UNPKG

highcharts

Version:
15 lines 19.5 kB
!/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/data * @requires highcharts * * Data module * * (c) 2012-2026 Highsoft AS * Author: Torstein Hønsi * * A commercial license may be required depending on use, * see www.highcharts.com/license */function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.Axis,e._Highcharts.Chart,e._Highcharts.Point,e._Highcharts.SeriesRegistry,e._Highcharts.Time):"function"==typeof define&&define.amd?define("highcharts/modules/data",["highcharts/highcharts"],function(e){return t(e,e.Axis,e.Chart,e.Point,e.SeriesRegistry,e.Time)}):"object"==typeof exports?exports["highcharts/modules/data"]=t(e._Highcharts,e._Highcharts.Axis,e._Highcharts.Chart,e._Highcharts.Point,e._Highcharts.SeriesRegistry,e._Highcharts.Time):e.Highcharts=t(e.Highcharts,e.Highcharts.Axis,e.Highcharts.Chart,e.Highcharts.Point,e.Highcharts.SeriesRegistry,e.Highcharts.Time)}("u"<typeof window?this:window,(e,t,s,i,r,a)=>(()=>{"use strict";var n={532(e){e.exports=t},960(e){e.exports=s},260(e){e.exports=i},512(e){e.exports=r},792(e){e.exports=a},944(t){t.exports=e}};let o={};function l(e){let t=o[e];if(void 0!==t)return t.exports;let s=o[e]={exports:{}};return n[e](s,s.exports,l),s.exports}l.n=e=>{let t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var i=t[s++],r=t[s++];l.o(e,i)?0===r&&s++:0===r?Object.defineProperty(e,i,{enumerable:!0,value:t[s++]}):Object.defineProperty(e,i,{enumerable:!0,get:r})}else for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let h={};l.d(h,{default:()=>H});var u=l(944),d=l.n(u);let{win:c}=d();function m(e){let t={json:"application/json",xml:"application/xml",text:"text/plain",octet:"application/octet-stream"},s=new XMLHttpRequest;function i(t,s){e.error&&e.error(t,s)}if(!e.url)return!1;s.open((e.type||"get").toUpperCase(),e.url,!0),e.headers?.["Content-Type"]||s.setRequestHeader("Content-Type",t[e.dataType||"json"]||t.text),(0,u.objectEach)(e.headers,function(e,t){s.setRequestHeader(t,e)}),e.responseType&&(s.responseType=e.responseType),s.onreadystatechange=function(){let t;if(4===s.readyState){if(200===s.status){if("blob"!==e.responseType&&(t=s.responseText,"json"===e.dataType))try{t=JSON.parse(t)}catch(e){if(e instanceof Error)return i(s,e)}return e.success?.(t,s)}i(s,s.responseText)}},e.data&&"string"!=typeof e.data&&(e.data=JSON.stringify(e.data)),s.send(e.data)}let p={ajax:m,getJSON:function(e,t){p.ajax({url:e,success:t,dataType:"json",headers:{"Content-Type":"text/plain"}})}};p.post=async function(e,t,s){let i=new c.FormData;(0,u.objectEach)(t,function(e,t){i.append(t,e)}),i.append("b64","true");let r=await c.fetch(e,{method:"POST",body:i,...s});if(r.ok){let e=await r.text(),s=document.createElement("a");s.href=`data:${t.type};base64,${e}`,s.download=t.filename,s.click(),(0,u.discardElement)(s)}};var f=l(532),g=l.n(f),y=l(960),x=l.n(y);let{setLength:v,splice:C}={convertToNumber:function(e,t){switch(typeof e){case"boolean":return+!!e;case"number":return isNaN(e)&&!t?null:e;default:return isNaN(e=parseFloat(`${e??""}`))&&!t?null:e}},setLength:function(e,t,s){return Array.isArray(e)?(e.length=t,e):e[s?"subarray":"slice"](0,t)},splice:function(e,t,s,i,r=[]){if(Array.isArray(e))return Array.isArray(r)||(r=Array.from(r)),{removed:e.splice(t,s,...r),array:e};let a=Object.getPrototypeOf(e).constructor,n=e[i?"subarray":"slice"](t,t+s),o=new a(e.length-s+r.length);return o.set(e.subarray(0,t),0),o.set(r,t),o.set(e.subarray(t+s),t+r.length),{removed:n,array:o}}},R=class{constructor(e={}){this.isDataTable=!0,this.autoId=!e.id,this.columns={},this.id=e.id||(0,u.uniqueKey)(),this.rowCount=0,this.versionTag=(0,u.uniqueKey)();let t=0;(0,u.objectEach)(e.columns||{},(e,s)=>{this.columns[s]=e.slice(),t=Math.max(t,e.length)}),this.applyRowCount(t)}applyRowCount(e){this.rowCount=e,(0,u.objectEach)(this.columns,(t,s)=>{t.length!==e&&(this.columns[s]=v(t,e))})}deleteRows(e,t=1){if(t>0&&e<this.rowCount){let s=0;(0,u.objectEach)(this.columns,(i,r)=>{this.columns[r]=C(i,e,t).array,s=i.length}),this.rowCount=s}(0,u.fireEvent)(this,"afterDeleteRows",{rowIndex:e,rowCount:t}),this.versionTag=(0,u.uniqueKey)()}getColumn(e,t){return this.columns[e]}getColumns(e,t){return(e||Object.keys(this.columns)).reduce((e,t)=>(e[t]=this.columns[t],e),{})}getRowObject(e,t){let s={},i=this.columns;for(let r of(t??(t=Object.keys(this.columns)),t))s[r]=i[r]?.[e];return s}setColumn(e,t=[],s=0,i){this.setColumns({[e]:t},s,i)}setColumns(e,t,s){let i=this.rowCount;(0,u.objectEach)(e,(e,t)=>{this.columns[t]=e.slice(),i=e.length}),this.applyRowCount(i),s?.silent||((0,u.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,u.uniqueKey)())}setRow(e,t=this.rowCount,s,i){var r;let{columns:a}=this,n=s?this.rowCount+1:t+1,o=Object.keys(e);if(i?.addColumns!==!1)for(let e=0,t=o.length;e<t;e++)a[r=o[e]]||(a[r]=Array(this.rowCount));(0,u.objectEach)(a,(i,r)=>{i&&(s?i=C(i,t,0,!0,[e[r]]).array:i[t]=r in e?e[r]:i[t],a[r]=i)}),this.applyRowCount(Math.max(n,this.rowCount)),i?.silent||((0,u.fireEvent)(this,"afterSetRows",{rowIndex:t}),this.versionTag=(0,u.uniqueKey)())}getModified(){return this.modified||this}};var N=l(260),w=l.n(N),T=l(512),b=l.n(T),A=l(792),D=l.n(A);let{doc:Y}=d(),{seriesTypes:E}=b();function O(e){return!!(e.rowsURL||e.csvURL||e.columnsURL)}class j{static data(e,t={},s){return new j(e,t,s)}static rowsToColumns(e){let t,s,i,r,a;if(e)for(t=0,a=[],s=e.length;t<s;t++)for(i=0,r=e[t].length;i<r;i++)a[i]||(a[i]=[]),a[i][t]=e[t][i];return a}constructor(e,t={},s){this.rowsToColumns=j.rowsToColumns,this.dateFormats={"YYYY/mm/dd":{regex:/^(\d{4})[\-\/\.](\d{1,2})[\-\/\.](\d{1,2})$/,parser:function(e){return e?Date.UTC(+e[1],e[2]-1,+e[3]):NaN}},"dd/mm/YYYY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{4})$/,parser:function(e){return e?Date.UTC(+e[3],e[2]-1,+e[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{4})$/,parser:function(e){return e?Date.UTC(+e[3],e[1]-1,+e[2]):NaN}},"dd/mm/YY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{2})$/,parser:function(e){if(!e)return NaN;let t=new Date,s=+e[3];return s>t.getFullYear()-2e3?s+=1900:s+=2e3,Date.UTC(s,e[2]-1,+e[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{2})$/,parser:function(e){return e?Date.UTC(+e[3]+2e3,e[1]-1,+e[2]):NaN}}},this.chart=s,this.chartOptions=t,this.options=e,this.rawColumns=[],this.init(e,t,s)}init(e,t,s){let i=e.decimalPoint,r;t&&(this.chartOptions=t),s&&(this.chart=s),"."!==i&&","!==i&&(i=void 0),this.options=e,this.columns=e.columns||this.rowsToColumns(e.rows)||[],this.firstRowAsNames=e.firstRowAsNames??this.firstRowAsNames??!0,this.decimalRegex=i&&RegExp("^(-?[0-9]+)"+i+"([0-9]+)$"),void 0!==this.liveDataTimeout&&(0,u.internalClearTimeout)(this.liveDataTimeout),this.rawColumns=[],this.columns.length&&(this.dataFound(),r=!O(e)),r||(r=this.fetchLiveData()),r||(r=!!this.parseCSV().length),r||(r=!!this.parseTable().length),r||(r=this.parseGoogleSpreadsheet()),!r&&e.afterComplete&&e.afterComplete(this)}getColumnDistribution(){let e=this.chartOptions,t=this.options,s=[],i=function(e="line"){return(E[e].prototype.pointArrayMap||[0]).length},r=function(e="line"){return E[e].prototype.pointArrayMap},a=e?.chart?.type,n=[],o=[],l=t?.seriesMapping||e?.series?.map(function(){return{x:0}})||[],h=0;(e?.series||[]).forEach(e=>{n.push(i(e.type||a))}),l.forEach(e=>{s.push(e.x||0)}),0===s.length&&s.push(0),l.forEach(t=>{let s=new F,l=n[h]||i(a),d=(e?.series??[])[h]??{},c=r(d.type||a),m=c??["y"];((0,u.defined)(t.x)||d.isCartesian||!c)&&s.addColumnReader(t.x,"x"),(0,u.objectEach)(t,function(e,t){"x"!==t&&s.addColumnReader(e,t)});for(let e=0;e<l;e++)s.hasReader(m[e])||s.addColumnReader(void 0,m[e]);o.push(s),h++});let d=r(a);void 0===d&&(d=["y"]),this.valueCount={global:i(a),xColumns:s,individual:n,seriesBuilders:o,globalPointArrayMap:d}}dataFound(){this.options.switchRowsAndColumns&&(this.columns=this.rowsToColumns(this.columns)),this.getColumnDistribution(),this.parseTypes(),!1!==this.parsed()&&this.complete()}parseCSV(e){let t=this,s=this.columns=[],i=e||this.options,r=i.startColumn||0,a=i.endColumn||Number.MAX_VALUE,n=[],o={",":0,";":0," ":0},l=i.csv,h=i.startRow||0,d=i.endRow||Number.MAX_VALUE,c,m,p=0;if(l&&i.beforeParse&&(l=i.beforeParse.call(this,l,this)),l){if(m=l.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(i.lineDelimiter||"\n"),(!h||h<0)&&(h=0),(!d||d>=m.length)&&(d=m.length-1),i.itemDelimiter)c=i.itemDelimiter;else{let e,s,r;e=0,s=0,r=!1,m.some(function(t,i){let r=!1,a,n,l,h="";if(i>13)return!0;for(let i=0;i<t.length;i++){if(a=t[i],n=t[i+1],l=t[i-1],"#"===a)return;if('"'===a)if(r){if('"'!==l&&'"'!==n){for(;" "===n&&i<t.length;)n=t[++i];void 0!==o[n]&&o[n]++,r=!1}}else r=!0;else void 0!==o[a]?(isNaN(Date.parse(h=h.trim()))?(isNaN(h)||!isFinite(h))&&o[a]++:o[a]++,h=""):h+=a;","===a&&s++,"."===a&&e++}}),o[";"]>o[","]?r=";":(o[","],o[";"],r=","),i.decimalPoint||(e>s?i.decimalPoint=".":i.decimalPoint=",",t.decimalRegex=RegExp("^(-?[0-9]+)"+i.decimalPoint+"([0-9]+)$")),c=r}let e=0;for(p=h;p<=d;p++)"#"===m[p][0]?e++:function(e,t,o,l){let h=0,u="",d="",m="",p="",f=0,g=0;function y(t){u=e[t],d=e[t-1],m=e[t+1]}function x(e){n.length<g+1&&n.push([e]),n[g][n[g].length-1]!==e&&n[g].push(e)}function v(){if(r>f||f>a){++f,p="";return}i.columnTypes||(!isNaN(parseFloat(p))&&isFinite(p)?(p=parseFloat(p),x("number")):isNaN(Date.parse(p))?x("string"):(p=p.replace(/\//g,"-"),x("date"))),s.length<g+1&&s.push([]),s[g][t]=p,p="",++g,++f}if(e.trim().length&&"#"!==e.trim()[0]){for(;h<e.length;h++)if(y(h),'"'===u)for(y(++h);h<e.length&&('"'!==u||'"'===d||'"'===m);)('"'!==u||'"'===u&&'"'!==d)&&(p+=u),y(++h);else u===c?v():p+=u;v()}}(m[p],p-h-e);(!i.columnTypes||0===i.columnTypes.length)&&n.length&&n[0].length&&"date"===n[0][1]&&!i.dateFormat&&(i.dateFormat=function(e,s){let i="YYYY/mm/dd",r=[],a=[],n,o=[],l,h=0,d=!1,c;for((!s||s>e.length)&&(s=e.length);h<s;h++)if(void 0!==e[h]&&e[h]?.length)for(c=0,n=e[h].trim().replace(/\//g," ").replace(/\-/g," ").replace(/\./g," ").split(" "),o=["","",""];c<n.length;c++)c<o.length&&(n[c]=parseInt(n[c],10),n[c]&&(a[c]=!a[c]||a[c]<n[c]?n[c]:a[c],void 0!==r[c]?r[c]!==n[c]&&(r[c]=!1):r[c]=n[c],n[c]>31?n[c]<100?o[c]="YY":o[c]="YYYY":n[c]>12&&n[c]<=31?(o[c]="dd",d=!0):o[c].length||(o[c]="mm")));if(d){for(c=0;c<r.length;c++)!1!==r[c]?a[c]>12&&"YY"!==o[c]&&"YYYY"!==o[c]&&(o[c]="YY"):a[c]>12&&"mm"===o[c]&&(o[c]="dd");return(3===o.length&&"dd"===o[1]&&"dd"===o[2]&&(o[2]="YY"),l=o.join("/"),t.dateFormats[l])?l:((0,u.fireEvent)(t,"deduceDateFailed"),i)}return i}(s[0])),this.dataFound()}return s}parseTable(){let e=this.options,t=this.columns||[],s=e.startRow||0,i=e.endRow||Number.MAX_VALUE,r=e.startColumn||0,a=e.endColumn||Number.MAX_VALUE;if(e.table){let n=e.table;"string"==typeof n&&(n=Y.getElementById(n)),[].forEach.call(n.getElementsByTagName("tr"),(e,n)=>{n>=s&&n<=i&&[].forEach.call(e.children,(e,i)=>{let o=t[i-r],l=1;if(("TD"===e.tagName||"TH"===e.tagName)&&i>=r&&i<=a)for(t[i-r]||(t[i-r]=[]),t[i-r][n-s]=e.innerHTML;n-s>=l&&void 0===o[n-s-l];)o[n-s-l]=null,l++})}),this.dataFound()}return t}fetchLiveData(){let e=this,t=this.chart,s=this.options,i=s.enablePolling,r=(0,u.merge)(s),a=0,n=1e3*(s.dataRefreshRate||2);return!!O(s)&&(n=Math.max(n,1e3),delete s.csvURL,delete s.rowsURL,delete s.columnsURL,!function s(o){function l(r,l,h){if(!r||!/^(http|\/|\.\/|\.\.\/)/.test(r))return r&&(0,u.error)(`Invalid URL: ${r}`,!1,t),!1;function d(){i&&t.liveDataURL===r&&(e.liveDataTimeout=setTimeout(s,n))}return o&&((0,u.internalClearTimeout)(e.liveDataTimeout),t.liveDataURL=r),m({url:r,dataType:h||"json",success:function(e){t?.series&&l(e),d()},error:function(e,s){if(++a<3&&d(),t.options)return(0,u.error)(`Request failed - ${e.status} `+("string"==typeof s?s:s.message),!1,t)}}),!0}l(r.csvURL,function(e){t.update({data:{csv:e}})},"text")||l(r.rowsURL,function(e){t.update({data:{rows:e}})})||l(r.columnsURL,function(e){t.update({data:{columns:e}})})}(!0),O(s))}parseGoogleSpreadsheet(){let e=this,t=this.options,s=t.googleSpreadsheetKey,i=this.chart,r=Math.max(1e3*(t.dataRefreshRate||2),4e3);return s&&(delete t.googleSpreadsheetKey,!function a(n){m({url:["https://sheets.googleapis.com/v4/spreadsheets",s,"values",(()=>{if(t.googleSpreadsheetRange)return t.googleSpreadsheetRange;let e="ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=(e.charAt(t.startColumn||0)||"A")+((t.startRow||0)+1),i=e.charAt(t.endColumn??-1)||"ZZ";return(0,u.defined)(t.endRow)&&(i+=t.endRow+1),`${s}:${i}`})(),"?alt=json&majorDimension=COLUMNS&valueRenderOption=UNFORMATTED_VALUE&dateTimeRenderOption=FORMATTED_STRING&key="+t.googleAPIKey].join("/"),dataType:"json",success:function(s){n(s),t.enablePolling&&(e.liveDataTimeout=setTimeout(function(){a(n)},r))},error:function(e,t){if(i.options)return(0,u.error)(`Request failed - ${e.status} `+("string"==typeof t?t:t.message),!1,i)}})}(function(t){let s=t.values;if(!s||0===s.length)return!1;let r=s.reduce((e,t)=>Math.max(e,t.length),0);s.forEach(e=>{for(let t=0;t<r;t++)void 0===e[t]&&(e[t]=null)}),i?.series?i.update({data:{columns:s}}):(e.columns=s,e.dataFound())})),!1}trim(e,t){return"string"==typeof e&&(e=e.replace(/^\s+|\s+$/g,""),t&&/[\d\s]+/.test(e)&&(e=e.replace(/\s/g,"")),this.decimalRegex&&(e=e.replace(this.decimalRegex,"$1.$2"))),e}parseTypes(){let e=this.columns||[],t=e.length;for(;t--;)this.parseColumn(e[t],t)}parseColumn(e,t){let s=this.rawColumns,i=this.columns=this.columns||[],r=this.firstRowAsNames,a=this.valueCount?.xColumns.indexOf(t)!==-1,n=[],o=this.chartOptions,l=(this.options.columnTypes||[])[t],h=a&&o?.xAxis&&"category"===(0,u.splat)(o.xAxis)[0].type||"string"===l,d=(0,u.defined)(e.name),c=e.length,m,p,f,g,y,x,v;for(s[t]||(s[t]=[]);c--;)m=n[c]||e[c],f=this.trim(m),p=parseFloat(g=this.trim(m,!0)),void 0===s[t][c]&&(s[t][c]=f),h||0===c&&r&&!d?e[c]=""+f:+g===p?(e[c]=p,p>31536e6&&"float"!==l?e.isDatetime=!0:e.isNumeric=!0,void 0!==e[c+1]&&(v=p>e[c+1])):(f?.length&&(y=this.parseDate(m)),a&&(0,u.isNumber)(y)&&"float"!==l?(n[c]=m,e[c]=y,e.isDatetime=!0,void 0!==e[c+1]&&((x=y>e[c+1])!==v&&void 0!==v&&this.alternativeFormat&&(this.dateFormat=this.alternativeFormat,c=e.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative),v=x)):(e[c]=""===f?null:f,0!==c&&(e.isDatetime||e.isNumeric)&&(e.mixed=!0)));a&&e.mixed&&(i[t]=s[t])}parseDate(e){let t=this.options.parseDate,s,i,r,a=this.options.dateFormat||this.dateFormat,n;if(t)s=t(e);else if(!1===t)s=e;else if("string"==typeof e){if(a)(r=this.dateFormats[a])||(r=this.dateFormats["YYYY/mm/dd"]),(n=e.match(r.regex))&&(s=r.parser(n));else for(i in this.dateFormats)if(r=this.dateFormats[i],n=e.match(r.regex)){this.dateFormat=a=i,this.alternativeFormat=r.alternative,s=r.parser(n);break}n||(s=new(D())().parse(e))}return s}getData(){if(this.columns)return this.rowsToColumns(this.columns)?.slice(1)}getDataTable(){return new R({columns:Object.values(this.columns||[]).reduce((e,t)=>{let s=t.slice(),i=s.shift();return("string"==typeof i||"number"==typeof i)&&(e[i]=s),e},{})})}parsed(){if(this.options.parsed)return this.options.parsed.call(this,this.columns,this)}complete(){let e=this.columns=this.columns||[],t=this.options,s=[],i="linear",r,a,n,o,l,h,d,c,m,p;if([].length=e.length,t.complete||t.afterComplete){var f,g;let y,x;if(this.firstRowAsNames)for(n=0;n<e.length;n++){let t=e[n];(0,u.defined)(t.name)||(t.name=(t.shift()??"").toString())}for(r=[],f=e?.length||0,g=this.valueCount.seriesBuilders,y=Array(f).fill(!0),x=[],g.forEach(e=>{e.getReferencedColumnIndexes().forEach(e=>{y[e]=!1})}),y.forEach((e,t)=>{e&&x.push(t)}),h=0;h<this.valueCount.seriesBuilders.length;h++)(c=this.valueCount.seriesBuilders[h]).populateColumns(x)&&s.push(c);for(;x.length>0;){for((c=new F).addColumnReader(0,"x"),-1!==(p=x.indexOf(0))&&x.splice(p,1),n=0;n<this.valueCount.global;n++)c.addColumnReader(void 0,this.valueCount.globalPointArrayMap[n]);c.populateColumns(x)&&s.push(c)}if(s.length>0&&s[0].readers.length>0&&void 0!==(m=e?.[s[0].readers[0].columnIndex??-1])&&(m.isDatetime?i="datetime":m.isNumeric||(i="category")),"category"===i)for(h=0;h<s.length;h++)for(l=0,c=s[h];l<c.readers.length;l++)"x"===c.readers[l].configName&&(c.readers[l].configName="name");for(h=0;h<s.length;h++){for(o=0,c=s[h],a=[];o<e[0].length;o++)a[o]=c.read(e,o);r[h]={data:a,pointStart:a[0]&&(c.pointIsArray?a[0]?.[0]:a[0]?.x)||void 0},c.name&&(r[h].name=c.name),"category"===i&&(r[h].turboThreshold=0,r[h].pointStart=0)}d={series:r},"linear"!==i||this.xAxisOptions&&this.xAxisOptions.type!==i?(this.xAxisOptions={type:i},"category"===i&&(this.xAxisOptions.uniqueNames=!1)):i=this.xAxisOptions=void 0,this.chart||(0,u.merge)(!0,d,{xAxis:this.xAxisOptions||{}}),t.complete?.(d),t.afterComplete?.(this,d)}}xAxisUpdateHandler(e){let t=this.xAxisOptions;t&&(!e.options.type&&t.type&&(e.type=t.type),e.options.uniqueNames||!1!==t.uniqueNames||(e.uniqueNames=t.uniqueNames))}update(e,t){let s=this.chart,i=s.options;e&&(e.afterComplete=function(e,i){if(!i)return;let r=s.xAxis[0],a=e.xAxisOptions;a&&r&&(r.type!==a.type&&!r.options.type||r.uniqueNames&&!1===a.uniqueNames&&void 0===r.options.uniqueNames)?r.update({},!1):(i?.series||[]).forEach(function(e){delete e.pointStart}),s.update(i,t,!0)},(0,u.merge)(!0,i.data,e),i.data?.googleSpreadsheetKey&&!e.columns&&delete i.data.columns,this.init(i.data||{},i))}}(0,u.addEvent)(g(),"afterSetOptions",function(){this.isXAxis&&(!this.chart.xAxis.length||this.chart.xAxis[0]===this)&&this.chart.data?.xAxisUpdateHandler(this)}),(0,u.addEvent)(x(),"init",function(e){let t=this,s=e.args[1],i=(0,u.getOptions)().data,r=e.args[0]||{};if((i||r&&r.data)&&!t.hasDataDef){t.hasDataDef=!0;let a=(0,u.merge)(i,r.data);t.data=new j((0,u.extend)(a,{afterComplete:function(e,i){let a,n;if(Object.hasOwnProperty.call(r,"series"))if("object"==typeof r.series)for(a=Math.max(r.series.length,i?.series?.length??0);a--;)n=r.series[a]||{},r.series[a]=(0,u.merge)(n,i?.series?.[a]??{});else delete r.series;r=(0,u.merge)(i,r),t.data=e,t.init(r,s)}}),r,t),e.preventDefault()}});class F{constructor(){this.readers=[],this.pointIsArray=!0}populateColumns(e){let t=!0;return this.readers.forEach(t=>{void 0===t.columnIndex&&(t.columnIndex=e.shift())}),this.readers.forEach(e=>{void 0===e.columnIndex&&(t=!1)}),t}read(e,t){let s=this.pointIsArray,i=s?[]:{};if(this.readers.forEach(r=>{let a=e[r.columnIndex][t];s?i.push(a):r.configName.indexOf(".")>0?w().prototype.setNestedProperty(i,a,r.configName):i[r.configName]=a}),void 0===this.name&&this.readers.length>=2){let t=[];this.readers.forEach(function(e){("x"===e.configName||"name"===e.configName||"y"===e.configName)&&void 0!==e.columnIndex&&t.push(e.columnIndex)}),t.length>=2&&(t.shift(),t.sort(function(e,t){return e-t})),this.name=e[t.shift()??0].name}return i}addColumnReader(e,t){this.readers.push({columnIndex:e,configName:t}),"x"!==t&&"y"!==t&&void 0!==t&&(this.pointIsArray=!1)}getReferencedColumnIndexes(){let e,t,s=[];for(e=0;e<this.readers.length;e+=1)void 0!==(t=this.readers[e]).columnIndex&&s.push(t.columnIndex);return s}hasReader(e){let t;for(t=0;t<this.readers.length;t+=1)if(this.readers[t].configName===e)return!0}}let U=d();U.Data=U.Data||j,U.HttpUtilities=U.HttpUtilities||p,U.ajax=U.HttpUtilities.ajax,U.data=U.Data.data,U.getJSON=U.HttpUtilities.getJSON,U.post=U.HttpUtilities.post;let H=d();return h.default})());