!/**
 * Highstock JS v13.0.0 (2026-06-11)
 * @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,i)=>(()=>{"use strict";let o;var r,a={512:t=>{t.exports=e},944:e=>{e.exports=t},984:t=>{t.exports=i}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return a[t](i,i.exports,s),i.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 i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var l={};s.d(l,{default:()=>Y});var u=s(944),h=s.n(u);let p={};function d(t){let e=t.length,i=c(t);return(0,u.isNumber)(i)&&e&&(i=(0,u.correctFloat)(i/e)),i}function c(t){let e=t.length,i;if(!e&&t.hasNulls)i=null;else if(e)for(i=0;e--;)i+=t[e];return i}let g={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?(0,u.arrayMax)(t):t.hasNulls?null:void 0},hlc:function(t,e,i){if(t=p.high(t),e=p.low(e),i=p.close(i),(0,u.isNumber)(t)||(0,u.isNumber)(e)||(0,u.isNumber)(i))return[t,e,i]},low:function(t){return t.length?(0,u.arrayMin)(t):t.hasNulls?null:void 0},ohlc:function(t,e,i,o){if(t=p.open(t),e=p.high(e),i=p.low(i),o=p.close(o),(0,u.isNumber)(t)||(0,u.isNumber)(e)||(0,u.isNumber)(i)||(0,u.isNumber)(o))return[t,e,i,o]},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),(0,u.isNumber)(t)||(0,u.isNumber)(e))?[t,e]:null===t&&null===e?null:void 0},sum:c};(0,u.extend)(p,g);let m={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]"]}},f={line:{},spline:{},area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10},candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5},hlc:{groupPixelWidth:5},heikinashi:{groupPixelWidth:10}},y=[["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 x(t){let e=this,i=e.series;i.forEach(function(t){t.groupPixelWidth=void 0}),i.forEach(function(i){i.groupPixelWidth=e.getGroupPixelWidth&&e.getGroupPixelWidth(),i.groupPixelWidth&&(i.hasProcessed=!0),i.applyGrouping(!!t.hasExtremesChanged)})}function b(){let t=this.series,e=t.length,i=0,o=!1,r,a;for(;e--;)(a=t[e].options.dataGrouping)&&(i=Math.max(i,(0,u.pick)(a.groupPixelWidth,m.groupPixelWidth)),r=(t[e].dataTable.getModified()||t[e].dataTable).rowCount,(t[e].groupPixelWidth||r>this.chart.plotSizeX/i||r&&a.forced)&&(o=!0));return o?i:0}function v(){this.series.forEach(function(t){t.hasProcessed=!1})}function G(t,e){let i;if(e=(0,u.pick)(e,!0),t||(t={forced:!1,units:null}),this instanceof o)for(i=this.series.length;i--;)this.series[i].update({dataGrouping:t},!1);else this.chart.options.series.forEach(function(e){e.dataGrouping="boolean"==typeof t?t:(0,u.merge)(t,e.dataGrouping)});this.ordinal&&(this.ordinal.slope=void 0),e&&this.chart.redraw()}let M=function(t){o=t;let e=t.prototype;e.applyGrouping||((0,u.addEvent)(t,"afterSetScale",v),(0,u.addEvent)(t,"postProcessData",x),(0,u.extend)(e,{applyGrouping:x,getGroupPixelWidth:b,setDataGrouping:G}))},{setLength:T,splice:w}={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,i){return Array.isArray(t)?(t.length=e,t):t[i?"subarray":"slice"](0,e)},splice:function(t,e,i,o,r=[]){if(Array.isArray(t))return Array.isArray(r)||(r=Array.from(r)),{removed:t.splice(e,i,...r),array:t};let a=Object.getPrototypeOf(t).constructor,n=t[o?"subarray":"slice"](e,e+i),s=new a(t.length-i+r.length);return s.set(t.subarray(0,e),0),s.set(r,e),s.set(t.subarray(e+i),e+r.length),{removed:n,array:s}}},A=class{constructor(t={}){this.isDataTable=!0,this.autoId=!t.id,this.columns={},this.id=t.id||(0,u.uniqueKey)(),this.rowCount=0,this.versionTag=(0,u.uniqueKey)();let e=0;(0,u.objectEach)(t.columns||{},(t,i)=>{this.columns[i]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,(0,u.objectEach)(this.columns,(e,i)=>{e.length!==t&&(this.columns[i]=T(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let i=0;(0,u.objectEach)(this.columns,(o,r)=>{this.columns[r]=w(o,t,e).array,i=o.length}),this.rowCount=i}(0,u.fireEvent)(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),{})}getRowObject(t,e){let i={},o=this.columns;for(let r of(e??(e=Object.keys(this.columns)),e))i[r]=o[r]?.[t];return i}setColumn(t,e=[],i=0,o){this.setColumns({[t]:e},i,o)}setColumns(t,e,i){let o=this.rowCount;(0,u.objectEach)(t,(t,e)=>{this.columns[e]=t.slice(),o=t.length}),this.applyRowCount(o),i?.silent||((0,u.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,u.uniqueKey)())}setRow(t,e=this.rowCount,i,o){var r;let{columns:a}=this,n=i?this.rowCount+1:e+1,s=Object.keys(t);if(o?.addColumns!==!1)for(let t=0,e=s.length;t<e;t++)a[r=s[t]]||(a[r]=Array(this.rowCount));(0,u.objectEach)(a,(o,r)=>{o&&(i?o=w(o,e,0,!0,[t[r]]).array:o[e]=r in t?t[r]:o[e],a[r]=o)}),this.applyRowCount(Math.max(n,this.rowCount)),o?.silent||((0,u.fireEvent)(this,"afterSetRows",{rowIndex:e}),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 i(){if("datetime"!==this.type){this.dateTime=void 0;return}this.dateTime||(this.dateTime=new o(this))}t.compose=function(t){return t.keepProps.includes("dateTime")||(t.keepProps.push("dateTime"),t.prototype.getTimeTicks=e,(0,u.addEvent)(t,"afterSetType",i)),t};class o{constructor(t){this.axis=t}normalizeTimeTickInterval(t,e){let i=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]],o=i[i.length-1],r=u.timeUnits[o[0]],a=o[1],n,s;for(n=0;n<i.length;n++)if(o=i[n],r=u.timeUnits[o[0]],a=o[1],i[n+1]){let e=(r*a[a.length-1]+u.timeUnits[i[n+1][0]])/2;if(t<=e){s=e/t;break}}r===u.timeUnits.year&&t<5*r&&(a=[1,2,5]);let l=(0,u.normalizeTickInterval)(t/r,a,"year"===o[0]?Math.max((0,u.getMagnitude)(t/r),1):1);return{unitRange:r,count:l,unitName:o[0],match:s}}getXDateFormat(t,e){let{axis:i}=this,o=i.chart.time;return i.closestPointRange?o.getDateFormat(i.closestPointRange,t,i.options.startOfWeek,e)||o.resolveDTLFormat(e.year).main:o.resolveDTLFormat(e.day).main}}t.Additions=o}(r||(r={}));let C=r;var D=s(512);let{series:{prototype:N}}=s.n(D)(),P=N.generatePoints;function S(t){var e,i,o;let r,a,n=this.chart,s=this.options.dataGrouping,l=!1!==this.allowDG&&s&&(0,u.pick)(s.enabled,n.options.isStock),h=this.reserveSpace(),p=this.currentDataGrouping,d,c,g=!1;l&&!this.requireSorting&&(this.requireSorting=g=!0);let m=!1==(e=this,i=t,!(e.isCartesian&&!e.isDirty&&!e.xAxis.isDirty&&!e.yAxis.isDirty&&!i))||!l;if(g&&(this.requireSorting=!1),m)return;this.destroyGroupedData();let f=s.groupAll?this.dataTable:this.dataTable.getModified()||this.dataTable,x=this.getColumn("x",!s.groupAll),b=n.plotSizeX,v=this.xAxis,G=v.getExtremes(),M=v.options.ordinal,T=this.groupPixelWidth;if(T&&x&&f.rowCount&&b&&(0,u.isNumber)(G.min)){a=!0,this.isDirty=!0,this.points=null;let t=G.min,e=G.max,i=M&&v.ordinal&&v.ordinal.getGroupIntervalFactor(t,e,this)||1,l=T*(e-t)/b*i,p=v.getTimeTicks(C.Additions.prototype.normalizeTimeTickInterval(l,s.units||y),Math.min(t,x[0]),Math.max(e,x[x.length-1]),v.options.startOfWeek,x,this.closestPointRange),g=N.groupData.apply(this,[f,p,s.approximation]),m=g.modified,w=m.getColumn("x",!0),A=0;for(s?.smoothed&&m.rowCount&&(s.firstAnchor="firstPoint",s.anchor="middle",s.lastAnchor="lastPoint",(0,u.error)(32,!1,n,{"dataGrouping.smoothed":"use dataGrouping.anchor"})),r=1;r<p.length;r++)p.info.segmentStarts&&-1!==p.info.segmentStarts.indexOf(r)||(A=Math.max(p[r]-p[r-1],A));(d=p.info).gapSize=A,this.closestPointRange=p.info.totalRange,this.groupMap=g.groupMap,this.currentDataGrouping=d,function(t,e,i){let o=t.options.dataGrouping,r=t.currentDataGrouping&&t.currentDataGrouping.gapSize,a=t.getColumn("x");if(!(o&&a.length&&r&&t.groupMap))return;let n=e.length-1,s=o.anchor,l=o.firstAnchor,h=o.lastAnchor,p=e.length-1,d=0;if(l&&a[0]>=e[0]){let i;d++;let o=t.groupMap[0].start,n=t.groupMap[0].length;(0,u.isNumber)(o)&&(0,u.isNumber)(n)&&(i=o+(n-1)),e[0]=({start:e[0],middle:e[0]+.5*r,end:e[0]+r,firstPoint:a[0],lastPoint:i&&a[i]})[l]}if(n>0&&h&&r&&e[n]>=i-r){p--;let i=t.groupMap[t.groupMap.length-1].start;e[n]=({start:e[n],middle:e[n]+.5*r,end:e[n]+r,firstPoint:i&&a[i],lastPoint:a[a.length-1]})[h]}if(s&&"start"!==s){let t=r*({middle:.5,end:1})[s];for(;p>=d;)e[p]+=t,p--}}(this,w||[],e),h&&w&&(o=w,(0,u.defined)(o[0])&&(0,u.isNumber)(v.min)&&(0,u.isNumber)(v.dataMin)&&o[0]<v.min&&((!(0,u.defined)(v.options.min)&&v.min<=v.dataMin||v.min===v.dataMin)&&(v.min=Math.min(o[0],v.min)),v.dataMin=Math.min(o[0],v.dataMin)),(0,u.defined)(o[o.length-1])&&(0,u.isNumber)(v.max)&&(0,u.isNumber)(v.dataMax)&&o[o.length-1]>v.max&&((!(0,u.defined)(v.options.max)&&(0,u.isNumber)(v.dataMax)&&v.max>=v.dataMax||v.max===v.dataMax)&&(v.max=Math.max(o[o.length-1],v.max)),v.dataMax=Math.max(o[o.length-1],v.dataMax))),s.groupAll&&(this.allGroupedTable=m,w=(m=(c=this.cropData(m,v.min||0,v.max||0)).modified).getColumn("x"),this.cropStart=c.start),this.dataTable.modified=m}else this.groupMap=void 0,this.currentDataGrouping=void 0;this.hasGroupedData=a,this.preventGraphAnimation=(p&&p.totalRange)!==(d&&d.totalRange)}function k(){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 E(){P.apply(this),this.destroyGroupedData(),this.groupedData=this.hasGroupedData?this.points:null}function R(){return this.is("arearange")?"range":this.is("ohlc")?"ohlc":this.is("hlc")?"hlc":this.is("column")||this.options.cumulative?"sum":"average"}function O(t,e,i){let o=t===this.dataTable?this.getColumn("x"):t.getColumn("x",!0),r=t.getColumn("y",!0),a=this,n=a.dataTable,s=a.cropStart||0,l=a.data,h=a.options?.data,d=[],c=new A,g=[],m=t.rowCount,f=!!r,y=[],x=a.pointArrayMap,b=x&&x.length,v=["x"].concat(x||["y"]),G=(x||["y"]).map(()=>[]),M=this.options.dataGrouping?.groupAll,T,w,C,D=0,N=0,P="function"==typeof i?i:i&&p[i]?p[i]:p[a.getDGApproximation&&a.getDGApproximation()||"average"];if(b){let t=x.length;for(;t--;)y.push([])}else y.push([]);let S=b||1;for(let t=0;t<=m;t++)if(!(o[t]<e[0])){for(;void 0!==e[D+1]&&o[t]>=e[D+1]||t===m;){if(T=e[D],a.dataGroupInfo={start:M?N:a.cropStart+N,length:y[0].length,groupStart:T},C=P.apply(a,y),a.pointClass&&!(0,u.defined)(a.dataGroupInfo.options)&&h&&(a.dataGroupInfo.options=(0,u.merge)(a.pointClass.prototype.optionsToObject.call({series:a},n.getRowObject(s+N))),v.forEach(function(t){delete a.dataGroupInfo.options[t]})),void 0!==C){d.push(T);let t=(0,u.splat)(C);for(let e=0;e<t.length;e++)G[e].push(t[e]);g.push(a.dataGroupInfo)}N=t;for(let t=0;t<S;t++)y[t].length=0,y[t].hasNulls=!1;if(D+=1,t===m)break}if(t===m)break;if(x){let e,i=M?t:a.cropStart+t,o=l&&l[i]||a.pointClass.prototype.applyOptions.apply({series:a},[n.getRowObject(i)]);for(let t=0;t<b;t++)e=o[x[t]],(0,u.isNumber)(e)?y[t].push(e):null===e&&(y[t].hasNulls=!0)}else w=f?r[t]:null,(0,u.isNumber)(w)?y[0].push(w):null===w&&(y[0].hasNulls=!0)}let k={x:d};return(x||["y"]).forEach((t,e)=>{k[t]=G[e]}),c.setColumns(k),{groupMap:g,modified:c}}function H(t){let e=t.options,i=this.type,o=this.chart.options.plotOptions,r=this.useCommonDataGrouping&&m,a=h().defaultOptions.plotOptions[i].dataGrouping;if(o&&(f[i]||r)){let t=this.chart.rangeSelector;a||(a=(0,u.merge)(m,f[i])),e.dataGrouping=(0,u.merge)(r,a,o.series&&o.series.dataGrouping,o[i].dataGrouping,this.userOptions.dataGrouping,!e.isInternal&&t&&(0,u.isNumber)(t.selected)&&t.buttonOptions[t.selected].dataGrouping)}}let F=function(t){let e=t.prototype;if(!e.applyGrouping){let i=t.prototype.pointClass;(0,u.addEvent)(i,"update",function(){if(this.dataGroup)return(0,u.error)(24,!1,this.series.chart),!1}),(0,u.addEvent)(t,"afterSetOptions",H),(0,u.addEvent)(t,"destroy",k),(0,u.extend)(e,{applyGrouping:S,destroyGroupedData:k,generatePoints:E,getDGApproximation:R,groupData:O})}};var j=s(984);let{format:W}=s.n(j)(),{composed:I}=h();function L(t){let e=this.chart,i=e.time,o=t.point,r=o.series,a=r.options,n=r.tooltipOptions,s=a.dataGrouping,l=r.xAxis,h=n.xDateFormat||"",p,d,c,g,f,y=n[t.isFooter?"footerFormat":"headerFormat"];if(l&&"datetime"===l.options.type&&s&&(0,u.isNumber)(o.key)){d=r.currentDataGrouping,c=s.dateTimeLabelFormats||m.dateTimeLabelFormats,d?(g=c[d.unitName],1===d.count?h=g[0]:(h=g[1],p=g[2])):!h&&c&&l.dateTime&&(h=l.dateTime.getXDateFormat(o.x,n.dateTimeLabelFormats));let a=(0,u.pick)(r.groupMap?.[o.index].groupStart,o.key),x=a+(d?.totalRange||0)-1;f=i.dateFormat(h,a),p&&(f+=i.dateFormat(p,x)),r.chart.styledMode&&(y=this.styledModeFormat(y)),t.text=W(y,{point:(0,u.extend)(o,{key:f}),series:r},e),t.preventDefault()}}let q=h();q.dataGrouping=q.dataGrouping||{},q.dataGrouping.approximationDefaults=q.dataGrouping.approximationDefaults||g,q.dataGrouping.approximations=q.dataGrouping.approximations||p,({compose:function(t,e,i){M(t),F(e),i&&(0,u.pushUnique)(I,"DataGrouping")&&(0,u.addEvent)(i,"headerFormatter",L)},groupData:O}).compose(q.Axis,q.Series,q.Tooltip);let Y=h();return l.default})());