!/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/data-tools
 * @requires highcharts
 *
 * Highcharts
 *
 * (c) 2010-2026 Highsoft AS
 *
 * 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(require("highcharts")):"function"==typeof define&&define.amd?define("highcharts/modules/data-tools",[["highcharts/highcharts"]],e):"object"==typeof exports?exports["highcharts/modules/data-tools"]=e(require("highcharts")):t.Highcharts=e(t.Highcharts)}(this,function(t){return function(){"use strict";var e,r,n,o,i,a,s,u,l,c,f,p,h,d,y,m,v,g,b,w,O,C={944:function(e){e.exports=t}},R={};function N(t){var e=R[t];if(void 0!==e)return e.exports;var r=R[t]={exports:{}};return C[t](r,r.exports,N),r.exports}N.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return N.d(e,{a:e}),e},N.d=function(t,e){for(var r in e)N.o(e,r)&&!N.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},N.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var T={};N.d(T,{default:function(){return rw}});var A=N(944),_=N.n(A),j=_().addEvent,P=_().fireEvent,x=_().merge,I=function(){function t(){}return t.prototype.benchmark=function(t,e){var r=[],n=this,o=function(){n.modifyTable(t),n.emit({type:"afterBenchmarkIteration"})},i=x({iterations:1},e).iterations;n.on("afterBenchmarkIteration",function(){r.length===i?n.emit({type:"afterBenchmark",results:r}):o()});var a={startTime:0,endTime:0};return n.on("modify",function(){a.startTime=window.performance.now()}),n.on("afterModify",function(){a.endTime=window.performance.now(),r.push(a.endTime-a.startTime)}),o(),r},t.prototype.emit=function(t){P(this,t.type,t)},t.prototype.modify=function(t,e){var r=this;return new Promise(function(n,o){t.modified||(t.modified=t.clone(!1,e));try{n(r.modifyTable(t,e))}catch(n){r.emit({type:"error",detail:e,table:t}),o(n instanceof Error?n:Error(""+n))}})},t.prototype.on=function(t,e){return j(this,t,e)},t}();(e=I||(I={})).types={},e.registerType=function(t,r){return!!t&&!e.types[t]&&!!(e.types[t]=r)};var M=I,E=function(t,e,r){if(r||2==arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))};(r=w||(w={})).setLength=function(t,e,r){return Array.isArray(t)?(t.length=e,t):t[r?"subarray":"slice"](0,e)},r.splice=function(t,e,r,n,o){if(void 0===o&&(o=[]),Array.isArray(t))return Array.isArray(o)||(o=Array.from(o)),{removed:t.splice.apply(t,E([e,r],o,!1)),array:t};var i=Object.getPrototypeOf(t).constructor,a=t[n?"subarray":"slice"](e,e+r),s=new i(t.length-r+o.length);return s.set(t.subarray(0,e),0),s.set(o,e),s.set(t.subarray(e+r),e+o.length),{removed:a,array:s}},r.convertToNumber=function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat("".concat(null!=t?t:"")))&&!e?null:t}};var F=w,D=F.setLength,S=F.splice,k=_().fireEvent,L=_().objectEach,V=_().uniqueKey,Y=function(){function t(t){void 0===t&&(t={});var e=this;this.autoId=!t.id,this.columns={},this.id=t.id||V(),this.rowCount=0,this.versionTag=V();var r=0;L(t.columns||{},function(t,n){e.columns[n]=t.slice(),r=Math.max(r,t.length)}),this.applyRowCount(r)}return t.prototype.applyRowCount=function(t){var e=this;this.rowCount=t,L(this.columns,function(r,n){r.length!==t&&(e.columns[n]=D(r,t))})},t.prototype.deleteRows=function(t,e){var r=this;if(void 0===e&&(e=1),e>0&&t<this.rowCount){var n=0;L(this.columns,function(o,i){r.columns[i]=S(o,t,e).array,n=o.length}),this.rowCount=n}k(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=V()},t.prototype.getColumn=function(t,e){return this.columns[t]},t.prototype.getColumns=function(t,e){var r=this;return(t||Object.keys(this.columns)).reduce(function(t,e){return t[e]=r.columns[e],t},{})},t.prototype.getRow=function(t,e){var r=this;return(e||Object.keys(this.columns)).map(function(e){var n;return null==(n=r.columns[e])?void 0:n[t]})},t.prototype.setColumn=function(t,e,r,n){var o;void 0===e&&(e=[]),void 0===r&&(r=0),this.setColumns(((o={})[t]=e,o),r,n)},t.prototype.setColumns=function(t,e,r){var n=this,o=this.rowCount;L(t,function(t,e){n.columns[e]=t.slice(),o=t.length}),this.applyRowCount(o),(null==r?void 0:r.silent)||(k(this,"afterSetColumns"),this.versionTag=V())},t.prototype.setRow=function(t,e,r,n){void 0===e&&(e=this.rowCount);var o=this.columns,i=r?this.rowCount+1:e+1,a=Object.keys(t);if((null==n?void 0:n.addColumns)!==!1)for(var s=0,u=a.length;s<u;s++){var l=a[s];o[l]||(o[l]=[])}L(o,function(a,s){var u,l;a||(null==n?void 0:n.addColumns)===!1||(a=Array(i)),a&&(r?a=S(a,e,0,!0,[null!=(u=t[s])?u:null]).array:a[e]=null!=(l=t[s])?l:null,o[s]=a)}),i>this.rowCount&&this.applyRowCount(i),(null==n?void 0:n.silent)||(k(this,"afterSetRows"),this.versionTag=V())},t.prototype.getModified=function(){return this.modified||this},t}(),U=(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),H=function(){return(H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$=F.splice,B=F.setLength,G=_().addEvent,X=_().defined,Z=_().extend,J=_().fireEvent,K=_().isNumber,q=_().uniqueKey,Q=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,e)||this;return r.metadata=e.metadata,r}return U(e,t),e.prototype.clone=function(t,r){var n={};this.emit({type:"cloneTable",detail:r}),t||(n.columns=this.columns),this.autoId||(n.id=this.id);var o=new e(n);return t||(o.versionTag=this.versionTag,o.originalRowIndexes=this.originalRowIndexes,o.localRowIndexes=this.localRowIndexes),o.metadata=H({},this.metadata),this.emit({type:"afterCloneTable",detail:r,tableClone:o}),o},e.prototype.deleteColumns=function(t,e){var r=this.columns,n={},o={},i=this.modifier,a=this.rowCount;if((t=t||Object.keys(r)).length){this.emit({type:"deleteColumns",columnIds:t,detail:e});for(var s=0,u=t.length,l=void 0,c=void 0;s<u;++s)(l=r[c=t[s]])&&(n[c]=l,o[c]=Array(a)),delete r[c];return Object.keys(r).length||(this.rowCount=0,this.deleteRowIndexReferences()),i&&i.modifyTable(this),this.emit({type:"afterDeleteColumns",columns:n,columnIds:t,detail:e}),n}},e.prototype.deleteRowIndexReferences=function(){delete this.originalRowIndexes,delete this.localRowIndexes},e.prototype.deleteRows=function(t,e,r){var n,o,i=this;void 0===e&&(e=1);var a=this.columns,s=this.modifier,u=[];if(X(t)?Array.isArray(t)?o=(n=t.filter(function(t,e,r){return t>=0&&t<i.rowCount&&r.indexOf(t)===e}).sort(function(t,e){return e-t})).length:(n=[t],o=e):(n=[0],o=this.rowCount),this.emit({type:"deleteRows",detail:r,rowCount:o,rowIndex:null!=t?t:0}),o>0)for(var l=Object.keys(a),c=0;c<l.length;++c){var f=l[c],p=a[f],h=void 0;if(1===n.length&&o>1){var d=$(p,n[0],o);h=d.removed,a[f]=d.array}else{h=[];for(var y=0,m=n;y<m.length;y++){var v=m[y];h.push(p[v]),$(p,v,1)}h.reverse()}c||(this.rowCount=p.length);for(var g=0,b=h.length;g<b;++g)u[g]=u[g]||[],u[g][c]=h[g]}return s&&s.modifyTable(this),this.emit({type:"afterDeleteRows",detail:r,rowCount:o,rowIndex:null!=t?t:0,rows:u}),u},e.prototype.emit=function(t){["afterDeleteColumns","afterDeleteRows","afterSetCell","afterSetColumns","afterSetRows"].includes(t.type)&&(this.versionTag=q()),J(this,t.type,t)},e.prototype.getCell=function(t,e){var r=this.columns[t];if(r)return r[e]},e.prototype.getColumn=function(t,e){return this.getColumns([t],e)[t]},e.prototype.getColumnIds=function(){return Object.keys(this.columns)},e.prototype.getColumns=function(t,e,r){var n=this.columns,o={};t=t||Object.keys(n);for(var i=0,a=t.length,s=void 0,u=void 0;i<a;++i)(s=n[u=t[i]])&&(e?o[u]=s:r&&!Array.isArray(s)?o[u]=Array.from(s):o[u]=s.slice());return o},e.prototype.getLocalRowIndex=function(t){var e=this.localRowIndexes;return e?e[t]:t},e.prototype.getModifier=function(){return this.modifier},e.prototype.getOriginalRowIndex=function(t){var e=this.originalRowIndexes;return e?e[t]:t},e.prototype.getRow=function(t,e){return this.getRows(t,1,e)[0]},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowIndexBy=function(t,e,r){var n=this.columns[t];if(n){var o=-1;if(Array.isArray(n)?o=n.indexOf(e,r):K(e)&&(o=n.indexOf(e,r)),-1!==o)return o}},e.prototype.getRowObject=function(t,e){return this.getRowObjects(t,1,e)[0]},e.prototype.getRowObjects=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=this.rowCount-t);var n=this.columns,o=Array(e);r=r||Object.keys(n);for(var i=t,a=0,s=Math.min(this.rowCount,t+e),u=void 0,l=void 0;i<s;++i,++a){l=o[a]={};for(var c=0,f=r;c<f.length;c++){var p=f[c];u=n[p],l[p]=u?u[i]:void 0}}return o},e.prototype.getRows=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=this.rowCount-t);var n=this.columns,o=Array(e);r=r||Object.keys(n);for(var i=t,a=0,s=Math.min(this.rowCount,t+e),u=void 0,l=void 0;i<s;++i,++a){l=o[a]=[];for(var c=0,f=r;c<f.length;c++)u=n[f[c]],l.push(u?u[i]:void 0)}return o},e.prototype.getVersionTag=function(){return this.versionTag},e.prototype.hasColumns=function(t){for(var e=this.columns,r=0,n=t.length,o=void 0;r<n;++r)if(!e[t[r]])return!1;return!0},e.prototype.hasRowWith=function(t,e){var r=this.columns[t];return Array.isArray(r)?-1!==r.indexOf(e):!!(X(e)&&Number.isFinite(e))&&-1!==r.indexOf(+e)},e.prototype.on=function(t,e){return G(this,t,e)},e.prototype.changeColumnId=function(t,e){var r=this.columns;return!!r[t]&&(t!==e&&(r[e]=r[t],delete r[t]),!0)},e.prototype.setCell=function(t,e,r,n){var o=this.columns,i=this.modifier,a=o[t];a&&a[e]===r||(this.emit({type:"setCell",cellValue:r,columnId:t,detail:n,rowIndex:e}),a||(a=o[t]=Array(this.rowCount)),e>=this.rowCount&&(this.rowCount=e+1),a[e]=r,i&&i.modifyTable(this),this.emit({type:"afterSetCell",cellValue:r,columnId:t,detail:n,rowIndex:e}))},e.prototype.setColumns=function(e,r,n,o){var i=this.columns,a=this.modifier,s=Object.keys(e),u=this.rowCount;if(this.emit({type:"setColumns",columns:e,columnIds:s,detail:n,rowIndex:r}),X(r)||o){for(var l=0,c=s.length,f=void 0,p=void 0,h=void 0,d=void 0;l<c;++l){f=e[h=s[l]],d=Object.getPrototypeOf((p=i[h])&&o?p:f).constructor,p?d===Array?Array.isArray(p)||(p=Array.from(p)):p.length<u&&(p=new d(u)).set(i[h]):p=new d(u),i[h]=p;for(var y=r||0,m=f.length;y<m;++y)p[y]=f[y];u=Math.max(u,f.length)}this.applyRowCount(u)}else t.prototype.setColumns.call(this,e,r,Z(n,{silent:!0}));a&&a.modifyTable(this),this.emit({type:"afterSetColumns",columns:e,columnIds:s,detail:n,rowIndex:r})},e.prototype.setModifier=function(t,e){var r=this;return r.emit({type:"setModifier",detail:e,modifier:t,modified:r.getModified()}),r.modifier=t,(t?t.modify(r):Promise.resolve(r)).then(function(r){return r.emit({type:"afterSetModifier",detail:e,modifier:t,modified:r.getModified()}),r}).catch(function(e){throw r.emit({type:"setModifierError",error:e,modifier:t,modified:r.getModified()}),e})},e.prototype.setOriginalRowIndexes=function(t,e){if(void 0===e&&(e=!1),this.originalRowIndexes=t,!e)for(var r=this.localRowIndexes=[],n=0,o=t.length,i=void 0;n<o;++n)X(i=t[n])&&(r[i]=n)},e.prototype.setRow=function(t,e,r,n){this.setRows([t],e,r,n)},e.prototype.setRows=function(e,r,n,o){void 0===r&&(r=this.rowCount);var i=this.columns,a=Object.keys(i),s=this.modifier,u=e.length;this.emit({type:"setRows",detail:o,rowCount:u,rowIndex:r,rows:e});for(var l=0,c=r,f=void 0;l<u;++l,++c)if(0===Object.keys(f=e[l]).length)for(var p=0,h=a.length;p<h;++p){var d=i[a[p]];n?i[a[p]]=$(d,c,0,!0,[null]).array:d[c]=null}else if(Array.isArray(f))for(var p=0,h=a.length;p<h;++p)i[a[p]][c]=f[p];else t.prototype.setRow.call(this,f,c,n,{silent:!0});var y=n?u+e.length:r+u;if(y>this.rowCount){this.rowCount=y;for(var l=0,m=a.length;l<m;++l){var v=a[l];i[v]=B(i[v],y)}}s&&s.modifyTable(this),this.emit({type:"afterSetRows",detail:o,rowCount:u,rowIndex:r,rows:e})},e}(Y),W=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},z=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},tt=_().addEvent,te=_().fireEvent,tr=_().merge,tn=_().pick,to=function(){function t(t){this.dataTables={},this.loaded=!1,this.metadata=t.metadata||{columns:{}},this.options=t;var e=null==t?void 0:t.dataTables,r=0;if(t.options&&console.error("The `DataConnectorOptions.options` property was removed in Dashboards v4.0.0. Check how to upgrade your connector to use the new options structure here: https://api.highcharts.com/dashboards/#interfaces/Data_DataTableOptions.DataTableOptions"),e&&(null==e?void 0:e.length)>0)for(var n=0,o=e.length;n<o;++n){var i=e[n],a=null==i?void 0:i.key;this.dataTables[null!=a?a:r]=new Q(i),!a&&r++}else this.dataTables[0]=new Q({id:t.id})}return Object.defineProperty(t.prototype,"polling",{get:function(){return!!this._polling},enumerable:!1,configurable:!0}),t.prototype.getTable=function(t){return t?this.dataTables[t]:Object.values(this.dataTables)[0]},t.prototype.describeColumn=function(t,e){var r=this.metadata.columns;r[t]=tr(r[t]||{},e)},t.prototype.describeColumns=function(t){for(var e,r=Object.keys(t);"string"==typeof(e=r.pop());)this.describeColumn(e,t[e])},t.prototype.getColumnOrder=function(){var t=this.metadata.columns,e=Object.keys(t||{});if(e.length)return e.sort(function(e,r){return tn(t[e].index,0)-tn(t[r].index,0)})},t.prototype.getSortedColumns=function(){return this.getTable().getColumns(this.getColumnOrder())},t.prototype.setColumnOrder=function(t){for(var e=0,r=t.length;e<r;++e)this.describeColumn(t[e],{index:e})},t.prototype.update=function(t){return W(this,arguments,void 0,function(t,e){var r;return void 0===e&&(e=!0),z(this,function(n){switch(n.label){case 0:if(this.emit({type:"beforeUpdate"}),tr(!0,this.options,t),r=this.options,("enablePolling"in t||"dataRefreshRate"in t)&&("enablePolling"in r&&r.enablePolling?(this.stopPolling(),this.startPolling("dataRefreshRate"in r&&"number"==typeof r.dataRefreshRate?1e3*Math.max(r.dataRefreshRate,1):1e3)):this.stopPolling()),!e)return[3,2];return[4,this.load()];case 1:n.sent(),n.label=2;case 2:return this.emit({type:"afterUpdate"}),[2]}})})},t.prototype.load=function(){return this.emit({type:"afterLoad"}),Promise.resolve(this)},t.prototype.applyTableModifiers=function(){return W(this,void 0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,f;return z(this,function(p){switch(p.label){case 0:t=null==(u=this.options)?void 0:u.dataTables,e=function(e,n){var o,i;return z(this,function(a){switch(a.label){case 0:return i=(o=null!=(c=null==(l=null==t?void 0:t.find(function(t){return t.key===e}))?void 0:l.dataModifier)?c:null==(f=r.options)?void 0:f.dataModifier)&&M.types[o.type],[4,n.setModifier(i?new i(o):void 0)];case 1:return a.sent(),[2]}})},r=this,n=0,o=Object.entries(this.dataTables),p.label=1;case 1:if(!(n<o.length))return[3,4];return a=(i=o[n])[0],s=i[1],[5,e(a,s)];case 2:p.sent(),p.label=3;case 3:return n++,[3,1];case 4:return[2,this]}})})},t.prototype.startPolling=function(t){void 0===t&&(t=1e3);var e=this;this.pollingController=new AbortController,window.clearTimeout(e._polling),e._polling=window.setTimeout(function(){return e.load().catch(function(t){return e.emit({type:"loadError",error:t})}).then(function(){e._polling&&e.startPolling(t)})},t)},t.prototype.stopPolling=function(){var t;this.polling&&(null==(t=null===this||void 0===this?void 0:this.pollingController)||t.abort(),window.clearTimeout(this._polling),delete this._polling)},t.prototype.emit=function(t){te(this,t.type,t)},t.prototype.on=function(t,e){return tt(this,t,e)},t.prototype.initConverters=function(t,e,r){for(var n=0,o=0,i=Object.entries(this.dataTables);o<i.length;o++){var a=i[o],s=a[0],u=a[1],l=e(s),c=r(l,t);u.deleteColumns(),u.setColumns(c),0===n&&(this.converter=l),n++}},t}();(o=to||(to={})).types={},o.registerType=function(t,e){return!!t&&!o.types[t]&&!!(o.types[t]=e)};var ti=to,ta=_().isNumber,ts=O||(O={});function tu(t,e){if("number"==typeof t)return t;if("boolean"==typeof t)return+!!t;if("string"==typeof t){if(t.indexOf(" ")>-1&&(t=t.replace(/\s+/g,"")),e){if(!e.test(t))return NaN;t=t.replace(e,"$1.$2")}return parseFloat(t)}return t instanceof Date?t.getDate():t?t.getRowCount():NaN}ts.asDate=function(t,e){var r;if("string"==typeof t)r=e.parseDate(t);else if("number"==typeof t)r=t;else{if(t instanceof Date)return t;r=e.parseDate(""+t)}return new Date(r)},ts.asNumber=tu,ts.asString=function(t){return""+t},ts.asBoolean=function(t){return"boolean"==typeof t?t:"string"==typeof t?""!==t&&"0"!==t&&"false"!==t:!!tu(t)},ts.guessType=function(t,e){var r="string";if("string"==typeof t){var n=ts.trim("".concat(t)),o=e.decimalRegExp,i=ts.trim(n,!0);o&&(i=o.test(i)?i.replace(o,"$1.$2"):"");var a=parseFloat(i);+i===a?t=a:r=ta(e.parseDate(t))?"Date":"string"}return"number"==typeof t&&(r=t>31536e6?"Date":"number"),r},ts.trim=function(t,e){return"string"==typeof t&&(t=t.replace(/^\s+|\s+$/g,""),e&&/^[\d\s]+$/.test(t)&&(t=t.replace(/\s/g,""))),t},ts.getColumnsCollection=function(t,e){void 0===t&&(t=[]);for(var r={},n=0,o=Math.max(e.length,t.length);n<o;++n)r[e[n]||"".concat(n)]=t[n]?t[n].slice():[];return r};var tl=O,tc=_().addEvent,tf=_().fireEvent,tp=_().merge,th=function(){function t(e){this.dateFormats={"YYYY/mm/dd":{regex:/^(\d{4})([\-\.\/])(\d{1,2})\2(\d{1,2})$/,parser:function(t){return t?Date.UTC(+t[1],t[3]-1,+t[4]):NaN}},"dd/mm/YYYY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{4})$/,parser:function(t){return t?Date.UTC(+t[4],t[3]-1,+t[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{4})$/,parser:function(t){return t?Date.UTC(+t[4],t[1]-1,+t[3]):NaN}},"dd/mm/YY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{2})$/,parser:function(t){var e=new Date;if(!t)return NaN;var r=+t[4];return r>e.getFullYear()-2e3?r+=1900:r+=2e3,Date.UTC(r,t[3]-1,+t[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{2})$/,parser:function(t){return t?Date.UTC(+t[4]+2e3,t[1]-1,+t[3]):NaN}}};var r=tp(t.defaultOptions,e),n=r.decimalPoint;("."===n||","===n)&&(n="."===n?"\\.":",",this.decimalRegExp=RegExp("^(-?[0-9]+)"+n+"([0-9]+)$")),this.options=r}return t.prototype.convertByType=function(t){var e=this;return({number:function(t){return tl.asNumber(t,e.decimalRegExp)},Date:function(t){return tl.asDate(t,e)},string:tl.asString})[tl.guessType(t,e)].call(e,t)},t.prototype.deduceDateFormat=function(t,e,r){var n,o,i,a=[],s=[],u="YYYY/mm/dd",l=[],c=0,f=!1;for((!e||e>t.length)&&(e=t.length);c<e;c++)if(void 0!==t[c]&&t[c]&&t[c].length)for(i=0,n=t[c].trim().replace(/[\-\.\/]/g," ").split(" "),l=["","",""];i<n.length;i++)i<l.length&&(o=parseInt(n[i],10))&&(s[i]=!s[i]||s[i]<o?o:s[i],void 0!==a[i]?a[i]!==o&&(a[i]=!1):a[i]=o,o>31?o<100?l[i]="YY":l[i]="YYYY":o>12&&o<=31?(l[i]="dd",f=!0):l[i].length||(l[i]="mm"));if(f){for(i=0;i<a.length;i++)!1!==a[i]?s[i]>12&&"YY"!==l[i]&&"YYYY"!==l[i]&&(l[i]="YY"):s[i]>12&&"mm"===l[i]&&(l[i]="dd");3===l.length&&"dd"===l[1]&&"dd"===l[2]&&(l[2]="YY"),u=l.join("/")}return r&&(this.options.dateFormat=u),u},t.prototype.emit=function(t){tf(this,t.type,t)},t.prototype.on=function(t,e){return tc(this,t,e)},t.prototype.parseDate=function(t,e){var r,n=this.options,o=e||n.dateFormat,i=NaN,a=null;if(n.parseDate)i=n.parseDate(t);else{var s=this.dateFormats;if(o){var u=s[o];u||(u=s["YYYY/mm/dd"]),(a=t.match(u.regex))&&(i=u.parser(a))}else for(r in s){var u=s[r];if(a=t.match(u.regex)){o=r,i=u.parser(a);break}}if(!a){var l=Date.parse(t);!isNaN(l)&&(i=l-6e4*new Date(l).getTimezoneOffset(),t.includes("2001")||2001!==new Date(i).getFullYear()||(i=NaN))}}return i},t.defaultOptions={dateFormat:"",firstRowAsNames:!0},t}();(i=th||(th={})).types={},i.registerType=function(t,e){return!!t&&!i.types[t]&&!!(i.types[t]=e)};var td=th,ty=function(){function t(t){void 0===t&&(t={}),this.emittingRegister=[],this.listenerMap={},this.stateMap=t}return t.prototype.addListener=function(t,e,r){var n=this.listenerMap[t]=this.listenerMap[t]||{};return(n[e]=n[e]||[]).push(r),this},t.prototype.buildEmittingTag=function(t){return("position"===t.cursor.type?[t.table.id,t.cursor.column,t.cursor.row,t.cursor.state,t.cursor.type]:[t.table.id,t.cursor.columns,t.cursor.firstRow,t.cursor.lastRow,t.cursor.state,t.cursor.type]).join("\0")},t.prototype.emitCursor=function(e,r,n,o){var i,a=e.id,s=r.state,u=this.listenerMap[a]&&this.listenerMap[a][s];if(u){var l=this.stateMap[a]=null!=(i=this.stateMap[a])?i:{},c=l[r.state]||[];o&&(c.length||(l[r.state]=c),-1===t.getIndex(r,c)&&c.push(r));var f={cursor:r,cursors:c,table:e};n&&(f.event=n);var p=this.emittingRegister,h=this.buildEmittingTag(f);if(p.indexOf(h)>=0)return this;try{this.emittingRegister.push(h);for(var d=0,y=u.length;d<y;++d)u[d].call(this,f)}finally{var m=this.emittingRegister.indexOf(h);m>=0&&this.emittingRegister.splice(m,1)}}return this},t.prototype.remitCursor=function(e,r){var n=this.stateMap[e]&&this.stateMap[e][r.state];if(n){var o=t.getIndex(r,n);o>=0&&n.splice(o,1)}return this},t.prototype.removeListener=function(t,e,r){var n=this.listenerMap[t]&&this.listenerMap[t][e];if(n){var o=n.indexOf(r);o>=0&&n.splice(o,1)}return this},t}(),tm=ty||(ty={});function tv(t,e){if("range"===t.type)return t;var r,n,o,i,a={type:"range",firstRow:null!=(n=null!=(r=t.row)?r:e&&e.firstRow)?n:0,lastRow:null!=(i=null!=(o=t.row)?o:e&&e.lastRow)?i:Number.MAX_VALUE,state:t.state};return void 0!==t.column&&(a.columns=[t.column]),a}tm.getIndex=function(t,e){if("position"===t.type){for(var r=void 0,n=0,o=e.length;n<o;++n)if("position"===(r=e[n]).type&&r.state===t.state&&r.column===t.column&&r.row===t.row)return n}else for(var i=JSON.stringify(t.columns),r=void 0,n=0,o=e.length;n<o;++n)if("range"===(r=e[n]).type&&r.state===t.state&&r.firstRow===t.firstRow&&r.lastRow===t.lastRow&&JSON.stringify(r.columns)===i)return n;return -1},tm.isEqual=function(t,e){return"position"===t.type&&"position"===e.type?t.column===e.column&&t.row===e.row&&t.state===e.state:"range"===t.type&&"range"===e.type&&t.firstRow===e.firstRow&&t.lastRow===e.lastRow&&JSON.stringify(t.columns)===JSON.stringify(e.columns)},tm.isInRange=function(t,e){"position"===e.type&&(e=tv(e)),"position"===t.type&&(t=tv(t,e));var r=t.columns,n=e.columns;return t.firstRow>=e.firstRow&&t.lastRow<=e.lastRow&&(!r||!n||r.every(function(t){return n.indexOf(t)>=0}))},tm.toPositions=function(t){if("position"===t.type)return[t];for(var e=t.columns||[],r=[],n=t.state,o=t.firstRow,i=t.lastRow;o<i;++o){if(!e.length){r.push({type:"position",row:o,state:n});continue}for(var a=0,s=e.length;a<s;++a)r.push({type:"position",column:e[a],row:o,state:n})}return r},tm.toRange=tv;var tg=ty,tb=_().addEvent,tw=_().fireEvent,tO=_().merge,tC=function(){function t(e){this.options=tO(t.defaultOptions,e),this.connectors={},this.waiting={}}return t.prototype.emit=function(t){tw(this,t.type,t)},t.prototype.getConnector=function(t){var e=this,r=this.connectors[t];if(null==r?void 0:r.loaded)return Promise.resolve(r);var n=this.waiting[t];if(!n){n=this.waiting[t]=[];var o=this.getConnectorOptions(t);if(!o)throw Error("Connector '".concat(t,"' not found."));this.loadConnector(o).then(function(r){delete e.waiting[t];for(var o=0,i=n.length;o<i;++o)n[o][0](r)}).catch(function(r){delete e.waiting[t];for(var o=0,i=n.length;o<i;++o)n[o][1](r)})}return new Promise(function(t,e){n.push([t,e])})},t.prototype.getConnectorIds=function(){for(var t=this.options.connectors,e=[],r=0,n=t.length;r<n;++r)e.push(t[r].id);return e},t.prototype.getConnectorOptions=function(t){for(var e=this.options.connectors,r=0,n=e.length;r<n;++r)if(e[r].id===t)return e[r]},t.prototype.isNewConnector=function(t){return!this.connectors[t]},t.prototype.loadConnector=function(t){var e=this;return new Promise(function(r,n){e.emit({type:"load",options:t});var o=ti.types[t.type];if(!o)throw Error("Connector type not found. (".concat(t.type,")"));var i=e.connectors[t.id]=new o(t);i.load().then(function(n){i.converter=n.converter,i.loaded=!0,e.emit({type:"afterLoad",options:t}),r(i)}).catch(n)})},t.prototype.cancelPendingRequests=function(){for(var t=this.connectors,e=0,r=Object.keys(t);e<r.length;e++)t[r[e]].stopPolling()},t.prototype.on=function(t,e){return tb(this,t,e)},t.prototype.setConnectorOptions=function(t){var e=this.options.connectors,r=this.connectors;this.emit({type:"setConnectorOptions",options:t});for(var n=0,o=e.length;n<o;++n)if(e[n].id===t.id){e.splice(n,1);break}r[t.id]&&(r[t.id].stopPolling(),delete r[t.id]),e.push(t),this.emit({type:"afterSetConnectorOptions",options:t})},t.defaultOptions={connectors:[]},t}(),tR=_().isString,tN=/^(?:FALSE|TRUE)/,tT=/^[+\-]?\d+(?:\.\d+)?(?:e[+\-]\d+)?/,tA=/^[+\-]?\d+(?:,\d+)?(?:e[+\-]\d+)?/,t_=/^([A-Z][A-Z\d\.]*)\(/,tj=/^(?:[+\-*\/^<=>]|<=|=>)/,tP=/^(\$?[A-Z]+)(\$?\d+)\:(\$?[A-Z]+)(\$?\d+)/,tx=/^R(\d*|\[\d+\])C(\d*|\[\d+\])\:R(\d*|\[\d+\])C(\d*|\[\d+\])/,tI=/^(\$?[A-Z]+)(\$?\d+)(?![\:C])/,tM=/^R(\d*|\[\d+\])C(\d*|\[\d+\])(?!\:)/;function tE(t){for(var e=0,r=0,n=t.length,o=void 0,i=1;r<n;++r){if("("===(o=t[r])){e||(i=r+1),++e;continue}if(")"===o&&!--e)return t.substring(i,r)}if(e>0){var a=Error("Incomplete parantheses.");throw a.name="FormulaParseError",a}return""}function tF(t){for(var e=-1,r=0,n=t.length,o=void 0,i=!1;r<n;++r){if("\\"===(o=t[r])){i=!i;continue}if(i){i=!1;continue}if('"'===o)if(!(e<0))return t.substring(e+1,r);else e=r}var a=Error("Incomplete string.");throw a.name="FormulaParseError",a}function tD(t,e){if(r=t.match(tx)){var r,n=""===r[2]||"["===r[2][0],o=""===r[1]||"["===r[1][0],i=""===r[4]||"["===r[4][0],a=""===r[3]||"["===r[3][0],s={type:"range",beginColumn:n?parseInt(r[2].substring(1,-1)||"0",10):parseInt(r[2],10)-1,beginRow:o?parseInt(r[1].substring(1,-1)||"0",10):parseInt(r[1],10)-1,endColumn:i?parseInt(r[4].substring(1,-1)||"0",10):parseInt(r[4],10)-1,endRow:a?parseInt(r[3].substring(1,-1)||"0",10):parseInt(r[3],10)-1};return n&&(s.beginColumnRelative=!0),o&&(s.beginRowRelative=!0),i&&(s.endColumnRelative=!0),a&&(s.endRowRelative=!0),s}if(r=t.match(tP)){var n="$"!==r[1][0],o="$"!==r[2][0],i="$"!==r[3][0],a="$"!==r[4][0],s={type:"range",beginColumn:tL(n?r[1]:r[1].substring(1))-1,beginRow:parseInt(o?r[2]:r[2].substring(1),10)-1,endColumn:tL(i?r[3]:r[3].substring(1))-1,endRow:parseInt(a?r[4]:r[4].substring(1),10)-1};return n&&(s.beginColumnRelative=!0),o&&(s.beginRowRelative=!0),i&&(s.endColumnRelative=!0),a&&(s.endRowRelative=!0),s}var u=tk(t,e);return 1===u.length&&"string"!=typeof u[0]?u[0]:u}function tS(t){var e=t.length,r=t[e-2];return"-"===t[e-1]&&tR(r)&&!!r.match(/\*|\/|\^/)}function tk(t,e){for(var r,n=e?tA:tT,o=[],i=("="===t[0]?t.substring(1):t).trim();i;){if(r=i.match(tM)){var a=""===r[2]||"["===r[2][0],s=""===r[1]||"["===r[1][0],u={type:"reference",column:a?parseInt(r[2].substring(1,-1)||"0",10):parseInt(r[2],10)-1,row:s?parseInt(r[1].substring(1,-1)||"0",10):parseInt(r[1],10)-1};a&&(u.columnRelative=!0),s&&(u.rowRelative=!0),tS(o)&&(o.pop(),u.isNegative=!0),o.push(u),i=i.substring(r[0].length).trim();continue}if(r=i.match(tI)){var a="$"!==r[1][0],s="$"!==r[2][0],u={type:"reference",column:tL(a?r[1]:r[1].substring(1))-1,row:parseInt(s?r[2]:r[2].substring(1),10)-1};a&&(u.columnRelative=!0),s&&(u.rowRelative=!0),tS(o)&&(o.pop(),u.isNegative=!0),o.push(u),i=i.substring(r[0].length).trim();continue}if(r=i.match(tj)){o.push(r[0]),i=i.substring(r[0].length).trim();continue}if(r=i.match(tN)){o.push("TRUE"===r[0]),i=i.substring(r[0].length).trim();continue}if(r=i.match(n)){var l=parseFloat(r[0]);tS(o)&&(o.pop(),l=-l),o.push(l),i=i.substring(r[0].length).trim();continue}if('"'===i[0]){var c=tF(i);o.push(c.substring(1,-1)),i=i.substring(c.length+2).trim();continue}if(r=i.match(t_)){var f=tE(i=i.substring(r[1].length).trim());o.push({type:"function",name:r[1],args:function(t,e){for(var r=[],n=e?";":",",o=0,i="",a=0,s=t.length,u=void 0;a<s;++a)if((u=t[a])===n&&!o&&i)r.push(tD(i,e)),i="";else if('"'!==u||o||i)" "!==u&&(i+=u,"("===u?++o:")"===u&&--o);else{var l=tF(t.substring(a));r.push(l),a+=l.length+1}return!o&&i&&r.push(tD(i,e)),r}(f,e)}),i=i.substring(f.length+2).trim();continue}if("("===i[0]){var p=tE(i);if(p){o.push(tk(p,e)),i=i.substring(p.length+2).trim();continue}}var h=t.length-i.length,d=Error("Unexpected character `"+t.substring(h,h+1)+"` at position "+(h+1)+". (`..."+t.substring(h-5,h+6)+"...`)");throw d.name="FormulaParseError",d}return o}function tL(t){for(var e=0,r=0,n=t.length,o=void 0,i=t.length-1;r<n;++r)(o=t.charCodeAt(r))>=65&&o<=90&&(e+=(o-64)*Math.pow(26,i)),--i;return e}var tV={parseFormula:tk},tY=["+","-","*","/","^","=","<","<=",">",">="],tU={isFormula:function(t){return Array.isArray(t)},isFunction:function(t){return"object"==typeof t&&!Array.isArray(t)&&"function"===t.type},isOperator:function(t){return"string"==typeof t&&tY.indexOf(t)>=0},isRange:function(t){return"object"==typeof t&&!Array.isArray(t)&&"range"===t.type},isReference:function(t){return"object"==typeof t&&!Array.isArray(t)&&"reference"===t.type},isValue:function(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t}},tH=tU.isFormula,t$=tU.isFunction,tB=tU.isOperator,tG=tU.isRange,tX=tU.isReference,tZ=tU.isValue,tJ=_().defined,tK=/ */,tq=Number.MAX_VALUE/1.000000000001,tQ=Number.MAX_VALUE/1.000000000002,tW=Number.MAX_VALUE,tz={"^":3,"*":2,"/":2,"+":1,"-":1,"=":0,"<":0,"<=":0,">":0,">=":0},t0={},t1=/^[A-Z][A-Z\.]*$/;function t2(t){switch(typeof t){case"boolean":return t?tW:tq;case"string":return tQ;case"number":return t;default:return NaN}}function t3(t){return"string"==typeof t?t.toLowerCase().replace(tK,"\0"):t}function t4(t){switch(typeof t){case"boolean":return+!!t;case"string":return parseFloat(t.replace(",","."));case"number":return t;default:return NaN}}function t6(t,e){return tZ(t)?t:tG(t)?e&&t5(t,e)||[]:t$(t)?et(t,e):t8(tH(t)?t:[t],e)}function t5(t,e){for(var r=e.getColumnIds().slice(t.beginColumn,t.endColumn+1),n=[],o=0,i=r.length,a=void 0;o<i;++o)for(var s=e.getColumn(r[o],!0)||[],u=t.beginRow,l=t.endRow+1;u<l;++u)"string"==typeof(a=s[u])&&"="===a[0]&&e!==e.getModified()&&(a=e.getModified().getCell(r[o],u)),n.push(tZ(a)?a:NaN);return n}function t9(t,e){var r=e.getColumnIds()[t.column];if(r){var n=e.getCell(r,t.row);if("string"==typeof n&&"="===n[0]&&e!==e.getModified()){var o=e.getModified().getCell(r,t.row);return tZ(o)?o:NaN}if(tZ(n))return t.isNegative?-n:n}return NaN}function t7(t,e){(t.length<2||e.length<1)&&t.push(NaN);var r=t.pop(),n=t.pop(),o=e.pop();tJ(r)&&tJ(n)&&tJ(o)?t.push(function(t,e,r){var n;switch(t){case"=":return t3(e)===t3(r);case"<":if(typeof e==typeof r)return t3(e)<t3(r);return t2(e)<t2(r);case"<=":if(typeof e==typeof r)return t3(e)<=t3(r);return t2(e)<=t2(r);case">":if(typeof e==typeof r)return t3(e)>t3(r);return t2(e)>t2(r);case">=":if(typeof e==typeof r)return t3(e)>=t3(r);return t2(e)>=t2(r)}switch(e=t4(e),r=t4(r),t){case"+":n=e+r;break;case"-":n=e-r;break;case"*":n=e*r;break;case"/":n=e/r;break;case"^":n=Math.pow(e,r);break;default:return NaN}return n%1?Math.round(1e9*n)/1e9:n}(o,n,r)):t.push(NaN)}function t8(t,e){for(var r=[],n=[],o=!0,i=0,a=t.length;i<a;++i){var s=t[i];if(tB(s)){if(o&&"-"===s)r.push(0),n.push("-"),o=!0;else{for(;n.length&&tz[n[n.length-1]]>=tz[s];)t7(r,n);n.push(s),o=!0}continue}var u=void 0;if(tZ(s))u=s;else if(tX(s))u=e?t9(s,e):NaN;else if(t$(s)){var l=et(s,e);u=tZ(l)?l:NaN}else tH(s)&&(u=t8(s,e));if(void 0===u)return NaN;r.push(u),o=!1}for(;n.length;)t7(r,n);return 1!==r.length?NaN:r[0]}function et(t,e,r){var n=t0[t.name];if(n)try{return n(t.args,e)}catch(t){return NaN}var o=Error('Function "'.concat(t.name,'" not found.'));throw o.name="FormulaProcessError",o}var ee={asNumber:t4,getArgumentValue:t6,getArgumentsValues:function(t,e){for(var r=[],n=0,o=t.length;n<o;++n)r.push(t6(t[n],e));return r},getRangeValues:t5,getReferenceValue:t9,processFormula:t8,processorFunctions:t0,registerProcessorFunction:function(t,e){return t1.test(t)&&!t0[t]&&!!(t0[t]=e)},translateReferences:function t(e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);for(var o=0,i=e.length,a=void 0;o<i;++o)Array.isArray(a=e[o])?t(a,r,n):t$(a)?t(a.args,r,n):tG(a)?(a.beginColumnRelative&&(a.beginColumn+=r),a.beginRowRelative&&(a.beginRow+=n),a.endColumnRelative&&(a.endColumn+=r),a.endRowRelative&&(a.endRow+=n)):tX(a)&&(a.columnRelative&&(a.column+=r),a.rowRelative&&(a.row+=n));return e}},er=ee.getArgumentValue;ee.registerProcessorFunction("ABS",function(t,e){var r=er(t[0],e);switch(typeof r){case"number":return Math.abs(r);case"object":for(var n=[],o=0,i=r.length,a=void 0;o<i;++o){if("number"!=typeof(a=r[o]))return NaN;n.push(Math.abs(a))}return n;default:return NaN}});var en=ee.getArgumentValue;ee.registerProcessorFunction("AND",function t(e,r){for(var n=0,o=e.length,i=void 0;n<o;++n)if(!(i=en(e[n],r))||"object"==typeof i&&!t(i,r))return!1;return!0});var eo=ee.getArgumentsValues;ee.registerProcessorFunction("AVERAGE",function(t,e){for(var r=eo(t,e),n=0,o=0,i=0,a=r.length,s=void 0;i<a;++i)switch(typeof(s=r[i])){case"number":isNaN(s)||(++n,o+=s);break;case"object":for(var u=0,l=s.length,c=void 0;u<l;++u)"number"!=typeof(c=s[u])||isNaN(c)||(++n,o+=c)}return n?o/n:0});var ei=ee.getArgumentValue;ee.registerProcessorFunction("AVERAGEA",function(t,e){for(var r=0,n=0,o=0,i=t.length,a=void 0;o<i;++o)switch(typeof(a=ei(t[o],e))){case"boolean":++r,n+=+!!a;continue;case"number":isNaN(a)||(++r,n+=a);continue;case"string":++r;continue;default:for(var s=0,u=a.length,l=void 0;s<u;++s)switch(typeof(l=a[s])){case"boolean":++r,n+=+!!l;continue;case"number":isNaN(l)||(++r,n+=l);continue;case"string":++r;continue}continue}return r?n/r:0}),ee.registerProcessorFunction("COUNT",function t(e,r){for(var n=ee.getArgumentsValues(e,r),o=0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":!isNaN(s)&&++o;break;case"object":o+=t(s,r)}return o}),ee.registerProcessorFunction("COUNTA",function t(e,r){for(var n=ee.getArgumentsValues(e,r),o=0,i=0,a=n.length,s=void 0;i<a;++i){switch(typeof(s=n[i])){case"number":if(isNaN(s))continue;break;case"object":o+=t(s,r);continue;case"string":if(!s)continue}++o}return o});var ea=ee.getArgumentValue;ee.registerProcessorFunction("IF",function(t,e){return ea(t[0],e)?ea(t[1],e):ea(t[2],e)});var es=ee.getArgumentValue;ee.registerProcessorFunction("ISNA",function(t,e){var r=es(t[0],e);return"number"!=typeof r||isNaN(r)});var eu=ee.getArgumentsValues;ee.registerProcessorFunction("MAX",function t(e,r){for(var n=eu(e,r),o=-1/0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":s>o&&(o=s);break;case"object":(s=t(s))>o&&(o=s)}return isFinite(o)?o:0}),ee.registerProcessorFunction("MEDIAN",function(t,e){for(var r=[],n=ee.getArgumentsValues(t,e),o=0,i=n.length,a=void 0;o<i;++o)switch(typeof(a=n[o])){case"number":isNaN(a)||r.push(a);break;case"object":for(var s=0,u=a.length,l=void 0;s<u;++s)"number"!=typeof(l=a[s])||isNaN(l)||r.push(l)}var c=r.length;if(!c)return NaN;var f=Math.floor(c/2);return c%2?r[f]:(r[f-1]+r[f])/2});var el=ee.getArgumentsValues;ee.registerProcessorFunction("MIN",function t(e,r){for(var n=el(e,r),o=1/0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":s<o&&(o=s);break;case"object":(s=t(s))<o&&(o=s)}return isFinite(o)?o:0});var ec=ee.getArgumentValue;function ef(t,e){for(var r={},n=ee.getArgumentsValues(t,e),o=0,i=n.length,a=void 0;o<i;++o)switch(typeof(a=n[o])){case"number":isNaN(a)||(r[a]=(r[a]||0)+1);break;case"object":for(var s=0,u=a.length,l=void 0;s<u;++s)"number"!=typeof(l=a[s])||isNaN(l)||(r[l]=(r[l]||0)+1)}return r}function ep(t,e){var r=ef(t,e),n=Object.keys(r);if(!n.length)return NaN;for(var o=parseFloat(n[0]),i=r[n[0]],a=1,s=n.length,u=void 0,l=void 0,c=void 0;a<s;++a)i<(c=r[u=n[a]])?(o=parseFloat(u),i=c):i===c&&o>(l=parseFloat(u))&&(o=l,i=c);return i>1?o:NaN}ee.registerProcessorFunction("MOD",function(t,e){var r=ec(t[0],e),n=ec(t[1],e);return("object"==typeof r&&(r=r[0]),"object"==typeof n&&(n=n[0]),"number"!=typeof r||"number"!=typeof n||0===n)?NaN:r%n}),ee.registerProcessorFunction("MODE",ep),ee.registerProcessorFunction("MODE.MULT",function(t,e){var r=ef(t,e),n=Object.keys(r);if(!n.length)return NaN;for(var o=[parseFloat(n[0])],i=r[n[0]],a=1,s=n.length,u=void 0,l=void 0;a<s;++a)i<(l=r[u=n[a]])?(o=[parseFloat(u)],i=l):i===l&&o.push(parseFloat(u));return i>1?o:NaN}),ee.registerProcessorFunction("MODE.SNGL",ep);var eh=ee.getArgumentValue;ee.registerProcessorFunction("NOT",function(t,e){var r=eh(t[0],e);switch("object"==typeof r&&(r=r[0]),typeof r){case"boolean":case"number":return!r}return NaN});var ed=ee.getArgumentValue;ee.registerProcessorFunction("OR",function t(e,r){for(var n=0,o=e.length,i=void 0;n<o;++n)if("object"==typeof(i=ed(e[n],r))){if(t(i,r))return!0}else if(i)return!0;return!1});var ey=ee.getArgumentsValues;ee.registerProcessorFunction("PRODUCT",function t(e,r){for(var n=ey(e,r),o=1,i=!1,a=0,s=n.length,u=void 0;a<s;++a)switch(typeof(u=n[a])){case"number":isNaN(u)||(i=!0,o*=u);break;case"object":i=!0,o*=t(u,r)}return i?o:0}),ee.registerProcessorFunction("SUM",function t(e,r){for(var n=ee.getArgumentsValues(e,r),o=0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":isNaN(s)||(o+=s);break;case"object":o+=t(s,r)}return o});var em=ee.getArgumentValue;ee.registerProcessorFunction("XOR",function(t,e){for(var r=0,n=t.length,o=void 0,i=void 0;r<n;++r)switch(typeof(i=em(t[r],e))){case"boolean":case"number":if(void 0===o)o=!!i;else if(!!i!==o)return!0;break;case"object":for(var a=0,s=i.length,u=void 0;a<s;++a)switch(typeof(u=i[a])){case"boolean":case"number":if(void 0===o)o=!!u;else if(!!u!==o)return!0}}return!1});var ev=function(){return(ev=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},eg=ev(ev(ev({},tV),ee),tU),eb=(a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ew=function(){return(ew=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},eO=_().merge,eC=function(t){function e(r){var n=this,o=eO(e.defaultOptions,r);return(n=t.call(this,o)||this).headers=[],n.dataTypes=[],n.options=o,n}return eb(e,t),e.prototype.parse=function(t,e){var r,n,o=this.dataTypes,i=eO(this.options,t),a=i.beforeParse,s=i.lineDelimiter,u=i.firstRowAsNames,l=i.itemDelimiter,c=0,f=i.csv,p=i.startRow,h=i.endRow,d=[];if(this.emit({type:"parse",columns:d,detail:e,headers:this.headers}),f&&a&&(f=a(f)),f){if(r=f.replace(/\r\n|\r/g,"\n").split(s||"\n"),(!p||p<0)&&(p=0),(!h||h>=r.length)&&(h=r.length-1),l||(this.guessedItemDelimiter=this.guessDelimiter(r)),u){for(var y=r[0].split(l||this.guessedItemDelimiter||","),m=0;m<y.length;m++)y[m]=y[m].trim().replace(/^["']|["']$/g,"");this.headers=y,p++}var v=0;for(c=p;c<=h;c++)"#"===r[c][0]?v++:this.parseCSVRow(d,r[c],c-p-v);o.length&&o[0].length&&"date"===o[0][1]&&!this.options.dateFormat&&this.deduceDateFormat(d[0],null,!0);for(var m=0,g=d.length;m<g;++m){n=d[m];for(var b=0,w=n.length;b<w;++b)if(n[b]&&"string"==typeof n[b]){var O=this.convertByType(n[b]);O instanceof Date&&(O=O.getTime()),d[m][b]=O}}}return d.forEach(function(t){t.length=Math.max.apply(Math,d.map(function(t){return t.length}))}),this.emit({type:"afterParse",columns:d,detail:e,headers:this.headers}),tl.getColumnsCollection(d,this.headers)},e.prototype.parseCSVRow=function(t,e,r){var n=this,o=n.dataTypes,i=n.options,a=i.startColumn,s=i.endColumn,u=n.options.itemDelimiter||n.guessedItemDelimiter,l=n.options.decimalPoint;l&&l!==u||(l=n.guessedDecimalPoint||".");var c=0,f="",p="",h=0,d=0,y=function(t){f=e[t]},m=function(t){o.length<d+1&&o.push([t]),o[d][o[d].length-1]!==t&&o[d].push(t)},v=function(){if(a>h||h>s){++h,p="";return}if("string"==typeof p){var e=parseFloat(p);!isNaN(e)&&isFinite(Number(p))?(p=e,m("number")):isNaN(Date.parse(p))?m("string"):(p=p.replace(/\//g,"-"),m("date"))}else m("number");if(t.length<d+1&&t.push([]),"number"!=typeof p&&"number"!==tl.guessType(p,n)&&l){var o=p;p=p.replace(l,"."),"number"!==tl.guessType(p,n)&&(p=o)}t[d][r]=p,p="",++d,++h};if(e.trim().length&&"#"!==e.trim()[0]){for(;c<e.length;c++){if(y(c),"#"===f&&!/^#[A-F\d]{3,3}|[A-F\d]{6,6}/i.test(e.substring(c)))return void v();if('"'===f)for(y(++c);c<e.length&&'"'!==f;)p+=f,y(++c);else f===u?v():p+=f}v()}},e.prototype.guessDelimiter=function(t){for(var e,r=0,n=0,o={",":0,";":0,"	":0},i=t.length,a=0;a<i;a++){var s=!1,u=void 0,l=void 0,c=void 0,f="";if(a>13)break;for(var p=t[a],h=0;h<p.length&&(u=p[h],l=p[h+1],c=p[h-1],"#"!==u);h++){if('"'===u)if(s){if('"'!==c&&'"'!==l){for(;" "===l&&h<p.length;)l=p[++h];void 0!==o[l]&&o[l]++,s=!1}}else s=!0;else void 0!==o[u]?(isNaN(Date.parse(f=f.trim()))?(isNaN(Number(f))||!isFinite(Number(f)))&&o[u]++:o[u]++,f=""):f+=u;","===u&&n++,"."===u&&r++}}return o[";"]>o[","]?e=";":(o[","]>o[";"],e=","),r>n?this.guessedDecimalPoint=".":this.guessedDecimalPoint=",",e},e.defaultOptions=ew(ew({},td.defaultOptions),{lineDelimiter:"\n",startColumn:0,endColumn:Number.MAX_VALUE,startRow:0,endRow:Number.MAX_VALUE}),e}(td);td.registerType("CSV",eC);var eR=(s=function(t,e){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eN=_().merge,eT=_().fireEvent,eA=function(t){function e(r){var n=this,o=eN(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,o.enablePolling&&n.startPolling(1e3*Math.max(o.dataRefreshRate||0,1)),n}return eR(e,t),e.prototype.emit=function(t){eT(this,t.type,t)},e.prototype.load=function(t){var e,r=this,n=this,o=n.options,i=o.csv,a=o.csvURL,s=o.dataTables,u=o.decimalPoint;return n.emit({type:"load",csv:i}),Promise.resolve(a?fetch(a,{signal:null==(e=null==n?void 0:n.pollingController)?void 0:e.signal}).then(function(t){return t.text()}):i||"").then(function(t){return t&&r.initConverters(t,function(t){var e=(null==s?void 0:s.find(function(e){return e.key===t}))||{},r=e.firstRowAsNames,n=void 0===r?o.firstRowAsNames:r,i=e.beforeParse,a=void 0===i?o.beforeParse:i;return new eC(eN(o,{decimalPoint:u,firstRowAsNames:n,beforeParse:a}))},function(t,e){return t.parse({csv:e})}),n.applyTableModifiers().then(function(){return t})}).then(function(e){return n.emit({type:"afterLoad",detail:t,csv:e}),n}).catch(function(e){throw n.emit({type:"loadError",detail:t,error:e}),e})},e.defaultOptions={id:"csv-connector",type:"CSV",csv:"",csvURL:"",enablePolling:!1,dataRefreshRate:1,firstRowAsNames:!0},e}(ti);ti.registerType("CSV",eA);var e_=(u=function(t,e){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ej=function(){return(ej=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},eP=_().error,ex=_().isArray,eI=_().merge,eM=_().objectEach,eE=function(t){function e(r){var n=this,o=eI(e.defaultOptions,r);return(n=t.call(this,o)||this).headerColumnIds=[],n.headers=[],n.options=o,n}return e_(e,t),e.prototype.parse=function(t,e){var r=(t=eI(this.options,t)).beforeParse,n=t.orientation,o=t.firstRowAsNames,i=t.columnIds,a=t.data;if(!a)return{};this.headers=[];var s=[];return this.emit({type:"parse",columns:s,detail:e,headers:this.headers}),r&&(a=r(a)),a=a.slice(),"columns"===n?this.parseColumnsOrientation(s,a,o,i):"rows"===n&&this.parseRowsOrientation(s,a,o,i),this.emit({type:"afterParse",columns:s,detail:e,headers:this.headers}),tl.getColumnsCollection(s,this.headers)},e.prototype.parseColumnsOrientation=function(t,e,r,n){for(var o=0,i=e.length;o<i;o++){var a=e[o];if(!Array.isArray(a))return;Array.isArray(this.headers)?(r?this.headers.push("".concat(a.shift())):n&&Array.isArray(n)&&this.headers.push(n[o]),t.push(a)):eP("JSONConverter: Invalid `columnIds` option.",!1)}},e.prototype.parseRowsOrientation=function(t,e,r,n){r?this.headers=e.shift():n&&(this.headerColumnIds=n);for(var o=0,i=e.length;o<i;o++){var a=e[o];ex(a)||(a=this.convertItemToRow(a,n));for(var s=0,u=a.length;s<u;s++)t.length<s+1&&t.push([]),t[s].push(a[s]),r||0!==o||(Array.isArray(this.headerColumnIds)?this.headers.push(this.headerColumnIds[s]||s.toString()):eP("JSONConverter: Invalid `columnIds` option.",!1))}},e.prototype.convertItemToRow=function(t,e){var r=this;if(e&&!Array.isArray(e)){var n=[];return eM(e,function(e,o){n.push(e.reduce(function(t,e){return t[e]},t)),0>r.headers.indexOf(o)&&r.headers.push(o)}),n}return r.headerColumnIds=Object.keys(t),Object.values(t)},e.defaultOptions=ej(ej({},td.defaultOptions),{orientation:"rows"}),e}(td);td.registerType("JSON",eE);var eF=(l=function(t,e){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eD=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},eS=_().merge,ek=_().fireEvent,eL=function(t){function e(r){var n=this,o=eS(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,o.enablePolling&&n.startPolling(1e3*Math.max(o.dataRefreshRate||0,1)),n}return eF(e,t),e.prototype.emit=function(t){ek(this,t.type,t)},e.prototype.load=function(t){var e,r=this,n=this,o=n.options,i=o.data,a=o.dataUrl,s=o.dataTables;return n.emit({type:"load",detail:t,data:i}),Promise.resolve(a?fetch(a,{signal:null==(e=null==n?void 0:n.pollingController)?void 0:e.signal}).then(function(t){return t.json()}).catch(function(e){n.emit({type:"loadError",detail:t,error:e}),console.warn("Unable to fetch data from ".concat(a,"."))}):i||[]).then(function(t){var e,i,a;return e=void 0,i=void 0,a=function(){return eD(this,function(e){return t&&this.initConverters(t,function(e){var r=(null==s?void 0:s.find(function(t){return t.key===e}))||{},n=r.columnIds,i=void 0===n?o.columnIds:n,a=r.firstRowAsNames,u=void 0===a?o.firstRowAsNames:a,l=r.orientation,c=void 0===l?o.orientation:l,f=r.beforeParse;return new eE({data:t,columnIds:i,firstRowAsNames:u,orientation:c,beforeParse:void 0===f?o.beforeParse:f})},function(t,e){return t.parse({data:e})}),[2,n.applyTableModifiers().then(function(){return null!=t?t:[]})]})},new(i||(i=Promise))(function(t,n){function o(t){try{u(a.next(t))}catch(t){n(t)}}function s(t){try{u(a.throw(t))}catch(t){n(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i(function(t){t(r)})).then(o,s)}u((a=a.apply(r,e||[])).next())})}).then(function(e){return n.emit({type:"afterLoad",detail:t,data:e}),n}).catch(function(e){throw n.emit({type:"loadError",detail:t,error:e}),e})},e.defaultOptions={type:"JSON",id:"json-connector",data:[],enablePolling:!1,dataRefreshRate:0,firstRowAsNames:!0,orientation:"rows"},e}(ti);ti.registerType("JSON",eL);var eV=(c=function(t,e){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eY=function(){return(eY=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},eU=_().merge,eH=_().uniqueKey,e$=function(t){function e(r){var n=this,o=eU(e.defaultOptions,r);return(n=t.call(this,o)||this).header=[],n.options=o,n}return eV(e,t),e.prototype.parse=function(t,e){var r,n,o=eU(this.options,t),i=((null==(r=o.json)?void 0:r.values)||[]).map(function(t){return t.slice()});if(0===i.length)return{};this.header=[],this.emit({type:"parse",columns:[],detail:e,headers:this.header});var a=o.beforeParse,s=o.json;a&&s&&(i=a(s.values));for(var u=0,l=i.length;u<l;u++){n=i[u],this.header[u]=o.firstRowAsNames?"".concat(n.shift()):eH();for(var c=0,f=n.length;c<f;++c){var p,h=n[c];p=h,"[object Date]"===Object.prototype.toString.call(p)&&(h=h.getTime()),i[u][c]=h}}return this.emit({type:"afterParse",columns:i,detail:e,headers:this.header}),tl.getColumnsCollection(i,this.header)},e.defaultOptions=eY({},td.defaultOptions),e}(td);td.registerType("GoogleSheets",e$);var eB=(f=function(t,e){return(f=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eG=_().merge,eX=_().pick,eZ=_().fireEvent,eJ=function(t){function e(r){var n=this,o=eG(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,n}return eB(e,t),e.prototype.emit=function(t){eZ(this,t.type,t)},e.prototype.load=function(t){var r,n=this,o=this,i=o.options,a=i.dataRefreshRate,s=i.enablePolling,u=i.googleAPIKey,l=i.googleSpreadsheetKey,c=i.dataTables,f=e.buildFetchURL(u,l,i);if(o.emit({type:"load",detail:t,url:f}),!URL.canParse(f))throw Error("Invalid URL: "+f);return fetch(f,{signal:null==(r=null==o?void 0:o.pollingController)?void 0:r.signal}).then(function(t){return t.json()}).then(function(t){if("object"==typeof t&&t&&"object"==typeof t.error&&t.error&&"number"==typeof t.error.code&&"string"==typeof t.error.message&&"string"==typeof t.error.status)throw Error(t.error.message);return n.initConverters(t,function(t){var e=(null==c?void 0:c.find(function(e){return e.key===t}))||{},r=e.firstRowAsNames,n=void 0===r?i.firstRowAsNames:r,o=e.beforeParse;return new e$({firstRowAsNames:n,beforeParse:void 0===o?i.beforeParse:o})},function(t,e){return t.parse({json:e})}),o.applyTableModifiers()}).then(function(){return o.emit({type:"afterLoad",detail:t,url:f}),s&&setTimeout(function(){return o.load()},1e3*Math.max(a||0,1)),o}).catch(function(e){throw o.emit({type:"loadError",detail:t,error:e}),e})},e.defaultOptions={id:"google-sheets-connector",type:"GoogleSheets",googleAPIKey:"",googleSpreadsheetKey:"",enablePolling:!1,dataRefreshRate:2,firstRowAsNames:!0},e}(ti),eK=eJ||(eJ={}),eq="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function eQ(t){void 0===t&&(t={});var e=t.endColumn,r=t.endRow,n=t.googleSpreadsheetRange,o=t.startColumn,i=t.startRow;return n||(eq[o||0]||"A")+(Math.max(i||0,0)+1)+":"+(eq[eX(e,25)]||"Z")+(r?Math.max(r,0):"Z")}eK.buildFetchURL=function(t,e,r){void 0===r&&(r={});var n=new URL("https://sheets.googleapis.com/v4/spreadsheets/".concat(e,"/values/")),o=r.onlyColumnIds?"A1:Z1":eQ(r);n.pathname+=o;var i=n.searchParams;return i.set("alt","json"),r.onlyColumnIds||(i.set("dateTimeRenderOption","FORMATTED_STRING"),i.set("majorDimension","COLUMNS"),i.set("valueRenderOption","UNFORMATTED_VALUE")),i.set("prettyPrint","false"),i.set("key",t),n.href},eK.buildQueryRange=eQ,ti.registerType("GoogleSheets",eJ);var eW=(p=function(t,e){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ez=function(){return(ez=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},e0=_().merge,e1=function(t){function e(r){var n=this,o=e0(e.defaultOptions,r);return(n=t.call(this,o)||this).headers=[],n.options=o,o.tableElement&&(n.tableElement=o.tableElement,n.tableElementID=o.tableElement.id),n}return eW(e,t),e.prototype.export=function(t,e){void 0===e&&(e=this.options);var r=!1!==e.firstRowAsNames,n=e.useMultiLevelHeaders,o=t.getSortedColumns(),i=Object.keys(o),a=[],s=i.length,u=[],l="";if(r){var c=[];if(n){for(var f=0;f<i.length;f++){var p=i[f],h=o[p];Array.isArray(h)||(h=Array.from(h));var d=(h.shift()||"").toString();o[p]=h,c.push(d)}l=this.getTableHeaderHTML(i,c,e)}else l=this.getTableHeaderHTML(void 0,i,e)}for(var y=0;y<s;y++)for(var p=i[y],h=o[p],m=h.length,v=0;v<m;v++){var g=h[v];u[v]||(u[v]=[]),"string"!=typeof g&&"number"!=typeof g&&void 0!==g&&(g=(g||"").toString()),u[v][y]=this.getCellHTMLFromValue(y?"td":"th",null,y?"":'scope="row"',g),y===s-1&&a.push("<tr>"+u[v].join("")+"</tr>")}var b="";return e.tableCaption&&(b='<caption class="highcharts-table-caption">'+e.tableCaption+"</caption>"),"<table>"+b+l+"<tbody>"+a.join("")+"</tbody></table>"},e.prototype.getCellHTMLFromValue=function(t,e,r,n,o){var i=n,a="text"+(e?" "+e:"");return"number"==typeof i?(i=i.toString(),","===o&&(i=i.replace(".",o)),a="number"):n||(i="",a="empty"),"<"+t+(r?" "+r:"")+' class="'+a+'">'+i+"</"+t+">"},e.prototype.getTableHeaderHTML=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===r&&(r=this.options);var n,o,i=r.useMultiLevelHeaders,a=r.useRowspanHeaders,s="<thead>",u=0,l=e&&e.length,c=0;if(i&&t&&e&&!function(t,e){var r=t.length;if(e.length!==r)return!1;for(;--r;)if(t[r]!==e[r])return!1;return!0}(t,e)){for(s+="<tr>";u<l;++u)(n=t[u])===t[u+1]?++c:c?(s+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col" colspan="'+(c+1)+'"',n),c=0):(n===e[u]?a?(o=2,e.splice(u,1)):(o=1,e[u]=""):o=1,s+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col"'+(o>1?' valign="top" rowspan="'+o+'"':""),n));s+="</tr>"}if(e){for(s+="<tr>",u=0,l=e.length;u<l;++u)void 0!==e[u]&&(s+=this.getCellHTMLFromValue("th",null,'scope="col"',e[u]));s+="</tr>"}return s+"</thead>"},e.prototype.parse=function(t,e){var r=[],n=[],o=e0(this.options,t),i=o.endRow,a=o.startColumn,s=o.endColumn,u=o.firstRowAsNames,l=o.tableElement||this.tableElement;if(!(l instanceof HTMLElement))return this.emit({type:"parseError",columns:r,detail:e,headers:n,error:"Not a valid HTML Table"}),{};this.tableElement=l,this.tableElementID=l.id,this.emit({type:"parse",columns:r,detail:e,headers:this.headers});var c,f=l.getElementsByTagName("tr"),p=f.length,h=0,d=o.startRow;if(u&&p){for(var y=f[0].children,m=y.length,v=a;v<m&&!(v>s);v++)("TD"===(c=y[v]).tagName||"TH"===c.tagName)&&n.push(c.innerHTML);d++}for(;h<p;){if(h>=d&&h<=i)for(var g=f[h].children,b=g.length,w=0;w<b;){var O=w-a,C=r[O];if(("TD"===(c=g[w]).tagName||"TH"===c.tagName)&&w>=a&&w<=s){r[O]||(r[O]=[]);var R=this.convertByType(c.innerHTML);R instanceof Date&&(R=R.getTime()),r[O][h-d]=R;for(var v=1;h-d>=v&&void 0===C[h-d-v];)C[h-d-v]=null,v++}w++}h++}return this.headers=n,this.emit({type:"afterParse",columns:r,detail:e,headers:n}),tl.getColumnsCollection(r,this.headers)},e.defaultOptions=ez(ez({},td.defaultOptions),{useRowspanHeaders:!0,useMultiLevelHeaders:!0,startColumn:0,endColumn:Number.MAX_VALUE,startRow:0,endRow:Number.MAX_VALUE}),e}(td);td.registerType("HTMLTable",e1);var e2=(h=function(t,e){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),e3=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},e4=_().win,e6=_().merge,e5=function(t){function e(r){var n=this,o=e6(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,n.converter=new e1(o),n}return e2(e,t),e.prototype.load=function(t){var e,r,n,o;return e=this,r=void 0,n=void 0,o=function(){var e,r,n,o,i,a,s;return e3(this,function(u){switch(u.label){case 0:if(e=this,r=e.options,n=e.converter,o=e.getTable(),i=r.htmlTable,e.emit({type:"load",detail:t}),"string"==typeof i?(e.tableID=i,a=e4.document.getElementById(i)):(a=i,e.tableID=a.id),e.tableElement=a||void 0,!e.tableElement)return e.emit({type:"loadError",detail:t,error:"HTML table not provided, or element with ID not found"}),[2,Promise.reject(Error("HTML table not provided, or element with ID not found"))];return s=n.parse(e6({tableElement:e.tableElement},r),t),o.deleteColumns(),o.setColumns(s),[4,e.applyTableModifiers()];case 1:return u.sent(),e.emit({type:"afterLoad",detail:t}),[2,e]}})},new(n||(n=Promise))(function(t,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o.throw(t))}catch(t){i(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof n?r:new n(function(t){t(r)})).then(a,s)}u((o=o.apply(e,r||[])).next())})},e.defaultOptions={id:"HTML-table-connector",type:"HTMLTable",htmlTable:""},e}(ti);ti.registerType("HTMLTable",e5);var e9=(d=function(t,e){return(d=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),e7=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},e8=_().addEvent,rt=_().fireEvent,re=_().merge,rr=function(t){function e(r){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=t.call(this)||this;i.chain=n,i.options=re(e.defaultOptions,r);for(var a=i.options.chain||[],s=0,u=a.length,l=void 0,c=void 0;s<u;++s)(l=a[s]).type&&(c=M.types[l.type])&&n.push(new c(l));return i}return e9(e,t),e.prototype.add=function(t,e){this.emit({type:"addModifier",detail:e,modifier:t}),this.chain.push(t),this.emit({type:"addModifier",detail:e,modifier:t})},e.prototype.clear=function(t){this.emit({type:"clearChain",detail:t}),this.chain.length=0,this.emit({type:"afterClearChain",detail:t})},e.prototype.modify=function(t,e){var r,n,o,i;return r=this,n=void 0,o=void 0,i=function(){var r,n,o,i,a;return e7(this,function(s){switch(s.label){case 0:r=this.options.reverse?this.chain.slice().reverse():this.chain.slice(),t.modified||(t.modified=t.clone(!1,e)),n=t,o=0,i=r.length,s.label=1;case 1:if(!(o<i))return[3,7];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r[o].modify(n,e)];case 3:return s.sent(),[3,5];case 4:throw a=s.sent(),this.emit({type:"error",detail:e,table:t}),a;case 5:n=n.getModified(),s.label=6;case 6:return++o,[3,1];case 7:return t.modified=n,[2,t]}})},new(o||(o=Promise))(function(t,e){function a(t){try{u(i.next(t))}catch(t){e(t)}}function s(t){try{u(i.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof o?r:new o(function(t){t(r)})).then(a,s)}u((i=i.apply(r,n||[])).next())})},e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});for(var r=this.options.reverse?this.chain.reverse():this.chain.slice(),n=t.getModified(),o=0,i=r.length,a=void 0;o<i;++o)n=r[o].modifyTable(n,e).getModified();return t.modified=n,this.emit({type:"afterModify",detail:e,table:t}),t},e.prototype.remove=function(t,e){var r=this.chain;this.emit({type:"removeModifier",detail:e,modifier:t}),r.splice(r.indexOf(t),1),this.emit({type:"afterRemoveModifier",detail:e,modifier:t})},e.prototype.emit=function(t){rt(this,t.type,t)},e.prototype.on=function(t,e){return e8(this,t,e)},e.defaultOptions={type:"Chain"},e}(M);M.registerType("Chain",rr);var rn=(y=function(t,e){return(y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ro=_().merge,ri=function(t){function e(r){var n=t.call(this)||this;return n.options=ro(e.defaultOptions,r),n}return rn(e,t),e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});var r=t.getModified();if(t.hasColumns(["columnIds"])){for(var n=(t.deleteColumns(["columnIds"])||{}).columnIds||[],o={},i=[],a=0,s=n.length;a<s;++a)i.push(""+n[a]);for(var a=0,s=t.getRowCount(),u=void 0;a<s;++a)(u=t.getRow(a))&&(o[i[a]]=u);r.deleteColumns(),r.setColumns(o)}else{for(var o={},a=0,s=t.getRowCount(),u=void 0;a<s;++a)(u=t.getRow(a))&&(o["".concat(a)]=u);o.columnIds=t.getColumnIds(),r.deleteColumns(),r.setColumns(o)}return this.emit({type:"afterModify",detail:e,table:t}),t},e.defaultOptions={type:"Invert"},e}(M);M.registerType("Invert",ri);var ra=(m=function(t,e){return(m=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rs=function(){return(rs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ru=function(t){function e(r){var n=t.call(this)||this;return n.options=rs(rs({},e.defaultOptions),r),n}return ra(e,t),e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});for(var r=this.options.alternativeSeparators,n=this.options.formulaColumns||t.getColumnIds(),o=t.getModified(),i=0,a=n.length,s=void 0;i<a;++i)s=n[i],n.indexOf(s)>=0&&o.setColumn(s,this.processColumn(t,s));for(var u=this.options.columnFormulas||[],i=0,a=u.length,l=void 0,c=void 0;i<a;++i)l=u[i],c=tV.parseFormula(l.formula,r),o.setColumn(l.column,this.processColumnFormula(c,t,l.rowStart,l.rowEnd));return this.emit({type:"afterModify",detail:e,table:t}),t},e.prototype.processColumn=function(t,e,r){void 0===r&&(r=0);for(var n=this.options.alternativeSeparators,o=(t.getColumn(e,!0)||[]).slice(r>0?r:0),i=0,a=o.length,s=[],u=void 0;i<a;++i)if("string"==typeof(u=o[i])&&"="===u[0])try{s=""===u?s:tV.parseFormula(u.substring(1),n),o[i]=ee.processFormula(s,t)}catch(t){o[i]=NaN}return o},e.prototype.processColumnFormula=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=e.getRowCount()),r=r>=0?r:0,n=n>=0?n:e.getRowCount()+n;for(var o=[],i=e.getModified(),a=0,s=n-r;a<s;++a)try{o[a]=ee.processFormula(t,i)}catch(t){o[a]=NaN}finally{t=ee.translateReferences(t,0,1)}return o},e.defaultOptions={type:"Math",alternativeSeparators:!1},e}(M);M.registerType("Math",ru);var rl=(v=function(t,e){return(v=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rc=_().merge,rf=function(t){function e(r){var n=t.call(this)||this;return n.options=rc(e.defaultOptions,r),n}return rl(e,t),e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});var r=this.options,n=r.start,o=r.end;n=Math.max(0,n||0);var i=Math.max((o=Math.min(o||1/0,t.getRowCount()))-n,0),a=t.getModified();return a.deleteRows(),a.setRows(t.getRows(n,i)),a.setOriginalRowIndexes(Array.from({length:i},function(e,r){return t.getOriginalRowIndex(n+r)})),this.emit({type:"afterModify",detail:e,table:t}),t},e.defaultOptions={type:"Range",start:0,end:1/0},e}(M);M.registerType("Range",rf);var rp=(g=function(t,e){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rh=_().merge,rd=function(t){function e(r){var n=t.call(this)||this;return n.options=rh(e.defaultOptions,r),n}return rp(e,t),e.ascending=function(t,e){return(t||0)<(e||0)?-1:+((t||0)>(e||0))},e.descending=function(t,e){return(e||0)<(t||0)?-1:+((e||0)>(t||0))},e.compareFactory=function(t,r){return r?"desc"===t?function(t,e){return-r(t,e)}:r:"asc"===t?e.ascending:e.descending},e.prototype.getRowReferences=function(t){for(var e=t.getRows(),r=[],n=0,o=e.length;n<o;++n)r.push({index:n,row:e[n]});return r},e.prototype.modifyTable=function(t,r){this.emit({type:"modify",detail:r,table:t});for(var n,o=t.getColumnIds(),i=t.getRowCount(),a=this.getRowReferences(t),s=this.options,u=s.direction,l=s.orderInColumn,c=s.compare,f=t.getModified(),p=("columns"in this.options)?this.options.columns:[this.options.orderByColumn],h=[],d=0,y=p.length;d<y;++d){var m=p[d],v="string"==typeof m,g=v?m:m.column,b=o.indexOf(g);-1!==b&&h.push({columnIndex:b,compare:e.compareFactory(v?u:m.direction||u,v?c:m.compare||c)})}if(h.length&&a.sort(function(t,e){for(var r=0,n=h.length;r<n;++r){var o=h[r],i=o.columnIndex,a=(0,o.compare)(t.row[i],e.row[i]);if(a)return a}return t.index-e.index}),l){for(var g=[],d=0;d<i;++d)g[a[d].index]=d;f.setColumns(((n={})[l]=g,n))}else{for(var w=[],O=[],C=void 0,d=0;d<i;++d)C=a[d],w.push(t.getOriginalRowIndex(C.index)),O.push(C.row);f.setRows(O,0),f.setOriginalRowIndexes(w)}return this.emit({type:"afterModify",detail:r,table:t}),t},e.defaultOptions={type:"Sort",direction:"desc",orderByColumn:"y"},e}(M);M.registerType("Sort",rd);var ry=(b=function(t,e){return(b=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rm=_().isFunction,rv=_().merge,rg=function(t){function e(r){var n=t.call(this)||this;return n.options=rv(e.defaultOptions,r),n}return ry(e,t),e.compile=function(t){var e=this;if(rm(t))return t;var r=t.operator;switch(r){case"and":var n=t.conditions.map(function(t){return e.compile(t)});return function(t,e,r){return n.every(function(n){return n(t,e,r)})};case"or":var o=t.conditions.map(function(t){return e.compile(t)});return function(t,e,r){return o.some(function(n){return n(t,e,r)})};case"not":var i=this.compile(t.condition);return function(t,e,r){return!i(t,e,r)}}var a=t.columnId,s=t.value;switch(r){case"==":return function(t){return t[a]==s};case"===":return function(t){return t[a]===s};case"!=":return function(t){return t[a]!=s};case"!==":return function(t){return t[a]!==s};case">":return function(t){return(t[a]||0)>(s||0)};case">=":return function(t){return(t[a]||0)>=(s||0)};case"<":return function(t){return(t[a]||0)<(s||0)};case"<=":return function(t){return(t[a]||0)<=(s||0)};case"empty":return function(t){return null===t[a]||""===t[a]}}var u=t.ignoreCase,l=function(t){var e=""+t;return null==u||u?e.toLowerCase():e};return"contains"===r?function(t){return l(t[a]).includes(l(s))}:function(t){return l(t[a])[r](l(s))}},e.prototype.modifyTable=function(t,r){this.emit({type:"modify",detail:r,table:t});var n=this.options.condition;if(!n)return t;for(var o=e.compile(n),i=t.getModified(),a=[],s=[],u=0,l=t.getRowCount();u<l;++u){var c=t.getRowObject(u);c&&o(c,t,u)&&(a.push(c),s.push(t.getOriginalRowIndex(u)))}return i.deleteRows(),i.setRows(a),i.setOriginalRowIndexes(s),this.emit({type:"afterModify",detail:r,table:t}),t},e.defaultOptions={type:"Filter"},e}(M);M.registerType("Filter",rg);var rb=_();rb.DataConnector=rb.DataConnector||ti,rb.DataConverter=rb.DataConverter||td,rb.DataCursor=rb.DataCursor||tg,rb.DataModifier=rb.DataModifier||M,rb.DataPool=rb.DataPool||tC,rb.DataTable=rb.DataTable||Q,rb.Formula=rb.Formula||eg;var rw=_();return T.default}()});