diff --git a/index.html b/index.html
index 539905e..bf77255 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
app
\ No newline at end of file
+app
\ No newline at end of file
diff --git a/js/vendor.d5b823ef9298b75f3c38.bundle.js b/js/vendor.d5b823ef9298b75f3c38.bundle.js
deleted file mode 100644
index 73430b0..0000000
--- a/js/vendor.d5b823ef9298b75f3c38.bundle.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see vendor.d5b823ef9298b75f3c38.bundle.js.LICENSE.txt */
-"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[736],{102:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,Token:()=>h});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function r(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,r,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}var o=function(t){function e(i){var s,r="EventError: "+i+"}";return s=t.call(this,r)||this,Object.setPrototypeOf(s,e.prototype),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(Error),h=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},a=0,l=function(t,e){return new o("Event listener with "+t.token+" id does not exist at Eventer with "+e+" id.")},u=function(){function t(){this.id=++a,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),r=i||h(this.id,++this.lastEventIndex);return s?s.set(r,e):this.topics.set(t,new Map([[r,e]])),r},t.prototype.has=function(t,e){var i,s;if(e)return(u=this.topics.get(e))?(c=u.get(t))||l(t,this.id):new o("Eventer with "+t.ownerIndex+" does not have "+e+".");try{for(var h=r(this.topics),a=h.next();!a.done;a=h.next()){var u,c,d=n(a.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{a&&!a.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(a=this.topics.get(e))||!a.delete(t));try{for(var o=r(this.topics),h=o.next();!h.done;h=o.next()){var a,l=n(h.value,2);if(l[0],(a=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return!1},t.prototype.allOff=function(){return this.topics.clear(),this},t.prototype.topicOff=function(t){return this.topics.delete(t)},t.prototype.emit=function(t){for(var e=[],i=1;i{i.r(e),i.d(e,{DataGenerator:()=>l,DataHost:()=>a,Stream:()=>h,createDeltaFunctionGenerator:()=>v,createOHLCGenerator:()=>x,createParametricFunctionGenerator:()=>D,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>k,createSpectrumDataGenerator:()=>I,createTraceGenerator:()=>m,createWaterDropDataGenerator:()=>O,createWhiteNoiseGenerator:()=>M});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},s(t,e)};function r(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n=function(){return n=Object.assign||function(t){for(var e,i=1,s=arguments.length;i0||-1===this.batchesLeft)&&i.length>0&&(this.data=this.data.concat(i.map((function(e){return t.infiniteReset(e)}))),i.length0||-1===this.batchesLeft||-2===this.batchesLeft&&this.data.length>0;return this.continueHandler&&(t=!0===this.continueHandler()),t},t.prototype.runStream=function(){var t=this.checkStreamContinue();if(this.data&&this.data.length>0&&t){if(this.streamHandler){var e=this.consume();this.streamHandler(e)}setTimeout(this.runStream,this.interval)}else this.streamActive=!1;this.batchesLeft>0&&this.batchesLeft--},t.prototype.activateStream=function(){this.streamActive||(this.streamActive=!0,this.runStream())},t.prototype.push=function(t){Array.isArray(t)?this.data=this.data.concat(t):this.data.push(t),this.activateStream()},t.prototype.map=function(e){return this.outputStream=new t(n(n({},this.options),{repeat:!1}),this.infiniteReset),this.mapHandler=e,this.streamHandler=this._map,this.activateStream(),this.outputStream},t.prototype._map=function(t){if(this.mapHandler&&this.outputStream){var e=t.map(this.mapHandler);this.outputStream.push(e)}},t.prototype.forEach=function(t){this.forEachHandler=t,this.streamHandler=this._forEach,this.activateStream()},t.prototype._forEach=function(t){this.forEachHandler&&t.forEach(this.forEachHandler)},t}(),a=function(){function t(t,e){this.data=[],this.derivativeDataHosts=[],this.promisesToResolve=[],this.streamsToPush=[],this.infiniteReset=this.infiniteReset.bind(this),this.infiniteResetHandler=t;var i={interval:e.interval,batchSize:e.batchSize,repeat:void 0!==e.repeat&&e.repeat};this.streamOptions=Object.freeze(i)}return t.prototype.toStream=function(){var t=new h(this.streamOptions,this.infiniteReset);return this.frozenData?t.push(this.frozenData):this.streamsToPush.push(t),t},t.prototype.toPromise=function(){var t=this;return this.frozenData?Promise.resolve(this.frozenData):new Promise((function(e){t.promisesToResolve.push(e)}))},t.prototype.infiniteReset=function(t){return this.infiniteResetHandler(t,this.frozenData?this.frozenData:[])},t.prototype.push=function(t){var e,i;if(!this.frozenData)if(Array.isArray(t))try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),r=s.next();!r.done;r=s.next()){var n=r.value;this.data.push(n)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}else this.data.push(t)},t.prototype.setData=function(t){this.data=t},t.prototype.freeze=function(){var t=this;this.frozenData||(this.frozenData=this.data,setTimeout((function(){t.promisesToResolve.forEach((function(e){return e(t.frozenData)})),t.promisesToResolve=[]}),0),setTimeout((function(){t.streamsToPush.forEach((function(e){return e.push(t.frozenData||[])})),t.streamsToPush=[]}),0),setTimeout((function(){t.handleDerivativeDataHosts()}),0),this.data=[])},t.prototype.getPointCount=function(){return this.frozenData?this.frozenData.length:0},t.prototype.handleDerivativeDataHosts=function(){var t=this;this.frozenData&&this.derivativeDataHosts.length>0&&(this.derivativeDataHosts.forEach((function(e){t.frozenData&&e.setData(t.frozenData),e.freeze()})),this.derivativeDataHosts=[])},t.prototype.setStreamInterval=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{interval:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamBatchSize=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{batchSize:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamRepeat=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{repeat:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t}();if("undefined"!=typeof window&&window.performance&&window.performance.now)o=window.performance.now.bind(window.performance);else try{o=Object(function(){var t=new Error("Cannot find module 'perf_hooks'");throw t.code="MODULE_NOT_FOUND",t}())}catch(t){throw new Error('Failed to detect "performance.now" API')}var l=function(){function t(t){this.options=t}return t.prototype.generate=function(){var t=new a(this.infiniteReset,{interval:500,batchSize:10,repeat:!1}),e=this.getPointCount(),i=this.generateChunks.bind(this,0,e,t);return setTimeout(i,0),t},t.prototype.generateChunks=function(t,e,i){for(var s=o(),r=[],n=0;o()-s<15&&t.5?this.offset+e:this.offset-e}return this.offset+this.options.dataMax>1?this.offset=1-this.options.dataMax:this.offset<0&&(this.offset=0),{x:t,y:this.offset+Math.random()*this.options.dataMax}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function d(){return new f({numberOfPoints:1e3})}var f=function(t){function e(e){var i=t.call(this,e)||this;i.previousPoint={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e={x:t,y:this.previousPoint.y+2*(Math.random()-.5)};return this.previousPoint=e,e},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function g(){return new p({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var p=function(t){function e(e){var i=t.call(this,e)||this;i.x=i.options.start;var s={samplingFunction:e.samplingFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setSamplingFunction=function(t){return new e(n(n({},this.options),{samplingFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.x,y:this.options.samplingFunction(this.x)};return this.x=this.x+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length*(e[e.length-1].x-e[e.length-2].x),y:t.y}},e}(l);function m(){return new y({numberOfPoints:1e3})}var y=function(t){function e(e){var i=t.call(this,e)||this;i.previous={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.previous.x+2*(Math.random()-.5),y:this.previous.y+2*(Math.random()-.5)};return this.previous=t,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function x(){return new S({numberOfPoints:1e3,startTimestamp:0,dataFreq:1,start:100,volatility:.1})}var S=function(t){function e(e){var i=t.call(this,e)||this;return i.prevPoint=[i.options.startTimestamp,i.options.start,i.options.start,i.options.start,i.options.start],i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setStartTimestamp=function(t){return new e(n(n({},this.options),{startTimestamp:t}))},e.prototype.setDataFrequency=function(t){return new e(n(n({},this.options),{dataFreq:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setVolatility=function(t){return new e(n(n({},this.options),{volatility:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e,i=this,s=this.options.startTimestamp+this.options.dataFreq*t,r=Math.random()>.5?1:-1,n=Array.from(Array(4)).map((function(t){var e=Math.random()*i.options.volatility*r;return i.prevPoint[4]+e<0&&(e*=-1),i.prevPoint[4]+e})).sort((function(t,e){return t-e}));return-1===r&&(n=[n[0],n[2],n[1],n[3]]),e=[s,n[1],n[3],n[0],n[2]],this.prevPoint=e,e},e.prototype.infiniteReset=function(t,e){return[t[0]+e.length*(e[e.length-1][0]-e[e.length-2][0]),t[1],t[2],t[3],t[4]]},e}(l);function v(){return new b({numberOfPoints:1e3,minGap:1,maxGap:-1,minAmplitude:.1,maxAmplitude:1,probability:.02})}var b=function(t){function e(e){var i=t.call(this,e)||this;i.lastSpike=0;var s={numberOfPoints:e.numberOfPoints,minGap:e.minGap,maxGap:e.maxGap,minAmplitude:e.minAmplitude,maxAmplitude:e.maxAmplitude,probability:e.probability};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setMinGap=function(t){return new e(n(n({},this.options),{minGap:t}))},e.prototype.setMaxGap=function(t){return new e(n(n({},this.options),{maxGap:t}))},e.prototype.setMinAmplitude=function(t){return new e(n(n({},this.options),{minAmplitude:t}))},e.prototype.setMaxAmplitude=function(t){return new e(n(n({},this.options),{maxAmplitude:t}))},e.prototype.setProbability=function(t){return new e(n(n({},this.options),{probability:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e=t-this.lastSpike,i={x:t,y:0};return(e>this.options.minGap||-1===this.options.minGap)&&(e1-this.options.probability&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t):e>=this.options.maxGap&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t)),i},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function M(){return new A({numberOfPoints:1e3})}var A=function(t){function e(e){var i=t.call(this,e)||this,s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(this.options?n(n({},this.options),{numberOfPoints:t}):{numberOfPoints:t})},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){return{x:t,y:2*(Math.random()-.5)}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function k(){return new w({inputData:[],samplingFrequency:50,step:0})}var w=function(t){function e(e){var i=t.call(this,e)||this;i.interval=1/(i.options.samplingFrequency||10);var s={inputData:e.inputData,samplingFrequency:e.samplingFrequency,step:e.step};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setInputData=function(t){return new e(n(n({},this.options),{inputData:t}))},e.prototype.setSamplingFrequency=function(t){return new e(n(n({},this.options),{samplingFrequency:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.options.inputData.length},e.prototype.generateDataPoint=function(t){return{timestamp:t*this.interval+t*this.options.step,data:this.options.inputData[t]}},e.prototype.infiniteReset=function(t,e){return{timestamp:t.timestamp+e[e.length-1].timestamp,data:t.data}},e}(l);function D(){return new E({xFunction:function(t){return 3*Math.cos(3*t)},yFunction:function(t){return 3*Math.sin(4*t)},start:0,end:1e3,step:.5})}var E=function(t){function e(e){var i=t.call(this,e)||this;i.t=i.options.start;var s={xFunction:e.xFunction,yFunction:e.yFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setXFunction=function(t){return new e(n(n({},this.options),{xFunction:t}))},e.prototype.setYFunction=function(t){return new e(n(n({},this.options),{yFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.options.xFunction(this.t),y:this.options.yFunction(this.t)};return this.t=this.t+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x,y:t.y}},e}(l),T={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function I(){return new C(T)}var C=function(t){function e(e){var i=t.call(this,e)||this,s={sampleSize:void 0!==e.sampleSize?e.sampleSize:T.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:T.numberOfSamples,variation:void 0!==e.variation?e.variation:T.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:T.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:T.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:T.narrowFactor2};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfSamples=function(t){return new e(n(n({},this.options),{numberOfSamples:t}))},e.prototype.setSampleSize=function(t){return new e(n(n({},this.options),{sampleSize:t}))},e.prototype.setVariation=function(t){return new e(n(n({},this.options),{variation:t}))},e.prototype.setFrequencyStability=function(t){return new e(n(n({},this.options),{frequencyStability:t}))},e.prototype.setNarrowFactor1=function(t){return new e(n(n({},this.options),{narrowFactor1:t}))},e.prototype.setNarrowFactor2=function(t){return new e(n(n({},this.options),{narrowFactor2:t}))},e.prototype.getPointCount=function(){return this.options.numberOfSamples},e.prototype.generateDataPoint=function(t){for(var e=100,i=this.options.variation,s=this.options.sampleSize,r=this.options.frequencyStability,n=s/8,o=s/2,h=new Array(s),a=0;as&&(n=s),(o+=(Math.random()-.5)*i/r/100*s)<0&&(o=0),o>s&&(o=s);var g,p=e/3*2,m=p/(f*f)*this.options.narrowFactor1,y=50/(f*f)*this.options.narrowFactor2;for(a=0;ae&&(l=e),(u=50-(d=.8*a-o)*d*y)<0&&(u=0),u>e&&(u=e),g=l+u,g+=g*(Math.random()-.5)*i/10,h[a]=(h[a]+g)/2,h[a]<0&&(h[a]=0),h[a]>e&&(h[a]=e),h[a]=.02*h[a];return h},e.prototype.infiniteReset=function(t,e){return t.slice()},e}(l),P={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function O(){return new F(P)}var F=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:P.rows,columns:void 0!==t.columns?t.columns:P.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:P.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:P.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:P.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:P.offsetLevel,volatility:void 0!==t.volatility?t.volatility:P.volatility};this.options=Object.freeze(e)}return t.prototype.setRows=function(e){return new t(n(n({},this.options),{rows:e}))},t.prototype.setColumns=function(e){return new t(n(n({},this.options),{columns:e}))},t.prototype.setWaterDrops=function(e){var i=e.map((function(t){return t.rowNormalized})),s=e.map((function(t){return t.columnNormalized})),r=e.map((function(t){return t.amplitude}));return new t(n(n({},this.options),{rowPositionsNormalized:i,columnPositionsNormalized:s,amplitudes:r}))},t.prototype.setOffsetLevel=function(e){return new t(n(n({},this.options),{offsetLevel:e}))},t.prototype.setVolatility=function(e){return new t(n(n({},this.options),{volatility:e}))},t.prototype.generate=function(){var t=this;return new Promise((function(e){return i=t,s=void 0,n=function(){var t,i,s,r,n,o,h,a,l,u,c,d,f,g,p,m,y,x,S;return function(t,e){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function h(n){return function(h){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]0&&p%1e3==0&&Date.now()-g>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:v.sent(),g=Date.now(),v.label=4;case 4:return x++,S+=d,[3,2];case 5:return m++,y+=f,[3,1];case 6:return e(c),[2]}}))},new((r=void 0)||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function h(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,h)}a((n=n.apply(i,s||[])).next())}));var i,s,r,n}))},t}()},187:t=>{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,p=e&&e.length,m=p?e[0]*s:t.length,y=i(t,0,m,s,!0),x=[];if(!y||y.next===y.prev)return x;if(p&&(y=function(t,e,s,r){var n,o,h,a=[];for(n=0,o=e.length;n80*s){n=h=t[0],o=a=t[1];for(var S=s;Sh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(y,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===D(t,e,i,s)>0)for(n=e;n=e;n-=s)o=A(n,t[n],t[n+1],o);return o&&y(o,o.next)&&(k(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!y(s,s.next)&&0!==m(s.prev,s,s.next))s=s.next;else{if(k(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,p,m=t;t.prev!==t.next;)if(g=t.prev,p=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(p.i/i|0),k(t),t=p.next,m=p.next;else if((t=p)===m){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,p=s.next;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=c&&p.y<=f&&g(r,h,n,a,o,l,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(m(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,p=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,v=d(p,y,e,i,s),b=d(x,S,e,i,s),M=t.prevZ,A=t.nextZ;M&&M.z>=v&&A&&A.z<=b;){if(M.x>=p&&M.x<=x&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,A.x>=p&&A.x<=x&&A.y>=y&&A.y<=S&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&m(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;M&&M.z>=v;){if(M.x>=p&&M.x<=x&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;A&&A.z<=b;){if(A.x>=p&&A.x<=x&&A.y>=y&&A.y<=S&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&m(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!y(n,o)&&x(n,r,r.next,o)&&b(n,o)&&b(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),k(r),k(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&p(a,l)){var u=M(a,l);return a=s(a,a.next),u=s(u,u.next),r(a,e,i,n,o,h,0),void r(u,e,i,n,o,h,0)}l=l.next}a=a.next}while(a!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,o=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var h=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(h<=r&&h>o&&(o=h,i=s.x=s.x&&s.x>=u&&r!==s.x&&g(ni.x||s.x===i.x&&c(i,s)))&&(i=s,f=a)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=M(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function p(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||y(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=v(m(t,e,i)),n=v(m(t,e,s)),o=v(m(i,s,t)),h=v(m(i,s,e));return r!==n&&o!==h||!(0!==r||!S(t,i,e))||!(0!==n||!S(t,s,e))||!(0!==o||!S(i,t,s))||!(0!==h||!S(i,e,s))}function S(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function v(t){return t>0?1:t<0?-1:0}function b(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function M(t,e){var i=new w(t.i,t.x,t.y),s=new w(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function A(t,e,i,s){var r=new w(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function k(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function w(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function D(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},369:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>w,Iterable:()=>Es,List:()=>ai,Map:()=>Le,OrderedMap:()=>Mi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>ji,Record:()=>ps,Repeat:()=>Ms,Seq:()=>K,Set:()=>Gi,Stack:()=>Ti,default:()=>Ts,fromJS:()=>As,get:()=>ae,getIn:()=>Yi,has:()=>he,hasIn:()=>Zi,hash:()=>yt,is:()=>ft,isAssociative:()=>k,isCollection:()=>S,isImmutable:()=>F,isIndexed:()=>A,isKeyed:()=>b,isList:()=>hi,isMap:()=>ut,isOrdered:()=>B,isOrderedMap:()=>ct,isOrderedSet:()=>Bi,isPlainObject:()=>re,isRecord:()=>O,isSeq:()=>C,isSet:()=>Ri,isStack:()=>Ei,isValueObject:()=>dt,merge:()=>ke,mergeDeep:()=>De,mergeDeepWith:()=>Ee,mergeWith:()=>we,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ds});var s="delete",r=5,n=1<>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?u(t)+e:e}function d(){return!0}function f(t,e,i){return(0===t&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return m(t,e,0)}function p(t,e){return m(t,e,e)}function m(t,e,i){return void 0===t?i:y(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function y(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[x])}var v="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[v])}var M="@@__IMMUTABLE_INDEXED__@@";function A(t){return Boolean(t&&t[M])}function k(t){return b(t)||A(t)}var w=function(t){return S(t)?t:K(t)},D=function(t){function e(t){return b(t)?t:J(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),E=function(t){function e(t){return A(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),T=function(t){function e(t){return S(t)&&!k(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=D,w.Indexed=E,w.Set=T;var I="@@__IMMUTABLE_SEQ__@@";function C(t){return Boolean(t&&t[I])}var P="@@__IMMUTABLE_RECORD__@@";function O(t){return Boolean(t&&t[P])}function F(t){return S(t)||O(t)}var R="@@__IMMUTABLE_ORDERED__@@";function B(t){return Boolean(t&&t[R])}var z=0,_=1,L=2,G="function"==typeof Symbol&&Symbol.iterator,V="@@iterator",N=G||V,W=function(t){this.next=t};function H(t,e,i,s){var r=0===t?e:1===t?i:[e,i];return s?s.value=r:s={value:r,done:!1},s}function U(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!$(t)}function j(t){return t&&"function"==typeof t.next}function Y(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(G&&t[G]||t[V]);if("function"==typeof e)return e}W.prototype.toString=function(){return"[Iterator]"},W.KEYS=z,W.VALUES=_,W.ENTRIES=L,W.prototype.inspect=W.prototype.toSource=function(){return this.toString()},W.prototype[N]=function(){return this};var Z=Object.prototype.hasOwnProperty;function q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var K=function(t){function e(t){return null==t?nt():F(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=$(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=$(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new W((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return H(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),J=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?b(t)?t.toSeq():t.fromEntrySeq():O(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(K),Q=function(t){function e(t){return null==t?nt():S(t)?b(t)?t.entrySeq():t.toIndexedSeq():O(t)?t.toSeq().entrySeq():ht(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(K),tt=function(t){function e(t){return(S(t)&&!k(t)?t:Q(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(K);K.isSeq=C,K.Keyed=J,K.Set=tt,K.Indexed=Q,K.prototype[I]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new W((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return H(t,n,i[n])}))},e}(Q),it=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Z.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,r=s.length,n=0;n!==r;){var o=s[e?r-++n:n++];if(!1===t(i[o],o,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,r=s.length,n=0;return new W((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return H(t,o,i[o])}))},e}(J);it.prototype[R]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=Y(this._collection),s=0;if(j(i))for(var r;!(r=i.next()).done&&!1!==t(r.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=Y(this._collection);if(!j(i))return new W(U);var s=0;return new W((function(){var e=i.next();return e.done?e:H(t,s++,e.value)}))},e}(Q);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return q(t)?new et(t):X(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&B(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function pt(t){return t>>>1&1073741824|3221225471&t}var mt=Object.prototype.valueOf;function yt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return pt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==mt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return pt(e)}(r);case"string":return r.length>Tt?(void 0===(s=Pt[i=r])&&(s=St(i),Ct===It&&(Ct=0,Pt={}),Ct++,Pt[i]=s),s):St(r);case"object":case"function":return function(t){var e;if(kt&&void 0!==(e=At.get(t)))return e;if(void 0!==(e=t[Et]))return e;if(!bt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Et]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=Mt(),kt)At.set(t,e);else{if(void 0!==vt&&!1===vt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)Object.defineProperty(t,Et,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Et]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Et]=e}}return e}(r);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=Mt(),wt[t]=e),e}(r);default:if("function"==typeof r.toString)return St(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function St(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&eh)return{value:void 0,done:!0};var t=r.next();return s||e===_||t.done?t:H(e,a-1,e===z?void 0:t.value[1],t)}))},l}function Nt(t,e,i,s){var r=qt(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(L,n),a=!0,l=0;return new W((function(){var t,n,u;do{if((t=h.next()).done)return s||r===_?t:H(r,l++,r===z?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===L?t:H(r,n,u,t)}))},r}function Wt(t,e,i){var s=qt(t);return s.__iterateUncached=function(r,n){if(n)return this.cacheResult().__iterate(r,n);var o=0,h=!1;return function t(a,l){a.__iterate((function(n,a){return(!e||l0}function jt(t,e,i,s){var r=qt(t),n=new et(i).map((function(t){return t.size}));return r.size=s?n.max():n.min(),r.__iterate=function(t,e){for(var i,s=this.__iterator(_,e),r=0;!(i=s.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var n=i.map((function(t){return t=w(t),Y(r?t.reverse():t)})),o=0,h=!1;return new W((function(){var i;return h||(i=n.map((function(t){return t.next()})),h=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),h?{value:void 0,done:!0}:H(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Yt(t,e){return t===e?t:C(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Zt(t){return b(t)?D:A(t)?E:T}function qt(t){return Object.create((b(t)?J:A(t)?Q:tt).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function Jt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[i]=arguments[i+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Ae(this,e,t)}function Ae(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Ie(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ie(e,i,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Te(t,e)}function Ee(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Te(e,i,t)}function Te(t,e,i){return Ie(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=K(i),h=K(n),A(o)===A(h)&&b(o)===b(h))?Ie(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Ie(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(F(t))return"function"==typeof i&&t.mergeWith?t.mergeWith.apply(t,[i].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var s=Array.isArray(t),r=t,n=s?E:D,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=Z.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=le(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Te(this,e,t)}function Oe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Ie(t,e)}))}function Fe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Te(t,e)}))}function Re(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Be(){return this.__ownerID?this:this.__ensureOwner(new l)}function ze(){return this.__ensureOwner()}function _e(){return this.__altered}var Le=function(t){function e(e){return null==e?qe():ut(e)&&!B(e)?e:qe().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t,e){return i.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return qe().withMutations((function(e){for(var i=0;i=t.length)throw new Error("Missing value for key: "+t[i]);e.set(t[i],t[i+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,h)},e.prototype.deleteAll=function(t){var e=w(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):qe()},e.prototype.sort=function(t){return Mi(Ht(this,t))},e.prototype.sortBy=function(t,e){return Mi(Ht(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(r,n){s.set(n,t.call(e,r,n,i))}))}))},e.prototype.__iterator=function(t,e){return new je(this,t,e)},e.prototype.__iterate=function(t,e){var i=this,s=0;return this._root&&this._root.iterate((function(e){return s++,t(e[1],e[0],i)}),e),s},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ze(this.size,this._root,t,this.__hash):0===this.size?qe():(this.__ownerID=t,this.__altered=!1,this)},e}(D);Le.isMap=ut;var Ge=Le.prototype;Ge[lt]=!0,Ge[s]=Ge.remove,Ge.removeAll=Ge.deleteAll,Ge.setIn=pe,Ge.removeIn=Ge.deleteIn=ye,Ge.update=Se,Ge.updateIn=ve,Ge.merge=Ge.concat=be,Ge.mergeWith=Me,Ge.mergeDeep=Ce,Ge.mergeDeepWith=Pe,Ge.mergeIn=Oe,Ge.mergeDeepIn=Fe,Ge.withMutations=Re,Ge.wasAltered=_e,Ge.asImmutable=ze,Ge["@@transducer/init"]=Ge.asMutable=Be,Ge["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ge["@@transducer/result"]=function(t){return t.asImmutable()};var Ve=function(t,e){this.ownerID=t,this.entries=e};Ve.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new Ue(t,yt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return 0==(h&n)?s:this.nodes[ei(h&n-1)].get(t+r,e,i,s)},Ne.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=yt(s));var c=(0===e?i:i>>>e)&o,d=1<=ri)return function(t,e,i,s,r){for(var o=0,h=new Array(n),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=r,new We(t,o+1,h)}(t,m,f,c,x);if(g&&!x&&2===m.length&&Qe(m[1^p]))return m[1^p];if(g&&x&&1===m.length&&Qe(x))return x;var S=t&&t===this.ownerID,v=g?x?f:f^d:f|d,b=g?x?ii(m,p,x,S):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},We.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=yt(s));var u=(0===e?i:i>>>e)&o,c=n===h,d=this.nodes,f=d[u];if(c&&!f)return this;var g=Je(f,t,e+r,i,s,n,a,l);if(g===f)return this;var p=this.count;if(f){if(!g&&--p>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new Ue(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Qt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=pi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Si(t,e).set(0,i):Si(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=vi(t._capacity)?s=mi(s,t.__ownerID,0,e,i,n):r=mi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Si(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=yi(this,t);if(!h)for(var u=0;u>>e&o;if(n>=this.array.length)return this;if(e>0){var h=this.array[n];if((s=h&&h.removeAfter(t,e-r,i))===h&&n===this.array.length-1)return this}var a=yi(this,t);return a.array.splice(n+1),s&&(a.array[n]=s),a};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=vi(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=mi(d,e,i-r,s,n,h);return f===d?t:((l=yi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=yi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function yi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=vi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Si(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=vi(h),p=vi(u);p>=1<g?new ui([],s):m;if(m&&p>g&&ar;S-=r){var v=g>>>S&o;x=x.array[v]=yi(x.array[v],s)}x.array[g>>>r&o]=m}if(u=p)a-=p,u-=p,c=r,d=null,y=y&&y.removeBefore(s,0,a);else if(a>n||p>>c&o;if(b!==p>>>c&o)break;b&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&p>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Ai(s,r)}Mi.isOrderedMap=ct,Mi.prototype[R]=!0,Mi.prototype[s]=Mi.prototype.remove;var Di="@@__IMMUTABLE_STACK__@@";function Ei(t){return Boolean(t&&t[Di])}var Ti=function(t){function e(t){return null==t?Oi():Ei(t)?t:Oi().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var i=this._head;for(t=c(this,t);i&&t--;)i=i.next;return i?i.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:t[s],next:i};return this.__ownerID?(this.size=e,this._head=i,this.__hash=void 0,this.__altered=!0,this):Pi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Ei(e))return e;ee(e.size);var i=this.size,s=this._head;return e.__iterate((function(t){i++,s={value:t,next:s}}),!0),this.__ownerID?(this.size=i,this._head=s,this.__hash=void 0,this.__altered=!0,this):Pi(i,s)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Oi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(p(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Pi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Pi(this.size,this._head,t,this.__hash):0===this.size?Oi():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new et(this.toArray()).__iterate((function(e,s){return t(e,s,i)}),e);for(var s=0,r=this._head;r&&!1!==t(r.value,s++,this);)r=r.next;return s},e.prototype.__iterator=function(t,e){if(e)return new et(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new W((function(){if(s){var e=s.value;return s=s.next,H(t,i++,e)}return{value:void 0,done:!0}}))},e}(E);Ti.isStack=Ei;var Ii,Ci=Ti.prototype;function Pi(t,e,i,s){var r=Object.create(Ci);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Oi(){return Ii||(Ii=Pi(0))}Ci[Di]=!0,Ci.shift=Ci.pop,Ci.unshift=Ci.push,Ci.unshiftAll=Ci.pushAll,Ci.withMutations=Re,Ci.wasAltered=_e,Ci.asImmutable=ze,Ci["@@transducer/init"]=Ci.asMutable=Be,Ci["@@transducer/step"]=function(t,e){return t.unshift(e)},Ci["@@transducer/result"]=function(t){return t.asImmutable()};var Fi="@@__IMMUTABLE_SET__@@";function Ri(t){return Boolean(t&&t[Fi])}function Bi(t){return Ri(t)&&B(t)}function zi(t,e){if(t===e)return!0;if(!S(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||b(t)!==b(e)||A(t)!==A(e)||B(t)!==B(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!k(t);if(B(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&&ft(r[1],t)&&(i||ft(r[0],e))}))&&s.next().done}var r=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{r=!0;var n=t;t=e,e=n}var o=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!ft(e,t.get(s,h)):!ft(t.get(s,h),e))return o=!1,!1}));return o&&t.size===a}function _i(t,e){var i=function(i){t.prototype[i]=e[i]};return Object.keys(e).forEach(i),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(i),t}function Li(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!ne(t))return t;t=K(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=Li(t)})),e}var i=[];return t.__iterate((function(t){i.push(Li(t))})),i}var Gi=function(t){function e(e){return null==e?Ui():Ri(e)&&!B(e)?e:Ui().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(D(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ni.intersect.apply(e(t.pop()),t):Ui()},e.union=function(t){return(t=w(t).toArray()).length?Ni.union.apply(e(t.pop()),t):Ui()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Wi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Wi(this,this._map.remove(t))},e.prototype.clear=function(){return Wi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Wi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=pt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(yt(t),yt(e))|0}:function(t,e){s=s+as(yt(t),yt(e))|0}:e?function(t){s=31*s+yt(t)|0}:function(t){s=s+yt(t)|0}),s)}(this))}});var Ki=w.prototype;Ki[x]=!0,Ki[N]=Ki.values,Ki.toJSON=Ki.toArray,Ki.__toStringMapper=oe,Ki.inspect=Ki.toSource=function(){return this.toString()},Ki.chain=Ki.flatMap,Ki.contains=Ki.includes,_i(D,{flip:function(){return Yt(this,zt(this))},mapEntries:function(t,e){var i=this,s=0;return Yt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Yt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var Ji=D.prototype;Ji[v]=!0,Ji[N]=Ki.entries,Ji.toJSON=qi,Ji.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},_i(E,{toKeyedSeq:function(){return new Ot(this,!1)},filter:function(t,e){return Yt(this,Gt(this,t,e,!1))},findIndex:function(t,e){var i=this.findEntry(t,e);return i?i[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Yt(this,Lt(this,!1))},slice:function(t,e){return Yt(this,Vt(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return Yt(this,1===i?s:s.concat(Qt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var i=this.findLastEntry(t,e);return i?i[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Yt(this,Wt(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,i){return i===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function as(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}ts.has=Ki.includes,ts.contains=ts.includes,ts.keys=ts.values,_i(J,Ji),_i(Q,Qi),_i(tt,ts);var ls=function(t){function e(t){return null==t?fs():Bi(t)?t:fs().withMutations((function(e){var i=T(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(D(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Gi);ls.isOrderedSet=Bi;var us,cs=ls.prototype;function ds(t,e){var i=Object.create(cs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function fs(){return us||(us=ds(ki()))}cs[R]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ps=function(t,e){var i;!function(t){if(O(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(F(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var s=function(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function ks(t,e,i,s,r,n){if("string"!=typeof i&&!F(i)&&(q(i)||X(i)||re(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==s&&r.push(s);var o=e.call(n,s,K(i).map((function(s,n){return ks(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return A(e)?e.toList():b(e)?e.toMap():e.toSet()}var Ds="4.3.0",Es=w;const Ts={version:Ds,Collection:w,Iterable:w,Seq:K,Map:Le,OrderedMap:Mi,List:ai,Stack:Ti,Set:Gi,OrderedSet:ls,PairSorting:gs,Record:ps,Range:ji,Repeat:Ms,is:ft,fromJS:As,hash:yt,isImmutable:F,isCollection:S,isKeyed:b,isIndexed:A,isAssociative:k,isOrdered:B,isValueObject:dt,isPlainObject:re,isSeq:C,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ei,isSet:Ri,isOrderedSet:Bi,isRecord:O,get:ae,getIn:Yi,has:he,hasIn:Zi,merge:ke,mergeDeep:De,mergeWith:we,mergeDeepWith:Ee,remove:ue,removeIn:me,set:ce,setIn:ge,update:xe,updateIn:de}},475:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(369),r=i(102),n=i(187),o=function(t){if(t&&t.i)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}(s),h=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(n);class a{constructor(){this.o=!0}l(){return this.o}}class l extends a{constructor(t,e){super(),this.u=t,this.o=e}S(t){return t!==this.u&&(this.u=t,this.o=!0),this}M(){return this.u}l(){return super.l()}}const u=(t,e)=>({x:t,y:e}),c=(t,e)=>({x:t,y:e}),d=(t,e,i)=>({position:t,high:e,low:i}),f=(t,e,i)=>({x:t,y:e,z:i}),g=t=>{const e=Array(0),i=Array(0);return t.length>0&&t.forEach((t=>{e.push(u(t.position,t.high)),i.push(u(t.position,t.low))})),[e,i]},p=(t,e)=>({min:t,max:e}),m=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),y=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),S=x,v=(t,e)=>({left:void 0!==e.left?e.left:t.left,top:void 0!==e.top?e.top:t.top,right:void 0!==e.right?e.right:t.right,bottom:void 0!==e.bottom?e.bottom:t.bottom}),b=s.Record({r:1,g:1,b:1,a:1});class M extends b{constructor(t){super(t)}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this._||(this._=new M({r:this.r+.45*(1-this.r),g:this.g+.45*(1-this.g),b:this.b+.45*(1-this.b),a:this.a<1?this.a+.45*(1-this.a):1})),this._}getLighter(){return this.C||(this.C=new M({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.C}getDarker(){return this.T||(this.T=new M({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.T}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const A=(t,e,i,s=255)=>new M({r:t/255,g:e/255,b:i/255,a:s/255}),k=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new M({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255,a:Number(`0x${e.substring(6,8)}`)/255});case 6:return new M({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255});case 4:return new M({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255,a:Number(`0x${e.charAt(3)}${e.charAt(3)}`)/255});case 3:return new M({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},w=(t,e=1,i=1)=>{let s,r,n;t/=360;const o=Math.floor(6*t),h=6*t-o,a=i*(1-e),l=i*(1-h*e),u=i*(1-(1-h)*e);switch(o%6){case 0:s=i,r=u,n=a;break;case 1:s=l,r=i,n=a;break;case 2:s=a,r=i,n=u;break;case 3:s=a,r=l,n=i;break;case 4:s=u,r=a,n=i;break;default:s=i,r=a,n=l}return new M({r:s,g:r,b:n})},D={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},E=new M({}),T=A(0,0,0,0),I=(t,e)=>t.value-e.value,C=s.Record({steps:[],title:"",units:"",interpolate:!0,color:A(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1}),P=t=>{const{steps:e}=t,i=e.length;e.sort(I);const[s,r]=i>0?[e[0].value,e[i-1].value]:[0,0],n=i>0?i-1:0,o=Array(n);for(let t=0;t0&&s!==r}};class O extends C{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,P(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.map((t=>`${t.value},${t.color.toString()}`)).join(",")}`}setSteps(t){return this.merge(P({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}getColors(t){if(Array.isArray(t)){if(Array.isArray(t[0])){const e=t,i=e.length,s=e[0].length,r=[...Array(i)].map((()=>Array(s)));for(let t=0;t=a&&t<=l){if(a===l)return i.color;const e=(t-i.value)/(h.value-i.value);return s=i.color,r=h.color,n=e,new M({r:s.r+(r.r-s.r)*n,g:s.g+(r.g-s.g)*n,b:s.b+(r.b-s.b)*n,a:s.a+(r.a-s.a)*n})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const F=s.Record({});class R extends F{constructor(){super(...arguments),this.type="fillstyle"}toString(){return"emptyFill"}}const B=new R,z=s.Record({color:A(255,255,255)});class _ extends z{constructor(){super(...arguments),this.type="fillstyle"}}class L extends _{constructor(t){super(t)}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return t instanceof M?this.set("color",t):this.set("color",t(this.get("color")))}getColor(){return this.get("color")}setA(t){return this.setColor(this.getColor().setA(t))}setR(t){return this.setColor(this.getColor().setR(t))}setG(t){return this.setColor(this.getColor().setG(t))}setB(t){return this.setColor(this.getColor().setB(t))}}class G extends _{constructor(t){super(t)}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return t instanceof M?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const V=s.Record({lut:new O({steps:[]}),lookUpProperty:"value"});class N extends V{constructor(t){super(t),this.type="fillstyle"}toString(){return`palettedFill:lut=${this.lut.toString()},lookUpProperty=${this.lookUpProperty}`}getPalette(){return this.get("lut")}setLookUpProperty(t){return"function"==typeof t?this.set("lookUpProperty",t(this.get("lookUpProperty"))):this.set("lookUpProperty",t)}getLookUpProperty(){return this.get("lookUpProperty")}}const W={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=te(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.F)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.D=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.P.emit("start")}start(){return this.D.includes(this)||this.D.push(this),this}addNextAnimations(t){return t instanceof Array?t.forEach((t=>this.nextAnimations.push(t))):this.nextAnimations.push(t),this}NextAnimation(t,e,i=this.duration,s=this.easing){const r=new H(t,e,i,s,this.D);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.P.on("start",t,e)}onAnimationEnd(t,e){return this.P.on("end",t,e)}onEveryAnimationEnd(t,e){return this.P.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.P.on("allEnd",t,e)}allOffAnimationEnd(){return this.P.topicOff("end"),this}allOffEveryAnimationEnd(){return this.P.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.P.topicOff("allEnd"),this}offAnimationEnd(t){return this.P.off(t,"end")}offEveryAnimationEnd(t){return this.P.off(t,"everyEnd")}offAllAnimationEnd(t){return this.P.off(t,"allEnd")}finish(t=!0){if(this.F=!0,this.D.splice(this.D.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.P.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.P.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.P.emit("end",e),this.P.emit("everyEnd",e)),e}t&&(this.P.emit("end",void 0),this.P.emit("everyEnd",void 0),this.P.emit("allEnd"))}finishAll(t=!0){let e=this;for(;e;)e=e.finish(t)}getFinalValues(){return this.nextAnimations.length>0?this.nextAnimations[this.nextAnimations.length-1].values.map(bt):this.values.map(bt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let e=0;e{e>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const i=[];let s,r,n=0;const o=()=>{s=void 0;const h=Date.now();r=r||h,n=h-r,n/1e3>=1/e&&(r=Date.now()-n%(1e3/e),i.forEach((t=>{0===t.delta&&t.O(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=mt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=W.linear)=>(r,n,h=t)=>{const a=new H(r,n,h,e,i).start();return s||(s=mt.requestAnimationFrame(o)),a}};var X,j;e.GradientShape=void 0,(X=e.GradientShape||(e.GradientShape={})).circle="circle",X.ellipse="ellipse",e.GradientExtent=void 0,(j=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",j.closestCorner="closest-corner",j.farthestSide="farthest-side",j.farthestCorner="farthest-corner";const Y=s.Record({stops:[{color:k("#f00"),offset:0},{color:k("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class $ extends Y{constructor(t){if(super(t),this.type="fillstyle",null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.")}toString(){return`radialGradientFill:${this.shape},${this.extent},${this.position.x},${this.position.y},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)}getColorStops(){return this.get("stops")}setPosition(t){return this.set("position",t)}getPosition(){return this.get("position")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}setExtent(t){return this.set("extent",t)}getExtent(){return this.get("extent")}}const Z=s.Record({stops:[{color:k("#f00"),offset:0},{color:k("#0f0"),offset:1}],angle:0});class q extends Z{constructor(t){if(super(t),this.type="fillstyle",null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("LinearGradientFill requires minimum two color stops to be defined.")}toString(){return`linearGradientFill:${this.angle},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");const e=t.sort(((t,e)=>t.offset-e.offset));return this.set("stops",e)}getColorStops(){return this.get("stops")}setAngle(t,e){return this.set("angle",e?ai(t):t)}getAngle(t){return t?hi(this.get("angle")):this.get("angle")}}const K=s.Record({}),J=new class extends K{constructor(){super(...arguments),this.type="linestyle",this.lineType="empty",this.thickness=0}setThickness(t){return this}getThickness(){return 0}L(){return 0}setFillStyle(t){return this}getFillStyle(){return B}},Q=s.Record({fillStyle:new L({color:A(255,255,255)}),thickness:1});class tt extends Q{constructor(t){super(t),this.type="linestyle",this.lineType="solid"}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setThickness(t){return"function"==typeof t?this.set("thickness",t(this.getThickness())):this.set("thickness",t)}getThickness(){return this.get("thickness")}L(){const t=this.getThickness();return t<0?1:t}}class et{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new it,this.y=new it,this.z=new it,this.P=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Oe,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=n.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=n.x&&i{this.cellsAmount.y=t.reduce(Oe,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=n.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=n.y&&i{s.x.N(e),s.y.N(r)}}}G(){return this.V&&(this.V(),this.V=void 0),this}W(t){return this.P.on("cell-resize",t)}H(t){return this.P.off(t,"cell-resize")}}class it extends a{constructor(){super(...arguments),this.U=0,this.$=10,this.Y=1}X(){return this.o=!1,this}j(){return this.o=!0,this}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}Z(t,e){return this.U=t,this.$=e,this.K(),this}q(t){return this.Y=t,this.K(),this}J(t){return t/this.Y}K(){const t=this.J(this.$-this.U),e=this.Y;void 0!==this.tt&&!1!==kt(t,this.tt)||(this.o=!0,this.it=e,this.tt=t)}st(){return this.tt}et(){return this.it}ht(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).nt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new et({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},rt=(t,e,i)=>e===i?t:i.ot(e.ct(t)),nt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Ei?e.x:e.x instanceof Ei?e.x.x:e.x.ut,r=e instanceof Ei?e.y:e.y instanceof Ei?e.y.y:e.y.ut,n=i instanceof Ei?i.x:i.x instanceof Ei?i.x.x:i.x.ut,o=i instanceof Ei?i.y:i.y instanceof Ei?i.y.y:i.y.ut;return{...t,x:rt(t.x,s,n),y:rt(t.y,r,o)}},ot=(...t)=>{if(0===t.length)return{remove:At};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,r,n)=>((i,s,r)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.dt(s,r,!1,!1,"synchronizedAxis"))),e=!1)})(i,r,n)))));let s=!1;const r=t.map((e=>e.onStoppedStateChanged(((i,r)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,r)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(r[e])}))}}};class ht{constructor(t){this.ft=t,this.St=new Map}yt(t){return!!this.St.get(t)}M(t){const e=this.St.get(t);return e&&e.textureInfo}xt(t){if(t instanceof O){let e=this.St.get(t);e&&(e={textureInfo:e.textureInfo,refs:e.refs+1},this.St.set(t,e))}else t.textureInfo&&this.St.set(t.lut,{textureInfo:t.textureInfo,refs:1});return this}bt(t){if(!t)return this;let e=this.St.get(t);return e&&(e={textureInfo:e.textureInfo,refs:e.refs-1},0===e.refs?(this.ft.deleteTexture(e.textureInfo.texture),this.St.delete(t)):this.St.set(t,e)),this}vt(){this.St.forEach((t=>{this.ft.deleteTexture(t.textureInfo.texture)})),this.St.clear()}Mt(t){const e=this.St.get(t);return e?e.refs:void 0}_t(){return this.St.size}}const at=t=>new ht(t);class lt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,lt.prototype)}}class ut extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&mt.alert(s),Object.setPrototypeOf(this,ut.prototype)}}class ct extends ut{constructor(t){super(t),Object.setPrototypeOf(this,ct.prototype)}}var dt,ft,gt,pt;e.UISpace=void 0,(dt=e.UISpace||(e.UISpace={}))[dt.Content=0]="Content",dt[dt.PaddedContent=1]="PaddedContent",dt[dt.PaddedBackground=2]="PaddedBackground",dt[dt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(ft=e.UIVisibilityModes||(e.UIVisibilityModes={}))[ft.never=0]="never",ft[ft.always=1]="always",ft[ft.whenHovered=2]="whenHovered",ft[ft.whenDragged=3]="whenDragged",ft[ft.whenNotDragged=4]="whenNotDragged",ft[ft.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(gt=e.UIDraggingModes||(e.UIDraggingModes={}))[gt.notDraggable=0]="notDraggable",gt[gt.draggable=1]="draggable",gt[gt.onlyHorizontal=2]="onlyHorizontal",gt[gt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(pt=e.UIDirections||(e.UIDirections={}))[pt.Up=0]="Up",pt[pt.Right=1]="Right",pt[pt.Down=2]="Down",pt[pt.Left=3]="Left";const mt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},yt=(t,e)=>t.x===e.x&&t.y===e.y,xt=t=>t!==ke&&t!==we&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,St=(t,e)=>Math.min(t,e.y),vt=(t,e)=>Math.max(t,e.y),bt=t=>t[1],Mt=t=>t.dispose(),At=()=>{},kt=(t,e)=>t===e,wt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Dt=t=>Array.prototype.concat.apply([],t),Et=(t,e)=>{const{x:i,y:s}={x:t[0].length,y:t.length},{column:r,row:n}=e,o=Math.max(0,r.start),h=Math.min(i,r.end),a=Math.max(0,n.start),l=Math.min(s,n.end),u=h-o,c=l-a,d=Array.from(Array(c)).map((()=>Array(u)));for(let e=a,i=0;e{const i=e&&void 0!==e.row.start?e.row.start:0,s=e&&void 0!==e.row.end?e.row.end:t.y,r=e&&void 0!==e.column.start?e.column.start:0,n=e&&void 0!==e.column.end?e.column.end:t.x;return[Math.min(i,s),Math.max(i,s),Math.min(r,n),Math.max(r,n)]},It=(t,e)=>{for(;e;)t.push(t.shift()),e-=1},Ct=t=>{const e=[];for(const i of t)e.push(i.slice());return e},Pt=(t,e)=>void 0!==t?t:e,Ot=t=>t.At(),Ft=t=>t.wt(),Rt=t=>t.kt(),Bt=t=>t.Ct(),zt=t=>t.min.x,_t=t=>t.max.x,Lt=t=>t.min.y,Gt=t=>t.max.y,Vt=(t,e,i,s,r)=>{if(t.length>0){let n=r?s(r):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Wt=u(0,1),Ht=u(1,0),Ut=u(0,-1),Xt=u(-1,0),jt=u(0,0),Yt=t=>{switch(t){case e.UIDirections.Up:return Wt;case e.UIDirections.Right:return Ht;case e.UIDirections.Down:return Ut;case e.UIDirections.Left:return Xt;default:return jt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Zt=t=>{t.stopPropagation(),t.preventDefault()},qt=(t,e)=>{if(!e){const e=t.length,i=new Float32Array(2*e);let s=0;for(let r=0;r{const e=t.length,i=new Float32Array(3*e);let s=0;for(let r=0;re=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},Qt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ee=te(Math.E),ie=(t,e)=>{const i=e[t];return i?i():void 0},se=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;ili(ti(t,i))-li(ti(e,i))))},re=(t,e,i)=>{if(0===t.length)return!1===i.canReturnB?e.slice():e;const s=e.length;if(s<1e5)return t.push.apply(t,e),t;for(let i=0;ii<0?t:i>1?e:A(t.getR()+i*(e.getR()-t.getR()),t.getG()+i*(e.getG()-t.getG()),t.getB()+i*(e.getB()-t.getB()),t.getA()+i*(e.getA()-t.getA())),oe=t=>255===t.getA()?t:t.setA(255),he=(()=>{const t=A(0,0,0);return i=>(i=oe(i),new $({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ne(i,t,.5)}]}))})(),ae=(()=>{const t=t=>{var e;if(t){if(t instanceof L){if(0===t.getColor().getA())return;return t.getColor()}if(t instanceof $||t instanceof q){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}}};return(e,i,s)=>{const r=[];if(s.fill&&r.push(s.fill),s.fill2&&r.push(s.fill2),s.stroke){const t=s.stroke;t instanceof tt&&r.push(t.getFillStyle())}if(s.point3D){const t=s.point3D;r.push(t.getFillStyle())}let n;if(s.behavior&&!0===s.behavior.colorStep){const[e,s]=r.reduce(((e,i)=>{if(e[0]&&e[1])return e;const s=t(i);return s&&(void 0===e[0]?e[0]=s:e[1]=s),e}),[void 0,void 0]);n=e&&s?(o=e)===(h=s)||o.getR()===h.getR()&&o.getG()===h.getG()&&o.getB()===h.getB()?he(o):(o=oe(o),h=oe(h),new q({angle:0,stops:[{offset:0,color:h},{offset:.5,color:h},{offset:.5,color:o},{offset:1,color:o}]})):i.uiButtonFillStyle}else{const e=r.reduce(((e,i)=>e||t(i)),void 0);n=e?he(e):i.uiButtonFillStyle}var o,h;e.setButtonOffFillStyle(new L({color:A(255,255,255,0)})).setButtonOffStrokeStyle(i.uiButtonStrokeStyle).setButtonOnFillStyle(n).setButtonOnStrokeStyle(J)}})(),le=t=>{const e=t;if(e instanceof N)return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ue=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ce=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let r=s>=0?s:i.length;for(;r"function"==typeof t?t(e):t,fe=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),ge=(t,e)=>e(),pe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to support@lightningchart.com or Stack Overflow with tag [lightningchart]");new L({color:A(255,255,255,1)});const me=t=>t===De||t.min.x===De.min.x&&t.max.x===De.max.x&&t.min.y===De.min.y&&t.max.y===De.max.y,ye=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,xe=(t,e)=>{throw new Error(e)},Se=()=>{const t=U((()=>{}));let e;return(i,s,r,n)=>{const o=null==n?void 0:n.onStart,h=null==n?void 0:n.onCompleted,a=(null==n?void 0:n.easing)||W.ease,l=(null==n?void 0:n.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else u=t(l,a)([[i,s]],(([t])=>{r(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),h&&u.onAnimationEnd(h)}},ve=t=>{let e;return()=>e||(e=t(),e)},be=t=>{if(t===J)return 0;const e=t.getThickness();return e<0?1:1*e},Me=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/lightningchart-js-api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw mt.alert(r),new Error(r);mt.console.warn(r)},Ae={add:(t,e)=>f(t.x+e,t.y+e,t.z+e),addVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x+=t.x,i.y+=t.y,i.z+=t.z;return i},subtract:(t,e)=>f(t.x-e,t.y-e,t.z-e),subtractVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x-=t.x,i.y-=t.y,i.z-=t.z;return i},multiply:(t,e)=>f(t.x*e,t.y*e,t.z*e),divide:(t,e)=>f(t.x/e,t.y/e,t.z/e),multiplyVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x*=t.x,i.y*=t.y,i.z*=t.z;return i},divideVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x/=t.x,i.y/=t.y,i.z/=t.z;return i},length:t=>Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),normalize:t=>Ae.divide(t,Ae.length(t)),dot:(t,e)=>t.x*e.x+t.y*e.y+t.z*e.z,cross:(t,e)=>f(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x),angle:(t,e)=>Math.acos(Ae.dot(t,e)/(Ae.length(t)*Ae.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ae.dot(e,t),o=Ae.cross(e,t);return Ae.addVec(Ae.multiply(t,s),Ae.addVec(Ae.multiply(e,(1-s)*n),Ae.multiply(o,r)))},lerp:(t,e,i)=>(i=wt(i,0,1),Ae.addVec(Ae.multiply(t,1-i),Ae.multiply(e,i))),equals:(t,e)=>kt(t.x,e.x)&&kt(t.y,e.y)&&kt(t.z,e.z),abs:t=>({x:Math.abs(t.x),y:Math.abs(t.y),z:Math.abs(t.z)}),sign:t=>({x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)})},ke=Number.MAX_SAFE_INTEGER,we=-Number.MAX_SAFE_INTEGER,De=p(u(ke,ke),u(we,we)),Ee=p(f(ke,ke,ke),f(we,we,we)),Te=(t,e)=>{const i=Math.log(t)/Math.log(e);return Math.floor((t=>(Math.ceil(t)-t<1e-4?t=Math.ceil(t):t-Math.floor(t)<1e-4&&(t=Math.floor(t)),t))(i))},Ie=(t,e)=>!(e.min.x>t.max.x||e.max.xt.max.y||e.max.y!(t[1].xe[1].x||t[3].ye[3].y),Pe=(t,e)=>p(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Oe=(t,e)=>e+t,Fe=(t,e,i)=>{const s=ti(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ti(i,t),o=(n.x*s.x+n.y*s.y)/r;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},Re=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Be=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},ze=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},_e=(t,e,i)=>{const s=ze(e,i);if(0===s)return[ze(t,e),e];let r=ri(ti(t,e),ti(i,e))/s;r=Math.max(0,Math.min(1,r));const n=u(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y));return[ze(t,n),n]},Le=(t,e,i)=>Qe(t,Je(ti(e,t),i)),Ge=(t,e,i)=>Ae.addVec(t,Ae.multiply(Ae.subtractVec(e,t),i));function Ve(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:ke,y:ke},max:{x:we,y:we}};for(const i of t)e.min.x=e.min.xi.max.x?e.max.x:i.max.x,e.min.y=e.min.yi.max.y?e.max.y:i.max.y;return e},He=(t,e)=>p(f(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y,t.max.z>e.max.z?t.max.z:e.max.z));function Ue(t,e,i,s){const r=t.x-s.x,n=t.y-s.y,o=s.x-i.x,h=i.y-s.y,a=h*r+o*n,l=(s.y-e.y)*r+(e.x-s.x)*n,u=h*(e.x-s.x)+o*(e.y-s.y);return u<0?a<=0&&l<=0&&a+l>=u:a>=0&&l>=0&&a+l<=u}const Xe=(t,e,i,s)=>u((t.x+e.x+i.x+s.x)/4,(t.y+e.y+i.y+s.y)/4),je=(t,e,i,s,r)=>{if(e.x>i.x)if(e.x>s.x)if(e.x>r.x){if(t.x>e.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(t.xs.x)if(i.x>r.x){if(t.x>i.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(s.xi.y)if(e.y>s.y)if(e.y>r.y){if(t.y>e.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(t.ys.y)if(i.y>r.y){if(t.y>i.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(s.y{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},oi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.x+(t-e.y)/s;return u(r,t)};function hi(t){return t*Math.PI/180}function ai(t){return 180*t/Math.PI}function li(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function ui(t){return u(Math.cos(t),Math.sin(t))}function ci(t){let e=-1;const i=Math.cos(t),s=Math.sin(t);return i>0&&i<1&&s>0&&s<1?e=1:i<0&&i>-1&&s>0&&s<1?e=2:i<0&&i>-1&&s<0&&s>-1?e=3:i>0&&i<1&&s<0&&s>-1&&(e=4),e}const di=(t,e,i,s)=>{let r,n,o,h;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,n=(s.y-i.y)/(s.x-i.x),h=n*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,r=(e.y-t.y)/(e.x-t.x),h=r*(o-t.x)+t.y):(r=(e.y-t.y)/(e.x-t.x),n=(s.y-i.y)/(s.x-i.x),o=(i.y-n*i.x+r*t.x-t.y)/(r-n),h=r*(o-t.x)+t.y),u(o,h)},fi=(t,e)=>{const i=t.length,s=e.length,r=new Uint16Array(i+s);return r.set(t,0),r.set(e,i),r};class gi{constructor(){this.Tt=!0}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.U)}Z(t,e){return this.U=t,this.$=e,this}X(){return this.Tt=!1,this}j(){return this.Tt=!0,this}}class pi extends gi{constructor(t,e,i,s){if(super(),this.It=!0,this.Ft=!0,this.Pt=[0,0],this.Dt=!0,this.Bt=t,this.Ot=e,this.Lt=i,this.Rt=t,this.Et=e,s){const t=s.R(this.zt.bind(this));this.zt(s.M()),this.Vt=()=>s.N(t)}}q(t){return this.Y=t,this.Ft=!0,this}Nt(t){return this.Pt=t.map(Math.abs),this.Dt=!0,this}Gt(){return this.Bt/this.Lt*this.Y+this.Pt[0]}Wt(){return(this.Bt+this.Ot)/this.Lt*this.Y-this.Pt[1]}Ht(){return this.getCellSize()-this.Ut()}$t(){return this.Y}getCellSize(){return this.Yt(this.Y)}Ut(){return this.Pt[0]+this.Pt[1]}Xt(){return this.Pt}zt(t){this.Lt=t.reduce(Oe,0),this.Bt=t.reduce(((t,e,i)=>i>=this.Rt?t:t+e),0),this.Ot=t.reduce(((t,e,i)=>i>=this.Rt&&ivi;return!n&&!o||!!r&&(e>t?{start:n?Si:t,end:o?vi:e}:{start:o?vi:t,end:n?Si:e})}ct(t){const e=this.Gt(),i=this.Wt(),s=Math.max(t,Si);return e+(this.Zt.function(s)-this.Kt.scaleStartLog)/this.Kt.scaleIntervalLog*(i-e)}ot(t){const e=this.Gt(),i=(t-e)/(this.Wt()-e),s=this.Kt.scaleStartLog+i*this.Kt.scaleIntervalLog;return this.Zt.number**s}jt(){this.Zt&&this.qt()}Z(t,e){return super.Z(t,e),this.Zt&&this.qt(),this}Nt(t){return super.Nt(t),this.Zt&&this.qt(),this}q(t){return super.q(t),this.Zt&&this.qt(),this}Jt(t){return this.Zt={internal:t,function:yi(t),number:xi(t)},this}Qt(){return this.Zt.internal}ti(t,e){const i=this.ct(t)+e;return this.ot(i)}get ii(){return this.Ft||this.Tt||this.Dt||this.It}qt(){const t=this.Zt.function(this.U),e=this.Zt.function(this.$)-t,i=2*this.Gt()/this.Y-1,s=2*this.Wt()/this.Y-1-i;return this.Kt={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.Kt}si(){return this.Kt}}const yi=t=>"e"===t?ee:te(t),xi=t=>"e"===t?Math.E:t,Si=.9*1e-9,vi=1.1*10**32,bi=["K","M","B","T"],Mi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Te(s,10),0);return t.toFixed(r)},Ai={Numeric:(t,e)=>Mi(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);const r=Te(t,1e3),n=1e3**r;let o="",h="";if(i>=1e3&&t>=1e3){const e=10**(Te(i,10)-1),a=Math.round(t/e)*e/n;let l=r;for(;l>0;){const t=Math.min(l,bi.length)-1;h=bi[t]+h,l-=t+1}o=(s?"-":"")+a}else{let e=String(Math.floor(t));for(let t=1;t<=r;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}o=(s?"-":"")+e+(i<=10?((t,e)=>{if(0===e)return"";let i=(Math.abs(t)-Math.abs(Math.floor(t))).toString().substring(1);return i.length>e&&(i=i.substring(0,e+1)),i})(t,2-Te(i,10)):"")}return o+=h,o}},ki=(t,e)=>{const i=yi(e);return"e"===e?t?(t,e)=>`${Math.floor(i(t))}e`:()=>"":(t,e)=>{const s=t.toString();if(t>1)return s;const r=Math.floor(i(t));return t.toFixed(Math.abs(r))}};class wi extends pi{constructor(t,e,i,s){super(t,e,i,s),this.ei=!1,this.ii=!1,this.hi=0,this.Y=1e3,this.Z(0,10),this.K()}rt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.ei){const i=((t,e,i)=>{const s=((t,e)=>{if(ewe&&twe){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),r=Math.min(i,s);return 10**Math.floor(Math.log10(r))}})(t,e);if(void 0!==s)return s*i})(t,e,this.getCellSize());if(void 0===i)return!1;if(o>i)return!0;const s=(e+t)/2,h=(r?i/2:n/2)*(t>e?-1:1);return{start:s-h,end:s+h}}const h=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>h)return!0;const a=(e+t)/2,l=(r?h/2:n/2)*(t>e?-1:1);return{start:a-l,end:a+l}}jt(){this.K()}ct(t){return this.Gt()+(t-this.U)/(this.$-this.U)*(this.Wt()-this.Gt())}ot(t){return this.U+(t-this.Gt())/(this.Wt()-this.Gt())*(this.$-this.U)}Z(t,e){return super.Z(t,e),this.K(),this}Nt(t){return super.Nt(t),this.K(),this}q(t){return super.q(t),this.ri=Di(this.$-this.U,this.Pt,this.Y,this.Ot,this.Lt),this.K(),this}ni(){return this.ei=!0,this}oi(){return this.ei}ai(){return Math.abs(this.li)}ci(){return this.ai()/this.ri}ui(){return this.di}fi(){return this.gi}getPixelSize(){return this.ri}si(){return this.Kt}j(){return super.j(),this.ii=!0,this}X(){return super.X(),this.ii=!1,this}pi(t,e=Ai.Numeric){return e(t,this)}mi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Si(t){return Di(t,this.Pt,this.Y,this.Ot,this.Lt)}K(){let t=this.U,e=this.$,i=0;this.ei&&(t=0,e=this.$-this.U,i=this.U);const s=e-t,r=Di(s,this.Pt,this.Y,this.Ot,this.Lt);this.gi=t-this.Pt[0]*r,this.di=e+this.Pt[1]*r;const n=this.di-this.gi,o=n-this.li,h=Math.abs(o/r),a=s-this.hi,l=Math.abs(a/r);(!this.Kt||h>=.4||l>=.4)&&(this.hi=s,this.li=n,this.ri=r,this.ii=!0);const u=this.li*this.Lt/(2*this.Ot),c=-(this.gi-this.li*this.Bt/this.Ot)-u,d=2*this.Gt()/this.Y-1,f=2*this.Wt()/this.Y-1-d;this.Kt={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}ti(t,e){return t+this.ri*e}}const Di=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Ei{yi(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}X(){return this.x.X(),this.y.X(),this}j(){return this.x.j(),this.y.j(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}$t(){return u(this.x.$t(),this.y.$t())}xi(t){return this.x.Nt(t),this}bi(t){return this.y.Nt(t),this}Ut(){return u(this.x.Ut(),this.y.Ut())}vi(t,e){return this.x.Z(t,e),this}Mi(t,e){return this.y.Z(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Ut(),y:e-this.y.Ut()}}_i(){return this.x.ii||this.y.ii}}class Ti extends Ei{constructor(){super(...arguments),this.Ai="LinearScaleXY"}nt(t,e,i,s){return this.x=new wi(t.x,e.x,i.x,s?s.x:void 0),this.y=new wi(t.y,e.y,i.y,s?s.y:void 0),this}oi(){return this.x.oi()||this.y.oi()}wi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}si(){return{x:this.x.si(),y:this.y.si()}}ti(t,e){const i=this.wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}ki(t,e,i,s){const r=this.wi(),n=qe(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Ii extends Ei{constructor(){super(...arguments),this.Ai="MixedScaleXY"}oi(){return!1}ti(t,e){const i=this.x.ct(t.x),s=this.y.ct(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ot(r.x),y:this.y.ot(r.y)}}ki(t,e,i,s){const r={x:this.x.ct(t.x),y:this.y.ct(t.y)},n={x:this.x.ct(e.x),y:this.y.ct(e.y)},o=Ze(ti(n,r)),h=qe(n,r),a={x:r.x+o.x*s+h.x*i,y:r.y+o.y*s+h.y*i};return{x:this.x.ot(a.x),y:this.y.ot(a.y)}}si(){const t=this.x.si(),e=this.y.si();return{uScaleStart:[this.x.U,this.y.U],uScaleInterval:[this.x.getInnerInterval(),this.y.getInnerInterval()],uScaleStartLog:[t.scaleStartLog,e.scaleStartLog],uScaleIntervalLog:[t.scaleIntervalLog,e.scaleIntervalLog],uViewportStart:[t.viewportStart,e.viewportStart],uViewportSize:[t.viewportSize,e.viewportSize]}}}const Ci={fitting:{start:(t,e,i,s)=>e>=t?i:s,end:(t,e,i,s)=>e>=t?s:i},expansion:{start:(t,e,i,s)=>e>=t?it?s:t,end:(t,e,i,s)=>e>=t?s>e?s:e:ie>t?Ci.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Ci.progressive.start(t,e,i,s)+(e-t)},regressive:{start:(t,e,i,s)=>e>t?ie>t?Ci.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ci,Fi=t=>void 0!==t.Ti,Ri={Ii:Ai.Numeric},Bi=(t,e)=>[t,e],zi=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{kt(t,0)&&(t=0),kt(e,0)&&(e=0);const n=[];let o=void 0!==s?((t,e,i)=>t-(t-i)%e)(t,i,s):t;if(i<=0)throw new Error(`_getRegularGreatKeyValues unit less than or equal to 0, unit: ${i}`);for(;o{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r},Gi=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,r,n,o,h,a)=>{if(r>=i)return;const l=e[r]||1;let u=!1,c=!1,d=1;return t&&(u="ignore"in t?"first"===t.ignore||"both"===t.ignore:u,c="ignore"in t?"last"===t.ignore||"both"===t.ignore:c,d="offset"in t&&void 0!==t.offset?t.offset:d),((t,e,i,s,r)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+r)%e==0))))(s,l,u,c,d)}},Vi=(t,e)=>{if(e.has(t))return e.get(t);const i=Ve(t.Pi.Fi());return e.set(t,i),i},Ni=t=>{const e=new Map;if(t!==Ri){for(const i of t.Di)e.set(i,new Map);for(const i of t.Bi)e.set(i,new Map)}return e};class Wi{constructor(t,e,i,s,n,o,h){this.P=new r.Eventer,this.Oi=Ri,this.Li=Pi.Empty,this.Ri=new Map,this.Ei=new Map,this.zi=Ci.fitting,this.Vi=!0,this.Ni=U((()=>this.chart.Wi.Gi()))(300,W.linear),this.Hi=!0,this.Ui=!0,this.$i=!1,this.Yi=we,this.Xi=!1,this.ji=!1,this.Zi=we,this.Ki=we,this.qi=we,this.Ji={},this.Qi=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ri.get(e),l=(t?t.get(a):void 0)||this.ts(a,e);l.ss=!1;const u=this.es(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.hs=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.ns!==i||!!t.find((t=>t===e)))).map((t=>Ie(e,Vi(t,a))?t:void 0)),p=y.some((t=>void 0!==t))}else p=!1;if(p){let t=!0;const e=y.filter((t=>void 0!==t));if(t&&i.os&&e.every((t=>Oi(t.ns)))&&(t=!1),t&&i.os&&i.os.ls&&!1===i.os.ls(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.Oi.Ii(t,this.ut),this.cs=([t,e])=>{this.us(t,e)},this.chart=t,this.ds=e,this.fs=s,this.gs=o,this.ut=i,this.ps=h,"logarithmic"===h.type&&this.setAnimationZoom(W.logarithmic(xi(h.base))),this.Ss=o.numeric,this.setTickStrategy("Numeric"),this.ys=i.getInnerStart(),this.xs=i.getInnerEnd(),n&&this.setAnimationsEnabled(!1)}getTitle(){return this.vs.bs()}setTitle(t){return this.vs.Ms(t),this.chart.Wi.Gi(),this}getTitleFillStyle(){return this.vs._s()}setTitleFillStyle(t){return this.vs.As(t),this.chart.Wi.Gi(),this}getTitleFont(){return this.vs.ws()}setTitleFont(t){return this.vs.ks(t),this.chart.Wi.Gi(),this}setTitleRotation(t){return this.vs.Cs(t),this.chart.Wi.Gi(),this}getTitleRotation(){return this.vs.Ts()}setTitleEffect(t){return this.Fs.Is(t),this.chart.Wi.Gi(),this}getTitleEffect(){return this.Fs.Ps()}setTickStrategy(t,e){if(this.Ri.size>0&&this.Ds(),"Empty"===t)this.Oi=Ri,this.Li=t;else if("Numeric"===t){"Numeric"!==this.Li&&(this.Ss=this.gs.numeric);const i=e||(t=>t);this.Ss=i(this.Ss),this.Oi=this.Ss.Bs(this.ps),this.Li=t}else if("DateTime"===t){"DateTime"!==this.Li&&(this.Ss=this.gs.datetime);const i=e||(t=>t);this.Ss=i(this.Ss),this.Oi=this.Ss.Bs(this.ps),this.Li=t}else if("Time"===t){"Time"!==this.Li&&(this.Ss=this.gs.time);const i=e||(t=>t);this.Ss=i(this.Ss),this.Oi=this.Ss.Bs(this.ps),this.Li=t}return this.Ei.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ei=Ni(this.Oi),this.chart.Wi.Gi(),this}getTickStrategy(){return this.Li}Os(){return this.Oi}Ls(t){this.Oi=t,this.Ei.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ei=Ni(this.Oi),this.chart.Wi.Gi()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.dt(void 0!==e?e:this.ys,void 0!==i?i:this.xs,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}dt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=Math.abs(e-t);if(Math.abs(this.xs-this.ys),void 0!==this.Oi.Rs&&this.Oi.Rs>o){const i=(e+t)/2,s=this.Oi.Rs/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.Oi.Es&&this.Oi.Ese?-1:1);n={start:i-s,end:i+s}}const h=this.ut.rt(n.start,n.end,this.ys,this.xs,!0);if(!1===h)return this;let a;switch(!0===h||(n=h),r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":a=!0;break;case"zoomBandChart":case"synchronizedAxis":a=!1;break;default:return xe(0,""),this}if(this.zs&&this.zs.finishAll(!1),this.Ni&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.zs||this.zs.isOver()?this.Ni:this.zs.NextAnimation.bind(this);this.zs=e([[this.ys,n.start],[this.xs,n.end]],this.cs,t),this.zs.onAnimationEnd((()=>{this.zs=void 0,a&&(this.qi=mt.performance.now())})),this.zs.onAnimationEnd((()=>this.setStopped(s)))}else this.us(n.start,n.end),s&&this.setStopped(!0),a&&(this.qi=mt.performance.now());return this}getInterval(){return{start:this.ys,end:this.xs}}setStopped(t){return t===this.$i||(t&&(this.zs&&this.zs.finishAll(!1),this.zs=void 0),this.$i=t,this.P.emit("stoppedStateChanged",this,this.$i),this.Yi=mt.performance.now(),this.chart.Wi.Gi()),this}getStopped(){return this.$i}onStoppedStateChanged(t){return this.P.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.P.off(t,"stoppedStateChanged")}fit(t,e=!1){const i=this.Vs(!1);if(i){const s=this.xs>=this.ys,r=s?i.min:i.max,n=s?i.max:i.min;this.dt(r,n,t,e,"userFit")}return this}setScrollStrategy(t){return this.zi=t,this.chart.Wi.Gi(),this}getScrollStrategy(){return this.zi}setAnimationScroll(t){return this.Vi=Boolean(t),this.chart.Wi.Gi(),this}setAnimationZoom(t,e=300){return this.zs&&(this.zs.finishAll(!1),this.zs=void 0),this.Ni=t?U((()=>this.chart.Wi.Gi()))(e,t):void 0,this}setAnimationsEnabled(t){return this.Hi=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(W.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.Hi}setVisible(t){const e=this.Ui!==t;return this.Ui=t,this.vs.setVisible(t),this.Ns((e=>{e.Pi.setVisible(t)})),e&&this.P.emit("visibleStateChanged",this,this.Ui),this}getVisible(){return this.Ui}onIntervalChange(t){return this.P.on("scaleChange",t)}offIntervalChange(t){return this.P.off(t,"scaleChange")}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}Gs(t,e){const i=new Map;if(this.Oi===Ri||!this.Ui)return this.Ds(),i;e=e||new Map;const s=this.Ws(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Ji.physicalAxisSize=h;const a=Ui(this.Oi,r,n,this.ys,this.xs,h),l=[];if(this.Hs(),l.push(...this.Us(this.Oi,r,n,a,e,t,i)),this.$s(this.Oi,r,n,a,e,t,l,i),this.Ys(),a)for(const[t,e]of this.Ei){const i=a.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.Ji.min=r,this.Ji.max=n,this.Ji.scaleInterval=o,this.Ji.physicalAxisSize=h,i}Xs(t){const e=t.ns.js;t.Pi.Ms(e(t.u,this.ut)).Zs()}Ks(t,e){const i=e.qs;t.Pi.As(i.getLabelFillStyle()).ks(i.getLabelFont()).Cs(i.getLabelRotation())}ts(t,e){const i=this.Ei.get(e);let s=i.get(t);s?(i.delete(t),s.ns=e,s.Js(!0)):s=this.Qs(t,e);const r=this.Ri.get(e)||new Map;return r.set(t,s),this.Ri.set(e,r),this.Ks(s,e),s}es(t,e){const i=this.te(t,e);return this.Xs(t),i}Us(t,e,i,s,r,n,o){const h=[];for(const a of t.Di){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ri.get(a),l=(t?t.get(s):void 0)||this.ts(s,a),u=this.es(l,n),c=Vi(l,r);h.find((t=>Ie(c,Vi(t,r))))&&l.Pi.setVisible(!1),l.ss=!1,o.set(l,u),h.push(l)}}return h}$s(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Bi){const t=s.get(u);if(!t)break;let c;if(void 0===a)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.os){y=!1;break}const t=u.os.ie;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.hs(p.filter((t=>a.some((e=>kt(t.u,e))))),g,u,d,n,h,e,i,r,o,l);!0!==m?t=t.concat(m):(d+=1,f=-1,t=[])}m=t,p.forEach((e=>{t.find((t=>t===e))||this.se(e)}))}if(l=m,!y)break}}se(t){const e=this.Ri.get(t.ns);null==e||e.delete(t.u);const i=this.Ei.get(t.ns);i&&i.has(t.u)?t.dispose():i&&(t.Js(!1),i.set(t.u,t))}Ns(t){for(const e of this.Ri.values())for(const i of e.values())t(i)}ee(t,e){for(const i of this.Ri.values())for(const s of i.values())e=t(e,s);return e}Ds(){this.Ri.forEach(((t,e)=>{t.forEach((t=>this.se(t)))})),this.Ri.clear()}Hs(){for(const t of this.Ri.values())for(const e of t.values())e.ss=!0}Ys(){for(const t of this.Ri.values())for(const[e,i]of t.entries())i.ss&&(i.dispose(),t.delete(e))}Ws(){const t=this.ut.getInnerStart()this.ut.getInnerStart()?this.ut.getInnerEnd():this.ut.getInnerStart();return p(t,e)}rs(t,e){return!(t.ss||0===t.Pi.bs().length||Oi(e)&&!0!==e.he)}re(t,e){return this.Oi===Ri||(this.Oi.Di.forEach((i=>{e=t(e,i.qs)})),this.Oi.Bi.forEach((i=>{(t=>void 0!==t.js)(i)&&(e=t(e,i.qs))}))),e}Vs(t){let e;for(const t of this.ne()){if(!t.oe())continue;let i=this.ds.ae(t);const s=this.ds.le(t);void 0!==i&&xt(i)&&void 0!==s&&xt(s)&&("logarithmic"===this.ps.type&&(0===i&&(i=Math.min(1,s)),Math.sign(i)!==Math.sign(s)&&(i=Math.min(1,s-.1))),e?(e.min=Math.min(e.min,i),e.max=Math.max(e.max,s)):e=p(i,s))}if(e&&xt(e.min)&&xt(e.max)){if(kt(e.min,e.max)){if(t)return;return{min:e.min-1,max:e.max+1}}return e}}ce(){let t=0;for(const e of this.ne()){if(!e.oe())continue;const i=this.ds.ue(e);i&&(t=Math.max(t,i))}return t}de(){const t=this.ne(),e=this.Xi;let i=!1;if(0!==t.length&&this.zi&&!this.$i){const t=this.Vs(!0);if(t){const e=this.ys,s=this.xs;let r=this.zi.start(e,s,t.min,t.max),n=this.zi.end(e,s,t.min,t.max);const o=!1===kt(e,r),h=!1===kt(s,n);if(r=o?r:e,n=h?n:s,o||h){let t=!1;if(this.Vi)if(this.Vi){t=!0;const a=o?this.fe(e,r):e,l=h?this.fe(s,n):s;if(!0===this.us(a,l,{allowClamping:!1})&&(o&&!1===kt(a,r)||h&&!1===kt(l,n))){this.chart.Wi.Gi(!0),i=!0;let t=Math.abs(n-r)/Math.abs(a-l);t<1&&(t=1/t),this.ji=t>=1.4}}else t=!1;t||this.us(r,n)}}}i?(this.Xi!==i&&(this.Xi=i,this.Zi=mt.performance.now()),this.ge&&(clearTimeout(this.ge),this.ge=void 0)):!0===e&&void 0===this.ge&&(this.ji=!1,this.ge=setTimeout((()=>{!1!==this.Xi&&(this.Xi=!1,this.Zi=mt.performance.now()),this.ge=void 0,this.chart.Wi.Gi()}),200))}us(t,e,i){const s=!i||!("allowClamping"in i)||void 0===i.allowClamping||i.allowClamping;let r={start:t,end:e},n=!0;const o=Math.abs(e-t),h=Math.abs(this.xs-this.ys);if(void 0!==this.Oi.Rs&&this.Oi.Rs>o){const i=(e+t)/2,o=(s?this.Oi.Rs/2:h/2)*(t>e?-1:1);r={start:i-o,end:i+o},n=!1}if(void 0!==this.Oi.Es&&this.Oi.Ese?-1:1);r={start:i-o,end:i+o},n=!1}let a=this.ut.rt(r.start,r.end,this.ys,this.xs,s);if(!1===a)return!1;!0!==a&&(r=a);const l=this.ce(),u=this.pe(Math.min(r.start,r.end),Math.max(r.start,r.end),l);return a=this.ut.rt(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min,this.ys,this.xs,!1),!!a&&(!0===a?this.ut.Z(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min):this.ut.Z(r.start,r.end),this.ys=r.start,this.xs=r.end,this.P.emit("scaleChange",this,r.start,r.end),this.Ki=mt.performance.now(),this.chart.Wi.Gi(),n)}me(){return this.Xi}Se(){return void 0!==this.zs}}class Hi{constructor(t,e,i,s,r=i.ye(s).setMouseInteractions(!1)){this.ss=!1,this.xe=!1,this.be=[],this.ns=t,this.u=e,this.ve=i,this.Me=s,this.Pi=r,this.be.push(r)}Js(t){this.be.forEach((e=>e.setVisible(t)))}dispose(){return this.xe||(this.xe=!0,this.be.forEach((t=>t.dispose()))),this}}const Ui=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Di){let t=n._e(e,i,s,r);t=Xi(t),o.set(n,t)}let h;for(const s of t.Bi){let t;if(void 0===h)t=s._e(e,i,e,i);else{let r=[];const o=h.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=n/(o-1);if(void 0!==s.Ae&&s.Ae>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),ji=s.Record({size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class Yi extends ji{constructor(t){super(t)}setSize(t){return this.set("size",t)}setFamily(t){return this.set("family",t)}setWeight(t){return this.set("weight",t)}setStyle(t){return this.set("style",t)}setVariant(t){return this.set("variant",t)}getSize(){return this.get("size")}getFamily(){return this.get("family")}getWeight(){return this.get("weight")}getStyle(){return this.get("style")}getVariant(){return this.get("variant")}}const $i=new Yi,Zi=new class{},qi=s.Record({shape:"sphere",size:10,fillStyle:new L,wireframeStyle:J});class Ki extends qi{constructor(t){super(t)}setSize(t){return this.set("size",t)}getSize(){return this.get("size")}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setWireframeStyle(t){return"function"==typeof t?this.set("wireframeStyle",t(this.get("wireframeStyle"))):this.set("wireframeStyle",t)}getWireframeStyle(){return this.get("wireframeStyle")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}}const Ji=s.Record({size:5,fillStyle:new L});class Qi extends Ji{constructor(t){super(t)}setSize(t){return this.set("size",t)}getSize(){return this.get("size")}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}}const ts={Triangulated:Ki,Pixelated:Qi};class es{constructor(t){this.we=new Map,this.Wi=t}ke(t,e,i){const s=i.animationEnabled;this.we.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.we.delete(t),t.offDispose(r)}))}Ce(t,e){const i=e.animationEnabled,s=[],r=t.onDispose((()=>{s.forEach((t=>{this.we.delete(t)})),t.offDispose(r)}));return{Te:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.we.set(t,r)}}}Ie(t,e){const i=this.we.get(t);i&&(i.curUnanimatedHighlightValue=ye(e),this.Wi.Gi())}Fe(t){const e=this.we.get(t);return e?e.curUnanimatedHighlightValue:0}Pe(t,e){const i=this.we.get(t);i&&(i.animationEnabled=e)}De(t){const e=this.we.get(t);return!!e&&e.animationEnabled}Zs(t){let e=!1;this.we.forEach(((i,s)=>{let r;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const n=i.curAnimationPositionMillis/s;r=i.curUnanimatedHighlightValue*Math.abs(Math.sin(n*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(r=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||r>0):r=0,i.curAnimationPositionMillis=0}else r=i.curUnanimatedHighlightValue;r!==i.curAnimatedHighlightValue&&(i.applyHighlight(r),i.curAnimatedHighlightValue=r)})),e&&this.Wi.Gi(!0)}}const is=new Map,ss=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),r=t.getStyle(),n=t.getVariant(),o=`${r} ${n?"small-caps":"normal"} ${s} ${e}px ${i}`;let h=is.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{size:e,family:i,style:r,variant:n,weight:s}),is.set(o,h)),h};var rs,ns;!function(t){t[t.click=0]="click",t[t.dbclick=1]="dbclick",t[t.mouseDown=2]="mouseDown",t[t.mouseUp=3]="mouseUp",t[t.contextmenu=4]="contextmenu",t[t.wheel=5]="wheel"}(rs||(rs={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(ns||(ns={}));const os=t=>({container:t.Be,scale:t.ut,setMouseStyle:(e,i)=>t.Oe(e,i),restoreMouseStyle:e=>t.Le(e),clientLocation2Engine:(e,i)=>t.Re(e,i),engineLocation2Client:(e,i)=>t.Ee(e,i),captureFrame:(e,i)=>t.ze(e,i),renderFrame:(e,i,s=!1)=>t.Ve(e,i,s),layout:()=>{t.Ne(),t.Ge()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.We(e,i)}),hs=[];let as;const ls=()=>{if(void 0!==as){const t=mt.getComputedStyle(mt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));as.style.height=mt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Gi()),60),this.$e=u(0,0),this.Ye=void 0,this.Xe=()=>{},this.je=()=>{},this.Ze=[],this.Ke=-1,this.qe=[],this.Je=!0,this.xe=!1,this.Ge=()=>{const{bottom:t,left:e}=this.Qe().getBoundingClientRect();return this.$e=u(Math.floor(e),Math.floor(t)),this},this.Ne=()=>{this.th&&this.th()},this.Oe=(t,e)=>{if(!e){this.Be.style.cursor=t;const e=this.Ke;return this.Ke+=1,this.qe.push([e,t]),e}return this.Le(e),this.Oe(t)},this.Le=t=>{const e=t?this.qe.findIndex((e=>e[0]===t)):-1;e>=0?(this.qe.splice(e,1),this.qe.length>0?this.Be.style.cursor=this.qe[this.qe.length-1][1]:this.Be.style.cursor="default"):(this.qe.push([0,"default"]),this.Be.style.cursor="default")},this.ih=t=>(this.sh.S(t),this),this.eh=()=>this.sh.M(),this.hh=()=>{this.Xe&&this.Xe(),this.rh(),this.oh(),this.je&&this.je()},this.ah=t=>(this.He.set(t.lh(),t),this.He=new Map([...this.He.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.uh=t=>(this.He.delete(t),this),this.X=()=>(this.sh.o=!1,this),this.j=()=>(this.sh.o=!0,this),this.dh=t=>{if(!this.Je)return;const e=this.fh,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.Re(t.clientX,t.clientY),r=this.gh(t,{x:t.clientX,y:t.clientY});if(this.ph&&((null==r?void 0:r.entity)!==this.ph.entity||r.collectionMember!==this.ph.collectionMember)&&!this.mh){this.ph.entity.Sh=!1;const e=this.ph.entity.yh;e&&e(this.ph.entity,t,this.ph.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.mh)if(r.entity.Sh){if(!i){const e=r.entity.xh;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Sh=!0;const e=r.entity.bh;e&&e(r.entity,t,r.collectionMember)}if(this.mh){const i=this.mh.entity.Mh,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.mh.entity,t,this.mh.button,this.mh.startLocation,s,this.mh.collectionMember)}this._h=t,this.fh=t,this.Ah=s,this.ph=r},this.wh=t=>{if(this.Je=!1,this.Ah=void 0,this._h=t,this.fh=void 0,this.mh){const e=this.mh.entity.kh;e&&e(this.mh.entity,t,this.mh.button,this.mh.startLocation,this.mh.collectionMember),this.mh.entity.Sh=!1;const i=this.mh.entity.yh;i&&i(this.mh.entity,t,this.mh.collectionMember),this.mh=void 0}if(this.Ch){const e=this.Ch.entity.Th;e&&e(this.Ch.entity,t,this.Ch.collectionMember),this.Ch=void 0}if(this.ph){this.ph.entity.Sh=!1;const e=this.ph.entity.yh;e&&e(this.ph.entity,t,this.ph.collectionMember),this.ph=void 0}},this.Ih=t=>{this.Je=!0,this._h=t},this.Fh=()=>this.Ah,this.fs=t.theme,this.Ph=e.Ph,this.Dh={Bh:e.Bh,Oh:e.Oh,Lh:e.Lh,Rh:e.Rh,Eh:e.Eh,zh:e.zh,Vh:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,Nh:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:`${mt.location.origin}/resources`,Gh:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings,Wh:(()=>{const e=null==t?void 0:t.pickingPrecision;if("string"==typeof e){const t=e.toLowerCase();if("best"===t)return 1;if("high"===t)return.5;if("low"===t)return 1/8}return 1/4})(),Hh:void 0===(null==t?void 0:t.interactable)||t.interactable,Uh:void 0===t.textPixelSnappingEnabled||t.textPixelSnappingEnabled};const i=t?t.container:void 0;if(i){if("string"==typeof i){const t=mt.document.getElementById(i);if(!t)throw new Error(`Container "${i}" doesn't exist.`);this.Be=t}else this.Be=i;mt.addEventListener("resize",this.Ne),this.Ze.push((()=>{mt.removeEventListener("resize",this.Ne)}))}else{if(void 0===as){const t=mt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",mt.document.body.appendChild(t),as=t,mt.addEventListener("resize",ls)}let t=1;for(;null!==mt.document.getElementById(`chart-${t}`);)t+=1;this.Be=mt.document.createElement("div"),this.Be.id=`chart-${t}`,this.Be.style.flex="1",as.appendChild(this.Be),ls(),hs.push(this.Ne),this.Ze.push((()=>{as&&as.removeChild(this.Be),hs.includes(this.Ne)&&hs.splice(hs.indexOf(this.Ne),1),0===hs.length&&as&&(mt.document.body.removeChild(as),as=void 0,mt.removeEventListener("resize",ls))}))}if(mt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Be&&this.Ne()};this.$h=new mt.ResizeObserver(t.bind(this)),this.$h.observe(this.Be)}""===this.Be.style.position&&(this.Be.style.position="relative"),this.Be.style.boxSizing="content-box",this.Be.addEventListener("fullscreenchange",this.Ne),this.Be.addEventListener("webkitfullscreenchange",this.Ne);const s=t?t.maxFps:void 0;this.Yh=s?-1===s?-1:0!==s?1e3/s:0:0;const n=new Map;let o=!1;const h=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":n.set(i.pointerId,s);break;default:n.delete(i.pointerId),o=!1}switch(i.interactions=Array.from(n.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(o=!0)};if(this.Be.onwheel=this.Xh(rs.wheel),this.Be.oncontextmenu=this.Xh(rs.contextmenu),this.Be.onclick=this.Xh(rs.click),this.Be.ondblclick=this.Xh(rs.dbclick),this.Be.onlostpointercapture=()=>{o=!1},this.Be.ontouchmove=t=>{o&&t.preventDefault()},this.Be.onpointerover=h(),this.Be.onpointerenter=h(this.Ih),this.Be.onpointerdown=h(this.Xh(rs.mouseDown),this.jh(ns.touchStart)),this.Be.onpointermove=h(this.dh,this.jh(ns.touchMove)),this.Be.onpointerup=h(this.Xh(rs.mouseUp),this.jh(ns.touchEnd)),this.Be.onpointercancel=h(),this.Be.onpointerout=h(),this.Be.onpointerleave=h(this.wh,this.jh(ns.touchEnd)),!mt.requestAnimationFrame||!mt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");mt.addEventListener("scroll",this.Ge),this.sh=y(new M({r:0,g:0,b:0,a:0})),this.Zh=new es(this)}Kh(){return this.qh}Jh(){return this.Qh}setBackgroundFillStyle(t){return this.tr.As(t),this}getBackgroundFillStyle(){return this.tr._s()}setBackgroundStrokeStyle(t){return this.tr.ir(t),this}getBackgroundStrokeStyle(){return this.tr.sr()}er(t){return this.je=t,this}hr(t){return this.Xe=t,this}rr(t){return this.He.get(t)}nr(){return Array.from(this.He.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Xh(t){return e=>this.ar(t,e)}ar(t,e){if(!this.Je)return;t===rs.contextmenu&&Zt(e);const i=this.Re(e.clientX,e.clientY),s=this.gh(e,{x:e.clientX,y:e.clientY});if(t===rs.mouseUp){if(this.mh){const t=this.mh.entity.kh;if(t&&t(this.mh.entity,e,this.mh.button,this.mh.startLocation,this.mh.collectionMember),(null==s?void 0:s.entity)!==this.mh.entity){this.mh.entity.Sh=!1;const t=this.mh.entity.yh;t&&t(this.mh.entity,e,this.mh.collectionMember)}this.mh=void 0}if(this.Ch){const t=this.Ch.entity.getMouseInteractions()&&this.Ch.entity.Th;t&&t(this.Ch.entity,e,this.Ch.collectionMember),this.Ch=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===rs.click?s.entity.lr:t===rs.dbclick?s.entity.cr:t===rs.mouseDown?s.entity.ur:t===rs.wheel?s.entity.dr:t===rs.contextmenu?s.entity.gr:void 0;if(i&&i(s.entity,e,s.collectionMember),t===rs.mouseDown){this.Ch={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Ch.event.button,i=s.entity.pr;i&&i(s.entity,e,t,s.collectionMember),this.mh={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this._h=e,this.Ah=i,this.ph=s}jh(t){return e=>this.mr(t,e)}mr(t,e){const i=e.interactions.length;if(this.Sr=e,this.yr){const s=t===ns.touchMove?this.yr.entity.br:t===ns.touchEnd?this.yr.entity.vr:t===ns.touchStart?this.yr.entity.Mr:void 0;s&&s(this.yr.entity,e,this.yr.collectionMember),t===ns.touchEnd&&0===i&&(this.yr.entity.Sh=!1,this.yr=void 0)}else if(t===ns.touchStart){for(let t=0;t{t()})),this.Ze.length=0,this.Ye&&mt.cancelAnimationFrame(this.Ye)}Re(t,e){return u(t-this.$e.x,this.$e.y-e)}Ee(t,e){return u(t+this.$e.x,this.$e.y-e)}}const fs=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=Je(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x+n;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=Je(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x-n;for(;lc&&l=c;)e[l].y>s&&(s=e[l].y),e[l].y({type:"verticalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=Je(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y+n;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=Je(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?xs.Nearest:"nearest-x"===t?xs.NearestX:"nearest-y"===t?xs.NearestY:void 0;return void 0!==e?e:xs.NearestX},vs=(t,e,i,s,r,n,o,h,a,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===xs.Nearest)return bs(t,e,n,o,c,d);if(i===xs.NearestX||i===xs.NearestY){if("boolean"==typeof l&&("x"===a&&i===xs.NearestX||"y"===a&&i===xs.NearestY))return ks(t,nt(e,o,n),a,l,c,d);if(i===xs.NearestX)return Ms(t,nt(e,o,n),h,c,d);if(i===xs.NearestY)return As(t,nt(e,o,n),h,c,d)}},bs=(t,e,i,s,r,n)=>{let o,h=Number.MAX_VALUE;for(let a=r;a<=n;a+=1){const r=t[a];if(!Number.isNaN(r.x)&&!Number.isNaN(r.y)){const t=nt(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,p=Math.floor((r+n)/2),m=n,y=-1;for(;;){const e=h-(o?t[p].x:t[p].y);if(e*(s?-1:1)>0)g=Math.min(p+1,m),y=Math.floor((g+m)/2);else{if(0===Math.abs(e))return p;m=Math.max(p-1,g),y=Math.floor((g+m)/2)}if(y===p){const i=p>r?Math.abs(h-(o?t[p-1].x:t[p-1].y)):ke,s=p{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,p=Math.floor((r+n)/2),m=n,y=-1;for(;;){const i=h-(o?t[p].x:t[p].y);if(i*(s?-1:1)>0)g=Math.min(p+1,m),y=Math.floor((g+m)/2);else{if(0===Math.abs(i))return{a:p,b:p,lerpAmount:0};m=Math.max(p-1,g),y=Math.floor((g+m)/2)}if(y===p){if(i*(s?-1:1)<0&&p>r){const i=t[p-1],s=t[p];return{a:p-1,b:p,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(pthis.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Wi=t,this.bt=e,this.Pr=i,this.Dr=Ds,Ds+=1,this.Br=t.fs.highlightColorOffset}Or(t){return void 0!==this.Pr.find((e=>e.type===t))}Lr(t,e){var i;return!!this.Or(t)&&!0===e(null===(i=this.Pr.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.xe||(this.Sh&&this.yh&&this.yh(this,void 0,void 0),this.xe=!0,this.bt(this),this.P.emit("dispose",this)),this}setVisible(t){const e=this.Ui;return this.Ui=t,!t&&e&&(this.Sh&&this.yh&&this.yh(this,void 0,void 0),this.Sh=!1),this}getVisible(){return this.Ui}setMouseInteractions(t){const e=this.kr.M();return this.kr.S(t),t||(e&&this.Sh&&this.yh&&this.yh(this,void 0,void 0),this.Sh=!1),this}getMouseInteractions(){return this.kr.M()}getIsUnderMouse(){return this.Sh}getIsGrabbed(){return this.Tr}setMouseMoveEventHandler(t){return this.xh=t,this}setMouseEnterEventHandler(t){return this.bh=t,this}setMouseLeaveEventHandler(t){return this.yh=t,this}setMouseClickEventHandler(t){return this.lr=t,this}setMouseDoubleClickEventHandler(t){return this.cr=t,this}setMouseDownEventHandler(t){return this.ur=t,this}setMouseUpEventHandler(t){return this.Th=t,this}setMouseWheelEventHandler(t){return this.dr=t,this}setMouseContextMenuEventHandler(t){return this.gr=t,this}setMouseDragEventHandler(t){return this.Mh=t,this}setMouseDragStartEventHandler(t){return this.pr=t,this}setMouseDragStopEventHandler(t){return this.kh=t,this}setTouchStartEventHandler(t){return this.Mr=t,this}setTouchMoveEventHandler(t){return this.br=t,this}setTouchEndEventHandler(t){return this.vr=t,this}Rr(t){return this.Ir=t,this}Er(){return this.Ir?this.Ir:Ts}zr(t){return this.Fr=t,this}Vr(){return this.Fr}Nr(t){return this.Br=t,this}Gr(){return this.Br}}const Ts=p(u(0,0),u(0,0));class Is extends Es{constructor(t,e,i,s){super(t,i,s),this.Wr=0,this.Hr=e,this.Hr.Ur=!0}$r(t){return this.Wr===t||(this.Wr=t,this.Hr.Ur=!0),this}Yr(){return this.Wr}}class Cs extends Is{constructor(t,e,i,s,r){super(t,e,s,r),this.Xr=!0,this.ut=i}}const Ps=(t,e,i)=>{if(i instanceof Ti){const s=i.wi(),r=ei(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return p(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return p(i.ti(u(t.min.x,t.min.y),Je(e,-1)),i.ti(u(t.max.x,t.max.y),e))},Os=(t,e)=>"function"==typeof e?e(t):e,Fs=(t,e)=>!t||t!==e,Rs=(t,e)=>t===B&&e!==B,Bs=t=>t!==B;class zs extends Cs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jr=cs.fillStyle,this.Wi=t}As(t){return this.jr=Os(this.jr,t),this}_s(){return this.jr}Zr(){return Fs(this.Kr,this.jr)}qr(){return Rs(this.Kr,this.jr)}Jr(){return Bs(this.jr)}Qr(t){this.Kr=t}}class _s extends zs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.tn=cs.lineStyle,this.Wi=t}ir(t){return this.tn="function"==typeof t?t(this.tn):t,this}sr(){return this.tn}sn(){return!this.en||this.en!==this.tn}hn(t){return!this.en||this.en.getThickness()!==t}Jr(){return this.tn!==J||super.Jr()}qr(){return(this.tn!==J||this.jr!==B)&&this.en===J&&this.Kr===B}rn(t){this.en=t}}class Ls extends zs{constructor(t,e,i,s,r,n=y(5)){super(t,e,i,s,r),this.size=y(5),this.size=n}q(t){return this.size.S(t),this}}class Gs extends zs{constructor(t,e,i,s,r,n=y(cs.font)){super(t,e,i,s,r),this.nn=y(""),this.an=y(u(0,0)),this.ln=y(0),this.cn=y(0),this.un=y(u(0,0)),this.dn=y(0),this.fn=y($i),this.gn=u(0,0),this.Pt=y(x(1,1,1,1)),this.pn=y(S(4,4,4,4)),this.font=y(cs.font),this.mn=!1,this.font=n}Jr(){return Bs(this.jr)&&this.nn.M().length>0}qr(){return!1===this.mn&&this.Jr()}Ms(t){return this.nn.S(t),this}bs(){return this.nn.M()}ks(t){return t instanceof Yi?this.fn.S(t):this.fn.S(t(this.fn.M())),this}ws(){return this.fn.M()}Sn(t){return this.fn.S(this.fn.M().setFamily(t)),this}yn(){return this.fn.M().getFamily()}xn(t){return this.fn.S(this.fn.M().setSize(t)),this}bn(){return this.fn.M().getSize()}vn(t){return this.fn.S(this.fn.M().setWeight(t)),this}Mn(){return this.fn.M().getWeight()}_n(t){return this.fn.S(this.fn.M().setStyle(t)),this}An(){return this.fn.M().getStyle()}wn(t){return this.fn.S(this.fn.M().setVariant(t)),this}kn(){return this.fn.M().getVariant()}Cn(t){return this.an.S(t),this}Tn(){return this.an.M()}Cs(t){return this.dn.S(t),this}Ts(){return this.dn.M()}In(t,e){return this.un.S(u(t,e)),this}Fn(){return this.un.M()}Pn(t){return this.cn.S(t),this}Dn(){return this.cn.M()}Bn(t){return this.ln.S(t),this}On(){return this.ln.M()}Ln(t){return this.cn.S(t.x),this.ln.S(t.y),this}Rn(t){return this.Pt.S(t),this}En(){return this.Pt.M()}zn(t){return this.pn.S(t),this}Vn(){return this.pn.M()}}class Vs extends Ls{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,y(o)),this.Nn=[],this.Gn=y(e.PointShape.Square),this.dn=y(0),this.Wn=y(!1),this.Hn=y(!1),this.Un=y(!1),this.$n=De,this.Yn=0,this.Xn=[],this.jn=0,this.Zn=De,this.Kn=xs.Nearest,this.qn=!1}Jn(t){return this.Kn=t,this}Qn(){return this.Xn}io(){return this.Nn}so(t){return this.Gn.S(t),this}Cs(t){return this.dn.S(t),this}eo(t){return this.Wn.S(t),this}ho(t){return this.Hn.S(t),this}ro(t){return this.Un.S(t),this}xt(t,e){return Array.isArray(t)||(t=[t]),this.jn+=t.length,this.Xn=re(this.Xn,t,{canReturnB:!0}),this.Zn&&(this.Zn=e?We(this.Zn,e):void 0),this}no(){return this.qn=!0,this.Nn.length=0,this.Yn=0,this.$n=De,this.Xn=[],this.jn=0,this}oo(){return this.Yn}ao(){return this.jn}}class Ns extends _s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.an=y(u(0,0)),this.Y=y(u(100,100)),this.dn=y(0),this.gn=y(u(0,0)),this.lo=!1}Zs(){return this.co(),this}Cn(t){const e=this.an.M();return t.x===e.x&&t.y===e.y||(this.an.S(t),this.co()),this}Tn(){return this.an.M()}uo(t){const e=this.an.M();return t!==e.x&&(this.an.S(u(t,e.y)),this.co()),this}do(t){const e=this.an.M();return t!==e.y&&(this.an.S(u(e.x,t)),this.co()),this}q(t){const e=this.Y.M();return t.x===e.x&&t.y===e.y||(this.Y.S(u(t.x,t.y)),this.co()),this}$t(){return this.Y.M()}fo(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(t,e.y)),this.co()),this}po(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(e.x,t)),this.co()),this}Cs(t){return this.dn.S(t),this}Ts(){return this.dn.M()}mo(t){const e=this.gn.M();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.lo=!1,this.co()):(this.lo=!0,this.gn.S(t))),this}co(){if(!this.lo){const t=this.an.M(),e=this.Y.M(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.gn.M();i.x===s.x&&i.y===s.y||this.gn.S(i)}}}class Ws extends _s{constructor(){super(...arguments),this.Nn=[],this.an=y(u(0,0)),this.$n=De,this.So=!1}yo(t){return t=Qt(t),this.Nn=t,this.So=!0,this}xo(){return this.Nn}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return 0}vo(){return 0}}class Hs extends Ws{}class Us extends zs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Mo=new Array,this._o=new Array,this.Ao=y({type:"disabled",packager:(t,e,i)=>t.slice()}),this.$n=De,this.wo=0,this.ko=!1,this.Xn=[Array(),Array()],this.Co=!1,this.To=(new L).setColor(A(42,171,240)),this.qn=!1,this.Io=!1,this.Fo=!1}xt(t,e){const i=this.wo-1,s=i>0&&!this.Co;let[r,n]=s?[[this.Mo[i]],[this._o[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=re(r,e,{canReturnB:!0}),n=re(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Co?(this.Xn[0]=re(this.Xn[0],r,{canReturnB:!0}),this.Xn[1]=re(this.Xn[1],n,{canReturnB:!0})):(this.Xn=[r,n],this.Co=!0),this.$n=We(this.$n,e||We(Ve(r),Ve(n))),this}no(){return this.qn=!0,this.Mo.length=0,this._o.length=0,this.wo=0,this.$n=De,this}io(){return[this.Mo,this._o]}Qn(){return[this.Xn[0],this.Xn[1]]}Po(t){return this.Ao.S(t),this}Do(){return this.Ao.M()}Bo(t){return this.To="function"==typeof t?t(this.To):t,this}Oo(){return this.To}oo(){return this.wo-(Number(this.Io)+Number(this.Fo))}ao(){return this.Xn.length}Lo(t){return this.Io=t,this}Ro(){return this.Io}Eo(t){return this.Fo=t,this}zo(){return this.Fo}qr(){return this.Kr===B&&this.Vo===B&&(this.jr!==B||this.To!==B)}No(t){this.Vo=t}Jr(){return this.To!==B||super.Jr()}Zr(){return super.Zr()||!this.Vo||this.Vo!==this.To}}class Xs extends _s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.an=y(u(0,0)),this.Go=y(0),this.di=y(360),this.Wo=y(100),this.Ho=y(100),this.Uo=y(0),this.$o=y(void 0),this.Yo=u(0,0),this.Xo=u(0,0),this.jo=u(0,0)}Zo(){return this.Wo.M()}Ko(){return this.Ho.M()}Tn(){return this.an.M()}qo(){return this.Go.M()}ui(){return this.di.M()}Jo(){return this.Uo.M()}Qo(){return this.$o.M()}ta(){return this.Yo}ia(){return this.Xo}sa(){return this.jo}Cn(t){return this.an.S(t),this}ea(t){return this.Go.S(t),this}ha(t){return this.di.S(t),this}ra(t){return this.Ho.S(t),this.Wo.S(t),this}na(t){return this.Wo.S(t),this}oa(t){return this.Ho.S(t),this}aa(t){return this.Uo.S(t<0?0:t),this}la(t){return this.$o.S(void 0!==t&&t<=0?void 0:t),this}}var js;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(js||(js={}));class Ys extends Cs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=cs.lineStyle,this.engine=t}ua(t){return this.ca=((t,e)=>"function"==typeof e?e(t):e)(this.ca,t),this}da(){return this.ca}sn(){return((t,e)=>!t||t!==e)(this.fa,this.ca)}ga(t){return((t,e)=>!t||t.getThickness()!==e)(this.fa,t)}qr(){return((t,e)=>t===J&&e!==J)(this.fa,this.ca)}Jr(){return(t=>t!==J&&t.getFillStyle()!==B)(this.ca)}pa(t){this.fa=t}}class $s extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.gi=u(0,0),this.di=u(0,0),this.ma=!1}S({min:t,max:e}){return t.x===this.gi.x&&t.y===this.gi.y&&e.x===this.di.x&&e.y===this.di.y||(this.ma=!0,this.gi=t,this.di=e),this}fi(){return this.gi}ui(){return this.di}Sa(t){return t.x===this.gi.x&&t.y===this.gi.y||(this.ma=!0,this.gi=t),this}ha(t){return t.x===this.di.x&&t.y===this.di.y||(this.ma=!0,this.di=t),this}}class Zs extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ya=[],this.ma=!1}xt(t,e){return this.ya.push(t),this.ya.push(e),this.ma=!0,this}no(){return this.ya.length=0,this.ma=!0,this}}class qs extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xa=[],this.$n=De,this.Xn=new Array,this.Yn=0,this.Kn=xs.NearestX,this.qn=!1,this.ba=y(void 0),this.Io=!1,this.Fo=!1}va(t){return this.ba.S(t),this}Ma(){return this.ba.M()}Qn(){return this.Xn}io(){return this.xa}Jn(t){return this.Kn=t,this}no(){return this.qn=!0,this.xa.length=0,this.Yn=0,this.Xn=[],this.$n=De,this}oo(){return this.Yn-(Number(this.Io)+Number(this.Fo))}ao(){return this.Xn.length}Lo(t){return this.Io=t,this}Ro(){return this.Io}Eo(t){return this.Fo=t,this}zo(){return this.Fo}}class Ks extends zs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wo=0,this._a=0,this.Y=y({x:0,y:0}),this.Aa=y({x:0,y:0}),this.wa=y({x:0,y:0}),this.gi={x:0,y:0},this.di={x:0,y:0},this.ka=!0,this.Ca=!0,this.Ta=!0,this.$n=De,this.Ia=!0,this.Fa=B}Pa(t){return this.Fa=Os(this.Fa,t),this}Da(){return this.Fa}S(t){return Js.S(this,t,((t,e)=>({x:t,y:e}))),this}Ba(){return Js.Ba(this)}Oa(){return Js.Oa(this)}Tn(){return Js.Tn(this)}ao(){return Js.ao(this)}La(t,e,i){return Js.La(this,t,e,i),this}Ra(t,e,i){return Js.Ra(this,t,e,i),this}Ea(t,e){return Js.Ea(this,t,e),this}za(t,e){return Js.za(this,t,e),this}Va(t,e){return Js.Va(this,t,e),this}no(){return Js.no(this,((t,e)=>({x:t,y:e}))),this}Na(){return Js.Na(this)}Ga(){return Js.Ga(this)}Wa(){return Js.Wa(this)}oo(){return Js.oo(this)}qr(){return Js.qr(this)}Jr(){return Js.Jr(this)}Ha(){return this.Ua}$a(){return this.Ya}}const Js={S(t,e,i){t.ka=!0,t.Ca=!0,t.Ta=!0;const{start:s}=e,{end:r}=e,{rows:n}=e,{columns:o}=e;t.Ia=e.pixelate;const h={x:e.pixelate&&o>=1||!e.pixelate&&o>1?o:0,y:e.pixelate&&n>=1||!e.pixelate&&n>1?n:0};t.Aa.S(h),t.gi={...s},t.di={...r},t.Y.S(ti(r,s)),Js.Xa(t,i)},Xa(t,e){const i=t.Aa.M();if(i.x>0&&i.y>0){t.Ua?t.Ua.length=0:t.Ua=[];const s=t.Ia?Qe(i,{x:1,y:1}):{x:i.x,y:i.y};t.wa.S(s),t.Ua=Array.from(Array(s.y)).map((()=>Array(s.x))),t.Ya=Array.from(Array(i.y)).map((()=>Array(i.x))),Js.ja(t,i,s,e),t.wo=s.x*s.y,t._a=i.x*i.y}else t.Ua=void 0,t.wa.S({x:0,y:0})},ja(t,e,i,s){const r=t.gi,n=t.di,o=t.Ua,h=t.Ya;if(o){const e=i.x,h=i.y,{x:a,y:l}=t.Y.M(),u={x:a/(e-1),y:l/(h-1)};for(let t=0;tt.Aa.o||t.wa.o,Oa(t){const e=t.Aa.M();return{columns:e.x,rows:e.y}},Tn(t){const e=t.gi,i=t.di;return{start:{x:e.x,y:e.y},end:{x:i.x,y:i.y}}},ao(t){throw new Error("Method not implemented.")},La(t,e,i,s){const r="geometry"===i||"y"===i?t.Ua:t.Ya;if(r){const n=t.wa.M();if("y"===i){const t=Ct(r);for(let i=0;iIt(t,e)));const o=r===t.Ua?t.wa.M():t.Aa.M(),h={column:{start:o.x-e,end:o.x},row:{start:0,end:o.y}},a=(t=>{const e=t.length,i=e>0?t[0].length:0,s=Array.from(Array(i)).map((()=>Array(e)));for(let r=0;r0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;at.wo,oo:t=>t._a,qr:t=>Rs(t.Kr,t.jr)||Rs(t.qa,t.Fa),Jr:t=>Bs(t.jr)||Bs(t.Fa)};class Qs{constructor(t,e){this.Nh=t,this.Ja=e,this.Qa=e.rows*Ir,this.tl=e.columns*Cr}}var tr,er;e.OnScreenMenuButtonType=void 0,(tr=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[tr.ZoomIn=0]="ZoomIn",tr[tr.ZoomInX=1]="ZoomInX",tr[tr.ZoomInY=2]="ZoomInY",tr[tr.ZoomOut=3]="ZoomOut",tr[tr.ZoomOutX=4]="ZoomOutX",tr[tr.ZoomOutY=5]="ZoomOutY",tr[tr.ZoomToFit=6]="ZoomToFit",tr[tr.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(er=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[er.Circle=0]="Circle",er[er.Rectangle=1]="Rectangle",er[er.RoundedRectangle=2]="RoundedRectangle";const ir={x:-43,y:0},sr={x:-65,y:0},rr={x:-86,y:0},nr={x:-107,y:-1},or={x:-128,y:-3},hr={x:-150,y:0},ar={x:-171,y:0},lr={x:-276,y:0},ur={x:-298,y:0},cr={x:0,y:0},dr={x:-21,y:0};class fr extends Qs{constructor(t,e,i,s){super(t,i),this.il=mt.document.createElement("button"),this.sl=mt.document.createElement("div"),this.el=mt.document.createElement("label"),this.Ja=i,this.hl=e,this.rl=s}nl(t,e,i,s){this.ol(t,s),this.al(),this.ll(e),this.cl(),this.el.textContent=i||"";const r=mt.document.createElement("div");this.ul(r),this.il.onclick=this.onClick.bind(this),r.appendChild(this.sl),r.appendChild(this.el),this.il.appendChild(r)}cl(){this.il.style.cursor="pointer"}ul(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}ll(t){"string"==typeof t?(this.sl.style.backgroundImage=`url(${t})`,this.sl.style.backgroundSize="100%",this.sl.style.backgroundRepeat="no-repeat",this.sl.style.backgroundPosition="center",this.sl.style.width="20px",this.sl.style.height="20px"):this.applyStyleForSprite(t),this.sl.style.margin="auto"}al(){switch(this.hl){case e.OnScreenMenuButtonShape.RoundedRectangle:this.il.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.il.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.il.style.borderRadius="31px"}}ol(t,e){this.il.style.width=`${this.tl.toString()}px`,this.il.style.height=`${this.Qa.toString()}px`,this.il.style.backgroundColor=t,this.il.style.opacity=e||Pr,this.il.style.alignItems="center",this.il.style.border="2px solid #707070",this.il.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.sl.style.backgroundImage=`url(${this.Nh}/${Or})`,this.sl.style.backgroundPositionX=`${t.x}px`,this.sl.style.backgroundPositionY=`${t.y}px`,this.sl.style.backgroundSize="1600%",this.sl.style.backgroundRepeat="no-repeat",this.sl.style.width="20px",this.sl.style.height="20px"}dl(t){return t.appendChild(this.il),t}fl(){return this.il}}class gr extends fr{constructor(t,e,i,s){super(t,e,i,s),this.pl="",this.ml="",this.Sl=!1,this.rl=s}yl(){this.xl(),this.onToggledStateAction()}bl(){this.vl(),this.onInitialStateAction()}vl(){this.Ml(this.pl)}xl(){this.Ml(this.ml)}Ml(t){"string"==typeof t?this.sl.style.background=t:(this.sl.style.backgroundImage=`url(${this.Nh}/${Or})`,this.sl.style.backgroundPositionX=`${t.x}px`,this.sl.style.backgroundPositionY=`${t.y}px`)}onClick(){this.Sl?this.bl():this.yl(),this.Sl=!this.Sl}}class pr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),ir)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:-1,y:-1})}}class mr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),nr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:-1,y:0})}}class yr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),hr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:0,y:-1})}}class xr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),sr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:1,y:1})}}class Sr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),or)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:1,y:0})}}class vr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),ar)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:0,y:1})}}class br extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.pl=lr,this.ml=ur,this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),this.pl)}onToggledStateAction(){this.rl.setAnimationsEnabled(!1)}onInitialStateAction(){this.rl.setAnimationsEnabled(!0)}}class Mr extends fr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),rr)}onClick(){this.rl.forEachAxis((t=>{t.fit(!0)}))}}class Ar extends fr{constructor(t,e,i){super(t,e.shape||Fr,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),r=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),n=e.icon||"",o=e.label||"",h=e.opacity||"";this.nl(r,n,o,h),this.Al=e.action}onClick(){this.Al(this.rl)}}class kr extends gr{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.rl=i,this.wl=s,this.pl=dr,this.ml=cr,this.nl(Rr,this.pl)}vl(){this.Ml(this.pl),this.il.style.backgroundColor=Rr,this.il.style.border="2px solid #707070",this.il.style.margin="0px"}xl(){this.Ml(this.ml),this.il.style.background="#FECC00 0% 0% no-repeat padding-box",this.il.style.border="10px solid #BCBCBC12",this.il.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.wl)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.wl)||void 0===t||t.style.setProperty("display","none")}}var wr;e.MouseStyles=void 0,(wr=e.MouseStyles||(e.MouseStyles={})).Move="move",wr.ResizeColumn="col-resize",wr.ResizeRow="row-resize",wr.Horizontal="ew-resize",wr.Vertical="ns-resize",wr.NorthWest="nw-resize",wr.NorthEast="ne-resize",wr.Copy="copy",wr.CrossHair="crosshair",wr.Default="default",wr.Help="help",wr.Restricted="not-allowed",wr.None="none",wr.Point="pointer",wr.Text="text",wr.Wait="wait",wr.ZoomIn="zoom-in",wr.ZoomOut="zoom-out";const Dr={LeftBottom:u(-1,-1),CenterBottom:u(0,-1),RightBottom:u(1,-1),LeftCenter:u(-1,0),Center:u(0,0),RightCenter:u(1,0),LeftTop:u(-1,1),CenterTop:u(0,1),RightTop:u(1,1)},Er=new L({color:A(255,255,255,0)}),Tr=new tt({thickness:1,fillStyle:Er}),Ir=60,Cr=60,Pr="1.0",Or="osm/osm-sprite-transparent.png",Fr=e.OnScreenMenuButtonShape.Circle,Rr="#363636";var Br;e.OSMPosition=void 0,(Br=e.OSMPosition||(e.OSMPosition={}))[Br.TopRight=0]="TopRight",Br[Br.TopLeft=1]="TopLeft",Br[Br.BottomLeft=2]="BottomLeft",Br[Br.BottomRight=3]="BottomRight";const zr=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let r=0;r{const e=t.length,i=new Array(e).fill(!1),s=(s,r)=>{for(let n=0;n=this.Il?(this.Tl.splice(t,1),t-=1):this.Tl[t].state&&(s=!0);return this.Cl?0===e.interactions.length&&(this.Tl.push({state:!1,time:i}),this.Cl=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Tl.push({state:!0,time:i}),s=!0,this.Cl=!0),s}Zs(t,e,i){if(i){const i=this.Tl.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Fl(t,e),this.Tl.length=0)}}},Gr=class{constructor(t,e,i,s=1,r=100){this.Pl=t,this.Dl=e,this.Bl=i,this.Ol=s,this.Ll=r}kl(t,e){const i=e.interactions.length;if(i===this.Ol){if(void 0!==this.Rl)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=zr(t);let s=0;for(let r=0;r{const i=t.getDraggingMode();return void 0!==i&&i!==e.UIDraggingModes.notDraggable?i===e.UIDraggingModes.draggable?e.MouseStyles.Move:i===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical:void 0};class Wr{constructor(){this.Ui=!0,this.P=new r.Eventer,this.Gl=0,this.Wl=(t,e)=>{0===this.Gl&&this.P.emit("mouseEnter",this,e),this.Gl+=1},this.Hl=(t,e)=>{this.Gl-=1,this.Gl<1&&(this.P.emit("mouseLeave",this,e),this.Gl=0)},this.Ul=(t,e)=>{this.P.emit("mouseClick",this,e)},this.$l=(t,e)=>{this.P.emit("mouseDoubleClick",this,e)},this.Yl=(t,e)=>{this.P.emit("mouseDown",this,e)},this.Xl=(t,e)=>{this.P.emit("mouseUp",this,e)},this.jl=(t,e)=>{this.P.emit("mouseMove",this,e)},this.Zl=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.Kl=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.ql=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Jl=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.Ql=(t,e)=>{this.Gl+=1,this.P.emit("touchStart",this,e)},this.tc=(t,e)=>{this.P.emit("touchMove",this,e)},this.ic=(t,e)=>{this.Gl-=1,this.P.emit("touchEnd",this,e)},this.sc=t=>(t instanceof Cs?t.setMouseEnterEventHandler(this.Wl).setMouseLeaveEventHandler(this.Hl).setMouseClickEventHandler(this.Ul).setMouseDoubleClickEventHandler(this.$l).setMouseDownEventHandler(this.Yl).setMouseUpEventHandler(this.Xl).setMouseMoveEventHandler(this.jl).setMouseDragEventHandler(this.Kl).setMouseDragStartEventHandler(this.Zl).setMouseDragStopEventHandler(this.ql).setMouseWheelEventHandler(this.Jl).setTouchStartEventHandler(this.Ql).setTouchMoveEventHandler(this.tc).setTouchEndEventHandler(this.ic):(t.onMouseEnter(this.Wl),t.onMouseLeave(this.Hl),t.onMouseClick(this.Ul),t.onMouseDoubleClick(this.$l),t.onMouseDown(this.Yl),t.onMouseUp(this.Xl),t.onMouseMove(this.jl),t.onMouseDrag(this.Kl),t.onMouseDragStart(this.Zl),t.onMouseDragStop(this.ql),t.onMouseWheel(this.Jl),t.onTouchStart(this.Ql),t.onTouchMove(this.tc),t.onTouchEnd(this.ic)),t)}onMouseEnter(t){return this.P.on("mouseEnter",t)}onMouseLeave(t){return this.P.on("mouseLeave",t)}onMouseClick(t){return this.P.on("mouseClick",t)}onMouseDoubleClick(t){return this.P.on("mouseDoubleClick",t)}onMouseDown(t){return this.P.on("mouseDown",t)}onMouseUp(t){return this.P.on("mouseUp",t)}onMouseMove(t){return this.P.on("mouseMove",t)}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offMouseEnter(t){return this.P.off(t,"mouseEnter")}offMouseLeave(t){return this.P.off(t,"mouseLeave")}offMouseClick(t){return this.P.off(t,"mouseClick")}offMouseDoubleClick(t){return this.P.off(t,"mouseDoubleClick")}offMouseDown(t){return this.P.off(t,"mouseDown")}offMouseUp(t){return this.P.off(t,"mouseUp")}offMouseMove(t){return this.P.off(t,"mouseMove")}offMouseDragStart(t){return this.P.off(t,"mouseDragStart")}offMouseDrag(t){return this.P.off(t,"mouseDrag")}offMouseDragStop(t){return this.P.off(t,"mouseDragStop")}offMouseWheel(t){return this.P.off(t,"mouseWheel")}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}getIsUnderMouse(){return this.Gl>0}setVisible(t){const e=this.Ui!==t;return this.Ui=t,e&&this.P.emit("visibleStateChanged",this,this.Ui),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Hr=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.ti(t.getPosition(),{x:r!==e.UIDraggingModes.onlyVertical?i.x:0,y:r!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,h=t.getSize(),a=t.getOrigin(),l=o.ti({x:o.x.getInnerStart(),y:o.y.getInnerStart()},ei({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.ti({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},ei({x:(a.x-1)/2,y:(a.y-1)/2},h)),c={x:Math.min(Math.max(n.x,l.x),u.x),y:Math.min(Math.max(n.y,l.y),u.y)};t.setPosition(c),Zt(s)}},Ur=(t,e,i,s,r)=>{Hr(t,r,e)},Xr=(t,e,i,s,r)=>{Hr(t,s,r)};class jr extends Wr{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.xe=!1,this.hc=void 0,this.rc=void 0,this.nc=Nr,this.oc=void 0,this.ac=()=>{const t="function"==typeof this.nc?this.nc(this):this.nc;t&&(this.rc=this.Hr.Wi.Oe(t))},this.lc=()=>{this.Hr.Wi.Le(this.rc)},this.Pt=x(0,0,0,0),this.Hr=t,this.renderingScale=e,this.scale=i,this.bt=s,this.fs=r,this.Hr.Gi(),this.onMouseEnter(this.ac),this.onMouseLeave(this.lc),this.onMouseDrag(Ur);const n=_r(new Gr(At,Xr,At));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.fs=r}setEffect(t){return this.cc=this.cc||this.Hr.Wi.cc.uc(this,{dc:{shapes:this.fc()}}),this.cc.dc.Is(t),this}getEffect(){return!!this.cc&&this.cc.dc.Ps()}setAutoDispose(t){return this.oc=t,this.Hr.Gi(),this}getAutoDispose(){return this.oc}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Pt.left+this.Pt.right),this.size.y+(this.Pt.bottom+this.Pt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Pt="object"==typeof t?v(this.Pt,t):{left:t,top:t,right:t,bottom:t},this.Hr.Gi(),this}getMargin(){return this.Pt}gc(){if(this.oc){const t=this.size,e=this.renderingScale.$t(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.oc.type&&i.x>=this.oc.maxWidth||"max-height"===this.oc.type&&i.y>=this.oc.maxHeight)&&this.dispose()}return this}Zs(){return this}dispose(){return this.xe||(this.Hr.Gi(),this.xe=!0,this.bt(this),this.P.emit("dispose",this)),this}setVisible(t){return super.setVisible(t),this.Hr.Gi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setPosition(t){return this.position=t,this.Hr.Gi(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.ti(this.position,ei({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.ti(r,ei({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.ti(r,{x:this.Pt.left,y:this.Pt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.ti(n,ei({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Hr.Gi(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.hc=t,this.Hr.Gi(),this}getDraggingMode(){return void 0!==this.hc?this.hc:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.nc=t,this}getMouseStyle(){return this.nc}}class Yr extends jr{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.pn=x(),this.mc=0,this.Hr=t,this.Sc=s,this.backgroundElement=new this.Sc(this.Hr,this.renderingScale,this.scale,At,n),this.sc(this.backgroundElement)}fc(){return this.backgroundElement.fc()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}gc(){return super.gc(),this.xe||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).gc(),this}Zs(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.yc(t).Zs(),super.Zs()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.pn="object"==typeof t?v(this.pn,t):{left:t,top:t,right:t,bottom:t},this.Hr.Gi(),this}getPadding(){return this.pn}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.pn.left+this.pn.right,i.y+this.pn.bottom+this.pn.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.xc()+this.backgroundElement.bc(),i.y+this.backgroundElement.vc()+this.backgroundElement.Mc())),i}getPosition(t=this.origin,i=e.UISpace.Everything){if(i===e.UISpace.Everything)return super.getPosition(t,i);const s=super.getPosition(u(-1,-1),e.UISpace.Everything),r=this.getMargin(),n=this.scale.ti(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.ti(n,ei({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.ti(n,{x:this.backgroundElement.xc(),y:this.backgroundElement.vc()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.ti(o,ei({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.ti(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.ti(a,ei({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return this.backgroundElement.setMouseInteractions(t),this}getMouseInteractions(){return this.backgroundElement.getMouseInteractions()}getHighlight(){return this.mc}setHighlight(t){return this.mc=ye(t),this.backgroundElement.setHighlight(t),this.P.emit("highlight",t),this}}const $r=t=>"setBackground"in t;class Zr extends Wr{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.u=0,this._c=1,this.Ac=!0,this.wc=new Yi,this.kc=!0,this.xe=!1,this.axisScale=s,this.renderingScale=r,this.Cc=o,this.Tc=h,this.Ic=a,this.bt=l,this.Fc=e,this.Pc=i,this.Dc=this.sc(this.Fc.Bc(this.renderingScale)),this.fs=u,this.Oc=this.sc(this.Ic.Lc(this.Pc,this.renderingScale,n,At,this.fs,!1).setOrigin(Yt(this.Tc)).setDirection(this.Tc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Oc.Rc?this.Dc.ua(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Oc.Rc?this.Dc.ua(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Oc.Rc&&this.Dc.ua(u.cursorGridStrokeStyleX)}setValue(t){return this.u=t,this.Pc.Gi(),this.P.emit("valueChange",this.u),this}getValue(){return this.u}setTextFormatter(t){return this.Ec=t,this.Pc.Gi(),this}setTickLength(t){return this.Oc.setPointerLength(t),this.Fc.Gi(),this}getTickLength(){return this.Oc.getPointerLength()}setTickLabelPadding(t){return this.Oc.setTickLabelPadding(t),this.Fc.Gi(),this}setTickLabelRotation(t){return this.Oc.setTextRotation(t),this.Fc.Gi(),this}getTickLabelRotation(){return this.Oc.getTextRotation()}getTickLabelPadding(){return this.Oc.getTickLabelPadding()}setGridStrokeLength(t){return this._c=t,this.Fc.Gi(),this}getGridStrokeLength(){return this._c}setGridStrokeStyle(t){return this.Dc.ua(t),this.Fc.Gi(),this}getGridStrokeStyle(){return this.Dc.da()}dispose(){return this.xe||(this.xe=!0,this.Dc.dispose(),this.Oc.dispose(),this.bt(this),this.Fc.Wi.Gi(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setMarkerVisible(t){return this.Ac=t,this.Pc.Gi(),this}getMarkerVisible(){return this.Ac}setMarker(t){return t(this.Oc),this.Pc.Gi(),this}getMarker(){return this.Oc}setMouseInteractions(t){return this.Oc.setMouseInteractions(t),this.Dc.setMouseInteractions(t),this}getMouseInteractions(){return this.Dc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.kc=t,this.Pc.Gi(),this}getAllocatesAxisSpace(){return this.kc}isInScale(){return Re(this.u,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}}class qr extends Zr{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,u,a,l),this.zc=!1,this.bt=a,this.Fc=e,this.Pc=i}dispose(){return this.zc=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.zc=!1;const r=rt(this.u,this.axisScale,this.Cc.getWidth(this.renderingScale));this.Dc.setVisible(!0).Sa(this.Cc.toPoint(r,t)).ha(this.Cc.toPoint(r,t-(i+e*this._c))),this.Ac?(this.Ec&&this.Oc.setText(this.Ec(this.u,this)),this.Oc.setVisible(!0).setPosition(this.Cc.toPoint(r,s))):this.Oc.setVisible(!1)}else this.Dc.setVisible(!1),this.Oc.setVisible(!1);return this.Oc.Zs().gc(),this}Vc(){const t=this.Oc.Zs().getSize();return this.Cc.getHeight(t)}}var Kr;e.HighlightModes=void 0,(Kr=e.HighlightModes||(e.HighlightModes={}))[Kr.noHighlighting=0]="noHighlighting",Kr[Kr.onHover=1]="onHover",Kr[Kr.onHoverIndividual=2]="onHoverIndividual";class Jr{constructor(t,i,s,n){this.Nc=!0,this.Gc=e.HighlightModes.onHover,this.xe=!1,this.Ui=!0,this.Wc=0,this.P=new r.Eventer,this.Hc=[],this.Uc=(t,e)=>{this.setVisible(e)},this.$c=()=>this.setHighlight(1),this.Yc=()=>this.setHighlight(0),this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.Xc=(t,e)=>{0===this.Wc&&this.P.emit("mouseEnter",this,e),this.jc()},this.Zc=(t,e)=>{1===this.Wc&&this.P.emit("mouseLeave",this,e),this.Kc()},this.qc=(t,e)=>{this.P.emit("mouseMove",this,e),this.Jc()},this.Qc=(t,e)=>this.P.emit("mouseClick",this,e),this.tu=(t,e)=>this.P.emit("mouseDoubleClick",this,e),this.iu=(t,e)=>this.P.emit("mouseDown",this,e),this.su=(t,e)=>this.P.emit("mouseUp",this,e),this.eu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.hu=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.ru=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.nu=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.ou=(t,e)=>{this.P.emit("touchStart",this,e),this.jc()},this.au=(t,e)=>{this.P.emit("touchMove",this,e),this.Jc()},this.lu=(t,e)=>{this.P.emit("touchEnd",this,e),this.Kc()},this.rl=t,this.cu=i,this.fs=s,this.be=new Map,this.uu=n,this.cc=this.uu.uc(this,{du:{themeEffectEnabled:this.fs.effectsText},fu:{}}),this.rl.Wi.Zh.ke(this,(t=>{this.be.forEach(((e,i)=>i.zr(t))),this.Hc.forEach((e=>{e.setHighlight(t)}))}),{animationEnabled:this.rl.getAnimationsEnabled()})}gu(t,e){const i=void 0===(null==e?void 0:e.setEventHandlers)||e.setEventHandlers,s=void 0!==(null==e?void 0:e.isText)&&e.isText;this.be.set(t,{isText:s});const r=Array.from(this.be);this.cc.du.pu(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.cc.fu.pu(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Nc).setVisible(this.Ui).zr(this.getHighlight()),i&&t.setMouseEnterEventHandler(this.Xc).setMouseLeaveEventHandler(this.Zc).setMouseClickEventHandler(this.Qc).setMouseDoubleClickEventHandler(this.tu).setMouseDownEventHandler(this.iu).setMouseUpEventHandler(this.su).setMouseMoveEventHandler(this.qc).setMouseDragStartEventHandler(this.eu).setMouseDragEventHandler(this.hu).setMouseDragStopEventHandler(this.ru).setMouseWheelEventHandler(this.nu).setTouchStartEventHandler(this.ou).setTouchMoveEventHandler(this.au).setTouchEndEventHandler(this.lu)}mu(t){this.be.delete(t)}setEffect(t){return this.cc.du.Is(t&&this.fs.effectsText),this.cc.fu.Is(t),this.rl.Wi.Gi(),this}getEffect(){return this.cc.du.Ps()||this.cc.fu.Ps()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setName(t){return this.Su=t,this.Hc.forEach((t=>t.setText(this.Su))),this}getName(){return this.Su}dispose(){return this.xe||(this.xe=!0,this.be.forEach(((t,e)=>e.dispose())),this.cu(this),this.Hc.forEach((t=>{t.dispose()})),this.Hc.length=0,this.P.emit("dispose",this),this.rl.Wi.Gi()),this}setVisible(t){return t===this.Ui||(this.Ui=t,this.be.forEach(((e,i)=>i.setVisible(t))),this.Hc.forEach((e=>e.setOn(t))),this.P.emit("visibleStateChanged",this,this.Ui),this.rl.Wi.Gi()),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setHighlight(t){return this.rl.Wi.Zh.Ie(this,t),this.P.emit("highlight",t),this}getHighlight(){return this.rl.Wi.Zh.Fe(this)}setAnimationHighlight(t){return this.rl.Wi.Zh.Pe(this,t),this}getAnimationHighlight(){return this.rl.Wi.Zh.De(this)}setMouseInteractions(t){return this.Nc=t,this.be.forEach(((e,i)=>i.setMouseInteractions(t))),this.rl.Wi.Gi(),this}getMouseInteractions(){return this.Nc}getIsUnderMouse(){return this.Wc>0}setHighlightOnHover(t){return this.Gc=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Gc!==e.HighlightModes.noHighlighting}attach(t,e=!0){t.setText(this.Su),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1));const i=t.getLocked();return t.setLocked(!1).setOn(this.getVisible()).setLocked(i),e&&t.onSwitch(this.Uc),t.setLocked(!e),t.onMouseEnter(this.$c),t.onMouseLeave(this.Yc),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.Hc.push(t),this}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}onDispose(t){return this.P.on("dispose",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}offDispose(t){return this.P.off(t,"dispose")}jc(t=1){this.Wc+=t,this.Wc===t&&this.Gc===e.HighlightModes.onHover&&this.setHighlight(!0)}Kc(t=1){this.Wc=Math.max(0,this.Wc-t),0===this.Wc&&this.Gc===e.HighlightModes.onHover&&this.setHighlight(!1)}Jc(){}}class Qr extends Jr{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Hr=t,this.axis=s,this.ut=r,this.yu=n,this.xu()}}class tn extends Qr{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Su="Band",this.bu=0,this.vu=0,this.jr=this.fs.bandFillStyle,this.tn=this.fs.bandStrokeStyle,this.Mu=this.Hr._u(this.ut).As(this.jr).ir(this.tn).zr(this.getHighlight()),this.gu(this.Mu)}setValueStart(t){return this.bu=t,this.P.emit("valueChange",this,this.bu,this.vu),this.Hr.Gi(),this}getValueStart(){return this.bu}setValueEnd(t){return this.vu=t,this.P.emit("valueChange",this,this.bu,this.vu),this.Hr.Gi(),this}getValueEnd(){return this.vu}setFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;return this.Mu.As(e),this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){this.tn="function"==typeof t?t(this.tn):t;const e=this.tn;return this.Mu.ir(e),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}gc(){return this.Mu.Cn(this.yu.toVec2(this.bu,this.yu.getHeight(this.ut).getInnerStart())).q(this.yu.toVec2(this.vu-this.bu,this.yu.getHeight(this.ut).getInnerInterval())),this}attach(t,e){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}Au(t,e){t.zr(e),this.Hr.Gi()}xu(){let t,i;const s=(e,s)=>{const r=nt(this.Hr.Wi.Re(s.x,s.y),this.Hr.Wi.ut,this.ut),n=this.yu.getWidth(r),o=this.axis.ut.ct(this.bu),h=this.axis.ut.ct(this.vu),a=(this.axis.ut.ct(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{const h=this.yu.getWidth(n);t?(this.bu=this.axis.ut.ti(this.bu,h),this.vu=this.axis.ut.ti(this.vu,h)):i?this.bu=this.axis.ut.ti(this.bu,h):this.vu=this.axis.ut.ti(this.vu,h),Zt(o),this.P.emit("valueChange",this,this.bu,this.vu),this.Hr.Gi()};this.onMouseMove(((i,r)=>{s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.yu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.wu=this.rl.engine.setMouseStyle(n,this.wu)})),this.onMouseLeave((()=>{this.rl.engine.restoreMouseStyle(this.wu),this.wu=void 0})),this.onMouseDrag(((t,e,i,s,n)=>{0===i&&r(0,0,0,n,e)}));const n=_r(new Gr(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class en extends Qr{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Su="Constant Line",this.u=0,this.tn=this.fs.constantLineStrokeStyle,this.ku=!0,this.Cu=this.Hr.Bc(this.ut).ua(this.tn).zr(this.getHighlight()),this.gu(this.Cu)}setValue(t){return this.u=t,this.P.emit("valueChange",this,this.u),this.Hr.Gi(),this}getValue(){return this.u}setStrokeStyle(t){this.tn="function"==typeof t?t(this.tn):t;const e=this.tn;return this.Cu.ua(e),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}setInteractionMoveByDragging(t){return this.ku=t,this}getInteractionMoveByDragging(){return this.ku}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}gc(){return this.Cu.Sa(this.yu.toVec2(this.u,this.yu.getHeight(this.ut).getInnerStart())).ha(this.yu.toVec2(this.u,this.yu.getHeight(this.ut).getInnerEnd())),this}attach(t,e){return super.attach(t,e),ae(t,this.fs,{stroke:this.tn}),this}Au(t,e){t.zr(e),this.Hr.Gi()}xu(){const t=(t,e)=>{this.ku&&(this.u=this.axis.ut.ti(this.u,this.yu.getWidth(e)),this.P.emit("valueChange",this,this.u),this.Hr.Gi(),Zt(t))};this.onMouseMove((()=>{if(this.ku){const t=this.yu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.wu=this.rl.engine.setMouseStyle(t,this.wu)}})),this.onMouseLeave((()=>{this.ku&&(this.rl.engine.restoreMouseStyle(this.wu),this.wu=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.ku&&0===s&&t(i,n)}));const i=_r(new Gr(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const sn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),rn=(t,e)=>(ae(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),nn=(t,e,i)=>{i&&$r(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},on={uiElement:void 0,stylers:o.List(),addStyler(t){return{...this,stylers:this.stylers.push(t)}},applyStylers(t,e){return this.stylers.forEach((i=>void 0!==i?i(t,e):void 0)),t}},hn={background:void 0,setBackground(t){return{...this,background:t}}},an={Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return nn(o,r,n),o}},ln={Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return nn(o,r,n),o}};class un extends jr{constructor(){super(...arguments),this.Tu=!0}gc(){return super.gc(),this}setMouseInteractions(t){return this.Tu=t,this}getMouseInteractions(){return this.Tu}fc(){return[]}}class cn extends un{onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}yc(t){return this.size=t,this}xc(){return 0}bc(){return 0}Mc(){return 0}vc(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return B}setStrokeStyle(){return this}getStrokeStyle(){return J}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class dn extends cn{constructor(){super(...arguments),this.setSize=this.yc.bind(this)}}class fn extends jr{constructor(){super(...arguments),this.jr=B,this.P=new r.Eventer,this.mc=0}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}fc(){return[this.Gn]}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Gn.As(this.jr),this.Hr.Gi(),this}getFillStyle(){return this.jr}getHighlight(){return this.mc}setHighlight(t){return this.mc=t,this.Gn.zr(t),this.P.emit("highlight",t),this.Hr.Gi(),this}setMouseInteractions(t){return this.Gn.setMouseInteractions(t),this}getMouseInteractions(){return this.Gn.getMouseInteractions()}dispose(){return super.dispose(),this.Gn.dispose(),this}setVisible(t){return super.setVisible(t),this.Gn.setVisible(t),this}}class gn extends fn{constructor(){super(...arguments),this.tn=J}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.Gn.ir(this.tn),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}}class pn extends gn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Hr=t,this.Gn=this.Hr.Iu(this.renderingScale,js.Simple).ir(this.getStrokeStyle()).As(this.getFillStyle()).setVisible(!1),this.sc(this.Gn)}Fu(){const t=this.Pu();if(t.length>2){const e=Ve(t),i=u(e.max.x-e.min.x,e.max.y-e.min.y);this.setContentSize(i);const s=t.map((t=>{const s=Qe(t,Je(e.min,-1));return this.scale.ti(this.position,Qe(s,ei(Je(Qe(this.origin,u(1,1)),-.5),i)))})).map((t=>nt(t,this.scale,this.renderingScale)));this.Gn.yo(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Gn&&this.Gn.setVisible(!1),this.setContentSize(u(0,0))}gc(){return super.gc(),this.xe||this.Fu(),this}Zs(){return this.Fu(),super.Zs()}setVisible(t){return super.setVisible(t),this.Gn.setVisible(t),this}}class mn extends fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.nn="label",this.Gn=this.Hr.ye(this.renderingScale).As(this.jr).Ms(this.nn),this.sc(this.Gn)}gc(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=nt(t,this.scale,this.renderingScale);return this.Gn.Cn(i),this}Zs(){this.Gn.Zs();const t=0===this.nn.length?u(0,0):this.Gn.Du();return this.setContentSize(t),super.Zs()}setText(t){return this.nn=t,this.Gn.Ms(this.nn),this.Hr.Gi(),this}getText(){return this.nn}setFont(t){return this.Gn.ks(t),this.Hr.Gi(),this}getFont(){return this.Gn.ws()}setTextRotation(t){return this.Gn.Cs(t),this.Hr.Gi(),this}getTextRotation(){return this.Gn.Ts()}}const yn={...on,...an,uiElement:mn};class xn extends gn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.yc.bind(this),this.setSize=this.fitTo,this.Gn=this.Hr._u(e).As(this.jr).ir(this.getStrokeStyle()),this.sc(this.Gn)}gc(){const t=Ve([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>nt(t,this.scale,this.renderingScale)))),i={x:t.max.x-t.min.x,y:t.max.y-t.min.y};return this.Gn.q(i).Cn(nt(this.getPosition(u(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)),this}yc(t){return this.setContentSize(t),this.Hr.Gi(),this}xc(){return 0}bc(){return 0}Mc(){return 0}vc(){return 0}}class Sn extends gn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Bu=u(0,0),this.setSize=this.fitTo.bind(this),this.Gn=t.Ou(e).ea(0).ha(360).As(this.jr).ir(this.getStrokeStyle()),this.sc(this.Gn)}gc(){const t=this.getSize(e.UISpace.Content).x/2;return this.Gn.na(t*this.renderingScale.wi().x).oa(t*this.renderingScale.wi().y).Cn(nt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).la(255).Zs(),this}yc(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Bu=t,this.Hr.Gi(),this}xc(){return(this.getSize(e.UISpace.Content).x-this.Bu.x)/2}bc(){return(this.getSize(e.UISpace.Content).x-this.Bu.x)/2}Mc(){return(this.getSize(e.UISpace.Content).y-this.Bu.y)/2}vc(){return(this.getSize(e.UISpace.Content).y-this.Bu.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Bu=t,this}}class vn extends pn{constructor(t,e,i,s,r){super(t,e,i,js.Simple,s,r),this.Lu=y(u(0,0)),this.Ru=!1,this.setSize=this.fitTo.bind(this),this.Hr=t,this.Fu()}Pu(){const t=this.Lu.M();if(this.Ru){const e=Math.min(t.x,t.y);return[u(0,0),u(e/2,e/2),u(0,e),u(-e/2,e/2)]}const e=2*Math.sqrt(this.Lu.M().x*this.Lu.M().x/4+this.Lu.M().y*this.Lu.M().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),r=u(0,0),n=Qe(r,Qe(i,s)),o=Qe(n,Qe(s,Je(i,-1)));return[r,n,o,ti(o,Qe(i,s))]}yc(t){return this.Lu.S(t),this.Ru=!1,this.Hr.Gi(),this}xc(){return this.Ru?0:(this.getSize(e.UISpace.Content).x-this.Lu.M().x)/2}bc(){return this.Ru?0:(this.getSize(e.UISpace.Content).x-this.Lu.M().x)/2}Mc(){return this.Ru?0:(this.getSize(e.UISpace.Content).y-this.Lu.M().y)/2}vc(){return this.Ru?0:(this.getSize(e.UISpace.Content).y-this.Lu.M().y)/2}fitTo(t){return this.Lu.S(t),this.Ru=!0,this.Hr.Gi(),this}}class bn extends pn{constructor(t,i,s,r,n){super(t,i,s,js.Simple,r,n),this.Eu=y(u(0,0)),this.zu=y(10),this.Vu=y(void 0),this.Tc=y(e.UIDirections.Right),this.Fu()}setDirection(t){return this.Tc.S(t),this.Hr.Gi(),this}getDirection(){return this.Tc.M()}setPointerLength(t){return this.zu.S(t),this.Hr.Gi(),this}getPointerLength(){return this.zu.M()}setPointerAngle(t){return this.Vu.S(t),this.Hr.Gi(),this}getPointerAngle(){let t=this.Vu.M();if(void 0===t){const e=this.Nu();if(0===e)return 0;t=0!==e?180*Math.atan(2*this.getPointerLength()/e)/Math.PI:0}return Math.min(Math.max(t,1),89)}yc(t){return this.Eu.S(t),this.Hr.Gi(),this}Gu(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Wu(){return $t(this.Tc.M())?this.Eu.M().x:this.Eu.M().y}Nu(){return $t(this.Tc.M())?this.Eu.M().y:this.Eu.M().x}xc(){switch(this.Tc.M()){case e.UIDirections.Right:return 0;case e.UIDirections.Left:return this.getPointerLength();case e.UIDirections.Up:case e.UIDirections.Down:return Math.max(0,this.Gu()-this.Nu());default:return 0}}bc(){switch(this.Tc.M()){case e.UIDirections.Right:return this.getPointerLength();case e.UIDirections.Left:return 0;case e.UIDirections.Up:case e.UIDirections.Down:return Math.max(0,this.Gu()-this.Nu());default:return 0}}Mc(){switch(this.Tc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Gu()-this.Nu());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}vc(){switch(this.Tc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Gu()-this.Nu());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}Pu(){const t=Yt(this.Tc.M()),e=qe(u(0,0),t),i=this.getPointerLength(),s=this.Gu(),r=this.Wu(),n=this.Nu();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=Qe(Qe(o,Je(t,-i)),Je(e,s/2)),a=Qe(h,Je(e,(n-s)/2)),l=Qe(a,Je(t,-r)),c=Qe(Qe(o,Je(t,-i)),Je(e,-s/2)),d=Qe(c,Je(e,-(n-s)/2)),f=Qe(d,Je(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:kt(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Mn extends un{setSize(t){return this.setContentSize(t),this.Hr.Gi(),this}}class An extends Yr{constructor(){super(...arguments),this.Hu=[],this.Uu=0,this.$u=t=>{const e=this.Hu.indexOf(t);e>=0&&this.Hu.splice(e,1)}}getMembers(){return this.Hu}getMemberCount(){return this.Hu.length}setMinimumSize(t){return this.Yu=t,this.Hr.Gi(),this}getMinimumSize(){return this.Yu}addElement(t,e=-1){const i=t.Lc(this.Hr,this.renderingScale,this.scale,this.$u,this.fs,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Hu.splice(e,0,i):this.Hu.push(i),i.setVisible(this.getVisible()),this.sc(i),this.xe&&(ge(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Hu.slice().forEach(Mt),this}setVisible(t){return super.setVisible(t),this.Hu.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Mn)),0),s=i>0?(this.size.x-this.Uu)/i:0;return this.Hu.reduce(((e,i)=>i instanceof Mn?this.scale.ti({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).gc().getPosition(u(1,0)).x),t.x),this}Zs(){for(let t=0;tt+ +(e instanceof Mn)),0),s=i>0?(this.size.y-this.Uu)/i:0;return this.Hu.reduce(((e,i)=>i instanceof Mn?this.scale.ti({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).gc().getPosition(u(0,-1)).y),t.y),this}Zs(){for(let t=0;t{const i={},s=`stylable${t}s`;return i[s]=e,i[`set${t}FillStyle`]=function(t){return this[s].forEach((e=>e.setFillStyle(t))),this},i[`get${t}FillStyle`]=function(){return this[s][0].getFillStyle()},i[`set${t}Font`]=function(t){return this[s].forEach((e=>e.setFont(t))),this},i[`get${t}Font`]=function(){return this[s][0].getFont()},i[`set${t}Rotation`]=function(t){return this[s].forEach((e=>e.setTextRotation(t))),this},i[`get${t}Rotation`]=function(){return this[s][0].getTextRotation()},i},Fn=On("Text",[]),Rn={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.P.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.P.on("switch",(e=>t(this,e)))},offSwitch(t){return this.P.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOffStrokeStyle(t){return this.button.setOffStrokeStyle(t),this},getButtonOffStrokeStyle(){return this.button.getOffStrokeStyle()},setButtonOffSize(t){return this.button.setOffSize(t),this},getButtonOffSize(){return this.button.getOffSize()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonOnStrokeStyle(t){return this.button.setOnStrokeStyle(t),this},getButtonOnStrokeStyle(){return this.button.getOnStrokeStyle()},setButtonOnSize(t){return this.button.setOnSize(t),this},getButtonOnSize(){return this.button.getOnSize()}},Bn={pointable:void 0,setDirection(t){return this.pointable.setDirection(t),this},getDirection(){return this.pointable.getDirection()},setPointerLength(t){return this.pointable.setPointerLength(t),this},getPointerLength(){return this.pointable.getPointerLength()}},zn={...on,...hn,background:xn,Lc(t,e,i,s,r,n){const o=new kn(t,e,i,this.background,s,r),h=o.addElement(yn,void 0),a=Object.assign(o,Pn,{setTextLabel:h},Fn,{stylableTexts:[h]});return nn(a,r,n),this.applyStylers(a,r)}}.addStyler(sn),_n={...on,...hn,background:bn,Lc(t,i,s,r,n,o){const h=new kn(t,i,s,this.background,r,n),a=h.addElement(yn,void 0),l=h.getBackground(),u=Object.assign(h,Pn,{setTextLabel:a},Fn,{stylableTexts:[a]},Bn,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Rc="other",u.setPointerLength(n.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(n.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(n.uiTextFont).setTextFillStyle(n.uiTextFillStyle).setBackground((t=>t.setFillStyle(n.uiBackgroundFillStyle).setStrokeStyle(n.uiBackgroundStrokeStyle))),nn(u,n,o),this.applyStylers(u,n)}};class Ln extends jr{constructor(t,e,i,s,n,o,h){super(t,e,i,o,h),this.Cl=!1,this.P=new r.Eventer,this.getOn=()=>this.Cl,this.ju=this.sc(new s(this.Hr,this.renderingScale,this.scale,At,h)),this.Zu=this.sc(new n(this.Hr,this.renderingScale,this.scale,At,h))}fc(){return[...this.ju.fc(),...this.Zu.fc()]}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setOn(t){return this.Cl=t,this.Hr.Gi(),this}setOffFillStyle(t){return this.ju.setFillStyle(t),this}getOffFillStyle(){return this.ju.getFillStyle()}setOffStrokeStyle(t){return this.ju.setStrokeStyle(t),this}getOffStrokeStyle(){return this.ju.getStrokeStyle()}setOffSize(t){return this.ju.fitTo("number"==typeof t?u(t,t):t),this}getOffSize(){return this.ju.getSize()}setOnFillStyle(t){return this.Zu.setFillStyle(t),this}getOnFillStyle(){return this.Zu.getFillStyle()}setOnStrokeStyle(t){return this.Zu.setStrokeStyle(t),this}getOnStrokeStyle(){return this.Zu.getStrokeStyle()}setOnSize(t){return this.Zu.fitTo("number"==typeof t?u(t,t):t),this}getOnSize(){return this.Zu.getSize()}gc(){return super.gc(),this.Cl?(this.ju.setVisible(!1),this.Zu.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).gc()):(this.ju.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).gc(),this.Zu.setVisible(!1)),this}Zs(){const t=this.ju.Zs().getSize(),e=this.Zu.Zs().getSize();return this.setContentSize(u(Math.max(t.x,e.x),Math.max(t.y,e.y))),super.Zs()}dispose(){return super.dispose(),this.ju.dispose(),this.Zu.dispose(),this}setMouseInteractions(t){return this.Zu.setMouseInteractions(t),this.ju.setMouseInteractions(t),this}getMouseInteractions(){return this.Zu.getMouseInteractions()}setHighlight(t){const e=ye(t);return this.Zu.setHighlight(e),this.ju.setHighlight(e),this.P.emit("highlight",t),this.Hr.Gi(),this}getHighlight(){return this.Zu.getHighlight()}}const Gn={...on,uiElement:Ln,pictureOff:Sn,pictureOn:Sn,setPictureOff(t){return{...this,pictureOff:t}},setPictureOn(t){return{...this,pictureOn:t}},Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.pictureOff,this.pictureOn,s,r),r);return nn(o,r,n),o}},Vn={...on,...hn,background:xn,buttonBuilder:Gn,setPictureOff(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOff(t)}},setPictureOn(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOn(t)}},Lc(t,i,s,r,n,o){const h=new kn(t,i,s,this.background,r,n),a=h.addElement(In);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(In);u.addGap();const c=u.addElement(yn);u.addGap(),h.addGap();const d=Object.assign(h,Pn,{setTextLabel:c},Fn,{stylableTexts:[c]},Rn,{button:l});return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setPadding({left:6}),nn(d,n,o),this.applyStylers(d,n)}}.addStyler(sn).addStyler(rn);class Nn extends jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Ku=[],this.qu=2,this.Ju="",this.Qu=(t,e)=>void 0!==t.label?t.label:Mi(t.value,e.min,e.max),this.td=0,this.sd=0,this.ed=!1,this.Hr=t,this.hd=n,this.rd=this.sc(t._u(e).ir(J)),this.nd=this.sc(t.ye(e).As(r.uiTextFillStyle).ks(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this._t=140,this.od=25):(this._t=160,this.od=15)}fc(){return[this.rd,this.nd]}ad(t){this.ld=t;const e=Un(t,"vertical"===this.hd?0:90,this.ed);return this.rd.As(e),this.Hr.Gi(),this}ud(){return this.ld}dd(t){return this._t=t,this.Hr.Gi(),this}fd(){return this._t}gd(t){return this.od=t,this.Hr.Gi(),this}pd(){return this.od}md(t){return this.Ju=t,this.Hr.Gi(),this}Sd(){return this.Ju}yd(t){return this.Qu=t,this.Hr.Gi(),this}setLUTDisplayProportionalSteps(t){if(this.ed=t,this.ld){const t=Un(this.ld,"vertical"===this.hd?0:90,this.ed);this.rd.As(t)}return this.Hr.Gi(),this}getLUTDisplayProportionalSteps(){return this.ed}setFillStyle(t){return this.nd.As(t),this.Hr.Gi(),this}getFillStyle(){return this.nd._s()}setFont(t){return this.nd.ks(t),this.Hr.Gi(),this}getFont(){return this.nd.ws()}setTextRotation(t){return this.sd=t,this.nd.Cs(t),this.Hr.Gi(),this}getTextRotation(){return this.nd.Ts()}gc(){var t,i,s,r;if(super.gc(),this.xe)return this;const n=this.ld;if(n){const o=this.renderingScale.wi(),h=n.min,a=n.max;if("vertical"===this.hd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=Qe(s,{x:this.rd.$t().x+this.qu*o.x,y:0}),l={x:r.x,y:r.y+(this.Ju.length>0?this.td*o.y+this.nd.$t().y:0)+.5*((null===(t=this.Ku[0])||void 0===t?void 0:t.$t().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Ku[this.Ku.length-1])||void 0===i?void 0:i.$t().y)||0)};this.rd.Cn({x:s.x,y:l.y}),this.nd.Ln({x:-1,y:-1}).Cn(r),n.getSteps().forEach(((t,e)=>{const i=Le(l,u,this.ed?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Ku[e].Ln({x:-1,y:0}).Cn(i)}))}else{const t=this.getPosition({x:-1,y:-1},e.UISpace.Content),i=this.getPosition({x:1,y:1},e.UISpace.Content),l=this.Ku.reduce(((t,e)=>Math.max(t,e.$t().y)),0),u=Qe(t,{x:.5*((null===(s=this.Ku[0])||void 0===s?void 0:s.$t().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Ku[this.Ku.length-1])||void 0===r?void 0:r.$t().x)||0)+(this.Ju.length>0?this.td*o.x+this.nd.$t().x:0)),y:u.y},f={x:u.x,y:u.y+this.qu*o.y};this.rd.Cn(f),this.nd.Ln({x:1,y:1}).Cn(c),n.getSteps().forEach(((t,e)=>{const i=Le(u,d,this.ed?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Ku[e].Ln({x:0,y:1}).Cn(i)}))}}return this}Zs(){if(this.ld&&this.getVisible()){const t=this.ld.getSteps();for(let e=this.Ku.length;eMath.max(t,e.Zs().Du().x)),0),this.nd.Zs().Du().x),s=(this.Ju.length>0?this.td+this.nd.Zs().Du().y:0)+e+.5*this.Ku[0].Zs().Du().y+.5*this.Ku[this.Ku.length-1].Zs().Du().y;this.setContentSize({x:i,y:s})}else{const t=this._t,e=this.od;this.rd.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Ju.length>0?this.td+this.nd.Zs().Du().x:0,.5*this.Ku[this.Ku.length-1].Zs().Du().x),s=t+.5*this.Ku[0].Zs().Du().x+i,r=e+this.qu+this.Ku.reduce(((t,e)=>Math.max(t,e.Zs().Du().y)),0);this.setContentSize({x:s,y:r})}}else this.Ku.forEach((t=>t.dispose())),this.Ku.length=0,this.nd.setVisible(!1),this.rd.setVisible(!1),this.setContentSize({x:0,y:0});return super.Zs()}dispose(){return super.dispose(),this.rd.dispose(),this.Ku.forEach(Mt),this.nd.dispose(),this}setMouseInteractions(t){return this.rd.setMouseInteractions(t),this}getMouseInteractions(){return this.rd.getMouseInteractions()}}const Wn={lutElement:{},setLUT(t){return this.lutElement.ad(t),this},getLUT(){return this.lutElement.ud()},setLUTLength(t){return this.lutElement.dd(t),this},getLUTLength(){return this.lutElement.fd()},setLUTThickness(t){return this.lutElement.gd(t),this},getLUTThickness(){return this.lutElement.pd()},setLookUpUnit(t){return this.lutElement.md(t),this},getLookUpUnit(){return this.lutElement.Sd()},setLUTStepValueFormatter(t){return this.lutElement.yd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Hn={...on,...hn,background:xn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},Lc(t,e,i,s,r,n){const o=new wn(t,e,i,this.background,s,r),h=o.addElement({Lc:()=>new Nn(t,e,i,At,r,this.alignment)}),a=Object.assign(o,Fn,{stylableTexts:[h]},Wn,{lutElement:h});return nn(a,r,n),this.applyStylers(a,r)}}.addStyler(sn),Un=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new q({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-r)/n:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew Nn(t,i,s,At,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Pn,{setTextLabel:c},Fn,{stylableTexts:[c,d]},On("LUTText",[d]),Rn,{button:l},Wn,{lutElement:d});return f.onMouseClick((()=>{f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setPadding({left:6}),this.applyStylers(f,n)}}.addStyler(sn).addStyler(rn),jn={alignment:null,title:null,entryStylers:null,legendBoxDisposed:null,entries:[],add(t,e){const i=!e||"object"!=typeof e||void 0===e.toggleVisibilityOnClick||e.toggleVisibilityOnClick,s=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof yo?this.addChart(t,i,s):"attach"in t?this.addAttachable(t,i,s):t&&this.addDashboard(t,i,s)),this},addAttachable(t,e,i){const s=t.ud&&t.ud();let r=i;r||(r=s?Xn.setAlignment(this.alignment):Vn);const n=this.addElement(r);if(s&&"setLUT"in n){n.setLUT(s.lut);const t=s.lut.getUnits(),e=s.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";n.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(n))),this.entries.push({entry:n,component:t}),t.attach(n,e),this},addChart(t,e,i){return t.xd().forEach((t=>this.addAttachable(t,e,i))),this},addDashboard(t,e,i){return t.getCells().filter((t=>t.panel instanceof yo)).forEach((t=>this.addChart(t.panel,e,i))),this},setTitle(t){return this.title.setText(t),this},getTitle(){return this.title.getText()},setTitleFillStyle(t){return this.title.setTextFillStyle(t),this},getTitleFillStyle(){return this.title.getTextFillStyle()},setTitleFont(t){return this.title.setTextFont(t),this},getTitleFont(){return this.title.getTextFont()},setTitleRotation(t){return this.title.setTextRotation(t),this},getTitleRotation(){return this.title.getTextRotation()},setEntries(t){return this.entries.forEach((e=>t(e.entry,e.component))),this}},Yn={alignment:"vertical",layoutBuilder:In,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Cn:In}},getAlignment(){return this.alignment},titleBuilder:zn,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},$n={...on,...hn,...Yn,background:xn,Lc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).Lc(t,e,i,s,r,!1);let h=Object.assign(o,jn,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.xe});h.entries=[];const a=h.addElement("horizontal"===this.alignment?In:Cn),l=a.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(r.legendTitleFillStyle).setTextFont(r.legendTitleFont);return a.addGap(),h=Object.assign(h,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),nn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Zn extends jr{constructor(t,i,s,r,n){super(t,i,s,r,n),this.bd=10,this.vd=e.UIDirections.Up,this.Md=0,this.Rc="major",this.nn=this.sc(t.ye(this.renderingScale)),this.Cu=this.sc(t.Bc(this.renderingScale))}fc(){return[this.nn]}gc(){if(super.gc(),this.xe)return this;const t=nt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.ti(t,{x:this.vd===e.UIDirections.Right?-this.bd:this.vd===e.UIDirections.Left?this.bd:0,y:this.vd===e.UIDirections.Up?-this.bd:this.vd===e.UIDirections.Down?this.bd:0}),s=this.renderingScale.ti(i,{x:this.vd===e.UIDirections.Right?-this.Md:this.vd===e.UIDirections.Left?this.Md:0,y:this.vd===e.UIDirections.Up?-this.Md:this.vd===e.UIDirections.Down?this.Md:0});return this.Cu.Sa(t).ha(i),this.nn.Cn(s).Ln(this.vd===e.UIDirections.Up?{x:0,y:1}:this.vd===e.UIDirections.Down?{x:0,y:-1}:this.vd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Zs(){const t=this.Cu.da(),i=t instanceof tt?t.getThickness():0;return this.size=this.vd===e.UIDirections.Left||this.vd===e.UIDirections.Right?{x:this.bd+this.Md+this.nn.Zs().Du().x,y:i}:{y:this.bd+this.Md+this.nn.Zs().Du().y,x:i},super.Zs()}dispose(){return super.dispose(),this.nn.dispose(),this.Cu.dispose(),this}setVisible(t){return super.setVisible(t),this.nn.setVisible(t),this.Cu.setVisible(t),this}setMouseInteractions(t){return this.nn.setMouseInteractions(t),this.Cu.setMouseInteractions(t),this}getMouseInteractions(){return this.nn.getMouseInteractions()}getText(){return this.nn.bs()}setTextFillStyle(t){return this.nn.As(t),this.Hr.Gi(),this}getTextFillStyle(){return this.nn._s()}setTextFont(t){return this.nn.ks(t),this}setTextRotation(t){return this.nn.Cs(t),this}getTextRotation(){return this.nn.Ts()}getTextFont(){return this.nn.ws()}setText(t){return this.nn.Ms(t),this.Hr.Gi(),this}setDirection(t){return this.vd=t,this.Hr.Gi(),this}getDirection(){return this.vd}setPointerLength(t){return this.bd=t,this.Hr.Gi(),this}getPointerLength(){return this.bd}setTickLabelPadding(t){return this.Md=t,this.Hr.Gi(),this}getTickLabelPadding(){return this.Md}setTickStyle(t){return this.Cu.ua(t),this.Hr.Gi(),this}getTickStyle(){return this.Cu.da()}}const qn={...on,Lc(t,e,i,s,r,n){const o=new Zn(t,e,i,s,r);return nn(o,r,n),this.applyStylers(o,r)}}.addStyler(sn),Kn=qn.addStyler(((t,e)=>(t.Rc="major",t.setPointerLength(e.xAxisNumericTicks.majorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.majorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.majorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.majorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.majorTickStyle.labelFillStyle)))),Jn=qn.addStyler(((t,e)=>(t.Rc="minor",t.setPointerLength(e.xAxisNumericTicks.minorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.minorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.minorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.minorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.minorTickStyle.labelFillStyle)))),Qn=Vn.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),to=$n.setAlignment("horizontal"),eo=$n.setAlignment("vertical"),io={TextBox:zn,CheckBox:Vn,ButtonBox:Qn,PointableTextBox:_n,AxisTickMajor:Kn,AxisTickMinor:Jn,LUTRange:Hn},so={HorizontalLegendBox:to,VerticalLegendBox:eo};class ro extends Hi{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this._d=r,this.Ad=n}}const no=(t,e,i)=>wt(t+.1*(e-t)+.5*i.getPixelSize()*Math.sign(e-t),t,e),oo=(t,e,i)=>{const s=i.ct(t),r=i.ct(e);return wt(i.ot(s+.1*(r-s)+.5*Math.sign(r-s)),t,e)};class ho extends Wi{constructor(t,i,s,n,o,h,a,l,c,d,f,g,p,m,y,x,S){var v;super(f,d,l,y,x,{numeric:d.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:d.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:d.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},S),this.wd=new Map,this.kd=void 0,this.Cd=0,this.Td=[],this.Id=[],this.zi=Ci.fitting,this.Fd=!0,this.Pd=0,this.Dd=8,this.Bd=void 0,this.Od=void 0,this.Ld=20,this.Rd=1,this.Ed=!0,this.zd=!0,this.Vd=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Hd=!0,this.Ud=!0,this.$d=!0,this.Yd=!0,this.Xd=this.ds.defaultDragMouseStyle,this.jd=this.ds.defaultDragMouseStyle,this.Zd=this.ds.defaultDragMouseStyle,this.Kd=this.ds.defaultDragMouseStyle,this.qd=this.ds.defaultDragMouseStyle,this.P=new r.Eventer,this.Jd=[],this.Qd=t=>{const e=this.Id.indexOf(t);e>=0&&this.Id.splice(e,1)},this.tf=t=>(this.Id.indexOf(t)<0&&this.Id.push(t),this.Qd),this.ou=(t,e)=>this.P.emit("axisAreaTouch",this,e),this.if=Jt(this.Jd),this.onAxisInteractionAreaMouseClick=t=>this.P.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.P.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.P.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.P.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.P.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.P.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.P.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.P.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.P.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.P.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.P.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.P.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.P.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.P.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.P.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.P.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.P.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.P.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.P.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.P.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.P.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.P.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.P.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.P.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.P.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.P.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.P.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.P.off(t,"axisAreaTouchEnd"),this.sf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().Vc()):t,this.ef=t=>{const e=this.Td.indexOf(t);-1!==e&&this.Td.splice(e,1)},this.hf=(t,e)=>{this.P.emit("axisAreaDoubleClick",this,e),this.Nd&&(this.setStopped(!1),Zt(e))},this.rf=t=>{this.P.emit("axisAreaMouseEnter",this),(this.zd||this.Ed||this.Vd||this.Nd)&&this.nf(t)},this.af=t=>{this.lf(t),this.P.emit("axisAreaMouseLeave",this)},this.cf=(t,e,i)=>{var s,r;this.P.emit("axisAreaMouseDragStart",this,e,i);const n=Pt(null===(s=this.chart.uf.Vh)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Pt(null===(r=this.chart.uf.Vh)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.zd?(this.df(t),Zt(e)):i===n&&this.Ed&&(this.ff(t,h),Zt(e))},this.gf=(t,e,i,s,r)=>{var n,o;this.P.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Pt(null===(n=this.chart.uf.Vh)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Pt(null===(o=this.chart.uf.Vh)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.zd?(this.pf(t,r),Zt(e)):i===h&&this.Ed&&(this.mf(t,s,l,r),Zt(e))},this.Sf=(t,e,i,s)=>{var r,n;this.P.emit("axisAreaMouseDragStop",this,e,i,s);const o=Pt(null===(r=this.chart.uf.Vh)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Pt(null===(n=this.chart.uf.Vh)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.zd?(this.yf(t),Zt(e)):i===o&&this.Ed&&(this.xf(t,s,a),Zt(e)),t.getIsUnderMouse()&&(this.zd||this.Ed||this.Vd||this.Nd)&&this.nf(t)},this.bf=(t,e)=>{if(this.P.emit("axisAreaMouseWheel",this,e),this.Vd){this.setStopped(!0);const t=this.ds.getWidth(this.vf.Wi.Re(e.clientX,e.clientY)),i=this.ut.ot(t);this.zoom(i,fe(e)),Zt(e)}},this.Mf=(t,e)=>this.P.emit("axisAreaMouseClick",this,e),this._f=(t,e)=>this.P.emit("axisAreaMouseDown",this,e),this.Af=(t,e)=>this.P.emit("axisAreaMouseUp",this,e),this.wf=(t,e)=>this.P.emit("axisAreaMouseMove",this,e),this.kf=(t,e,i)=>{this.P.emit("axisAreaTouchStart",this,i),this.Ed&&(this.nf(t),this.ff(t,e),Zt(i))},this.Cf=(t,e,i,s,r)=>{this.P.emit("axisAreaTouch",this,r),this.Ed&&(this.mf(t,e,i,s),Zt(r))},this.Tf=(t,e,i,s)=>{this.P.emit("axisAreaTouchEnd",this,s),this.Ed&&(this.xf(t,e,i),this.lf(t),Zt(s))},this.If=(t,e,i,s)=>{(this.zd||this.Vd)&&(this.nf(t),this.df(t),Zt(s))},this.Ff=(t,e,i,s,r,n)=>{if(this.zd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.pf(t,e),Zt(n)}if(this.Vd){const t=this.vf.Wi.Re(e.x,e.y),o=this.vf.Wi.Re(i.x,i.y),h=Math.abs(this.ds.getWidth(ti(t,s))-this.ds.getWidth(ti(o,r)))-Math.abs(this.ds.getWidth(t)-this.ds.getWidth(o)),a=this.ut.ti(this.ys,-h),l=this.ut.ti(this.xs,h);this.us(a,l),Zt(n)}},this.Pf=(t,e,i,s)=>{(this.zd||this.Vd)&&(this.yf(t),this.lf(t),Zt(s))},this.Df=(t,e)=>{(this.Gd||this.Wd)&&this.Bf(t)},this.Of=(t,e)=>{this.Lf(t)},this.Rf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gd&&this.Ef(t,s)},this.zf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.Vf(t,n,s,r)},this.Nf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.Gf(t,n,s,r)},this.Wf=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gd||this.Wd)&&this.Hf(t,r,s),(this.Gd||this.Wd)&&this.Bf(t)},this.Uf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.ys,fe(e)),Zt(e))},this.$f=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.xs,fe(e)),Zt(e))},this.Yf=(t,e,i)=>{this.Gd&&(this.Bf(t),this.Ef(t,e),Zt(i))},this.Xf=(t,e,i,s,r)=>{this.Gd&&(this.Vf(t,e,i,s),Zt(r))},this.jf=(t,e,i,s,r)=>{this.Gd&&(this.Gf(t,e,i,s),Zt(r))},this.Zf=(t,e,i,s)=>{this.Gd&&(this.Hf(t,e,i),this.Lf(t),Zt(s))},this._d=t,this.Kf=i,this.vf=s,this.qf=o,this.Jf=h,this.chart=f,this.Qf=p,this.tg=n,this.uu=a,m(this,this.tf),l.ig=this,this.sg=g,this.eg=this.sg>50?1:-1,this.hg=(v=this.ds.toPoint(0,-this.eg),Math.abs(v.x)>=Math.abs(v.y)?v.x>=0?e.UIDirections.Right:e.UIDirections.Left:v.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.rg=c,this.ng=this.ut instanceof wi?(new Ti).yi(this.ds.toVec2(this.ut,this.rg)):(new Ii).yi(this.ds.toVec2(this.ut,this.rg)),this.og=this.chart.pixelScale,this.ag=(new Ti).yi(this.ds.toVec2(this.ds.getWidth(this.og),this.rg)),this.lg=this.vf.Bc(this.ng).setMouseInteractions(!1),this.cg=this.vf.Bc(this.ng).setMouseInteractions(!1),this.ug=this.vf.Bc(this.ng).setMouseInteractions(!1),this.dg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).ir(J).Nr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.gg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).ir(d.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.pg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).ir(J).Nr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.mg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).ir(J).Nr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.vs=this.tg.ye(this.ng).setMouseInteractions(!1).Cs(this.ds.getTitleTextRotation(this.eg)),this.chart.Wi.Zh.ke(this.dg,(t=>this.dg.zr(t)),{animationEnabled:this.Hi}),this.chart.Wi.Zh.ke(this.pg,(t=>this.pg.zr(t)),{animationEnabled:this.Hi}),this.chart.Wi.Zh.ke(this.mg,(t=>this.mg.zr(t)),{animationEnabled:this.Hi});const b=_r(new Gr(this.kf,this.Cf,this.Tf,1),new Vr(this.If,this.Ff,this.Pf),new Lr(this.hf)),M=_r(new Gr(this.Yf,this.Xf,this.Zf)),A=_r(new Gr(this.Yf,this.jf,this.Zf));this.dg.setMouseEnterEventHandler(this.rf).setMouseLeaveEventHandler(this.af).setMouseDragStartEventHandler(this.cf).setMouseDragEventHandler(this.gf).setMouseDragStopEventHandler(this.Sf).setMouseWheelEventHandler(this.bf).setMouseDoubleClickEventHandler(this.hf).setMouseClickEventHandler(this.Mf).setMouseDownEventHandler(this._f).setMouseUpEventHandler(this.Af).setMouseMoveEventHandler(this.wf).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.pg.setMouseEnterEventHandler(this.Df).setMouseLeaveEventHandler(this.Of).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.zf).setMouseDragStopEventHandler(this.Wf).setMouseWheelEventHandler(this.Uf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.mg.setMouseEnterEventHandler(this.Df).setMouseLeaveEventHandler(this.Of).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Nf).setMouseDragStopEventHandler(this.Wf).setMouseWheelEventHandler(this.$f).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),this.lg.ua(d.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.cg.ua(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.ug.ua(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.vs.As(d.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).ks(d.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.cc=a.uc(this,{}),this.Fs=this.cc.Sg([this.vs]).Is(y.effectsText)}me(){return this.Xi}Se(){return void 0!==this.zs}addBand(t=!0){const e=t?this.Jf:this.qf,i=new tn(e,this.chart,this.if,this,this.ng,this.ds,this.fs,this.uu);return this.Jd.push(i),i}addConstantLine(t=!0){const e=t?this.Jf:this.qf,i=new en(e,this.chart,this.if,this,this.ng,this.ds,this.fs,this.uu);return this.Jd.push(i),i}yg(t){this.Jd.forEach(t)}xg(t){return this.Jd.map(t)}getHighlighters(){return this.Jd}setThickness(t){return"number"==typeof t?(this.bg=t,this.vg=t):"object"==typeof t&&(this.bg=t.min,this.vg=t.max),this._d.Gi(),this}getThickness(){return{min:this.bg,max:this.vg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}ne(){return this.Id}Qs(t,e){return new ro(e,t,this.vf,this.ng,this._d,this.ng)}Ds(){if(this.wd){for(const t of this.wd)t[1].grid.dispose(),t[1].tick.dispose();this.wd.clear()}super.Ds()}te(t,e){const{tickStart:i}=e,s=t.ns.qs,r=i+s.getTickLength()*this.eg+s.getTickPadding()*this.eg;t.Pi.Cn(this.ds.toPoint(t.u,r)).Ln(this.ds.toPoint(s.getLabelAlignment(),-this.eg)).Cs(s.labelRotation).setVisible(this.getVisible())}Mg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.ns.qs,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.eg;return{gridStroke:{start:this.ds.toPoint(t.u,r),end:this.ds.toPoint(t.u,h)},tickStroke:{start:this.ds.toPoint(t.u,n),end:this.ds.toPoint(t.u,a)}}}_g(t,e,i,s){return this._d.Bc(this.ng).ua(new tt({fillStyle:new L({color:w(360*(1-s))}),thickness:5})).Sa(this.ds.toVec2(t,0)).ha(this.ds.toVec2(t,this.eg*(50*s)))}fe(t,e){return"linear"===this.ps.type?no(t,e,this.ut):oo(t,e,this.ut)}Ag(t,e){return e instanceof wi?no:oo}pe(t,e,i){if("linear"===this.ps.type){const s=this.ut.Si(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ut;return{min:s.ti(t,-i),max:s.ti(e,i)}}gc(t,e,i){const s=this.lg.da(),r=this.ut.getInnerStart()this.ut.getInnerStart()?this.ut.getInnerEnd():this.ut.getInnerStart(),o=this.ut.Ht(),h=this.rg.getInnerInterval(),a=s instanceof tt?s.getThickness()*this.eg/2:0,l=this.sg/100*h,u=l+t,c=u+a,d=h*this.eg,f=c+a,g=this.Td.reduce(this.sf,0);let p,m=0;if(this.Ui||this.Ds(),this.Oi!==Ri&&this.Ui){const t=this.ut.Ht();this.Gs({physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});for(const[e,i]of this.Ri){let s=this.wd.get(e);if(!s)if(e.Ci)s={grid:this._d.wg(this.ng).setMouseInteractions(!1),tick:this._d.wg(this.ng).setMouseInteractions(!1)};else if("kg"in e){const t=Array.from(this.Ri.keys()).filter((t=>"kg"in t)).reverse().indexOf(e),i=this.Kf[t];if(!i)throw new Error("Not enough tick layers. This is an internal LCJS error - if you see this, please contact Arction support.");s={grid:i.wg(this.ng).setMouseInteractions(!1),tick:i.wg(this.ng).setMouseInteractions(!1)}}if(s){s.grid.no(),s.tick.no();for(const[e,r]of i){const e=this.Mg(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});s.grid.xt(e.gridStroke.start,e.gridStroke.end),s.tick.xt(e.tickStroke.start,e.tickStroke.end)}s.grid.ua(e.qs.getGridStrokeStyle()),s.tick.ua(e.qs.getTickStyle()),this.wd.set(e,s)}}for(const t of this.Ri.values()){let e=we;for(const i of t.values()){const t=i.ns.qs,s=this.ds.getHeight(i.Pi.$t()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}m=Math.max(m,e)}p=f+Math.max(m,g)*this.eg}else m=0,p=f+g*this.eg;this.lg.Sa(this.ds.toPoint(r,c)).ha(this.ds.toPoint(n,c)),this.cg.Sa(this.ds.toPoint(this.ut.ti(this.ut.getInnerStart(),this.Dd),c)).ha(this.ds.toPoint(this.ut.getInnerStart(),c)),this.ug.Sa(this.ds.toPoint(this.ut.ti(this.ut.getInnerEnd(),-this.Dd),c)).ha(this.ds.toPoint(this.ut.getInnerEnd(),c));const y=this.vs&&this.vs.bs().length>0?this.ds.getHeight(this.vs.Zs().$t()):0,x=p+.5*y*this.eg;this.vs.Cn(this.ds.toPoint(this.ut.ti(this.ut.getInnerStart(),o/2),x));const S=f,v=S+this.eg*this.Cd,b=this.Gd||this.Wd?Math.min(this.Ld,.25*o):0,M={start:this.ds.toVec2(this.ut.ti(this.ut.getInnerStart(),b),S),end:this.ds.toVec2(this.ut.ti(this.ut.getInnerEnd(),-b),v)};if(this.kd){const e=this.sg/100*h+t,i=-this.eg*h-t,s={start:this.ds.toVec2(this.kd.min,f+this.eg*this.Cd),end:this.ds.toVec2(this.kd.max,e+i)},r=nt(s.start,this.ng,this.og),n=nt(s.end,this.ng,this.og);this.gg.Cn(r).q(ti(n,r)).setVisible(!0)}else this.gg.setVisible(!1);const A=nt(this.ds.toVec2(this.ut.getInnerStart(),v),this.ng,this.og),k=nt(M.start,this.ng,this.og),w=nt(M.end,this.ng,this.og),D=nt(this.ds.toVec2(this.ut.getInnerEnd(),S),this.ng,this.og);this.dg.Cn(k).q(ti(w,k)),this.pg.Cn(A).q(ti(k,A)),this.mg.Cn(w).q(ti(D,w));for(const e of this.Td)e.update().plot(u,d,t,f);for(const t of this.Jd)t.gc();const E=(s instanceof tt?s.getThickness():0)+Math.max(m,g)+(this.vs&&this.vs.bs().length>0?y+this.Pd:0);return this.Cd=wt(E,void 0!==this.bg?this.bg:0,void 0!==this.vg?this.vg:ke),this}Cg(t){const e=this.lg.da(),i=e instanceof tt?e.getThickness()*this.eg/2:0,s=this.rg.getInnerInterval(),r=this.sg/100*s+t,n=r+i,o=s*this.eg,h=n+i;for(const e of this.Td)e.update().plot(r,o,t,h);for(const t of this.Jd)t.gc()}Tg(){return this.Cd}Ig(t,e){e=e||io.AxisTickMajor;const i=new qr(this,t?this._d:this.tg,this.tg,this.ut,this.ag,this.ag,this.ds,this.hg,this.ef,this.fs,e).setTextFormatter(this.formatValue);return this.Td.push(i),i}nf(t){this.chart.Wi.Zh.Ie(t,1),this.Bd=t.Wi.Oe(this.Xd,this.Bd)}lf(t){this.chart.Wi.Zh.Ie(t,0),t.Wi.Le(this.Bd)}df(t){this.setStopped(!0),t.Wi.Le(this.Bd)}pf(t,e){const i=-this.ds.getWidth(e);this.pan(i),this.Bd=t.Wi.Oe(this.jd,this.Bd)}pan(t){const e=this.ys,i=this.xs,s=this.ut.ti(e,t),r=this.ut.ti(i,t);this.us(s,r,{allowClamping:!1})}zoom(t,e){const i=this.ut.ct(this.ys),s=this.ut.ct(this.xs),r=this.ut.ct(t),n=wt((r-i)/(s-i),0,1),o=.2*this.ut.Ht(),h=n*this.Rd*o*-e,a=(1-n)*this.Rd*o*e,l=this.ut.ti(this.ys,h),u=this.ut.ti(this.xs,a);this.us(l,u)}yf(t){this.kd=void 0,t.Wi.Le(this.Bd)}ff(t,e){this.setStopped(!0),t.Wi.Le(this.Bd),this.chart.Wi.Zh.Ie(this.dg,0)}mf(t,e,i,s){const r=nt(this.vf.Wi.Re(i.x,i.y),this.vf.Wi.ut,this.ng),n=wt(this.ds.getWidth(r),this.ys,this.xs),o=this.ds.getWidth(nt(this.vf.Wi.Re(e.x,e.y),this.vf.Wi.ut,this.ng)),h=Re(this.ds.getHeight(r),this.ds.getHeight(nt(this.dg.Tn(),this.og,this.ng)),this.ds.getHeight(nt(Qe(this.dg.Tn(),this.dg.$t()),this.og,this.ng)));Math.abs(this.ut.ct(n)-this.ut.ct(o))>10&&h?(this.kd=p(Math.min(n,o),Math.max(n,o)),this.Bd=t.Wi.Oe(this.Zd,this.Bd)):(this.kd=void 0,this.Bd=t.Wi.Oe(this.Xd,this.Bd)),this.vf.Gi()}xf(t,e,i){if(this.kd){const t=this.kd.min,e=this.kd.max,i=this.xs{e.Js(t)}));for(const e of this.wd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this._d.Gi(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.Hi),this}}const ao=(t,e)=>t instanceof mi||e instanceof mi?(new Ii).yi(t,e):(new Ti).yi(t,e),lo=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const r=t.captureFrame(i,s);if("image/png"!==i&&r.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(mt.navigator.msSaveBlob)mt.navigator.msSaveBlob(r,e);else{const t=mt.document.createElement("a");mt.document.body.appendChild(t);const i=mt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{mt.URL.revokeObjectURL(i),mt.document.body.removeChild(t)}),0)}},uo=(t,i,s,r,n,o)=>{const h=t.Lc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},co=t=>{if(t instanceof Ei)return t;const e=t.x instanceof ho?t.x.ut:t.x.x,i=t.y instanceof ho?t.y.ut:t.y.y;return ao(e,i)};class fo{constructor(t,e,i,s,n,o,h,a){this.Fg=[],this.Pg=[],this.P=new r.Eventer,this.Dg=void 0,this.Bg=void 0,this.Og=void 0,this.Pt=x(0,0,0,0),this.xe=!1,this.Lg=()=>{this.Rg=!0,this.Eg.Gi()},this.zg=t=>e=>{const i=this.Fg.indexOf(e);-1!==i&&this.Fg.splice(i,1),this.Wi.Gi(),t.G()},this.Vg=t=>{const e=this.Pg.indexOf(t);-1!==e&&this.Pg.splice(e,1),this.Wi.Gi()},this.Rg=!0,this.onResize=t=>this.P.on("resize",t),this.offResize=t=>this.P.off(t,"resize"),this.uf=t,this.Ng=i,this.Eg=s,this.removePanel=n,this.fs=e.Wi.fs;const l=e.Wi.$t();this.uiScale=i.d2({scaleXYConstructor:Ti}).vi(0,100).Mi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:Ti}).vi(0,this.uiScale.x.getCellSize()).Mi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.Wi.Gg,this.Wi=e.Wi.Wg,this.cc=this.Wi.cc.uc(this,{}),this.Hg=()=>e.Ug("unidentified ui"),this.$g=e.Yg(),this.Xg=this.Eg._u(this.uiScale).Cn(u(0,0)).q(u(100,100)).As(o).ir(h).setMouseMoveEventHandler(((t,e)=>this.P.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.P.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.P.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.P.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.P.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.P.emit("touchEndPanelBackground",this,e)));const c=e.Wi._r(this.Lg);if(this.jg=e.Wi.Ar.bind(e.Wi,c),a){const t=a.on(this.Lg);this.Zg=()=>a.off(t)}this.Dg=n}getTheme(){return this.fs}setBackgroundFillStyle(t){return this.Xg.As(t),this.Eg.Gi(),this}getBackgroundFillStyle(){return this.Xg._s()}setBackgroundStrokeStyle(t){return this.Xg.ir(t),this.Eg.Gi(),this}getBackgroundStrokeStyle(){return this.Xg.sr()}Kg(t){return this.Fg.push(t),this.Wi.Gi(),t}qg(t){return this.Pg.push(t),this.Wi.Gi(),t}addUIElement(t=zn,e=this.uiScale){e=co(e);const i=this.Hg();return this.Kg(uo(t,i,this.uiScale,e,this.zg(i),this.fs))}addLegendBox(t=$n,i=this.uiScale){i=co(i);const s=this.qg(uo(t,this.$g,this.uiScale,i,this.Vg,this.fs));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Dr.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Dr.CenterBottom).setPosition(this.uiScale.ti({x:50,y:0},{x:0,y:3}))),s}dispose(){return this.xe||(this.xe=!0,this.jg&&this.jg(),this.Zg&&this.Zg(),go(this.uiScale),go(this.pixelScale),this.Bg&&this.Bg(),this.Eg.G(),this.$g.G(),this.Fg.slice().forEach((t=>{t.dispose()})),this.Pg.slice().forEach((t=>{t.dispose()})),this.Wi.Gi(),this.Dg&&this.Dg(this),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return lo(this.engine,t,e,i),this}Rn(t){this.Pt=t,this.Lg()}X(){return this.pixelScale.X(),this.uiScale.X(),this}j(){return this.pixelScale.j(),this.uiScale.j(),this}gc(){if(this.Rg){const t=this.Eg.Wi.$t(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Pt.left,this.Pt.right],r=[this.Pt.bottom,this.Pt.top];this.uiScale.xi(s),this.uiScale.bi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.vi(0,n.x).xi(s).Mi(0,n.y).bi(r),this.P.emit("resize",this,n.x,n.y,e,i)}this.Rg=!1}Jg(){for(let t=0;t{t.Vt&&t.Vt()};class po extends fo{constructor(t,e,i,s,r,n){super(t,e,i,e.tp("uipanel bg",0),s,e.Wi.fs.uiPanelBackgroundFillStyle,e.Wi.fs.uiPanelBackgroundStrokeStyle,n),this.Qg(r,this.pixelScale)}setMinimumSize(t){return this.Yu=t,this.Wi.Gi(),this}getMinimumSize(){return this.Yu}gc(){super.gc(),super.Jg()}}const mo=x(10,10,10,10);class yo extends fo{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.ip={},this.pn=mo,this.Hi=!0,this.sp=e.ep("chart internal ui",0),this.hp=this.sp.ye(this.uiScale).Ms("Chart").Cn(u(50,100)).Ln(u(0,1)).ks(h).As(a).setMouseInteractions(!1),this.rp=this.cc.Sg([this.hp]).Is(this.fs.effectsText)}setAnimationsEnabled(t){return this.Hi=t,this}getAnimationsEnabled(){return this.Hi}setTitle(t){return this.hp.Ms(t),this.Wi.Gi(),this}getTitle(){return this.hp.bs()}getTitleSize(){return this.hp.Zs().Du()}setTitleFillStyle(t){return this.hp.As(t),this.Lg(),this}getTitleFillStyle(){return this.hp._s()}setTitleFont(t){return this.hp.ks(t),this.Lg(),this}getTitleFont(){return this.hp.ws()}setTitleRotation(t){return this.hp.Cs(t),this.Wi.Gi(),this}getTitleRotation(){return this.hp.Ts()}setTitleEffect(t){return this.rp.Is(t),this.Wi.Gi(),this}getTitleEffect(){return this.rp.Ps()}setTitleMargin(t){var e,i;return this.ip="object"==typeof t?this.ip?(e=this.ip,{left:void 0!==(i=t).left?i.left:e.left,top:void 0!==i.top?i.top:e.top,right:void 0!==i.right?i.right:e.right,bottom:void 0!==i.bottom?i.bottom:e.bottom}):t:{left:t,top:t,right:t,bottom:t},this.Lg(),this}getTitleMargin(){return this.ip}setPadding(t){return this.pn="object"==typeof t?v(this.pn,t):{left:t,top:t,right:t,bottom:t},this.Lg(),this}getPadding(){return this.pn}np(t){const e=t.op(),i=null==e?void 0:e.height,s=null==e?void 0:e.width;if(void 0!==i&&void 0!==s)return{x:i/2,y:s/2}}dispose(){return super.dispose(),this.sp.G(),this}}const xo={ap:(t,e)=>t._s()!==B&&0!==t.bs().length&&t.getVisible()?t.Zs().Du().y+(void 0!==e.top?e.top:10)+(void 0!==e.bottom?e.bottom:0):0,lp(t,e){t.Cn(u(50,100)).Rn({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var So;e.SliceLabelIndices=void 0,(So=e.SliceLabelIndices||(e.SliceLabelIndices={}))[So.LabelsInsideSlices=0]="LabelsInsideSlices",So[So.LabelsOnSides=1]="LabelsOnSides";const vo={SortByName:(t,e)=>t.getName().localeCompare(e.getName(),void 0,{numeric:!0}),SortByValueAscending:(t,e)=>t.getAnimatedValue()-e.getAnimatedValue(),SortByValueDescending:(t,e)=>e.getAnimatedValue()-t.getAnimatedValue(),None:()=>0},bo={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Mo extends Jr{constructor(){super(...arguments),this.Su="Slice",this.u=0}}const Ao=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class ko extends Mo{}class wo extends ko{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.cp=!1,this.up=B,this.dp=B,this.fp=this.u,this.gp=this.cp?1:0,this.pp=this.getVisible(),this.mp=U((()=>this.rl.Wi.Gi())),this.Sp=U((()=>this.rl.Wi.Gi())),this.yp=()=>{this.xp=void 0},this.bp=()=>{this.vp=void 0},this.index=t,this.rl=s,this.scale=r,this.cu=n,this.Mp=e.Ou(r).zr(this.getHighlight()),this.gu(this.Mp),this.Pi=i.ye(r).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0}),this.onMouseClick(Ao),this.onTouchEnd(Ao)}setValue(t){return this.rl.getAnimationsEnabled()?this.pp&&this._p(this.fp,t):this.fp=t,this.u=t,this.rl.Wi.Gi(),this}getValue(){return this.u}setExploded(t){if(t&&!1===this.rl.getMultipleSliceExplosion()){const t=this.rl.getSlices();for(let e=0;e{this.gp=t,this.rl.Wi.Gi()})),this.vp.onEveryAnimationEnd(this.bp),this.cp=!this.cp):!1!==this.rl.getMultipleSliceExplosion()||t?(this.gp=this.cp?0:1,this.cp=!this.cp):(this.gp=0,this.cp=!this.cp),this.rl.Wi.Gi(),this}getExploded(){return this.cp}setVisible(t){return this.pp=t,!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?(this.xp&&(this.xp.finish(!1),this.xp=void 0),this._p(this.fp,0,(()=>super.setVisible(!1)))):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(this.xp&&(this.xp.finish(!1),this.xp=void 0),super.setVisible(!0),this._p(this.fp,this.u)):(this.fp=this.u,super.setVisible(!0)),this}_p(t,e,i){this.xp=this.mp(300,W.ease)([[t,e]],(([t])=>{this.fp=t,this.rl.Wi.Gi()})),this.xp.onEveryAnimationEnd(this.yp),i&&this.xp.onAnimationEnd(i)}setStyle(t,e,i,s){this.up=t,this.dp=i,this.Mp.As(this.up).ir(e),this.Pi.As(this.dp).ks(s);for(let t=0;tQe(e,Je(ui(.5*(t.qo()+t.ui())*Math.PI/180),i)),Eo=(t,e,i,s,r,n)=>{const o=t.length;let h=90;for(let a=0;a{const e=t.getSlices();for(let t=0;t{const e=this.Ap.indexOf(t);e>=0&&(this.Ap.splice(e,1),this.Ep())},this.uf.Oh||this.uf.Bh||this.Wi.Ph(7),this.zp=e.Vp("pieChart bottom",0),this.Np=e.Vp("pieChart top",1),this.hp.Ms("Pie Chart"),this.Qg(r,this.pixelScale),this.onBackgroundMouseDoubleClick(To);const h=_r(new Lr(To));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new wo(this.Pp,this.zp,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);this.Pp+=1,i.setName(t);const s=this.Hi;return this.Hi=!1,i.setValue(e),this.Hi=s,i.setEffect(this.Op),this.Gp(i),this.Ap.push(i),this.Ep(),i.setHighlightOnHover(this.Tp),i}addSlices(t){const e=[];for(let i=0;ie.cc.fu.Is(t))),this.Wi.Gi(),this}getSliceEffect(){return this.Op}setSliceSorter(t){return this.wp=t,this.Ap=this.Ap.sort(this.wp),this.Wi.Gi(),this}getSliceSorter(){return this.wp}setLabelFillStyle(t){this.Fp="function"==typeof t?t(this.Fp):t;for(let t=0;te.cc.du.Is(t))),this.Wi.Gi(),this}getLabelEffect(){return this.Lp}setLabelFormatter(t){return this.Wp=t,this.Wi.Gi(),this}getLabelFormatter(){return this.Wp}setSliceHighlightOnHover(t){return this.Tp=t,this.Ap.forEach((e=>e.setHighlightOnHover(t))),this}gc(){super.gc(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.ap(this.hp,this.ip),e=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+t)),i=u(this.pn.left+e.x/2,this.pn.bottom+e.y/2);if(this.ld){const t=this.ld;this.Ap.forEach((e=>{this.Gp(e,new L({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Ap[t].Mp.setVisible(e),this.Ap[t].Pi.setVisible(e)}this.Ap=this.Ap.sort(this.wp);const s=this.Ap.filter((t=>t.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),this}}const Co={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Po=(...t)=>{const e=[];return t.forEach((t=>{var i;t&&"object"==typeof(i=t)&&i&&"pattern"in i&&e.push({type:"DataPattern",args:t})})),e};var Oo;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(Oo||(Oo={}));const Fo=(t,e,i,s,r,n,o,h,a)=>{if(0===t.length)return;const l=s.x+e*r.x*.5,c=1===i?Math.max:Math.min;let d;for(let r=0;r{const o=r*t.getAnimatedExplosion(),h=t.Mp,a=t.Pi,l=Do(h,i,s+n+o),c=oi(a.Tn().y,l,i);return[l,c,u(a.Tn().x-e*(n+a.$t().x),c.y)]},Bo=(...t)=>e=>{const i=(t=>{let e=.5*(t.Mp.qo()+t.Mp.ui());for(e%=360;e<0;)e+=360;return e<=90?Oo.TopRight:e<180?Oo.TopLeft:e<270?Oo.BottomLeft:Oo.BottomRight})(e);return t.includes(i)},zo=Bo(Oo.BottomLeft,Oo.TopLeft),_o=Bo(Oo.BottomRight,Oo.TopRight),Lo=Bo(Oo.TopLeft,Oo.TopRight),Go=Bo(Oo.BottomLeft,Oo.BottomRight);class Vo extends Io{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Wp=bo.NamePlusValue,this.$p=5,this.Yp=5,this.Xp=[],this.jp=this.fs.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.jp=t;for(let t=0;tt.getXMin(),le:t=>t.getXMax(),ue:t=>t.Jp().x,Qp:t=>t.x,tm:(t,e)=>({x:t.x,y:e.y,z:e.z}),vd:f(0,-1,0),im:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(0,e.y,e.z),gridlinePositionB:f(0,e.y,-e.z),gridlinePositionC:f(0,-e.y,-e.z)}}},Uo={ae:t=>t.getYMin(),le:t=>t.getYMax(),ue:t=>t.Jp().y,Qp:t=>t.y,tm:(t,e)=>({x:e.x,y:t.y,z:e.z}),vd:f(-1,0,0),im:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(e.x,0,e.z),gridlinePositionB:f(e.x,0,-e.z),gridlinePositionC:f(-e.x,0,-e.z)}}},Xo={ae:t=>t.getZMin(),le:t=>t.getZMax(),ue:t=>t.Jp().z,Qp:t=>t.z,tm:(t,e)=>({x:e.x,y:e.y,z:t.z}),vd:f(1,0,0),im:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(e.x,-e.y,0),gridlinePositionB:f(e.x,e.y,0),gridlinePositionC:f(-e.x,e.y,0)}}},jo=t=>{if(t instanceof tt){const e=t.getThickness(),i=t.getFillStyle();if(i instanceof L)return 1===e?Zi:new Ki({size:e,fillStyle:i,shape:"sphere"})}return Zi};class Yo{constructor(t,e,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.u=0,this.Ui=!0,this.xe=!1,this.Gi=t,this.sm=e,this.hm=i,this.rm=s,this.nm=n,this.om=o,this.sd=h,this.am=a,this.lm=l,this.Ec=u}setValue(t){return t===this.u||(this.u=t,this.Gi(),this.P.emit("valueChange",this.u)),this}getValue(){return this.u}setTickStyle(t){return this.hm="function"==typeof t?t(this.hm):t,this.Gi(),this}getTickStyle(){return this.hm}setTickLength(t){return this.rm=t,this.Gi(),this}getTickLength(){return this.rm}setGridStrokeStyle(t){return this.nm="function"==typeof t?t(this.nm):t,this.Gi(),this}getGridStrokeStyle(){return this.nm}setTextPadding(t){return this.om=t,this.Gi(),this}getTextPadding(){return this.om}setTextRotation(t){return this.sd=t,this.Gi(),this}getTextRotation(){return this.sd}setTextFillStyle(t){return this.am="function"==typeof t?t(this.am):t,this.Gi(),this}getTextFillStyle(){return this.am}setTextFont(t){return this.lm="function"==typeof t?t(this.lm):t,this.Gi(),this}getTextFont(){return this.lm}setTextFormatter(t){return this.Ec=t,this.Gi(),this}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}dispose(){return this.xe||(this.xe=!0,this.sm(),this.Gi(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Ui!==t;return this.Ui=t,e&&(this.P.emit("visibleStateChanged",this,this.Ui),this.Gi()),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}class $o{constructor(t,e){this.um=[],this.dm=t,this.fm=e}gm(){const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];t.forEach((t=>{const i=e.find((e=>((t,e)=>{const i=Object.keys(t);for(const s of i)if(t[s]!==e[s])return!1;return!0})(e.sharedProperties,t.instanceSharedProperties)));i?i.instances.push(t.instanceUniqueProperties):e.push({sharedProperties:t.instanceSharedProperties,instances:[t.instanceUniqueProperties]})}));const i=this.um.slice();e.forEach((t=>{let e=i.pop();e||(e=this.dm(),this.um.push(e)),this.fm(e,t.instances,t.sharedProperties)})),i.forEach((t=>{t.dispose();const e=this.um.indexOf(t);e<0?ge(0,(()=>{})):this.um.splice(e,1)}))}}}pm(){this.um.forEach((t=>{t.dispose()})),this.um.length=0}}class Zo{constructor(t){this.Sm=[],this.ym=t}gm(){return this.xm(),{add:()=>this.bm(),finishPlot:()=>{this.vm()}}}bm(){let t=this.Sm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.ym()},this.Sm.push(t)),t.isFree=!1,t.shape}xm(){this.Sm.forEach((t=>{t.isFree=!0}))}vm(){this.Sm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Sm.splice(this.Sm.indexOf(t),1)}))}pm(){this.Sm.forEach((t=>t.shape.dispose())),this.Sm.length=0}}class qo extends Wi{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Qp({x:t.Wi.fs.xAxis3DNumericTicks,y:t.Wi.fs.yAxis3DNumericTicks,z:t.Wi.fs.zAxis3DNumericTicks}),datetime:e.Qp({x:t.Wi.fs.xAxis3DDateTimeTicks,y:t.Wi.fs.yAxis3DDateTimeTicks,z:t.Wi.fs.zAxis3DDateTimeTicks}),time:e.Qp({x:t.Wi.fs.xAxis3DTimeTicks,y:t.Wi.fs.yAxis3DTimeTicks,z:t.Wi.fs.zAxis3DTimeTicks})},{type:"linear"}),this.Td=[],this.Mm=()=>{},this._m=()=>{},this.Am=()=>{},this.wm=()=>{},this.km=r,this.Cm=n,this.Tm=o,this.Im=this.km.ut;const l=this.ds.Qp({x:this.fs.xAxis3DStrokeStyle,y:this.fs.yAxis3DStrokeStyle,z:this.fs.zAxis3DStrokeStyle});this.Fm=this.km.Kp([Co.InternalUI]).ua(l).Pm(jo(l)).setMouseInteractions(!1),this.vs=this.Cm.ye(this.Tm).setMouseInteractions(!1).As(e.Qp({x:t.Wi.fs.xAxis3DTitleFillStyle,y:t.Wi.fs.yAxis3DTitleFillStyle,z:t.Wi.fs.zAxis3DTitleFillStyle})).ks(e.Qp({x:t.Wi.fs.xAxis3DTitleFont,y:t.Wi.fs.yAxis3DTitleFont,z:t.Wi.fs.zAxis3DTitleFont})),this.Dm=new Zo((()=>this.Cm.ye(this.Tm))),this.Bm=new $o((()=>this.km.wg().setMouseInteractions(!1)),((t,e,i)=>{t.no().ua(i.lineStyle),e.forEach((({positions:e})=>t.xt(e)))})),this.cc=a,this.Fs=this.cc.Sg([this.vs]).Is(s.effectsText),this.Fm.setMouseEnterEventHandler(this.Mm).setMouseLeaveEventHandler(this._m).setMouseDragEventHandler(this.Am).setMouseDragStopEventHandler(this.wm),i.ig=this}addCustomTick(){const t=new Yo((()=>this.chart.Wi.Gi()),(()=>{const e=this.Td.indexOf(t);e>=0&&this.Td.splice(e,1)}),this.fs.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.fs.xAxis3DNumericTicks.majorTickStyle.tickLength,this.fs.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.fs.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.fs.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.fs.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.fs.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Td.push(t),this.chart.Wi.Gi(),t}setStrokeStyle(t){return this.Fm.ua(t).Pm(jo(this.Fm.da())),this.chart.Wi.Gi(),this}getStrokeStyle(){return this.Fm.da()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Fm.setVisible(t),!1===t&&(this.Bm.pm(),this.Dm.pm()),this.Cm.Gi(),this}ne(){return this.chart.getSeries()}Om(t){return Math.abs(this.ut.J(t)*this.km.Lm(1))}pe(t,e,i){const s=Math.abs(this.ut.J(e-t)*this.km.Lm(1));return{min:t-i*s,max:e+i*s}}Qs(t,e){return new Ko(e,t,this.Cm,this.Tm,this.km)}te(t,e){const i=this.Rm(e,t.u,t.ns.qs.tickLength,t.ns.qs.tickPadding);return t.Pi.Cn(i.labelPosition).Ln(i.labelAlignment),i}Rm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ut.getInnerStart())/(this.ut.getInnerEnd()-this.ut.getInnerStart()),c=Ae.addVec(Ge(n,o,l),Ae.multiplyVec(Ae.multiply(h,this.km.Lm(.5*this.Fm.da().getThickness())),r)),d=Ae.addVec(c,Ae.multiplyVec(Ae.multiply(h,this.km.Lm(i)),r)),f=this.km.Em(d)||u(0,0);return{labelPosition:Qe(nt(f,this.chart.engine.scale,this.Tm),Je(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}_g(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ut.getInnerStart())/(this.ut.getInnerEnd()-this.ut.getInnerStart()),a=Ae.addVec(Ge(r,n,h),Ae.multiplyVec(Ae.multiply(o,this.km.Lm(.5*this.Fm.da().getThickness())),s)),l=Ae.addVec(a,Ae.multiplyVec(Ae.multiply(o,this.km.Lm(10)),s)),c=this.km.Em(a)||u(0,0),d=this.km.Em(l)||u(0,0);return this.Cm.Bc(this.Tm).Sa(c).ha(d).ua(new tt({fillStyle:new L({color:w(120*i)}),thickness:1}))}fe(t,e){return Jo(t,e,this.ut)}gc(t){if(!this.Ui)return;const e=Math.min(this.ys,this.xs),i=Math.max(this.ys,this.xs),s=this.Im,r=f(s.x.st(),s.y.st(),s.z.st());let n,o;this.ds===Xo?(n=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.ds.tm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.ds.vd,a=this.km.Em(n)||u(0,0),l=this.km.Em(o)||u(0,0),c=Ge(n,o,.5),d=Ae.addVec(c,Ae.multiplyVec(Ae.multiply(h,-1),r)),g=this.km.Em(c)||u(0,0),p=this.km.Em(d)||u(0,0),m=Ze(ti(nt(g,this.chart.engine.scale,this.Tm),nt(p,this.chart.engine.scale,this.Tm)));this.Fm.no().xt([n,o]);const{gridlinePositionA:y,gridlinePositionB:x,gridlinePositionC:S}=this.ds.im(t),v=t=>({x:-1===t.x?this.Im.x.getInnerStart():1===t.x?this.Im.x.getInnerEnd():0,y:-1===t.y?this.Im.y.getInnerStart():1===t.y?this.Im.y.getInnerEnd():0,z:-1===t.z?this.Im.z.getInnerStart():1===t.z?this.Im.z.getInnerEnd():0}),b=v(y),M=v(x),A=v(S),k={physicalAxisSize:Ke(ti(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:b,gridlinePositionB:M,gridlinePositionC:A},w=this.Gs(k),D=this.Bm.gm();for(const[t,e]of this.Ri)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.zm(k,e);D.add({positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.qs.tickStyle}),s.gridStroke&&D.add({positions:s.gridStroke},{lineStyle:t.qs.gridStrokeStyle})}const E=this.Dm.gm(),T={x:0,y:0};this.Td.forEach((t=>{if(!t.Ui||t.ui)return;const s=this.Rm(k,t.u,t.rm,t.om),r=this.zm(k,s),n=E.add().Cn(s.labelPosition).Ln(s.labelAlignment).As(t.am).ks(t.lm).Ms(t.Ec(t.u)).Cs(t.sd).Zs().$t();T.x=Math.max(T.x,n.x),T.y=Math.max(T.y,n.y),D.add({positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.hm}),r.gridStroke&&D.add({positions:r.gridStroke},{lineStyle:t.nm})})),E.finishPlot(),D.finishPlot();const I=this.ee(((t,e)=>{const i=e.Pi.$t();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:T.x,y:T.y}),C=Math.atan((l.y-a.y)/(l.x-a.x));this.vs.Ln({x:0,y:0}).Cs(180*-C/Math.PI);const P=Ae.addVec(c,Ae.multiplyVec(Ae.multiply(h,this.km.Lm(.5*this.Fm.da().getThickness()+this.re(((t,e)=>Math.max(t,e.tickLength)),0))),r)),O=this.km.Em(P)||u(0,0),F=Qe(nt(O,this.chart.engine.scale,this.Tm),Qe(Qe(ei(I,m),Je(m,this.re(((t,e)=>Math.max(t,e.labelPadding)),0))),ei(Je(this.vs.Zs().$t(),.5),m)));this.vs.Cn(F),this.Fm.Vm={overrideFollowing:!1,skipMousePicking:!1}}zm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return kt(h,0)||kt(h,1)||(a=[this.isX()?{...i,x:n.x}:this.isY()?{...i,y:n.y}:this.isZ()?{...i,z:n.z}:{x:0,y:0,z:0},this.isX()?{...s,x:n.x}:this.isY()?{...s,y:n.y}:this.isZ()?{...s,z:n.z}:{x:0,y:0,z:0},this.isX()?{...r,x:n.x}:this.isY()?{...r,y:n.y}:this.isZ()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Ds(){super.Ds(),this.Bm.pm(),this.Dm.pm()}isX(){return this.ds===Ho}isY(){return this.ds===Uo}isZ(){return this.ds===Xo}}class Ko extends Hi{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._d=r}}const Jo=(t,e,i)=>wt(t+.1*(e-t)+Math.abs(i.st())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e));class Qo{constructor(){this.type="simple"}}const th=new Qo;class eh{constructor(t){this.type="phong",this.ambientReflection=1,this.specularReflection=.1,this.diffuseReflection=1,this.ambientColor=k("#000"),this.specularColor=k("#fff"),this.shininess=32,t&&(this.ambientReflection=Number.isNaN(Number(t.ambientReflection))?this.ambientReflection:Number(t.ambientReflection),this.specularReflection=Number.isNaN(Number(t.specularReflection))?this.specularReflection:Number(t.specularReflection),this.diffuseReflection=Number.isNaN(Number(t.diffuseReflection))?this.diffuseReflection:Number(t.diffuseReflection),this.ambientColor=t.ambientColor||this.ambientColor,this.specularColor=t.specularColor||this.specularColor,this.shininess=t.shininess||this.shininess)}}const ih=new eh,sh={Simple:Qo,Phong:eh};class rh extends Jr{constructor(t,e,i,s,r){super(t,e,s,r),this.Nm=ih,this.Gm=!0,this.Wm=!0,this.rl=t,this.km=i,this.be=new Map,this.onMouseWheel(this.rl.Hm),this.onMouseDrag(this.rl.Um),this.onTouchStart(this.rl.$m.onTouchStart),this.onTouchMove(this.rl.$m.onTouchMove),this.onTouchEnd(this.rl.$m.onTouchEnd)}setAutoScrollingEnabled(t){return this.Gm=t,this.rl.Wi.Gi(),this}getAutoScrollingEnabled(){return this.Gm}setColorShadingStyle(t){return this.Nm=t,this.be.forEach(((e,i)=>i.Ym(t))),this.km.Gi(),this}getColorShadingStyle(){return this.Nm}setDepthTestEnabled(t){return this.Wm=t,this.be.forEach(((e,i)=>i.Xm(t))),this.km.Gi(),this}getDepthTestEnabled(){return this.Wm}jm(){}gc(){}Zm(){}getXMax(){const t=this.Gn;return t?t.wt():void 0}getXMin(){const t=this.Gn;return t?t.At():void 0}getYMax(){const t=this.Gn;return t?t.Ct():void 0}getYMin(){const t=this.Gn;return t?t.kt():void 0}getZMax(){const t=this.Gn;return t?t.Km():void 0}getZMin(){const t=this.Gn;return t?t.qm():void 0}Jp(){const t=this.Gn;return t?f(t.bo(),t.vo(),t.Jm()):f(0,0,0)}}class nh extends rh{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Su="Box Series 3D",this.Qm=.25,this.ud=()=>le(this.jr),this.jr=de(this.fs.boxSeries3DFillStyle,r),this.Gn=this.km.iS().Xm(this.Wm).As(this.jr).tS(this.Qm).zr(this.getHighlight()),this.gu(this.Gn)}invalidateData(t){const e=t.length;if(0===e)return this;const i=t[0];if(!i)return this;let s;if("xMin"in i||"yMin"in i||"zMin"in i||"xMax"in i||"yMax"in i||"zMax"in i){s=[];for(let i=0;ile(this.ca.getFillStyle())}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;return this.Gn.ua(e),this.km.Gi(),this}getStrokeStyle(){return this.ca}add(t){return(t=Array.isArray(t)?t:[t])?(this.Gn.xt(t.slice()),this.km.Gi(),this):this}clear(){return this.Gn.no(),this.Wc=0,this}getPointAmount(){const t=this.Gn;return t.oo()+t.ao()}oe(){return this.Gm&&this.getPointAmount()>0&&this.getVisible()}Au(t,e){t.zr(e),this.km.Gi()}attach(t,e){return super.attach(t,e),ae(t,this.fs,{stroke:this.ca}),this}}class hh extends oh{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Su="Line Series 3D",this.ca=de(s.lineSeries3DStrokeStyle,r),this.eS=cs.pointStyle3D,this.hS(this.ca),this.Gn=this.km.Kp([Co.UserSeries]).Xm(this.Wm).ua(this.ca).Pm(this.eS).zr(this.getHighlight()),this.gu(this.Gn)}setStrokeStyle(t){super.setStrokeStyle(t),this.hS(this.ca);const e=this.eS;return this.Gn.Pm(e),this}hS(t){const e=new ts.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.eS=e}}class ah extends oh{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Su="Point Line Series 3D",this.ud=()=>le(this.ca.getFillStyle())||le(this.eS.getFillStyle()),this.eS=de(s.pointLineSeries3DPointStyle,r),this.ca=de(s.lineSeries3DStrokeStyle,r),this.rS(),this.Gn=this.km.Kp([Co.UserSeries]).Xm(this.Wm).ua(this.ca).Pm(this.eS).zr(this.getHighlight()),this.gu(this.Gn)}setPointStyle(t){return this.eS="function"==typeof t?t(this.eS):t,this.rS(),this.Gn.Pm(this.eS),this.km.Gi(),this}getPointStyle(){return this.eS}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.ca,i=Math.abs(e.getThickness()),s=this.eS;i>s.getSize()&&(this.eS=s.setSize(i)),this.rS();const r=this.eS;return this.Gn.Pm(r),this.km.Gi(),this}rS(){const t=this.eS,e=t.getSize();this.eS=t.setSize(e)}Au(t,e){t.zr(e),this.km.Gi()}}class lh extends rh{constructor(t,e,i,s,r,n){super(t,e,i,s,r)}add(t){return(t=Array.isArray(t)?t:[t])?(this.Gn.xt(t.slice()),this.km.Gi(),this):this}clear(){return this.Gn.no(),this.Wc=0,this}getPointAmount(){const t=this.Gn;return t.oo()+t.ao()}oe(){return this.Gm&&this.getPointAmount()>0&&this.getVisible()}Au(t,e){t.zr(e),this.km.Gi()}attach(t,e){return super.attach(t,e),ae(t,this.fs,{point3D:this.nS}),this}}class uh extends lh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Su="Point Series 3D",this.ud=()=>le(this.nS.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.rl.getSeries().length;this.nS=de(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Gn=this.km.aS(h).Xm(this.Wm).oS(this.nS).zr(this.getHighlight()),this.gu(this.Gn)}setPointStyle(t){this.nS="function"==typeof t?t(this.nS):t;const e=this.nS;return this.Gn.oS(e),this.km.Gi(),this}getPointStyle(){return this.nS}}class ch extends lh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Su="Point Cloud Series 3D",this.ud=()=>le(this.nS.getFillStyle());const o=this.rl.getSeries().length;this.nS=de(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Gn=this.km.aS(h).oS(this.nS).zr(this.getHighlight()),this.gu(this.Gn)}setPointStyle(t){this.nS="function"==typeof t?t(this.nS):t;const e=this.nS;return this.Gn.oS(e),this.km.Gi(),this}getPointStyle(){return this.nS}}const dh={Triangulated:uh,Pixelated:ch};class fh extends yo{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.lS=[],this.cS=0,this.uS=t=>{const e=this.lS.indexOf(t);e>=0&&(this.lS.splice(e,1),this.P.emit("seriesDispose",this,t))},this.dS=()=>{this.cS+=1},this.fS=()=>{this.cS-=1},this.onSeriesBackgroundMouseEnter=t=>this.P.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.P.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.P.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.P.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.P.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.P.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.P.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.P.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.P.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.P.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.P.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.P.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.P.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.P.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.P.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.P.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.P.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.P.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.P.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.P.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.P.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.P.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.P.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.P.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.P.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.P.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.P.off(t,"touchEndSeriesBackground"),this.gS=this.cc.Sg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.lS.forEach((e=>e.setAnimationHighlight(t))),this}pS(t,e){this.gS.pu([e]),t.setMouseMoveEventHandler(((t,e)=>{this.P.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.P.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.P.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.P.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.P.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.P.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.mS.As(t),this.Wi.Gi(),this}getSeriesBackgroundFillStyle(){return this.mS._s()}setSeriesBackgroundStrokeStyle(t){return this.SS.ir(t),this.Wi.Gi(),this}getSeriesBackgroundStrokeStyle(){return this.SS.sr()}setSeriesBackgroundEffect(t){return this.gS.Is(t),this.Wi.Gi(),this}getSeriesBackgroundEffect(){return this.gS.Ps()}yS(t){this.lS.push(t),t.onMouseEnter(this.dS),t.onMouseLeave(this.fS),void 0!==this.xS&&t.setHighlightOnHover(this.xS),this.P.emit("seriesAdded",this,t)}xd(){return this.lS}bS(){return this.cS}setSeriesHighlightOnHover(t){return this.xS=t,this.lS.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.lS.slice().forEach(Mt),super.dispose()}}const gh=Ae.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class ph{constructor(t,e,i,s){this.vS=!0,this.MS=!0,this._S=2*-Math.PI/2160,this.AS=2*Math.PI/2160,this.wS=.1,this.kS=1*Math.PI/180,this.CS=t,this.TS=e,this.IS=i,this.Em=s}getDefaultCameraConfiguration(t){const e={direction:gh,location:Ae.multiply(gh,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:e.direction,cameraLocation:e.location})||e}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.FS(i,t):"wheel-zoom"===t.type?i=this.PS(i,t):"rotate+zoom"===t.type?i=this.DS(i,t):"fixed-rotate"===t.type?i=this.BS(i,t):"move"===t.type&&(i=this.OS(i,t))})),this.vS?i=this.LS(t.boundingBox,i):this.MS&&(i=this.RS(t.boundingBox,i)),i}FS(t,e){const{rotation:i}=e,s=t.location,r=Ae.multiply(Ae.normalize(t.location),-1),{Right:n,Up:o}=this.ES(r);let h=s;const a=this.zS(r),l=i.x*this._S*a;h=Ae.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.AS,a-this.kS);return 0!==u&&(h=Ae.rotateAroundAxis(h,n,u)),{location:h,direction:Ae.multiply(Ae.normalize(h),-1)}}PS(t,e){const{deltaY:i}=e;this.vS&&this.VS(!1);const s=t.location,r=Ae.multiply(Ae.normalize(s),-1),n=i*this.wS,o=Ae.length(s)*-n;return{direction:r,location:Ae.addVec(s,Ae.multiply(r,o))}}DS(t,e){const{rotation:i,cameraDistance:s}=e;this.vS&&this.VS(!1);let r=this.FS(t,{type:"rotate",rotation:i});const n=r.location,o=Ae.multiply(Ae.normalize(n),-1),h=Ae.multiply(o,-s);return r={direction:Ae.multiply(Ae.normalize(h),-1),location:h},r}BS(t,e){this.vS&&this.VS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.ES(r),h=i.x*this._S;let a=Ae.normalize(Ae.rotateAroundAxis(r,o,h));const l=i.y*this.AS;return a=Ae.normalize(Ae.rotateAroundAxis(a,n,l)),{location:s,direction:a}}OS(t,e){this.vS&&this.VS(!1),this.MS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.ES(n);return{location:Ae.addVec(r,Ae.multiply(n,.01*s),Ae.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ae.multiply(Ae.normalize(t.cameraLocation),-1)};return this.vS?this.LS(t.boundingBox,e):this.RS(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ae.multiply(Ae.normalize(t.cameraLocation),-1)};return this.vS?this.LS(t.boundingBox,e):this.RS(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ae.multiply(Ae.normalize(t.cameraLocation),-1)};if(this.vS)return this.LS(t.boundingBox,e)}LS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.NS(t,s,100,20,1,i,5);const r=this.zS(s.direction);return s=this.GS(s,this.WS(t,s,100,1),r),s}NS(t,e,i,s,r,n,o){return mh(n,o,(t=>({direction:e.direction,location:Ae.multiply(e.direction,-t)})),(e=>this.HS(t,e)),i,r,"linear",s)}WS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.ES(e.direction),a=this.US(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(a.bottom-a.top)>u&&(l=a.bottom({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,h,t))})),(e=>this.$S(t,e)),0,u,!0,i):yh(0,c,(t=>({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,o,t))})),(e=>this.$S(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,n,t))})),(e=>this.YS(t,e)),0,u,!0,i):yh(0,c,(t=>({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,r,t))})),(e=>this.YS(t,e)),0,u,!0,i)),l}HS(t,e){const i=this.US(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}YS(t,e){const i=this.US(t,!1,e);return Math.abs(i.left-i.right)}$S(t,e){const i=this.US(t,!1,e);return Math.abs(i.top-i.bottom)}US(t,e,i){const s=Ve(this.XS(t,e,i).map((t=>nt(t,this.CS,this.TS))));return{left:s.min.x,right:this.TS.x.getInnerEnd()-s.max.x,top:this.TS.y.getInnerEnd()-s.max.y,bottom:s.min.y}}XS(t,e,i){const s=this.IS,r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),n=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],h=e?16:4,a=(r.x+n.x)/2,l=(r.z+n.z)/2,u=Math.sqrt(2)*(n.x-a),c=Math.sqrt(2)*(n.z-l);return[r.y,n.y].forEach((t=>{for(let e=0;ethis.Em(t,i))).filter((t=>void 0!==t))}RS(t,e){const i=Ae.length(e.location),s=this.jS(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)le(this.jr),this.Nm=th;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.rl.getSeries().length;this.jr=de(this.fs.surfaceGridSeries3DFillStyle,o),this.Fa=de(this.fs.surfaceGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.end?{x:(s.end.x-h.x)/s.columns,z:(s.end.z-h.z)/s.rows}:s.step||{x:1,z:1},l={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this.Dh=l,this.Gn=this.km.KS(l).As(this.jr).Pa(this.Fa).Ym(this.Nm).zr(this.getHighlight()),this.gu(this.Gn)}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Gn.As(this.jr),this.km.Gi(),this}getFillStyle(){return this.jr}setWireframeStyle(t){return this.Fa="function"==typeof t?t(this.Fa):t,this.Gn.Pa(this.Fa),this.km.Gi(),this}getWireframeStyle(){return this.Gn.Da()}setIntensityInterpolation(t){return t=t||"disabled",this.Gn.qS(t),this.km.Gi(),this}getIntensityInterpolation(){return this.Gn.JS()}invalidateIntensityValues(t){if(Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Dh.dataOrder?t.length:t[0].length,rows:"rows"===this.Dh.dataOrder?t.length:t[0].length},i="columns"===this.Dh.dataOrder?this.Dh.columns:this.Dh.rows,s="columns"===this.Dh.dataOrder?this.Dh.rows:this.Dh.columns;if(e.x>i||e.y>s){if(!0===this.rl.uf.Gh){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.rl.uf.Gh){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\n Out of bounds data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ei||e.y>s){if(!0===this.rl.uf.Gh){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.rl.uf.Gh){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\n Out of bounds data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ele(this.jr),this.Nm=th;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.rl.getSeries().length;this.jr=de(this.fs.surfaceScrollingGridSeries3DFillStyle,o),this.Fa=de(this.fs.surfaceScrollingGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.step||{x:1,z:1},l={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this.Dh=l,this.Gn=this.km.ey(l).As(this.jr).Pa(this.Fa).Ym(this.Nm).zr(this.getHighlight()),this.gu(this.Gn)}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Gn.As(this.jr),this.km.Gi(),this}getFillStyle(){return this.jr}setWireframeStyle(t){return this.Fa="function"==typeof t?t(this.Fa):t,this.Gn.Pa(this.Fa),this.km.Gi(),this}getWireframeStyle(){return this.Gn.Da()}setIntensityInterpolation(t){return t=t||"disabled",this.Gn.qS(t),this.km.Gi(),this}getIntensityInterpolation(){return this.Gn.JS()}clear(){return this.Gn.no(),this.km.Gi(),this}addValues(t){if(!t)return this;let e=t.yValues,i=t.intensityValues;if(!e&&!i)return this;if(e&&0===e.length&&(e=void 0),i&&0===i.length&&(i=void 0),e){const t=e[0].length,i=0+t-1,s="columns"===this.Dh.scrollDimension?this.Dh.rows:this.Dh.columns;if(i>s-1){if(!0===this.rl.uf.Gh){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Dh.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.rl.uf.Gh){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Dh.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(e)}const e=[];for(let t=0;ts?e=e.slice(0,s):i=i.slice(0,t)}}const s=e?e.length:null==i?void 0:i.length,r=e?e[0].length:null==i?void 0:i[0].length;return this.Gn.hy({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.km.Gi(),this}setCullMode(t){return this.Gn.iy("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Gn.sy()}jm(){}gc(){}Zm(){}oe(){return this.Gm&&this.getVisible()}Au(t,e){t.zr(e),this.km.Gi()}}class vh extends fh{constructor(t,e,i,s,r,n,o){let h;super(t,e,i,e.tp("chart3D bg",0),s,e.Wi.fs.chart3DBackgroundFillStyle,e.Wi.fs.chart3DBackgroundStrokeStyle,e.Wi.fs.chart3DTitleFont,e.Wi.fs.chart3DTitleFillStyle,n),this.ny=1,this.oy=[],this.ly=2,this.uy=!0,this.gy=!0,this.py=!0,this.my=0,this.axes={id:"axes",chart:this},this.world={id:"world",chart:this},this.Ze=[],this.th=()=>{const t=this.km.Sy();this.xy.yy(t),this.by.yy(t);const e=this.vy.viewportChanged(this.My());e&&this._y(e),this.Wi.Gi()},this.Um=(t,e,i,s,r)=>{if(this.py){const t=r;this.oy.push({type:"rotate",rotation:t}),this.Wi.Gi(),Zt(e)}},this.Hm=(t,e)=>{if(this.gy){if(this.uy)Math.sign(this.my)!==Math.sign(e.deltaY)?this.my=fe(e):this.my+=fe(e);else{const t=fe(e);this.oy.push({type:"wheel-zoom",deltaY:t})}this.Wi.Gi(),Zt(e)}},this.uf.Oh||this.uf.Bh||this.Wi.Ph(1),this.hp.Ms("Chart3D"),this.Ay=i.d3(),this.Ay.x.Z(-1,1),this.Ay.y.Z(-1,1),this.Ay.z.Z(-1,1),this.km=e.wy("chart3D layer3D",0,this.Ay),this.xy=e.ky("chart3D series bg",0),this.by=e.Vp("chart3D axis ui",1),this.Cy={x:new qo(this,Ho,this.Ay.x,this.fs,this.km,this.by,this.pixelScale,!1,this.cc),y:new qo(this,Uo,this.Ay.y,this.fs,this.km,this.by,this.pixelScale,!1,this.cc),z:new qo(this,Xo,this.Ay.z,this.fs,this.km,this.by,this.pixelScale,!1,this.cc)},this.Ty=this.km.Kp([Co.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.fs.chart3DBoundingBoxStrokeStyle),this.mS=this.xy.Iu(this.engine.scale,js.Simple).As(this.fs.chart3DSeriesBackgroundFillStyle).ir(J).setMouseInteractions(!0),this.SS=this.xy.Iu(this.engine.scale,js.Simple).As(B).ir(this.fs.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.pS(this.mS,this.SS),this.Iy({x:1,y:1,z:1},!0),this.vy=new ph(this.engine.scale,this.pixelScale,this.Ay,((t,e)=>(e&&this._y(e),this.km.Em(t)))),this.Fy=this.vy.getDefaultCameraConfiguration(this.Py(this.Dy)),this._y(this.Fy),this.$m=_r(new Vr(((t,e,i)=>{h={locationOne:e,locationTwo:i,cameraLocation:this.km.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.py&&!this.gy)return;const o=(h.locationOne.x-h.locationTwo.x)**2+(h.locationOne.y-h.locationTwo.y)**2,a=(e.x-i.x)**2+(e.y-i.y)**2,l=Ae.length(h.cameraLocation),c=o/a*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.oy.push({type:"rotate+zoom",rotation:this.py?d:{x:0,y:0},cameraDistance:this.gy?c:l}),this.Wi.Gi(),Zt(n)}),(t=>{})),new Gr((t=>{}),((t,e,i,s,r)=>{if(this.py){const t=s;this.oy.push({type:"rotate",rotation:t}),this.Wi.Gi(),Zt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.$m.onTouchStart),this.onBackgroundTouchMove(this.$m.onTouchMove),this.onBackgroundTouchEnd(this.$m.onTouchEnd),this.onSeriesBackgroundTouchStart(this.$m.onTouchStart),this.onSeriesBackgroundTouchMove(this.$m.onTouchMove),this.onSeriesBackgroundTouchEnd(this.$m.onTouchEnd),this.onBackgroundMouseDrag(this.Um),this.onBackgroundMouseWheel(this.Hm),this.onBackgroundMouseDown(((t,e)=>{Zt(e)})),this.onSeriesBackgroundMouseDrag(this.Um),this.onSeriesBackgroundMouseWheel(this.Hm),this.onSeriesBackgroundMouseDown(((t,e)=>{Zt(e)})),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.onResize(this.th),this.th(),this.Qg(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||uh)(this,this.uS,this.km,this.fs,this.Wi.cc,t);return this.yS(e),e}addLineSeries(t){const e=new hh(this,this.uS,this.km,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPointLineSeries(t){const e=new ah(this,this.uS,this.km,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addSurfaceGridSeries(t){const e=new xh(this,this.uS,this.km,t,this.fs,this.Wi.cc);return this.yS(e),e}addSurfaceScrollingGridSeries(t){const e=new Sh(this,this.uS,this.km,t,this.fs,this.Wi.cc);return this.yS(e),e}addBoxSeries(t){const e=new nh(this,this.uS,this.km,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}getDefaultAxisX(){return this.Cy.x}getDefaultAxisY(){return this.Cy.y}getDefaultAxisZ(){return this.Cy.z}getDefaultAxes(){return[this.Cy.x,this.Cy.y,this.Cy.z]}setCameraLocation(t){let e={location:t,direction:Ae.normalize(Ae.multiply(t,-1))};const i=this.vy.cameraLocationChanged(this.My(e));return i&&(e=i),this._y(e),this.Wi.Gi(),this}getCameraLocation(){return this.km.getCameraLocation()}getCameraDirection(){return this.km.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.vy.VS(t);const e=this.vy.cameraLocationChanged(this.My());return e&&this._y(e),this}getCameraAutomaticFittingEnabled(){return this.vy.ZS()}onCameraChange(t){return this.P.on("cameraChange",t)}offCameraChange(t){return this.P.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.Ty.ua(t).Pm(jo(this.Ty.da())),this.km.Gi(),this}getBoundingBoxStrokeStyle(){return this.Ty.da()}setBoundingBox(t){return this.Iy(t,!1),this}Iy(t,e){this.Dy=t;const i=this.Py(t);if(this.Ay.x.q(i.x),this.Ay.y.q(i.y),this.Ay.z.q(-i.z),!e){const t=this.vy.boundingBoxChanged(this.My());t&&this._y(t)}this.Wi.Gi()}getBoundingBox(){return this.Dy}gc(){const t=mt.performance.now();if(xo.lp(this.hp,this.ip),0!==this.my){const e=this.By?t-this.By:1e3/60,i=this.my*e*.006;this.oy.push({type:"wheel-zoom",deltaY:i}),this.my=Math.sign(this.my)*Math.max(Math.abs(this.my)-.01*e,0),0!==this.my?(this.Wi.Gi(!0),this.By=t):this.By=void 0}const e=this.getCameraDirection();if(this.oy.length>0){const t=this.vy.applyCameraInteractions(this.My(),this.oy);t&&this._y(t),this.oy.length=0}this.Oy&&Ae.equals(this.Oy.location,this.Fy.location)&&Ae.equals(this.Oy.direction,this.Fy.direction)||this.P.emit("cameraChange",this,this.getCameraLocation()),this.Oy=this.Fy,super.gc();for(let t=0;tthis.km.Em(t))),o=this.km.Em(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=se(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.Ze.length=0,this.Ay.G(),this.km.G(),this.by.G(),this.xy.G(),super.dispose()}X(){return this.Ay.x.X(),this.Ay.y.X(),this.Ay.z.X(),super.X()}j(){return super.j()}_y(t){this.km.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ae.addVec(t.location,Ae.multiply(t.direction,-this.ly))),this.Fy=t,this.Wi.Gi()}Py(t){return Ae.divide(t,Ae.length(t)/this.ny)}My(t=this.Fy){return{boundingBox:this.Py(this.Dy),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.gy=t,this}getMouseInteractionZoom(){return this.gy}setMouseInteractionRotate(t){return this.py=t,this}getMouseInteractionRotate(){return this.py}forEachAxis(t){return t(this.Cy.x),t(this.Cy.y),t(this.Cy.z),this}getMinimumSize(){}getSeries(){return this.lS}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.uy=!!t,this}getAnimationZoom(){return this.uy}}const bh={Column:In,Row:Cn};class Mh extends po{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ly=new Map,this.Ry=this.addUIElement(bh.Row).setPosition({x:0,y:100}).setOrigin(Dr.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(J)))}add(t,e){return(t instanceof yo?[t]:t instanceof md?t.getCells().filter((t=>t.panel instanceof yo)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Ry.addElement(so.VerticalLegendBox).setBackground((t=>t.setFillStyle(B).setStrokeStyle(J))).add(t,e).setTitle(t.getTitle());this.Ly.set(t,i)})),this.Wi.Gi(),this}setLegendBoxes(t){return this.Ly.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Ry.getSize()}}class Ah{constructor(t,e){this.Ey=t,this.zy=e}alter(t){this.Vy=void 0!==this.Vy?this.Vy:this.zy(),this.Ny=t,this.Ey(t)}resetValue(){void 0!==this.Ny&&(void 0!==this.Vy&&this.isAltered()&&this.Ey(this.Vy),this.Vy=void 0,this.Ny=void 0)}getNormalValue(){return void 0!==this.Vy?this.Vy:this.zy()}isAltered(){return void 0!==this.Ny&&this.zy()===this.Ny}}class kh{constructor(t,e){this.Gy=[],this.Wy=t,this.ut=e}update(){return this.Wy.getVisible()?!(this.Hy()&&(!this.Uy()||(this.resetTable(),this.Wy.Zs(),this.Hy()))&&(this.$y(),this.Wy.Zs(),this.Hy()&&(this.resetTable(),this.Wy.Zs(),1))):(this.Uy()&&this.resetTable(),!0)}Uy(){for(let t=0;t{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Wy,this.ut)}Yy(){return((t,i)=>{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Wy,this.ut)}Xy(){return((t,i)=>{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Wy,this.ut)}jy(t){return this.Gy.push(t),t}}class wh extends kh{constructor(){super(...arguments),this.gn=this.jy(new Ah((t=>this.Wy.setOrigin(t)),(()=>this.Wy.getOrigin())))}$y(){const t=this.gn.getNormalValue(),e=u(this.Yy()?-t.x:t.x,this.Xy()?-t.y:t.y);this.gn.alter(e)}}class Dh extends kh{constructor(t,e,i,s){super(t,e),this.Zy=this.jy(new Ah((t=>this.Wy.setTextFont((e=>e.setSize(t)))),(()=>this.Wy.getTextFont().getSize()))),this.Ky=i,this.qy=s}$y(){const t=this.Zy.getNormalValue(),e=this.Ky;if(enew wh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new Dh(i,s,t,e)};class Th{constructor(){this.Jy=[]}addRow(...t){return this.Jy.push(t),this}}class Ih extends Th{Lc(){const t=this.Jy;return this.Jy=[],t}Qy(){return this.Jy.length=0,this}}class Ch extends En{constructor(){super(...arguments),this.wc=this.fs.cursorResultTableTextFont,this.sd=0,this.am=this.fs.cursorResultTableTextFillStyle}setContent(t){for(let e=0;e=e)this.getMembers()[s].dispose(),s-=1,i-=1;else{const e=t[s].length;let i=r.getMembers().length;for(let n=0;n=e)r.getMembers()[n].dispose(),n-=1,i-=1;else if(void 0!==o&&o.length>0){for(let t=h.length;t=h.length)t=r.addElement(yn,void 0);else{const e=h[n];e instanceof Mn?(r.getMembers()[n].dispose(),t=r.addElement(yn,n)):t=e}t.setFont(this.wc).setFillStyle(this.am).setText(o).setTextRotation(this.sd)}else{for(let t=h.length;t=h.length?r.addGap(void 0,void 0):h[n]instanceof mn&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.Hr.Gi(),this}setTextFillStyle(t){this.am="function"==typeof t?t(this.am):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this.ux=Eh.Flip(this.Wy,this.scale)}dispose(){return this.lx.dispose(),this.Wy.dispose(),this}pointAt(t){return this.an=t.series.scale===this.scale?t.location:nt(t.location,t.series.scale,this.scale),this.lx.setPosition(this.an),this.Wy.setPosition(this.an).setContent(t.resultTableContent),this.Hr.Gi(),this}getPosition(){return this.an}setVisible(t){return this.Ui=t,this.Hr.Gi(),this}getVisible(){return this.Ui}setPointMarkerVisible(t){return this.ix=t,this.Hr.Gi(),this}getPointMarkerVisible(){return this.ix}setPointMarker(t){return t(this.lx),this.Hr.Gi(),this}getPointMarker(){return this.lx}setResultTableVisible(t){return this.sx=t,this.Hr.Gi(),this}getResultTableVisible(){return this.sx}setResultTable(t){return t(this.Wy),this.Hr.Gi(),this}getResultTable(){return this.Wy}setAutoFitStrategy(t){return this.ux&&this.ux.resetTable(),this.ux=t?t(this.Wy,this.Hr.Wi.ut):void 0,this.Hr.Gi(),this}getAutoFitStrategy(){return void 0!==this.ux}gc(){return this.ux&&this.ux.update(),this.Wy.setVisible(this.hx&&this.Ui&&this.sx),this.lx.setVisible(this.hx&&this.Ui&&this.ix),this.lx.gc(),this.Wy.gc(),this}Zs(){return this.lx.Zs(),this.Wy.Zs(),this.hx=((t,e,i=e)=>{const s=e!==i?nt(t,e,i):t;return s.x>=i.x.getInnerStart()&&s.x<=i.x.getInnerEnd()&&s.y>=i.y.getInnerStart()&&s.y<=i.y.getInnerEnd()})(this.an,this.scale),this}}class Oh extends Ph{constructor(){super(...arguments),this.gx=!1}pointAt(t){return this.mx(t.fillStyle),super.pointAt(t)}mx(t){t&&this.gx&&this.Wy.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.gx=t,this.Hr.Gi(),this}getResultTableAutoTextStyle(){return this.gx}}class Fh extends Ph{setPosition(t){return this.an=t,this.lx.setPosition(t),this.Wy.setPosition(t),this.Hr.Gi(),this}}class Rh{constructor(t,e,i=[]){this.Sx=[],this.yx=(t,e)=>(this.Sx.forEach((i=>i(t,e))),t),this.nx=t,this.ox=e,this.Sx=i}}class Bh extends Rh{constructor(){super(...arguments),this.xx=(t,e,i,s)=>this.yx(new Oh(t,e,i,this.nx,this.ox,s),s),this.addStyler=t=>new Bh(this.nx,this.ox,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Bh(t,this.ox,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Bh(this.nx,t,this.Sx.map((t=>t)))}}class zh extends Rh{constructor(){super(...arguments),this.bx=(t,e,i,s)=>this.yx(new Fh(t,e,i,this.nx,this.ox,s),s),this.addStyler=t=>new zh(this.nx,this.ox,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new zh(t,this.ox,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new zh(this.nx,t,this.Sx.map((t=>t)))}}const _h=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),Lh=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setStrokeStyle(e.chartMarkerPointMarkerStrokeStyle).setSize(u(20,20)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10)));new Bh(xn,xn,[_h]);const Gh=new Bh(xn,bn,[_h,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof bn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Vh=Gh;new zh(vn,xn,[Lh,t=>t.setResultTableVisible(!1)]);const Nh=new zh(dn,xn,[Lh,t=>t.setResultTable((t=>t.setOrigin(Dr.LeftBottom)))]),Wh=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),Hh={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Uh=(t,e)=>!(!e.name||t.name.toLowerCase()!==e.name.toLowerCase())||"ISO_A3"in t&&"ISO_A3"in e&&t.ISO_A3.toLowerCase()===e.ISO_A3.toLowerCase(),Xh=(t,e)=>{let i=e.geometry;return i=jh(t,e,i),i=Yh(t,e,i),i},jh=(t,e,i)=>{if(t===Hh.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===Hh.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=Ve(Dt(i)),h=[];for(let e=0;e{this.lS.includes(t)||(this.lS.push(t),this.P.emit("seriesAdded",this,t))},this._x=i.Ax();const c=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},d=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},f=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},g=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},p=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},m=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()};this.onSeriesBackgroundMouseEnter(c),this.onSeriesBackgroundMouseMove(d),this.onSeriesBackgroundMouseLeave(f),this.onSeriesBackgroundTouchStart(g),this.onSeriesBackgroundTouchMove(p),this.onSeriesBackgroundTouchEnd(m),this.wx(((t,e)=>{const i=e.onMouseEnter(c),s=e.onMouseMove(d),r=e.onMouseLeave(f),n=e.onTouchStart(g),o=e.onTouchMove(p),h=e.onTouchEnd(m),a=this.kx(((t,l)=>{l===e&&(e.offMouseEnter(i),e.offMouseMove(s),e.offMouseLeave(r),e.offTouchStart(n),e.offTouchMove(o),e.offTouchEnd(h)),this.Cx(a)}))}))}setAutoCursor(t){return this.Tx&&t(this.Tx),this.Wi.Gi(),this}getAutoCursor(){return this.Tx}setAutoCursorMode(t){return this.vx=t,this.Wi.Gi(),this}getAutoCursorMode(){return this.vx}Ix(t){if(t.xthis.uiScale.x.Wt()||t.ythis.uiScale.y.Wt())return;let e,i=Number.MAX_VALUE;for(const s of this.lS)if(s.getCursorEnabled()&&s.getVisible()){const r=s.Ix(t,!1);if(r){const s=nt(r.location,r.scale,this.engine.scale),n=Be(t,s);Number.isNaN(n)||e&&!(nt.getIsUnderMouse())),r=this.mS.getIsUnderMouse();this.vx===e.AutoCursorModes.snapToClosest?(r||void 0!==s)&&(i=t&&this.Ix(t)):this.vx===e.AutoCursorModes.onHover&&void 0!==s&&s.getCursorEnabled()&&(i=t&&s.Ix(t,!0))}i?this.Tx.pointAt(i).setVisible(!0):this.Tx.setVisible(!1),this.Tx.Zs().gc()}wx(t){return this.P.on("seriesAdded",t)}Px(t){return this.P.off(t)}kx(t){return this.P.on("seriesDispose",t)}Cx(t){return this.P.off(t)}dispose(){return this._x.G(),this.Tx.dispose(),super.dispose()}}class Jh extends yo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("mapChart bg",0),r,i.Wi.fs.mapChartBackgroundFillStyle,i.Wi.fs.mapChartBackgroundStrokeStyle,i.Wi.fs.mapChartTitleFont,i.Wi.fs.mapChartTitleFillStyle,h),this.Dx=[],this.ut=this.Ng.d2({scaleXYConstructor:Ti}),this.Nc=!0,this.Bx=this.fs.mapChartSeparateRegionFillStyle,this.Ox=this.fs.mapChartSeparateRegionStrokeStyle,this.Lx=e.AutoCursorModes.onHover,this.Rx=Qh,this.Hi=!0,this.Ex=0,this.zx=!0,this.Vx=new Map,this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.P.on("mapDataReady",t);return this.Nx&&mt.setTimeout((()=>t())),e},this.onViewChange=t=>this.P.on("viewChange",t),this.Gx=(t,e,i,s,r)=>{this.ut.x.q(s).Nt([this.Pt.left+this.pn.left,this.Pt.right+this.pn.right]),this.ut.y.q(r).Nt([this.Pt.bottom+this.pn.bottom,this.Pt.top+this.pn.top+xo.ap(this.hp,this.ip)]),this.Wx&&this.Hx(this.Ux,this.ut,this.Wx)},this.Xc=(t,i)=>{const s=i;if(!s||!this.Nx)return;const{iRegion:r,region:n}=this.$x(this.Nx,s);this.Lx!==e.AutoCursorModes.disabled&&(this.Yx(n,r),Zt(t)),this.zx&&this.Wi.Zh.Ie(n,!0),this.P.emit("mouseEnter",this,t)},this.Zc=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.Xx(r,s),this.zx&&this.Wi.Zh.Ie(r,!1),this.P.emit("mouseLeave",this,t),t&&Zt(t)},this.qc=(t,i)=>{const s=i;if(!s||!this.Nx)return;const{iRegion:r,region:n}=this.$x(this.Nx,s);this.Lx!==e.AutoCursorModes.disabled&&(this.Yx(n,r),Zt(t)),this.P.emit("mouseMove",this,t)},this.Qc=(t,e)=>this.P.emit("mouseClick",this,t),this.tu=(t,e)=>this.P.emit("mouseDoubleClick",this,t),this.iu=(t,e)=>this.P.emit("mouseDown",this,t),this.su=(t,e)=>this.P.emit("mouseUp",this,t),this.eu=(t,e,i)=>{this.P.emit("mouseDragStart",this,t,e)},this.hu=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,t,e,i,s)},this.ru=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,t,e,i)},this.nu=(t,e)=>{this.P.emit("mouseWheel",this,t)},this.ou=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.jx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Yx(r,s),this.zx&&this.Wi.Zh.Ie(r,!0),this.P.emit("touchStart",this,t),Zt(t)},this.au=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.jx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Yx(r,s),this.P.emit("touchMove",this,t),Zt(t)},this.lu=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.jx=void 0,this.Xx(r,s),this.zx&&this.Wi.Zh.Ie(r,!1),this.P.emit("touchEnd",this,t),Zt(t)},this.uf.Oh||this.uf.Bh||this.Wi.Ph(3),(null==o?void 0:o.disableAnimations)&&(this.Hi=!1),this.Zx=i.Vp("mapChart plotting",0),this.onResize(this.Gx),this.hp.Ms("Map Chart");const a=Pt(o?o.autoCursorBuilder:void 0,Nh);this.Kx=a.bx(i.Ax(),this.ut,this.ut,this.fs).setVisible(!1),this.qx=this.cc.Sg(),this.Qg(n,this.uiScale),this.Jx=this.Zx.Qx(this.ut).setMouseInteractions(this.Nc).setMouseEnterEventHandler(((t,e,i)=>this.Xc(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Zc(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Qc(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.tu(e,i))).setMouseDownEventHandler(((t,e,i)=>this.iu(e,i))).setMouseUpEventHandler(((t,e,i)=>this.su(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.qc(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.eu(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.hu(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.ru(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.nu(e,i))).setTouchStartEventHandler(((t,e,i)=>this.ou(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.au(e,i))).setTouchEndEventHandler(((t,e,i)=>this.lu(e,i))).As(this.fs.mapChartFillStyle).ir(this.fs.mapChartStrokeStyle),this.tb=this.Zx.Qx(this.ut).setMouseInteractions(this.Nc).As(this.fs.mapChartOutlierRegionFillStyle).ir(this.fs.mapChartOutlierRegionStrokeStyle);const l=Pt(o&&o.type,Hh.World);this.Ux=l,this.ib(l).then((()=>{this.P.emit("mapDataReady")}))}setFillStyle(t){return this.Jx.As(t),this.Wi.Gi(),this}getFillStyle(){return this.Jx._s()}setStrokeStyle(t){return this.Jx.ir(t),this.Wi.Gi(),this}getStrokeStyle(){return this.Jx.sr()}setEffect(t){return this.qx.Is(t),this.Wi.Gi(),this}getEffect(){return this.qx.Ps()}setOutlierRegionFillStyle(t){return this.tb.As(t),this.Wi.Gi(),this}getOutlierRegionFillStyle(){return this.tb._s()}setOutlierRegionStrokeStyle(t){return this.tb.ir(t),this.Wi.Gi(),this}getOutlierRegionStrokeStyle(){return this.tb.sr()}setSeparateRegionFillStyle(t){return this.Bx="function"==typeof t?t(this.Bx):t,this.Dx.forEach((t=>t.As(this.Bx))),this.Wi.Gi(),this}getSeparateRegionFillStyle(){return this.Bx}setSeparateRegionStrokeStyle(t){return this.Ox="function"==typeof t?t(this.Ox):t,this.Dx.forEach((t=>t.ir(this.Ox))),this.Wi.Gi(),this}getSeparateRegionStrokeStyle(){return this.Ox}invalidateRegionValues(t){if(!this.Nx||!this.sb)return this.eb=this.eb||[],this.eb.push(t),this;if("function"==typeof t)for(let e=0;e{t.hb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.hb(e.value)}))}}return this.Wi.Gi(),this}setAutoCursor(t){return this.Kx&&t(this.Kx),this.Wi.Gi(),this}getAutoCursor(){return this.Kx}setAutoCursorMode(t){return this.Lx=t,this.Wi.Gi(),this}getAutoCursorMode(){return this.Lx}setCursorResultTableFormatter(t){return this.Rx=t,this.Wi.Gi(),this}getCursorResultTableFormatter(){return this.Rx}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}setMouseInteractions(t){return this.Nc=t,this.Jx.setMouseInteractions(t),this}getMouseInteractions(){return this.Nc}setHighlight(t){var e;return t=ye(t),this.Ex=t,null===(e=this.Nx)||void 0===e||e.regions.forEach((e=>{this.Wi.Zh.Ie(e,t)})),this.P.emit("highlight",t),this}getHighlight(){return this.Ex}setAnimationHighlight(t){var e;return null===(e=this.Nx)||void 0===e||e.regions.forEach((e=>{this.Wi.Zh.Pe(e,t)})),this}getAnimationHighlight(){var t;return this.Wi.Zh.De(null===(t=this.Nx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.zx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.zx}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}offMapDataReady(t){return this.P.off(t,"mapDataReady")}offViewChange(t){return this.P.off(t,"viewChange")}async ib(t){const e=await((t,e)=>{let i;if(t===Hh.World)i="countries_world.json";else if(t===Hh.NorthAmerica)i="countries_northAmerica.json";else if(t===Hh.SouthAmerica)i="countries_southAmerica.json";else if(t===Hh.Africa)i="countries_africa.json";else if(t===Hh.Europe)i="countries_europe.json";else if(t===Hh.Asia)i="countries_asia.json";else if(t===Hh.USA)i="states_usa.json";else if(t===Hh.Canada)i="territoriesProvinces_canada.json";else{if(t!==Hh.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw mt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return mt.fetch(s).then((t=>t.json())).catch((t=>{Me(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.uf.Nh);this.sb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=$h[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.tb.Te().yo(e);if(t===Hh.USA){const t=25.8,e=29.7;this.Dx.push(this.Zx._u(this.ut).setMouseInteractions(!1).As(this.Bx).ir(this.Ox).Cn({x:-126,y:t}).q({x:10,y:e-t}),this.Zx._u(this.ut).setMouseInteractions(!1).As(this.Bx).ir(this.Ox).Cn({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.Wi.Zh.Ce(this.Jx,{animationEnabled:this.Hi});for(let i=0;i{o.forEach((e=>e.zr(t)))}))}if(this.qx.pu([this.Jx]),this.Wx=i,this.Hx(t,this.ut,i),this.Nx=e,this.eb){for(const t of this.eb)this.invalidateRegionValues(t);this.eb=void 0}this.gc()}Hx(t,e,i){const s=Zh[t],r=e.x.getCellSize(),n=e.y.getCellSize()/r,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(ns){const t=(o.max.y-o.min.y)*(n/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.Z(o.min.x,o.max.x),e.y.Z(o.min.y,o.max.y);const h=this.ut.x.Xt(),a=this.ut.y.Xt();this.P.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:a[1],bottom:a[0],left:h[0],right:h[1]}})}Yx(t,e){this.rb={region:t,iRegion:e},this.Wi.Gi()}Xx(t,e){this.rb&&t===this.rb.region&&(this.rb=void 0,this.Wi.Gi())}$x(t,e){const i=Array.from(this.Vx.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.Hi=!t,this}getAnimationsEnabled(){return this.Hi}getMinimumSize(){}xd(){return[this]}gc(){super.gc(),super.Jg(),xo.lp(this.hp,this.ip);const t=m(this.ut.x.Gt(),this.ut.y.Gt(),this.ut.x.Ht(),this.ut.y.Ht());this.Zx.yy(t);const e=this.Wi.Fh()||this.jx;if(this.rb&&e){const t=this.sb&&this.sb[this.rb.iRegion];let i=nt(e,this.engine.scale,this.ut);i={x:wt(i.x,this.ut.x.getInnerStart(),this.ut.x.getInnerEnd()),y:wt(i.y,this.ut.y.getInnerStart(),this.ut.y.getInnerEnd())};let s=i.x,r=i.y;const n=this.rb.region.transform;this.rb.region.outlier&&n&&(s=(s-n.translate.x-n.vertexBoundaries.min.x)/n.scale.x+n.vertexBoundaries.min.x,r=(r-n.translate.y-n.vertexBoundaries.min.y)/n.scale.y+n.vertexBoundaries.min.y),this.Kx.setPosition(i).setVisible(!0).getResultTable().setContent(this.Rx(new Ih,this.rb.region,t,s,r,this).Lc())}else this.Kx.setVisible(!1);return this.Kx.Zs().gc(),this}dispose(){return this.Zx.G(),this.Kx.dispose(),go(this.ut),super.dispose()}X(){return super.X(),this.ut.X(),this}j(){return super.j(),this.ut.j(),this}ud(){return le(this.getFillStyle())}attach(t,e){return t.setText(this.getTitle()),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1)),t.setOn(!0).setLocked(!0),t.onMouseEnter((()=>{this.setHighlight(!0)})),t.onMouseLeave((()=>{this.setHighlight(!1)})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),ae(t,this.fs,{fill:this.getFillStyle()}),this}}const Qh=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(ta(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),ta=(t,e)=>{const i=t>0,s=e>0;return`${[ce(Math.abs(0|t),2),"° ",ce(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ce(Math.abs(0|e),2),"° ",ce(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class ea extends Wi{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.nb(i),s,r,{numeric:e.ob({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.ob({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.ob({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.ab=n,this.lb=o,this.cb=h,this.cc=a,this.ub=i,this.fb=e.ob({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.vs=h.ye(i).setMouseInteractions(!1).ks(e.ob({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).As(e.ob({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Fs=this.cc.Sg([this.vs]).Is(s.effectsText)}setStrokeStyle(t){return this.fb="function"==typeof t?t(this.fb):t,this.lb.Gi(),this}getStrokeStyle(){return this.fb}Qs(t,e){return new ia(e,t,this.ub,this.cb,this.cb,this.gb(this.ab,this.ub),this.cb.Bc(this.ub).setMouseInteractions(!1))}te(t,e){const i=this.pb(this.ub,t);this.mb&&!1===this.mb(t)?t.Pi.setVisible(!1):t.Pi.setVisible(!0).Cn(Qe(this.Sb(this.ub,t.u),i.padding)).Ln(i.alignment).Cs(i.rotation).In(i.offset.x,i.offset.y),this.yb(this.ub,t.xb,t.bb,t)}setMouseInteractions(t){return this}gc(){this.Gs({physicalAxisSize:0});const t=this.ee(((t,e)=>{const i=e.ns.qs,s=.5*this.fb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Pi.Zs().$t().y/this.ub.wi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.vb(this.ub,this.fb,t),this.Mb(this.ub,this.vs,t),t}}class ia extends ro{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.xb=n,this.bb=o,n.setMouseInteractions(!1),this.be.push(n,o)}}class sa extends ea{constructor(t,e,i,s,r,n,o,h,a){super(t,ra,e,i,s,r,n,o,h),this.Fm=this.lb.Bc(this.ub).setMouseInteractions(!1),this._b=a,this.setScrollStrategy(Ci.expansion),this.setTickStrategy(Pi.Numeric),this.setTitle("Amplitude")}ne(){return this._b()}fe(t,e){return no(t,e,this.ub.y)}pe(t,e,i){const s=2*(e-t),r=this.ub.x.Si(s);return{min:t-i*r,max:e+i*r}}Sb(t,e){return{x:t.Ab()?e-t.wb().start:t.wb().start-e,y:0}}gb(t,e){return t.Ou(e)}yb(t,e,i,s){const r=s.ns.qs,n=t.Ab()?s.u-t.wb().start:t.wb().start-s.u;kt(s.u,t.wb().start)||kt(s.u,t.wb().end)?e.setVisible(!1):e.setVisible(!0).ea(0).ha(360).la(void 0).aa(0).ra(n).la(60).As(B).ir(r.gridStrokeStyle);const o=.5*this.fb.getThickness();i.Sa({x:n,y:-o*t.wi().y}).ha({x:n,y:-(o+r.tickLength)*t.wi().y}).ua(r.tickStyle)}pb(t,e){const i=e.ns.qs;return{alignment:{x:0,y:1},padding:{x:0,y:t.wi().y*-(.5*this.fb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}vb(t,e,i){const s=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;this.Fm.Sa({x:0,y:0}).ha({x:s,y:0}).ua(e)}Mb(t,e,i){const s=t.Ab()?(t.wb().start+t.wb().end)/2-t.wb().start:t.wb().start-(t.wb().start+t.wb().end)/2;e.Ln({x:0,y:1}).Cn({x:s,y:-i*t.wi().y})}}const ra={ae:t=>t.getAmplitudeMin(),le:t=>t.getAmplitudeMax(),ue:t=>{},nb:t=>({getInnerStart:()=>t.wb().start,getInnerEnd:()=>t.wb().end,Z:(e,i)=>t.kb(e,i),rt:(e,i,s,r,n)=>t.y.rt(e,i,s,r,n)}),ob:t=>t.amplitude};class na extends ea{constructor(t,e,i,s,r,n,o,h){super(t,ha,e,i,s,r,n,o,h),this.Cb=90,this.Tb=12,this.Ib=oa,this.Fm=this.lb.Ou(this.ub).setMouseInteractions(!1),this.mb=t=>{let e=180*(t.u-this.ub.Fb())/Math.PI%360;for(;e<0;)e+=360;for(;e>360;)e-=360;if(e>=0&&e<=20||e>=340&&e<=360)return!1},this.zi=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Cb)}setTickStyle(t){return this.Pb="function"==typeof t?t(this.Pb):t,this.Db(),this.lb.Gi(),this}getTickStyle(){return this.Pb}setTickFormattingFunction(t){return this.Ib=t,this.Db(),this.lb.Gi(),this}getTickFormattingFunction(){return this.Ib}setClockwise(t){this.ub.Bb(t);const e=this.Cb*Math.PI/180;return t?this.ub.Ob(e+Math.PI/2):this.ub.Ob(e-Math.PI/2),this.lb.Gi(),this}getClockwise(){return!this.ub.Lb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Cb=t;const e=t*Math.PI/180;return this.getClockwise()?this.ub.Ob(e+Math.PI/2):this.ub.Ob(e-Math.PI/2),this.lb.Gi(),this}getNorth(){return 180*this.ub.Fb()/Math.PI}setDivision(t){return this.Tb=t,this.Db(),this.lb.Gi(),this}getDivision(){return this.Tb}ne(){return[]}fe(t,e){return e}pe(t,e,i){return{min:t,max:e}}Sb(t,e){const i=t.Lb()?1:-1,s=t.Fb(),r=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}gb(t,e){return t.Bc(e)}yb(t,e,i,s){const r=this.Pb,n=t.Lb()?1:-1,o=t.Fb(),h=(s.u-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end,c={x:a*u,y:l*u};e.Sa({x:0,y:0}).ha(c);const d={x:c.x+a*r.tickLength*t.wi().x,y:c.y+l*r.tickLength*t.wi().y};i.Sa(c).ha(d),e.ua(r.gridStrokeStyle),i.ua(r.tickStyle)}pb(t,e){const i=this.Pb,s=t.Lb()?1:-1,r=t.Fb();let n,o=(e.u-r)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;n=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const h=i.tickLength+i.tickPadding,a=Math.cos(o)*h*t.wi().x,l=Math.sin(o)*h*t.wi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}vb(t,e,i){const s=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;this.Fm.ea(0).ha(360).aa(0).ra(s+.5*e.getThickness()*t.wi().x).la(60).As(B).ir(e)}Mb(t,e,i){const s=t.Fb(),r=this.pb(t,{u:0+s}),n=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;e.Ln(r.alignment).Cs(r.rotation).In(r.offset.x,r.offset.y).Cn(Qe({x:n,y:0},r.padding))}Db(){this.Ls({Di:[],Bi:[{Pi:"Radial ticks",kg:0,qs:this.Pb,js:this.Ib,_e:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Tb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},os:{ie:()=>{},ls:()=>!1},Ae:void 0}],Ii:oa,Rs:void 0,Es:void 0})}}const oa=(t,e,i)=>(180*t/Math.PI).toFixed(0),ha={ae:t=>{},le:t=>{},ue:t=>{},nb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,Z:(t,e)=>{},rt:(e,i,s,r,n)=>t.x.rt(e,i,s,r,n)}),ob:t=>t.radial};class aa extends Jr{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Su="Sector",this.Rb=0,this.Eb=1*Math.PI/2,this.zb=void 0,this.Vb=void 0,this.Hr=t,this.ub=s,this.Mp=this.Hr.Ou(this.ub).zr(this.getHighlight()),this.gu(this.Mp),this.jr=r.polarSectorFillStyle,this.tn=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.Rb=wt(t,0,360),this.Hr.Gi(),this}getAngleStart(){return this.Rb}setAngleEnd(t){return this.Eb=wt(t,0,360),this.Hr.Gi(),this}getAngleEnd(){return this.Eb}setAmplitudeStart(t){return this.zb=t,this.Hr.Gi(),this}getAmplitudeStart(){return this.zb}setAmplitudeEnd(t){return this.Vb=t,this.Hr.Gi(),this}getAmplitudeEnd(){return this.Vb}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.Hr.Gi(),this}getStrokeStyle(){return this.tn}gc(){const t=this.ub.wb(),e=180*this.ub.Fb()/Math.PI,i=void 0!==this.zb?wt(this.zb,t.start,t.end):t.start,s=void 0!==this.Vb?wt(this.Vb,t.start,t.end):t.end,r=this.ub.Ab()?i-t.start:t.start-i,n=this.ub.Ab()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.ub.Lb()?1:-1,l=Math.abs(this.Eb-this.Rb);this.Mp.ea((this.Rb-e)*a).ha((this.Eb-e)*a).aa(100*o/h).ra(h).As(this.jr).ir(this.tn).la(Math.ceil(l/2))}Au(t,e){t.zr(e),this.Hr.Gi()}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}}class la extends Jr{constructor(){super(...arguments),this.Gm=!0,this.Nb=!0}setAutoScrollingEnabled(t){return this.Gm=t,this.rl.Wi.Gi(),this}getAutoScrollingEnabled(){return this.Gm}jm(){}gc(){}Zm(){}setCursorEnabled(t){return this.Nb=t,this}getCursorEnabled(){return this.Nb}}class ua extends la{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Rx=ca,this.Hr=t,this.rl=e,this.scale=s}getAmplitudeMin(){return this.Gb?this.Gb.min:void 0}getAmplitudeMax(){return this.Gb?this.Gb.max:void 0}setCursorResultTableFormatter(t){return this.Rx=t,this.rl.Wi.Gi(),this}getCursorResultTableFormatter(){return this.Rx}setCursorEnabled(t){return super.setCursorEnabled(t)}}const ca=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),da=(t,e,i)=>t*(1-i)+e*i,fa=(t,e,i,s,r)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===r.value)return;const n=(t.x-i.point.x)/(r.point.x-i.point.x),o=(r.point.y-i.point.y)*n+i.point.y,h=(t.x-e.point.x)/(s.point.x-e.point.x),a=(s.point.y-e.point.y)*h+e.point.y,l=(t.y-a)/(o-a),u=da(i.value,r.value,n),c=da(e.value,s.value,h);return da(c,u,l)},ga=(t,e)=>{const i=[],s=e.wb().start,r=e.wb().end,n=e.Ab(),o=e.Lb()?1:-1,h=e.Fb(),a=Math.abs(r-s),l=Math.min(s,r)+.001*a,u=Math.max(s,r)-.001*a;for(const e of t){const t=wt(e.amplitude,l,u),r=e.angle*Math.PI/180-h,a=Math.cos(r*o)*(n?t-s:s-t),c=Math.sin(r*o)*(n?t-s:s-t),d=e.color;i.push({x:a,y:c,color:d})}return i},pa=t=>{const e={min:ke,max:we};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ma=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),ya=(t,e)=>{let i=li(t);for(e.Lb()||(i*=-1),i+=180*e.Fb()/Math.PI;i<0;)i+=360;i%=360;const s=Ke(t),r=e.wb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:da(r.start,r.end,s/n)}};class xa extends ua{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Su="Line Series",this.Wb=[],this.Hb=!1,this.Ub=!1,this.ca=de(this.fs.polarLineSeriesStrokeStyle,n),this.$b=t.Kp(s,void 0,[Co.UserSeries]).ua(this.ca).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.$b)}setData(t){return this.Wb=ma(t),this.Hb=!0,this.Gb=pa(this.Wb),this.Hr.Gi(),this}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;return this.$b.ua(e),this.Hr.Gi(),this}getStrokeStyle(){return this.ca}setConnectDataAutomaticallyEnabled(t){return this.Ub=t,this.Hr.Gi(),this}getConnectDataAutomaticallyEnabled(){return this.Ub}oe(){return this.Gm&&this.Wb.length>0&&this.getVisible()}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){return this.Yb(t,this.$b)}solveNearestFromScreen(t){return this.Yb(t,this.$b)}Yb(t,e){const i=e.Xb(t);if(!i)return;const{angle:s,amplitude:r}=ya(i,this.scale);return Wh(i,this.scale,this.Rx(new Ih,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,this.ca.getFillStyle())}gc(){if(this.Hb||this.scale.jb()){const t=ga(this.Wb,this.scale),e=Ve(t);this.Ub?(t.push({...t[0]}),this.$b.Eo(!0)):this.$b.Eo(!1),this.$b.no().xt(t).Rr(e),this.Hb=!1,this.$b.Zs()}}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{stroke:this.ca}),this}}class Sa extends ua{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Su="Point Line Series",this.Wb=[],this.Hb=!1,this.Ub=!1,this.Zb=3,this.dn=0,this.Kb=e.PointShape.Circle,this.jr=de(this.fs.polarPointLineSeriesFillStyle,o),this.ca=de(this.fs.polarPointLineSeriesStrokeStyle,o),this.$b=t.Kp(r,void 0,[Co.UserSeries]).ua(this.ca).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.$b),this.qb=t.aS(r).As(this.jr).so(this.Kb).q(this.Zb).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.qb)}setData(t){return this.Wb=ma(t),this.Hb=!0,this.Gb=pa(this.Wb),this.Hr.Gi(),this}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;return this.$b.ua(e),this.Hr.Gi(),this}getStrokeStyle(){return this.ca}setPointFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;return this.qb.As(e),this.Hr.Gi(),this}getPointFillStyle(){return this.jr}setPointSize(t){return this.Zb=t,this.qb.q(t),this.Hr.Gi(),this}getPointSize(){return this.Zb}setPointShape(t){return this.Kb=t,this.qb.so(this.Kb),this}getPointShape(){return this.Kb}setPointRotation(t){return this.dn=t,this.qb.Cs(t),this.Hr.Gi(),this}getPointRotation(){return this.dn}setConnectDataAutomaticallyEnabled(t){return this.Ub=t,this.Hr.Gi(),this}getConnectDataAutomaticallyEnabled(){return this.Ub}oe(){return this.Gm&&this.Wb.length>0&&this.getVisible()}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){return this.Yb(t,this.$b)}solveNearestFromScreen(t){return this.Yb(t,this.$b)}Yb(t,e){const i=e instanceof Vs?e.Ix(t):e.Xb(t);if(!i)return;const{angle:s,amplitude:r}=ya(i,this.scale);return Wh(i,this.scale,this.Rx(new Ih,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,"color"in i&&this.jr instanceof G?new L({color:i.color}):this.jr)}gc(){if(this.Hb||this.scale.jb()){const t=ga(this.Wb,this.scale),e=Ve(t);this.Ub?(t.push({...t[0]}),this.$b.Eo(!0)):this.$b.Eo(!1),this.$b.no().xt(t).Rr(e),this.qb.no().xt(t).Rr(e),this.Hb=!1,this.$b.Zs(),this.qb.Zs()}}}class va extends ua{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Su="Point Series",this.Wb=[],this.Hb=!1,this.Zb=3,this.dn=0,this.Kb=e.PointShape.Circle,this.jr=de(this.fs.polarPointSeriesFillStyle,o),this.qb=t.aS(r).As(this.jr).so(this.Kb).q(this.Zb).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.qb)}setData(t){return this.Wb=ma(t),this.Hb=!0,this.Gb=pa(this.Wb),this.Hr.Gi(),this}setPointFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;return this.qb.As(e),this.Hr.Gi(),this}getPointFillStyle(){return this.jr}setPointSize(t){return this.Zb=t,this.qb.q(t),this.Hr.Gi(),this}getPointSize(){return this.Zb}setPointShape(t){return this.Kb=t,this.qb.so(this.Kb),this}getPointShape(){return this.Kb}setPointRotation(t){return this.dn=t,this.qb.Cs(t),this.Hr.Gi(),this}getPointRotation(){return this.dn}oe(){return this.Gm&&this.Wb.length>0&&this.getVisible()}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){const i=this.qb.Ix(t);if(!i)return;const{angle:s,amplitude:r}=ya(i,this.scale);return Wh(i,this.scale,this.Rx(new Ih,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,"color"in i&&this.jr instanceof G?new L({color:i.color}):this.jr)}solveNearestFromScreen(t){return this.Ix(t,!1)}gc(){if(this.Hb||this.scale.jb()){const t=ga(this.Wb,this.scale),e=Ve(t);this.qb.no().xt(t).Rr(e),this.Hb=!1,this.qb.Zs()}}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr}),this}}class ba{constructor(t,e,i,s){this.P=new r.Eventer,this.Jb=!1,this.rl=t,this.Qb=e,this.lS=i,this.Gn=s}setGeometry(t){return this.tv=t,this.Jb=!0,this.rl.Wi.Gi(),this}getGeometry(){return this.tv}setMouseInteractions(t){return this.Gn.setMouseInteractions(t),this}dispose(){return this.Gn.dispose(),this.Qb(this),this.P.emit("dispose",this),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Gn.getVisible()!==t;return this.Gn.setVisible(t),e&&this.P.emit("visibleStateChanged",this,t),this.rl.Wi.Gi(),this}getVisible(){return this.Gn.getVisible()}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Ma=(t,e,i)=>{const s=e.ut,r=i.ut;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.eg&&(n=1-n),1===e.eg&&(o=1-o),u(o,n)};class Aa extends Fh{constructor(t,e,i,s,r,n,o,h,a){super(t,e,ao(i.ut,s.ut),r,n,a),this.sv=!1,this.ev=!1,this.hv=!0,this.rv=!0,this.nv=!1,this.ov=!1,this.setGridStrokeYStyle=t=>(this.av.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.av.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.lv=o,this.cv=h,this.uv=this.axisX.Ig(!1,this.lv).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.av=this.axisY.Ig(!1,this.cv).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.uv.dispose(),this.av.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(nt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.uv.setValue(t.x),this.av.setValue(t.y);const e=Ma(u(this.uv.getValue(),this.av.getValue()),this.axisX,this.axisY);return this.uv.setGridStrokeLength(this.nv?e.x:1),this.av.setGridStrokeLength(this.ov?e.y:1),this}gc(){this.uv.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.sv),this.av.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.ev);const t=Ma(u(this.uv.getValue(),this.av.getValue()),this.axisX,this.axisY);return this.uv.setGridStrokeLength(this.nv?t.x:1),this.av.setGridStrokeLength(this.ov?t.y:1),super.gc()}setGridStrokeXCut(t){return this.nv=t,this.Hr.Gi(),this}getGridStrokeXCut(){return this.nv}setGridStrokeYCut(t){return this.ov=t,this.Hr.Gi(),this}getGridStrokeYCut(){return this.ov}setGridStrokeXStyle(t){return this.uv.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.uv.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.sv=t,this.Hr.Gi(),this}getTickMarkerXVisible(){return this.sv}setTickMarkerYVisible(t){return this.ev=t,this.Hr.Gi(),this}getTickMarkerYVisible(){return this.ev}setTickMarkerX(t){return this.uv.setMarker(t),this}setTickMarkerY(t){return this.av.setMarker(t),this}getTickMarkerX(){return this.uv.getMarker()}getTickMarkerY(){return this.av.getMarker()}}class ka extends Oh{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.nv=!1,this.ov=!1,this.dv=!1,this.fv=!1,this.gv=new Map,this.pv=new Map,this.sv=!0,this.ev=!0,this.nx=s,this.ox=r,this.lv=n,this.cv=o,this.mv=h.cursorGridStrokeStyleX,this.Sv=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.gv.forEach((t=>t.dispose())),this.pv.forEach((t=>t.dispose())),this.yv=void 0,this.xv=void 0,this}gc(){return this.yv&&this.yv.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.sv),this.xv&&this.xv.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.ev),super.gc()}pointAt(t){const{location:e}=t,{series:i}=t,{axisX:s}=i,{axisY:r}=i,n=this.ts(s,!0),o=this.ts(r,!1);n!==this.yv&&this.yv&&this.yv.setVisible(!1),o!==this.xv&&this.xv&&this.xv.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=Ma(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.nv?h.x:1),o.setGridStrokeLength(this.ov?h.y:1),this.yv=n,this.xv=o,super.pointAt(t)}mx(t){if(super.mx(t),t){const e=e=>e.setTextFillStyle(t);this.yv&&this.dv&&this.yv.setMarker(e),this.xv&&this.fv&&this.xv.setMarker(e)}}ts(t,e){let i=(e?this.gv:this.pv).get(t);return i||(e?(i=t.Ig(!1,this.lv),this.gv.set(t,i)):(i=t.Ig(!1,this.cv),this.pv.set(t,i)),this.Ks(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}Ks(t,e){const i=e?this.mv:this.Sv;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.sv:this.ev)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.nv=t,this.Hr.Gi(),this}getGridStrokeXCut(){return this.nv}setGridStrokeYCut(t){return this.ov=t,this.Hr.Gi(),this}getGridStrokeYCut(){return this.ov}setGridStrokeXStyle(t){return this.mv=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.gv.forEach((t=>t.setGridStrokeStyle(this.mv))),this}getGridStrokeXStyle(){return this.mv}setGridStrokeYStyle(t){return this.Sv=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.pv.forEach((t=>t.setGridStrokeStyle(this.Sv))),this}getGridStrokeYStyle(){return this.Sv}setTickMarkerXVisible(t){return this.sv=t,this.Hr.Gi(),this}getTickMarkerXVisible(){return this.sv}setTickMarkerYVisible(t){return this.ev=t,this.Hr.Gi(),this}getTickMarkerYVisible(){return this.ev}setTickMarkerX(t){return this.gv.forEach((e=>e.setMarker(t))),this.lv=this.lv.addStyler(t),this.Hr.Gi(),this}setTickMarkerY(t){return this.pv.forEach((e=>e.setMarker(t))),this.cv=this.cv.addStyler(t),this.Hr.Gi(),this}setTickMarkerXAutoTextStyle(t){return this.dv=t,this.Hr.Gi(),this}getTickMarkerXAutoTextStyle(){return this.dv}setTickMarkerYAutoTextStyle(t){return this.fv=t,this.Hr.Gi(),this}getTickMarkerYAutoTextStyle(){return this.fv}}class wa extends Rh{constructor(t,e,i,s,r){super(t,e,r),this.nx=t,this.ox=e,this.lv=i,this.cv=s,this.Sx=r}}class Da extends wa{constructor(){super(...arguments),this.xx=(t,e,i,s)=>this.yx(new ka(t,e,i,this.nx,this.ox,this.lv,this.cv,s),s),this.addStyler=t=>new Da(this.nx,this.ox,this.lv,this.cv,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Da(t,this.ox,this.lv,this.cv,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Da(this.nx,t,this.lv,this.cv,this.Sx.map((t=>t)))}}class Ea extends wa{constructor(){super(...arguments),this.bx=(t,e,i,s,r)=>this.yx(new Aa(t,e,i,s,this.nx,this.ox,this.lv,this.cv,r),r),this.addStyler=t=>new Ea(this.nx,this.ox,this.lv,this.cv,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ea(t,this.ox,this.lv,this.cv,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Ea(this.nx,t,this.lv,this.cv,this.Sx.map((t=>t)))}}const Ta=new Da(xn,xn,io.PointableTextBox,io.PointableTextBox,[(t,e)=>{_h(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ia=new Ea(vn,xn,io.PointableTextBox,io.PointableTextBox,[(t,e)=>{Lh(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ca=(t,i,s)=>{switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return s;case e.UIVisibilityModes.whenHovered:return i&&!s;case e.UIVisibilityModes.whenHoveredOrDragged:return s||i;case e.UIVisibilityModes.whenNotDragged:return!s;default:return!1}},Pa=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Oa{constructor(t,i,s,n,o,h){this.bv=e.UIVisibilityModes.always,this.vv=e.UIVisibilityModes.always,this.kr=!0,this.xe=!1,this.Mv=!1,this._v=!1,this.an=u(0,0),this.hc=e.UIDraggingModes.draggable,this.rc=void 0,this.P=new r.Eventer,this.Ui=!0,this.Av=(t,i,s)=>{this.Mv=!0,this.Hr.Gi();const r=this.hc===e.UIDraggingModes.notDraggable?this.hc:s||this.hc;this.rc=this.Hr.Wi.Oe(r===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:r===e.UIDraggingModes.draggable?e.MouseStyles.Move:r===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.wv=()=>{this.Mv=!1,this.Hr.Gi(),this.Hr.Wi.Le(this.rc)},this.kv=(t,e)=>{this._v=!0,Zt(e),this.Hr.Gi()},this.Cv=(t,i)=>{if(this.hc!==e.UIDraggingModes.notDraggable){const s=i||this.hc,r=nt(this.Hr.Wi.Re(t.x,t.y),this.Hr.Wi.ut,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?Pa(r.x,this.scale.x):this.an.x,s!==e.UIDraggingModes.onlyHorizontal?Pa(r.y,this.scale.y):this.an.y);return this.setPosition(n),!0}return!1},this.Tv=(t,e)=>{this._v=!1,Zt(e),this.Hr.Gi()},this.onDispose=t=>this.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Hr=t,this.renderingScale=i,this.scale=s,this.Kx=n,this.Iv=o,this.fs=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.Av(t,e))),a.onMouseLeave(this.wv),a.onMouseDragStart(this.kv),a.onMouseDrag(((t,e)=>this.Cv(u(e.clientX,e.clientY))&&Zt(e))),a.onMouseDragStop(this.Tv),a.onTouchStart(this.kv),a.onTouchMove(((t,e)=>this.Cv(u(e.clientX,e.clientY))&&Zt(e))),a.onTouchEnd(this.Tv),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.an)}setPosition(t){return this.an=t,this.Kx.setPosition(t),this.P.emit("positionChange",this,this.an),this}getPosition(){return this.an}onPositionChange(t){return this.P.on("positionChange",t)}offPositionChange(t){return this.P.off(t,"positionChange")}setPointMarkerVisibility(t){return this.bv=t,this.Hr.Gi(),this}getPointMarkerVisibility(){return this.bv}setResultTableVisibility(t){return this.vv=t,this.Hr.Gi(),this}getResultTableVisibility(){return this.vv}setMouseInteractions(t){return this.kr=t,this.Kx.getPointMarker().setMouseInteractions(t),this.Kx.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.kr}setAutoFitStrategy(t){return this.Kx.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Kx.getAutoFitStrategy()}isAttached(){return!0}gc(){const t=this.isAttached();return Ca(this.bv,this.Mv,this._v)?this.Kx.setPointMarkerVisible(!0):this.Kx.setPointMarkerVisible(!1),t&&Ca(this.vv,this.Mv,this._v)?this.Kx.setResultTableVisible(!0):this.Kx.setResultTableVisible(!1),this.Kx.gc(),this}Zs(){return this.Kx.Zs(),this}pointAt(t){return this.Kx.pointAt(t),this}dispose(){return this.xe||(this.xe=!0,this.Iv(this),this.Kx.dispose(),this.P.emit("dispose")),this}setVisible(t){const e=this.Ui!==t;return this.Ui=t,this.Kx.setVisible(t),e&&this.P.emit("visibleStateChanged",this,this.Ui),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setPointMarker(t){return this.Kx.setPointMarker(t),this}getPointMarker(){return this.Kx.getPointMarker()}setResultTable(t){return this.Kx.setResultTable(t),this}getResultTable(){return this.Kx.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.hc=t,this.Hr.Gi(),this}getDraggingMode(){return this.hc}}class Fa extends Oa{constructor(t,i,s,r,n,o,h){super(t,i,ao(s.ut,r.ut),n.bx(t,i,s,r,h),o,h),this.Fv=e.UIVisibilityModes.always,this.Pv=e.UIVisibilityModes.always,this.Dv=e.UIVisibilityModes.always,this.Bv=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Kx.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Kx.getGridStrokeYStyle(),this.Hr=t,this.axisX=s,this.axisY=r,this.Iv=o;const a=this.Kx.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.Av(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.wv),a.onMouseDragStart(this.kv),a.onMouseDrag(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i))),a.onMouseDragStop(this.Tv),a.onTouchStart(this.kv),a.onTouchMove(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i)));const l=this.Kx.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.Av(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.wv),l.onMouseDragStart(this.kv),l.onMouseDrag(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i))),l.onMouseDragStop(this.Tv),l.onTouchStart(this.kv),l.onTouchMove(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i)))}gc(){const t=this.isAttached();return this.Ui&&t&&Ca(this.Dv,this.Mv,this._v)?this.Kx.setTickMarkerXVisible(!0):this.Kx.setTickMarkerXVisible(!1),this.Ui&&t&&Ca(this.Bv,this.Mv,this._v)?this.Kx.setTickMarkerYVisible(!0):this.Kx.setTickMarkerYVisible(!1),this.Kx.setGridStrokeXStyle(this.Ui&&t&&Ca(this.Fv,this.Mv,this._v)?this.gridStrokeStyleX:J),this.Kx.setGridStrokeYStyle(this.Ui&&t&&Ca(this.Pv,this.Mv,this._v)?this.gridStrokeStyleY:J),super.gc()}setGridStrokeXVisibility(t){return this.Fv=t,this.Hr.Gi(),this}getGridStrokeXVisibility(){return this.Fv}setGridStrokeYVisibility(t){return this.Pv=t,this.Hr.Gi(),this}getGridStrokeYVisibility(){return this.Pv}setTickMarkerXVisibility(t){return this.Dv=t,this.Hr.Gi(),this}getTickMarkerXVisibility(){return this.Dv}setTickMarkerYVisibility(t){return this.Bv=t,this.Hr.Gi(),this}getTickMarkerYVisibility(){return this.Bv}setGridStrokeXCut(t){return this.Kx.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Kx.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Kx.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Kx.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Kx.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Kx.getGridStrokeYStyle()}setTickMarkerX(t){return this.Kx.setTickMarkerX(t),this}getTickMarkerX(){return this.Kx.getTickMarkerX()}setTickMarkerY(t){return this.Kx.setTickMarkerY(t),this}getTickMarkerY(){return this.Kx.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Kx.getTickMarkerX().setMouseInteractions(t),this.Kx.getTickMarkerY().setMouseInteractions(t),this}}class Ra extends Fa{}class Ba extends Ra{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.Ov=!1,this.Hr=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.Ov=!1,this.Hr.Gi(),this}Zs(){if(!this.Ov){const t=this.owningSeries.solveNearestFromScreen(nt(this.an,this.scale,this.Hr.Wi.ut));t?(this.an=nt(t.location,this.owningSeries.scale,this.scale),this.Kx.pointAt(t),this.Ov=!0):this.Kx.setPosition(this.an)}return super.Zs()}isAttached(){return this.Ov}}class za extends la{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Lv=[],this.addMarker=(t=Ia)=>{const e=new Ba(this.Rv(),this.rl.uiScale,this,t,this.removeMarker,this.fs);return this.Lv.push(e),e},this.removeMarker=t=>{const e=this.Lv.indexOf(t);-1!==e&&this.Lv.splice(e,1)},this.be=new Map,this.chart=t,this.Hr=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.Rv=h,this.scale=ao(s.ut,r.ut),this.Ev=t.zv,t.zv+=1,this.Vv(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.Nv),this.onMouseLeave(this.chart.Gv),this.onMouseWheel(this.chart.Hm),this.onMouseDragStart(this.chart.Wv),this.onMouseDrag(this.chart.Um),this.onMouseDragStop(this.chart.Hv),this.onTouchStart(this.chart.$m.onTouchStart),this.onTouchMove(this.chart.$m.onTouchMove),this.onTouchEnd(this.chart.$m.onTouchEnd)}attacheAxis(){this.Uv=this.axisXAttachHandler(this),this.$v=this.axisYAttachHandler(this)}gc(){super.gc();for(let t=0;t{e.$r(this.Ev)})),this.rl.Wi.Gi(),this}dispose(){return super.dispose(),this.Lv.slice().forEach((t=>t.dispose())),this.Uv(this),this.$v(this),this}Yv(){for(let t=0;t{const r=t.length;let n=0;if(void 0!==e){const r=i-e;if(r>0){const e=t.slice(n,r);n+=r,s(e,!0)}}for(;nt))=>{const i=[];let s;for(let r=0;r{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class Na extends za{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.Xv=[],this.xa=[],this.jv=0,this.Sh=!1,this.Gc=e.HighlightModes.onHover,this.Rx=Va,this.Zv=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.jv=void 0!==e&&e>0?e:0,this.Hr.Gi(),this}add(t){if(Array.isArray(t)?this.Kv(t):this.Kv([t]),this.xa.length>0){const t=this.xa[this.xa.length-1];this.qv={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.qv?this.qv.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.oo()+e.ao()),this.xa.length)}clear(){this.Jv=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.Zv.getXMax(this.Xv,this.Jv)||0}getXMin(){return this.Zv.getXMin(this.Xv,this.Jv)||0}getYMax(){return this.Zv.getYMax(this.Xv,this.Jv)||0}getYMin(){return this.Zv.getYMin(this.Xv,this.Jv)||0}Jp(){const t=u(0,0);for(const e of this.Xv)t.x=Math.max(t.x,e.bo()),t.y=Math.max(t.y,e.vo());return t}Qv(t,e,i,s){this.Zv.Qv(t,e,i,s,this.scale,(t=>{this.mu(t)}))}jm(){super.jm();const t=this.Xv.length;this.tM&&this.Qv(this.Xv,this.getPointAmount(),this.tM,this.jv),t!==this.Xv.length&&this.Yv()}gc(){super.gc();const t=this.getBoundaries();this.xa.length>0&&(this.iM(this.xa),this.xa=[]);for(const e of this.Xv)e.Rr(t);return super.gc()}Zm(){super.Zm(),this.Jv=void 0,this.xa.length=0}Kv(t){0!==t.length&&(this.Jv?this.Jv=We(this.Jv,Ve(t)):this.Jv=Ve(t),this.P.emit("dataAdd",this,t,this.Jv),this.xa=re(this.xa,t,{canReturnB:!1}),this.Hr.Gi())}sM(){return La(this.Xv)}eM(t){return this.P.on("dataAdd",t)}hM(t){return this.P.off(t)}rM(t){return this.P.on("dataClear",t)}nM(t){return this.P.off(t)}}const Wa=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.aM.indexOf(t);e>=0&&this.aM.splice(e,1);const i=this.oM.findIndex((e=>e===t.Gn));i>=0&&this.oM.splice(i,1),this.mu(t.Gn),this.Hr.Gi()},this.jr=de(this.fs.polarPolygonSeriesFillStyle,n),this.tn=de(this.fs.polarPolygonSeriesStrokeStyle,n)}addPolygon(){const t=new ba(this.rl,this.lM,this,this.cM());return this.aM.push(t),t}setFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;for(const t of this.oM)t.As(e);return this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){this.tn="function"==typeof t?t(this.tn):t;const e=this.tn;for(const t of this.oM)t.ir(e);return this.Hr.Gi(),this}getStrokeStyle(){return this.tn}oe(){return this.Gm&&void 0!==this.aM.find((t=>void 0!==t.uM))&&this.getVisible()}gc(){this.aM.forEach((t=>{(t.Jb||this.scale.jb())&&t.dM&&(t.Gn.yo(ga(t.dM,this.scale)),t.Jb=!1,t.Gn.Zs())}))}jm(){super.jm();const t=p(ke,we);this.aM.forEach((e=>{if(!e.tv)return;const i=!e.Jb&&e.dM?e.dM:ma(e.tv);e.dM=i;const s=!e.Jb&&e.uM?e.uM:pa(i);e.uM=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Gb=t}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){const i=Wa(t,this.oM,((t,e)=>{const i=t.Ix(e);if(i)return nt(i,this.scale,t.Wi.ut)}),Be);if(!i)return;const s=nt(i[0],i[1].Wi.ut,this.scale),r=this.fM(i[1]);if(!r)return;const{angle:n,amplitude:o}=ya(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.Rx(new Ih,this,n,o,this.rl.getAmplitudeAxis().formatValue).Lc(),series:this,fillStyle:this.jr,polarPolygon:r}}solveNearestFromScreen(t){return this.Ix(t,!1)}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}cM(){const t=this.Hr.Iu(this.scale,js.Simple).As(this.jr).ir(this.tn).zr(this.getHighlight());return this.oM.push(t),this.gu(t),t}fM(t){return this.aM.find((e=>e.Gn===t))}}class Ua extends ua{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Su="Area Series",this.Wb=[],this.Hb=!1,this.Ub=!1,this.gM=!1,this.jr=de(this.fs.polarAreaSeriesFillStyle,n),this.tn=de(this.fs.polarAreaSeriesStrokeStyle,n)}setData(t){const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}}class Xa extends Ua{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.pM=this.Hr.Iu(this.scale,js.Simple).zr(this.getHighlight()),this.gu(this.pM)}gc(){if(this.Hb||this.scale.jb()){const t=this.Wb,e=!0===this.Ub?ga(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(kt(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let r=0;const n=[];for(let t=i.angle+s;!kt(t%360,e.angle%360);t+=s)if(n.push({angle:t,amplitude:0}),r+=1,r>360)return[];for(let t=0;t=this.mM.start}Bb(t){this.SM=t,this.MM=!0}Lb(){return!1===this.SM}Ob(t){this.yM=t,this.MM=!0}Fb(){return this.yM}oi(){return!1}nt(t,e,i,s){return this.x=new wi(t.x,e.x,i.x,s?s.x:void 0),this.y=new wi(t.y,e.y,i.y,s?s.y:void 0),this}si(){return this.Kt}jb(){return this.vM}wM(){return this.MM}_i(){return this.ii}wi(){return this._M}X(){return this.o=!1,this.ii=!1,this.vM=!1,this.MM=!1,this}j(){return this.o=!0,this.ii=!0,this.vM=!0,this.MM=!0,this}q(t,e){return"object"==typeof t?(this.Y.x=t.x,this.Y.y=t.y):(this.Y.x=t,this.Y.y=e),this.AM(),this}xi(t){return this.xM=t,this.AM(),this}bi(t){return this.bM=t,this.AM(),this}Ut(){return u(this.xM[0]+this.xM[1],this.bM[0]+this.bM[1])}$t(){return this.Y}AM(){const t=this.mM,e=u(this.x.Yt(this.Y.x),this.y.Yt(this.Y.y)),i=this.xM[0]+this.xM[1],s=this.bM[0]+this.bM[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.xM[0]+Math.max((r-2*o)/2,0),this.xM[1]+Math.max((r-2*o)/2,0)],a=[this.bM[0]+Math.max((n-2*o)/2,0),this.bM[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.Y.x).Nt(h).Z(-l,l),this.y.q(this.Y.y).Nt(a).Z(-l,l),this._M={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Kt={x:this.x.si(),y:this.y.si()},this.j()}ti(t,e){const i=this.wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}ki(t,e,i,s){const r=this.wi(),n=qe(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Ya extends Kh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("polarChart bg",0),r,i.Wi.fs.polarChartBackgroundFillStyle,i.Wi.fs.polarChartBackgroundStrokeStyle,i.Wi.fs.polarChartTitleFont,i.Wi.fs.polarChartTitleFillStyle,h),this.vx=e.AutoCursorModes.snapToClosest,this.Jd=[],this.kr=!0,this.kM=(t,e,i,s,r)=>{this.ub.q(s,r)},this.if=Jt(this.Jd),this.CM=t=>{this.Jd.push(t)},this.TM=()=>this.lS,this.uf.Oh||this.uf.Bh||this.Wi.Ph(4),this.IM=i.ky("polarChart series bg",0),this.FM=i.Vp("polarChart axis gridlines",0),this.PM=i.Vp("polarChart series",1),this.DM=i.Vp("polarChart axis lines",2),this.BM=i.Vp("polarChart axis ticks",3),this.ub=s.d2({scaleXYConstructor:ja}),this.onResize(this.kM),this.hp.Ms("Polar Chart");const a=Pt(o?o.autoCursorBuilder:void 0,Vh);this.Tx=a.xx(this._x,this.uiScale,this.uiScale,this.fs),this.mS=this.IM.Ou(this.ub).As(this.fs.polarChartSeriesBackgroundFillStyle).ir(J).ea(0).ha(360).aa(0),this.SS=this.IM.Ou(this.ub).As(B).ir(this.fs.polarChartSeriesBackgroundStrokeStyle).ea(0).ha(360).aa(0),super.pS(this.mS,this.SS),this.Qg(n,this.pixelScale),this.OM=new sa(this,this.ub,this.fs,!(!o||!0!==o.disableAnimations),this.FM,this.DM,this.BM,this.cc,this.TM),this.LM=new na(this,this.ub,this.fs,!(!o||!0!==o.disableAnimations),this.FM,this.DM,this.BM,this.cc),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1)}addLineSeries(t){const e=new xa(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPointSeries(t){const e=new va(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPointLineSeries(t){const e=new Sa(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addAreaSeries(t){const e=new Xa(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPolygonSeries(t){const e=new Ha(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}getSeries(){return this.lS}addSector(){const t=new aa(this.PM,this,this.if,this.ub,this.fs,this.Wi.cc);return this.CM(t),t}getAmplitudeAxis(){return this.OM}getRadialAxis(){return this.LM}gc(){var t,e;super.gc(),xo.lp(this.hp,this.ip);for(const t of this.lS)t.jm();this.OM.de(),this.LM.de();for(const t of this.lS)t.gc();for(let t=1;t<=2;t+=1){const e=this.OM.gc(),i=this.LM.gc(),s=xo.ap(this.hp,this.ip),r=[this.pn.left+i,this.pn.right+i],n=[this.pn.bottom+i,this.pn.top+i+s];this.ub.xi(r).bi(n);const o=4;if(!(!this.RM||Math.abs(this.RM.amplitude-e)>=o||Math.abs(this.RM.radial-i)>=o)||1!==t){this.RM={amplitude:e,radial:i};break}}const i=this.ub.wb().start,s=this.ub.wb().end,r=this.ub.Ab()?((null===(t=this.RM)||void 0===t?void 0:t.radial)||0)*this.ub.x.getPixelSize()+s-i:((null===(e=this.RM)||void 0===e?void 0:e.radial)||0)*this.ub.x.getPixelSize()+i-s;this.mS.ra(r).la(360),this.SS.ra(r).la(360);for(const t of this.Jd)t.gc();this.Fx(!1);for(const t of this.lS)t.Zm();return super.Jg(),this.EM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.OM.setAnimationsEnabled(t),this.LM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.kr=t,this}getMouseInteractions(){return this.kr}getMinimumSize(){return u($a,$a)}EM(){}forEachAxis(t){return t(this.OM),t(this.LM),this}dispose(){return this.IM.G(),this.FM.G(),this.PM.G(),this.DM.G(),this.BM.G(),this.Jd.slice().forEach((t=>t.dispose())),super.dispose()}xd(){return[...this.lS,...this.Jd]}}const $a=300;class Za extends Mo{}class qa extends Za{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Su="Slice",this.u=0,this.cp=!1,this.zM=B,this.dp=B,this.fp=this.u,this.mp=U((()=>this.rl.Wi.Gi())),this.yp=()=>{this.xp=void 0},this.index=t,this.rl=s,this.scale=r,this.cu=n,this.pM=e.Iu(r,js.Simple).zr(this.getHighlight()),this.gu(this.pM),this.Pi=i.ye(r).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0})}setValue(t){return this.rl.getAnimationsEnabled()?this.getVisible()&&this._p(this.fp,t):this.fp=t,this.u=t,this.rl.Wi.Gi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?(this.xp&&(this.xp.finish(!1),this.xp=void 0),this._p(this.fp,0,(()=>super.setVisible(!1)))):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(this.xp&&(this.xp.finish(!1),this.xp=void 0),super.setVisible(!0),this._p(this.fp,this.u)):(this.fp=this.u,super.setVisible(!0)),this}_p(t,e,i){this.xp=this.mp(300,W.ease)([[t,e]],(([t])=>{this.fp=t,this.rl.Wi.Gi()})),this.xp.onEveryAnimationEnd(this.yp),i&&this.xp.onAnimationEnd(i)}setStyle(t,e,i,s){this.zM=t,this.dp=i,this.pM.As(this.zM).ir(e),this.Pi.As(this.dp).ks(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Qa=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Ja(i,r.x),s=Ja(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},p={x:0,y:n.bottom},m=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:p.x-x*o,y:p.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},p={x:a+v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&p.x>g.x&&y.pM.yo([g,d,f,p])}};class tl extends yo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("funnelChart bg",0),r,i.Wi.fs.funnelChartBackgroundFillStyle,i.Wi.fs.funnelChartBackgroundStrokeStyle,i.Wi.fs.funnelChartTitleFont,i.Wi.fs.funnelChartTitleFillStyle,o),this.Ap=[],this.wp=vo.None,this.Tp=!0,this.Pp=0,this.VM=80,this.NM=20,this.GM=0,this.WM=e.FunnelSliceModes.VariableHeight,this.Op=!0,this.Rp=t=>{const e=this.Ap.indexOf(t);e>=0&&(this.Ap.splice(e,1),this.Ep())},this.uf.Oh||this.uf.Bh||this.Wi.Ph(5),this.Lp=this.fs.effectsText,this.zp=i.Vp("funnelChart bottom",0),this.Np=i.Vp("funnelChart top",1),this.hp.Ms("Funnel Chart"),this.kp=this.fs.funnelChartSliceFillStylePalette,this.Cp=this.fs.funnelChartSliceStrokeStyle,this.Ip=this.fs.funnelChartSliceLabelFont,this.Fp=this.fs.funnelChartSliceLabelFillStyle,h&&this.setAnimationsEnabled(!1),this.Qg(n,this.pixelScale)}addSlice(t,e){const i=new qa(this.Pp,this.zp,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);return this.Pp+=1,i.setName(t),i.setValue(e),i.cc.du.Is(this.Lp),i.cc.fu.Is(this.Op),this.Ap.push(i),this.Wi.Gi(),i.setHighlightOnHover(this.Tp),i}addSlices(t){const e=[];for(let i=0;ie.cc.fu.Is(t))),this.Wi.Gi(),this}getSliceEffect(){return this.Op}setSliceSorter(t){return this.wp=t,this.Ap=this.Ap.sort(this.wp),this.Wi.Gi(),this}getSliceSorter(){return this.wp}setLabelFillStyle(t){return this.Fp="function"==typeof t?t(this.Fp):t,this.Wi.Gi(),this}getLabelFillStyle(){return this.Fp}setLabelFont(t){return this.Ip="function"==typeof t?t(this.Ip):t,this.Wi.Gi(),this}getLabelFont(){return this.Ip}setLabelEffect(t){return this.Lp=t,this.Ap.forEach((e=>e.cc.du.Is(t))),this.Wi.Gi(),this}getLabelEffect(){return this.Lp}setLabelFormatter(t){return this.Wp=t,this.Wi.Gi(),this}getLabelFormatter(){return this.Wp}setSliceHighlightOnHover(t){return this.Tp=t,this.Ap.forEach((e=>e.setHighlightOnHover(t))),this}gc(){super.gc(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.ap(this.hp,this.ip),e=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+t)),i=u(this.pn.left+e.x/2,this.pn.bottom+e.y/2);this.Ap=this.Ap.sort(this.wp);for(let t=0,{length:e}=this.Ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),super.dispose()}}const el=(t,i,s)=>{const r=t.xo();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.FunnelLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},il=t=>{const e=t.xo();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class sl extends tl{constructor(){super(...arguments),this.Wp=bo.NamePlusValue,this.$p=10,this.HM=e.FunnelLabelSide.Left,this.UM=e.SliceLabelIndices.LabelsOnSides,this.Xp=[],this.jp=this.fs.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.jp=t;for(let t=0;t{const e=this.Ap.indexOf(t);e>=0&&this.Ap.splice(e,1)},this.uf.Oh||this.uf.Bh||this.Wi.Ph(6),this.Hr=e.Vp("gaugeChart layer",0),this.Np=e.Vp("gaugeChart top layer",1),this.hp.Ms("Gauge Chart"),this.Qg(r,this.pixelScale);const h=_r();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}dispose(){return this.Hr.G(),this.Np.G(),this.Ap.slice().forEach((t=>t.dispose())),super.dispose()}}class ll extends al{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Xo=90,this.jo=-270,this.XM={min:this.Xo,max:this.jo},this.jM=U((()=>this.Hr.Gi())),this.ZM=()=>{this.KM=void 0},this.qM=e.Vp("radialGaugeChart bg arc",2),this.JM=this.Hr.Ou(this.pixelScale).As(this.fs.gaugeChartEmptyGaugeFillStyle).ir(this.fs.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.Xo,s=this.jo,r=this.XM;return this.getAnimationsEnabled()?this.QM(r,{min:t,max:e}):(r.min=t,r.max=e,this.Xo=t,this.jo=e),this.P.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.Wi.Gi(),this}getAngleInterval(){return{min:this.Xo,max:this.jo}}setGaugeFillStyle(t){return this.JM.As(t),this.Wi.Gi(),this}setGaugeStrokeStyle(t){return this.JM.ir(t),this.Wi.Gi(),this}QM(t,e,i){this.KM=this.jM(1e3,W.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.XM={min:t,max:e},this.Xo=t,this.jo=e,this.Hr.Gi()})),this.KM.onEveryAnimationEnd(this.ZM),i&&this.KM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.P.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.P.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.qM.G(),this}}class ul extends Mo{t_(t){return this.P.on("valueChange",t)}i_(t){return this.P.on("valueIntervalChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}offIntervalChange(t){return this.P.off(t,"valueIntervalChange")}attach(t,e=!0){return super.attach(t,e),this.styleAttachedEntry(t),this}styleAttachedEntry(t){ae(t,this.fs,{fill:this.s_})}}class cl extends ul{onValueChange(t){return this.t_(t)}onIntervalChange(t){return this.i_(t)}}class dl extends cl{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.Xo=0,this.jo=0,this.e_=0,this.h_=0,this.r_=0,this.n_=100,this.o_=!0,this.fp=this.u,this.pp=this.getVisible(),this.mp=Se(),this.a_=t=>{this.fp=t,this.rl.Wi.Gi()},this.l_=t,this.ve=e,this.rl=i,this.scale=s,this.s_=this.fs.gaugeChartGaugeFillStyle,this.Mp=t.Ou(s).As(this.s_).ir(J).zr(this.getHighlight()),this.gu(this.Mp),this.c_=e.ye(s).zr(this.getHighlight()),this.gu(this.c_,{isText:!0}),this.u_=e.ye(s).zr(this.getHighlight()),this.gu(this.u_,{isText:!0}),this.Pi=e.ye(s).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0}),this.c_.As(n.gaugeChartIntervalLabelsFillStyle).ks(n.gaugeChartIntervalLabelsFont),this.u_.As(n.gaugeChartIntervalLabelsFillStyle).ks(n.gaugeChartIntervalLabelsFont),this.Pi.As(n.gaugeChartValueLabelFillStyle).ks(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}gc(){const t=this.rl.getDataLabelFormatter(),e=this.Xo/90r&&(i=r);const n=this.jo-e*this.h_,o=this.Xo+e*this.e_,h=this.n_-this.r_,a=(0!==h?(n-o)/h:1/0)*(i-this.r_);this.Mp.ea(o).ha(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Pi.Ms(l)}d_(){const t=this.rl.getIntervalLabelFormatter(),e="function"==typeof t?t(this.r_,{getInnerStart:()=>this.r_,getInnerEnd:()=>this.n_}):t.format(this.r_);return this.c_.Ms(e).Zs(),this.c_.$t()}f_(){const t=this.rl.getIntervalLabelFormatter(),e="function"==typeof t?t(this.n_,{getInnerStart:()=>this.r_,getInnerEnd:()=>this.n_}):t.format(this.n_);return this.u_.Ms(e).Zs(),this.u_.$t()}setName(t){return super.setName(t),this.rl.Wi.Gi(),this}setValue(t){const e=this.u;return this.rl.getAnimationsEnabled()?this.pp&&this.mp(e,t,this.a_):this.fp=t,this.u=t,this.P.emit("valueChange",this,e,t),this.rl.Wi.Gi(),this}getValue(){return this.u}setVisible(t){return this.pp=t,!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?this.mp(this.fp,0,this.a_,{onCompleted:()=>super.setVisible(!1)}):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(super.setVisible(!0),this.mp(this.fp,this.u,this.a_)):(this.fp=this.u,super.setVisible(!0)),this}setInterval(t,e){const i=this.r_,s=this.n_;return this.P.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.r_=t,this.n_=e,this.rl.Wi.Gi(),this}setIntervalLabelsFont(t){return this.c_.ks(t),this.u_.ks(t),this.rl.Wi.Gi(),this}getIntervalLabelsFont(){return this.c_.ws()}setIntervalLabelsFillStyle(t){return this.c_.As(t),this.u_.As(t),this.rl.Wi.Gi(),this}getIntervalLabelsFillStyle(){return this.c_._s()}setIntervalLabelsVisible(t){return t?(this.c_.setVisible(!0),this.u_.setVisible(!0)):(this.c_.setVisible(!1),this.u_.setVisible(!1)),this.o_=t,this}getIntervalLabelsVisible(){return this.o_}setAngleInterval(t,e){return this.Xo=t,this.jo=e,this.rl.Wi.Gi(),this}setMinAngle(t){return this.Xo=t,this.rl.Wi.Gi(),this}setMaxAngle(t){return this.jo=t,this.rl.Wi.Gi(),this}setMarginInDegrees(t=this.e_,e=this.h_){return t!==this.e_&&(this.e_=t),e!==this.h_&&(this.h_=e),this.rl.Wi.Gi(),this}setFillStyle(t){this.s_="function"==typeof t?t(this.s_):t;const e=this.s_;this.Mp.As(e);for(let t=0;tr?25*s:25*r))){const o=Array(n+2),h=Math.PI;let a=0,l=0;const c=e*h/180,d=(i*h/180-c)/n;for(o[a]=u(t.x,t.y),a+=1;a<=n+1;)o[a]=u(t.x+s*Math.cos(c+l*d),t.y+r*Math.sin(c+l*d)),a+=1,l+=1;return[o,n]}class gl extends ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.od=20,this.m_=new Intl.NumberFormat,this.S_=new Intl.NumberFormat,this.y_=!1,this.x_=5;const h=new dl(this.Hr,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);this.b_=h,this.Ap.push(h),this.setPadding(10)}gc(){super.gc(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.ap(this.hp,this.ip),e=Ve([this.b_.d_(),this.b_.f_()]),i=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right+2*e.max.x),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+1*e.max.y+t)),s=Math.max(.5*Math.min(i.x,i.y),0),r=u(this.pn.left+e.max.x+.5*i.x,this.pn.bottom+e.max.y+.5*i.y),n=this.y_?this.v_(r,s):r,o=this.JM.tn.getThickness(),h=s-.5*o,a=s-this.od;let l=a/s*100;l=l>100||l<0?99:l;const c=100*(1-(this.od-o)/s);this.M_(n,a)&&(this.JM.ra(s).aa(l),this.b_.Mp.ra(h).aa(c));const d=.5*(f=s,(g=this.jo-this.Xo)/(2*Math.PI*f*(g/360))*o);var f,g;this.JM.ea(this.Xo).ha(this.jo).Cn(n),this.b_.Mp.Cn(n),this.b_.Pi.Cn(n),this.ld&&this.b_.setFillStyle(new L({color:this.ld.getColors(this.b_.getAnimatedValue())})),this.b_.setMinAngle(this.Xo).setMaxAngle(this.jo).setMarginInDegrees(d,d).gc();const p=this.JM.Zo();if(this.b_.getIntervalLabelsVisible()){this.__(this.Xo,this.jo,n,p+this.x_);const t=this.b_.c_.Zs().Fi(),e=this.b_.u_.Zs().Fi();Ce(t,e)&&this.A_(t,e,n,p+this.x_)}}M_(t,e){const i=Je(this.b_.Pi.Zs().$t(),.5),s=t.x+e,r=t.x-e,n=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xn||t.y-i.y=0?i=-s:s=-i),[i,s]}v_(t,e){const[i]=fl(t,this.Xo,this.jo,e,e),s=Ve(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return Qe(ti(t,u(s.min.x+r,s.min.y+n)),t)}__(t,e,i,s){const r=hi(t),n=hi(e);this.b_.c_.Cn(Ye(u(i.x+s,i.y),i,-r)),this.b_.u_.Cn(Ye(u(i.x+s,i.y),i,-n)),this.b_.c_.Ln(u(-Math.cos(r),-Math.sin(r))),this.b_.u_.Ln(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.b_}setAutoScaling(t){return this.y_=t,this.Wi.Gi(),this}getAutoScaling(){return this.y_}setDataLabelFormatter(t){return this.S_=t,this.Wi.Gi(),this}getDataLabelFormatter(){return this.S_}setIntervalLabelFormatter(t){return this.m_=t,this.Wi.Gi(),this}getIntervalLabelFormatter(){return this.m_}setIntervalLabelPadding(t){return this.x_=t,this.Wi.Gi(),this}getIntervalLabelPadding(){return this.x_}setThickness(t){return this.od=t,this}setLUT(t){return this.ld=t,this.Wi.Gi(),this}setDataLabelFont(t){return this.b_.Pi.ks(t),this.Wi.Gi(),this}getDataLabelFont(){return this.b_.Pi.ws()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.b_.g_(t),this.Wi.Gi(),this}getDataLabelFillStyle(){return this.b_.p_()}xd(){return this.Ap}dispose(){return this.b_.dispose(),super.dispose()}}class pl extends Mo{}class ml extends pl{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Su="Slice",this.u=0,this.cp=!1,this.zM=B,this.dp=B,this.fp=this.u,this.mp=U((()=>this.rl.Wi.Gi())),this.yp=()=>{this.xp=void 0},this.index=t,this.rl=s,this.scale=r,this.cu=n,this.pM=e.Iu(r,js.Simple).zr(this.getHighlight()),this.gu(this.pM),this.Pi=i.ye(r).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0})}setValue(t){return this.rl.getAnimationsEnabled()?this.getVisible()&&this._p(this.fp,t):this.fp=t,this.u=t,this.rl.Wi.Gi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?(this.xp&&(this.xp.finish(!1),this.xp=void 0),this._p(this.fp,0,(()=>super.setVisible(!1)))):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(this.xp&&(this.xp.finish(!1),this.xp=void 0),super.setVisible(!0),this._p(this.fp,this.u)):(this.fp=this.u,super.setVisible(!0)),this}_p(t,e,i){this.xp=this.mp(300,W.ease)([[t,e]],(([t])=>{this.fp=t,this.rl.Wi.Gi()})),this.xp.onEveryAnimationEnd(this.yp),i&&this.xp.onAnimationEnd(i)}setStyle(t,e,i,s){this.zM=t,this.dp=i,this.pM.As(this.zM).ir(e),this.Pi.As(this.dp).ks(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},xl=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=yl(i,r.x),s=yl(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},p={x:0,y:n.bottom},m=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:p.x-x*o,y:p.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},p={x:a+v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&p.x>=g.x&&y.pM.yo([g,d,f,p])}};class Sl extends yo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("pyramidChart bg",0),r,i.Wi.fs.pyramidChartBackgroundFillStyle,i.Wi.fs.pyramidChartBackgroundStrokeStyle,i.Wi.fs.pyramidChartTitleFont,i.Wi.fs.pyramidChartTitleFillStyle,o),this.Ap=[],this.wp=vo.None,this.kp=this.fs.pyramidChartSliceFillStylePalette,this.Cp=this.fs.pyramidChartSliceStrokeStyle,this.Tp=!0,this.Ip=this.fs.pyramidChartSliceLabelFont,this.Fp=this.fs.pyramidChartSliceLabelFillStyle,this.Pp=0,this.VM=0,this.NM=80,this.GM=0,this.WM=e.PyramidSliceModes.VariableHeight,this.Op=!0,this.Rp=t=>{const e=this.Ap.indexOf(t);e>=0&&(this.Ap.splice(e,1),this.Ep())},this.uf.Oh||this.uf.Bh||this.Wi.Ph(8),this.Lp=this.fs.effectsText,this.zp=i.Vp("pyramidChart bottom",0),this.Np=i.Vp("pyramidChart top",1),this.hp.Ms("Pyramid Chart"),h&&this.setAnimationsEnabled(!1),this.Qg(n,this.pixelScale)}addSlice(t,e){const i=new ml(this.Pp,this.zp,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);return this.Pp+=1,i.setName(t),i.setValue(e),i.cc.du.Is(this.Lp),i.cc.fu.Is(this.Op),this.Ap.push(i),this.Wi.Gi(),i}addSlices(t){const e=[];for(let i=0;ie.cc.fu.Is(t))),this.Wi.Gi(),this}getSliceEffect(){return this.Op}setSliceSorter(t){return this.wp=t,this.Ap=this.Ap.sort(this.wp),this.Wi.Gi(),this}getSliceSorter(){return this.wp}setLabelFillStyle(t){return this.Fp="function"==typeof t?t(this.Fp):t,this.Wi.Gi(),this}getLabelFillStyle(){return this.Fp}setLabelFont(t){return this.Ip="function"==typeof t?t(this.Ip):t,this.Wi.Gi(),this}getLabelFont(){return this.Ip}setLabelEffect(t){return this.Lp=t,this.Ap.forEach((e=>e.cc.du.Is(t))),this.Wi.Gi(),this}getLabelEffect(){return this.Lp}setLabelFormatter(t){return this.Wp=t,this.Wi.Gi(),this}getLabelFormatter(){return this.Wp}setSliceHighlightOnHover(t){return this.Tp=t,this.Ap.forEach((e=>e.setHighlightOnHover(t))),this}gc(){super.gc(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.ap(this.hp,this.ip),e=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+t)),i=u(this.pn.left+e.x/2,this.pn.bottom+e.y/2);this.Ap=this.Ap.sort(this.wp);for(let t=0,{length:e}=this.Ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),super.dispose()}}const vl=(t,i,s)=>{const r=t.xo();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.PyramidLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},bl=t=>{const e=t.xo();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Ml extends Sl{constructor(){super(...arguments),this.Wp=bo.NamePlusValue,this.$p=10,this.HM=e.PyramidLabelSide.Left,this.UM=e.SliceLabelIndices.LabelsOnSides,this.Xp=[],this.jp=this.fs.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.jp=t;for(let t=0;t(t.alignmentX=(r+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=r%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(r)*n,t.paddingY=Math.sin(r)*n,t),El=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Tl;e.SpiderWebMode=void 0,(Tl=e.SpiderWebMode||(e.SpiderWebMode={}))[Tl.Normal=0]="Normal",Tl[Tl.Circle=1]="Circle";class Il{constructor(t,e,i,s,n,o,h,a){this.P=new r.Eventer,this.k_=t,this.ve=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.C_=h,this.T_=a,this.I_=this.k_.Bc(this.scale).setMouseInteractions(!1),this.F_=this.ve.ye(this.scale).Ms(this.tag).setMouseInteractions(!1),this.P_=this.C_(this,this.ve.Kp(this.scale,void 0,[Co.InternalUI])).ua(this.chart.getNibStyle()),this.T_.pu([this.F_])}Hp(t,i,s,r,n,o,h){const a=i.length,l=i[s>0?s-1:a-1],c=i[s],d=i[s{const n=s/i,o=[];for(let h=-s/2;h<=s/2;h+=r){const r=n*(h/s)+e,a=u(t.x+Math.cos(r)*i,t.y+Math.sin(r)*i);o.push(a)}return o})(t,r,n,f)),h?this.F_.setVisible(!0).Cn(Qe(c,u(h.paddingX,h.paddingY))).Pn(h.alignmentX).Bn(h.alignmentY):this.F_.setVisible(!1)}getLabelSize(){return this.F_.ks(this.chart.getAxisLabelFont()).As(this.chart.getAxisLabelStyle()).Zs().$t()}dispose(){this.I_&&this.I_.dispose(),this.F_&&this.F_.dispose(),this.P_&&this.P_.dispose()}}const Cl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class Pl extends la{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Su="Spider Series",this.xa=new Map,this.Gc=e.HighlightModes.onHover,this.Rx=Cl,this.Zb=8,this.dn=0,this.D_=Se(),this.B_={},this.O_={},this.pp=this.getVisible(),this.L_=1,this.R_=((t,e)=>{const i=U((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||W.ease,u=(null==a?void 0:a.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?h&&n?(s=i(u,l)([[n,0]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(n=0,e(!1)):h?(e(!0),s=i(u,l)([[n,1]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0}))):(n=1,e(!0))}})((t=>{this.L_=t,this.Hr.Wi.Gi()}),(t=>{super.setVisible(t)})),this.rl=t,this.Hr=i,this.Kb=r,this.E_=n,this.Cy=o,this.z_=h,this.V_=a,this.scale=s,this.N_=de(u.spiderSeriesFillStyle,c),this.G_=de(u.spiderSeriesStrokeStyle,c),this.W_=de(u.spiderSeriesPointFillStyle,c)}oe(){return this.Gm&&this.xa.size>0&&this.getVisible()}addPoints(...t){t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.D_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.xa.set(s,r+t*(e-r)),this.Hr.Wi.Gi()}))}),{easing:this.B_.easing,durationMs:this.B_.durationMs,onStart:()=>{i=new Map(this.xa)}})}else for(let e=0;e=3&&(this.pM||(this.pM=this.Hr.Iu(this.scale,js.Simple).ir(this.G_).As(this.N_).zr(this.getHighlight()),this.gu(this.pM)),this.pM.yo(t),this.qb||(this.qb=this.Hr.aS(this.scale).q(this.Zb).so(this.Kb).Cs(this.dn).As(this.W_).zr(this.getHighlight()),this.gu(this.qb)),this.qb.no().xt(t))}}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.N_,stroke:this.G_}),this}H_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Fl=t=>Ve(t.F_.Fi()),Rl=t=>Ve(t.Fi()),Bl=(t,i,s,r)=>t.aa(0).Cn(s).ea(90).ha(-270).la(i===e.SpiderWebMode.Circle?void 0:r.length),zl={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},_l={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Ll=()=>{_l.alignmentX=0,_l.alignmentY=0,_l.paddingX=0,_l.paddingY=0};class Gl extends Kh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("spiderChart bg",0),r,i.Wi.fs.spiderChartBackgroundFillStyle,i.Wi.fs.spiderChartBackgroundStrokeStyle,i.Wi.fs.spiderChartTitleFont,i.Wi.fs.spiderChartTitleFillStyle,h),this.vx=e.AutoCursorModes.onHover,this.pn=x(20,20,20,20),this.axisScale=st.d1({scale1DConstructor:wi,dimension:"x"}).Z(0,1),this.Cy=[],this.U_=[],this.Y_=[],this.X_=Ci.expansion,this.j_=!0,this.Z_=El,this.K_=Dl,this.kr=!0,this.q_=e.SpiderWebMode.Normal,this.J_=4,this.Q_=this.fs.spiderChartWebStyle,this.tA=this.fs.spiderChartScaleLabelFillStyle,this.iA=this.fs.spiderChartScaleLabelFont,this.sA=5,this.eA=this.fs.spiderChartAxisLabelFillStyle,this.hA=this.fs.spiderChartAxisLabelFont,this.rA=5,this.nA=this.fs.spiderChartAxisStrokeStyle,this.oA=this.fs.spiderChartAxisNibStrokeStyle,this.Dd=10,this.aA=x(),this.hasAxis=t=>this.Cy.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.pi(t,Ai.Numeric),this.lA=()=>(t=>{const e=t.length;for(let i=0;ithis.uA.Ou(this.pixelScale).setMouseInteractions(!1),this.dA=t=>t.dispose(),this.fA=()=>this.vf.ye(this.pixelScale).setMouseInteractions(!1),this.gA=t=>t.dispose(),this.pA=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.mA=(t,e)=>{let i,s;const r=()=>{void 0!==this.SA&&this.SA.finish(),i=p(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.X_,this.X_=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Cy.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Ol(a,this.Cy.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=Ke(ti(t.I_.fi(),t.I_.ui())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.Z(i.min,l),Zt(o),this.Wi.Gi()}},o=()=>{if(i=void 0,void 0!==s)if(this.Hi){const t=p(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.yA(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),r=i.end(t.min,t.max,e.min,e.max);this.SA=this.Eg.Wi.Ue(300,W.ease)([[0,1]],(([e])=>{this.axisScale.Z(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.SA.onAnimationEnd((()=>{this.SA=void 0,this.X_=i}))}else this.X_=s}else this.X_=s;s=void 0};e.setMouseEnterEventHandler(this.xA).setMouseLeaveEventHandler(this.bA).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=_r(new Gr(((t,e,i)=>{this.xA(t),r(),Zt(i)}),n,((t,e,i,s)=>{this.bA(t),o(),Zt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.vA=t=>{this.j_&&!this.hasAxis(t)&&this.addAxis(t)},this.z_=(t,e)=>{for(const i of this.Cy)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Le(i.I_.fi(),i.I_.ui(),t)}},this.V_=t=>{if(0===this.Cy.length)return;const e=ti(nt(t,this.engine.scale,this.pixelScale),this.Cy[0].I_.fi()),i=Math.atan2(e.y,e.x);let s,r=ke;for(const t of this.Cy){const e=ti(t.I_.ui(),t.I_.fi()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.kr&&(t.ua(this.oA),this.Wi.Gi())},this.bA=t=>{t.ua(this.oA),this.Wi.Gi()},this.uf.Oh||this.uf.Bh||this.Wi.Ph(9),this.IM=i.ky("spiderChart series bg",0),this.uA=i.Vp("spiderChart web shapes",0),this.MA=i.Vp("spiderChart axis bg",1),this.Zx=i.Vp("spiderChart plotting",2),this.vf=i.Vp("spiderChart fg",3),this.T_=this.cc.Sg().Is(this.fs.effectsText),this.hp.Ms("Spider Chart");const a=Pt(o?o.autoCursorBuilder:void 0,Gh);this.Tx=a.xx(this._x,this.uiScale,this.uiScale,this.fs),this.mS=this.IM.Ou(this.pixelScale).As(this.fs.spiderChartSeriesBackgroundFillStyle).ir(J).ea(90).ha(-270).aa(0),this.SS=this.IM.Ou(this.pixelScale).As(B).ir(this.fs.spiderChartSeriesBackgroundStrokeStyle).ea(90).ha(-270).aa(0),super.pS(this.mS,this.SS),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Qg(n,this.pixelScale)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Il(this.MA,this.vf,this.pixelScale,this,t,this.axisScale,this.mA,this.T_);this.Cy.push(e)}}else t&&this.Cy.push(t);return this.T_.pu(this.Cy.map((t=>t.F_))),this.Wi.Gi(),this}addSeries(t){const i="object"==typeof t?t.pointShape?t.pointShape:e.PointShape.Circle:t||e.PointShape.Circle,s="object"==typeof t&&t.automaticColorIndex?t.automaticColorIndex:this.lS.length,r=new Pl(this,this.Zx,this.pixelScale,i,this.vA,this.Cy,this.z_,this.V_,this.uS,this.fs,s,this.Wi.cc);return this.yS(r),r}getSeriesCount(){return this.lS.length}getSeries(){return this.lS}setWebMode(t){return this.q_=t,this.Wi.Gi(),this}getWebMode(){return this.q_}setWebCount(t){return this.J_=t,this.Wi.Gi(),this}getWebCount(){return this.J_}setWebStyle(t){return this.Q_="function"==typeof t?t(this.Q_):t,this.Wi.Gi(),this}getWebStyle(){return this.Q_}setScaleLabelStyle(t){return this.tA="function"==typeof t?t(this.tA):t,this.Wi.Gi(),this}getScaleLabelStyle(){return this.tA}setScaleLabelFont(t){return this.iA="function"==typeof t?t(this.iA):t,this.Wi.Gi(),this}getScaleLabelFont(){return this.iA}setScaleLabelPadding(t){return this.sA=t,this.Wi.Gi(),this}getScaleLabelPadding(){return this.sA}setScaleLabelStrategy(t){return this.Z_=t,this.Wi.Gi(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.Wi.Gi(),this}setAxisLabelStyle(t){return this.eA="function"==typeof t?t(this.eA):t,this.Wi.Gi(),this}getAxisLabelStyle(){return this.eA}setAxisLabelFont(t){return this.hA="function"==typeof t?t(this.hA):t,this.Wi.Gi(),this}getAxisLabelFont(){return this.hA}setAxisLabelEffect(t){return this.T_.Is(t),this.Wi.Gi(),this}getAxisLabelEffect(){return this.T_.Ps()}setAxisLabelPadding(t){return this.rA=t,this.Wi.Gi(),this}getAxisLabelPadding(){return this.rA}setAxisLabelStrategy(t){return this.K_=t,this.Wi.Gi(),this}setAxisStyle(t){return this.nA="function"==typeof t?t(this.nA):t,this.Wi.Gi(),this}getAxisStyle(){return this.nA}setNibStyle(t){return this.oA="function"==typeof t?t(this.oA):t,this.Wi.Gi(),this}getNibStyle(){return this.oA}setNibLength(t){return this.Dd=t,this.Wi.Gi(),this}getNibLength(){return this.Dd}setAutoAxis(t){return this.j_=t,this}getAutoAxis(){return this.j_}setMouseInteractions(t){return this.kr=t,this}getMouseInteractions(){return this.kr}setAxisScrollStrategy(t){return this.X_=t,this.Wi.Gi(),this}getAxisScrollStrategy(){return this.X_}setAxisInterval(t,e=0){return this.axisScale.Z(e,t),this.Wi.Gi(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}gc(){super.gc(),xo.lp(this.hp,this.ip);const t=this.Cy.length,e=xo.ap(this.hp,this.ip),i=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+e)),s=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.K_){const e=Math.min(i.x,i.y)/2;for(let i=0;i0?s.right=Math.max(s.right,l.x+.5*(1-a.alignmentX)*h.x-e):s.left=Math.max(s.left,-l.x+.5*(a.alignmentX+1)*h.x-e),o>0?s.top=Math.max(s.top,l.y+.5*(1-a.alignmentY)*h.y-e):s.bottom=Math.max(s.bottom,-l.y+.5*(a.alignmentY+1)*h.y-e)}}if(this.X_){const t=this.yA();if(void 0!==t){const e=this.X_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.X_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.Z(e,i)}}const r=u(this.pixelScale.x.getInnerStart()+(s.left+this.pixelScale.x.getInnerInterval()-s.right)/2,this.pixelScale.y.getInnerStart()+(s.bottom+this.pixelScale.y.getInnerInterval()-s.top)/2),n=Math.min(i.x/2-(s.left+s.right)/2,i.y/2-(s.bottom+s.top)/2);this.aA=x(this.Pt.left+this.pn.left+s.left,this.Pt.top+this.pn.top+e+s.top,this.Pt.right+this.pn.right+s.right,this.Pt.bottom+this.pn.bottom+s.bottom),this.Hp(r,n);for(const t of this.lS)t.jm();for(const t of this.lS)t.gc();super.Jg(),this.Fx(!1);for(const t of this.lS)t.Zm()}dispose(){return this.IM.G(),this.uA.G(),this.MA.G(),this.Zx.G(),this.vf.G(),super.dispose()}getMinimumSize(){return u(this.aA.left+this.aA.right+100,this.aA.bottom+this.aA.top+100)}Hp(t,e){const i=this.Cy.length,s=[];for(let r=0;r{const a=t.length,l=n.length,u=e>0&&l>1;for(let l=0;l=a&&t.push(o());const h=t[l];Bl(h,i,s,n);const u=r*((l+1)/e);h.ra(u)}else l{const c=r.length,d=t.length;let f=0;if(void 0!==e)for(let a=0;a=d&&t.push(h());const e=t[f];f+=1;const s=(i-r)/i,c=Le(n,o[a],s);e.Cn(Qe(c,u(m.paddingX,m.paddingY))).Pn(m.alignmentX).Bn(m.alignmentY).Ms(l(s))}}}for(let e=f;e