/**
 * Highstock JS v13.0.0 (2026-06-11)
 * @module highcharts/indicators/acceleration-bands
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Daniel Studencki
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as e from"../highcharts.js";var t,a={};a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let r=e.default;var i=a.n(r);let o=e.default.SeriesRegistry;var s=a.n(o);let{sma:{prototype:n}}=s().seriesTypes;!function(e){let t=["bottomLine"],a=["top","bottom"],i=["top"];function o(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function s(e,t){let a=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&a.push(o(e))}),a}function l(){let e=this,t=e.pointValKey,a=e.linesApiNames,i=e.areaLinesNames,l=e.points,p=e.options,h=e.graph,c={options:{gapSize:p.gapSize}},d=[],u=s(e,t),f=l.length,y;if(u.forEach((e,t)=>{for(d[t]=[];f--;)y=l[f],d[t].push({x:y.x,plotX:y.plotX,plotY:y[e],isNull:!(0,r.defined)(y[e])});f=l.length}),e.userOptions.fillColor&&i.length){let t=d[u.indexOf(o(i[0]))],a=1===i.length?l:d[u.indexOf(o(i[1]))],s=e.color;e.points=a,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=(0,r.merge)(l,c),e.graph=e.area,e.fillGraph=!0,n.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=s}a.forEach((t,a)=>{d[a]?(e.points=d[a],p[t]?e.options=(0,r.merge)(p[t].styles,c):(0,r.error)('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],n.drawGraph.call(e),e["graph"+t]=e.graph):(0,r.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=l,e.options=p,e.graph=h,n.drawGraph.call(e)}function p(e){let t,a=[],r=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=n.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",a=n.getGraphPath.call(this,e),r=t.slice(0,a.length);for(let e=r.length-1;e>=0;e--)a.push(r[e])}}else a=n.getGraphPath.apply(this,arguments);return a}function h(e){let t=[];return(this.pointArrayMap||[]).forEach(a=>{t.push(e[a])}),t}function c(){let e=this.pointArrayMap,t=[],a;t=s(this),n.translate.apply(this,arguments),this.points.forEach(r=>{e.forEach((e,i)=>{a=r[e],this.dataModify&&(a=this.dataModify.modifyValue(a)),null!==a&&(r[t[i]]=this.yAxis.toPixels(a,!0))})})}e.compose=function(e){let r=e.prototype;return r.linesApiNames=r.linesApiNames||t.slice(),r.pointArrayMap=r.pointArrayMap||a.slice(),r.pointValKey=r.pointValKey||"top",r.areaLinesNames=r.areaLinesNames||i.slice(),r.drawGraph=l,r.getGraphPath=p,r.toYData=h,r.translate=c,e}}(t||(t={}));let l=t,{sma:p}=s().seriesTypes;class h extends p{getValues(e,t){let a,i,o,s,n,l,p,h,c,d,u,f=t.period,y=t.factor,m=t.index,g=e.xData,x=e.yData,A=x?x.length:0,D=[],G=[],b=[],v=[],M=[];if(!(A<f)){for(u=0;u<=A;u++){if(u<A){var N,O,P,L;N=x[u][2],O=x[u][1],n=(0,r.correctFloat)(O-N)/((0,r.correctFloat)(O+N)/2)*1e3*y,D.push((P=x[u][1],P*(0,r.correctFloat)(1+2*n))),G.push((L=x[u][2],L*(0,r.correctFloat)(1-2*n)))}u>=f&&(c=g.slice(u-f,u),d=x.slice(u-f,u),p=super.getValues.call(this,{xData:c,yData:D.slice(u-f,u)},{period:f}),h=super.getValues.call(this,{xData:c,yData:G.slice(u-f,u)},{period:f}),s=(l=super.getValues.call(this,{xData:c,yData:d},{period:f,index:m})).xData[0],i=p.yData[0],o=h.yData[0],a=l.yData[0],b.push([s,i,a,o]),v.push(s),M.push([i,a,o]))}return{values:b,xData:v,yData:M}}}}h.defaultOptions=(0,r.merge)(p.defaultOptions,{params:{period:20,factor:.001,index:3},lineWidth:1,topLine:{styles:{lineWidth:1}},bottomLine:{styles:{lineWidth:1}},dataGrouping:{approximation:"averages"}}),(0,r.extend)(h.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameBase:"Acceleration Bands",nameComponents:["period","factor"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),l.compose(h),s().registerSeriesType("abands",h);let c=i();export{c as default};