/**
 * Highstock JS v12.6.0 (2026-04-13)
 * @module highcharts/indicators/chaikin
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Wojciech Chmiel
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */import*as e from"../highcharts.js";var t={};t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let r=e.default;var o=t.n(r);let a=e.default.SeriesRegistry;var n=t.n(a);let{doc:i,win:s}=o();function l(e,t){let r;for(r in e||(e={}),t)e[r]=t[r];return e}function u(e){return p(e)&&"number"==typeof e.nodeType}function p(e,t){let r;return!!e&&"object"==typeof e&&(!t||"[object Array]"!==(r=Object.prototype.toString.call(e))&&"[object Array Iterator]"!==r)}function c(e,...t){let r,o=[e,...t],a={},n=function(e,t){return"object"!=typeof e&&(e={}),function(e,t,r){for(let r in e)Object.hasOwnProperty.call(e,r)&&t.call((0,e[r]),e[r],r,e)}(t,function(r,o){if("__proto__"!==o&&"constructor"!==o){let a;!p(r,!0)||(a=r?.constructor,p(r,!0)&&!u(r)&&a?.name&&"Object"!==a.name)||u(r)?e[o]=t[o]:e[o]=n(e[o]||{},r)}}),e};!0===e&&(a=o[1],o=Array.prototype.slice.call(o,2));let i=o.length;for(r=0;r<i;r++)a=n(a,o[r]);return a}Array.prototype.find;let{sma:d}=n().seriesTypes;class f extends d{static populateAverage(e,t,r,o,a){let n=t[o][1],i=t[o][2],s=t[o][3],l=r[o],u=s===n&&s===i||n===i?0:(2*s-i-n)/(n-i)*l;return[e[o],u]}getValues(e,t){let o,a,n,i=t.period,s=e.xData,l=e.yData,u=t.volumeSeriesID,p=e.chart.get(u),c=p?.getColumn("y"),d=l?l.length:0,h=[],y=[],m=[];if(!(s.length<=i)||!d||4===l[0].length){if(!p)return void(0,r.error)("Series "+u+" not found! Check `volumeSeriesID`.",!0,e.chart);for(a=i;a<d;a++)o=h.length,n=f.populateAverage(s,l,c,a,i),o>0&&(n[1]+=h[o-1][1]),h.push(n),y.push(n[0]),m.push(n[1]);return{values:h,xData:y,yData:m}}}}f.defaultOptions=c(d.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume"}}),l(f.prototype,{nameComponents:!1,nameBase:"Accumulation/Distribution"}),n().registerSeriesType("ad",f);let{ema:h}=n().seriesTypes;class y extends h{getValues(e,t){let o,a,n=t.periods,i=t.period,s=[],l=[],u=[];if(2!==n.length||n[1]<=n[0])return void(0,r.error)('Error: "Chaikin requires two periods. Notice, first period should be lower than the second one."');let p=f.prototype.getValues.call(this,e,{volumeSeriesID:t.volumeSeriesID,period:i});if(!p)return;let c=super.getValues.call(this,p,{period:n[0]}),d=super.getValues.call(this,p,{period:n[1]});if(!c||!d)return;let h=n[1]-n[0];for(a=0;a<d.yData.length;a++){var y;o=(y=c.yData[a+h]-d.yData[a])>1e14?y:parseFloat(y.toPrecision(14)),s.push([d.xData[a],o]),l.push(d.xData[a]),u.push(o)}return{values:s,xData:l,yData:u}}}y.defaultOptions=c(h.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume",period:9,periods:[3,10]}}),l(y.prototype,{nameBase:"Chaikin Osc",nameComponents:["periods"]}),n().registerSeriesType("chaikin",y);let m=o();export{m as default};