!/**
 * Highstock JS v12.6.0 (2026-04-13)
 * @module highcharts/modules/datagrouping
 * @requires highcharts
 *
 * Data grouping module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Templating):"function"==typeof define&&define.amd?define("highcharts/modules/datagrouping",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.Templating)}):"object"==typeof exports?exports["highcharts/modules/datagrouping"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Templating):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Templating)}("u"<typeof window?this:window,(t,e,o)=>(()=>{"use strict";let i;var n,r={512:t=>{t.exports=e},944:e=>{e.exports=t},984:t=>{t.exports=o}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var o=a[t]={exports:{}};return r[t](o,o.exports,s),o.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var l={};s.d(l,{default:()=>ti});var u=s(944),h=s.n(u);let p={},{doc:c,win:d}=h();function f(t,e,o,i={}){let n="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(n,"hcEvents")||(n.hcEvents={});let r=n.hcEvents;h().Point&&t instanceof h().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let a=t.addEventListener;a&&a.call(t,e,o,!!h().supportsPassiveEvents&&{passive:void 0===i.passive?-1!==e.indexOf("touch"):i.passive,capture:!1}),r[e]||(r[e]=[]);let s={fn:o,order:"number"==typeof i.order?i.order:1/0};return r[e].push(s),r[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,o){function i(e,o){let i=t.removeEventListener;i&&i.call(t,e,o,!1)}function n(o){let n,r;t.nodeName&&(e?(n={})[e]=!0:n=o,T(n,function(t,e){if(o[e])for(r=o[e].length;r--;)i(e,o[e][r].fn)}))}let r="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(r,"hcEvents")){let t=r.hcEvents;if(e){let r=t[e]||[];o?(t[e]=r.filter(function(t){return o!==t.fn}),i(e,o)):(n(t),t[e]=[])}else n(t),delete r.hcEvents}}(t,e,o)}}function g(t,e){return t>1e14?t:parseFloat(t.toPrecision(e||14))}function m(t){return null!=t}function y(t,e){let o;for(o in t||(t={}),e)t[o]=e[o];return t}function x(t,e,o,i){if(o=o||{},c?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==h())){let i=c.createEvent("Events");i.initEvent(e,!0,!0),o=y(i,o),t.dispatchEvent?t.dispatchEvent(o):t.fireEvent(e,o)}else if(t.hcEvents){o.target||y(o,{preventDefault:function(){o.defaultPrevented=!0},target:t,type:e});let i=[],n=t,r=!1;for(;n.hcEvents;)Object.hasOwnProperty.call(n,"hcEvents")&&n.hcEvents[e]&&(i.length&&(r=!0),i.unshift.apply(i,n.hcEvents[e])),n=Object.getPrototypeOf(n);r&&i.sort((t,e)=>t.order-e.order),i.forEach(e=>{!1===e.fn.call(t,o,t)&&o.preventDefault()})}i&&!o.defaultPrevented&&i.call(t,o)}function v(t){return Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function b(t){return P(t)&&"number"==typeof t.nodeType}function M(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function G(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function P(t,e){return!!t&&"object"==typeof t&&(!e||!G(t))}function A(t,...e){let o,i=[t,...e],n={},r=function(t,e){return"object"!=typeof t&&(t={}),T(e,function(o,i){if("__proto__"!==i&&"constructor"!==i){let n;!P(o,!0)||(n=o?.constructor,P(o,!0)&&!b(o)&&n?.name&&"Object"!==n.name)||b(o)?t[i]=e[i]:t[i]=r(t[i]||{},o)}}),t};!0===t&&(n=i[1],i=Array.prototype.slice.call(i,2));let a=i.length;for(o=0;o<a;o++)n=r(n,i[o]);return n}function T(t,e,o){for(let i in t)Object.hasOwnProperty.call(t,i)&&e.call(o||t[i],t[i],i,t)}function w(){let t=arguments,e=t.length;for(let o=0;o<e;o++){let e=t[o];if(null!=e)return e}}function D(t){let e=t.length,o=C(t);return M(o)&&e&&(o=g(o/e)),o}function C(t){let e=t.length,o;if(!e&&t.hasNulls)o=null;else if(e)for(o=0;e--;)o+=t[e];return o}Array.prototype.find;let S={average:D,averages:function(){let t=[];return[].forEach.call(arguments,function(e){t.push(D(e))}),void 0===t[0]?void 0:t},close:function(t){return t.length?t[t.length-1]:t.hasNulls?null:void 0},high:function(t){return t.length?function(t){let e=t.length,o=t[0];for(;e--;)t[e]>o&&(o=t[e]);return o}(t):t.hasNulls?null:void 0},hlc:function(t,e,o){if(t=p.high(t),e=p.low(e),o=p.close(o),M(t)||M(e)||M(o))return[t,e,o]},low:function(t){return t.length?function(t){let e=t.length,o=t[0];for(;e--;)t[e]<o&&(o=t[e]);return o}(t):t.hasNulls?null:void 0},ohlc:function(t,e,o,i){if(t=p.open(t),e=p.high(e),o=p.low(o),i=p.close(i),M(t)||M(e)||M(o)||M(i))return[t,e,o,i]},open:function(t){return t.length?t[0]:t.hasNulls?null:void 0},range:function(t,e){return(t=p.low(t),e=p.high(e),M(t)||M(e))?[t,e]:null===t&&null===e?null:void 0},sum:C};y(p,S);let E={groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%[AebHMSL]","%[AebHMSL]","-%[HMSL]"],second:["%[AebHMS]","%[AebHMS]","-%[HMS]"],minute:["%[AebHM]","%[AebHM]","-%[HM]"],hour:["%[AebHM]","%[AebHM]","-%[HM]"],day:["%[AebY]","%[Aeb]","-%[AebY]"],week:["%v %[AebY]","%[Aeb]","-%[AebY]"],month:["%[BY]","%[B]","-%[BY]"],year:["%Y","%Y","-%Y"]}},O={line:{},spline:{},area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10},candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5},hlc:{groupPixelWidth:5},heikinashi:{groupPixelWidth:10}},k=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]];function H(t){let e=this,o=e.series;o.forEach(function(t){t.groupPixelWidth=void 0}),o.forEach(function(o){o.groupPixelWidth=e.getGroupPixelWidth&&e.getGroupPixelWidth(),o.groupPixelWidth&&(o.hasProcessed=!0),o.applyGrouping(!!t.hasExtremesChanged)})}function R(){let t=this.series,e=t.length,o=0,i=!1,n,r;for(;e--;)(r=t[e].options.dataGrouping)&&(o=Math.max(o,w(r.groupPixelWidth,E.groupPixelWidth)),n=(t[e].dataTable.getModified()||t[e].dataTable).rowCount,(t[e].groupPixelWidth||n>this.chart.plotSizeX/o||n&&r.forced)&&(i=!0));return i?o:0}function j(){this.series.forEach(function(t){t.hasProcessed=!1})}function F(t,e){let o;if(e=w(e,!0),t||(t={forced:!1,units:null}),this instanceof i)for(o=this.series.length;o--;)this.series[o].update({dataGrouping:t},!1);else this.chart.options.series.forEach(function(e){e.dataGrouping="boolean"==typeof t?t:A(t,e.dataGrouping)});this.ordinal&&(this.ordinal.slope=void 0),e&&this.chart.redraw()}let N=function(t){i=t;let e=t.prototype;e.applyGrouping||(f(t,"afterSetScale",j),f(t,"postProcessData",H),y(e,{applyGrouping:H,getGroupPixelWidth:R,setDataGrouping:F}))},{setLength:W,splice:L}={convertToNumber:function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat(`${t??""}`))&&!e?null:t}},setLength:function(t,e,o){return Array.isArray(t)?(t.length=e,t):t[o?"subarray":"slice"](0,e)},splice:function(t,e,o,i,n=[]){if(Array.isArray(t))return Array.isArray(n)||(n=Array.from(n)),{removed:t.splice(e,o,...n),array:t};let r=Object.getPrototypeOf(t).constructor,a=t[i?"subarray":"slice"](e,e+o),s=new r(t.length-o+n.length);return s.set(t.subarray(0,e),0),s.set(n,e),s.set(t.subarray(e+o),e+n.length),{removed:a,array:s}}},_=class{constructor(t={}){this.autoId=!t.id,this.columns={},this.id=t.id||(0,u.uniqueKey)(),this.rowCount=0,this.versionTag=(0,u.uniqueKey)();let e=0;T(t.columns||{},(t,o)=>{this.columns[o]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,T(this.columns,(e,o)=>{e.length!==t&&(this.columns[o]=W(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let o=0;T(this.columns,(i,n)=>{this.columns[n]=L(i,t,e).array,o=i.length}),this.rowCount=o}x(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=(0,u.uniqueKey)()}getColumn(t,e){return this.columns[t]}getColumns(t,e){return(t||Object.keys(this.columns)).reduce((t,e)=>(t[e]=this.columns[e],t),{})}getRow(t,e){return(e||Object.keys(this.columns)).map(e=>this.columns[e]?.[t])}setColumn(t,e=[],o=0,i){this.setColumns({[t]:e},o,i)}setColumns(t,e,o){let i=this.rowCount;T(t,(t,e)=>{this.columns[e]=t.slice(),i=t.length}),this.applyRowCount(i),o?.silent||(x(this,"afterSetColumns"),this.versionTag=(0,u.uniqueKey)())}setRow(t,e=this.rowCount,o,i){let{columns:n}=this,r=o?this.rowCount+1:e+1,a=Object.keys(t);if(i?.addColumns!==!1)for(let t=0,e=a.length;t<e;t++){let e=a[t];n[e]||(n[e]=[])}T(n,(a,s)=>{a||i?.addColumns===!1||(a=Array(r)),a&&(o?a=L(a,e,0,!0,[t[s]??null]).array:a[e]=t[s]??null,n[s]=a)}),r>this.rowCount&&this.applyRowCount(r),i?.silent||(x(this,"afterSetRows"),this.versionTag=(0,u.uniqueKey)())}getModified(){return this.modified||this}};!function(t){function e(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)}function o(){if("datetime"!==this.type){this.dateTime=void 0;return}this.dateTime||(this.dateTime=new i(this))}t.compose=function(t){return t.keepProps.includes("dateTime")||(t.keepProps.push("dateTime"),t.prototype.getTimeTicks=e,f(t,"afterSetType",o)),t};class i{constructor(t){this.axis=t}normalizeTimeTickInterval(t,e){let o=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],i=o[o.length-1],n=u.timeUnits[i[0]],r=i[1],a,s;for(a=0;a<o.length;a++)if(i=o[a],n=u.timeUnits[i[0]],r=i[1],o[a+1]){let e=(n*r[r.length-1]+u.timeUnits[o[a+1][0]])/2;if(t<=e){s=e/t;break}}n===u.timeUnits.year&&t<5*n&&(r=[1,2,5]);let l=function(t,e,o,i,n){let r,a=t;o=w(o,v(t));let s=t/o;for(e||(e=[1,2,2.5,5,10]),r=0;r<e.length&&(a=e[r],!(s<=(e[r]+(e[r+1]||e[r]))/2));r++);return g(a*o,-Math.round(Math.log(.001)/Math.LN10))}(t/n,r,"year"===i[0]?Math.max(v(t/n),1):1);return{unitRange:n,count:l,unitName:i[0],match:s}}getXDateFormat(t,e){let{axis:o}=this,i=o.chart.time;return o.closestPointRange?i.getDateFormat(o.closestPointRange,t,o.options.startOfWeek,e)||i.resolveDTLFormat(e.year).main:i.resolveDTLFormat(e.day).main}}t.Additions=i}(n||(n={}));let I=n;var Y=s(512);let{series:{prototype:q}}=s.n(Y)(),z=q.generatePoints;function K(t){var e,o,i;let n,r,a=this.chart,s=this.options.dataGrouping,l=!1!==this.allowDG&&s&&w(s.enabled,a.options.isStock),h=this.reserveSpace(),p=this.currentDataGrouping,c,d,f=!1;l&&!this.requireSorting&&(this.requireSorting=f=!0);let g=!1==(e=this,o=t,!(e.isCartesian&&!e.isDirty&&!e.xAxis.isDirty&&!e.yAxis.isDirty&&!o))||!l;if(f&&(this.requireSorting=!1),g)return;this.destroyGroupedData();let y=s.groupAll?this.dataTable:this.dataTable.getModified()||this.dataTable,x=this.getColumn("x",!s.groupAll),v=a.plotSizeX,b=this.xAxis,G=b.getExtremes(),P=b.options.ordinal,A=this.groupPixelWidth;if(A&&x&&y.rowCount&&v&&M(G.min)){r=!0,this.isDirty=!0,this.points=null;let t=G.min,e=G.max,o=P&&b.ordinal&&b.ordinal.getGroupIntervalFactor(t,e,this)||1,l=A*(e-t)/v*o,p=b.getTimeTicks(I.Additions.prototype.normalizeTimeTickInterval(l,s.units||k),Math.min(t,x[0]),Math.max(e,x[x.length-1]),b.options.startOfWeek,x,this.closestPointRange),f=q.groupData.apply(this,[y,p,s.approximation]),g=f.modified,T=g.getColumn("x",!0),w=0;for(s?.smoothed&&g.rowCount&&(s.firstAnchor="firstPoint",s.anchor="middle",s.lastAnchor="lastPoint",(0,u.error)(32,!1,a,{"dataGrouping.smoothed":"use dataGrouping.anchor"})),n=1;n<p.length;n++)p.info.segmentStarts&&-1!==p.info.segmentStarts.indexOf(n)||(w=Math.max(p[n]-p[n-1],w));(c=p.info).gapSize=w,this.closestPointRange=p.info.totalRange,this.groupMap=f.groupMap,this.currentDataGrouping=c,function(t,e,o){let i=t.options.dataGrouping,n=t.currentDataGrouping&&t.currentDataGrouping.gapSize,r=t.getColumn("x");if(!(i&&r.length&&n&&t.groupMap))return;let a=e.length-1,s=i.anchor,l=i.firstAnchor,u=i.lastAnchor,h=e.length-1,p=0;if(l&&r[0]>=e[0]){let o;p++;let i=t.groupMap[0].start,a=t.groupMap[0].length;M(i)&&M(a)&&(o=i+(a-1)),e[0]=({start:e[0],middle:e[0]+.5*n,end:e[0]+n,firstPoint:r[0],lastPoint:o&&r[o]})[l]}if(a>0&&u&&n&&e[a]>=o-n){h--;let o=t.groupMap[t.groupMap.length-1].start;e[a]=({start:e[a],middle:e[a]+.5*n,end:e[a]+n,firstPoint:o&&r[o],lastPoint:r[r.length-1]})[u]}if(s&&"start"!==s){let t=n*({middle:.5,end:1})[s];for(;h>=p;)e[h]+=t,h--}}(this,T||[],e),h&&T&&(m((i=T)[0])&&M(b.min)&&M(b.dataMin)&&i[0]<b.min&&((!m(b.options.min)&&b.min<=b.dataMin||b.min===b.dataMin)&&(b.min=Math.min(i[0],b.min)),b.dataMin=Math.min(i[0],b.dataMin)),m(i[i.length-1])&&M(b.max)&&M(b.dataMax)&&i[i.length-1]>b.max&&((!m(b.options.max)&&M(b.dataMax)&&b.max>=b.dataMax||b.max===b.dataMax)&&(b.max=Math.max(i[i.length-1],b.max)),b.dataMax=Math.max(i[i.length-1],b.dataMax))),s.groupAll&&(this.allGroupedTable=g,T=(g=(d=this.cropData(g,b.min||0,b.max||0)).modified).getColumn("x"),this.cropStart=d.start),this.dataTable.modified=g}else this.groupMap=void 0,this.currentDataGrouping=void 0;this.hasGroupedData=r,this.preventGraphAnimation=(p&&p.totalRange)!==(c&&c.totalRange)}function U(){this.groupedData&&(this.groupedData.forEach(function(t,e){t&&(this.groupedData[e]=t.destroy?t.destroy():null)},this),this.groupedData.length=0,delete this.allGroupedTable)}function X(){z.apply(this),this.destroyGroupedData(),this.groupedData=this.hasGroupedData?this.points:null}function B(){return this.is("arearange")?"range":this.is("ohlc")?"ohlc":this.is("hlc")?"hlc":this.is("column")||this.options.cumulative?"sum":"average"}function $(t,e,o){let i=t.getColumn("x",!0)||[],n=t.getColumn("y",!0),r=this,a=r.data,s=r.options&&r.options.data,l=[],u=new _,h=[],c=t.rowCount,d=!!n,f=[],g=r.pointArrayMap,y=g&&g.length,x=["x"].concat(g||["y"]),v=(g||["y"]).map(()=>[]),b=this.options.dataGrouping&&this.options.dataGrouping.groupAll,P,T,w,D=0,C=0,S="function"==typeof o?o:o&&p[o]?p[o]:p[r.getDGApproximation&&r.getDGApproximation()||"average"];if(y){let t=g.length;for(;t--;)f.push([])}else f.push([]);let E=y||1;for(let t=0;t<=c;t++)if(!(i[t]<e[0])){for(;void 0!==e[D+1]&&i[t]>=e[D+1]||t===c;){if(P=e[D],r.dataGroupInfo={start:b?C:r.cropStart+C,length:f[0].length,groupStart:P},w=S.apply(r,f),r.pointClass&&!m(r.dataGroupInfo.options)&&(r.dataGroupInfo.options=A(r.pointClass.prototype.optionsToObject.call({series:r},r.options.data[r.cropStart+C])),x.forEach(function(t){delete r.dataGroupInfo.options[t]})),void 0!==w){l.push(P);let t=G(w)?w:[w];for(let e=0;e<t.length;e++)v[e].push(t[e]);h.push(r.dataGroupInfo)}C=t;for(let t=0;t<E;t++)f[t].length=0,f[t].hasNulls=!1;if(D+=1,t===c)break}if(t===c)break;if(g){let e,o=b?t:r.cropStart+t,i=a&&a[o]||r.pointClass.prototype.applyOptions.apply({series:r},[s[o]]);for(let t=0;t<y;t++)M(e=i[g[t]])?f[t].push(e):null===e&&(f[t].hasNulls=!0)}else M(T=d?n[t]:null)?f[0].push(T):null===T&&(f[0].hasNulls=!0)}let O={x:l};return(g||["y"]).forEach((t,e)=>{O[t]=v[e]}),u.setColumns(O),{groupMap:h,modified:u}}function J(t){let e=t.options,o=this.type,i=this.chart.options.plotOptions,n=this.useCommonDataGrouping&&E,r=h().defaultOptions.plotOptions[o].dataGrouping;if(i&&(O[o]||n)){let t=this.chart.rangeSelector;r||(r=A(E,O[o])),e.dataGrouping=A(n,r,i.series&&i.series.dataGrouping,i[o].dataGrouping,this.userOptions.dataGrouping,!e.isInternal&&t&&M(t.selected)&&t.buttonOptions[t.selected].dataGrouping)}}let Q=function(t){let e=t.prototype;e.applyGrouping||(f(t.prototype.pointClass,"update",function(){if(this.dataGroup)return(0,u.error)(24,!1,this.series.chart),!1}),f(t,"afterSetOptions",J),f(t,"destroy",U),y(e,{applyGrouping:K,destroyGroupedData:U,generatePoints:X,getDGApproximation:B,groupData:$}))};var V=s(984);let{format:Z}=s.n(V)(),{composed:tt}=h();function te(t){let e=this.chart,o=e.time,i=t.point,n=i.series,r=n.options,a=n.tooltipOptions,s=r.dataGrouping,l=n.xAxis,u=a.xDateFormat||"",h,p,c,d,f,g=a[t.isFooter?"footerFormat":"headerFormat"];if(l&&"datetime"===l.options.type&&s&&M(i.key)){p=n.currentDataGrouping,c=s.dateTimeLabelFormats||E.dateTimeLabelFormats,p?(d=c[p.unitName],1===p.count?u=d[0]:(u=d[1],h=d[2])):!u&&c&&l.dateTime&&(u=l.dateTime.getXDateFormat(i.x,a.dateTimeLabelFormats));let r=w(n.groupMap?.[i.index].groupStart,i.key),m=r+(p?.totalRange||0)-1;f=o.dateFormat(u,r),h&&(f+=o.dateFormat(h,m)),n.chart.styledMode&&(g=this.styledModeFormat(g)),t.text=Z(g,{point:y(i,{key:f}),series:n},e),t.preventDefault()}}let to=h();to.dataGrouping=to.dataGrouping||{},to.dataGrouping.approximationDefaults=to.dataGrouping.approximationDefaults||S,to.dataGrouping.approximations=to.dataGrouping.approximations||p,({compose:function(t,e,o){var i;N(t),Q(e),o&&(i="DataGrouping",0>tt.indexOf(i)&&tt.push(i))&&f(o,"headerFormatter",te)},groupData:$}).compose(to.Axis,to.Series,to.Tooltip);let ti=h();return l.default})());