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