/**
 * Highstock JS v13.0.0 (2026-06-11)
 * @module highcharts/indicators/aroon
 * @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,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 o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let o=e.default;var r=a.n(o);let n=e.default.SeriesRegistry;var i=a.n(n);let{sma:{prototype:s}}=i().seriesTypes;!function(e){let t=["bottomLine"],a=["top","bottom"],r=["top"];function n(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function i(e,t){let a=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&a.push(n(e))}),a}function p(){let e=this,t=e.pointValKey,a=e.linesApiNames,r=e.areaLinesNames,p=e.points,l=e.options,h=e.graph,c={options:{gapSize:l.gapSize}},u=[],f=i(e,t),d=p.length,m;if(f.forEach((e,t)=>{for(u[t]=[];d--;)m=p[d],u[t].push({x:m.x,plotX:m.plotX,plotY:m[e],isNull:!(0,o.defined)(m[e])});d=p.length}),e.userOptions.fillColor&&r.length){let t=u[f.indexOf(n(r[0]))],a=1===r.length?p:u[f.indexOf(n(r[1]))],i=e.color;e.points=a,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=(0,o.merge)(p,c),e.graph=e.area,e.fillGraph=!0,s.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=i}a.forEach((t,a)=>{u[a]?(e.points=u[a],l[t]?e.options=(0,o.merge)(l[t].styles,c):(0,o.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],s.drawGraph.call(e),e["graph"+t]=e.graph):(0,o.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=p,e.options=l,e.graph=h,s.drawGraph.call(e)}function l(e){let t,a=[],o=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=s.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",a=s.getGraphPath.call(this,e),o=t.slice(0,a.length);for(let e=o.length-1;e>=0;e--)a.push(o[e])}}else a=s.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=i(this),s.translate.apply(this,arguments),this.points.forEach(o=>{e.forEach((e,r)=>{a=o[e],this.dataModify&&(a=this.dataModify.modifyValue(a)),null!==a&&(o[t[r]]=this.yAxis.toPixels(a,!0))})})}e.compose=function(e){let o=e.prototype;return o.linesApiNames=o.linesApiNames||t.slice(),o.pointArrayMap=o.pointArrayMap||a.slice(),o.pointValKey=o.pointValKey||"top",o.areaLinesNames=o.areaLinesNames||r.slice(),o.drawGraph=p,o.getGraphPath=l,o.toYData=h,o.translate=c,e}}(t||(t={}));let p=t,{sma:l}=i().seriesTypes;function h(e,t){let a=e[0],o=0,r;for(r=1;r<e.length;r++)("max"===t&&e[r]>=a||"min"===t&&e[r]<=a)&&(a=e[r],o=r);return o}class c extends l{getValues(e,t){let a,r,n,i,s,p=t.period,l=e.xData,c=e.yData,u=c?c.length:0,f=[],d=[],m=[];for(i=p-1;i<u;i++)n=h((s=c.slice(i-p+1,i+2)).map(function(e){return(0,o.pick)(e[2],e)}),"min"),a=h(s.map(function(e){return(0,o.pick)(e[1],e)}),"max")/p*100,r=n/p*100,l[i+1]&&(f.push([l[i+1],a,r]),d.push(l[i+1]),m.push([a,r]));return{values:f,xData:d,yData:m}}}c.defaultOptions=(0,o.merge)(l.defaultOptions,{params:{index:void 0,period:25},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Aroon Up: {point.y}<br/>Aroon Down: {point.aroonDown}<br/>'},aroonDown:{styles:{lineWidth:1,lineColor:void 0}},dataGrouping:{approximation:"averages"}}),(0,o.extend)(c.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),p.compose(c),i().registerSeriesType("aroon",c);let u=r();export{u as default};