diff --git a/index.html b/index.html index 70c7a63..9d7a025 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.318c12a9e98430514f0d.bundle.js b/js/vendor.318c12a9e98430514f0d.bundle.js new file mode 100644 index 0000000..240837d --- /dev/null +++ b/js/vendor.318c12a9e98430514f0d.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.318c12a9e98430514f0d.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[502],{243:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,TokenFactory:()=>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+=1);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{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,m=e&&e.length,y=m?e[0]*s:t.length,p=i(t,0,y,s,!0),A=[];if(!p||p.next===p.prev)return A;if(m&&(p=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 x=s;xh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,A,s,n,o,g,0),A}function i(t,e,i,s,r){var n,o;if(r===w(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(C(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||!p(s,s.next)&&0!==y(s.prev,s,s.next))s=s.next;else{if(C(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,m,y=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),C(t),t=m.next,y=m.next;else if((t=m)===y){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(y(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,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(y(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,m=ha?h>l?h:l:a>l?a:l,x=u>c?u>f?u:f:c>f?c:f,S=d(m,p,e,i,s),v=d(A,x,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=S&&M&&M.z<=v;){if(b.x>=m&&b.x<=A&&b.y>=p&&b.y<=x&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=m&&M.x<=A&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=S;){if(b.x>=m&&b.x<=A&&b.y>=p&&b.y<=x&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=m&&M.x<=A&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&A(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),C(r),C(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&&m(a,l)){var u=b(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=b(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return y(t.prev,t,e.prev)<0&&y(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 m(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(v(t,e)&&v(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)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||p(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,s){var r=S(y(t,e,i)),n=S(y(t,e,s)),o=S(y(i,s,t)),h=S(y(i,s,e));return r!==n&&o!==h||!(0!==r||!x(t,i,e))||!(0!==n||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==h||!x(i,e,s))}function x(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 S(t){return t>0?1:t<0?-1:0}function v(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new T(t.i,t.x,t.y),s=new T(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 M(t,e,i,s){var r=new T(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 C(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 T(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 w(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}},568:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>C,Iterable:()=>Ms,List:()=>ri,Map:()=>Pe,OrderedMap:()=>Ai,OrderedSet:()=>ns,PairSorting:()=>us,Range:()=>Ui,Record:()=>cs,Repeat:()=>As,Seq:()=>j,Set:()=>Oi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>xs,get:()=>re,getIn:()=>Yi,has:()=>se,hasIn:()=>Xi,hash:()=>ft,is:()=>lt,isAssociative:()=>M,isCollection:()=>A,isImmutable:()=>R,isIndexed:()=>b,isKeyed:()=>S,isList:()=>si,isMap:()=>ot,isOrdered:()=>P,isOrderedMap:()=>ht,isOrderedSet:()=>Fi,isPlainObject:()=>te,isRecord:()=>F,isSeq:()=>I,isSet:()=>zi,isStack:()=>Mi,isValueObject:()=>at,merge:()=>Se,mergeDeep:()=>be,mergeDeepWith:()=>Me,mergeWith:()=>ve,remove:()=>oe,removeIn:()=>de,set:()=>he,setIn:()=>ue,update:()=>ge,updateIn:()=>ae,version:()=>bs});var s="delete",r=32,n=31,o={};function h(t){t&&(t.value=!0)}function a(){}function l(t){return void 0===t.size&&(t.size=t.__iterate(c)),t.size}function u(t,e){if("number"!=typeof e){var i=e>>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?l(t)+e:e}function c(){return!0}function d(t,e,i){return(0===t&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function f(t,e){return m(t,e,0)}function g(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 p="@@__IMMUTABLE_ITERABLE__@@";function A(t){return Boolean(t&&t[p])}var x="@@__IMMUTABLE_KEYED__@@";function S(t){return Boolean(t&&t[x])}var v="@@__IMMUTABLE_INDEXED__@@";function b(t){return Boolean(t&&t[v])}function M(t){return S(t)||b(t)}var C=function(t){return A(t)?t:j(t)},T=function(t){function e(t){return S(t)?t:$(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),w=function(t){function e(t){return b(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),E=function(t){function e(t){return A(t)&&!M(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C);C.Keyed=T,C.Indexed=w,C.Set=E;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var z="@@__IMMUTABLE_RECORD__@@";function F(t){return Boolean(t&&t[z])}function R(t){return A(t)||F(t)}var D="@@__IMMUTABLE_ORDERED__@@";function P(t){return Boolean(t&&t[D])}var O="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",_=O||L,B=function(t){this.next=t};function V(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 G(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!H(t)}function U(t){return t&&"function"==typeof t.next}function Y(t){var e=H(t);return e&&e.call(t)}function H(t){var e=t&&(O&&t[O]||t[L]);if("function"==typeof e)return e}B.prototype.toString=function(){return"[Iterator]"},B.KEYS=0,B.VALUES=1,B.ENTRIES=2,B.prototype.inspect=B.prototype.toSource=function(){return this.toString()},B.prototype[_]=function(){return this};var X=Object.prototype.hasOwnProperty;function W(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 j=function(t){function e(t){return null==t?et():R(t)?t.toSeq():function(t){var e,i,s=rt(t);if(s)return(i=H(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=H(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new J(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 B((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return V(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(C),$=function(t){function e(t){return null==t?et().toKeyedSeq():A(t)?S(t)?t.toSeq():t.fromEntrySeq():F(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(j),Z=function(t){function e(t){return null==t?et():A(t)?S(t)?t.entrySeq():t.toIndexedSeq():F(t)?t.toSeq().entrySeq():st(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}(j),q=function(t){function e(t){return(A(t)&&!M(t)?t:Z(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}(j);j.isSeq=I,j.Keyed=$,j.Set=q,j.Indexed=Z,j.prototype[k]=!0;var K=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[u(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 B((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return V(t,n,i[n])}))},e}(Z),J=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 X.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 B((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return V(t,o,i[o])}))},e}($);J.prototype[D]=!0;var Q,tt=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(U(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(!U(i))return new B(G);var s=0;return new B((function(){var e=i.next();return e.done?e:V(t,s++,e.value)}))},e}(Z);function et(){return Q||(Q=new K([]))}function it(t){var e=rt(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new J(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function st(t){var e=rt(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function rt(t){return W(t)?new K(t):N(t)?new tt(t):void 0}var nt="@@__IMMUTABLE_MAP__@@";function ot(t){return Boolean(t&&t[nt])}function ht(t){return ot(t)&&P(t)}function at(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function lt(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!!(at(t)&&at(e)&&t.equals(e))}var ut="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 ct(t){return t>>>1&1073741824|3221225471&t}var dt=Object.prototype.valueOf;function ft(t){if(null==t)return gt(t);if("function"==typeof t.hashCode)return ct(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==dt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return gt(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 ct(e)}(r);case"string":return r.length>Ct?(void 0===(s=Et[i=r])&&(s=mt(i),wt===Tt&&(wt=0,Et={}),wt++,Et[i]=s),s):mt(r);case"object":case"function":return function(t){var e;if(St&&void 0!==(e=xt.get(t)))return e;if(void 0!==(e=t[Mt]))return e;if(!pt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Mt]))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=At(),St)xt.set(t,e);else{if(void 0!==yt&&!1===yt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(pt)Object.defineProperty(t,Mt,{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[Mt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Mt]=e}}return e}(r);case"symbol":return function(t){var e=vt[t];return void 0!==e||(e=At(),vt[t]=e),e}(r);default:if("function"==typeof r.toString)return mt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function gt(t){return null===t?1108378658:1108378659}function mt(t){for(var e=0,i=0;i=0&&(a.get=function(e,i){return(e=u(this,e))>=0&&en)return{value:void 0,done:!0};var t=r.next();return s||1===e||t.done?t:V(e,a-1,0===e?void 0:t.value[1],t)}))},a}function _t(t,e,i,s){var r=Wt(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(2,n),a=!0,l=0;return new B((function(){var t,n,u;do{if((t=h.next()).done)return s||1===r?t:V(r,l++,0===r?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 2===r?t:V(r,n,u,t)}))},r}function Bt(t,e,i){var s=Wt(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 Ut(t,e,i,s){var r=Wt(t),n=new K(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(1,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=C(t),Y(r?t.reverse():t)})),o=0,h=!1;return new B((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}:V(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Yt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function Ht(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Xt(t){return S(t)?T:b(t)?w:E}function Wt(t){return Object.create((S(t)?$:b(t)?Z:q).prototype)}function jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):j.prototype.cacheResult.call(this)}function $t(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 xe(this,e,t)}function xe(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Te(t,e)}function ve(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Te(e,i,t)}function be(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function Me(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ce(e,i,t)}function Ce(t,e,i){return Te(t,e,function(t){return function e(i,s,r){return ee(i)&&ee(s)&&(n=s,o=j(i),h=j(n),b(o)===b(h)&&S(o)===S(h))?Te(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Te(t,e,i){if(!ee(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(R(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?w:T,o=s?function(e){r===t&&(r=ne(r)),r.push(e)}:function(e,s){var n=X.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=ne(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ce(this,e,t)}function ke(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,We(),(function(t){return Te(t,e)}))}function Ie(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,We(),(function(t){return Ce(t,e)}))}function ze(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Fe(){return this.__ownerID?this:this.__ensureOwner(new a)}function Re(){return this.__ensureOwner()}function De(){return this.__altered}var Pe=function(t){function e(e){return null==e?We():ot(e)&&!P(e)?e:We().withMutations((function(i){var s=t(e);Kt(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 We().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 je(this,t,e)},e.prototype.remove=function(t){return je(this,t,o)},e.prototype.deleteAll=function(t){var e=C(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):We()},e.prototype.sort=function(t){return Ai(Vt(this,t))},e.prototype.sortBy=function(t,e){return Ai(Vt(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 Ue(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?Xe(this.size,this._root,t,this.__hash):0===this.size?We():(this.__ownerID=t,this.__altered=!1,this)},e}(T);Pe.isMap=ot;var Oe=Pe.prototype;Oe[nt]=!0,Oe[s]=Oe.remove,Oe.removeAll=Oe.deleteAll,Oe.setIn=ce,Oe.removeIn=Oe.deleteIn=fe,Oe.update=me,Oe.updateIn=ye,Oe.merge=Oe.concat=pe,Oe.mergeWith=Ae,Oe.mergeDeep=we,Oe.mergeDeepWith=Ee,Oe.mergeIn=ke,Oe.mergeDeepIn=Ie,Oe.withMutations=ze,Oe.wasAltered=De,Oe.asImmutable=Re,Oe["@@transducer/init"]=Oe.asMutable=Fe,Oe["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Oe["@@transducer/result"]=function(t){return t.asImmutable()};var Le=function(t,e){this.ownerID=t,this.entries=e};Le.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=Qe)return function(t,e,i,s){t||(t=new a);for(var r=new Ge(t,ft(i),[i,s]),n=0;n>>t)&n),o=this.bitmap;return o&r?this.nodes[Ke(o&r-1)].get(t+5,e,i,s):s},_e.prototype.update=function(t,e,i,s,h,a,l){void 0===i&&(i=ft(s));var u=(0===e?i:i>>>e)&n,c=1<=ti)return function(t,e,i,s,n){for(var o=0,h=new Array(r),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=n,new Be(t,o+1,h)}(t,m,d,u,p);if(f&&!p&&2===m.length&&Ze(m[1^g]))return m[1^g];if(f&&p&&1===m.length&&Ze(p))return p;var A=t&&t===this.ownerID,x=f?p?d:d^c:d|c,S=f?p?Je(m,g,p,A):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)&n,o=this.nodes[r];return o?o.get(t+5,e,i,s):s},Be.prototype.update=function(t,e,i,s,r,h,a){void 0===i&&(i=ft(s));var l=(0===e?i:i>>>e)&n,u=r===o,c=this.nodes,d=c[l];if(u&&!d)return this;var f=$e(d,t,e+5,i,s,r,h,a);if(f===d)return this;var g=this.count;if(d){if(!f&&--g>>i)&n,a=(0===i?s:s>>>i)&n,l=h===a?[qe(t,e,i+5,s,r)]:(o=new Ge(e,s,r),h>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function Je(t,e,i,s){var r=s?t:Zt(t);return r[e]=i,r}var Qe=8,ti=16,ei=8,ii="@@__IMMUTABLE_LIST__@@";function si(t){return Boolean(t&&t[ii])}var ri=function(t){function e(e){var i=ci();if(null==e)return i;if(si(e))return e;var s=t(e),n=s.size;return 0===n?i:(Kt(n),n>0&&n=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?mi(t,e).set(0,i):mi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=yi(t._capacity)?s=di(s,t.__ownerID,0,e,i,n):r=di(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):ui(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=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ci()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){mi(i,0,e+t.length);for(var s=0;s>>e&n;if(s>=this.array.length)return new oi([],t);var r,o=0===s;if(e>0){var h=this.array[s];if((r=h&&h.removeBefore(t,e-5,i))===h&&o)return this}if(o&&!r)return this;var a=fi(this,t);if(!o)for(var l=0;l>>e&n;if(r>=this.array.length)return this;if(e>0){var o=this.array[r];if((s=o&&o.removeAfter(t,e-5,i))===o&&r===this.array.length-1)return this}var h=fi(this,t);return h.array.splice(r+1),s&&(h.array[r]=s),h};var hi,ai={};function li(t,e){var i=t._origin,s=t._capacity,n=yi(s),o=t._tail;return function t(h,a,l){return 0===a?function(t,h){var a=h===n?o&&o.array:t&&t.array,l=h>i?0:i-h,u=s-h;return u>r&&(u=r),function(){if(l===u)return ai;var t=e?--u:l++;return a&&a[t]}}(h,l):function(n,o,h){var a,l=n&&n.array,u=h>i?0:i-h>>o,c=1+(s-h>>o);return c>r&&(c=r),function(){for(;;){if(a){var i=a();if(i!==ai)return i;a=null}if(u===c)return ai;var s=e?--c:u++;a=t(l&&l[s],o-5,h+(s<>>i&n,u=t&&l0){var c=t&&t.array[l],d=di(c,e,i-5,s,r,o);return d===c?t:((a=fi(t,e)).array[l]=d,a)}return u&&t.array[l]===r?t:(o&&h(o),a=fi(t,e),void 0===r&&l===a.array.length-1?a.array.pop():a.array[l]=r,a)}function fi(t,e){return e&&t&&e===t.ownerID?t:new oi(t?t.array.slice():[],e)}function gi(t,e){if(e>=yi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&n],s-=5;return i}}function mi(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new a,r=t._origin,o=t._capacity,h=r+e,l=void 0===i?o:i<0?o+i:r+i;if(h===r&&l===o)return t;if(h>=l)return t.clear();for(var u=t._level,c=t._root,d=0;h+d<0;)c=new oi(c&&c.array.length?[void 0,c]:[],s),d+=1<<(u+=5);d&&(h+=d,r+=d,l+=d,o+=d);for(var f=yi(o),g=yi(l);g>=1<f?new oi([],s):m;if(m&&g>f&&h5;A-=5){var x=f>>>A&n;p=p.array[x]=fi(p.array[x],s)}p.array[f>>>5&n]=m}if(l=g)h-=g,l-=g,u=5,c=null,y=y&&y.removeBefore(s,0,h);else if(h>r||g>>u&n;if(S!==g>>>u&n)break;S&&(d+=(1<r&&(c=c.removeBefore(s,u,h-d)),c&&g>>5<<5}var pi,Ai=function(t){function e(t){return null==t?Si():ht(t)?t:Si().withMutations((function(e){var i=T(t);Kt(i.size),i.forEach((function(t,i){return e.set(i,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("OrderedMap {","}")},e.prototype.get=function(t,e){var i=this._map.get(t);return void 0!==i?this._list.get(i)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Si()},e.prototype.set=function(t,e){return vi(this,t,e)},e.prototype.remove=function(t){return vi(this,t,o)},e.prototype.__iterate=function(t,e){var i=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],i)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),i=this._list.__ensureOwner(t);return t?xi(e,i,t,this.__hash):0===this.size?Si():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=i,this)},e}(Pe);function xi(t,e,i,s){var r=Object.create(Ai.prototype);return r.size=t?t.size:0,r._map=t,r._list=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Si(){return pi||(pi=xi(We(),ci()))}function vi(t,e,i){var s,n,h=t._map,a=t._list,l=h.get(e),u=void 0!==l;if(i===o){if(!u)return t;a.size>=r&&a.size>=2*h.size?(s=(n=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=n.__ownerID=t.__ownerID)):(s=h.remove(e),n=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=h,n=a.set(l,[e,i])}else s=h.set(e,a.size),n=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=n,t.__hash=void 0,t.__altered=!0,t):xi(s,n)}Ai.isOrderedMap=ht,Ai.prototype[D]=!0,Ai.prototype[s]=Ai.prototype.remove;var bi="@@__IMMUTABLE_STACK__@@";function Mi(t){return Boolean(t&&t[bi])}var Ci=function(t){function e(t){return null==t?ki():Mi(t)?t:ki().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=u(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):Ei(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Mi(e))return e;Kt(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):Ei(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):ki()},e.prototype.slice=function(e,i){if(d(e,i,this.size))return this;var s=f(e,this.size);if(g(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):Ei(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ei(this.size,this._head,t,this.__hash):0===this.size?ki():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new K(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 K(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new B((function(){if(s){var e=s.value;return s=s.next,V(t,i++,e)}return{value:void 0,done:!0}}))},e}(w);Ci.isStack=Mi;var Ti,wi=Ci.prototype;function Ei(t,e,i,s){var r=Object.create(wi);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function ki(){return Ti||(Ti=Ei(0))}wi[bi]=!0,wi.shift=wi.pop,wi.unshift=wi.push,wi.unshiftAll=wi.pushAll,wi.withMutations=ze,wi.wasAltered=De,wi.asImmutable=Re,wi["@@transducer/init"]=wi.asMutable=Fe,wi["@@transducer/step"]=function(t,e){return t.unshift(e)},wi["@@transducer/result"]=function(t){return t.asImmutable()};var Ii="@@__IMMUTABLE_SET__@@";function zi(t){return Boolean(t&&t[Ii])}function Fi(t){return zi(t)&&P(t)}function Ri(t,e){if(t===e)return!0;if(!A(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||S(t)!==S(e)||b(t)!==b(e)||P(t)!==P(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!M(t);if(P(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&<(r[1],t)&&(i||lt(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 h=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!lt(e,t.get(s,o)):!lt(t.get(s,o),e))return h=!1,!1}));return h&&t.size===a}function Di(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 Pi(t){if(!t||"object"!=typeof t)return t;if(!A(t)){if(!ee(t))return t;t=j(t)}if(S(t)){var e={};return t.__iterate((function(t,i){e[i]=Pi(t)})),e}var i=[];return t.__iterate((function(t){i.push(Pi(t))})),i}var Oi=function(t){function e(e){return null==e?Gi():zi(e)&&!P(e)?e:Gi().withMutations((function(i){var s=t(e);Kt(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(T(t).keySeq())},e.intersect=function(t){return(t=C(t).toArray()).length?_i.intersect.apply(e(t.pop()),t):Gi()},e.union=function(t){return(t=C(t).toArray()).length?_i.union.apply(e(t.pop()),t):Gi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Bi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Bi(this,this._map.remove(t))},e.prototype.clear=function(){return Bi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Bi(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=ut(e<<13|e>>>-13,5),e=ut((e=e+3864292196^t)^e>>>16,2246822507),e=ct((e=ut(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+rs(ft(t),ft(e))|0}:function(t,e){s=s+rs(ft(t),ft(e))|0}:e?function(t){s=31*s+ft(t)|0}:function(t){s=s+ft(t)|0}),s)}(this))}});var ji=C.prototype;ji[p]=!0,ji[_]=ji.values,ji.toJSON=ji.toArray,ji.__toStringMapper=ie,ji.inspect=ji.toSource=function(){return this.toString()},ji.chain=ji.flatMap,ji.contains=ji.includes,Di(T,{flip:function(){return Yt(this,Rt(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 $i=T.prototype;$i[x]=!0,$i[_]=ji.entries,$i.toJSON=Wi,$i.__toStringMapper=function(t,e){return ie(e)+": "+ie(t)},Di(w,{toKeyedSeq:function(){return new kt(this,!1)},filter:function(t,e){return Yt(this,Ot(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,Pt(this,!1))},slice:function(t,e){return Yt(this,Lt(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=f(t,t<0?this.count():this.size);var s=this.slice(0,t);return Yt(this,1===i?s:s.concat(Zt(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,Bt(this,t,!1))},get:function(t,e){return(t=u(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=u(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function rs(t,e){return t^e+2654435769+(t<<6)+(t>>2)}qi.has=ji.includes,qi.contains=qi.includes,qi.keys=qi.values,Di($,$i),Di(Z,Zi),Di(q,qi);var ns=function(t){function e(t){return null==t?ls():Fi(t)?t:ls().withMutations((function(e){var i=E(t);Kt(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(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Oi);ns.isOrderedSet=Fi;var os,hs=ns.prototype;function as(t,e){var i=Object.create(hs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function ls(){return os||(os=as(Si()))}hs[D]=!0,hs.zip=Zi.zip,hs.zipWith=Zi.zipWith,hs.zipAll=Zi.zipAll,hs.__empty=ls,hs.__make=as;var us={LeftThenRight:-1,RightThenLeft:1},cs=function(t,e){var i;!function(t){if(F(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(R(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 Ss(t,e,i,s,r,n){if("string"!=typeof i&&!R(i)&&(W(i)||N(i)||te(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,j(i).map((function(s,n){return Ss(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function vs(t,e){return b(e)?e.toList():S(e)?e.toMap():e.toSet()}var bs="4.3.7",Ms=C;const Cs={version:bs,Collection:C,Iterable:C,Seq:j,Map:Pe,OrderedMap:Ai,List:ri,Stack:Ci,Set:Oi,OrderedSet:ns,PairSorting:us,Record:cs,Range:Ui,Repeat:As,is:lt,fromJS:xs,hash:ft,isImmutable:R,isCollection:A,isKeyed:S,isIndexed:b,isAssociative:M,isOrdered:P,isValueObject:at,isPlainObject:te,isSeq:I,isList:si,isMap:ot,isOrderedMap:ht,isStack:Mi,isSet:zi,isOrderedSet:Fi,isRecord:F,get:re,getIn:Yi,has:se,hasIn:Xi,merge:Se,mergeDeep:be,mergeWith:ve,mergeDeepWith:Me,remove:oe,removeIn:de,set:he,setIn:ue,update:ge,updateIn:ae}},377:(t,e,i)=>{Object.defineProperty(e,"o",{value:!0});var s=i(568),r=i(243),n=i(570),o=function(t){if(t&&t.o)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.u=!0}S(){return this.u}}class l extends a{constructor(t,e){super(),this.M=t,this.u=e}_(t){return t!==this.M&&(this.M=t,this.u=!0),this}C(){return this.M}S(){return super.S()}}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]},m=(t,e)=>({min:t,max:e}),y=(t,e,i,s)=>({x:t,y:e,width:i,height:s}),p=(t,e=!0)=>new l(t,e),A=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=A,S=(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}),v=s.Record({type:"color",r:1,g:1,b:1,a:1});class b extends v{constructor(t){super(t)}toUint32(){return void 0!==this.T||(this.T=z(this.getR(),this.getG(),this.getB(),this.getA())),this.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.F||(this.F=new b({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.F}getLighter(){return this.I||(this.I=new b({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.I}getDarker(){return this.P||(this.P=new b({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.P}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const M=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),C=(t,e,i,s=255)=>new b({r:t/255,g:e/255,b:i/255,a:s/255}),T=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new b({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 b({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 b({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 b({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 b({r:s,g:r,b:n})},E={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"},k=new b({}),I=C(0,0,0,0),z=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,F=(t,e)=>t.value-e.value,R=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:C(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),D=t=>{const{steps:e}=t,i=e.length;e.sort(F);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 P extends R{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,D(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(D({...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")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}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 b({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 O=s.Record({type:"fillstyle",fillType:"empty"});class L extends O{toString(){return"emptyFill"}}const _=new L,B=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),V=s.Record({type:"fillstyle",fillType:"solid",color:C(255,255,255)});class G extends V{}class N extends G{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return M(t)?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))}}const U=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class Y extends G{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),X=s.Record({type:"fillstyle",fillType:"palette",lut:new P({steps:[]}),lookUpProperty:"value"});class W extends X{constructor(t){super({...t,fillType:"palette"})}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 j=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),$={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=le(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.L)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.V=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.R.emit("start")}start(){return this.V.includes(this)||this.V.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 Z(t,e,i,s,this.V);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.R.on("start",t,e)}onAnimationEnd(t,e){return this.R.on("end",t,e)}onEveryAnimationEnd(t,e){return this.R.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.R.on("allEnd",t,e)}allOffAnimationEnd(){return this.R.topicOff("end"),this}allOffEveryAnimationEnd(){return this.R.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.R.topicOff("allEnd"),this}offAnimationEnd(t){return this.R.off(t,"end")}offEveryAnimationEnd(t){return this.R.off(t,"everyEnd")}offAllAnimationEnd(t){return this.R.off(t,"allEnd")}finish(t=!0){if(this.L=!0,this.V.splice(this.V.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.R.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.R.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.R.emit("end",e),this.R.emit("everyEnd",e)),e}t&&(this.R.emit("end",void 0),this.R.emit("everyEnd",void 0),this.R.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(Dt):this.values.map(Dt)}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=zt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=$.linear)=>(r,n,h=t)=>{const a=new Z(r,n,h,e,i).start();return s||(s=zt.requestAnimationFrame(o)),a}};var K;e.ImageFitMode=void 0,(K=e.ImageFitMode||(e.ImageFitMode={}))[K.Fill=0]="Fill",K[K.Fit=1]="Fit",K[K.Stretch=2]="Stretch",K[K.Center=3]="Center",K[K.Tile=4]="Tile";const J=s.Record({type:"fillstyle",fillType:"image",source:void 0,surroundingColor:C(0,0,0,0),sourceMissingColor:C(0,0,0,0),fitMode:e.ImageFitMode.Fill});class Q extends J{constructor(t){super(t)}setSource(t){return this.set("source",t)}getSource(){return this.get("source")}setSurroundingColor(t){return M(t)?this.set("surroundingColor",t):this.set("surroundingColor",t(this.get("surroundingColor")))}getSurroundingColor(){return this.get("surroundingColor")}setSourceMissingColor(t){return M(t)?this.set("sourceMissingColor",t):this.set("sourceMissingColor",t(this.get("sourceMissingColor")))}getSourceMissingColor(){return this.get("sourceMissingColor")}setFitMode(t){return this.set("fitMode",t)}getFitMode(){return this.get("fitMode")}toString(){return`imagefill:${this.fitMode}`}}const tt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType);var et,it;e.GradientShape=void 0,(et=e.GradientShape||(e.GradientShape={})).circle="circle",et.ellipse="ellipse",e.GradientExtent=void 0,(it=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",it.closestCorner="closest-corner",it.farthestSide="farthest-side",it.farthestCorner="farthest-corner";const st=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class rt extends st{constructor(t){if(super(t),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 nt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),ot=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],angle:0});class ht extends ot{constructor(t){if(super(t),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?function(t){return 180*t/Math.PI}(t):t)}getAngle(t){return t?Ci(this.get("angle")):this.get("angle")}}const at=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),lt=s.Record({type:"linestyle",lineType:"empty"}),ut=new class extends lt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}N(){return 0}setFillStyle(t){return this}getFillStyle(){return _}},ct=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class dt{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new ft,this.y=new ft,this.z=new ft,this.R=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Je,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(Je,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.W(e),s.y.W(r)}}}Y(){return this.U&&(this.U(),this.U=void 0),this}H(t){return this.R.on("cell-resize",t)}X(t){return this.R.off(t,"cell-resize")}}class ft extends a{constructor(){super(...arguments),this.$=0,this.j=10,this.Z=1}J(){return this.u=!1,this}K(){return this.u=!0,this}getInnerStart(){return this.$}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}q(t,e){return this.$=t,this.j=e,this.tt(),this}it(t){return this.Z=t,this.tt(),this}st(t){return t/this.Z}tt(){const t=this.st(this.j-this.$),e=this.Z;void 0!==this.et&&!1!==Lt(t,this.et)||(this.u=!0,this.ht=e,this.et=t)}rt(){return this.et}nt(){return this.ht}ot(){return this.jnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ct({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new dt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},mt=(t,e,i)=>e===i?t:i.dt(e.ft(t)),yt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Ui?e.x:e.x instanceof Ui?e.x.x:e.x.At,r=e instanceof Ui?e.y:e.y instanceof Ui?e.y.y:e.y.At,n=i instanceof Ui?i.x:i.x instanceof Ui?i.x.x:i.x.At,o=i instanceof Ui?i.y:i.y instanceof Ui?i.y.y:i.y.At;return{...t,x:mt(t.x,s,n),y:mt(t.y,r,o)}},pt=(...t)=>{if(0===t.length)return{remove:Ot};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.yt(s,r,!1,i.getStopped(),"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])}))}}},At=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,xt=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,St=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,vt=t=>t&&"object"==typeof t&&"index"in t;class bt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,bt.prototype)}}class Mt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&zt.alert(s),Object.setPrototypeOf(this,Mt.prototype)}}class Ct extends Mt{constructor(t){super(t),Object.setPrototypeOf(this,Ct.prototype)}}var Tt,wt,Et,kt;e.UISpace=void 0,(Tt=e.UISpace||(e.UISpace={}))[Tt.Content=0]="Content",Tt[Tt.PaddedContent=1]="PaddedContent",Tt[Tt.PaddedBackground=2]="PaddedBackground",Tt[Tt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(wt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[wt.never=0]="never",wt[wt.always=1]="always",wt[wt.whenHovered=2]="whenHovered",wt[wt.whenDragged=3]="whenDragged",wt[wt.whenNotDragged=4]="whenNotDragged",wt[wt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(Et=e.UIDraggingModes||(e.UIDraggingModes={}))[Et.notDraggable=0]="notDraggable",Et[Et.draggable=1]="draggable",Et[Et.onlyHorizontal=2]="onlyHorizontal",Et[Et.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(kt=e.UIDirections||(e.UIDirections={}))[kt.Up=0]="Up",kt[kt.Right=1]="Right",kt[kt.Down=2]="Down",kt[kt.Left=3]="Left";const It=t=>{if(t.resourcesBaseUrl){const e=t.styleFactory(t.resourcesBaseUrl),i=tt(e)&&e.getSource(),s=i&&i instanceof Image?i:void 0;return null==s||s.addEventListener("error",(()=>{De(t.resourcesBaseUrl,s.src,"Theme resource",{shouldCrash:!1})})),e}const e=`${zt.location.origin}/resources`,i=t.styleFactory(e);if(tt(i)){const e=i.getSource();e instanceof Image&&e.addEventListener("error",(()=>{const i=t.styleFactory("https://lcjs-resources.lightningchart.com/v1"),s=tt(i)&&i.getSource(),r=s&&s instanceof Image?s:void 0;zt.console.warn("LightningChart JS warning | fallbacking to publicly hosted asset resources.\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/warning-using-publicly-hosted-resources/"),null==r||r.addEventListener("load",(()=>{t.apply(i)})),null==r||r.addEventListener("error",(()=>{De(t.resourcesBaseUrl,e.src,"Theme resource",{shouldCrash:!1})}))}))}return i},zt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Ft=(t,e)=>t.x===e.x&&t.y===e.y,Rt=t=>t!==Ye&&t!==He&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Dt=t=>t[1],Pt=t=>t.dispose(),Ot=()=>{},Lt=(t,e)=>t===e,_t=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Bt=t=>Array.prototype.concat.apply([],t),Vt=(t,e)=>void 0===t||Number.isNaN(t)?e:t,Gt=t=>t.vt(),Nt=t=>t.St(),Ut=t=>t.xt(),Yt=t=>t.bt(),Ht=t=>t.min.x,Xt=t=>t.max.x,Wt=t=>t.min.y,jt=t=>t.max.y,$t=(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,qt=u(0,1),Kt=u(1,0),Jt=u(0,-1),Qt=u(-1,0),te=u(0,0),ee=t=>{switch(t){case e.UIDirections.Up:return qt;case e.UIDirections.Right:return Kt;case e.UIDirections.Down:return Jt;case e.UIDirections.Left:return Qt;default:return te}},ie=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,se=t=>{t.stopPropagation(),t.preventDefault()},re=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let r=0;for(let e=0;e{if(!e){const e=t.length,s=new i(2*e);let r=0;for(let i=0;i{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)},ae=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ue=le(Math.E),ce=(t,e)=>{const i=e[t];return i?i():void 0},de=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iTi(pi(t,i))-Ti(pi(e,i))))},fe=(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:C(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())),me=t=>255===t.getA()?t:t.setA(255),ye=(()=>{const t=C(0,0,0);return i=>(i=me(i),new rt({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ge(i,t,.5)}]}))})(),pe=(()=>{const t=t=>{var e;if(t){if(U(t)){if(0===t.getColor().getA())return;return t.getColor()}if(nt(t)||at(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}j(t)}};return(e,i,s,r)=>{var n;const o=[];if(r.fill&&o.push(r.fill),r.fill2&&o.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==_&&("stroke"===(null===(n=r.behavior)||void 0===n?void 0:n.priority)?o.unshift(t):o.push(t))}if(r.point3D){const t=r.point3D;o.push(t.getFillStyle())}let h;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=o.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]);h=e&&s?(a=e)===(l=s)||a.getR()===l.getR()&&a.getG()===l.getG()&&a.getB()===l.getB()?ye(a):(a=me(a),l=me(l),new ht({angle:0,stops:[{offset:0,color:l},{offset:.5,color:l},{offset:.5,color:a},{offset:1,color:a}]})):i.uiButtonFillStyle}else{const e=o.reduce(((e,i)=>e||t(i)),void 0);h=e?s?new N({color:e}):ye(e):i.uiButtonFillStyle}var a,l;e.setButtonOnFillStyle(h)}})(),Ae=t=>{const e=t;if(j(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},xe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},Se=(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,be=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),Me=(t,e)=>e(),Ce=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new N({color:C(255,255,255,1)});const Te=t=>t===Xe||t.min.x===Xe.min.x&&t.max.x===Xe.max.x&&t.min.y===Xe.min.y&&t.max.y===Xe.max.y,we=t=>Array.from(new Set(t)),Ee=t=>t.filter((t=>void 0!==t)),ke=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Ie=(t,e,i)=>{e.length<=0||(t.setText(i.label).setOn(e[0].getVisible()),i.style&&t.setButtonOnFillStyle(i.style),i.toggleVisibilityOnClick&&t.onSwitch(((t,i)=>e.forEach((t=>t.setVisible(i))))),t.onMouseEnter((()=>e.forEach((t=>t.setHighlight(!0))))),t.onMouseLeave((()=>e.forEach((t=>t.setHighlight(!1))))),e.forEach((e=>e.onMouseEnter((()=>t.setHighlight(!0))))),e.forEach((e=>e.onMouseLeave((()=>t.setHighlight(!1))))),e.forEach((e=>e.onTouchStart((()=>t.setHighlight(!0))))),e.forEach((e=>e.onTouchEnd((()=>t.setHighlight(!1))))))},ze=(t,e)=>{throw new Error(e)},Fe=t=>{let e;return()=>e||(e=t(),e)},Re=t=>{if(t===ut)return 0;const e=t.getThickness();return e<0?1:1*e},De=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(s.shouldCrash)throw zt.alert(r),new Error(r);zt.console.warn(r)},Pe=(t,e,i,s=0)=>{if(t{const t=new Map;return{Mt:e=>(e.setMouseEnterEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n._t(e,i,s,r)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.wt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ct(e,i,s,r)})),e.setMouseDoubleClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.kt(e,i,s,r)})),e.setMouseDownEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Tt(e,i,s,r)})),e.setMouseUpEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ft(e,i,s,r)})),e.setMouseMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.It(e,i,s,r)})),e.setMouseDragEventHandler(((e,i,s,r,n,o,h)=>{const a=o&&t.get(o);a&&a.Pt(e,i,s,r,n,o,h)})),e.setMouseDragStartEventHandler(((e,i,s,r,n)=>{const o=r&&t.get(r);o&&o.Dt(e,i,s,r,n)})),e.setMouseDragStopEventHandler(((e,i,s,r,n,o)=>{const h=n&&t.get(n);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseWheelEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Lt(e,i,s,r)})),e.setTouchStartEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Rt(e,i,s,r)})),e.setTouchMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Et(e,i,s,r)})),e.setTouchEndEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.zt(e,i,s,r)})),e),Vt:(e,i)=>{t.set(e,i)},Ot:()=>{t.clear()}}},Le={left:0,right:0,top:0,bottom:0},_e=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),Be=(t,e,i)=>{e&&e.Nt();const s=i();return{Gt:t,Nt:()=>{s.forEach((e=>t.Ut(e)))}}},Ve=(t,e,i)=>{let s;const r=()=>(s=i(),s),n={...t,resolve:()=>s||r()};for(const t of Object.keys(e))Object.defineProperty(n,t,{get:function(){return s?s[t]:r()[t]}});return n},Ge=t=>{if(t)return"resolve"in t?t.resolve():t},Ne=t=>{let e=t;return{Wt:t=>{const i=e;return e=i+t,[i,t]}}},Ue={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=>Ue.divide(t,Ue.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(Ue.dot(t,e)/(Ue.length(t)*Ue.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ue.dot(e,t),o=Ue.cross(e,t);return Ue.addVec(Ue.multiply(t,s),Ue.addVec(Ue.multiply(e,(1-s)*n),Ue.multiply(o,r)))},lerp:(t,e,i)=>(i=_t(i,0,1),Ue.addVec(Ue.multiply(t,1-i),Ue.multiply(e,i))),equals:(t,e)=>Lt(t.x,e.x)&&Lt(t.y,e.y)&&Lt(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)})},Ye=Number.MAX_SAFE_INTEGER,He=-Number.MAX_SAFE_INTEGER,Xe=m(u(Ye,Ye),u(He,He)),We=m(f(Ye,Ye,Ye),f(He,He,He)),je=(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))},$e=(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),qe=(t,e)=>({min:{x:Math.min(t[0].x,e[0].x),y:Math.min(t[0].y,e[0].y)},max:{x:Math.max(t[2].x,e[2].x),y:Math.max(t[2].y,e[2].y)}}),Ke=t=>{const e=t.length;for(let i=0;ie+t,Qe=(t,e,i)=>{const s=pi(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=pi(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)},ti=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,ei=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},ii=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},si=(t,e,i)=>yi(t,mi(pi(e,t),i)),ri=(t,e,i)=>Ue.addVec(t,Ue.multiply(Ue.subtractVec(e,t),i));function ni(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:Ye,y:Ye},max:{x:He,y:He}};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},ai=(t,e)=>m(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 li(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}function ui(t,e,i){return u(Math.cos(i)*(t.x-e.x)+Math.sin(i)*(t.y-e.y)+e.x,-Math.sin(i)*(t.x-e.x)+Math.cos(i)*(t.y-e.y)+e.y)}function ci(t,e){return u(t.x-e.x,t.y-e.y)}function di(t){const e=gi(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function fi(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=di(i);const s=Math.PI/2,r=i.x;return i.x=-Math.sin(s)*i.y,i.y=r*Math.sin(s),i}function gi(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function mi(t,e){return u(t.x*e,t.y*e)}function yi(t,e){return u(t.x+e.x,t.y+e.y)}function pi(t,e){return u(t.x-e.x,t.y-e.y)}function Ai(t,e){return u(t.x*e.x,t.y*e.y)}function xi(t,e){return u(t.x/e.x,t.y/e.y)}function Si(t){return mi(t,-1)}function vi(t,e){return t.x*e.x+t.y*e.y}const bi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},Mi=(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 Ci(t){return t*Math.PI/180}function Ti(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function wi(t){return u(Math.cos(t),Math.sin(t))}const Ei=(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)},ki=(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 Ii{constructor(){this.Yt=!0}getInnerStart(){return this.$}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.j-this.$)}q(t,e){return this.Yt=t!==this.$||e!==this.j,this.$=t,this.j=e,this}J(){return this.Yt=!1,this}K(){return this.Yt=!0,this}}class zi extends Ii{constructor(t,e,i,s){if(super(),this.Ht=!0,this.Xt=!0,this.$t=[0,0],this.jt=!0,this.Zt=t,this.Qt=e,this.Jt=i,this.Kt=t,this.qt=e,s){const t=s.G(this.ti.bind(this));this.ti(s.C()),this.ii=()=>s.W(t)}}it(t){return this.Z=t,this.Xt=!0,this}si(t){return this.$t=t.map(Math.abs),this.jt=!0,this}ei(){return this.Zt/this.Jt*this.Z+this.$t[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.Z-this.$t[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.Z}getCellSize(){return this.ai(this.Z)}ni(){return this.$t[0]+this.$t[1]}li(){return this.$t}ti(t){this.Jt=t.reduce(Je,0),this.Zt=t.reduce(((t,e,i)=>i>=this.Kt?t:t+e),0),this.Qt=t.reduce(((t,e,i)=>i>=this.Kt&&iOi;return!n&&!o||!!r&&(e>t?{start:n?Pi:t,end:o?Oi:e}:{start:o?Oi:t,end:n?Pi:e})}ft(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Pi);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}dt(t){const e=this.ei(),i=(t-e)/(this.hi()-e),s=this.di.scaleStartLog+i*this.di.scaleIntervalLog;return this.ci.number**s}ui(){this.ci&&this.fi()}q(t,e){return super.q(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}it(t){return super.it(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:Ri(t),number:Di(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ft(t)+e;return this.dt(i)}yi(){return this.Xt||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.$),e=this.ci.function(this.j)-t,i=2*this.ei()/this.Z-1,s=2*this.hi()/this.Z-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}mi(){return this.di}}const Ri=t=>"e"===t?ue:le(t),Di=t=>"e"===t?Math.E:t,Pi=.9*10**-20,Oi=1.1*10**25,Li=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],_i=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-je(s,10),0);return t.toFixed(r)},Bi={Numeric:(t,e)=>_i(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let r="",n="";if(i>=1e3&&t>1e3){let e="";for(const i of Li){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),n=i.prefix;break}}r=(s?"-":"")+e}else{let e=String(Math.floor(t));const n=je(t,1e3);for(let t=1;t<=n;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}r=(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-je(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ri(s)(t);return`${s}${Vi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ri(s),n=Math.floor(r(t)),o=t/Di(s)**n;return`${Math.round(o)}×${s}${Vi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ri(s),n=Math.floor(r(t));return`${(t/Di(s)**n).toFixed(2)}×${s}${Vi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ri(s);if("e"===s)return`${Math.floor(r(t))}e`;const n=t.toString();if(t>1)return n;const o=Math.floor(r(t));return t.toFixed(Math.abs(o))},Scientific:(t,e)=>{const i=Math.max(Math.abs(e.getInnerStart()),Math.abs(e.getInnerEnd())),s=Math.floor(Math.log10(i));return 0===t?`0.00e${s<0?"":"+"}${s}`:t.toExponential(2)}},Vi=t=>Math.round(t).toString().split("").map((t=>{switch(t){case"0":return"⁰";case"1":return"¹";case"2":return"²";case"3":return"³";case"4":return"⁴";case"5":return"⁵";case"6":return"⁶";case"7":return"⁷";case"8":return"⁸";case"9":return"⁹";case"-":return"⁻";default:return t}})).join("");class Gi extends zi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.Si=!1,this.xi=0,this.Z=1e3,this.q(0,10),this.tt()}yi(){return this.Si}ut(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.vi){const i=((t,e,i)=>{const s=((t,e)=>{if(eHe&&tHe){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}}ui(){this.tt()}ft(t){return this.ei()+(t-this.$)/(this.j-this.$)*(this.hi()-this.ei())}dt(t){return this.$+(t-this.ei())/(this.hi()-this.ei())*(this.j-this.$)}q(t,e){return super.q(t,e),this.tt(),this}si(t){return super.si(t),this.tt(),this}it(t){return super.it(t),this.bi=Ni(this.j-this.$,this.$t,this.Z,this.Qt,this.Jt),this.tt(),this}Mi(){return this.vi=!0,this}_i(){return this.vi}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}mi(){return this.di}K(){return super.K(),this.Si=!0,this}J(){return super.J(),this.Si=!1,this}Di(t,e=Bi.Numeric){return e(t,this)}Bi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Li(t){return Ni(t,this.$t,this.Z,this.Qt,this.Jt)}tt(){let t=this.$,e=this.j,i=0;this.vi&&(t=0,e=this.j-this.$,i=this.$);const s=e-t,r=Ni(s,this.$t,this.Z,this.Qt,this.Jt);this.Pi=t-this.$t[0]*r,this.Fi=e+this.$t[1]*r;const n=this.Fi-this.Pi,o=n-this.Ci,h=Math.abs(o/r),a=s-this.xi,l=Math.abs(a/r);(!this.di||h>=.4||l>=.4)&&(this.xi=s,this.Ci=n,this.bi=r,this.Si=!0);const u=this.Ci*this.Jt/(2*this.Qt),c=-(this.Pi-this.Ci*this.Zt/this.Qt)-u,d=2*this.ei()/this.Z-1,f=2*this.hi()/this.Z-1-d;this.di={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}pi(t,e){return t+this.bi*e}}const Ni=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Ui{Ri(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}J(){return this.x.J(),this.y.J(),this}K(){return this.x.K(),this.y.K(),this}it(t,e){return"object"==typeof t?(this.x.it(t.x),this.y.it(t.y)):(this.x.it(t),this.y.it(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}zi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}Vi(t,e){return this.x.q(t,e),this}Oi(t,e){return this.y.q(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.ni(),y:e-this.y.ni()}}Ni(){return this.x.yi()||this.y.yi()}}class Yi extends Ui{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ct(t,e,i,s){return this.x=new Gi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Gi(t.y,e.y,i.y,s?s.y:void 0),this}_i(){return this.x._i()||this.y._i()}Ui(){return u(this.x.getPixelSize(),this.y.getPixelSize())}mi(){return{x:this.x.mi(),y:this.y.mi()}}pi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Wi(t,e,i,s){const r=this.Ui(),n=fi(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 Hi extends Ui{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ft(t.x),s=this.y.ft(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.dt(r.x),y:this.y.dt(r.y)}}Wi(t,e,i,s){const r={x:this.x.ft(t.x),y:this.y.ft(t.y)},n={x:this.x.ft(e.x),y:this.y.ft(e.y)},o=di(pi(n,r)),h=fi(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.dt(a.x),y:this.y.dt(a.y)}}mi(){const t=this.x.mi(),e=this.y.mi();return{uScaleStart:[this.x.$,this.y.$],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 Xi=(t,e)=>t instanceof Fi||e instanceof Fi?(new Hi).Ri(t,e):(new Yi).Ri(t,e),Wi=t=>"client"===t,ji=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),$i=t=>"relative"===t,Zi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y),qi=(t,e,i)=>{if(t){const t={x:i.x.ei(),y:i.y.ei(),width:i.x.ri(),height:i.y.ri()};e.forEach((e=>{e.Yi=t}))}else e.forEach((t=>{t.Yi=void 0}))},Ki=(t,e)=>{var i;return e?"string"==typeof e?`${t} ${e}`:!1!==(null===(i=e.Hi)||void 0===i?void 0:i.displayInCursor)&&e.getUnits()?`${t} ${e.getUnits()}`:t:t},Ji=t=>{let e=!1,i={type:"linear"};if(t&&(void 0!==t.opposite&&(e=t.opposite),t.type&&"linear-highPrecision"===t.type&&(i={type:"linear-highPrecision"}),t.type&&"logarithmic"===t.type)){let s=10;if(t.base)if("E"===t.base||"e"===t.base||"natural"===t.base)s="e";else if("number"==typeof t.base)s=t.base;else if("string"==typeof t.base)try{s=Number(t.base)}catch(e){console.warn(`Unidentified logarithmic base "${t.base}"`)}i={base:s,type:"logarithmic"}}return{opposite:e,type:i}},Qi=(t,e,i,s=1)=>_t(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),ts=(t,e,i,s=1)=>{const r=i.ft(t),n=i.ft(e);return _t(i.dt(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};var es;e.HighlightModes=void 0,(es=e.HighlightModes||(e.HighlightModes={}))[es.noHighlighting=0]="noHighlighting",es[es.onHover=1]="onHover";class is{constructor(t,i,s,n){this.Xi=!0,this.$i=e.HighlightModes.onHover,this.ji=!1,this.Zi=!0,this.R=new r.Eventer,this.Qi=[],this.Ji=[],this.onMouseEnter=t=>this.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this._t=(t,i,s,r)=>{const n=this.Ki(r,i);this.R.emit("mouseEnter",this,i,n),this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.wt=(t,i,s)=>{this.R.emit("mouseLeave",this,i,void 0),this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.It=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseMove",this,e,r)},this.Ct=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseClick",this,e,r)},this.kt=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseDoubleClick",this,e,r)},this.Tt=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseDown",this,e,r)},this.Ft=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseUp",this,e,r)},this.Dt=(t,e,i,s,r)=>{const n=this.Ki(r,e);this.R.emit("mouseDragStart",this,e,i,n)},this.Pt=(t,e,i,s,r,n,o)=>{const h=this.Ki(o,e);this.R.emit("mouseDrag",this,e,i,s,r,h)},this.Bt=(t,e,i,s,r,n)=>{const o=this.Ki(n,e);this.R.emit("mouseDragStop",this,e,i,s,o)},this.Lt=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseWheel",this,e,r)},this.Rt=(t,i,s,r)=>{const n=this.Ki(r,i);this.R.emit("touchStart",this,i,n),this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Et=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("touchMove",this,e,r)},this.zt=(t,i,s,r)=>{const n=this.Ki(r,i);this.R.emit("touchEnd",this,i,n),this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.chart=t,this.qi=i,this.ts=s,this.ss=new Map,this.es=n,this.hs=this.es.rs(this,{ns:{themeEffectEnabled:this.ts.effectsText},os:{}}),this.chart.cs.us.ls(this,(t=>{this.ss.forEach(((e,i)=>i.ds(t))),this.Ji.forEach((e=>e.setHighlight(t))),this.Qi.forEach((e=>e.ds(t)))}),{animationEnabled:this.chart.getAnimationsEnabled()})}fs(){}As(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.ss.set(t,{isText:s});const r=Array.from(this.ss);this.hs.ns.gs(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.hs.os.gs(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Xi).setVisible(this.Zi).ds(this.chart.cs.us.ps(this,!0)),i&&t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragStartEventHandler(this.Dt).setMouseDragEventHandler(this.Pt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt);const n=t.onDispose((()=>{t.offDispose(n),this.ss.delete(t)}))}ys(t){this.Qi=t;const e=this.chart.cs.us.ps(this,!0);t.forEach((t=>{t.ds(e).vs(this.Zi)}))}Ki(t,e){}Ss(t){const e=this.chart.cs.xs(t);if(e&&Array.from(this.ss.keys()).includes(e.entity))return this.Ki(e.info,t)}setEffect(t){return this.hs.ns.bs(t&&this.ts.effectsText),this.hs.os.bs(t),this.chart.cs.Ms(),this}getEffect(){return this.hs.ns._s()||this.hs.os._s()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setIcon(t){return this.ws=t,this.chart.cs.Ms(),this}getIcon(){return this.ws}setName(t){return this.Cs=t,this.Ji.forEach((e=>e.setText(t))),this}getName(){return this.Cs||"Component"}dispose(){return this.ji||(this.ji=!0,this.ss.forEach(((t,e)=>e.dispose())),this.qi(this),this.Ji.forEach((t=>{t.dispose()})),this.Ji.length=0,this.R.emit("dispose",this),this.chart.cs.Ms()),this}setVisible(t){return t===this.Zi||(this.Zi=t,this.ss.forEach(((e,i)=>i.setVisible(t))),this.Qi.forEach((e=>e.vs(t))),this.Ji.forEach((e=>e.setOn(t))),this.R.emit("visibleStateChanged",this,this.Zi),this.chart.cs.Ms()),this}getVisible(){return this.Zi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setHighlight(t){return this.chart.cs.us.ks(this,t),this.R.emit("highlight",this,t),this}getHighlight(){return this.chart.cs.us.ps(this)}setAnimationHighlight(t){return this.chart.cs.us.Ts(this,t),this}getAnimationHighlight(){return this.chart.cs.us.Fs(this)}setMouseInteractions(t){return this.Xi=t,this.ss.forEach(((e,i)=>i.setMouseInteractions(t))),this.chart.cs.Ms(),this}getMouseInteractions(){return this.Xi}getIsUnderMouse(){if(!this.chart.cs.Is())return!1;for(const t of this.ss)if(t[0].Ps)return!0;for(const t of this.Qi)if(this.chart.cs.Ds(t))return!0;return!1}setHighlightOnHover(t){return this.$i=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.$i!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return this.styleLegendEntry(t,i),Ie(t,[this],{toggleVisibilityOnClick:e,label:this.getName(),style:void 0}),this.Ji.push(t),t.onDispose((()=>{const e=this.Ji.indexOf(t);e>=0&&this.Ji.splice(e,1)})),this}Bs(){return this.ws}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}offDispose(t){return this.R.off(t,"dispose")}}class ss extends is{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ls=!0,this.Rs=t,this.axis=s,this.At=r,this.Es=n,this.zs()}setClipping(t){return this.Ls=t,this.Rs.Ms(),this}getClipping(){return this.Ls}}const rs=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.Us?(this.Gs.splice(t,1),t-=1):this.Gs[t].state&&(s=!0);return this.Ns?0===e.interactions.length&&(this.Gs.push({state:!1,time:i}),this.Ns=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Gs.push({state:!0,time:i}),s=!0,this.Ns=!0),s}Os(t,e,i){if(i){const i=this.Gs.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Ws(t,e),this.Gs.length=0)}}},hs=class{constructor(t,e,i,s=1,r=100){this.Ys=t,this.Hs=e,this.Xs=i,this.$s=s,this.js=r}Vs(t,e){const i=e.interactions.length;if(i===this.$s){if(void 0!==this.Zs)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=rs(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class ds{constructor(t,e){this.te=t,this.ie=e,this.se=e.rows*Us,this.ee=e.columns*Ys}}var fs,gs;e.OnScreenMenuButtonType=void 0,(fs=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[fs.ZoomIn=0]="ZoomIn",fs[fs.ZoomInX=1]="ZoomInX",fs[fs.ZoomInY=2]="ZoomInY",fs[fs.ZoomOut=3]="ZoomOut",fs[fs.ZoomOutX=4]="ZoomOutX",fs[fs.ZoomOutY=5]="ZoomOutY",fs[fs.ZoomToFit=6]="ZoomToFit",fs[fs.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(gs=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[gs.Circle=0]="Circle",gs[gs.Rectangle=1]="Rectangle",gs[gs.RoundedRectangle=2]="RoundedRectangle";const ms={x:-43,y:0},ys={x:-65,y:0},ps={x:-86,y:0},As={x:-107,y:-1},xs={x:-128,y:-3},Ss={x:-150,y:0},vs={x:-171,y:0},bs={x:-276,y:0},Ms={x:-298,y:0},Cs={x:0,y:0},Ts={x:-21,y:0};class ws extends ds{constructor(t,e,i,s){super(t,i),this.he=zt.document.createElement("button"),this.re=zt.document.createElement("div"),this.ne=zt.document.createElement("label"),this.ie=i,this.oe=e,this.ae=s}le(t,e,i,s){this.ue(t,s),this.ce(),this.de(e),this.fe(),this.ne.textContent=i||"";const r=zt.document.createElement("div");this.Ae(r),this.he.onclick=this.onClick.bind(this),r.appendChild(this.re),r.appendChild(this.ne),this.he.appendChild(r)}fe(){this.he.style.cursor="pointer"}Ae(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}de(t){"string"==typeof t?(this.re.style.backgroundImage=`url(${t})`,this.re.style.backgroundSize="100%",this.re.style.backgroundRepeat="no-repeat",this.re.style.backgroundPosition="center",this.re.style.width="20px",this.re.style.height="20px"):this.applyStyleForSprite(t),this.re.style.margin="auto"}ce(){switch(this.oe){case e.OnScreenMenuButtonShape.RoundedRectangle:this.he.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.he.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.he.style.borderRadius="31px"}}ue(t,e){this.he.style.width=`${this.ee.toString()}px`,this.he.style.height=`${this.se.toString()}px`,this.he.style.backgroundColor=t,this.he.style.opacity=e||Hs,this.he.style.alignItems="center",this.he.style.border="2px solid #707070",this.he.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.re.style.backgroundImage=`url(${this.te}/${Xs})`,this.re.style.backgroundPositionX=`${t.x}px`,this.re.style.backgroundPositionY=`${t.y}px`,this.re.style.backgroundSize="1600%",this.re.style.backgroundRepeat="no-repeat",this.re.style.width="20px",this.re.style.height="20px"}ge(t){return t.appendChild(this.he),t}pe(){return this.he}}class Es extends ws{constructor(t,e,i,s){super(t,e,i,s),this.ye="",this.me="",this.ve=!1,this.ae=s}Se(){this.xe(),this.onToggledStateAction()}be(){this.Me(),this.onInitialStateAction()}Me(){this._e(this.ye)}xe(){this._e(this.me)}_e(t){"string"==typeof t?this.re.style.background=t:(this.re.style.backgroundImage=`url(${this.te}/${Xs})`,this.re.style.backgroundPositionX=`${t.x}px`,this.re.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ve?this.be():this.Se(),this.ve=!this.ve}}class ks extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),ms)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:-1,y:-1})}}class Is extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),As)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:-1,y:0})}}class zs extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),Ss)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:0,y:-1})}}class Fs extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),ys)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:1,y:1})}}class Rs extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),xs)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:1,y:0})}}class Ds extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),vs)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:0,y:1})}}class Ps extends Es{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.ye=bs,this.me=Ms,this.le(s.onScreenMenuBackgroundColor.toRGBAString(),this.ye)}onToggledStateAction(){this.ae.setAnimationsEnabled(!1)}onInitialStateAction(){this.ae.setAnimationsEnabled(!0)}}class Os extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),ps)}onClick(){this.ae.forEachAxis((t=>{t.fit(!0)}))}}class Ls extends ws{constructor(t,e,i){super(t,e.shape||Ws,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.le(r,n,o,h),this.Ce=e.action}onClick(){this.Ce(this.ae)}}class _s extends Es{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.ae=i,this.ke=s,this.ye=Ts,this.me=Cs,this.le(js,this.ye)}Me(){this._e(this.ye),this.he.style.backgroundColor=js,this.he.style.border="2px solid #707070",this.he.style.margin="0px"}xe(){this._e(this.me),this.he.style.background="#FECC00 0% 0% no-repeat padding-box",this.he.style.border="10px solid #BCBCBC12",this.he.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.ke)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.ke)||void 0===t||t.style.setProperty("display","none")}}var Bs;e.MouseStyles=void 0,(Bs=e.MouseStyles||(e.MouseStyles={})).Move="move",Bs.ResizeColumn="col-resize",Bs.ResizeRow="row-resize",Bs.Horizontal="ew-resize",Bs.Vertical="ns-resize",Bs.NorthWest="nw-resize",Bs.NorthEast="ne-resize",Bs.Copy="copy",Bs.CrossHair="crosshair",Bs.Default="default",Bs.Help="help",Bs.Restricted="not-allowed",Bs.None="none",Bs.Point="pointer",Bs.Text="text",Bs.Wait="wait",Bs.ZoomIn="zoom-in",Bs.ZoomOut="zoom-out";const Vs={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)},Gs=new N({color:C(255,255,255,0)}),Ns=new us({thickness:1,fillStyle:Gs}),Us=60,Ys=60,Hs="1.0",Xs="osm/osm-sprite-transparent.png",Ws=e.OnScreenMenuButtonShape.Circle,js="#363636";var $s;e.OSMPosition=void 0,($s=e.OSMPosition||(e.OSMPosition={}))[$s.TopRight=0]="TopRight",$s[$s.TopLeft=1]="TopLeft",$s[$s.BottomLeft=2]="BottomLeft",$s[$s.BottomRight=3]="BottomRight";class Zs extends ss{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Cs="Band",this.Te=0,this.Fe=0,this.Ie=this.ts.bandFillStyle,this.Pe=this.ts.bandStrokeStyle,this.De=!0,this.Be=this.Rs.Ee(this.At).Re(this.Ie).Le(this.Pe).ds(this.getHighlight()),this.As(this.Be)}setValueStart(t){return this.Te=t,this.R.emit("valueChange",this,this.Te,this.Fe),this.Rs.Ms(),this}getValueStart(){return this.Te}setValueEnd(t){return this.Fe=t,this.R.emit("valueChange",this,this.Te,this.Fe),this.Rs.Ms(),this}getValueEnd(){return this.Fe}setFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;return this.Be.Re(e),this.Rs.Ms(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){this.Pe="function"==typeof t?t(this.Pe):t;const e=this.Pe;return this.Be.Le(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}ze(){return this.Be.Ve(this.Es.toVec2(this.Te,this.Es.getHeight(this.At).getInnerStart())).it(this.Es.toVec2(this.Fe-this.Te,this.Es.getHeight(this.At).getInnerInterval())),qi(this.Ls,[this.Be],this.At),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}Oe(t,e){t.ds(e),this.Rs.Ms()}setDefaultMouseInteractions(t){return this.De=t,this}zs(){let t,i;const s=(e,s)=>{if(!this.De)return;const r=yt(this.Rs.cs.Ne(s.x,s.y),this.Rs.cs.At,this.At),n=this.Es.getWidth(r),o=this.axis.At.ft(this.Te),h=this.axis.At.ft(this.Fe),a=(this.axis.At.ft(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this.De)return;const h=this.Es.getWidth(n);t?(this.Te=this.axis.At.pi(this.Te,h),this.Fe=this.axis.At.pi(this.Fe,h)):i?this.Te=this.axis.At.pi(this.Te,h):this.Fe=this.axis.At.pi(this.Fe,h),se(o),this.R.emit("valueChange",this,this.Te,this.Fe),this.Rs.Ms()};this.onMouseMove(((i,r)=>{if(!this.De)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Es.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ge=this.chart.engine.setMouseStyle(n,this.Ge)})),this.onMouseLeave((()=>{this.De&&(this.chart.engine.restoreMouseStyle(this.Ge),this.Ge=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this.De&&0===i&&r(0,0,0,n,e)}));const n=ns(new hs(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class qs extends ss{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Cs="Constant Line",this.M=0,this.Pe=this.ts.constantLineStrokeStyle,this.Ue=!0,this.De=!0,this.We=this.Rs.He(this.At).Ye(this.Pe).ds(this.getHighlight()),this.As(this.We)}setValue(t){return this.M=t,this.R.emit("valueChange",this,this.M),this.Rs.Ms(),this}getValue(){return this.M}setStrokeStyle(t){this.Pe="function"==typeof t?t(this.Pe):t;const e=this.Pe;return this.We.Ye(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}setInteractionMoveByDragging(t){return this.Ue=t,this}getInteractionMoveByDragging(){return this.Ue}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}ze(){return this.We.$e(this.Es.toVec2(this.M,this.Es.getHeight(this.At).getInnerStart())).Xe(this.Es.toVec2(this.M,this.Es.getHeight(this.At).getInnerEnd())),qi(this.Ls,[this.We],this.At),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Pe})}Oe(t,e){t.ds(e),this.Rs.Ms()}setDefaultMouseInteractions(t){return this.De=t,this}zs(){const t=(t,e)=>{this.De&&this.Ue&&(this.M=this.axis.At.pi(this.M,this.Es.getWidth(e)),this.R.emit("valueChange",this,this.M),this.Rs.Ms(),se(t))};this.onMouseMove((()=>{if(this.De&&this.Ue){const t=this.Es.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ge=this.chart.engine.setMouseStyle(t,this.Ge)}})),this.onMouseLeave((()=>{this.De&&this.Ue&&(this.chart.engine.restoreMouseStyle(this.Ge),this.Ge=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.De&&this.Ue&&0===s&&t(i,n)}));const i=ns(new hs(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Ks={fitting:{start:(t,e,i,s)=>e>=t?i:s,end:(t,e,i,s)=>e>=t?s:i,allowIntervalLengthChange:!0},expansion:{start:(t,e,i,s)=>e>=t?it?s:t,end:(t,e,i,s)=>e>=t?s>e?s:e:ie>t?Ks.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Ks.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Ks.regressive.start(t,e,i,s)+(e-t):i{if(e>=t){if(is?s:t}if(s>t)return t+(t-e);const r=t-.5*(t-e);return s{if(e>=t){if(s>e)return e+(e-t);const i=e-.5*(e-t);return sr?r:e},allowIntervalLengthChange:!0}},Js={Empty:"Empty",Numeric:"Numeric",DateTime:"DateTime",Time:"Time"},Qs=t=>void 0!==t.je&&void 0!==t.Ze,tr=t=>void 0!==t.Qe,er=t=>void 0!==t.Je,ir=(t,e)=>[t,e],sr=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Lt(t,0)&&(t=0),Lt(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},or=(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)}},hr=(...t)=>{const e=t.length>0?t.length:0;return(i,s,r,n,o,h)=>{if(s>=e)return;const a=t[s]||1;return i.filter(((t,e)=>e%a==0))}},ar=s.Record({type:"empty-ticks",cursorFormatter:void 0});class lr extends ar{Ke(t){return{qe:[],th:[],ih:this.cursorFormatter?this.cursorFormatter:Bi.Numeric,sh:void 0,eh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}}const ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),cr=(t,e)=>{if(e.has(t))return e.get(t);const i=ni(t.rh.hh());if(Te(i))return i;const s=t.oh.pi(i.min,{x:-5,y:-5}),r=t.oh.pi(i.min,{x:5,y:5}),n=t.oh.pi(i.max,{x:-5,y:-5}),o=t.oh.pi(i.max,{x:5,y:5}),h={min:{x:Math.min(s.x,r.x,n.x,o.x),y:Math.min(s.y,r.y,n.y,o.y)},max:{x:Math.max(s.x,r.x,n.x,o.x),y:Math.max(s.y,r.y,n.y,o.y)}};return e.set(t,h),h},dr=t=>{const e=new Map;if(!ur(t)){for(const i of t.qe)e.set(i,new Map);for(const i of t.th)e.set(i,new Map)}return e},fr=(new lr).Ke({type:"linear"});class gr{constructor(t,e,i,s,n,o,h){this.R=new r.Eventer,this.ah=fr,this.lh=Js.Empty,this.uh=new Map,this.dh=new Map,this.fh=Ks.fitting,this.Ah=!0,this.gh=q((()=>this.chart.cs.Ms()))(300,$.linear),this.ph=!0,this.Zi=!0,this.yh=!1,this.mh=He,this.Sh=!1,this.xh=!1,this.bh=He,this.Mh=He,this._h=He,this.wh=!1,this.Ch="",this.kh={},this.Th=()=>{this.Fh.setMouseInteractions(!0).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMoveTitle",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterTitle",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeaveTitle",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownTitle",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpTitle",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickTitle",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickTitle",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelTitle",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartTitle",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragTitle",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopTitle",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartTitle",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMoveTitle",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndTitle",this,e))),this.Th=void 0},this.Ih=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.uh.get(e),l=(t?t.get(a):void 0)||this.Ph(a,e);l.Dh=!1;const u=this.Bh(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.Lh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Eh!==i||!!t.find((t=>t===e)))).map((t=>$e(e,cr(t,a))?t:void 0)),m=p.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>tr(t.Eh)))&&(t=!1),t&&i.zh&&i.zh.Vh&&!1===i.zh.Vh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.ah.ih(t,this.At),this.Oh=!0,this.Nh=!0,this.chart=t,this.Gh=e,this.ts=s,this.Uh=o,this.At=i,this.Wh=h,"logarithmic"===h.type&&this.setAnimationZoom($.logarithmic(Di(h.base))),this.Yh=o.numeric,this.Hh("Numeric"),this.Xh=i.getInnerStart(),this.$h=i.getInnerEnd(),this.setAnimationsEnabled(n)}setUnits(t,e={}){return this.jh=t,this.Hi=e,this.Zh(),this}getUnits(){return this.jh}setDefaultInterval(t,e){return this.Qh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.wh=!0,this.chart.cs.Ms()),this}getDefaultInterval(){return this.Qh}getTitle(){return this.Ch}setTitle(t){return this.Ch=t,this.Zh(),this}getTitleFillStyle(){return this.Fh.Jh()}setIntervalRestrictions(t){return this.Kh=t,this.chart.cs.Ms(),this}getIntervalRestrictions(){if("function"==typeof this.Kh){const t=this.qh();return this.Kh({curStart:this.Xh,curEnd:this.$h,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max})}return this.Kh}setTitleFillStyle(t){return this.Fh.Re(t),this.chart.cs.Ms(),this}getTitleFont(){return this.Fh.tr()}setTitleFont(t){return this.Fh.ir(t),this.chart.cs.Ms(),this}setTitleRotation(t){return this.Fh.sr(t),this.chart.cs.Ms(),this}getTitleRotation(){return this.Fh.er()}setTitleEffect(t){return this.hr.bs(t),this.chart.cs.Ms(),this}getTitleEffect(){return this.hr._s()}Hh(t,e){if(this.uh.size>0&&this.rr(),"Empty"===t){const i=e||(t=>t);this.Yh=i(new lr),this.ah=this.Yh.Ke(this.Wh),this.lh=t}else if("Numeric"===t){"Numeric"!==this.lh&&(this.Yh=this.Uh.numeric);const i=e||(t=>t);this.Yh=i(this.Yh),this.ah=this.Yh.Ke(this.Wh),this.lh=t}else if("DateTime"===t){"DateTime"!==this.lh&&(this.Yh=this.Uh.datetime);const i=e||(t=>t);this.Yh=i(this.Yh),this.ah=this.Yh.Ke(this.Wh),this.lh=t}else if("Time"===t){"Time"!==this.lh&&(this.Yh=this.Uh.time);const i=e||(t=>t);this.Yh=i(this.Yh),this.ah=this.Yh.Ke(this.Wh),this.lh=t}return this.dh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.dh=dr(this.ah),this.chart.cs.Ms(),this}nr(){return this.ah}ar(t){this.ah=t,this.dh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.dh=dr(this.ah),this.chart.cs.Ms()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.yt(void 0!==e?e:this.Xh,void 0!==i?i:this.$h,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}yt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=!0,h=Math.abs(e-t);if(Math.abs(this.$h-this.Xh),void 0!==this.ah.sh&&this.ah.sh>h){const i=(e+t)/2,s=this.ah.sh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.ah.eh&&this.ah.ehe?-1:1);n={start:i-s,end:i+s}}const a=this.At.ut(n.start,n.end,this.Xh,this.$h,o);if(!1===a)return this;if(!0===a);else if(n=a,"zoomBandChart"===r)return this;let l;switch(r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return ze(0,""),this}if(this.lr&&this.lr.finishAll(!1),this.gh&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.lr||this.lr.isOver()?this.gh:this.lr.NextAnimation.bind(this);this.lr=e([[this.Xh,n.start],[this.$h,n.end]],(([t,e])=>{this.ur(t,e,o)}),t),this.lr.onAnimationEnd((()=>{this.lr=void 0,l&&(this._h=zt.performance.now())})),this.lr.onAnimationEnd((()=>this.setStopped(s)))}else this.ur(n.start,n.end,o),this.setStopped(s),l&&(this._h=zt.performance.now());return this}getInterval(){return{start:this.Xh,end:this.$h}}setStopped(t){return t===this.yh||(t&&(this.lr&&this.lr.finishAll(!1),this.lr=void 0),this.yh=t,this.R.emit("stoppedStateChanged",this,this.yh),this.mh=zt.performance.now(),this.chart.cs.Ms()),this}getStopped(){return this.yh}onStoppedStateChanged(t){return this.R.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.R.off(t,"stoppedStateChanged")}fit(t,e){const i=this.qh(),s=this.Qh||xr,r="function"==typeof s?s({curStart:this.Xh,curEnd:this.$h,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.yt(void 0!==r.start?r.start:this.Xh,void 0!==r.end?r.end:this.$h,void 0!==r.animate?r.animate:void 0===t||t,void 0!==r.stopAxisAfter?r.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.fh=t,this.chart.cs.Ms(),this}getScrollStrategy(){return this.fh}setAnimationScroll(t){return this.Ah=Boolean(t),this.chart.cs.Ms(),this}setAnimationZoom(t,e=300){return this.lr&&(this.lr.finishAll(!1),this.lr=void 0),this.gh=t?q((()=>this.chart.cs.Ms()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ph=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom($.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ph}setVisible(t){const e=this.Zi!==t;return this.Zi=t,this.Fh.setVisible(t),this.cr((e=>{e.rh.setVisible(t)})),e&&this.R.emit("visibleStateChanged",this,this.Zi),this}getVisible(){return this.Zi}onIntervalChange(t){return this.R.on("scaleChange",t)}offIntervalChange(t){return this.R.off(t,"scaleChange")}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}dr(t,e){this.Th&&this.Th();const i=new Map;if(ur(this.ah)||!this.Zi)return this.rr(),i;e=e||new Map;const s=this.Ar(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.kh.physicalAxisSize=h;const a=yr(this.ah,r,n,this.Xh,this.$h,h),l=[];if(this.gr(),l.push(...this.pr(this.ah,r,n,a,e,t,i)),this.yr(this.ah,r,n,a,e,t,l,i),this.mr(),a)for(const[t,e]of this.dh){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.kh.min=r,this.kh.max=n,this.kh.scaleInterval=o,this.kh.physicalAxisSize=h,i}vr(t){const e=t.Eh.Ze;t.rh.Sr(e(t.M,this.At)).Os()}br(t,e){const i=e.je;t.rh.Re(i.getLabelFillStyle()).ir(i.getLabelFont()).sr(i.getLabelRotation())}Ph(t,e){const i=this.dh.get(e);let s=i.get(t);s?(i.delete(t),s.Eh=e,s.vs(!0)):s=this.Mr(t,e);const r=this.uh.get(e)||new Map;return r.set(t,s),this.uh.set(e,r),this.br(s,e),s}Bh(t,e){const i=this._r(t,e);return this.vr(t),i}pr(t,e,i,s,r,n,o){const h=[];for(const a of t.qe){const t=s.get(a);for(const s of t){if(si)continue;const t=this.uh.get(a),l=(t?t.get(s):void 0)||this.Ph(s,a),u=this.Bh(l,n),c=cr(l,r);h.find((t=>$e(c,cr(t,r))))&&l.rh.setVisible(!1),l.Dh=!1,o.set(l,u),h.push(l)}}return h}yr(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.th){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.zh){p=!1;break}const t=u.zh.wr;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const y=this.Lh(m.filter((t=>a.some((e=>Lt(t.M,e))))),g,u,d,n,h,e,i,r,o,l);!0!==y?t=t.concat(y):(d+=1,f=-1,t=[])}y=t,m.forEach((e=>{t.find((t=>t===e))||this.Cr(e)}))}if(l=y,!p)break}}Cr(t){const e=this.uh.get(t.Eh);null==e||e.delete(t.M);const i=this.dh.get(t.Eh);i&&i.has(t.M)?t.dispose():i&&(t.vs(!1),i.set(t.M,t))}cr(t){for(const e of this.uh.values())for(const i of e.values())t(i)}kr(t,e){for(const i of this.uh.values())for(const s of i.values())e=t(e,s);return e}rr(){this.uh.forEach(((t,e)=>{t.forEach((t=>this.Cr(t)))})),this.uh.clear()}gr(){for(const t of this.uh.values())for(const e of t.values())e.Dh=!0}mr(){for(const t of this.uh.values())for(const[e,i]of t.entries())i.Dh&&(i.dispose(),t.delete(e))}Ar(){const t=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart();return m(t,e)}Rh(t,e){return!(t.Dh||0===t.rh.Tr().length||tr(e)&&!0!==e.Fr)}Ir(t,e){return ur(this.ah)||(this.ah.qe.forEach((i=>{e=t(e,i.je)})),this.ah.th.forEach((i=>{(t=>void 0!==t.Ze)(i)&&(e=t(e,i.je))}))),e}qh(){let t=this.Gh.Pr();const e=this.Gh.Dr();let i;if(void 0!==t&&Rt(t)&&void 0!==e&&Rt(e)&&("logarithmic"===this.Wh.type&&(0===t&&(t=Math.min(1,e)),Math.sign(t)!==Math.sign(e)&&(t=Math.min(1,e-.1))),i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,e)):i=m(t,e)),i&&Rt(i.min)&&Rt(i.max))return Lt(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}Br(){if(!this.Oh)return 0;let t=0;const e=this.Gh.Lr();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this.Oh=t,this.chart.cs.Ms(),this}Rr(){var t;const e=this.Sh;let i=!1;if(this.wh&&this.Qh){const t=this.qh();if(t){const e="function"==typeof this.Qh?this.Qh({curStart:this.Xh,curEnd:this.$h,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Qh;this.setInterval(e),this.wh=!1}}if(this.fh&&!this.yh){const e=this.qh();if(e){const s=this.Xh,r=this.$h;let n=this.fh.start(s,r,e.min,e.max),o=this.fh.end(s,r,e.min,e.max);const h=null===(t=this.fh.allowIntervalLengthChange)||void 0===t||t,a=Ar(this.Kh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Lt(s,n),u=!1===Lt(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.Ah&&!this.Nh)if(this.Ah){t=!0;const e=l?this.Er(s,n):s,a=u?this.Er(r,o):r;if(!0===this.ur(e,a,h)&&(l&&!1===Lt(e,n)||u&&!1===Lt(a,o))){this.chart.cs.Ms(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.xh=t>=1.4}}else t=!1;t||this.ur(n,o,h),this.Nh=!1}}}return i?(this.Sh!==i&&(this.Sh=i,this.bh=zt.performance.now()),this.zr&&(clearTimeout(this.zr),this.zr=void 0)):!0===e&&void 0===this.zr&&(this.xh=!1,this.zr=setTimeout((()=>{!1!==this.Sh&&(this.Sh=!1,this.bh=zt.performance.now()),this.zr=void 0,this.chart.cs.Ms()}),200)),this}ur(t,e,i){let s={start:t,end:e},r=!0;if(this.Kh){const t=this.qh();s=Ar(this.Kh,t,s,{start:this.Xh,end:this.$h},i)}const n=Math.abs(e-t),o=Math.abs(this.$h-this.Xh);if(void 0!==this.ah.sh&&this.ah.sh>n){const n=(e+t)/2,h=(i?this.ah.sh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.ah.eh&&this.ah.ehe?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.At.ut(s.start,s.end,this.Xh,this.$h,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.Br(),l=this.Vr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.At.ut(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Xh,this.$h,!1),!!h&&(!0===h?this.At.q(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.At.q(s.start,s.end),this.Xh=s.start,this.$h=s.end,this.R.emit("scaleChange",this,s.start,s.end),this.Mh=zt.performance.now(),this.chart.cs.Ms(),r)}Or(){return this.Sh}Nr(){return void 0!==this.lr}Zh(){var t;const e=!1!==(null===(t=this.Hi)||void 0===t?void 0:t.displayOnAxis);this.Fh.Sr(this.jh&&e&&this.Ch?`${this.Ch} (${this.jh})`:this.Ch),this.chart.cs.Ms()}onTitleMouseEnter(t){return this.R.on("mouseEnterTitle",t)}offTitleMouseEnter(t){return this.R.off(t,"mouseEnterTitle")}onTitleMouseMove(t){return this.R.on("mouseMoveTitle",t)}offTitleMouseMove(t){return this.R.off(t,"mouseMoveTitle")}onTitleMouseLeave(t){return this.R.on("mouseLeaveTitle",t)}offTitleMouseLeave(t){return this.R.off(t,"mouseLeaveTitle")}onTitleMouseDown(t){return this.R.on("mouseDownTitle",t)}offTitleMouseDown(t){return this.R.off(t,"mouseDownTitle")}onTitleMouseUp(t){return this.R.on("mouseUpTitle",t)}offTitleMouseUp(t){return this.R.off(t,"mouseUpTitle")}onTitleMouseClick(t){return this.R.on("mouseClickTitle",t)}offTitleMouseClick(t){return this.R.off(t,"mouseClickTitle")}onTitleMouseDoubleClick(t){return this.R.on("mouseDoubleClickTitle",t)}offTitleMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClickTitle")}onTitleMouseDragStart(t){return this.R.on("mouseDragStartTitle",t)}offTitleMouseDragStart(t){return this.R.off(t,"mouseDragStartTitle")}onTitleMouseDrag(t){return this.R.on("mouseDragTitle",t)}offTitleMouseDrag(t){return this.R.off(t,"mouseDragTitle")}onTitleMouseDragStop(t){return this.R.on("mouseDragStopTitle",t)}offTitleMouseDragStop(t){return this.R.off(t,"mouseDragStopTitle")}onTitleMouseWheel(t){return this.R.on("mouseWheelTitle",t)}offTitleMouseWheel(t){return this.R.off(t,"mouseWheelTitle")}onTitleTouchStart(t){return this.R.on("touchStartTitle",t)}offTitleMouseTouchStart(t){return this.R.off(t,"touchStartTitle")}onTitleTouchMove(t){return this.R.on("touchMoveTitle",t)}offTitleTouchMove(t){return this.R.off(t,"touchMoveTitle")}onTitleTouchEnd(t){return this.R.on("touchEndTitle",t)}offTitleTouchEnd(t){return this.R.off(t,"touchEndTitle")}}class mr{constructor(t,e,i,s,r=i.Wr(s).Ur(Le).Gr(Le).setMouseInteractions(!1)){this.Dh=!1,this.ji=!1,this.ss=[],this.Eh=t,this.M=e,this.Yr=i,this.oh=s,this.rh=r,this.ss.push(r)}vs(t){this.ss.forEach((e=>e.setVisible(t)))}dispose(){return this.ji||(this.ji=!0,this.ss.forEach((t=>t.dispose()))),this}}const yr=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.qe){let t=n.Hr(e,i,s,r);t=pr(t),o.set(n,t)}let h;for(const s of t.th){let t;if(void 0===h)t=s.Hr(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.Xr&&s.Xr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Ar=(t,e,i,s,r)=>{const n="function"==typeof t?t({curStart:s.start,curEnd:s.end,dataMin:null==e?void 0:e.min,dataMax:null==e?void 0:e.max}):t;if(!n)return i;const o={start:i.start,end:i.end};let h=Math.abs(i.end-i.start);if(void 0!==n.intervalMin&&hn.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*n.intervalMax,o.end=t+.5*Math.sign(i.end-t)*n.intervalMax}return h=Math.abs(i.end-i.start),void 0!==n.startMin&&(o.start=Math.max(o.start,n.startMin),r||Lt(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.startMax&&(o.start=Math.min(o.start,n.startMax),r||Lt(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMin&&(o.end=Math.max(o.end,n.endMin),r||Lt(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMax&&(o.end=Math.min(o.end,n.endMax),r||Lt(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},xr=t=>{if(void 0===t.dataMin||void 0===t.dataMax)return{stopAxisAfter:!1};const e=t.curEnd>=t.curStart;return{start:e?t.dataMin:t.dataMax,end:e?t.dataMax:t.dataMin,stopAxisAfter:!1}},Sr=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class vr extends Sr{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 br=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),Mr=new vr,Cr=new class{getFillStyle(){return _}},Tr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new N,wireframeStyle:ut});class wr extends Tr{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 Er=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),kr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new N});class Ir extends kr{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 zr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),Fr={Triangulated:wr,Pixelated:Ir};class Rr{constructor(t){this.$r=new Map,this.cs=t}ls(t,e,i){const s=i.animationEnabled;this.$r.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.$r.delete(t),t.offDispose(r)}))}jr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.$r.delete(t)})),t.offDispose(r)}));return{Zr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.$r.set(t,r)},Qr:()=>{s.forEach((t=>{this.$r.delete(t)})),s.length=0},Jr:t=>{i=t,s.forEach((t=>{this.Ts(t,i)}))},Kr:()=>i}}ks(t,e){const i=this.$r.get(t);i&&(i.curUnanimatedHighlightValue=ke(e),this.cs.Ms())}ps(t,e=!1){const i=this.$r.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Ts(t,e){const i=this.$r.get(t);i&&(i.animationEnabled=e)}Fs(t){const e=this.$r.get(t);return!!e&&e.animationEnabled}Os(t){let e=!1;this.$r.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.cs.Ms(!0)}}const Dr=new Map,Pr=(t,e)=>{const i=t.getSize(),s=t.getFamily(),r=t.getWeight(),n=t.getStyle(),o=t.getVariant(),h=`${n} ${o?"small-caps":"normal"} ${r} ${i}px ${s}`,a=`${h} ${e.toFixed(2)}`;let l=Dr.get(a);return l||(l=((t,e,i,s)=>({font:t,properties:e,dpr:i,id:s}))(h,{type:"font",size:i,family:s,style:n,variant:o,weight:r},e,a),Dr.set(a,l)),l};var Or,Lr;!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"}(Or||(Or={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(Lr||(Lr={}));const _r=t=>({container:t.qr,setMouseStyle:(e,i)=>t.tn(e,i),restoreMouseStyle:e=>t.sn(e),captureFrame:(e,i,s)=>t.en(e,i,s),renderFrame:(e,i,s=!1)=>t.hn(e,i,s),layout:()=>{t.rn(),t.nn(),t.ln.an(),t.Ms()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.un(e,i),onRenderFrame:e=>t.cn(e),offRenderFrame:e=>t.dn(e)}),Br=[];let Vr;const Gr=()=>{if(void 0!==Vr){const t=zt.getComputedStyle(zt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Vr.style.height=zt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Ms()),60),this.gn=u(0,0),this.pn=!1,this.yn=Ot,this.mn=()=>{},this.vn=[],this.Sn=-1,this.xn=[],this.bn=!0,this.ji=!1,this.Mn=!1,this.nn=()=>{const{bottom:t,left:e}=this.qr.getBoundingClientRect();return this.gn=u(Math.floor(e),Math.floor(t)),this},this._n=t=>{if(this.wn){const e=this.wn.entity.Cn;e&&e(this.wn.entity,t,this.wn.button,this.wn.startLocation,this.wn.collectionMember,this.wn.info),this.wn=void 0}},this.rn=()=>{this.kn&&this.kn()},this.tn=(t,e)=>{if(!e){this.qr.style.cursor=t;const e=this.Sn;return this.Sn+=1,this.xn.push([e,t]),e}return this.sn(e),this.tn(t)},this.sn=t=>{const e=t?this.xn.findIndex((e=>e[0]===t)):-1;e>=0?(this.xn.splice(e,1),this.xn.length>0?this.qr.style.cursor=this.xn[this.xn.length-1][1]:this.qr.style.cursor="default"):(this.xn.push([0,"default"]),this.qr.style.cursor="default")},this.Tn=t=>(this.Fn._(t),this),this.In=()=>this.Fn.C(),this.Pn=()=>{this.yn&&this.yn(1e3/60),this.Dn(),this.Bn(),this.mn&&this.mn()},this.Ln=t=>(this.fn.set(t.Rn(),t),this.fn=new Map([...this.fn.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.En=t=>(this.fn.delete(t),this),this.J=()=>(this.Fn.u=!1,this),this.K=()=>(this.Fn.u=!0,this),this.zn=t=>{if(!this.bn)return;const e=this.Vn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.xs({x:t.clientX,y:t.clientY});if(this.On&&((null==s?void 0:s.entity)!==this.On.entity||s.collectionMember!==this.On.collectionMember)&&!this.wn){this.On.entity.Ps=!1;const e=this.On.entity.Nn;e&&e(this.On.entity,t,this.On.collectionMember)}if(s&&s.entity.getMouseInteractions()&&!this.wn)if(s.entity.Ps){if(!i){const e=s.entity.Gn;e&&e(s.entity,t,s.collectionMember,s.info)}}else{s.entity.Ps=!0;const e=s.entity.Un;e&&e(s.entity,t,s.collectionMember,s.info)}if(this.wn){const i=this.wn.entity.Wn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.wn.entity,t,this.wn.button,this.wn.startLocation,s,this.wn.collectionMember,this.wn.info)}this.Yn=t,this.Vn=t,this.On=s?{...s,event:t}:void 0},this.Hn=t=>{if(this.bn=!1,this.Yn=t,this.On&&!this.Xn&&!this.wn){this.On.entity.Ps=!1;const e=this.On.entity.Nn;e&&e(this.On.entity,t,this.On.collectionMember),this.On=void 0}},this.$n=t=>{if(this.bn=!0,this.Yn=t,this.wn&&t.buttons<=0){const e=this.wn.entity.Cn;e&&e(this.wn.entity,t,this.wn.button,this.wn.startLocation,this.wn.collectionMember,this.wn.info),this.wn=void 0}if(this.Xn&&t.buttons<=0){const e=this.Xn.entity.jn;e&&e(this.Xn.entity,t,this.Xn.collectionMember,this.Xn.info),this.Xn=void 0}},this.Zn=()=>this.Yn&&this.Qn?this.Yn.timeStamp>this.Qn.timeStamp?this.Yn:this.Qn:this.Yn||this.Qn,this.ln=t,this.ts=e.theme,this.Jn=i.Jn,this.Kn=i.Kn,this.qn=i.qn,this.io={so:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,te:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:void 0,eo:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,ho:(()=>{const t=null==e?void 0:e.pickingPrecision;if("string"==typeof t){const e=t.toLowerCase();if("best"===e)return 1;if("high"===e)return.5;if("low"===e)return 1/8}return 1/4})(),ro:void 0===(null==e?void 0:e.interactable)||e.interactable,no:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=zt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.qr=t}else this.qr=s;zt.addEventListener("resize",this.rn),this.vn.push((()=>{zt.removeEventListener("resize",this.rn)}))}else{if(void 0===Vr){const t=zt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",zt.document.body.appendChild(t),Vr=t,zt.addEventListener("resize",Gr)}let t=1;for(;null!==zt.document.getElementById(`chart-${t}`);)t+=1;this.qr=zt.document.createElement("div"),this.qr.id=`chart-${t}`,this.qr.style.flex="1",this.qr.style.height="100%",Vr.appendChild(this.qr),Gr(),Br.push(this.rn),this.vn.push((()=>{Vr&&Vr.removeChild(this.qr),Br.includes(this.rn)&&Br.splice(Br.indexOf(this.rn),1),0===Br.length&&Vr&&(zt.document.body.removeChild(Vr),Vr=void 0,zt.removeEventListener("resize",Gr))}))}if(zt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.qr&&this.rn()};this.oo=new zt.ResizeObserver(t.bind(this)),this.oo.observe(this.qr)}""===this.qr.style.position&&(this.qr.style.position="relative"),this.qr.style.boxSizing="content-box",this.qr.addEventListener("fullscreenchange",this.rn),this.qr.addEventListener("webkitfullscreenchange",this.rn);const n=e?e.maxFps:void 0;this.ao=n?-1===n?-1:0!==n?1e3/n:0:0;const o=new Map;let h=!1;const a=(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":o.set(i.pointerId,s);break;default:o.delete(i.pointerId),h=!1}switch(i.interactions=Array.from(o.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(h=!0)};this.qr.onwheel=this.lo(Or.wheel),this.qr.oncontextmenu=this.lo(Or.contextmenu),this.qr.onclick=this.lo(Or.click),this.qr.ondblclick=this.lo(Or.dbclick),this.qr.onlostpointercapture=()=>{h=!1},this.qr.ontouchmove=t=>{h&&t.preventDefault()},this.qr.onpointerover=a(),this.qr.onpointerenter=a(this.$n),this.qr.onpointerdown=a(this.lo(Or.mouseDown),this.uo(Lr.touchStart)),this.qr.onpointermove=a(this.zn,this.uo(Lr.touchMove)),this.qr.onpointerup=a(this.lo(Or.mouseUp),this.uo(Lr.touchEnd)),this.qr.onpointercancel=a(),this.qr.onpointerout=a(),this.qr.onpointerleave=a(this.Hn,this.uo(Lr.touchEnd)),zt.addEventListener("dragstart",this._n),zt.addEventListener("scroll",this.nn,{passive:!0}),this.Fn=p(new b({r:0,g:0,b:0,a:0})),this.us=new Rr(this)}co(t,e){var i,s,r,n;(null===(i=this.On)||void 0===i?void 0:i.entity)===t.entity&&this.On.collectionMember===t.collectionMember&&(this.On={...e,info:this.On.info,event:this.On.event}),(null===(s=this.do)||void 0===s?void 0:s.entity)===t.entity&&this.do.collectionMember===t.collectionMember&&(this.do={...e,info:this.do.info}),(null===(r=this.Xn)||void 0===r?void 0:r.entity)===t.entity&&this.Xn.collectionMember===t.collectionMember&&(this.Xn={...e,info:this.Xn.info,event:this.Xn.event}),(null===(n=this.wn)||void 0===n?void 0:n.entity)===t.entity&&this.wn.collectionMember===t.collectionMember&&(this.wn={...e,info:this.wn.info,button:this.wn.button,startLocation:this.wn.startLocation})}fo(){this.Mn=!0,this.yn=void 0,this.mn=void 0}cn(t){return this.R.on("render",t)}dn(t){return this.R.off(t)}Ao(){return this.po}yo(){return this.mo}setBackgroundFillStyle(t){return this.vo.Re(t),this.Ms(),this}getBackgroundFillStyle(){return this.vo.Jh()}setBackgroundStrokeStyle(t){return this.vo.Le(t),this.Ms(),this}getBackgroundStrokeStyle(){return this.vo.So()}xo(t){return this.mn=t,this}bo(t){return this.yn=t,this}Mo(t){return this.fn.get(t)}_o(){return Array.from(this.fn.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}lo(t){return e=>this.wo(t,e)}wo(t,e){if(!this.bn)return;t===Or.contextmenu&&se(e);const i=this.xs({x:e.clientX,y:e.clientY});if(t===Or.mouseUp){if(this.wn){const t=this.wn.entity.Cn;if(t&&t(this.wn.entity,e,this.wn.button,this.wn.startLocation,this.wn.collectionMember,this.wn.info),(null==i?void 0:i.entity)!==this.wn.entity||i.collectionMember!==this.wn.collectionMember){this.wn.entity.Ps=!1;const t=this.wn.entity.Nn;t&&t(this.wn.entity,e,this.wn.collectionMember)}this.wn=void 0}if(this.Xn){const t=this.Xn.entity.getMouseInteractions()&&this.Xn.entity.jn;t&&t(this.Xn.entity,e,this.Xn.collectionMember,this.Xn.info),this.Xn=void 0}}else if(i&&i.entity.getMouseInteractions()){const s=t===Or.click?i.entity.Co:t===Or.dbclick?i.entity.ko:t===Or.mouseDown?i.entity.To:t===Or.wheel?i.entity.Fo:t===Or.contextmenu?i.entity.Io:void 0;if(s&&s(i.entity,e,i.collectionMember,i.info),t===Or.mouseDown){this.Xn={entity:i.entity,collectionMember:i.collectionMember,event:e,info:i.info};const t=this.Xn.event.button,s=i.entity.Po;s&&s(i.entity,e,t,i.collectionMember,i.info),this.wn={entity:i.entity,collectionMember:i.collectionMember,button:t,startLocation:u(e.clientX,e.clientY),info:i.info}}}this.Yn=e,this.On=i?{...i,event:e}:void 0}uo(t){return e=>this.Do(t,e)}Do(t,e){const i=e.interactions.length;if(this.Qn=e,this.do){const s=t===Lr.touchMove?this.do.entity.Bo:t===Lr.touchEnd?this.do.entity.Lo:t===Lr.touchStart?this.do.entity.Ro:void 0;s&&s(this.do.entity,e,this.do.collectionMember,this.do.info),t===Lr.touchEnd&&0===i&&(this.do.entity.Ps=!1,this.do=void 0)}else if(t===Lr.touchStart){for(let t=0;t{t()})),this.vn.length=0}}Ne(t,e){return u(t-this.gn.x,this.gn.y-e)}Go(t,e){return u(t+this.gn.x,this.gn.y-e)}Uo(t){const e=this.Ne(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Wo(t){const e=this.Go(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Hr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=mi(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=mi(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=mi(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=mi(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"ProgressiveX"===t||"RegressiveX"===t?"x":"y",Kr=t=>"ProgressiveX"===t||"ProgressiveY"===t;var Jr;!function(t){t[t.Nearest=0]="Nearest",t[t.NearestX=1]="NearestX",t[t.NearestY=2]="NearestY"}(Jr||(Jr={}));const Qr=(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===Jr.Nearest)return tn(t,e,n,o,c,d);if(i===Jr.NearestX||i===Jr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Jr.NearestX||"y"===a&&i===Jr.NearestY))return rn(t,yt(e,o,n),a,l,c,d);if(i===Jr.NearestX)return en(t,yt(e,o,n),h,c,d);if(i===Jr.NearestY)return sn(t,yt(e,o,n),h,c,d)}},tn=(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=yt(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,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(e))return m;y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Ye,s=m{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,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){if(i*(s?-1:1)<0&&m>r){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.R.on("dispose",t),this.offDispose=t=>this.R.off(t,"dispose"),this.cs=t,this.Zo=e,this.Qo=i,this.Jo=on,on+=1,this.Ko=t.ts.highlightColorOffset}qo(){let t;return this.ta("DataPattern",(e=>(t=e.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?Jr.NearestX:"ProgressiveY"===t||"RegressiveY"===t?Jr.NearestY:Jr.Nearest}ia(t){return void 0!==this.Qo.find((e=>e.type===t))}ta(t,e){var i;return!!this.ia(t)&&!0===e(null===(i=this.Qo.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.ji||(this.Ps&&this.Nn&&this.Nn(this,void 0,void 0),this.ji=!0,this.Zo(this),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}setVisible(t){const e=this.Zi;return this.Zi=t,!t&&e&&(this.Ps&&this.Nn&&this.Nn(this,void 0,void 0),this.Ps=!1),this}getVisible(){return this.Zi}setMouseInteractions(t){const e=this.Yo.C();return this.Yo._(t),t||(e&&this.Ps&&this.Nn&&this.Nn(this,void 0,void 0),this.Ps=!1),this}getMouseInteractions(){return this.Yo.C()}getIsUnderMouse(){return this.Ps}getIsGrabbed(){return this.Xo}setMouseMoveEventHandler(t){return this.Gn=t,this}setMouseEnterEventHandler(t){return this.Un=t,this}setMouseLeaveEventHandler(t){return this.Nn=t,this}setMouseClickEventHandler(t){return this.Co=t,this}setMouseDoubleClickEventHandler(t){return this.ko=t,this}setMouseDownEventHandler(t){return this.To=t,this}setMouseUpEventHandler(t){return this.jn=t,this}setMouseWheelEventHandler(t){return this.Fo=t,this}setMouseContextMenuEventHandler(t){return this.Io=t,this}setMouseDragEventHandler(t){return this.Wn=t,this}setMouseDragStartEventHandler(t){return this.Po=t,this}setMouseDragStopEventHandler(t){return this.Cn=t,this}setTouchStartEventHandler(t){return this.Ro=t,this}setTouchMoveEventHandler(t){return this.Bo=t,this}setTouchEndEventHandler(t){return this.Lo=t,this}sa(t){return this.$o=t,this}ea(){return this.$o?this.$o:an}ds(t){return this.jo=t,this}ha(){return this.jo}ra(t){return this.Ko=t,this}na(){return this.Ko}}const an=m(u(0,0),u(0,0));class ln extends hn{constructor(t,e,i,s){super(t,i,s),this.oa=0,this.Rs=e,this.Rs.aa=!0}la(){}ua(t){return this.oa===t||(this.oa=t,this.Rs.aa=!0),this}ca(){return this.oa}}class un extends ln{constructor(t,e,i,s,r){super(t,e,s,r),this.da=!0,this.At=i}}const cn=(t,e,i)=>{if(i instanceof Yi){const s=i.Ui(),r=Ai(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.pi(u(t.min.x,t.min.y),mi(e,-1)),i.pi(u(t.max.x,t.max.y),e))},dn=(t,e)=>"function"==typeof e?e(t):e,fn=(t,e)=>!t||t!==e,gn=t=>t!==_;class mn extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ie=Ur.fillStyle,this.cs=t}Re(t){return this.Ie=dn(this.Ie,t),this}Jh(){return this.Ie}fa(){return fn(this.Aa,this.Ie)}ga(){return((t,e)=>t===_&&e!==_)(this.Aa,this.Ie)}pa(){return gn(this.Ie)}ya(t){this.Aa=t}}class yn extends mn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pe=Ur.lineStyle,this.cs=t}Le(t){return this.Pe="function"==typeof t?t(this.Pe):t,this}So(){return this.Pe}ma(){return!this.va||this.va!==this.Pe}Sa(t){return!this.va||this.va.getThickness()!==t}pa(){return this.Pe!==ut||super.pa()}ga(){return(this.Pe!==ut||this.Ie!==_)&&this.va===ut&&this.Aa===_}xa(t){this.va=t}}class pn extends mn{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}it(t){return this.size._(t),this}}class An extends mn{constructor(t,e,i,s,r,n=p(Ur.font)){super(t,e,i,s,r),this.ba=p(""),this.Ma=p(u(0,0)),this._a=p(0),this.wa=p(0),this.Ca=p(u(0,0)),this.ka=p(0),this.Ta=p(Mr),this.Fa=u(0,0),this.$t=p(A(1,1,1,1)),this.Ia=p(x(4,4,4,4)),this.font=p(Ur.font),this.Pa=!1,this.font=n}pa(){return gn(this.Ie)&&this.ba.C().length>0}ga(){return!1===this.Pa&&this.pa()}Sr(t){return this.ba._(t),this}Tr(){return this.ba.C()}ir(t){return br(t)?this.Ta._(t):this.Ta._(t(this.Ta.C())),this}tr(){return this.Ta.C()}Da(t){return this.Ta._(this.Ta.C().setFamily(t)),this}Ba(){return this.Ta.C().getFamily()}La(t){return this.Ta._(this.Ta.C().setSize(t)),this}Ra(){return this.Ta.C().getSize()}Ea(t){return this.Ta._(this.Ta.C().setWeight(t)),this}za(){return this.Ta.C().getWeight()}Va(t){return this.Ta._(this.Ta.C().setStyle(t)),this}Oa(){return this.Ta.C().getStyle()}Na(t){return this.Ta._(this.Ta.C().setVariant(t)),this}Ga(){return this.Ta.C().getVariant()}Ve(t){return this.Ma._(t),this}Ua(){return this.Ma.C()}sr(t){return this.ka._(t),this}er(){return this.ka.C()}Wa(t,e){return this.Ca._(u(t,e)),this}Ya(){return this.Ca.C()}Ha(t){return this.wa._(t),this}Xa(){return this.wa.C()}$a(t){return this._a._(t),this}ja(){return this._a.C()}Za(t){return this.wa._(t.x),this._a._(t.y),this}Gr(t){return this.$t._(t),this}Qa(){return this.$t.C()}Ur(t){return this.Ia._(t),this}Ja(){return this.Ia.C()}}class xn extends pn{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Ka=[],this.qa=p(e.PointShape.Square),this.ka=p(0),this.tl=p(!1),this.il=p(!1),this.sl=p(!1),this.el=Xe,this.hl=0,this.rl=[],this.nl=0,this.ol=Xe,this.al=!1,this.ll=void 0}ul(){return this.rl}cl(){return this.Ka}dl(t){return this.qa._(t),this}fl(){return this.qa.C()}sr(t){return this.ka._(t),this}er(){return this.ka.C()}Al(t){return this.tl._(t),this}pl(t){return this.il._(t),this}yl(t){return this.sl._(t),this}ml(t,e){return Array.isArray(t)||(t=[t]),this.nl+=t.length,this.rl=fe(this.rl,t,{canReturnB:!0}),this.ol&&(this.ol=e?hi(this.ol,e):void 0),this.ll=void 0,this}Ot(){return this.al=!0,this.Ka.length=0,this.hl=0,this.el=Xe,this.rl=[],this.nl=0,this.ll=void 0,this}vl(){return this.hl}Sl(){return this.nl}}class Sn extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ma=p(u(0,0)),this.Z=p(u(100,100)),this.ka=p(0),this.Fa=p(u(0,0)),this.xl=!1}Os(){return this.bl(),this}Ve(t){const e=this.Ma.C();return t.x===e.x&&t.y===e.y||(this.Ma._(t),this.bl()),this}Ua(){return this.Ma.C()}Ml(t){const e=this.Ma.C();return t!==e.x&&(this.Ma._(u(t,e.y)),this.bl()),this}_l(t){const e=this.Ma.C();return t!==e.y&&(this.Ma._(u(e.x,t)),this.bl()),this}it(t){const e=this.Z.C();return t.x===e.x&&t.y===e.y||(this.Z._(u(t.x,t.y)),this.bl()),this}oi(){return this.Z.C()}wl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(t,e.y)),this.bl()),this}Cl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(e.x,t)),this.bl()),this}sr(t){return this.ka._(t),this}er(){return this.ka.C()}kl(t){const e=this.Fa.C();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.xl=!1,this.bl()):(this.xl=!0,this.Fa._(t))),this}bl(){if(!this.xl){const t=this.Ma.C(),e=this.Z.C(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Fa.C();i.x===s.x&&i.y===s.y||this.Fa._(i)}}}class vn extends yn{constructor(){super(...arguments),this.Ka=[],this.Ma=p(u(0,0)),this.el=Xe,this.Tl=!1}Fl(t){return t=ae(t),this.Ka=t,this.Tl=!0,this}Il(){return this.Ka}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return 0}Dl(){return 0}}class bn extends vn{}class Mn extends mn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Bl=new Array,this.Ll=new Array,this.Rl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.el=Xe,this.El=0,this.zl=!1,this.rl=[Array(),Array()],this.Vl=!1,this.Ol=(new N).setColor(C(42,171,240)),this.al=!1,this.Nl=!1,this.Gl=!1}ml(t,e){const i=this.El-1,s=i>0&&!this.Vl;let[r,n]=s?[[this.Bl[i]],[this.Ll[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=fe(r,e,{canReturnB:!0}),n=fe(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Vl?(this.rl[0]=fe(this.rl[0],r,{canReturnB:!0}),this.rl[1]=fe(this.rl[1],n,{canReturnB:!0})):(this.rl=[r,n],this.Vl=!0),this.el=hi(this.el,e||hi(ni(r),ni(n))),this}Ot(){return this.al=!0,this.Bl.length=0,this.Ll.length=0,this.El=0,this.el=Xe,this}cl(){return[this.Bl,this.Ll]}ul(){return[this.rl[0],this.rl[1]]}Ul(t){return this.Rl._(t),this}Wl(){return this.Rl.C()}Yl(t){return this.Ol="function"==typeof t?t(this.Ol):t,this}Hl(){return this.Ol}vl(){return this.El-(Number(this.Nl)+Number(this.Gl))}Sl(){return this.rl.length}Xl(t){return this.Nl=t,this}$l(){return this.Nl}jl(t){return this.Gl=t,this}Zl(){return this.Gl}ga(){return this.Aa===_&&this.Ql===_&&(this.Ie!==_||this.Ol!==_)}Jl(t){this.Ql=t}pa(){return this.Ol!==_||super.pa()}fa(){return super.fa()||!this.Ql||this.Ql!==this.Ol}}class Cn extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ma=p(u(0,0)),this.Kl=p(0),this.Fi=p(360),this.ql=p(100),this.tu=p(100),this.iu=p(0),this.su=p(void 0),this.eu=u(0,0),this.hu=u(0,0),this.ru=u(0,0)}nu(){return this.ql.C()}ou(){return this.tu.C()}Ua(){return this.Ma.C()}au(){return this.Kl.C()}Ti(){return this.Fi.C()}lu(){return this.iu.C()}uu(){return this.su.C()}cu(){return this.eu}du(){return this.hu}fu(){return this.ru}Ve(t){return this.Ma._(t),this}Au(t){return this.Kl._(t),this}Xe(t){return this.Fi._(t),this}gu(t){return this.tu._(t),this.ql._(t),this}pu(t){return this.ql._(t),this}yu(t){return this.tu._(t),this}mu(t){return this.iu._(t<0?0:t),this}vu(t){return this.su._(void 0!==t&&t<=0?void 0:t),this}}var Tn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(Tn||(Tn={}));class wn extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Su=Ur.lineStyle,this.engine=t}Ye(t){return this.Su=((t,e)=>"function"==typeof e?e(t):e)(this.Su,t),this}xu(){return this.Su}ma(){return((t,e)=>!t||t!==e)(this.bu,this.Su)}Mu(t){return((t,e)=>!t||t.getThickness()!==e)(this.bu,t)}ga(){return((t,e)=>t===ut&&e!==ut)(this.bu,this.Su)}pa(){return(t=>t!==ut&&t.getFillStyle()!==_)(this.Su)}_u(t){this.bu=t}}class En extends wn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.wu=!1}_({min:t,max:e}){return t.x===this.Pi.x&&t.y===this.Pi.y&&e.x===this.Fi.x&&e.y===this.Fi.y||(this.wu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}$e(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.wu=!0,this.Pi=t),this}Xe(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.wu=!0,this.Fi=t),this}}class kn extends wn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Cu=void 0,this.ku=0}}class In extends wn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tu=[],this.el=Xe,this.rl=new Array,this.hl=0,this.al=!1,this.Fu=p(void 0),this.Nl=!1,this.Gl=!1}Iu(t){return this.Fu._(t),this}Pu(){return this.Fu.C()}ul(){return this.rl}cl(){return this.Tu}Ot(){return this.al=!0,this.Tu.length=0,this.hl=0,this.rl=[],this.el=Xe,this}vl(){return this.hl-(Number(this.Nl)+Number(this.Gl))}Sl(){return this.rl.length}Xl(t){return this.Nl=t,this}$l(){return this.Nl}jl(t){return this.Gl=t,this}Zl(){return this.Gl}}const zn=t=>{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 Fn{constructor(){this.Zi=!0,this.R=new r.Eventer,this.Du=0,this._t=(t,e,i)=>{0===this.Du&&this.R.emit("mouseEnter",this,e),this.Du+=1},this.wt=(t,e,i)=>{this.Du-=1,this.Du<1&&(this.R.emit("mouseLeave",this,e),this.Du=0)},this.Ct=(t,e,i)=>{this.R.emit("mouseClick",this,e)},this.kt=(t,e,i)=>{this.R.emit("mouseDoubleClick",this,e)},this.Tt=(t,e,i)=>{this.R.emit("mouseDown",this,e)},this.Ft=(t,e,i)=>{this.R.emit("mouseUp",this,e)},this.It=(t,e,i)=>{this.R.emit("mouseMove",this,e)},this.Dt=(t,e,i,s)=>{this.R.emit("mouseDragStart",this,e,i)},this.Pt=(t,e,i,s,r,n)=>{this.R.emit("mouseDrag",this,e,i,s,r)},this.Bt=(t,e,i,s,r)=>{this.R.emit("mouseDragStop",this,e,i,s)},this.Lt=(t,e,i)=>{this.R.emit("mouseWheel",this,e)},this.Rt=(t,e)=>{this.Du+=1,this.R.emit("touchStart",this,e)},this.Et=(t,e)=>{this.R.emit("touchMove",this,e)},this.zt=(t,e)=>{this.Du-=1,this.R.emit("touchEnd",this,e)},this.Bu=t=>(t instanceof un?t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragEventHandler(this.Pt).setMouseDragStartEventHandler(this.Dt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt):(t.onMouseEnter(((t,e)=>this._t(t,e))),t.onMouseLeave(((t,e)=>this.wt(t,e))),t.onMouseClick(((t,e)=>this.Ct(t,e))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e))),t.onMouseDown(((t,e)=>this.Tt(t,e))),t.onMouseUp(((t,e)=>this.Ft(t,e))),t.onMouseMove(((t,e)=>this.It(t,e))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Lt(t,e))),t.onTouchStart(((t,e)=>this.Rt(t,e))),t.onTouchMove(((t,e)=>this.Et(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e)))),t)}onMouseEnter(t){return this.R.on("mouseEnter",t)}onMouseLeave(t){return this.R.on("mouseLeave",t)}onMouseClick(t){return this.R.on("mouseClick",t)}onMouseDoubleClick(t){return this.R.on("mouseDoubleClick",t)}onMouseDown(t){return this.R.on("mouseDown",t)}onMouseUp(t){return this.R.on("mouseUp",t)}onMouseMove(t){return this.R.on("mouseMove",t)}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offMouseEnter(t){return this.R.off(t,"mouseEnter")}offMouseLeave(t){return this.R.off(t,"mouseLeave")}offMouseClick(t){return this.R.off(t,"mouseClick")}offMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClick")}offMouseDown(t){return this.R.off(t,"mouseDown")}offMouseUp(t){return this.R.off(t,"mouseUp")}offMouseMove(t){return this.R.off(t,"mouseMove")}offMouseDragStart(t){return this.R.off(t,"mouseDragStart")}offMouseDrag(t){return this.R.off(t,"mouseDrag")}offMouseDragStop(t){return this.R.off(t,"mouseDragStop")}offMouseWheel(t){return this.R.off(t,"mouseWheel")}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}getIsUnderMouse(){return this.Du>0}setVisible(t){const e=this.Zi!==t;return this.Zi=t,e&&this.R.emit("visibleStateChanged",this,this.Zi),this}getVisible(){return this.Zi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}const Rn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.pi(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.pi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},Ai({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},Ai({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),se(s)}},Dn=(t,e,i,s,r)=>{Rn(t,r,e)},Pn=(t,e,i,s,r)=>{Rn(t,s,r)};class On extends Fn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.ji=!1,this.Lu=void 0,this.Ru=void 0,this.Eu=zn,this.zu=void 0,this.Yo=!0,this.Vu=()=>{const t="function"==typeof this.Eu?this.Eu(this):this.Eu;t&&(this.Ru=this.Rs.cs.tn(t))},this.Ou=()=>{this.Rs.cs.sn(this.Ru)},this.$t=A(0,0,0,0),this.Rs=t,this.renderingScale=e,this.scale=i,this.Zo=s,this.ts=r,this.Rs.Ms(),this.onMouseEnter(this.Vu),this.onMouseLeave(this.Ou),this.onMouseDrag(Dn);const n=ns(new hs(Ot,Pn,Ot));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.ts=r}setMouseInteractions(t){return this.Nu().forEach((e=>e.setMouseInteractions(t))),this.Yo=t,this}getMouseInteractions(){return this.Yo}setEffect(t){return this.hs=this.hs||this.Rs.cs.hs.rs(this,{Gu:{shapes:this.Nu()}}),this.hs.Gu.bs(t),this}getEffect(){return!!this.hs&&this.hs.Gu._s()}setAutoDispose(t){return this.zu=t,this.Rs.Ms(),this}getAutoDispose(){return this.zu}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.$t.left+this.$t.right),this.size.y+(this.$t.bottom+this.$t.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.$t="object"==typeof t?S(this.$t,t):{left:t,top:t,right:t,bottom:t},this.Rs.Ms(),this}getMargin(){return this.$t}ze(){if(this.zu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.zu.type&&i.x>=this.zu.maxWidth||"max-height"===this.zu.type&&i.y>=this.zu.maxHeight)&&this.dispose()}return this}Os(){return this}dispose(){return this.ji||(this.Rs.Ms(),this.ji=!0,this.Zo(this),this.R.emit("dispose",this),this.Nu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Nu().forEach((e=>e.setVisible(t))),this.Rs.Ms(),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setPosition(t){return this.position=t,this.Rs.Ms(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,Ai({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,Ai({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.pi(r,{x:this.$t.left,y:this.$t.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.pi(n,Ai({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Rs.Ms(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Lu=t,this.Rs.Ms(),this}getDraggingMode(){return void 0!==this.Lu?this.Lu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Eu=t,this}getMouseStyle(){return this.Eu}}class Ln extends On{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ia=A(),this.Uu=0,this.Rs=t,this.Wu=s,this.backgroundElement=new this.Wu(this.Rs,this.renderingScale,this.scale,Ot,n),this.Bu(this.backgroundElement)}Nu(){return this.backgroundElement.Nu()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}ze(){return super.ze(),this.ji||(void 0!==this.oa&&(this.backgroundElement.oa=this.oa-.01),this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).ze()),this}Os(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Yu(t).Os(),super.Os()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Ia="object"==typeof t?S(this.Ia,t):{left:t,top:t,right:t,bottom:t},this.Rs.Ms(),this}getPadding(){return this.Ia}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Ia.left+this.Ia.right,i.y+this.Ia.bottom+this.Ia.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Hu()+this.backgroundElement.Xu(),i.y+this.backgroundElement.$u()+this.backgroundElement.ju())),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.pi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.pi(n,Ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Hu(),y:this.backgroundElement.$u()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,Ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.pi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.pi(a,Ai({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return super.setMouseInteractions(t),this.backgroundElement.setMouseInteractions(t),this}getHighlight(){return this.Uu}setHighlight(t){return this.Uu=ke(t),this.backgroundElement.setHighlight(t),this.R.emit("highlight",this,t),this}}const _n=t=>"setBackground"in t;class Bn extends Fn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.M=0,this.Zu=1,this.Qu=!0,this.Ju=new vr,this.Ku=!0,this.ji=!1,this.axisScale=s,this.renderingScale=r,this.qu=o,this.tc=h,this.ic=a,this.Zo=l,this.sc=e,this.hc=i,this.rc=this.Bu(this.sc.He(this.renderingScale)),this.ts=u,this.nc=this.Bu(this.ic.setDirection(this.tc).oc(this.hc,this.renderingScale,n,Ot,this.ts,!1).setOrigin(ee(this.tc))),this.axis=t,this.setMouseInteractions(!1),"major"===this.nc.ac?this.rc.Ye(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.nc.ac?this.rc.Ye(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.nc.ac&&this.rc.Ye(u.cursorGridStrokeStyleX)}setValue(t){return this.M=t,this.hc.Ms(),this.R.emit("valueChange",this,this.M),this}getValue(){return this.M}setTextFormatter(t){return this.lc=t,this.hc.Ms(),this}setTickLength(t){return this.nc.setPointerLength(t),this.sc.Ms(),this}getTickLength(){return this.nc.getPointerLength()}setTickLabelPadding(t){return this.nc.setTickLabelPadding(t),this.sc.Ms(),this}setTickLabelRotation(t){return this.nc.setTextRotation(t),this.sc.Ms(),this}getTickLabelRotation(){return this.nc.getTextRotation()}getTickLabelPadding(){return this.nc.getTickLabelPadding()}setGridStrokeLength(t){return this.Zu=t,this.sc.Ms(),this}getGridStrokeLength(){return this.Zu}setGridStrokeStyle(t){return this.rc.Ye(t),this.sc.Ms(),this}getGridStrokeStyle(){return this.rc.xu()}dispose(){return this.ji||(this.ji=!0,this.rc.dispose(),this.nc.dispose(),this.Zo(this),this.sc.cs.Ms(),this.R.emit("dispose",this)),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMarkerVisible(t){return this.Qu=t,this.hc.Ms(),this}getMarkerVisible(){return this.Qu}setMarker(t){return t(this.nc),this.hc.Ms(),this}getMarker(){return this.nc}setMouseInteractions(t){return this.nc.setMouseInteractions(t),this.rc.setMouseInteractions(t),this}getMouseInteractions(){return this.rc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.Ku=t,this.hc.Ms(),this}getAllocatesAxisSpace(){return this.Ku}isInScale(){return ti(this.M,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}}class Vn extends Bn{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.uc=!1,this.Zo=a,this.sc=e,this.hc=i}dispose(){return this.uc=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.uc=!1;const t=mt(this.M,this.axisScale,this.qu.getWidth(this.renderingScale));this.rc.setVisible(!0).$e(this.qu.toPoint(t,e)).Xe(this.qu.toPoint(t,e-(s+i*this.Zu))),this.Qu?(this.lc&&this.nc.setText(this.lc(this.M,this)),this.nc.setVisible(!0).setPosition(this.qu.toPoint(t,r))):this.nc.setVisible(!1)}else this.rc.setVisible(!1),this.nc.setVisible(!1);return this.nc.Os().ze(),this}cc(){const t=this.nc.Os().getSize();return this.qu.getHeight(t)}}const Gn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Nn=(t,e)=>(pe(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),Un=(t,e,i)=>{i&&_n(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Yn={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}}},Xn={oc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return Un(o,r,n),o}},Wn={oc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return Un(o,r,n),o}};class jn extends On{constructor(){super(...arguments),this.dc=!0}ze(){return super.ze(),this}setMouseInteractions(t){return this.dc=t,this}getMouseInteractions(){return this.dc}Nu(){return[]}}class $n extends jn{onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}Yu(t){return this.size=t,this}Hu(){return 0}Xu(){return 0}ju(){return 0}$u(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return _}setStrokeStyle(){return this}getStrokeStyle(){return ut}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Zn extends On{constructor(){super(...arguments),this.R=new r.Eventer,this.Uu=0}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.Uu}setHighlight(t){return this.Uu=t,this.Nu().forEach((e=>e.ds(t))),this.R.emit("highlight",this,t),this.Rs.Ms(),this}}class qn extends Zn{}class Kn extends qn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Rs=t,this.qa=this.Rs.fc(this.renderingScale,Tn.Simple).setVisible(!1).Re(_).Le(ut),this.Bu(this.qa)}Ac(){const t=this.gc();if(t.length>2){const e=ni(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=yi(t,mi(e.min,-1));return this.scale.pi(this.position,yi(s,Ai(mi(yi(this.origin,u(1,1)),-.5),i)))})).map((t=>yt(t,this.scale,this.renderingScale)));this.qa.Fl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.qa&&this.qa.setVisible(!1),this.setContentSize(u(0,0))}ze(){return super.ze(),this.ji||(this.Ac(),void 0!==this.oa&&this.qa.ua(this.oa)),this}Os(){return this.Ac(),super.Os()}setVisible(t){return super.setVisible(t),this.qa.setVisible(t),this}}const Jn=(t,e,i)=>t*(1-i)+e*i,Qn=(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=Jn(i.value,r.value,n),c=Jn(e.value,s.value,h);return Jn(c,u,l)},to={warm:t=>e=>w(60/(t-1)*e,.8,.8),cold:t=>e=>w(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>w(360/t*e,.8,.8),reverseSpectrum:t=>e=>w(360/t*(t-e),.8,.8),flatUI:t=>e=>w(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return w(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return w(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return w(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return w(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return w(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>w(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return w(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return w(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),w(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return w(0,0,s);const r=e.getR()/255,n=e.getG()/255,o=e.getB()/255,h=Math.max(r,n,o),a=Math.min(r,n,o);let l=0;if(h!==a){const t=h-a;switch(h){case r:l=(n-o)/t+(nr=>n=>w(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>eo([{value:0,hex:"#23FF7A"},{value:1/9,hex:"#03E65D"},{value:2/9,hex:"#04D155"},{value:3/9,hex:"#00B849"},{value:4/9,hex:"#00A869"},{value:5/9,hex:"#008F68"},{value:6/9,hex:"#00815E"},{value:7/9,hex:"#017153"},{value:8/9,hex:"#704A85"},{value:1,hex:"#743A70"}],t,e),blueSciFi:t=>e=>eo([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#E2E7FF"},{value:2/9,hex:"#ACB9F8"},{value:3/9,hex:"#889DFF"},{value:4/9,hex:"#547EEF"},{value:5/9,hex:"#4068D8"},{value:6/9,hex:"#2B50B7"},{value:7/9,hex:"#1B3E9F"},{value:8/9,hex:"#8D1395"},{value:1,hex:"#780A74"}],t,e),light:t=>e=>eo([{value:0,hex:"#FECC00"},{value:1/9,hex:"#F7B300"},{value:2/9,hex:"#EF9900"},{value:3/9,hex:"#E88000"},{value:4/9,hex:"#E06600"},{value:5/9,hex:"#DD5A00"},{value:6/9,hex:"#D94D00"},{value:7/9,hex:"#D13300"},{value:8/9,hex:"#C91A00"},{value:1,hex:"#C10000"}],t,e),monochrome:t=>e=>eo([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#EEEEEE"},{value:2/9,hex:"#DCDCDC"},{value:3/9,hex:"#C1C1C1"},{value:4/9,hex:"#A4A2A2"},{value:5/9,hex:"#8B8B8B"},{value:6/9,hex:"#787878"},{value:7/9,hex:"#656565"},{value:8/9,hex:"#565555"},{value:1,hex:"#434343"}],t,e),night:t=>e=>eo([{value:0,hex:"#F0F9E0"},{value:1/9,hex:"#C9DFA4"},{value:2/9,hex:"#B5C796"},{value:3/9,hex:"#8998B7"},{value:4/9,hex:"#6E7E9E"},{value:5/9,hex:"#5C6D8F"},{value:6/9,hex:"#47587A"},{value:7/9,hex:"#374B72"},{value:8/9,hex:"#273C65"},{value:1,hex:"#192847"}],t,e),sunset2:t=>e=>eo([{value:0,hex:"#22334D"},{value:1/9,hex:"#82062C"},{value:2/9,hex:"#AB001D"},{value:3/9,hex:"#D80428"},{value:4/9,hex:"#CF5D1B"},{value:5/9,hex:"#CF8229"},{value:6/9,hex:"#CF9D29"},{value:7/9,hex:"#C4BE25"},{value:8/9,hex:"#E1DC49"},{value:1,hex:"#FFFA67"}],t,e)},eo=(t,e,i)=>{const s=so(e,i),[r,n]=ro(s,t),o=io(t[r]),h=io(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Jn(o.h,h.h,a),s:Jn(o.s,h.s,a),v:Jn(o.v,h.v,a)};return w(l.h,l.s,l.v)},io=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,r=Math.max(e,i,s),n=Math.min(e,i,s);let o=0;const h=r,a=r-n,l=0===r?0:a/r;if(r===n)o=0;else{switch(r){case e:o=(i-s)/a+(i{const i=e/t;return i<0?0:i>1?1:i},ro=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),mo=s.Record({type:"icon",width:void 0,height:void 0,yc:void 0,mc:Ot,vc:Ot});class yo extends mo{constructor(t,e,i,s){super({...s,yc:t,mc:e,vc:i})}dispose(){return this.vc(this),this}setWidth(t){const e=this.set("width",t);return this.mc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.mc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.mc(i),i}oi(){if(!this.yc)return{x:0,y:0};const t=this.yc.width,e=this.yc.height;if(0===t||0===e)return{x:0,y:0};const i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const po=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),Ao=s.Record({type:"glow",color:C(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class xo extends Ao{constructor(t){super(t)}setSpread(t){return this.set("spread","function"==typeof t?t(this.get("spread")):t)}getSpread(){return this.get("spread")}setBlur(t){return this.set("blur","function"==typeof t?t(this.get("blur")):t)}getBlur(){return this.get("blur")}setColor(t){return this.set("color","function"==typeof t?t(this.get("color")):t)}getColor(){return this.get("color")}setOffset(t){return this.set("offset","function"==typeof t?t(this.get("offset")):t)}getOffset(){return this.get("offset")}}class So{constructor(t){this.Sc=0,this.xc=0,this.bc=0,this.Mc=!1,this._c=!0,this.wc=!1,this.Cc={warningDisplayed:!1,expandEvents:[]},this.R=new r.Eventer,this._c=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.kc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.Tc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Fc=void 0!==(null==t?void 0:t.colors)&&t.colors,this.Ic=void 0!==(null==t?void 0:t.ids)&&t.ids,this.Pc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.Dc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.Bc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.Lc=!1!==(null==t?void 0:t.allowInputModification)}add(t){return Array.isArray(t)?this.appendJSON(t,{x:"x",y:"y"}):this.appendSample(t),this}addArraysXY(t,e){return this.appendSamples({xValues:t,yValues:e}),this}appendJSON(t,e={x:"x",y:"y"}){const i=t.length,s=e.x,r=e.y,n=e.lookupValue,o=e.size,h=e.rotation,a=e.color,l=e.id;let u,c,d,f,g,m,y;if(s){u=new this.Bc(i);const e=t[0]&&t[0][s]instanceof Date,r=t[0]&&ko(t[0][s]);if(!r&&t[0]&&"string"==typeof t[0][s])throw new Error("LightningChart JS error - XY coordinate supplied as unrecognized String format. Coordinates must be Numbers, Date objects or ISO 8601 Date strings");if(r)for(let e=0;ea-1&&(this.Sc=0,this.Mc=!0),this.xc=Math.min(this.xc+1,a),this.bc+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:r,rotations:n,start:o,step:h}=t;let a=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(a=void 0!==a?a:0,l=void 0!==l?l:c-a,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:a,f=void 0!==t.offsetColors?t.offsetColors:a,g=void 0!==t.offsetIds?t.offsetIds:a,m=void 0!==t.offsetSizes?t.offsetSizes:a,y=void 0!==t.offsetRotations?t.offsetRotations:a,p=this.Wc(!0),[A,x]=this.Yc(l,t.xValues,"x","ProgressiveX"===p||"RegressiveX"===p||void 0===p?o:void 0,"ProgressiveX"===p||"RegressiveX"===p||void 0===p?h:void 0,a,p),[S,v]=this.Yc(l,t.yValues,"y","ProgressiveY"===p||"RegressiveY"===p?o:void 0,"ProgressiveY"===p||"RegressiveY"===p?h:void 0,a,p),b=this.Gc(i),{samplesCacheX:M,samplesCacheY:C,samplesCacheLookup:T,samplesCacheColors:w,samplesCacheIDs:E,samplesCacheSize:k,samplesCacheRotation:I,maxSampleCount:z,dataPattern:F,incomingDataReplacedCache:R}=this.Rc({appendCount:l,...0===x&&0===v&&0===a&&0===d&&0===f&&0===g&&0===m&&0===y?{incomingDataX:A,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!R&&F&&this._c&&this.zc&&this.Vc){const t=A[x],i=S[v];if(!this.Oc(F,t,i)&&!this.wc)return this.Nc(this.zc,this.Vc,wo(A,x,x+l),wo(S,v,v+l),wo(e,d,d+l),wo(b,f,f+l),wo(s,g,g+l),wo(r,m,m+l),wo(n,y,y+l),F),this}const D=z-this.Sc,P=Math.min(l,D);if(P>0&&(R||(Co(M,A,x,P,this.Sc),Co(C,S,v,P,this.Sc),e&&T&&Co(T,e,d,P,this.Sc),s&&E&&Co(E,s,g,P,this.Sc),b&&w&&Co(w,b,f,P,this.Sc),r&&k&&Co(k,r,m,P,this.Sc),n&&I&&Co(I,n,y,P,this.Sc)),this.Uc(this.Sc,this.Sc+P-1),this.Sc+=P,this.Sc>z-1&&(this.Sc=0,this.Mc=!0)),this.xc=Math.min(this.xc+P,z),this.bc+=P,this.Wc(),l-P>0){const t={xValues:A?wo(A,x+P,void 0):void 0,yValues:S?wo(S,v+P,void 0):void 0,lookupValues:e?wo(e,d+P,void 0):void 0,ids:s?wo(s,g+P,void 0):void 0,colors:b?wo(b,f+P,void 0):void 0,sizes:r?wo(r,m+P,void 0):void 0,rotations:n?wo(n,y+P,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.zc||this.Vc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.zc=this.zc||new this.Bc(i),this.zc.fill(t.x)),void 0!==t.y&&(this.Vc=this.Vc||new this.Bc(i),this.Vc.fill(t.y)),void 0!==t.lookupValue&&(this.Hc=this.Hc||new Float32Array(i),this.Hc.fill(t.lookupValue)),void 0!==t.color){const e=this.Gc([t.color]);e&&(this.Xc=this.Xc||new Uint32Array(i),this.Xc.fill(e[0]))}return void 0!==t.size&&(this.$c=this.$c||new Float32Array(i),this.$c.fill(t.size)),void 0!==t.rotation&&(this.jc=this.jc||new Float32Array(i),this.jc.fill(t.rotation)),this.R.emit("cleared"),this}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a}=e;let l=e.offset,u=e.count;const c=i||s||r||n||o||h||a,d=c?c.length:void 0!==e.x||void 0!==e.y?1:0;if(l=void 0!==l?l:0,u=void 0!==u?u:d-l,u<=0)return this;const f=void 0!==e.offsetLookupValues?e.offsetLookupValues:l,g=void 0!==e.offsetColors?e.offsetColors:l,m=void 0!==e.offsetIds?e.offsetIds:l,y=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,A=this.Gc(n),x=this.bc-1,S=void 0!==this.Zc?Math.max(this.bc-this.Zc,0):0,v=t+u-1,b=Math.max(t,S),M=Math.min(v,x),C=M-b+1;if(this.bc>0&&C>0){const{samplesCacheX:n,samplesCacheY:u,samplesCacheColors:c,samplesCacheIDs:d,samplesCacheLookup:x,samplesCacheSize:v,samplesCacheRotation:T}=this.Rc({appendCount:0}),w=n.length;if(void 0!==this.Zc&&this.Mc&&this.bc%this.Zc!=0){const S=this.bc-this.bc%this.Zc,C=this.bc-1,E=this.bc-this.xc,k=S-1,I=Math.max(b,E),z=Math.min(M,k)-I+1;if(z>0){const S=I-t,b=vo(I,this.bc,w,this.Sc);if(void 0!==e.x)for(let t=b;t0){const S=F-t,b=vo(F,this.bc,w,this.Sc);if(void 0!==e.x)for(let t=b;t0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:y+e,offsetRotations:p+e,count:T})}return this}alterSamplesByID(t,e){if(!this.Ic)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Qc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Gc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.Bc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.Bc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Gc(e.colors),l=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,u=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,c=s.length,d=this.xc,f=this.bc-1,g=Math.max(f-d+1,0);for(let d=0;ds[vo(t,this.bc,c,this.Sc)])),y=vo(m,this.bc,c,this.Sc);s[y]===i&&(void 0!==e.x&&this.zc&&(this.zc[y]=e.x),void 0!==e.y&&this.Vc&&(this.Vc[y]=e.y),void 0!==e.lookupValue&&this.Hc&&(this.Hc[y]=e.lookupValue),void 0!==e.size&&this.$c&&(this.$c[y]=e.size),void 0!==e.rotation&&this.jc&&(this.jc[y]=e.rotation),void 0!==r&&this.Xc&&(this.Xc[y]=r),n&&this.zc&&(this.zc[y]=n[d]),o&&this.Vc&&(this.Vc[y]=o[d]),h&&this.Hc&&(this.Hc[y]=h[d]),a&&this.Xc&&(this.Xc[y]=a[d]),l&&this.$c&&(this.$c[y]=l[d]),u&&this.jc&&(this.jc[y]=u[d]))}return this.R.emit("cleared"),this}clear(){return this.Sc=0,this.xc=0,this.bc=0,this.Mc=!1,this.R.emit("cleared"),this}getSampleCount(){return this.xc}getNextSampleIndex(){return this.bc}setMaxSampleCount(t){if("object"==typeof t){this.Jc&&this.offMaxSampleCountExceeded(this.Jc);const e=t.max,i=t.initial,s=t=>{const i=this.Zc||0;if(void 0!==e&&i>=e)return;let s=Math.max(2*i,t);void 0!==e&&(s=Math.min(s,e)),this.setMaxSampleCount(s)};this.Jc=this.onMaxSampleCountExceeded(((t,e,i,r)=>{s(r)})),void 0===this.Zc&&(void 0!==i?this.setMaxSampleCount(i):this.setMaxSampleCount(Math.min(2*this.xc,void 0!==e?e:Number.MAX_SAFE_INTEGER)))}else if("number"==typeof t){const e=t;if(void 0!==this.Zc&&this.Zc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.zc||!this.Vc)return this.Zc=e,this;if(e===this.Zc)return this;if(this.Mc&&0!==this.Sc)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to expand data set that has exceeded its max sample count. This is currently not supported.");this.Zc=e,this.xct+e.count),0),n=new this.Bc(r),o=new this.Bc(r),h=this.Fc?new Uint32Array(r):void 0,a=this.Tc?new Float32Array(r):void 0,l=this.Ic?new Uint32Array(r):void 0,u=this.Pc?new Float32Array(r):void 0,c=this.Dc?new Float32Array(r):void 0;let d=0;for(const t of s)n.set(this.zc.subarray(t.offset,t.offset+t.count),d),o.set(this.Vc.subarray(t.offset,t.offset+t.count),d),this.Fc&&h&&this.Xc&&h.set(this.Xc.subarray(t.offset,t.offset+t.count),d),this.Tc&&a&&this.Hc&&a.set(this.Hc.subarray(t.offset,t.offset+t.count),d),this.Ic&&l&&this.Qc&&l.set(this.Qc.subarray(t.offset,t.offset+t.count),d),this.Pc&&u&&this.$c&&u.set(this.$c.subarray(t.offset,t.offset+t.count),d),this.Dc&&c&&this.jc&&c.set(this.jc.subarray(t.offset,t.offset+t.count),d),d+=t.count;return{xValues:n,yValues:o,iSampleFirst:i,lookupValues:a,colors:h,ids:l,sizes:u,rotations:c}}onMaxSampleCountExceeded(t){return this.R.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.R.off(t)}Yc(t,e,i,s,r,n,o){if(void 0===e){const e=this.Ec();r=void 0!==r?r:o&&qr(o)===i?Kr(o)?1:-1:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.Bc(t);for(let e=0;ee){l=t;break}const c={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l};this.wc=!0,this.appendSamples(c),this.wc=!1}else{const l=t.length,u=this.xc,f=this.bc-1,y=Math.max(f-u+1,0),p=Mo(m,y,f,c,(t=>d[vo(t,this.bc,l,this.Sc)])),A=p-1,x=p+1,S=d[vo(p,this.bc,l,this.Sc)],v=x<=this.bc-1?d[vo(x,this.bc,l,this.Sc)]:void 0,b=void 0!==v&&(c&&vm)?x+1:c&&Sm?p+1:A+1,M=f-b+1,C=new this.Bc(M),T=new this.Bc(M),w=this.Tc?new Float32Array(M):void 0,E=this.Fc?new Uint32Array(M):void 0,k=this.Ic?new Uint32Array(M):void 0,I=this.Pc?new Float32Array(M):void 0,z=this.Dc?new Float32Array(M):void 0;let F=0;for(let i=b;i<=f;i+=1){const s=vo(i,this.bc,l,this.Sc);C[F]=t[s],T[F]=e[s],w&&this.Hc&&(w[F]=this.Hc[s]),E&&this.Xc&&(E[F]=this.Xc[s]),k&&this.Qc&&(k[F]=this.Qc[s]),I&&this.$c&&(I[F]=this.$c[s]),z&&this.jc&&(z[F]=this.jc[s]),F+=1}this.td(M);const R=new this.Bc(g+M);R.set(i),R.set(C,g);const D=new this.Bc(g+M);let P,O,L,_,B;D.set(s),D.set(T,g),r&&w&&(P=new Float32Array(g+M),P.set(r),P.set(w,g)),n&&E&&(O=new Uint32Array(g+M),O.set(n),O.set(E,g)),o&&k&&(L=new Uint32Array(g+M),L.set(o),L.set(k,g)),h&&I&&(_=new Float32Array(g+M),_.set(h),_.set(I,g)),a&&z&&(B=new Float32Array(g+M),B.set(a),B.set(z,g)),this.wc=!0,this.appendSamples({xValues:R,yValues:D,lookupValues:P,colors:O,ids:L,sizes:_,rotations:B}),this.wc=!1,this.R.emit("cleared")}}Kc(){return this.Wc()}Wc(t=!1){let e;if(this.kc&&"userSpecified"in this.kc)e=this.kc.userSpecified;else if(this.kc&&"autoDetectResult"in this.kc)e=this.kc.autoDetectResult;else if(this.zc&&this.Vc&&this.bc>0&&!t){const t=void 0!==this.Zc&&this.Mc?this.Sc:0,i=this.xc-1,s=void 0!==this.Zc&&this.Mc?0:void 0,r=void 0!==this.Zc&&this.Mc?this.Sc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-t)?[s,r]:[t,i];if(1+o-n>=2){let t,i,s=this.zc[n],r=this.Vc[n];for(let e=n+1;e<=o;e+=1){if(!1!==t){const i=this.zc[e],r=Math.sign(i-s);0!==r&&t&&t.direction!==r?t=!1:0===r||t||(t={direction:r}),s=i}if(!1!==i){const t=this.Vc[e],s=Math.sign(t-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=t}}e=t&&t.direction>0?Zr.ProgressiveX:t&&t.direction<0?Zr.RegressiveX:i&&i.direction>0?Zr.ProgressiveY:i&&i.direction<0?Zr.RegressiveY:void 0,this.kc={autoDetectResult:e},e&&zt.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${e}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${e}'} } to your application when creating series or DataSetXY to clear this warning.`)}}return e}Oc(t,e,i){const s=this.Ec();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.Cc.expandEvents.push({timestamp:i}),this.Cc.expandEvents.length>5)return zt.console.warn("LightningChart JS warning - DataSetXY append operation was performed more than 5 times in 5 seconds.\nAutomatic max sample count control was enabled.\nFor streaming applications, DataSetXY.setMaxSampleCount() or Series.setMaxSampleCount() should be configured explicitly to get rid of this warning."),this.Cc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.Rc(t)}const i=new this.Bc(e);i.set(this.zc),this.zc=i;const s=new this.Bc(e);if(s.set(this.Vc),this.Vc=s,this.Tc){const t=new Float32Array(e);this.Hc&&t.set(this.Hc),this.Hc=t}if(this.Ic){const t=new Uint32Array(e);this.Qc&&t.set(this.Qc),this.Qc=t}if(this.Fc){const t=new Uint32Array(e);this.Xc&&t.set(this.Xc),this.Xc=t}if(this.Pc){const t=new Float32Array(e);this.$c&&t.set(this.$c),this.$c=t}if(this.Dc){const t=new Float32Array(e);this.jc&&t.set(this.jc),this.jc=t}return this.Sc=this.xc,{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.Xc,samplesCacheSize:this.$c,samplesCacheRotation:this.jc,maxSampleCount:e}}if(i>4*e){const t=new this.Bc(e);t.set(this.zc.subarray(0,this.xc)),this.zc=t;const i=new this.Bc(e);if(i.set(this.Vc.subarray(0,this.xc)),this.Vc=i,this.Tc){const t=new Float32Array(e);this.Hc&&t.set(this.Hc.subarray(0,this.xc)),this.Hc=t}if(this.Ic){const t=new Uint32Array(e);this.Qc&&t.set(this.Qc.subarray(0,this.xc)),this.Qc=t}if(this.Fc){const t=new Uint32Array(e);this.Xc&&t.set(this.Xc.subarray(0,this.xc)),this.Xc=t}if(this.Pc){const t=new Float32Array(e);this.$c&&t.set(this.$c.subarray(0,this.xc)),this.$c=t}if(this.Dc){const t=new Float32Array(e);this.jc&&t.set(this.jc.subarray(0,this.xc)),this.jc=t}return{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.Xc,samplesCacheSize:this.$c,samplesCacheRotation:this.jc,maxSampleCount:e}}return{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.Xc,samplesCacheSize:this.$c,samplesCacheRotation:this.jc,maxSampleCount:i}}return t.appendCount+this.xc>this.Zc&&this.R.emit("maxSampleCountExceeded",this,this.xc,this.Zc,this.xc+t.appendCount),this.zc=this.zc||new this.Bc(this.Zc),this.Vc=this.Vc||new this.Bc(this.Zc),this.Hc=this.Hc||(this.Tc?new Float32Array(this.Zc):void 0),this.Qc=this.Qc||(this.Ic?new Uint32Array(this.Zc):void 0),this.Xc=this.Xc||(this.Fc?new Uint32Array(this.Zc):void 0),this.$c=this.$c||(this.Pc?new Float32Array(this.Zc):void 0),this.jc=this.jc||(this.Dc?new Float32Array(this.Zc):void 0),{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.Xc,samplesCacheSize:this.$c,samplesCacheRotation:this.jc,maxSampleCount:this.Zc}}sd(){if(!this.zc||!this.Vc||0===this.xc)return;if(void 0===this.Zc)return this.bc>0?{x:this.zc[0],y:this.Vc[0]}:void 0;if(!this.Mc)return{x:this.zc[0],y:this.Vc[0]};let t=this.Sc-this.xc;return t<0&&(t+=this.Zc),{x:this.zc[t],y:this.Vc[t]}}Ec(){if(!this.zc||!this.Vc||0===this.xc)return;if(void 0===this.Zc){const t=this.xc-1;return t>=0?{x:this.zc[t],y:this.Vc[t]}:void 0}let t=this.Sc-1;return t<0&&(t+=this.Zc),{x:this.zc[t],y:this.Vc[t]}}ed(t){if(!this.zc||!this.Vc)return;const e=this.zc.length,i=this.xc,s=this.bc-1,r=Math.max(s-i+1,0)+t,n=vo(r,this.bc,e,this.Sc);return{x:this.zc[n],y:this.Vc[n],lookupValue:this.Tc&&this.Hc?this.Hc[n]:void 0,id:this.Ic&&this.Qc?this.Qc[n]:void 0,color:this.Fc&&this.Xc?this.Xc[n]:void 0,size:this.Pc&&this.$c?this.$c[n]:void 0,rotation:this.Dc&&this.jc?this.jc[n]:void 0,iSample:r}}hd(t,e,i,s){const r=this.Wc(),n=this.zc,o=this.Vc;if(!n||!o)return;const h=(t,e)=>({x:n[t],y:o[t],lookupValue:this.Tc&&this.Hc?this.Hc[t]:void 0,id:this.Ic&&this.Qc?this.Qc[t]:void 0,color:this.Fc&&this.Xc?this.Xc[t]:void 0,size:this.Pc&&this.$c?this.$c[t]:void 0,rotation:this.Dc&&this.jc?this.jc[t]:void 0,iSample:e}),a=n.length,l=this.xc,u=this.bc-1,c=Math.max(u-l+1,0);if(r){const i=Kr(r),s=this.sd(),n=this.Ec();if(!(s&&n&&this.zc&&this.Vc))return;const o="ProgressiveX"===r||"RegressiveX"===r?"x":"y",l="x"===o?"y":"x",d="x"===o?this.zc:this.Vc,f="x"===l?this.zc:this.Vc,g=t[o],m=Math.min(s[o],n[o]),y=Math.max(s[o],n[o]);if(gy)return;const p=Mo(g,c,u,i,(t=>d[vo(t,this.bc,a,this.Sc)])),A=vo(p,this.bc,a,this.Sc);if(!e)return h(A,p);const x=p-1,S=p+1,v=d[A],b=i?g>=v?S<=u?S:void 0:x>=c?x:void 0:g<=v?S<=u?S:void 0:x>=c?x:void 0;if(void 0===b)return;const M=vo(b,this.bc,a,this.Sc),C=pb?{pos:d[A],val:f[A],iSample:p}:{pos:d[M],val:f[M],iSample:b},w=(g-C.pos)/(T.pos-C.pos),E=Jn(C.val,T.val,w);return"x"===qr(r)?{x:g,y:E,iSample:Jn(C.iSample,T.iSample,w)}:{y:g,x:E,iSample:Jn(C.iSample,T.iSample,w)}}let d,f=Number.MAX_VALUE;const g=yt(t,i,s),m=this.xc-1;for(let t=0;t<=m;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=mt(e,i.x,s.x),o=mt(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,bo=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=Kr(o),l=i.length,u=s-1,c=Math.max(u-r+1,0),d=Mo(t,c,u,a,(t=>i[vo(t,s,l)])),f=Mo(e,c,u,a,(t=>i[vo(t,s,l)])),g=Math.min(d,f),m=Math.max(d,f),y=Math.max(g-h,c),p=Math.min(m+h,u),A=vo(y,s,l),x=vo(p,s,l);return A>x?{iFirstSample:y,iLastSample:p,iFirstSampleDataArray:A,iLastSampleDataArray:x,dataRanges:[{offset:A,count:l-A},{offset:0,count:x+1}]}:{iFirstSample:y,iLastSample:p,iFirstSampleDataArray:A,iLastSampleDataArray:x,dataRanges:[{offset:A,count:x-A+1}]}},Mo=(t,e,i,s,r)=>{const n=i;for(;e!==i;){const n=Math.ceil((e+i)/2),o=r(n);s&&to?i=n-1:e=n}const o=Math.abs(t-r(e));return e{const n=e.length;if(Array.isArray(e))for(let n=0;nvoid 0===t?void 0:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),wo=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)},Eo=/^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|[+-]\d{2}:\d{2})?)?$/,ko=t=>"string"==typeof t&&Eo.test(t)&&!zt.isNaN(Date.parse(t));class Io extends Zn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ba="label",this.qa=this.Rs.Wr(this.renderingScale).Sr(this.ba).Re(_).Gr(Le).Ur(Le),this.setMargin(5),this.Bu(this.qa)}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}ze(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=yt(t,this.scale,this.renderingScale);return this.qa.Ve(i),this}Os(){this.qa.Os(),void 0!==this.oa&&this.qa.ua(this.oa);const t=0===this.ba.length?u(0,0):this.qa.od();return this.setContentSize(t),super.Os()}setText(t){return this.ba=t,this.qa.Sr(this.ba),this.Rs.Ms(),this}getText(){return this.ba}setFont(t){return this.qa.ir(t),this.Rs.Ms(),this}getFont(){return this.qa.tr()}setTextRotation(t){return this.qa.sr(t),this.Rs.Ms(),this}getTextRotation(){return this.qa.er()}}const zo={...Yn,...Xn,uiElement:Io};class Fo extends qn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ad=!1,this.fitTo=this.Yu.bind(this),this.setSize=this.fitTo,this.qa=this.Rs.fc(e).Re(_).Le(ut),this.Bu(this.qa)}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}ze(){void 0!==this.oa&&this.qa.ua(this.oa);const t=ni([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>yt(t,this.scale,this.renderingScale))));return this.ad?this.qa.Fl([{x:(t.min.x+t.max.x)/2,y:t.min.y},{x:t.min.x,y:(t.min.y+t.max.y)/2},{x:(t.min.x+t.max.x)/2,y:t.max.y},{x:t.max.x,y:(t.min.y+t.max.y)/2}]):this.qa.Fl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Yu(t){return this.setContentSize(t),this.Rs.Ms(),this}Hu(){return 0}Xu(){return 0}ju(){return 0}$u(){return 0}}class Ro extends qn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ld=u(0,0),this.qa=t.ud(e).Au(0).Xe(360).Re(_).Le(ut),this.Bu(this.qa)}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}ze(){void 0!==this.oa&&this.qa.ua(this.oa);const t=this.getSize(e.UISpace.Content).x/2;return this.qa.pu(t*this.renderingScale.Ui().x).yu(t*this.renderingScale.Ui().y).Ve(yt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).vu(255).Os(),this}Yu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.ld=t,this.Rs.Ms(),this}Hu(){return(this.getSize(e.UISpace.Content).x-this.ld.x)/2}Xu(){return(this.getSize(e.UISpace.Content).x-this.ld.x)/2}ju(){return(this.getSize(e.UISpace.Content).y-this.ld.y)/2}$u(){return(this.getSize(e.UISpace.Content).y-this.ld.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.ld=t,this}}class Do extends Kn{constructor(t,e,i,s,r){super(t,e,i,Tn.Simple,s,r),this.dd=p(u(0,0)),this.fd=!1,this.Rs=t,this.Ac()}gc(){const t=this.dd.C();if(this.fd){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.dd.C().x*this.dd.C().x/4+this.dd.C().y*this.dd.C().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=yi(r,yi(i,s)),o=yi(n,yi(s,mi(i,-1)));return[r,n,o,pi(o,yi(i,s))]}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}Yu(t){return this.dd._(t),this.fd=!1,this.Rs.Ms(),this}Hu(){return this.fd?0:(this.getSize(e.UISpace.Content).x-this.dd.C().x)/2}Xu(){return this.fd?0:(this.getSize(e.UISpace.Content).x-this.dd.C().x)/2}ju(){return this.fd?0:(this.getSize(e.UISpace.Content).y-this.dd.C().y)/2}$u(){return this.fd?0:(this.getSize(e.UISpace.Content).y-this.dd.C().y)/2}fitTo(t){return this.dd._(t),this.fd=!0,this.Rs.Ms(),this}}class Po extends Kn{constructor(t,i,s,r,n){super(t,i,s,Tn.Simple,r,n),this.Ad=p(u(0,0)),this.gd=p(10),this.pd=p(void 0),this.tc=p(e.UIDirections.Right),this.Ac()}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}setDirection(t){return this.tc._(t),this.Rs.Ms(),this}getDirection(){return this.tc.C()}setPointerLength(t){return this.gd._(t),this.Rs.Ms(),this}getPointerLength(){return this.gd.C()}setPointerAngle(t){return this.pd._(t),this.Rs.Ms(),this}getPointerAngle(){let t=this.pd.C();if(void 0===t){const e=this.yd();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)}Yu(t){return this.Ad._(t),this.Rs.Ms(),this}md(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}vd(){return ie(this.tc.C())?this.Ad.C().x:this.Ad.C().y}yd(){return ie(this.tc.C())?this.Ad.C().y:this.Ad.C().x}Hu(){switch(this.tc.C()){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.md()-this.yd());default:return 0}}Xu(){switch(this.tc.C()){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.md()-this.yd());default:return 0}}ju(){switch(this.tc.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.md()-this.yd());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}$u(){switch(this.tc.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.md()-this.yd());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}gc(){const t=ee(this.tc.C()),e=fi(u(0,0),t),i=this.getPointerLength(),s=this.md(),r=this.vd(),n=this.yd();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=yi(yi(o,mi(t,-i)),mi(e,s/2)),a=yi(h,mi(e,(n-s)/2)),l=yi(a,mi(t,-r)),c=yi(yi(o,mi(t,-i)),mi(e,-s/2)),d=yi(c,mi(e,-(n-s)/2)),f=yi(d,mi(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Lt(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Oo extends Zn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Yu.bind(this),this.setSize=this.fitTo,this.Sd=new So,this.qa=this.Rs._d(e).Ye(ut).Md(_).bd(_).xd(this.Sd),this.Bu(this.qa)}Nu(){return[this.qa]}setShape(t){return this.qa.wd(t),this}getShape(){return this.qa.Cd()}setRotation(t){return this.qa.kd(t),this}getRotation(){return this.qa.Td()}setFillStyle(t){return this.qa.bd(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Fd()}ze(){void 0!==this.oa&&this.qa.ua(this.oa);const t=yt(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.Sd.clear(),i>0){const e=this.qa.Cd(),s=this.qa.Fd(),r=po(e)&&e,n=tt(s)&&s;if(r){const t=i/r.oi().y;this.qa.Id(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.qa.Id(e)}}else this.qa.Id(i);this.Sd.appendSample(t)}return this}Yu(t){return this.setContentSize(t),this.Rs.Ms(),this}Hu(){return 0}Xu(){return 0}ju(){return 0}$u(){return 0}}const Lo={...Yn,...Xn,uiElement:Oo};class _o extends jn{setSize(t){return this.setContentSize(t),this.Rs.Ms(),this}}class Bo extends Ln{constructor(){super(...arguments),this.Pd=[],this.Dd=0,this.Bd=t=>{const e=this.Pd.indexOf(t);e>=0&&this.Pd.splice(e,1)}}getMembers(){return this.Pd}getMemberCount(){return this.Pd.length}setMinimumSize(t){return this.Ld=t,this.Rs.Ms(),this}getMinimumSize(){return this.Ld}addElement(t,e=-1){const i=t.oc(this.Rs,this.renderingScale,this.scale,this.Bd,this.ts,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Pd.splice(e,0,i):this.Pd.push(i),i.setVisible(this.getVisible()),this.Bu(i),this.ji&&(Me(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Pd.slice().forEach(Pt),this}Os(){super.Os();const t=this.oa;return void 0!==t&&this.Pd.forEach(((e,i)=>{e.oa=t+1+.01*i})),this}setVisible(t){return super.setVisible(t),this.Pd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof _o)),0),s=i>0?(this.size.x-this.Dd)/i:0;return this.Pd.reduce(((e,i)=>i instanceof _o?this.scale.pi({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).ze().getPosition(u(1,0)).x),t.x),this}Os(){for(let t=0;tt+ +(e instanceof _o)),0),s=i>0?(this.size.y-this.Dd)/i:0;return this.Pd.reduce(((e,i)=>i instanceof _o?this.scale.pi({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).ze().getPosition(u(0,-1)).y),t.y),this}Os(){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},$o=jo("Text",[]),Zo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.R.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.R.on("switch",(e=>t(this,e)))},offSwitch(t){return this.R.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonSize(t){return this.button.setSize(t),this},getButtonSize(){return this.button.getSize()},setButtonShape(t){return this.button.setButtonShape(t),this},getButtonShape(){return this.button.getButtonShape()}},qo={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},Ko={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()}},Jo={...Yn,...Hn,background:Fo,oc(t,e,i,s,r,n){const o=new Vo(t,e,i,this.background,s,r),h=o.addElement(zo,void 0),a=Object.assign(o,Wo,{setTextLabel:h},$o,{stylableTexts:[h]});return Un(a,r,n),this.applyStylers(a,r)}}.addStyler(Gn),Qo={...Yn,...Hn,background:Po,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},oc(t,i,s,r,n,o){const h=this.direction,a=new Vo(t,i,s,this.background,r,n),l=a.addElement(zo,void 0),u=a.getBackground().setDirection(h),c=Object.assign(a,Wo,{setTextLabel:l},$o,{stylableTexts:[l]},Ko,{pointable:u},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),l.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),l.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),l.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),l.setMargin({left:0})),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 c.ac="other",c.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))),Un(c,n,o),this.applyStylers(c,n)}};class th extends On{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Ns=!1,this.R=new r.Eventer,this.Ed=_,this.zd=_,this.getOn=()=>this.Ns,this.zd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle,this.Vd=this.Bu(new Oo(this.Rs,this.renderingScale,this.scale,Ot,o).setShape(s)).setFillStyle(this.zd)}Nu(){return[...this.Vd.Nu()]}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setOn(t){return this.Ns=t,this.Vd.setFillStyle(t?this.Ed:this.zd),this.Rs.Ms(),this}setOffFillStyle(t){return this.zd="function"==typeof t?t(this.zd):t,this.Ns||this.Vd.setFillStyle(this.zd),this}getOffFillStyle(){return this.zd}setSize(t){return this.Vd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Vd.getSize()}setOnFillStyle(t){return this.Ed="function"==typeof t?t(this.Ed):t,this.Ns&&this.Vd.setFillStyle(this.Ed),this}getOnFillStyle(){return this.Ed}setButtonShape(t){return this.Vd.setShape(t),this.Rs.Ms(),this}getButtonShape(){return this.Vd.getShape()}ze(){return super.ze(),this.Vd.oa=this.oa,this.Vd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).ze(),this}Os(){const t=this.Vd.Os().getSize();return this.setContentSize(t),super.Os()}dispose(){return super.dispose(),this.Vd.dispose(),this}setMouseInteractions(t){return this.Vd.setMouseInteractions(t),this}getMouseInteractions(){return this.Vd.getMouseInteractions()}setHighlight(t){const e=ke(t);return this.Vd.setHighlight(e),this.R.emit("highlight",this,t),this.Rs.Ms(),this}getHighlight(){return this.Vd.getHighlight()}}const eh={...Yn,uiElement:th,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},oc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return Un(o,r,n),o}},ih={...Yn,...Hn,background:Fo,buttonBuilder:eh,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},oc(t,i,s,r,n,o){const h=new Vo(t,i,s,this.background,r,n),a=h.addElement(Ho);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Ho);u.addGap();const c=u.addElement(zo);u.addGap(),h.addGap();const d=Object.assign(h,Wo,{setTextLabel:c},$o,{stylableTexts:[c]},Zo,{button:l},qo);let f;return d.onMouseClick(((t,e)=>{d.getLocked()||d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:5}),Un(d,n,o),this.applyStylers(d,n)}}.addStyler(Gn).addStyler(Nn);class sh extends On{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Od=[],this.Nd=2,this.Gd="",this.Ud=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:_i(t.value,e.min,e.max),this.Wd=0,this.Yd=0,this.Hd=!1,this.Rs=t,this.Xd=n,this.$d=this.Bu(t.Ee(e).Le(ut)),this.jd=this.Bu(t.Wr(e).Re(r.uiTextFillStyle).ir(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Zd=140,this.Qd=25):(this.Zd=160,this.Qd=15)}Nu(){return[this.$d,this.jd]}Jd(t){this.Kd=t;const e=oh(t,"vertical"===this.Xd?0:90,this.Hd);return this.$d.Re(e),this.Rs.Ms(),this}qd(){return this.Kd}tf(t){return this.Zd=t,this.Rs.Ms(),this}if(){return this.Zd}sf(t){return this.Qd=t,this.Rs.Ms(),this}ef(){return this.Qd}hf(t){return this.Gd=t,this.Rs.Ms(),this}rf(){return this.Gd}nf(t){return this.Ud=t,this.Rs.Ms(),this}setLUTDisplayProportionalSteps(t){if(this.Hd=t,this.Kd){const t=oh(this.Kd,"vertical"===this.Xd?0:90,this.Hd);this.$d.Re(t)}return this.Rs.Ms(),this}getLUTDisplayProportionalSteps(){return this.Hd}setFillStyle(t){return this.jd.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.jd.Jh()}setFont(t){return this.jd.ir(t),this.Rs.Ms(),this}getFont(){return this.jd.tr()}setTextRotation(t){return this.Yd=t,this.jd.sr(t),this.Rs.Ms(),this}getTextRotation(){return this.jd.er()}ze(){var t,i,s,r;if(super.ze(),this.ji||!this.getVisible())return this;const n=this.Kd;if(n){const o=this.renderingScale.Ui(),h=n.min,a=n.max;if("vertical"===this.Xd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=yi(s,{x:this.$d.oi().x+this.Nd*o.x,y:0}),l={x:r.x,y:r.y+(this.Gd.length>0?this.Wd*o.y+this.jd.oi().y:0)+.5*((null===(t=this.Od[0])||void 0===t?void 0:t.oi().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Od[this.Od.length-1])||void 0===i?void 0:i.oi().y)||0)};this.$d.Ve({x:s.x,y:l.y}),this.jd.Za({x:-1,y:-1}).Ve(r),n.getSteps().forEach(((t,e)=>{const i=si(l,u,this.Hd?!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.Od[e].Za({x:-1,y:0}).Ve(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.Od.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=yi(t,{x:.5*((null===(s=this.Od[0])||void 0===s?void 0:s.oi().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Od[this.Od.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Gd.length>0?this.Wd*o.x+this.jd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Nd*o.y};this.$d.Ve(f),this.jd.Za({x:1,y:1}).Ve(c),n.getSteps().forEach(((t,e)=>{const i=si(u,d,this.Hd?!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.Od[e].Za({x:0,y:1}).Ve(i)}))}}return this}Os(){if(this.Kd&&this.getVisible()){const t=this.Kd.getSteps();for(let e=this.Od.length;eMath.max(t,e.Os().od().x)),0),this.jd.Os().od().x),s=(this.Gd.length>0?this.Wd+this.jd.Os().od().y:0)+e+.5*this.Od[0].Os().od().y+.5*this.Od[this.Od.length-1].Os().od().y;this.setContentSize({x:i,y:s})}else{const t=this.Zd,e=this.Qd;this.$d.it({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Gd.length>0?this.Wd+this.jd.Os().od().x:0,.5*this.Od[this.Od.length-1].Os().od().x),s=t+.5*this.Od[0].Os().od().x+i,r=e+this.Nd+this.Od.reduce(((t,e)=>Math.max(t,e.Os().od().y)),0);this.setContentSize({x:s,y:r})}}else this.Od.forEach((t=>t.dispose())),this.Od.length=0,this.jd.setVisible(!1),this.$d.setVisible(!1),this.setContentSize({x:0,y:0});return super.Os()}dispose(){return super.dispose(),this.$d.dispose(),this.Od.forEach(Pt),this.jd.dispose(),this}setMouseInteractions(t){return this.$d.setMouseInteractions(t),this}getMouseInteractions(){return this.$d.getMouseInteractions()}}const rh={lutElement:{},setLUT(t){return this.lutElement.Jd(t),this},getLUT(){return this.lutElement.qd()},setLUTLength(t){return this.lutElement.tf(t),this},getLUTLength(){return this.lutElement.if()},setLUTThickness(t){return this.lutElement.sf(t),this},getLUTThickness(){return this.lutElement.ef()},setLookUpUnit(t){return this.lutElement.hf(t),this},getLookUpUnit(){return this.lutElement.rf()},setLUTStepValueFormatter(t){return this.lutElement.nf(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},nh={...Yn,...Hn,background:Fo,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},oc(t,e,i,s,r,n){const o=new Go(t,e,i,this.background,s,r),h=o.addElement({oc:()=>new sh(t,e,i,Ot,r,this.alignment)}),a=Object.assign(o,$o,{stylableTexts:[h]},rh,{lutElement:h});return Un(a,r,n),this.applyStylers(a,r)}}.addStyler(Gn),oh=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new ht({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 sh(t,i,s,Ot,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Wo,{setTextLabel:c},$o,{stylableTexts:[c,d]},jo("LUTText",[d]),Zo,{button:l},rh,{lutElement:d},qo);let g;return f.onMouseClick((()=>{f.getLocked()||f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:5}),this.applyStylers(f,n)}}.addStyler(Gn).addStyler(Nn),ah={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=null==e?void 0:e.matchStyleExactly,r=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof fa?this.addChart(t,i,r,s):"attach"in t?this.addAttachable(t,i,r,s):t&&this.addDashboard(t,i,r,s)),this},addAttachable(t,e,i,s){const r=t.qd&&t.qd(),n=t.Bs&&t.Bs(),o=void 0!==s&&s;let h=i;if(!h){let t=r?hh.setAlignment(this.alignment):ih;void 0!==n&&(t=t.setButtonShape(n)),h=t}const a=this.addElement(h);if(r&&"setLUT"in a){a.setLUT(r.lut);const t=r.lut.getUnits(),e=r.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";a.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(a))),this.entries.push({entry:a,component:t}),t.attach(a,e,o),e||a.setLocked(!0),this},addChart(t,e,i,s){return t.af().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof fa)).forEach((t=>this.addChart(t.panel,e,i,s))),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}},lh={alignment:"vertical",layoutBuilder:Ho,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Xo:Ho}},getAlignment(){return this.alignment},titleBuilder:Jo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},uh={...Yn,...Hn,...lh,background:Fo,oc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).oc(t,e,i,s,r,!1);let h=Object.assign(o,ah,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.ji});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Ho:Xo),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}),Un(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class ch extends On{constructor(t,i,s,r,n){super(t,i,s,r,n),this.lf=10,this.uf=e.UIDirections.Up,this.cf=0,this.ac="major",this.ba=this.Bu(t.Wr(this.renderingScale).Gr(Le).Ur(Le)),this.We=this.Bu(t.He(this.renderingScale))}Nu(){return[this.ba]}ze(){if(super.ze(),this.ji)return this;const t=yt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.uf===e.UIDirections.Right?-this.lf:this.uf===e.UIDirections.Left?this.lf:0,y:this.uf===e.UIDirections.Up?-this.lf:this.uf===e.UIDirections.Down?this.lf:0}),s=this.renderingScale.pi(i,{x:this.uf===e.UIDirections.Right?-this.cf:this.uf===e.UIDirections.Left?this.cf:0,y:this.uf===e.UIDirections.Up?-this.cf:this.uf===e.UIDirections.Down?this.cf:0});return this.We.$e(t).Xe(i),this.ba.Ve(s).Za(this.uf===e.UIDirections.Up?{x:0,y:1}:this.uf===e.UIDirections.Down?{x:0,y:-1}:this.uf===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Os(){const t=this.We.xu().getThickness();return this.size=this.uf===e.UIDirections.Left||this.uf===e.UIDirections.Right?{x:this.lf+this.cf+this.ba.Os().od().x,y:t}:{y:this.lf+this.cf+this.ba.Os().od().y,x:t},super.Os()}dispose(){return super.dispose(),this.ba.dispose(),this.We.dispose(),this}setVisible(t){return super.setVisible(t),this.ba.setVisible(t),this.We.setVisible(t),this}setMouseInteractions(t){return this.ba.setMouseInteractions(t),this.We.setMouseInteractions(t),this}getMouseInteractions(){return this.ba.getMouseInteractions()}getText(){return this.ba.Tr()}setTextFillStyle(t){return this.ba.Re(t),this.Rs.Ms(),this}getTextFillStyle(){return this.ba.Jh()}setTextFont(t){return this.ba.ir(t),this}setTextRotation(t){return this.ba.sr(t),this}getTextRotation(){return this.ba.er()}getTextFont(){return this.ba.tr()}setText(t){return this.ba.Sr(t),this.Rs.Ms(),this}setDirection(t){return this.uf=t,this.Rs.Ms(),this}getDirection(){return this.uf}setPointerLength(t){return this.lf=t,this.Rs.Ms(),this}getPointerLength(){return this.lf}setTickLabelPadding(t){return this.cf=t,this.Rs.Ms(),this}getTickLabelPadding(){return this.cf}setTickStyle(t){return this.We.Ye(t),this.Rs.Ms(),this}getTickStyle(){return this.We.xu()}}const dh={...Yn,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},oc(t,e,i,s,r,n){const o=this.direction,h=new ch(t,e,i,s,r);return Un(h,r,n),h.setDirection(o),this.applyStylers(h,r)}}.addStyler(Gn),fh=dh.addStyler(((t,e)=>(t.ac="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)))),gh=dh.addStyler(((t,e)=>(t.ac="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)))),mh=ih.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),yh=uh.setAlignment("horizontal"),ph=uh.setAlignment("vertical"),Ah={TextBox:Jo,CheckBox:ih,ButtonBox:mh,PointableTextBox:Qo,AxisTickMajor:fh,AxisTickMinor:gh,LUTRange:nh},xh={HorizontalLegendBox:yh,VerticalLegendBox:ph},Sh={df:"X0Z1bGxBY2Nlc3M=",ff:"X0Jhc2VDaGFydHM=",Af:"RGF0YSBHcmlk",gf:"X0hhc0hhcmRFeHBpcmF0aW9u",pf:"X0lzVHJpYWw=",yf:"X0lzQ29tbXVuaXR5",mf:"T0hMQyBTZXJpZXM=",vf:"QmFyIENoYXJ0",Sf:"c2xpY2VkIGNoYXJ0cw==",xf:"R2F1Z2UgQ2hhcnQ=",bf:"U3BpZGVyIENoYXJ0",Mf:"UG9sYXIgQ2hhcnQ=",_f:"M0QgQ2hhcnQ=",wf:"Wm9vbSBCYW5kIENoYXJ0",Cf:"TWFwIENoYXJ0",kf:"WFkgQ2hhcnQ=",Tf:"WFkgU2VyaWVz",Ff:"SGVhdG1hcCBTZXJpZXM=",If:"RmlndXJlIFNlcmllcw==",Pf:"bG9nYXJpdGhtaWMgYXhpcw==",Df:"cmVhbC10aW1lIHZpc3VhbGl6YXRpb24=",Bf:"aW5kaXZpZHVhbCBwb2ludCBzaXpl",Lf:"aW5kaXZpZHVhbCBwb2ludCBjb2xvcg==",Rf:"VHJlZU1hcCBDaGFydA==",Ef:"UGFyYWxsZWwgQ29vcmRpbmF0ZSBDaGFydA==",zf:"X1B5dGhvbkxpY2Vuc2U="};class vh extends mr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Vf=r}}class bh extends gr{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,y,p,A){var x,S,v;super(d,c,a,y,p,{numeric:c.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:c.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:c.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},A),this.Of=new Map,this.Nf=void 0,this.Gf=0,this.Uf=[],this.Wf=[],this.fh=Ks.fitting,this.Yf=!0,this.Hf=8,this.Xf=void 0,this.$f=void 0,this.jf=20,this.Zf=1,this.Qf=!0,this.Jf=!0,this.Kf=!0,this.qf=!0,this.tA=!0,this.iA=!0,this.sA=!0,this.eA=!0,this.hA=!0,this.rA=!0,this.nA=this.Gh.defaultDragMouseStyle,this.oA=this.Gh.defaultDragMouseStyle,this.aA=this.Gh.defaultDragMouseStyle,this.lA=this.Gh.defaultDragMouseStyle,this.uA=this.Gh.defaultDragMouseStyle,this.R=new r.Eventer,this.cA=[],this.dA=t=>{const e=this.Wf.indexOf(t);e>=0&&this.Wf.splice(e,1)},this.fA=t=>(this.Wf.indexOf(t)<0&&this.Wf.push(t),this.dA),this.AA="center",this.Rt=(t,e)=>this.R.emit("axisAreaTouch",this,e),this.gA=he(this.cA),this.onAxisInteractionAreaMouseClick=t=>this.R.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.R.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.R.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.R.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.R.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.R.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.R.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.R.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.R.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.R.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.R.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.R.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.R.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.R.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.R.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.R.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.R.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.R.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.R.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.R.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.R.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.R.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.R.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.R.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.R.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.R.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.R.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.R.off(t,"axisAreaTouchEnd"),this.Zd={relative:1},this.pA=0,this.yA=0,this.mA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().cc()):t,this.vA=t=>{const e=this.Uf.indexOf(t);-1!==e&&this.Uf.splice(e,1)},this.SA=(t,e)=>{this.R.emit("axisAreaDoubleClick",this,e),this.qf&&(this.setStopped(!1),se(e))},this.xA=t=>{this.R.emit("axisAreaMouseEnter",this),(this.Jf||this.Qf||this.Kf||this.qf)&&this.bA(t)},this.MA=t=>{this._A(t),this.R.emit("axisAreaMouseLeave",this)},this.wA=(t,e,i)=>{var s,r;this.R.emit("axisAreaMouseDragStart",this,e,i);const n=Vt(null===(s=this.chart.CA.so)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Vt(null===(r=this.chart.CA.so)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Jf?(this.kA(t),se(e)):i===n&&this.Qf&&(this.TA(t,h),se(e))},this.FA=(t,e,i,s,r)=>{var n,o;this.R.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Vt(null===(n=this.chart.CA.so)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Vt(null===(o=this.chart.CA.so)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Jf?(this.IA(t,r),se(e)):i===h&&this.Qf&&(this.PA(t,s,l,r),se(e))},this.DA=(t,e,i,s)=>{var r,n;this.R.emit("axisAreaMouseDragStop",this,e,i,s);const o=Vt(null===(r=this.chart.CA.so)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Vt(null===(n=this.chart.CA.so)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Jf?(this.BA(t),se(e)):i===o&&this.Qf&&(this.LA(t,s,a),se(e)),t.getIsUnderMouse()&&(this.Jf||this.Qf||this.Kf||this.qf)&&this.bA(t)},this.RA=(t,e)=>{if(this.R.emit("axisAreaMouseWheel",this,e),this.Kf){this.setStopped(!0);const t=this.Gh.getWidth(this.EA.cs.Ne(e.clientX,e.clientY)),i=this.At.dt(t);this.zoom(i,be(e)),se(e)}},this.zA=(t,e)=>this.R.emit("axisAreaMouseClick",this,e),this.VA=(t,e)=>this.R.emit("axisAreaMouseDown",this,e),this.OA=(t,e)=>this.R.emit("axisAreaMouseUp",this,e),this.NA=(t,e)=>this.R.emit("axisAreaMouseMove",this,e),this.GA=(t,e,i)=>{this.R.emit("axisAreaTouchStart",this,i),this.Qf&&(this.bA(t),this.TA(t,e),se(i))},this.UA=(t,e,i,s,r)=>{this.R.emit("axisAreaTouch",this,r),this.Qf&&(this.PA(t,e,i,s),se(r))},this.WA=(t,e,i,s)=>{this.R.emit("axisAreaTouchEnd",this,s),this.Qf&&(this.LA(t,e,i),this._A(t),se(s))},this.YA=(t,e,i,s)=>{(this.Jf||this.Kf)&&(this.bA(t),this.kA(t),se(s))},this.HA=(t,e,i,s,r,n)=>{if(this.Jf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.IA(t,e),se(n)}if(this.Kf){const t=this.EA.cs.Ne(e.x,e.y),o=this.EA.cs.Ne(i.x,i.y),h=Math.abs(this.Gh.getWidth(pi(t,s))-this.Gh.getWidth(pi(o,r)))-Math.abs(this.Gh.getWidth(t)-this.Gh.getWidth(o)),a=this.At.pi(this.Xh,-h),l=this.At.pi(this.$h,h);this.ur(a,l,!0),se(n)}},this.XA=(t,e,i,s)=>{(this.Jf||this.Kf)&&(this.BA(t),this._A(t),se(s))},this.$A=(t,e)=>{(this.tA||this.iA)&&this.jA(t)},this.ZA=(t,e)=>{this.QA(t)},this.JA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.tA&&this.KA(t,s)},this.qA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.tA&&this.tg(t,n,s,r)},this.ig=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.tA&&this.sg(t,n,s,r)},this.eg=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.tA||this.iA)&&this.hg(t,r,s),(this.tA||this.iA)&&this.jA(t)},this.rg=(t,e)=>{this.iA&&(this.setStopped(!0),this.zoom(this.Xh,be(e)),se(e))},this.ng=(t,e)=>{this.iA&&(this.setStopped(!0),this.zoom(this.$h,be(e)),se(e))},this.og=(t,e,i)=>{this.tA&&(this.jA(t),this.KA(t,e),se(i))},this.ag=(t,e,i,s,r)=>{this.tA&&(this.tg(t,e,i,s),se(r))},this.lg=(t,e,i,s,r)=>{this.tA&&(this.sg(t,e,i,s),se(r))},this.ug=(t,e,i,s)=>{this.tA&&(this.hg(t,e,i),this.QA(t),se(s))},this.cg=t,this.EA=i,this.dg=n,this.Ag=o,this.chart=d,this.gg=g,this.pg=s,this.es=h,"logarithmic"===A.type&&this.chart.cs.Jn(Sh.Pf),m(this,this.fA),a.yg=this,this.mg=f,this.vg=this.mg>50?1:-1,this.Sg=(v=this.Gh.toPoint(0,-this.vg),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.xg=l,this.bg=this.At instanceof Gi?(new Yi).Ri(this.Gh.toVec2(this.At,this.xg)):(new Hi).Ri(this.Gh.toVec2(this.At,this.xg)),this.Mg=this.chart._g,this.wg=(new Yi).Ri(this.Gh.toVec2(this.Gh.getWidth(this.Mg),this.xg)),this.Cg=this.EA.He(this.bg).setMouseInteractions(!1),this.kg=this.EA.He(this.bg).setMouseInteractions(!1),this.Tg=this.EA.He(this.bg).setMouseInteractions(!1),this.Fg=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Le(ut).ra(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Ig=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Le(c.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.Pg=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Le(ut).ra(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Dg=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Le(ut).ra(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Fh=this.pg.Wr(this.bg).setMouseInteractions(!1).sr(this.Gh.getTitleTextRotation(this.vg)).Ur(Le).Gr(Le),this.chart.cs.us.ls(this.Fg,(t=>this.Fg.ds(t)),{animationEnabled:this.ph}),this.chart.cs.us.ls(this.Pg,(t=>this.Pg.ds(t)),{animationEnabled:this.ph}),this.chart.cs.us.ls(this.Dg,(t=>this.Dg.ds(t)),{animationEnabled:this.ph});const b=ns(new hs(this.GA,this.UA,this.WA,1),new as(this.YA,this.HA,this.XA),new os(this.SA)),M=ns(new hs(this.og,this.ag,this.ug)),C=ns(new hs(this.og,this.lg,this.ug));this.Fg.setMouseEnterEventHandler(this.xA).setMouseLeaveEventHandler(this.MA).setMouseDragStartEventHandler(this.wA).setMouseDragEventHandler(this.FA).setMouseDragStopEventHandler(this.DA).setMouseWheelEventHandler(this.RA).setMouseDoubleClickEventHandler(this.SA).setMouseClickEventHandler(this.zA).setMouseDownEventHandler(this.VA).setMouseUpEventHandler(this.OA).setMouseMoveEventHandler(this.NA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.Pg.setMouseEnterEventHandler(this.$A).setMouseLeaveEventHandler(this.ZA).setMouseDragStartEventHandler(this.JA).setMouseDragEventHandler(this.qA).setMouseDragStopEventHandler(this.eg).setMouseWheelEventHandler(this.rg).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.Dg.setMouseEnterEventHandler(this.$A).setMouseLeaveEventHandler(this.ZA).setMouseDragStartEventHandler(this.JA).setMouseDragEventHandler(this.ig).setMouseDragStopEventHandler(this.eg).setMouseWheelEventHandler(this.ng).setTouchStartEventHandler(C.onTouchStart).setTouchMoveEventHandler(C.onTouchMove).setTouchEndEventHandler(C.onTouchEnd),this.Cg.Ye(c.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.kg.Ye(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Tg.Ye(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Fh.Re(c.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).ir(c.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.hs=h.rs(this,{}),this.hr=this.hs.Bg([this.Fh]).bs(y.effectsText),this.Lg=null!==(x=c.getWidth({x:y.xAxisMarginAfterTicks,y:y.yAxisMarginAfterTicks}))&&void 0!==x?x:7,this.Rg=null!==(S=c.getWidth({x:y.xAxisMarginAfterTitle,y:y.yAxisMarginAfterTitle}))&&void 0!==S?S:7}Or(){return this.Sh}Nr(){return void 0!==this.lr}setTickStrategy(t,e){return super.Hh(t,e)}getTickStrategy(){return this.lh}addBand(t=!0){const e=t?this.Ag:this.dg,i=new Zs(e,this.chart,this.gA,this,this.bg,this.Gh,this.ts,this.es);return this.cA.push(i),i}addConstantLine(t=!0){const e=t?this.Ag:this.dg,i=new qs(e,this.chart,this.gA,this,this.bg,this.Gh,this.ts,this.es);return this.cA.push(i),i}Eg(t){this.cA.forEach(t)}zg(t){return this.cA.map(t)}getHighlighters(){return this.cA}setThickness(t){return"number"==typeof t?(this.Vg=t,this.Og=t):"object"==typeof t&&(this.Vg=t.min,this.Og=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Vg,max:this.Og}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Ng(){return this.Wf}Mr(t,e){return new vh(e,t,this.EA,this.bg,this.bg)}rr(){if(this.Of){for(const t of this.Of)t[1].grid.dispose(),t[1].tick.dispose();this.Of.clear()}super.rr()}_r(t,e){const{tickStart:i}=e,s=t.Eh.je,r=i+s.getTickLength()*this.vg+s.getTickPadding()*this.vg;t.rh.Ve(this.Gh.toPoint(t.M,r)).Za(this.Gh.toPoint(s.getLabelAlignment(),-this.vg)).sr(s.labelRotation).setVisible(this.getVisible())}Gg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Eh.je,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.vg;return{gridStroke:{start:this.Gh.toPoint(t.M,r),end:this.Gh.toPoint(t.M,h)},tickStroke:{start:this.Gh.toPoint(t.M,n),end:this.Gh.toPoint(t.M,a)}}}Er(t,e){return"linear"===this.Wh.type?Qi(t,e,this.At):ts(t,e,this.At)}Ug(t,e){return e instanceof Gi?Qi:ts}Vr(t,e,i){if("logarithmic"!==this.Wh.type){const s=this.At.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.At,r={start:s.$,end:s.j};s.q(t,e).fi();const n={min:s.pi(t,-i),max:s.pi(e,i)};return s.q(r.start,r.end).fi(),n}Os(){if(!this.Zi)return{Wg:0,Yg:0,Qd:0};const t=!(this.uh.size>0),e=this.Fh&&this.Fh.Tr().length>0&&this.getTitleFillStyle()!==_,i=this.Gh.getHeight(e?this.chart.cs.Xg.Hg(this.Fh.Tr(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.Rg:0),s=ur(this.ah)?new Map:yr(this.ah,Math.min(this.Xh,this.$h),Math.max(this.Xh,this.$h),this.Xh,this.$h,0),r=this.At;let n=0;s.forEach(((e,i)=>{if(Qs(i)){const s=Math.max(...e.map((e=>{if(!ti(e,this.Xh,this.$h))return 0;const s=this.chart.cs.Xg.Hg(i.Ze(e,r),i.je.labelFont,i.je.labelRotation);return t||!s.isEstimate?this.Gh.getHeight(s):0})))+i.je.tickLength+i.je.tickPadding;n=Math.max(n,s)}}));const o=this.Uf.reduce(this.mA,0);n=Math.max(n,o),n+=this.Lg;const h=_t(i+n,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye);return this.Gf=h,{Wg:n,Yg:i,Qd:h}}ze(t){const e=this.getVisible()&&t.$g>0;this.jg=t;const i=this.Cg.xu(),s=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart(),n=i.getThickness()*this.vg/2,o=this.xg.getInnerInterval(),h=this.mg/100*o,a=h+t.Zg,l=o*this.vg,u=a+n;if(e||this.rr(),!ur(this.ah)&&e){const t=this.At.ri();this.dr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.uh){let s=this.Of.get(e);if(!s)if(e.Qe)s={grid:this.cg[0].Qg(this.bg).setMouseInteractions(!1),tick:this.cg[0].Qg(this.bg).setMouseInteractions(!1)};else if("Jg"in e){const t=Array.from(this.uh.keys()).filter((t=>"Jg"in t)).reverse().indexOf(e),i=this.cg[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.Qg(this.bg).setMouseInteractions(!1),tick:i.Qg(this.bg).setMouseInteractions(!1)}}if(s){s.grid.Ot(),s.tick.Ot();for(const[e,r]of i){const e=this.Gg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Zr().Kg(e.gridStroke.start,e.gridStroke.end),s.tick.Zr().Kg(e.tickStroke.start,e.tickStroke.end)}s.grid.Ye(e.je.getGridStrokeStyle()),s.tick.Ye(e.je.getTickStyle()),this.Of.set(e,s)}}}const c=u,d=c+this.vg*t.qg,f=this.tA||this.iA?Math.min(this.jf,.25*t.$g):0,g={start:this.Gh.toVec2(this.At.pi(this.At.getInnerStart(),f),c),end:this.Gh.toVec2(this.At.pi(this.At.getInnerEnd(),-f),d)},m=yt(this.Gh.toVec2(this.At.getInnerStart(),d),this.bg,this.Mg),y=yt(g.start,this.bg,this.Mg),p=yt(g.end,this.bg,this.Mg),A=yt(this.Gh.toVec2(this.At.getInnerEnd(),c),this.bg,this.Mg);this.Cg.$e(this.Gh.toPoint(s,a)).Xe(this.Gh.toPoint(r,a)).setVisible(e),this.kg.$e(this.Gh.toPoint(this.At.pi(this.At.getInnerStart(),this.Hf),a)).Xe(this.Gh.toPoint(this.At.getInnerStart(),a)).setVisible(e),this.Tg.$e(this.Gh.toPoint(this.At.pi(this.At.getInnerEnd(),-this.Hf),a)).Xe(this.Gh.toPoint(this.At.getInnerEnd(),a)).setVisible(e);const x=a+t.Wg*this.vg;if(this.Fh.Ve(this.Gh.toPoint(this.Gh.getWidth(yt("center"===this.AA?mi(yi(m,A),.5):"start"===this.AA?m:A,this.Mg,this.bg)),x)).Za(this.Gh.toPoint("center"===this.AA?0:"start"===this.AA?-1:1,-1*this.vg)).setVisible(e).setMouseInteractions(void 0!==["mouseEnterTitle","mouseMoveTitle","mouseLeaveTitle","mouseDownTitle","mouseUpTitle","mouseClickTitle","mouseDoubleClickTitle","mouseDragStartTitle","mouseDragTitle","mouseDragStopTitle","mouseWheelTitle","touchStartTitle","touchMoveTitle","touchEndTitle"].find((t=>this.R.listeners(t).size>0))),this.Nf){const e=this.mg/100*o+t.Zg,i=-this.vg*o-t.Zg,s={start:this.Gh.toVec2(this.Nf.min,u+this.vg*this.Gf),end:this.Gh.toVec2(this.Nf.max,e+i)},r=yt(s.start,this.bg,this.Mg),n=yt(s.end,this.bg,this.Mg);this.Ig.Ve(r).it(pi(n,r)).setVisible(!0)}else this.Ig.setVisible(!1);this.Fg.Ve(y).it(pi(p,y)).setVisible(e),this.Pg.Ve(m).it(pi(y,m)).setVisible(e),this.Dg.Ve(p).it(pi(A,p)).setVisible(e);for(const i of this.Uf)i.update().plot(e,a,l,t.Zg,u);for(const t of this.cA)t.ze()}setLength(t){return this.Zd=t,this.chart.cs.Ms(),this}getLength(){return this.Zd}setMargins(t,e){return this.pA=t,this.yA=e,this.chart.cs.Ms(),this}getMargins(){return{start:this.pA,end:this.yA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.tp,...this.chart.ip,...this.chart.sp,...this.chart.ep].find((t=>t.axis===this)))||void 0===t?void 0:t.iStack)&&void 0!==e?e:0}getParallelIndex(){var t,e;return null!==(e=null===(t=[...this.chart.tp,...this.chart.ip,...this.chart.sp,...this.chart.ep].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}hp(){const t=this.jg;if(!t)return;const e=this.getVisible()&&t.$g>0,i=this.Cg.xu().getThickness()*this.vg/2,s=this.xg.getInnerInterval(),r=this.mg/100*s+t.Zg,n=s*this.vg,o=r+i;for(const i of this.Uf)i.update().plot(e,r,n,t.Zg,o);for(const t of this.cA)t.ze()}rp(){return this.Gf}np(t,e){e=e||Ah.AxisTickMajor;const i=new Vn(this,t?this.cg[0]:this.pg,this.pg,this.At,this.wg,this.wg,this.Gh,this.Sg,this.vA,this.ts,e).setTextFormatter(this.formatValue);return this.Uf.push(i),i}bA(t){this.chart.cs.us.ks(t,1),this.Xf=t.cs.tn(this.nA,this.Xf)}_A(t){this.chart.cs.us.ks(t,0),t.cs.sn(this.Xf)}kA(t){this.setStopped(!0),t.cs.sn(this.Xf)}IA(t,e){const i=-this.Gh.getWidth(e);this.pan(i),this.Xf=t.cs.tn(this.oA,this.Xf)}pan(t){const e=this.Xh,i=this.$h,s=this.At.pi(e,t),r=this.At.pi(i,t);this.ur(s,r,!1)}zoom(t,e){const i=this.At.ft(this.Xh),s=this.At.ft(this.$h),r=this.At.ft(t),n=_t((r-i)/(s-i),0,1),o=.2*this.At.ri(),h=n*this.Zf*o*-e,a=(1-n)*this.Zf*o*e,l=this.At.pi(this.Xh,h),u=this.At.pi(this.$h,a);this.ur(l,u,!0)}BA(t){this.Nf=void 0,t.cs.sn(this.Xf)}TA(t,e){this.setStopped(!0),t.cs.sn(this.Xf),this.chart.cs.us.ks(this.Fg,0)}PA(t,e,i,s){const r=yt(this.EA.cs.Ne(i.x,i.y),this.EA.cs.At,this.bg),n=_t(this.Gh.getWidth(r),this.Xh,this.$h),o=this.Gh.getWidth(yt(this.EA.cs.Ne(e.x,e.y),this.EA.cs.At,this.bg));Math.abs(this.At.ft(n)-this.At.ft(o))>10?(this.Nf=m(Math.min(n,o),Math.max(n,o)),this.Xf=t.cs.tn(this.aA,this.Xf)):(this.Nf=void 0,this.Xf=t.cs.tn(this.nA,this.Xf)),this.EA.Ms()}LA(t,e,i){if(this.Nf){const t=this.Nf.min,e=this.Nf.max,i=this.$h{e.vs(t)}));for(const e of this.Of.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.cs.Ms(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ph),this}}var Mh;e.AxisXYTitlePositionOptions=void 0,(Mh=e.AxisXYTitlePositionOptions||(e.AxisXYTitlePositionOptions={})).Start="start",Mh.Center="center",Mh.End="end";const Ch={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Th={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},wh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof bh&&"y"in t&&t.y instanceof bh),Eh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new us,tickLength:7,tickStyle:new us,tickPadding:0,labelFont:new vr,labelFillStyle:new N,labelAlignment:0,labelRotation:0});class kh extends Eh{constructor(t){super(t)}setGridStrokeLength(t){return this.set("gridStrokeLength",t)}getGridStrokeLength(){return this.get("gridStrokeLength")}setGridStrokeStyle(t){return this.set("gridStrokeStyle","function"==typeof t?t(this.get("gridStrokeStyle")):t)}getGridStrokeStyle(){return this.get("gridStrokeStyle")}setTickLength(t){return this.set("tickLength",t)}getTickLength(){return this.get("tickLength")}setTickStyle(t){return this.set("tickStyle","function"==typeof t?t(this.get("tickStyle")):t)}getTickStyle(){return this.get("tickStyle")}setTickPadding(t){return this.set("tickPadding",t)}getTickPadding(){return this.get("tickPadding")}setLabelFillStyle(t){return this.set("labelFillStyle","function"==typeof t?t(this.get("labelFillStyle")):t)}getLabelFillStyle(){return this.get("labelFillStyle")}setLabelFont(t){return this.set("labelFont","function"==typeof t?t(this.get("labelFont")):t)}getLabelFont(){return this.get("labelFont")}setLabelAlignment(t){return this.set("labelAlignment",t)}getLabelAlignment(){return this.get("labelAlignment")}setLabelRotation(t){return this.set("labelRotation",t)}getLabelRotation(){return this.get("labelRotation")}}const Ih=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),zh=new kh({labelFillStyle:_,gridStrokeStyle:ut,tickStyle:ut}),Fh=t=>Ih(t)&&B(t.labelFillStyle)&&ct(t.gridStrokeStyle)&&ct(t.tickStyle),Rh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new kh,minorTickStyle:new kh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Dh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=9e4?"MajorMinutes":i>=10500?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Ph={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}.${Se(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}.${Se(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}.${Se(o,3)}${h}`}},Oh={MajorHours12:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,rr(t,e,r,void 0,1e6)},fitKeyValues:or({ignore:"first"},2,4)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,36e5,1e6),fitKeyValues:or({},2,3,4,6)},defaultValueFormatter:Ph.hhmmss},MajorHours:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,rr(t,e,r,void 0,1e6)},fitKeyValues:or({ignore:"first"},2,6,12)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,3e5,1e6),fitKeyValues:or({},2,4,6)},defaultValueFormatter:Ph.hhmmss},MajorMinutes15:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),rr(t,e,9e5,void 0,1e6)),fitKeyValues:or({ignore:"first"},2)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,6e4,1e6),fitKeyValues:or({},3,5)},defaultValueFormatter:Ph.hhmmss},MajorMinutes:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,rr(t,e,6e4,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,5e3,1e6),fitKeyValues:or({},2,3,4,6)},defaultValueFormatter:Ph.hhmmss},MajorSeconds15:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,rr(t,e,15e3,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,4)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,1e3,1e6),fitKeyValues:or({},3,5)},defaultValueFormatter:Ph.hhmmss},MajorSeconds:{major:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,rr(t,e,1e3,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>sr(t,e,100,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmm},MajorMilliseconds100:{major:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,rr(t,e,100,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>sr(t,e,10,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmm},MajorMilliseconds10:{major:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,rr(t,e,10,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>sr(t,e,1,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmm},MajorMilliseconds:{major:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,rr(t,e,1,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>sr(t,e,.1,1e6),fitKeyValues:or({},2)},defaultValueFormatter:Ph.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,rr(t,e,.1,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>sr(t,e,.01,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,rr(t,e,.01,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>sr(t,e,.001,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,rr(t,e,.001,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>sr(t,e,100*1e-6,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,rr(t,e,r,void 0,1e6)},fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>sr(t,e,10*1e-6,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuunnn},Unknown:{major:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},minor:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},defaultValueFormatter:(t,e,i)=>""}};class Lh extends Rh{Ke(t){const e=this.timeOrigin||0,i=[{rh:"Major ticks",Jg:0,je:this.majorTickStyle,Ze:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Dh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Oh[r].major.format)(t+e,i,s)},Hr:(t,e,i,s)=>{const r=Dh(i,s);return(0,Oh[r].major.getKeyValues)(t,e,i,s)},zh:{wr:(t,e,i,s,r,n)=>{const o=Dh(r,n),h=Oh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Xr:void 0}];return Ih(this.minorTickStyle)&&i.push({rh:"Minor ticks",Jg:1,je:this.minorTickStyle,Ze:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Dh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Oh[r].minor.format)(t+e,i,s)},Hr:(t,e,i,s)=>{const r=Dh(i,s);return(0,Oh[r].minor.getKeyValues)(t,e,i,s)},zh:{wr:(t,e,i,s,r,n)=>{const o=Dh(r,n),h=Oh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Xr:void 0}),{qe:[],th:i,ih:this.cursorFormatter||((t,i,s)=>{const r=Dh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Oh[r].defaultValueFormatter(t+e,i,s)}),sh:1e-4,eh:864e6}}setTickStyle(t){return this.setMajorTickStyle(t).setMinorTickStyle(t)}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTimeOrigin(t){return this.set("timeOrigin",t)}getTimeOrigin(){return this.get("timeOrigin")}setFormattingFunction(t){return this.withMutations((e=>e.set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const _h=(t,e,i,s,r)=>(n,o)=>h=>{const a=new Date(h+n),l={year:o?a.getUTCFullYear():a.getFullYear(),monthIndex:o?a.getUTCMonth():a.getMonth(),day:o?a.getUTCDate():a.getDate(),hours:o?a.getUTCHours():a.getHours(),minutes:o?a.getUTCMinutes():a.getMinutes(),seconds:o?a.getUTCSeconds():a.getSeconds(),millis:o?a.getUTCMilliseconds():a.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return h;const c=l[e];r.includes("year")&&(l.year=Math.floor(l.year/i)*i),r.includes("monthIndex")&&(l.monthIndex=0),r.includes("day")&&(l.day=1),r.includes("hours")&&(l.hours=0),r.includes("minutes")&&(l.minutes=0),r.includes("seconds")&&(l.seconds=0),r.includes("millis")&&(l.millis=0);let d=(0===t?1:t)*i;return-1===t&&!1===u&&(d=0),0!==d&&(l[e]=i*(d>0?Math.floor((c+d)/i):Math.ceil((c+d)/i))),o?Date.UTC(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis)-n:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-n},Bh=(t,e,i,...s)=>_h(-1,t,e,i,s),Vh=(t,e,i,...s)=>_h(-1,t,e,i,s),Gh=(t,e,i,...s)=>_h(0,t,e,i,s),Nh=(t,e,...i)=>_h(1,t,e,void 0,i),Uh=t=>(e,i)=>s=>{const r=new Date(s+e),n=i?r.getUTCDay():r.getDay(),o=1===n&&0===(i?r.getUTCHours():r.getHours())&&0===(i?r.getUTCMinutes():r.getMinutes())&&0===r.getSeconds()&&0===r.getMilliseconds();if(0===t&&!0===o)return s;let h=i?r.getUTCDate():r.getDate();return-1===t&&1===n&&!1===o||(-1===t?h-=n>=2?n-1:n+6:h+=n>0?8-n:1),i?Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),h,0,0,0,0)-e:new Date(r.getFullYear(),r.getMonth(),h,0,0,0,0).getTime()-e},Yh=[{label:"MilliSecond1",unit:1,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:or({offset:0},2,5)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"MilliSecond10",unit:10,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("millis",10,(t=>t.millis%10==0),"millis")},majorTicks:{fitFunction:or({offset:0},2,5)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("millis",100,(t=>t.millis%100==0),"millis")},majorTicks:{fitFunction:or({offset:0},2,5)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:hr(5,10,15,30)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:hr(5,10,15,30)},minorTicks:{amount:12,fitFunction:or(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:hr(3,6,12)},minorTicks:{amount:8,fitFunction:or(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:or({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:or({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Uh(-1),getNextKeyValueIncludingRef:Uh(0),getNextKeyValue:Uh(1),greatTicks:!0,majorTicks:{fitFunction:or(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Vh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:or(void 0,2,3)},minorTicks:{fitFunction:or(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Vh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:or({ignore:"first"},2,5)},minorTicks:{fitFunction:or(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Vh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:or(void 0,2,4)},minorTicks:{fitFunction:or(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Vh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",100,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0},{label:"Millennium",unit:316224e8,irregular:!0,getPrevKeyValue:Vh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],Hh=(t,e,i,s,r)=>{const n=e-t;let o;for(let t=r?0:Yh.length-1;r?t=0;r?t+=1:t-=1){const e=n/Yh[t].unit;if((void 0===i||e>=i)&&(void 0===s||e<=s)){o=Yh[t];break}}return o},Xh=(t,e,i)=>{let s=Hh(e,i,void 0,1,!0);if(void 0!==s&&0===Yh.indexOf(s)&&(s=Yh[1]),void 0===s)return;if("great"===t)return s;const r="major"===t?1:2,n=Yh[Yh.indexOf(s)-r];return void 0===n?Yh[0]:n},Wh=(t,e,i)=>(s,r,n,o)=>{const h=Xh("great",s,r);if(void 0===h)return[];if("Decade"===h.label||"Century"===h.label||"Millennium"===h.label)return[];const a=o>n?s:r,l=(s+r)/2,u=o>n?r:s;if(Yh.indexOf(h)<=Yh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=nr(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=rr(s,r,h.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,r,c);return"left"===i?void 0===d||ti(d,l,u)?[a]:[d]:void 0!==d&&ti(d,l,u)?[d]:[u]},jh=(t,e,i)=>(s,r,n,o)=>{const h=Xh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=nr(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=rr(s,r,h.unit,t,1)}else if("major"===t&&void 0!==h.majorTicks)a=!0===h.irregular?((t,e,i,s)=>{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})(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let r=t,n=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(r),s})(s,r,h.unit);else{if("minor"!==t||void 0===h.minorTicks)return[];if(!0===h.irregular)a=((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r})(s,r,h.getNextKeyValueIncludingRef(e,i),h.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return Yh[Yh.indexOf(t)+1]})(h);if(void 0===t)return[];a=sr(s,r,t.unit/h.minorTicks.amount,1)}}return a},$h=t=>(e,i,s,r,n,o)=>{const h=Xh(t,n,o);if(void 0===h)return;let a;return"major"===t?a=h.majorTicks.fitFunction:h.minorTicks&&(a=h.minorTicks.fitFunction),a?a(e,i,s,r,n,o):void 0},Zh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new kh,majorTickStyle:new kh,minorTickStyle:new kh,formatOptionsMajorCentury:{year:"numeric",hour12:!1},formatOptionsMinorDecade:{year:"numeric",hour12:!1},formatOptionsMajorDecade:{year:"numeric",hour12:!1},formatOptionsMinorYear:{year:"numeric",hour12:!1},formatOptionsMajorYear:{year:"numeric",hour12:!1},formatOptionsMinorMonth:{month:"short",hour12:!1},formatOptionsGreatYear:{year:"numeric",hour12:!1},formatOptionsMajorMonth:{month:"long",hour12:!1},formatOptionsMinorWeek:{day:"numeric",hour12:!1},formatOptionsGreatMonth:{year:"numeric",month:"long",hour12:!1},formatOptionsMajorWeek:{day:"numeric",weekday:"short",hour12:!1},formatOptionsMinorDay:{day:"numeric",weekday:"short",hour12:!1},formatOptionsGreatWeek:(t,e,i)=>{const s=new Date(t),r=(t=>{const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)})(s);return`${new Intl.DateTimeFormat(i,{year:"numeric",month:"long",hour12:!1}).format(s)} Week ${r}`},formatOptionsMajorDay:{weekday:"long",day:"numeric",hour12:!1},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Ph.hhmmssmmm(t-e.getTime())},formatMillisecondRange:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Ph.hhmmssmmm(t-e.getTime())},formatOptionsGreatSecond:{},formatOptionsMajorMilliSecond:{}});class qh extends Zh{Ke(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Yh.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond1":case"MilliSecond10":case"MilliSecond100":return"Great"===e?t.formatOptionsGreatMinute:t.formatMillisecondRange;case"Second":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorSecond:t.formatOptionsMinorSecond;case"Minute":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorMinute:t.formatOptionsMinorMinute;default:case"Hour":return"Great"===e?t.formatOptionsGreatHour:"Major"===e?t.formatOptionsMajorHour:t.formatOptionsMinorHour;case"Day":return"Great"===e?t.formatOptionsGreatDay:"Major"===e?t.formatOptionsMajorDay:t.formatOptionsMinorDay;case"Week":return"Great"===e?t.formatOptionsGreatWeek:"Major"===e?t.formatOptionsMajorWeek:t.formatOptionsMinorWeek;case"Month":return"Great"===e?t.formatOptionsGreatMonth:"Major"===e?t.formatOptionsMajorMonth:t.formatOptionsMinorMonth;case"Year":return"Great"===e?t.formatOptionsGreatYear:"Major"===e?t.formatOptionsMajorYear:t.formatOptionsMinorYear;case"Decade":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorDecade:t.formatOptionsMinorDecade;case"Century":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorCentury:void 0;case"Millennium":return}})(this,t,e);if("object"!=typeof i)return i;try{return new Intl.DateTimeFormat(this.locale,i)}catch(t){let e="";for(const t in i)e+=` ${t}: ${i[t]},`;zt.console.error(`Invalid Intl.DateTimeFormat ( locale: ${this.locale}, formatOptions {${e}} )`)}})),s=new Map;s.set("great",i("Great")),s.set("major",i("Major")),s.set("minor",i("Minor"));const r=t=>String(t),n=(t,i)=>(n,o)=>{let h=n+e;const a=o.getInnerStart(),l=o.getInnerEnd(),u=a>l,c=Xh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Lt(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(n):c.greatTicks.getReferenceKeyValue(e,this.utc)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(n):c.getNextKeyValue(e,this.utc)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[Yh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{rh:"Great ticks (directive)",Jg:0,Je:!0,Hr:jh("great",e,this.utc),Xr:void 0},{rh:"Major ticks",Jg:1,je:this.majorTickStyle,Ze:n("major"),Hr:jh("major",e,this.utc),zh:{wr:$h("major")},Xr:void 0}];Fh(this.greatTickStyle)||(o.push({rh:"Great ticks (left)",je:this.greatTickStyle.setLabelAlignment(-1),Ze:n("great","left"),Hr:Wh(e,this.utc,"left"),Qe:!0,Fr:!1}),o.push({rh:"Great ticks (right)",je:this.greatTickStyle.setLabelAlignment(1),Ze:n("great","right"),Hr:Wh(e,this.utc,"right"),Qe:!0,Fr:!1})),Fh(this.minorTickStyle)||h.push({rh:"Minor ticks",Jg:2,je:this.minorTickStyle,Ze:n("minor"),Hr:jh("minor",e,this.utc),zh:{wr:$h("minor"),Vh:(t,e,i,s,r,n)=>{const o=Xh("minor",r,n);return!o||"Week"!==o.label}},Xr:void 0});const a=this.cursorFormatter;return{qe:o,th:h,ih:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=Hh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()),void 0,1,!0),n=r&&r.unit<=6e4,o=new Date(e+t),h=new Date(e+t);h.setHours(0,0,0,0);const a=n?Ph.hhmmssmmm:Ph.hhmmss;return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric"}).format(o)} ${a(o.getTime()-h.getTime())}`},sh:1,eh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTickStyle(t){return this.setGreatTickStyle(t).setMajorTickStyle(t).setMinorTickStyle(t)}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return this.set("greatTickStyle",t(e))}return this.set("greatTickStyle",t)}getGreatTickStyle(){return this.get("greatTickStyle")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setUTC(t){return this.set("utc",t)}getUTC(){return this.get("utc")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}setFormatting(t,e,i){return this.withMutations((s=>s.set("formatOptionsGreatYear",t||this.formatOptionsGreatYear).set("formatOptionsGreatMonth",t||this.formatOptionsGreatMonth).set("formatOptionsGreatWeek",t||this.formatOptionsGreatWeek).set("formatOptionsGreatDay",t||this.formatOptionsGreatDay).set("formatOptionsGreatHour",t||this.formatOptionsGreatHour).set("formatOptionsGreatMinute",t||this.formatOptionsGreatMinute).set("formatOptionsMajorCentury",e||this.formatOptionsMajorCentury).set("formatOptionsMajorDecade",e||this.formatOptionsMajorDecade).set("formatOptionsMajorYear",e||this.formatOptionsMajorYear).set("formatOptionsMajorMonth",e||this.formatOptionsMajorMonth).set("formatOptionsMajorWeek",e||this.formatOptionsMajorWeek).set("formatOptionsMajorDay",e||this.formatOptionsMajorDay).set("formatOptionsMajorHour",e||this.formatOptionsMajorHour).set("formatOptionsMajorMinute",e||this.formatOptionsMajorMinute).set("formatOptionsMajorSecond",e||this.formatOptionsMajorSecond).set("formatOptionsMinorDecade",i||this.formatOptionsMinorDecade).set("formatOptionsMinorYear",i||this.formatOptionsMinorYear).set("formatOptionsMinorMonth",i||this.formatOptionsMinorMonth).set("formatOptionsMinorWeek",i||this.formatOptionsMinorWeek).set("formatOptionsMinorDay",i||this.formatOptionsMinorDay).set("formatOptionsMinorHour",i||this.formatOptionsMinorHour).set("formatOptionsMinorMinute",i||this.formatOptionsMinorMinute).set("formatOptionsMinorSecond",i||this.formatOptionsMinorSecond)))}setFormattingDecade(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorDecade",t)),e&&(i=i.set("formatOptionsMinorYear",e)),i)))}setFormattingYear(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorYear",t)),e&&(i=i.set("formatOptionsMinorMonth",e)),i)))}setFormattingMonth(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatYear",t)),e&&(s=s.set("formatOptionsMajorMonth",e)),i&&(s=s.set("formatOptionsMinorWeek",i)),s)))}setFormattingWeek(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMonth",t)),e&&(s=s.set("formatOptionsMajorWeek",e)),i&&(s=s.set("formatOptionsMinorDay",i)),s)))}setFormattingDay(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatWeek",t)),e&&(s=s.set("formatOptionsMajorDay",e)),i&&(s=s.set("formatOptionsMinorHour",i)),s)))}setFormattingHour(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatDay",t)),e&&(s=s.set("formatOptionsMajorHour",e)),i&&(s=s.set("formatOptionsMinorMinute",i)),s)))}setFormattingMinute(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatHour",t)),e&&(s=s.set("formatOptionsMajorMinute",e)),i&&(s=s.set("formatOptionsMinorSecond",i)),s)))}setFormattingSecond(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMinute",t)),e&&(s=s.set("formatOptionsMajorSecond",e)),i&&(s=s.set("formatOptionsMinorMillisecond",i)),s)))}setFormattingMilliSecond(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsGreatSecond",t)),e&&(i=i.set("formatOptionsMajorMilliSecond",e)),i)))}}const Kh=(t,e)=>(i,s)=>{const r=s-i;if(e){const e=Math.log10(r/2);let n=10**Math.floor(e-t);const o=1/n;n=Math.round(n*o)/o;const h=Math.round(Math.floor(i/(10*n))*n*10*o)/o;return rr(h,s,n,void 0,o)}const n=Math.log10(r);let o=10**Math.round(n-t);const h=1/o;return o=Math.round(o*h)/h,sr(i,s,o,h)},Jh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Qh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%3==0)):2===e?t.filter(((t,e)=>e%4==0)):3===e?t.filter(((t,e)=>e%5==0)):void 0,ta=or(void 0,2,5),ea=(t,e,i,s,r,n)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,ia=(t,e)=>{const i=Ri(t),s=Di(t);if(e)return(t,e)=>{const r=[],n=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=n-1;t<=o+1;t+=1){const e=s**t;r.push(e)}return r};const r=10===t?9:4;return(t,e)=>{const n=Math.round(i(t)),o=Math.round(i(e)),h=[],a=s**n,l=(s**o-a)/r;for(let i=1;i<=r;i+=1){const s=a+l*i;s>t&&sBi.LogarithmicNoExponents(e,i,void 0,t.base):Bi.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Bi.LogarithmicNoExponents(e,i,void 0,t.base):Bi.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Bi.LogarithmicNoExponents(e,i,void 0,t.base):Bi.Numeric),n=[],o=[];Fh(this.extremeTickStyle)||n.push({rh:"Extreme ticks",je:this.extremeTickStyle,Ze:void 0===e?i:(t,s,r)=>i(e+t,s,r),Hr:ir,Qe:!0,Fr:!0}),o.push({rh:"Major ticks",Jg:0,je:this.majorTickStyle,Ze:void 0===e?s:(t,i,r)=>s(e+t,i,r),Hr:"logarithmic"===t.type?ia(t.base,!0):Kh(0,!0),zh:"logarithmic"===t.type?{wr:Qh}:{wr:Jh},Xr:void 0}),Fh(this.minorTickStyle)||o.push({rh:"Minor ticks",Jg:1,je:this.minorTickStyle,Ze:void 0===e?r:(t,i,s)=>r(e+t,i,s),Hr:"logarithmic"===t.type?ia(t.base,!1):Kh(1,!1),zh:"logarithmic"===t.type?{wr:ea}:{wr:ta},Xr:50});const h=this.cursorFormatter?this.cursorFormatter:Bi.Numeric;return{qe:n,th:o,ih:void 0===e?h:(t,i,s)=>h(e+t,i,s),sh:1e-9,eh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setExtremeTickStyle(t){if("function"==typeof t){const e=this.get("extremeTickStyle");return this.set("extremeTickStyle",t(e))}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setTickStyle(t){const e=this.setMajorTickStyle(t).setMinorTickStyle(t);return e.extremeTickStyle!==zh?e.setExtremeTickStyle(t):e}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setFormattingFunction(t){return this.withMutations((e=>e.set("extremeFormattingFunction",t).set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getExtremeFormattingFunction(){return this.get("extremeFormattingFunction")}setExtremeFormattingFunction(t){return this.set("extremeFormattingFunction",t)}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const na=(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(zt.navigator.msSaveBlob)zt.navigator.msSaveBlob(r,e);else{const t=zt.document.createElement("a");zt.document.body.appendChild(t);const i=zt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{zt.URL.revokeObjectURL(i),zt.document.body.removeChild(t)}),0)}},oa=(t,i,s,r,n,o)=>{const h=t.oc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},ha=(t,e)=>{if("relative"===t)return e;if(t instanceof Ui)return t;const i=t.x instanceof gr?t.x.At:t.x.x,s=t.y instanceof gr?t.y.At:t.y.y;return Xi(i,s)},aa=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=wh(o)?o:$i(o)?s:void 0;if(h&&Wi(i)){const t=yt(n,h,r.At);return r.Wo({engineX:t.x,engineY:t.y})}if(h&&$i(i))return yt(n,h,s);if(h&&wh(i))return yt(n,h,i)}else{const i=t;if($i(e)){const t=r.Uo(i);return yt({x:t.engineX,y:t.engineY},r.At,s)}if(wh(e)){const t=e,s=r.Uo(i);return yt({x:s.engineX,y:s.engineY},r.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class la{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.op=[],this.ap=[],this.R=new r.Eventer,this.lp=void 0,this.up=void 0,this.cp=void 0,this.$t=A(0,0,0,0),this.dp=!1,this.ji=!1,this.fp=()=>{this.Ap=!0,this.gp.Ms()},this.pp=t=>e=>{const i=this.op.indexOf(e);-1!==i&&this.op.splice(i,1),this.cs.Ms(),t.Y()},this.yp=t=>{const e=this.ap.indexOf(t);-1!==e&&this.ap.splice(e,1),this.cs.Ms()},this.Ap=!0,this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.CA=t,this.mp=i,this.gp=s,this.removePanel=n,this.ts=e.cs.ts;const l=e.cs.oi();if(this.uiScale=i.d2({scaleXYConstructor:Yi}).Vi(0,100).Oi(0,100).it(l),this._g=i.d2({scaleXYConstructor:Yi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(l),this.engine=e.cs.vp,this.cs=e.cs.Sp,this.hs=this.cs.hs.rs(this,{}),this.xp=()=>e.bp("unidentified ui"),this.Mp=e._p(),this.wp=this.gp.Ee(this.uiScale).Ve(u(0,0)).it(u(100,100)).Re(o).Le(h).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.fp);this.Cp=()=>a.off(t)}else{const t=e.cs.Eo(this.fp);this.kp=e.cs.zo.bind(e.cs,t)}const c=e.cs.Oo((t=>{this.dp=t,this.R.emit("inViewChange",this,t)}));this.Tp=e.cs.No.bind(e.cs,c),this.lp=n}getTheme(){return this.ts}getSizePixels(){return this._g.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.wp.Re(t),this.gp.Ms(),this}getBackgroundFillStyle(){return this.wp.Jh()}setBackgroundStrokeStyle(t){return this.wp.Le(t),this.gp.Ms(),this}getBackgroundStrokeStyle(){return this.wp.So()}translateCoordinate(t,e,i){return aa(t,e,i,this._g,this.cs)}Fp(t){return this.op.push(t),this.cs.Ms(),t}Ip(t){return this.ap.push(t),this.cs.Ms(),t}addUIElement(t=Jo,e=this.uiScale){e=ha(e,this._g);const i=this.xp();return this.Fp(oa(t,i,this.uiScale,e,this.pp(i),this.ts))}addLegendBox(t=uh,i=this.uiScale){i=ha(i,this._g);const s=this.Ip(oa(t,this.Mp,this.uiScale,i,this.yp,this.ts));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Vs.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Vs.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.ap}dispose(){return this.ji||(this.ji=!0,this.kp&&this.kp(),this.Cp&&this.Cp(),ua(this.uiScale),ua(this._g),this.Tp&&this.Tp(),this.up&&this.up(),this.gp.Y(),this.Mp.Y(),this.op.slice().forEach((t=>{t.dispose()})),this.ap.slice().forEach((t=>{t.dispose()})),this.cs.Ms(),this.lp&&this.lp(this),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}saveToFile(t,e,i){return na(this.engine,t,e,i),this}Gr(t){this.$t=t,this.fp()}J(){return this._g.J(),this.uiScale.J(),this}K(){return this._g.K(),this.uiScale.K(),this}ze(t){if(this.Ap){const t=this.gp.cs.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this._g.it(e,i);const s=[this.$t.left,this.$t.right],r=[this.$t.bottom,this.$t.top];this.uiScale.Ei(s),this.uiScale.zi(r);const n=this.uiScale.getInnerIntervalPixels();this._g.Vi(0,n.x).Ei(s).Oi(0,n.y).zi(r),this.R.emit("resize",this,n.x,n.y,e,i)}this.Ap=!1}Pp(){for(let t=0;t{t.ii&&t.ii()};class ca extends la{constructor(t,e,i,s,r,n){super(t,e,i,e.Bp("uipanel bg",0),s,e.cs.ts.uiPanelBackgroundFillStyle,e.cs.ts.uiPanelBackgroundStrokeStyle,n),this.Dp(r,this._g)}setMinimumSize(t){return this.Ld=t,this.cs.Ms(),this}getMinimumSize(){return this.Ld}ze(t){super.ze(t),super.Pp()}}const da=A(10,10,10,10);class fa extends la{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Lp={},this.Ia=da,this.ph=!0,this.Rp=e.Ep("chart internal ui",0),this.Ch=this.Rp.Wr(this.uiScale).Sr("Chart").Ve(u(50,100)).Za(u(0,1)).ir(h).Re(a).setMouseInteractions(!1),this.zp=this.hs.Bg([this.Ch]).bs(this.ts.effectsText)}setAnimationsEnabled(t){return this.ph=t,this}getAnimationsEnabled(){return this.ph}setTitle(t){return this.Ch.Sr(t),this.cs.Ms(),this}getTitle(){return this.Ch.Tr()}getTitleSize(){return this.Ch.Os().od()}setTitleFillStyle(t){return this.Ch.Re(t),this.fp(),this}getTitleFillStyle(){return this.Ch.Jh()}setTitleFont(t){return this.Ch.ir(t),this.fp(),this}getTitleFont(){return this.Ch.tr()}setTitleRotation(t){return this.Ch.sr(t),this.cs.Ms(),this}getTitleRotation(){return this.Ch.er()}setTitleEffect(t){return this.zp.bs(t),this.cs.Ms(),this}getTitleEffect(){return this.zp._s()}setTitleMargin(t){var e,i;return this.Lp="object"==typeof t?this.Lp?(e=this.Lp,{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.fp(),this}getTitleMargin(){return this.Lp}setPadding(t){return this.Ia="object"==typeof t?S(this.Ia,t):{left:t,top:t,right:t,bottom:t},this.fp(),this}getPadding(){return this.Ia}Vp(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.Rp.Y(),this}}const ga={Np:(t,e)=>t.Jh()!==_&&0!==t.Tr().length&&t.getVisible()?t.Os().od().y:0,Gp(t,e){t.Ve(u(50,100)).Gr({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}},ma=t=>"show-all-interpolated"===t||"show-nearest-interpolated"===t||"show-pointed-interpolated"===t,ya=(t,e)=>{const i="series"in t?t.series:void 0;if(!i||!("getCursorFormattingOverride"in i))return e;const s=i.getCursorFormattingOverride();return s?s(t,e):e},pa=(t,e,i,s,n,o,h)=>{let a,l,u=n,c=o,d=null,f=!0;const g=new r.Eventer;if(s){f=!1;const e=()=>{f=!0,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},i=()=>{t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},r=()=>{f=!1,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},n=()=>{f=!0,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},o=()=>{t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},h=()=>{f=!1,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())};s.onSeriesBackgroundMouseEnter(e),s.onSeriesBackgroundMouseMove(i),s.onSeriesBackgroundMouseLeave(r),s.onSeriesBackgroundTouchStart(n),s.onSeriesBackgroundTouchMove(o),s.onSeriesBackgroundTouchEnd(h),s.Wp(((e,i)=>{i.onMouseEnter(((e,s,r)=>{i.Yp()&&(l||t.cs.Ms(),a=r||void 0),t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())})),i.onMouseMove(((e,s,r)=>{i.Yp()&&(l||t.cs.Ms(),a=r||void 0),t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())})),i.onMouseLeave((()=>{i.Yp()&&(l||t.cs.Ms(),a=void 0),t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())}))}))}let m;const y={setCursor:e=>(e(i),t),getCursor:()=>i,setCursorMode:e=>(u=e,t.cs.Ms(),t),getCursorMode:()=>u,setCustomCursor:t=>{l=t},onCursorTargetChanged:t=>g.on("cursorTargetChanged",t),offCursorTargetChanged:t=>{g.off(t)},setCursorFormatting:e=>(c=e,t.cs.Ms(),t),getCursorFormatting:()=>c,Y:()=>{i.dispose(),e.Y()},ze:(e,s,r,n)=>{m=[e,s,r,n];const o=t.cs.Zn();let y=[];if((null==n?void 0:n.explicitTarget)&&u)y=Array.isArray(n.explicitTarget)?n.explicitTarget:[n.explicitTarget];else if(!e&&u){const t=s.find((t=>t.getIsUnderMouse())),e=o&&t&&(!t.getCursorEnabled||t.getCursorEnabled())&&t.Ss?t.Ss(o):void 0;if(a=e||a,a&&"show-all"!==u&&"show-all-interpolated"!==u)y=[a];else if("show-all"===u||"show-all-interpolated"===u||"show-nearest"===u||"show-nearest-interpolated"===u){if((f||void 0!==t)&&o&&r){for(const t of s){if(!t.getVisible()||t.getCursorEnabled&&!t.getCursorEnabled())continue;if(t.getCursorEnabled&&!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,o,u);e&&y.push(e)}"show-nearest"!==u&&"show-nearest-interpolated"!==u||(y.sort(((t,e)=>h(t,o)-h(e,o))),y.length=1)}}else if(("show-pointed"===u||"show-pointed-interpolated"===u)&&o&&t&&(!t.getCursorEnabled||t.getCursorEnabled())&&r){const e=r(t,o,u);e&&(y=[e])}}y=Ee(y.map((t=>Ge(t))));const p=(null==n?void 0:n.overrideCursorPositions)||((t,e)=>e),A=y[0],x=y.length>0?y:void 0;if(A!==d&&o&&(l&&l(A,x,o),g.emit("cursorTargetChanged",A,x,o),d=A),l)i.getVisible()&&(i.setVisible(!1),i.Os().ze());else{if(y&&y.length>0){const e=c(t,y[0],y);i.setVisible(!0).setPosition(...p(y,y.map((t=>t.cursorPosition)))).setResultTable((t=>t.setContent(e)))}else i.setVisible(!1);(null==n?void 0:n.afterCursorPointedAt)&&n.afterCursorPointedAt(y),i.Os().ze()}},solveNearest:(e,i,s,r)=>{const n=e||t.cs.Zn();if(!n)return[];let o=[];if("show-all"===i||"show-all-interpolated"===i||"show-nearest"===i||"show-nearest-interpolated"===i){for(const t of s){if(!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,n,i);e&&o.push(e)}"show-nearest"!==i&&"show-nearest-interpolated"!==i||(o.sort(((t,e)=>h(t,n)-h(e,n))),o.length=1)}return o=Ee(o.map((t=>Ge(t)))),o},Hp:i};return y};class Aa{constructor(t,e){this.Xp=t,this.$p=e}alter(t){this.jp=void 0!==this.jp?this.jp:this.$p(),this.Zp=t,this.Xp(t)}resetValue(){void 0!==this.Zp&&(void 0!==this.jp&&this.isAltered()&&this.Xp(this.jp),this.jp=void 0,this.Zp=void 0)}getNormalValue(){return void 0!==this.jp?this.jp:this.$p()}isAltered(){return void 0!==this.Zp&&this.$p()===this.Zp}}class xa{constructor(t){this.Qp=[],this.Hp=t,this.Jp=t.Jp}update(){return this.Jp.getVisible()?!(this.Kp()&&(!this.qp()||(this.resetTable(),this.Jp.Os(),this.Kp()))&&(this.ty(),this.Jp.Os(),this.Kp()&&(this.resetTable(),this.Jp.Os(),1))):(this.qp()&&this.resetTable(),!0)}qp(){for(let t=0;tthis.Jp.setOrigin(t)),(()=>this.Jp.getOrigin())))}ty(){const t=this.Fa.getNormalValue(),e=u(this.iy()?-t.x:t.x,this.sy()?-t.y:t.y);this.Fa.alter(e)}}class va extends xa{constructor(t,e,i){super(t),this.hy=this.ey(new Aa((t=>this.Jp.setTextFont((e=>e.setSize(t)))),(()=>this.Jp.getTextFont().getSize()))),this.ny=e,this.oy=i}ty(){const t=this.hy.getNormalValue(),e=this.ny;if(enew Sa(t),FontSize:(t=5,e=5)=>i=>new va(i,t,e)},Ma={None:$n,Rectangle:Fo,Circle:Ro,Diamond:Do,Pointer:Po};class Ca extends Uo{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ju=this.ts.cursorResultTableTextFont,this.Yd=0,this.ly=this.ts.cursorResultTableTextFillStyle,this.oa=100}setContent(t){let e;void 0===t?e=[]:Array.isArray(t)?(e=[],t.forEach((t=>{e.push(Array.isArray(t)?t:[t])}))):e=[[t]];for(let t=0;t0||n||o)){s=!0;break}}s||(i.unshift(""),i.push(""))}const i=e.length;let s=this.getMembers().length;for(let t=0;t=i)this.getMembers()[t].dispose(),t-=1,s-=1;else{const i=e[t].length;let s=n.getMembers().length;for(let o=0;o=i)n.getMembers()[o].dispose(),o-=1,s-=1;else if(void 0!==u&&u.length>0||c||d){const t=a?this.Ju.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];void 0!==i&&t.set(e,i)}return t})):this.Ju,e=l||this.ly,i=f[o];if(u){let s;i&&i instanceof Io?s=i:(i&&i.dispose(),s=n.addElement(zo,o)),s.setText(u).setFont(t).setFillStyle(e).setTextRotation(this.Yd)}else if(c){let s;i&&i instanceof Oo?s=i:(i&&i.dispose(),s=n.addElement(Lo,o)),s.setFillStyle(e).setShape(c).setSize({y:t.size,x:t.size}),s.setMargin(5)}else if(d){let s;i&&"setTextFillStyleHidden"in(r=i)&&"setText"in r?s=i:(i&&i.dispose(),s=n.addElement(ih.setBackground(Ma.None),o).setOn(!0));const h=d.Bs();void 0!==h&&s.setButtonShape(h),s.setText(d.getName()).setTextFont(t).setTextFillStyle(e).setTextRotation(this.Yd),d.styleLegendEntry(s)}}else{const t=f[o];t&&t instanceof _o||(t&&t.dispose(),n.addGap(void 0,o))}}}}var r;return this.Rs.Ms(),this}setTextFillStyle(t){this.ly="function"==typeof t?t(this.ly):t;for(let t=0;tt.setFillStyle(o.cursorResultTableFillStyle).setStrokeStyle(o.cursorResultTableStrokeStyle))).setTextFillStyle(o.cursorResultTableTextFillStyle).setTextFont(o.cursorResultTableTextFont),this.Sy=ba.Flip(this)}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setPointMarkerVisible(t){return this.gy=t,this.Ay.forEach((e=>e.pointMarker.setVisible(e.targetVisible&&t))),this.Rs.Ms(),this}getPointMarkerVisible(){return this.gy}setPointMarker(t){return this.Ay.forEach((e=>t(e.pointMarker))),this.yy.push(t),this.Rs.Ms(),this}setResultTableVisible(t){return this.py=t,this.Rs.Ms(),this}getResultTableVisible(){return this.py}setResultTable(t){return t(this.Jp),this.Rs.Ms(),this}setAutoFitStrategy(t){return this.Sy&&this.Sy.resetTable(),this.Sy=t?t(this):void 0,this.Rs.Ms(),this}getAutoFitStrategy(){return void 0!==this.Sy}setVisible(t){return this.Zi=t,this.Rs.Ms(),this}getVisible(){return this.Zi}dispose(){return this.Ay.forEach((t=>t.pointMarker.dispose())),this.Jp.dispose(),this.yy.length=0,this.my(this),this.R.emit("dispose"),this}Kp(){const t=this.Jp,i=this.Rs.cs.At,s=yt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=yt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return{x:s.xi.x.getInnerEnd(),y:s.yi.y.getInnerEnd()}}ze(){return this.Sy&&this.Sy.update(),this.Jp.setVisible(this.dp&&this.Zi&&this.py),this.Ay.forEach((t=>t.pointMarker.setVisible(t.targetVisible&&this.dp&&this.Zi&&this.gy))),this.Ay.forEach((t=>t.pointMarker.ze())),this.Jp.ze(),this}Os(){return this.Ay.forEach((t=>t.pointMarker.Os())),this.Jp.Os(),this}xy(t,e){const i=e===this.scale?t:yt(t,e,this.scale);this.Jp.setPosition(i)}}const wa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5)));class Ea extends Ta{setPosition(...t){const e=this.renderingScale,i=ha(t[0].resultTableScale,e),s=i===this.scale?t[0].resultTable:yt(t[0].resultTable,i,this.scale);return this.dp=!1,this.Ay.forEach((t=>{t.targetVisible=!1})),t.forEach(((t,i)=>{const s=ha(t.pointMarkerScale,e),r=s===this.scale?t.pointMarker:yt(t.pointMarker,s,this.scale);let n=this.Ay[i];if(!n){const t=new Oo(this.Rs,this.renderingScale,this.scale,Ot,this.ts).setMouseInteractions(!1).setFillStyle(this.ts.cursorPointMarkerFillStyle).setSize(this.ts.cursorPointMarkerSize).setShape(this.ts.cursorPointMarkerShape);n={pointMarker:t,targetVisible:!0},this.Ay.push(n),this.yy.forEach((e=>e(t)))}n.pointMarker.setPosition(r),n.targetVisible=((t,e,i=e)=>{const s=e!==i?yt(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()})(t.pointMarker,s),n.targetVisible&&(this.dp=!0)})),this.Jp.setPosition(s),this.Rs.Ms(),this}}class ka{constructor(t,e=[]){this.by=[],this.My=(t,e)=>(this.by.forEach((i=>i(t,e))),t),this.addStyler=t=>new ka(this.vy,this.by.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ka(t,this.by.map((t=>t))),this._y=(t,e,i,s,r)=>this.My(new Ea(t,e,i,s,this.vy,r),r),this.vy=t,this.by=e}}const Ia=new ka(Fo,[wa]),za=new ka(Po,[wa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Po&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Fa=Ia,Ra=Ia,Da=Ia,Pa=za,Oa=new ka(Fo,[wa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Vs.LeftBottom)))]),La=Ia;var _a;e.SliceLabelIndices=void 0,(_a=e.SliceLabelIndices||(e.SliceLabelIndices={}))[_a.LabelsInsideSlices=0]="LabelsInsideSlices",_a[_a.LabelsOnSides=1]="LabelsOnSides";const Ba={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},Va={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Ga extends is{constructor(){super(...arguments),this.Cs="Slice",this.M=0}}const Na=(t,e)=>{se(e),t.setExploded(!t.getExploded())};class Ua extends Ga{}class Ya extends Ua{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.wy=!1,this.Cy=_,this.ky=_,this.Ty=this.M,this.Fy=this.wy?1:0,this.Iy=this.getVisible(),this.Py=q((()=>this.chart.cs.Ms())),this.Dy=q((()=>this.chart.cs.Ms())),this.By=()=>{this.Ly=void 0},this.Ry=()=>{this.Ey=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.zy=e.ud(r).ds(this.getHighlight()),this.As(this.zy),this.rh=i.Wr(r).ds(this.getHighlight()),this.As(this.rh,{isText:!0}),this.onMouseClick(Na),this.onTouchEnd(Na)}setValue(t){return this.chart.getAnimationsEnabled()?this.Iy&&this.Vy(this.Ty,t):this.Ty=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setExploded(t){if(t&&!1===this.chart.getMultipleSliceExplosion()){const t=this.chart.getSlices();for(let e=0;e{this.Fy=t,this.chart.cs.Ms()})),this.Ey.onEveryAnimationEnd(this.Ry),this.wy=!this.wy):!1!==this.chart.getMultipleSliceExplosion()||t?(this.Fy=this.wy?0:1,this.wy=!this.wy):(this.Fy=0,this.wy=!this.wy),this.chart.cs.Ms(),this}getExploded(){return this.wy}setVisible(t){return this.Iy=t,!1===t?this.chart.getAnimationsEnabled()&&this.Ty>0?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),this.Vy(this.Ty,0,(()=>super.setVisible(!1)))):(this.Ty=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),super.setVisible(!0),this.Vy(this.Ty,this.M)):(this.Ty=this.M,super.setVisible(!0)),this}Vy(t,e,i){this.Ly=this.Py(300,$.ease)([[t,e]],(([t])=>{this.Ty=t,this.chart.cs.Ms()})),this.Ly.onEveryAnimationEnd(this.By),i&&this.Ly.onAnimationEnd(i)}setStyle(t,e,i,s){this.Cy=t,this.ky=i,this.zy.Re(this.Cy).Le(e),this.rh.Re(this.ky).ir(s);for(let t=0;tyi(e,mi(wi(.5*(t.au()+t.Ti())*Math.PI/180),i)),Xa=(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.Oy.indexOf(t);e>=0&&(this.Oy.splice(e,1),this.Ky())},this.cs.Jn(Sh.Sf),this.qy=e.tm("pieChart bottom",0),this.im=e.tm("pieChart top",1),this.Ch.Sr("Pie Chart"),this.Dp(r,this._g),this.onBackgroundMouseDoubleClick(Wa);const h=ns(new os(Wa));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd);const a=e.sm(),l=Vt(o?o.cursorBuilder:void 0,Ra);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",$a,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Ra){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addSlice(t,e){const i=new Ya(this.Xy,this.qy,this.im,this,this._g,this.Jy,this.ts,this.cs.hs);this.Xy+=1,i.setName(t);const s=this.ph;return this.ph=!1,i.setValue(e),this.ph=s,i.setEffect(this.Zy),this.rm(i),this.Oy.push(i),this.Ky(),i.setHighlightOnHover(this.Wy),i.onMouseMove((()=>{this.getCursorMode()&&this.cs.Ms()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.bs(t))),this.cs.Ms(),this}getSliceEffect(){return this.Zy}setSliceSorter(t){return this.Ny=t,this.Oy=this.Oy.sort(this.Ny),this.cs.Ms(),this}getSliceSorter(){return this.Ny}setLabelFillStyle(t){this.Hy="function"==typeof t?t(this.Hy):t;for(let t=0;te.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Qy}setLabelFormatter(t){return this.nm=t,this.cs.Ms(),this}getLabelFormatter(){return this.nm}setSliceHighlightOnHover(t){return this.Wy=t,this.Oy.forEach((e=>e.setHighlightOnHover(t))),this}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=ga.Np(this.Ch,this.Lp),i=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+e)),s=u(this.Ia.left+i.x/2,this.Ia.bottom+i.y/2);if(this.Kd){const t=this.Kd;this.Oy.forEach((e=>{this.rm(e,new N({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Oy[t].zy.setVisible(e),this.Oy[t].rh.setVisible(e)}this.Oy=this.Oy.sort(this.Ny);const r=this.Oy.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.om(r,o,s,i)}rm(t,e=this.Gy(t.index,t)){t.setStyle(e,this.Uy,this.Hy,this.Yy)}Ky(){this.Oy=this.Oy.sort(this.Ny),this.cs.Ms()}af(){return this.Oy}dispose(){return super.dispose(),this.Oy.slice().forEach((t=>t.dispose())),this.hm.Y(),this.im.Y(),this.qy.Y(),this}}const $a=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],Za={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},qa=(...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};class Ka extends ja{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.nm=Va.NamePlusValue,this.am=[],this.lm=40,this.um=5,this.dm=10,this.fm=this.ts.pieChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.fm=t;for(let t=0;tt.rh.setVisible(!1))),this.am.forEach((t=>t.setVisible(!1)))}else{Xa(t,e,i,u,this.iu,a);let s=90;const r=t.map(((t,r)=>{const h=360*e[r],a=s-h,l=wi(Ci(.5*(s+a))),c=l.x>=0?-1:1,d=yi(yi(i,mi(l,u+n)),{x:c*-o,y:0});s=a;const f={x:c,y:0};t.rh.Ve(d).Za(f),t.rh.Os();const g=ni(t.rh.hh());return{position:d,alignment:f,shape:t.rh,boundaries:g,sliceAngleVec:l,slice:t}})),l=[];for(let t=0;t{const s=t.slice.zy,r=Ha(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=Mi(t.position.y,r,i),o=t.position;this.Am([r,n,o])}))}}getMinimumSize(){return u(500,300)}Am(t){let e;for(let t=0;t{if(cs(t)){const e=t.getThickness(),i=t.getFillStyle();if(U(i))return 1===e?Cr:new wr({size:e,fillStyle:i,shape:"sphere"})}return Cr};class el{constructor(t,e,i,s,n,o,h,a,l,u){this.R=new r.Eventer,this.M=0,this.Zi=!0,this.ji=!1,this.Yo=!0,this.Ms=t,this.ym=e,this.vm=i,this.Sm=s,this.xm=n,this.bm=o,this.Yd=h,this.ly=a,this.Mm=l,this.lc=u}setValue(t){return t===this.M||(this.M=t,this.Ms(),this.R.emit("valueChange",this,this.M)),this}getValue(){return this.M}setTickStyle(t){return this.vm="function"==typeof t?t(this.vm):t,this.Ms(),this}getTickStyle(){return this.vm}setTickLength(t){return this.Sm=t,this.Ms(),this}getTickLength(){return this.Sm}setGridStrokeStyle(t){return this.xm="function"==typeof t?t(this.xm):t,this.Ms(),this}getGridStrokeStyle(){return this.xm}setTextPadding(t){return this.bm=t,this.Ms(),this}getTextPadding(){return this.bm}setTextRotation(t){return this.Yd=t,this.Ms(),this}getTextRotation(){return this.Yd}setTextFillStyle(t){return this.ly="function"==typeof t?t(this.ly):t,this.Ms(),this}getTextFillStyle(){return this.ly}setTextFont(t){return this.Mm="function"==typeof t?t(this.Mm):t,this.Ms(),this}getTextFont(){return this.Mm}setTextFormatter(t){return this.lc=t,this.Ms(),this}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}dispose(){return this.ji||(this.ji=!0,this.ym(),this.Ms(),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.Zi!==t;return this.Zi=t,e&&(this.R.emit("visibleStateChanged",this,this.Zi),this.Ms()),this}getVisible(){return this.Zi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setMouseInteractions(t){return this.Yo=t,this.Ms(),this}getMouseInteractions(){return this.Yo}}class il extends el{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,a,l),this._m=u,this.wm=c,this.Ia=d}setBackgroundFillStyle(t){return this._m="function"==typeof t?t(this._m):t,this.Ms(),this}getBackgroundFillStyle(){return this._m}setBackgroundStrokeStyle(t){return this.wm="function"==typeof t?t(this.wm):t,this.Ms(),this}getBackgroundStrokeStyle(){return this.wm}setPadding(t){return this.Ia="number"==typeof t?{left:t,top:t,right:t,bottom:t}:{...this.Ia,...t},this.Ms(),this}getPadding(){return this.Ia}}class sl{constructor(t,e,i,s){this.Cm=[],this.km=new Map,this.Tm=t,this.Fm=e,this.Im=i,this.Pm=s}Dm(){this.Im&&this.Im();const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];let i=[];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 s=this.Cm.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.Tm(),this.Cm.push(e));const n=[],o=e.Bm().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Fm(e,n,t.sharedProperties);i=fe(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.Bd(t)}))})),s.forEach((t=>{t.dispose();const e=this.Cm.indexOf(t);e<0?Me(0,(()=>{})):this.Cm.splice(e,1)})),r.forEach((t=>{const e=this.km.get(t.Jo);e&&t.collection.cs.co({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.km.clear(),r.forEach((t=>{this.km.set(t.Jo,t)})),this.Pm&&this.Pm(this.Cm,i)}}}Lm(){this.Cm.forEach((t=>{t.dispose()})),this.Cm.length=0}}class rl{constructor(t){this.Rm=[],this.Em=t}Dm(){return this.zm(),{add:()=>this.fl(),finishPlot:()=>{this.Vm()}}}fl(){let t=this.Rm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Em()},this.Rm.push(t)),t.isFree=!1,t.shape}zm(){this.Rm.forEach((t=>{t.isFree=!0}))}Vm(){this.Rm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Rm.splice(this.Rm.indexOf(t),1)}))}Lm(){this.Rm.forEach((t=>t.shape.dispose())),this.Rm.length=0}}class nl extends gr{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Om({x:t.cs.ts.xAxis3DNumericTicks,y:t.cs.ts.yAxis3DNumericTicks,z:t.cs.ts.zAxis3DNumericTicks}),datetime:e.Om({x:t.cs.ts.xAxis3DDateTimeTicks,y:t.cs.ts.yAxis3DDateTimeTicks,z:t.cs.ts.zAxis3DDateTimeTicks}),time:e.Om({x:t.cs.ts.xAxis3DTimeTicks,y:t.cs.ts.yAxis3DTimeTicks,z:t.cs.ts.zAxis3DTimeTicks})},{type:"linear"}),this.Uf=[],this.Nm=()=>{},this.Gm=()=>{},this.Um=()=>{},this.Wm=()=>{},this.chart=t,this.Ym=r,this.Hm=n,this.Xm=o,this.$m=this.Ym.At;const l=this.Gh.Om({x:this.ts.xAxis3DStrokeStyle,y:this.ts.yAxis3DStrokeStyle,z:this.ts.zAxis3DStrokeStyle});this.jm=this.Ym.gm([Za.InternalUI]).Ye(l).Zm(tl(l)).setMouseInteractions(!1),this.Fh=this.Hm.Wr(this.Xm).setMouseInteractions(!1).Re(e.Om({x:t.cs.ts.xAxis3DTitleFillStyle,y:t.cs.ts.yAxis3DTitleFillStyle,z:t.cs.ts.zAxis3DTitleFillStyle})).ir(e.Om({x:t.cs.ts.xAxis3DTitleFont,y:t.cs.ts.yAxis3DTitleFont,z:t.cs.ts.zAxis3DTitleFont})).ua(3),this.Qm=new rl((()=>this.Hm.Wr(this.Xm).ua(2).Ur(Le).Gr(Le))),this.Jm=new sl((()=>this.Hm.Km(this.Xm).setMouseInteractions(!1).ua(1)),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((({positions:e,existingMember:i})=>{const s=i||t.Zr();return s.Fl(e),s}))))),this.qm=new sl((()=>this.Ym.Qg().setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Ye(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.ml(e)))))),this.hs=a,this.hr=this.hs.Bg([this.Fh]).bs(s.effectsText),this.jm.setMouseEnterEventHandler(this.Nm).setMouseLeaveEventHandler(this.Gm).setMouseDragEventHandler(this.Um).setMouseDragStopEventHandler(this.Wm),i.yg=this}setTickStrategy(t,e){return super.Hh(t,e)}getTickStrategy(){return this.lh}addCustomTick(){const t=new il((()=>this.chart.cs.Ms()),(()=>{const e=this.Uf.indexOf(t);e>=0&&this.Uf.splice(e,1)}),this.ts.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickLength,this.ts.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.ts.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)),_,ut,{left:4,right:4,top:4,bottom:4});return this.Uf.push(t),this.chart.cs.Ms(),t}setStrokeStyle(t){return this.jm.Ye(t).Zm(tl(this.jm.xu())),this.chart.cs.Ms(),this}getStrokeStyle(){return this.jm.xu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.jm.setVisible(t),!1===t&&(this.qm.Lm(),this.Qm.Lm(),this.Jm.Lm()),this.Ym.Ms(),this}Ng(){return this.chart.getSeries()}tv(t){return Math.abs(this.At.st(t)*this.Ym.sv(1))}Vr(t,e,i){const s=Math.abs(this.At.st(e-t)*this.Ym.sv(1));return{min:t-i*s,max:e+i*s}}Mr(t,e){const i=new ol(e,t,this.Hm,this.Xm,this.Ym);return i.rh.ua(0),i}_r(t,e){const i=this.ev(e,t.M,t.Eh.je.tickLength,t.Eh.je.tickPadding);return t.rh.Ve(i.labelPosition).Za(i.labelAlignment),i}ev(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),c=Ue.addVec(ri(n,o,l),Ue.multiplyVec(Ue.multiply(h,this.Ym.sv(.5*this.jm.xu().getThickness())),r)),d=Ue.addVec(c,Ue.multiplyVec(Ue.multiply(h,this.Ym.sv(i)),r)),f=this.Ym.hv(d)||u(0,0);return{labelPosition:yi(yt(f,this.chart.cs.At,this.Xm),mi(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}rv(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),a=Ue.addVec(ri(r,n,h),Ue.multiplyVec(Ue.multiply(o,this.Ym.sv(.5*this.jm.xu().getThickness())),s)),l=Ue.addVec(a,Ue.multiplyVec(Ue.multiply(o,this.Ym.sv(10)),s)),c=this.Ym.hv(a)||u(0,0),d=this.Ym.hv(l)||u(0,0);return this.Hm.He(this.Xm).$e(c).Xe(d).Ye(new us({fillStyle:new N({color:w(120*i)}),thickness:1}))}Er(t,e){return hl(t,e,this.At)}ze(t){if(!this.Zi)return;const e=Math.min(this.Xh,this.$h),i=Math.max(this.Xh,this.$h),s=this.$m,r=f(s.x.rt(),s.y.rt(),s.z.rt());let n,o;this.nv()?(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.Gh.ov(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Gh.uf,a=this.Ym.hv(n)||u(0,0),l=this.Ym.hv(o)||u(0,0),c=ri(n,o,.5),d=Ue.addVec(c,Ue.multiplyVec(Ue.multiply(h,-1),r)),g=this.Ym.hv(c)||u(0,0),m=this.Ym.hv(d)||u(0,0),y=di(pi(yt(g,this.chart.cs.At,this.Xm),yt(m,this.chart.cs.At,this.Xm)));this.jm.Ot().ml([n,o]);const{gridlinePositionA:p,gridlinePositionB:A,gridlinePositionC:x}=this.Gh.av(t),S=t=>({x:-1===t.x?this.$m.x.getInnerStart():1===t.x?this.$m.x.getInnerEnd():0,y:-1===t.y?this.$m.y.getInnerStart():1===t.y?this.$m.y.getInnerEnd():0,z:-1===t.z?this.$m.z.getInnerStart():1===t.z?this.$m.z.getInnerEnd():0}),v=S(p),b=S(A),M=S(x),C={physicalAxisSize:gi(pi(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:y,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},T=this.dr(C),w=this.qm.Dm();for(const[t,e]of this.uh)for(const[,i]of e){const e=T.get(i);if(!e)continue;const s=this.lv(C,e);w.add({Jo:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.je.tickStyle}),s.gridStroke&&w.add({Jo:0,positions:s.gridStroke},{lineStyle:t.je.gridStrokeStyle})}const E=this.Qm.Dm(),k=this.Jm.Dm(),I={x:0,y:0};this.Uf.forEach((t=>{if(!t.Zi||t.Mi)return;const s=this.ev(C,t.M,t.Sm,t.bm),r=this.lv(C,s);if(t.ly!==_){const e=E.add().Ve(s.labelPosition).Za(s.labelAlignment).Re(t.ly).ir(t.Mm).Sr(t.lc(t.M)).sr(t.Yd).setMouseInteractions(t.Yo),i=e.Os().oi();if(I.x=Math.max(I.x,i.x),I.y=Math.max(I.y,i.y),t._m!==_){const i=e.hh(),s=[{x:i[0].x-t.Ia.left,y:i[0].y+t.Ia.top},{x:i[1].x+t.Ia.right,y:i[1].y+t.Ia.top},{x:i[2].x+t.Ia.right,y:i[2].y-t.Ia.bottom},{x:i[3].x-t.Ia.left,y:i[3].y-t.Ia.bottom}];k.add({Jo:0,positions:s},{fillStyle:t._m,strokeStyle:t.wm})}}w.add({Jo:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.vm}),r.gridStroke&&w.add({Jo:0,positions:r.gridStroke},{lineStyle:t.xm})})),E.finishPlot(),k.finishPlot(),w.finishPlot();const z=this.kr(((t,e)=>{const i=e.rh.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:I.x,y:I.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.Fh.Za({x:0,y:0}).sr(180*-F/Math.PI);const R=Ue.addVec(c,Ue.multiplyVec(Ue.multiply(h,this.Ym.sv(.5*this.jm.xu().getThickness()+this.Ir(((t,e)=>Math.max(t,e.tickLength)),0))),r)),D=this.Ym.hv(R)||u(0,0),P=yi(yt(D,this.chart.cs.At,this.Xm),yi(yi(Ai(z,y),mi(y,this.Ir(((t,e)=>Math.max(t)),0))),Ai(mi(this.Fh.Os().oi(),.5),y)));this.Fh.Ve(P),this.jm.uv={overrideFollowing:!1,skipMousePicking:!1}}lv(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Lt(h,0)||Lt(h,1)||(a=[this.cv()?{...i,x:n.x}:this.dv()?{...i,y:n.y}:this.nv()?{...i,z:n.z}:{x:0,y:0,z:0},this.cv()?{...s,x:n.x}:this.dv()?{...s,y:n.y}:this.nv()?{...s,z:n.z}:{x:0,y:0,z:0},this.cv()?{...r,x:n.x}:this.dv()?{...r,y:n.y}:this.nv()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}rr(){super.rr(),this.qm.Lm(),this.Qm.Lm(),this.Jm.Lm()}cv(){return this.Gh.cv()}dv(){return this.Gh.dv()}nv(){return this.Gh.nv()}}class ol extends mr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.fv=r}}const hl=(t,e,i)=>_t(t+.1*(e-t)+Math.abs(i.rt())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),al=(t,e,i,s)=>({Pr:()=>{const i=t();let s;for(const t of i){if(!t.Av())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},Dr:()=>{const e=t();let s;for(const t of e){if(!t.Av())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Lr:()=>{const e=t();let i;for(const t of e){if(!t.Av())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),ll=t=>({...al(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Lr().y)),Om:t=>t.y,ov:(t,e)=>({x:e.x,y:t.y,z:e.z}),uf:f(-1,0,0),av: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)}},cv:()=>!1,dv:()=>!0,nv:()=>!1}),ul=t=>({...al(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Lr().z)),Om:t=>t.z,ov:(t,e)=>({x:e.x,y:e.y,z:t.z}),uf:f(1,0,0),av: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)}},cv:()=>!1,dv:()=>!1,nv:()=>!0});class cl extends is{constructor(t,e,i,s,r){super(t,e,s,r),this.gv=ao,this.pv=!0,this.yv=!0,this.mv=!0,this.chart=t,this.Ym=i,this.ss=new Map,this.onMouseWheel(this.chart.vv),this.onMouseDrag(this.chart.Sv),this.onMouseDragStop(this.chart.xv),this.onTouchStart(this.chart.bv.onTouchStart),this.onTouchMove(this.chart.bv.onTouchMove),this.onTouchEnd(this.chart.bv.onTouchEnd)}Ki(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ()}}setCursorEnabled(t){return this.pv=t,this}getCursorEnabled(){return this.pv}setCursorFormattingOverride(t){return this.Mv=t,this}getCursorFormattingOverride(){return this.Mv}Yp(){return this.getCursorEnabled()}setAutoScrollingEnabled(t){return this.yv=t,this.chart.cs.Ms(),this}getAutoScrollingEnabled(){return this.yv}setColorShadingStyle(t){return this.gv=t,this.ss.forEach(((e,i)=>i._v(t))),this.Ym.Ms(),this}getColorShadingStyle(){return this.gv}setDepthTestEnabled(t){return this.mv=t,this.ss.forEach(((e,i)=>i.wv(t))),this.Ym.Ms(),this}getDepthTestEnabled(){return this.mv}Cv(){}ze(){}Pm(){}getXMax(){const t=this.qa;return t?t.St():void 0}getXMin(){const t=this.qa;return t?t.vt():void 0}getYMax(){const t=this.qa;return t?t.bt():void 0}getYMin(){const t=this.qa;return t?t.xt():void 0}getZMax(){const t=this.qa;return t?t.kv():void 0}getZMin(){const t=this.qa;return t?t.Tv():void 0}Lr(){const t=this.qa;return t?f(t.Pl(),t.Dl(),t.Fv()):f(0,0,0)}}class dl extends cl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Box Series 3D",this.Iv=.25,this.Pv=!1,this.qd=()=>Ae(this.Ie),this.Ie=ve(this.ts.boxSeries3DFillStyle,r),this.qa=this.Ym.Bv().wv(this.mv).Re(this.Ie).Dv(this.Iv).ds(this.getHighlight()),this.As(this.qa)}invalidateData(t){const e=t.length;if(0===e)return this;this.Pv&&this.chart.cs.Jn(Sh.Df);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;iAe(this.Su.getFillStyle())}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;return this.qa.Ye(e),this.Ym.Ms(),this}getStrokeStyle(){return this.Su}add(t){return this.Pv&&this.chart.cs.Jn(Sh.Df),this.Pv=!0,(t=Array.isArray(t)?t:[t])?(this.qa.ml(t.slice()),this.Ym.Ms(),this):this}clear(){return this.qa.Ot(),this}getPointAmount(){const t=this.qa;return t.vl()+t.Sl()}Av(){return this.yv&&this.getPointAmount()>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Ym.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su})}}class gl extends fl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Line Series 3D",this.Su=ve(s.lineSeries3DStrokeStyle,r),this.Rv=Ur.pointStyle3D,this.Ev(this.Su),this.qa=this.Ym.gm([Za.UserSeries]).wv(this.mv).Ye(this.Su).Zm(this.Rv).ds(this.getHighlight()),this.As(this.qa)}setStrokeStyle(t){super.setStrokeStyle(t),this.Ev(this.Su);const e=this.Rv;return this.qa.Zm(e),this}Ev(t){const e=new Fr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Rv=e}}class ml extends fl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Point Line Series 3D",this.qd=()=>Ae(this.Su.getFillStyle())||Ae(this.Rv.getFillStyle()),this.Rv=ve(s.pointLineSeries3DPointStyle,r),this.Su=ve(s.lineSeries3DStrokeStyle,r),this.zv(),this.qa=this.Ym.gm([Za.UserSeries]).wv(this.mv).Ye(this.Su).Zm(this.Rv).ds(this.getHighlight()),this.As(this.qa)}setPointStyle(t){return this.Rv="function"==typeof t?t(this.Rv):t,this.zv(),this.qa.Zm(this.Rv),this.Ym.Ms(),this}getPointStyle(){return this.Rv}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.Su,i=Math.abs(e.getThickness()),s=this.Rv,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.Rv=s.setSize(i)),this.zv();const n=this.Rv;return this.qa.Zm(n),this.Ym.Ms(),this}zv(){const t=this.Rv,e=t.getSize();this.Rv=t.setSize(e)}Oe(t,e){t.ds(e),this.Ym.Ms()}}class yl extends cl{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Pv=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.chart.cs.Jn(Sh.Bf)}add(t){return this.Pv&&this.chart.cs.Jn(Sh.Df),this.Pv=!0,(t=Array.isArray(t)?t:[t])?(this.qa.ml(t.slice()),this.Ym.Ms(),this):this}clear(){return this.qa.Ot(),this}getPointAmount(){const t=this.qa;return t.vl()+t.Sl()}Av(){return this.yv&&this.getPointAmount()>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Ym.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{point3D:this.Vv})}}class pl extends yl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Cs="Point Series 3D",this.qd=()=>Ae(this.Vv.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.chart.getSeries().length;this.Vv=ve(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.qa=this.Ym.Nv(h).wv(this.mv).Ov(this.Vv).ds(this.getHighlight()),this.As(this.qa)}setPointStyle(t){this.Vv="function"==typeof t?t(this.Vv):t;const e=this.Vv;return this.qa.Ov(e),this.Ym.Ms(),this}getPointStyle(){return this.Vv}}class Al extends yl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Cs="Point Cloud Series 3D",this.qd=()=>Ae(this.Vv.getFillStyle());const o=this.chart.getSeries().length;this.Vv=ve(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.qa=this.Ym.Nv(h).Ov(this.Vv).ds(this.getHighlight()),this.As(this.qa)}setPointStyle(t){this.Vv="function"==typeof t?t(this.Vv):t;const e=this.Vv;return this.qa.Ov(e),this.Ym.Ms(),this}getPointStyle(){return this.Vv}}const xl={Triangulated:pl,Pixelated:Al};class Sl extends fa{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Gv=[],this.Uv=0,this.Wv=t=>{const e=this.Gv.indexOf(t);e>=0&&(this.Gv.splice(e,1),this.R.emit("seriesDispose",this,t))},this.onSeriesBackgroundMouseEnter=t=>this.R.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.R.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.R.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.R.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.R.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.R.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.R.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.R.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.R.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.R.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.R.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.R.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.R.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.R.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.R.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.R.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.R.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.R.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.R.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.R.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.R.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.R.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.R.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.R.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.R.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.R.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.R.off(t,"touchEndSeriesBackground"),this.Yv=this.hs.Bg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Gv.forEach((e=>e.setAnimationHighlight(t))),this}Hv(t,e){this.Yv.gs([e]),t.setMouseMoveEventHandler(((t,e)=>{this.R.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.R.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.R.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.R.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.R.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.R.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.Xv.Re(t),this.cs.Ms(),this}getSeriesBackgroundFillStyle(){return this.Xv.Jh()}setSeriesBackgroundStrokeStyle(t){return this.$v.Le(t),this.cs.Ms(),this}getSeriesBackgroundStrokeStyle(){return this.$v.So()}setSeriesBackgroundEffect(t){return this.Yv.bs(t),this.cs.Ms(),this}getSeriesBackgroundEffect(){return this.Yv._s()}jv(t){this.Gv.push(t),void 0!==this.Zv&&t.setHighlightOnHover(this.Zv),this.R.emit("seriesAdded",this,t)}af(){return this.Gv}setSeriesHighlightOnHover(t){return this.Zv=t,this.Gv.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Gv.slice().forEach(Pt),super.dispose()}Wp(t){return this.R.on("seriesAdded",t)}Qv(t){return this.R.off(t)}Jv(t){return this.R.on("seriesDispose",t)}Kv(t){return this.R.off(t)}}const vl=Ue.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class bl{constructor(t,e,i,s){this.qv=!0,this.tS=!0,this.iS=2*-Math.PI/2160,this.sS=2*Math.PI/2160,this.eS=.1,this.hS=1*Math.PI/180,this.rS=t,this.nS=e,this.oS=i,this.hv=s}getDefaultCameraConfiguration(t,e){const i={direction:vl,location:Ue.multiply(vl,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:i.direction,cameraLocation:i.location,projection:e})||i}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.aS(i,t):"wheel-zoom"===t.type?i=this.lS(i,t):"rotate+zoom"===t.type?i=this.uS(i,t):"fixed-rotate"===t.type?i=this.cS(i,t):"move"===t.type&&(i=this.dS(i,t))})),this.qv?i=this.fS(t.boundingBox,i):this.tS&&(i=this.AS(t.boundingBox,t.projection,i)),i}aS(t,e){const{rotation:i}=e,s=t.location,r=Ue.multiply(Ue.normalize(t.location),-1),{Right:n,Up:o}=this.gS(r);let h=s;const a=this.pS(r),l=i.x*this.iS*a;h=Ue.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.sS,a-this.hS);return 0!==u&&(h=Ue.rotateAroundAxis(h,n,u)),{location:h,direction:Ue.multiply(Ue.normalize(h),-1)}}lS(t,e){const{deltaY:i}=e;this.qv&&this.yS(!1);const s=t.location,r=Ue.multiply(Ue.normalize(s),-1),n=i*this.eS,o=Ue.length(s)*-n;return{direction:r,location:Ue.addVec(s,Ue.multiply(r,o))}}uS(t,e){const{rotation:i,cameraDistance:s}=e;this.qv&&this.yS(!1);let r=this.aS(t,{type:"rotate",rotation:i});const n=r.location,o=Ue.multiply(Ue.normalize(n),-1),h=Ue.multiply(o,-s);return r={direction:Ue.multiply(Ue.normalize(h),-1),location:h},r}cS(t,e){this.qv&&this.yS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.gS(r),h=i.x*this.iS;let a=Ue.normalize(Ue.rotateAroundAxis(r,o,h));const l=i.y*this.sS;return a=Ue.normalize(Ue.rotateAroundAxis(a,n,l)),{location:s,direction:a}}dS(t,e){this.qv&&this.yS(!1),this.tS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.gS(n);return{location:Ue.addVec(r,Ue.multiply(n,.01*s),Ue.multiply(o,.01*i)),direction:n}}projectionChanged(t,e){return this.viewportChanged(t)}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ue.multiply(Ue.normalize(t.cameraLocation),-1)};return this.qv?this.fS(t.boundingBox,e):this.AS(t.boundingBox,t.projection,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ue.multiply(Ue.normalize(t.cameraLocation),-1)};return this.qv?this.fS(t.boundingBox,e):this.AS(t.boundingBox,t.projection,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ue.multiply(Ue.normalize(t.cameraLocation),-1)};if(this.qv)return this.fS(t.boundingBox,e)}fS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.mS(t,s,100,20,1,i,5);const r=this.pS(s.direction);return s=this.vS(s,this.SS(t,s,100,1),r),s}mS(t,e,i,s,r,n,o){return Ml(n,o,(t=>({direction:e.direction,location:Ue.multiply(e.direction,-t)})),(e=>this.xS(t,e)),i,r,"linear",s)}SS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.gS(e.direction),a=this.bS(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:Ue.normalize(Ue.lerp(l.direction,h,t))})),(e=>this.MS(t,e)),0,u,!0,i):Cl(0,c,(t=>({location:l.location,direction:Ue.normalize(Ue.lerp(l.direction,o,t))})),(e=>this.MS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ue.normalize(Ue.lerp(l.direction,n,t))})),(e=>this._S(t,e)),0,u,!0,i):Cl(0,c,(t=>({location:l.location,direction:Ue.normalize(Ue.lerp(l.direction,r,t))})),(e=>this._S(t,e)),0,u,!0,i)),l}xS(t,e){const i=this.bS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}_S(t,e){const i=this.bS(t,!1,e);return Math.abs(i.left-i.right)}MS(t,e){const i=this.bS(t,!1,e);return Math.abs(i.top-i.bottom)}bS(t,e,i){const s=ni(this.wS(t,e,i).map((t=>yt(t,this.rS,this.nS))));return{left:s.min.x,right:this.nS.x.getInnerEnd()-s.max.x,top:this.nS.y.getInnerEnd()-s.max.y,bottom:s.min.y}}wS(t,e,i){const s=this.oS,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.hv(t,i))).filter((t=>void 0!==t))}AS(t,e,i){const s=Ue.length(i.location),r=this.CS(t,e);return sr.max?{direction:i.direction,location:Ue.multiply(i.direction,-r.max)}:i}CS(t,e){return{min:("perspective"===e?.8:.5)*Math.sqrt(t.x**2+t.y**2+t.z**2),max:3*Math.sqrt(t.x**2+t.y**2+t.z**2)}}gS(t){const e=f(0,1,0),i=Ue.normalize(Ue.cross(e,Ue.multiply(t,-1)));let s=Ue.cross(i,t);return s.y=Math.abs(s.y),s=Ue.normalize(s),{Right:i,Up:s,Down:Ue.multiply(s,-1),Left:Ue.multiply(i,-1)}}pS(t){const e={x:0,y:1,z:0},i=Ue.angle(t,e),s=Ue.angle(t,Ue.multiply(e,-1));return Math.min(i,s)}vS(t,e,i){return{location:Ue.lerp(t.location,e.location,i),direction:Ue.normalize(Ue.lerp(t.direction,e.direction,i))}}yS(t){return this.qv=t,this}kS(){return this.qv}}const Ml=(t,e,i,s,r,n,o,h)=>{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)Ae(this.Ie),this.gv=oo;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.Ie=ve(this.ts.surfaceGridSeries3DFillStyle,o),this.FS=ve(this.ts.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.io=h,this.qa=this.Ym.PS(h).Re(this.Ie).IS(this.FS)._v(this.gv).ds(this.getHighlight()),this.As(this.qa),this.setHighlightOnHover(!1)}Ki(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(this.Ie)?this.Ie.lut:void 0}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}DS(){const t=this.TS.start||{x:0,z:0};let e;e=this.TS.end?{x:(this.TS.end.x-t.x)/this.io.columns,z:(this.TS.end.z-t.z)/this.io.rows}:this.TS.step?this.TS.step:{x:1,z:1},this.qa.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.qa.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.qa.LS().step}setEnd(t){return this.TS.end=t,this.DS(),this}getEnd(){return this.qa.LS().end}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.qa.Re(this.Ie),this.Ym.Ms(),this}getFillStyle(){return this.Ie}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.qa.IS(this.FS),this.Ym.Ms(),this}getWireframeStyle(){return this.qa.RS()}setIntensityInterpolation(t){return t=t||"disabled",this.qa.ES(t),this.Ym.Ms(),this}getIntensityInterpolation(){return this.qa.zS()}invalidateIntensityValues(t){if(this.Pv&&this.chart.cs.Jn(Sh.Df),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.io.dataOrder?t.length:t[0].length,rows:"rows"===this.io.dataOrder?t.length:t[0].length},i="columns"===this.io.dataOrder?this.io.columns:this.io.rows,s="columns"===this.io.dataOrder?this.io.rows:this.io.columns;if(e.x>i||e.y>s){if(!0===this.chart.CA.eo){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.io.columns}x${this.io.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.`;zt.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.chart.CA.eo){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.io.columns}x${this.io.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.`;zt.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;eAe(this.Ie),this.chart.cs.Jn(Sh.Df),this.gv=oo;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.Ie=ve(this.ts.surfaceScrollingGridSeries3DFillStyle,o),this.FS=ve(this.ts.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.io=h,this.qa=this.Ym.US(h).Re(this.Ie).IS(this.FS)._v(this.gv).ds(this.getHighlight()),this.As(this.qa),this.setHighlightOnHover(!1)}Ki(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(this.Ie)?this.Ie.lut:void 0}}DS(){const t=this.TS.start||{x:0,z:0};let e;e=this.TS.step?this.TS.step:{x:1,z:1},this.qa.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.qa.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.qa.LS().step}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.qa.Re(this.Ie),this.Ym.Ms(),this}getFillStyle(){return this.Ie}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.qa.IS(this.FS),this.Ym.Ms(),this}getWireframeStyle(){return this.qa.RS()}setIntensityInterpolation(t){return t=t||"disabled",this.qa.ES(t),this.Ym.Ms(),this}getIntensityInterpolation(){return this.qa.zS()}clear(){return this.qa.Ot(),this.Ym.Ms(),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.io.scrollDimension?this.io.rows:this.io.columns;if(i>s-1){if(!0===this.chart.CA.eo){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.io.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.chart.CA.eo){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.io.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.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.qa.WS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Ym.Ms(),this}setCullMode(t){return this.qa.NS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.qa.GS()}Cv(){}ze(){}Pm(){}Av(){return this.yv&&this.getVisible()}Oe(t,e){t.ds(e),this.Ym.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}}const El=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Dl),kl=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y&&"z"in t&&"number"==typeof t.z);class Il extends cl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Mesh Model 3D",this.YS=new Float32Array,this.At={x:1,y:1,z:1},this.HS={x:0,y:0,z:0},this.XS={x:0,y:0,z:0},this.$S={x:0,y:0,z:0},this.jS={w:1,x:0,y:0,z:0},this.ZS={x:0,y:0,z:0},this.el=We,this.qd=()=>Ae(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.chart.getSeries().length;this.qa=this.Ym.QS().wv(this.mv).Re(ve(this.ts.meshModel3DFillStyle||this.ts.pointSeriesFillStyle,o)).ds(this.getHighlight()),this.As(this.qa)}Ki(t,e){const i=this.getFillStyle();return Ve({series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(i)?i.lut:void 0},{cursorPosition:0,index:0,x:0,y:0,z:0,value:0},(()=>{const s=this.qa.JS(t,e);if(s)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:s.coordAxis},...s.coordAxis,index:s.index,value:s.value,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(i)?i.lut:void 0}}))}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=He,n=Ye,o=He,h=Ye,a=He,l=Ye;for(let t=0;te(t)))}return r.pointMarker.setPosition(s),this.chart.cs.Ms(),this}}class Fl{constructor(t,e){this.by=[],this.My=(t,e)=>(this.by.forEach((i=>i(t,e))),t),this.addStyler=t=>new Fl(this.vy,this.by.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new Fl(t,this.by.map((t=>t))),this._y=(t,e,i,s,r,n)=>this.My(new zl(t,e,i,s,this.vy,r,n),r),this.vy=t,this.by=e}}const Rl=new Fl(Fo,[(t,e)=>{wa(t)}]);class Dl extends Sl{constructor(t,e,i,s,r,n,o){var h;super(t,e,i,e.Bp("chart3D bg",0),s,e.cs.ts.chart3DBackgroundFillStyle,e.cs.ts.chart3DBackgroundStrokeStyle,e.cs.ts.chart3DTitleFont,e.cs.ts.chart3DTitleFillStyle,n),this.yx=1,this.mx=[],this.vx=2,this.Sx=!0,this.xx=!0,this.bx=!0,this.Mx=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.vn=[],this.kn=()=>{const t=this.Ym._x();this.Cx.wx(t),this.kx.wx(t);const e=this.Tx.viewportChanged(this.Fx());e&&this.Ix(e),this.cs.Ms()},this.Px=!1,this.Sv=(t,e,i,s,r)=>{if(this.Px=!0,this.bx){const t=r;this.mx.push({type:"rotate",rotation:t}),this.cs.Ms(),se(e)}},this.xv=(t,e,i,s,r)=>{this.Px=!1},this.vv=(t,e)=>{if(this.xx){if(this.Sx)Math.sign(this.Mx)!==Math.sign(e.deltaY)?this.Mx=be(e):this.Mx+=be(e);else{const t=be(e);this.mx.push({type:"wheel-zoom",deltaY:t})}this.cs.Ms(),se(e)}},this.cs.Jn(Sh._f),this.Ch.Sr("Chart3D"),this.Dx=i.d3(),this.Dx.x.q(-1,1),this.Dx.y.q(-1,1),this.Dx.z.q(-1,1),this.Ym=e.Bx("chart3D layer3D",0,this.Dx),this.Cx=e.Lx("chart3D series bg",0),this.kx=e.tm("chart3D axis ui",1),this.Rx={x:new nl(this,(h=()=>this.Gv,{...al(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Lr().x)),Om:t=>t.x,ov:(t,e)=>({x:t.x,y:e.y,z:e.z}),uf:f(0,-1,0),av: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)}},cv:()=>!0,dv:()=>!1,nv:()=>!1}),this.Dx.x,this.ts,this.Ym,this.kx,this._g,!1,this.hs),y:new nl(this,ll((()=>this.Gv)),this.Dx.y,this.ts,this.Ym,this.kx,this._g,!1,this.hs),z:new nl(this,ul((()=>this.Gv)),this.Dx.z,this.ts,this.Ym,this.kx,this._g,!1,this.hs)},this.Ex=this.Ym.gm([Za.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.ts.chart3DBoundingBoxStrokeStyle),this.Xv=this.Cx.fc(this.cs.At,Tn.Simple).Re(this.ts.chart3DSeriesBackgroundFillStyle).Le(ut).setMouseInteractions(!0),this.$v=this.Cx.fc(this.cs.At,Tn.Simple).Re(_).Le(this.ts.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Hv(this.Xv,this.$v),this.zx({x:1,y:1,z:1},!0),this.Tx=new bl(this.cs.At,this._g,this.Dx,((t,e)=>(e&&this.Ix(e),this.Ym.hv(t)))),this.Vx=this.Tx.getDefaultCameraConfiguration(this.Ox(this.Nx),this.getProjection()),this.Ix(this.Vx);const a=Vt(o?o.cursorBuilder:void 0,Rl),l=e.sm();let c;this.hm=pa(this,l,a._y(l,this._g,this._g,Ot,this.ts,this),this,"show-pointed",Pl,(()=>0)),this.bv=ns(new as(((t,e,i)=>{c={locationOne:e,locationTwo:i,cameraLocation:this.Ym.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.bx&&!this.xx)return;const o=(c.locationOne.x-c.locationTwo.x)**2+(c.locationOne.y-c.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,a=Ue.length(c.cameraLocation),l=o/h*a,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.mx.push({type:"rotate+zoom",rotation:this.bx?d:{x:0,y:0},cameraDistance:this.xx?l:a}),this.cs.Ms(),se(n)}),(t=>{})),new hs((t=>{}),((t,e,i,s,r)=>{if(this.bx){const t=s;this.mx.push({type:"rotate",rotation:t}),this.cs.Ms(),se(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.bv.onTouchStart),this.onBackgroundTouchMove(this.bv.onTouchMove),this.onBackgroundTouchEnd(this.bv.onTouchEnd),this.onSeriesBackgroundTouchStart(this.bv.onTouchStart),this.onSeriesBackgroundTouchMove(this.bv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.bv.onTouchEnd),this.onBackgroundMouseDrag(this.Sv),this.onBackgroundMouseDragStop(this.xv),this.onBackgroundMouseWheel(this.vv),this.onBackgroundMouseDown(((t,e)=>{se(e)})),this.onSeriesBackgroundMouseDrag(this.Sv),this.onSeriesBackgroundMouseDragStop(this.xv),this.onSeriesBackgroundMouseWheel(this.vv),this.onSeriesBackgroundMouseDown(((t,e)=>{se(e)})),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.kn),this.kn(),this.Dp(r,this._g)}setProjection(t){this.Ym.Gx(t);const e=this.Tx.projectionChanged(this.Fx(),t);return e&&this.Ix(e),this.cs.Ms(),this}getProjection(){return this.Ym.Ux()}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Rl){const e=this.xp(),i=t._y(e,this._g,this._g,this.pp(e),this.ts,this);return this.Fp(i),i}addPointSeries(t){const e=new(t&&t.type||pl)(this,this.Wv,this.Ym,this.ts,this.cs.hs,t);return this.jv(e),e}addLineSeries(t){const e=new gl(this,this.Wv,this.Ym,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPointLineSeries(t){const e=new ml(this,this.Wv,this.Ym,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addSurfaceGridSeries(t){const e=new Tl(this,this.Wv,this.Ym,t,this.ts,this.cs.hs);return this.jv(e),e}addSurfaceScrollingGridSeries(t){const e=new wl(this,this.Wv,this.Ym,t,this.ts,this.cs.hs);return this.jv(e),e}addBoxSeries(t){const e=new dl(this,this.Wv,this.Ym,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addMeshModel(t){const e=new Il(this,this.Wv,this.Ym,this.ts,t,this.cs.hs);return this.jv(e),e}translateCoordinate(t,e,i){if(El(e)||El(i)||kl(t)){if(El(e)&&El(i)&&kl(t)){if("axes"===e.id&&"world"===i.id)return this.Ym.Wx(t);if("world"===e.id&&"axes"===i.id)return this.Ym.Yx(t);if(e.id===i.id)return t}if(El(e)&&Wi(i)&&kl(t)){const e=this.Ym.hv(t);return e?this.cs.Wo({engineX:e.x,engineY:e.y}):{clientX:-1,clientY:-1}}if(El(e)&&$i(i)&&kl(t)){const e=this.Ym.hv(t);return e?yt(e,this.cs.At,this._g):{clientX:-1,clientY:-1}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return aa(t,e,i,this._g,this.cs)}getDefaultAxisX(){return this.Rx.x}getDefaultAxisY(){return this.Rx.y}getDefaultAxisZ(){return this.Rx.z}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}get axisZ(){return this.getDefaultAxisZ()}get zAxis(){return this.getDefaultAxisZ()}getDefaultAxes(){return[this.Rx.x,this.Rx.y,this.Rx.z]}setCameraLocation(t){let e={location:t,direction:Ue.normalize(Ue.multiply(t,-1))};const i=this.Tx.cameraLocationChanged(this.Fx(e));return i&&(e=i),this.Ix(e),this.cs.Ms(),this}getCameraLocation(){return this.Ym.getCameraLocation()}getCameraDirection(){return this.Ym.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.Tx.yS(t);const e=this.Tx.cameraLocationChanged(this.Fx());return e&&this.Ix(e),this}getCameraAutomaticFittingEnabled(){return this.Tx.kS()}onCameraChange(t){return this.R.on("cameraChange",t)}offCameraChange(t){return this.R.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.Ex.Ye(t).Zm(tl(this.Ex.xu())),this.Ym.Ms(),this}getBoundingBoxStrokeStyle(){return this.Ex.xu()}setBoundingBox(t){return this.zx(t,!1),this}zx(t,e){this.Nx=t;const i=this.Ox(t);if(this.Dx.x.it(i.x),this.Dx.y.it(i.y),this.Dx.z.it(-i.z),!e){const t=this.Tx.boundingBoxChanged(this.Fx());t&&this.Ix(t)}this.cs.Ms()}getBoundingBox(){return this.Nx}ze(t){if(ga.Gp(this.Ch,this.Lp),0!==this.Mx){const e=this.Mx*t*.006;this.mx.push({type:"wheel-zoom",deltaY:e}),this.Mx=Math.sign(this.Mx)*Math.max(Math.abs(this.Mx)-.01*t,0),0!==this.Mx&&this.cs.Ms(!0)}const e=this.getCameraDirection();if(this.mx.length>0){const t=this.Tx.applyCameraInteractions(this.Fx(),this.mx);t&&this.Ix(t),this.mx.length=0}this.Hx&&Ue.equals(this.Hx.location,this.Vx.location)&&Ue.equals(this.Hx.direction,this.Vx.direction)||this.R.emit("cameraChange",this,this.getCameraLocation()),this.Hx=this.Vx,super.ze(t);for(let t=0;tthis.Ym.hv(t))),o=this.Ym.hv(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=de(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.vn.length=0,this.Dx.Y(),this.Ym.Y(),this.kx.Y(),this.Cx.Y(),this.hm.Y(),super.dispose()}J(){return this.Dx.x.J(),this.Dx.y.J(),this.Dx.z.J(),super.J()}K(){return super.K()}Ix(t){this.Ym.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ue.addVec(t.location,Ue.multiply(t.direction,-this.vx))),this.Vx=t,this.cs.Ms()}Ox(t){return Ue.divide(t,Ue.length(t)/this.yx)}Fx(t=this.Vx){return{boundingBox:this.Ox(this.Nx),cameraLocation:t.location,cameraDirection:t.direction,projection:this.getProjection()}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.xx=t,this}getMouseInteractionZoom(){return this.xx}setMouseInteractionRotate(t){return this.bx=t,this}getMouseInteractionRotate(){return this.bx}forEachAxis(t){return t(this.Rx.x),t(this.Rx.y),t(this.Rx.z),this}getSeries(){return this.Gv}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.Sx=!!t,this}getAnimationZoom(){return this.Sx}}const Pl=(t,e,i)=>{var s,r;return xt(e)?ya(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Ki(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Ki(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:Ki(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:Ki(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):vt(e)?ya(e,[[e.series],void 0!==e.value?["Value","",{text:Ki(e.value.toFixed(2),null===(r=e.lut)||void 0===r?void 0:r.units),font:{weight:"bold"}}]:[]]):ya(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Ki(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Ki(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:Ki(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}]])},Ol={Column:Ho,Row:Xo};class Ll extends ca{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Xx=new Map,this.$x=this.addUIElement(Ol.Row).setPosition({x:0,y:100}).setOrigin(Vs.LeftTop).setBackground((t=>t.setFillStyle(_).setStrokeStyle(ut)))}add(t,e){return(t instanceof fa?[t]:t instanceof gg?t.getCells().filter((t=>t.panel instanceof fa)).map((t=>t.panel)):[]).forEach((t=>{const i=this.$x.addElement(xh.VerticalLegendBox).setBackground((t=>t.setFillStyle(_).setStrokeStyle(ut))).add(t,e).setTitle(t.getTitle());this.Xx.set(t,i)})),this.cs.Ms(),this}setLegendBoxes(t){return this.Xx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.$x.getSize()}}const _l={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Bl=(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(),Vl=(t,e)=>{let i=e.geometry;return i=Gl(t,e,i),i=Nl(t,e,i),i},Gl=(t,e,i)=>{if(t===_l.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===_l.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=ni(Bt(i)),h=[];for(let e=0;ethis.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.R.on("mapDataReady",t);return this.tb&&zt.setTimeout((()=>t())),e},this.onViewChange=t=>this.R.on("viewChange",t),this.ib=(t,e,i,s,r)=>{this.At.x.it(s).si([this.$t.left+this.Ia.left,this.$t.right+this.Ia.right]),this.At.y.it(r).si([this.$t.bottom+this.Ia.bottom,this.$t.top+this.Ia.top+ga.Np(this.Ch,this.Lp)]),this.sb&&this.eb(this.hb,this.At,this.sb)},this._t=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.nb(s),se(t)),this.Kx&&this.cs.us.ks(r,!0),this.ob=r,this.R.emit("mouseEnter",this,t,s))},this.wt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;this.ab(),r&&(this.Kx&&this.cs.us.ks(r,!1),this.ob=void 0,this.R.emit("mouseLeave",this,t,s),t&&se(t))},this.It=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.nb(s),se(t)),this.ob=r,this.R.emit("mouseMove",this,t,s))},this.Ct=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseClick",this,t,s)},this.kt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseDoubleClick",this,t,s)},this.Tt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseDown",this,t,s)},this.Ft=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseUp",this,t,s)},this.Dt=(t,e,i)=>{const s=i;if(!s||!this.tb)return;const r=this.rb(this.tb,s);this.R.emit("mouseDragStart",this,t,e,r)},this.Pt=(t,e,i,s,r)=>{const n=r;if(!n||!this.tb)return;const o=this.rb(this.tb,n);this.R.emit("mouseDrag",this,t,e,i,s,o)},this.Bt=(t,e,i,s)=>{const r=s;if(!r||!this.tb)return;const n=this.rb(this.tb,r);this.R.emit("mouseDragStop",this,t,e,i,n)},this.Lt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseWheel",this,t,s)},this.Rt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.nb(s),this.Kx&&this.cs.us.ks(r,!0),this.ob=r,this.R.emit("touchStart",this,t,s),se(t))},this.Et=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.nb(s),this.ob=r,this.R.emit("touchMove",this,t,s),se(t))},this.zt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;this.ab(),r&&(this.Kx&&this.cs.us.ks(r,!1),this.ob=void 0,this.R.emit("touchEnd",this,t,s),se(t))},this.cs.Jn(Sh.Cf),this.ph=!1!==(null==n?void 0:n.animationsEnabled),this.lb=e.tm("mapChart plotting",0),this.onResize(this.ib),this.Ch.Sr("Map Chart");const h=e.sm(),a=Vt(n?n.cursorBuilder:void 0,Oa);this.hm=pa(this,h,a._y(h,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",Wl,(()=>0)),this.ub=this.hs.Bg(),this.Dp(r,this.uiScale),this.cb=this.lb.Km(this.At).setMouseInteractions(this.Xi).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).Re(this.ts.mapChartFillStyle).Le(this.ts.mapChartStrokeStyle),this.fb=this.lb.Km(this.At).setMouseInteractions(this.Xi).Re(this.ts.mapChartOutlierRegionFillStyle).Le(this.ts.mapChartOutlierRegionStrokeStyle);const l=Vt(n&&n.type,_l.World);this.hb=l,this.Ab(l).then((()=>{this.R.emit("mapDataReady")}))}getRegionUnderMouse(){return this.ob}setFillStyle(t){return this.cb.Re(t),this.cs.Ms(),this}getFillStyle(){return this.cb.Jh()}setStrokeStyle(t){return this.cb.Le(t),this.cs.Ms(),this}getStrokeStyle(){return this.cb.So()}setEffect(t){return this.ub.bs(t),this.cs.Ms(),this}getEffect(){return this.ub._s()}setOutlierRegionFillStyle(t){return this.fb.Re(t),this.cs.Ms(),this}getOutlierRegionFillStyle(){return this.fb.Jh()}setOutlierRegionStrokeStyle(t){return this.fb.Le(t),this.cs.Ms(),this}getOutlierRegionStrokeStyle(){return this.fb.So()}setSeparateRegionFillStyle(t){return this.Zx="function"==typeof t?t(this.Zx):t,this.jx.forEach((t=>t.Re(this.Zx))),this.cs.Ms(),this}getSeparateRegionFillStyle(){return this.Zx}setSeparateRegionStrokeStyle(t){return this.Qx="function"==typeof t?t(this.Qx):t,this.jx.forEach((t=>t.Le(this.Qx))),this.cs.Ms(),this}getSeparateRegionStrokeStyle(){return this.Qx}invalidateRegionValues(t){if(!this.tb||!this.gb)return this.pb=this.pb||[],this.pb.push(t),this;if("function"==typeof t)for(let e=0;e{t.yb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.yb(e.value)}))}}return this.cs.Ms(),this}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}setMouseInteractions(t){return this.Xi=t,this.cb.setMouseInteractions(t),this}getMouseInteractions(){return this.Xi}setHighlight(t){var e;return t=ke(t),this.Jx=t,null===(e=this.tb)||void 0===e||e.regions.forEach((e=>{this.cs.us.ks(e,t)})),this.R.emit("highlight",this,t),this}getHighlight(){return this.Jx}setAnimationHighlight(t){var e;return null===(e=this.tb)||void 0===e||e.regions.forEach((e=>{this.cs.us.Ts(e,t)})),this}getAnimationHighlight(){var t;return this.cs.us.Fs(null===(t=this.tb)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Kx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Kx}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}offMapDataReady(t){return this.R.off(t,"mapDataReady")}offViewChange(t){return this.R.off(t,"viewChange")}async Ab(t){const e=await((t,e)=>{let i;if(t===_l.World)i="countries_world.json";else if(t===_l.NorthAmerica)i="countries_northAmerica.json";else if(t===_l.SouthAmerica)i="countries_southAmerica.json";else if(t===_l.Africa)i="countries_africa.json";else if(t===_l.Europe)i="countries_europe.json";else if(t===_l.Asia)i="countries_asia.json";else if(t===_l.USA)i="states_usa.json";else if(t===_l.Canada)i="territoriesProvinces_canada.json";else{if(t!==_l.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw zt.alert(e),new Error(e)}i="territories_australia.json"}return new Promise(((t,s)=>{(t=>{if(t.resourcesBaseUrl){const e=`${t.resourcesBaseUrl}${t.fileName}`;return void zt.fetch(e).then((e=>{t.success(e)})).catch((()=>{t.error({url:e})}))}const e=`${zt.location.origin}/resources${t.fileName}`;zt.fetch(e).then((e=>{if(!e.ok)throw new Error;t.success(e)})).catch((()=>{const i=`https://lcjs-resources.lightningchart.com/v1${t.fileName}`;zt.fetch(i).then((e=>{zt.console.warn("LightningChart JS warning | fallbacking publicly hosted asset resources.\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/warning-using-publicly-hosted-resources/"),t.success(e)})).catch((()=>{t.error({url:e})}))}))})({fileName:`/maps/${i}`,resourcesBaseUrl:e,success:e=>e.json().then(t),error:({url:t})=>De(e,t,"Map Chart",{shouldCrash:!0})})}))})(t,this.CA.te);this.gb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Ul[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.fb.Zr().Fl(e);if(t===_l.USA){const t=25.8,e=29.7;this.jx.push(this.gp.Ee(this.At).setMouseInteractions(!1).Re(this.Zx).Le(this.Qx).Ve({x:-126,y:t}).it({x:10,y:e-t}),this.gp.Ee(this.At).setMouseInteractions(!1).Re(this.Zx).Le(this.Qx).Ve({x:-113,y:t}).it({x:7,y:e-t}))}const s=this.cs.us.jr(this.cb,{animationEnabled:this.ph});for(let i=0;i{o.forEach((e=>e.ds(t)))}))}if(this.ub.gs([this.cb]),this.sb=i,this.eb(t,this.At,i),this.tb=e,this.pb){for(const t of this.pb)this.invalidateRegionValues(t);this.pb=void 0}this.cs.Ms()}eb(t,e,i){const s=Yl[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.q(o.min.x,o.max.x),e.y.q(o.min.y,o.max.y);const h=this.At.x.li(),a=this.At.y.li();this.R.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]}})}nb(t){this.mb=t,this.cs.Ms()}ab(){this.mb=void 0,this.cs.Ms()}rb(t,e){const i=Array.from(this.qx.entries()).findIndex((([t,i])=>i.includes(e))),s=null==t?void 0:t.regions[i],r=this.cs.Zn();if(!r)return;const n=this.cs.Uo(r),o=this.gb&&this.gb[i];let h=yt({x:n.engineX,y:n.engineY},this.cs.At,this.At);h={x:_t(h.x,this.At.x.getInnerStart(),this.At.x.getInnerEnd()),y:_t(h.y,this.At.y.getInnerStart(),this.At.y.getInnerEnd())};let a=h.x,l=h.y;const u=s.transform;s.outlier&&u&&(a=(a-u.translate.x-u.vertexBoundaries.min.x)/u.scale.x+u.vertexBoundaries.min.x,l=(l-u.translate.y-u.vertexBoundaries.min.y)/u.scale.y+u.vertexBoundaries.min.y);const c=this.getFillStyle();return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},region:s,value:o,longitude:l,latitude:a,lut:j(c)?c.lut:void 0}}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Oa){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}setAnimationsEnabled(t){return this.ph=!t,this}getAnimationsEnabled(){return this.ph}getMinimumSize(){}af(){return[this]}ze(t){super.ze(t),super.Pp(),ga.Gp(this.Ch,this.Lp);const e=y(this.At.x.ei(),this.At.y.ei(),this.At.x.ri(),this.At.y.ri());return this.lb.wx(e),this.hm.ze(!1,[],void 0,{explicitTarget:this.mb}),this}dispose(){return this.lb.Y(),this.hm.Y(),ua(this.At),super.dispose()}J(){return super.J(),this.At.J(),this}K(){return super.K(),this.At.K(),this}qd(){return Ae(this.getFillStyle())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),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))),this.styleLegendEntry(t,i),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.getFillStyle()})}}const Xl=(t,e)=>{const i=t>0,s=e>0;return`${[Se(Math.abs(0|t),2),"° ",Se(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[Se(Math.abs(0|e),2),"° ",Se(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`},Wl=(t,e,i)=>{var s;const r=[[e.region.name],[Xl(e.longitude,e.latitude)]];return void 0!==e.value&&r.push({text:Ki(e.value.toFixed(1),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}),r};class jl extends gr{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.vb(i),s,r,{numeric:e.Sb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Sb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Sb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.xb=n,this.bb=o,this.Mb=h,this.hs=a,this._b=i,this.wb=e.Sb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Fh=h.Wr(i).setMouseInteractions(!1).ir(e.Sb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Re(e.Sb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.hr=this.hs.Bg([this.Fh]).bs(s.effectsText)}setTickStrategy(t,e){return super.Hh(t,e)}setStrokeStyle(t){return this.wb="function"==typeof t?t(this.wb):t,this.bb.Ms(),this}getStrokeStyle(){return this.wb}Mr(t,e){return new $l(e,t,this._b,this.Mb,this.Cb(this.xb,this._b),this.Mb.He(this._b).setMouseInteractions(!1))}_r(t,e){const i=this.kb(this._b,t);this.Tb&&!1===this.Tb(t)?t.rh.setVisible(!1):t.rh.setVisible(!0).Ve(yi(this.Fb(this._b,t.M),i.padding)).Za(i.alignment).sr(i.rotation).Wa(i.offset.x,i.offset.y),this.Ib(this._b,t.Pb,t.Db,t)}setMouseInteractions(t){return this}ze(){this.dr({physicalAxisSize:0});const t=this.kr(((t,e)=>{const i=e.Eh.je,s=.5*this.wb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.rh.Os().od().y);return Math.max(t,s)}),0);return this.Bb(this._b,this.wb,t),this.Lb(this._b,this.Fh,t),t}}class $l extends mr{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.Pb=r,this.Db=n,r.setMouseInteractions(!1),this.ss.push(r,n)}}class Zl extends jl{constructor(t,e,i,s,r,n,o,h,a){super(t,ql((()=>this.Ng())),e,i,s,r,n,o,h),this.jm=this.bb.He(this._b).setMouseInteractions(!1),this.Rb=a,this.setScrollStrategy(Ks.expansion),this.setTickStrategy(Js.Numeric),this.setTitle("Amplitude")}Ng(){return this.Rb()}Er(t,e){return Qi(t,e,this._b.y)}Vr(t,e,i){const s=2*(e-t),r=this._b.x.Li(s);return{min:t-i*r,max:e+i*r}}Fb(t,e){return{x:t.Eb()?e-t.zb().start:t.zb().start-e,y:0}}Cb(t,e){return t.ud(e)}Ib(t,e,i,s){const r=s.Eh.je,n=t.Eb()?s.M-t.zb().start:t.zb().start-s.M;Lt(s.M,t.zb().start)||Lt(s.M,t.zb().end)?e.setVisible(!1):e.setVisible(!0).Au(0).Xe(360).vu(void 0).mu(0).gu(n).vu(60).Re(_).Le(r.gridStrokeStyle);const o=.5*this.wb.getThickness();i.$e({x:n,y:-o*t.Ui().y}).Xe({x:n,y:-(o+r.tickLength)*t.Ui().y}).Ye(r.tickStyle)}kb(t,e){const i=e.Eh.je;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ui().y*-(.5*this.wb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Bb(t,e,i){const s=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;this.jm.$e({x:0,y:0}).Xe({x:s,y:0}).Ye(e)}Lb(t,e,i){const s=t.Eb()?(t.zb().start+t.zb().end)/2-t.zb().start:t.zb().start-(t.zb().start+t.zb().end)/2;e.Za({x:0,y:1}).Ve({x:s,y:-i*t.Ui().y})}}const ql=t=>({...al(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),vb:t=>({getInnerStart:()=>t.zb().start,getInnerEnd:()=>t.zb().end,q:(e,i)=>t.Vb(e,i),ut:(e,i,s,r,n)=>t.y.ut(e,i,s,r,n)}),Sb:t=>t.amplitude});class Kl extends jl{constructor(t,e,i,s,r,n,o,h){super(t,Ql,e,i,s,r,n,o,h),this.Ob=90,this.Nb=12,this.Gb=Jl,this.jm=this.bb.ud(this._b).setMouseInteractions(!1),this.Tb=t=>{let e=180*(t.M-this._b.Ub())/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.fh=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Ob)}setTickStyle(t){return this.Wb="function"==typeof t?t(this.Wb):t,this.Yb(),this.bb.Ms(),this}getTickStyle(){return this.Wb}setTickFormattingFunction(t){return this.Gb=t,this.Yb(),this.bb.Ms(),this}getTickFormattingFunction(){return this.Gb}setClockwise(t){this._b.Hb(t);const e=this.Ob*Math.PI/180;return t?this._b.Xb(e+Math.PI/2):this._b.Xb(e-Math.PI/2),this.bb.Ms(),this}getClockwise(){return!this._b.$b()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Ob=t;const e=t*Math.PI/180;return this.getClockwise()?this._b.Xb(e+Math.PI/2):this._b.Xb(e-Math.PI/2),this.bb.Ms(),this}getNorth(){return 180*this._b.Ub()/Math.PI}setDivision(t){return this.Nb=t,this.Yb(),this.bb.Ms(),this}getDivision(){return this.Nb}Ng(){return[]}Er(t,e){return e}Vr(t,e,i){return{min:t,max:e}}Fb(t,e){const i=t.$b()?1:-1,s=t.Ub(),r=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}Cb(t,e){return t.He(e)}Ib(t,e,i,s){const r=this.Wb,n=t.$b()?1:-1,o=t.Ub(),h=(s.M-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end,c={x:a*u,y:l*u};e.$e({x:0,y:0}).Xe(c);const d={x:c.x+a*r.tickLength*t.Ui().x,y:c.y+l*r.tickLength*t.Ui().y};i.$e(c).Xe(d),e.Ye(r.gridStrokeStyle),i.Ye(r.tickStyle)}kb(t,e){const i=this.Wb,s=t.$b()?1:-1,r=t.Ub();let n,o=(e.M-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.Ui().x,l=Math.sin(o)*h*t.Ui().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Bb(t,e,i){const s=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;this.jm.Au(0).Xe(360).mu(0).gu(s+.5*e.getThickness()*t.Ui().x).vu(360).Re(_).Le(e)}Lb(t,e,i){const s=t.Ub(),r=this.kb(t,{M:0+s}),n=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;e.Za(r.alignment).sr(r.rotation).Wa(r.offset.x,r.offset.y).Ve(yi({x:n,y:0},r.padding))}Yb(){this.ar({qe:[],th:[{rh:"Radial ticks",Jg:0,je:this.Wb,Ze:this.Gb,Hr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Nb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},zh:{wr:()=>{},Vh:()=>!1},Xr:void 0}],ih:Jl,sh:void 0,eh:void 0})}}const Jl=(t,e,i)=>(180*t/Math.PI).toFixed(0),Ql={Pr:()=>{},Dr:()=>{},Lr:()=>{},vb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,q:(t,e)=>{},ut:(e,i,s,r,n)=>t.x.ut(e,i,s,r,n)}),Sb:t=>t.radial},tu=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),eu=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class iu extends is{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Cs="Sector",this.jb=0,this.Zb=1*Math.PI/2,this.Qb=void 0,this.Jb=void 0,this.Rs=t,this._b=s,this.zy=this.Rs.ud(this._b).ds(this.getHighlight()),this.As(this.zy),this.Ie=r.polarSectorFillStyle,this.Pe=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.jb=_t(t,0,360),this.Rs.Ms(),this}getAngleStart(){return this.jb}setAngleEnd(t){return this.Zb=_t(t,0,360),this.Rs.Ms(),this}getAngleEnd(){return this.Zb}setAmplitudeStart(t){return this.Qb=t,this.Rs.Ms(),this}getAmplitudeStart(){return this.Qb}setAmplitudeEnd(t){return this.Jb=t,this.Rs.Ms(),this}getAmplitudeEnd(){return this.Jb}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.Rs.Ms(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}ze(){const t=this._b.zb(),e=180*this._b.Ub()/Math.PI,i=void 0!==this.Qb?_t(this.Qb,t.start,t.end):t.start,s=void 0!==this.Jb?_t(this.Jb,t.start,t.end):t.end,r=this._b.Eb()?i-t.start:t.start-i,n=this._b.Eb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this._b.$b()?1:-1,l=Math.abs(this.Zb-this.jb);this.zy.Au((this.jb-e)*a).Xe((this.Zb-e)*a).mu(100*o/h).gu(h).Re(this.Ie).Le(this.Pe).vu(Math.ceil(l/2))}Oe(t,e){t.ds(e),this.Rs.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}}class su extends is{constructor(){super(...arguments),this.yv=!0,this.pv=!0}setAutoScrollingEnabled(t){return this.yv=t,this.chart.cs.Ms(),this}getAutoScrollingEnabled(){return this.yv}Cv(){}ze(){}Pm(){}setCursorEnabled(t){return this.pv=t,this}getCursorEnabled(){return this.pv}Yp(){return this.getVisible()&&this.getCursorEnabled()}setCursorFormattingOverride(t){return this.Mv=t,this}getCursorFormattingOverride(){return this.Mv}}class ru extends su{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Rs=t,this.chart=e,this.scale=s}getAmplitudeMin(){return this.Kb?this.Kb.min:void 0}getAmplitudeMax(){return this.Kb?this.Kb.max:void 0}}const nu=(t,e)=>{const i=[],s=e.zb().start,r=e.zb().end,n=e.Eb(),o=e.$b()?1:-1,h=e.Ub(),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=_t(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},ou=t=>{const e={min:Ye,max:He};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},hu=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),au=(t,e)=>{let i=Ti(t);for(e.$b()||(i*=-1),i+=180*e.Ub()/Math.PI;i<0;)i+=360;i%=360;const s=gi(t),r=e.zb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Jn(r.start,r.end,s/n)}};class lu extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.Cs="Heatmap Series",this.qb=!0,this.Pv=!1,this.qd=()=>Ae(this.Ie);const h=this.chart.getSeries().length;this.Ie=ve(this.ts.polarHeatmapSeriesFillStyle||this.ts.heatmapGridSeriesFillStyle,h);const a=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-a)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:a,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.io=u,this.tM=t.iM(s,[],u).Re(this.Ie).ds(this.getHighlight()),this.As(this.tM);const c=Math.min(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep),d=Math.max(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep);this.Kb={min:c,max:d},this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=yt(s,this.chart.cs.At,this.scale),n=au(r,this.scale),o=ma(e)?this.tM.sM(n):this.tM.hd(n);if(!o)return;const h=nu([o],this.scale)[0];return{cursorPosition:{pointMarker:h,pointMarkerScale:this.scale,resultTable:h,resultTableScale:this.scale},series:this,angle:o.angle,amplitude:o.amplitude,intensity:o.cellValue,annulus:o.iAnnulus,sector:o.iSector,lut:j(this.Ie)?this.Ie.lut:void 0}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0,intensity:0,sector:0,annulus:0,lut:j(this.Ie)?this.Ie.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}invalidateIntensityValues(t){if(this.Pv&&this.chart.cs.Jn(Sh.Df),Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,sectors:"annuli"===this.io.dataOrder?t[0].length:t.length,annuli:"annuli"===this.io.dataOrder?t.length:t[0].length},i="annuli"===this.io.dataOrder?this.io.annuli:this.io.sectors,s="annuli"===this.io.dataOrder?this.io.sectors:this.io.annuli;if(e.x>i||e.y>s){if(!0===this.chart.CA.eo){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nHeatmap ${i}x${s}, input ${e.x}x${e.y}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${h}, input ${e.primary}x${e.secondary} starting at [${i},${r}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const a=Math.max(s-o,0),l=e.primary-a,u=Math.max(n-h,0),c=[];for(let e=0;e0?-u:void 0);if(0===(t={iSector:t.iSector,iAnnulus:t.iAnnulus,values:c}).values.length||0===t.values[0].length)return this}this.tM.VS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Rs.Ms(),this.Pv=!0,this}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.tM.Re(this.Ie),this.Rs.Ms(),this}getFillStyle(){return this.Ie}clear(){return this.tM.Ot(),this.Rs.Ms(),this}setIntensityInterpolation(t){return t=t||"disabled",this.tM.ES(t),this.Rs.Ms(),this}getIntensityInterpolation(){return this.tM.zS()}Av(){return this.yv&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}}class uu extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Line Series",this.eM=[],this.hM=!1,this.rM=!1,this.Su=ve(this.ts.polarLineSeriesStrokeStyle,n),this.nM=t.gm(s,void 0,[Za.UserSeries]).Ye(this.Su).ds(this.getHighlight()),this.As(this.nM)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=this.nM.oM(s);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,"show-nearest")))}setData(t){return 0!==this.eM.length&&this.chart.cs.Jn(Sh.Df),this.eM=hu(t),this.hM=!0,this.Kb=ou(this.eM),this.Rs.Ms(),this}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;return this.nM.Ye(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Su}setConnectDataAutomaticallyEnabled(t){return this.rM=t,this.Rs.Ms(),this}getConnectDataAutomaticallyEnabled(){return this.rM}Av(){return this.yv&&this.eM.length>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){if(this.hM||this.scale.aM()){const t=nu(this.eM,this.scale),e=ni(t);this.rM?(t.push({...t[0]}),this.nM.jl(!0)):this.nM.jl(!1),this.nM.Ot().ml(t).sa(e),this.hM=!1,this.nM.Os()}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su})}}class cu extends ru{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Cs="Point Line Series",this.eM=[],this.hM=!1,this.rM=!1,this.lM=3,this.ka=0,this.uM=e.PointShape.Circle,this.Ie=ve(this.ts.polarPointLineSeriesFillStyle,o),this.Su=ve(this.ts.polarPointLineSeriesStrokeStyle,o),this.nM=t.gm(r,void 0,[Za.UserSeries]).Ye(this.Su).ds(this.getHighlight()),this.As(this.nM),this.cM=t.Nv(r).Re(this.Ie).dl(this.uM).it(this.lM).ds(this.getHighlight()),this.As(this.cM)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=this.nM.oM(s);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.eM.length&&this.chart.cs.Jn(Sh.Df),this.eM=hu(t),this.hM=!0,this.Kb=ou(this.eM),this.Rs.Ms(),this}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;return this.nM.Ye(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Su}setPointFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;return this.cM.Re(e),this.Rs.Ms(),this}getPointFillStyle(){return this.Ie}setPointSize(t){return this.lM=t,this.cM.it(t),this.Rs.Ms(),this}getPointSize(){return this.lM}setPointShape(t){return this.uM=t,this.cM.dl(this.uM),this}getPointShape(){return this.uM}setPointRotation(t){return this.ka=t,this.cM.sr(t),this.Rs.Ms(),this}getPointRotation(){return this.ka}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Su})}setConnectDataAutomaticallyEnabled(t){return this.rM=t,this.Rs.Ms(),this}getConnectDataAutomaticallyEnabled(){return this.rM}Av(){return this.yv&&this.eM.length>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){if(this.hM||this.scale.aM()){const t=nu(this.eM,this.scale),e=ni(t);this.rM?(t.push({...t[0]}),this.nM.jl(!0)):this.nM.jl(!1),this.nM.Ot().ml(t).sa(e),this.cM.Ot().ml(t).sa(e),this.hM=!1,this.nM.Os(),this.cM.Os()}}Bs(){return this.ws||this.uM}}class du extends Fn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Jo=_e(),this.R=new r.Eventer,this.ji=!1,this.dM=s,this.fM=n,this.AM=o,this.gM=h,this.pM=a,this.Rs=t,this.scale=e,this.yM=i,this.ts=l}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}dispose(){return this.yM&&this.yM(this),this.Rs.cs.Ms(),this.R.emit("dispose",this),this.ji=!0,this}setVisible(t){return super.setVisible(t),this.AM(),this.Rs.cs.Ms(),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMouseInteractions(t){return this.gM(this,t),this}getMouseInteractions(){return this.pM(this)}}class fu extends du{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,y,p){super(t,e,i,s,r,n,o,h,p),this.mM=1,this.vM=1,this.Rs=t,this.scale=e,this.dimensionStrategy=a,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=y,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,y)),this.SM=this.ts.boxSeriesBodyFillStyle,this.xM=this.ts.boxSeriesBodyStrokeStyle,this.Su=this.ts.boxSeriesStrokeStyle,this.bM=this.ts.boxSeriesMedianStrokeStyle,this.Os()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.mM=t,this.Os(),this}getBodyWidth(){return this.mM}setBodyFillStyle(t){return this.SM="function"==typeof t?t(this.SM):t,this.fM(),this}getBodyFillStyle(){return this.SM}setBodyStrokeStyle(t){return this.xM="function"==typeof t?t(this.xM):t,this.fM(),this}getBodyStrokeStyle(){return this.xM}setTailWidth(t){return this.vM=t,this.Os(),this}getTailWidth(){return this.vM}setStrokeStyle(t){return this.Su="function"==typeof t?t(this.Su):t,this.fM(),this}getStrokeStyle(){return this.Su}setMedianStrokeStyle(t){return this.bM="function"==typeof t?t(this.bM):t,this.fM(),this}getMedianStrokeStyle(){return this.bM}Os(){this.dM()}getDominantStyle(){return this.getBodyFillStyle()}}class gu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Ls=!0,this.ss=new Map,this.chart=t,this.Rs=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.MM=h,this.scale=Xi(s.At,r.At),this._M=t.wM,t.wM+=1,this.CM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.kM),this.onMouseLeave(this.chart.TM),this.onMouseWheel(this.chart.vv),this.onMouseDragStart(this.chart.FM),this.onMouseDrag(this.chart.Sv),this.onMouseDragStop(this.chart.xv),this.onTouchStart(this.chart.bv.onTouchStart),this.onTouchMove(this.chart.bv.onTouchMove),this.onTouchEnd(this.chart.bv.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}la(){const t=Array.from(this.ss.keys());for(const e of t){const t=e.la();if(t)return t}}setClipping(t){return this.Ls=t,this.Rs.Ms(),this}getClipping(){return this.Ls}attacheAxis(){this.IM=this.axisXAttachHandler(this),this.PM=this.axisYAttachHandler(this)}As(t,e){super.As(t,e),t.ua(this._M)}getName(){const t=this.fs(),e="ProgressiveY"===t||"RegressiveY"===t?this.axisX.getTitle():this.axisY.getTitle();return this.Cs||e.length>0&&e||"Series"}setDrawOrder(t){return this._M=t.seriesDrawOrderIndex,this.ss.forEach(((t,e)=>{e.ua(this._M)})),this.chart.cs.Ms(),this}dispose(){return super.dispose(),this.IM(this),this.PM(this),this}Pm(){super.Pm(),qi(this.Ls,Array.from(this.ss.keys()),this.scale)}getBoundaries(){return m(u(this.getXMin()||0,this.getYMin()||0),u(this.getXMax()||0,this.getYMax()||0))}setCursorEnabled(t){return super.setCursorEnabled(t)}}const mu=(t,e,i,s)=>{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 e=this.DM.findIndex((e=>e===t));e>=0&&this.DM.splice(e,1),this.LM=!0,this.BM=void 0,this.Rs.Ms()},this.dM=()=>{this.BM=void 0,this.LM=!0,this.chart.cs.Ms()},this.fM=()=>{this.LM=!0,this.chart.cs.Ms()},this.AM=()=>{this.BM=void 0,this.LM=!0,this.chart.cs.Ms()},this.gM=(t,e)=>{this.setMouseInteractions(e)},this.RM=t=>this.getMouseInteractions()}ze(){super.ze(),this.LM&&(this.EM(this.DM),this.LM=!1)}clear(){return this.DM.slice().forEach(Pt),this.DM.length=0,this.LM=!0,this.BM=void 0,this.Rs.Ms(),this}zM(t,e){void 0!==e?this.DM.splice(e,0,t):this.DM.push(t),this.LM=!0,this.VM&&this.VM(t),t.onMouseEnter(((t,e)=>this._t(t,e,void 0,{}))),t.onMouseLeave(((t,e)=>this.wt(t,e,void 0))),t.onMouseClick(((t,e)=>this.Ct(t,e,void 0,{}))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e,void 0,{}))),t.onMouseDown(((t,e)=>this.Tt(t,e,void 0,{}))),t.onMouseUp(((t,e)=>this.Ft(t,e,void 0,{}))),t.onMouseMove(((t,e)=>this.It(t,e,void 0,{}))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i,void 0,{}))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r,void 0,{}))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s,void 0,{}))),t.onMouseWheel(((t,e)=>this.Lt(t,e,void 0,{}))),t.onTouchStart(((t,e)=>this.Rt(t,e,void 0,{}))),t.onTouchMove(((t,e)=>this.Et(t,e,void 0,{}))),t.onTouchEnd(((t,e)=>this.zt(t,e,void 0,{}))),this.Rs.Ms()}Av(){return this.yv&&this.DM.length>0&&this.getVisible()}setDefaultStyle(t){this.VM=t,this.DM.forEach(t),t(this.OM);for(let t=0;t0?this.DM[0].getDominantStyle():this.OM.getDominantStyle()})}}const Au=(t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i0?e:0,this.Rs.Ms(),this}add(t){if(0!==this.GM.length&&this.chart.cs.Jn(Sh.Df),Array.isArray(t)?this.YM(t):this.YM([t]),this.Tu.length>0){const t=this.Tu[this.Tu.length-1];this.HM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.HM?this.HM.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.vl()+e.Sl()),this.Tu.length)}clear(){this.XM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.WM.getXMax(this.GM,this.XM)||0}getXMin(){return this.WM.getXMin(this.GM,this.XM)||0}getYMax(){return this.WM.getYMax(this.GM,this.XM)||0}getYMin(){return this.WM.getYMin(this.GM,this.XM)||0}Lr(){const t=u(0,0);for(const e of this.GM)t.x=Math.max(t.x,e.Pl()),t.y=Math.max(t.y,e.Dl());return t}$M(t,e,i,s){this.WM.$M(t,e,i,s,this.scale,(t=>{}))}Cv(){super.Cv(),this.jM&&this.$M(this.GM,this.getPointAmount(),this.jM,this.UM)}ze(){super.ze();const t=this.getBoundaries();this.Tu.length>0&&(this.ZM(this.Tu),this.Tu=[]);for(const e of this.GM)e.sa(t);return super.ze()}Pm(){super.Pm(),this.XM=void 0,this.Tu.length=0}YM(t){0!==t.length&&(this.XM?this.XM=hi(this.XM,ni(t)):this.XM=ni(t),this.R.emit("dataAdd",this,t,this.XM),this.Tu=fe(this.Tu,t,{canReturnB:!1}),this.Rs.Ms())}QM(){return yu(this.GM)}JM(t){return this.R.on("dataAdd",t)}KM(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}t_(t){return this.R.off(t)}}const Su=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;hyt(this.Es.toPoint((t.start+t.end)/2,t.median),this.scale,this.Rs.cs.At),this.chart.cs.Jn(Sh.If),this.Es=a,this.OM=new fu(this.Rs,this.scale,this.yM,Ot,Ot,Ot,Ot,(t=>!1),this.Es,0,0,0,0,0,0,0,this.ts).dispose(),this.e_=new sl((()=>{const t=this.Rs.Qg(this.scale);return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ye(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Kg(e.start,e.end),i}))))),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],start:r[1].start,end:r[1].end,lowerExtreme:r[1].lowerExtreme,lowerQuartile:r[1].lowerQuartile,median:r[1].median,upperQuartile:r[1].upperQuartile,upperExtreme:r[1].upperExtreme,series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,median:0,lowerQuartile:0,upperQuartile:0,lowerExtreme:0,upperExtreme:0,start:0,end:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){if(!(t instanceof Yi||t instanceof Hi))throw new Error("BoxSeries only supports Linear Axes")}EM(t){const e=this.h_.Dm(),i=this.e_.Dm();t.forEach((t=>{if(!t.getVisible())return;const s=this.Es.toPoint((t.start+t.end-t.mM*(t.end-t.start))/2,t.lowerQuartile),r=this.Es.toPoint((t.end-t.start)*t.mM,t.upperQuartile-t.lowerQuartile),n=this.Es.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Es.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Es.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Es.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Es.toPoint((t.start+t.end-t.vM*(t.end-t.start))/2,t.lowerExtreme),u=this.Es.toPoint((t.start+t.end+t.vM*(t.end-t.start))/2,t.lowerExtreme),c=this.Es.toPoint((t.start+t.end-t.vM*(t.end-t.start))/2,t.upperExtreme),d=this.Es.toPoint((t.start+t.end+t.vM*(t.end-t.start))/2,t.upperExtreme),f=this.Es.toPoint((t.start+t.end-t.mM*(t.end-t.start))/2,t.median),g=this.Es.toPoint((t.start+t.end+t.mM*(t.end-t.start))/2,t.median);e.add({Jo:t.Jo,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+r.y},{x:s.x+r.x,y:s.y+r.y},{x:s.x+r.x,y:s.y}],figure:t},{fillStyle:t.SM,strokeStyle:t.xM}),i.add({Jo:0,start:n,end:o,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:h,end:a,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:l,end:u,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:c,end:d,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:f,end:g,figure:t},{strokeStyle:t.bM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new fu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.Es,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.ts);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class bu extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.el=m(u(0,0),u(0,0)),this.Rs=t,this.scale=e,this.Ie=ve(a.ellipseSeriesFillStyle,l),this.Pe=ve(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return this.dimensions=t,this.el=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.dM(),this.Rs.Ms(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.fM(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){return this.Ie}}class Mu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Ellipse Series",this.i_=Oe(),this.s_=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new bu(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,radiusX:0,radiusY:0,drawSteps:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){if(!(t instanceof Yi||t instanceof Hi))throw new Error("EllipseSeries only supports Linear Axes")}EM(t){const e=this.h_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],r=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=r;t+=1){const e=t/r*2*Math.PI,n=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:n,y:o})}const n=t.getFillStyle(),o=t.getStrokeStyle();e.add({Jo:t.Jo,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new bu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class Cu extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.n_=[],this.el=Xe,this.Rs=t,this.scale=e,this.Ie=ve(a.polygonSeriesFillStyle,l),this.Pe=ve(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return this.n_=t,this.el=ni(this.n_),this.dM(),this.Rs.Ms(),this}getDimensions(){return this.n_}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.fM(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){return this.Ie}}class Tu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Polygon Series",this.i_=Oe(),this.s_=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new Cu(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],coordinates:r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,coordinates:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){}EM(t){const e=this.h_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Jo:t.Jo,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new Cu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class wu extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.o_={x:0,y:0,width:0,height:0},this.a_={x1:0,y1:0,x2:0,y2:0},this.el=m(u(0,0),u(0,0)),this.Ie=ve(a.rectangleSeriesFillStyle,l),this.Rs=t,this.scale=e,this.Pe=ve(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return"x"in t?(this.o_=t,this.a_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.a_=t,this.o_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.el=ni([this.o_,u(this.o_.x+this.o_.width,this.o_.y+this.o_.height)]),this.dM(),this.Rs.Ms(),this}getDimensionsPositionAndSize(){return this.o_}getDimensionsTwoPoints(){return this.a_}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.fM(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){return this.Ie}}class Eu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Rectangle Series",this.i_=Oe(),this.s_=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new wu(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensionsPositionAndSize(),...r[1].getDimensionsTwoPoints(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,x1:0,y1:0,x2:0,y2:0,width:0,height:0,multiHit:0,figure:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){}EM(t){const e=this.h_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensionsTwoPoints(),s=[{x:i.x1,y:i.y1},{x:i.x1,y:i.y2},{x:i.x2,y:i.y2},{x:i.x2,y:i.y1}],r=t.getFillStyle(),n=t.getStrokeStyle();e.add({Jo:t.Jo,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new wu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class ku extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.el=m(u(0,0),u(0,0)),this.ts=a,this.Rs=t,this.scale=e,this.Pe=ve(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return this.dimensions=t,this.el=m(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.dM(),this.Rs.Ms(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){const t=this.Pe;return t!==ut?t.getFillStyle():_}}class Iu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Segment Series",this.l_=Oe(),this.s_=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new ku(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.e_=new sl((()=>{const t=this.l_.Mt(this.Rs.Qg(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ye(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Kg(e.start,e.end),this.l_.Vt(i,e.figure),i})))),(()=>{this.l_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,startX:0,startY:0,endX:0,endY:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){}EM(t){const e=this.e_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},r={x:i.endX,y:i.endY},n=t.getStrokeStyle();e.add({Jo:t.Jo,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new ku(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class zu extends gu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Cs="Heatmap Grid Series",this.TS={},this.chart.cs.Jn(Sh.Ff),this.u_=a,this.ts=l;const d=c;this.Ie=ve(l.heatmapGridSeriesFillStyle,d),this.FS=ve(this.ts.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.io=f,this.c_=this.Rs.d_(this.scale,[],f).Re(this.Ie).IS(this.FS).ds(this.getHighlight()),this.As(this.c_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=yt(s,this.Rs.cs.At,this.scale),n=ma(e)?this.c_.sM(r):this.c_.hd(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:j(this.Ie)?this.Ie.lut:void 0}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,intensity:0,column:0,row:0,lut:j(this.Ie)?this.Ie.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}DS(){const t=this.TS.start||{x:0,y:0};let e;e=this.TS.end?{x:(this.TS.end.x-t.x)/this.io.columns,y:(this.TS.end.y-t.y)/this.io.rows}:this.TS.step?this.TS.step:{x:1,y:1},this.c_.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.c_.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.c_.LS().step}setEnd(t){return this.TS.end=t,this.DS(),this}getEnd(){return this.c_.LS().end}clear(){return this.c_.Ot(),this.Rs.Ms(),this.R.emit("dataClear",this),this}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.c_.IS(this.FS),this.Rs.Ms(),this.R.emit("styleChange",this),this}getWireframeStyle(){return this.FS}setIntensityInterpolation(t){return t=t||"disabled",this.c_.ES(t),this.Rs.Ms(),this.R.emit("styleChange",this),this}getIntensityInterpolation(){return this.c_.zS()}Av(){return this.yv&&this.getVisible()}qd(){return Ae(this.Ie)}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}f_(t){this.c_.f_().forEach((e=>{t.c_.VS(e)}))}t_(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}A_(t){return this.R.on("styleChange",t)}g_(t){return this.R.off(t)}getXMax(){const t=this.c_;return t?t.St():void 0}getXMin(){const t=this.c_;return t?t.vt():void 0}getYMax(){const t=this.c_;return t?t.bt():void 0}getYMin(){const t=this.c_;return t?t.xt():void 0}Lr(){const t=u(0,0);return t.x=Math.max(t.x,this.c_.Pl()),t.y=Math.max(t.y,this.c_.Dl()),t}CM(t){if(!(t instanceof Yi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Yi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){return super.ze(),this.c_.sa(this.getBoundaries()),this}}class Fu extends zu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.Pv=!1}invalidateIntensityValues(t){if(this.Pv&&this.chart.cs.Jn(Sh.Df),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.io.dataOrder?t.length:t[0].length,rows:"rows"===this.io.dataOrder?t.length:t[0].length},i="columns"===this.io.dataOrder?this.io.columns:this.io.rows,s="columns"===this.io.dataOrder?this.io.rows:this.io.columns;if(e.x>i||e.y>s){if(!0===this.chart.CA.eo){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(i)}const i=Math.max(s-o,0),r=e.primary-i,a=Math.max(n-h,0),l=[];for(let e=0;e0?-a:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.c_.VS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.R.emit("invalidateIntensity",this,t),this.Rs.Ms(),this.Pv=!0,this}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.c_.Re(this.Ie),this.R.emit("styleChange",this),this.Rs.Ms(),this}getFillStyle(){return this.Ie}p_(t){return this.R.on("invalidateIntensity",t)}y_(t){return this.R.off(t)}}class Ru extends gu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Cs="Scrolling Heatmap Grid Series",this.TS={},this.chart.cs.Jn(Sh.Ff),this.chart.cs.Jn(Sh.Df);const d=c;this.Ie=ve(l.heatmapScrollingGridSeriesFillStyle,d),this.FS=ve(this.ts.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.io=f,this.m_=this.Rs.v_(this.scale,[],f).Re(this.Ie).IS(this.FS).ds(this.getHighlight()),this.As(this.m_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=yt(s,this.Rs.cs.At,this.scale),n=ma(e)?this.m_.sM(r):this.m_.hd(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:j(this.Ie)?this.Ie.lut:void 0}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,intensity:0,multiHit:0,column:0,row:0,lut:j(this.Ie)?this.Ie.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}DS(){const t=this.TS.start||{x:0,y:0};let e;e=this.TS.step?this.TS.step:{x:1,y:1},this.m_.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.m_.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.m_.LS().step}clear(){return this.m_.Ot(),this.Rs.Ms(),this}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.m_.IS(this.FS),this.Rs.Ms(),this}getWireframeStyle(){return this.FS}setPixelInterpolationMode(t){return t=t||"disabled",this.m_.ES(t),this.Rs.Ms(),this}getPixelInterpolationMode(){return this.m_.zS()}setDataCleaning(t){return this.m_.Iu(t),this.Rs.Ms(),this}Av(){return this.yv&&this.getVisible()}qd(){return Ae(this.Ie)}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}Re(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.m_.Re(this.Ie),this.Rs.Ms(),this}CM(t){if(!(t instanceof Yi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Yi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.m_.St()||0}getXMin(){return this.m_.vt()||0}getYMax(){return this.m_.bt()||0}getYMin(){return this.m_.xt()||0}Lr(){const t=u(0,0);return t.x=Math.max(t.x,this.m_.Pl()),t.y=Math.max(t.y,this.m_.Dl()),t}Oe(t,e){t.ds(e),this.Rs.Ms()}}class Du extends Ru{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c)}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.io.scrollDimension?t.length:t[0].length,"rows"===this.io.scrollDimension?t.length:t[0].length,0+i-1),r=this.io.resolution-1;if(s>r){if(!0===this.chart.CA.eo){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.io.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const s=[];for(let i=0;i{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.slice()},this.M_=[],this.__=[],this.w_=!1,this.C_=(t,e)=>{const i=t.oM(e);if(i)return[yt(i[0],this.scale,this.Rs.cs.At),yt(i[1],this.scale,this.Rs.cs.At)]},this.k_=(t,e)=>{const i=t.T_(e);if(i)return[yt(i[0],this.scale,this.Rs.cs.At),yt(i[1],this.scale,this.Rs.cs.At)]},this.qd=()=>Ae(this.F_)||Ae(this.I_),this.P_=t=>{const e=t.length;if(this.GM.length>0){const i=this.GM.length-1,s=this.GM[i];if(e>0){const[e,i]=s.cl(),[r,n]=s.ul();if((r?e.length+r.length:e.length)>=this.jM){const o=r&&r.length>0?r[r.length-1]:e[e.length-1],h=n&&n.length>0?n[n.length-1]:i[e.length-1],a=(o.x+t[0].position)/2,l=bi(a,o,u(t[0].position,t[0].high)).y,c=bi(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.ml(f,m(u(a,c),u(a,l))).jl(!0),this.D_([f].concat(t)).Xl(!0)}else s.ml(t)}}else e>0&&this.D_(t)},this.B_=t=>{const e=this.M_,i=t.length;if(this.M_.length>0){if(i>0){const i=e[e.length-1],s=i.cl(),r=i.ul();if(s.length+r.length>=this.jM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=bi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ml(a,m(u(o,h),u(o,h))).jl(!0),e.push(this.L_([a].concat(t),this.XM).Xl(!0))}else i.ml(t)}}else i>0&&e.push(this.L_(t))},this.R_=t=>{const e=this.__,i=t.length;if(this.__.length>0){if(i>0){const i=e[e.length-1],s=i.cl(),r=i.ul();if(s.length+r.length>=this.jM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=bi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ml(a,m(u(o,h),u(o,h))).jl(!0),e.push(this.E_([a].concat(t)).Xl(!0))}else i.ml(t)}}else i>0&&e.push(this.E_(t))}}fs(){return"ProgressiveX"}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.UM=void 0!==e&&e>0?e:0,this.Rs.Ms(),this}clear(){for(let t=0;tt+e.vl()+e.Sl()),this.Tu.length)}getXMax(){return $t(this.GM,Nt,Math.max,Xt,this.XM)||0}getXMin(){return $t(this.GM,Gt,Math.min,Ht,this.XM)||0}getYMax(){return $t(this.GM,Yt,Math.max,jt,this.XM)||0}getYMin(){return $t(this.GM,Ut,Math.min,Wt,this.XM)||0}Lr(){const t=u(0,0);for(const e of this.GM)t.x=Math.max(t.x,e.Pl()),t.y=Math.max(t.y,e.Dl());return t}Av(){return this.yv&&this.getPointAmount()>0&&this.getVisible()}CM(t){}YM(t,e,i){this.Tu=fe(this.Tu,t,{canReturnB:!1}),this.x_=fe(this.x_,e,{canReturnB:!1}),this.b_=fe(this.b_,i,{canReturnB:!1}),this.Rs.Ms()}z_(t,e,i,s){this.V_(e,i,s),this.YM(Array.isArray(t)?t:[t],e,i)}V_(t,e,i){const s=hi(ni(t),ni(e));this.XM?this.XM=hi(this.XM,s):this.XM=s,i&&(this.XM=hi(this.XM,i))}O_(){const t=this.GM.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const r=Math.ceil(i/e),n=t.length-r;if(n>0&&s>0){const e=n-s>0?s:n;if(e>0){for(let i=0;i0?this.GM[this.GM.length-1]:void 0,i=e?e.cl()[0].length+(e.ul()[0]?e.ul()[0].length:0):void 0;mu(t,i,this.jM,this.P_)}G_(t){const e=this.M_.length>0?this.M_[this.M_.length-1].cl().length+this.M_[this.M_.length-1].ul().length:void 0;mu(t,e,this.jM,this.B_)}U_(t,e){const i=this.M_.length>0?this.M_[this.M_.length-1].cl().length+this.M_[this.M_.length-1].ul().length:void 0;mu(t,i,this.jM,this.B_),mu(e,i,this.jM,this.R_)}D_(t,e){const i=this.Rs.W_(this.scale).ml(t,e).Re(this.F_).Yl(this.I_).Ul(this.Rl).ds(this.getHighlight());return this.GM.push(i),this.As(i),i}Y_(t,e,i){const s=this.Rs.gm(this.scale,void 0,[Za.UserSeries]).ml(t,i).setMouseInteractions(!1).Ye(e).ds(this.getHighlight());return this.As(s),s}L_(t,e){return this.Y_(t,this.H_,e)}E_(t,e){return this.Y_(t,this.X_,e)}j_(t){this.F_="function"==typeof t?t(this.F_):t;const e=this.F_;for(let t=0;t0){const t=this.O_();this.$M(this.GM,this.jM,this.UM,t),this.M_.length>0&&this.$M(this.M_,this.jM,this.UM,t),this.__.length>0&&this.$M(this.__,this.jM,this.UM,t),this.w_=!0}}ze(){if(super.ze(),this.Tu.length>0&&(this.N_(this.Tu),this.sw(this.x_,this.b_),this.w_=!0),this.w_){const t=this.getBoundaries();for(const e of this.GM)e.sa(t);for(const e of this.M_)e.sa(t);for(const e of this.__)e.sa(t)}}Pm(){super.Pm(),this.XM=void 0,this.Tu.length=0,this.x_.length=0,this.b_.length=0}}class Lu extends Ou{constructor(t,e,i,s,r,n,o,h,a=0,l,u){super(t,e,i,s,r,n,o,h,l,u),this.chart.cs.Jn(Sh.Tf),this.ew=a}add(t){0!==this.GM.length&&this.chart.cs.Jn(Sh.Df);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.hw(e),[i,s]=this.rw(t);this.z_(t,i,s,m(u(Ye,this.ew),u(He,this.ew)));const r=this.Tu[this.Tu.length-1];this.HM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.XM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.HM?this.HM.position+e:0),this.add(Au(t,e,s)),this}JM(t){return this.R.on("dataAdd",t)}KM(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}t_(t){return this.R.off(t)}}class _u extends Lu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u);const c=t.getSeries().length;this.F_=ve(this.ts.areaSeriesBipolarHighFillStyle,c),this.H_=ve(this.ts.areaSeriesBipolarHighStrokeStyle,c),this.I_=ve(this.ts.areaSeriesBipolarLowFillStyle,c),this.X_=ve(this.ts.areaSeriesBipolarLowStrokeStyle,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Pu(s,this.GM,ma(e)?this.k_:this.C_);if(void 0!==r&&void 0!==r[0]){const t=yt(r[0][0],this.Rs.cs.At,this.scale),e=yt(r[0][1],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}hw(t){return this.nw(t)}sw(t,e){return this.U_(t,e)}nw(t){let e=0;const i=[],s=t.length,r=this.ew;return s>0&&(this.ow&&(this.ow.y<=r&&r<=t[0].y||this.ow.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.ow.x+t[0].x),r,r),e+=1),this.ow=t[s-1],1===s?this.aw(t[0],i,e):this.lw(t,i)),i}aw(t,e,i=0){return e[i]=d(t.x,t.y,this.ew),i+1}lw(t,e){let i=0,s=0;const r=t.length-1,n=this.ew;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Jn(r.x,o.x,(h-t)/(s-t));e[i]=d(a,n,n),i+=1}e[i]=d(o.x,o.y,n),i+=1}return i}rw(t){const e=t.length,i=Array(e),s=Array(e),r=this.ew;for(let n=0;nr?(i[n]=u(e.position,e.high),s[n]=u(e.position,r)):e.hight[0]))}setPositiveFillStyle(t){return this.j_(t),this}setNegativeFillStyle(t){return this.Z_(t),this}setPositiveStrokeStyle(t){return this.J_(t),this}setNegativeStrokeStyle(t){return this.K_(t),this}getPositiveFillStyle(){return this.Q_()}getNegativeFillStyle(){return this.Hl()}getPositiveStrokeStyle(){return this.q_()}getNegativeStrokeStyle(){return this.tw()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.F_,fill2:this.I_,behavior:{colorStep:!0}})}}class Bu extends Lu{constructor(){super(...arguments),this.X_=ut}sw(t){return this.G_(t)}rw(t){const e=t.length,i=Array(e);for(let s=0;ss?d(t.x,s,s):d(t.x,t.y,s),i+1}lw(t,e,i=0){let s=0;const r=t.length-1,n=this.ew;for(;sn){const t=Ei(u(He,n),u(Ye,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,n,n),i+=1}else e[i]=d(o.x,o.y,n),i+=1}else{const t=d(r.x,n,n);if(0!==i&&Zt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=Ei(u(He,n),u(Ye,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}QM(){return yu(this.GM,(t=>t[1]))}setFillStyle(t){return this.Z_(t),this}getFillStyle(){return this.Hl()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.I_,stroke:this.H_})}}class Gu extends Bu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u);const d=c;this.F_=ve(this.ts.areaSeriesPositiveFillStyle,d),this.I_=_,this.H_=ve(this.ts.areaSeriesPositiveStrokeStyle,d)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Pu(s,this.GM,ma(e)?this.k_:this.C_);if(void 0!==r&&void 0!==r[0]){const t=yt(r[0][0],this.Rs.cs.At,this.scale),e=yt(r[0][1],this.Rs.cs.At,this.scale),i=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Zt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=Ei(u(He,n),u(Ye,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}QM(){return yu(this.GM,(t=>t[0]||[]))}setFillStyle(t){return this.j_(t),this}getFillStyle(){return this.Q_()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.F_,stroke:this.H_})}}const Nu={Positive:Gu,Negative:Vu,Bipolar:_u};class Uu extends Ou{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.chart.cs.Jn(Sh.Tf);const c=u;this.F_=ve(this.ts.areaRangeSeriesFillStyle,c),this.H_=ve(this.ts.areaRangeSeriesStrokeStyle,c),this.I_=ve(this.ts.areaRangeSeriesFillStyleInverted,c),this.X_=ve(this.ts.areaRangeSeriesStrokeStyleInverted,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Pu(s,this.GM,ma(e)?this.k_:this.C_);if(void 0!==r&&void 0!==r[0]){const t=yt(r[0][0],this.Rs.cs.At,this.scale),e=yt(r[0][1],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.z_(t,i,s);const r=this.Tu[this.Tu.length-1];return this.HM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.XM),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let r=s;r||(r=this.HM?this.HM.position+i:0),this.add(((t,e,i=1,s)=>{const r=void 0!==s?s:0,n=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],r=e.length;for(let t=0;t{const i=[],s=t.length,r=e;if(s>0){let e=0,n=t[0];i[e]=n,e+=1;for(let o=1;o{const i=t*t,s=i*t,r=1-t,n=r*r,o=n*r;return u(o*e[0].x+3*t*n*e[1].x+3*i*r*e[2].x+s*e[3].x,o*e[0].y+3*t*n*e[1].y+3*i*r*e[2].y+s*e[3].y)},Wu=(t,e=32)=>{if(2===t.length)return[t[0],t[1]];const i=(t=>{const e=1e-5,i=t.length-1,s=Array(i);if(i>1){let r=u(0,0),n=u(0,0),o=u(0,0),h=di(pi(t[1],t[0]));const a=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(a*r.x)):1,c=Math.abs(n.x)>e?Math.abs(i/(a*n.x)):1}f[1]=yi(mi(r,l),f[1]),f[2]=pi(f[2],mi(n,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,r=Array(s*e);let n=0;for(let t=0;t{const i=t.hd(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.gw=(t,e)=>{const i=t.T_(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.pw=t=>{if(this.GM.length>0){const e=this.GM[this.GM.length-1];if(t.length>0){const i=e.cl(),s=e.ul(),r=i.length+s.length-+e.$l();if(r>=this.jM){const n=s.length>0?s[s.length-1]:i[e.$l()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.ml(o,m(u(o.x,o.y),u(o.x,o.y))).jl(!0),this.yw([o].concat(t)).Xl(!0)}else e.ml(t,this.XM)}}else t.length>0&&this.yw(t)},this.mw=t=>{if(this.fw.length>0){const e=this.fw[this.fw.length-1];t.length>0&&((e.cl().length+e.ul().length)*this.dw>=this.jM?this.Sw(t):e.ml(t))}else t.length>0&&this.Sw(t)},this.io=y,this.uM=l,this.xw=f,this.bw=ve(c.pointLineSeriesFillStyle,g),this.Su=ve(this.ts.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}QM(){return yu(this.fw)}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;for(let t=0;te.setVisible(t))),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.GM.length)return;const r=this.GM[0].qo()||Jr.NearestX,n=ma(e)?Su(s,this.GM,this.gw,r===Jr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Jr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):Su(s,this.fw,this.Aw,r===Jr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Jr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=yt(n[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}qd(){return Ae(this.bw)||Ae(this.Su.getFillStyle())}Bs(){return this.ws||this.uM}CM(t){}Oe(t,e){t.ds(e),this.Rs.Ms()}ZM(t){const e=this.GM.length>0?this.GM[this.GM.length-1].cl().length+this.GM[this.GM.length-1].ul().length-+this.GM[this.GM.length-1].$l():void 0;mu(t,e,this.jM,this.pw),mu(t,e,this.jM,this.mw)}Sw(t,e){const i=this.Rs.Nv(this.scale).ml(t,e).setMouseInteractions(this.Xi).Re(this.bw).dl(this.uM).it(this.lM).sr(this.ka).Al(this.tl).pl(this.il).yl(this.sl).ds(this.getHighlight());return this.As(i),this.fw.push(i),i}yw(t,e){const i=this.Rs.gm(this.scale,void 0,[Za.UserSeries,...this.xw]).ml(t,e).setMouseInteractions(this.Xi).Ye(this.Su).ds(this.getHighlight());return this.As(i),this.GM.push(i),i}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su,fill:this.bw})}getPointAmount(){return this.fw.reduce(((t,e)=>t+e.vl()+e.Sl()),this.Tu.length)}clear(){super.clear();for(let t=0;t{}))}}const $u=(t,e)=>t.ul().length>=e?t.ul().slice(-e):Array.prototype.concat(t.cl(),t.ul()).slice(-e),Zu=(t,e,i)=>{const s=Array.prototype.concat(t.cl(),t.ul()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ot().ml(s).Os()};class qu extends ju{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g){super(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g),this.dw=32,this.jM=8e3,this.Mw=t=>{if(0===t.length)return;const e=this.fw.length;if(e>0){const i=e>1,s=this.fw[e-1];if(i){const i=Array.prototype.concat(s.cl(),s.ul()),r=i.length;if(32*r>=this.jM){const i=$u(s,3),r=Array.prototype.concat(i,t),n=Wu(r,32);Zu(this.GM[e-1],n,32),this.yw(n.slice(66))}else if(r<5){const s=this.fw[e-2],r=$u(s,3),n=Array.prototype.concat(r,i,t),o=Wu(n,32),h=this.GM[e-1],a=o.slice(66);h.Ot().ml(a).Os()}else{const i=this.GM[e-1],r=Array.prototype.concat(i.cl(),i.ul()),n=$u(s,4),o=Array.prototype.concat(n,t),h=Wu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ot().ml(a).Os()}}else{const i=Array.prototype.concat(s.cl(),s.ul()),r=i.length,n=this.GM[e-1];if(32*r>=this.jM){const e=$u(s,3),i=Array.prototype.concat(e,t),r=Wu(i,32);Zu(this.GM[0],r,32),this.yw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=Wu(e,32);n.Ot().ml(s).Os()}else n.ml(t)}}else{const e=t.length>0?Wu(t,32):t,i=ni(e);this.yw(e,i)}this.mw(t)}}ZM(t){const e=this.fw.length,i=this.fw.length>0?this.fw[e-1].cl().length+this.fw[e-1].ul().length:void 0;mu(t,i,Math.ceil(this.jM/this.dw),this.Mw)}}class Ku{constructor(){this.Gi="FreeformPattern",this.Rl={type:"disabled",packager:(t,e,i)=>t.slice()}}$M(t,e,i,s,r,n){if(s>0){const r=Math.trunc((e-s)/i);if(r>0&&t.length>1){const e=t.splice(0,r);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},Qu=s.Record({Rl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class tc extends Qu{$M(t,e,i,s,r,n){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.O_(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.xt();return t?Math.min(i,t):i},ic=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class sc extends tc{_w(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(ic,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(ec,e?e.min.y:void 0)}}const rc=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},nc=(t,e)=>{const i=e.St();return t?Math.max(i,t):i};class oc extends tc{_w(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(nc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(rc,e?e.min.x:void 0)}}const hc={horizontalProgressive:new class extends sc{constructor(){super({Rl:Hr()}),this.Gi="HorizontalProgressivePattern"}O_(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].St():void 0}getXMin(t=[],e){return t.length>0&&t[0].vl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Hr(Ju(t)))}},horizontalRegressive:new class extends sc{constructor(){super({Rl:Xr()}),this.Gi="HorizontalRegressivePattern"}O_(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].vl()>0?t[0].St():e?e.max.x:void 0}getXMin(t=[],e){return void 0!==e?e?e.min.x:void 0:t.length>0?t[t.length-1].vt():void 0}setPrecision(t){return this.set("_columnPackaging",Xr(Ju(t)))}},verticalProgressive:new class extends oc{constructor(){super({Rl:Wr()}),this.Gi="VerticalProgressivePattern"}O_(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getYMin(t=[],e){return t.length>0&&t[0].vl()>0?t[0].xt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Wr(Ju(t)))}},verticalRegressive:new class extends oc{constructor(){super({Rl:jr()}),this.Gi="VerticalRegressivePattern"}O_(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].vl()>0?t[0].bt():e?e.max.y:void 0}getYMin(t=[],e){return void 0!==e?e?e.min.y:void 0:t.length>0?t[t.length-1].xt():void 0}setPrecision(t){return this.set("_columnPackaging",jr(Ju(t)))}},freeform:new Ku};class ac extends ju{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,y){super(t,e,i,s,r,n,o,h,hc.horizontalProgressive,a,c,d,f,g,y),this.pw=t=>{const e=this.GM.length>0?this.GM[this.GM.length-1].cl().length+this.GM[this.GM.length-1].ul().length:void 0;mu(t,e,this.jM,this.ww)},this.ww=t=>{const e=t.length;if(this.GM.length>0){const i=this.GM[this.GM.length-1];if(e>0){const e=i.cl(),s=i.ul(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Hu([r].concat(t),this.Cw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.jM?(i.ml(o,m(u(o.x,o.y),u(o.x,o.y))).jl(!0),this.yw(h).Xl(!0),this.Sw(t)):i.ml(h)}}else e>0&&this.yw(Hu(t,this.Cw));this.mw(t)},this.Cw=l,void 0===this.xw.find((t=>"DataPattern"===t.type))&&this.xw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class lc extends gu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.kw=t=>t[4]>=t[1],this.BM=m(c(Ye,Ye),c(He,He)),this.Tw=[],this.Fw=!1,this.Iw=-1,this.Pw=[],this.Dw=!0,this.Bw=!1,this.Lw=4,this.Rw=[1e-7,1e-6,1e-5,1e-4,.001,.01,.1,1,5,10,30,60,300,600,1800,3600,7200,14400,28800,36e3,43200,50400,57600,64800,72e3,86400,172800,259200,345600,432e3,604800,1209600,2592e3,7776e3,10368e3,15552e3,31536e3,15768e4,31536e4,63072e4,7884e5,15768e5,31536e5,3942e6,47304e5,63072e5,7884e6,15768e6,31536e6,3942e7,47304e6,63072e6,7884e7,15768e7,31536e7,63072e7,7884e8,15768e8,31536e8,47304e8,63072e8],this.chart.cs.Jn(Sh.mf)}QM(){return this.Pw}JM(t){return this.R.on("dataAdd",t)}KM(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}t_(t){return this.R.off(t)}Av(){return this.yv&&this.Pw.length>0&&this.getVisible()}Ew(t){if(!(this.Pw.length<1))return[this.Pw[t][0],this.Pw[t][1],this.Pw[t][2],this.Pw[t][3],this.Pw[t][4]]}solveNearest(t,e){if(0===this.Pw.length)return;const i=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}).x,s=void 0!==this.getPackDataState();let r,n,o,h,a;if(s){const t=this.zw;if(!t)return;const e=Pe(i,t.length-1,(e=>t[e][0])),s=void 0!==e&&t[e];if(!s)return;h=s[3],o=s[2],n=s[1],a=s[4],r=s[0]}else{const t=Pe(i,this.Pw.length-1,(t=>this.Pw[t][0])),e=void 0!==t&&this.Pw[t];if(!e)return;r=e[0],n=e[1],o=e[2],h=e[3],a=e[4]}return{cursorPosition:{resultTable:u(r,a),resultTableScale:this.scale,pointMarker:u(r,a),pointMarkerScale:{x:this.axisX,y:this.axisY}},x:r,y:a,open:n,high:o,low:h,close:a,position:r,isPacked:s,series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,open:0,high:0,low:0,close:0,position:0,isPacked:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){if(!(t.x instanceof Gi))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Vw=t.x}Lr(){return u(5,5)}w_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.chart.cs.Jn(Sh.Df);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.Fw=!0;const t=this.Pw.length,i=this.Tw.length,s=e.length;this.Pw.length=t+s,this.Tw.length=i+s;for(let r=0;rthis.Rw[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Iw||this.Fw||this.Bw)){this.Bw=!1,this.Iw=t,this.Fw=!1,this.Nw(),this.zw=[];const e=this.Pw.length;let i=this.Pw[0][0]-this.Pw[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...al(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Lr().x))}),gc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...al(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Lr().y))});class mc extends Ta{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.aC=!1,this.lC=!1,this.uC=!1,this.cC=!1,this.dC=!1,this.fC=new Map,this.AC=new Map,this.gC=[],this.pC=[],this.yC=!0,this.mC=!0,this.vC=!1,this.SC=[],this.xC=new Set,this.bC=!1,this.vy=r,this.MC=n,this._C=o,this.wC=h.cursorGridStrokeStyleX,this.CC=h.cursorGridStrokeStyleY}setKeepWithinAxisBoundaries(t){return this.aC=t,this.Rs.Ms(),this}getKeepWithinAxisBoundaries(){return this.aC}dispose(){return super.dispose(),this.fC.forEach((t=>t.forEach((t=>t.dispose())))),this.AC.forEach((t=>t.forEach((t=>t.dispose())))),this.gC.length=0,this.pC.length=0,this.yy.length=0,this}ze(){return this.vC&&this.setPosition(...this.SC),this.gC.forEach((t=>t.setVisible(this.Zi&&this.dp).setMarkerVisible(this.Zi&&this.dp&&this.yC))),this.pC.forEach((t=>t.setVisible(this.Zi&&this.dp).setMarkerVisible(this.Zi&&this.dp&&this.mC))),super.ze()}Kp(){if(!this.aC)return super.Kp();const t={x:!0,y:!0},i=this.Jp,s=i.getPosition(u(-1,-1),e.UISpace.PaddedBackground),r=i.getPosition(u(1,1),e.UISpace.PaddedBackground);return this.SC.forEach(((e,n)=>{const o=e.pointMarkerScale.x,h=e.pointMarkerScale.y,a=yt(s,i.scale,{x:o,y:h}),l=yt(r,i.scale,{x:o,y:h});ti(a.x,o.Xh,o.$h)&&ti(l.x,o.Xh,o.$h)&&(t.x=!1),ti(a.y,h.Xh,h.$h)&&ti(l.y,h.Xh,h.$h)&&(t.y=!1)})),t}setPosition(...t){if(this.SC=t,this.gC.forEach((t=>t.setVisible(!1))),this.pC.forEach((t=>t.setVisible(!1))),this.gC.length=0,this.pC.length=0,0===t.length)return this;const e=this.renderingScale,i=t[0].resultTable,s=ha(t[0].resultTableScale,e),r=s===this.scale?i:yt(i,s,this.scale);this.Jp.setPosition(r),this.dp=!1,this.Ay.forEach((t=>{t.targetVisible=!1}));const n=new Map;return t.forEach(((t,i)=>{const s=t.pointMarkerScale.x,r=t.pointMarkerScale.y,o=n.get(s)||[],h=n.get(r)||[],a=!o.includes(t.pointMarker.x),l=!h.includes(t.pointMarker.y);o.push(t.pointMarker.x),h.push(t.pointMarker.y),n.set(s,o),n.set(r,h);const c=t.pointMarker,d=Ac(u(c.x,c.y),s,r);if(a){const t=this.Ph(s,!0);t.setValue(c.x),t.setGridStrokeLength(this.lC?d.x:1).setAllocatesAxisSpace(this.bC),this.gC.push(t)}if(l){const t=this.Ph(r,!1);t.setValue(c.y),t.setGridStrokeLength(this.uC?d.y:1).setAllocatesAxisSpace(this.bC),this.pC.push(t)}let f=this.Ay[i];if(!f){const t=new Oo(this.Rs,this.renderingScale,this.scale,Ot,this.ts).setMouseInteractions(!1).setFillStyle(this.ts.cursorPointMarkerFillStyle).setSize(this.ts.cursorPointMarkerSize).setShape(this.ts.cursorPointMarkerShape);f={pointMarker:t,targetVisible:!0},this.Ay.push(f),this.yy.forEach((e=>e(t)))}const g=ha(t.pointMarkerScale,e),m=g===this.scale?t.pointMarker:yt(t.pointMarker,g,this.scale);f.pointMarker.setPosition(m),f.targetVisible=!0;const y=s.getInterval(),p=r.getInterval(),A=Math.min(y.start,y.end),x=Math.max(y.start,y.end),S=Math.min(p.start,p.end),v=Math.max(p.start,p.end);c.x>=A&&c.x<=x&&c.y>=S&&c.y<=v&&(this.dp=!0)})),this}setTickMarkersAllocateAxisSpace(t){return this.bC=t,this.Rs.Ms(),this}getTickMarkersAllocateAxisSpace(){return this.bC}Ph(t,e){this.xC.has(t)||(t.onDispose((()=>{var e;null===(e=i.get(t))||void 0===e||e.forEach((t=>t.dispose())),i.delete(t)})),this.xC.add(t));const i=e?this.fC:this.AC,s=e?this.gC:this.pC,r=i.get(t)||[];i.set(t,r);let n=r.find((t=>!s.includes(t)));return n||(n=e?t.np(!1,this.MC):t.np(!1,this._C),r.push(n),this.br(n,e),n.setMouseInteractions(!1)),n}br(t,e){const i=e?this.wC:this.CC;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.yC:this.mC)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.lC=t,this.Rs.Ms(),this}getGridStrokeXCut(){return this.lC}setGridStrokeYCut(t){return this.uC=t,this.Rs.Ms(),this}getGridStrokeYCut(){return this.uC}setGridStrokeXStyle(t){return this.wC=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.fC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.wC))))),this}getGridStrokeXStyle(){return this.wC}setGridStrokeYStyle(t){return this.CC=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.AC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.CC))))),this}getGridStrokeYStyle(){return this.CC}setTickMarkerXVisible(t){return this.yC=t,this.Rs.Ms(),this}getTickMarkerXVisible(){return this.yC}setTickMarkerYVisible(t){return this.mC=t,this.Rs.Ms(),this}getTickMarkerYVisible(){return this.mC}setTickMarkerX(t){return this.fC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.MC=this.MC.addStyler(t),this.Rs.Ms(),this}setTickMarkerY(t){return this.AC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this._C=this._C.addStyler(t),this.Rs.Ms(),this}}class yc{constructor(t,e,i,s){this.by=[],this.My=(t,e)=>(this.by.forEach((i=>i(t,e))),t),this.addStyler=t=>new yc(this.vy,this.MC,this._C,this.by.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new yc(t,this.MC,this._C,this.by.map((t=>t))),this._y=(t,e,i,s,r)=>this.My(new mc(t,e,i,s,this.vy,this.MC,this._C,r),r),this.vy=t,this.by=s,this.MC=e,this._C=i}}const pc=new yc(Fo,Ah.PointableTextBox,Ah.PointableTextBox,[(t,e)=>{wa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),_n(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),_n(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ac=(t,e,i)=>{const s=e.At,r=i.At;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.vg&&(n=1-n),1===e.vg&&(o=1-o),u(o,n)};class xc extends xu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.GM=[],this.qb=!0,this.jM=void 0,this.Fu=void 0,this.kC=(t,e)=>{const i=t.oM(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.gw=(t,e)=>{const i=t.T_(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.qd=()=>Ae(this.Su.getFillStyle()),this.xw=c,this.io=f,this.Su=ve(this.ts.lineSeriesStrokeStyle,d),this.TC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}fs(){var t,e;return null===(e=null===(t=this.io)||void 0===t?void 0:t.dataPattern)||void 0===e?void 0:e.pattern}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;for(let t=0;tt.Iu(this.Fu))),this.Rs.Ms(),this}setCursorInterpolationEnabled(t){return this.qb=t,this.Rs.cs.Ms(),this}getCursorInterpolationEnabled(){return this.qb}CM(t){}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.GM.length)return;const r=this.GM[0].qo()||Jr.NearestX,n=Su(s,this.GM,ma(e)?this.gw:this.kC,r===Jr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Jr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=yt(n[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}ZM(t){let e=this.GM[0];e||(e=this.yw(),this.GM.push(e),this.As(e)),e.ml(t,this.XM)}yw(){return this.Rs.gm(this.scale,this.TC,[Za.UserSeries,...this.xw]).Ye(this.Su).Iu(this.Fu).ds(this.getHighlight())}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su})}Oe(t,e){t.ds(e),this.Rs.Ms()}$M(t,e,i,s){}}class Sc extends xu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new Ku,l,u),this.GM=[],this.lM=5,this.ka=0,this.tl=!1,this.il=!1,this.sl=!1,this.jM=void 0,this.Aw=(t,e)=>{const i=t.hd(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.io=d,this.uM=a,this.Ie=ve(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Su(s,this.GM,this.Aw,ei);if(void 0!==r){const t=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}qd(){return Ae(this.Ie)}Bs(){return this.ws||this.uM}CM(t){}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}Oe(t,e){t.ds(e),this.Rs.Ms()}setPointFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;for(let t=0;t{const t=i.engine.container.getBoundingClientRect();this.PC.style.left=`${t.left}px`,this.PC.style.top=`${t.top}px`,this.PC.style.width=`${t.width}px`,this.PC.style.height=`${t.height}px`};n(),i.onResize(n),this.DC(this.PC),this.BC(),this.LC(),this.RC(),this.EC(e),this.chart.zC().push(this)}DC(t){this.VC=zt.document.createElement("div"),this.VC.style.pointerEvents="all",t.append(this.VC),this.OC=zt.document.createElement("div"),this.NC=new _s(this.te,this.oe,this.chart,this.OC),this.GC=zt.document.createElement("table"),this.GC.style.borderSpacing="0",this.VC.appendChild(this.NC.pe()),this.VC.appendChild(this.OC),this.OC.appendChild(this.GC)}LC(){let t=0,e=0,i=0,s=0,r=!1;this.FC=!1,this.VC.onmousedown=n=>{n=n||zt.event,i=n.clientX,s=n.clientY,r=!0,zt.document.onmouseup=t=>{this.FC?this.VC.addEventListener("click",se,!0):this.VC.removeEventListener("click",se,!0),r=!1,this.FC=!1,zt.document.onmouseup=null,zt.document.onmousemove=null},zt.document.onmousemove=n=>{n=n||zt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.FC=!0,this.VC.style.top=this.VC.offsetTop-e+"px",this.VC.style.left=this.VC.offsetLeft-t+"px",this.VC.style.removeProperty("right"),this.VC.style.removeProperty("bottom"))}}}RC(){let t=0,e=0,i=0,s=0,r=!1;this.VC.ontouchstart=n=>{n=n||zt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.VC.ontouchend=()=>{r=!1,zt.document.ontouchend=null,zt.document.ontouchmove=null},this.VC.ontouchmove=n=>{r&&(se(n),n=n||zt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.VC.style.top=this.VC.offsetTop-e+"px",this.VC.style.left=this.VC.offsetLeft-t+"px",this.VC.style.removeProperty("right"),this.VC.style.removeProperty("bottom"))}}}BC(){this.VC.style.setProperty("top","10px"),this.VC.style.setProperty("left","10px"),this.VC.style.position="absolute",this.VC.style.display="flex",this.VC.style.alignItems="flex-start",this.OC.style.setProperty("display","none")}removePositionProperty(){this.VC.style.removeProperty("top"),this.VC.style.removeProperty("left"),this.VC.style.removeProperty("bottom"),this.VC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.VC.style.setProperty("bottom","10px"),this.VC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.VC.style.setProperty("top","10px"),this.VC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.VC.style.setProperty("bottom","10px"),this.VC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.VC.style.setProperty("top","10px"),this.VC.style.setProperty("right","10px")}}EC(t){for(let e=0;e[t.rd((()=>{this.YC+=1,this.YC>1&&this.chart.cs.Jn(Sh.Df),this.chart.cs.Ms()})),t.nd((()=>this.chart.cs.Ms()))])),this.qa.xd(t),this.chart.cs.Ms()),this}getDataSet(){return this.$C()}setStrokeStyle(t){return this.qa.Ye(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.xu()}setAreaFillStyle(t){return this.qa.Md(t),this.Rs.Ms(),this}getAreaFillStyle(){return this.qa.jC()}setPointFillStyle(t){return this.qa.bd(t),this.Rs.Ms(),this}getPointFillStyle(){return this.qa.Fd()}setPointSize(t){return this.qa.Id(t),this.Rs.Ms(),this}getPointSize(){return this.qa.ZC()}setPointShape(t){return this.qa.wd(t),this.Rs.Ms(),this}getPointShape(){return this.qa.Cd()}setPointRotation(t){return this.qa.kd(t),this.Rs.Ms(),this}getPointRotation(){return this.qa.Td()}setPointAlignment(t){return this.qa.QC(t),this.chart.cs.Ms(),this}getPointAlignment(){return this.qa.JC()}setCurvePreprocessing(t){return this.qa.HC(t),this.Rs.Ms(),this}getCurvePreprocessing(){return this.qa.KC()}add(t){return this.$C().add(t),this.Rs.Ms(),this}addArraysXY(t,e){return this.$C().addArraysXY(t,e),this.Rs.Ms(),this}appendJSON(t,e){return this.$C().appendJSON(t,e),this.Rs.Ms(),this}appendSample(t){return this.$C().appendSample(t),this.Rs.Ms(),this}appendSamples(t){return this.$C().appendSamples(t),this.Rs.Ms(),this}fill(t){return this.$C().fill(t),this.Rs.Ms(),this}setSamples(t){return this.$C().setSamples(t),this.Rs.Ms(),this}alterSamples(t,e){return this.$C().alterSamples(t,e),this.Rs.Ms(),this}alterSamplesByID(t,e){return this.$C().alterSamplesByID(t,e),this.Rs.Ms(),this}getSampleCount(){return this.$C().getSampleCount()}getNextSampleIndex(){return this.$C().getNextSampleIndex()}clear(){return this.$C().clear(),this.Rs.Ms(),this}setMaxSampleCount(t){return this.$C().setMaxSampleCount(t),this.Rs.Ms(),this}getMaxSampleCount(){return this.$C().getMaxSampleCount()}readBack(t){return this.$C().readBack(t)}onMaxSampleCountExceeded(t){return this.$C().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.$C().offMaxSampleCountExceeded(t)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){let i=ma(e);void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.qC(),r=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}),n=s.hd(r,i,this.scale,this.chart._g);if(void 0!==n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){const i=this.getDataSet(),s=null==t?void 0:t.dataPoint;return void 0===i.Kc()||s?s?{cursorPosition:{resultTable:s,resultTableScale:this.scale,pointMarker:s,pointMarkerScale:{x:this.axisX,y:this.axisY}},...s,series:this,axisX:this.axisX,axisY:this.axisY}:void 0:Ve({series:this,axisX:this.axisX,axisY:this.axisY},{x:0,y:0,cursorPosition:0,id:0,rotation:0,size:0,color:0,lookupValue:0,multiHit:0,iSample:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}qC(){return this.$C()}qd(){return Ae(this.getPointFillStyle())||Ae(this.getStrokeStyle().getFillStyle())||Ae(this.getAreaFillStyle())}Av(){var t;const e=null===(t=this.Sd)||void 0===t?void 0:t.Gt;return this.getVisible()&&this.getAutoScrollingEnabled()&&void 0!==e&&e.bc>0}CM(t){}getXMax(){return this.qa.St()}getXMin(){return this.qa.vt()}getYMax(){return this.qa.bt()}getYMin(){return this.qa.xt()}Lr(){return{x:this.qa.Pl(),y:this.qa.Dl()}}Cv(){var t;super.Cv();const e=qr(null!==(t=this.fs())&&void 0!==t?t:"ProgressiveX");this.qa.tk("x"===e?0===this.xAxis.mg?"bottom":"top":0===this.yAxis.mg?"left":"right")}$C(){if(!this.Sd){const t=new So(this.io);t.Fc&&this.chart.cs.Jn(Sh.Lf),t.Pc&&this.chart.cs.Jn(Sh.Bf),this.Sd=Be(t,this.Sd,(()=>[t.rd((()=>{this.YC+=1,this.YC>1&&this.chart.cs.Jn(Sh.Df),this.chart.cs.Ms()})),t.nd((()=>{this.chart.cs.Ms()}))])),this.qa.xd(t)}return this.Sd.Gt}styleLegendEntry(t,e=!1){const i=this.getPointFillStyle(),s=this.getAreaFillStyle();pe(t,this.ts,e,{stroke:this.getStrokeStyle(),fill:i!==_?i:s,behavior:{priority:"stroke"}})}Bs(){return this.ws||this.getPointShape()}Oe(t,e){t.ds(e),this.Rs.Ms()}}const Mc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.At.it(e),t.axis.xg.it(i)})))),Cc=u(10,10);var Tc;e.AxisPosition=void 0,(Tc=e.AxisPosition||(e.AxisPosition={}))[Tc.Top=0]="Top",Tc[Tc.Bottom=1]="Bottom",Tc[Tc.Left=2]="Left",Tc[Tc.Right=3]="Right";const wc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Ec=t=>t.setStopped(!0),kc=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Ic=(t,e)=>{const i="linear-highPrecision"===t.Wh.type||"linear-highPrecision"===e.Wh.type,s="logarithmic"===t.Wh.type||"logarithmic"===e.Wh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Wh.type}, y: ${e.Wh.type})`;throw new Error(i)}};var zc,Fc,Rc;!function(t){t[t.seriesBackground=0]="seriesBackground",t[t.gridLine0=1]="gridLine0",t[t.gridLine1=2]="gridLine1",t[t.gridLine2=3]="gridLine2",t[t.highlightersBelow=4]="highlightersBelow"}(zc||(zc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Fc||(Fc={}));class Dc extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("chartXY bg",0),r,i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.chartXYTitleFont,i.cs.ts.chartXYTitleFillStyle,h),this.ik=this.mp.d2({scaleXYConstructor:Yi}),this.tp=[],this.ip=[],this.ep=[],this.sp=[],this.sk=new Map,this.ek=!0,this.hk=!0,this.rk=!0,this.Zf=2,this.nk=!0,this.ak=!0,this.lk=[],this.uk=this.Rp.Ee(this.ik).Re(_).Le(ut).setMouseInteractions(!1),this.ck=this.Rp.He(this.ik).Ye(ut).setMouseInteractions(!1),this.dk=this.Rp.He(this.ik).Ye(ut).setMouseInteractions(!1),this.fk=this.ts.chartXYZoomingRectangleFillStyle,this.Ak=this.ts.chartXYZoomingRectangleStrokeStyle,this.gk=this.ts.chartXYFittingRectangleFillStyle,this.pk=this.ts.chartXYFittingRectangleStrokeStyle,this.yk=e.MouseStyles.Default,this.mk=e.MouseStyles.Move,this.vk=e.MouseStyles.ZoomIn,this.Sk=e.MouseStyles.Default,this.xk=void 0,this.AA=Pc,this.wM=0,this.bk=(t,e,i)=>{const s=t.solveNearest(e,i);return s&&ti(s.cursorPosition.pointMarker.x,s.axisX.getInterval().start,s.axisX.getInterval().end)&&ti(s.cursorPosition.pointMarker.y,s.axisY.getInterval().start,s.axisY.getInterval().end)?s:void 0},this.Mk=Mc(this.ip,this.tp),this._k=Mc(this.ep,this.sp),this.wk=(t,e,i,s,r)=>{this.Mk(s,r),this._k(r,s),this.ik.it(s,r),this.cs.Ms()},this.Ck=(t,e)=>{this.sk.set(t,e)},this.gg=t=>{const e=this.ip.findIndex((e=>e.axis===t)),i=this.tp.findIndex((e=>e.axis===t)),s=this.ep.findIndex((e=>e.axis===t)),r=this.sp.findIndex((e=>e.axis===t));e>=0&&this.ip.splice(e,1),i>=0&&this.tp.splice(i,1),s>=0&&this.ep.splice(s,1),r>=0&&this.sp.splice(r,1),this.sk.delete(t),this.cs.Ms()},this.addAreaSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Ic(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Nu.Positive)(this,this.Wv,this.lb,e,i,this.kk(e),this.kk(i),this.xp,s,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length);return this.jv(r),r},this.addAreaRangeSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Ic(e,i);const s=new Uu(this,this.Wv,this.lb,e,i,this.kk(e),this.kk(i),this.xp,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length);return this.jv(s),s},this.Tk=!1,this.Fk=!1,this.kM=()=>{(this.ek||this.hk)&&(this.xk=this.engine.setMouseStyle(this.yk))},this.TM=()=>{this.Tk=!1,this.engine.restoreMouseStyle(this.xk)},this.FM=(t,e,i)=>{var s,r;const n=Vt(null===(s=this.CA.so)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Vt(null===(r=this.CA.so)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.xk);const h=this.Rp.cs.Ne(e.clientX,e.clientY);i===n&&(this.ek||this.hk)?(this.Ik(t,h),se(e)):i===o&&this.nk&&(this.xk=this.engine.setMouseStyle(this.mk),this.Fk=!0,se(e))},this.Sv=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Vt(null===(n=this.CA.so)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Vt(null===(o=this.CA.so)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.ek||this.hk)?(this.Pk(t,s,h),se(e)):i===l&&this.nk&&(this.Dk(mi(r,-1)),se(e)),this.cs.Ms()},this.xv=(t,e,i,s)=>{var r,n;const o=Vt(null===(r=this.CA.so)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Vt(null===(n=this.CA.so)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.ek||this.hk)){const i=u(e.clientX,e.clientY);this.Bk(t,s,i),se(e)}else i===h&&this.nk&&se(e);this.engine.restoreMouseStyle(this.xk),this.Xv.getIsUnderMouse()&&(this.xk=this.engine.setMouseStyle(this.yk)),this.Tk=!1,this.Fk=!1},this.vv=(t,e)=>{if(this.rk){const t=this.Rp.cs.Ne(e.clientX,e.clientY);this.Lk(t,u(be(e),be(e))),se(e)}},this.Rk=(t,e,i,s)=>{},this.Ek=(t,e,i,s,r,n)=>{if(this.nk){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.Dk(t),se(n),this.Fk=!0}if(this.rk){const t=this.cs.Uo({clientX:e.x,clientY:e.y}),o=this.cs.Uo({clientX:i.x,clientY:i.y}),h=pi(u(Math.abs(t.engineX-s.x-(o.engineX-r.x)),Math.abs(t.engineY-s.y-(o.engineY-r.y))),u(Math.abs(t.engineX-o.engineX),Math.abs(t.engineY-o.engineY)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.yt(t.At.pi(t.getInterval().start,-h.x),t.At.pi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.yt(t.At.pi(t.getInterval().start,-h.y),t.At.pi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),se(n),this.Tk=!0}},this.zk=(t,e,i,s)=>{this.Fk=!1,this.Tk=!1},this.Vk=(t,e,i)=>{(this.hk||this.ek)&&(this.Ik(t,e),se(i))},this.Ok=(t,e,i,s,r)=>{(this.hk||this.ek)&&(this.Pk(t,e,i),se(r))},this.Nk=(t,e,i,s)=>{(this.hk||this.ek)&&(this.Bk(t,e,i),se(s))},this.cs.Jn(Sh.kf),this.setPadding({right:24}),this.Gk=i.Lx("chartXY series bg",zc.seriesBackground),this.Uk=[zc.gridLine0,zc.gridLine1,zc.gridLine2].map((t=>i.Wk(`chartXY gridline #${t}`,t))),this.dg=i.Wk("chartXY highlighters below",zc.highlightersBelow),this.lb=i.tm("chartXY plotting",Fc.plotting),this.Ag=i.tm("chartXY highlighters above",Fc.highlightersAbove),this.EA=i.tm("chartXY fg",Fc.fg),this.ik.x.q(0,this.uiScale.x.getCellSize()-(this.$t.left+this.$t.right+this.Ia.left+this.Ia.right)),this.ik.y.q(0,this.uiScale.y.getCellSize()-(this.$t.bottom+this.$t.top+this.Ia.bottom+this.Ia.top)),this.ik.it(this.uiScale.oi().x,this.uiScale.oi().y),this.Xv=this.Gk.Ee(this.ik).Re(this.ts.chartXYSeriesBackgroundFillStyle).Le(ut),this.$v=this.EA.Ee(this.ik).Re(_).Le(this.ts.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Hv(this.Xv,this.$v),this.setSeriesBackgroundEffect(!1);const a=Vt(o?o.cursorBuilder:void 0,pc),l=i.sm();this.hm=pa(this,l,a._y(l,this.ik,this.ik,Ot,this.ts),this,"show-all",Bc,((t,e)=>{const i=this.translateCoordinate(t,{x:t.axisX,y:t.axisY},this.coordsClient);return Math.sqrt((i.clientX-e.clientX)**2+(i.clientY-e.clientY)**2)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.wk),this.Ch.Sr("ChartXY"),this.bv=ns(new hs(this.Vk,this.Ok,this.Nk,1),new as(this.Rk,this.Ek,this.zk)),this.onSeriesBackgroundMouseEnter(this.kM),this.onSeriesBackgroundMouseLeave(this.TM),this.onSeriesBackgroundMouseWheel(this.vv),this.onSeriesBackgroundMouseDragStart(this.FM),this.onSeriesBackgroundMouseDrag(this.Sv),this.onSeriesBackgroundMouseDragStop(this.xv),this.onSeriesBackgroundTouchStart(this.bv.onTouchStart),this.onSeriesBackgroundTouchMove(this.bv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.bv.onTouchEnd),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.Dp(n,this.ik)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.hm.solveNearest(t,e,this.Gv,this.bk)}addCursor(t=pc){const e=this.xp(),i=t._y(e,this.ik,this.ik,this.pp(e),this.ts);return i.vC=!0,this.Fp(i),i}getMinimumSize(){const t={x:0,y:0};t.x+=this.$t.left+this.$t.right+this.Ia.left+this.Ia.right,t.y+=this.$t.top+this.$t.bottom+this.Ia.top+this.Ia.bottom;const e=this.Ch.Os().od(),i=S(Oc(this.AA||Pc),this.Lp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Yk&&(t.x+=this.Yk.left,t.x+=this.Yk.right,t.y+=this.Yk.top,t.y+=this.Yk.bottom),t.x+=Cc.x,t.y+=Cc.y,t}addAxisX(t){var e,i;const{opposite:s,type:r}=Ji(t);let n;n="linear"===r.type?this.mp.d1({dimension:"x",scale1DConstructor:Gi}):"linear-highPrecision"===r.type?this.mp.d1({dimension:"x",scale1DConstructor:Gi}).Mi():this.mp.d1({dimension:"x",scale1DConstructor:Fi}).Ai(r.base),n.it(this.ik.x.oi());const o=s?this.tp:this.ip,h=new bh(this.Uk,this.EA,this.Rp,this.dg,this.Ag,this.cs.hs,n,this.ik.y,(a=()=>h.Ng(),{...Ch,...fc(a)}),this,s?100:0,this.gg,this.Ck,this.ts,this.ph,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iStack:u,iParallel:l}),this.cs.Ms(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=Ji(t);let n;n="linear"===r.type?this.mp.d1({dimension:"y",scale1DConstructor:Gi}):"linear-highPrecision"===r.type?this.mp.d1({dimension:"y",scale1DConstructor:Gi}).Mi():this.mp.d1({dimension:"y",scale1DConstructor:Fi}).Ai(r.base),n.it(this.ik.y.oi());const o=s?this.sp:this.ep,h=new bh(this.Uk,this.EA,this.Rp,this.dg,this.Ag,this.cs.hs,n,this.ik.x,(a=()=>h.Ng(),{...Th,...gc(a)}),this,s?100:0,this.gg,this.Ck,this.ts,this.ph,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iParallel:l,iStack:u}),this.cs.Ms(),h}swapAxes(t,e){const i=[this.ip,this.ep,this.sp,this.tp],s=i.find((e=>void 0!==e.find((e=>e.axis===t)))),r=i.find((t=>void 0!==t.find((t=>t.axis===e))));if(!s||!r)return this;if(s!==r)throw new Error("LightningChart JS ChartXY.swapAxes does not support swapping Axes that are on different sides.");const n=s.find((e=>e.axis===t)),o=s.find((t=>t.axis===e));if(!n||!o)return this;const h=n.iParallel,a=n.iStack;return n.iParallel=o.iParallel,n.iStack=o.iStack,o.iParallel=h,o.iStack=a,this.cs.Ms(),this}dispose(){return this.hm.Y(),this.Gk.Y(),this.lb.Y(),this.EA.Y(),this.Uk.forEach((t=>t.Y())),this.Ag.Y(),this.dg.Y(),this.zC().forEach((t=>t.dispose())),ua(this.ik),this.ip.slice().forEach((t=>t.axis.dispose())),this.ep.slice().forEach((t=>t.axis.dispose())),this.sp.slice().forEach((t=>t.axis.dispose())),this.tp.slice().forEach((t=>t.axis.dispose())),this.Gv.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.ip,...this.tp].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}getDefaultAxisY(){var t;return null===(t=[...this.ep,...this.sp].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):wc;return Bt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.tp.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis));case e.AxisPosition.Bottom:return this.ip.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis));case e.AxisPosition.Left:return this.ep.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis));case e.AxisPosition.Right:return this.sp.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis))}})))}Hk(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.ip.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.tp.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.ep.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.sp.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.AA=t,this.cs.Ms(),this}getTitlePosition(){return this.AA}Xk(t,e,i,s){const r=this.AA||Pc;let n,o=S(Oc(r),this.Lp);this.getTitleFillStyle()===_||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.Ch.Os().od();const h=Math.abs(s)+this.Ia.bottom+this.$t.bottom,a=Math.abs(i)+this.Ia.top+this.$t.top,l={left:Math.abs(t)+this.Ia.left+this.$t.left,right:Math.abs(e)+this.Ia.right+this.$t.right,top:a,bottom:h},u=this.uiScale.Ui(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Lc(r,u,l,n,o,this.Ia);return this.Ch.Ve(f).Ha(c).$a(d),g}ze(t){super.ze(t);for(const t of this.Gv)t.Cv();for(const t of this.Gv)t.ze();const e=Ee(this.Gv.map((t=>t.la()))),i=new Set(e.map((t=>t.$k)));if(1===i.size){const t=Array.from(i)[0],s="x"===t?[this.ip,this.tp]:[this.ep,this.sp],r="y"===t?[this.ip,this.tp]:[this.ep,this.sp];s.forEach((t=>t.forEach((t=>t.axis.Rr())))),e.forEach((t=>t.jk())),r.forEach((t=>t.forEach((t=>t.axis.Rr()))))}else this.ep.forEach((t=>t.axis.Rr())),this.ip.forEach((t=>t.axis.Rr())),this.tp.forEach((t=>t.axis.Rr())),this.sp.forEach((t=>t.axis.Rr()));const s=this.ep.map((t=>t.axis.Os())),r=this.ip.map((t=>t.axis.Os())),n=this.tp.map((t=>t.axis.Os())),o=this.sp.map((t=>t.axis.Os()));let h=!1;this.forEachAxis((t=>{(t.Or()||t.Nr())&&(h=!0)}));const a=this.Tk||this.Fk||!this.ak&&h,l=new Set(this.getAxes().map((t=>t.getStackIndex()))).size>1;this.hm.ze(a,l?this.Gv.sort(((t,e)=>e.axisY.getStackIndex()-t.axisY.getStackIndex())):this.Gv,this.bk,{afterCursorPointedAt:t=>{const e=this.cs.Zn();if(t.length>1&&e){const t=this.cs.Uo(e);this.hm.Hp.xy({x:t.engineX,y:t.engineY},this.cs.At)}},overrideCursorPositions:(t,e)=>t.map((t=>t.multiHit?t.multiHit.map((e=>({...t.cursorPosition,pointMarker:e}))):[t.cursorPosition])).flat()});const c=_c(this.ep,s),d=_c(this.ip,r),f=_c(this.tp,n),g=_c(this.sp,o),m=this.Xk(c.thicknessTotal,g.thicknessTotal,f.thicknessTotal,d.thicknessTotal),p=this.ik.x.getCellSize()-(m.left+m.right),A=this.ik.y.getCellSize()-(m.bottom+m.top),x=[m.left,m.right],S=[m.bottom,m.top];this.ik.x.q(0,p),this.ik.y.q(0,A),this.ik.x.si(x),this.ik.y.si(S);const v=(t,e,i,s)=>{let r=0;t.groups.forEach((t=>{let n=0;const o=t.stacks.reduce(((t,e)=>Math.max(t,e.Wg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.pA+e.axis.yA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Zd?e.axis.Zd.pixels:0)),0),l=e-h-a;t.stacks.forEach((s=>{const h=s.axis,a=h.getVisible(),u=Math.max(e-n,0),c=Math.min(a?"pixels"in h.Zd?h.Zd.pixels:h.Zd.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.pA:0,f=a?i[1]+(e-n)-c-h.pA:0;h.At.si([d,f]),h.ze({Wg:o,Yg:s.Yg,$g:c,Zk:n,qg:o+s.Yg,Zg:r}),a&&(n+=c+h.pA+h.yA)})),r+=s*t.thicknessMax}))};v(c,A,S,-1),v(g,A,S,1),v(d,p,x,-1),v(f,p,x,1),this.Yk={left:c.thicknessTotal,top:f.thicknessTotal,right:g.thicknessTotal,bottom:d.thicknessTotal},this.Xv.Ve(u(0,0)).it(u(p,A)),this.$v.Ve(u(0,0)).it(u(p,A));const b=y(this.ik.x.ei(),this.ik.y.ei(),this.ik.x.ri(),this.ik.y.ri());this.lb.wx(b),this.dg.wx(b),this.Ag.wx(b),this.cp&&this.cp(),super.Pp(),this.ip.forEach((t=>t.axis.hp())),this.tp.forEach((t=>t.axis.hp())),this.ep.forEach((t=>t.axis.hp())),this.sp.forEach((t=>t.axis.hp()));for(const t of this.Gv)t.Pm()}J(){for(let t=0;t=10;h&&c&&l.x===r.x&&this.hk?(this.Tk=!0,this.uk.Re(this.gk).Le(this.pk),this.ck.Ye(this.pk).$e(r).Xe(o),this.dk.Ye(this.pk).$e(u(r.x,o.y)).Xe(u(o.x,r.y)),this.xk=this.engine.setMouseStyle(this.Sk,this.xk)):h&&c&&(this.ek||this.hk)?(this.Tk=!0,this.uk.Re(this.fk).Le(this.Ak),this.ck.Ye(ut),this.dk.Ye(ut),this.xk=this.engine.setMouseStyle(this.vk,this.xk)):(this.Tk=!1,this.uk.Le(ut).Re(_),this.ck.Ye(ut),this.dk.Ye(ut),this.engine.restoreMouseStyle(this.xk)),this.cs.Ms()}Bk(t,e,i){if(this.Tk){const t=this.cs.Uo({clientX:i.x,clientY:i.y}),s=yt({x:t.engineX,y:t.engineY},this.Rp.cs.At,this.ik),r=ti(s.x,this.ik.x.getInnerStart(),this.ik.x.getInnerEnd())&&ti(s.y,this.ik.y.getInnerStart(),this.ik.y.getInnerEnd()),n=i.x>=e.x||!this.hk?"zoom":"fit",o=this.uk.Ua(),h=yi(o,this.uk.oi()),a=Math.min(this.uk.oi().x,this.uk.oi().y)>=10;r&&a&&"zoom"===n&&this.ek?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=yt(o,this.ik,t.bg).x,i=yt(h,this.ik,t.bg).x;t.yt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=yt(o,this.ik,t.bg).y,i=yt(h,this.ik,t.bg).y;t.yt(e,i,!0,!0,"interactionSetInterval")}}))):r&&a&&"fit"===n&&this.hk&&this.forEachAxis(kc)}this.uk.Le(ut).Re(_),this.ck.Ye(ut),this.dk.Ye(ut),this.cs.Ms()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}Dk(t){this.forEachAxisX((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.y)}))}zoom(t,e){this.forEachAxis(Ec),this.forEachAxisX((i=>{i.zoom(i.At.dt(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.At.dt(t.y),e.y)}))}Lk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Ec(i),i.zoom(i.At.dt(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Ec(i),i.zoom(i.At.dt(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}af(){const t=[];return this.forEachAxis((e=>e.Eg((e=>t.push(e))))),super.af().concat(t)}zC(){return this.lk}we(){return this.Vp(this.lb)}setCursorEnabledDuringAxisAnimation(t){return this.ak=t,this}getCursorEnabledDuringAxisAnimation(){return this.ak}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=wh(r)?r:$i(r)?this._g:void 0;if(n&&Wi(i)){const t=yt(s,n,this.cs.At);return this.cs.Wo({engineX:t.x,engineY:t.y})}if(n&&$i(i))return yt(s,n,this._g);if(n&&wh(i))return yt(s,n,i)}else{const i=t;if($i(e)){const t=this.cs.Uo(i);return yt({x:t.engineX,y:t.engineY},this.cs.At,this._g)}if(wh(e)){const t=e,s=this.cs.Uo(i);return yt({x:s.engineX,y:s.engineY},this.cs.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(Rc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Rc.RightTop="right-top",Rc.LeftTop="left-top",Rc.CenterBottom="center-bottom",Rc.RightBottom="right-bottom",Rc.LeftBottom="left-bottom",Rc.SeriesCenterTop="series-center-top",Rc.SeriesRightTop="series-right-top",Rc.SeriesLeftTop="series-left-top",Rc.SeriesCenterBottom="series-center-bottom",Rc.SeriesRightBottom="series-right-bottom",Rc.SeriesLeftBottom="series-left-bottom";const Pc=e.ChartXYTitlePositionOptions.CenterTop,Oc=t=>{switch(t){case"center-top":case"series-center-bottom":return{left:0,right:0,top:0,bottom:5};case"left-top":return{left:20,right:0,top:0,bottom:5};case"right-top":return{left:0,right:20,top:0,bottom:5};case"center-bottom":return{left:0,right:0,top:0,bottom:0};case"left-bottom":return{left:20,right:0,top:0,bottom:0};case"right-bottom":return{left:0,right:20,top:0,bottom:0};case"series-center-top":return{left:0,right:0,top:5,bottom:0};case"series-left-top":return{left:5,right:0,top:5,bottom:0};case"series-right-top":return{left:0,right:5,top:5,bottom:0};case"series-left-bottom":return{left:5,right:0,top:0,bottom:5};case"series-right-bottom":return{left:0,right:5,top:0,bottom:5}}return ze(0,`Unexpected ChartXY title position selection ${t}`)},Lc=(t,e,i,s,r,n)=>{s.x,r.left,r.right;const o=s.y+r.bottom+r.top,h=(r.left-r.right)*e.x,a=(r.bottom-r.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-(n.top+r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i}}return ze(0,`Unexpected ChartXY title position selection ${t}`)},_c=(t,e)=>{const i=[];t.forEach(((t,s)=>{const r=e[s],n=i.find((e=>e.iParallel===t.iParallel));n?(n.stacks.push({...t,...r}),n.stacks.sort(((t,e)=>t.iStack-e.iStack))):i.push({iParallel:t.iParallel,stacks:[{...t,...r}]})}));const s=i.map((t=>{const e=t.stacks.reduce(((t,e)=>Math.max(t,e.Wg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Yg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Qd)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Zd?e.axis.Zd.relative:0)),0);return{...t,ticksSizeMax:e,titleSizeMax:i,sumRelativeSize:r,thicknessMax:s}}));return s.sort(((t,e)=>t.iParallel-e.iParallel)),{groups:s,thicknessTotal:s.reduce(((t,e)=>t+e.thicknessMax),0)}},Bc=(t,e,i)=>{var s;const r=Array.from(new Set(i.map((t=>t.series.fs())))),n=1===r.length&&void 0!==r[0]?r[0]:void 0,o="ProgressiveY"===n||"RegressiveY"===n?{progressiveDimension:"Y",progressiveAxis:e.axisY,valueDimension:"X",hitValueAxis:t=>t.axisX,value:t=>t.x,position:t=>t.y}:{progressiveDimension:"X",progressiveAxis:e.axisX,valueDimension:"Y",hitValueAxis:t=>t.axisY,value:t=>t.y,position:t=>t.x},h=o.progressiveAxis.getTickStrategy();return At(e)?ya(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Ki(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Ki(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:Ki(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):1===i.length?"Time"===h||"DateTime"===h?e.multiHit?[[Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...ya(e,[[e.series,""],[`${o.valueDimension}1`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:[[Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...ya(e,[[e.series,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:e.multiHit?ya(e,[[e.series],[o.progressiveDimension,"",{text:Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[`${o.valueDimension}1`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]]):ya(e,[[e.series],[o.progressiveDimension,"",{text:Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]]):n?[Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),...i.map((t=>t.multiHit?ya(t,[[t.series,""],[`${o.valueDimension}1`,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t.multiHit[0])),o.hitValueAxis(t)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t.multiHit[1])),o.hitValueAxis(t)),font:{weight:"bold"}}]]):ya(t,[[t.series,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()]:i.map((t=>ya(t,[[t.series],[o.progressiveDimension,"",{text:Ki(o.progressiveAxis.formatValue(o.position(t)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()};class Vc{constructor(t,e,i,s,n,o,h){this.coordsRelative="relative",this.coordsClient="client",this.R=new r.Eventer,this.Qk=[],this.Jk=new Map,this.Gv=new Map,this.Kk=(t,e,i)=>{0!==this.Gv.size&&void 0!==[...this.Gv.values()].find((({series:t})=>!0===t.getVisible()))||this.qk.yt(e,i,!1,!1,"zoomBandChart"),this.tT.cs.Ms()},e.cs.Jn(Sh.wf),this.CA=t,this.iT=(null==o?void 0:o.orientation)||"x",this.sT=void 0!==(null==o?void 0:o.useSharedValueAxis)&&o.useSharedValueAxis,this.eT=s,this.qu="x"===this.iT?Ch:Th;const a={...o,defaultAxisX:this.qu.getWidth({x:null==o?void 0:o.defaultAxis,y:void 0}),defaultAxisY:this.qu.getHeight({x:null==o?void 0:o.defaultAxis,y:void 0})};this.tT=new Dc(t,e,i,Ot,n,a,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setCursorMode(void 0),this.engine=this.tT.engine;const l=this.tT.getDefaultAxisX().setMouseInteractions(!1),u=this.tT.getDefaultAxisY().setMouseInteractions(!1);this.qk=this.qu.getWidth({x:l,y:u}).setScrollStrategy(Ks.fitting).setAnimationScroll(!1).setStrokeStyle(ut).setTickStrategy(Js.Empty),(null==o?void 0:o.useSharedValueAxis)?this.hT=this.qu.getHeight({x:l,y:u}):this.qu.getHeight({x:l,y:u}).dispose();const c=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new N({color:this.getTheme().isDark?C(0,0,0,180):C(255,255,255,180)});this.rT=[this.tT.EA.Ee(this.qk.bg).Re(c).Le(ut),this.tT.EA.Ee(this.qk.bg).Re(c).Le(ut)];const d=this.tT.EA.Qg(this.qk.bg).Ye(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.nT={collection:d,members:new Array(5).fill(0).map((t=>d.Zr()))};const f=this.getTheme(),g="function"==typeof f.zoomBandChartKnobFillStyle?It({resourcesBaseUrl:this.CA.te,styleFactory:f.zoomBandChartKnobFillStyle,apply:t=>this.setKnobFillStyle(t)}):f.zoomBandChartKnobFillStyle||_;this.oT=[this.tT.EA.Ee(this.tT._g).Re(g).Le(ut),this.tT.EA.Ee(this.tT._g).Re(g).Le(ut)],this.aT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.lT()}add(t){var e,i,s,r,n;const o=this.Qk.map((t=>t.axis)),h="x"===this.iT?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Kk);this.Qk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.qk.ar(h.nr()),this.uT&&this.uT.remove(),this.uT=pt(...this.Qk.map((t=>t.axis)))}const a=this.qu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.sT)l=this.hT;else{const t=this.Jk.get(a);t?l=t:(l=this.qu.getHeight({x:this.tT.addAxisX.bind(this.tT),y:this.tT.addAxisY.bind(this.tT)})(),this.cT(l)),this.Jk.set(a,l)}const u=this.qu.getWidth({x:this.qk,y:l}),c=this.qu.getHeight({x:this.qk,y:l});let d;const f=[],g=(t,e)=>{const i=t=>{if(0!==t.length)if("x"in t[0]){const i=t;e.add(i)}else{const i=t,s=[];for(let t=0;ti(e)));f.push((()=>t.KM(r)));const n=t.qM((()=>e.clear()));f.push((()=>{t.t_(n)}))};if(t instanceof bc)d=this.tT.addPointLineAreaSeries({...t.io,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setPointAlignment(t.getPointAlignment()).setPointRotation(t.getPointRotation()).setPointShape(t.getPointShape()).setPointSize(t.getPointSize()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.qC());else if(t instanceof xc||t instanceof lc){const i=this.tT.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof xc?null===(e=t.io)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof xc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Gc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof Bu){const e=this.tT.addAreaSeries({xAxis:u,yAxis:c,baseline:t.ew}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof Sc){const e=this.tT.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.io)||void 0===i?void 0:i.pointShape}).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ac){const e=this.tT.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.io)||void 0===s?void 0:s.pointShape,mode:t.Cw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof qu){const e=this.tT.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.io)||void 0===r?void 0:r.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ju){const e=this.tT.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.io)||void 0===n?void 0:n.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Uu){const e=this.tT.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.QM()),i=t.JM(((t,i)=>e.add(i)));f.push((()=>t.KM(i))),d=e;const s=t.qM((()=>e.clear()));f.push((()=>{t.t_(s)}))}else{if(!(t instanceof zu))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.tT.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.u_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.f_(d);const s=t.p_(((t,i)=>e.invalidateIntensityValues(i))),r=t.A_(i);f.push((()=>{t.y_(s),t.g_(r)}));const n=t.qM((()=>e.clear()));f.push((()=>{t.t_(n)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const y=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(y)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.Gv.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.Gv.get(t);if(e){const{clearReferences:i}=e;i(),this.Gv.delete(t),e.series.dispose();const s=this.qu.getHeight({x:t.axisX,y:t.axisY}),r=this.Jk.get(s);r&&0===r.Ng().length&&(this.Jk.delete(s),r.dispose())}const i="x"===this.iT?t.axisX:t.axisY;if(!Array.from(this.Gv.keys()).find((t=>i===("x"===this.iT?t.axisX:t.axisY)))){const t=this.Qk.findIndex((t=>t.axis===i));this.Qk[t].deattach(),this.Qk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.rT.forEach((e=>e.Re(t))),this.tT.cs.Ms(),this}getDefocusOverlayFillStyle(){return this.rT[0].Jh()}setSplitterStrokeStyle(t){return this.nT.collection.Ye(t),this.tT.cs.Ms(),this}getSplitterStrokeStyle(){return this.nT.collection.xu()}setKnobFillStyle(t){return this.oT.forEach((e=>e.Re(t))),this.tT.cs.Ms(),this}getKnobFillStyle(){return this.oT[0].Jh()}setKnobStrokeStyle(t){return this.oT.forEach((e=>e.Le(t))),this.tT.cs.Ms(),this}getKnobStrokeStyle(){return this.oT[0].So()}setKnobSize(t){return this.aT=t,this.tT.cs.Ms(),this}getKnobSize(){return this.aT}getDefaultAxisX(){return this.tT.getDefaultAxisX()}getDefaultAxisY(){return this.tT.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}cT(t){t.setTickStrategy(Js.Empty).setMouseInteractions(!1).setNibStyle(ut).setStrokeStyle(ut)}lT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.iT?null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Gv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.qk.getInterval();Math.abs(this.qk.At.ft(t)-this.qk.At.ft(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(h.start,h.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.qu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const n="x"===this.iT?null===(e=Array.from(this.Gv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.qu.getWidth(this.tT.translateCoordinate(t,this.tT.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),se(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=ns(new hs(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.tT.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.tT.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.iT?null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Gv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.qk.At.pi(o.start,this.qu.getWidth(t)),a=this.qk.At.pi(o.end,this.qu.getWidth(t));i(h,a,!1),se(e)};this.tT.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=ns(new hs(void 0,((t,e,i,r,n)=>s(r,n))));this.tT.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.iT?null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Gv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.qk.getInterval(),a=this.qu.getWidth(this.tT.translateCoordinate(e,this.tT.coordsAxis)),l=this.qk.At.ft(o.start),u=this.qk.At.ft(o.end),c=this.qk.At.ft(a),d=_t((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Zf,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),y=_t(this.qk.At.pi(o.start,g),h.start,h.end),p=_t(this.qk.At.pi(o.end,m),h.start,h.end);i(y,p,!1),se(e)})),this.tT.onSeriesBackgroundTouchStart(r.onTouchStart),this.tT.onSeriesBackgroundTouchMove(r.onTouchMove),this.tT.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.rT.forEach(((s,r)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const r="x"===this.iT?null===(e=Array.from(this.Gv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.qu.getWidth(this.tT.translateCoordinate(t,this.tT.coordsAxis)),o=r.getInterval(),h=this.qk.getInterval(),a=_t(n-(o.end-o.start)/2,Math.min(h.start,h.end),Math.max(h.start,h.end)-Math.abs(o.end-o.start)),l=a+(o.end-o.start);i(a,l,!0),se(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=ns(new class{constructor(t,e=300){this.Ns=!1,this.Gs=[],this.Us=300,this.Ws=t,this.Us=e}Vs(t,e){const i=zt.performance.now();let s=!1;for(let t=0;t=this.Us?(this.Gs.splice(t,1),t-=1):this.Gs[t].state&&(s=!0);return this.Ns?0===e.interactions.length&&(this.Gs.push({state:!1,time:i}),this.Ns=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Gs.push({state:!0,time:i}),s=!0,this.Ns=!0),s}Os(t,e,i){if(i&&!this.Ns){const i=this.Gs.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Ws(t,e),this.Gs.length=0)}}}(((t,e)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.tT.getSizePixels()}onResize(t){return this.tT.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.tT.offResize(t)}Gr(t){this.tT.Gr(t)}getMinimumSize(){return this.tT.getMinimumSize()}J(){return this.tT.J()}K(){return this.tT.K()}ze(t){var e,i,s,r;const n=we(Array.from(this.Gv.keys()).map((t=>t.chart))),o="x"===this.iT?null===(e=Array.from(this.Gv.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.Gv.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.iT){const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(0!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),e=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(100!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=n.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.tT.forEachAxisY((t=>t.setThickness(0))),null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.tT.setPadding({left:i+(0===n.length?10:0),right:r+e+(0===n.length?10:0)})}else{const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisX((t=>{if(0!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),e=n.reduce(((t,e)=>{const i=[];e.forEachAxisX((t=>{if(100!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=n.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.tT.forEachAxisX((t=>t.setThickness(0))),null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.tT.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.tT.ze(t);const h=this.qk.getInterval().start,a=this.qk.getInterval().end,l=_t(o?o.getInterval().start:h,h,a),u=_t(o?o.getInterval().end:a,h,a),c=this.qu.getHeight(this.tT.ik.getInnerIntervalPixels());this.rT[0].Ve(this.qu.toPoint(h,0)).it(this.qu.toPoint(l-h,c)),this.rT[1].Ve(this.qu.toPoint(u,0)).it(this.qu.toPoint(a-u,c)),this.nT.members[0].Kg(this.qu.toPoint(h,c),this.qu.toPoint(l,c)),this.nT.members[1].Kg(this.qu.toPoint(l,c),this.qu.toPoint(l,0)),this.nT.members[2].Kg(this.qu.toPoint(l,0),this.qu.toPoint(u,0)),this.nT.members[3].Kg(this.qu.toPoint(u,0),this.qu.toPoint(u,c)),this.nT.members[4].Kg(this.qu.toPoint(u,c),this.qu.toPoint(a,c));const d=yt(this.qu.toPoint(l,c/2),this.qk.bg,this.tT._g),f=yt(this.qu.toPoint(u,c/2),this.qk.bg,this.tT._g),g=this.aT;this.oT[0].Ve({x:d.x-g.x/2,y:d.y-g.y/2}).it({x:g.x,y:g.y}).sr(this.qu.getWidth({x:0,y:90})),this.oT[1].Ve({x:f.x-g.x/2,y:f.y-g.y/2}).it({x:g.x,y:g.y}).sr(this.qu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.tT.setSeriesBackgroundFillStyle(t),this.tT.cs.Ms(),this}getSeriesBackgroundFillStyle(){return this.tT.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.tT.setSeriesBackgroundStrokeStyle(t),this.tT.cs.Ms(),this}getSeriesBackgroundStrokeStyle(){return this.tT.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.tT.setSeriesBackgroundEffect(t),this.tT.cs.Ms(),this}getSeriesBackgroundEffect(){return this.tT.getSeriesBackgroundEffect()}getTheme(){return this.tT.getTheme()}setTitle(t){return this.tT.setTitle(t),this}getTitle(){return this.tT.getTitle()}setTitleFillStyle(t){return this.tT.setTitleFillStyle(t),this}getTitleFillStyle(){return this.tT.getTitleFillStyle()}setTitleFont(t){return this.tT.setTitleFont(t),this}getTitleFont(){return this.tT.getTitleFont()}setTitleMargin(t){return this.tT.setTitleMargin(t),this}getTitleMargin(){return this.tT.getTitleMargin()}setPadding(t){return this.tT.setPadding(t),this}getPadding(){return this.tT.getPadding()}setBackgroundFillStyle(t){return this.tT.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.tT.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.tT.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.tT.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return aa(t,e,i,this.tT._g,this.tT.cs)}addUIElement(t,e){return this.tT.addUIElement(t,e)}addLegendBox(t,e){return this.tT.addLegendBox(t,e)}getLegendBoxes(){return this.tT.getLegendBoxes()}saveToFile(t,e,i){return this.tT.saveToFile(t,e,i),this}dispose(){return this.tT.dispose(),this.Jk.clear(),this.Gv.clear(),this.eT(this),this}isDisposed(){return this.tT.isDisposed()}onDispose(t){return this.tT.onDispose((()=>t(this)))}offDispose(t){return this.tT.offDispose(t)}}const Gc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof xc||t instanceof Bu?t.getStrokeStyle().getFillStyle():t instanceof Sc||t instanceof ju?t.getPointFillStyle():void 0)(t);return e?new us({thickness:2,fillStyle:e}):void 0};class Nc extends ru{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Cs="Point Series",this.eM=[],this.hM=!1,this.lM=3,this.ka=0,this.Ie=ve(this.ts.polarPointSeriesFillStyle,o),this.Sd=new So({dataPattern:null}),this.qa=t._d(r).Ye(ut).Md(_).bd(this.Ie).wd(e.PointShape.Circle).Id(this.lM).ds(this.getHighlight()).xd(this.Sd),this.As(this.qa)}solveNearest(t,e="show-nearest"){const i=this.chart.translateCoordinate(t,this.chart.coordsAxis),s=nu([i],this.scale)[0],r=this.Sd.hd(s,ma(e),this.scale,this.chart._g);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.eM.length&&this.chart.cs.Jn(Sh.Df),this.eM=hu(t),this.hM=!0,this.Kb=ou(this.eM),this.Rs.Ms(),this}setPointAlignment(t){return this.qa.QC(t),this.chart.cs.Ms(),this}getPointAlignment(){return this.qa.JC()}setPointFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;return this.qa.bd(e),this.Rs.Ms(),this}getPointFillStyle(){return this.Ie}setPointSize(t){return this.lM=t,this.qa.Id(t),this.Rs.Ms(),this}getPointSize(){return this.lM}setPointShape(t){return this.qa.wd(t),this.chart.cs.Ms(),this}getPointShape(){return this.qa.Cd()}setPointRotation(t){return this.ka=t,this.qa.kd(t),this.Rs.Ms(),this}getPointRotation(){return this.ka}Av(){return this.yv&&this.eM.length>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){if(this.hM||this.scale.aM()){const t=nu(this.eM,this.scale),e=ni(t);this.Sd.clear().add(t),this.qa.sa(e),this.hM=!1,this.qa.Os()}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}Bs(){return this.ws||this.getPointShape()}}class Uc{constructor(t,e,i,s){this.R=new r.Eventer,this.dT=!1,this.ae=t,this.fT=e,this.Gv=i,this.qa=s}setGeometry(t){return this.AT=t,this.dT=!0,this.ae.cs.Ms(),this}getGeometry(){return this.AT}setMouseInteractions(t){return this.qa.setMouseInteractions(t),this}dispose(){return this.qa.dispose(),this.fT(this),this.R.emit("dispose",this),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.qa.getVisible()!==t;return this.qa.setVisible(t),e&&this.R.emit("visibleStateChanged",this,t),this.ae.cs.Ms(),this}getVisible(){return this.qa.getVisible()}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Yc extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Polygon Series",this.gT=[],this.pT=[],this.yT=t=>{const e=this.pT.indexOf(t);e>=0&&this.pT.splice(e,1);const i=this.gT.findIndex((e=>e===t.qa));i>=0&&this.gT.splice(i,1),this.Rs.Ms()},this.Ie=ve(this.ts.polarPolygonSeriesFillStyle,n),this.Pe=ve(this.ts.polarPolygonSeriesStrokeStyle,n)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Su(s,this.gT,((t,e)=>{const i=t.hd(e);if(i)return yt(i,this.scale,t.cs.At)}),ei);if(!r)return;const n=yt(r[0],r[1].cs.At,this.scale);if(!this.mT(r[1]))return;const o=au(n,this.scale);return{cursorPosition:{pointMarker:n,pointMarkerScale:this.scale,resultTable:n,resultTableScale:this.scale},series:this,...o}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}addPolygon(){const t=new Uc(this.chart,this.yT,this,this.vT());return this.pT.push(t),t}setFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;for(const t of this.gT)t.Re(e);return this.Rs.Ms(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){this.Pe="function"==typeof t?t(this.Pe):t;const e=this.Pe;for(const t of this.gT)t.Le(e);return this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}Av(){return this.yv&&void 0!==this.pT.find((t=>void 0!==t.ST))&&this.getVisible()}ze(){this.pT.forEach((t=>{(t.dT||this.scale.aM())&&t.xT&&(t.qa.Fl(nu(t.xT,this.scale)),t.dT=!1,t.qa.Os())}))}Cv(){super.Cv();const t=m(Ye,He);this.pT.forEach((e=>{if(!e.AT)return;const i=!e.dT&&e.xT?e.xT:hu(e.AT);e.xT=i;const s=!e.dT&&e.ST?e.ST:ou(i);e.ST=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Kb=t}Oe(t,e){t.ds(e),this.Rs.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}vT(){const t=this.Rs.fc(this.scale,Tn.Simple).Re(this.Ie).Le(this.Pe).ds(this.getHighlight());return this.gT.push(t),this.As(t),t}mT(t){return this.pT.find((e=>e.qa===t))}}class Hc extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Area Series",this.eM=[],this.hM=!1,this.rM=!1,this.bT=!1,this.Ie=ve(this.ts.polarAreaSeriesFillStyle,n),this.Pe=ve(this.ts.polarAreaSeriesStrokeStyle,n)}setData(t){0!==this.eM.length&&this.chart.cs.Jn(Sh.Df);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}}class Xc extends Hc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.MT=this.Rs.fc(this.scale,Tn.Simple).ds(this.getHighlight()),this.As(this.MT)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=this.MT.hd(s);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}ze(){if(this.hM||this.scale.aM()){const t=this.eM,e=!0===this.rM?nu(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Lt(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;!Lt(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._T.start}Hb(t){this.wT=t,this.IT=!0}$b(){return!1===this.wT}Xb(t){this.CT=t,this.IT=!0}Ub(){return this.CT}yi(){return this.Si}_i(){return!1}ct(t,e,i,s){return this.x=new Gi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Gi(t.y,e.y,i.y,s?s.y:void 0),this}mi(){return this.di}aM(){return this.FT}BT(){return this.IT}Ui(){return this.PT}J(){return this.u=!1,this.Si=!1,this.FT=!1,this.IT=!1,this}K(){return this.u=!0,this.Si=!0,this.FT=!0,this.IT=!0,this}it(t,e){return"object"==typeof t?(this.Z.x=t.x,this.Z.y=t.y):(this.Z.x=t,this.Z.y=e),this.DT(),this}Ei(t){return this.kT=t,this.DT(),this}zi(t){return this.TT=t,this.DT(),this}ni(){return u(this.kT[0]+this.kT[1],this.TT[0]+this.TT[1])}oi(){return this.Z}DT(){const t=this._T,e=u(this.x.ai(this.Z.x),this.y.ai(this.Z.y)),i=this.kT[0]+this.kT[1],s=this.TT[0]+this.TT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.kT[0]+Math.max((r-2*o)/2,0),this.kT[1]+Math.max((r-2*o)/2,0)],a=[this.TT[0]+Math.max((n-2*o)/2,0),this.TT[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.it(this.Z.x).si(h).q(-l,l),this.y.it(this.Z.y).si(a).q(-l,l),this.PT={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.mi(),y:this.y.mi()},this.K()}pi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Wi(t,e,i,s){const r=this.Ui(),n=fi(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 jc extends Sl{constructor(t,e,i,s,r,n,o){super(t,e,i,e.Bp("polarChart bg",0),s,e.cs.ts.polarChartBackgroundFillStyle,e.cs.ts.polarChartBackgroundStrokeStyle,e.cs.ts.polarChartTitleFont,e.cs.ts.polarChartTitleFillStyle,o),this.coordsClient="client",this.cA=[],this.Yo=!0,this.LT=(t,e,i,s,r)=>{this._b.it(s,r)},this.gA=he(this.cA),this.RT=t=>{this.cA.push(t)},this.ET=()=>this.Gv,this.cs.Jn(Sh.Mf),this.Gk=e.Lx("polarChart series bg",0),this.zT=e.tm("polarChart axis gridlines",0),this.VT=e.tm("polarChart series",1),this.OT=e.tm("polarChart axis lines",2),this.NT=e.tm("polarChart axis ticks",3),this._b=i.d2({scaleXYConstructor:Wc}),this.onResize(this.LT),this.Ch.Sr("Polar Chart"),this.Xv=this.Gk.ud(this._b).Re(this.ts.polarChartSeriesBackgroundFillStyle).Le(ut).Au(0).Xe(360).mu(0),this.$v=this.Gk.ud(this._b).Re(_).Le(this.ts.polarChartSeriesBackgroundStrokeStyle).Au(0).Xe(360).mu(0),super.Hv(this.Xv,this.$v),this.Dp(r,this._g),this.GT=new Zl(this,this._b,this.ts,!1!==(null==n?void 0:n.animationsEnabled),this.zT,this.OT,this.NT,this.hs,this.ET),this.UT=new Kl(this,this._b,this.ts,!1!==(null==n?void 0:n.animationsEnabled),this.zT,this.OT,this.NT,this.hs),this.coordsAxis={axisAmplitude:this.GT,axisRadial:this.UT};const h=e.sm(),a=Vt(n?n.cursorBuilder:void 0,Pa);this.hm=pa(this,h,a._y(h,this.uiScale,this.uiScale,Ot,this.ts),this,"show-nearest",Zc,((t,e)=>{const i=this.translateCoordinate(t,this.coordsClient);return Math.sqrt((i.clientX-e.clientX)**2+(i.clientY-e.clientY)**2)})),this.setAnimationsEnabled(!1!==(null==n?void 0:n.animationsEnabled))}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.hm.solveNearest(t,e,this.Gv,((t,e,i)=>t.solveNearest(e,i)))}addCursor(t=Pa){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}translateCoordinate(t,e,i){if(i){const e=t,s=this._g,r=i;if(Wi(r)){const t=yt(e,s,this.cs.At);return this.cs.Wo({engineX:t.x,engineY:t.y})}if($i(r))return e;if(tu(r)){const t=yt(e,s,this._b);return au(t,this._b)}}else{const i=t,s=e;if(ji(i)){if(tu(s)){const t=this.cs.Uo(i),e=yt({x:t.engineX,y:t.engineY},this.cs.At,this._b);return au(e,this._b)}if(Wi(s))return i;if($i(s)){const t=this.cs.Uo(i);return yt({x:t.engineX,y:t.engineY},this.cs.At,this._g)}}else if(eu(i)){if(tu(s))return i;const t=nu([i],this._b)[0];if(Wi(s)){const e=yt(t,this._b,this.cs.At),i={engineX:e.x,engineY:e.y};return this.cs.Wo(i)}if($i(s))return yt(t,this._b,this._g)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new uu(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPointSeries(t){const e=new Nc(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPointLineSeries(t){const e=new cu(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addAreaSeries(t){const e=new Xc(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPolygonSeries(t){const e=new Yc(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addHeatmapSeries(t){const e=new lu(this.VT,this,this.Wv,this._b,this.ts,this.cs.hs,t);return this.jv(e),e}addSector(){const t=new iu(this.VT,this,this.gA,this._b,this.ts,this.cs.hs);return this.RT(t),t}getAmplitudeAxis(){return this.GT}get amplitudeAxis(){return this.GT}get axisAmplitude(){return this.GT}getRadialAxis(){return this.UT}get radialAxis(){return this.UT}get axisRadial(){return this.UT}ze(t){var e,i;super.ze(t),ga.Gp(this.Ch,this.Lp);for(const t of this.Gv)t.Cv();this.GT.Rr(),this.UT.Rr();for(const t of this.Gv)t.ze();for(let t=1;t<=2;t+=1){const e=this.GT.ze(),i=this.UT.ze(),s=ga.Np(this.Ch,this.Lp),r=[this.Ia.left+i,this.Ia.right+i],n=[this.Ia.bottom+i,this.Ia.top+i+s];this._b.Ei(r).zi(n);const o=4;if(!(!this.WT||Math.abs(this.WT.amplitude-e)>=o||Math.abs(this.WT.radial-i)>=o)||1!==t){this.WT={amplitude:e,radial:i};break}}const s=this._b.zb().start,r=this._b.zb().end,n=this._b.Eb()?((null===(e=this.WT)||void 0===e?void 0:e.radial)||0)*this._b.x.getPixelSize()+r-s:((null===(i=this.WT)||void 0===i?void 0:i.radial)||0)*this._b.x.getPixelSize()+s-r;this.Xv.gu(n).vu(360),this.$v.gu(n).vu(360);for(const t of this.cA)t.ze();this.hm.ze(!1,this.Gv,((t,e,i)=>t.solveNearest(e,i)));for(const t of this.Gv)t.Pm();return super.Pp(),this.YT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.GT.setAnimationsEnabled(t),this.UT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.Yo=t,this}getMouseInteractions(){return this.Yo}getMinimumSize(){return u($c,$c)}YT(){}forEachAxis(t){return t(this.GT),t(this.UT),this}dispose(){return this.cA.slice().forEach((t=>t.dispose())),this.hm.Y(),this.Gk.Y(),this.zT.Y(),this.VT.Y(),this.OT.Y(),this.NT.Y(),super.dispose()}af(){return[...this.Gv,...this.cA]}}const $c=300,Zc=(t,e,i)=>{var s;return St(e)?ya(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:Ki(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}],["Intensity","",{text:Ki(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]]):ya(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:Ki(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}]])};class qc extends Ga{}class Kc extends qc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Cs="Slice",this.M=0,this.wy=!1,this.HT=_,this.ky=_,this.Ty=this.M,this.Py=q((()=>this.chart.cs.Ms())),this.By=()=>{this.Ly=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.MT=e.fc(r,Tn.Simple).ds(this.getHighlight()),this.As(this.MT),this.rh=i.Wr(r).ds(this.getHighlight()),this.As(this.rh,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Vy(this.Ty,t):this.Ty=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.Ty>0?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),this.Vy(this.Ty,0,(()=>super.setVisible(!1)))):(this.Ty=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),super.setVisible(!0),this.Vy(this.Ty,this.M)):(this.Ty=this.M,super.setVisible(!0)),this}Vy(t,e,i){this.Ly=this.Py(300,$.ease)([[t,e]],(([t])=>{this.Ty=t,this.chart.cs.Ms()})),this.Ly.onEveryAnimationEnd(this.By),i&&this.Ly.onAnimationEnd(i)}setStyle(t,e,i,s){this.HT=t,this.ky=i,this.MT.Re(this.HT).Le(e),this.rh.Re(this.ky).ir(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},td=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Qc(i,r.x),s=Qc(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},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:a+S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>g.x&&p.MT.Fl([g,d,f,m])}};class ed extends fa{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("funnelChart bg",0),r,i.cs.ts.funnelChartBackgroundFillStyle,i.cs.ts.funnelChartBackgroundStrokeStyle,i.cs.ts.funnelChartTitleFont,i.cs.ts.funnelChartTitleFillStyle,o),this.Oy=[],this.Ny=Ba.None,this.Wy=!0,this.Xy=0,this.XT=80,this.$T=20,this.jT=0,this.ZT=e.FunnelSliceModes.VariableHeight,this.Zy=!0,this.Jy=t=>{const e=this.Oy.indexOf(t);e>=0&&(this.Oy.splice(e,1),this.Ky())},this.cs.Jn(Sh.Sf),this.Qy=this.ts.effectsText,this.qy=i.tm("funnelChart bottom",0),this.im=i.tm("funnelChart top",1),this.Ch.Sr("Funnel Chart"),this.Gy=this.ts.funnelChartSliceFillStylePalette,this.Uy=this.ts.funnelChartSliceStrokeStyle,this.Yy=this.ts.funnelChartSliceLabelFont,this.Hy=this.ts.funnelChartSliceLabelFillStyle;const a=i.sm(),l=Vt(h?h.cursorBuilder:void 0,Ra);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",id,(()=>0)),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled)),this.Dp(n,this._g)}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Ra){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addSlice(t,e){const i=new Kc(this.Xy,this.qy,this.im,this,this._g,this.Jy,this.ts,this.cs.hs);return this.Xy+=1,i.setName(t),i.setValue(e),i.hs.ns.bs(this.Qy),i.hs.os.bs(this.Zy),this.Oy.push(i),this.cs.Ms(),i.setHighlightOnHover(this.Wy),i.onMouseMove((()=>{this.getCursorMode()&&this.cs.Ms()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.bs(t))),this.cs.Ms(),this}getSliceEffect(){return this.Zy}setSliceSorter(t){return this.Ny=t,this.Oy=this.Oy.sort(this.Ny),this.cs.Ms(),this}getSliceSorter(){return this.Ny}setLabelFillStyle(t){return this.Hy="function"==typeof t?t(this.Hy):t,this.cs.Ms(),this}getLabelFillStyle(){return this.Hy}setLabelFont(t){return this.Yy="function"==typeof t?t(this.Yy):t,this.cs.Ms(),this}getLabelFont(){return this.Yy}setLabelEffect(t){return this.Qy=t,this.Oy.forEach((e=>e.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Qy}setLabelFormatter(t){return this.nm=t,this.cs.Ms(),this}getLabelFormatter(){return this.nm}setSliceHighlightOnHover(t){return this.Wy=t,this.Oy.forEach((e=>e.setHighlightOnHover(t))),this}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=ga.Np(this.Ch,this.Lp),i=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+e)),s=u(this.Ia.left+i.x/2,this.Ia.bottom+i.y/2);this.Oy=this.Oy.sort(this.Ny);for(let t=0,{length:e}=this.Oy;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.om(r,o,s,i)}rm(t,e){t.setStyle(this.Kd?new N({color:this.Kd.getColors(t.getAnimatedValue())}):this.Gy(e,t),this.Uy,this.Hy,this.Yy)}Ky(){this.Oy=this.Oy.sort(this.Ny),this.cs.Ms()}af(){return this.Oy}dispose(){return this.Oy.slice().forEach((t=>t.dispose())),this.hm.Y(),this.qy.Y(),this.im.Y(),super.dispose()}}const id=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],sd=(t,i,s)=>{const r=t.Il();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}}},rd=t=>{const e=t.Il();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 nd extends ed{constructor(){super(...arguments),this.nm=Va.NamePlusValue,this.QT=10,this.JT=e.FunnelLabelSide.Left,this.KT=e.SliceLabelIndices.LabelsOnSides,this.am=[],this.fm=this.ts.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.fm=t;for(let t=0;tt.rh.setVisible(!1))),void this.am.forEach((t=>t.setVisible(!1)));this.qT(t,this.JT===e.FunnelLabelSide.Left?-1:1,-1,s,r);for(let t=0;tthis.chart.cs.Ms())),this.By=()=>{this.Ly=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.MT=e.fc(r,Tn.Simple).ds(this.getHighlight()),this.As(this.MT),this.rh=i.Wr(r).ds(this.getHighlight()),this.As(this.rh,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Vy(this.Ty,t):this.Ty=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.Ty>0?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),this.Vy(this.Ty,0,(()=>super.setVisible(!1)))):(this.Ty=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),super.setVisible(!0),this.Vy(this.Ty,this.M)):(this.Ty=this.M,super.setVisible(!0)),this}Vy(t,e,i){this.Ly=this.Py(300,$.ease)([[t,e]],(([t])=>{this.Ty=t,this.chart.cs.Ms()})),this.Ly.onEveryAnimationEnd(this.By),i&&this.Ly.onAnimationEnd(i)}setStyle(t,e,i,s){this.HT=t,this.ky=i,this.MT.Re(this.HT).Le(e),this.rh.Re(this.ky).ir(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},fd=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=dd(i,r.x),s=dd(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},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:a+S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>=g.x&&p.MT.Fl([g,d,f,m])}};class gd extends fa{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("pyramidChart bg",0),r,i.cs.ts.pyramidChartBackgroundFillStyle,i.cs.ts.pyramidChartBackgroundStrokeStyle,i.cs.ts.pyramidChartTitleFont,i.cs.ts.pyramidChartTitleFillStyle,o),this.Oy=[],this.Ny=Ba.None,this.Gy=this.ts.pyramidChartSliceFillStylePalette,this.Uy=this.ts.pyramidChartSliceStrokeStyle,this.Wy=!0,this.Yy=this.ts.pyramidChartSliceLabelFont,this.Hy=this.ts.pyramidChartSliceLabelFillStyle,this.Xy=0,this.XT=0,this.$T=80,this.jT=0,this.ZT=e.PyramidSliceModes.VariableHeight,this.Zy=!0,this.Jy=t=>{const e=this.Oy.indexOf(t);e>=0&&(this.Oy.splice(e,1),this.Ky())},this.cs.Jn(Sh.Sf),this.Qy=this.ts.effectsText,this.qy=i.tm("pyramidChart bottom",0),this.im=i.tm("pyramidChart top",1),this.Ch.Sr("Pyramid Chart");const a=i.sm(),l=Vt(h?h.cursorBuilder:void 0,Ra);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",md,(()=>0)),this.Dp(n,this._g),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled))}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Ra){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addSlice(t,e){const i=new cd(this.Xy,this.qy,this.im,this,this._g,this.Jy,this.ts,this.cs.hs);return this.Xy+=1,i.setName(t),i.setValue(e),i.hs.ns.bs(this.Qy),i.hs.os.bs(this.Zy),this.Oy.push(i),this.cs.Ms(),i.onMouseMove((()=>{this.getCursorMode()&&this.cs.Ms()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.bs(t))),this.cs.Ms(),this}getSliceEffect(){return this.Zy}setSliceSorter(t){return this.Ny=t,this.Oy=this.Oy.sort(this.Ny),this.cs.Ms(),this}getSliceSorter(){return this.Ny}setLabelFillStyle(t){return this.Hy="function"==typeof t?t(this.Hy):t,this.cs.Ms(),this}getLabelFillStyle(){return this.Hy}setLabelFont(t){return this.Yy="function"==typeof t?t(this.Yy):t,this.cs.Ms(),this}getLabelFont(){return this.Yy}setLabelEffect(t){return this.Qy=t,this.Oy.forEach((e=>e.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Qy}setLabelFormatter(t){return this.nm=t,this.cs.Ms(),this}getLabelFormatter(){return this.nm}setSliceHighlightOnHover(t){return this.Wy=t,this.Oy.forEach((e=>e.setHighlightOnHover(t))),this}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=ga.Np(this.Ch,this.Lp),i=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+e)),s=u(this.Ia.left+i.x/2,this.Ia.bottom+i.y/2);this.Oy=this.Oy.sort(this.Ny);for(let t=0,{length:e}=this.Oy;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.om(r,o,s,i)}rm(t,e){t.setStyle(this.Kd?new N({color:this.Kd.getColors(t.getAnimatedValue())}):this.Gy(e,t),this.Uy,this.Hy,this.Yy)}Ky(){this.Oy=this.Oy.sort(this.Ny),this.cs.Ms()}af(){return this.Oy}dispose(){return this.Oy.slice().forEach((t=>t.dispose())),this.hm.Y(),this.qy.Y(),this.im.Y(),super.dispose()}}const md=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],yd=(t,i,s)=>{const r=t.Il();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}}},pd=t=>{const e=t.Il();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 Ad extends gd{constructor(){super(...arguments),this.nm=Va.NamePlusValue,this.QT=10,this.JT=e.PyramidLabelSide.Left,this.KT=e.SliceLabelIndices.LabelsOnSides,this.am=[],this.fm=this.ts.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.fm=t;for(let t=0;tt.rh.setVisible(!1))),void this.am.forEach((t=>t.setVisible(!1)));this.qT(t,this.JT===e.PyramidLabelSide.Left?-1:1,-1,s,r);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),Md=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Cd;e.SpiderWebMode=void 0,(Cd=e.SpiderWebMode||(e.SpiderWebMode={}))[Cd.Normal=0]="Normal",Cd[Cd.Circle=1]="Circle";class Td{constructor(t,e,i,s,n,o,h,a){this.R=new r.Eventer,this.iF=t,this.Yr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.sF=h,this.eF=a,this.hF=this.iF.He(this.scale).setMouseInteractions(!1),this.rF=this.Yr.Wr(this.scale).Sr(this.tag).setMouseInteractions(!1),this.nF=this.sF(this,this.iF.gm(this.scale,void 0,[Za.InternalUI])).Ye(this.chart.getNibStyle()),this.eF.gs([this.rF])}om(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.rF.setVisible(!0).Ve(yi(c,u(h.paddingX,h.paddingY))).Ha(h.alignmentX).$a(h.alignmentY):this.rF.setVisible(!1)}getLabelSize(){return this.rF.ir(this.chart.getAxisLabelFont()).Re(this.chart.getAxisLabelStyle()).Os().oi()}dispose(){this.hF&&this.hF.dispose(),this.rF&&this.rF.dispose(),this.nF&&this.nF.dispose()}}class wd extends su{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Cs="Spider Series",this.Tu=new Map,this.$i=e.HighlightModes.onHover,this.lM=8,this.ka=0,this.oF=(()=>{const t=q((()=>{}));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)||$.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)}})(),this.aF={},this.lF={},this.Iy=this.getVisible(),this.uF=1,this.cF=((t,e)=>{const i=q((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||$.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.uF=t,this.Rs.cs.Ms()}),(t=>{super.setVisible(t)})),this.chart=t,this.Rs=i,this.uM=r,this.dF=n,this.Rx=o,this.fF=h,this.AF=a,this.scale=s,this.gF=ve(u.spiderSeriesFillStyle,c),this.pF=ve(u.spiderSeriesStrokeStyle,c),this.yF=ve(u.spiderSeriesPointFillStyle,c)}Ki(t,e){const i=this.AF(e);if(void 0!==i&&this.Tu.has(i.tag)){const t=this.Tu.get(i.tag),e=this.fF(i.tag,t);return{cursorPosition:{pointMarker:e,pointMarkerScale:this.scale,resultTable:e,resultTableScale:this.scale},series:this,axis:i.tag,value:t}}}Av(){return this.yv&&this.Tu.size>0&&this.getVisible()}addPoints(...t){this.Tu.size>0&&this.chart.cs.Jn(Sh.Df),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.oF(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.Tu.set(s,r+t*(e-r)),this.Rs.cs.Ms()}))}),{easing:this.aF.easing,durationMs:this.aF.durationMs,onStart:()=>{i=new Map(this.Tu)}})}else for(let e=0;e=3&&(this.MT||(this.MT=this.Rs.fc(this.scale,Tn.Simple).Le(this.pF).Re(this.gF).ds(this.getHighlight()),this.As(this.MT)),this.MT.Fl(t),this.cM||(this.cM=this.Rs.Nv(this.scale).it(this.lM).dl(this.uM).sr(this.ka).Re(this.yF).ds(this.getHighlight()),this.As(this.cM)),this.cM.Ot().ml(t))}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.gF,stroke:this.pF})}Bs(){return this.ws||this.uM}mF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},kd=t=>ni(t.rF.hh()),Id=t=>ni(t.hh()),zd=(t,i,s,r)=>t.mu(0).Ve(s).Au(90).Xe(-270).vu(i===e.SpiderWebMode.Circle?void 0:r.length),Fd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Rd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Dd=()=>{Rd.alignmentX=0,Rd.alignmentY=0,Rd.paddingX=0,Rd.paddingY=0};class Pd extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("spiderChart bg",0),r,i.cs.ts.spiderChartBackgroundFillStyle,i.cs.ts.spiderChartBackgroundStrokeStyle,i.cs.ts.spiderChartTitleFont,i.cs.ts.spiderChartTitleFillStyle,h),this.Ia=A(20,20,20,20),this.axisScale=gt.d1({scale1DConstructor:Gi,dimension:"x"}).q(0,1),this.Rx=[],this.vF=[],this.SF=[],this.xF=Ks.expansion,this.bF=!0,this.MF=Md,this._F=bd,this.Yo=!0,this.wF=e.SpiderWebMode.Normal,this.CF=4,this.kF=this.ts.spiderChartWebStyle,this.TF=this.ts.spiderChartScaleLabelFillStyle,this.FF=this.ts.spiderChartScaleLabelFont,this.IF=5,this.PF=this.ts.spiderChartAxisLabelFillStyle,this.DF=this.ts.spiderChartAxisLabelFont,this.BF=5,this.LF=this.ts.spiderChartAxisStrokeStyle,this.RF=this.ts.spiderChartAxisNibStrokeStyle,this.Hf=10,this.EF=A(),this.hasAxis=t=>this.Rx.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Bi.Numeric),this.zF=()=>{const t=this.Rx.map(kd).concat(this.SF.map(Id));return Ke(t)},this.VF=()=>this.OF.ud(this._g).setMouseInteractions(!1),this.NF=t=>t.dispose(),this.GF=()=>this.EA.Wr(this._g).setMouseInteractions(!1),this.UF=t=>t.dispose(),this.WF=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.YF=(t,e)=>{let i,s;const r=()=>{void 0!==this.HF&&this.HF.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.xF,this.xF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Rx.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Ed(a,this.Rx.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=gi(pi(t.hF.Ii(),t.hF.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.q(i.min,l),se(o),this.cs.Ms()}},o=()=>{if(i=void 0,void 0!==s)if(this.ph){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.XF(),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.HF=this.gp.cs.An(300,$.ease)([[0,1]],(([e])=>{this.axisScale.q(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.HF.onAnimationEnd((()=>{this.HF=void 0,this.xF=i}))}else this.xF=s}else this.xF=s;s=void 0};e.setMouseEnterEventHandler(this.$F).setMouseLeaveEventHandler(this.jF).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=ns(new hs(((t,e,i)=>{this.$F(t),r(),se(i)}),n,((t,e,i,s)=>{this.jF(t),o(),se(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.ZF=t=>{this.bF&&!this.hasAxis(t)&&this.addAxis(t)},this.fF=(t,e)=>{for(const i of this.Rx)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return si(i.hF.Ii(),i.hF.Ti(),t)}},this.AF=t=>{if(0===this.Rx.length)return;const e=pi(this.translateCoordinate(t,this.coordsRelative),this.Rx[0].hF.Ii()),i=Math.atan2(e.y,e.x);let s,r=Ye;for(const t of this.Rx){const e=pi(t.hF.Ti(),t.hF.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.Yo&&(t.Ye(this.RF),this.cs.Ms())},this.jF=t=>{t.Ye(this.RF),this.cs.Ms()},this.cs.Jn(Sh.bf),this.Gk=i.Lx("spiderChart series bg",0),this.OF=i.tm("spiderChart web shapes",0),this.QF=i.tm("spiderChart axis bg",1),this.lb=i.tm("spiderChart plotting",2),this.EA=i.tm("spiderChart fg",3),this.eF=this.hs.Bg().bs(this.ts.effectsText),this.Ch.Sr("Spider Chart"),this.Xv=this.Gk.ud(this._g).Re(this.ts.spiderChartSeriesBackgroundFillStyle).Le(ut).Au(90).Xe(-270).mu(0),this.$v=this.Gk.ud(this._g).Re(_).Le(this.ts.spiderChartSeriesBackgroundStrokeStyle).Au(90).Xe(-270).mu(0),super.Hv(this.Xv,this.$v);const a=i.sm(),l=Vt(o?o.cursorBuilder:void 0,za);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),this,"show-pointed",Od,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.Dp(n,this._g)}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=za){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Td(this.QF,this.EA,this._g,this,t,this.axisScale,this.YF,this.eF);this.Rx.push(e)}}else t&&this.Rx.push(t);return this.eF.gs(this.Rx.map((t=>t.rF))),this.cs.Ms(),this}addSeries(t){const i=void 0!==(null==t?void 0:t.pointShape)?t.pointShape:e.PointShape.Circle,s=void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,r=new wd(this,this.lb,this._g,i,this.ZF,this.Rx,this.fF,this.AF,this.Wv,this.ts,s,this.cs.hs);return this.jv(r),r}getSeriesCount(){return this.Gv.length}setWebMode(t){return this.wF=t,this.cs.Ms(),this}getWebMode(){return this.wF}setWebCount(t){return this.CF=t,this.cs.Ms(),this}getWebCount(){return this.CF}setWebStyle(t){return this.kF="function"==typeof t?t(this.kF):t,this.cs.Ms(),this}getWebStyle(){return this.kF}setScaleLabelStyle(t){return this.TF="function"==typeof t?t(this.TF):t,this.cs.Ms(),this}getScaleLabelStyle(){return this.TF}setScaleLabelFont(t){return this.FF="function"==typeof t?t(this.FF):t,this.cs.Ms(),this}getScaleLabelFont(){return this.FF}setScaleLabelPadding(t){return this.IF=t,this.cs.Ms(),this}getScaleLabelPadding(){return this.IF}setScaleLabelStrategy(t){return this.MF=t,this.cs.Ms(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.cs.Ms(),this}setAxisLabelStyle(t){return this.PF="function"==typeof t?t(this.PF):t,this.cs.Ms(),this}getAxisLabelStyle(){return this.PF}setAxisLabelFont(t){return this.DF="function"==typeof t?t(this.DF):t,this.cs.Ms(),this}getAxisLabelFont(){return this.DF}setAxisLabelEffect(t){return this.eF.bs(t),this.cs.Ms(),this}getAxisLabelEffect(){return this.eF._s()}setAxisLabelPadding(t){return this.BF=t,this.cs.Ms(),this}getAxisLabelPadding(){return this.BF}setAxisLabelStrategy(t){return this._F=t,this.cs.Ms(),this}setAxisStyle(t){return this.LF="function"==typeof t?t(this.LF):t,this.cs.Ms(),this}getAxisStyle(){return this.LF}setNibStyle(t){return this.RF="function"==typeof t?t(this.RF):t,this.cs.Ms(),this}getNibStyle(){return this.RF}setNibLength(t){return this.Hf=t,this.cs.Ms(),this}getNibLength(){return this.Hf}setAutoAxis(t){return this.bF=t,this}getAutoAxis(){return this.bF}setMouseInteractions(t){return this.Yo=t,this}getMouseInteractions(){return this.Yo}setAxisScrollStrategy(t){return this.xF=t,this.cs.Ms(),this}getAxisScrollStrategy(){return this.xF}setAxisInterval(t,e=0){return this.axisScale.q(e,t),this.cs.Ms(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp);const e=this.Rx.length,i=ga.Np(this.Ch,this.Lp),s=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+i)),r=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this._F){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?r.right=Math.max(r.right,l.x+.5*(1-a.alignmentX)*h.x-t):r.left=Math.max(r.left,-l.x+.5*(a.alignmentX+1)*h.x-t),o>0?r.top=Math.max(r.top,l.y+.5*(1-a.alignmentY)*h.y-t):r.bottom=Math.max(r.bottom,-l.y+.5*(a.alignmentY+1)*h.y-t)}}if(this.xF){const t=this.XF();if(void 0!==t){const e=this.xF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.xF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.q(e,i)}}const n=u(this._g.x.getInnerStart()+(r.left+this._g.x.getInnerInterval()-r.right)/2,this._g.y.getInnerStart()+(r.bottom+this._g.y.getInnerInterval()-r.top)/2),o=Math.min(s.x/2-(r.left+r.right)/2,s.y/2-(r.bottom+r.top)/2);this.EF=A(this.$t.left+this.Ia.left+r.left,this.$t.top+this.Ia.top+i+r.top,this.$t.right+this.Ia.right+r.right,this.$t.bottom+this.Ia.bottom+r.bottom),this.om(n,o);for(const t of this.Gv)t.Cv();for(const t of this.Gv)t.ze();super.Pp(),this.hm.ze(!1,this.Gv,void 0);for(const t of this.Gv)t.Pm()}dispose(){return this.Gk.Y(),this.OF.Y(),this.QF.Y(),this.lb.Y(),this.EA.Y(),this.hm.Y(),super.dispose()}getMinimumSize(){return u(this.EF.left+this.EF.right+100,this.EF.bottom+this.EF.top+100)}om(t,e){const i=this.Rx.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];zd(h,i,s,n);const u=r*((l+1)/e);h.gu(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=si(n,o[a],s);e.Ve(yi(c,u(y.paddingX,y.paddingY))).Ha(y.alignmentX).$a(y.alignmentY).Sr(l(s))}}}for(let e=f;e1;for(const s of this.Rx)for(const r of this.Gv){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Od=(t,e,i)=>ya(e,[[e.series],[e.axis],[{text:t.formatValue(e.value),font:{weight:"bold"}}]]),Ld=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99998/e),o=Math.floor(99999/(e+1)),h=Math.floor(89999/(e+1)),a=510001+e*h;let l=0;return{JF:()=>{const e=t.KF("dashboard ui",a+l);return l+=1,e},qF:()=>t.KF("dashboard legend",51e4),tI:e=>{const a=1+e*i,l=100001+e*s,u=200002+e*r,c=300002+e*n,d=400001+e*o,f=510001+e*h;let g=0;return{cs:t,Bp:(e,i)=>{const s=a+i;return t.KF(e,s)},Lx:(e,i)=>{const s=l+i;return t.KF(e,s)},Wk:(e,i)=>{const s=u+i;return t.KF(e,s)},tm:(e,i)=>{const s=c+i;return t.KF(e,s)},Bx:(e,i,s)=>{const r=c+i;return t.iI(e,r,s)},Ep:(e,i)=>{const s=d+i;return t.KF(e,s)},bp:e=>{const i=f+g,s=t.KF(e,i);return g+=1,s},_p:()=>t.KF("panel legend",500002+e),sm:()=>t.KF("panel cursor",600001+e)}}}};class _d{constructor(t){this.R=new r.Eventer,this.M=t}_(t){return this.M=t,this.R.emit("set",t),this}C(){return this.M}G(t){return this.R.on("set",t)}W(t){return this.R.off(t,"set")}}const Bd={yh:!1,mh:0,Sh:!1,bh:0,xh:!1,Mh:0,_h:0,fh:Ks.fitting},Vd=t=>{if(!t||"object"!=typeof t||null===t)return!1;const e=t.type;return!(!e||!["spark-line","spark-bar","spark-win-loss","spark-area","spark-pie"].includes(e))},Gd=(t,e,i,s,r,n,o,h)=>{const{type:a,data:l}=t;if(0===l.length)return;const u=[s,r];"spark-line"===a&&Zd(t,e,u,n,o,h),"spark-bar"===a&&qd({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&qd({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Kd(t,e,u,n,o,h),"spark-pie"===a&&Jd(t,e,u,n,o,h)},Nd=(t,e,i,s)=>({x:Yd(t.x,e.x,i.x,s),y:Hd(t.y,e.y,i.y,s)}),Ud=(t,e,i,s)=>({position:Yd(t.position,e.x,i.x,s),high:Hd(t.high,e.y,i.y,s),low:Hd(t.low,e.y,i.y,s)}),Yd=(t,e,i,s)=>{const r=_t(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Hd=(t,e,i,s)=>{const r=_t(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Xd=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Wd(a,e,i,r,n,o,h),"axis-band"===a.type&&jd(a,i,r,n,o,h),"constant-line"===a.type&&$d(a,i,s,r,n,o,h)},Wd=(t,i,s,r,n,o,h)=>{const{value:a,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===a&&(f=i[0]),"end"===a&&(f=i[i.length-1]),"min"===a){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof a||(f=Nd(a,s,r,n),((t,e)=>{const i=e[0],s=e[1],r=t.x,n=t.y;return i.x<=r&&r<=i.x+s.x&&i.y<=n&&n<=i.y+s.y})(f,n)))&&o.pointSet.add().Ot().dl(void 0!==u?u:e.PointShape.Circle).sr(d||0).it(c||5).Re(l||h.sparkPointChartFillStyle).ml(f)},jd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(He,Ye),f=u(He,Ye);"x"===o&&(d=Nd({x:h,y:He},e,i,s),f=Nd({x:a,y:Ye},e,i,s)),"y"===o&&(d=Nd({x:He,y:h},e,i,s),f=Nd({x:Ye,y:a},e,i,s));const g=s[0],m=s[1],y=_t(d.x,g.x,g.x+m.x),p=_t(d.y,g.y,g.y+m.y),A=_t(f.x,g.x,g.x+m.x),x=_t(f.y,g.y,g.y+m.y);r.rect.add().Ml(y)._l(p).it(u(A-y,x-p)).Re(l||n.sparkChartBandFillStyle).Le(c||n.sparkChartBandStrokeStyle).Le(ut)},$d=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,y=[];if("y"===h&&d<=c&&c<=f){const t=Nd(u(g,c),{x:g,y:d},s,r),e=Nd(u(m,c),{x:g,y:d},s,r);y.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=Nd(u(c,d),{x:g,y:d},s,r),e=Nd(u(c,f),{x:g,y:d},s,r);y.push([t,e])}y.length>0&&n.line.add().Ye(l||o.sparkChartConstantLineStrokeStyle).$e(y[0][0]).Xe(y[0][1])},Zd=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.eo&&zt.console.warn("LightningChart JS warning: SparkLineChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=Ye,c=He,d=Ye,f=He;for(let t=0;tNd(t,{x:u,y:d},g,i)));e.lineSet.add().ds(n).Ye(o||s.sparkLineChartStrokeStyle).Ot().ml(m),a&&Xd(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},qd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,y=f/d*1;let p=Ye,A=He;if(g)p=-1,A=1;else for(const t of o)p=Math.min(p,t),A=Math.max(A,t);const x={x:0,y:g?-1:Math.min(0,p)},S={x:1*o.length+(o.length-1)*y,y:g?2:Math.max(A,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*y,y:g?t>=m?1:0:t},r=Nd({x:1*e+e*y,y:g?t>=m?0:-1:0},x,S,i),n=Nd(s,x,S,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().ds(n).Ve(t.position).Cl(t.height).wl(t.width).Re((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Le(a||s.sparkBarChartStrokeStyle)}))},Kd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.eo&&zt.console.warn("LightningChart JS warning: SparkAreaChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=Ye,f=He,g=Ye,m=He;for(let t=0;t{const{data:o,strokeStyle:h}=t,a=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=a.reduce(((t,e)=>t+e),0),d=Nd(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().ds(n).Ve(d).gu(g).mu(0).Au(m).Xe(m+r).Re(l[i]||ve(s.sparkPieChartFillStyle,i)).Le(h||s.sparkPieChartStrokeStyle),m+=r}))};var Qd,tf,ef;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(Qd||(Qd={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(tf||(tf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(ef||(ef={}));class sf extends Fn{constructor(t,e,i,s,r){super(),this.Ns=!1,this.o_={x:0,y:0,height:20,width:20},this.sI={x:10,y:10},this.Rs=t,this.eI=r,this.hI=new Fo(t,e,i,Ot,s).setMouseInteractions(!0),this.rI=t.fc(e,Tn.Simple).Re(s.dataGridScrollBarButtonArrowFillStyle).Le(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Bu(this),this.hI.onMouseEnter((t=>t.setHighlight(1))),this.hI.onMouseLeave((t=>t.setHighlight(0)))}nI(){switch(this.eI){case ef.Up:this.rI.Fl([{x:this.o_.x,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y-this.sI.y/2},{x:this.o_.x-this.sI.x/2,y:this.o_.y-this.sI.y/2}]);break;case ef.Down:this.rI.Fl([{x:this.o_.x-this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x,y:this.o_.y-this.sI.y/2}]);break;case ef.Left:this.rI.Fl([{x:this.o_.x-this.sI.x/2,y:this.o_.y},{x:this.o_.x+this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y-this.sI.y/2}]);break;case ef.Right:this.rI.Fl([{x:this.o_.x-this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y},{x:this.o_.x-this.sI.x/2,y:this.o_.y-this.sI.y/2}])}}Ve(t){return this.o_.x=t.x,this.o_.y=t.y,this}Ua(){return u(this.o_.x,this.o_.y)}it(t){return this.o_.height=t.x,this.o_.width=t.y,this}oi(){return{x:this.o_.height,y:this.o_.width}}onMouseDown(t){return this.hI.onMouseDown(t)}onMouseUp(t){return this.hI.onMouseUp(t)}setFillStyle(t){return this.hI.setFillStyle(t),this}getFillStyle(){return this.hI.getFillStyle()}setStrokeStyle(t){return this.hI.setStrokeStyle(t),this}getStrokeStyle(){return this.hI.getStrokeStyle()}ze(){return this.hI.ze(),this.nI(),this}Os(){return this.hI.setSize(u(this.o_.height,this.o_.width)).setPosition(u(this.o_.x,this.o_.y)),this}setVisible(t){return this.hI.setVisible(t),this.rI.setVisible(t),this}dispose(){return this.hI.dispose(),this.rI.dispose(),this}setMouseInteractions(t){return this.hI.setMouseInteractions(t),this}getMouseInteractions(){return this.hI.getMouseInteractions()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.hI.getHighlight()}setHighlight(t){return this.hI.setHighlight(ke(t)),this.R.emit("highlight",this,Boolean(t)),this.Rs.Ms(),this}}const rf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class nf{constructor(t,i,s,n,o,h,a){this.dd={x:0,y:0},this.o_={x:0,y:0,height:0,width:0},this.R=new r.Eventer,this.oI={min:u(0,0),max:u(0,0)},this.aI=!1,this.lI=!1,this.uI={x:0,y:0},this.Ru=void 0,this.cI=u(0,0),this.dI={x:0,y:0},this.fI=0,this.AI=15,this.gI=(t,i)=>{this.aI=!0,this.EA.Ms();const s=this.pI.getDraggingMode();this.Ru=this.EA.cs.tn(s===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:s===e.UIDraggingModes.draggable?e.MouseStyles.Move:s===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.yI&&clearInterval(this.yI)},this.mI=()=>{this.aI=!1,this.EA.Ms(),this.EA.cs.sn(this.Ru)},this.vI=t=>(this.lI=!0,this.uI=yt(this.EA.cs.Ne(t.x,t.y),this.EA.cs.At,this.scale),!0),this.SI=(t,e)=>(this.xI(e),this.yI=setInterval((()=>this.xI(e)),300),!0),this.bI=()=>(clearInterval(this.yI),!0),this.MI=(t,i)=>{const s=this.pI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=yt(this.EA.cs.Ne(t.x,t.y),this.EA.cs.At,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?rf(n.x,this.scale.x):this.o_.x,r!==e.UIDraggingModes.onlyHorizontal?rf(n.y,this.scale.y):this.o_.y),h=u(o.x-this.uI.x,o.y-this.uI.y),a=u(this.pI.getPosition().x+h.x,this.pI.getPosition().y+h.y),l=this._I(a),c={x:Math.abs(this.cI.x-l.x),y:Math.abs(this.cI.y-l.y)};return this.wI(c),this.dI.y>h.y&&(this.uI=n),this.ze(),!0}return!1},this.CI=(t,e)=>{this.lI=!1,se(e),this.EA.Ms()},this.EA=t,this.gp=i,this.scale=n,this.contentScale=o,this.kI=a,this.TI=new sf(t,s,n,h,a===Qd.UpToDown?ef.Up:ef.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.FI=new sf(t,s,n,h,a===Qd.UpToDown?ef.Down:ef.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.pI=new Fo(t,s,n,Ot,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===Qd.UpToDown?e.UIDraggingModes.onlyVertical:a===Qd.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.II=new Fo(i,s,n,Ot,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.pI.onMouseEnter(this.gI),this.pI.onMouseLeave(this.mI),this.pI.onMouseDragStart(((t,e)=>this.vI(u(e.clientX,e.clientY))&&se(e))),this.pI.onMouseDrag(((t,e)=>this.MI(u(e.clientX,e.clientY))&&se(e))),this.pI.onMouseDragStop(this.CI),this.pI.onTouchStart(((t,e)=>this.vI(u(e.clientX,e.clientY))&&se(e))),this.pI.onTouchMove(((t,e)=>this.MI(u(e.clientX,e.clientY))&&se(e))),this.pI.onTouchEnd(this.CI),this.TI.onMouseDown(((t,e)=>this.SI(t,e)&&se(e))),this.FI.onMouseDown(((t,e)=>this.SI(t,e)&&se(e))),this.TI.onMouseUp(((t,e)=>this.bI()&&se(e))),this.FI.onMouseUp(((t,e)=>this.bI()&&se(e))),this.II.onMouseWheel(((t,e)=>this.DI(e))),this.pI.onMouseWheel(((t,e)=>this.DI(e))),this.II.onMouseDown(((t,e)=>this.SI(t,e)&&se(e))),this.II.onMouseUp(((t,e)=>this.bI()&&se(e)))}BI(t){return this.o_=t,this}wl(t){return this.o_.width=t,this}LI(){return this.o_.width}RI(t){return this.cI=t,this}EI(t){return this.dd=t,this}zI(){return this.dd}VI(t){return this.AI=t,this}OI(){return this.kI}NI(t){let e;switch(this.kI){case Qd.UpToDown:return e=t>0?Math.min(this.cI.y-this.oI.max.y,this.dI.y+t):Math.max(0,this.dI.y+t),e!==this.dI.y&&(this.wI({x:0,y:e}),this.ze(),!0);case Qd.LeftToRight:return e=Math.min(this.oI.max.x-this.cI.x,this.dI.x+t),e!==this.dI.x&&(this.wI({y:0,x:e}),this.ze(),!0);default:return!1}}GI(t){let e;switch(this.kI){case Qd.UpToDown:return e=Math.max(0,this.dI.y-t),e!==this.dI.y&&(this.wI({x:0,y:e}),this.ze(),!0);case Qd.LeftToRight:return e=t>0?Math.max(0,this.dI.x-t):Math.min(this.oI.max.x-this.cI.x,this.dI.x-t),e!==this.dI.x&&(this.wI({x:e,y:0}),this.ze(),!0);default:return!0}}UI(t){switch(this.kI){case Qd.UpToDown:return this.R.on("scrollY",t);case Qd.LeftToRight:return this.R.on("scrollX",t)}return this.R.on("scrollY",t)}_I(t){switch(this.kI){case Qd.UpToDown:if(t.y>this.oI.min.y)return u(t.x,this.oI.min.y);if(t.ythis.oI.max.x)return u(this.oI.max.x,t.y)}return t}DI(t){t.deltaY>0&&this.WI()&&se(t),t.deltaY<0&&this.YI()&&se(t)}xI(t){const e=yt(this.EA.cs.Ne(t.clientX,t.clientY),this.EA.cs.At,this.scale);let i;const s=this.pI.getPosition(),r=this.pI.getSize();this.HI(e,s,r)?clearInterval(this.yI):(i=this.kI===Qd.UpToDown?u(0,e.y-s.y>0?this.AI:-this.AI):u(s.x-e.x>0?this.AI:-this.AI,0),(i.x>0||i.y>0)&&this.XI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.$I(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}HI(t,e,i){return this.kI===Qd.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.o_.height?Math.min(this.cI.y-this.oI.max.y,this.dI.y+t):0,e!==this.dI.y&&(this.wI({x:0,y:e}),this.ze(),!0)}case Qd.LeftToRight:{const e=Math.min(this.oI.max.x-this.cI.x,this.dI.x+t);return e!==this.dI.x&&(this.wI({y:0,x:e}),this.ze(),!0)}default:return!1}}YI(){return this.XI(this.AI)}WI(){return this.$I(this.AI)}wI(t){if(t.x===this.dI.x&&t.y===this.dI.y)return;let e;switch(this.dI=t,this.kI){case Qd.UpToDown:e=this.dI.y*this.fI*this.contentScale.Ui().y,this.R.emit("scrollY",tf.Vertical,e),this.EA.cs.Ms();break;case Qd.LeftToRight:e=this.dI.x*this.fI*this.contentScale.Ui().x,this.R.emit("scrollX",tf.Horizontal,e)}}setVisible(t){return this.TI.setVisible(t),this.FI.setVisible(t),this.II.setVisible(t),this.pI.setVisible(t),this}dispose(){return this.TI.dispose(),this.FI.dispose(),this.II.dispose(),this.pI.dispose(),this.yI&&clearInterval(this.yI),this}Os(){switch(this.ZI(),this.QI(),this.kI){case Qd.UpToDown:this.TI.Ve({x:this.o_.x,y:this.o_.y+this.o_.height-this.TI.oi().x/2}).it(u(this.o_.width,this.o_.width)).Os(),this.FI.Ve({x:this.o_.x,y:this.o_.y+10}).it(u(this.o_.width,this.o_.width)).Os(),this.II.setSize({x:this.o_.width,y:this.o_.height-2*this.TI.oi().x}).setPosition({x:this.o_.x,y:this.o_.y+this.FI.oi().y+this.II.getSize().y/2}),this.pI.setSize(u(this.o_.width,this.JI())),this.cI={x:this.o_.x,y:this.TI.Ua().y-this.TI.oi().y/2-this.pI.getSize().y/2},this.jI({min:{x:this.o_.x,y:this.TI.Ua().y-this.TI.oi().y/2-this.pI.getSize().y/2},max:{x:this.o_.x,y:this.FI.Ua().y+this.FI.oi().x/2+this.pI.getSize().y/2}});break;case Qd.LeftToRight:this.TI.Ve({x:this.o_.x,y:this.o_.y}).it(u(this.o_.height,this.o_.height)).Os(),this.FI.Ve({x:this.o_.x+this.o_.width-this.FI.oi().x,y:this.o_.y}).it(u(this.o_.height,this.o_.height)).Os(),this.II.setSize({y:this.o_.height,x:this.o_.width-2*this.TI.oi().y}).setPosition({x:this.o_.x+this.TI.oi().x/2+this.II.getSize().x/2,y:this.o_.y}),this.pI.setSize(u(this.JI(),this.o_.height)),this.cI={x:this.TI.Ua().x+this.TI.oi().x/2+this.pI.getSize().x/2,y:this.o_.y},this.jI({min:{x:this.TI.Ua().x+this.TI.oi().x/2+this.pI.getSize().x/2,y:this.o_.y},max:{x:this.FI.Ua().x-this.FI.oi().x/2-this.pI.getSize().x/2,y:this.o_.y}})}return this.KI(),this}ZI(){switch(this.kI){case Qd.UpToDown:this.qI()||this.setVisible(!1),this.qI()&&this.setVisible(!0);break;case Qd.LeftToRight:this.tP()||this.setVisible(!1),this.tP()&&this.setVisible(!0)}}QI(){switch(this.kI){case Qd.UpToDown:this.qI()||this.wI({x:0,y:0});break;case Qd.LeftToRight:this.tP()||this.wI({x:0,y:0})}}qI(){return this.dd.x>this.o_.height}tP(){return this.dd.y>this.o_.width}JI(){switch(this.kI){case Qd.UpToDown:return this.o_.height*(this.o_.height-2*this.TI.oi().x)/this.dd.x;case Qd.LeftToRight:return this.o_.width*(this.o_.width-2*this.TI.oi().y)/this.dd.y;default:return 0}}KI(){switch(this.kI){case Qd.UpToDown:this.fI=(this.dd.x-this.o_.height)/(this.oI.min.y-this.oI.max.y);break;case Qd.LeftToRight:this.fI=(this.dd.y-this.o_.width)/(this.oI.max.x-this.oI.min.x)}}ze(){switch(this.TI.ze(),this.FI.ze(),this.II.ze(),this.kI){case Qd.UpToDown:this.pI.setPosition({x:this.o_.x,y:this.TI.Ua().y-this.TI.oi().y/2-this.pI.getSize().y/2-this.dI.y}).ze();break;case Qd.LeftToRight:this.pI.setPosition({y:this.o_.y,x:this.TI.Ua().x+this.TI.oi().x/2+this.pI.getSize().x/2+this.dI.x}).ze()}return this}}class of{constructor(t,e,i,s,r,n,o){switch(this.EA=t,this.gp=e,this.scale=s,this.contentScale=r,o){case tf.Vertical:this.iP=this.sP(i,n,Qd.UpToDown);break;case tf.Horizontal:this.eP=this.sP(i,n,Qd.LeftToRight);break;case tf.Both:this.iP=this.sP(i,n,Qd.UpToDown),this.eP=this.sP(i,n,Qd.LeftToRight)}this.hP=ns(new hs(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.eP)||void 0===n?void 0:n.GI(s.x))&&se(r),0!==s.y&&(null===(o=this.iP)||void 0===o?void 0:o.NI(s.y))&&se(r)})))}sP(t,e,i){return new nf(this.EA,this.gp,t,this.scale,this.contentScale,e,i)}LI(){return 20}EI(t){var e,i;return null===(e=this.iP)||void 0===e||e.EI(t),null===(i=this.eP)||void 0===i||i.EI(t),this}rP(t){var e;return null===(e=this.eP)||void 0===e||e.VI(t),this}nP(t){var e;return null===(e=this.iP)||void 0===e||e.VI(t),this}oP(t){const e=this.iP;return e&&e.DI(t),this}aP(t){return this.hP.onTouchStart(this,t),this}lP(t){return this.hP.onTouchMove(this,t),this}uP(t){return this.hP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.eP)||void 0===e||e.UI(t),null===(i=this.iP)||void 0===i||i.UI(t),this}dispose(){var t,e;return null===(t=this.iP)||void 0===t||t.dispose(),null===(e=this.eP)||void 0===e||e.dispose(),this}ze(){var t,e;return null===(t=this.iP)||void 0===t||t.ze(),null===(e=this.eP)||void 0===e||e.ze(),this}Os(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.iP)||void 0===t||t.BI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.eP)||void 0===e||e.BI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.iP)||void 0===i||i.Os(),null===(s=this.eP)||void 0===s||s.Os(),this}}class hf extends fa{constructor(t,e,i,s,r,n){super(t,e,i,e.Bp("dataGrid bg",0),s,e.cs.ts.dataGridBackgroundFillStyle,e.cs.ts.dataGridBackgroundStrokeStyle,e.cs.ts.dataGridTitleFont,e.cs.ts.dataGridTitleFillStyle,n),this.cP=[],this.dP=[],this.fP=[],this.AP=new Map,this.gP=!0,this.pP=!0,this.yP=!0,this.mP=!0,this.vP=!0,this.SP=!0,this.xP=!0,this.bP=!0,this.MP=!0,this._P=!0,this.wP=!0,this.CP=!0,this.kP=!0,this.TP=!0,this.FP=!0,this.IP=!0,this.PP=new Set,this.DP=new Set,this.BP=!0,this.LP=!0,this.RP=(t,e)=>{t.borders=void 0===e?df:{...t.borders,...e},this.EP(t),this.CP=!0,this.cs.Ms()},this.EP=t=>{t.borders&&(!1===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.VP,bottom:!1}})),!1===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.VP,top:!1}})),!1===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.VP,right:!1}})),!1===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.VP,left:!1}})),!0===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.VP,bottom:!0}})),!0===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.VP,top:!0}})),!0===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.VP,right:!0}})),!0===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.VP,left:!0}})))},this.OP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseEnter,i,e)},this.NP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseLeave,i,e)},this.GP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseClick,i,e)},this.UP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDoubleClick,i,e)},this.WP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDown,i,e)},this.YP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseUp,i,e)},this.HP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseMove,i,e)},this.XP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDrag,i,e)},this.$P=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDragStart,i,e)},this.jP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDragStop,i,e)},this.ZP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellMouseWheel,i,e),!e.defaultPrevented&&this.BP&&this.QP.oP(e))},this.JP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellTouchStart,i,e),!e.defaultPrevented&&this.LP&&this.QP.aP(e))},this.KP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellTouchMove,i,e),!e.defaultPrevented&&this.LP&&this.QP.lP(e))},this.qP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellTouchEnd,i,e),!e.defaultPrevented&&this.LP&&this.QP.uP(e))},this.cs.Jn(Sh.Af),this.Ch.Sr("Data Grid"),this.tD=i.d2({scaleXYConstructor:Yi}),this.tD.x.yg=Bd,this.iD=i.d2({scaleXYConstructor:Yi}),this.sD={x:0,y:0},this.eD=this.ts.dataGridTextFont,this.hD=this.ts.dataGridTextFillStyle,this.VP={top:!0,bottom:!0,left:!0,right:!0},this.rD=this.ts.dataGridCellBackgroundFillStyle,this.nD=this.ts.dataGridBorderStrokeStyle,this.oD="left-center",this.aD={left:5,right:5,bottom:5,top:5},this.lD=e.Lx("dataGrid grid bg",0),this.uD=e.Lx("dataGrid cell bg",1),this.cD=e.tm("dataGrid cell content",0),this.dD=e.tm("dataGrid scrollbar bg",1),this.fD=e.tm("dataGrid scrollbar fg",2),this.QP=this.AD(),this.onBackgroundMouseWheel(((t,e)=>{this.BP&&this.QP.oP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.LP&&this.QP.aP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.LP&&this.QP.lP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.LP&&this.QP.uP(e)})),this.gD=this.lD.Ee(this.tD).Re(this.ts.dataGridBackgroundFillStyle).Le(ut).setMouseInteractions(!1),this.pD=this.cD.Qg(this.tD).setMouseInteractions(!1),this.yD=new rl((()=>this.uD.Ee(this.tD).setMouseInteractions(!0).setMouseEnterEventHandler(this.OP).setMouseLeaveEventHandler(this.NP).setMouseClickEventHandler(this.GP).setMouseDoubleClickEventHandler(this.UP).setMouseDownEventHandler(this.WP).setMouseUpEventHandler(this.YP).setMouseMoveEventHandler(this.HP).setMouseDragEventHandler(this.XP).setMouseDragStartEventHandler(this.$P).setMouseDragStopEventHandler(this.jP).setMouseWheelEventHandler(this.ZP).setTouchStartEventHandler(this.JP).setTouchMoveEventHandler(this.KP).setTouchEndEventHandler(this.qP))),this.mD=new rl((()=>this.cD.Ee(this.tD).setMouseInteractions(!1))),this.vD=new rl((()=>this.cD.Wr(this.tD).setMouseInteractions(!1))),this.SD=new rl((()=>this.cD.gm(this.tD,{},[Za.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.xD=new rl((()=>this.cD.He(this.tD).setMouseInteractions(!1))),this.bD=new rl((()=>this.cD.Nv(this.tD).setMouseInteractions(!1))),this.MD=new rl((()=>this.cD.Ee(this.tD).setMouseInteractions(!1))),this._D=new rl((()=>this.cD.W_(this.tD).setMouseInteractions(!1))),this.wD=new rl((()=>this.cD.ud(this.tD).setMouseInteractions(!1))),this.Dp(r,this.uiScale),this.onResize((()=>{this.gP=!0,this.cs.Ms(),this.tD.it(this._g.oi()),this.iD.it(this._g.oi())})),this.CD=this.hs.Bg([this.gD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}af(){return[]}dispose(){return super.dispose(),this.lD.Y(),this.uD.Y(),this.cD.Y(),this.dD.Y(),this.fD.Y(),ua(this.tD),ua(this.iD),this.QP.dispose(),this.vD.Lm(),this.yD.Lm(),this.mD.Lm(),this.SD.Lm(),this.xD.Lm(),this.bD.Lm(),this.MD.Lm(),this._D.Lm(),this.wD.Lm(),this}J(){return super.J(),this.tD.J(),this.iD.J(),this}K(){return super.K(),this.tD.K(),this.iD.K(),this}setBackgroundEffect(t){return this.CD.bs(t),this.cs.Ms(),this}getBackgroundEffect(){return this.CD._s()}setInteractionScrollOnWheel(t){return this.BP=t,this}getInteractionScrollOnWheel(){return this.BP}setInteractionPanOnTouch(t){return this.LP=t,this}getInteractionPanOnTouch(){return this.LP}onCellMouseEnter(t){return this.R.on(af.cellMouseEnter,t)}offCellMouseEnter(t){return this.R.off(t)}onCellMouseLeave(t){return this.R.on(af.cellMouseLeave,t)}offCellMouseLeave(t){return this.R.off(t)}onCellMouseClick(t){return this.R.on(af.cellMouseClick,t)}offCellMouseClick(t){return this.R.off(t)}onCellMouseDoubleClick(t){return this.R.on(af.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.R.off(t)}onCellMouseDown(t){return this.R.on(af.cellMouseDown,t)}offCellMouseDown(t){return this.R.off(t)}onCellMouseUp(t){return this.R.on(af.cellMouseUp,t)}offCellMouseUp(t){return this.R.off(t)}onCellMouseMove(t){return this.R.on(af.cellMouseMove,t)}offCellMouseMove(t){return this.R.off(t)}onCellMouseDrag(t){return this.R.on(af.cellMouseDrag,t)}offCellMouseDrag(t){return this.R.off(t)}onCellMouseDragStart(t){return this.R.on(af.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.R.off(t)}onCellMouseDragStop(t){return this.R.on(af.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.R.off(t)}onCellMouseWheel(t){return this.R.on(af.cellMouseWheel,t)}offCellMouseWheel(t){return this.R.off(t)}onCellTouchStart(t){return this.R.on(af.cellTouchStart,t)}offCellTouchStart(t){return this.R.off(t)}onCellTouchMove(t){return this.R.on(af.cellTouchMove,t)}offCellTouchMove(t){return this.R.off(t)}onCellTouchEnd(t){return this.R.on(af.cellTouchEnd,t)}offCellTouchEnd(t){return this.R.off(t)}setGridBackgroundFillStyle(t){return this.gD.Re(t),this.cs.Ms(),this}getGridBackgroundFillStyle(){return this.gD.Jh()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const n=i,o=s,h=r;let a=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.dP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.dP.splice(this.dP.indexOf(i),1):(i.min=e,i.max=e),this.SP=!0,this.cs.Ms(),this}setRowHeight(t,e){let i=this.fP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.fP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.fP.splice(this.fP.indexOf(i),1):(i.min=e,i.max=e),this.SP=!0,this.cs.Ms(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.TD(t,(t=>this.FD(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.ID(t,(t=>this.FD(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.zP(t,e,(t=>this.FD(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.aD={...this.aD,...t},this.PD((t=>this.FD(t,this.aD))),this}setCellBorders(t,e,i){return this.zP(t,e,(t=>this.RP(t,i))),this}setRowBorders(t,e){return this.ID(t,(t=>this.RP(t,e))),this}setColumnBorders(t,e){return this.TD(t,(t=>this.RP(t,e))),this}setCellsBorders(t){return this.VP=void 0===t?df:t,this.PD((t=>this.RP(t,this.VP))),this}setCellsBorderStrokeStyle(t){return this.nD="function"==typeof t?t(this.nD):t,this.TP=!0,this.cs.Ms(),this}setColumnTextFillStyle(t,e){return this.TD(t,(t=>this.DD(t,e))),this}setRowTextFillStyle(t,e){return this.ID(t,(t=>this.DD(t,e))),this}setCellTextFillStyle(t,e,i){return this.zP(t,e,(t=>this.DD(t,i))),this}setCellsTextFillStyle(t){return this.hD="function"==typeof t?t(this.hD):t,this.PD((t=>this.DD(t,this.hD))),this}setColumnTextFont(t,e){return this.TD(t,(t=>this.BD(t,e))),this}setRowTextFont(t,e){return this.ID(t,(t=>this.BD(t,e))),this}setCellTextFont(t,e,i){return this.zP(t,e,(t=>this.BD(t,i))),this}setCellsTextFont(t){return this.eD="function"==typeof t?t(this.eD):t,this.PD((t=>this.BD(t,this.eD))),this}setColumnContentAlignment(t,e){return this.TD(t,(t=>this.LD(t,e))),this}setRowContentAlignment(t,e){return this.ID(t,(t=>this.LD(t,e))),this}setCellContentAlignment(t,e,i){return this.zP(t,e,(t=>this.LD(t,i))),this}setCellsContentAlignment(t){return this.oD=t,this.PD((t=>this.LD(t,this.oD))),this}setCellBackgroundFillStyle(t,e,i){return this.zP(t,e,(t=>this.RD(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.TD(t,(t=>this.RD(t,e))),this}setRowBackgroundFillStyle(t,e){return this.ID(t,(t=>this.RD(t,e))),this}setCellsBackgroundFillStyle(t){return this.rD="function"==typeof t?t(this.rD):t,this.PD((t=>this.RD(t,this.rD))),this}setCellHighlight(t,e,i){return this.zP(t,e,(t=>{t.highlight=ke(i)})),this.kP=!0,this.cs.Ms(),this}setColumnHighlight(t,e){const i=ke(e);return this.TD(t,(t=>{t.highlight=i})),this.kP=!0,this.cs.Ms(),this}setRowHighlight(t,e){const i=ke(e);return this.ID(t,(t=>{t.highlight=i})),this.kP=!0,this.cs.Ms(),this}removeCell(t,e){return this.zP(t,e,(t=>this.cP.splice(this.cP.indexOf(t),1))),this.vP=!0,this.cs.Ms(),this}removeRow(t){return this.ID(t,(t=>this.cP.splice(this.cP.indexOf(t),1))),this.cP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.vP=!0,this.cs.Ms(),this}removeColumn(t){return this.TD(t,(t=>this.cP.splice(this.cP.indexOf(t),1))),this.cP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.vP=!0,this.cs.Ms(),this}removeCells(){return this.cP.splice(0),this.vP=!0,this.cs.Ms(),this}getColumnMax(){return 0===this.cP.length?0:this.cP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.cP.length?0:this.cP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=Math.round(this.nD.N()),i=e/2;let s=this.pP||this.yP||this.mP||this.vP||this.SP||this.xP||this.wP||this.CP||this.TP||this.IP;if(s){this.cP.forEach((t=>{this.DP.add(t.column)})),this.cP.forEach((t=>{this.PP.add(t.row)}));const t=this.vD.Dm(),r=this.ED(i,t);t.finishPlot();const n=this.zD(this.DP.size,r),o=this.VD(this.PP.size,r),h=n.reduce(Je,0)+e,a=o.reduce(Je,0)+e,l=new Array(n.length+1).fill(0).map(((t,e)=>n.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===n[e])),e=this.OD.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.OD={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.yP||this.mP||this.vP||this.bP||this.MP||this._P||this.CP||this.kP||this.TP||this.gP||this.IP;if((r||this.FP)&&this.OD){const t=this._g.getInnerIntervalPixels(),s=ga.Np(this.Ch,this.Lp),n=[this.Ia.left+i,this.Ia.right+i],o=[this.Ia.bottom+i,this.Ia.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.Ia.left,this.Ia.right],l=[this.Ia.bottom,this.Ia.top+s],u={x:Math.round(t.x-a[0]-a[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.iD.Ei(n).zi(o).Vi(0,h.x).Oi(0,h.y),this.QP.EI({x:this.OD.dataGridHeight,y:this.OD.dataGridWidth}).Os().ze();const d={x:Math.round(this.sD.x),y:Math.round(Math.min(0,this.sD.y))};this.tD.Ei(a).zi(l).Vi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.gD.Ve({x:c.x,y:c.y});const f={x:this.tD.x.ei(),y:this.tD.y.ei()+this.QP.LI(),width:this.tD.x.ri()+e-this.QP.LI(),height:this.tD.y.ri()+e};this.cD.wx(f),this.uD.wx(f),this.lD.wx(f);const g=this.OD,m=[{x:this.tD.x.getInnerStart(),y:this.tD.y.getInnerStart()},{x:this.tD.x.getInnerEnd(),y:this.tD.y.getInnerStart()},{x:this.tD.x.getInnerEnd(),y:this.tD.y.getInnerEnd()},{x:this.tD.x.getInnerStart(),y:this.tD.y.getInnerEnd()}];g.cellsContentSizes.forEach((t=>{var e;const i={x:c.x+g.columnWidthsCumulative[t.cell.column],y:c.y-g.rowHeightsCumulative[t.cell.row+t.cell.rowSpan]},s={x:i.x+g.columnWidths[t.cell.column],y:i.y+g.rowHeights[t.cell.row]},r=Ze([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.ND(c,this.OD,e)}this.gP=!1,this.pP=!1,this.yP=!1,this.mP=!1,this.vP=!1,this.SP=!1,this.xP=!1,this.bP=!1,this.MP=!1,this._P=!1,this.wP=!1,this.CP=!1,this.kP=!1,this.TP=!1,this.FP=!1,this.IP=!1}ED(t,e){const i=[],s={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.cP){const{content:r}=t,n={...this.aD,...t.padding};let o,h,a,l={x:0,y:0};if("string"==typeof r||"number"==typeof r){const i=String(r);o=e.add(),l=o.Sr(i).ir(t.textFont||this.eD).Os().od()}if(Vd(r)&&(h=r,l={x:200,y:50}),po(r)){const t=this.cs.GD(r);t.UD()?(a=r,l=a.oi()):t.WD((()=>{this.IP=!0,this.cs.Ms()}))}if(o||h||a){n.top=Math.round(n.top),n.left=Math.round(n.left),n.right=Math.round(n.right),n.bottom=Math.round(n.bottom);const e={x:Math.round(l.x+n.left+n.right+s.left+s.right),y:Math.round(l.y+n.top+n.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:h,icon:a,cellPadding:n,cellMargin:s})}}return i}ND(t,i,s){const{dataGridWidth:r,dataGridHeight:n,cellsContentSizes:o,columnWidths:h,columnWidthsCumulative:a,rowHeights:l,rowHeightsCumulative:u}=i,c={x:r-s,y:-n+s};this.gD.it(c),this.pD.Ye(this.nD),this.AP.clear();const d={cellBackground:this.yD.Dm(),cellIconRect:this.mD.Dm(),lineSet:this.SD.Dm(),line:this.xD.Dm(),pointSet:this.bD.Dm(),rect:this.MD.Dm(),junction:this._D.Dm(),arc:this.wD.Dm()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,y={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},A={x:p.x+m.left,y:p.y+m.bottom},x={x:A.x+g.left,y:A.y+g.bottom},S={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:S.x-m.left-m.right,y:S.y-m.top-m.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=cf(x,b,r.contentAlignment||this.oD);n.Ve(t[0]).Za({x:t[1],y:t[2]}).Re(this.YD(r.textFillStyle||this.hD,r.content,this.hD)).ds(r.highlight)}const M=this.YD(r.backgroundFillStyle||this.rD,r.content);if(M!==_){const t=d.cellBackground.add();t.Ve(p).it(S).Re(M).Le(ut).ds(r.highlight),this.AP.set(t,y)}const C=r.borders||this.VP;if(C&&uf(p,S,C,s,f),o){const t=x,e=b;Gd(o,d,this.tD,t,e,this.ts,this.CA,r.highlight)}if(c){const t=c.oi(),i=cf(x,b,r.contentAlignment||this.oD);d.cellIconRect.add().Ve({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).it(t).Re(new Q({source:c.yc,fitMode:e.ImageFitMode.Stretch})).Le(ut).ds(r.highlight)}}this.pD.Ot();for(const t of f)this.pD.Zr().Kg(t[0],t[1]);d.cellBackground.finishPlot(),d.cellIconRect.finishPlot(),d.lineSet.finishPlot(),d.line.finishPlot(),d.pointSet.finishPlot(),d.rect.finishPlot(),d.junction.finishPlot(),d.arc.finishPlot()}zD(t,e){const i=new Array(t).fill(0);for(const t of this.DP.values()){const s=e.filter((e=>t>=e.cell.column&&t+1<=e.cell.column+e.cell.columnSpan)).reduce(((t,e)=>{const i=e.contentSize.x/e.cell.columnSpan;return Math.max(t,i)}),0),r=this.dP.find((e=>e.column===t)),n=r?_t(s,void 0!==r.min?r.min:He,void 0!==r.max?r.max:Ye):s;i[t]=n}return i}VD(t,e){const i=new Array(t).fill(0);for(const t of this.PP.values()){const s=e.filter((e=>t>=e.cell.row&&t+1<=e.cell.row+e.cell.rowSpan)).reduce(((t,e)=>{const i=e.contentSize.y/e.cell.rowSpan;return Math.max(t,i)}),0),r=this.fP.find((e=>e.row===t)),n=r?_t(s,void 0!==r.min?r.min:He,void 0!==r.max?r.max:Ye):s;i[t]=n}return i}YD(t,e,i){if(j(t)){try{const i=Number(e);return new N({color:t.getPalette().getColors(i)})}catch(t){}return i||_}return t}DD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.hD):e,this._P=!0,this.cs.Ms()}BD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.eD):e,this.wP=!0,this.cs.Ms()}RD(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.rD):e,this.MP=!0,this.cs.Ms()}LD(t,e){t.contentAlignment=e,this.bP=!0,this.cs.Ms()}FD(t,e){t.padding={...t.padding,...e},this.xP=!0,this.cs.Ms()}kD(t,e,i){let s=this.zP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.cP.push(s),this.mP=!0),"string"==typeof s.content||"number"==typeof s.content?this.pP=!0:this.yP=!0,this.cs.Ms()}PD(t){this.cP.forEach((e=>t(e)))}zP(t,e,i){const s=this.cP.find((i=>t>=i.column&&t+1<=i.column+i.columnSpan&&e>=i.row&&e+1<=i.row+i.rowSpan));return s&&i&&i(s),s}TD(t,e){const i=this.cP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}ID(t,e){const i=this.cP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}AD(){return new of(this.fD,this.dD,this.iD,this.iD,this.tD,this.ts,tf.Both).onScroll(((t,e)=>{this.OD&&(t===tf.Vertical&&(this.sD.y=-e),t===tf.Horizontal&&(this.sD.x=e),this.FP=!0,this.cs.Ms())})).rP(50).nP(12)}}const af={cellMouseEnter:"cellMouseEnter",cellMouseLeave:"cellMouseLeave",cellMouseClick:"cellMouseClick",cellMouseDoubleClick:"cellMouseDoubleClick",cellMouseDown:"cellMouseDown",cellMouseUp:"cellMouseUp",cellMouseMove:"cellMouseMove",cellMouseDrag:"cellMouseDrag",cellMouseDragStart:"cellMouseDragStart",cellMouseDragStop:"cellMouseDragStop",cellMouseWheel:"cellMouseWheel",cellTouchStart:"cellTouchStart",cellTouchMove:"cellTouchMove",cellTouchEnd:"cellTouchEnd"};var lf;e.DataGridCellContentAlignmentOptions=void 0,(lf=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",lf.RightCenter="right-center",lf.LeftCenter="left-center",lf.RightTop="right-top",lf.LeftTop="left-top",lf.RightBottom="right-bottom",lf.LeftBottom="left-bottom",lf.CenterTop="center-top",lf.CenterBottom="center-bottom";const uf=(t,e,i,s,r)=>{const n={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},h={x:t.x+e.x,y:t.y},a={x:t.x+e.x,y:t.y+e.y};i.top&&r.push([o,a]),i.bottom&&r.push([n,h]),i.left&&r.push([n,o]),i.right&&r.push([h,a])},cf=(t,e,i)=>{const s=t.x,r=t.x+e.x,n=t.x+e.x/2,o=t.y+e.y,h=t.y,a=t.y+e.y/2;switch(i){case"left-center":return[u(s,a),-1,0];case"right-center":return[u(r,a),1,0];case"center":return[u(n,a),0,0];case"left-bottom":return[u(s,h),-1,-1];case"right-bottom":return[u(r,h),1,-1];case"center-bottom":return[u(n,h),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(r,o),1,1];case"center-top":return[u(n,o),0,1]}return ze(0,`Unidentified DataGrid cell content alignment option: ${i}`)},df={top:!1,bottom:!1,left:!1,right:!1};class ff extends gr{constructor(t,e,i,s,r,n){super(t,{Dr(){},Pr(){},Lr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.hs=n,this.Rs=r,this.Fh=r.Wr(t.HD).ir(this.ts.barChartCategoryAxisTitleFont||this.ts.xAxisTitleFont).Re(this.ts.barChartCategoryAxisTitleFillStyle||this.ts.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Es.getWidth({x:0,y:-90})),this.hr=this.hs.Bg([this.Fh]).bs(e.effectsText),this.XD=r.He(t.HD).Ye(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Vg=t,this.Og=t):"object"==typeof t&&(this.Vg=t.min,this.Og=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Vg,max:this.Og}}setStrokeStyle(t){return this.XD.Ye(t),this.chart.cs.Ms(),this}getStrokeStyle(){return this.XD.xu()}Os(){if(!this.Zi)return{Wg:0,Yg:0,Qd:_t(0,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye)};const t=this.XD.xu().N()/2,e=this.chart.Es.getHeight(this.Fh.Os().od());return{Wg:t,Yg:e,Qd:t+e}}ze(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.XD.$e(this.chart.Es.toPoint(r.start,n.start)).Xe(this.chart.Es.toPoint(r.end,n.start)).setVisible(this.Zi),this.Fh.Ve(this.chart.Es.toPoint(.5*(r.start+r.end),this.chart.valueAxis.At.pi(n.start,-(t.Wg+s.labelMarginBeforeCategoryAxisPixels)))).Za(this.chart.Es.toPoint(0,1)).setVisible(this.Zi)}setMouseInteractions(t){return this}Mr(t,e){return new mr(e,t,this.Rs,this.chart.HD)}_r(t,e){return{}}Er(t,e){return e}Vr(t,e,i){return{min:t,max:e}}}class gf extends gr{constructor(t,e,i,s,r,n,o){super(t,{Dr:()=>{var e;if(t.$D){if("positive"===t.jD||"bipolar"===t.jD){if("after-bar"===(null===(e=t.ZD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.$D.max,Math.min(this.chart.Es.getHeight(this.chart.QD())+t.ZD.labelMargin,.3*e))}return t.$D.max}return t.JD?_t(-1,-1e-6,t.$D.max):0}},Pr:()=>{var e;if(t.$D){if("negative"===t.jD||"bipolar"===t.jD){if("after-bar"===(null===(e=t.ZD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.$D.min,-Math.min(this.chart.Es.getHeight(this.chart.QD())+t.ZD.labelMargin,.3*e))}return t.$D.min}return t.JD?_t(1,1e-6,t.$D.min):0}},Lr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.hs=n,this.Rs=r,this.Fh=r.Wr(t.HD).ir(this.ts.barChartValueAxisTitleFont||this.ts.yAxisTitleFont).Re(this.ts.barChartValueAxisTitleFillStyle||this.ts.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Es.getHeight({x:0,y:-90})),this.hr=this.hs.Bg([this.Fh]).bs(e.effectsText),this.XD=r.He(t.HD).Ye(e.barChartValueAxisStrokeStyle||this.ts.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Vg=t,this.Og=t):"object"==typeof t&&(this.Vg=t.min,this.Og=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Vg,max:this.Og}}setStrokeStyle(t){return this.XD.Ye(t),this.chart.cs.Ms(),this}getStrokeStyle(){return this.XD.xu()}setTickStrategy(t,e){return super.Hh(t,e)}Os(t){if(!this.Zi)return this.rr(),{Wg:0,Yg:0,Qd:_t(0,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye)};const e=this.chart.Es.getWidth(this.chart.HD).ri(),i=this.At.ri();this.dr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.uh.values())for(const e of t.values()){const t=e.Eh.je,i=this.chart.Es.getWidth(e.rh.od()),r=t.getTickLength()+t.getTickPadding()+i;s=Math.max(s,r)}const r=s+this.XD.xu().N()/2,n=this.chart.Es.getWidth(this.Fh.Os().od());return{Wg:r,Yg:n,Qd:_t(r+n,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye)}}ze(t){const e=this.getInterval();this.XD.$e(this.chart.Es.toPoint(-.5,this.Xh)).Xe(this.chart.Es.toPoint(-.5,this.$h)).setVisible(this.Zi);const i="logarithmic"===this.Wh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Es.toPoint(this.chart.categoryAxis.At.pi(-.5,t.Wg*this.chart.Es.KD),i),r=this.chart.Es.toPoint(this.chart.Es.qD,0);this.Fh.Ve(s).Za(r).setVisible(this.Zi)}setMouseInteractions(t){return this}Mr(t,e){return new mr(e,t,this.Rs,this.chart.HD)}_r(t,e){const i=t.Eh.je,s=this.chart.Es.toPoint(-.5,t.M),r=this.chart.HD.pi(s,this.chart.Es.toPoint(i.getTickLength()*this.chart.Es.KD,0)),n=this.chart.HD.pi(s,this.chart.Es.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Es.KD,0)),o=this.chart.HD.pi(r,this.chart.Es.toPoint(i.getTickPadding()*this.chart.Es.KD,0));t.rh.Ve(o).Za(this.chart.Es.toPoint(this.chart.Es.qD,i.getLabelAlignment())).sr(i.getLabelRotation()),i.tickStyle!==ut&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==ut&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}Er(t,e){return"linear"===this.Wh.type?Qi(t,e,this.At):ts(t,e,this.At)}Vr(t,e,i){return{min:t,max:e}}}class mf extends su{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Jo=_e(),this.M=0,this.tB=!1,this.chart=t,this.chart=t,this.category=r,this.subCategory=n,this.Cs=r,this.Ie=ve(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Pe=ve(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.chart.iB()})),this.onDispose((()=>{this.chart.iB(),this.chart.sB.delete(this.category),this.chart.eB.delete(this)}))}Ki(t,e){const i=this.chart.cs.Uo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.chart.cs.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.chart.cs.At},category:this.category,subCategory:this.subCategory,bar:this,value:this.getValue()}}setValue(t){return this.tB=!0,this.M=t,this.chart.iB(),this.chart.cs.Ms(),this.chart.sB.delete(this.category),this.chart.eB.delete(this),this}getValue(){return this.M}get value(){return this.M}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.chart.iB(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.chart.iB(),this}getStrokeStyle(){return this.Pe}Av(){return this.yv}setEffect(t){return this.chart.setBarsEffect(t),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}}const yf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),pf=(t,e,i)=>{const s=t.Od.filter((t=>void 0!==t)),r=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),n=Math.ceil(r/(e/s.length));return n<=1?s:s.filter(((t,e)=>e%n==0))};class Af extends Sl{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.Bp("barChart bg",0),s,e.cs.ts.barChartBackgroundFillStyle||e.cs.ts.chartXYBackgroundFillStyle,e.cs.ts.barChartBackgroundStrokeStyle||e.cs.ts.chartXYBackgroundStrokeStyle,e.cs.ts.barChartTitleFont||e.cs.ts.chartXYTitleFont,e.cs.ts.barChartTitleFillStyle||e.cs.ts.chartXYTitleFillStyle,n),this.coordsBars="barChart",this.hB=xf.Descending,this.rB=this.ts.barChartCategoryLabels,this.ZD=this.ts.barChartValueLabelsAfterBars,this.nB=!1,this.i_=Oe(),this.sB=new Map,this.eB=new Map,this.jD="positive",this.oB="columns",this.aB=!0,this.lB=new Map,this.uB={speed:1},this.Ly={speed:1},this.cB=.08,this.dB=[],this.kn=(t,e,i,s,r)=>{this.HD.it(s,r)},this.cs.Jn(Sh.vf),this.Es="horizontal"===(null==o?void 0:o.type)?vf:Sf,this.Ch.Sr("Bar Chart"),this.fB=e.tm("barChart plotting 1",0),this.AB=e.tm("barChart plotting 2",1),this.JD="logarithmic"===(null===(h=null==o?void 0:o.valueAxis)||void 0===h?void 0:h.type),this.JD?"horizontal"===this.Es.gB?(a=i.d1({scale1DConstructor:Gi,dimension:"y"}),this.HD=(new Hi).Ri(i.d1({scale1DConstructor:Fi,dimension:"x"}),a)):(a=i.d1({scale1DConstructor:Gi,dimension:"x"}),this.HD=(new Hi).Ri(a,i.d1({scale1DConstructor:Fi,dimension:"y"}))):(this.HD=i.d2({scaleXYConstructor:Yi}),a=this.Es.getWidth(this.HD)),this.pB=this.hs.Bg(),this.h_=new sl((()=>this.i_.Mt(this.fB.Km(this.HD).ua(0))),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.bar),e.bar.ys([i]),i})))),(()=>{this.i_.Ot()}),(t=>{this.pB.gs(t)})),this.Xv=this.gp.Ee(this.HD).Re(this.ts.barChartSeriesBackgroundFillStyle||_).Le(ut),this.$v=this.gp.Ee(this.HD).Re(_).Le(this.ts.barChartSeriesBackgroundStrokeStyle||ut).setMouseInteractions(!1),super.Hv(this.Xv,this.$v),this.categoryAxis=new ff(this,this.ts,!1!==(null==o?void 0:o.animationsEnabled),a,this.AB,this.hs);const l=Ji(null==o?void 0:o.valueAxis);this.valueAxis=new gf(this,this.ts,!1!==(null==o?void 0:o.animationsEnabled),this.Es.getHeight(this.HD),this.AB,this.hs,l.type),this.yB=new rl((()=>this.AB.Wr(this.HD).Ur(Le).Gr(Le).ua(1))),this.mB=new sl((()=>this.gp.Qg(this.HD).setMouseInteractions(!1)),((t,e,i)=>(t.Ye(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Zr()).Kg(e[0],e[1]))))));const u=e.sm(),c=Vt(o?o.cursorBuilder:void 0,Fa);this.hm=pa(this,u,c._y(u,this.uiScale,this.uiScale,Ot,this.ts),this,"show-pointed",bf,(()=>0)),this.onResize(this.kn),this.Dp(r,this.HD),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Fa){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}setBarsMargin(t){return this.cB=_t(t,0,.49),this.nB=!0,this.cs.Ms(),this}getBarsMargin(){return this.cB}setBarsEffect(t){return this.pB.bs(t),this.cs.Ms(),this}getBarsEffect(){return this.pB._s()}setData(t){let e;if(Array.isArray(t))e=[],t.forEach(((t,i)=>{"string"==typeof t?e.push({category:t}):"number"==typeof t?e.push({category:`Category ${i+1}`,value:t}):"object"==typeof t&&e.push(t)}));else{e=[];const i=Object.keys(t);for(const s of i){const i=t[s];e.push({category:s,value:"number"==typeof i?i:void 0})}}return this.vB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.vB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.vB("groups",i),this}vB(t,e){this.Gv.length>0&&this.cs.Jn(Sh.Df),this.oB=t,this.dB=e.map((t=>({category:t.category,subCategory:t.subCategory}))),this.SB(e);const i=we(e.map((t=>t.category))),s=i.length,r=we(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.Gv.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),n=r.includes(t.subCategory)?r.indexOf(t.subCategory):void 0;e=new mf(this,this.Wv,this.ts,this.cs.hs,t.category,t.subCategory,Vt(n,s)),this.jv(e),this.lB.set(e,{category:s,valueStart:this.JD?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.Gv.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.lB.delete(t))})),this.categoryAxis.setInterval(this.Es.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.$D=0===this.Gv.length?void 0:"stacks"!==t?this.Gv.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Ye,max:He}):{min:0,max:i.reduce(((t,i)=>Math.max(t,e.reduce(((t,e)=>e.category!==i?t:void 0!==e.value?t+e.value:t),0))),0)},this.$D&&(this.jD=this.$D.min>=0?"positive":this.$D.max<=0?"negative":"bipolar",("bipolar"===this.jD||"negative"===this.jD)&&this.JD))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.SB(this.Gv),this.sB.clear(),this.eB.clear(),this.nB=!0,this.cs.Ms()}setCategoryLabels(t){const e="function"==typeof t?this.rB?t(this.rB):this.rB:t;return this.rB=e?{...this.ts.barChartCategoryLabels,...e}:void 0,this.sB.clear(),this.cs.Ms(),this}getCategoryLabels(){return this.rB}setValueLabels(t){var e;const i="function"==typeof t?this.ZD?t(this.ZD):this.ZD:t,s=(null==i?void 0:i.position)||(null===(e=this.ZD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.ZD={...this.ts.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.ZD={...this.ts.barChartValueLabelsInsideBars,...i}):this.ZD=void 0,this.eB.clear(),this.cs.Ms(),this}getValueLabels(){return this.ZD}setLabelFittingEnabled(t){return this.aB=t,this.cs.Ms(),this}getLabelFittingEnabled(){return this.aB}getBar(t,e){if(("groups"===this.oB||"stacks"===this.oB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.Gv.find((i=>i.category===t&&(void 0===e||e===i.subCategory)));if(!i)throw new Error(`BarChart.getBar() no such bar: "${t}" ${e?`"${e}"`:""}`);return i}getBars(){return this.Gv}setSorting(t){this.hB=t;const e=this.Gv.slice();return this.Gv.length=0,this.Gv.push(...Ee(this.dB.map((t=>e.find((e=>e.category===t.category&&(void 0===t.subCategory||t.subCategory===e.subCategory))))))),this.SB(this.Gv),this.cs.Ms(),this}getSorting(){return this.hB}setAnimationCategoryPosition(t,e=1){return this.uB=t?{speed:e}:void 0,this.cs.Ms(),this}setAnimationValues(t,e=1){return this.Ly=t?{speed:e}:void 0,this.cs.Ms(),this}translateCoordinate(t,e,i){if(i&&Zi(t)&&$i(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(ji(t))r=this.cs.Uo(t);else if(Zi(t)){const e=yt(t,this._g,this.cs.At);r={engineX:e.x,engineY:e.y}}else{if(!yf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=yt(this.Es.toPoint(t.iCategory,t.value),this.HD,this.cs.At);r={engineX:e.x,engineY:e.y}}}if(Wi(s))return this.cs.Wo(r);if("barChart"===s){const t=yt({x:r.engineX,y:r.engineY},this.cs.At,this.HD);return{iCategory:this.Es.getWidth(t),value:this.Es.getHeight(t)}}if($i(s))return yt({x:r.engineX,y:r.engineY},this.cs.At,this._g);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}af(){if("columns"===this.oB)return this.Gv;const t=we(Ee(this.Gv.map((t=>t.subCategory))));return Ee(t.map((t=>{const e=this.Gv.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,r)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(r):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,r){return Ie(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}ze(t){var e,i;super.ze(t);const s=this.yB.Dm(),r=this.mB.Dm(),n=this.Gv.filter((t=>t.getVisible()&&t.tB)),o=we(n.map((t=>t.category))),h=we(Ee(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.uB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.uB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.At,c=u instanceof Gi?(t,e)=>{var i;return Qi(t,e,u,(null===(i=this.Ly)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return ts(t,e,u,(null===(i=this.Ly)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.oB?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.JD?1e-6:0,valueEnd:t.value}}))):"groups"===this.oB?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.cB),r=this.cB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.JD?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.JD?1e-6:0;i.forEach(((e,i)=>{d.push({bar:e,position:{category:o.indexOf(t),valueStart:s,valueEnd:s+e.value}}),s+=e.value}))}))),d.forEach((t=>{const{bar:e,position:i}=t;let s,r,n=this.lB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.uB&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+a*t+l*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.Ly&&n.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-n.valueEnd);r=c(n.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-r)&&(r=i.valueEnd)}else r=i.valueEnd;this.lB.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.cs.Ms(!0),s===n.category&&r===n.valueEnd||(this.nB=!0)})),ga.Gp(this.Ch,this.Lp);const f=n.length>0;this.categoryAxis.Rr(),this.valueAxis.Rr();const g=this.categoryAxis.setVisible(f).Os(),m=this.valueAxis.setVisible(f).Os(r),{labelMarginBeforeCategoryAxisPixels:y}=f?this.xB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.ze(g,s,r,{labelMarginBeforeCategoryAxisPixels:y}),this.valueAxis.ze(m);const p=this.categoryAxis.getThickness(),A=_t(g.Qd+y,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Ye),x={x:Math.min(this.HD.x.getInnerStart(),this.HD.x.getInnerEnd()),y:Math.min(this.HD.y.getInnerStart(),this.HD.y.getInnerEnd())},S=Math.max(this.HD.x.getInnerStart(),this.HD.x.getInnerEnd()),v=Math.max(this.HD.y.getInnerStart(),this.HD.y.getInnerEnd()),b={x:S-x.x,y:v-x.y};this.Xv.Ve(x),this.Xv.it(b),this.$v.Ve(x),this.$v.it(b),super.Pp(),this.hm.ze(!1,this.Gv,void 0);const M=ga.Np(this.Ch,this.Lp);if(this.HD.zi([this.$t.bottom+this.Ia.bottom+("vertical"===this.Es.gB?A:0),this.$t.top+this.Ia.top+M+("horizontal"===this.Es.gB?m.Qd:0)]),this.HD.Ei([this.$t.left+this.Ia.left+this.Es.getHeight({x:A,y:m.Qd}),this.$t.right+this.Ia.right]),this.fB.wx({x:this.HD.x.ei(),y:this.HD.y.ei(),width:this.HD.x.ri(),height:this.HD.y.ri()}),this.cp&&this.cp(),this.nB){const t=this.h_.Dm(),e="groups"===this.oB?1/(h.length+2*(h.length+1)*this.cB):1-2*this.cB;n.forEach((i=>{const s=this.lB.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Es.toPoint(r,s.valueStart),this.Es.toPoint(r,s.valueEnd),this.Es.toPoint(n,s.valueEnd),this.Es.toPoint(n,s.valueStart)];t.add({Jo:i.Jo,vertices:o,bar:i},{fillStyle:i.Ie,strokeStyle:i.Pe})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.nB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(t),this.setAnimationValues(t),this.valueAxis.setAnimationsEnabled(t),this.categoryAxis.setAnimationsEnabled(t),this}dispose(){return this.AB.Y(),this.fB.Y(),this.hm.Y(),super.dispose()}SB(t){const e=this.hB;e&&t.sort(((i,s)=>e({category:i.category,value:t.reduce(((t,e)=>t+(e.category===i.category&&e.value||0)),0)},{category:s.category,value:t.reduce(((t,e)=>t+(e.category===s.category&&e.value||0)),0)})))}xB(t,e,i,s){let r=0;const n=this.rB,o=this.ZD,h=this.valueAxis.getInterval(),a=this.Es.getWidth({x:this.HD.x.ri(),y:this.HD.y.ri()});if(n&&n.labelFillStyle!==_){const o=n.tickLength+n.labelMargin,l=this.Es.toPoint(0,1),u={Od:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),r=n.formatter(t,s);if(!r)return;const a=i;return void 0!==a?{text:r,position:this.Es.toPoint(a,this.valueAxis.At.pi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.bB(t,s)}:void 0})),Ju:n.labelFont,At:this.HD},c=u?this.aB?pf(u,a,this.Es.getWidth):u.Od:[];c.forEach((t=>{t&&i.add().Sr(t.text).Ve(t.position).Za(t.alignment).sr(t.rotation).Re(n.labelFillStyle).ir(n.labelFont)})),n.tickStyle!==ut&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Es.getWidth(t.position);s.add({positions:[this.Es.toPoint(e,this.valueAxis.At.getInnerStart()),this.Es.toPoint(e,this.valueAxis.At.pi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Es.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==_){let t;"after-bar"===o.position?t={Od:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.lB.get(t);return void 0!==s?{text:i,position:this.Es.toPoint(s.category,this.valueAxis.At.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Es.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.MB(t)}:void 0})),Ju:o.labelFont,At:this.HD}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Od:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.lB.get(t);if(void 0===s)return;const r="bipolar"===this.jD?Math.sign(s.valueEnd):"negative"===this.jD?-1:1,n=this.Es.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*r:"inside-bar-centered"===o.position?0:-1*r);return{text:i,position:this.Es.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.At.pi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.At.pi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.MB(t)}})),Ju:o.labelFont,At:this.HD}),t&&(t?this.aB?pf(t,a,this.Es.getWidth):t.Od:[]).forEach((t=>{t&&i.add().Sr(t.text).Ve(t.position).Za(t.alignment).sr(t.rotation).Re(o.labelFillStyle).ir(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}bB(t,e){if(!this.rB||this.rB.labelFillStyle===_)return{x:0,y:0};const i=this.sB.get(t);if(i)return i;const s=this.rB.formatter(t,e),r=this.cs.Xg.Hg(s,this.rB.labelFont,this.rB.labelRotation);return r.isEstimate?this.cs.Ms(!0):this.sB.set(t,r),r}MB(t){if(!this.ZD||this.ZD.labelFillStyle===_)return{x:0,y:0};const e=this.eB.get(t);if(e)return e;const i=this.cs.Xg.Hg(this.ZD.formatter(t,t.category,t.value),this.ZD.labelFont,this.ZD.labelRotation);return i.isEstimate?this.cs.Ms(!0):this.eB.set(t,i),i}QD(){return this.Gv.reduce(((t,e)=>{const i=this.MB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}iB(){this.nB=!0,this.cs.Ms()}getMinimumSize(){return{x:200,y:200}}}const xf={Disabled:void 0,None:void 0,Ascending:(t,e)=>t.value-e.value,Descending:(t,e)=>e.value-t.value,Alphabetical:(t,e)=>t.category.localeCompare(e.category)},Sf={...Ch,gB:"vertical",KD:-1,qD:1},vf={...Th,gB:"horizontal",KD:1,qD:-1},bf=(t,e,i)=>{const s=[[e.bar]],r=t.valueAxis.getTitle();return r&&s.push([r]),e.subCategory?s.push([e.subCategory,"",{text:Ki(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}]):s.push({text:Ki(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}),s},Mf={XY:pc,Spider:za,BarChart:Fa,Map:Oa,Polar:Pa,D3:Rl},Cf={Angola:{name:"Angola",ISO_A3:"AGO"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Gabon:{name:"Gabon",ISO_A3:"GAB"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Namibia:{name:"Namibia",ISO_A3:"NAM"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Oman:{name:"Oman",ISO_A3:"OMN"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},Somalia:{name:"Somalia",ISO_A3:"SOM"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"}},Tf={Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Armenia:{name:"Armenia",ISO_A3:"ARM"},Australia:{name:"Australia",ISO_A3:"AUS"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},China:{name:"China",ISO_A3:"CHN"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},India:{name:"India",ISO_A3:"IND"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Nepal:{name:"Nepal",ISO_A3:"NPL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Philippines:{name:"Philippines",ISO_A3:"PHL"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Palestine:{name:"Palestine",ISO_A3:"PSE"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Russia:{name:"Russia",ISO_A3:"RUS"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Singapore:{name:"Singapore",ISO_A3:"SGP"},Syria:{name:"Syria",ISO_A3:"SYR"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Yemen:{name:"Yemen",ISO_A3:"YEM"}},wf={"New South Wales":{name:"New South Wales"},Victoria:{name:"Victoria"},Queensland:{name:"Queensland"},"South Australia":{name:"South Australia"},"Western Australia":{name:"Western Australia"},Tasmania:{name:"Tasmania"},"Northern Territory":{name:"Northern Territory"},"Australian Capital Territory":{name:"Australian Capital Territory"},"Other Territories":{name:"Other Territories"}},Ef={"British Columbia":{name:"British Columbia"},Quebec:{name:"Quebec"},Nunavut:{name:"Nunavut"},"Prince Edward Island":{name:"Prince Edward Island"},Saskatchewan:{name:"Saskatchewan"},Yukon:{name:"Yukon"},Manitoba:{name:"Manitoba"},Ontario:{name:"Ontario"},"New Brunswick":{name:"New Brunswick"},"Northwest Territories":{name:"Northwest Territories"},Alberta:{name:"Alberta"},"Newfoundland and Labrador":{name:"Newfoundland and Labrador"},"Nova Scotia":{name:"Nova Scotia"}},kf={Albania:{name:"Albania",ISO_A3:"ALB"},Austria:{name:"Austria",ISO_A3:"AUT"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Denmark:{name:"Denmark",ISO_A3:"DNK"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Finland:{name:"Finland",ISO_A3:"FIN"},France:{name:"France",ISO_A3:"FRA"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Greece:{name:"Greece",ISO_A3:"GRC"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Italy:{name:"Italy",ISO_A3:"ITA"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Malta:{name:"Malta",ISO_A3:"MLT"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Poland:{name:"Poland",ISO_A3:"POL"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Romania:{name:"Romania",ISO_A3:"ROU"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Russia:{name:"Russia",ISO_A3:"RUS"},Turkey:{name:"Turkey",ISO_A3:"TUR"}},If={Aruba:{name:"Aruba",ISO_A3:"ABW"},Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},Angola:{name:"Angola",ISO_A3:"AGO"},Anguilla:{name:"Anguilla",ISO_A3:"AIA"},Albania:{name:"Albania",ISO_A3:"ALB"},Aland:{name:"Aland",ISO_A3:"ALA"},Andorra:{name:"Andorra",ISO_A3:"AND"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Argentina:{name:"Argentina",ISO_A3:"ARG"},Armenia:{name:"Armenia",ISO_A3:"ARM"},"American Samoa":{name:"American Samoa",ISO_A3:"ASM"},Antarctica:{name:"Antarctica",ISO_A3:"ATA"},"French Southern and Antarctic Lands":{name:"French Southern and Antarctic Lands",ISO_A3:"ATF"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},Australia:{name:"Australia",ISO_A3:"AUS"},Austria:{name:"Austria",ISO_A3:"AUT"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belize:{name:"Belize",ISO_A3:"BLZ"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},Canada:{name:"Canada",ISO_A3:"CAN"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Chile:{name:"Chile",ISO_A3:"CHL"},China:{name:"China",ISO_A3:"CHN"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Cyprus No Mans Area":{name:"Cyprus No Mans Area",ISO_A3:"-99"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},"Cook Islands":{name:"Cook Islands",ISO_A3:"COK"},Colombia:{name:"Colombia",ISO_A3:"COL"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Cuba:{name:"Cuba",ISO_A3:"CUB"},Curaçao:{name:"Curaçao",ISO_A3:"CUW"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},"Northern Cyprus":{name:"Northern Cyprus",ISO_A3:"-99"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Dominica:{name:"Dominica",ISO_A3:"DMA"},Denmark:{name:"Denmark",ISO_A3:"DNK"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},"Dhekelia Sovereign Base Area":{name:"Dhekelia Sovereign Base Area",ISO_A3:"-99"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Finland:{name:"Finland",ISO_A3:"FIN"},Fiji:{name:"Fiji",ISO_A3:"FJI"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},France:{name:"France",ISO_A3:"FRA"},"Faroe Islands":{name:"Faroe Islands",ISO_A3:"FRO"},"Federated States of Micronesia":{name:"Federated States of Micronesia",ISO_A3:"FSM"},Gabon:{name:"Gabon",ISO_A3:"GAB"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Guernsey:{name:"Guernsey",ISO_A3:"GGY"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Greece:{name:"Greece",ISO_A3:"GRC"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},Guam:{name:"Guam",ISO_A3:"GUM"},Guyana:{name:"Guyana",ISO_A3:"GUY"},"Hong Kong S.A.R.":{name:"Hong Kong S.A.R.",ISO_A3:"HKG"},"Heard Island and McDonald Islands":{name:"Heard Island and McDonald Islands",ISO_A3:"HMD"},Honduras:{name:"Honduras",ISO_A3:"HND"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},"Isle of Man":{name:"Isle of Man",ISO_A3:"IMN"},India:{name:"India",ISO_A3:"IND"},"Indian Ocean Territories":{name:"Indian Ocean Territories",ISO_A3:"-99"},"British Indian Ocean Territory":{name:"British Indian Ocean Territory",ISO_A3:"IOT"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Israel:{name:"Israel",ISO_A3:"ISR"},Italy:{name:"Italy",ISO_A3:"ITA"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},Jersey:{name:"Jersey",ISO_A3:"JEY"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},"Baykonur Cosmodrome":{name:"Baykonur Cosmodrome",ISO_A3:"-99"},"Siachen Glacier":{name:"Siachen Glacier",ISO_A3:"-99"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},Kiribati:{name:"Kiribati",ISO_A3:"KIR"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},Liechtenstein:{name:"Liechtenstein",ISO_A3:"LIE"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},"Macao S.A.R":{name:"Macao S.A.R",ISO_A3:"MAC"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Mexico:{name:"Mexico",ISO_A3:"MEX"},"Marshall Islands":{name:"Marshall Islands",ISO_A3:"MHL"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},"Northern Mariana Islands":{name:"Northern Mariana Islands",ISO_A3:"MNP"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Namibia:{name:"Namibia",ISO_A3:"NAM"},"New Caledonia":{name:"New Caledonia",ISO_A3:"NCL"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Niue:{name:"Niue",ISO_A3:"NIU"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Nepal:{name:"Nepal",ISO_A3:"NPL"},"New Zealand":{name:"New Zealand",ISO_A3:"NZL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Panama:{name:"Panama",ISO_A3:"PAN"},"Pitcairn Islands":{name:"Pitcairn Islands",ISO_A3:"PCN"},Peru:{name:"Peru",ISO_A3:"PER"},"Spratly Islands":{name:"Spratly Islands",ISO_A3:"-99"},Philippines:{name:"Philippines",ISO_A3:"PHL"},Palau:{name:"Palau",ISO_A3:"PLW"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},Poland:{name:"Poland",ISO_A3:"POL"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Palestine:{name:"Palestine",ISO_A3:"PSE"},"French Polynesia":{name:"French Polynesia",ISO_A3:"PYF"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Romania:{name:"Romania",ISO_A3:"ROU"},Russia:{name:"Russia",ISO_A3:"RUS"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},Singapore:{name:"Singapore",ISO_A3:"SGP"},"South Georgia and South Sandwich Islands":{name:"South Georgia and South Sandwich Islands",ISO_A3:"SGS"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Solomon Islands":{name:"Solomon Islands",ISO_A3:"SLB"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Somalia:{name:"Somalia",ISO_A3:"SOM"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},"Sao Tome and Principe":{name:"Sao Tome and Principe",ISO_A3:"STP"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},"East Timor":{name:"East Timor",ISO_A3:"TLS"},Tonga:{name:"Tonga",ISO_A3:"TON"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Tuvalu:{name:"Tuvalu",ISO_A3:"TUV"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},"United States Minor Outlying Islands":{name:"United States Minor Outlying Islands",ISO_A3:"UMI"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"US Naval Base Guantanamo Bay":{name:"US Naval Base Guantanamo Bay",ISO_A3:"-99"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Vanuatu:{name:"Vanuatu",ISO_A3:"VUT"},"Wallis and Futuna":{name:"Wallis and Futuna",ISO_A3:"WLF"},"Akrotiri Sovereign Base Area":{name:"Akrotiri Sovereign Base Area",ISO_A3:"-99"},Samoa:{name:"Samoa",ISO_A3:"WSM"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"}},zf={Alabama:{name:"Alabama"},Alaska:{name:"Alaska"},Arizona:{name:"Arizona"},Arkansas:{name:"Arkansas"},California:{name:"California"},Colorado:{name:"Colorado"},Connecticut:{name:"Connecticut"},Delaware:{name:"Delaware"},"District of Columbia":{name:"District of Columbia"},Florida:{name:"Florida"},Georgia:{name:"Georgia"},Hawaii:{name:"Hawaii"},Idaho:{name:"Idaho"},Illinois:{name:"Illinois"},Indiana:{name:"Indiana"},Iowa:{name:"Iowa"},Kansas:{name:"Kansas"},Kentucky:{name:"Kentucky"},Louisiana:{name:"Louisiana"},Maine:{name:"Maine"},Maryland:{name:"Maryland"},Massachusetts:{name:"Massachusetts"},Michigan:{name:"Michigan"},Minnesota:{name:"Minnesota"},Mississippi:{name:"Mississippi"},Missouri:{name:"Missouri"},Montana:{name:"Montana"},Nebraska:{name:"Nebraska"},Nevada:{name:"Nevada"},"New Hampshire":{name:"New Hampshire"},"New Jersey":{name:"New Jersey"},"New Mexico":{name:"New Mexico"},"New York":{name:"New York"},"North Carolina":{name:"North Carolina"},"North Dakota":{name:"North Dakota"},Ohio:{name:"Ohio"},Oklahoma:{name:"Oklahoma"},Oregon:{name:"Oregon"},Pennsylvania:{name:"Pennsylvania"},"Rhode Island":{name:"Rhode Island"},"South Carolina":{name:"South Carolina"},"South Dakota":{name:"South Dakota"},Tennessee:{name:"Tennessee"},Texas:{name:"Texas"},Utah:{name:"Utah"},Vermont:{name:"Vermont"},Virginia:{name:"Virginia"},Washington:{name:"Washington"},"West Virginia":{name:"West Virginia"},Wisconsin:{name:"Wisconsin"},Wyoming:{name:"Wyoming"}},Ff={Anguilla:{name:"Anguilla",ISO_A3:"AIA"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Canada:{name:"Canada",ISO_A3:"CAN"},Cuba:{name:"Cuba",ISO_A3:"CUB"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},Dominica:{name:"Dominica",ISO_A3:"DMA"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Mexico:{name:"Mexico",ISO_A3:"MEX"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"}},Rf={Argentina:{name:"Argentina",ISO_A3:"ARG"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Chile:{name:"Chile",ISO_A3:"CHL"},Colombia:{name:"Colombia",ISO_A3:"COL"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},Guyana:{name:"Guyana",ISO_A3:"GUY"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Panama:{name:"Panama",ISO_A3:"PAN"},Peru:{name:"Peru",ISO_A3:"PER"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Honduras:{name:"Honduras",ISO_A3:"HND"}},Df={World:If,USA:zf,NorthAmerica:Ff,SouthAmerica:Rf,Canada:Ef,Europe:kf,Asia:Tf,Africa:Cf,Australia:wf},Pf=(t,e)=>Math.abs(t)+Math.abs(e);function Of(t,e){const i=t.reduce(Pf,0),s=(r=t,Math.max(...r.map((t=>t))));var r;const n=(t=>Math.min(...t.map((t=>t))))(t);return Math.max(e**2*s/i**2,i**2/(e**2*n))}const Lf=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},_f=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(Pf,0),h=t.map((t=>t.animatedValue)).reduce(Pf,0),a=t.map((t=>t.animatedValue*n*r/h)),l=a.reduce(((t,e)=>t+e),0),u=a.map((t=>t/l*100)),c=a.filter(((t,e)=>u[e])),d={children:[],id:0,parentID:-1,name:"Main Rectangle",value:o,animatedValue:h,x:i,y:s,width:r,height:n,nodeIndex:-1,userNode:{name:"Main Rectangle",value:o}};if(1===t.length){const i={...t[0],x:e.x,y:e.y,width:e.width,height:e.height,userNode:{...t[0].userNode,value:t[0].value}};d.children.push(i)}else Vf(c,Lf(d).value,t,d);return d.children},Bf=(t,e,i,s,r)=>{const n=t.reduce(Pf,0)/e;t.forEach(((t,e)=>{const o=Math.abs(t)/n,{x:h,y:a,children:l}=r,u=s[l.length],c={...u,x:h,y:a,width:i?n:o,height:i?o:n,userNode:{...u.userNode,value:u.value}};i?r.y-=o:r.x+=o,l.push(c)})),i?(r.x+=n,r.y+=e,r.width-=n):(r.x-=e,r.y-=n,r.height-=n)},Vf=(t,e,i,s)=>{const r=[{children:t,width:e,row:[]}];for(;r.length>0;){const t=r.pop();if(!t)continue;const{children:e,width:n,row:o}=t;let h=0;const a=[...o];for(;hl)){Bf(a,n,Lf(s).vertical,i,s),r.push({children:e.slice(h),width:Lf(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&Bf(a,n,Lf(s).vertical,i,s)}};class Gf extends fa{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.Bp("treeMapChart bg",0),r,i.cs.ts.treeMapChartBackgroundFillStyle||i.cs.ts.chartXYSeriesBackgroundFillStyle,i.cs.ts.treeMapChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.treeMapChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.treeMapChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,h),this._B=new Map,this.wB=[],this.CB={},this.kB=p([]),this.Ly={speed:1},this.TB=Ye,this.FB=!0,this.IB="Go Back",this.PB=[],this.DB=this.ts.treeMapChartPathLabelFillStyle||this.ts.uiTextFillStyle,this.BB=this.ts.treeMapChartPathLabelFont||this.ts.uiTextFont,this.LB=this.ts.treeMapChartLabelHeaderFillStyle||this.ts.uiTextFillStyle,this.RB=this.ts.treeMapChartLabelHeaderFont||this.ts.uiTextFont,this.EB=this.ts.treeMapChartLabelFillStyle||this.ts.uiTextFillStyle,this.zB=this.ts.treeMapChartLabelFont||this.ts.uiTextFont,this.Xi=!0,this.Kx=!0,this.VB=!1,this.OB=this.ts.treeMapChartParentColor||I,this.NB=this.ts.treeMapChartNodeStrokeStyle||this.ts.uiBackgroundStrokeStyle,this.onNodeMouseEnter=t=>this.R.on("mouseEnter",t),this.onNodeMouseLeave=t=>this.R.on("mouseLeave",t),this.onNodeMouseClick=t=>this.R.on("mouseClick",t),this.onNodeMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onNodeMouseDown=t=>this.R.on("mouseDown",t),this.onNodeMouseUp=t=>this.R.on("mouseUp",t),this.onNodeMouseMove=t=>this.R.on("mouseMove",t),this.offNodeMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offNodeMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offNodeMouseClick=t=>this.R.off(t,"mouseClick"),this.offNodeMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offNodeMouseDown=t=>this.R.off(t,"mouseDown"),this.offNodeMouseUp=t=>this.R.off(t,"mouseUp"),this.offNodeMouseMove=t=>this.R.off(t,"mouseMove"),this.offNodeMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offNodeMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offNodeMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offNodeMouseWheel=t=>this.R.off(t,"mouseWheel"),this.ib=(t,e,i,s,r)=>{this.cs.Ms(),this.VB=!0},this._t=(t,i)=>{const s=this.GB(i);s&&(this.mb=this.UB(s,t),this.Kx&&this.cs.us.ks(i,!0),this.FB&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.mb),this.cs.Ms())},this.wt=(t,i)=>{this.GB(i)&&(this.mb=void 0,this.Kx&&this.cs.us.ks(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.R.emit("mouseLeave",this,t,this.mb),this.cs.Ms())},this.It=(t,i)=>{const s=this.GB(i);s&&(this.mb=this.UB(s,t),this.Kx&&this.cs.us.ks(i,!0),this.FB&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.mb),this.cs.Ms())},this.Ct=(t,e)=>{const i=this.GB(e);if(i){if(this.FB){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.CB[i.parentID]:void 0;e&&(this.kB._([e]),this.mb=void 0,this.R.emit("viewChange",this.kB.C()),this.VB=!0),t&&se(t)}this.R.emit("mouseClick",this,t,this.UB(i,t)),this.cs.Ms()}},this.kt=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseDoubleClick",this,t,this.UB(i,t))},this.Tt=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseDown",this,t,this.UB(i,t))},this.Ft=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseUp",this,t,this.UB(i,t))},this.Dt=(t,e,i)=>{const s=this.GB(i);s&&this.R.emit("mouseDragStart",this,t,e,this.UB(s,t))},this.Pt=(t,e,i,s,r)=>{const n=this.GB(r);n&&this.R.emit("mouseDrag",this,t,e,i,s,this.UB(n,t))},this.Bt=(t,e,i,s)=>{const r=this.GB(s);r&&this.R.emit("mouseDragStop",this,t,e,i,this.UB(r,t))},this.Lt=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseWheel",this,t,this.UB(i,t))},this.Rt=(t,e)=>{const i=this.GB(e);i&&(this.mb=this.UB(i,t),this.Kx&&this.cs.us.ks(e,!0),this.R.emit("touchStart",this,t,this.mb),this.cs.Ms(),se(t))},this.Et=(t,e)=>{const i=this.GB(e);i&&(this.mb=this.UB(i,t),this.Kx&&this.cs.us.ks(e,!0),this.R.emit("touchMove",this,t,this.mb),this.cs.Ms(),se(t))},this.zt=(t,e)=>{const i=this.GB(e);if(i){if(this.mb=void 0,this.FB){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.CB[i.parentID]:void 0;e&&(this.kB._([e]),this.R.emit("viewChange",this.kB.C()),this.VB=!0),t&&se(t)}this.Kx&&this.cs.us.ks(e,!1),this.R.emit("touchEnd",this,t,this.mb),this.cs.Ms(),se(t)}},this.WB=t=>{const e=this.CB[this.PB[t].id]?[this.CB[this.PB[t].id]]:this.wB;this.kB._(e),this.R.emit("viewChange",e),this.VB=!0,this.cs.Ms()},this.ts.treeMapChartNodeColors)this.YB=this.ts.treeMapChartNodeColors;else{const t=this.ts.pointSeriesFillStyle,e=t=>U(t)?t.getColor():I;this.YB="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.cs.Jn(Sh.Rf),this.qy=i.Lx("TreeMapChart plotting",0),this.im=i.Lx("TreeMap UI plotting",1),this.onResize(this.ib),this.Ch.Sr("TreeMap Chart");const a=i.sm(),l=Vt(o?o.cursorBuilder:void 0,Da);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",Nf,(()=>0)),this.HB=this.hs.Bg(),this.Dp(n,this.uiScale),this.cb=this.qy.Km(this._g).Re(new Y).Le(this.NB),this.XB=this.cs.us.jr(this,{animationEnabled:!1!==(null==o?void 0:o.animationsEnabled)}),this.$B=new rl((()=>this.im.Wr(this._g).setMouseInteractions(!1))),this.jB=new rl((()=>this.im.Wr(this.uiScale))),this.cb.setMouseInteractions(this.Xi).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setData(t){t=Array.isArray(t)?t.slice():[t];const{ZB:e}=(()=>{let t=0;return{ZB:e=>{var i;const s=e.map(((t,e)=>({node:t,parent:null}))),r=[];for(;s.length>0;){const e=s.pop();if(!e)continue;const{node:n,parent:o}=e;t+=1;const h={id:t,parentID:null==o?void 0:o.id,name:n.name,value:Number(n.value)||0,animatedValue:Number(n.value)||0,children:[],nodeIndex:o?o.nodeIndex:-1,userNode:n};o?o.children.push(h):r.push(h),null===(i=n.children)||void 0===i||i.forEach((t=>{s.push({node:t,parent:h})}))}const n=t=>{t.children.forEach(n),t.children.length>0&&(t.value+=t.children.reduce(((t,e)=>t+e.value),0),t.animatedValue+=t.children.reduce(((t,e)=>t+e.animatedValue),0),t.children.sort(((t,e)=>e.animatedValue-t.animatedValue)))};r.forEach(n);const o=1===e.length?r[0].children:r;return o.sort(((t,e)=>e.animatedValue-t.animatedValue)),o.forEach(((t,e)=>{t.nodeIndex=e;const i=e=>{e.children.forEach((e=>{e.nodeIndex=t.nodeIndex,i(e)}))};i(t)})),r}}})(),i=e(t);return i.forEach((t=>{const e=this.CB[t.id];e&&this.QB(t,e)})),this.mb=void 0,this.kB._(i),this.wB=i,this.CB=this.JB(i),this.VB=!0,this.cs.Ms(),this}setAnimationValues(t,e=1){return this.Ly=t?{speed:e}:void 0,this.cs.Ms(),this}setInitPathButtonText(t){return this.IB=t,this.VB=!0,this.cs.Ms(),this}setDisplayedLevelsCount(t){return this.TB=t,this.VB=!0,this.cs.Ms(),this}setDrillDownEnabled(t){return this.FB=t,this.VB=!0,this.cs.Ms(),this}setDrillDownNode(t){var e,i;if(this.mb=void 0,void 0===t)this.kB._(this.wB);else{const s=[...this.wB];for(;s.length>0;){const r=s.pop();if(r){if(void 0!==r.value&&r.userNode===t||r.parentID&&Array.isArray(t)&&(null===(i=null===(e=this.CB[r.parentID])||void 0===e?void 0:e.userNode)||void 0===i?void 0:i.children)===t){const t=r.children.length?r:r.parentID?this.CB[r.parentID]:this.wB[0];this.kB._([t]);break}if(r.children)for(let t=r.children.length-1;t>=0;t-=1)s.push(r.children[t])}}}return this.R.emit("viewChange",this.kB.C()),this.VB=!0,this.cs.Ms(),this}setNodeColoring(t){return t instanceof Array?(this.cb.Re(new Y),this.YB=t):this.cb.Re(t),this.VB=!0,this.cs.Ms(),this}setParentNodeColor(t){return this.OB=t,this.VB=!0,this.cs.Ms(),this}setPathLabelFillStyle(t){return this.DB="function"==typeof t?t(this.DB):t,this.VB=!0,this.cs.Ms(),this}getPathLabelFillStyle(){return this.DB}setPathLabelFont(t){return br(t)?this.BB=t:this.BB=t(this.BB),this.VB=!0,this.cs.Ms(),this}getPathLabelFont(){return this.BB}setHeaderFont(t){return br(t)?this.RB=t:this.RB=t(this.RB),this.VB=!0,this.cs.Ms(),this}getHeaderFont(){return this.RB}setHeaderFillStyle(t){return this.LB="function"==typeof t?t(this.LB):t,this.VB=!0,this.cs.Ms(),this}getHeaderFillStyle(){return this.LB}setLabelFont(t){return br(t)?this.zB=t:this.zB=t(this.zB),this.VB=!0,this.cs.Ms(),this}getLabelFont(){return this.zB}setLabelFillStyle(t){return this.EB="function"==typeof t?t(this.EB):t,this.VB=!0,this.cs.Ms(),this}getLabelFillStyle(){return this.EB}setNodeBorderStyle(t){return this.cb.Le(t),this.VB=!0,this.cs.Ms(),this}getNodeBorderStyle(){return this.cb.So()}setNodeEffect(t){return this.HB.bs(t),this.cs.Ms(),this}getNodeEffect(){return this.HB._s()}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Da){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}onNodeMouseDragStart(t){return this.R.on("mouseDragStart",t)}onNodeMouseDrag(t){return this.R.on("mouseDrag",t)}onNodeMouseDragStop(t){return this.R.on("mouseDragStop",t)}onNodeMouseWheel(t){return this.R.on("mouseWheel",t)}onNodeTouchStart(t){return this.R.on("touchStart",t)}onNodeTouchMove(t){return this.R.on("touchMove",t)}onNodeTouchEnd(t){return this.R.on("touchEnd",t)}onViewChange(t){return this.R.on("viewChange",t)}offNodeTouchStart(t){return this.R.off(t,"touchStart")}offNodeTouchMove(t){return this.R.off(t,"touchMove")}offNodeTouchEnd(t){return this.R.off(t,"touchEnd")}offViewChange(t){return this.R.off(t,"viewChange")}setMouseInteractions(t){return this.Xi=t,this.cb.setMouseInteractions(t),this}getMouseInteractions(){return this.Xi}setAnimationHighlight(t){return this.XB.Jr(t),this}getAnimationHighlight(){return this.XB.Kr()}setHighlightOnHover(t){return this.Kx=t,this}getHighlightOnHover(){return this.Kx}UB(t,e){const i=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.cs.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.cs.At},name:t.name,value:t.value,node:t.userNode}}getMinimumSize(){}af(){return[this]}ze(t){super.ze(t),super.Pp(),ga.Gp(this.Ch,this.Lp);const i=ga.Np(this.Ch,this.Lp);if(this.VB&&this.kB.C().length){this.cb.Ot(),this._B.clear(),this.XB.Qr(),this.ph&&this.KB(t);const s=_f({data:this.kB.C(),dimensions:{x:0+this.Ia.left,y:this._g.y.getInnerEnd()-i-this.Ia.top,width:this._g.x.getInnerEnd()-this.Ia.right-this.Ia.left,height:this._g.y.getInnerEnd()-i-this.Ia.top-this.Ia.bottom}}),r=this.$B.Dm();this.qB(s,r),r.finishPlot(),this.tL(),this.wB!==this.kB.C()&&this.wB.length>1&&this.PB.unshift({name:this.IB,id:0});let n=0;const o=this.jB.Dm(),h=this.BB;this.PB.forEach(((t,i)=>{const s=o.add(),r=this.cs.Xg.Hg(t.name,h,0);s.Sr(`← ${t.name}`).ir(h).Ve({x:0,y:100}).Za({x:-1,y:1}).Gr({left:this.Ia.left+n,top:this.Ia.top,right:0,bottom:0}).Re(this.DB).setMouseClickEventHandler((t=>this.WB(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.kB.C().every((t=>t.value===t.animatedValue))?this.VB=!1:this.cs.Ms(!0)}return this.hm.ze(!1,[],void 0,{explicitTarget:this.mb}),this}dispose(){return this.im.Y(),this.qy.Y(),this.hm.Y(),this.cb.dispose(),this._B.clear(),this.$B.Lm(),this.jB.Lm(),super.dispose()}J(){return super.J(),this}K(){return super.K(),this}qd(){return Ae(this.cb.Jh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),pe(t,this.ts,i,{}),this}qB(t,e,i=!1,s=0){const r=t.map(((t,e)=>({node:t,isChild:i,visibleDepth:s})));for(;r.length>0;){const t=r.pop();if(!t)continue;const{node:i,visibleDepth:s,opacity:n}=t,{x:o,y:h,height:a,width:l,children:u,animatedValue:c,name:d,nodeIndex:f}=i,g=this.YB,m=0===s&&1===this.kB.C().length?this.OB:g[f%g.length],y=[{x:o,y:h},{x:o,y:h-a},{x:l+o,y:h-a},{x:l+o,y:h}],p=this.cb.Zr().Fl(y).iL(m.setA(m.getA()*((null!=n?n:255)/255))).yb(c);this._B.set(p,i),this.XB.Zr(p,(t=>p.ds(t)));const A=o+5,x=h+25+5,S=Math.max(a-25-5,0),v=Math.max(l-5-5,0);if(u&&u.length&&s15&&S>15){const t=_f({data:u,dimensions:{x:v>0?A:o,y:S>0?h-25:x,width:v,height:S}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.wB.length||this.wB===this.kB.C()?255:n?n/(s+1):255-e*o;r.push({node:t[e],isChild:!0,visibleDepth:s+1,opacity:h})}}const b=0===s&&1===this.kB.C().length?this.LB:this.EB,M=0===s?this.RB:this.zB,C=this.sL(d,l-25,M),T=this.cs.Xg.Hg(C,M,0),w=e.add();l-25>T.x&&a>25?w.Sr(C).Ve({x:o+5,y:h-2.5}).Za({x:-1,y:1}).Re(b).ir(M):w.Sr("")}}JB(t){const e={},i=[...t];for(;i.length>0;){const t=i.pop();t&&(e[t.id]=t,t.children&&i.push(...t.children))}return e}GB(t){if(!this.VB&&t)return this._B.get(t)}tL(){this.PB=[];const t=this.kB.C()[0].id;let e=this.CB[t].parentID;for(;e;)this.PB.push({name:this.CB[e].name,id:e}),e=this.CB[e].parentID;return this.PB.reverse()}sL(t,e,i){let s=this.cs.Xg.Hg(t,i,0).x;if(s<=e)return t;const r=t.split(" ");let n=t;for(;r.length>1&&s>e;)r.pop(),n=`${r.join(" ")}...`,s=this.cs.Xg.Hg(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.cs.Xg.Hg(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.cs.Xg.Hg(n,i,0).x;return n.length<=3&&s>e?"":n}KB(t){var e;const i=[...this.wB];for(;i.length>0;){const s=i.pop();if(!s)continue;const r=s.value-s.animatedValue;if(Math.abs(r)<.0015*s.value||void 0===this.Ly)s.animatedValue=s.value;else{const i=r/255*((null===(e=this.Ly)||void 0===e?void 0:e.speed)||1)*t;s.animatedValue+=i,(r>0&&s.animatedValue>s.value||r<0&&s.animatedValue0&&i.push(...s.children)}}QB(t,e){const i=[{current:t,previous:e}];for(;i.length>0;){const t=i.pop();if(!t)continue;const{current:e,previous:s}=t;e.animatedValue=this.ph?s.animatedValue:e.value,s.nodeIndex<0?e.nodeIndex=0:e.nodeIndex=s.nodeIndex;const r=new Map(s.children.map((t=>[t.id,t])));e.children.forEach(((t,e)=>{const n=r.get(t.id);i.push({current:t,previous:n||s})}))}}}const Nf=(t,e,i)=>[[e.name],[{text:e.value.toString(),font:{weight:"bold"}}]];class Uf extends fa{constructor(t,e,i,s,r,n,o){super(t,e,i,e.Bp("gaugeChart bg",0),s,e.cs.ts.gaugeChartBackgroundFillStyle,e.cs.ts.gaugeChartBackgroundStrokeStyle,e.cs.ts.gaugeChartTitleFont,e.cs.ts.gaugeChartTitleFillStyle,n),this.hu=this.ts.gaugeChartStartAngle,this.ru=this.ts.gaugeChartEndAngle,this.eL={start:0,end:100},this.M=0,this.hL=[],this.rL=this.ts.gaugeChartBarThickness,this.nL=this.ts.gaugeChartValueIndicatorThickness,this.oL=this.ts.gaugeChartNeedleLength,this.aL=this.ts.gaugeChartNeedleThickness,this.lL=this.ts.gaugeChartNeedleFillStyle,this.uL=this.ts.gaugeChartNeedleStrokeStyle,this.cL=this.ts.gaugeChartRoundedEdges,this.dL=!0,this.fL=!0,this.AL=!0,this.gL=[],this.pL=[],this.yL=!0,this.mL=!0,this.Ty=this.M,this.vL=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.SL=this.ts.gaugeChartBarGradient,this.xL=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.bL=this.ts.gaugeChartTickFont,this.ML=this.ts.gaugeChartValueLabelFont,this._L=this.ts.gaugeChartValueLabelFillStyle,this.wL=this.ts.gaugeChartUnitLabelFont,this.CL=this.ts.gaugeChartUnitLabelFillStyle,this.kL=this.ts.gaugeChartTickFillStyle,this.TL=this.ts.gaugeChartBarColor,this.FL=this.ts.gaugeChartGlowColor,this.IL=this.ts.gaugeChartGlowColor.getA(),this.PL=1,this.DL=1,this.BL=this.ts.gaugeChartNeedleAlignment,this.LL=!1,this.RL=this.ts.gaugeChartGapBetweenBarAndValueIndicators,this.EL=this.ts.gaugeChartBarStrokeStyle,this.zL=!1,this.cs.Jn(Sh.xf),this.Ch.Sr("Gauge Chart"),this.Dp(r,this._g),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.VL=this.TL,this.OL=this.FL,this.NL=C(0,0,0,0),this.GL=this.hs.Bg(),this.UL=this.hs.Bg().bs(this.ts.effectsText),this.WL=this.gp.fc(this._g).Le(this.EL).setMouseInteractions(!1),this.YL=this.gp.ud(this._g).Au(0).Xe(360).mu(0).Le(ut).setMouseInteractions(!1),this.HL=this.Rp.He(this._g).Ye(this.ts.gaugeChartNeedleStrokeStyle).setMouseInteractions(!1),this.XL=this.Rp.He(this._g).Ye(new us({thickness:this.aL,fillStyle:this.lL})).setMouseInteractions(!1),this.$L=this.Rp.Wr(this._g).ir(this.ML).Re(this._L).setMouseInteractions(!1),this.jd=this.Rp.Wr(this._g).ir(this.wL).Re(this.CL).Sr("").setMouseInteractions(!1),this.jL=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1),this.ZL=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1),this.GL.gs([this.WL]),this.UL.gs([this.$L,this.jd,this.jL,this.ZL]),this.QL(),this.onResize((()=>{this.LL=!0}))}QL(){this.XL.Ye((t=>t.setThickness(this.aL))),this.HL.Ye((t=>t.setThickness(2*this.uL.getThickness()+this.aL)))}setAnimationsEnabled(t){return this.ph=t,this.mL=t,this.yL=t,this}setInterval(t,e){return this.eL={start:t,end:e},this.LL=!0,this.cs.Ms(),this}getInterval(){return this.eL}setTickFillStyle(t){return this.kL="function"==typeof t?t(this.kL):t,this.pL.forEach((e=>{e.start.Re(t),e.end.Re(t)})),this.jL.Re(t),this.ZL.Re(t),this.LL=!0,this.cs.Ms(),this}getTickFillStyle(){return this.kL}setTickFont(t){return this.bL="function"==typeof t?t(this.bL):t,this.pL.forEach((e=>{e.start.ir(t),e.end.ir(t)})),this.jL.ir(t),this.ZL.ir(t),this.LL=!0,this.cs.Ms(),this}getTickFont(){return this.bL}setTickFormatter(t){return this.vL=t,this.LL=!0,this.cs.Ms(),this}getTickFormatter(){return this.vL}setValueLabelFillStyle(t){return this._L="function"==typeof t?t(this._L):t,this.$L.Re(t),this.LL=!0,this.cs.Ms(),this}getValueLabelFillStyle(){return this.$L.Jh()}setValueLabelFont(t){return this.ML="function"==typeof t?t(this.ML):t,this.$L.ir(t),this.LL=!0,this.cs.Ms(),this}getValueLabelFont(){return this.$L.tr()}setValueFormatter(t){return this.xL="string"==typeof t?e=>t:t,this.LL=!0,this.cs.Ms(),this}getValueLabel(){return this.$L.Tr()||this.xL}setUnitLabelFillStyle(t){return this.CL="function"==typeof t?t(this.CL):t,this.jd.Re(t),this.LL=!0,this.cs.Ms(),this}getUnitLabelFillStyle(){return this.jd.Jh()}setUnitLabelFont(t){return this.wL="function"==typeof t?t(this.wL):t,this.jd.ir(t),this.LL=!0,this.cs.Ms(),this}getUnitLabelFont(){return this.jd.tr()}setUnitLabel(t){return this.jd.Sr(t),this.LL=!0,this.cs.Ms(),this}getUnitLabel(){return this.jd.Tr()}setNeedleFillStyle(t){return this.lL="function"==typeof t?t(this.lL):t,this.XL.Ye((e=>e.setFillStyle(t))),this.LL=!0,this.cs.Ms(),this}getNeedleFillStyle(){return this.XL.xu().getFillStyle()}setNeedleThickness(t){return this.aL=t,this.QL(),this.LL=!0,this.cs.Ms(),this}getNeedleThickness(){return this.aL}setNeedleStrokeStyle(t){return this.uL="function"==typeof t?t(this.uL):t,this.HL.Ye(t),this.QL(),this.LL=!0,this.cs.Ms(),this}getNeedleStrokeStyle(){return this.HL.xu()}setNeedleLength(t){return this.oL=t,this.LL=!0,this.cs.Ms(),this}getNeedleLength(){return this.oL}setBarColor(t){return this.TL=t,this.LL=!0,this.cs.Ms(),this}getBarColor(){return this.VL}setBarGradient(t){return this.SL=t,this.LL=!0,this.cs.Ms(),this}getBarGradient(){return this.SL}setBarStrokeStyle(t){return this.EL="function"==typeof t?t(this.EL):t,this.WL.Le(t),this.LL=!0,this.cs.Ms(),this}getBarStrokeStyle(){return this.WL.So()}setBarThickness(t){return this.rL=t,this.LL=!0,this.cs.Ms(),this}getBarThickness(){return this.rL}setAngleInterval(t,e){return Math.abs(t-e)>360&&(e=t{t.dispose()})),this.gL.length=0,this.pL.forEach((t=>{t.start.dispose(),t.end.dispose()})),this.pL.length=0,this.hL.forEach((t=>{const e=this.gp.fc(this._g).Le(ut).Re(new N({color:t.color})).setMouseInteractions(!1);this.gL.push(e);const i=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1),s=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1);this.pL.push({start:i,end:s})})),this.GL.gs([this.WL,...this.gL]),this.UL.gs([this.$L,this.jd,this.jL,this.ZL,...this.pL.map((t=>[t.start,t.end])).flat()]),this.LL=!0,this.cs.Ms(),this}getValueIndicators(){return this.hL}setValueIndicatorThickness(t){return this.nL=t,this.LL=!0,this.cs.Ms(),this}getValueIndicatorThickness(){return this.nL}setAutomaticBarColoring(t){return this.AL=!!t,this.LL=!0,this.cs.Ms(),this}getAutomaticBarColoring(){return this.AL}setGlowColor(t){return void 0===t?(this.dL=!1,this.OL=void 0):"object"==typeof t&&"auto"in t?(this.fL=t.auto,t.auto&&(this.OL=void 0),void 0!==t.alpha&&(this.IL=t.alpha),this.dL=!0):(this.OL=t,this.IL=t.getA(),this.fL=!1,this.dL=!0),this.LL=!0,this.cs.Ms(),this}getAutomaticGlowColoring(){return this.fL}setNeedleAlignment(t){return this.BL=t,this.LL=!0,this.cs.Ms(),this}getNeedleAlignment(){return this.BL}setGapBetweenBarAndValueIndicators(t){return this.RL=t,this.LL=!0,this.cs.Ms(),this}getGapBetweenBarAndValueIndicators(){return this.RL}setBarEffect(t){return this.GL.bs(t),this.cs.Ms(),this}getBarEffect(){return this.GL._s()}setLabelEffect(t){return this.UL.bs(t),this.cs.Ms(),this}getLabelEffect(){return this.UL._s()}ze(t){var i;if(super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp(),this.Ty!==this.M){if(this.yL){const e=5e-4*t,i=.003*t,s=Math.sign(this.M-this.Ty);this.Ty=this.Ty+e*s+i*this.PL*(this.M-this.Ty),s!==Math.sign(this.M-this.Ty)?this.Ty=this.M:this.cs.Ms(!0)}else this.Ty=this.M;this.LL=!0}let s=this.hL.find((t=>this.Ty>=t.start&&this.Ty<=t.end));if(s||(this.Tyt.start===this.eL.start)):this.Ty>this.eL.end&&(s=this.hL.find((t=>t.end===this.eL.end)))),this.VL=this.AL&&s?s.color:this.TL,this.mL){if(this.NL!==this.VL){const e=this.NL.getR(),i=this.NL.getG(),s=this.NL.getB(),r=this.VL.getR(),n=this.VL.getG(),o=this.VL.getB(),h=Math.sign(r-e),a=Math.sign(n-i),l=Math.sign(o-s),u=.005*t,c=.003*t;this.NL=C(e+u*h+c*this.DL*(r-e),i+u*a+c*this.DL*(n-i),s+u*l+c*this.DL*(o-s));const d=Math.abs(r-this.NL.getR()),f=Math.abs(n-this.NL.getG()),g=Math.abs(o-this.NL.getB());d<1&&f<1&&g<1?this.NL=this.VL:this.cs.Ms(!0),this.LL=!0}}else this.NL=this.VL;if(this.LL){let t=Ye,r=He,n=Ye,o=He;if(new Array(100).fill(0).forEach(((e,i,s)=>{const h=this.hu+i/s.length*(this.ru-this.hu),a=Math.sin(h*Math.PI/180),l=Math.cos(h*Math.PI/180);ar&&(r=a),lo&&(o=l)})),this.SL?this.WL.Re(new rt({stops:[{offset:0,color:T("#000000")},{offset:1,color:this.NL}],position:{x:.5,y:.5}})):this.WL.Re(new N({color:this.NL})),this.dL){const t=this.fL&&s?this.NL:null!==(i=this.OL)&&void 0!==i?i:this.FL;this.YL.Re(new rt({stops:[{offset:0,color:t.setA(this.IL)},{offset:1,color:t.setA(0)}],position:{x:.5,y:.5},extent:e.GradientExtent.farthestSide}))}else this.YL.Re(_);const h=this.vL(this.eL.start),a=this.vL(this.eL.end);let l=0,u=0;const c=this.cs.Xg.Hg(h,this.jL.tr(),this.jL.er()),d=this.cs.Xg.Hg(a,this.ZL.tr(),this.ZL.er());c.x>l&&(l=c.x),c.y>u&&(u=c.y),d.x>l&&(l=d.x),d.y>u&&(u=d.y),this.pL.forEach(((t,e)=>{if(e>=this.hL.length)return;const i=this.hL[e],s=this.vL(i.start),r=this.vL(i.end),n=this.cs.Xg.Hg(s,t.start.tr(),t.start.er()),o=this.cs.Xg.Hg(r,t.end.tr(),t.end.er());n.x>l&&(l=n.x),n.y>u&&(u=n.y),o.x>l&&(l=o.x),o.y>u&&(u=o.y)}));const f=this.hL.length>0?this.nL:0,g=this._g.getInnerIntervalPixels(),m=ga.Np(this.Ch,this.Lp),y={x:g.x-(this.Ia.left+this.Ia.right),y:g.y-(this.Ia.bottom+this.Ia.top)-m},p={x:this.Ia.left+.5*y.x,y:this.Ia.bottom+.5*y.y},A=f+2*this.RL+this.rL/2,x=l+A,S=u+A,v=S+m,b=y.y-(v+S),M=y.x-(x+x),C=Math.max(0,b0;if(this.WL.setVisible(F),this.gL.forEach((t=>t.setVisible(F))),this.XL.setVisible(F),this.HL.setVisible(F),this.YL.setVisible(F),this.jd.setVisible(F),this.$L.setVisible(F),this.jL.setVisible(F),this.ZL.setVisible(F),this.pL.forEach((t=>{t.start.setVisible(F),t.end.setVisible(F)})),!F)return;const R={x:p.x-.5*I,y:p.y-.5*k};this.YL.Ve(p).gu(.5*Math.min(y.x,y.y)),this.$L.Ve(R).Sr(this.xL(this.Ty)),this.jd.Ve({x:R.x,y:R.y-this.$L.od().y-this.jd.od().y/4});const D=Xf(this.eL,this.hu,this.ru,this.Ty,z,w+this.BL*(this.oL/2+this.rL/2)),P=D.angle*(Math.PI/180),O=.5*this.oL,L=Math.cos(P),B=Math.sin(P);this.XL.$e({x:D.x+O*L,y:D.y+O*B}).Xe({x:D.x-O*L,y:D.y-O*B}),this.HL.$e({x:D.x+O*L,y:D.y+O*B}).Xe({x:D.x-O*L,y:D.y-O*B});const V=Yf(z,w,this.hu,this.ru,this.rL,this.cL,!1,!1);this.WL.Fl(V).sa({min:{x:z.x-w,y:z.y-w},max:{x:z.x+w,y:z.y+w}});const G=z.y+w,U=z.y-w,Y=z.x+w,H=z.x-w,[X,W]=this.eL.start{var i,s;const r=t.start>=X&&t.end<=W;this.gL[e].setVisible(r),this.pL[e].start.setVisible(r),this.pL[e].end.setVisible(r);const n=Xf(this.eL,this.hu,this.ru,t.start,z,$),o=Xf(this.eL,this.hu,this.ru,t.end,z,$),h=Yf(z,j,n.angle,o.angle,this.nL,this.cL,!(0===e),!(e===this.hL.length-1));this.gL[e].Fl(h);const a=this.eL.start===t.start||this.eL.end===t.start,l=this.eL.start===t.end||this.eL.end===t.end||this.hL.some((e=>e.start===t.end&&e!==t));this.pL[e].start.Ve({x:n.x,y:n.y}).Za({x:Math.min(1,Math.max(-1,2*(n.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(n.y-G)/(U-G)-1))}).Sr(null!==(i=t.startLabel)&&void 0!==i?i:a?"":this.vL(t.start)),this.pL[e].end.Ve({x:o.x,y:o.y}).Za({x:Math.min(1,Math.max(-1,2*(o.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(o.y-G)/(U-G)-1))}).Sr(null!==(s=t.endLabel)&&void 0!==s?s:l?"":this.vL(t.end))}));const Z=this.hL.some((t=>t.start=t.start&&this.eL.start<=t.end:this.eL.start<=t.start&&this.eL.start>=t.end)),q=Xf(this.eL,this.hu,this.ru,this.eL.start,z,Z?$:j-this.RL);this.jL.Ve({x:q.x,y:q.y}).Za({x:Math.min(1,Math.max(-1,2*(q.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(q.y-G)/(U-G)-1))}).Sr(h);const K=this.hL.some((t=>t.start=t.start&&this.eL.end<=t.end:this.eL.end<=t.start&&this.eL.end>=t.end)),J=Xf(this.eL,this.hu,this.ru,this.eL.end,z,K?$:j-this.RL);this.ZL.Ve({x:J.x,y:J.y}).Za({x:Math.min(1,Math.max(-1,2*(J.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(J.y-G)/(U-G)-1))}).Sr(a),this.LL=!1}}getMinimumSize(){return{x:150,y:150}}af(){return[this]}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.setMouseInteractions(!1),pe(t,this.ts,i,{fill:new N({color:this.getBarColor()})}),this}}const Yf=(t,e,i,s,r,n=!0,o=!0,h=!0)=>{const a=[],l=.5*r,u=i>s,c=Math.sign(i-s),d=-1*c;if(n){const t=l/(2*Math.PI*e)*360+.1;o&&(i+=t*d),h&&(s+=t*c)}else i+=.1*d,s+=.1*c;const f=Hf(t,e+l,i,s,u);if(a.push(...f),n){const r={x:t.x+e*Math.cos(s*(Math.PI/180)),y:t.y+e*Math.sin(s*(Math.PI/180))};let n;n=i>s?Hf(r,l,s+180,s+360,u):Hf(r,l,s-180,s-360,u),a.push(...n)}const g=Hf(t,e-l,s,i,!u);if(a.push(...g),n){const r={x:t.x+e*Math.cos(i*(Math.PI/180)),y:t.y+e*Math.sin(i*(Math.PI/180))};let n;n=i>s?Hf(r,l,i-180,i-360,u):Hf(r,l,i+180,i+360,u),a.push(...n)}return a},Hf=(t,e,i,s,r)=>{it>s:t=>t{const[o,h]=t.start{const s=(t=>{const i=new N({color:t.uiStrokeColorContrastHigh}),s=new N({color:t.uiStrokeColorContrastMedium}),r=new N({color:t.uiStrokeColorContrastLow}),n=new vr({family:t.fontFamily,weight:"normal",style:"normal"}),o=n.setSize(18*t.fontScaler),h=n.setSize(16*t.fontScaler),a=n.setSize(14*t.fontScaler),l=n.setSize(10*t.fontScaler),u=n.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=n.setSize(13*t.fontScaler),d=new us({thickness:2,fillStyle:r}),f=new N({color:t.dataHighlightOverlayColor}),g=new us({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new N({color:t.stroke}))),y=t=>m[t%m.length],p=m.map((t=>new us({thickness:2,fillStyle:t}))),A=t=>p[t%p.length],x=t.dataColorPalette.map((t=>new N({color:t.border}))).map((t=>new us({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new ht({angle:0,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new ht({angle:180,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),w=t=>M[t%M.length],E=t.dataColorPalette.map((t=>{const e=t.area;return new ht({angle:180,stops:[{color:ge(e,C(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ge(e,C(0,0,0,e.getA()),.3),offset:1}]})})),k=t=>E[t%E.length],I=t.dataColorPaletteInverted.map((t=>new N({color:t.border}))).map((t=>new us({thickness:2,fillStyle:t}))),z=t=>I[t%I.length],F=new N({color:t.dataColorPositive}),R=new N({color:t.dataColorNegative}),D=new us({thickness:1,fillStyle:new N({color:t.dataStrokeColorContrastHigh.setA(50)})}),P=new us({thickness:2,fillStyle:t.axisLineFillStyle}),O=ut,L=new N({color:C(0,0,0,1)}),B=new us({thickness:1,fillStyle:t.axisGridMajorFillStyle}),V=ut,G=a,U=t.axisLabelMajorFillStyle,Y=new us({thickness:1,fillStyle:t.axisGridMajorFillStyle}),H=new us({thickness:1,fillStyle:t.axisTickMajorFillStyle}),X=a,W=t.axisLabelMajorFillStyle,j=new us({thickness:1,fillStyle:t.axisGridMinorFillStyle}),$=new us({thickness:1,fillStyle:t.axisTickMinorFillStyle}),Z=l,q=t.axisLabelMinorFillStyle,K=zh,J=new kh({gridStrokeStyle:B,tickStyle:V,tickLength:50,tickPadding:-14,labelFont:G,labelFillStyle:U}),Q=new kh({gridStrokeStyle:Y,tickStyle:H,tickLength:7,tickPadding:5,labelFont:X,labelFillStyle:W}),tt=new kh({gridStrokeStyle:j,tickStyle:$,tickLength:4,tickPadding:10,labelFont:Z,labelFillStyle:q}),et=new ra({extremeTickStyle:K,majorTickStyle:Q,minorTickStyle:tt}),it=new qh({greatTickStyle:J,majorTickStyle:Q,minorTickStyle:tt}),st=new Lh({majorTickStyle:Q,minorTickStyle:tt}),rt=new N({color:t.dataHighlightOverlayColor}),nt=new us({thickness:1,fillStyle:s}),ot=new us({thickness:2,fillStyle:s}),at=t=>new Fr.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),lt=m[0],ct=t.uiTextFillStyle,dt=t.legendBackgroundFillStyle,ft=new us({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),gt=ye(t.legendButtonDefaultColor),mt=ye(t.isDark?C(70,70,70,255):C(170,170,170,255)),yt=new N({color:t.isDark?C(70,70,70,255):C(170,170,170,255)}),pt=new us({thickness:1,fillStyle:i}),At=new fo({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:uo.DashedEqual,patternScale:3}),xt=new us({thickness:1,fillStyle:t.cursorGridFillStyle}),St=t.zoomBandChartDefocusOverlayFillStyle,vt=new us({thickness:2,fillStyle:new N({color:t.zoomBandChartSplitterColor})}),bt=new N({color:t.uiBackgroundColor});let Mt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:ut,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new us({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:ut,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:A,pointLineSeriesStrokeStyle:A,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:A,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:A,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:ut,segmentSeriesStrokeStyle:A,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:ut,boxSeriesStrokeStyle:new us({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new us({thickness:1,fillStyle:new N({color:C(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:F,ohlcCandleBodyFillStyleNegative:R,ohlcCandleTailStrokeStylePositive:new us({thickness:1,fillStyle:new N({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new us({thickness:1,fillStyle:new N({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new us({thickness:2,fillStyle:F}),ohlcBarStrokeStyleNegative:new us({thickness:2,fillStyle:R}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:D,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:D,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:z,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:z,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:z,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:P,xAxisNibStyle:O,xAxisOverlayStyle:L,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:ut,xAxisNumericTicks:et,xAxisDateTimeTicks:it,xAxisTimeTicks:st,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:P,yAxisNibStyle:O,yAxisOverlayStyle:L,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:ut,yAxisNumericTicks:et,yAxisDateTimeTicks:it,yAxisTimeTicks:st,bandFillStyle:rt,bandStrokeStyle:nt,constantLineStrokeStyle:ot,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:ut,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:_,barChartSeriesBackgroundStrokeStyle:ut,barChartBarFillStyle:y,barChartBarStrokeStyle:new us({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:P,barChartValueAxisTicks:et.setMajorTickStyle((t=>t.setGridStrokeStyle(ut))).setMinorTickStyle((t=>t.setGridStrokeStyle(ut))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:P,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:et.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:ut,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:ut,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:P,xAxis3DNumericTicks:et,xAxis3DDateTimeTicks:it,xAxis3DTimeTicks:st,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:P,yAxis3DNumericTicks:et,yAxis3DDateTimeTicks:it,yAxis3DTimeTicks:st,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:P,zAxis3DNumericTicks:et,zAxis3DDateTimeTicks:it,zAxis3DTimeTicks:st,lineSeries3DStrokeStyle:A,pointLineSeries3DStrokeStyle:A,pointLineSeries3DPointStyle:at,pointSeries3DPointStyle:at,pointCloudSeries3DPointStyle:t=>new Fr.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:D,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:D,boxSeries3DFillStyle:y,meshModel3DFillStyle:y(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:ut,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:rt,polarSectorStrokeStyle:nt,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:P,polarAmplitudeAxisNumericTicks:et,polarAmplitudeAxisDateTimeTicks:it,polarAmplitudeAxisTimeTicks:st,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:P,polarRadialAxisTickStyle:Q,polarLineSeriesStrokeStyle:A,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:A,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:k,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:k,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:ut,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:lt,mapChartStrokeStyle:new us({thickness:1,fillStyle:new N({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:_,mapChartOutlierRegionStrokeStyle:new us({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:dt,mapChartSeparateRegionStrokeStyle:ft,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:ut,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:lt,dataGridCellBackgroundFillStyle:new N({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new us({thickness:.4,fillStyle:new N({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:ut,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ft,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ft,dataGridScrollBarButtonArrowFillStyle:gt,dataGridScrollBarButtonArrowStrokeStyle:ft,sparkLineChartStrokeStyle:A(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:ft,sparkChartBandFillStyle:rt,sparkChartBandStrokeStyle:nt,sparkChartConstantLineStrokeStyle:ot,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:ut,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new us({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new us({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new us({thickness:2,fillStyle:i}),spiderSeriesFillStyle:k,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:ut,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:ft,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:pt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:ut,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:ft,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:pt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:ut,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:ft,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:pt,gaugeChartValueLabelFont:c.setSize(60),gaugeChartUnitLabelFont:c.setSize(40),gaugeChartTickFont:c.setSize(30),gaugeChartBarThickness:40,gaugeChartValueIndicatorThickness:10,gaugeChartRoundedEdges:!0,gaugeChartNeedleLength:40,gaugeChartStartAngle:225,gaugeChartEndAngle:-45,gaugeChartNeedleAlignment:0,gaugeChartGapBetweenBarAndValueIndicators:10,gaugeChartTickFillStyle:t.uiTextFillStyle,gaugeChartBarGradient:!0,gaugeChartBarStrokeStyle:ut,gaugeChartUnitLabelFillStyle:t.uiTextFillStyle,gaugeChartValueLabelFillStyle:t.uiTextFillStyle,gaugeChartBarColor:C(255,255,255),gaugeChartGlowColor:C(255,255,64),gaugeChartNeedleFillStyle:new N({color:C(255,255,255)}),gaugeChartNeedleThickness:10,gaugeChartNeedleStrokeStyle:new us({thickness:2,fillStyle:new N({color:C(0,0,0)})}),gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:ut,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:ut,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new us({thickness:1,fillStyle:new N({color:T("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:ct,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:ut,zoomBandChartDefocusOverlayFillStyle:St,zoomBandChartSplitterStrokeStyle:vt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:C(254,204,0,.7),parallelCoordinateChartBackgroundFillStyle:t.panelBackgroundFillStyle,parallelCoordinateChartBackgroundStrokeStyle:ut,parallelCoordinateChartTitleFont:o,parallelCoordinateChartTitleFillStyle:t.titleFillStyle,parallelCoordinateChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,parallelCoordinateChartSeriesBackgroundStrokeStyle:d,parallelCoordinateChartSeriesColor:e=>t.dataColorPalette[e%t.dataColorPalette.length].stroke,parallelCoordinateChartSeriesColorUnselected:t.dataColorUnselected,parallelCoordinateChartSeriesLineThickness:2,parallelCoordinateChartPointedSeriesLineStyle:p[0],parallelCoordinateAxisTitleFont:h,parallelCoordinateAxisTitleFillStyle:t.axisTitleFillStyle,parallelCoordinateAxisNumericTicks:et,parallelCoordinateAxisDateTimeTicks:it,parallelCoordinateAxisTimeTicks:st,parallelCoordinateAxisStrokeStyle:P,parallelCoordinateAxisRangeSelectorFillStyle:t.seriesBackgroundFillStyle,parallelCoordinateAxisRangeSelectorStrokeStyle:ft,parallelCoordinateAxisBackgroundFillStyle:new ht({angle:90,stops:[{offset:0,color:t.isDark?C(0,0,0,0):C(255,255,255,0)},{offset:1,color:t.isDark?C(0,0,0,255):C(255,255,255,180)}]}),uiButtonFillStyle:gt,uiButtonFillStyleHidden:mt,uiButtonStrokeStyle:ft,uiButtonSize:10,uiBackgroundFillStyle:dt,uiBackgroundStrokeStyle:ft,uiTextFillStyle:ct,uiTextFillStyleHidden:yt,uiTextFont:c,legendTitleFillStyle:ct,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:dt,cursorTickMarkerXBackgroundStrokeStyle:ft,cursorTickMarkerXTextFillStyle:ct,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:dt,cursorTickMarkerYBackgroundStrokeStyle:ft,cursorTickMarkerYTextFillStyle:ct,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:At.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:dt,cursorResultTableStrokeStyle:ft,cursorResultTableTextFillStyle:ct,cursorResultTableTextFont:c,cursorGridStrokeStyleX:At,cursorGridStrokeStyleY:At,cursor3DGridStrokeStyleX:xt,cursor3DGridStrokeStyleY:xt,cursor3DGridStrokeStyleZ:xt,cursor3DTickStrokeStyleX:Q.tickStyle,cursor3DTickStrokeStyleY:Q.tickStyle,cursor3DTickStrokeStyleZ:Q.tickStyle,cursor3DTickLabelFillStyleX:ct,cursor3DTickLabelFillStyleY:ct,cursor3DTickLabelFillStyleZ:ct,cursor3DTickLabelFontX:c,cursor3DTickLabelFontY:c,cursor3DTickLabelFontZ:c,cursor3DTickLabelBackgroundFillStyleX:bt,cursor3DTickLabelBackgroundFillStyleY:bt,cursor3DTickLabelBackgroundFillStyleZ:bt,cursor3DTickLabelBackgroundStrokeStyleX:ft,cursor3DTickLabelBackgroundStrokeStyleY:ft,cursor3DTickLabelBackgroundStrokeStyleZ:ft,cursor3DTickLabelPaddingX:{left:4,right:4,top:4,bottom:4},cursor3DTickLabelPaddingY:{left:4,right:4,top:4,bottom:4},cursor3DTickLabelPaddingZ:{left:4,right:4,top:4,bottom:4}};return t.overrideThemeProperties&&(Mt={...Mt,...t.overrideThemeProperties}),Mt})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},jf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.src=s,i},$f=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ge(e[s%e.length].stroke,C(255,255,255),.5);return new rt({stops:[{color:ge(r,C(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ge(r,C(30,30,30),.5*i).setA(100),offset:1}]})},Zf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ge(e[s%e.length].stroke,C(255,255,255),.2);return new rt({stops:[{color:ge(r,C(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ge(r,C(0,0,0),.2*i),offset:1}]})},qf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ge(e[s%e.length].stroke,C(255,255,255),.2);return new ht({angle:90,stops:[{color:ge(r,C(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ge(r,C(30,30,30),.5*i),offset:1}]})},Kf=(t,e,i)=>(()=>{const i=new Map;return s=>{const r=i.get(s);if(r)return r;const n=(i=>{const s=!0===t?e[i%e.length].stroke:ge(e[i%e.length].stroke,C(255,255,255),.3);return new ht({angle:90,stops:[{color:ge(s,C(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ge(s,C(30,30,30),.5),offset:1}]})})(s);return i.set(s,n),n}})(),Jf=Fe((()=>{const t=C(255,255,255),i=new N({color:t}),s=!0,r=new xo({spread:1,blur:9,offset:{x:0,y:0},color:C(0,0,0,150)}),n=new rt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:C(50,51,52)},{offset:.5,color:C(14,15,16)},{offset:1,color:C(0,0,0)}]}),o=new N({color:C(45,45,45)}),h=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(120,120,120,100)},{offset:1,color:C(0,0,0,50)}]}),a=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(30,30,30,200)},{offset:1,color:C(0,0,0,255)}]}),l=new N({color:C(255,255,220)}),u=new N({color:C(255,255,166)}),c=new N({color:C(255,255,220)}),d=new N({color:C(255,255,220,130)}),f=new N({color:C(255,255,200)}),g=f,m=g,y=new ht({angle:45,stops:[{offset:0,color:C(230,230,230)},{offset:1,color:C(150,150,150)}]}),p=new N({color:C(220,220,220)}),A=new N({color:C(200,200,200,50)}),x=new N({color:C(200,200,200,150)}),S=new N({color:C(200,200,200,20)}),v=new N({color:C(220,220,220)}),b=new ht({angle:0,stops:[{offset:0,color:C(10,10,10,220)},{offset:1,color:C(30,30,30,220)}]}),M=i,w=C(255,255,200),E=b,k=M,I=C(20,20,20),z=C(0,0,0),F=t,R=C(150,150,150),D=C(50,50,50),P=C(50,50,50),O=C(100,100,100),L=C(200,200,200),_=[C(255,255,91,255),C(255,205,91,255),C(255,155,91,255),C(255,196,188,255),C(255,148,184,255),C(219,148,198,255),C(235,196,224,255),C(169,148,198,255),C(148,226,198,255),C(148,255,176,255),C(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),B=t.setA(20),V=C(176,255,157,255),G=C(255,112,76,255),U={mapChartFillStyle:new ht({angle:135,stops:[{color:C(255,255,91,255),offset:0},{color:C(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:$f(s,_,.5),pieChartSliceFillStylePalette:Zf(s,_,1),funnelChartSliceFillStylePalette:qf(s,_,1),pyramidChartSliceFillStylePalette:qf(s,_,1),rectangleSeriesFillStyle:Kf(s,_),gaugeChartBarColor:C(255,255,91,255),gaugeChartGlowColor:C(255,255,91,64)},Y=new N({color:C(176,255,157,255)}),H=new N({color:C(255,146,146,255)}),X=new N({color:C(176,255,157,255)}),W=new N({color:C(230,63,63,255)}),j=new N({color:C(176,255,157,120)}),$=new N({color:C(229,63,63,180)}),Z=new N({color:C(27,37,36,255)}),q=new N({color:C(62,27,27,255)}),K=[C(255,0,0),C(255,255,0),C(0,255,0)],J=[C(10,10,255),C(10,190,255),C(251,255,0),C(255,38,0)],tt=[C(255,255,0),C(255,204,0),C(255,128,0),C(255,0,0)],et=[C(0,0,0),C(167,4,69,255),C(255,0,0),C(252,252,168,255)],it=new rt({stops:[{color:C(61,61,80,100),offset:0},{color:C(44,44,55,30),offset:1}]}),st=new N({color:C(148,148,198,255)}),nt=j.getColor().setA(255),ot=C(100,100,100),at=[C(255,241,149,200),C(255,230,65,200),C(238,211,32,200),C(238,176,32,200),C(255,159,13,200),C(254,120,37,200),C(253,91,56,200),C(253,75,84,200),C(254,95,124,200),C(227,56,160,200),C(226,53,134,200),C(216,90,166,200),C(254,151,206,200),C(237,151,254,200),C(243,177,255,200),C(233,133,252,200),C(210,101,230,200),C(178,61,200,200),C(193,81,156,200),C(217,95,145,200)];return Wf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:A,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:I,uiBackgroundBorderColor:z,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:R,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:O,dataStrokeColorContrastLow:L,dataColorPalette:_,dataColorPaletteInverted:[{area:C(190,50,50,100),border:C(210,80,80)}],dataHighlightOverlayColor:B,dataColorPositive:V,dataColorNegative:G,zoomBandChartDefocusOverlayFillStyle:new N({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(255,255,255,24),overrideThemeProperties:U,treeMapChartParentColor:T("#181E21"),treeMapChartNodeColors:at,treeMapChartLabelFillStyle:new N({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new N({color:C(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:H,positiveFillStyle:X,negativeFillStyle:W,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:Z,negativeBackgroundFillStyle:q,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),Qf=Fe((()=>{const t=C(255,255,255),i=new N({color:t}),s=!0,r=new xo({spread:0,blur:9,offset:{x:0,y:0},color:C(105,255,236,40)}),n=new N({color:C(2,21,30)}),o=new rt({stops:[{color:C(19,40,66,150),offset:0},{color:C(0,0,0,150),offset:1}]}),h=new N({color:C(0,5,8,150)}),a=i,l=i,u=i,c=new N({color:C(255,255,220,130)}),d=i,f=i,g=f,m=new N({color:C(20,224,250,255)}),y=i,p=new N({color:C(61,94,110,100)}),A=new N({color:C(61,94,110,255)}),x=new N({color:C(61,94,110,40)}),S=i,v=new N({color:C(0,18,23,255)}),b=i,M=t,w=new N({color:C(0,17,22,240)}),E=i,k=C(0,38,48,220),I=C(0,0,0),z=t,F=C(150,150,150),R=C(19,78,93),D=C(50,50,50),P=C(0,36,48),O=C(200,200,200),L=[C(45,253,253,255),C(44,172,247,255),C(46,100,248,255),C(96,84,199,255),C(184,104,245,255),C(98,160,218,255),C(43,238,245,255),C(38,140,206,255),C(112,96,224,255),C(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),_=t.setA(50),B=C(3,217,194,255),V=C(230,63,63,255),G={mapChartFillStyle:new ht({angle:135,stops:[{color:C(118,248,231,255),offset:0},{color:C(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:$f(s,L,1),pieChartSliceFillStylePalette:Zf(s,L,1),funnelChartSliceFillStylePalette:qf(s,L,1),pyramidChartSliceFillStylePalette:qf(s,L,1),rectangleSeriesFillStyle:Kf(s,L),gaugeChartBarColor:C(3,217,194,255),gaugeChartGlowColor:C(3,217,194,120)},U=new N({color:C(45,253,253,255)}),Y=new N({color:C(255,146,146,255)}),H=new N({color:C(45,253,253,255)}),X=new N({color:C(230,63,63,255)}),W=new N({color:C(1,190,164,120)}),j=new N({color:C(229,63,63,180)}),$=new N({color:C(1,53,57,255)}),Z=new N({color:C(62,27,27,255)}),q=[C(1,104,119,255),C(0,165,144,255),C(0,246,214,255)],K=[C(0,87,95,255),C(0,125,124,255),C(1,209,182,255),C(0,255,221,255),C(218,112,112,255),C(172,47,47,255)],J=[C(126,255,253,255),C(50,233,230,255),C(0,196,193,255),C(62,138,178,255),C(139,88,191,255),C(162,55,143,255)],tt=[C(13,31,52,255),C(101,50,118,255),C(1,142,172,255),C(2,196,170,255),C(0,255,221,255)],et=new rt({stops:[{color:C(122,103,254,70),offset:0},{color:C(178,168,255,10),offset:1}]}),it=new N({color:C(122,103,254,255)}),st=W.getColor().setA(255),nt=C(15,83,83),ot=[C(139,252,252,150),C(60,239,239,150),C(2,201,201,150),C(26,159,159,150),C(15,146,187,150),C(65,168,200,150),C(67,146,207,150),C(64,108,209,150),C(189,64,233,150),C(219,84,238,150),C(192,55,212,150),C(212,98,229,150),C(248,110,211,150),C(251,154,225,150),C(251,154,184,150),C(233,105,144,150),C(255,133,170,150),C(249,110,135,150),C(245,72,101,150),C(210,57,84,150)];return Wf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Q({source:jf(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:z,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:R,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:O,dataColorPalette:L,dataColorPaletteInverted:[{area:C(170,60,210,100),border:C(210,100,250)}],dataHighlightOverlayColor:_,dataColorPositive:B,dataColorNegative:V,zoomBandChartDefocusOverlayFillStyle:new N({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(255,255,255,24),overrideThemeProperties:G,treeMapChartParentColor:T("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new N({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new N({color:C(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:nt})})),tg=Fe((()=>{const t=!1,i=new xo({spread:0,blur:6,offset:{x:2,y:-2},color:C(0,0,0,30)}),s=new rt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:C(255,255,255)},{offset:1,color:C(255,255,255)}]}),r=new N({color:C(219,227,233,255)}),n=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(255,255,255,200)},{offset:1,color:C(240,244,246,200)}]}),o=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(255,255,255,255)},{offset:1,color:C(255,255,255,255)}]}),h=new N({color:C(33,43,49)}),a=new N({color:C(33,43,49)}),l=new N({color:C(33,43,49)}),u=new N({color:C(33,43,49,150)}),c=new N({color:C(33,43,49)}),d=c,f=d,g=new ht({angle:45,stops:[{offset:0,color:C(225,225,225)},{offset:1,color:C(225,225,225)}]}),m=new N({color:C(150,150,150,255)}),y=new N({color:C(150,150,150,170)}),p=new N({color:C(150,150,150,150)}),A=new N({color:C(150,150,150,100)}),x=new N({color:C(60,70,80)}),S=new ht({angle:0,stops:[{offset:0,color:C(255,255,255,240)},{offset:1,color:C(255,255,255,240)}]}),v=new N({color:C(168,186,199)}),b=C(255,255,200),M=new N({color:C(255,255,255,240)}),w=new N({color:C(128,146,159,255)}),E=C(255,255,255,255),k=C(168,168,199,255),I=C(168,186,199,255),z=C(168,186,199,255),F=C(168,186,199,255),R=C(168,186,199,255),D=C(100,100,100),P=C(200,200,200),O=[C(28,181,140,255),C(255,132,0,255),C(240,39,39,255),C(86,121,251,255),C(2,181,213,255),C(13,212,158,255),C(22,167,3,255),C(234,103,232,255),C(62,183,179,255),C(140,93,3,255),C(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),L=C(150,150,150,80),_=C(46,182,120,255),B=C(255,66,66,255),V=new us({thickness:2,fillStyle:new N({color:C(168,186,199,255)})}),G={mapChartFillStyle:new ht({angle:-45,stops:[{color:C(2,181,213,255),offset:0},{color:C(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:$f(t,O,.8),pieChartSliceFillStylePalette:Zf(t,O,.8),funnelChartSliceFillStylePalette:qf(t,O,.5),pyramidChartSliceFillStylePalette:qf(t,O,.5),rectangleSeriesFillStyle:Kf(t,O),gaugeChartBarColor:C(46,182,120,255),gaugeChartGlowColor:C(46,182,120,120),chartXYSeriesBackgroundStrokeStyle:V,chart3DSeriesBackgroundStrokeStyle:V,polarChartSeriesBackgroundStrokeStyle:V,spiderChartSeriesBackgroundStrokeStyle:V,dataGridTextFillStyle:new N({color:C(0,88,64,255)})},U=new N({color:C(4,146,108,255)}),Y=new N({color:C(240,39,39,255)}),H=new N({color:C(28,181,140,255)}),X=new N({color:C(230,88,88,255)}),W=new N({color:C(28,181,140,180)}),j=new N({color:C(230,88,88,180)}),$=new N({color:C(229,243,228)}),Z=new N({color:C(232,225,216)}),q=[C(193,48,48,255),C(240,234,60,255),C(45,191,55,255)],K=[C(10,19,255,255),C(15,191,250,255),C(249,255,2,255),C(253,133,0,255),C(255,24,0,255)],J=[C(50,99,213),C(8,179,77),C(255,246,0),C(255,126,0),C(189,36,30)],tt=[C(16,64,176),C(8,179,77),C(255,246,0),C(255,126,0),C(168,6,0)],et=new N({color:C(185,198,207,255)}),it=new rt({stops:[{color:C(151,190,220,10),offset:0},{color:C(151,190,220,50),offset:1}]}),st=W.getColor().setA(255),nt=C(150,150,150),ot=[C(255,243,136,125),C(254,237,99,125),C(255,216,109,125),C(255,172,100,125),C(255,133,101,125),C(255,113,142,125),C(230,103,129,125),C(242,126,219,125),C(255,155,235,125),C(255,181,240,125),C(203,143,255,125),C(208,154,255,125),C(171,188,255,125),C(197,209,255,125),C(171,187,255,125),C(84,167,239,125),C(38,196,214,125),C(38,214,196,125),C(69,225,141,125),C(36,191,88,125)];return Wf({isDark:t,highlightColorOffset:C(-60,-60,-60,60),highlightColorOffsetAxisOverlay:C(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:p,axisGridMinorFillStyle:A,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:z,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:R,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:P,dataColorPalette:O,dataColorPaletteInverted:[{area:C(190,50,50,100),border:C(210,80,80)}],dataHighlightOverlayColor:L,dataColorPositive:_,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new N({color:C(255,255,255,180)}),zoomBandChartSplitterColor:T("#505D65"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(0,0,0,24),overrideThemeProperties:G,treeMapChartParentColor:T("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new N({color:C(0,0,0)}),treeMapChartLabelHeaderFillStyle:new N({color:C(33,33,33)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:C(0,0,0),highlightDataGridColor:st,unfocusedDataColor:nt})})),eg=Fe((()=>{const t=!1,i=new rt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:C(255,255,255)},{offset:1,color:C(255,255,255)}]}),s=new N({color:C(214,236,216,255)}),r=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(233,244,231,70)},{offset:1,color:C(233,244,231,200)}]}),n=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(255,255,255,255)},{offset:1,color:C(255,255,255,255)}]}),o=new N({color:C(1,61,53)}),h=new N({color:C(1,61,53)}),a=new N({color:C(1,61,53)}),l=new N({color:C(1,61,53,150)}),u=new N({color:C(1,61,53)}),c=u,d=c,f=new ht({angle:45,stops:[{offset:0,color:C(225,225,225)},{offset:1,color:C(225,225,225)}]}),g=new N({color:C(188,211,186,255)}),m=new N({color:C(188,211,186,150)}),y=new N({color:C(188,211,186,50)}),p=new N({color:C(188,211,186,50)}),A=new N({color:C(104,148,111,255)}),x=new ht({angle:0,stops:[{offset:0,color:C(255,255,255,240)},{offset:1,color:C(255,255,255,240)}]}),S=new N({color:C(104,148,111)}),v=C(255,255,200),b=new N({color:C(255,255,255,240)}),M=new N({color:C(104,148,111,255)}),w=C(255,255,255,255),E=C(179,201,183,255),k=C(188,211,186,255),I=C(188,211,186,255),z=C(188,211,186,255),F=C(188,211,186,255),R=C(100,100,100),D=C(200,200,200),P=[C(138,195,142,255),C(193,161,114,255),C(178,99,99,255),C(142,156,210,255),C(154,209,219,255),C(164,212,199,255),C(104,156,97,255),C(196,147,195,255),C(92,190,187,255),C(126,100,51,255),C(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),O=C(150,150,150,80),L=C(46,182,84,255),_=C(232,96,96,255),B=new us({thickness:2,fillStyle:new N({color:C(188,211,186,255)})}),V={mapChartFillStyle:new ht({angle:-45,stops:[{color:C(118,160,121,255),offset:0},{color:C(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:$f(t,P,.8),pieChartSliceFillStylePalette:Zf(t,P,.8),pyramidChartSliceFillStylePalette:qf(t,P,.5),funnelChartSliceFillStylePalette:qf(t,P,.5),rectangleSeriesFillStyle:Kf(t,P),gaugeChartBarColor:C(46,182,84,255),gaugeChartGlowColor:C(46,182,84,120),chartXYSeriesBackgroundStrokeStyle:B,chart3DSeriesBackgroundStrokeStyle:B,polarChartSeriesBackgroundStrokeStyle:B,spiderChartSeriesBackgroundStrokeStyle:B,dataGridTextFillStyle:new N({color:C(77,66,21,255)})},G=new N({color:C(93,151,97,255)}),U=new N({color:C(178,99,99,255)}),Y=new N({color:C(138,195,142,255)}),H=new N({color:C(178,99,99,255)}),X=new N({color:C(138,195,142,180)}),W=new N({color:C(178,99,99,180)}),j=new N({color:C(224,240,237)}),$=new N({color:C(251,227,227)}),Z=[C(178,99,99,255),C(215,224,111,255),C(80,186,88,255)],q=[C(62,64,142,255),C(66,131,77,255),C(250,250,135,255),C(202,161,78,255),C(179,53,53,255)],K=[C(64,86,138),C(123,192,205),C(255,252,149),C(220,155,92),C(184,78,74)],J=[C(64,86,138),C(123,192,205),C(255,252,149),C(220,155,92),C(132,60,57)],tt=new N({color:C(185,198,207,255)}),et=new rt({stops:[{color:C(151,190,220,10),offset:0},{color:C(151,190,220,50),offset:1}]}),it=X.getColor().setA(255),st=C(150,150,150),nt=[C(242,239,210,150),C(243,238,183,150),C(210,222,136,150),C(204,217,148,150),C(157,190,124,150),C(143,178,72,150),C(198,147,88,150),C(216,148,71,150),C(229,142,103,150),C(225,174,152,150),C(219,149,203,150),C(216,188,209,150),C(109,198,189,150),C(172,206,202,150),C(164,223,217,150),C(174,215,233,150),C(203,225,235,150),C(220,227,243,150),C(207,213,227,150),C(171,182,209,150)];return Wf({isDark:t,highlightColorOffset:C(-60,-60,-60,60),highlightColorOffsetAxisOverlay:C(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:y,axisGridMinorFillStyle:p,cursorGridFillStyle:A,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:w,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:z,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:R,dataStrokeColorContrastLow:D,dataColorPalette:P,dataColorPaletteInverted:[{area:C(210,70,70,100),border:C(200,110,110)}],dataHighlightOverlayColor:O,dataColorPositive:L,dataColorNegative:_,zoomBandChartDefocusOverlayFillStyle:new N({color:C(255,255,255,180)}),zoomBandChartSplitterColor:T("#446A40"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(0,0,0,24),overrideThemeProperties:V,treeMapChartParentColor:T("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new N({color:C(0,0,0)}),treeMapChartLabelHeaderFillStyle:new N({color:C(33,33,33)})},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:q,intensityColorPalette:K,spectrogramColorPalette:J,bollingerFillStyle:et,bollingerBorderFillStyle:tt,highlightPointColor:C(0,0,0),highlightDataGridColor:it,unfocusedDataColor:st})})),ig=Fe((()=>{const t=C(255,255,255),i=new N({color:t}),s=!0,r=new xo({spread:1,blur:9,offset:{x:0,y:0},color:C(255,255,255,30)}),n=new N({color:C(6,15,36)}),o=new rt({stops:[{color:C(46,13,87,50),offset:0},{color:C(0,0,0,150),offset:1}]}),h=new N({color:C(0,5,8,150)}),a=i,l=i,u=i,c=new N({color:C(255,255,220,130)}),d=i,f=i,g=f,m=new ht({angle:45,stops:[{offset:0,color:C(241,133,255,255)},{offset:1,color:C(115,207,238,255)}]}),y=i,p=new N({color:C(61,94,110,100)}),A=new N({color:C(61,94,110,255)}),x=new N({color:C(61,94,110,40)}),S=i,v=new N({color:C(0,18,23,255)}),b=i,M=C(115,207,238,255),w=new N({color:C(0,17,22,240)}),E=i,k=C(0,38,48,255),I=C(0,0,0),z=t,F=C(150,150,150),R=C(19,57,93),D=C(50,50,50),P=C(0,17,48),O=C(200,200,200),L=[C(20,211,237,255),C(98,147,252,255),C(164,73,250,255),C(129,117,253,255),C(95,134,252,255),C(22,133,212,255),C(35,200,242,255),C(104,121,233,255),C(137,69,232,255),C(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),_=t.setA(50),B=C(3,217,194,255),V=C(243,21,110,255),G={mapChartFillStyle:new ht({angle:135,stops:[{color:C(118,248,231,255),offset:0},{color:C(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:$f(s,L,.5),pieChartSliceFillStylePalette:Zf(s,L,2),funnelChartSliceFillStylePalette:qf(s,L,1),pyramidChartSliceFillStylePalette:qf(s,L,1),rectangleSeriesFillStyle:Kf(s,L),gaugeChartBarColor:C(3,217,194,255),gaugeChartGlowColor:C(3,217,194,150)},U=new N({color:C(20,211,237,255)}),Y=new N({color:C(253,145,178,255)}),H=new N({color:C(20,211,237,255)}),X=new N({color:C(239,68,121,255)}),W=new N({color:C(20,211,237,120)}),j=new N({color:C(239,68,121,180)}),$=new N({color:C(1,53,57,255)}),Z=new N({color:C(94,19,42,255)}),q=[C(174,51,132,255),C(204,107,218,255),C(189,215,253,255)],K=[C(0,63,95,255),C(0,149,255,255),C(0,225,255,255),C(255,154,254,255),C(204,98,170,255),C(139,39,84,255)],J=[C(197,241,255,255),C(70,210,255,255),C(0,164,217,255),C(90,99,222,255),C(138,75,192,255),C(151,27,162,255)],tt=[C(13,31,52,255),C(129,54,130,255),C(131,108,176,255),C(7,162,213,255),C(26,247,255,255)],et=new rt({stops:[{color:C(219,42,235,60),offset:0},{color:C(237,73,252,10),offset:1}]}),it=new N({color:C(237,73,252,255)}),st=W.getColor().setA(255),nt=C(8,70,100),ot=[C(149,230,255,150),C(93,213,243,150),C(20,189,223,150),C(5,151,181,150),C(2,138,198,150),C(2,113,198,150),C(97,148,236,150),C(93,111,230,150),C(151,120,223,150),C(128,87,227,150),C(153,52,230,150),C(179,92,245,150),C(248,110,211,150),C(255,155,228,150),C(251,88,207,150),C(255,0,162,150),C(214,73,177,150),C(209,71,159,150),C(238,101,169,150),C(210,57,134,150)];return Wf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Q({source:jf(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:z,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:R,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:O,dataColorPalette:L,dataColorPaletteInverted:[{area:C(41,130,255,100),border:C(45,110,240)}],dataHighlightOverlayColor:_,dataColorPositive:B,dataColorNegative:V,zoomBandChartDefocusOverlayFillStyle:new N({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#DB77FF"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(255,255,255,24),overrideThemeProperties:G,treeMapChartParentColor:T("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new N({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new N({color:C(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:nt})})),sg={};Object.defineProperty(sg,"darkGold",{get:Jf,enumerable:!0}),Object.defineProperty(sg,"turquoiseHexagon",{get:Qf,enumerable:!0}),Object.defineProperty(sg,"light",{get:tg,enumerable:!0}),Object.defineProperty(sg,"lightNature",{get:eg,enumerable:!0}),Object.defineProperty(sg,"cyberSpace",{get:ig,enumerable:!0});const rg=sg,ng=rg.darkGold;class og extends el{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.JL=u}setLabelAlignment(t){return this.JL=t,this.Ms(),this}getLabelAlignment(){return this.JL}}class hg extends gr{constructor(t,i,s,r,n,o,h){let a;super(t,{Dr:()=>t.KL?t.KL[this.key].max:void 0,Pr:()=>t.KL?t.KL[this.key].min:void 0,Lr:()=>{}},o,i,s,{numeric:i.parallelCoordinateAxisNumericTicks||i.yAxisNumericTicks,datetime:i.parallelCoordinateAxisDateTimeTicks||i.yAxisDateTimeTicks,time:i.parallelCoordinateAxisTimeTicks||i.yAxisTimeTicks},{type:"linear"}),this.qL=[],this.Uf=[],this.tR=!0,this.iR=8,this.ji=!1,this.sR=(t,i)=>{this.eR=this.chart.engine.setMouseStyle(e.MouseStyles.Vertical,this.eR)},this.hR=(t,e)=>{this.chart.engine.restoreMouseStyle(this.eR)},this.rR=(t,e)=>{const i=this.qL.find((e=>e.shape===t));if(!i)return;if(!i.mouseInteractions)return;const s=this.chart.cs.Uo(e),r=yt({x:s.engineX,y:s.engineY},this.chart.cs.At,this.chart.nR),n=this.chart.nR.y.pi(t.xt(),10),o=this.chart.nR.y.pi(t.bt(),-10);r.y<=n?this.oR={selector:i,type:"scaleMin"}:r.y>=o?this.oR={selector:i,type:"scaleMax"}:this.oR={selector:i,type:"move"},se(e)},this.aR=(t,e,i)=>{if(void 0===this.lR)return;if(!this.oR)return;const{selector:s,type:r}=this.oR;if(!s.mouseInteractions)return;const n=.05*Math.abs(this.$h-this.Xh);if("move"===r){const t=s.max-s.min,e=this.chart.uR(s.max,this.lR,this).y,r=this.chart.nR.y.pi(e,i.y),n=this.chart.cR(r,this.lR,this);s.max=_t(n,Math.max(this.Xh,this.$h),Math.min(this.Xh,this.$h)+t),s.min=s.max-t}else if("scaleMax"===r){const t=this.chart.uR(s.max,this.lR,this).y,e=this.chart.nR.y.pi(t,i.y),r=this.chart.cR(e,this.lR,this);s.max=_t(r,s.min+n,Math.max(this.Xh,this.$h))}else if("scaleMin"===r){const t=this.chart.uR(s.min,this.lR,this).y,e=this.chart.nR.y.pi(t,i.y),r=this.chart.cR(e,this.lR,this);s.min=_t(r,s.max-n,Math.min(this.Xh,this.$h))}this.chart.dR(),se(e)},this.fR=(t,e)=>{const i=this.qL.find((e=>e.shape===t));if(!i)return;if(!i.mouseInteractions)return;const s=this.qL.indexOf(i);s>=0&&this.qL.splice(s,1),i.shape.dispose(),this.chart.dR(),se(e)},this.AR=t=>{this.tR&&(this.addRangeSelector(),se(t))},this.chart=t,this.key=r,this.userID=n,this.hs=this.chart.cs.hs.rs(this,{}),this.Rs=h,this.gR=h.Ee(t.nR).Re(this.ts.parallelCoordinateAxisBackgroundFillStyle||_).Le(ut).setMouseInteractions(!1),this.Fh=h.Wr(t.nR).ir(this.ts.parallelCoordinateAxisTitleFont||this.ts.yAxisTitleFont).Re(this.ts.parallelCoordinateAxisTitleFillStyle||this.ts.yAxisTitleFillStyle).setMouseInteractions(!1).Gr(Le).Ur(Le),this.hr=this.hs.Bg([this.Fh]).bs(i.effectsText),this.XD=h.He(t.nR).Ye(i.parallelCoordinateAxisStrokeStyle||i.yAxisStrokeStyle),this.setAnimationsEnabled(!1),this.onIntervalChange(((e,i,s)=>{t.pR(this,i,s)})),this.XD.setMouseEnterEventHandler((()=>{this.tR&&(a=this.chart.engine.setMouseStyle(e.MouseStyles.Point))})),this.XD.setMouseLeaveEventHandler((()=>{this.chart.engine.restoreMouseStyle(a)})),this.XD.setMouseDoubleClickEventHandler(((t,e)=>this.AR(e)));const l=ns(new os(((t,e)=>{this.AR(e)})));this.XD.setTouchStartEventHandler(l.onTouchStart),this.XD.setTouchMoveEventHandler(l.onTouchMove),this.XD.setTouchEndEventHandler(l.onTouchEnd),this.setTitle(r)}setBackgroundFillStyle(t){return this.gR.Re(t),this.Rs.Ms(),this}getBackgroundFillStyle(){return this.gR.Jh()}setStrokeStyle(t){const e="function"==typeof t?t(this.XD.xu()):t,i=e.getFillStyle();return j(i)?(this.yR=i.lut,this.chart.mR=!0):this.yR=void 0,this.XD.Ye(e),this.chart.cs.Ms(),this}getStrokeStyle(){return this.XD.xu()}setMouseInteractionRangeSelectors(t){return this.tR=t,this}getMouseInteractionRangeSelectors(){return this.tR}setTickStrategy(t,e){return super.Hh(t,e)}getTickStrategy(){return this.lh}addRangeSelector(){const t=this.Ar(),e=this.Rs.Ee(this.chart.nR).Re(this.ts.parallelCoordinateAxisRangeSelectorFillStyle||this.ts.dataGridScrollBarFillStyle).Le(this.ts.parallelCoordinateAxisRangeSelectorStrokeStyle||this.ts.dataGridScrollBarStrokeStyle).setMouseEnterEventHandler(this.sR).setMouseLeaveEventHandler(this.hR).setMouseDragStartEventHandler(((t,e)=>this.rR(t,e))).setMouseDragEventHandler(((t,e,i,s,r)=>this.aR(t,e,r))).setMouseDoubleClickEventHandler(this.fR).setMouseInteractions(!0),i=ns(new hs(((t,e,i)=>this.rR(t,i)),((t,e,i,s,r)=>this.aR(t,r,s)),((t,e,i,s)=>{}),1));e.setTouchStartEventHandler(i.onTouchStart),e.setTouchMoveEventHandler(i.onTouchMove),e.setTouchEndEventHandler(i.onTouchEnd);const s={min:t.min+.25*(t.max-t.min),max:t.max-.25*(t.max-t.min),shape:e,mouseInteractions:!0};this.qL.push(s),this.chart.dR();const r={setInterval:(t,e)=>(s.min=Math.min(t,e),s.max=Math.max(t,e),this.chart.dR(),r),setMouseInteractions:t=>(s.mouseInteractions=t,r),dispose:()=>{const t=this.qL.indexOf(s);return t>=0&&(this.qL.splice(t,1),this.chart.dR()),r}};return r}addCustomTick(){const t=new og((()=>this.chart.cs.Ms()),(()=>{const e=this.Uf.indexOf(t);e>=0&&this.Uf.splice(e,1)}),(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.tickStyle,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.tickLength,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.gridStrokeStyle,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.tickPadding,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelRotation,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelFillStyle,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelFont,(t=>this.formatValue(t)),(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelAlignment);return this.Uf.push(t),this.chart.cs.Ms(),t}Os(){if(!this.Zi)return{Wg:0,vR:0,SR:0,Qd:0};const t=!(this.uh.size>0),e=this.Fh&&this.Fh.Tr().length>0&&this.getTitleFillStyle()!==_?this.chart.cs.Xg.Hg(this.Fh.Tr(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0},i=ur(this.ah)?new Map:yr(this.ah,Math.min(this.Xh,this.$h),Math.max(this.Xh,this.$h),this.Xh,this.$h,0),s=this.At;let r=0;i.forEach(((e,i)=>{if(Qs(i)){const n=Math.max(...e.map((e=>{if(!ti(e,this.Xh,this.$h))return 0;const r=this.chart.cs.Xg.Hg(i.Ze(e,s),i.je.labelFont,i.je.labelRotation);return t||!r.isEstimate?r.x:0})))+i.je.tickLength+i.je.tickPadding;r=Math.max(r,n)}}));const n=this.Uf.reduce(((t,e)=>Math.max(t,e.Zi?this.chart.cs.Xg.Hg(e.lc(e.M),e.Mm,e.Yd).x+e.Sm+e.bm:0)),0);r=Math.max(r,n);const o=e.y+this.iR;r=Math.max(r,e.x/2);const h=r;return{Wg:r,vR:o,SR:e.x,Qd:h}}ze(t,e,i,s){this.lR=s;const r=Math.min(this.Xh,this.$h),n=Math.max(this.Xh,this.$h),o=this.chart.nR.y.ri(),h=this.XD.xu(),a=cs(h)?h.getThickness()/2:0,l=this.dr({physicalAxisSize:o,parallelAxisIndex:s,halfAxisThickness:a});for(const[t,e]of this.uh)for(const[,s]of e){const e=l.get(s);e&&i.add({positions:[e.positionTicklineStart,e.positionTicklineEnd]},{lineStyle:t.je.tickStyle})}this.Uf.forEach((t=>{if(!t.Zi||t.Mn)return;const o=this.ev(s,a,t.M,t.Sm,t.bm,t.JL);i.add({positions:[o.positionTicklineStart,o.positionTicklineEnd]},{lineStyle:t.vm}),e.add().Ve(o.positionLabel).Za(o.alignmentLabel).Re(t.ly).ir(t.Mm).Sr(t.lc(t.M)).sr(t.Yd).setMouseInteractions(t.Yo)})),this.XD.$e({x:s,y:0}).Xe({x:s,y:1}),this.Fh.Ve({x:s,y:this.chart.nR.y.pi(0,-(a+this.iR))}).sr(this.getTitleRotation()).Za({x:0,y:1});const u=0===s?s:this.chart.nR.x.pi(s,-1.2*t.Wg);this.gR.Ve({x:u,y:0}).it({x:s-u,y:1});const c=this.chart.nR.Ui();this.qL.forEach((t=>{const e=this.chart.uR(t.min,s,this),i=this.chart.uR(t.max,s,this),r={x:s-10*c.x*.5,y:e.y},n=s+10*c.x*.5,o=i.y;t.shape.Ve(r).it({x:n-r.x,y:o-r.y})}))}Y(){this.gR.dispose(),this.Fh.dispose(),this.XD.dispose(),this.qL.forEach((t=>t.shape.dispose())),this.qL.length=0,this.rr(),this.mr(),this.ji=!0,this.R.emit("dispose")}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setMouseInteractions(t){return this.setMouseInteractionRangeSelectors(t),this}Mr(t,e){return new mr(e,t,this.Rs,this.chart.nR)}_r(t,e){const i=t.Eh.je,s=this.getInterval(),r=this.ev(e.parallelAxisIndex,e.halfAxisThickness,t.M,i.getTickLength(),i.getTickPadding(),2*(t.M-s.start)/(s.end-s.start)-1);return t.rh.Ve(r.positionLabel).Za(r.alignmentLabel).sr(i.getLabelRotation()),r}ev(t,e,i,s,r,n){const o=this.chart.nR.pi({x:t,y:(i-this.Xh)/(this.$h-this.Xh)},{x:0-e,y:0}),h=this.chart.nR.pi(o,{x:-s,y:0});return{positionTicklineStart:o,positionTicklineEnd:h,positionLabel:this.chart.nR.pi(h,{x:-r,y:0}),alignmentLabel:{x:1,y:n}}}Er(t,e){return Qi(t,e,this.At)}Vr(t,e,i){return{min:t,max:e}}}class ag extends su{constructor(t,e,i,s,r){super(t,e,i,s),this.Cs="Parallel Coordinate Series",this.xR=!1,this.ae=t;const n=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.ae.getSeries().length;this.bR=ve(this.ts.parallelCoordinateChartSeriesColor,n)||(()=>{const t=ve(this.ts.lineSeriesStrokeStyle,n).getFillStyle();return(U(t)?t.getColor():void 0)||C(255,255,0)})(),this.onVisibleStateChanged((()=>{this.ae.MR()})),this.onDispose((()=>{this.ae.MR()})),this.setHighlightOnHover(!1)}setData(t){const e=void 0!==this._R;return this._R=this.ae.wR(t),e&&this.ae.CR(),this}getData(){return this._R}setColor(t){const e="function"==typeof t?t(this.bR):t;return e===this.bR||(this.bR=e,this.ae.cs.Ms(),this.ae.kR(this)),this}getColor(){return this.bR}Av(){return this.getAutoScrollingEnabled()}Cv(){}ze(){}Pm(){}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:new N({color:this.bR})})}Yp(){return super.Yp()&&!this.xR}}class lg extends Sl{constructor(t,e,i,s,r,n,o){var h,a;super(t,e,i,e.Bp("parallelAxisChart bg",0),s,e.cs.ts.parallelCoordinateChartBackgroundFillStyle||e.cs.ts.chartXYBackgroundFillStyle,e.cs.ts.parallelCoordinateChartBackgroundStrokeStyle||e.cs.ts.chartXYBackgroundStrokeStyle,e.cs.ts.parallelCoordinateChartTitleFont||e.cs.ts.chartXYTitleFont,e.cs.ts.parallelCoordinateChartTitleFillStyle||e.cs.ts.chartXYTitleFillStyle,n),this.axes=[],this.TR=!0,this.FR=Oe(),this.IR=new Map,this.PR=this.ts.parallelCoordinateChartSeriesColorUnselected||C(255,255,255,30),this.DR=p({resolution:32}),this.BR=!0,this.mR=!1,this.LR=!1,this.RR=!0,this.ER=!1,this.zR=!1,this.VR=!1,this.OR=!1,this.kn=(t,e,i,s,r)=>{this.nR.it(s,r)},this.Ch.Sr("Parallel Coordinate Chart"),this.cs.Jn(Sh.Ef),this.nR=this.mp.d2({scaleXYConstructor:Yi}).Oi(0,1),this.Dp(r,this.nR),this.Xv=this.gp.Ee(this.nR).Ve({x:0,y:0}).it({x:0,y:1}).Re(this.ts.parallelCoordinateChartSeriesBackgroundFillStyle||this.ts.chartXYSeriesBackgroundFillStyle).Le(ut).setMouseInteractions(!0),this.$v=this.gp.Ee(this.nR).Ve({x:0,y:0}).it({x:0,y:1}).Re(_).Le(this.ts.parallelCoordinateChartSeriesBackgroundStrokeStyle||this.ts.chartXYBackgroundStrokeStyle).setMouseInteractions(!1),super.Hv(this.Xv,this.$v),this.setSeriesBackgroundEffect(!1),this.NR=new us({thickness:null!==(h=this.ts.parallelCoordinateChartSeriesLineThickness)&&void 0!==h?h:2,fillStyle:new Y}),this.GR=new us({thickness:null!==(a=this.ts.parallelCoordinateChartSeriesLineThickness)&&void 0!==a?a:2,fillStyle:new N({color:this.ts.parallelCoordinateChartSeriesColorUnselected})}),this.UR=this.FR.Mt(this.gp.Qg(this.nR)).Ye(this.NR),this.UR.ku=5e4,this.WR=this.gp.Qg(this.nR).Ye(this.ts.parallelCoordinateChartPointedSeriesLineStyle||ve(this.ts.lineSeriesStrokeStyle,0)).setMouseInteractions(!1),this.YR=new rl((()=>this.gp.Wr(this.nR))),this.HR=new sl((()=>this.gp.Qg(this.nR).setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Ye(i.lineStyle),e.map((({positions:e})=>t.Zr().Kg(e[0],e[1]))))));const l=e.sm(),u=Vt(o?o.cursorBuilder:void 0,La);this.hm=pa(this,l,u._y(l,this.uiScale,this.uiScale,Ot,this.ts),this,"show-nearest",ug,(()=>0)),this.onResize(this.kn)}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=La){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}onSelectedSeriesChanged(t){return this.R.on("selectedSeriesChanged",t)}offSelectedSeriesChanged(t){return this.R.off(t)}setMouseInteractionRangeSelectors(t){return this.BR=t,this.forEachAxis((t=>t.setMouseInteractionRangeSelectors(this.BR))),this}getMouseInteractionRangeSelectors(){return this.BR}setMouseInteractions(t){return this.setMouseInteractionRangeSelectors(t),this}setUnselectedSeriesColor(t){return this.PR="function"==typeof t?t(this.PR):t,this.GR=new us({thickness:this.getSeriesStrokeThickness(),fillStyle:new N({color:this.PR})}),this.cs.Ms(),this}getUnselectedSeriesColor(){return this.PR}setPointedSeriesStrokeStyle(t){return this.WR.Ye(t),this.cs.Ms(),this}getPointedSeriesStrokeStyle(){return this.WR.xu()}setSpline(t,e){return t?this.DR._({resolution:void 0!==(null==e?void 0:e.resolution)?e.resolution:32}):this.DR._(void 0),this.cs.Ms(),this}setAxes(t){const e=Array.isArray(t)?t.map(((t,e)=>({key:t,id:e}))):"object"==typeof t?Object.entries(t).map(((t,e)=>({key:t[0],id:t[1]}))):void 0;if(!e)return this;const i=e.filter((t=>void 0===this.axes.find((e=>e.key===t.key)))),s=this.axes.filter((t=>void 0===e.find((e=>t.key===e.key))));return i.forEach((t=>{const e=this.XR(),i=new hg(this,this.ts,!this.ph,t.key,t.id,e,this.gp);i.setMouseInteractionRangeSelectors(this.BR);const s=i.onVisibleStateChanged((t=>{this.RR=!0}));i.onDispose((()=>{i.offVisibleStateChanged(s)})),this.axes.push(i)})),s.forEach((t=>{t.Y();const e=this.axes.indexOf(t);e>=0&&this.axes.splice(e,1)})),this.axes=e.map((t=>this.axes.find((e=>e.key===t.key)))),this.RR=!0,this.KL=void 0,this.cs.Ms(),this}getAxis(t){const e=this.$R(t);if(!e)throw new Error(`ParallelAxisChart.getAxis | no such axis: "${t}". Found: ${this.axes.map((t=>void 0!==t.userID?`${t.key}, ${t.userID}`:t.key)).join(", ")}`);return e}hasAxis(t){return void 0!==this.$R(t)}addSeries(t){const e=new ag(this,this.Wv,this.ts,this.cs.hs,t);return super.jv(e),this.zR=!0,this.KL=void 0,this.cs.Ms(),e}setSeriesStrokeThickness(t){return this.NR=this.NR.setThickness(t),this.GR=this.GR.setThickness(t),this.UR.Ye(this.NR),this.cs.Ms(),this}getSeriesStrokeThickness(){return this.NR.getThickness()}setLUT(t){return this.Kd=t,this.Kd&&0===this.Kd.lut.units.length&&(this.Kd.lut=this.Kd.lut.setUnits(this.Kd.axis.getTitle())),this.OR=!0,this.cs.Ms(),this}ze(t){super.ze(t);const e=this.axes.filter((t=>t.getVisible()));this.nR.Vi(0,e.length-1),this.Xv.it({x:e.length-1,y:1}),this.$v.it({x:e.length-1,y:1});const i=void 0===this.KL;if(!this.KL){const t={};e.forEach((e=>{t[e.key]={min:Ye,max:He}})),this.Gv.forEach((e=>{e._R&&Object.entries(e._R).forEach((([e,i])=>{const s=t[e];s&&!Number.isNaN(i)&&(s.min=Math.min(s.min,i),s.max=Math.max(s.max,i))}))})),this.KL=t}if(this.VR||this.ER||this.zR){const t=e.map(((t,e)=>t.qL));this.Gv.forEach((i=>{const s=i._R;if(!s)return;let r=!1;for(let i=0;iti(s[n.key],t.min,t.max)));if(o.length>0&&!h){r=!0;break}}i.xR=r}));const i=this.Gv.filter((t=>!t.xR));this.R.emit("selectedSeriesChanged",this,i)}for(const t of this.Gv)t.Cv();for(const t of this.Gv)t.ze();super.Pp();const s=!this.Xv.getIsUnderMouse()&&void 0===this.Gv.find((t=>t.getIsUnderMouse()))||this.cs.jR()?void 0:this.ZR();if(this.hm.ze(!1,this.Gv,void 0,{explicitTarget:s,afterCursorPointedAt:t=>{const e=this.cs.Zn();if(t.length>1&&e){const t=this.cs.Uo(e);this.hm.Hp.xy({x:t.engineX,y:t.engineY},this.cs.At)}}}),ga.Gp(this.Ch,this.Lp),e.length>=2){const t=this.YR.Dm(),s=this.HR.Dm(),r=e.map((t=>(t.Rr(),t.Os())));r.forEach(((i,r)=>e[r].ze(i,t,s,r))),t.finishPlot(),s.finishPlot();const n=ga.Np(this.Ch,this.Lp);this.nR.Ei([this.$t.left+this.Ia.left+r[0].Qd,this.$t.right+this.Ia.right+r[r.length-1].SR/2]),this.nR.zi([this.$t.bottom+this.Ia.bottom+r.reduce(((t,e)=>Math.max(t,e.vR)),0),this.$t.top+this.Ia.top+n]),t.finishPlot(),s.finishPlot(),(i||this.mR)&&e.forEach(((t,e)=>{if(!t.yR)return;const i=t.yR.steps.map((i=>({...i,value:this.uR(i.value,e,t).y}))),s=t.yR.setSteps(i);t.XD.Ye((t=>t.setFillStyle(new W({lookUpProperty:"y",lut:s}))))}));const o=this.RR||this.ER||this.TR||this.DR.u;o&&(this.UR.Ot(),this.FR.Ot(),this.IR.clear(),this.Gv.forEach((t=>{const i=t._R;if(!t.getVisible()||!i)return;const s=this.QR(t,i,e,this.UR,this.FR);this.IR.set(t,s),t.ys(s)}))),(o||this.VR||this.OR||this.ER)&&this.JR(this.Gv),!o&&this.zR&&this.Gv.forEach((t=>{if(t.Qi.length>0)return;const i=t._R;if(!t.getVisible()||!i)return;const s=this.QR(t,i,e,this.UR,this.FR);this.IR.set(t,s),t.ys(s),this.JR([t])})),this.Gv.find((t=>t._R&&Object.keys(t._R).length>0))&&(this.LR=!0)}const r=1===(null==s?void 0:s.length)?s[0]:void 0;(r!==this.KR||this.ER)&&(this.WR.Ot(),r&&r.series._R?(this.QR(r.series,r.series._R,e,this.WR,void 0),this.UR.Ye(this.GR)):this.UR.Ye(this.NR));for(const t of this.Gv)t.Pm();this.TR=!1,this.VR=!1,this.RR=!1,this.ER=!1,this.zR=!1,this.OR=!1,this.DR.u=!1,this.mR=!1,this.KR=r}JR(t){const e=this.Kd&&{lut:this.Kd.lut,key:this.Kd.axis.key};t.forEach((t=>{const i=t._R,s=this.IR.get(t);if(!i||!s)return;let r;if(t.xR)r=this.PR;else if(e){const t=i[e.key];r=e.lut.getColors(t)}else r=t.bR;s.forEach((t=>t.iL(r)))}))}MR(){this.ER=!0,this.cs.Ms()}CR(){this.LR&&this.cs.Jn(Sh.Df),this.ER=!0,this.cs.Ms()}$R(t){return this.axes.find((e=>e.key===t))||this.axes.find((e=>e.userID===t))}XR(){return gt.d1({scale1DConstructor:Gi,dimension:"x"}).q(0,1)}wR(t){if(this.KL=void 0,this.cs.Ms(),Array.isArray(t)){const e={};return t.forEach(((t,i)=>{var s;if("number"==typeof t){const r=null===(s=this.axes[i])||void 0===s?void 0:s.key;if(!r)throw new Error("ParallelCoordinateSeries Axis count doesnt match supplied data");e[r]=t}else"object"==typeof t&&(e[t.key]=t.value)})),e}if("object"==typeof t)return t;throw new Error("ParallelCoordinateSeries unidentified data format")}pR(t,e,i){this.TR=!0,this.cs.Ms()}uR(t,e,i){return{x:e,y:(t-i.At.$)/(i.At.j-i.At.$)}}cR(t,e,i){const s=i.getInterval();return s.start+t*(s.end-s.start)}kR(t){this.OR=!0,this.cs.Ms()}dR(){this.VR=!0,this.cs.Ms()}getSeries(){return this.Gv}af(){const t=[],e=this.Kd;return e&&t.push({qd:()=>({lut:e.lut,lookUpProperty:void 0}),attach:(t,i)=>{t.setText("Value based color").setOn(!0),t.onSwitch(((t,i)=>{this.setLUT(i?e:void 0)}))}}),t}getMinimumSize(){return{x:200,y:200}}forEachAxis(t){return this.axes.slice().forEach((e=>t(e))),this}addLegendBox(t,e){const i=super.addLegendBox(t,e);return void 0!==e&&e!==this.uiScale||void 0!==t&&"vertical"!==t.getAlignment()||i.setOrigin(Vs.RightCenter).setPosition({x:this.uiScale.x.dt(this.uiScale.x.hi()-this.Ia.right),y:mt(this._g.y.dt(this._g.y.ei()+this._g.y.ri()/2),this._g.y,this.uiScale.y)}),i}QR(t,e,i,s,r){const n=[];let o;for(let h=0;ht.getVisible()))[r],o=n.key,h=Ee(this.Gv.map((t=>{if(!t._R||!t.Yp())return;const e=t._R[o],i=this.uR(e,r,n);return{cursorPosition:{pointMarker:i,pointMarkerScale:this.nR,resultTable:i,resultTableScale:this.nR},value:e,series:t,axis:n}})));return"show-nearest"===t?[h.sort(((t,e)=>Math.abs(t.cursorPosition.pointMarker.y-s.y)-Math.abs(e.cursorPosition.pointMarker.y-s.y)))[0]]:("show-nearest-interpolated"!==t&&"show-all-interpolated"!==t||zt.console.warn('LightningChart JS ParallelCoordinateChart does not support "interpolated" cursor modes.'),h)}}}const ug=(t,e,i)=>{if(i.length>1)return[[i[0].axis.getTitle()],...Ee(i.map((t=>{const e=t.series.getData(),i=e?e[t.axis.key]:void 0;if(void 0!==i)return ya(t,[[t.series,"",Ki(t.axis.formatValue(i),t.axis)]])})).flat())];const s=i[0],r=[[s.series]];return t.axes.forEach((e=>{const i=s.series.getData();if(!i)return;const n=i[e.key];if(void 0===n)return;const o=t.axes.filter((t=>t.getVisible()))[s.cursorPosition.pointMarker.x]===e?{weight:"bold"}:{};r.push([{text:e.getTitle(),font:o},"",{text:e.formatValue(n),font:o}])})),r},cg=(t,e)=>e?t.x:t.y,dg=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),fg=(t,e,i,s,r,n)=>{const o=e.length,h=Math.sign(s),a=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)a.push(cg(r,n)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=a.map((t=>0));let c=a[i-1]+s;for(let e=i;e>0&&edg(t,h,n,e))).reduce(((t,e)=>Math.max(t,cg(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>cg(r,n)-s||-1===h&&c<0+s){u.fill(0);break}if(e!==i&&(1===h?o>c:oa[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/cg(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class gg{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.ji=!1,this.cP=new Array,this.R=new r.Eventer,this.qR=[],this.ap=[],this.tE=void 0,this.iE=!0,this.sE=!0,this.eE=!0,this.dp=!1,this.hE=!0,this.rE=()=>{this.hE=!0,this.cs.Ms()},this.nE=[],this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.oE=t=>{for(let e=0;e{const e=this.qR.indexOf(t);e>=0&&this.qR.splice(e,1)},this.yp=t=>{const e=this.ap.indexOf(t);e>=0&&this.ap.splice(e,1)},this.lE=(t,e,i,s,r)=>{if(this.uE(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.cP.push(n),this.cE(n),this.iE=!0,t}throw new bt("Out of dashboard range.")},this.dE=e.numberOfRows,this.fE=e.numberOfColumns,this.CA=t,this.AE=e,this.gE=s;const o=this.fE*this.dE;this.pE={x:new _d(new Array(this.fE).fill(1)),y:new _d(new Array(this.dE).fill(1))},this.ts=i.ts,this.yE=this.ts.dashboardSplitterStyle,this.ph=!1!==(null==e?void 0:e.animationsEnabled),this.mE=Ld(i,o),this.vE=i.KF("dashboard splitters",500001),this.MM=()=>this.mE.JF(),this.Mp=this.mE.qF(),this.hs=i.hs.rs(this,{SE:{}}),this.hs.SE.bs(this.ts.effectsDashboardSplitters);const h=i.oi();this.uiScale=gt.d2({scaleXYConstructor:Yi}).Vi(0,100).Oi(0,100).it(h),this._g=gt.d2({scaleXYConstructor:Yi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(h),this.xE=i.bE.bind(i),this.ME=i._E.bind(i),this.wE=i.CE.bind(i),this.kE=i.TE.bind(i),this.Ao=i.Ao.bind(i),this.yo=i.yo.bind(i),this.engine=i.vp,this.cs=i.Sp,i.Eo((()=>this.rE())),i.Ms();const a=i.Oo((t=>{this.dp=t,this.R.emit("inViewChange",this,t)}));this.Tp=i.No.bind(i,a),this.FE(),this.setAnimationsEnabled(this.ph);const l=(t=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.R);this.createChartXY=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Dc(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Pd(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new jc(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=mg(t,this.AE,this.ph),i=e&&e.type?e.type:Ka;return this.lE(new i(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Uf(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=mg(t,this.AE,this.ph),i=e&&e.type?e.type:nd;return this.lE(new i(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=mg(t,this.AE,this.ph),i=t&&t.type?t.type:Ad;return this.lE(new i(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new ca(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Ll(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Vc(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Hl(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=mg(t,this.AE,this.ph),i=new Dl(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=mg(t,this.AE,this.ph),i=new hf(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=mg(t,this.AE,this.ph),i=new Af(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createParallelCoordinateChart=t=>{const e=mg(t,this.AE,this.ph),i=new lg(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}IE(t,e){return t+e*this.fE}PE(t,e){return{d1:i=>new i.scale1DConstructor("x"===i.dimension?t.columnIndex:t.rowIndex,"x"===i.dimension?t.columnSpan:t.rowSpan,"x"===i.dimension?this.fE:this.dE,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ct({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.fE,y:this.dE},e),d3:()=>new dt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.fE,y:this.dE},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.xE(t[0]),this.ME(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.wE(t[0]),this.kE(t[1]),this}getWidth(){return this.Ao()}getHeight(){return this.yo()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.vE.Ms(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.vE.Ms(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.ts}setSplitterStyle(t){const e=this.yE;return this.yE="function"==typeof t?t(this.yE):t,this.DE(e),this}getSplitterStyle(){return this.yE}setSplitterEffect(t){return this.hs.SE.bs(t),this.cs.Ms(),this}getSplitterEffect(){return this.hs.SE._s()}setAnimationHighlight(t){return this.eE=t,this.nE.forEach((e=>this.cs.us.Ts(e.line,t))),this}getAnimationHighlight(){return this.eE}DE(t){for(const t of this.nE)t.line.Ye(this.yE);this.FE()}setColumnWidth(t,e){const i=this.pE.x.C();return t>=0&&t=e.length)throw new bt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.pE.y.C();return t>=0&&t=e.length)throw new bt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this._g.getInnerIntervalPixels()}onResize(t){return this.R.on("resize",t)}offResize(t){return this.R.off(t,"resize")}BE(t,e,i){if(i&&Math.abs(t.x)>0)this.LE(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.RE(e,t.y)}for(const t of this.cP)t.panel.K();this.rE()}RE(t,e){const i=fg(this.cP,this.pE.y.C(),t,e,this._g.oi(),!1);this.pE.y._(i),this.rE()}LE(t,e){const i=fg(this.cP,this.pE.x.C(),t,e,this._g.oi(),!0);this.pE.x._(i),this.rE()}EE(){this.nE.forEach((t=>t.line.dispose())),this.nE.length=0;for(let t=1;t<=this.fE-1;t+=1)for(let e=0;e<=this.dE-1;e+=1)if(void 0!==this.cP.find((i=>ti(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=ns(new hs((()=>{this.zE(t)}),((e,i,s,r,n)=>{this.BE(r,t,!0),se(n)}),(()=>{this.VE(t)}))),s=this.vE.He(this._g).Ye(this.yE).setMouseEnterEventHandler((()=>{this.zE(t)})).setMouseLeaveEventHandler((()=>{this.VE(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.BE(n,t,!0),se(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.eE}),this.nE.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.dE-1;t+=1)for(let e=0;e<=this.fE-1;e+=1)if(void 0!==this.cP.find((i=>ti(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=ns(new hs((()=>{this.OE(t)}),((e,i,s,r,n)=>{this.BE(r,t,!1),se(n)}),(()=>{this.NE(t)}))),s=this.vE.He(this._g).Ye(this.yE).setMouseEnterEventHandler((()=>{this.OE(t)})).setMouseLeaveEventHandler((()=>{this.NE(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.BE(n,t,!1),se(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.eE}),this.nE.push({row:t,column:e,line:s,alignment:"horizontal"})}this.hs.SE.gs(this.nE.map((t=>t.line)))}GE(){const t=this._g.oi(),e=this.pE.x.C(),i=e.reduce(((t,e)=>t+e)),s=this.pE.y.C(),r=s.reduce(((t,e)=>t+e));this.nE.forEach((n=>{if("vertical"===n.alignment){const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(o.x,t.y*s.slice(0,n.row+1).reduce(((t,e)=>t+e),0)/r);n.line.$e(o).Xe(h)}else{const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(t.x*e.slice(0,n.column+1).reduce(((t,e)=>t+e),0)/i,o.y);n.line.$e(o).Xe(h)}}))}zE(t){this.nE.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.cs.us.ks(e.line,1),this.vE.UE(e.line))})),this.tE=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.cs.Ms()}OE(t){this.nE.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.cs.us.ks(e.line,1),this.vE.UE(e.line))})),this.tE=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.cs.Ms()}VE(t){this.nE.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.cs.us.ks(e.line,0)})),this.engine.restoreMouseStyle(this.tE),this.cs.Ms()}NE(t){this.nE.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.cs.us.ks(e.line,0)})),this.engine.restoreMouseStyle(this.tE),this.cs.Ms()}setAnimationsEnabled(t){return this.ph=t,this.getCells().filter((t=>t.panel instanceof fa)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ph),this}getAnimationsEnabled(){return this.ph}getCells(){return this.cP.slice()}dispose(){return this.ji||(this.Tp&&this.Tp(),this.cP.slice().forEach((t=>t.panel.dispose())),this.qR.slice().forEach((t=>t.dispose())),this.ap.slice().forEach((t=>t.dispose())),this.ji=!0,this.gE(),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}getIsInView(){return this.dp}saveToFile(t,e,i){return na(this.engine,t,e,i),this}WE(t){if(this.hE){const t=this.cs.At.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this._g.it(e,i);const s=this.uiScale.getInnerIntervalPixels();this._g.Vi(0,s.x).Oi(0,s.y),this.R.emit("resize",this,s.x,s.y,e,i),this.sE=!0}this.iE&&(this.EE(),this.iE=!1,this.sE=!0),this.sE&&(this.GE(),this.sE=!1);for(const e of this.cP)e.panel.ze(t);return this.qR.forEach((t=>t.Os())),this.qR.forEach((t=>t.ze())),this.ap.forEach((t=>t.Os())),this.ap.forEach((t=>t.ze())),this.hE=!1,this}J(){for(const t of this.cP)t.panel.J();return this._g.x.J(),this._g.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}K(){for(const t of this.cP)t.panel.K();return this._g.x.K(),this._g.y.K(),this.uiScale.x.K(),this.uiScale.y.K(),this}translateCoordinate(t,e,i){return aa(t,e,i,this._g,this.cs)}addUIElement(t=Jo,e=this.uiScale){e=ha(e,this._g);const i=oa(t,this.MM(),this.uiScale,e,this.aE,this.ts);return this.qR.push(i),i}addLegendBox(t=uh,i=this.uiScale){i=ha(i,this._g);const s=oa(t,this.Mp,this.uiScale,i,this.yp,this.ts);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.ap.push(s),s}getLegendBoxes(){return this.ap}uE(t,e,i,s){return e>=0&&t>=0&&e+s<=this.dE&&t+i<=this.fE}cE(t){const e=this.yE,i=e===ut?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Gr(s)}FE(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this._g.x.si([0,0]),this._g.y.si([0,0]);for(const t of this.cP)this.cE(t);this.cs.Ms()}}const mg=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,animationsEnabled:void 0!==t.animationsEnabled?t.animationsEnabled:i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},yg=(t,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAsa2NhQlgAACxranVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAALEVqdW1iAAAAR2p1bWRjMm1hABEAEIAAAKoAOJtxA3Vybjp1dWlkOjlmZDBkZjkzLTVmMDMtNDczYi1hZThhLTFhNDM4NmMzNmJhYQAAAAGzanVtYgAAAClqdW1kYzJhcwARABCAAACqADibcQNjMnBhLmFzc2VydGlvbnMAAAAA12p1bWIAAAAmanVtZGNib3IAEQAQgAAAqgA4m3EDYzJwYS5hY3Rpb25zAAAAAKljYm9yoWdhY3Rpb25zgaNmYWN0aW9ua2MycGEuZWRpdGVkbXNvZnR3YXJlQWdlbnRtQWRvYmUgRmlyZWZseXFkaWdpdGFsU291cmNlVHlwZXhTaHR0cDovL2N2LmlwdGMub3JnL25ld3Njb2Rlcy9kaWdpdGFsc291cmNldHlwZS9jb21wb3NpdGVXaXRoVHJhaW5lZEFsZ29yaXRobWljTWVkaWEAAACranVtYgAAAChqdW1kY2JvcgARABCAAACqADibcQNjMnBhLmhhc2guZGF0YQAAAAB7Y2JvcqVqZXhjbHVzaW9uc4GiZXN0YXJ0GCFmbGVuZ3RoGSx3ZG5hbWVuanVtYmYgbWFuaWZlc3RjYWxnZnNoYTI1NmRoYXNoWCBvErgv+J0u7bVCYViyMUgw5yMb8idAv1erA3/DALx9NWNwYWRIAAAAAAAAAAAAAAIDanVtYgAAACRqdW1kYzJjbAARABCAAACqADibcQNjMnBhLmNsYWltAAAAAddjYm9yqGhkYzp0aXRsZW9HZW5lcmF0ZWQgaW1hZ2VpZGM6Zm9ybWF0aWltYWdlL3BuZ2ppbnN0YW5jZUlEeCh4bXAuaWlkOjI3NEMxQjdDN0E0MDExRUVBQkZFQUNFQjJDOTA0NzVCb2NsYWltX2dlbmVyYXRvcng2QWRvYmVfUGhvdG9zaG9wLzI1LjIuMCBhZG9iZV9jMnBhLzAuNy42IGMycGEtcnMvMC4yNS4ydGNsYWltX2dlbmVyYXRvcl9pbmZvgb9kbmFtZW9BZG9iZSBQaG90b3Nob3BndmVyc2lvbmYyNS4yLjD/aXNpZ25hdHVyZXgZc2VsZiNqdW1iZj1jMnBhLnNpZ25hdHVyZWphc3NlcnRpb25zgqJjdXJseCdzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnNkaGFzaFggSmnBvf+o3kEweL4k7cz4MTrB0WSVNFZxoA1rBrM31K+iY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggL2g6Dghd536quyA5vPlS/9NGA5WvLRkkKJmqn0VxCoFjYWxnZnNoYTI1NgAAKEBqdW1iAAAAKGp1bWRjMmNzABEAEIAAAKoAOJtxA2MycGEuc2lnbmF0dXJlAAAAKBBjYm9y0oREoQE4JKNmc2lnVHN0oWl0c3RUb2tlbnOBoWN2YWxZDjYwgg4yMAMCAQAwgg4pBgkqhkiG9w0BBwKggg4aMIIOFgIBAzEPMA0GCWCGSAFlAwQCAQUAMIGCBgsqhkiG9w0BCRABBKBzBHEwbwIBAQYJYIZIAYb9bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHj4VpJDPzaO0x4hOPnj/w1GTHuwXU0IpBf4VVocIQzoAhB3SsxvHza2JR1fKj3Mjr0yGA8yMDIzMTEwMzExNTcyNloCCQCyOL6wAOGCbaCCC70wggUHMIIC76ADAgECAhAFHp6R1x6RCrvkPVzt0N3ZMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE7MDkGA1UEAxMyRGlnaUNlcnQgVHJ1c3RlZCBHNCBSU0E0MDk2IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMjMwOTA4MDAwMDAwWhcNMzQxMjA3MjM1OTU5WjBYMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xMDAuBgNVBAMTJ0RpZ2lDZXJ0IEFkb2JlIEFBVEwgVGltZXN0YW1wIFJlc3BvbmRlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE0srlH5A/+15/MFl1asNh8Q8TubOsEVfu0qlJrF0smjtwL1IeHZ/AB7J59u1Trpho1BDN85lfTY30rNBsfT+myjggGLMIIBhzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAgBgNVHSAEGTAXMAgGBmeBDAEEAjALBglghkgBhv1sBwEwHwYDVR0jBBgwFoAUuhbZbU2FL3MpdpovdYxqII+eyG8wHQYDVR0OBBYEFLA1qlbDIamLztO4vIsWJVed7zThMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcmwwgZAGCCsGAQUFBwEBBIGDMIGAMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wWAYIKwYBBQUHMAKGTGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcnQwDQYJKoZIhvcNAQELBQADggIBAHgrjELHhBCEWJSCyRX7lsL0C9LJgbX1ryVYySNRxHkMR2LqC7PQZRJgDNR+kJop8P5v2Bzp/jMrzw4U4pY6rYv3I8HpFlJa4uBwUTIUgHWpi8Xxd1JEEX94POODi7HySekX60A055BozFb7GGVaxb0LreQTRXnkr6ggPNUPX9Gh+2ScOxlTdQQLgZbkdYvxo3Ap6cy9riZijRxOZqiOyWSxMUhgKxeKzwrFW6Xbe0awNhOUXZzIxc4ixpKzWSItpPJ30ZiBQn49U3ADYTnshbN9ZkTA1pHf/Nov2ZUvvddkZ8UYvwo9vBvLTDvnmABnRMBKaXYAs3ZCvw9CkDPOWTeUJMFRAtmUx52ohaA3nD8bCJ6UfpQ2pFfOdShwpb6GKv0g+BgcdIG2LHPJ0Ufmr+XmpgZgq/HIge0hjcCADpjDgq2z4B0L4xtAA1M8MrUx02hxb7104nFKqMuv5zJTQl3sgwqXUyP+9zHQP9y/Z5Fx/AQWrOXCW56dV7P4cFBJl8zHqinlhkOStZ1m22+9Hlq+eC0hJ2lkF1LuzRdJJb/51LXoPKRnopFDng6XpoD7eG6w4YpAx9+P00JuUoBsYSrdsuFiyWyQQGBAnjI69ggbSLcW+hJytuinaxawVlItJkS2eV5Z4XsxPg7f82uRkdtN0hTHeI93CN3OWeRebnK7MIIGrjCCBJagAwIBAgIQBzY3tyRUfNhHrP0oZipeWzANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMjIwMzIzMDAwMDAwWhcNMzcwMzIyMjM1OTU5WjBjMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRpZ2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxoY1BkmzwT1ySVFVxyUDxPKRN6mXUaHW0oPRnkyibaCwzIP5WvYRoUQVQl+kiPNo+n3znIkLf50fng8zH1ATCyZzlm34V6gCff1DtITaEfFzsbPuK4CEiiIY3+vaPcQXf6sZKz5C3GeO6lE98NZW1OcoLevTsbV15x8GZY2UKdPZ7Gnf2ZCHRgB720RBidx8ald68Dd5n12sy+iEZLRS8nZH92GDGd1ftFQLIWhuNyG7QKxfst5Kfc71ORJn7w6lY2zkpsUdzTYNXNXmG6jBZHRAp8ByxbpOH7G1WE15/tePc5OsLDnipUjW8LAxE6lXKZYnLvWHpo9OdhVVJnCYJn+gGkcgQ+NDY4B7dW4nJZCYOjgRs/b2nuY7W+yB3iIU2YIqx5K/oN7jPqJz+ucfWmyU8lKVEStYdEAoq3NDzt9KoRxrOMUp88qqlnNCaJ+2RrOdOqPVA+C/8KI8ykLcGEh/FDTP0kyr75s9/g64ZCr6dSgkQe1CvwWcZklSUPRR8zZJTYsg0ixXNXkrqPNFYLwjjVj33GHek/45wPmyMKVM1+mYSlg+0wOI/rOP015LdhJRk8mMDDtbiiKowSYI+RQQEgN9XyO7ZONj4KbhPvbCdLI/Hgl27KtdRnXiYKNYCQEoAA6EVO7O6V3IXjASvUaetdN2udIOa5kM0jO0zbECAwEAAaOCAV0wggFZMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLoW2W1NhS9zKXaaL3WMaiCPnshvMB8GA1UdIwQYMBaAFOzX44LScV1kTN8uZz/nupiuHA9PMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAKBggrBgEFBQcDCDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcnQwQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcmwwIAYDVR0gBBkwFzAIBgZngQwBBAIwCwYJYIZIAYb9bAcBMA0GCSqGSIb3DQEBCwUAA4ICAQB9WY7Ak7ZvmKlEIgF+ZtbYIULhsBguEE0TzzBTzr8Y+8dQXeJLKftwig2qKWn8acHPHQfpPmDI2AvlXFvXbYf6hCAlNDFnzbYSlm/EUExiHQwIgqgWvalWzxVzjQEiJc6VaT9Hd/tydBTX/6tPiix6q4XNQ1/tYLaqT5Fmniye4Iqs5f2MvGQmh2ySvZ180HAKfO+ovHVPulr3qRCyXen/KFSJ8NWKcXZl2szwcqMj+sAngkSumScbqyQeJsG33irr9p6xeZmBo1aGqwpFyd/EjaDnmPv7pp1yr8THwcFqcdnGE4AJxLafzYeHJLtPo0m5d2aR8XKc6UsCUqc3fpNTrDsdCEkPlM05et3/JWOZJyw9P2un8WbDQc1PtkCbISFA0LcTJM3cHXg65J6t5TRxktcma+Q4c6umAU+9Pzt4rUyt+8SVe+0KXzM5h0F4ejjpnOHdI/0dKNPH+ejxmF/7K9h+8kaddSweJywm228Vex4Ziza4k9Tm8heZWcpw8De/mADfIBZPJ/tgZxahZrrdVcA6KYawmKAr7ZVBtzrVFZgxtGIJDwq9gdkT/r+k0fNX2bwE+oLeMt8EifAAzV3C+dAjfwAL5HYCJtnwZXZCpimHCUcr5n8apIUP/JiW9lVUKx+A+sDyDivl1vupL0QVSucTDh3bNzgaoSv27dZ8/DGCAbgwggG0AgEBMHcwYzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMTswOQYDVQQDEzJEaWdpQ2VydCBUcnVzdGVkIEc0IFJTQTQwOTYgU0hBMjU2IFRpbWVTdGFtcGluZyBDQQIQBR6ekdcekQq75D1c7dDd2TANBglghkgBZQMEAgEFAKCB0TAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTIzMTEwMzExNTcyNlowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQU2Rq5M/4XremCHqYT9aQ6cU4+fn0wLwYJKoZIhvcNAQkEMSIEIGmY+GsCefCDmP0PFcYjdxBUfi0EgKYuEZb9pUMyLNuVMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEIILa8ZSVezaEAkWP1ScAaf5ixxRW+p4Lhqv4J+hTICfZMAoGCCqGSM49BAMCBEcwRQIgcxxuf7QHV9Fkpj1VhPrFqhNFh8dZzl8qUU/2N3Sr4eoCIQDKu0KGYL++CSsDAXjJciMDbr5ImTy3jw0yQU5GYYeLimd4NWNoYWluglkGMzCCBi8wggQXoAMCAQICEBtbCzvasORd8vMNnlTR2tIwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEiMCAGA1UEAxMZQWRvYmUgUHJvZHVjdCBTZXJ2aWNlcyBHMzAeFw0yMzAyMDEwMDAwMDBaFw0yNDAyMDEyMzU5NTlaMIGhMREwDwYDVQQDDAhjYWktcHJvZDEcMBoGA1UECwwTQ29udGVudCBDcmVkZW50aWFsczETMBEGA1UECgwKQWRvYmUgSW5jLjERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAgMCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMSQwIgYJKoZIhvcNAQkBFhVncnAtY2FpLW9wc0BhZG9iZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv0wCnfYY9lkHDsykrTG7FYlnYHBcyualuD5u9ULjzv+FsTWOLg8Nhrz9RTxI9EeBbu3Wm7f4vqPsQYfxkEp0wIa6DVmEOZhbAeRfbhybWQ/D4Wvvck4mEZR+QZmTpIn7HX61gbtMFHlJUxkYBctIoAt9TBAFbz9d5Ig2WG0bsH39b6/8USXnIIk4FB6dtBRT1xeEwSDtwOd1YBpXXNBJmRWHXNJZZ85of2tBTesg/kMvTrOJJxYDZ97U416wcvbVomlees+NXUY3/ZB4xH+NsZils7m1bL2v2hSnHiLoqZeUKklbHUmT4ZpjrZCdtuIsWm5j2PPXKr7HKUuCbZSXBAgMBAAWjggGMMIIBiDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAeBgNVHSUEFzAVBgkqhkiG9y8BAQwGCCsGAQUFBwMEMIGOBgNVHSAEgYYwgYMwgYAGCSqGSIb3LwECAzBzMHEGCCsGAQUFBwICMGUMY1lvdSBhcmUgbm90IHBlcm1pdHRlZCB0byB1c2UgdGhpcyBMaWNlbnNlIENlcnRpZmljYXRlIGV4Y2VwdCBhcyBwZXJtaXR0ZWQgYnkgdGhlIGxpY2Vuc2UgYWdyZWVtZW50LjBdBgNVHR8EVjBUMFKgUKBOhkxodHRwOi8vcGtpLWNybC5zeW1hdXRoLmNvbS9jYV83YTVjM2EwYzczMTE3NDA2YWRkMTkzMTJiYzFiYzIzZi9MYXRlc3RDUkwuY3JsMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMB8GA1UdIwQYMBaAFFcpejJNzP7kNU7AHyRzznNTq99qMA0GCSqGSIb3DQEBCwUAA4ICAQBXjlGa3yAK/Gijn6n/JNU9FZm72MP6vc5czrWe9y0T+EawuRvhpD5Edi1TnXkrpe8sMkgSjTGdbY+yGhq8zlCWQeXN1/aWo3L9Xr1uNxY/oVpLn0uWWfnfJ7yR9gKl/yoMfhjydT4t1fXHi/MhfhrWSVRHqX2U31UFGz/e298P2kv+vqhzpIUo1bj+jibtoPLMMQcCOTtKiJOTh4o3VSZpwQDERCzo91NkF+LnZjwYl6fE5USIkg/oCoomXxSPpowybDrcRJ9ilbtJcER48/LGgwzv/c7OYdron4PnEXm1FkOaVj+QRf7OwiNTizonhIzLR5Vfp0QHOWv/bPzvCjPQd+Xr0Q4032WlSxQwostNTAPtoVAU4OCwVH3Ech38emJ00/6fkDCdr7MN8/4n2LSNrMUvaBEZdmLqDCBnO02dbFrmpg3pTc0FqRQ4GL/88pjRNSMy5tU9SoQnSCGYqIsjfL8AzgPEGiXXRgABYc1uXecf4/eayb3K2MPs7hnWTbUKpHHJIwxpdN3vTGdZNWpz9Oxfuo3eELQlkTvACHgqkaXi/FAanHe5PChn6fr1/4cNF8goD0buPApgS3zzwqjRhxrH8ISwPfJn8JqzurMaLDMnnc18tHzUiMtX73jf6oXh7voCxX/T4D3nFPlxU3om2cpcLQ1Wd4026x18rlSGR1kGpTCCBqEwggSJoAMCAQICEAyotlR7iebSBol1zYubieIwDQYJKoZIhvcNAQELBQAwbDELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEZMBcGA1UEAxMQQWRvYmUgUm9vdCBDQSBHMjAeFw0xNjExMjkwMDAwMDBaFw00MTExMjgyMzU5NTlaMHUxCzAJBgNVBAYTAlVTMSMwIQYDVQQKExpBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZDEdMBsGA1UECxMUQWRvYmUgVHJ1c3QgU2VydmljZXMxIjAgBgNVBAMTGUFkb2JlIFByb2R1Y3QgU2VydmljZXMgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3Hy69vQmzXEhs/gyDrmwB6lF4JaSAPomnsbKIZNr2iXaB+fkd85X8eJiNmI7P5O4cVT4Nc1p3zrESqBV4ZUyW8gcZ78QdwoHG8QNd2VNcHnMgSR+XT9Iafsnq9Nfww3Jt9KL3l5ANQ5n1+MJqr48EWNLll942bOL/JH4ywDSMoqhZqtJEIUUUGlQVBZ8CAvJc7LE6ddA5C52PE2Ppa7RfQgHXf4gfXVZwpxYRZcziPiOHqEvLb0J3cShUbejFxV6cwX8QyAPa1ePHg1RtM0HX+D34xHo3DkyGnmT+Ddq00TEDGG26AL5PdINKFIQl+zaq6KJFQe1fdGE5wrWzU4mBPmzaz3EbLn+7FWlwAhorYqIMldbfHE3ydc+aTU1JW7+bG19qmvhO9IluGtTtQDeqFBj2fg6faxsfVfVPD7stN6TwoIDlkOCE4RE+Iin8m3z3eqi/VsTmsmRqBxWDRaqOHz02EJoEDxXJG3ei+UbIIp01XZQvdufm90WxOTuqqan2ZqTPX9K5VdjEh/ovr7xFc5q1dZo+Sa5y4sTVM854/tLU3klOgUKzzSXYPYS3GhBcYJHjwr9xNRHnNX99D6F0g7OijScWfvtjxh13aTv/H0ETvymah4yfDpVdh9cK5YSCPqnuOlsujFAyhYwJXOWDvZZU2EkWVLDhoPx9zp7N4QIDAQABo4IBNDCCATAwEgYDVR0TAQH/BAgwBgEB/wIBADA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vY3JsLmFkb2JlLmNvbS9hZG9iZXJvb3RnMi5jcmwwDgYDVR0PAQH/BAQDAgEGMBQGA1UdJQQNMAsGCSqGSIb3LwEBBzBXBgNVHSAEUDBOMEwGCSqGSIb3LwECAzA/MD0GCCsGAQUFBwIBFjFodHRwczovL3d3dy5hZG9iZS5jb20vbWlzYy9wa2kvcHJvZF9zdmNlX2Nwcy5odG1sMCQGA1UdEQQdMBukGTAXMRUwEwYDVQQDEwxTWU1DLTQwOTYtMzMwHQYDVR0OBBYEFFcpejJNzP7kNU7AHyRzznNTq99qMB8GA1UdIwQYMBaAFKYc4W1UJEyoj0hyv26pjNXk7DHUMA0GCSqGSIb3DQEBCwUAA4ICAQBxzuUHjKbcLdzI4DtlXgCSgZXrlSAkr59pOF3JfPG42qVNAGU7JcEYXJ6+WbfcGwY7WYMl+jO7IvJPb7shXFYW9bnJgxX7lLU14KExchmcLNY1ee6IhBJ2Y8PzZMRUKSd5CkURPg0PBLGjz/KR/DofHx+G4rPTCOGORYxeYrd01lci5hVxvKccvIk7MD69ZTewfZPSM+0WnsU3f0Zmd7hgbRpUyWceG0eHFpdUKK/ZFWhHjDVC28odCnN885tHncKXviItK0ZUUo/AIthFKlhEXsnq9VL9fFbgvO83ZvpUQo5y8mY3cuGnEVGXdhjNb53CfC1u4dbpYmWaN99subUzEsUaUb3loLPfVfzDOpg2y9v37kBdy/wuXr20teY7U62xj/fAgs1QSnhUtlMTfCqbefyEycKVmKIrJkJLsvgTSYKVvH4FFIwfd5WjqOC97jX98rcVAzhAI0iSkazsWOMvL6m0L4nLJapx+85GsVX8Y6AHmEP4bmCElwil6KAP+UewJFiw5rmwV2pESHAhYuZJa03B8tl0nd2QJzvJGmbeBqXqpF9ORinFM3HErK8puRokOjFH2+1asLeI2tB31W/ELdNe27Ogduq6Z6qBwCp59YX27qydDhD0WRfN64kCs25K88iGAGNW2CAfTDS+b+WYJBiIL9jXYZ4LF+BiUvfdu2NwYWRZC70AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZZAQBKX2Q2ihN2fLDLReHISpfOF0xIqNpOZXbBwZ0XanWG98erbIBdawl7r9nVma/uZjYH457wp00TVpKYUTJHMnzJMKskvM2Df4K6t5pUKGtJqEvMXLUy3g9kJq53aYDwikcUE+8wv+CYtu/+vii4XYSXQIxT4NN+JKoTDXmrNH1G46Nmpfq6SKk0g9GQ2brbkW3fzGR0xDxY3BXRy71guSBxN9TAbQGqUjMnkIyBcwV9wUQ2oCW9oIMNKASjW0CRkcFEzzmrQ+y+zHYpNvUaG7QehHcyhvOec3plzlyP6DZeQWp3PHA5bmonI8t5j6Qj15X1KnQiXuJ0rW+xoMA89aIVmpx4VgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOSaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjYyYTdmYWExLWJmZTMtMjE0Ny04MjAwLWMxM2NlMGU4ZTc1NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzRDMUI3RDdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzRDMUI3QzdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMiAoMjAyMzEwMjQubS4yMzc0IDRhYjk0MzkpICAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphYjQzZjNjYy1hNTY4LTRkNGQtOTdiZC1iYjk0YjBlZjhjYmQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjJhN2ZhYTEtYmZlMy0yMTQ3LTgyMDAtYzEzY2UwZThlNzU0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HNvo5wAADZFJREFUeNrsXFtPVUkW3gc4yP0qDigKON517FFbHRGn1TamjaOJvvhsjIkvPplgfEKe1AefNDE+GP+AmWTszPTYcbpn2piJzc1GWwlOekRBEBFQ7jeZ9ZVrnVkUtfc5CGp3h5VU9qUuu3bVV9+67DonND4+7omEQiHPJaWlpYlxcXGLKX8epTCdB5aXNnHU6c2bN5POcaREp+O9dHxSX1/f5s3KL1ImYCkasMrKyvIISJspD+AyZSTpOrodDSaIBpQCkwtgSM8oVd2/f39M2quoqAijmcrKyjG/l7L77vde+v6sfCRgbdu2LY3AtJNSgg0qDa5oTOViKQtM9nXTgQMHaqmpPEoLKXUQqJpcYIqPj/cSEhLMUZgUbYyNjZkjRPpu50n+VEUvKtditMEb7Xom5OrVqzvpkOXIukFps5XXTunO4cOHR7heKp1/ye1gEX9BCcdv6H4330cbCyh9iXrRgJUQ1FmarFWUIqDS4ApiCT9AobxMpj24uI/209LSvMLCwiLKz6fyQModAlW73TeAac6cOV5SUpIBlasv9qKRvgBYIyMj3tDQkDmPdaLRPzwrHA6bhGsNWr9xsMfEZnC7XDSg+tzv4lRCCRPfjJtHjhzpu3LlCkDVx4BKZICsx9gy4PT4rmFQQbIpdfM5ynX7gWrS/Phl7NixI0SDWCCD52Is14vqAXIByoluAkl+fr43f/58Lyvr7cIaHh4OJSYmfkug6rXZApOamprqUb6vned3X4CBujj29/cbkEl/7EUj74o+og4S2gh6xkypk6mUPXnyZN25c+fCDKzm8vLyOuQzqCAtJ06cuH/+/PkwAytMLCR57VjQFy5cmKeAiXJZGOeLFy/iPBVt4Nqeb60dogKLBm9O/FvxXIwVxBAaUBpgixYt8np7e7329vYJZUtKSkwSefHihVdTU9N2586dXrtfmNj09HQz0dMRvAsYD0dhLryrvG8s7/w+ZCrPcJSdx8duAb+6l0WgWqeu/8uMZMoDWCTr+BpMVoZ8jLUq18XXgdohEFg0cXF6kF2s5Uf9NqBwxL0FCxaYSXz58qWZSNzr6+vzioqKIm01NTV5ZLgbT9HuExgGAzBdUOmJEeb6EKD5AJKt1KJ9TwAFNrpz6tSpljNnzgiQuuh8DbNSNx9HlF0mx26/cbTHLy6AsSKGcVCyjWepJwnS2trqbdiwwZyDJaDyUBbslZmZGTG6Hz9+7D18+NDdUSqTkpIyY6B6V5b4mYsBAIGm27rXR/f+DFXGKm5Ega6P7a5lqvw6sbMIcFkKlCUAI6esQI0QBCwBjxirNqCkDACSkZFhQKLVCSassbHR27Jli6kvsnDhQnN8/vy5t3Hjxsj95ubmSQ6CVoEA5a8IBO+LsSKgoskPKxaC1DKo1mmDXF1/AwAyCO+rNoX1FrANVqLA6V6sfuGGgwcPphBovrCBIuwCgRp7+vSpAUd2dra5bmtrM6pvdHTUu3fvnrGdNHhEbt265XV1dXn79+9/y8V0XltbGwkDkKpsqqqqqhG2AmgBrFn5+Qo0Uyw21gRm0kwCLwqAAgC2b99u2AQCVYWyACtUGkRUoC2bNm0yYBIBe/l5ncKaWmg1hrj/47TCRu32ebUam4LyAweEymK1QG+PUdk3PmXCrGZicrej9e99CD0znvs4NsPtRh2fmMMNLmBBYHgDmTC4ly1bNslWAbhu375tyh06dGgCw2kB+yDEAIEh39HR4RsjE+/NkgJKf0DwlNJ3jkndi2Yo/QXOZ5RxWElpOaUqSk99QLWPErzUr2OcD+j7T+GPUKqZocldyu2mWWbMv1mt4T3q2OObSVnNz46MD49xMfelE85ArOGGiA2FSR0cHDRggVe3fv16Lzc317cXCBeUlZUZu8sVBLUF7YrnaDMWygsjWpLJx1eOvCS8LKX+GFeYdPS1T356wLOC7NcOK/g4HSbaSmku2zZtlo0D6l8U5R2mIxmO91/F79iP8aY+lmhAR2Us09PXr439hAles2ZNoK2Tl5dnwgorV66clHfz5k1v165dk8CFuJYfWwm4/Twgn4FMZqO0U00OPg/lsgck0k3Ae6JACq8HamsAJgPl9fOAzef8VLpey1HtVGXUQoZ45b7QawzgojqpauJNZIYnpEXUFpWZw8ZxMqsdEdgUixlUqPMt1RlygE8mv4jO5/M7tFHZXs4HI+uJG4YFQvldnF+sAPRGjd8SSjl8fzGVG6I6Dxk76GcKl8uOlbESh4eHDVOBpWCcQ/1F88qQv2fPnknlnjx5YsIJOBYXF/9/NqhtANcV8ZbYlc8zswJYJJ8H5Eem7A3WxEYmjdVcigycyltBeV/RsVANbDKDrJnL5jom+Dsa+A5e0WDOn7g/Kx3PR/06qpPDjBS28gG6e6pfDT6gimeV5LF6iqh4focxHo84Ne8hzv8ng2sJA6tfjUedROkZbPkqRhbie8JauTEBi7y6ePncAQaaO3fulKLaWgDQgYEBoxrh+WlgiW3l9znFNtp5IBN5kv0YS6vJYgYVVlU120mfUPot58sqbeaBxJh8zqs7TIN+i573R2aMfykGQD2w21dcfx2DMI3yXjOosLqH6Fr6U8VqDHGhzVw2ns8T2BaTWNMefrc09a7PA1R1iNuuYibZwfXmUB8Qq/qrZa9tZjs1i65fcRswHf5O1zuYgZ7yeG1jdq3SbM9gauFF8yimOBYABaN66dKlUwKVS0TVQT2+evVqgjcIYAWxXxQ12O/jcWUq0MlqvwtQsIeo8zOUWoQHOcCTNMbqQsqPcTARE5PCk/+a64woB6HPYf/JMzq57KgqW8AAaKa8Jn4fbfOlKe92wGeoMq13GFQqdwD95aDmZ5Q+Z9AJwwwoYL5Wn3vqHH2JCOU9pkMjg7jWMgH8GYtspVx8cIwW6QYDrV271rccgATGAkhgm8GTfPDggbd161YTWIUqdLGVnPt4lQKsQQebJTCVj7CNlO4YmAwFlCUaBAo0XVR/nK6T+RqTNh5g7GuwLrTyMxlMfY760r/eKI4J+hJSffA1rlm9o989DK5SLtOmnpOm+pCr6zNoojpJVK6HnxFbuKGiomI5u5hRQVVdXW0+0UjowGa97u6Jn5ewewExMIAN3mA0lepjX8nLgsYXMy2P8SAmWJM6zGoJhnkrr7BEBRwbJLYHJJ/zQ5gwZhx7IkMMkEFWfZF8BcxOFU9zAes33L9+yzERMKLP66nMM8V4HjNFpgPI0r9kft4AmwLjzE4wD0Z58S0OMCvk/RMDgB1zHGtZtIoIgopKe/TokRNYnZ2dzroAIsAFo93Vrq0OAxgLdPZ7TZBsLOtBAl2vZbvqE1VWT4JWM/YkDfJk4P4+GtxqR5l07otrYjMdk6Ydj24ebxjwO23CZ6A+YGegiJOn+vY3xcC9jncY5TwA7E92+zGEW/r5+CnbUjdijbXYbJXs8E6ck11aWmp2G+B7oC1Qc2AsP+AAVHqT3RR3Vd5nQ9dO93hw6ik95hX9H7jonF/PIQBjj7ARC9f5rhUTQrlWrt/L9e/y/XbOq1ce0ihfy0A85useZop6K2gJ8P8A0FACo/7De7tV5Qd4sgIa8QDp2IBoDTNOvU7Mlo1sQ44rwNSzwS3t19l14WWq/tb4qLW76rn3Yp2gSd8KCVjwWMqC1JP6nmei8Ddu3DBRdgmI4jshDHbkByVpQ5+rY9P3339fk5OT46m9RVMNLGLQf2cxdCGff62M3I8m1EcY73nqVg4nhBYe/FK+EwJH+E4cpAozgxoQlhEQwGNctWqVUW2rV6+OGOx++96jbcm193bJBrx3lBQV3NRu8o+xgCrWvervsoddWD8pKamQ40Py9QEM00htNrzrnvxY3yeW/kUTIRlbO7kYa4OlxyMsZG87loQ8Yhdv9+7dJkIPYGk28mOrFStWGOMeux+wdx0foq9fvx7Z3QDGgmeK9D63y8j74D2QpI+unZHTAZdsgJzKxE33vfQzowEuluC3q57eyx/EWBn2DQQ3MdDa9bd/xrV8+fLIpx8beH4/HigoKHgbKi4u9s6ePeuVl5cbYOkOIxwB0M30Bj+0DRDhy4LE7KSfszJ9SbAMd0+5vxEjG6EB+SWMRq3eepycnGwMdq0mfX7aNWHbsrAhovvXrl2bpCKRB2DDSZjuKpd2AVa0qX9EMSszK3GOmEWCjopLgBMJE4GEyZajVh8OA9zJXBpUOL98+bJ37Ngxr6WlRbPbuIABrILPS+8KAtRD/3t6ekzsTBbLLKg+HLC0GrxLkzCmAaWTDSptm0QDGf92cMKvdy5duuQdPXpU6+sB7TAAWFCzOI8VTCiLOoinIeaGNqbyO8JZmXlg3a2srPyJANQqQHIBTIPLBlYQc8GTxM5SAdHevXvNr3NgSylGe2Z7owAG2AZHcSbshHJgOJQDoCSeNgumj2hjMbAMqHBBE/IAv0imiU6AjSUGvN9Pv1z2lAtc2AiILTg4r6mpMfGP48ePew0NDdJGU21t7SuXaysAt3e26l85z7LSx5cJ4YbTp0/PJVBN2G6wb9++PJrAzdif5fpBhTaK/f70I1qygPeMrqvq6upi0nmuPyWZlY8XJPWNY7mEVJX5GyNK8yiFg34J7fM3RYEgIyCN09H8jVF1dfXs3xj9CoD1PwEGAKorJqR4atjIAAAAAElFTkSuQmCC",s)=>{let r,n=0,o=0;const h=[],a=t=>{const i=new zt.Image;i.src=t,i.onload=()=>{h.forEach((t=>{var s;const r=new Q({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.$d)||void 0===s||s.Re(r),n=i.width,o=i.height,c(t)}))}};a(i);const l=t.Kn((t=>a(t)));let u;if(new zt.Image instanceof zt.HTMLImageElement){const t=new zt.Image;t.src=i,u=new Q({source:t,fitMode:e.ImageFitMode.Stretch})}else if(zt.lcjs_setup){const t=new zt.Image;t.src=i;const s=zt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),u=new Q({source:s,fitMode:e.ImageFitMode.Stretch})}else u=new N({color:T("#f00")});const c=t=>{if(t.$d){const e=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-(3+n),y:3}),i=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-3,y:3+o}),s={x:i.x-e.x,y:i.y-e.y};t.$d.Ve(e).it(s)}r&&r.Ms()};return r=t.KF("logo",Number.MAX_SAFE_INTEGER),i=>{const n={At:i};return(i=>{const n=s&&"cGx1Z2lu"in s&&"cHl0aG9u"===s.cGx1Z2lu?Ag:pg;i.$d&&i.$d.dispose(),r&&(i.$d=r.Ee(i.At).Re(u).setMouseInteractions(!0).Le(ut).setMouseEnterEventHandler((()=>{t.tn(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.tn(e.MouseStyles.None)})).setMouseClickEventHandler(n).setTouchEndEventHandler(n),c(i))})(n),h.push(n),{Os:()=>c(n),Y:()=>(e=>{e.$d&&(e.$d.dispose(),e.$d=void 0);const i=h.indexOf(e);i>=0&&h.splice(i,1),h.length<=0&&t.qn(l)})(n)}}},pg=()=>zt.open("https://lightningchart.com/lightningchart-js/"),Ag=()=>zt.open("https://lightningchart.com/python-charts/");class xg{constructor(){this.YE=this.UI.bind(this),zt.addEventListener("scroll",this.YE,{passive:!0})}Y(){this.YE&&zt.removeEventListener("scroll",this.YE),this.YE=void 0}}class Sg{constructor(t,e){this.Fa=t,this.Z=e,this.HE=!0,this.XE=null,this.$E=null}}class vg{constructor(t){this.jE=!1,this.ZE=1,this.QE=t,this.JE={Fa:u(0,0),Z:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),HE:!0,XE:null,$E:null},this.KE=u(64,64),this.qE=new Uint8ClampedArray(this.KE.x*this.KE.y*this.ZE)}tz(t,e){if(!t.HE)return null;if(t.XE&&t.$E){const i=this.tz(t.XE,e);return null!==i?i:this.tz(t.$E,e)}const i=c(t.Z.x,t.Z.y);if(t.Fa.x+t.Z.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.KE.x-t.Fa.x-1),t.Fa.y+t.Z.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.KE.y-t.Fa.y-1),t.Z.x===e.x&&t.Z.y===e.y)return t.HE=!1,t;if(i.xt.Z.y)),h?(s=new Sg(yi(t.Fa,{x:0,y:1}),u(t.Z.x,e.y)),r=new Sg(yi(t.Fa,{x:0,y:e.y+1}),u(t.Z.x,t.Z.y-1-e.y))):(s=new Sg(yi(t.Fa,{x:1,y:0}),u(e.x,t.Z.y)),r=new Sg(yi(t.Fa,{x:e.x+1,y:0}),u(t.Z.x-1-e.x,t.Z.y))),t.XE=s,t.$E=r,this.tz(t.XE,e)}iz(t,e){const i={sz:!1,Fa:null};let s=this.tz(this.JE,e);if(null===s)for(;null===s&&this.KE.xthis.QE||t.y>this.QE)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.ZE);for(let i=0;i{this.lz.fz(t)})),this.az.clear(),this}Az(t,e){const i=this.oz.get(e);if(i)return i.get(t)}gz(t,e,i){let s=this.oz.get(e);if(s||(s=new Map,this.oz.set(e,s)),s.has(t.glyph))return Mg.Success;const r=this.uz.iz(i,t.size);if(!r||!r.Fa)return Mg.Fail;r.sz&&this.pz();const n=this.uz.rz(r.nz);if(!n)return Mg.Fail;let o=this.az.get(r.nz);if(!o){const t=this.lz.gl.createTexture();if(!t)throw new Mt("Failed to create texture for font!");o=t,this.az.set(r.nz,t)}const h=r.Fa,a=n.KE.x,l=n.KE.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,y=(h.x+t.size.x)/a,p=h.y/l,A=[g,m,y,m,g,p,g,p,y,m,y,p],x=[u,c,d,c,u,f,u,f,d,c,d,f],S={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:x,texCoords:A,packerId:r.nz,texture:o};s.set(t.glyph,S);const v=this.lz.gl;return v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.bindTexture(v.TEXTURE_2D,o),v.texImage2D(v.TEXTURE_2D,0,v.LUMINANCE,n.KE.x,n.KE.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.lz.yz?n.qE:new Uint8Array(n.qE)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.bindTexture(v.TEXTURE_2D,null),r.sz?Mg.Resize:Mg.Success}pz(){this.oz.forEach((t=>{t.forEach(((e,i)=>{const s=this.uz.rz(e.packerId);if(!s)return;const r=e.origin,n=s.KE.x,o=s.KE.y,h=r.x/n,a=(r.y+e.size.y)/o,l=(r.x+e.size.x)/n,u=r.y/o,c=[h,a,l,a,h,u,h,u,l,a,l,u];e.texCoords=c,t.set(i,e)}))}))}}const wg=t=>{if(t instanceof Yi||t instanceof Wc)return t._i()?"linear-highPrecision":"linear";if(t instanceof Hi){const e={};return t.x instanceof Fi&&(e.x={base:t.x.gi()}),t.y instanceof Fi&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},Eg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let r=!1;i[e]=t=>{if(!t)return r;const e=s();return r=e,e}})),i},kg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.vt(),max:e.St()}:"y"===t.getLookUpProperty()?{min:e.xt(),max:e.bt()}:"z"===t.getLookUpProperty()?{min:e.Tv(),max:e.kv()}:void 0,Ig=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),zg=t=>(e,i)=>i%2?e:e+t;class Fg{constructor(t){this.mz=new Map,this.vz=xe("font"),this.Sz=new Map,this.xz=new Set,this.lz=t}dz(t=!1){return(t||0===this.xz.size)&&(this.mz.forEach(((t,e)=>{t.dz(),this.mz.delete(e)})),this.xz.clear()),this}bz(t){this.xz.add(t)}Mz(t){this.xz.delete(t)}_z(t,e,i,s){const r=zt.devicePixelRatio,n=`${s?"dark":"light"} - ${Pr(e,r).id}`,o=this.Sz.get(n),h=this.mz.get(o);let a=0,l=0,u=0;const c=t.split(""),d=e.size,f=.45*e.size*r,g=Math.round(1*e.size);let m=!1;for(let t=0;t{if(0===i||360===i||180===i||i%180==0)return{x:t,y:e};if(90===i||-90===i||(i+90)%180==0)return{x:e,y:t};const s=i*Math.PI/180,r=Math.cos(s),n=Math.sin(s);return{x:Math.abs(t*r)+Math.abs(e*n),y:Math.abs(t*n)+Math.abs(e*r)}})(u/r,(l-a+1)/r,i);return{x:y.x,y:y.y,isEstimate:m}}wz(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.Sz.get(s);r||(r=this.vz(),this.mz.set(r,new Tg(this.lz)),this.Sz.set(s,r));const n=this.mz.get(r);if(!n)throw new Mt("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),c=new Map;let d=0;const f=e.properties.size;for(let t=0;t{t.ba.u=!0})),t=-1,d=0,h=0,o=0,c.clear(),this.lz.cs.Ms(!0);continue}if(l===Mg.Fail)throw new Mt("Failed to create glyph");if(a=n.Az(s,f),!a)throw new Mt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(a.texture);t||(t={vertices:[],texCoords:[]},c.set(a.texture,t)),t.vertices.push(...a.vertices.map(zg(r))),t.texCoords.push(...a.texCoords),h=Math.max(h,a.baseline),o=Math.min(o,a.baseline-(a.size.y-1))}d+=a.advanceX}a=d;const g=m(u(0,o),u(a,h)),y=[];return c.forEach(((t,e)=>{y.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[y,g]}}class Rg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>Dg(t)));for(const i of e)t=i(t);return`${we(this.modifiers.filter((t=>Pg(t)))).map((t=>t.kz)).join("\n")}\n${t}`}}const Dg=t=>"function"==typeof t,Pg=t=>t&&"object"==typeof t&&"Tz"in t,Og=(...t)=>e=>{t=t.reverse();for(let i of t)"string"==typeof i&&(i=i.includes("{")||i.endsWith(";")?i:`${i};`,i=i.trim(),e=e.replace("void main(void)",`${i}\nvoid main(void)`));return e},Lg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),_g=(...t)=>e=>{const i=t.filter((t=>t));for(let t=0;ti=>{for(let t=0;t{if(!n.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${n}\n)`)})),n},Vg=(t,...e)=>i=>{const s=e.filter((t=>"string"==typeof t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},Gg=(...t)=>e=>{for(let i of t)if("string"==typeof i){i=i.endsWith(";")?i:`${i};`,i=i.trim(),i=i.startsWith("\t")?i:`\t${i}`;const t=e.lastIndexOf("}");e=`${e.substring(0,t-1)}\n${i}\n}`}return e},Ng=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Og(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Og(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Gg(`\t${r} = ${s};`)(i)},Ug=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Yg={roundUnsigned:{Tz:"roundUnsigned",kz:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{Tz:"linearStep",kz:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{Tz:"decodeUbyteRGBAEncodedFloat",kz:"\n // Denormalize 8-bit color channels to integers in the range 0 to 255.\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n \n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n \n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n \n // Decode a 32-bit float from the RGBA color channels of a texel.\n float decodeUbyteRGBAEncodedFloat(vec4 rgba, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(rgba, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n "},texelFetchWithFallback:{webgl2:{Tz:"texelFetchWithFallback",kz:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{Tz:"texelFetchWithFallback",kz:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},texelFetchUnsignedWithFallback:{webgl2:{Tz:"texelFetchUnsignedWithFallback",kz:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{Tz:"texelFetchUnsignedWithFallback",kz:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},modulus:{Tz:"modulus",kz:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{Tz:"computeScreenSpaceWireframe",kz:"#extension GL_OES_standard_derivatives : enable\nfloat computeScreenSpaceWireframe (vec3 barycentric, float lineWidth) {\n vec3 dist = fwidth(barycentric);\n vec3 smoothed = smoothstep(dist * ((lineWidth * 0.5) - 0.5), dist * ((lineWidth * 0.5) + 0.5), barycentric);\n return 1.0 - min(min(smoothed.x, smoothed.y), smoothed.z);\n}"}},Hg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Og("uniform vec4 uFallbackColor")],n=[],o=[];for(let t=0;t= uLUTValue${s}) {\n colorLookup = uLUTColor${s};\n }`,...i.slice(0,-1).map(((t,e)=>`if (value >= uLUTValue${e} && value <= uLUTValue${e+1}) {\ncolorLookup = uLUTColor${e} + vec4(uLUTColor${e+1}.r - uLUTColor${e}.r, uLUTColor${e+1}.g - uLUTColor${e}.g, uLUTColor${e+1}.b - uLUTColor${e}.b, uLUTColor${e+1}.a - uLUTColor${e}.a) * (value - uLUTValue${e})/(uLUTValue${e+1} - uLUTValue${e});} `)),"colorFragment = colorLookup")):r.push(Vg("colorFragment =","vec4 colorLookup = vec4(uLUTValue0)","float value = "+(e.percentageValues?`clamp((${t} - uMinValue) / (uMaxValue - uMinValue), 0.0, 1.0);`:`${t}`),`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorLookup = uFallbackColor;\n } else if (${t} < uLUTValue0) { colorLookup = uLUTColor0;} ${i.slice().reverse().map((t=>{const e=i.indexOf(t);return`else if (value >= uLUTValue${e}) { colorLookup = uLUTColor${e};} `})).join("")}`,"colorFragment = colorLookup")),r},Xg=[Og("uniform sampler2D uMaskTexture"),Og("varying vec2 vMaskTextureCoord"),Vg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Wg=[Og("uniform sampler2D uMaskTexture"),Og("varying vec2 vMaskTextureCoord"),Vg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],jg=[Og("varying vec3 vPosWorld;","varying vec3 vNormal;","uniform vec3 uCameraLoc;","uniform vec3 uLightLoc;","uniform vec4 uLightColor;","uniform vec4 uAmbientColor;","uniform float uShininess;","uniform float uAmbientReflection;","uniform float uDiffuseReflection;","uniform float uSpecularReflection;"),Vg("colorFragment =","float ambientReflection = uAmbientReflection","float diffuseReflection = uDiffuseReflection","float specularReflection = uSpecularReflection","vec3 ambientColor = uAmbientColor.rgb","vec3 diffuseColor = colorFragment.rgb","vec3 specularColor = uLightColor.rgb","vec3 vNormalNormalized = normalize(vNormal)","vNormalNormalized = (float(gl_FrontFacing) * 2.0 - 1.0) * vNormalNormalized","vec3 lightDir = normalize( uLightLoc - vPosWorld )","float lambertian = abs(dot(vNormalNormalized, lightDir))","float specular = 0.0","vec3 R = reflect(-lightDir, vNormalNormalized)","vec3 V = normalize(uCameraLoc - vPosWorld)","float specAngle = max(dot(R,V),0.0)","specular = pow(specAngle, uShininess)","colorFragment = vec4(ambientReflection * ambientColor + diffuseReflection * lambertian * diffuseColor + specularReflection * specular * specularColor, colorFragment.a)")],$g=(t,...e)=>{var i,s,r;if("linear-highPrecision"!==t||0===e.length)return{vertexShaderModifiers:[],fragmentShaderModifiers:[]};const n=e[0];return{vertexShaderModifiers:[Og("varying vec4 d"),Gg(`d = vec4(${e[0]}.x, ${null!==(i=e[1])&&void 0!==i?i:n}.x, ${null!==(s=e[2])&&void 0!==s?s:n}.x, ${null!==(r=e[3])&&void 0!==r?r:n}.x)`)],idFragment:"hpfix",fragmentShaderModifiers:[Og("varying vec4 d"),Gg("if (d.z == -100.0 + d.z / 10.0) { gl_FragColor = d; }")]}};class Zg extends Error{constructor(t,e,i){super(`Dynamic shader generation error\n(id: ${e})\n ${i?`when applying feature: ${i.idVertex?`vert: ${i.idVertex}`:""} ${i.idFragment?`frag: ${i.idFragment}`:""}`:""} | ${t}`)}}const qg=(...t)=>{let e="";for(const i of t){if("object"!=typeof i){e+=`${String(i)},`;continue}const t=[{prefix:"",obj:i}];for(;t.length>0;){const{prefix:i,obj:s}=t.shift();e+=`${i}:`;const r=Object.keys(s).sort();for(const i of r){const r=s[i];"object"==typeof r&&r.__proto__===Object.prototype||Array.isArray(r)?t.push({prefix:i,obj:r}):e+=`${i}=${String(r)},`}}}return e},Kg=t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Iz})),Jg=t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Pz})),Qg=(t,e,...i)=>{const s=[],r=e?"vec3":"vec2",{axisWorldTranslation:n,scaling:o,translation:h,offset:a,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Og("attribute vec3 aNormal"),_g("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(_g(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(_g(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))})):i.forEach((e=>{!0!==t.splitPosAttribute?s.push(_g(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),_g(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(_g(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),_g(`${r} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),a&&a.rotation){const t=a.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Og("attribute float aRotDeg"),Og("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(_g(`vec2 ${t} = vec2(sin((aRotDeg + uBaseRotDeg) * 0.01745329252), cos((aRotDeg + uBaseRotDeg) * 0.01745329252))`,`vec2 rotatedGeo = vec2(${e}.x * ${t}.y + ${e}.y * ${t}.x, ${e}.y * ${t}.y - ${e}.x * ${t}.x)`))}else{const i=`${e}Rot`;s.push(Og(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(_g(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Og(`attribute ${r} aInstanceGeo`)),!0===l){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXY");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${e?`vec3(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x, ${t.variableNameAxisCoord}.z)`:`vec2(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`}`)}))}if(!0===u){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXZ");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = vec3(${t.variableNameAxisCoord}.z, ${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`)}))}if(o){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",r=e?"vec3":"vec2";s.push(Og(`${o.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===h.dataType?"a":"u")+"TranslationAxis",r=e?"vec3":"vec2";s.push(Og(`${h.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===a.dataType?"a":"u")+"OffsetAxis",o=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${o} ${t}`));const h=a.halved?" * 0.5":"",l=a.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${r} ${u} = ${t} * ${l}${h} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${r} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===n||"linear"===n)s.push(Og(`uniform ${r} uDisp`,`uniform ${r} uScale`)),i.forEach((t=>{f.push(`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===n)s.push(Og(`uniform ${r} uDisp`,`uniform ${r} uScale`,`uniform ${r} uScaleStart_highpart`,`uniform ${r} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${r} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${r} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===n)s.push(Og("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Og("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Og(`uniform ${r} uScaleStart`,`uniform ${r} uScaleStartLog`,`uniform ${r} uScaleInterval`,`uniform ${r} uScaleIntervalLog`,`uniform ${r} uViewportStart`,`uniform ${r} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=n[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${Di(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Og(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),r=n[1][t];if(void 0===r)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const n=r.base,o="e"===n;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${n}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${r} ${e.variableNameWorldCoord} = uViewportStart + ${r}(${o.join(", ")}) * uViewportSize`)}))}if(a&&"px"===a.sizeUnit){s.push(Og("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Og("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${n} ${e}`));const o=a.halved?" * 0.5":"",h=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e}${o} * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${h}`)}))}if(a&&"scale"===a.sizeUnit){s.push(Og("uniform vec2 uRatioPxClip")),s.push(Og("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Og("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Og(`${a.dataType} float ${e}`));const r=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e} * uSizePixels * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${r}`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(a&&"nwu"===a.sizeUnit){s.push(Og("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Og("uniform vec2 uViewportSizePx")),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = 2.0 * floor(((${t.variableNameWorldCoord} + 1.0) * 0.5) * uViewportSizePx + 0.5) / uViewportSizePx - 1.0`)}))),s.push(Bg("gl_Position =",...f)),s},tm=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(Vg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(Vg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==n[0])throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");{const t=[`${o} ${i}_percent = (${i} - uViewportStart) / uViewportSize`];(e?["x","y","z"]:["x","y"]).forEach((e=>{const s=e.toUpperCase(),r=n[1][e];if(void 0===r)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const n=r.base,o="e"===n?"1.0":`cLog${n}`;t.push(`float pos${s}Back = pow(2.71828, (${i}_percent.${e} * uScaleIntervalLog.${e} + uScaleStartLog.${e}) / ${o})`)}})),t.push(`${o} ${s} = ${o}(posXBack, posYBack${e?", posZBack":""})`),r.push(Vg(i,...t))}}return r},em=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Dz})))(t)?[Lg("attribute vec4 aColor"),Lg("vColor = aColor"),Og("attribute vec4 aColorA"),Og("attribute vec4 aColorB"),Gg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],im=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Bz})))(t)?[Lg("attribute float aLookupValue"),Lg("vLookupValue = aLookupValue"),Og("attribute float aLookupValueA"),Og("attribute float aLookupValueB"),Gg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],sm={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"2DCompose":{idFeature:"2DCompose",apply:t=>({idVertex:"2DCompose",idFragment:"2DCompose",defaultVertexShader:"2DMatrix",defaultFragmentShader:"Empty"})},"3D":{idFeature:"3D",Fz:{Iz:!0},apply:t=>({idVertex:"3D",idFragment:"3D",defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",apply:e=>{const i="uniform"===t?"u":"a";return{idVertex:`SizePrimitive:${qg(t)}`,idFragment:void 0,vertexShaderModifiers:[Og(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Gg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTextureText,r=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",Fz:{Pz:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,Bz:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,Dz:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${qg(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Og("uniform vec4 uColor"),Vg("colorFragment =","colorFragment = uColor"),...s?Xg:[],...r?Wg:[]);else if("attribute"===i)a="colorAttribute",u.push(Ng("attribute vec4 aColor","varying vec4 vColor")),d.push(Og("varying vec4 vColor"),Vg("colorFragment =","colorFragment = vColor"),...s?Xg:[],...r?Wg:[]);else if("texture"===i)a="colorTexCoord",u.push(Ng("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Og("varying vec2 vTextureCoord"),Og("uniform sampler2D uColorTexture"),Og("uniform vec4 uColor"),Vg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Xg:[],...r?Wg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Og("attribute vec2 aTextureCoord"),Og("varying vec2 vTextureCoord"),Gg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Og("varying vec2 vTextureCoord"),Og("uniform sampler2D uColorTexture"),_g("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Ng("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Og("uniform sampler2D uColorTexture"),Og("varying vec2 vTextureCoord"),Vg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Og("uniform sampler2D uColorTexture"),Og("varying vec2 vTextureCoord"),Og("uniform vec4 uColor"),Vg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }"));else if(Array.isArray(i)&&"lookup"===i[0]){const t=i[1];if("value"===t)a="lookup:value",u.push(Ng("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Ng(e,"varying float vLookupValue"))}d.push(Og("varying float vLookupValue"),...Hg("vLookupValue",i[2]),...s?Xg:[],...r?Wg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();nt(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Og("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Og(...Bt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Yg.linearStep,Vg("colorFragment =","vec2 uv = vec2((((gl_FragCoord.x)-uBounds.x)/(uBounds.z))*uAspect,((gl_FragCoord.y)-uBounds.y)/(uBounds.w))","float mixVal = distance(uv/uDistance, uCenter/uDistance)","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, mixVal))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"colorFragment = color"),...s?Xg:[],...r?Wg:[])):at(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Og("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Og(...Bt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Yg.linearStep,Vg("colorFragment =","vec2 uv = gl_FragCoord.xy - uBounds.xy","float magnitude = ((uv.x-uStartPoint.x) * (uEndPoint.x-uStartPoint.x) + (uv.y-uStartPoint.y) * (uEndPoint.y-uStartPoint.y)) / (pow(uEndPoint.x - uStartPoint.x, 2.0) + pow(uEndPoint.y-uStartPoint.y,2.0))","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, magnitude))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"colorFragment = color"),...s?Xg:[],...r?Wg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Ng("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Og("uniform float uOpacity"),Vg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:u,fragmentShader:c,fragmentShaderModifiers:d,idVertex:a,idFragment:l}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${qg(t)}`;return{idFeature:"ColorShaded3D",Fz:{Pz:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,Bz:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Ng("normal","varying vec3 vNormal"),Ng("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Og("uniform vec4 uColorDiffuse"),Vg("colorFragment =","colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Ng("attribute vec4 aColor","varying vec4 vColor")),a.push(Og("varying vec4 vColor"),Vg("colorFragment =","colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Ng("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Ng(e,"varying float vLookupValue"))}a.push(Og("varying float vLookupValue"),...Hg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Ng("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Og("varying vec3 vTriangleBary"),Og("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Yg.computeScreenSpaceWireframe,Vg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...jg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=$g(t.axisWorldTranslation,"posAxis_hprecision"),s=[],r=Kg(e),n=t.coordType?t.coordType:r?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?s.push(Og(`attribute ${n} aPos`)):s.push(Og("attribute float aPosX"),Og("attribute float aPosY"),r&&Og("attribute float aPosZ")):!0===t.splitPosAttribute?s.push(Og("attribute float aPos_highpartX"),Og("attribute float aPos_lowpartX"),Og("attribute float aPos_highpartY"),Og("attribute float aPos_lowpartY")):s.push(Og(`attribute ${n} aPos_highpart`),Og(`attribute ${n} aPos_lowpart`)),s.push(...Qg(t,r,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),s.push(...i.vertexShaderModifiers),{idVertex:`VertexLocation:${qg(t)}`,idFragment:i.idFragment,vertexShaderModifiers:s,fragmentShaderModifiers:i.fragmentShaderModifiers}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Og("attribute vec3 aGeoPos"),Og("uniform mat4 uModelRotation"),Og("uniform mat4 uModelRotationNormals"),Og("uniform vec3 uLocationAxis"),Og("uniform vec3 uModelAlignment"),Og("uniform vec3 uModelScale"),Og("uniform vec3 uModelSize"),...Qg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Bg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&Vg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Jg(e)?tm({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${qg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>{const e=$g(t.axisWorldTranslation,"locationA_hprecision","locationB_hprecision");return{idFeature:"LineInstanced2D",apply:i=>({idVertex:`LineInstanced2D:${qg(t)}`,idFragment:e.idFragment,vertexShaderModifiers:[Og("uniform float uThicknessPixels"),Og("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA"),Og("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA_highpart"),Og("attribute vec2 aLocationB_highpart"),Og("attribute vec2 aLocationA_lowpart"),Og("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationAX"),Og("attribute float aLocationAY"),Og("attribute float aLocationBX"),Og("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationA_highpartX"),Og("attribute float aLocationA_highpartY"),Og("attribute float aLocationB_highpartX"),Og("attribute float aLocationB_highpartY"),Og("attribute float aLocationA_lowpartX"),Og("attribute float aLocationA_lowpartY"),Og("attribute float aLocationB_lowpartX"),Og("attribute float aLocationB_lowpartY")]:[],Og("attribute vec2 aSegmentPosition"),Og("attribute float aSegmentSide"),...Qg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Og("uniform vec2 uMinSegmentPixelVector"),Vg("worldB = ",t.ensureMinimumSegmentLength&&"float segmentLengthPixels = sqrt(pow(worldB.x - worldA.x, 2.0) + pow(worldB.y - worldA.y, 2.0)) / length(uRatioPxClip)",t.ensureMinimumSegmentLength&&"if (segmentLengthPixels == 0.0 || segmentLengthPixels < length(uMinSegmentPixelVector)) {\n worldB = worldA + uMinSegmentPixelVector * uRatioPxClip;\n }","vec2 directionBasis = worldB - worldA","vec2 directionBasisNorm = normalize(directionBasis)","vec2 perpendBasisNorm = vec2(-directionBasisNorm.y, directionBasisNorm.x)","vec2 offset = mix(worldA, worldB, aSegmentSide)","vec2 thicknessDirection = aSegmentPosition.x * directionBasisNorm + aSegmentPosition.y * perpendBasisNorm","vec2 posWorld = offset + thicknessDirection * uThicknessPixels * uRatioPxClip"),...im(i),...em(i),...Jg(i)?tm(t,!1,"posWorld","posAxis"):[],...e.vertexShaderModifiers],fragmentShaderModifiers:e.fragmentShaderModifiers})}},Area2D:t=>({idFeature:"Area2D",apply:e=>{const i=$g(t.axisWorldTranslation,"locationA_hprecision","locationB_hprecision");return{idVertex:`Area2D:${qg(t)}`,idFragment:i.idFragment,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA"),Og("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA_highpart"),Og("attribute vec2 aLocationB_highpart"),Og("attribute vec2 aLocationA_lowpart"),Og("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationAX"),Og("attribute float aLocationAY"),Og("attribute float aLocationBX"),Og("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationA_highpartX"),Og("attribute float aLocationA_highpartY"),Og("attribute float aLocationB_highpartX"),Og("attribute float aLocationB_highpartY"),Og("attribute float aLocationA_lowpartX"),Og("attribute float aLocationA_lowpartY"),Og("attribute float aLocationB_lowpartX"),Og("attribute float aLocationB_lowpartY")]:[],Og("attribute float aCurveOrBaseline"),Og("attribute float aSegmentSide"),...Qg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Vg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","bottom"===t.fill?"float baseline = min(posCoord.y, -1.0)":"top"===t.fill?"float baseline = max(posCoord.y, 1.0)":"left"===t.fill?"float baseline = min(posCoord.x, -1.0)":"float baseline = max(posCoord.x, 1.0)","vec2 posWorld = "+("bottom"===t.fill||"top"===t.fill?"vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))":"vec2(mix(posCoord.x, baseline, aCurveOrBaseline), posCoord.y)")),...im(e),...em(e),...Jg(e)?tm(t,!1,"posWorld","posAxis"):[],...i.vertexShaderModifiers],fragmentShaderModifiers:i.fragmentShaderModifiers}}}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${qg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Og("uniform float uOffsetWU"),Og("attribute vec3 aLocationA"),Og("attribute vec3 aLocationB"),Og("attribute float aSegmentPosition"),Og("attribute float aPerpendHorizontal"),Og("attribute float aPerpendVertical"),...Qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Kg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Vg("worldB = ","vec3 directionBasis = worldB - worldA","vec3 directionBasisNorm = normalize(directionBasis)","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(directionBasis.y), 0.9 ) ))","vec3 horizontalBasis = normalize( cross( notParallel, directionBasisNorm ) )","vec3 verticalBasis = normalize( cross( horizontalBasis, directionBasisNorm ) )","vec3 normal = aPerpendHorizontal * horizontalBasis + aPerpendVertical * verticalBasis","vec3 posWorld = worldA + aSegmentPosition * directionBasis + normal * uOffsetWU * 0.5"),...Jg(e)?tm({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Og("attribute vec3 aEdge"),Og("uniform float uEdgeRoundness"),Vg("posWorld =","vec3 boxSizeWorld = abs( aOffsetAxis / uScale )","float boxMinDimensionWorldXZ = min( boxSizeWorld.x, boxSizeWorld.z )","vec3 edgeRoundAmount = uEdgeRoundness * vec3( boxMinDimensionWorldXZ, min( boxMinDimensionWorldXZ, boxSizeWorld.y ), boxMinDimensionWorldXZ )","posWorld = posWorld + aEdge * edgeRoundAmount")]})},ColorGrid2D:t=>{const e=t.flipXY,i=t.intensityTextureType,s=t.littleEndian;return{idFeature:"ColorGrid2D",apply:(r,n)=>({idVertex:void 0,idFragment:`ColorGrid2D:${qg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Og("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Yg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?_g("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions - 1.0)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensions - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensions - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${e?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${e?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${e?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${e?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===i?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${s})`),"float intensity01 = "+("float"===i?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${s})`),"float intensity10 = "+("float"===i?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${s})`),"float intensity11 = "+("float"===i?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${s})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${e?"lerpFactors.y":"lerpFactors.x"})`):_g("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellIndexNormalized = cellIndex / uTileDimensions",`vec4 sample0 = texture2D(uTileIntensityValues, ${e?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...Hg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,h)=>{const a=[],l=[];return a.push(Og("uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB","attribute"===i&&"attribute float aVertexID"),void 0!==i&&Yg.roundUnsigned,Yg.modulus,Yg.texelFetchWithFallback[h],"ubyte"===r&&Yg.decodeUbyteRGBAEncodedFloat,_g(void 0===i?"int iVertex = gl_VertexID":"int iVertex = int(roundUnsigned(aVertexID))","int iSecondary = modulus(iVertex, (uTileDimensions.y - 1))","int iPrimary = iVertex / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(uTileDimensions) - 1.0","vec2 halfTexelWorld = 2.0 / (uTileDimensionsMinus1 * 2.0)","vec2 posWorld = vec2(-1.0 + halfTexelWorld.y + iCell.y * 2.0 * halfTexelWorld.y, -1.0 + halfTexelWorld.x + iCell.x * 2.0 * halfTexelWorld.x)","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec3 posAxis0 = vec3(\n uTileStartLocationAxisXZ.x + iCell.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`} ,\n uTileStartLocationAxisXZ.y + iCell.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell1 = iCell + vec2(1.0, 0.0)",`vec3 posAxis1 = vec3(\n uTileStartLocationAxisXZ.x + iCell1.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell1.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell2 = iCell + vec2(0.0, 1.0)",`vec3 posAxis2 = vec3(\n uTileStartLocationAxisXZ.x + iCell2.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell2.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell3 = iCell + vec2(1.0, 1.0)",`vec3 posAxis3 = vec3(\n uTileStartLocationAxisXZ.x + iCell3.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell3.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec3 normal = normalize(cross(posAxis2 - posAxis0, posAxis1 - posAxis0) + cross(posAxis1 - posAxis3, posAxis2 - posAxis3))","uint"===s?"vNormalRGB = uvec3(((normal / 2.0) + 0.5) * float(-1u))":"vNormalRGB = (normal / 2.0) + 0.5","gl_PointSize = 1.0")),l.push(Og("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),_g("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${qg(t)}`,idFragment:`DrawToNormalTexture:${qg(t)}`,vertexShaderModifiers:a,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,r=t.shadingStyle,n=t.wireframe,o=t.normalTextureType,h=t.heightmapTextureType,a=t.intensityTextureType,l=t.littleEndian;return{idFeature:"SurfaceGrid",Fz:{Lz:!0},apply:(u,c)=>{const d=[],f=[];return d.push(Og("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture"),Yg.modulus,Yg.texelFetchWithFallback[c],"ubyte"===h&&Yg.decodeUbyteRGBAEncodedFloat,_g("int iSecondary = modulus(iInstance + uBaseInstance, (uTileDimensions.y - 1))","int iPrimary = (iInstance + uBaseInstance) / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 iCellVertex = iCell + aGeoCellOffset","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","vec2 ySampleCoordinate = vec2(iCellVertex.y, iCellVertex.x) / vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x)","float y = "+("float"===h?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${l})`),"vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)","vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * "+(s?"vec2(iCellVertex.y, iCellVertex.x)":"iCellVertex"),"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)")),d.push(...Qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(Ng("posWorld","varying vec3 vPosWorld"),..."uint"===o?[Yg.texelFetchUnsignedWithFallback[c],Gg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Gg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Gg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Og("varying vec3 vNormal",..."uint"===o?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Og("varying vec3 vTriangleBary")),"uniform"===e?f.push(Og("uniform vec4 uColorDiffuse"),Vg("colorFragment =","colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]&&("value"===e[1]?(d.push(Ng("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Og("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===a&&Yg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?_g("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = (vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensionsXZ - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensionsXZ - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${s?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${s?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${s?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${s?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===a?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${l})`),"float intensity01 = "+("float"===a?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${l})`),"float intensity10 = "+("float"===a?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${l})`),"float intensity11 = "+("float"===a?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${l})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${s?"lerpFactors.y":"lerpFactors.x"})`):_g("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = floor((vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ)","vec2 cellIndexNormalized = cellIndex / (uTileDimensionsXZ - 1.0)",`vec4 sample0 = texture2D(uTileIntensityValues, ${s?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = sample0.x"),...Hg("intensityP",e[2]))):(d.push(Ng(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Og("varying float vLookupValue"),...Hg("vLookupValue",e[2])))),"phong"===r&&f.push(...jg),n&&(d.push(Og("attribute vec3 aTriangleBary"),Ng("aTriangleBary","varying vec3 vTriangleBary")),f.push(Og("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Yg.computeScreenSpaceWireframe,Vg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)",e?"if (edge > 0.0) {\n colorFragment = vec4(mix(colorFragment.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorFragment.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorFragment = uWireframeColor;\n } else {\n discard;\n }"))),{idVertex:`SurfaceGrid:${qg(t)}`,idFragment:`SurfaceGrid:${qg(t)}`,vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${qg(t)}`,idFragment:`DebugSurfaceGridNormals:${qg(t)}`,vertexShaderModifiers:[Og("attribute float aNormalArrow","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===t.instanceIdSource&&"attribute float aInstanceID",..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),Yg.roundUnsigned,Yg.modulus,Yg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Yg.decodeUbyteRGBAEncodedFloat,_g(void 0===t.instanceIdSource?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","float y00 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y = (y00 + y01 + y10 + y11) / 4.0","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * (0.5 + ${t.flipXZ?"vec2(iCell.y, iCell.x)":"iCell"})`,"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)",..."uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"],"vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"),..."uint"===t.normalTextureType?[Yg.texelFetchUnsignedWithFallback[i]]:[],...Qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),Vg("posWorld =","vec3 dirArrow = normalWorld","vec3 posArrowStart = posWorld","vec3 posArrowEnd = posWorld + dirArrow * 0.010","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(dirArrow.y), 0.9 ) ))","vec3 dirArrowLeft = normalize(-dirArrow + 0.50 * normalize(cross(dirArrow, notParallel)))","vec3 dirArrowRight = normalize(-dirArrow + 0.50 * normalize(cross(notParallel, dirArrow)))","vec3 posArrowLeft = posArrowEnd + dirArrowLeft * 0.0025","vec3 posArrowRight = posArrowEnd + dirArrowRight * 0.0025","if (aNormalArrow == 0.0) {\n posWorld = posArrowStart;\n } else if (aNormalArrow == 1.0) {\n posWorld = posArrowEnd;\n } else if (aNormalArrow == 2.0) {\n posWorld = posArrowLeft;\n } else if (aNormalArrow == 3.0) {\n posWorld = posArrowRight;\n }")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Gg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Og("uniform vec3 uCameraLoc"),Vg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Og("attribute float aSegmentInside"),Og("varying float vSegmentInside"),Og("varying float vSegmentSide"),Vg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Ug("#extension GL_OES_standard_derivatives : enable"),Og("uniform float uAALimit"),Og("varying float vSegmentInside"),Og("varying float vSegmentSide"),Vg("antiAliasFactor = ","\n float dist = (uAALimit - vSegmentInside);\n vec2 ddist = vec2(dFdx(dist), dFdy(dist));\n float pixelDist = dist / length(ddist);\n // additional blurring\n pixelDist *= 0.5;\n\n float aa = clamp(0.5 - pixelDist, 0.0, 1.0);\n if((vSegmentSide <= 0.0 || vSegmentSide >= 1.0) && aa <=0.99){\n aa *= 0.5;\n }\n antiAliasFactor = aa;\n ")]})},Glow1D:t=>({idFeature:"Glow1D",apply:()=>{const e=Math.round(t.spreadPx),i=Math.round(t.blurPx),s=e+i,r=t.firstPass,n=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);n.push(r?{x:t.toFixed(1),y:"0.0",distPx:e.toFixed(1)}:{x:"0.0",y:t.toFixed(1),distPx:e.toFixed(1)})}return{idVertex:`Glow1D:${qg(t)}`,idFragment:`Glow1D:${qg(t)}`,vertexShaderModifiers:[Ng("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Og("uniform sampler2D uTexture"),Og("varying vec2 vTextureCoord"),Og("uniform vec2 uTextureSize"),r&&Og("uniform vec2 uOffsetPx"),!r&&Og("uniform sampler2D uTextureFirstGlowPass"),!r&&Og("uniform vec4 uGlowColor"),Vg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...r?[]:["float inverseIntensity =\n 0.25 * texture2D(uTexture, vTextureCoord).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, -oneTexel.y)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, oneTexel.y)).a","antiAliasFactor *= 1.0 - (inverseIntensity * inverseIntensity)","if (antiAliasFactor <= 0.0) { discard; }"],"float distancePx = 255.0","vec2 sample_tx = vec2(0.0)",...r?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...n.map(((t,e)=>[`sample_tx = texCoordOffset + oneTexel * vec2(${t.x}, ${t.y})`,`if (distancePx > ${t.distPx} && sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0 && texture2D(uTexture, sample_tx).a > 0.0) { distancePx = ${t.distPx}; }`])).flat(),"colorFragment = vec4(distancePx / 255.0, 0.0, 0.0, 1.0)"]:["vec4 sample_horizontal = vec4(0.0)","float horizontal_dist = 255.0","float min_horizontal_dist = 255.0",...n.map(((t,e)=>[`sample_tx = vTextureCoord + oneTexel * vec2(${t.x}, ${t.y})`,"if (sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0) {\n sample_horizontal = texture2D(uTextureFirstGlowPass, sample_tx);\n horizontal_dist = sample_horizontal.r * 255.0;\n }","if (sample_horizontal.a < 0.9) { horizontal_dist = 255.0; }","min_horizontal_dist = min(min_horizontal_dist, horizontal_dist)",`distancePx = min(distancePx, pow(horizontal_dist * horizontal_dist + ${t.y} * ${t.y}, 0.5))`])).flat(),`if (distancePx > ${s.toFixed(1)}) { discard; }`,"vec4 pixelGlowColor = vec4(0.0, 0.0, 0.0, 0.0)",`if (distancePx > ${e.toFixed(1)}) {\n float lerpAmount = (distancePx - ${e.toFixed(1)}) / ${(i+1).toFixed(1)};\n pixelGlowColor = mix(uGlowColor, vec4(uGlowColor.rgb, 0.0), 1.0 - (1.0 - lerpAmount) * (1.0 - lerpAmount));\n } else {\n pixelGlowColor = uGlowColor;\n }`,"colorFragment = pixelGlowColor"])]}}}),MousePicking:t=>{const e=!!(null==t?void 0:t.customMousePickingIdInput),i=!e&&!!(null==t?void 0:t.useVertexId),s=!e&&!!(null==t?void 0:t.useAttribute),r=!e&&!i&&!s;return{idFeature:"MousePicking",Fz:{Lz:r,Rz:i},apply:(n,o)=>{const h="webgl2"===o?"flat":"",a="webgl2"===o?"int":"float";return{idVertex:`MousePicking:${qg(t)}`,idFragment:`MousePicking:${qg(t)}`,vertexShaderModifiers:[...r?[Og(`${h} varying ${a} vPickingIdOffset`),Gg(`vPickingIdOffset = ${a}(iInstance)`)]:[],...i?[Og(`${h} varying ${a} vPickingIdOffset`),Gg(`vPickingIdOffset = ${a}(iVertex)`)]:[],...s?[Og("attribute float aPickingIdOffset",`${h} varying ${a} vPickingIdOffset`),Gg(`vPickingIdOffset = ${a}(aPickingIdOffset)`)]:[]],fragmentShaderModifiers:[Og("uniform int uFirstId"),...e?[]:[Og(`${h} varying ${a} vPickingIdOffset`),_g("int mousePickingIdOffset = "+("int"===a?"vPickingIdOffset":"int(floor(vPickingIdOffset + 0.5))"))],Vg("colorFragment =","int remainder = mousePickingIdOffset + uFirstId","int r = remainder / 16777216","remainder -= r * 16777216","int g = remainder / 65536","remainder -= g * 65536","int b = remainder / 256","remainder -= b * 256","int a = remainder","colorFragment = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, float(a) / 255.0)"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd").replace("if (fragColorEnd.a <= 0.0) { discard; }","")]}}}},AttributeHighlight:{idFeature:"AttributeHighlight",apply:t=>({idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",vertexShaderModifiers:[Ng("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",apply:(t,e)=>({idVertex:"StippleTexture",idFragment:"StippleTexture",vertexShaderModifiers:[Og("attribute vec2 aLengthSoFar"),Og("varying float vLengthSoFar"),Og("uniform vec2 uStippleCount"),Gg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Og("uniform sampler2D uStippleTexture"),Og("uniform float uStippleScale"),Og("varying float vLengthSoFar"),"webgl1"===e&&Og("uniform float uStippleTextureWidthLimiter"),Vg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},StippleTextureInstanced:{idFeature:"StippleTextureInstanced",apply:(t,e)=>({idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",vertexShaderModifiers:[Og("attribute vec2 aLengthSoFarA"),Og("attribute vec2 aLengthSoFarB"),Og("varying float vLengthSoFar"),Og("uniform vec2 uStippleCount"),Gg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Og("uniform sampler2D uStippleTexture"),Og("uniform float uStippleScale"),Og("varying float vLengthSoFar"),"webgl1"===e&&Og("uniform float uStippleTextureWidthLimiter"),Vg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},PolarHeatmap:t=>({idFeature:"PolarHeatmap",apply:(e,i)=>{const s="dataType"in t,r="interpolation"in t?t:void 0,n=r?r.flipXY:void 0,o="bilinear"===(null==r?void 0:r.interpolation),h=null==r?void 0:r.intensityTextureType,a=null==r?void 0:r.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${qg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Og("uniform vec2 uViewportSize","uniform vec2 uScale","uniform vec2 uDisp","uniform float uSectors","uniform float uAnnuli","uniform float uAmplitudeStart","uniform float uAmplitudeStep","uniform float uAmplitudeAxisStart","uniform float uAmplitudeAxisEnd","uniform float uAngleOffset","uniform float uAngleDirection",r&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),Yg.texelFetchWithFallback[i],"ubyte"===h&&Yg.decodeUbyteRGBAEncodedFloat,_g("vec2 posWorld = (2.0 * gl_FragCoord.xy / uViewportSize) - 1.0","vec2 posAxis = posWorld * uScale + uDisp","float amplitudeAxisInterval = uAmplitudeAxisEnd - uAmplitudeAxisStart","float amplitude = uAmplitudeAxisStart + sign(amplitudeAxisInterval) * sqrt(posAxis.x * posAxis.x + posAxis.y * posAxis.y)","float iAnnulus = (amplitude - uAmplitudeStart) / uAmplitudeStep"),r&&Vg("iAnnulus","float angRad = atan(posAxis.y, posAxis.x) * uAngleDirection + uAngleOffset","if (angRad < 0.0) { angRad = angRad + 2.0 * 3.1415926538; }","if (angRad > 2.0 * 3.1415926538) { angRad = angRad - 2.0 * 3.1415926538; }","float iSector = uSectors * angRad / (2.0 * 3.1415926538)","vec2 cellIndex = vec2(iSector, iAnnulus)","ivec2 cellStart = ivec2(floor(cellIndex))","ivec2 cellEnd = cellStart + ivec2(1)","if (cellEnd.x >= int(uSectors)) { cellEnd = ivec2(0, cellEnd.y); }",n&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",n&&"cellStart = ivec2(cellStart.y, cellStart.x)",n&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)"),s&&Vg("colorFragment =","colorFragment = uColor"),r&&Vg("cellEnd","vec2 tileDimensions = "+(n?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),o&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",o&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",o&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",o&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",o&&"float intensity00 = "+("float"===h?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${a})`),o&&"float intensity01 = "+("float"===h?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${a})`),o&&"float intensity10 = "+("float"===h?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${a})`),o&&"float intensity11 = "+("float"===h?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${a})`),o&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",o&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",o&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",o&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!o&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!o&&"float intensityP = "+("float"===h?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${a})`)),...r?Hg("intensityP",r.lut):[]]}}})},rm={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","2DMatrix":"\nvoid main(void) {\n gl_Position = posWorld;\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},nm={FragmentShader:"\nuniform float uIsHighlighted;\nuniform vec4 uHighlightColorOffset;\nuniform float uRenderEffectMask;\nvoid main(void) {\n vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0);\n float antiAliasFactor = 1.0;\n vec4 fragColorEnd = colorFragment;\n if (fragColorEnd.a <= 0.0) { discard; }\n fragColorEnd = clamp(fragColorEnd + uIsHighlighted * uHighlightColorOffset, vec4(0.0), vec4(1.0));\n fragColorEnd = mix(fragColorEnd, vec4(1.0), uRenderEffectMask * fragColorEnd.a * 1000.0);\n gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor);\n}\n",Empty:"\nvoid main(void) {\n}\n"};class om{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new Ct(`Could not find ${this.Ez()} ${this.zz()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}Ez(){return this.id.toString()}zz(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class hm extends om{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class am extends om{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class lm{constructor(t,e,i,s){this.Vz=new Map,this.Oz=new Map,this.Nz=i,this.Gz=i.createProgram(),this.Uz=`${t.Ez()} vertex`,this.Wz=`${e.Ez()} fragment`,i.attachShader(this.Gz,t.shader),i.attachShader(this.Gz,e.shader),i.bindAttribLocation(this.Gz,0,"aPos"),i.linkProgram(this.Gz),i.deleteShader(t.shader),i.deleteShader(e.shader),this.allAttributeNames=t.info.allAttributeNames,this.allUniformNames=Array.from(new Set(t.info.allUniformNames.concat(e.info.allUniformNames)).values()),this.vertexSharedRemovedVariables=t.info.removedVariableNames,this.fragmentSharedRemovedVariables=e.info.removedVariableNames}get vertexShaderSrc(){return""}get fragmentShaderSrc(){return""}Yz(t){return Me(0,(()=>Ce()))}Xz(t){const e=this.$z(t);if(void 0===e)throw this.Yz(`Could not get ${t} uniform from ${this.Uz} and ${this.Wz} shaders.`);return e}$z(t){const e=this.Vz.get(t);if(e)return e;const i=this.Nz.getUniformLocation(this.Gz,t);return i?(this.Vz.set(t,i),i):void 0}jz(t){const e=this.Zz(t);if(void 0===e)throw this.Yz(`Could not get ${t} attribute from ${this.Uz} and ${this.Wz} shaders.`);return e}Zz(t){const e=this.Oz.get(t);if(e||0===e)return e;const i=this.Nz.getAttribLocation(this.Gz,t);return i>=0?(this.Oz.set(t,i),i):void 0}Y(){this.Nz.deleteProgram(this.Gz)}}const um=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,cm=t=>{let e;try{e=zt.getComputedStyle(t)}catch(t){return null}return e};function dm(t){const e=cm(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=cm(ym(t)),i=e?e.display:"auto";return"flex"===i||"inline-flex"===i}(t))||+e.opacity<1||"transform"in e&&"none"!==e.transform||"webkitTransform"in e&&"none"!==e.webkitTransform||"mixBlendMode"in e&&"normal"!==e.mixBlendMode||"filter"in e&&"none"!==e.filter||"webkitFilter"in e&&"none"!==e.webkitFilter||"isolation"in e&&"isolate"===e.isolation||!!um.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function fm(t){let e=t.length;for(;e--;)if(dm(t[e]))return t[e];return null}function gm(t){var e;return t&&Number((null===(e=cm(t))||void 0===e?void 0:e.zIndex)||0)||0}function mm(t){const e=[];for(;t;)e.push(t),t=ym(t);return e}function ym(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}const pm=t=>t&&"resize"in t;class Am extends xg{constructor(t){if(super(),this.Qz=new Map,this.Jz=new Map,this.Kz=new Map,this.qz=!0,this.tV=null,this.iV=null,this.sV=null,this.eV=null,this.hV=0,this.rV=0,this.nV=0,this.oV=!1,this.aV=!0,this.ji=!1,this.lV=xe(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.Z={x:100,y:100},this.uV=()=>{this.cV&&clearTimeout(this.cV),this.cV=setTimeout((()=>this.an()),12)},this.dV=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.Qz.get(i);if(t){const s=t.fV();t.AV(e),e?this.Jz.set(i,t):this.Jz.delete(i),s!==e&&t.Ms()}}},this.gV=(t,e,i,s,r)=>{const n=r[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.iV.Gz),o.clear(o.COLOR_BUFFER_BIT),n.qr.getBoundingClientRect()){const t=n.pV();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.yV),o.uniform1i(this.hV,0),o.uniformMatrix4fv(this.rV,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.sV),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.nV,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.mV&&(n.mV.clearRect(0,0,n.mV.canvas.width,n.mV.canvas.height),n.mV.drawImage(this.vV,0,this.vV.height-t.y,t.x,t.y,0,0,n.mV.canvas.width,n.mV.canvas.height))}},this.SV=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.iV.Gz),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.qr.getBoundingClientRect();if(r){const i=r.right-r.left,o=r.bottom-r.top,h=r.left,a=s-r.bottom;n.viewport(h*this.xV-t*this.xV,a*this.xV+e*this.xV,i*this.xV,o*this.xV)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.yV),n.uniform1i(this.hV,0),n.uniformMatrix4fv(this.rV,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.sV),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.nV,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.bV=(t,e,i,s,r)=>{const n=r[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const h=n.pV();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.MV[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.vV.height-h.y,h.x,this.vV.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.mV&&(n.mV.clearRect(0,0,n.mV.canvas.width,n.mV.canvas.height),n.mV.drawImage(this.vV,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this._V=(t,e,i,s,r)=>{const n=this.gl2.ctx;n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.qr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.pV();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.MV[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.xV-t*this.xV,l*this.xV+e*this.xV,(a-t+o)*this.xV,(l+e+h)*this.xV,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.cV=void 0,this.io=t,!zt.requestAnimationFrame||!zt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.wV)e=!0===t.wV?zt.devicePixelRatio||1:t.wV||1;else{const t=zt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=zt.devicePixelRatio||1)}this.xV=e,t.eo=!0===t.eo,this.aV=!1!==t.CV,this.kV=!1!==t.TV,this.FV=t.FV||!1;let i=!1;if(t.vV)if("string"==typeof t.vV){const e=zt.document.getElementById(t.vV);if(!e)throw new Error(`Canvas "${t.vV}" doesn't exist.`);this.vV=e,i=!0}else this.vV=t.vV,i=!0;else this.vV=zt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.IV&&t.IV){const e=this.vV.getContext("webgl",{...s,antialias:!!t.CV})||this.vV.getContext("experimental-webgl",{...s,antialias:!!t.CV});this.gl=e,this.PV=!1}else{const t=this.vV.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.PV=!0}if(!this.gl)throw new Mt("No WebGL context available."+((null==t?void 0:t.IV)?`\nSelected explicit target: WebGL ${t.IV}`:""));const r=[];if(this.DV={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.DV).forEach((t=>{null===this.DV[t]&&r.push(t)})),this.PV)this.BV=!0;else{const t={ANGLE_instanced_arrays:this.gl.getExtension("ANGLE_instanced_arrays"),EXT_blend_minmax:this.gl.getExtension("EXT_blend_minmax"),OES_element_index_uint:this.gl.getExtension("OES_element_index_uint"),OES_standard_derivatives:this.gl.getExtension("OES_standard_derivatives"),OES_vertex_array_object:this.gl.getExtension("OES_vertex_array_object")};t.OES_standard_derivatives||(this.qz=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.BV=!!e.OES_texture_float,this.gl1={ctx:this.gl,DV:t,optional:e}}const n=r;if(n.length>0&&!1!==t.eo){const t=zt.document.createElement("div");t.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",t.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";const e=zt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),zt.document.body.appendChild(t),t.appendChild(e),zt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.LV=this.FV?this.RV(this.PV?this.bV.bind(this):this.gV.bind(this)).bind(this):this.EV(this.PV?this._V.bind(this):this.SV.bind(this)).bind(this),zt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.vV&&this.zV()};this.oo=new zt.ResizeObserver(t.bind(this)),this.oo.observe(this.vV)}if(this.VV=((t,e)=>{const i=t,s=new Map,r=new Map,n=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},h=(t,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(t.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(t.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(t.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(e){const e=t.match(/#extension.*/g);e&&n.push(...e),t=t.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");const e=s.find((t=>"fragOutput"===t.type));t=(t=e?`out ${e.fragOutput} fragOutput;\n${t}`:`out vec4 fragOutput;\n${t}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:t=`${r.join("\n")}\n${t}`,info:o}};return(...t)=>{const a=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,y,p;try{const e=zt.performance.now();l=t.filter((t=>!1!==t&&void 0!==t)),u=((t,e)=>{const i=t.map((i=>i.apply(t,e))),s=i.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),r=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),n=`vert: ${s} frag: ${r}`;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(h||(o=t.defaultVertexShader)),t.vertexShader){if(o&&h&&o!==t.vertexShader)throw new Zg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,n,t);o=t.vertexShader,h=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(a||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&a&&u!==t.fragmentShader)throw new Zg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,n,t);u=t.fragmentShader,a=!0}if(t.fragmentShaderModifiers)for(const e of t.fragmentShaderModifiers)void 0!==e&&!1!==e&&c.push(e);t.hints&&t.hints.forEach((t=>{t&&d.push(t)}))})),!!t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Lz}))&&("webgl1"===e?l.push(Og("attribute float aInstanceID"),_g("int iInstance = int(aInstanceID)")):l.push(_g("int iInstance = gl_InstanceID"))),!!t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Rz}))&&("webgl1"===e?l.push(Og("attribute float aVertexID"),_g("int iVertex = int(aVertexID)")):l.push(_g("int iVertex = gl_VertexID"))),!o)throw new Zg("No vertex shader template defined",n);if(!u)throw new Zg("Fragment shader not defined",n);return{id:n,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:r,template:u,modifiers:c},hints:d}})(l,a);const A=n.get(u.id);if(c="new",A)return c="existing",g=A.vertexShaderSrc,m=A.fragmentShaderSrc,A;const x=u.vertexShader.id;let S=s.get(x);if(S)g=S.src,d="existing";else{d="new";const t=new Rg(u.vertexShader.modifiers).build(rm[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,y=r,S=new hm(x,e,i,r),s.set(x,S),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)m=b.src,f="existing";else{f="new";const t=nm[v.template],e=new Rg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);m=s,p=n,b=new am(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const C=new lm(S,b,i,u);return n.set(u.id,C),o.programs+=1,o.totalMs+=zt.performance.now()-e,C}catch(t){throw Me(0,(()=>{const t="Unexpected LightningChart JS rendering error.\nThis can mean a bug in the library, or that it is simply used in unsupported manner (passing wrong type to method, using disposed component, etc).";return zt.alert(t),new Error(t)}))}}})(this.gl,!this.PV),this.Cz=(()=>{const t=zt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new Mt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,r,n)=>{const o=`${s.style} ${s.weight} ${s.size*r}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const h=e.measureText(i);if(0===h.width)return;const a=void 0!==h.actualBoundingBoxLeft&&void 0!==h.actualBoundingBoxRight?Math.ceil(h.actualBoundingBoxLeft+h.actualBoundingBoxRight):Math.ceil(h.width),l=h.width,c=Math.round(s.size*r),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",n?(e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff"):(e.fillStyle="rgba(255,255,255,0)",e.fillRect(0,0,t.width,t.height),e.fillStyle="#000"),e.fillText(i,d,c);const f=e.getImageData(0,0,t.width,t.height);let g=0,m=0;const y=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),zt.addEventListener("resize",this.uV,{passive:!0}),!this.PV){if(this.iV=this.VV(sm["2DCompose"],sm.Color({dataType:"texture-coord-calc-gpu"}),sm.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.iV.Gz)throw new Mt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.iV.Gz,"uColorTexture");if(!e)throw new Mt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.iV.Gz,"uMatrix");if(!i)throw new Mt("Unable to setup composition shader! Failed to find uMatrix");this.hV=e,this.rV=i,this.nV=t.getAttribLocation(this.iV.Gz,"aPos"),this.sV=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.sV),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this.eV=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.eV),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,0,0,1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null)}}RV(t){return e=>{this.tV=null;const i=this.gl.canvas,s=Array.from(this.Jz.values());this.oV=!1,s.forEach((s=>{const r=s.pV();(this.Z.x{this.tV=null,"style"in this.gl.canvas&&!this.io.WV&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.vV.clientHeight,r=this.vV.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.xV&&i.height===s*this.xV||(i.width=r*this.xV,i.height=s*this.xV);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.Jz.values());this.oV=!1,h.sort(((t,e)=>t.YV()-e.YV())).forEach((t=>{t.pn&&t.UV(e)})),t(n,o,r,s,h),this.oV&&this.zV()}}zV(t){return pm(this.gl)||(!this.oV&&t&&(this.oV=!0),this.tV||this.ji||(this.tV=zt.requestAnimationFrame(this.LV))),this}HV(t){const e=this.lV();return t.qr.setAttribute("data-lcjs-engine-id",e),this.Qz.set(e,t),t.XV(this.Qz.size-1),t.AV(!0),this.Jz.set(e,t),this.GV&&this.GV.observe(t.qr),this.cV&&clearTimeout(this.cV),this.cV=setTimeout((()=>this.an()),0),this}$V(t){const e=t.qr.getAttribute("data-lcjs-engine-id");return e?(this.Qz.delete(e),this.Jz.delete(e),this.GV&&this.GV.unobserve(t.qr),t.qr.removeAttribute("data-lcjs-engine-id"),this):this}an(){if(this.GV){const t=this.GV.takeRecords();for(let e=0;efunction(t,e){if(t===e)return 0;const i={a:mm(t),b:mm(e)};let s;for(;i.a[i.a.length-1]===i.b[i.b.length-1];)t=i.a.pop(),e=i.b.pop(),s=t;const r=gm(fm(i.a)),n=gm(fm(i.b));if(r===n&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let r=t.length;for(;r--;){const i=t[r];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(r-n)}(t.qr,e.qr))).forEach(((t,e)=>t.XV(e))),this.zV(!0),this}UI(){return this.zV(),this}jV(){this.ji||this.Qz.forEach((t=>t.vp.layout()))}Y(){var t;if(this.ji)return;this.ji=!0,super.Y(),this.tV&&(zt.cancelAnimationFrame(this.tV),this.tV=null),this.oV=!1,this.oo&&(this.oo.disconnect(),this.oo=void 0),this.GV&&(this.GV.disconnect(),this.GV=void 0),zt.removeEventListener("resize",this.uV),this.uV=void 0,this.Qz.forEach((t=>{t.Y()})),this.Qz.clear(),Array.from(this.Kz.values()).forEach((t=>{t.dz(!0)})),this.Kz.clear();const e=this.gl;e.deleteBuffer(this.sV),e.deleteBuffer(this.eV),this.vV&&!this.io.vV?(this.vV.width=1,this.vV.height=1,null===(t=this.vV.parentElement)||void 0===t||t.removeChild(this.vV),this.vV=void 0):this.vV=void 0,this.VV=void 0,this.Cz=void 0,this.LV=()=>{},this.DV.WEBGL_lose_context&&this.DV.WEBGL_lose_context.loseContext()}}const xm=(t,e,i,s)=>r=>{const n={theme:ng,...i,...r},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new gg(o.io,r,o,o.Y.bind(o),h);return o.bo((t=>a.WE(t))).xo((()=>a.J())).Ms(),a},Sm=(t,e)=>{t.bo((t=>{e.ze(t)})).xo((()=>e.J())).Ms()},vm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new ca(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h);return Sm(o,a),a},bm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Dc(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Mm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Pd(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Cm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new jc(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Tm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new(r&&r.type?r.type:Ka)(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},wm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Uf(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Em=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new(r&&r.type?r.type:nd)(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},km=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new(r&&r.type?r.type:Ad)(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Im=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Hl(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r,void 0);return Sm(o,a),a},zm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Dl(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Fm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new hf(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0);return Sm(o,a),a},Rm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Af(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Dm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Vc(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Pm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Gf(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Om=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e?yg(o,s):void 0,a=new lg(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0);return Sm(o,a),a},Lm={translation:(t,e,i)=>[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1],xRotation(t){const e=Math.cos(t),i=Math.sin(t);return[1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1]},yRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1]},zRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1]},scaling:(t,e,i)=>[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1],translate:(t,e,i,s)=>Lm.multiply(t,Lm.translation(e,i,s)),xRotate:(t,e)=>Lm.multiply(t,Lm.xRotation(e)),yRotate:(t,e)=>Lm.multiply(t,Lm.yRotation(e)),zRotate:(t,e)=>Lm.multiply(t,Lm.zRotation(e)),rotateXYZ(t,e){let i=Lm.xRotate(t,e.x);return i=Lm.yRotate(i,e.y),i=Lm.zRotate(i,e.z),i},scale:(t,e,i,s)=>Lm.multiply(t,Lm.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],p=e[15],A=t[0],x=t[1],S=t[2],v=t[3],b=t[4],M=t[5],C=t[6],T=t[7],w=t[8],E=t[9],k=t[10],I=t[11],z=t[12],F=t[13],R=t[14],D=t[15],P=[];return P[0]=i*A+s*b+r*w+n*z,P[1]=i*x+s*M+r*E+n*F,P[2]=i*S+s*C+r*k+n*R,P[3]=i*v+s*T+r*I+n*D,P[4]=o*A+h*b+a*w+l*z,P[5]=o*x+h*M+a*E+l*F,P[6]=o*S+h*C+a*k+l*R,P[7]=o*v+h*T+a*I+l*D,P[8]=u*A+c*b+d*w+f*z,P[9]=u*x+c*M+d*E+f*F,P[10]=u*S+c*C+d*k+f*R,P[11]=u*v+c*T+d*I+f*D,P[12]=g*A+m*b+y*w+p*z,P[13]=g*x+m*M+y*E+p*F,P[14]=g*S+m*C+y*k+p*R,P[15]=g*v+m*T+y*I+p*D,P},inverse(t){const e=[],i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],y=t[14],p=t[15],A=d*p,x=y*f,S=a*p,v=y*l,b=a*f,M=d*l,C=r*p,T=y*n,w=r*f,E=d*n,k=r*l,I=a*n,z=u*m,F=g*c,R=o*m,D=g*h,P=o*c,O=u*h,L=i*m,_=g*s,B=i*c,V=u*s,G=i*h,N=o*s,U=A*h+v*c+b*m-(x*h+S*c+M*m),Y=x*s+C*c+E*m-(A*s+T*c+w*m),H=S*s+T*h+k*m-(v*s+C*h+I*m),X=M*s+w*h+I*c-(b*s+E*h+k*c),W=1/(i*U+o*Y+u*H+g*X);return e[0]=W*U,e[1]=W*Y,e[2]=W*H,e[3]=W*X,e[4]=W*(x*o+S*u+M*g-(A*o+v*u+b*g)),e[5]=W*(A*i+T*u+w*g-(x*i+C*u+E*g)),e[6]=W*(v*i+C*o+I*g-(S*i+T*o+k*g)),e[7]=W*(b*i+E*o+k*u-(M*i+w*o+I*u)),e[8]=W*(z*l+D*f+P*p-(F*l+R*f+O*p)),e[9]=W*(F*n+L*f+V*p-(z*n+_*f+B*p)),e[10]=W*(R*n+_*l+G*p-(D*n+L*l+N*p)),e[11]=W*(O*n+B*l+N*f-(P*n+V*l+G*f)),e[12]=W*(R*d+O*y+F*a-(P*y+z*a+D*d)),e[13]=W*(B*y+z*r+_*d-(L*d+V*y+F*r)),e[14]=W*(L*a+N*y+D*r-(G*y+R*r+_*a)),e[15]=W*(G*d+P*r+V*a-(B*a+N*d+O*r)),e},projectionPerspective(t,e,i,s){const r=1/Math.tan(t*Math.PI/180/2),n=1/(i-s);return[r/e,0,0,0,0,r,0,0,0,0,(i+s)*n,-1,0,0,i*s*n*2,0]},projectionOrthographic:(t,e,i,s,r,n)=>[2/(e-t),0,0,0,0,2/(s-i),0,0,0,0,2/(r-n),0,(t+e)/(t-e),(i+s)/(i-s),(r+n)/(r-n),1],quaternionToRotationMatrix(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]),i=[t[0]/e,t[1]/e,t[2]/e,t[3]/e],s=i[0]+i[0],r=i[1]+i[1],n=i[2]+i[2],o=i[0]*s,h=i[0]*r,a=i[0]*n,l=i[1]*r,u=i[1]*n,c=i[2]*n,d=i[3]*s,f=i[3]*r,g=i[3]*n;return[1-(l+c),h-g,a+f,0,h+g,1-(o+c),u-d,0,a-f,u+d,1-(o+l),0,0,0,0,1]}};function _m(t,i,s,r,n,o){let h=i.x.ft(t.max.x),a=i.x.ft(t.min.x),l=i.y.ft(t.max.y),u=i.y.ft(t.min.y),c=h-a,d=l-u;if(c<1){const t=(a+h)/2;a=t-.5,h=t+.5,c=1}if(d<1){const t=(u+l)/2;u=t-.5,l=t+.5,d=1}const f=c/d,g=c*s.x,m=d*s.y,y=c-g,p=d-m,A=g>y?[y,g]:[g,y],x=m>p?[p,m]:[m,p];let S,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(S=A[0]/c,v=x[0]/d,n===e.GradientShape.circle){const t=Math.min(S*f,v);b=t,M=t}else b=S*f,M=v;break;case e.GradientExtent.farthestSide:if(S=A[1]/c,v=x[1]/d,n===e.GradientShape.circle){const t=Math.max(S*f,v);b=t,M=t}else b=S*f,M=v;break;case e.GradientExtent.closestCorner:if(v=x[0]/d,n===e.GradientShape.circle){S=A[0]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=A[0]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=x[1]/d,n===e.GradientShape.circle){S=A[1]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=A[1]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(b,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Bm(t,e,i,s){const r=e.x.ft(t.max.x),n=e.x.ft(t.min.x),o=e.y.ft(t.max.y),h=e.y.ft(t.min.y),a=r-n,l=o-h,c=Math.abs(a*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(a/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(a/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[n*s,h*s,a*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class Vm{constructor(t){this.lz=t}}class Gm{constructor(){this.ZV=new Array,this.QV=t=>(this.ZV.push(t),t),this.JV=this.QV(new Map),this.KV=this.QV(new Map),this.qV=this.QV(new Map),this.tO=this.QV(new Map),this.iO=this.QV(new Map),this.sO=this.QV(new Map),this.eO=this.QV(new Map),this.hO=this.QV(new Map)}rO(){this.ZV.forEach((t=>{t.forEach((t=>t.rO())),t.clear()}))}}const Nm=(t,e,i)=>()=>{t.nO=e,i&&i()},Um=(t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,y=1;switch(n){case e.ImageFitMode.Fill:u{this.cO=!0,this.pO()})),this.yc.addEventListener("error",(()=>{this.dO=!0})),this.yc.complete&&(this.cO=!0,this.pO());else if(this.yc instanceof zt.HTMLVideoElement){const t=this;this.yc.addEventListener("canplay",(function(){t.aO=this.videoHeight,t.oO=this.videoWidth,t.cO=!0,t.pO()}),!0),this.yc.addEventListener("play",Nm(this,!0,(()=>this.pO()))),this.yc.addEventListener("playing",Nm(this,!0,(()=>this.pO()))),this.yc.addEventListener("pause",Nm(this,!1)),this.yc.addEventListener("ended",Nm(this,!1)),this.yc.readyState>=1&&(this.oO=this.yc.videoWidth,this.aO=this.yc.videoHeight,this.nO=!this.yc.paused,this.cO=!0,this.pO())}else this.cO=!0,this.pO()}bz(t){0===this.AO.size&&this.cO&&this.pO(),this.AO.add(t)}Mz(t){this.AO.delete(t),0===this.AO.size&&this.unbindResources()}yO(t){this.fO.add(t),this.uO&&(t(),this.mO(t))}mO(t){this.fO.delete(t)}pO(){if(this.dO||this.uO||!this.cO)return;const t=this.Nz.gl;if(!this.gO&&this.yc&&t){this.gO=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.gO),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.yc,o=this.oO>0?this.oO:n.width,h=this.aO>0?this.aO:n.height;t.texImage2D(t.TEXTURE_2D,e,i,s,r,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.oO=o,this.aO=h,t.bindTexture(t.TEXTURE_2D,null)}this.uO=!0,this.fO&&this.fO.forEach((t=>{t(),this.mO(t)}))}Os(){const t=this.Nz.gl;if(!this.dO&&this.uO&&this.gO){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.yc;n&&(t.bindTexture(t.TEXTURE_2D,this.gO),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}vO(){return this.gO}unbindResources(){return this.uO&&(this.gO&&(this.Nz.fz(this.gO),this.gO=null),this.uO=!1),this}}class Hm extends hn{constructor(t,e,i){super(t.cs,e,i),this.mv=!0,this.uv={},this.gv=p(oo),this.Rs=t,this.At=t.At}SO(){var t;return this.gv.u&&this.gv.C().type!==(null===(t=this.xO)||void 0===t?void 0:t.type)}wv(t){return this.mv=t,this}bO(t){return this.uv=t,this}}class Xm{constructor(t){this.ZO=[],this.lz=t}QO(t,e){((t,e,i,s)=>{const r=t.MO(),n=Math.round(Math.min(i.spread,10)*r),o=Math.round(Math.min(i.blur,10)*r),h={x:Math.round(i.offset.x*r),y:Math.round(i.offset.y*r)},a=t._O(),l=t.wO(),u=t.CO(),c=t.kO(),d=t.TO();t.FO("disabled"),t.wv(!1),t.IO(!1);const f=e.PO(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.MO(),o=t.DO();t.BO(r.FRAMEBUFFER,s.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,s.depthBuffer),r.bindTexture(r.TEXTURE_2D,s.texture),r.clearDepth(1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);const h=s.sizeDpr;t.LO(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof ln?s=e.Yi||e.Rs.Op():e instanceof Hm&&(s=e.Rs._x()),s){const e=s.x+i.left,r=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),h=Math.max(s.height-(i.bottom+i.top),0);t.RO(e*n,r*n,o*n,h*n)}else t.IO(!1);e.WE(2,0)})),t.BO(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.IO(!1)})(t,s,{left:g+(h.x<0?-h.x:0),top:g+(h.y>0?h.y:0),right:g+(h.x>0?h.x:0),bottom:g+(h.y<0?-h.y:0)},f);let m=f;const y=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;i$e(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=hi(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof ln||t instanceof Hm?t.Rs.EO(t):Xe;if(Te(e))return Xe;const r={min:{x:Math.max(e.min.x-i.left,0),y:Math.max(e.min.y-i.bottom,0)},max:{x:Math.min(e.max.x+i.right,s.x),y:Math.min(e.max.y+i.top,s.y)}};return r.max.x<=r.min.x||r.max.y<=r.min.y?Xe:r})).filter((t=>!Te(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=xi(t.min,s),i=xi(t.max,s),r=e,n=i;o[h+0]=e.x,o[h+1]=e.y,o[h+2]=r.x,o[h+3]=r.y,o[h+4]=i.x,o[h+5]=e.y,o[h+6]=n.x,o[h+7]=r.y,o[h+8]=i.x,o[h+9]=i.y,o[h+10]=n.x,o[h+11]=n.y,o[h+12]=i.x,o[h+13]=i.y,o[h+14]=n.x,o[h+15]=n.y,o[h+16]=e.x,o[h+17]=i.y,o[h+18]=r.x,o[h+19]=n.y,o[h+20]=e.x,o[h+21]=e.y,o[h+22]=r.x,o[h+23]=r.y,h+=24})),{vertexBuffer:t.zO(o),vertexCount:n}})(t,s,{left:y+(h.x<0?-h.x:0),top:y+(h.y>0?h.y:0),right:y+(h.x>0?h.x:0),bottom:y+(h.y<0?-h.y:0)},e.VO()),A=e.PO(f,m),x=t.VV(sm["2D"],sm.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl,h=t.DO();t.BO(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearDepth(1),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.LO(0,0,i.sizeDpr.x,i.sizeDpr.y),t.OO(s,((h,a,l,u)=>(t.bz(s),n&&n(h),t.WO(h("uIsHighlighted"),0).iL(h("uHighlightColorOffset"),k).WO(h("uRenderEffectMask"),0).UO(h("uTexture"),e.texture,0).GO(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GO(h("uScale"),i.uniforms.YO()).GO(h("uDisp"),i.uniforms.HO()).GO(h("uScaling"),[i.size.x,i.size.y]).GO(h("uTranslationAxis"),[0,0]).NO(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).om(o.TRIANGLES,r.vertexCount,0),!0))),t.BO(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,A,x,p,((e,i,s,r)=>(t.GO(e("uOffsetPx"),[h.x,h.y]),!0))),m=A,t.IO(l),t.XO(d);const S=t.VV(sm["2D"],sm.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r)=>{const n=t.gl,o={x:t.cs.oi().x,y:t.cs.oi().y};t.LO(0,0,o.x*t.MO(),o.y*t.MO());const h=gt.d2({scaleXYConstructor:Yi}).it(o).Vi(0,o.x).Oi(0,o.y),a=new $m;a.$O(h),t.OO(i,((h,l,u,c)=>(t.bz(i),r&&r(h),t.WO(h("uIsHighlighted"),0).iL(h("uHighlightColorOffset"),k).WO(h("uRenderEffectMask"),0).UO(h("uTexture"),e.texture,0).GO(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GO(h("uScale"),a.YO()).GO(h("uDisp"),a.HO()).GO(h("uScaling"),[o.x,o.y]).GO(h("uTranslationAxis"),[0,0]).NO(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).om(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.UO(e("uTextureFirstGlowPass"),A.texture,1).iL(e("uGlowColor"),i.color),!0))),t.LO(a.x,a.y,a.width,a.height),t.FO(u),t.wv(c),t.jO(p.vertexBuffer)})(this.lz,this,e,t)}VO(){const t=this.lz.cs.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}PO(...t){const e=this.ZO,i=this.VO(),s={x:Math.ceil(i.x*this.lz.MO()),y:Math.ceil(i.y*this.lz.MO())},r=this.lz.gl,n=e.find((e=>!t.includes(e)));if(n)return n.sizeDpr.x===s.x&&n.sizeDpr.y===s.y||(n.size=i,n.sizeDpr=s,r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindRenderbuffer(r.RENDERBUFFER,n.depthBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),n.scale.it(i).Vi(0,i.x).Oi(0,i.y),n.uniforms.$O(n.scale)),n;const o=r.createTexture(),h=this.lz.JO(),a=this.lz.KO();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.lz.DO();this.lz.BO(r.FRAMEBUFFER,h),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0),r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a),r.bindTexture(r.TEXTURE_2D,null),this.lz.BO(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=gt.d2({scaleXYConstructor:Yi}).it(i).Vi(0,i.x).Oi(0,i.y),c=new $m;c.$O(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}Y(){[this.ZO].forEach((t=>{t.forEach((t=>{this.lz.qO(t.depthBuffer),this.lz.tN(t.frameBuffer),this.lz.fz(t.texture)})),t.length=0}))}}class Wm{constructor(t,i,s,r,n=!0){this.iN=new Gm,this.sN=new Map,this.eN=new Map,this.hN=[],this.wV=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(zt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.mv=!1,this.GO=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.rN=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.nN=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.oN=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.aN=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.lN=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.iL=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.WO=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.uN=(t,e)=>(this.gl.uniform1i(t,e),this),this.UO=(t,e,i)=>{if(void 0===t)return this;if(e){const s=this.gl.TEXTURE0+i;return this.gl.activeTexture(s),this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.uniform1i(t,i),this}throw new Mt("Could not bind a texture.")},this.cN=t=>(((t,i)=>{i===e.ImageFitMode.Tile?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE))})(this.gl,t),this),this.zO=(t,e=!1,i,s=Float32Array)=>{const r=t.length,n=this.dN(r,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof s?t:new s(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new Mt("Could not create vertex buffer")},this.fN=(t,e,i,s=Float32Array)=>{const r=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),e&&e.length===t?this.gl.bufferData(this.gl.ARRAY_BUFFER,e instanceof s?e:new s(e),this.gl.STATIC_DRAW):(this.gl.bufferData(this.gl.ARRAY_BUFFER,new s(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof s?e:new s(e))),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new Mt("Could not create vertex buffer")},this.AN=(t,e,i,s=Float32Array)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*s.BYTES_PER_ELEMENT,i instanceof s?i:new s(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.gN=(t,e,i,s,r)=>{if(s&&t&&(t.usedSize=0),!t){const t=e.length+i,s=new r(t);return s.set(e),{buffer:this.fN(t,s,void 0,r),dataCache:s,preallocSize:t,usedSize:e.length}}if(t.usedSize+e.length>t.preallocSize){const s=t.usedSize+e.length+i,n=new r(s);return n.set(t.dataCache),n.set(e,t.usedSize),{buffer:this.fN(s,n,t.buffer,r),dataCache:n,preallocSize:s,usedSize:t.usedSize+e.length}}return t.dataCache.set(e,t.usedSize),this.AN(t.buffer,t.usedSize,e,r),t.usedSize+=e.length,t},this.pN=(t,e,i=!1)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,i?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.yN=(t,e)=>{const i=t.length,s=this.dN(i,e);if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new Mt("Could not create index buffer")},this.mN=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new Mt("Could not create float buffer")},this.vN=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,2,this.gl.FLOAT,!1,0,0)),this),this.SN=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,3,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t)),this),this.NO=(t,e,...i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);const s=i.length;let r=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let n=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),n+=e.size}if(void 0!==e)for(let t=0;t-1&&this.xN(s,e)}return this},this.bN=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.MN=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,0,0)),this),this._N=(t,e,i)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t),void 0!==i&&this.xN(t,i)),this),this.wN=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.CN=null,this.om=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.kN=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.TN=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.DV.ANGLE_instanced_arrays)return zt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.DV.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.FN=(t,e,i,s,r=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,r,i,s),this.gl1)){if(!this.gl1.DV.ANGLE_instanced_arrays)return zt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.DV.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.xN=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.DV.ANGLE_instanced_arrays)return zt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.DV.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.IN=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=this.DO();this.BO(this.gl.FRAMEBUFFER,e),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,i,0);const o=this.wO();o&&this.IO(!1),t(),o&&this.IO(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.BO(this.gl.FRAMEBUFFER,n)},this.Ot=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.PN=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.bz=t=>(this.gl.useProgram(t.Gz),this),this.DN=!1,this.LN=[],this.cs=t,this.CA=i,this.cs=t,this.gl=s.ctx,this.RN=s.antialias,this.EN=!!this.cs.ln.qz&&s.lineAntialias,this.BV=this.cs.ln.BV,this.zN=new Map,this.gl1=this.cs.ln.gl1,this.gl2=this.cs.ln.gl2,n&&(this.XO(!0),this.VN()),this.DV=this.cs.ln.DV,this.cz=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.yz=this.ON(),this.VV=this.cs.ln.VV,this.NN=new qm(this),this.Cz=this.cs.ln.Cz,this.GN=new Xm(this),this.Kz=this.cs.ln.Kz,this.UN=this.zO([0,0,1,0,1,1,0,1]),this.WN=this.zO([0,0,1,0,0,1,0,1,1,0,1,1])}FO(t){return t!==this.YN&&(this.YN=t,"disabled"===t?this.gl.disable(this.gl.CULL_FACE):"cull-back"===t?(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)):"cull-front"===t&&(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.FRONT))),this}CO(){return this.YN||"disabled"}wv(t){return t!==this.mv&&(this.mv=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}kO(){return this.mv}HN(t){return this.wV=t,this}MO(){return this.wV}dN(t,e){let i;if(e){const s=this.zN.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.jO(e)}return i||(i=this.gl.createBuffer(),this.zN.set(i,{size:t})),i}XN(t,e=this.gl.RGBA,i=!1,s,r,n=!1,o=this.gl.UNSIGNED_BYTE,h=e){const a=this.gl.createTexture();if(!a)throw new Mt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),t&&null===r?this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,e,o,t):r&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,r.x,r.y,0,e,o,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),i?(this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR),this.gl.generateMipmap(this.gl.TEXTURE_2D)):this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),a}fz(t){this.gl.deleteTexture(t)}JO(){const t=this.gl.createFramebuffer();if(!t)throw new Mt("Couldn't reserve Framebuffer.");return t}BO(t,e){this.CN=e,this.gl.bindFramebuffer(t,e)}DO(){return this.CN}tN(t){this.gl.deleteFramebuffer(t)}KO(){const t=this.gl.createRenderbuffer();if(!t)throw new Mt("Couldn't reserve Render buffer.");return t}qO(t){this.gl.deleteRenderbuffer(t)}LO(t,e,i,s){return this.gl.viewport(t,e,i,s),this.$N&&t===this.$N.x&&e===this.$N.y&&i===this.$N.width&&s===this.$N.height||(this.$N={x:t,y:e,width:i,height:s}),this}_O(){return this.$N||{x:0,y:0,width:0,height:0}}RO(t,e,i,s){return this.IO(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}IO(t){return t===this.jN||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.jN=t),this}XO(t){return t!==this.DN&&(this.DN=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}TO(){return this.DN}VN(t,e,i,s){return t?(void 0!==t&&void 0!==e&&(void 0!==i&&void 0!==s?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e)),this):(this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA),this)}wO(){return void 0!==this.jN&&this.jN}OO(t,e){const i=new Km(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}jO(t){t&&(this.gl.deleteBuffer(t),this.zN.delete(t))}ZN(t,e,i){this.GO(t.uniform("uCenter"),e.center).GO(t.uniform("uDistance"),e.distance).nN(t.uniform("uBounds"),e.bounds).WO(t.uniform("uAspect"),e.aspectRatio);const s=i.getColorStops();if(s.length<2)throw new Error("Minimum two color stops required");for(let e=0;e=t)return this.sG.buffer;this.sG&&(this.jO(this.sG.buffer),this.sG=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.LN.splice(this.LN.indexOf(l),1)}))}aG(t,e,i,s,r,n,o,h){const a=this.gl,l=this.DO();this.BO(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.BO(this.gl.FRAMEBUFFER,l)}lG(t){const e=this.eN.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new Mt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let r=255;for(let e=0;e{t-=1;for(let e=1;e<32;e<<=1)t|=t>>1;return t+1})(s.length);for(let e=s.length;e{})),this;this.WO(s("uMinValue"),i.min),this.WO(s("uMaxValue"),i.max)}return this}AG(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.yc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.zO(o(t.texture.oO,t.texture.aO,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.Mz(t),this.jO(i.texCoordsBuffer));const r=this.JN(h);r.bz(t);const n=s?s.getSourceMissingColor():Gs.color;e={texture:r,source:h,texCoordsBuffer:this.zO([]),sourceMissingTexture:this.XN(new Uint8Array([n.getR(),n.getG(),n.getB(),n.getA()]),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{e&&h&&(l(e),this.cs.Ms())}},r.yO(e.textureReadyCallback),l(e)}return e&&e.texture.uO&&e.texture.lO&&e.texture.nO&&(e.texture.Os(),this.cs.Ms()),n&&e&&e.texture.uO&&l(e),e}i&&this.gG(t,i)}gG(t,e){e&&(e.texture.Mz(t),e.texture.mO(e.textureReadyCallback),this.fz(e.sourceMissingTexture),this.jO(e.texCoordsBuffer))}pG(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.At,a=this.MO();this.WO(r("uIsHighlighted"),1===e||2===e?0:i.jo).iL(r("uHighlightColorOffset"),1===e||2===e?I:i.Ko).WO(r("uRenderEffectMask"),2===e?1:0).GO(n("uRatioPxClip"),[2/this.cs.oi().x,2/this.cs.oi().y]).WO(n("uDevicePixelRatio"),a),h instanceof Yi||h instanceof Wc?this.GO(r("uScale"),s.uniforms.YO()).GO(r("uDisp"),s.uniforms.HO()).GO(n("uScaleStart_highpart"),s.uniforms.yG()).GO(n("uScaleStart_lowpart"),s.uniforms.mG()):h instanceof Hi&&this.GO(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).GO(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).GO(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).GO(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).GO(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).GO(r("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const l=!0===s.coordsHighPrecision;if(s.coordsX)if(l){const t=o("aPos_highpartX"),e=o("aPos_lowpartX");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsX),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this._N(o("aPosX"),s.coordsX);if(s.coordsY)if(l){const t=o("aPos_highpartY"),e=o("aPos_lowpartY");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsY),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this._N(o("aPosY"),s.coordsY);if(1===e)this.uN(r("uFirstId"),s.idFirst);else{if(s.fillStyleSolid&&this.iL(r("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this._N(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.xN(t,s.lookupValueAttribDivisor)}this.fG(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.QN(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.ZN(t,s.radialGradientInfo,s.fillStyleRadialGradient)}if(s.fillStyleIndividual&&null!==s.colorBuffer){if(!s.colorBuffer)return!1;const t=o("aColor");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.colorBuffer),this.gl.vertexAttribPointer(t,4,this.gl.UNSIGNED_BYTE,!0,0,0),this.gl.enableVertexAttribArray(t),void 0!==s.colorAttribDivisor&&this.xN(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.vO();this.iL(n("uColor"),s.fillStyleImage.getSurroundingColor()).UO(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).NO(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).cN(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.vO();this.UO(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).NO(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return void 0!==s.useInstanceID&&this.nG(t,s.useInstanceID),void 0!==s.useVertexID&&this.hG(t,s.useVertexID),!0}vG(t,e,i){if(t)return Bm(i||e.ea(),e.At,t.getAngle(!0),this.MO())}SG(t,e,i){if(t)return _m(i||e.ea(),e.At,t.getPosition(),t.getExtent(),t.getShape(),this.MO())}}const jm=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void zt.setTimeout(o,r)};zt.setTimeout(o,0)}))})(t,h,{retryTimeout:10}).then((()=>(t.deleteSync(h),t.bindBuffer(e,i),t.getBufferSubData(e,s,r,n,o),t.bindBuffer(e,null),r))).catch((t=>{throw t}))};class $m{$O(t){if(t instanceof Yi||t instanceof Wc){const e=t.mi();this.xG=e.x.scaling,this.bG=-e.x.displacement,this.MG=e.y.scaling,this._G=-e.y.displacement;const i=Math.fround(e.x.highPrecisionOffset),s=Math.fround(e.y.highPrecisionOffset);this.wG=i,this.CG=e.x.highPrecisionOffset-i,this.kG=s,this.TG=e.y.highPrecisionOffset-s}else t instanceof Hi&&(this.MixedScaleXY=t.mi());return this}HO(){return[this.bG,this._G]}YO(){return[this.xG,this.MG]}yG(){return[this.wG,this.kG]}mG(){return[this.CG,this.TG]}}class Zm{constructor(){this.xG=0,this.MG=0,this.FG=0,this.bG=0,this._G=0,this.IG=0}PG(t){return this.xG=t.rt(),this.bG=t.getInnerStart()+.5*this.xG*t.nt(),this}DG(t){return this.MG=t.rt(),this._G=t.getInnerStart()+.5*this.MG*t.nt(),this}BG(t){return this.FG=t.rt(),this.IG=t.getInnerStart()+.5*this.FG*t.nt(),this}YO(){return[this.xG,this.MG,this.FG]}HO(){return[this.bG,this._G,this.IG]}LG(t,e,i,s,r){const n=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=Lm.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class qm{constructor(t){this.lz=t}WE(t,e,i,s,r,n=0){const o=this.lz,h=void 0===s;if(!(s=s||o.JO()))throw new Mt("Could not bind a framebuffer.");const a=o._O(),l=o.TO();o.XO(!1),o.IN((()=>{o.LO(0,0,i.x,i.y),t()}),s,e,n),h&&o.tN(s),this.lz.PN(r),this.lz.LO(a.x,a.y,a.width,a.height),o.XO(l)}}class Km{constructor(t,e){this.EG=[],this.zG=[],this.uniform=t=>{const e=this.shader.Xz(t);return this.zG.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.$z(t);return this.zG.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.jz(t);return this.EG.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.EG)this.glUtils.bN(t.location),this.glUtils.xN(t.location,0)}}class Jm extends ln{constructor(t,e,i,s,r){super(t,e,i,s),this.VG=new Map,this.OG=t,this.NG=e,this.lz=t.GG(),this.UG=r,this.NG=e}dz(){return this}WE(t,e){if(!this.UG||0!==t||0===this.VG.size)return{};const i=Array.from(this.VG.values()).map((t=>t.WG.filter((t=>t.YG)).map((t=>t.ss)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===i.length)return{};const s=this.UG;return this.lz.GN.QO(i,s),{}}HG(t,e,i,s,r){return{}}Os(){return this}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Pl(){return 0}Dl(){return 0}rs(t,e){const i={WG:[]},s=(t,e)=>{const s={ss:t||[],YG:void 0===e||e};i.WG.push(s);const r={gs:t=>(s.ss=t,r),bs:t=>(s.YG=t,r),_s:()=>s.YG};return r},r={};Object.keys(e).forEach((t=>{const i=e[t],n=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,h=s(n,o);r[t]=h}));const n={Bg:s,...r};this.VG.set(t,i);const o=t.onDispose((()=>{this.VG.delete(t),t.offDispose(o)}));return n}}function Qm(t,e,i,s,r,n=Math.floor(Math.sqrt(s>r?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]}const ty=(t,e,i)=>((t,e,i)=>{const s=[];let r=0;const n=mi(e,i/2);let o,h,a,l,c=t[t.length-1],d=0;for(let i=0;i0&&(c=t[i-1]),Ft(o,c)&&(c=yi(o,di(mi(pi(h,o),-1)))),Ft(o,h)&&(h=yi(o,di(mi(pi(c,o),-1))));const f=xi(c,e),g=xi(o,e),m=xi(h,e),y=di(pi(g,f)),p=di(pi(m,g)),A=yi(y,p),x=u(-A.y,A.x),S=u(-y.y,y.x),v=1/vi(x,S),b=gi(x),M=di(pi(y,p)),C=Math.sign(vi(x,M))||1,T=Ai(x,mi(n,v)),w=Ai(x,mi(n,-v));if(b<1||v===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},a={x:0,y:0};const l=u(-p.y,p.x),f=Math.sign(vi(y,x))||C,g=Ai(S,mi(n,f)),m=Ai(l,mi(n,f));1===C?(t=g,e=w,i=m,a=w):(t=T,e=g,i=T,a=m);const A=4*ei(c,o),b=4*ei(o,h);(v>A||v>b)&&(1===C?(t=g,e=m,i=m,a=g):(t=m,e=g,i=g,a=m));const M=yi(o,t),E=yi(o,e),k=yi(o,i),I=yi(o,a);s[r]=M,r+=1,s[r]=E,r+=1,s[r]=k,r+=1,s[r]=I,r+=1,d=4}else{const t=yi(o,T),e=yi(o,w);s[r]=t,r+=1,s[r]=e,r+=1,d=2}l=a,a=t[i]}return s[r]=s[0],r+=1,s[r]=s[1],r+=1,[s,d,[l,a]]})(t,e,i)[0];class ey extends Cn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.XG=Xe,this.$G=Xe,this.jG=Eg({arcStyleSolid:()=>U(this.Ie)&&this.Ie,arcStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,arcStyleLinearGradient:()=>at(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG()}ZG(t,e){let i=0,s=Array(0),r=0;if(void 0!==e){const r=t.length,n=Array(r+e.length);let o=0,h=0;for(;o0?Qm(this.Ma.C(),this.Kl.C(),this.Fi.C(),this.ql.C()*l/100,this.tu.C()*l/100,a)[0]:[this.Ma.C()],d=h.length-1;if(2===d){const t=(h[d-1].x+h[1].x)/2,e=(h[d-1].y+h[1].y)/2;this.eu=u(t,e)}else{const t=Math.floor(d/2);this.eu=u(h[t].x,h[t].y)}this.hu=h[1];const f=h.length-1;this.ru=h[f],this.iu.C()&&(h.shift(),c.shift());let g=!1;(this.Ma.u||this.Kl.u||this.Fi.u||this.ql.u||this.tu.u||this.iu.u||this.su.u||s)&&(this.$G=m(u(this.Ua().x-n,this.Ua().y-o),u(this.Ua().x+n,this.Ua().y+o)),g=!0,this.Ma.u=!1,this.Kl.u=!1,this.Fi.u=!1,this.ql.u=!1,this.tu.u=!1,this.iu.u=!1,this.su.u=!1);const y=this.fa();(g||y)&&this.Ie!==_&&(this.iu.C()?(this.JG&&this.lz.jO(this.JG),[this.KG,this.JG,this.qG,this.tU]=this.ZG(h,c)):(this.JG&&this.lz.jO(this.JG),[this.KG,this.JG,this.qG,this.tU]=this.ZG(h,void 0)),nt(this.Ie)?this.iU=_m(this.$G,this.At,this.Ie.getPosition(),this.Ie.getExtent(),this.Ie.getShape(),this.lz.MO()):at(this.Ie)?this.sU=Bm(this.$G,this.At,this.Ie.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0));const p=this.jG.arcStyleSolid(y),A=this.jG.arcStyleLinearGradient(y),x=this.jG.arcStyleRadialGradient(y),S=p||A||x;y&&(this.eU=S?this.lz.VV(sm["2D"],sm.Color({dataType:nt(this.Ie)||at(this.Ie)?["gradient",this.Ie]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.ya(this.Ie));const v=this.Pe;if(cs(v)&&(g||this.Sa(v.getThickness())||s)){this.iu.C()?360===i?(h.pop(),c.pop(),[this.hU,this.rU]=this.QG(h,void 0,v.getThickness(),r),this.nU&&this.hU?this.lz.pN(this.nU,this.hU,!0):!this.nU&&this.hU?this.nU=this.lz.zO(this.hU,!0):this.nU&&!this.hU&&(this.lz.jO(this.nU),this.nU=void 0),[this.oU,this.aU]=this.QG(c,void 0,v.getThickness(),r),this.lU&&this.oU?this.lz.pN(this.lU,this.oU,!0):!this.lU&&this.oU?this.lU=this.lz.zO(this.oU,!0):this.lU&&!this.oU&&(this.lz.jO(this.lU),this.lU=void 0)):([this.hU,this.rU]=this.QG(h,c,v.getThickness(),r),this.nU&&this.hU?this.lz.pN(this.nU,this.hU,!0):!this.nU&&this.hU?this.nU=this.lz.zO(this.hU,!0):this.nU&&!this.hU&&(this.lz.jO(this.nU),this.nU=void 0),this.oU&&(this.lU&&this.lz.jO(this.lU),this.lU=void 0,this.aU=0)):(360===i&&(h.shift(),h.pop()),[this.hU,this.rU]=this.QG(h,void 0,v.getThickness(),r),this.nU&&this.hU?this.lz.pN(this.nU,this.hU,!0):!this.nU&&this.hU?this.nU=this.lz.zO(this.hU,!0):this.nU&&!this.hU&&(this.lz.jO(this.nU),this.nU=void 0));const t=v.getFillStyle();nt(t)?this.uU=_m(this.$G,this.At,t.getPosition(),t.getExtent(),t.getShape(),this.lz.MO()):at(t)?this.cU=Bm(this.$G,this.At,t.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),this.dU=t===_?void 0:this.lz.VV(sm["2D"],sm.Color({dataType:nt(t)||at(t)?["gradient",t]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})),this.xa(v)}if(g){let t=1,e=1;cs(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.XG=m(u(this.$G.min.x-t,this.$G.min.y-e),u(this.$G.max.x+t,this.$G.max.y+e))}this.fU=e&&S?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.AU=e&&this.Pe!==ut?this.AU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0}return this}WE(t,e){if(this.pa()){const i=1===t?this.fU:this.eU,s=this.Ie,r=this.JG;i&&r&&this.lz.bz(i).OO(i,((i,n,o,h)=>{if(this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(h("uScaleStart_highpart"),this.Vz.yG()).GO(h("uScaleStart_lowpart"),this.Vz.mG()).qN(o,r,this.At._i(),void 0).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t)this.lz.uN(i("uFirstId"),e).nG(o,1);else if(U(s))this.lz.iL(i("uColor"),s.getColor());else if(nt(s)){if(!this.iU)return!1;this.lz.ZN(o,this.iU,s)}else if(at(s)){if(!this.sU)return!1;this.lz.QN(o,this.sU,s)}return this.lz.om(this.tU,this.qG),!0}));const n=this.Pe;cs(n)&&(void 0!==this.nU&&this.gU(t,this.nU,this.rU,n,e),void 0!==this.lU&&this.gU(t,this.lU,this.aU,n,e))}return{idCount:1}}HG(t,e,i,s,r){return{}}gU(t,e,i,s,r){const n=1===t?this.AU:this.dU,o=s.getFillStyle();n&&this.lz.bz(n).OO(n,((n,h,a,l)=>{if(this.lz.GO(n("uScale"),this.Vz.YO()).GO(n("uDisp"),this.Vz.HO()).qN(a,e,this.At._i(),void 0).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),1===t)this.lz.uN(n("uFirstId"),r).nG(a,1);else if(U(o))this.lz.iL(n("uColor"),o.getColor());else if(nt(o)){if(!this.uU)return!1;this.lz.ZN(a,this.uU,o)}else if(at(o)){if(!this.cU)return!1;this.lz.QN(a,this.cU,o)}const u=s.getThickness(),c=-1===u||1===u;return this.lz.om(c?this.lz.gl.LINE_LOOP:this.lz.gl.TRIANGLE_STRIP,i),!0}))}dz(){return this.pU&&(this.lz.jO(this.pU),this.pU=void 0),this.yU&&(this.lz.jO(this.yU),this.yU=void 0),this.JG&&(this.lz.jO(this.JG),this.JG=void 0),this.nU&&(this.lz.jO(this.nU),this.nU=void 0),this.lU&&(this.lz.jO(this.lU),this.lU=void 0),this.eU=void 0,this.dU=void 0,this.fU=void 0,this.AU=void 0,this}St(){return this.$G.max.x}vt(){return this.$G.min.x}bt(){return this.$G.max.y}xt(){return this.$G.min.y}Pl(){return Re(this.Pe)}Dl(){return Re(this.Pe)}}class iy{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}mU(t){return this.first=t,this.second=t+1,this.third=t+2,this.fourth=t+3,this.fifth=t+4,this.sixth=t+5,t+=6,this}vU(){return this.first=this.second,this.second=this.third,this.third=this.fourth,this.fourth=this.fifth,this.fifth=this.sixth,this.sixth+=1,this}SU(){return this.first=this.third,this.second=this.fourth,this.third=this.fifth,this.fourth=this.sixth,this.fifth=this.fourth+1,this.sixth=this.fifth+1,this}xU(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.vU(),this}bU(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.third,e[i+2]=this.second,e[i+3]=this.third,e[i+4]=this.fourth,e[i+5]=this.second,i+=6,t.position=i,t.next&&this.SU(),this}MU(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new iy).mU(t))(),ry=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||sy.vU(),n.push(t,e),r.push(sy.first,sy.second,sy.third),h=void 0,o=void 0,r.push(sy.third,sy.fourth,sy.second),a=sy.third,sy.SU(),l&&n.push(i,s),[o,h,a]),ny=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||sy.vU(),o.push(t,e),r.push(sy.first,sy.second,sy.third);const c=Ei(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(sy.third,sy.fourth,sy.fifth),l=sy.fourth),sy.SU(),u&&o.push(i,s),[h,a,l]},oy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||sy.vU(),r.push(t,e),s.push(sy.first,sy.second,sy.third),n=i,o=void 0,h=sy.third,l?r.push(i):a=!0,[n,o,h,a]),hy=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||sy.vU(),sy.vU()):a>0&&(sy.vU(),u>0&&(u-=1)),n.push(t),r.push(sy.first,sy.second,sy.third),a=sy.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),ay=(t,e=0)=>{sy.mU(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],y=!1,p=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=ry(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=ny(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,y]=oy(g,m,d,o,h,a,l,u,y,t):d.y===f.y?(a=g,y&&(h.push(g),y=!1,sy.vU()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=hy(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=hy(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class ly extends Mn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.wU=0,this.Ka=Array(),this.CU=0,this.kU=new Uint16Array(0),this.TU=new Uint16Array(0),this.jG=Eg({hightFillSolid:()=>U(this.Ie)&&this.Ie,hightFillRadialGradient:()=>nt(this.Ie)&&this.Ie,hightFillLinearGradient:()=>at(this.Ie)&&this.Ie,hightFillPaletted:()=>j(this.Ie)&&this.Ie,lowFillSolid:()=>U(this.Ol)&&this.Ol,lowFillRadialGradient:()=>nt(this.Ol)&&this.Ol,lowFillLinearGradient:()=>at(this.Ol)&&this.Ol,lowFillPaletted:()=>j(this.Ol)&&this.Ol}),this.OG=t,this.NG=e,this.lz=t.GG()}Os(){const t=this.ga(),e=this.Yo.C(),i=this.al;if(this.pa()){this.Vz.$O(this.At);const s=this.At instanceof Hi==0,r=s?this.At.Ui():void 0,n=this.Wl(),o=this.At.Ni()||t,h=i||this.Rl.u||o&&"disabled"!==n.type;if(h){if(this.wU=0,this.kU=new Uint16Array(0),this.TU=new Uint16Array(0),this.Ka.length=0,this.CU=0,this.El>1){const[t,e,i,o]=ay([s?n.packager(this.Bl,r,.5):this.Bl,s?n.packager(this.Ll,r,.5):this.Ll]);this.wU=o,this.kU=e,this.TU=i,this.Ka=t,this.CU=t.length}this.Rl.u=!1}if(this.Vl&&this.rl[0].length>1){const[t,e]=this.rl,i=t.length,[o,h,a,l,u]=ay([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.wU);this.wU=l;const c=o.length;for(let t=u;t0||this.El>0?1:u;s{if(this.lz.qN(h,i,this.At._i(),void 0).wN(n).WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(r("uScale"),this.Vz.YO()).GO(r("uDisp"),this.Vz.HO()).GO(a("uScaleStart_highpart"),this.Vz.yG()).GO(a("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(a("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(a("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(a("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(a("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(r("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(r("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(r("uFirstId"),e).nG(h,1);else if(U(s))this.lz.iL(r("uColor"),s.getColor());else if(nt(s)){if(!this.PU)return!1;this.lz.ZN(h,this.PU,s)}else if(at(s)){if(!this.DU)return!1;this.lz.QN(h,this.DU,s)}else if(j(s)){const t=kg(s,this,void 0);if(!t&&s.lut.percentageValues)return!1;this.lz.fG(h,s.lut,t)}return this.lz.kN(this.zU),!0}))}const n=1===t?this.fU:this.FU;if(n&&this.BU&&this.LU){const s=this.BU,r=this.LU;this.lz.bz(n).OO(n,((n,o,h,a)=>{if(this.lz.qN(h,s,this.At._i(),void 0).wN(r).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(n("uScale"),this.Vz.YO()).GO(n("uDisp"),this.Vz.HO()).GO(a("uScaleStart_highpart"),this.Vz.yG()).GO(a("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(a("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(a("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(a("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(a("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(n("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(n("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(n("uFirstId"),e).nG(h,1);else if(U(i))this.lz.iL(n("uColor"),i.getColor());else if(nt(i)){if(!this.iU)return!1;this.lz.ZN(h,this.iU,i)}else if(at(i)){if(!this.sU)return!1;this.lz.QN(h,this.sU,i)}else if(j(i)){const t=kg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.lz.fG(h,i.lut,t)}return this.lz.kN(this.RU),!0}))}return{idCount:1}}HG(t,e,i,s,r){return{}}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return 0}Dl(){return 0}oM(t){this.Sl()>0&&this.Os();const[e,i]=this.cl(),s=e.length>2&&e[1].x0&&this.Os();const[e,i]=this.cl(),s=e.length;if(0===s)return;const r=this.Nl?1:0,n=s-(this.Gl?2:1),o=e.length>2&&e[1].x{const i=1===e?.5*Math.PI:1.5*Math.PI;for(let s=0;s<=this.VU;s+=1){const r=i-s*Math.PI/this.VU;t.push(.5*Math.cos(r),.5*Math.sin(r),e,0)}})),t.push(0,0,1,1),t.push(0,0,0,1);const e=t.length/4,i=[];for(let t=0;t((t,e)=>{let i=t.iN.tO.get(e);return i||(i=new uy(t,e),t.iN.tO.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),dy={YU:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i)}},HU:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.xN(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.xN(r,1),h.enableVertexAttribArray(r)},XU:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i)}},$U:(t,e,i,s,r,n,o,h,a,l)=>{const u=t.gl;u.bindBuffer(u.ARRAY_BUFFER,i),u.vertexAttribPointer(s,n,a,h,2*n*l,o*l),t.xN(s,1),u.enableVertexAttribArray(s),u.vertexAttribPointer(r,n,a,h,2*n*l,(o+n)*l),t.xN(r,1),u.enableVertexAttribArray(r)},WE:(t,e,i,s,r,n,o)=>{const h=t.GG(),{uniform:a,uniformOptional:l}=i,u=1/t.io.ho,c=(r?Math.max(n,u):Math.max(n,0))+1;h.WO(a("uThicknessPixels"),c).WO(l("uAALimit"),1-(c-1)/c).GO(a("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.bz(i,s).om(o)}},fy={YU:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t);const e=o("aPos_lowpart");h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},HU:(t,e,i,s,r,n)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,r,o.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},XU:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart"),e=o("aPos_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t),h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},jU:(t,e)=>{const i=t.GG();i.om(i.gl.LINE_STRIP,e,0)},ZU:(t,e)=>{const i=t.GG();i.om(i.gl.LINES,2*e,0)}};class gy extends En{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.el=Xe,this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,strokeFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},strokeFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t}}),this.OG=t,this.NG=e,this.lz=t.GG(),this.QU=this.lz.EN}Os(){const t=this.ma(),e=this.Su,i=this.jG.lineStyleSolid(t),s=this.jG.lineStyleDashed(t),r=i||s,n=this.jG.strokeFillSolid(t),o=this.jG.strokeFillLinearGradient(t),h=this.jG.strokeFillRadialGradient(t),a=this.jG.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Ii(),d=this.Ti(),f=this.Yo.C(),g=this.Yo.u,y=e.N();if(s&&this.At instanceof Hi)return zt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.Vz.$O(this.At),this.wu&&(this.JU=this.lz.zO(ne([c,d],this.At._i()),!1,this.JU),this.el=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.pa()&&r&&l&&y>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.KU=t?{type:"triangulated",shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),this.QU?sm.AliasedEdge:void 0,s&&sm.StippleTextureInstanced),mousePickingShader:f?this.lz.VV(sm["2D"],sm.MousePicking(),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),s&&sm.StippleTextureInstanced):void 0,geometry:cy(this.lz,y),thickness:y,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.uU=_m(cn(this.el,{x:this.Pl(),y:this.Dl()},this.At),this.At,h.getPosition(),h.getExtent(),h.getShape(),this.lz.MO()):o?this.cU=Bm(cn(this.el,{x:this.Pl(),y:this.Dl()},this.At),this.At,o.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),s){if(t||this.wu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.qU=this.lz.zO(t,!1,this.qU)}this.tW=this.lz.lG(s.getPattern())}else this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.tW=void 0;return this._u(e),this.wu=!1,this.Yo.u=!1,this}WE(t,e){var i,s;const r=this.JU;if(!r)return{};const n=this.KU;if(!n)return{};const{fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l,lineStyleDashed:u,thickness:c}=n,d=1===t?null===(i=this.KU)||void 0===i?void 0:i.mousePickingShader:null===(s=this.KU)||void 0===s?void 0:s.shader;return d?(this.lz.bz(d).OO(d,((i,s,d,f)=>{if(this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(f("uScaleStart_highpart"),this.Vz.yG()).GO(f("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(f("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(f("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(f("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(f("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(i("uFirstId"),e).nG(d,1);else if(o)this.lz.iL(i("uColor"),o.getColor());else if(a){if(!this.uU)return!1;this.lz.ZN(d,this.uU,a)}else if(h){if(!this.cU)return!1;this.lz.QN(d,this.cU,h)}else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.lz.fG(d,l.lut,t)}if(u){if(!this.qU||!this.tW)return!1;dy.HU(this.lz,d,this.qU,s("aLengthSoFarA"),s("aLengthSoFarB"),2,0),this.lz.GO(i("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(f("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(i("uStippleScale"),u.getPatternScale()).UO(i("uStippleTexture"),this.tW.uG,1)}return dy.YU(this.At._i(),this.lz,r,d,this.At._i()?4:2,0),dy.WE(this.OG,n.geometry,d,this.QU&&1!==t,1===t,c,1),!0})),{idCount:1}):{}}HG(t,e,i,s,r){return{}}dispose(){return super.dispose(),this.KU=void 0,this.JU&&(this.lz.jO(this.JU),this.JU=void 0),this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.tW=void 0,this}dz(){return this}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return Re(this.Su)}Dl(){return Re(this.Su)}}class my extends kn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.iW=[],this.sW=!1,this.eW=!1,this.hW=!1,this.rW=!1,this.nW=!1,this.Vz=new $m,this.el=Xe,this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,lineFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},lineFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},lineFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},lineIndividualPointFill:()=>{const t=this.Su.getFillStyle();return H(t)&&t}}),this.OG=t,this.NG=e,this.lz=t.GG(),this.QU=this.lz.EN,this.oW=t.io.no}Zr(){const t={vs:e=>this.aW(t,e),ds:e=>this.lW(t,e),Kg:(e,i)=>this.uW(t,e,i),iL:e=>this.cW(t,e),Pi:{x:0,y:0},Fi:{x:0,y:0},jo:0,bR:void 0,dW:this.iW.length,fW:!0,AW:!0};return this.eW=!0,this.iW.push(t),t}Ot(){var t;return this.iW.length=0,this.sW=!0,this.Ps&&this.Nn&&(null===(t=this.cs.On)||void 0===t?void 0:t.entity)===this&&this.Nn(this,void 0,this.cs.On.collectionMember),this}gW(){return this.iW.length}C(t){const e=this.iW[t];return[e.Pi,e.Fi]}Bm(){return this.iW}Bd(t){var e;const i=this.iW.indexOf(t);i>=0&&(this.iW.splice(i,1),t.AW||(this.sW=!0),this.Ps&&this.Nn&&(null===(e=this.cs.On)||void 0===e?void 0:e.entity)===this&&this.Nn(this,void 0,this.cs.On.collectionMember))}aW(t,e){if(e&&!t.fW)t.dW=this.iW.length,this.iW.push(t);else if(!e){const e=this.iW.indexOf(t);this.iW.splice(e,1)}return t.fW=e,t.AW||(this.rW=!0),t}lW(t,e){return t.jo=e,t.AW||(this.hW=!0),t}uW(t,e,i){return t.Pi=e,t.Fi=i,t.AW||(this.sW=!0),t}cW(t,e){return t.bR=e,t.AW||(this.nW=!0),t}Os(){const t=this.Yo.C(),e=this.Yo.u,i=this.ma(),s=this.Su,r=this.iW,n=this.hW,o=this.sW,h=this.rW,a=this.nW,l=this.eW,u=this.jG.lineStyleSolid(i),c=this.jG.lineStyleDashed(i),d=u||c,f=this.jG.lineFillSolid(i),g=this.jG.lineIndividualPointFill(i),m=this.jG.lineFillRadialGradient(i),y=this.jG.lineFillLinearGradient(i),p=f||g||y||m,A=s.N(),x=c?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(c&&this.At instanceof Hi)return zt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.Vz.$O(this.At);const S=this.ku,v=o||h,b=!v&&l;if(v||b){const t=v?r:r.filter((t=>t.AW)),e=[],i=t.length;let s=Ye,n=Ye,o=He,h=He;for(let r=0;r0&&e;this.KU=i?"triangulated"===x?{type:"triangulated",shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW,ensureMinimumSegmentLength:void 0!==this.Cu}),this.QU?sm.AliasedEdge:void 0,c&&sm.StippleTextureInstanced,sm.AttributeHighlight),mousePicking:t?{shader:this.lz.VV(sm["2D"],sm.MousePicking({useAttribute:!0}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW,ensureMinimumSegmentLength:void 0!==this.Cu}),c&&sm.StippleTextureInstanced,sm.AttributeHighlight)}:void 0,geometry:cy(this.lz,A,!1),thickness:A,lineStyleSolid:u,lineStyleDashed:c,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:y,fillStyleRadialGradient:m}:{type:"primitive",shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW}),sm.AttributeHighlight),mousePicking:t?{shader:this.lz.VV(sm["2D"],sm.MousePicking({useAttribute:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW}),sm.AttributeHighlight)}:void 0,lineStyleSolid:u,lineStyleDashed:c,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:y,fillStyleRadialGradient:m}:void 0}if(c){if(i||v||b){const t=v||i?r:r.filter((t=>t.AW)),e=new Float32Array(4*t.length);let s=0;for(let i=0;it.AW)),i=new Float32Array(e.length*t);let s=0;e.forEach((e=>{for(let r=0;rt.AW)),e=new Uint32Array(2*t.length);let s=0;t.forEach((t=>{const i=(t.bR||g.color).toUint32();for(let t=s;tt.AW)),s=new Float32Array(i.length*t);let n=0;i.forEach((e=>{for(let i=0;i{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(m("uScaleStart_highpart"),this.Vz.yG()).GO(m("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(m("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(m("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(m("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(m("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.oW&&this.lz.GO(m("uViewportSizePx"),[this.cs.oi().x*this.lz.MO(),this.cs.oi().y*this.lz.MO()]),void 0!==this.Cu&&this.lz.GO(i("uMinSegmentPixelVector"),[this.Cu.x,this.Cu.y]),this.lz.iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.lz.uN(i("uFirstId"),e),!n)return!1;"triangulated"===h?this.lz.NO(n.buffer,1,{location:f("aPickingIdOffset"),size:1}):this.lz._N(f("aPickingIdOffset"),n.buffer)}else if(a)this.lz.iL(i("uColor"),a.getColor());else if(l){if(!this.yW)return!1;if("triangulated"===h)dy.$U(this.lz,g,this.yW.buffer,f("aColorA"),f("aColorB"),4,0,!0,this.lz.gl.UNSIGNED_BYTE,1);else{const t=f("aColor");this.lz.gl.bindBuffer(this.lz.gl.ARRAY_BUFFER,this.yW.buffer),this.lz.gl.vertexAttribPointer(t,4,this.lz.gl.UNSIGNED_BYTE,!0,0,0),this.lz.gl.enableVertexAttribArray(t)}}else if(c){if(!this.iU)return!1;this.lz.ZN(g,this.iU,c)}else if(u){if(!this.sU)return!1;this.lz.QN(g,this.sU,u)}if(d){if(!this.qU||!this.tW)return!1;dy.$U(this.lz,g,this.qU.buffer,f("aLengthSoFarA"),f("aLengthSoFarB"),2,0,!1,this.lz.gl.FLOAT,Float32Array.BYTES_PER_ELEMENT),this.lz.GO(i("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(m("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(i("uStippleScale"),d.getPatternScale()).UO(i("uStippleTexture"),this.tW.uG,0)}if("triangulated"===h){const{geometry:e,thickness:i}=o;dy.XU(this.At._i(),this.lz,s.buffer,g,this.At._i()?4:2,0),this.lz.NO(r.buffer,1,{location:f("aIsHighlighted"),size:1}),dy.WE(this.OG,e,g,this.QU&&1!==t,1===t,i,this.iW.length)}else fy.XU(this.At._i(),this.lz,s.buffer,g,this.At._i()?4:2,0),this.lz._N(f("aIsHighlighted"),r.buffer),fy.ZU(this.OG,this.iW.length);return!0})),{idCount:this.iW.length}):{}}dispose(){return super.dispose(),this.KU=void 0,this.JU&&(this.lz.jO(this.JU.buffer),this.JU=void 0),this.qU&&(this.lz.jO(this.qU.buffer),this.qU=void 0),this.pW&&(this.lz.jO(this.pW.buffer),this.pW=void 0),this.mW&&(this.lz.jO(this.mW.buffer),this.mW=void 0),this.yW&&(this.lz.jO(this.yW.buffer),this.yW=void 0),this.tW=void 0,this}HG(t,e,i,s,r){return{collectionMember:this.iW.find((i=>e+i.dW===t))}}dz(){return this}ds(t){super.ds(t);for(const e of this.iW)e.ds(t);return this}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return Re(this.Su)}Dl(){return Re(this.Su)}}class yy{constructor(t,e){this.vW=!1,this.SW=!1,this.xW=!1,this.At=t,this.bW=e,this.bW.ta("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.vW="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.vW="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.SW=!0),!0===t.regularProgressiveStep&&(this.xW=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.vW?t[0].x:t[0].y,end:"x"===this.vW?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.vW?"x"===this.vW?function(t){const e=t.length;if(e>0){const i=Math.max(t[e-1].x,t[0].x),s=Math.min(t[e-1].x,t[0].x);let r=t[0].y,n=t[0].y;for(let i=0;ir&&(r=e.y),e.y0){const i=Math.max(t[e-1].y,t[0].y),s=Math.min(t[e-1].y,t[0].y);let r=t[0].x,n=t[0].x;for(let i=0;ir&&(r=e.x),e.x{!1===t.allowDataGrouping&&(this.MW=!0)}))}TW(t,e=!1){if(this.MW||!this.vW||"linear"!==this.kW.type)return!1;!1===e&&this.FW&&(clearTimeout(this.FW),this.FW=void 0);const i="x"===this.vW?this.kW.scale.x.yg:this.kW.scale.y.yg;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const r=t[0],n=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.vW?r.x:r.y,"x"===this.vW?n.x:n.y,s),h=this.kW.scale,a=Math.abs("x"===this.vW?h.Ui().x:h.Ui().y),l=a/o,u=Math.floor(l*py),c=u*o,d=zt.performance.now(),f=!(d-i._h<500)&&(i.yh?d-i.Mh<1e3:d-i.mh<2e3||i.xh),g=s>2*this._W.totalDataPointsAtTime;if(f&&!g)return this.FW=setTimeout((()=>this.IW(t)),1e3),!1;const m=u>=10,y=this._W.enabled?this._W.columnWidthAxis/a<1.5:void 0,p=this._W.enabled&&u>this._W.dataPointsPerColumn?u/this._W.dataPointsPerColumn>=2:void 0;let A;!0===this._W.enabled?y?p&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):A=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return A?(x&&(this._W=A),!0):(x&&(this._W={...this._W,totalDataPointsAtTime:s}),!1)}PW(){this.DW=void 0,this.wW.length=0,this.FW&&(clearTimeout(this.FW),this.FW=void 0)}BW(t){if(0===t.length)return t;if(this.MW||!this.vW||"linear"!==this.kW.type||!this._W.enabled)return t;let e;e=this.wW.length>0?fe(this.wW,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.DW,h=-1,a=-1,l=0,u=0;if("x"!==this.vW||this.SW)if("x"===this.vW&&this.SW){const t=this._W.columnWidthAxis;let c=this.DW?this.DW.x:e[0].x,d=c-t;for(let f=0;f=d?((!r||i.y>r.y)&&(r=i,h=f),(!n||i.y=d?((!r||i.x>r.x)&&(r=i,h=f),(!n||i.xr.x)&&(r=i,h=f),(!n||i.xr.y)&&(r=i,h=f),(!n||i.y0&&(this.DW=s[c-1]),s}LW(t){if(this.vW&&"linear"===this.kW.type){const e="x"===this.vW?this.kW.scale.x.yg:this.kW.scale.y.yg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.fh===Ks.progressive||e.fh===Ks.regressive){const e=Math.abs("x"===this.vW?this.kW.scale.x.getInnerInterval():this.kW.scale.y.getInnerInterval());if(this._W.enabled)return 2*e/this._W.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.vW?s.x:s.y,"x"===this.vW?r.x:r.y,i)}}}RW(t,e,i){if(!this.vW)return e;const s=i.length;let r=rn(i,t.min,this.vW,this.SW,0,s-1);void 0===r&&(r=this.SW?s-1:0);let n=rn(i,t.max,this.vW,this.SW,0,s-1);return void 0===n&&(n=this.SW?0:s-1),1+Math.abs(n-r)}EW(){this.FW&&(clearTimeout(this.FW),this.FW=void 0)}IW(t){this.TW(t,!0)&&this.Ms()}}class xy extends yy{renderVisibleOnly(t,e,i=!1){const s=this.At.x.getInnerStart(),r=this.At.x.getInnerEnd(),n=Math.min(s,r),o=Math.max(s,r),h=this.At.y.getInnerStart(),a=this.At.y.getInnerEnd(),l=Math.min(h,a),u=Math.max(h,a);t.forEach(((t,s)=>{t.existingCoordinatesCount<=1||!1===i&&(t.boundaries.max.xo||t.boundaries.max.yu)||e(t)}))}}class Sy{constructor(t,e,i){this.zW=e,this.VW=i,this.OW=t,this.NW=[]}GW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.OW[this.OW.length-1];do{const t=this.OW.length;let r;h||(h=this.UW(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.VW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.OW[t-1].lastDataPoint;e?(n.splice(0,0,e),a=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(h)r=Math.min(o,h.allocatedCoordinatesCount-h.existingCoordinatesCount),s(h,n.slice(0,r),r,a);else{const t=Math.ceil(e)+a;r=Math.min(t,o);const s={...i(t,n.slice(0,r),r,a),isDropped:!1};this.OW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.WW()}YW(t){const e=t,i=this.OW.indexOf(e);i>=0&&this.OW.splice(i,1),e.droppedTimestamp=zt.performance.now(),this.NW.push(e)}HW(){this.OW.slice().forEach((t=>this.YW(t)))}XW(){this.OW.forEach((t=>this.zW(t))),this.NW.forEach((t=>this.zW(t))),this.OW.length=0,this.NW.length=0}UW(t,e){const i=2*t/3,s=4*t/3,r=this.NW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.NW[r];return this.NW.splice(r,1),this.OW.push(t),t}}WW(){if(this.NW.length>5){const t=zt.performance.now();for(let e=0;e=1e4)&&(this.zW(i),this.NW.splice(e,1),e-=1)}}}}class vy extends yy{$W(t,e){if(!e||"object"!=typeof e)return 0;const i=this.At.x.getInnerStart(),s=this.At.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.At.y.getInnerStart(),h=this.At.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.jW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.ZW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.QW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}jW(t,e,i,s,r,n){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let h=0,a=o;for(let i=0;ie&&(h+=1,a-=s.existingDataPointsCount)}return h}QW(t,e,i,s,r,n){if(void 0===e||!this.vW)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.vW?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.vW?a.boundaries.max.x2))break;o+=1}return o}ZW(t,e,i,s,r,n){if(void 0===e||0===e)return 0;let o=0,h=0;for(let a=t.length-1;a>=0;a-=1){const l=t[a];if(h>e)if(this.vW){if(this.SW?"x"===this.vW?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.vW?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}JW(t,e){const i=t.reduce(((t,e)=>hi(t,e.boundaries)),Xe);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.vW||this.SW?"x"===this.vW&&this.SW?i.max.x=Math.min(i.max.x,t):"y"!==this.vW||this.SW?"y"===this.vW&&this.SW&&(i.max.y=Math.min(i.max.y,t)):i.min.y=Math.max(i.min.y,t):i.min.x=Math.max(i.min.x,t)}return i}}class by extends In{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Vz=new $m,this.GM=[],this.KW=new xy(this.At,this),this.qW=new Ay(this.At,this,(()=>this.cs.Ms())),this.tY=new Sy(this.GM,(t=>{t.coordsBuffer&&this.lz.jO(t.coordsBuffer),t.qU&&this.lz.jO(t.qU)}),!0),this.iY=new vy(this.At,this),this.sY=0,this.eY=0,this.hY=!1,this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,strokeFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},strokeFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t}}),this.NG=e,this.io=n,this.KU={type:"none"},this.lz=t.GG(),this.OG=t,this.QU=this.lz.EN;const o=this.At._i(),h=!0===(null==n?void 0:n.individualLookupValuesEnabled);let a,l,u,c=0;o||(a=c,c+=2),o&&(l=c,c+=4),h&&(u=c,c+=1);const d=((t,e)=>e?(e,i)=>((t,e)=>{if(!e){const e=t.length,i=new Float32Array(3*e);for(let s=0,r=0;sne(e,t,Float32Array))(o,h);this.rY={individualLookupValuesEnabled:h,attributesPerVertex:c,attributeOffsetCoordinateLowPrecision:a,attributeOffsetCoordinateHighPrecision:l,attributeOffsetLookUpValue:u,prepareRenderData:(t,e)=>d(t,this.Su.getFillStyle())}}nY(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.Yo.C(),h=this.Yo.u,a=this.jG.lineStyleSolid(i),l=this.jG.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.jG.strokeFillSolid(i),f=this.jG.strokeFillLinearGradient(i),g=this.jG.strokeFillRadialGradient(i),m=this.jG.strokeFillPaletted(i),y=d||f||g||m,p=this.rY.individualLookupValuesEnabled;if(l&&this.At instanceof Hi)return zt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.Tu=fe(this.Tu,s,{canReturnB:!0}),this.hl+=r);let A=this.Fu.u;const x=this.iY.$W(this.GM,this.Fu.C());if(x>0){let t=0;for(let e=0;e{t.qU&&(this.lz.jO(t.qU),t.qU=void 0)})),this.hY=!1),v&&(this.qW.PW(),this.GM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Xe,t.lastDataPoint=void 0})),this.tY.HW(),S=this.Tu,this.sY=0,this.eY=0);const b=this.qW.BW(S),M=b.length;if(M>0){let t=this.qW.LW(this.Tu)||(this.ta("ApplicationType",(t=>"InternalUI"===t.type))?this.hl:1e5);M/t>10&&(t=M/10),this.tY.GW(b,t,((t,e,i,s)=>{const r=this.KW.calculateUserDataPointsBoundaries(e),n=this.qW.RW(r,i,this.Tu)-s;return this.oY=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.lz.fN(t*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),lastDataPoint:e[i-1],qU:this.hY?this.lz.fN(2*t,this.nY(e,i,this.oY)):void 0}}),((t,e,i,s)=>{const r=hi(t.boundaries,this.KW.calculateUserDataPointsBoundaries(e)),n=this.qW.RW(r,t.existingCoordinatesCount+i,this.Tu)-(t.jointPointsCount+s);this.lz.AN(t.coordsBuffer,t.existingCoordinatesCount*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),this.hY&&t.qU&&this.lz.AN(t.qU,2*t.existingCoordinatesCount,this.nY(e,i,this.oY)),this.oY=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(A&&(this.el=this.iY.JW(this.GM,this.Fu.C())),this.Vz.$O(this.At),g?this.uU=_m(this.$o||this.el,this.At,g.getPosition(),g.getExtent(),g.getShape(),this.lz.MO()):f?this.cU=Bm(this.$o||this.el,this.At,f.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw zt.alert(t),new Error(t)}if(y&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.KU="primitive"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}),l&&sm.StippleTexture),mousePickingShader:o?this.lz.VV(sm["2D"],sm.MousePicking({useVertexId:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}),l&&sm.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),this.QU?sm.AliasedEdge:void 0,l&&sm.StippleTextureInstanced),mousePickingShader:o?this.lz.VV(sm["2D"],sm.MousePicking(),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),l&&sm.StippleTextureInstanced):void 0,geometry:cy(this.lz,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.KU={type:"none"}}return this.tW=l?this.lz.lG(l.getPattern()):void 0,this._u(e),this.al=!1,this.rl=[],this.Yo.u=!1,this.Fu.u=!1,this}WE(t,e){const i=this.lz.gl,s=this.KU;if(!s||"none"===s.type)return{};const r=1===t?s.mousePickingShader:s.shader;if(!r)return{};const{lineStyleDashed:n,fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l}=s;return this.lz.bz(r).OO(r,((r,u,c,d)=>{let f=!1;if(this.lz.WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(r("uScale"),this.Vz.YO()).GO(r("uDisp"),this.Vz.HO()).GO(d("uScaleStart_highpart"),this.Vz.yG()).GO(d("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(d("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(d("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(d("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(d("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(r("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(r("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t);else if(o)this.lz.iL(r("uColor"),o.getColor());else if(a){if(!this.uU)return!1;this.lz.ZN(c,this.uU,a)}else if(h){if(!this.cU)return!1;this.lz.QN(c,this.cU,h)}else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.lz.fG(c,l.lut,t)}const g=Ne(e);return this.KW.renderVisibleOnly(this.GM,(e=>{const{coordsBuffer:o}=e;if(!o)return;if(1===t){const[t,i]=g.Wt(e.existingDataPointsCount);this.lz.uN(r("uFirstId"),t),"triangulated"===s.type?this.lz.nG(c,i):this.lz.hG(c,i)}i.bindBuffer(i.ARRAY_BUFFER,o);const h="triangulated"===s.type?dy.YU:fy.YU;if(this.At._i()||void 0===this.rY.attributeOffsetCoordinateLowPrecision?this.At._i()&&void 0!==this.rY.attributeOffsetCoordinateHighPrecision&&h(!0,this.lz,o,c,this.rY.attributesPerVertex,this.rY.attributeOffsetCoordinateHighPrecision):h(!1,this.lz,o,c,this.rY.attributesPerVertex,this.rY.attributeOffsetCoordinateLowPrecision),n){if(!e.qU||!this.tW)return;"triangulated"===s.type?dy.HU(this.lz,c,e.qU,u("aLengthSoFarA"),u("aLengthSoFarB"),2,0):fy.HU(this.lz,c,e.qU,u("aLengthSoFar"),2,0),this.lz.GO(r("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(d("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(r("uStippleScale"),n.getPatternScale()).UO(r("uStippleTexture"),this.tW.uG,1)}if(l&&"value"===l.lookUpProperty&&void 0!==this.rY.attributeOffsetLookUpValue&&1!==t)if("triangulated"===s.type){const t=u("aLookupValueA");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(t,1),i.enableVertexAttribArray(t);const e=u("aLookupValueB");i.vertexAttribPointer(e,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.rY.attributeOffsetLookUpValue+this.rY.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(e,1),i.enableVertexAttribArray(e)}else{const t=u("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),i.enableVertexAttribArray(t)}if("triangulated"===s.type){const{thickness:i}=s;dy.WE(this.OG,s.geometry,c,this.QU&&1!==t,1===t,i,e.existingCoordinatesCount-1)}else fy.jU(this.OG,e.existingCoordinatesCount);f=!0}),void 0===this.Yi),i.bindBuffer(i.ARRAY_BUFFER,null),f})),{idCount:this.hl}}HG(t,e,i,s,r){return{}}ml(t,e){return Array.isArray(t)||(t=[t]),this.rl=fe(this.rl,t,{canReturnB:!0}),this.el=hi(this.el,e||e||this.KW.calculateUserDataPointsBoundaries(t)),this}Ot(){return super.Ot(),this.sY=0,this.eY=0,this.oY=void 0,this}dispose(){return super.dispose(),this.tY.XW(),this.qW.EW(),this.KU={type:"none"},this.tW=void 0,this}dz(){return this}oM(t){this.Sl()>0&&this.Os();const e=this.cl(),i=Qr(e,t,this.qo(),this.Nl,this.Gl,this.At,this.engine.At,this.el,this.KW.vW,this.KW.SW);return void 0!==i?e[i]:void 0}T_(t){this.Sl()>0&&this.Os();const e=this.cl(),i=e.length;if(0===i)return;const s=this.Nl?1:0,r=i-(this.Gl?2:1),n=this.qo();if(n===Jr.Nearest){let s,r,n=Ye;for(let o=0;o1}om(t,e,i,s,r){return"object"==typeof s?e?this.lz._N(t.attribute("aOffsetScale"),e,1).GO(t.uniform("uSizePixels"),[s.width,s.height]):this.lz.WO(t.uniform("uOffsetScale"),s.scale).GO(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.lz._N(t.attribute("aOffsetPixels"),e,1):this.lz.WO(t.uniform("uOffsetPixels"),s):this.lz.WO(t.uniform("uPointSize"),s),r?this.lz.NO(this.qE,0,{location:t.attribute("aInstanceGeo"),size:2}).TN(this.WU,0,this.uY,i):this.lz.om(this.lz.gl.POINTS,i),this}rO(){this.lz.jO(this.qE)}}const Cy=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new My(t,i,t.gl.TRIANGLE_FAN,e)},Ty=(t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05),u(-.05,-.5),u(i,-.5),u(i,.5),u(i,.5),u(-.05,.5),u(-.05,-.5)];return new My(t,s,t.gl.TRIANGLES,e)},wy=(t,i,s)=>{if(po(t))return wy(e.PointShape.Square,i,s);let r=i.iN.JV.get(t);if(t===e.PointShape.Circle||t===e.PointShape.HollowCircle){const n=s<=3?4:s<=5?8:s<=10?16:24;return t===e.PointShape.Circle?(r=i.iN.KV.get(n)||((t,e,i=0)=>{const s=function(t=25){return Qm(u(0,0),0,360,.5,.5,t)[0]}(e);return new My(t,s,t.gl.TRIANGLE_FAN,i)})(i,n),i.iN.KV.set(n,r),r):(r=i.iN.qV.get(n)||((t,e,i=0)=>{const s=[],r=2*Math.PI/e;for(let t=0;t<=e;t+=1){const e=t*r,i=Math.cos(e),n=Math.sin(e);s.push({x:.5*i,y:.5*n}),s.push({x:.3*i,y:.3*n})}return new My(t,s,t.gl.TRIANGLE_STRIP,i)})(i,n),i.iN.qV.set(n,r),r)}if(!r){switch(t){case e.PointShape.Triangle:r=((t,e=0)=>{const i=function(){const t=[],e=2/1.73205080757;return t.push(u(-e/2,.3333333333333333)),t.push(u(0,-.6666666666666666)),t.push(u(e/2,.3333333333333333)),t}();return new My(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=Cy(i);break;case e.PointShape.Plus:r=Ty(i);break;case e.PointShape.Cross:r=Ty(i,45);break;case e.PointShape.Diamond:r=Cy(i,45);break;case e.PointShape.Arrow:r=((t,e=0)=>{const i=.05,s=[u(-.05,-.5),u(i,-.5),u(i,.45),u(i,.45),u(-.05,.45),u(-.05,-.5),u(-.5,0),u(-.4,0),u(0,.4),u(0,.4),u(0,.5),u(-.5,0),u(.5,0),u(.4,0),u(0,.4),u(0,.4),u(0,.5),u(.5,0)];return new My(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new My(t,[{x:0,y:0},{x:0,y:.5},{x:.1,y:.1},{x:.5,y:.1},{x:.2,y:-.1},{x:.3,y:-.5},{x:0,y:-.25},{x:-.3,y:-.5},{x:-.2,y:-.1},{x:-.5,y:.1},{x:-.1,y:.1},{x:0,y:.5}],t.gl.TRIANGLE_FAN,e))(i);break;case e.PointShape.Minus:r=((t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05)];return new My(t,s,t.gl.TRIANGLES,e)})(i);break;default:return ze(0,"LightningChart JS unidentified point shape")}i.iN.JV.set(t,r)}return r};class Ey extends xn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.XG=m(c(He,He),c(Ye,Ye)),this.jG=Eg({pointStyleSolid:()=>U(this.Ie)&&this.Ie,pointStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,pointStyleLinearGradient:()=>at(this.Ie)&&this.Ie,pointStylePaletted:()=>j(this.Ie)&&this.Ie,pointStyleIndividual:()=>H(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG()}Os(){var t;const e=this.Yo.C(),i=this.Yo.u,s=this.rl,r=s.length,n=r>0,o=this.qa.C(),h=this.Ie,a=this.size.C(),l=this.qa.u||this.ka.u,u=this.At.Ni(),c=this.size.u||this.qa.u,d=this.al||s&&s.length>0,f=u||c,g=this.fa(),m=this.jG.pointStyleSolid(g),y=this.jG.pointStyleRadialGradient(g),p=this.jG.pointStyleLinearGradient(g),A=this.jG.pointStylePaletted(g),x=this.jG.pointStyleIndividual(g),S=m||y||p||A||x;if(n&&(this.Ka=fe(this.Ka,s,{canReturnB:!0}),this.hl+=r),n||this.al){this.el=this.ol?hi(this.el,this.ol):hi(this.el,ni(this.Ka));const t=ne(this.Ka,this.At._i());this.fY=this.hl,this.AY=this.lz.zO(t,!1,this.AY)}this.Vz.$O(this.At),h!==_?f&&(this.gY&&(this.gY=void 0),a>1||this.tl.C()?a<=1&&!this.tl.C()?this.WU=this.lz.gl.POINTS:(this.gY=wy(o,this.lz,this.tl.C()?25:a),this.WU=this.gY.WU):this.WU=this.lz.gl.POINTS):this.gY&&(this.gY=void 0);const v=(null===(t=this.gY)||void 0===t?void 0:t.cY)||0,b=this.ka.C()+v;if(c||g||i||l){const t=this.tl.C()?"attribute":"uniform",i=a<=1&&sm.PointSize(t),s=sm.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.il.C()||b%360!=0)&&{dataType:this.il.C()?"attribute":"uniform"}}:void 0,axisWorldTranslation:wg(this.At),normalSource:void 0});this.Gz=S?this.lz.VV(sm["2D"],i,s,m?sm.Color({dataType:"uniform"}):x?sm.Color({dataType:"attribute"}):A?sm.Color({dataType:["lookup",A.getLookUpProperty(),A.lut]}):y?sm.Color({dataType:["gradient",y]}):p?sm.Color({dataType:["gradient",p]}):void 0):void 0,this.fU=e&&S?this.lz.VV(sm["2D"],i,s,sm.MousePicking()):void 0}if(d||g){const t=this.Ka.length;if(H(h)&&this.fY&&this.fY>0){const e=h.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&a>1){const e=new Float32Array(t);for(let i=0;i0&&a>1){const e=new Float32Array(2*t),i=Ci(b),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.ll={min:e,max:t}}return this.Aa=h,this.qa.u=!1,this.size.u=!1,this.ka.u=!1,this.Yo.u=!1,this.al=!1,this}WE(t,e){const i=1===t?this.fU:this.Gz,s=this.AY,r=this.fY,n=this.hl;return i&&s&&r&&(this.lz.bz(i),this.lz.OO(i,((i,o,h,a)=>{var l;if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(a("uScaleStart_highpart"),this.Vz.yG()).GO(a("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(a("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(a("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(a("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(a("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.lz.qN(h,s,this.At._i(),this.gY?1:void 0).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).WO(a("uDevicePixelRatio"),this.lz.MO()),this.gY){const t=o("aInstanceGeo");this.lz.vN(t,this.gY.qE).xN(t,0)}if(1===t)this.lz.uN(i("uFirstId"),e).nG(h,n);else if(U(this.Ie))this.lz.iL(i("uColor"),this.Ie.getColor());else if(H(this.Ie)&&this.pY){const t=o("aColor");this.lz.MN(t,this.pY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}else if(j(this.Ie)){if("value"===this.Ie.getLookUpProperty()&&this.vY){const t=o("aLookupValue");this.lz._N(t,this.vY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}const t=kg(this.Ie,this,this.ll);if(!t&&this.Ie.lut.percentageValues)return!1;this.lz.fG(h,this.Ie.lut,t)}else if(nt(this.Ie)){if(!this.iU)return!1;this.lz.ZN(h,this.iU,this.Ie)}else if(at(this.Ie)){if(!this.sU)return!1;this.lz.QN(h,this.sU,this.Ie)}if(this.yY&&this.WU!==this.lz.gl.POINTS){const t=o("aOffsetPixels");this.lz._N(t,this.yY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}else if(this.WU!==this.lz.gl.POINTS){const t=i("uOffsetPixels");this.lz.WO(t,this.size.C())}const u=((null===(l=this.gY)||void 0===l?void 0:l.cY)||0)+this.ka.C();if(this.mY&&this.WU!==this.lz.gl.POINTS){const t=o("aRot");this.lz.vN(t,this.mY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}else if(this.WU!==this.lz.gl.POINTS&&u%360!=0){const t=Ci(u),e=Math.sin(t),s=Math.cos(t);this.lz.GO(i("uRot"),[e,s])}if(this.WU===this.lz.gl.POINTS)this.lz.WO(i("uPointSize"),this.size.C());else{const t={x:2/this.cs.oi().x,y:2/this.cs.oi().y};this.lz.GO(i("uRatioPxClip"),[t.x,t.y])}let c=!1;return this.WU===this.lz.gl.POINTS?(this.lz.om(this.WU,r),c=!0):this.gY&&(this.lz.TN(this.WU,0,this.gY.uY,r),c=!0),c}))),{idCount:n}}HG(t,e,i,s,r){return{}}hd(t){this.Sl()>0&&this.Os();const e=this.cl(),i=Qr(e,t,this.qo(),!1,!1,this.At,this.cs.At,this.el,void 0,void 0);return void 0!==i?e[i]:void 0}Re(t){return super.Re(t)}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return this.tl.C()?25:this.size.C()}Dl(){return this.tl.C()?25:this.size.C()}dz(){return this.AY&&(this.lz.jO(this.AY),this.AY=void 0),this.gY&&(this.gY=void 0),this.pY&&(this.lz.jO(this.pY),this.pY=void 0),this.mY&&(this.lz.jO(this.mY),this.mY=void 0),this.vY&&(this.lz.jO(this.vY),this.vY=void 0),this}}class ky extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.KU={fill:void 0,border:void 0},this.Vz=new $m,this.el=Xe,this.SY=!1,this.xY=!1,this.bY=!1,this.MY=!1,this._Y=!1,this.Pd=[],this.jG=Eg({polygonStyleSolid:()=>U(this.Ie)&&this.Ie,polygonStyleImage:()=>tt(this.Ie)&&this.Ie,polygonStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,polygonStyleLinearGradient:()=>at(this.Ie)&&this.Ie,polygonStylePaletted:()=>j(this.Ie)&&this.Ie,polygonStyleIndividual:()=>H(this.Ie)&&this.Ie,lineStyleSolid:()=>cs(this.Pe)&&this.Pe,lineStyleDashed:()=>go(this.Pe)&&this.Pe,lineStyleFilled:()=>{const t=this.Pe&&this.Pe.getFillStyle();return U(t)&&t}}),this.OG=t,this.NG=e,this.lz=t.GG(),this.QU=this.lz.EN}Zr(){const t={vs:e=>this.aW(t,e),ds:e=>this.lW(t,e),Fl:e=>this.wY(t,e),yb:e=>this.CY(t,e),iL:e=>this.cW(t,e),Ka:[],M:void 0,kY:void 0,jo:0,fW:!0,TY:this.Pd.length};return this.Pd.push(t),t}Ot(){var t;return this.Pd.length=0,this.SY=!0,this.Ps&&this.Nn&&(null===(t=this.cs.On)||void 0===t?void 0:t.entity)===this&&this.Nn(this,void 0,this.cs.On.collectionMember),this}Bm(){return this.Pd}Bd(t){var e;const i=this.Pd.indexOf(t);i>=0&&(this.Pd.splice(i,1),this._Y=!0,this.Ps&&this.Nn&&(null===(e=this.cs.On)||void 0===e?void 0:e.entity)===this&&this.cs.On.collectionMember===t&&this.Nn(this,void 0,this.cs.On.collectionMember))}aW(t,e){var i;return t.fW=e,this._Y=!0,this.Ps&&this.Nn&&(null===(i=this.cs.On)||void 0===i?void 0:i.entity)===this&&this.cs.On.collectionMember===t&&!t.fW&&this.Nn(this,void 0,this.cs.On.collectionMember),t}lW(t,e){return t.jo=e,this.MY=!0,t}wY(t,e){return t.Ka=e,this.SY=!0,t}CY(t,e){return t.M=e,this.xY=!0,t}cW(t,e){return t.kY=null==e?void 0:e.toUint32(),this.bY=!0,t}Os(){const t=this.Yo.C(),e=this.Yo.u,i=this.fa(),s=this.MY,r=this.SY,n=this.xY,o=this.bY,a=this._Y,l=this.Pe,u=this.ma(),c=this.Pd.filter((t=>t.fW&&t.Ka.length>0));if(this.Vz.$O(this.At),(r||a)&&(this.el=hi(...c.map((t=>ni(t.Ka))))),r||a){const t=c.map((t=>[...t.Ka,t.Ka[0],{x:Number.NaN,y:Number.NaN}])).flat(),e=ne(t,!1,Float64Array),i=this.At._i()?ne(t,!0):e;this.JU=this.lz.zO(i,!1,this.JU);let s=[];c.reduce(((t,i)=>{const r=t,n=2*(i.Ka.length+1),o=new Float64Array(e.buffer,r,n),a=h.default(o,void 0,2),l=t/(2*Float64Array.BYTES_PER_ELEMENT);for(let t=0;tt+e.Ka.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Ka.length+2;for(let r=i;rt+e.Ka.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Ka.length+2;for(let r=i;rt+e.Ka.length+2),0),e=new Float32Array(t);let i=0;const s={min:Ye,max:He};c.forEach((t=>{const r=void 0!==t.M?t.M:-34028234663852886e22,n=t.Ka.length+2;for(let t=i;tt+e.Ka.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():k.toUint32();c.forEach((t=>{const r=void 0!==t.kY?t.kY:s,n=t.Ka.length+2;for(let t=i;tt+e.Ka.length),2*c.length),e=new Float32Array(2*t);let i=0;c.forEach((t=>{let s=t.Ka[0],r=0,n=0;for(const o of t.Ka)r+=Math.abs(o.x-s.x),n+=Math.abs(o.y-s.y),e[i]=r,e[i+1]=n,i+=2,s=o;e[i+0]=r+Math.abs(t.Ka[0].x-s.x),e[i+1]=n+Math.abs(t.Ka[0].y-s.y),e[i+2]=Number.NaN,e[i+3]=Number.NaN,i+=4})),this.qU=this.lz.zO(e,!1,this.qU)}this.tW=this.lz.lG(S.getPattern())}else this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.tW=void 0;return this.zY=this.lz.AG(this,this.zY,p,void 0,r||a||this.At.Ni(),((t,e,i)=>this.VY(t,e,i,c))),this.MY=!1,this._Y=!1,this.SY=!1,this.xY=!1,this.bY=!1,this.Yo.u=!1,this.ya(this.Ie),this.xa(l),this}WE(t,e){var i,s;const{fill:r,border:n}=this.KU,o=this.JU,h=this.DY,a=this.BY;if(!o||!h)return{};if(r){const{fillStyleSolid:s,fillStyleLinearGradient:n,fillStyleRadialGradient:l,fillStylePaletted:u,fillStyleImage:c,fillStyleIndividual:d}=r,f=this.FY,g=this.IY,m=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;m&&o&&f&&void 0!==g&&this.lz.bz(m).OO(m,((i,r,m,y)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(y("uScaleStart_highpart"),this.Vz.yG()).GO(y("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(y("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(y("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(y("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(y("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.lz.qN(m,o,this.At._i(),void 0).wN(f)._N(r("aIsHighlighted"),h).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.lz.uN(i("uFirstId"),e),!a)return!1;this.lz._N(r("aPickingIdOffset"),a)}else if(s)this.lz.iL(i("uColor"),s.getColor());else if(l){if(!this.iU)return!1;this.lz.ZN(m,this.iU,l)}else if(n){if(!this.sU)return!1;this.lz.QN(m,this.sU,n)}else if(u){const t=kg(u,this,this.LY);if(!t&&u.lut.percentageValues)return!1;if(this.lz.fG(m,u.lut,t),"value"===u.getLookUpProperty()){if(!this.RY)return!1;this.lz._N(r("aLookupValue"),this.RY)}}else if(c){if(!this.zY)return!1;this.lz.iL(y("uColor"),c.getSurroundingColor()).UO(i("uColorTexture"),this.zY.texture.vO()||this.zY.sourceMissingTexture,0).NO(this.zY.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).cN(c.fitMode)}else if(d){if(!this.EY)return!1;const t=r("aColor");this.lz.gl.bindBuffer(this.lz.gl.ARRAY_BUFFER,this.EY),this.lz.gl.vertexAttribPointer(t,4,this.lz.gl.UNSIGNED_BYTE,!0,0,0),this.lz.gl.enableVertexAttribArray(t)}return this.lz.kN(g,void 0,void 0,this.lz.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:i,fillStyleSolid:r,thickness:l,lineStyleDashed:u}=n,c=this.PY,d=1===t?null===(s=n.mousePicking)||void 0===s?void 0:s.shader:n.shader;d&&o&&c&&this.lz.bz(d).OO(d,((s,n,d,f)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(s("uScale"),this.Vz.YO()).GO(s("uDisp"),this.Vz.HO()).GO(f("uScaleStart_highpart"),this.Vz.yG()).GO(f("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(f("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(f("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(f("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(f("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(s("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(s("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.lz.NO(h,1,{location:n("aIsHighlighted"),size:1}).iL(s("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0),1===t){if(this.lz.uN(s("uFirstId"),e),!a)return!1;this.lz._N(n("aPickingIdOffset"),a,1)}else r&&this.lz.iL(s("uColor"),r.getColor());if(u){if(!this.tW||!this.qU)return!1;dy.HU(this.lz,d,this.qU,n("aLengthSoFarA"),n("aLengthSoFarB"),2,0),this.lz.GO(s("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(f("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(s("uStippleScale"),u.getPatternScale()).UO(s("uStippleTexture"),this.tW.uG,1)}return dy.YU(this.At._i(),this.lz,o,d,this.At._i()?4:2,0),dy.WE(this.OG,i,d,this.QU&&1!==t,1===t,l,c),!0}))}return{idCount:this.Pd.length}}VY(t,e,i,s){const r=yt({x:this.el.min.x,y:this.el.min.y},this.At,this.cs.At),n=yt({x:this.el.max.x,y:this.el.max.y},this.At,this.cs.At),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Um(t,e,o.x,o.y,i),a=h[1],l=h[4],u=h[6],c=h[7],d=s.reduce(((t,e)=>t+e.Ka.length+2),0),f=new Float32Array(2*d),g=this.el.max.x-this.el.min.x,m=this.el.max.y-this.el.min.y,y=l-u,p=c-a;let A=0;for(const t of s){for(const e of t.Ka){const t=u+y*((e.x-this.el.min.x)/g),i=a+p*((e.y-this.el.min.y)/m);f[A]=t,f[A+1]=i,A+=2}const e=u+y*((t.Ka[0].x-this.el.min.x)/g),i=a+p*((t.Ka[0].y-this.el.min.y)/m);f[A]=e,f[A+1]=i,A+=2,f[A]=Number.NaN,f[A+1]=Number.NaN,A+=2}return f}HG(t,e,i,s,r){return{collectionMember:this.Pd.find((i=>e+i.TY===t))}}dz(){return this.FY&&(this.lz.jO(this.FY),this.FY=void 0),this.JU&&(this.lz.jO(this.JU),this.JU=void 0),this.DY&&(this.lz.jO(this.DY),this.DY=void 0),this.BY&&(this.lz.jO(this.BY),this.BY=void 0),this.RY&&(this.lz.jO(this.RY),this.RY=void 0),this.EY&&(this.lz.jO(this.EY),this.EY=void 0),this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.KU={fill:void 0,border:void 0},this.zY=this.lz.gG(this,this.zY),this}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return Re(this.Pe)}Dl(){return Re(this.Pe)}}class Iy extends Sn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.OY=Xe,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,fillStyleLinearGradient:()=>at(this.Ie)&&this.Ie,fillStyleImage:()=>tt(this.Ie)&&this.Ie,strokeStyleSolid:()=>cs(this.Pe)&&this.Pe,strokeFillSolid:()=>{const t=this.Pe.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Pe.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Pe.getFillStyle();return nt(t)&&t}}),this.VY=(t,e,i)=>{const s=yt(this.Ua(),this.At,this.cs.At),r=pi(yt(yi(this.Ua(),this.oi()),this.At,this.cs.At),s);return Um(t,e,r.x,r.y,i)},this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e}Os(){super.Os();const t=this.Yo.C(),e=this.fa(),i=this.Ma.u||this.Z.u||this.ka.u||this.Fa.u,s=this.Pe,r=this.ma(),n=s.getThickness(),o=this.ka.C();this.Vz.$O(this.At);const h=this.At.Ni();if(i){const t=this.Z.C();this.Ka=function(t,e,i,s,r){const n=((t,e,i)=>[t,u(t.x+e,t.y),u(t.x+e,t.y+i),u(t.x,t.y+i)])(t,e,i);if(0!==s||s%360!=0){const t=s*Math.PI/180;n[0]=ui(n[0],r,t),n[1]=ui(n[1],r,t),n[2]=ui(n[2],r,t),n[3]=ui(n[3],r,t)}return n}(this.Ma.C(),t.x,t.y,o,this.Fa.C());const e=ne(this.Ka,this.At._i());this.JG=this.lz.zO(e,!1,this.JG),this.qG=this.Ka.length,this.OY=ni(this.Ka)}const a=this.jG.fillStyleSolid(e),l=this.jG.fillStyleRadialGradient(e),c=this.jG.fillStyleLinearGradient(e),d=this.jG.fillStyleImage(e),f=a||l||c||d;e&&(this.eU=f?this.lz.VV(sm["2D"],a&&sm.Color({dataType:"uniform"}),c&&sm.Color({dataType:["gradient",c]}),l&&sm.Color({dataType:["gradient",l]}),d&&sm.Color({dataType:["image",d]}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),l?this.iU=_m(this.$o||this.OY,this.At,l.getPosition(),l.getExtent(),l.getShape(),this.lz.MO()):c?this.sU=Bm(this.$o||this.OY,this.At,c.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0),this.zY=this.lz.AG(this,this.zY,d,void 0,h||i,this.VY);const g=this.jG.strokeStyleSolid(r),m=this.jG.strokeFillSolid(r),y=this.jG.strokeFillLinearGradient(r),p=this.jG.strokeFillRadialGradient(r),A=g,x=m||y||p;if(A&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.hU,this.NY]=[this.Ka,void 0];else{const t=this.At;[this.hU,this.NY]=t instanceof Hi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Wi(s,r,h,-h),i.Wi(r,s,-h,-h),i.Wi(o,n,-h,-h),i.Wi(n,o,h,-h),i.Wi(s,r,-h,h),i.Wi(r,s,h,h),i.Wi(o,n,h,h),i.Wi(n,o,-h,h)],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Ka,n,t):((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=u(e.x*i*.5,e.y*i*.5),a=di(ci(r,s)),l=di(ci(o,s)),c=Si(a),d=Si(l);return[[yi(s,yi(mi(c,h.x),mi(d,h.y))),yi(r,yi(mi(a,h.x),mi(d,h.y))),yi(o,yi(mi(c,h.x),mi(l,h.y))),yi(n,yi(mi(a,h.x),mi(l,h.y))),yi(s,yi(mi(a,h.x),mi(l,h.y))),yi(r,yi(mi(c,h.x),mi(l,h.y))),yi(o,yi(mi(a,h.x),mi(d,h.y))),yi(n,yi(mi(c,h.x),mi(d,h.y)))],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Ka,t.Ui(),n)}this.nU=this.lz.zO(ne(this.hU,this.At._i()),!1,this.nU),this.NY?(this.GU=this.lz.yN(new Uint16Array(this.NY),this.GU),this.rU=this.NY.length):(this.GU&&this.lz.jO(this.GU),this.GU=void 0,this.rU=this.hU.length)}return r&&(this.dU=A&&x?this.lz.VV(sm["2D"],sm.Color({dataType:p?["gradient",p]:y?["gradient",y]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),p?this.uU=_m(this.OY,this.At,p.getPosition(),p.getExtent(),p.getShape(),this.lz.MO()):y?this.cU=Bm(this.OY,this.At,y.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),this.fU=t&&f?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.AU=t&&this.Pe!==ut?this.AU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.ya(this.Ie),this.xa(s),this.Ma.u=!1,this.ka.u=!1,this.Z.u=!1,this.Fa.u=!1,this}WE(t,e){const i=1===t?this.fU:this.eU,s=this.JG,r=this.qG,n=this.jG.fillStyleSolid(!1),o=this.jG.fillStyleRadialGradient(!1),h=this.jG.fillStyleLinearGradient(!1),a=this.jG.fillStyleImage(!1);i&&s&&r&&this.Ie!==_&&(this.lz.bz(i),this.lz.OO(i,((i,l,u,c)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(c("uScaleStart_highpart"),this.Vz.yG()).GO(c("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(c("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(c("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(c("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(c("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(i("uFirstId"),e).nG(u,1);else if(n)this.lz.iL(i("uColor"),n.getColor());else if(o){if(!this.iU)return!1;this.lz.ZN(u,this.iU,o)}else if(h){if(!this.sU)return!1;this.lz.QN(u,this.sU,h)}else if(a){if(!this.zY)return!1;const t=this.zY&&this.zY.texture.vO();this.lz.iL(c("uColor"),a.getSurroundingColor()).UO(i("uColorTexture"),t||this.zY.sourceMissingTexture,0).NO(this.zY.texCoordsBuffer,void 0,{location:l("aTextureCoord"),size:2}).cN(a.fitMode)}return this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).qN(u,s,this.At._i(),void 0).om(this.lz.gl.TRIANGLE_FAN,r),!0})));const l=1===t?this.AU:this.dU,u=this.jG.strokeStyleSolid(!1),c=this.jG.strokeFillSolid(!1),d=this.jG.strokeFillLinearGradient(!1),f=this.jG.strokeFillRadialGradient(!1),g=this.nU;return l&&g&&u&&(this.lz.bz(l),this.lz.OO(l,((i,s,r,n)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(n("uScaleStart_highpart"),this.Vz.yG()).GO(n("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(n("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(n("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(n("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(n("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(i("uFirstId"),e).nG(r,1);else if(c)this.lz.iL(i("uColor"),c.getColor());else if(f){if(!this.uU)return!1;this.lz.ZN(r,this.uU,f)}else if(d){if(!this.cU)return!1;this.lz.QN(r,this.cU,d)}return this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).qN(r,g,this.At._i(),void 0),this.GU?this.lz.wN(this.GU).kN(this.rU):this.lz.om(this.lz.gl.LINE_LOOP,this.rU),!0}))),{idCount:1}}HG(t,e,i,s,r){return{}}dz(){return this.GU&&(this.lz.jO(this.GU),this.GU=void 0),this.JG&&(this.lz.jO(this.JG),this.JG=void 0),this.nU&&(this.lz.jO(this.nU),this.nU=void 0),this.zY=this.lz.gG(this,this.zY),this.eU=void 0,this.dU=void 0,this.fU=void 0,this.AU=void 0,this}St(){return Math.max(this.Ma.C().x,this.Ma.C().x+this.Z.C().x)}vt(){return Math.min(this.Ma.C().x,this.Ma.C().x+this.Z.C().x)}bt(){return Math.max(this.Ma.C().y,this.Ma.C().y+this.Z.C().y)}xt(){return Math.min(this.Ma.C().y,this.Ma.C().y+this.Z.C().y)}Pl(){return Re(this.Pe)}Dl(){return Re(this.Pe)}}class zy extends bn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie,fillStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,fillStyleLinearGradient:()=>at(this.Ie)&&this.Ie,fillStyleImage:()=>tt(this.Ie)&&this.Ie,strokeLineStyleSolid:()=>cs(this.Pe)&&this.Pe,strokeLineSolidFill:()=>{const t=this.Pe.getFillStyle();return U(t)&&t},strokeLinearGradientFill:()=>{const t=this.Pe.getFillStyle();return at(t)&&t},strokeRadialGradientFill:()=>{const t=this.Pe.getFillStyle();return nt(t)&&t}}),this.VY=(t,e,i)=>{const s=yt({x:this.el.min.x,y:this.el.min.y},this.At,this.cs.At),r=yt({x:this.el.max.x,y:this.el.max.y},this.At,this.cs.At),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Um(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Ka.length),d=this.el.max.x-this.el.min.x,f=this.el.max.y-this.el.min.y,g=a-l,m=u-h;let y=0;for(const t of this.Ka){const e=l+g*((t.x-this.el.min.x)/d),i=h+m*((t.y-this.el.min.y)/f);c[y]=e,c[y+1]=i,y+=2}return c},this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e}hd(t){let e,i=Number.MAX_VALUE;for(const s of this.Ka){const r=ei(yt(s,this.At,this.cs.At),t);r=3,r=this.Pe,n=this.ma(),o=r.getThickness(),a=this.Sa(o);this.Vz.$O(this.At),this.PT=this.At.Ui();const l=this.At.Ni();if(i&&(this.el=ni(this.Ka)),i&&s){const t=ne(this.Ka,this.At._i());this.JG=this.lz.zO(t,!1,this.JG),this.GY=new Uint16Array(h.default(t)),this.UY=this.lz.yN(this.GY,this.UY),this.qG=this.GY.length}const u=this.jG.fillStyleSolid(e),c=this.jG.fillStylePaletted(e),d=this.jG.fillStyleRadialGradient(e),f=this.jG.fillStyleLinearGradient(e),g=this.jG.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.eU=m?this.lz.VV(sm["2D"],u&&sm.Color({dataType:"uniform"}),f&&sm.Color({dataType:["gradient",f]}),d&&sm.Color({dataType:["gradient",d]}),c&&sm.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&sm.Color({dataType:["image",g]}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),d?this.iU=_m(this.$o||this.el,this.At,d.getPosition(),d.getExtent(),d.getShape(),this.lz.MO()):f?this.sU=Bm(this.$o||this.el,this.At,f.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0),this.zY=this.lz.AG(this,this.zY,g,void 0,l||i,this.VY),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Ka:ty(this.Ka,this.PT,o);this.hU=ne(t,this.At._i()),this.nU=this.lz.zO(this.hU,!0,this.nU),this.rU=t.length}const y=this.jG.strokeLineStyleSolid(n),p=this.jG.strokeLineSolidFill(n),A=this.jG.strokeLinearGradientFill(n),x=this.jG.strokeRadialGradientFill(n),S=y,v=p||A||x;return n&&(this.dU=S&&v?this.lz.VV(sm["2D"],sm.Color({dataType:x?["gradient",x]:A?["gradient",A]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),x?this.uU=_m(this.$o||this.el,this.At,x.getPosition(),x.getExtent(),x.getShape(),this.lz.MO()):A?this.cU=Bm(this.$o||this.el,this.At,A.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),this.fU=t&&m?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.AU=t&&this.Pe!==ut?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.Tl=!1,this.ya(this.Ie),this.xa(r),this}WE(t,e){const i=1===t?this.fU:this.eU,s=this.JG,r=this.qG,n=this.jG.fillStyleSolid(!1),o=this.jG.fillStyleRadialGradient(!1),h=this.jG.fillStyleLinearGradient(!1),a=this.jG.fillStylePaletted(!1),l=this.jG.fillStyleImage(!1);i&&s&&r&&this.lz.bz(i).OO(i,((i,r,u,c)=>{if(this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(c("uScaleStart_highpart"),this.Vz.yG()).GO(c("uScaleStart_lowpart"),this.Vz.mG()).qN(u,s,this.At._i(),void 0).wN(this.UY).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t)this.lz.uN(i("uFirstId"),e).nG(u,1);else if(n)this.lz.iL(i("uColor"),n.getColor());else if(o){if(!this.iU)return!1;this.lz.ZN(u,this.iU,o)}else if(h){if(!this.sU)return!1;this.lz.QN(u,this.sU,h)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.lz.fG(u,a.lut,t)}else if(l){if(!this.zY)return!1;this.lz.iL(c("uColor"),l.getSurroundingColor()).UO(i("uColorTexture"),this.zY.texture.vO()||this.zY.sourceMissingTexture,0).NO(this.zY.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).cN(l.fitMode)}return this.lz.kN(this.qG),!0}));const u=1===t?this.AU:this.dU,c=this.Pe,d=this.nU,f=this.rU;return u&&d&&f&&this.lz.bz(u).OO(u,((i,s,r,n)=>{this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).qN(r,d,this.At._i(),void 0);const o=c.getFillStyle();if(1===t)this.lz.uN(i("uFirstId"),e).nG(r,1);else if(U(o))this.lz.iL(i("uColor"),o.getColor());else if(nt(o)){if(!this.uU)return!1;this.lz.ZN(r,this.uU,o)}else if(at(o)){if(!this.cU)return!1;this.lz.QN(r,this.cU,o)}const h=c.getThickness(),a=-1===h||1===h;return this.lz.om(a?this.lz.gl.LINE_LOOP:this.lz.gl.TRIANGLE_STRIP,this.rU),!0})),{idCount:1}}HG(t,e,i,s,r){return{}}dz(){return this.UY&&(this.lz.jO(this.UY),this.UY=void 0),this.JG&&(this.lz.jO(this.JG),this.JG=void 0),this.nU&&(this.lz.jO(this.nU),this.nU=void 0),this.eU=void 0,this.dU=void 0,this.fU=void 0,this.AU=void 0,this.zY=this.lz.gG(this,this.zY),this}}const Fy=(t,e)=>{let i=0;const s=[];for(;i0;n-=o?1:0,n-=i+n{let i=0;const s=[];for(;i0;n-=o?1:0,n-=0;const h=Math.min(n,t-r),a=i-(o?1:0),l={start:a,startUnique:r,sizeData:Math.min(e,t-a),sizeUniqueData:h};s.push(l),i+=h}return s},Dy=(t,e,i,s)=>{if(i){const t=new Map;return e.gridTiles.forEach((e=>{t.set(e,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:e.sizeHeatmapDataVectors}]})})),t}const r=new Map;for(let i=0;i{const e=t.iFirstVector,i=s(t),o={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},h=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ze(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const c=(d=a,f=h,m(u(Math.max(Math.min(d[0].x,d[2].x),Math.min(f[0].x,f[2].x)),Math.max(Math.min(d[0].y,d[2].y),Math.min(f[0].y,f[2].y))),u(Math.min(Math.max(d[0].x,d[2].x),Math.max(f[0].x,f[2].x)),Math.min(Math.max(d[0].y,d[2].y),Math.max(f[0].y,f[2].y)))));var d,f;const g={primary:c.min.x-e.primary,secondary:c.min.y-e.secondary},y={primary:1+c.max.x-c.min.x,secondary:1+c.max.y-c.min.y};let p=!1;const A=[{x:g.primary,y:g.secondary},{x:g.primary+y.primary,y:g.secondary},{x:g.primary+y.primary,y:g.secondary+y.secondary},{x:g.primary,y:g.secondary+y.secondary}];for(let t=0;t{if(1!==t.length||0!==e.startPrimary||0!==e.startSecondary||e.lengthPrimary!==t[0].sizeHeatmapDataVectors.primary||e.lengthSecondary!==t[0].sizeHeatmapDataVectors.secondary)t.forEach((t=>{const s=i(t),r=Math.max(e.startPrimary,t.iFirstVector.primary),n=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),h=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=r;i<=n;i+=1){const r=i-e.startPrimary,n=e.values[r],a=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=h;i+=1){const r=i-e.startSecondary,o=i-t.iFirstVector.secondary,h=n[r];s[a+o]=h}}}));else{const s=t[0],r=i(s);for(let t=0;t{var s,r;const n=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(n)return t.XN(null,n.RED,!1,!0,{x:e,y:i},!1,n.FLOAT,n.R32F);const o=t.gl;return(null===(r=t.gl1)||void 0===r?void 0:r.optional.OES_texture_float)?t.XN(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.XN(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Ly=(t,e,i,s)=>{e.forEach(((e,r)=>{var n,o;const h=i(r),a=s(r),l=t.gl;l.bindTexture(l.TEXTURE_2D,a),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(n=t.gl2)||void 0===n?void 0:n.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/r.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*r.sizeHeatmapDataVectors.secondary,n=s+e.tileInvalidationLength.primary*r.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,h.subarray(s,n));else if(null===(i=t.gl1)||void 0===i?void 0:i.optional.OES_texture_float)l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,h.subarray(s,n));else{const t=new Uint8Array(h.buffer).subarray(4*s,4*n);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,h):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,h):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(h.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class _y extends mn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.WY=p("bilinear"),this.Pi={x:0,y:0},this.Cw={x:1,y:1},this.FS=Ur.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.io={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}ES(t){return this.WY._(t),this}zS(){return this.WY.C()}BS(t,e){return this.Pi=t,this.Cw=e,this}LS(){return{start:this.Pi,step:this.Cw,end:{x:this.Pi.x+this.Cw.x*this.io.columns,y:this.Pi.y+this.Cw.y*this.io.rows}}}IS(t){return this.FS="function"==typeof t?t(this.FS):t,this}RS(){return this.FS}}class By extends _y{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Vz=new $m,this.KU={},this.YY=[],this.HY=!1,this.al=!1,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie,wireframeStyleLine:()=>cs(this.FS)&&this.FS,wireframeStyleFill:()=>{const t=this.FS&&this.FS.getFillStyle();return U(t)&&t}}),this.$Y=Fy,this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e;const o=Math.min(this.lz.cz,void 0!==n.jY?n.jY:2048),h={x:Math.min(o,this.io.primaryDimensionVectorsCount),y:Math.min(o,this.io.secondaryDimensionVectorsCount)},a=((t,e,i)=>{const s=[],r=i(t.primaryDimensionVectorsCount,e.x),n=i(t.secondaryDimensionVectorsCount,e.y);let o;return r.forEach((t=>n.forEach((e=>{const i={iFirstVector:{primary:t.start,secondary:e.start},iFirstUniqueVector:{primary:t.startUnique,secondary:e.startUnique},sizeHeatmapDataVectors:{primary:t.sizeData,secondary:e.sizeData},sizeUniqueHeatmapDataVectors:{primary:t.sizeUniqueData,secondary:e.sizeUniqueData}};s.push(i)})))),o=[],s.forEach((t=>{let e=o.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},o.push(e)),e.tiles.push(t)})),{gridTiles:s,gridTileSizes:o}})(this.io,h,this.$Y),l=a.gridTiles.map((t=>{const e=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,intensityData:e,hasIntensityData:!1}})),u=a.gridTileSizes.map((t=>({...t,tiles:l.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary))})));this.ZY={gridTiles:l,gridTileSizes:u},this.BS(this.Pi,this.Cw)}Os(){const t=this.YY,e=this.Ie,i=this.fa(),s=this.FS,r=s!==this.QY,n=this.jG.fillStylePaletted(i),o=this.jG.fillStyleSolid(i),h=this.WY.u,a=this.WY.C(),l=this.al,u=this.Yo.C();this.JY=this.JY||this.KY();const c=this.JY,d=Dy(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Ly(this.lz,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.HY=!0),this.Vz.$O(this.At);const f=this.KU;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.lz.VV(sm["2D"],sm.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.io.dataOrder,intensityTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),flipXY:"rows"===this.io.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.lz.VV(sm["2D"],sm.Color({dataType:"uniform"}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),flipXY:"rows"===this.io.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.jG.wireframeStyleLine(r),e=this.jG.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.lz.VV(sm["2D"],sm.Color({dataType:"uniform"}),sm.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.io.dataOrder,axisWorldTranslation:wg(this.At),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.lz.VV(sm["2D"],sm.Color({dataType:"uniform"}),sm.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.io.dataOrder,axisWorldTranslation:wg(this.At),normalSource:void 0})),geometry:cy(this.lz,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.qY=this.qY||this.tH():this.qY&&(this.lz.jO(this.qY.wireframeCoordinatesBuffer),this.qY=void 0)}if(f.mousePicking=u?this.KU.mousePicking||{shader:this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),flipXY:"rows"===this.io.dataOrder,normalSource:void 0}))}:void 0,this.KU=f,void 0===this.ll&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Ye,e=He;this.JY.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.ll={min:t,max:e}}return this.al=!1,this.YY.length=0,this.ya(e),this.QY=s,this.WY.u=!1,this}KY(){const t=this.ZY.gridTiles.map((t=>{const e=Oy(this.lz,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.ZY.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.lz.zO([0,0,1,0,0,1,1,1]),s=this.lz.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}tH(){const t=this.io.primaryDimensionVectorsCount+1+this.io.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.io.dataOrder?{x:this.Pi.x+this.Cw.x*t.iFirstVector.primary,y:this.Pi.y+this.Cw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.Cw.x*t.iFirstVector.secondary,y:this.Pi.y+this.Cw.y*t.iFirstVector.primary},i="columns"===this.io.dataOrder?{x:this.Cw.x*t.sizeHeatmapDataVectors.primary,y:this.Cw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Cw.x*t.sizeHeatmapDataVectors.secondary,y:this.Cw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.io.dataOrder?{x:this.Pi.x+this.Cw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.Cw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.Cw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.Cw.y*t.iFirstUniqueVector.primary},n="columns"===this.io.dataOrder?{x:this.Cw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Cw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Cw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Cw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.iH={boundaries:s,tilesInfo:r},this}WE(t,e){var i,s;const r=this.JY,n=this.iH,o=1===t?null===(i=this.KU.mousePicking)||void 0===i?void 0:i.shader:null===(s=this.KU.tile)||void 0===s?void 0:s.shader;if(this.KU.tile&&o&&r&&n){const i=o,s=this.KU.tile,h={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.Cw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.Cw.y)},a={x:h.x/this.io.columns,y:h.y/this.io.rows},l=this.At.Ui(),u={x:a.x/l.x,y:a.y/l.y};if("solid"===s.renderMode||1===t)this.lz.bz(i).OO(i,((i,n,o)=>{if(1===t)this.lz.uN(i("uFirstId"),e).nG(o,1);else if("solid"===s.renderMode){const{fillStyleSolid:t}=s;this.lz.iL(i("uColor"),t.getColor())}return this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).NO(r.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).GO(i("uScaling"),[this.Cw.x*this.io.columns,this.Cw.y*this.io.rows]).GO(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).om(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),!0}));else if("paletted"===s.renderMode){const{fillStylePaletted:e}=s,o=this.ll;this.lz.OO(i,((s,h,a)=>{let l=!1;var c,d;return this.lz.bz(i).GO(s("uScale"),this.Vz.YO()).GO(s("uDisp"),this.Vz.HO()).fG(a,e.lut,o).NO(r.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).WO(s("uIsHighlighted"),this.jo).iL(s("uHighlightColorOffset"),2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0),c=t=>{this.lz.GO(s("uTileDimensions"),["columns"===this.io.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.io.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const i=n.tilesInfo.get(t.tileData);if(!i)return;let o;const h=this.lz.MO();if("bilinear"===this.WY.C()){const t=(this.At.x.ft(i.startLocationAxis.x)+u.x/2)*h,e=(this.At.y.ft(i.startLocationAxis.y)+u.y/2)*h;o=[t,e,(this.At.x.ft(i.startLocationAxis.x+i.sizeAxis.x)-u.x/2)*h-t,(this.At.y.ft(i.startLocationAxis.y+i.sizeAxis.y)-u.y/2)*h-e]}else{const t=this.At.x.ft(i.startLocationAxis.x)*h,e=this.At.y.ft(i.startLocationAxis.y)*h;o=[t,e,this.At.x.ft(i.startLocationAxis.x+i.sizeAxis.x)*h-t,this.At.y.ft(i.startLocationAxis.y+i.sizeAxis.y)*h-e]}this.lz.nN(s("uTileBounds"),o).GO(s("uScaling"),[i.renderSizeAxis.x,i.renderSizeAxis.y]).GO(s("uTranslationAxis"),[i.startRenderLocationAxis.x,i.startRenderLocationAxis.y]).UO(s("uTileIntensityValues"),t.intensityDataTexture,1).om(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),l=!0},r.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),l}))}}const h=this.qY,a=this.KU.wireframe,l=1===t||null==a?void 0:a.shader;if(h&&a&&l&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.lz.bz(l).OO(l,((i,s,r)=>((this.At instanceof Yi||this.At instanceof Wc)&&this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()),this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).iL(i("uColor"),e.getColor()).NO(h.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).GO(i("uScaling"),[this.Cw.x,this.Cw.y]).GO(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).om(this.lz.gl.LINES,2*h.wireframeSegmentsLength),!0)))}else if(h&&a&&l&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.lz.bz(l).OO(l,((r,n,o)=>((this.At instanceof Yi||this.At instanceof Wc)&&this.lz.GO(r("uScale"),this.Vz.YO()).GO(r("uDisp"),this.Vz.HO()),this.lz.WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0).iL(r("uColor"),s.getColor()).WO(r("uThicknessPixels"),i.getThickness()).GO(r("uRatioPxClip"),[2/this.cs.oi().x,2/this.cs.oi().y]).NO(h.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).GO(r("uScaling"),[this.Cw.x,this.Cw.y]).GO(r("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.bz(o,!1).om(h.wireframeSegmentsLength),!0)))}return{idCount:1}}HG(t,e,i,s,r){return{}}VS(t){return this.YY.push(t),Py(this.ZY.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.ll=void 0,this}Ot(){return this.HY&&(this.ZY.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.al=!0,this.HY=!1,this.ll=void 0),this}dispose(){super.dispose();const t=this.JY;t&&(t.gridTiles.forEach((t=>{this.lz.fz(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.lz.jO(t.rectangleLocationsBuffer)),this.JY=void 0;const e=this.qY;return e&&this.lz.jO(e.wireframeCoordinatesBuffer),this.qY=void 0,this.KU={},this}dz(){return this.dispose(),this}hd(t){const e=t,i="columns"===this.io.dataOrder?e.x:e.y,s="columns"===this.io.dataOrder?e.y:e.x,r="columns"===this.io.dataOrder?this.Pi.x:this.Pi.y,n="columns"===this.io.dataOrder?this.Pi.y:this.Pi.x;let o=(i-r)/("columns"===this.io.dataOrder?this.Cw.x:this.Cw.y),h=(s-n)/("columns"===this.io.dataOrder?this.Cw.y:this.Cw.x);o=Math.floor(_t(o,0,this.io.primaryDimensionVectorsCount-1)),h=Math.floor(_t(h,0,this.io.secondaryDimensionVectorsCount-1));const a=this.sH(o,h),l="columns"===this.io.dataOrder?{x:this.Pi.x+(o+.5)*this.Cw.x,y:this.Pi.y+(h+.5)*this.Cw.y}:{x:this.Pi.x+(h+.5)*this.Cw.x,y:this.Pi.y+(o+.5)*this.Cw.y},u="columns"===this.io.dataOrder?o:h,c="columns"===this.io.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}sM(t){const e=this.iH;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.io.dataOrder?i.x:i.y,r="columns"===this.io.dataOrder?i.y:i.x,n="columns"===this.io.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.io.dataOrder?this.Pi.y:this.Pi.x,h="columns"===this.io.dataOrder?this.Cw.x:this.Cw.y,a="columns"===this.io.dataOrder?this.Cw.y:this.Cw.x,l=_t((s-n)/h-.5,0,this.io.primaryDimensionVectorsCount-1),u=_t((r-o)/a-.5,0,this.io.secondaryDimensionVectorsCount-1),c=_t(Math.ceil(l)-1,0,this.io.primaryDimensionVectorsCount-1),d=_t(Math.ceil(u)-1,0,this.io.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.sH(c,d)},g={point:{x:c,y:d+1},value:this.sH(c,d+1)},m={point:{x:c+1,y:d},value:this.sH(c+1,d)},y={point:{x:c+1,y:d+1},value:this.sH(c+1,d+1)},p=Qn({x:l,y:u},f,g,m,y);if(void 0===p)return;const A=_t(Math.floor(l+.5),0,this.io.primaryDimensionVectorsCount-1),x=_t(Math.floor(u+.5),0,this.io.secondaryDimensionVectorsCount-1),S="columns"===this.io.dataOrder?A:x,v="columns"===this.io.dataOrder?x:A,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}sH(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}return 0}St(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.min.x)||0}bt(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.max.y)||0}xt(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.min.y)||0}Pl(){return 0}Dl(){return 0}f_(){const t=[];return this.ZY.gridTiles.forEach((e=>{if(!e.hasIntensityData)return;const i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((t=>new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)));for(let t=0;t0?"ProgressiveX":"RegressiveX":this.Cw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.iY=new vy(this.At,this));const t=this.iY.$W(this.GM,this.Fu.C());if(t>0){for(let e=0;e0?this.GM[0].boundaries.min.x:Ye:this.el.min.y=this.GM.length>0?this.GM[0].boundaries.min.y:Ye}this.GM.forEach((t=>t.shape.Os()));const e=this.GM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Vt(null===(i=e.shape.ll)||void 0===i?void 0:i.min,Ye)),t.max=Math.max(t.max,Vt(null===(s=e.shape.ll)||void 0===s?void 0:s.max,He)),t}),{min:Ye,max:He});return this.GM.forEach((t=>{t.shape.ll=e})),this.Fu.u=!1,this}WE(t,e){let i=0;return this.GM.forEach((s=>{const{idCount:r}=s.shape.WE(t,e+i);void 0!==r&&(i+=r)})),{idCount:i}}HG(t,e,i,s,r){return{}}WS(t){if(0===t.length)return this;let e=0;const i=this.hH.dataPerSegment,s=t.length;do{let r=this.GM[this.GM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.io.scrollDimension?i:this.io.resolution,rows:"rows"===this.io.scrollDimension?i:this.io.resolution,heatmapDataType:this.io.heatmapDataType,dataOrder:this.io.scrollDimension};let e="columns"===this.io.scrollDimension?{x:this.Pi.x+this.Cw.x*this.eH,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.Cw.y*this.eH};this.GM.length>0&&(e="columns"===this.io.scrollDimension?{x:e.x-1*this.Cw.x,y:e.y}:{x:e.x,y:e.y-1*this.Cw.y},o=!0);const s=new By(this.OG,this.NG,this.At,Ot,[],t).ES(this.WY.C()).Re(this.Ie).IS(this.FS).BS(e,this.Cw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.eH,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.xt()},max:{x:s.St(),y:s.bt()}}},this.GM.push(r),n=i-(o?1:0)}const h=s-e,a=Math.min(n,h),l=t.slice(e,e+a),u={type:"intensity",values:l,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:a,lengthSecondary:this.io.resolution};o&&(u.values.unshift(this.rH),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.VS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.rH=l[l.length-1],this.eH+=a,e+=a}while(e{const n=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const h=i-n,a=Math.min(s,o),l=a-h+1,u=e.slice(h-i,a-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:r,startPrimary:h,lengthPrimary:l,values:u};t.shape.VS(c)}));const n=this.eH-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().dz()})),this.GM.length=0,this.el="columns"===this.io.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.io.resolution*this.Cw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.io.resolution*this.Cw.x,y:this.Pi.y}),this.eH=0,this.rH=void 0,this}BS(t,e){return super.BS(t,e),this.GM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.BS(r,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.xt()},max:{x:i.shape.St(),y:i.shape.bt()}}})),this.GM.length>0?this.el=hi(...this.GM.map((t=>t.boundaries))):this.el="columns"===this.io.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.io.resolution*this.Cw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.io.resolution*this.Cw.x,y:this.Pi.y}),this}Re(t){return super.Re(t),this.GM.forEach((t=>t.shape.Re(this.Ie))),this}IS(t){return super.IS(t),this.GM.forEach((t=>t.shape.IS(this.FS))),this}ES(t){return super.ES(t),this.GM.forEach((e=>e.shape.ES(t))),this}dispose(){return super.dispose(),this.GM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.GM.forEach((e=>e.shape.setVisible(t))),this}dz(){return this.GM.forEach((t=>t.shape.dz())),this}hd(t){const e=yt(t,this.At,this.engine.At),i=this.GM.reduce(((i,s)=>{const r=s.shape.hd(t);if(r){const t=ii(yt(r,this.At,this.engine.At),e);if(void 0===i||t=this.eH||"rows"===this.io.scrollDimension&&e>=this.eH)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}sM(t){const e=yt(t,this.At,this.engine.At),i=this.GM.reduce(((i,s)=>{const r=s.shape.sM(t);if(r){const t=ii(yt(r,this.At,this.engine.At),e);if(void 0===i||t=this.eH||"rows"===this.io.scrollDimension&&e>=this.eH)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return 0}Dl(){return 0}ds(t){return super.ds(t),this.GM.forEach((e=>e.shape.ds(t))),this}}class Ny extends mn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.WY=p("bilinear"),this.FS=Ur.lineStyle,this.io=n}ES(t){return this.WY._(t),this}zS(){return this.WY.C()}IS(t){return this.FS="function"==typeof t?t(this.FS):t,this}RS(){return this.FS}}class Uy extends Ny{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Vz=new $m,this.KU={},this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e,this.c_=new By(this.OG,t.nH,t.At,Ot,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",jY:this.lz.cz}).IS(ut);const o=2*Math.PI/360,h=new Float32Array(724);let a=0;h[a+0]=0,h[a+1]=0,a+=2;for(let t=0;t<=360;t+=1){const e=t*o,i=Math.cos(e),s=Math.sin(e);h[a+0]=i,h[a+1]=s,a+=2}this.oH={vertexBuffer:this.lz.zO(h),drawMode:this.lz.gl.TRIANGLE_FAN,drawLength:362}}Os(){const t=this.fa(),e=this.Ie,i=this.jG.fillStyleSolid(t),s=this.jG.fillStylePaletted(t),r=i||s,n=this.WY.C(),o=this.WY.u,h=this.Yo.C(),a=this.Yo.u;return this.Vz.$O(this.At),this.c_.Os(),this.c_.JY?((t||o)&&(this.KU.fill=r?{shader:this.lz.VV(sm["2D"],sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),normalSource:void 0}),s&&sm.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.io.dataOrder,lut:s.lut}),i&&sm.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.KU.mousePicking=h?{shader:this.lz.VV(sm["2D"],sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),normalSource:void 0}),sm.MousePicking())}:void 0),this.ya(e),this.WY.u=!1,this.Yo.u=!1,this):this}WE(t,e){var i;const{vertexBuffer:s,drawLength:r,drawMode:n}=this.oH,o=this.c_.JY;if(!this.KU.fill||!o)return{};const{fillStylePaletted:h,fillStyleSolid:a}=this.KU.fill,l=1===t?null===(i=this.KU.mousePicking)||void 0===i?void 0:i.shader:this.KU.fill.shader;if(!l)return{};const u=this.At.zb(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this.io.amplitudeStart,this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep),g=Math.max(this.io.amplitudeStart,this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep);let m;return m=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.lz.bz(l).OO(l,((i,l,u,c)=>{if(this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).GO(c("uViewportSize"),[this.OG.oi().x*this.lz.MO()/(1===t?this.cs.io.ho:1),this.OG.oi().y*this.lz.MO()/(1===t?this.cs.io.ho:1)]).GO(i("uScaling"),[m,m]).GO(i("uTranslationAxis"),[0,0]).NO(s,void 0,{location:l("aPos"),size:2}).WO(c("uAngleOffset"),this.At.Ub()%(2*Math.PI)).WO(c("uAngleDirection"),this.At.$b()?1:-1).WO(c("uSectors"),this.io.sectors).WO(c("uAnnuli"),this.io.annuli),1===t)this.lz.uN(i("uFirstId"),e).nG(u,1);else{if(h){const t=this.c_.ll;this.lz.WO(i("uAmplitudeStart"),this.io.amplitudeStart).WO(i("uAmplitudeStep"),this.io.amplitudeStep).WO(i("uAmplitudeAxisStart"),this.At.zb().start).WO(i("uAmplitudeAxisEnd"),this.At.zb().end).fG(u,h.lut,t).UO(i("uTileIntensityValues"),o.gridTiles[0].intensityDataTexture,0)}a&&this.lz.iL(i("uColor"),a.getColor())}return this.lz.om(n,r),!0})),{idCount:1}}HG(t,e,i,s,r){return{}}VS(t){return this.c_.VS(t),this}Ot(){return this.c_.Ot(),this}dispose(){return super.dispose(),this.c_.dispose(),this.KU={},this.lz.jO(this.oH.vertexBuffer),this}dz(){return this.dispose(),this}Re(t){return super.Re(t),this.c_.Re(this.Ie),this}hd(t){const e=this.io.amplitudeStart,i=this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);(t.angle<0||t.angle>360||t.amplituder)&&(t.angle=_t(t.angle,0,360),t.amplitude=_t(t.amplitude,r,r));let n=Math.round((t.angle-0)/360*this.io.sectors);n>=this.io.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.io.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.sH(o,n),angle:n*(360/this.io.sectors),amplitude:e+o*(i-e)/(this.io.annuli-1)}}sM(t){const e=this.io.amplitudeStart,i=this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);(t.angle<0||t.angle>360||t.amplituder)&&(t.angle=_t(t.angle,0,360),t.amplitude=_t(t.amplitude,r,r));const n=(t.angle-0)/360*this.io.sectors,o=(t.amplitude-e)/(i-e)*(this.io.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.sH(a,h)},u={point:{x:a,y:h+1},value:this.sH(a,h+1)},c={point:{x:a+1,y:h},value:this.sH(a+1,h)},d={point:{x:a+1,y:h+1},value:this.sH(a+1,h+1)},f=Qn({x:o,y:n},l,u,c,d);if(void 0!==f)return{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}}sH(t,e){const i="annuli"===this.io.dataOrder?t:e,s="annuli"===this.io.dataOrder?e:t;for(let t=0;t=e.iFirstVector.primary&&i<=e.iFirstVector.primary+e.sizeHeatmapDataVectors.primary-1&&s>=e.iFirstVector.secondary&&s<=e.iFirstVector.secondary+e.sizeHeatmapDataVectors.secondary-1){const t=i-e.iFirstVector.primary,r=s-e.iFirstVector.secondary,n=t*e.sizeHeatmapDataVectors.secondary+r;return e.intensityData[n]}}return 0}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Pl(){return 0}Dl(){return 0}}class Yy extends Vm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.OU();this.NU=t.zO(e),this.UU=s,this.WU=i}bz(t){return this.lz.NO(this.NU,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}om(t,e,i){return this.lz.TN(void 0!==e?e:this.WU,i||0,this.UU,t),this}OU(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.lz.gl.TRIANGLES,drawSize:6}}rO(){this.lz.jO(this.NU)}}const Hy=t=>{let e=t.iN.iO.get(void 0);return e||(e=new Yy(t),t.iN.iO.set(void 0,e),e)};class Xy extends wn{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.aH=Ur.fillStyle,this.lH=p("bottom"),this.uH=Ur.fillStyle,this.cH=p(e.PointShape.Circle),this.dH=p(5),this.fH=p(0),this.AH=p(void 0),this.XC=!0,this.gH={x:0,y:0}}tk(t){this.lH.C()!==t&&this.lH._(t)}Md(t){return this.aH=dn(this.aH,t),this}jC(){return this.aH}pH(){return fn(this.yH,this.aH)}mH(){return fn(this.vH,this.uH)}bd(t){return this.uH=dn(this.uH,t),tt(this.uH)&&(this.wd(e.PointShape.Square),this.Id(1)),this}Fd(){return this.uH}wd(t){return this.cH._(t),po(this.cH.C())&&this.Id(1),this}Cd(){return this.cH.C()}Id(t){return this.dH._(t),this}ZC(){return this.dH.C()}kd(t){return this.fH._(t),this}Td(){return this.fH.C()}QC(t){return this.gH=t,this}JC(){return this.gH}HC(t){return this.AH._(t),this}KC(){return this.AH.C()}}class Wy extends yy{constructor(t,e){super(t,e),this.MW=!1,this._W={enabled:!1,totalDataPointsAtTime:0},this.kW=t instanceof Yi?{type:"linear",scale:t}:{type:"unknown"},this.bW.ta("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.MW=!0)}))}SH(t,e){const i=null==t?void 0:t.zc,s=null==t?void 0:t.Vc,r=null==t?void 0:t.xc,n=null==t?void 0:t.Sc,o=null==t?void 0:t.Kc();if(!t||this.MW||!o||"linear"!==this.kW.type||!i||!s||void 0===r||void 0===n||!e){const t=this._W.enabled;return this._W={enabled:!1,totalDataPointsAtTime:null!=r?r:0},{cpStateChanged:t,cpActive:!1}}const h=qr(o),a=t.Ec(),l=t.sd(),u=a?a[h]:void 0,c=l?l[h]:void 0;if(r<2||void 0===u||void 0===c||c===u){const t=this._W.enabled;return this._W={enabled:!1,totalDataPointsAtTime:null!=r?r:0},{cpStateChanged:t,cpActive:!1}}const d=this.calculateAvgStepBetweenDataPoints(c,u,r),f=this.kW.scale,g=Math.abs(f.Ui()[h]),m=g/d,y=Math.floor(.8*m),p=y*d,A=y>=4,x=this._W.enabled?this._W.columnWidthAxis/g<1.5:void 0,S=this._W.enabled&&y>this._W.dataPointsPerColumn?y/this._W.dataPointsPerColumn>=2:void 0;let v;return!0===this._W.enabled?x?S&&(v={enabled:!0,columnWidthAxis:p,dataPointsPerColumn:y,totalDataPointsAtTime:r}):v=A?{enabled:!0,columnWidthAxis:p,dataPointsPerColumn:y,totalDataPointsAtTime:r}:{enabled:!1,totalDataPointsAtTime:r}:A&&(v={enabled:!0,columnWidthAxis:p,dataPointsPerColumn:y,totalDataPointsAtTime:r}),this._W=v||{...this._W,totalDataPointsAtTime:r},!!v&&this.PW(),{cpStateChanged:!!v,cpActive:this._W.enabled}}xH(t,e){var i,s,r;const n=t.zc,o=t.Vc,h=t.bc,a=t.xc,l=t.Sc;if(this.MW||!this._W.enabled||!n||!o||void 0===e)return;const u=qr(e),c=Kr(e),d="x"===u?n:o,f="x"===u?o:n,g=d.length,m="x"===u?this.At.x:this.At.y,y=this._W.columnWidthAxis,p=Math.min(m.getInnerStart(),m.getInnerEnd()),A=Math.max(m.getInnerStart(),m.getInnerEnd()),x=bo(p,A,d,h,a,l,e,1);if(!x)return;const S=d[x.iFirstSampleDataArray];if(this.bH){if(this.bH.iFirstPackedSample0)if(this.bH.packedColumnsCount-=t,this.bH.packedColumnsCount>0){this.bH.packedDataProg.splice(0,2*t),this.bH.packedDataValues.splice(0,2*t),this.bH.packedDataColors&&this.bH.packedDataColors.splice(0,2*t),this.bH.packedDataLookupValues&&this.bH.packedDataLookupValues.splice(0,2*t),this.bH.origin+=t*y;const e=Mo(this.bH.origin,Math.max(h-1-g+1,0),h-1,c,(t=>d[vo(t,h,g)])),i=vo(e,h,g);this.bH.iFirstPackedSample=d[i]>=this.bH.origin?e:e+1}else this.bH=void 0}if(void 0!==(null===(i=this.bH)||void 0===i?void 0:i.iLastPackedSample)&&this.bH.iLastPackedSample>x.iLastSample){const t=d[x.iLastSampleDataArray],e=Math.min(Math.floor((this.bH.origin+this.bH.packedColumnsCount*y-t)/y),this.bH.packedColumnsCount);if(e>0)if(this.bH.packedColumnsCount-=e,this.bH.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.bH.packedDataProg.pop(),this.bH.packedDataValues.pop(),this.bH.packedDataColors&&this.bH.packedDataColors.pop(),this.bH.packedDataLookupValues&&this.bH.packedDataLookupValues.pop();const t=Mo(this.bH.origin+this.bH.packedColumnsCount*y,Math.max(h-1-g+1,0),h-1,c,(t=>d[vo(t,h,g)])),i=vo(t,h,g);this.bH.iLastPackedSample=d[i]<=this.bH.origin+this.bH.packedColumnsCount*y?t:t-1}else this.bH=void 0}}const v=this.bH||{origin:S,packedColumnsCount:0,packedDataProg:[],packedDataValues:[],packedDataColors:t.Xc?[]:void 0,packedDataLookupValues:t.Hc?[]:void 0,packedDataSize:t.$c?[]:void 0,packedDataRotation:t.jc?[]:void 0,iFirstPackedSample:x.iFirstSample,iLastPackedSample:void 0},b=(t,e,i,s)=>{let r=Math.min(t,t+i*y),n=Math.max(t,t+i*y),o=s;const a=[];let l=He,u=He,c=-1,m=Ye,S=Ye,b=-1,M=0;for(;o<=x.iLastSample&&o>=x.iFirstSample;){const s=o%g,x=d[s],C=f[s];if(r<=x&&x<=n)M+=1,Number.isNaN(C)||(C>u&&(l=x,u=C,c=o),C0)l=l===He?Number.NaN:l,u=u===He?Number.NaN:u,m=m===Ye?Number.NaN:m,S=S===Ye?Number.NaN:S,c0?(v.packedDataProg.push(l),v.packedDataValues.push(u),v.packedDataProg.push(m),v.packedDataValues.push(S)):(v.packedDataProg.unshift(m),v.packedDataValues.unshift(S),v.packedDataProg.unshift(l),v.packedDataValues.unshift(u))):(a.push({iFirst:b,iSecond:c}),e>0?(v.packedDataProg.push(m),v.packedDataValues.push(S),v.packedDataProg.push(l),v.packedDataValues.push(u)):(v.packedDataProg.unshift(l),v.packedDataValues.unshift(u),v.packedDataProg.unshift(m),v.packedDataValues.unshift(S)));else{const t=e>0?v.iLastPackedSample:v.iFirstPackedSample;if(void 0===t)a.push({iFirst:0,iSecond:0}),e>0?(v.packedDataProg.push(Number.NaN),v.packedDataValues.push(Number.NaN),v.packedDataProg.push(Number.NaN),v.packedDataValues.push(Number.NaN)):(v.packedDataProg.unshift(Number.NaN),v.packedDataValues.unshift(Number.NaN),v.packedDataProg.unshift(Number.NaN),v.packedDataValues.unshift(Number.NaN));else{const s=vo(t,h,g),o=d[s],l=f[s],u=(r+n)/2,c=u-i*y/6,m=l+(c-o)/(x-o)*(C-l),p=u+i*y/6,A=l+(p-o)/(x-o)*(C-l);a.push({iFirst:t,iSecond:t}),e>0?(v.packedDataProg.push(c),v.packedDataValues.push(m),v.packedDataProg.push(p),v.packedDataValues.push(A)):(v.packedDataProg.unshift(c),v.packedDataValues.unshift(m),v.packedDataProg.unshift(p),v.packedDataValues.unshift(A))}}if(v.packedColumnsCount+=1,e>0?v.iLastPackedSample=o-1:(v.iFirstPackedSample=o+1,v.origin=r),r=Math.min(t+a.length*i*y,t+(a.length+1)*i*y),n=Math.max(t+a.length*i*y,t+(a.length+1)*i*y),M=0,l=He,u=He,c=-1,m=Ye,S=Ye,b=-1,rA)break}}return a},M=b(v.origin+v.packedColumnsCount*y,1,1*(Kr(e)?1:-1),void 0!==(null===(s=this.bH)||void 0===s?void 0:s.iLastPackedSample)?this.bH.iLastPackedSample+1:x.iFirstSample),C=b(v.origin,-1,-1*(Kr(e)?1:-1),void 0!==(null===(r=this.bH)||void 0===r?void 0:r.iFirstPackedSample)?this.bH.iFirstPackedSample-1:x.iFirstSample),T=t.Xc&&v.packedDataColors?[t.Xc,v.packedDataColors]:void 0,w=t.Hc&&v.packedDataLookupValues?[t.Hc,v.packedDataLookupValues]:void 0,E=t.$c&&v.packedDataSize?[t.$c,v.packedDataSize]:void 0,k=t.jc&&v.packedDataRotation?[t.jc,v.packedDataRotation]:void 0;if(T||w||E||k){for(const t of M){const e=vo(t.iFirst,h,g),i=vo(t.iSecond,h,g);T&&T[1].push(T[0][e],T[0][i]),w&&w[1].push(w[0][e],w[0][i]),E&&E[1].push(E[0][e],E[0][i]),k&&k[1].push(k[0][e],k[0][i])}for(const t of C){const e=vo(t.iFirst,h,g),i=vo(t.iSecond,h,g);T&&T[1].unshift(T[0][i],T[0][e]),w&&w[1].unshift(w[0][i],w[0][e]),E&&E[1].unshift(E[0][i],E[0][e]),k&&k[1].unshift(k[0][i],k[0][e])}}return this.bH=v.packedColumnsCount>0?v:void 0,{x:"x"===u?v.packedDataProg:v.packedDataValues,y:"y"===u?v.packedDataProg:v.packedDataValues,color:v.packedDataColors,lookup:v.packedDataLookupValues,size:v.packedDataSize,rotation:v.packedDataRotation}}PW(){this.bH=void 0}EW(){}}class jy extends Xy{constructor(t,e,i,s){super(t,e,i,s),this.Vz=new $m,this.qW=new Wy(this.At,this),this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,strokeFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},strokeFillIndividual:()=>{const t=this.Su.getFillStyle();return H(t)&&t},strokeFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t},areaFillSolid:()=>U(this.aH)&&this.aH,areaFillLinearGradient:()=>at(this.aH)&&this.aH,areaFillRadialGradient:()=>nt(this.aH)&&this.aH,areaFillIndividual:()=>H(this.aH)&&this.aH,areaFillPaletted:()=>j(this.aH)&&this.aH,markerFillSolid:()=>U(this.uH)&&this.uH,markerFillLinearGradient:()=>at(this.uH)&&this.uH,markerFillRadialGradient:()=>nt(this.uH)&&this.uH,markerFillPaletted:()=>j(this.uH)&&this.uH,markerFillIndividual:()=>H(this.uH)&&this.uH,markerFillImage:()=>tt(this.uH)&&this.uH,markerShapeIcon:()=>{const t=this.cH.C();return po(t)&&t}}),this.Sd=p(void 0),this.MH=[],this.al=!1,this._H=[],this.wH=void 0,this.VY=(t,e,i)=>{var s;const r=null===(s=this.CH)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.oi().x,o=r.oi().y),Um(t,e,n*this.dH.C(),o*this.dH.C(),i)},this.NG=e,this.KU={type:"none"},this.lz=t.GG(),this.OG=t,this.QU=this.lz.EN}xd(t){return this.Sd._(Be(t,this.Sd.C(),(()=>[t.rd(((e,i)=>{this.MH.push({min:e,max:i}),void 0===t.Kc()&&this.kH&&this._H.push({min:e,max:i})})),t.nd((()=>{this.al=!0,this.kH=void 0,this.wH=void 0,this.qW.PW()}))]))),this.wH=void 0,this}la(){var t;const e=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt,i=null==e?void 0:e.Kc();return i&&{$k:qr(i),jk:()=>this.TH()}}TH(){var t,i,s,r,n,o,h,a,l,c,d,f,g;const m=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt,y=this.Sd.u,p=null==m?void 0:m.zc,A=null==m?void 0:m.Vc;if(!m||!p||!A)return;const x=m.Kc(),S=x&&this.At[qr(x)],v=m.Hc,b=m.Xc,M=m.$c,C=m.jc,T=m.bc,w=m.xc,E=m.Sc,k=y||this.ma()||this.pH()||this.mH()||this.lH.u,I=this.jG.lineStyleSolid(k),z=this.jG.lineStyleDashed(k),F=I||z,R=F&&F.getThickness(),D=this.jG.strokeFillSolid(k),P=this.jG.strokeFillLinearGradient(k),O=this.jG.strokeFillRadialGradient(k),L=this.jG.strokeFillIndividual(k),_=this.jG.strokeFillPaletted(k),B=D||P||O||L||_,V=this.jG.areaFillSolid(k),G=this.jG.areaFillLinearGradient(k),N=this.jG.areaFillRadialGradient(k),U=this.jG.areaFillIndividual(k),Y=this.jG.areaFillPaletted(k),H=V||G||N||U||Y,X=this.jG.markerFillSolid(k),W=this.jG.markerFillLinearGradient(k),j=this.jG.markerFillRadialGradient(k),$=this.jG.markerFillPaletted(k),Z=this.jG.markerFillIndividual(k),q=this.jG.markerFillImage(k),K=X||W||j||$||Z||q,J=this.cH.C(),Q=this.cH.u,tt=this.jG.markerShapeIcon(Q),et=this.dH.C(),it=this.dH.u,st=this.AH.u,rt=this.MH.length>0||st,nt=this.al,ot=nt?[m.qc()]:(t=>{const e=[];for(const i of t){let t=!1;for(const s of e)if(i.min>=s.min&&i.min<=s.max||i.max>=s.min&&i.max<=s.max){s.min=Math.min(s.min,i.min),s.max=Math.min(s.max,i.max),t=!0;break}t||e.push(i)}return e})(this.MH),ht=!!z,at=this.Yo.C(),lt=this.Yo.u,ut=this.XC&&(!!F||!!H),{cpStateChanged:ct,cpActive:dt}=this.qW.SH(m,ut);if(x&&dt&&S&&(ct||nt||rt||S.Yt||k)){const t=this.qW.xH(m,x);if(t){const e=!ct&&!nt&&!k;this.FH=$y(this.lz,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ht,this.FH,e,x,1e3,this.At._i(),(t=>re(t,this.At._i()))),this.IH={min:Ye,max:He};const i="x"===qr(x)?t.y:t.x,s=i.length;for(let t=0;tthis.BH.iLastSample||k){let t,i,s,r,n,h;if(1===c.dataRanges.length){const e=c.dataRanges[0];t=p.subarray(e.offset,e.offset+e.count),i=A.subarray(e.offset,e.offset+e.count),s=b?b.subarray(e.offset,e.offset+e.count):void 0,r=v?v.subarray(e.offset,e.offset+e.count):void 0,n=M?M.subarray(e.offset,e.offset+e.count):void 0,h=C?C.subarray(e.offset,e.offset+e.count):void 0}else{const e=c.dataRanges[0],o=c.dataRanges[1],a=e.count+o.count;t=new m.Bc(a),t.set(p.subarray(e.offset),0),t.set(p.subarray(o.offset,o.offset+o.count),e.count),i=new m.Bc(a),i.set(A.subarray(e.offset),0),i.set(A.subarray(o.offset,o.offset+o.count),e.count),b&&(s=new Uint32Array(a),s.set(b.subarray(e.offset),0),s.set(b.subarray(o.offset,o.offset+o.count),e.count)),v&&(r=new Float32Array(a),r.set(v.subarray(e.offset),0),r.set(v.subarray(o.offset,o.offset+o.count),e.count)),M&&(n=new Float32Array(a),n.set(M.subarray(e.offset),0),n.set(M.subarray(o.offset,o.offset+o.count),e.count)),C&&(h=new Float32Array(a),h.set(C.subarray(e.offset),0),h.set(C.subarray(o.offset,o.offset+o.count),e.count))}const a=!ct&&!nt&&!k;this.DH=$y(this.lz,[t,i],s,r,n,h,ht,this.DH,a,x,1e3,this.At._i(),(t=>re(t,this.At._i())));let l=t,d=i,f=s,g=r;const y=this.AH.C();if(y){const n="spline"===y.type?((t,e,i)=>{const s=qr(i),r="x"===s?t.xValues:t.yValues,n="x"===s?t.yValues:t.xValues,{lookupValues:o,colors:h}=t;if(r.length<=2)return{xValues:Array.from(t.xValues),yValues:Array.from(t.yValues),lookupValues:o?Array.from(o):void 0,colors:h?Array.from(h):void 0};const a=((t,e)=>{const i=1e-5,s=t.length-1,r=Array(s);if(s>1){let n=u(0,0),o=u(0,0),h=u(0,0),a=di(pi({x:t[1],y:e[1]},{x:t[0],y:e[0]}));const l=3;let c=0,d=0;for(let f=0;fi?Math.abs(e/(l*n.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=yi(mi(n,c),g[1]),g[2]=pi(g[2],mi(o,d)),r[f]=g}}return r.length>0?r:[]})(r,n),l=a.length,c=[],d=[],f=[],g=[];for(let t=0;t{const{lookupValues:r,colors:n}=t,o=qr(s),h="x"===o?t.xValues:t.yValues,a="x"===o?t.yValues:t.xValues,l=[],u=[],c=[],d=[],f=h.length,g=i;if(f>0){let t=0,e=h[0],i=a[0];l[t]=e,u[t]=i,t+=1;for(let s=1;sre(t,this.At._i()))),this.BH=c}}else this.PH=void 0;if(!x&&(nt||rt||k)){if(!this.FH||this.FH.bufferSize{var s,r,n,o;const h=p.subarray(i.min,i.max+1),a=A.subarray(i.min,i.max+1);if(this.lz.AN(t,i.min*(this.At._i()?2:1),re(h,this.At._i())),this.lz.AN(e,i.min*(this.At._i()?2:1),re(a,this.At._i())),b&&(null===(s=this.FH)||void 0===s?void 0:s.bufferColors)){const t=b.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferColors,i.min,t,Uint32Array)}if(v&&(null===(r=this.FH)||void 0===r?void 0:r.bufferLookupValues)){const t=v.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferLookupValues,i.min,t,Float32Array)}if(C&&(null===(n=this.FH)||void 0===n?void 0:n.bufferRotations)){const t=C.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferRotations,i.min,t,Float32Array)}if(M&&(null===(o=this.FH)||void 0===o?void 0:o.bufferSizes)){const t=M.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferSizes,i.min,t,Float32Array)}})),this.FH.valueCount=m.xc}this.DH=this.FH}if(k||it||Q||lt){if(B&&F&&!1!==R){const t=-1===R?"primitive":"triangulated",e=_?["lookup",_.lookUpProperty,_.lut]:L?"attribute":P?["gradient",P]:O?["gradient",O]:"uniform";this.KU="primitive"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),z&&sm.StippleTexture),lineStyleSolid:I,lineStyleDashed:z,fillStyleSolid:D,fillStyleLinearGradient:P,fillStyleRadialGradient:O,fillStyleIndividual:L,fillStylePaletted:_,mousePickingShader:at&&this.lz.VV(sm["2D"],sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),z&&sm.StippleTexture,sm.MousePicking({useVertexId:!0}))}:"triangulated"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),this.QU?sm.AliasedEdge:void 0,z&&sm.StippleTextureInstanced),geometry:cy(this.lz,R),thickness:R,lineStyleSolid:I,lineStyleDashed:z,fillStyleSolid:D,fillStyleLinearGradient:P,fillStyleRadialGradient:O,fillStyleIndividual:L,fillStylePaletted:_,mousePickingShader:at&&this.lz.VV(sm["2D"],sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),z&&sm.StippleTextureInstanced,sm.MousePicking())}:{type:"none"}}else this.KU={type:"none"};if(this.LH=H?{shader:this.lz.VV(sm["2D"],Y&&sm.Color({dataType:["lookup",Y.lookUpProperty,Y.lut]}),U&&sm.Color({dataType:"attribute"}),V&&sm.Color({dataType:"uniform"}),G&&sm.Color({dataType:["gradient",G]}),N&&sm.Color({dataType:["gradient",N]}),sm.Area2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0,fill:this.lH.C()})),geometry:Hy(this.lz),fillStyleSolid:V,fillStyleLinearGradient:G,fillStyleRadialGradient:N,fillStyleIndividual:U,fillStylePaletted:Y,mousePickingShader:at&&this.lz.VV(sm["2D"],sm.Area2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0,fill:this.lH.C()}),sm.MousePicking())}:void 0,K){const t=!(!q&&!tt),e=et>1||t,i=M?"attribute":"uniform",s=!e&&sm.PointSize("uniform"),r=sm.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:C?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:C?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0});this.CH={shader:this.lz.VV(sm["2D"],s,r,X&&sm.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!tt}),W&&sm.Color({dataType:["gradient",W],overrideOpacity:!0,maskTexture:!!tt}),j&&sm.Color({dataType:["gradient",j],overrideOpacity:!0,maskTexture:!!tt}),$&&sm.Color({dataType:["lookup",$.getLookUpProperty(),$.getPalette()],overrideOpacity:!0,maskTexture:!!tt}),Z&&sm.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!tt}),q&&sm.Color({dataType:["image",q],overrideOpacity:!0,maskTexture:!!tt})),geometry:wy(J,this.lz,"uniform"===i?et:25),fillStyleSolid:X,fillStyleLinearGradient:W,fillStyleRadialGradient:j,fillStylePaletted:$,fillStyleIndividual:Z,fillStyleImage:q,mousePickingShader:at&&this.lz.VV(sm["2D"],s,r,sm.MousePicking({useVertexId:!e})),shapeIcon:tt,pointSizeAsScale:t,instancedRendering:e}}else this.CH=void 0}if((void 0===this.wH||rt)&&v&&(Ig(_)||Ig(Y)||Ig($))){const t=this.wH?ot:[m.qc()];let e=this.wH?this.wH.max:He,i=this.wH?this.wH.min:Ye;const s=v;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.wH={min:i,max:e}}this.zY=this.lz.AG(this,this.zY,q,tt,it,this.VY),this.tW=z?this.lz.lG(z.getPattern()):void 0,this._u(this.Su),this.yH=this.aH,this.vH=this.uH,this.cH.u=!1,this.dH.u=!1,this.MH.length=0,this.al=!1,this.AH.u=!1,this.Sd.u=!1,this.Yo.u=!1,this.lH.u=!1}Os(){this.TH();const t=this.jG.strokeFillLinearGradient(!1),e=this.jG.strokeFillRadialGradient(!1),i=this.jG.areaFillLinearGradient(!1),s=this.jG.areaFillRadialGradient(!1),r=this.jG.markerFillLinearGradient(!1),n=this.jG.markerFillRadialGradient(!1);let o;this.Vz.$O(this.At);const h=this.lH.C();o="bottom"===h||"top"===h?cn({min:{x:this.vt(),y:Math.min(this.At.y.getInnerStart(),this.At.y.getInnerEnd(),this.xt(),this.bt())},max:{x:this.St(),y:Math.max(this.At.y.getInnerStart(),this.At.y.getInnerEnd(),this.xt(),this.bt())}},{x:this.Pl(),y:this.Dl()},this.At):cn({min:{x:Math.min(this.At.x.getInnerStart(),this.At.x.getInnerEnd(),this.vt(),this.St()),y:this.xt()},max:{x:Math.max(this.At.x.getInnerStart(),this.At.x.getInnerEnd(),this.vt(),this.St()),y:this.bt()}},{x:this.Pl()/2,y:this.Dl()/2},this.At);const a=cn({min:{x:this.vt(),y:this.xt()},max:{x:this.St(),y:this.bt()}},{x:this.Pl(),y:this.Dl()},this.At);return this.RH=this.lz.vG(t,this,a),this.EH=this.lz.SG(e,this,a),this.zH=this.lz.vG(i,this,o),this.VH=this.lz.SG(s,this,o),this.OH=this.lz.vG(r,this,a),this.NH=this.lz.SG(n,this,a),this}WE(t,e){var i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p,A,x,S;const v=this.lz.gl,b=null===(i=this.FH)||void 0===i?void 0:i.bufferX,M=null===(s=this.FH)||void 0===s?void 0:s.bufferY,C=null===(r=this.FH)||void 0===r?void 0:r.bufferColors,T=null===(n=this.FH)||void 0===n?void 0:n.bufferLookupValues,w=null===(o=this.FH)||void 0===o?void 0:o.valueCount,E=null===(h=this.DH)||void 0===h?void 0:h.valueCount,k=null===(a=this.Sd.C())||void 0===a?void 0:a.Gt,I=null==k?void 0:k.Kc(),z=Math.max((null===(l=this.FH)||void 0===l?void 0:l.valueCount)||0,(null===(u=this.DH)||void 0===u?void 0:u.valueCount)||0);if(!b||!M||!k)return{};const F=(e,i,s)=>{if(qy(this.lz,e,this.At._i(),b,"aLocation","X",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),qy(this.lz,e,this.At._i(),M,"aLocation","Y",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!C)return!1;qy(this.lz,e,!1,C,"aColor","",4,!0,v.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!T)return!1;qy(this.lz,e,!1,T,"aLookupValue","",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},R=1===t?null===(c=this.LH)||void 0===c?void 0:c.mousePickingShader:null===(d=this.LH)||void 0===d?void 0:d.shader;if(this.LH&&R&&void 0!==w&&w>0&&I&&2!==t){const i=this.LH;this.lz.bz(R).OO(R,((s,r,n,o)=>!!this.lz.pG(n,t,this,{uniforms:this.Vz,idFirst:e,useInstanceID:1===t?z:void 0,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStylePaletted:i.fillStylePaletted,linearGradientInfo:this.zH,radialGradientInfo:this.VH,lookupValueRange:i.fillStylePaletted?kg(i.fillStylePaletted,this,this.wH):void 0,lookupValueBuffer:null})&&!!F(n,i.fillStyleIndividual,i.fillStylePaletted)&&(null==i||i.geometry.bz(n).om(w-1),!0)))}const D="none"===this.KU.type?void 0:1===t?this.KU.mousePickingShader:this.KU.shader;if("none"!==this.KU.type&&D&&void 0!==w&&w>0){const i=this.KU;this.lz.bz(D).OO(D,((s,r,n,o)=>{var h,a;if(!this.lz.pG(n,t,this,{uniforms:this.Vz,idFirst:e,useInstanceID:1===t&&"triangulated"===i.type?z:void 0,useVertexID:1===t&&"primitive"===i.type?z:void 0,fillStyleSolid:i.fillStyleSolid,fillStylePaletted:i.fillStylePaletted,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStyleIndividual:i.fillStyleIndividual,linearGradientInfo:this.RH,radialGradientInfo:this.EH,lookupValueRange:i.fillStylePaletted?kg(i.fillStylePaletted,this,this.wH):void 0,lookupValueBuffer:"primitive"===i.type?T:null,colorBuffer:"primitive"===i.type?C:null,coordsX:"primitive"===i.type?b:void 0,coordsY:"primitive"===i.type?M:void 0,coordsHighPrecision:this.At._i()}))return!1;if(i.lineStyleDashed){if(!this.tW)return!1;this.lz.GO(s("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(o("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(s("uStippleScale"),i.lineStyleDashed.getPatternScale()).UO(s("uStippleTexture"),this.tW.uG,1)}if("primitive"===i.type){if(i.lineStyleDashed){if(!(null===(h=this.FH)||void 0===h?void 0:h.bufferLengthSoFar))return!1;this.lz.vN(r("aLengthSoFar"),this.FH.bufferLengthSoFar)}fy.jU(this.OG,w)}else{if(!F(n,i.fillStyleIndividual,i.fillStylePaletted))return!1;if(i.lineStyleDashed){if(!(null===(a=this.FH)||void 0===a?void 0:a.bufferLengthSoFar))return!1;qy(this.lz,n,!1,this.FH.bufferLengthSoFar,"aLengthSoFar","",2,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}dy.WE(this.OG,i.geometry,n,this.QU&&1!==t,1===t,i.thickness,w-1)}return!0}))}const P=null===(f=this.DH)||void 0===f?void 0:f.bufferX,O=null===(g=this.DH)||void 0===g?void 0:g.bufferY,L=null===(m=this.DH)||void 0===m?void 0:m.bufferColors,_=null===(y=this.DH)||void 0===y?void 0:y.bufferLookupValues,B=null===(p=this.DH)||void 0===p?void 0:p.bufferSizes,V=null===(A=this.DH)||void 0===A?void 0:A.bufferRotations,G=1===t?null===(x=this.CH)||void 0===x?void 0:x.mousePickingShader:null===(S=this.CH)||void 0===S?void 0:S.shader,N=this.CH;let U=1;if(I&&(R||D)){const t="x"===qr(I)?this.vt():this.xt(),e="x"===qr(I)?this.St():this.bt(),i="x"===qr(I)?this.At.x:this.At.y,s=this.Sd?Math.abs((e-t)/k.getSampleCount()):0,r=i.getInnerInterval()/s,n=this.dH.C(),o=i.ri()/n/1,h=2*o;U=r<=o?1:Math.max(1-(r-o)/(h-o),0)}if(G&&N&&P&&O&&U>0&&void 0!==E&&E>0){const i=N,s=i.instancedRendering?1:0;this.lz.bz(G).OO(G,((r,n,o,h)=>{if(!this.lz.pG(o,t,this,{uniforms:this.Vz,idFirst:e,useInstanceID:i.instancedRendering&&1===t?z:void 0,useVertexID:i.instancedRendering||1!==t?void 0:z,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,linearGradientInfo:this.OH,radialGradientInfo:this.NH,fillStylePaletted:i.fillStylePaletted,fillStyleIndividual:i.fillStyleIndividual,lookupValueRange:i.fillStylePaletted?kg(i.fillStylePaletted,this,this.wH):void 0,lookupValueBuffer:_,lookupValueAttribDivisor:s,colorBuffer:L,colorAttribDivisor:s,fillStyleImage:i.fillStyleImage,texturedFillGLInfo:this.zY,texCoordAttribDivisor:0,maskTexture:i.shapeIcon&&this.zY,maskTextureCoordsAttribDivisor:0}))return!1;if(this.At._i()?this.lz.NO(P,s,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).NO(O,s,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.lz._N(n("aPosX"),P,s)._N(n("aPosY"),O,s),1!==t&&this.lz.WO(r("uOpacity"),U),i.instancedRendering)if(V)this.lz._N(n("aRotDeg"),V,s).WO(r("uBaseRotDeg"),i.geometry.cY);else{const t=Ci(this.fH.C()+i.geometry.cY),e=Math.sin(t),s=Math.cos(t);this.lz.GO(r("uRot"),[e,s])}return this.lz.GO(h("uOffsetAlignment"),[-this.gH.x/2,-this.gH.y/2]),i.geometry.om(o,B,E,i.pointSizeAsScale&&this.zY?{scale:this.dH.C(),width:i.shapeIcon?i.shapeIcon.oi().x:this.zY.texture.oO,height:i.shapeIcon?i.shapeIcon.oi().y:this.zY.texture.aO}:this.dH.C(),i.instancedRendering),!0}))}return{idCount:z}}HG(t,e,i,s,r){var n;const o=null===(n=this.Sd.C())||void 0===n?void 0:n.Gt;if(null==o?void 0:o.Kc())return{};const h=t-e;return{info:{dataPoint:null==o?void 0:o.ed(h)}}}dispose(){var t,e,i,s,r,n,o,h,a,l,u,c,d;return super.dispose(),this.lz.jO(null===(t=this.FH)||void 0===t?void 0:t.bufferX),this.lz.jO(null===(e=this.FH)||void 0===e?void 0:e.bufferY),this.lz.jO(null===(i=this.FH)||void 0===i?void 0:i.bufferColors),this.lz.jO(null===(s=this.FH)||void 0===s?void 0:s.bufferLookupValues),this.lz.jO(null===(r=this.FH)||void 0===r?void 0:r.bufferRotations),this.lz.jO(null===(n=this.FH)||void 0===n?void 0:n.bufferSizes),this.lz.jO(null===(o=this.DH)||void 0===o?void 0:o.bufferX),this.lz.jO(null===(h=this.DH)||void 0===h?void 0:h.bufferY),this.lz.jO(null===(a=this.DH)||void 0===a?void 0:a.bufferColors),this.lz.jO(null===(l=this.DH)||void 0===l?void 0:l.bufferLookupValues),this.lz.jO(null===(u=this.DH)||void 0===u?void 0:u.bufferRotations),this.lz.jO(null===(c=this.DH)||void 0===c?void 0:c.bufferSizes),this.KU={type:"none"},this.LH=void 0,this.CH=void 0,this.qW.PW(),null===(d=this.Sd.C())||void 0===d||d.Nt(),this.FH=void 0,this.DH=void 0,this.RH=void 0,this.EH=void 0,this.zH=void 0,this.VH=void 0,this.OH=void 0,this.NH=void 0,this.lz.gG(this,this.zY),this}dz(){return this.dispose(),this}GH(t){if(!this.kH){const{xValues:e,yValues:i}=t.readBack();this.kH={min:{x:Ye,y:Ye},max:{x:He,y:He}};const s=e.length;for(let t=0;tthis.kH.max.x?s:this.kH.max.x,this.kH.max.y=r>this.kH.max.y?r:this.kH.max.y}return this._H.length=0,this.kH}const e=t.zc,i=t.Vc;if(this._H.length>0&&e&&i){for(const t of this._H){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.kH.min.x=tthis.kH.max.x?t:this.kH.max.x,this.kH.max.y=r>this.kH.max.y?r:this.kH.max.y}this._H.length=0}return this.kH}return this.kH}St(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?(null===(e=n.Ec())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.sd())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.IH)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.IH)||void 0===r?void 0:r.max)||0:this.GH(n).max.x}vt(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?(null===(e=n.sd())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Ec())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.IH)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.IH)||void 0===r?void 0:r.min)||0:this.GH(n).min.x}bt(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?Vt(null===(e=this.IH)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Vt(null===(i=this.IH)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Vt(null===(s=n.Ec())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Vt(null===(r=n.sd())||void 0===r?void 0:r.y,0):this.GH(n).max.y}xt(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?Vt(null===(e=this.IH)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Vt(null===(i=this.IH)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Vt(null===(s=n.sd())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Vt(null===(r=n.Ec())||void 0===r?void 0:r.y,0):this.GH(n).min.y}Pl(){var t,e;let i=this.dH.C();this.zY&&(i=Math.max(this.zY.texture.oO,this.zY.texture.aO)*this.dH.C());const s=Math.max(Re(this.Su),(null===(t=this.Sd.C())||void 0===t?void 0:t.Gt.Pc)?25:i),r=null===(e=this.Sd.C())||void 0===e?void 0:e.Gt.Kc();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}Dl(){var t,e;let i=this.dH.C();this.zY&&(i=Math.max(this.zY.texture.oO,this.zY.texture.aO)*this.dH.C());const s=Math.max(Re(this.Su),(null===(t=this.Sd.C())||void 0===t?void 0:t.Gt.Pc)?25:i),r=null===(e=this.Sd.C())||void 0===e?void 0:e.Gt.Kc();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const $y=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{const f=qr(l),g=Kr(l),m=e[0],y=e[1],p=m.length,A=m[0],x=m[p-1],S=y[0],v=y[p-1],b=c?2:1;if(h&&a&&h.firstX&&h.lastX&&h.firstY&&h.lastY&&("ProgressiveX"===l&&A>=h.firstX||"RegressiveX"===l&&A<=h.firstX||"ProgressiveY"===l&&S>=h.firstY||"RegressiveY"===l&&S<=h.firstY)){const e="x"===f?m:y,a="x"===f?h.lastX:h.lastY,l=Mo(a,0,p-1,g,(t=>e[t]));if(e[l]===a){const e=h.bufferSize-h.valueCount,a=l+1,u=p-a;if(0===u)return h;if(e>=u){const e=wo(m,a,void 0),l=wo(y,a,void 0);if(t.AN(h.bufferX,h.valueCount*b,d(e)),t.AN(h.bufferY,h.valueCount*b,d(l)),i&&h.bufferColors){const e=i.slice(a);t.AN(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(a);t.AN(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(a);t.AN(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(a);t.AN(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Zy(e,l,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.AN(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=x,h.lastY=v,h}}}const M=p+u,C=t.fN(M*b,d(m),null==h?void 0:h.bufferX),T=t.fN(M*b,d(y),null==h?void 0:h.bufferY),w=i?t.fN(M,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,E=s?t.fN(M,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,k=r?t.fN(M,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,I=n?t.fN(M,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let z,F=0,R=0;if(o){const e=Zy(m,y,m[0],y[0],0,0);z=t.fN(2*M,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),F=e[1],R=e[2]}return{bufferX:C,bufferY:T,bufferColors:w,bufferLookupValues:E,bufferSizes:k,bufferRotations:I,bufferSize:M,bufferLengthSoFar:z,valueCount:p,firstX:A,lastX:x,firstY:S,lastY:v,lengthSoFarX:F,lengthSoFarY:R}},Zy=(t,e,i,s,r,n)=>{const o=t.length,h=new Float32Array(2*o);if(0===o)return[h,0,0];let a=0,l=i,u=s,c=r,d=n;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${r}A_highpart${n}`),c=e.attribute(`${r}A_lowpart${n}`),d=e.attribute(`${r}B_highpart${n}`),f=e.attribute(`${r}B_lowpart${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,2*o*l,0*l),u.vertexAttribPointer(c,o,a,h,2*o*l,o*l),t.xN(i,1),t.xN(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,a,h,2*o*l,2*o*l),u.vertexAttribPointer(f,o,a,h,2*o*l,3*o*l),t.xN(d,1),t.xN(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${r}A${n}`),c=e.attribute(`${r}B${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,o*l,0*l),u.vertexAttribPointer(c,o,a,h,o*l,o*l),t.xN(i,1),t.xN(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Ky={translation:(t,e)=>[1,0,0,0,1,0,t,e,1],rotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:(t,e)=>[t,0,0,0,e,0,0,0,1],translate:(t,e,i)=>Ky.multiply(t,Ky.translation(e,i)),rotate:(t,e)=>Ky.multiply(t,Ky.rotation(e)),scale:(t,e,i)=>Ky.multiply(t,Ky.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],y=e[5],p=e[6],A=e[7],x=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+m*n+y*a,g*s+m*o+y*l,g*r+m*h+y*u,p*i+A*n+x*a,p*s+A*o+x*l,p*r+A*h+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Jy extends An{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UH=[],this.Vz=new $m,this.WH=[u(0,0),u(0,0),u(0,0),u(0,0)],this.YH=m(u(0,0),u(0,0)),this.HH=m(u(0,0),u(0,0)),this.XH=u(0,0),this.$H=u(0,0),this.PT=u(0,0),this.jH=u(0,0),this.ZH=0,this.QH=0,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,fillStyleLinearGradient:()=>at(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e,this.oW=t.io.no}Os(){const t=this.pa(),e=this.ga(),i=this.Yo.C();if(t){const t=this.fa(),s=this.jG.fillStyleSolid(t),r=this.jG.fillStyleRadialGradient(t),n=this.jG.fillStyleLinearGradient(t),o=s||r||n,h=this.lz,a=this.lz.MO(),l=a!==this.QH;if(this.QH=a,this.Vz.$O(this.At),this.Ta.u||l){this.JH&&this.JH.Mz(this),this.font._(Pr(this.Ta.C(),a));const t=this.font.C();this.JH=this.lz.tr(t.properties.family),this.JH.bz(this)}const c=this.font.u,d=c||this.ba.u;if(d&&this.JH){const t=this.font.C();[this.KH,this.HH]=this.JH.wz(this.ba.C(),t,this.OG.ts.isDark),this.UH.forEach((t=>{t.texCoordBuff&&h.jO(t.texCoordBuff),t.vertexBuff&&h.jO(t.vertexBuff)})),this.UH=this.KH.map((t=>({texCoordBuff:h.zO(t.texCoords,!1),texture:t.texture,info:t}))),this.Ta.u=!1,this.font.u=!1,this.ba.u=!1}const f=this.At.Ni()||e,g=this.Ma.u||this.wa.u||this._a.u||this.Ca.u||this.Ia.u||this.$t.u||d||f,m=this.Ia.C(),y=mi(u(this.wa.C()+1,this._a.C()+1),.5);if(g&&this.KH&&(this.XH=u(-(m.left*a+this.HH.max.x-this.HH.min.x+m.right*a)*y.x-this.HH.min.x+m.right*a,-(m.bottom*a+this.HH.max.y-this.HH.min.y+m.top*a)*y.y-this.HH.min.y+m.top*a)),(g||f||this.ka.u||this.fa())&&this.Ie!==_){if(this.KH){const t=yi(this.Ma.C(),this.Ca.C()),e=yt(t,this.At,this.cs.At),i=mi(e,a);this.jH=i;const s=Ci(this.ka.C());this.ZH=s,d&&this.UH.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.zO(e.vertices,!0,t.vertexBuff))}));const r=this.$t.C(),n=[yi(ui(u((this.HH.min.x+(-r.left-m.left)*a+this.XH.x)/a,(this.HH.max.y+(r.top+m.top)*a+this.XH.y)/a),this.Fa,s),e),yi(ui(u((this.HH.max.x+(r.right+m.right)*a+this.XH.x)/a,(this.HH.max.y+(r.top+m.top)*a+this.XH.y)/a),this.Fa,s),e),yi(ui(u((this.HH.max.x+(r.right+m.right)*a+this.XH.x)/a,(this.HH.min.y+(-r.bottom-m.bottom)*a+this.XH.y)/a),this.Fa,s),e),yi(ui(u((this.HH.min.x+(-r.left-m.left)*a+this.XH.x)/a,(this.HH.min.y+(-r.bottom-m.bottom)*a+this.XH.y)/a),this.Fa,s),e)];this.WH=[yt(n[0],this.cs.At,this.At),yt(n[1],this.cs.At,this.At),yt(n[2],this.cs.At,this.At),yt(n[3],this.cs.At,this.At)];const o=ni(n);this.$H=u(-(o.max.x-o.min.x)*a*y.x-o.min.x*a+this.jH.x,-(o.max.y-o.min.y)*a*y.y-o.min.y*a+this.jH.y),this.Hg=pi(o.max,o.min);const l=ni(this.WH),c=this.At.pi(l.min,this.$H),f=this.At.pi(l.max,this.$H);this.YH=ni([c,f])}r?this.iU=_m(this.YH,this.At,r.getPosition(),r.getExtent(),r.getShape(),this.lz.MO()):n?this.sU=Bm(this.YH,this.At,n.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0)}(this.fa()||c)&&(this.Gz=o?this.lz.VV(sm["2D"],sm.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.oW}),sm.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.qH=i&&o?this.qH||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.oW})):void 0,this.Ma.u=!1,this.wa.u=!1,this._a.u=!1,this.Ca.u=!1,this.ka.u=!1,this.ya(this.Ie)}return this.Pa=t,this}WE(t,e){if(this.pa()){const i=1===t?this.qH:this.Gz;if(!i||0===this.UH.length)return{};const s=this.jG.fillStyleSolid(!1),r=this.jG.fillStyleRadialGradient(!1),n=this.jG.fillStyleLinearGradient(!1),o=this.cs.pV(),h=o.x,a=o.y;let l=Ky.projection(h,a,-1);const u=Ky.translation(this.XH.x,this.XH.y),c=Ky.translation(this.$H.x,this.$H.y);l=Ky.translate(l,this.jH.x,this.jH.y),l=Ky.multiply(l,c),l=Ky.rotate(l,this.ZH),l=Ky.multiply(l,u),1===t&&(l=Ky.scale(l,this.HH.max.x,this.HH.max.y)),this.lz.bz(i).OO(i,((i,h,a,u)=>{if(this.lz.aN(i("uMatrix"),l).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),this.oW&&this.lz.GO(u("uViewportSizePx"),[o.x*this.lz.MO(),o.y*this.lz.MO()]),1===t)this.lz.uN(i("uFirstId"),e).nG(a,1);else if(s)this.lz.iL(i("uColor"),s.getColor());else if(r&&this.iU){this.lz.GO(i("uCenter"),this.iU.center).GO(i("uDistance"),this.iU.distance).nN(i("uBounds"),this.iU.bounds).WO(i("uAspect"),this.iU.aspectRatio);const t=r.getColorStops();for(let e=0;e{this.lz.vN(h("aPos"),t.vertexBuff).vN(h("aMaskTextureCoord"),t.texCoordBuff).UO(i("uMaskTexture"),t.texture,0).om(this.lz.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return{idCount:1}}HG(t,e,i,s,r){return{}}hh(){return this.pa()?this.WH:[]}od(){return this.pa()&&this.Hg?this.Hg:u(0,0)}oi(){if(this.pa()&&this.YH){const t=this.YH;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}dz(){return this.UH.forEach((t=>{t.texCoordBuff&&this.lz.jO(t.texCoordBuff),t.vertexBuff&&this.lz.jO(t.vertexBuff)})),this.UH=[],this.JH&&this.JH.Mz(this),this}St(){return this.YH.max.x}vt(){return this.YH.min.x}bt(){return this.YH.max.y}xt(){return this.YH.min.y}Pl(){return 0}Dl(){return 0}}class Qy{constructor(t,e,i){this.tX=new Set,this.iX=t=>(this.tX.add(t),t),this.sX=t=>(this.tX.delete(t),t.dz(),this),this.cs=t,this.oa=e,this.eX=i}UE(t){this.tX.delete(t)&&this.tX.add(t)}Y(){for(const t of this.tX)t.dz().dispose();this.cs.En(this.oa)}Ms(){return this.cs.Ms(),this}Rn(){return this.oa}}class tp extends Qy{constructor(){super(...arguments),this.hX=p(void 0),this.aa=!1}wx(t){return this.hX._(t),this}Op(){return this.hX.C()}}class ep extends tp{constructor(t,e,i){super(t,e,i),this.OG=t,this.gl=t.GG(),this.rX=this.tX}EO(t){const e=t instanceof un&&t;if(!e)return Xe;const i=e.vt(),s=e.St(),r=e.xt(),n=e.bt();if(i===Ye||s===He||r===Ye||n===He)return Xe;const o=e.Pl(),h=e.Dl(),a=cn({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.At),l={min:yt(a.min,e.At,t.cs.At),max:yt(a.max,e.At,t.cs.At)},u=this.hX.C();let c;if(u){if(c={min:{x:Math.min(l.min.x,u.x),y:Math.min(l.min.y,u.y)},max:{x:Math.max(l.max.x,u.x+u.width),y:Math.max(l.max.y,u.y+u.height)}},c.max.xt.ca()-e.ca()));this.tX.clear();for(const e of t)this.tX.add(e)}for(const t of this.tX)t.Os();return this}WE(t,e,i){var s;const r=this.hX.C();let n;if(r){const t=r.x*this.gl.MO()*e,i=r.y*this.gl.MO()*e,s=Math.ceil(t),o=Math.ceil(i);n=[s,o,Math.floor(t+r.width*this.gl.MO()*e)-s,Math.floor(i+r.height*this.gl.MO()*e)-o],this.gl.RO(n[0],n[1],n[2],n[3])}if(1!==t){for(const i of this.tX)if(i.getVisible()){if(i.Yi){const t=i.Yi.x*this.gl.MO()*e,s=i.Yi.y*this.gl.MO()*e,r=Math.ceil(t),n=Math.ceil(s),o=Math.floor(t+i.Yi.width*this.gl.MO()*e)-r,h=Math.floor(s+i.Yi.height*this.gl.MO()*e)-n;this.gl.RO(r,n,o,h)}i.WE(t,0),i.Yi&&n&&this.gl.RO(n[0],n[1],n[2],n[3])}}else{let r=((null===(s=i[i.length-1])||void 0===s?void 0:s.idLast)||0)+1;const o=Array.from(this.rX.values());for(let s=0;s{const e=new Float32Array(324);let i=0;return e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,{vertices:e,drawSize:i/9,drawMode:t.TRIANGLES}};class np extends ip{constructor(t,e){super(t),this.oX="attribute",this.aX=e;const{vertices:i,indices:s}=op();this.qE=t.zO(i),this.GU=t.yN(s),this.UU=s.length,this.WU=t.gl.TRIANGLES}om(t,e,i,s){return this.lz.NO(this.qE,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).wN(this.GU).WO(t.uniform("uEdgeRoundness"),this.aX/2).FN(this.WU,this.UU,0,e),this}rO(){this.lz.jO(this.qE),this.lz.jO(this.GU)}lX(t){return this.aX=t,this}uX(){return this.aX}}const op=()=>{const t=[{normal:{x:0,y:1,z:0},perpendA:{x:0,y:0,z:1},perpendB:{x:-1,y:0,z:0}},{normal:{x:0,y:0,z:-1},perpendA:{x:0,y:1,z:0},perpendB:{x:-1,y:0,z:0}},{normal:{x:-1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:1}},{normal:{x:1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:-1}},{normal:{x:0,y:0,z:1},perpendA:{x:0,y:1,z:0},perpendB:{x:1,y:0,z:0}},{normal:{x:0,y:-1,z:0},perpendA:{x:0,y:0,z:-1},perpendB:{x:-1,y:0,z:0}}],e=[];let i=0;const s=[];let r=0;for(const n of t){const{normal:t,perpendA:o,perpendB:h}=n,a=Ue.multiply(o,-1),l=Ue.multiply(h,-1),u=i;e[i]={thicknessDirection:Ue.addVec(t,o,h),edge:Ue.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ue.addVec(t,a,h),edge:Ue.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ue.addVec(t,a,l),edge:Ue.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ue.addVec(t,o,l),edge:Ue.addVec(a,h),normal:t},i+=1,s[r+0]=d,s[r+1]=u,s[r+2]=f,s[r+3]=d,s[r+4]=c,s[r+5]=u,r+=6;const g=[{A:o,B:h},{A:a,B:h},{A:a,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=Ue.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const r=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const n of r)for(let r=0;r<8;r+=1){const o=.5*r/7,h=Ue.normalize(Ue.lerp(t,n.direction,o)),a=Math.PI/2-Ue.angle(h,t),l=Ue.addVec(Ue.multiply(Ue.multiply(n.direction,-1),1-Math.cos(a)),Ue.multiply(Ue.multiply(t,-1),1-Math.sin(a)),Ue.multiply(n.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:h,edge:l};const c=e[i];i+=1,n.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.iN.hO.get(e);return i||(i=void 0!==e&&e>0?new np(t,_t(e,0,1)):new sp(t),t.iN.hO.set(e,i),i)};class ap extends Hm{_v(t){return this.xO=this.gv.C(),this.gv._(t),this}NS(t){return this.cX=t,this}GS(){return this.cX}}class lp extends ap{constructor(t,e,i){super(t,e,i),this.dX=t,this.OG=t.OG,this.lz=this.OG.GG()}}class up extends lp{constructor(t,e,i){super(t,e,i),this.cX="cull-back",this.el=We,this.fX={},this.AX=[],this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleIndividual:()=>H(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie}),this.Ie=Ur.fillStyle,this.gv._(ao)}Os(t){const e=this.AX,i=this.Ie,s=i!==_,r=this.gX,n=this.fa()||this.pX!==r,o=this.SO(),h=this.Yo.C(),a=this.Yo.u;if(s){for(const t of e)t.id=void 0!==t.id?String(t.id):void 0,t.xSize=void 0!==t.xSize&&t.xSize<0?-t.xSize:t.xSize,t.ySize=void 0!==t.ySize&&t.ySize<0?-t.ySize:t.ySize,t.zSize=void 0!==t.zSize&&t.zSize<0?-t.zSize:t.zSize;const t=this.yX||0;let s=t;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.fX[e]||(s+=1)}let r,l=!1,u=!1;if(l=s!==t,u=l,r=!u&&(e.length<100?"chunks":"all"),l){const e=11*s,i=new Float32Array(e);this.lY&&i.set(this.lY),this.lY=i,this.mX=e,this.vX=11*t}const c=H(i)?i.getFallbackColor():void 0;for(const t of e){const e=t.id,i=void 0!==e&&this.fX[e],s=[t.xCenter,t.yCenter,t.zCenter,t.xSize,t.ySize,t.zSize,t.color?t.color.r:c?c.r:void 0,t.color?t.color.g:c?c.g:void 0,t.color?t.color.b:c?c.b:void 0,t.color?t.color.a:c?c.a:void 0,t.value];if(i){for(let t=0;t<11;t+=1)s[t]=void 0!==s[t]?s[t]:i.buffer[t];i.buffer.set(s)}else{const t=this.vX,i=new Float32Array(this.lY.buffer,t*Float32Array.BYTES_PER_ELEMENT,11);i.set(s),void 0!==e&&(this.fX[e]={location:t,buffer:i}),this.vX+=11}}if(u&&(this.NU=this.lz.zO(this.lY,!0)),"all"===r)this.lz.AN(this.NU,0,this.lY);else if("chunks"===r)for(const t of e){const e=t.id;if(void 0!==e){const t=this.fX[e];this.lz.AN(this.NU,t.location,t.buffer)}}if(n||o||a){const t=this.jG.fillStyleSolid(n),e=this.jG.fillStyleIndividual(n),i=this.jG.fillStylePaletted(n);t||e||i?(this.SX=hp(this.lz,this.xX()),this.Gz=this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:e?"attribute":i?["lookup",i.getLookUpProperty(),i.lut]:"uniform",shadingStyle:this.gv.C().type}),sm.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:wg(this.At),normalSource:this.SX.oX}),void 0!==this.gX&&sm.RoundedEdges3D),this.qH=h?this.lz.VV(sm["3D"],sm.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:wg(this.At),normalSource:void 0}),sm.MousePicking(),void 0!==this.gX&&sm.RoundedEdges3D):void 0):(this.SX=void 0,this.Gz=void 0,this.qH=void 0)}if(e.length>0){const t=m({x:Ye,y:Ye,z:Ye},{x:He,y:He,z:He});for(let e=0;en?t.max.x:n,t.max.y=t.max.y>l?t.max.y:l,t.max.z=t.max.z>f?t.max.z:f}this.el=t}this.yX=s,this.AX.length=0}return this.ya(i),this.pX=r,this.gv.u=!1,this.Yo.u=!1,this}WE(t,e){const i=1===t?this.qH:this.Gz,s=this.SX,r=this.NU,n=this.Ie,o=this.yX,h=this.gv.C(),a=o||0;return i&&r&&void 0!==o&&this.lz.OO(i,((l,u,c)=>{let d=!1;const f=u("aPos"),g=u("aOffsetAxis");this.lz.bz(i).oN(l("uScale"),this.dX.Vz.YO()).oN(l("uDisp"),this.dX.Vz.HO()).lN(l("uViewProjectionMatrix"),this.bX).WO(l("uIsHighlighted"),1===t||2===t?0:this.jo).iL(l("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(l("uRenderEffectMask"),2===t?1:0);const m={location:f,size:3},y={location:g,size:3},p={location:void 0,size:4};if(1!==t&&"phong"===h.type&&this.lz.oN(l("uCameraLoc"),this.MX).oN(l("uLightLoc"),this._X).WO(l("uAmbientReflection"),h.ambientReflection).WO(l("uSpecularReflection"),h.specularReflection).WO(l("uDiffuseReflection"),h.diffuseReflection).WO(l("uShininess"),h.shininess).iL(l("uLightColor"),h.specularColor).iL(l("uAmbientColor"),h.ambientColor),1===t)this.lz.uN(l("uFirstId"),e).nG(c,a);else if(U(n))this.lz.iL(l("uColorDiffuse"),n.getColor());else if(H(n)){const t=u("aColor");p.location=t}else if(j(n)){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.lz.fG(c,n.lut,t)}return r&&(this.lz.NO(r,1,m,y,p,{location:void 0,size:1}),s.om(c,o,"phong"===h.type&&1!==t,!1),d=!0),d})),{idCount:a}}HG(t,e,i,s,r){const n=11*(t-e);if(!this.lY)return{};const o=this.lY[n+0],h=this.lY[n+1],a=this.lY[n+2],l=this.lY[n+3],u=this.lY[n+4],c=this.lY[n+5],d=Vt(this.lY[n+6],void 0),f=Vt(this.lY[n+7],void 0),g=Vt(this.lY[n+8],void 0),m=Vt(this.lY[n+9],void 0),y=Vt(this.lY[n+10],void 0);let p;for(const t of Object.keys(this.fX))if(this.fX[t].location===n){p=t;break}return{info:{dataPoint:{x:o,y:h,z:a,xSize:l,ySize:u,zSize:c,r:d,g:f,b:g,a:m,intensity:y,id:p}}}}dispose(){return super.dispose(),this.NU&&(this.lz.jO(this.NU),this.NU=void 0),this.Gz=void 0,this}dz(){return this.dispose(),this}Lv(t){this.AX=fe(this.AX,t,{canReturnB:!0})}Re(t){return this.Ie=dn(this.Ie,t),this}Jh(){return this.Ie}Dv(t){return this.gX=void 0!==t&&t>0?_t(t,0,1):void 0,this}xX(){return this.gX}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}kv(){return this.el.max.z}Tv(){return this.el.min.z}Pl(){return 0}Dl(){return 0}Fv(){return 0}fa(){return fn(this.Aa,this.Ie)}ya(t){this.Aa=t}}class cp extends Vm{constructor(t,e){super(t),this.oX="custom",this.VU=e;const{vertices:i,drawSize:s}=this.OU();this.NU=t.zO(i),this.UU=s}bz(t){return this.lz.NO(this.NU,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}om(t){return this.lz.TN(this.lz.gl.TRIANGLE_STRIP,0,this.UU,t),this}OU(){const t=this.VU,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const r=2*Math.PI*s/t,n=Math.cos(r),o=Math.sin(r);for(const t of[0,1])e[i+0]=t,e[i+1]=n,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}rO(){this.lz.jO(this.NU)}}const dp=(t,e=16)=>{let i=t.iN.sO.get(e);return i||(i=new cp(t,e),t.iN.sO.set(e,i),i)};class fp extends lp{constructor(t,e,i){super(t,e,i),this.cX="cull-back",this.wX=We,this.CX=[],this.kX=!1,this.Su=Ur.lineStyle,this.gv._(oo)}Os(t){const e=this.kX,i=this.Su,s=this.bu!==i,r=this.SO(),n=e;if(e){const t=oe(this.CX);this.TX=this.lz.zO(t,!1,this.TX)}if(n&&(this.wX=oi(this.CX)),s||r){const t=8,e=cs(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.KU=void 0,U(e)&&("primitive"===s?this.KU={type:s,shader:this.lz.VV(sm["3D"],sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}),sm.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.KU={type:s,shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:"uniform",shadingStyle:this.gv.C().type}),sm.LineInstanced3D({axisWorldTranslation:wg(this.At)})),geometry:dp(this.lz,t),fillStyle:e}))}return this.kX=!1,this.bu=i,this.gv.u=!1,this}WE(t,e){if(1===t)return{};const i=this.lz.gl,s=this.KU,r=this.TX,n=this.Su,o=this.gv.C();if(s&&r&&cs(n))switch(s.type){case"instanced":{const e=.5*this.Rs.sv(n.thickness),h=s.fillStyle.getColor(),a=s.shader,l=s.geometry;this.lz.OO(a,((s,n,u)=>{this.lz.bz(a).oN(s("uScale"),this.dX.Vz.YO()).oN(s("uDisp"),this.dX.Vz.HO()).lN(s("uViewProjectionMatrix"),this.bX).iL(s("uColorDiffuse"),h).WO(s("uOffsetWU"),e).WO(s("uIsHighlighted"),this.jo).iL(s("uHighlightColorOffset"),2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0),"phong"===o.type&&this.lz.oN(s("uCameraLoc"),this.MX).oN(s("uLightLoc"),this._X).WO(s("uAmbientReflection"),o.ambientReflection).WO(s("uSpecularReflection"),o.specularReflection).WO(s("uDiffuseReflection"),o.diffuseReflection).WO(s("uShininess"),o.shininess).iL(s("uLightColor"),o.specularColor).iL(s("uAmbientColor"),o.ambientColor),i.bindBuffer(i.ARRAY_BUFFER,r);const c=n("aLocationA"),d=n("aLocationB");return i.vertexAttribPointer(c,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(c,1),i.enableVertexAttribArray(c),i.vertexAttribPointer(d,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(d,1),i.enableVertexAttribArray(d),l.bz(u).om(this.CX.length/2),!0}));break}case"primitive":{const e=cs(n)?n.getFillStyle():void 0,o=e&&U(e)?e.getColor():void 0;if(o){const e=s.shader;this.lz.OO(e,((s,n)=>(this.lz.bz(e).oN(s("uScale"),this.dX.Vz.YO()).oN(s("uDisp"),this.dX.Vz.HO()).lN(s("uViewProjectionMatrix"),this.bX).iL(s("uColor"),o).WO(s("uIsHighlighted"),this.jo).iL(s("uHighlightColorOffset"),2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0).NO(r,void 0,{location:n("aPos"),size:3}).om(i.LINES,this.CX.length),!0)))}break}}return{idCount:this.CX.length}}HG(t,e,i,s,r){return{}}ml(t){for(let e=0;e{const l=e*r,u=Math.PI/2-t*n,c=Math.cos(u),d=c*Math.cos(l),f=c*Math.sin(l),g=Math.sin(u);i[s]=d,i[s+1]=g,i[s+2]=f,i[s+3]=o,i[s+4]=h,i[s+5]=a,s+=6};for(let i=0;i0&&(o(i,s,1,0,0),o(i,s+1,1,1,0),o(i+1,s,0,0,1)),i{this.lz.CA.eo&&s>i.length&&zt.console.warn("LightningChart JS unexpected error scenario, sphere geometry buffer size mismatch.\nA point series 3D component might have missing points.\n\nThis warning can be omitted with LightningChartOptions.warnings")})),{vertices:i,drawSize:s/6}}rO(){this.lz.jO(this.NU)}}const mp=(t,e)=>{const i=Math.round(e);i<3&&Me(0,Ot);const s=i;let r=t.iN.eO.get(Array.from(t.iN.eO.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new gp(t,i,s),t.iN.eO.set({sectors:i,stacks:s},r),r)};class yp extends lp{constructor(t,e,i){super(t,e,i),this.cX="cull-back",this.GM=[],this.KU={},this.tY=new Sy(this.GM,(t=>t.vertexBuffer&&this.lz.jO(t.vertexBuffer)),!0),this.Tu=[],this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=We,this.jG=Eg({lineStyleSolid:()=>{const t=this.Su;return cs(t)&&t},lineFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},lineFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t},jointStyleTriangulatedPoints:()=>Er(this.Rv)&&this.Rv,jointSizeTriangulated:()=>{const t=this.Rv;return Er(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Rv.getFillStyle();return U(t)&&t},jointFillPaletted:()=>{const t=this.Rv.getFillStyle();return j(t)&&t},wireframeLineStyleSolid:()=>{const t=Er(this.Rv)&&this.Rv.getWireframeStyle();return cs(t)&&t},wireframeFillSolid:()=>{const t=Er(this.Rv)&&this.Rv.getWireframeStyle(),e=t&&t.getFillStyle();return U(e)&&e}}),this.al=!1,this.Su=Ur.lineStyle,this.Rv=Ur.pointStyle3D,this.gv._(ao),this.rY={attributesPerVertex:3,prepareRenderData:(t,e)=>oe(t)}}HG(t,e,i,s,r){return{info:{dataPoint:this.Tu[t-e]}}}Os(t){const e=this.al,i=this.rl,s=this.nl,r=s>0,n=this.Su,o=n!==this.bu,h=this.Rv,a=h!==this.PX,l=this.SO(),u=this.Yo.u,c=this.Yo.C();this.ol&&(this.el=ai(this.el,this.ol),this.ol=void 0),r&&(this.Tu=fe(this.Tu,i,{canReturnB:!0}),this.hl+=s);let d=i,f=s;if(e&&(this.GM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=We})),this.tY.HW(),d=this.Tu,f=this.hl),f>0){const t=1e5,e=Math.floor(this.OG.DX/(this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.ta("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=_t(i,t,e);this.tY.GW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:We,vertexBuffer:this.lz.fN(t*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i))})),((t,e,i,s)=>{this.lz.AN(t.vertexBuffer,t.existingCoordinatesCount*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||a||l||u){const t={},e=this.jG.lineStyleSolid(o),i=this.jG.lineFillSolid(o),s=this.jG.lineFillPaletted(o),r=i||s,h=this.jG.jointStyleTriangulatedPoints(a),l=this.jG.jointSizeTriangulated(a),u=this.jG.jointFillSolid(a),d=this.jG.jointFillPaletted(a),f=u||d,g=this.jG.wireframeLineStyleSolid(a),m=this.jG.wireframeFillSolid(a),y=n.getThickness()<0||1===n.getThickness()&&this.ta("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===y&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.lz.VV(sm["3D"],sm.Color({dataType:p}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})),mousePicking:c?{shader:this.lz.VV(sm["3D"],sm.MousePicking({useVertexId:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}))}:void 0}:"instanced"===y&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:p,shadingStyle:this.gv.C().type}),sm.LineInstanced3D({axisWorldTranslation:wg(this.At)})),geometry:pp(this.lz,e.getThickness()),mousePicking:c?{shader:this.lz.VV(sm["3D"],sm.MousePicking(),sm.LineInstanced3D({axisWorldTranslation:wg(this.At)}))}:void 0}),t.markers=void 0,f&&h){const e=ce(h.getShape(),{cube:()=>hp(this.lz),sphere:()=>Ap(this.lz,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.gv.C().type,wireframe:!1!==m}),sm.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.At),normalSource:e.oX})),mousePicking:c?{shader:this.lz.VV(sm["3D"],sm.MousePicking(),sm.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.At),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.KU=t}return this.al=!1,this.rl=[],this.nl=0,this.bu=n,this.PX=h,this.gv.u=!1,this.Yo.u=!1,this}WE(t,e){var i,s;const r=this.lz.gl,{lines:n,markers:o}=this.KU,h=this.gv.C(),a=this.hl,l=1===t?null===(i=null==n?void 0:n.mousePicking)||void 0===i?void 0:i.shader:null==n?void 0:n.shader;if(n&&l&&"instanced"===n.type){const i=l,{geometry:s,lineStyleSolid:o,fillStyleSolid:a,fillStylePaletted:u}=n;this.lz.OO(i,((n,l,c)=>{let d=!1;if(this.lz.bz(i).oN(n("uScale"),this.dX.Vz.YO()).oN(n("uDisp"),this.dX.Vz.HO()).lN(n("uViewProjectionMatrix"),this.bX).WO(n("uOffsetWU"),this.Rs.sv(o.getThickness())).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.lz.oN(n("uCameraLoc"),this.MX).oN(n("uLightLoc"),this._X).WO(n("uAmbientReflection"),h.ambientReflection).WO(n("uSpecularReflection"),h.specularReflection).WO(n("uDiffuseReflection"),h.diffuseReflection).WO(n("uShininess"),h.shininess).iL(n("uLightColor"),h.specularColor).iL(n("uAmbientColor"),h.ambientColor),1===t);else if(a)this.lz.iL(n("uColorDiffuse"),a.getColor());else if(u){const t=kg(u,this,void 0);if(!t&&u.lut.percentageValues)return!1;this.lz.fG(c,u.lut,t)}const f=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=f.Wt(e.existingDataPointsCount);this.lz.uN(n("uFirstId"),t).nG(c,i)}r.bindBuffer(r.ARRAY_BUFFER,e.vertexBuffer);const i=l("aLocationA"),o=l("aLocationB");r.vertexAttribPointer(i,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(i,1),r.enableVertexAttribArray(i),r.vertexAttribPointer(o,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(o,1),r.enableVertexAttribArray(o),s.bz(c).om(e.existingCoordinatesCount-1),d=!0})),d}))}if(n&&l&&"primitive"===n.type){const i=l,{fillStyleSolid:s,fillStylePaletted:o}=n;this.lz.OO(i,((n,h,a)=>{let l=!1;if(this.lz.bz(i).oN(n("uScale"),this.dX.Vz.YO()).oN(n("uDisp"),this.dX.Vz.HO()).lN(n("uViewProjectionMatrix"),this.bX).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),1===t);else if(s)this.lz.iL(n("uColor"),s.getColor());else if(o){const t=kg(o,this,void 0);if(!t&&o.lut.percentageValues)return!1;this.lz.fG(a,o.lut,t)}const u=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=u.Wt(e.existingDataPointsCount);this.lz.uN(n("uFirstId"),t).hG(a,i)}this.lz.NO(e.vertexBuffer,void 0,{location:h("aPos"),size:3}).om(r.LINE_STRIP,e.existingCoordinatesCount),l=!0})),l}))}const u=1===t?null===(s=null==o?void 0:o.mousePicking)||void 0===s?void 0:s.shader:null==o?void 0:o.shader;if(o&&u){const i=u,{geometry:s,fillStyleSolid:r,fillStylePaletted:n,pointSizeAxis:a,pointSizeNWU:l,wireframe:c}=o;this.lz.OO(i,((o,u,d,f)=>{let g=!1;if(this.lz.bz(i).oN(o("uScale"),this.dX.Vz.YO()).oN(o("uDisp"),this.dX.Vz.HO()).lN(o("uViewProjectionMatrix"),this.bX).WO(f("uRatioNwuWu"),this.dX.BX()).WO(o("uIsHighlighted"),1===t||2===t?0:this.jo).iL(o("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(o("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.lz.oN(o("uCameraLoc"),this.MX).oN(o("uLightLoc"),this._X).WO(o("uAmbientReflection"),h.ambientReflection).WO(o("uSpecularReflection"),h.specularReflection).WO(o("uDiffuseReflection"),h.diffuseReflection).WO(o("uShininess"),h.shininess).iL(o("uLightColor"),h.specularColor).iL(o("uAmbientColor"),h.ambientColor),1===t);else if(r)this.lz.iL(o("uColorDiffuse"),r.getColor());else if(n){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.lz.fG(d,n.lut,t)}c&&1!==t&&this.lz.WO(o("uWireframeThickness"),c.thickness).iL(o("uWireframeColor"),c.fillStyleSolid.getColor()),!1!==a&&this.lz.oN(o("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.lz.WO(o("uOffsetNWU"),l);const m=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=m.Wt(e.existingDataPointsCount);this.lz.uN(o("uFirstId"),t).nG(d,i)}this.lz.NO(e.vertexBuffer,1,{location:u("aPos"),size:3}),s.om(d,e.existingCoordinatesCount,"phong"===h.type&&1!==t,Boolean(c)&&1!==t),g=!0})),g}))}return{idCount:a}}ml(t,e){Array.isArray(t)||(t=[t]),this.rl=fe(this.rl,t,{canReturnB:!0}),this.nl+=t.length;const i=e||oi(t);return this.ol=this.ol?ai(this.ol,i):i,this}Ye(t){return this.Su="function"==typeof t?t(this.Su):t,this}xu(){return this.Su}Zm(t){return this.Rv="function"==typeof t?t(this.Rv):t,this}LX(){return this.Rv}St(){return this.ol?Math.max(this.ol.max.x,this.el.max.x):this.el.max.x}vt(){return this.ol?Math.min(this.ol.min.x,this.el.min.x):this.el.min.x}bt(){return this.ol?Math.max(this.ol.max.y,this.el.max.y):this.el.max.y}xt(){return this.ol?Math.min(this.ol.min.y,this.el.min.y):this.el.min.y}kv(){return this.ol?Math.max(this.ol.max.z,this.el.max.z):this.el.max.z}Tv(){return this.ol?Math.min(this.ol.min.z,this.el.min.z):this.el.min.z}Pl(){return Re(this.Su)}Dl(){return Re(this.Su)}Fv(){return Re(this.Su)}cl(){return this.Tu}ul(){return this.rl}vl(){return this.hl}Sl(){return this.nl}Ot(){return this.al=!0,this.Tu.length=0,this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=void 0,this}dispose(){return super.dispose(),this.tY.XW(),this.KU={},this}dz(){return this.dispose(),this}}const pp=(t,e)=>dp(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Ap=(t,e)=>{const i=e.getSize();return mp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class xp extends lp{constructor(t,e,i){super(t,e,i),this.cX="disabled",this.RX=!1,this.EX=!1,this.zX={x:1,y:1,z:1},this.XS={x:0,y:0,z:0},this.HS={x:0,y:0,z:0},this.VX={x:0,y:0,z:0},this.jS={x:0,y:0,z:0,w:1},this.ZS={x:1,y:1,z:1},this.OX=Lm.projectionOrthographic(-1,1,-1,1,1,-1),this.NX=Lm.projectionOrthographic(-1,1,-1,1,1,-1),this.GX=!1,this.isEulerRotation=!0,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleValuePalette:()=>j(this.Ie)&&"value"===this.Ie.lookUpProperty&&this.Ie}),this.Ie=Ur.fillStyle,this.gv._(ao)}Os(t){var e;const i=this.SO(),s=this.Yo.C(),r=this.Yo.u,n=this.fa();this.jG.fillStyleSolid(n);const o=this.jG.fillStyleValuePalette(n),h=this.VX,a=this.ZS;if(this.RX&&this.UX&&(this.NU=this.lz.zO(this.UX.vertices,void 0,this.NU),this.GU=this.lz.yN(this.UX.indices,this.GU),this.WX=this.UX.indices.length),"phong"===this.gv.C().type&&(i||this.RX)&&(null===(e=this.UX)||void 0===e?void 0:e.normals)&&(this.YX=this.lz.zO(this.UX.normals,void 0,this.YX)),!this.HX&&o&&"value"===o.lookUpProperty&&this.UX&&(this.HX=new Float32Array(this.UX.vertices.length/3),this.EX=!0),this.HX&&this.EX&&(this.XX=this.lz.zO(this.HX,void 0,this.XX)),i||n||r){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.Gz=this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.gv.C().type,wireframe:!1}),sm.Model3D({normalSource:"phong"===this.gv.C().type?"attribute":void 0})),this.qH=s?this.lz.VV(sm["3D"],sm.MousePicking({useVertexId:!0}),sm.Model3D({normalSource:void 0})):void 0}if(this.GX){const t=Lm.projectionOrthographic(-1,1,-1,1,1,-1);if(this.isEulerRotation)this.NX=Lm.rotateXYZ(t,h),this.OX=Lm.translate(t,a.x/2,a.y/2,a.z/2),this.OX=Lm.rotateXYZ(this.OX,h),this.OX=Lm.translate(this.OX,-a.x/2,-a.y/2,-a.z/2);else{const e=[-this.jS.x,-this.jS.y,-this.jS.z,this.jS.w];this.NX=Lm.quaternionToRotationMatrix(e),this.OX=Lm.translate(t,a.x/2,a.y/2,a.z/2),this.OX=Lm.multiply(this.OX,this.NX),this.OX=Lm.translate(this.OX,-a.x/2,-a.y/2,-a.z/2)}this.GX=!1}return this.gv.u=!1,this.ya(this.Ie),this.Yo.u=!1,this.RX=!1,this.EX=!1,this}WE(t,e){const i=1===t?this.qH:this.Gz,s=1===t,r=this.GU,n=this.WX,o=this.NU,h=this.YX,a=this.XX,l=this.XS,u=this.HS,c=this.zX,d=this.ZS,f=this.OX,g=this.NX,m=this.jG.fillStyleValuePalette(!1),y=this.jG.fillStyleSolid(!1),p=this.gv.C(),A={location:void 0,size:1};if(!(i&&o&&r&&n&&this.UX))return{};const x=this.UX.vertices.length;return this.lz.OO(i,((S,v,b,M)=>{if(this.lz.bz(i).oN(S("uScale"),this.dX.Vz.YO()).oN(S("uDisp"),this.dX.Vz.HO()).lN(S("uViewProjectionMatrix"),this.bX).WO(S("uIsHighlighted"),1===t||2===t?0:this.jo).iL(S("uHighlightColorOffset"),this.Ko).WO(S("uRenderEffectMask"),2===t?1:0),s)this.lz.uN(S("uFirstId"),e).hG(b,x);else{if(this.Ie===_)return!1;if(y)this.lz.iL(S("uColorDiffuse"),y.getColor());else if(m){if(!a)return!1;const t=m.getPalette();A.location=v("aLookupValue"),this.lz.fG(b,t,void 0).NO(a,void 0,A)}}return"phong"!==p.type||s||(this.lz.oN(S("uCameraLoc"),this.MX).oN(S("uLightLoc"),this._X).WO(S("uAmbientReflection"),p.ambientReflection).WO(S("uSpecularReflection"),p.specularReflection).WO(S("uDiffuseReflection"),p.diffuseReflection).WO(S("uShininess"),p.shininess).iL(S("uLightColor"),p.specularColor).iL(S("uAmbientColor"),p.ambientColor).lN(S("uModelRotationNormals"),g),h&&this.lz.NO(h,void 0,{location:b.attribute("aNormal"),size:3})),this.lz.lN(S("uModelRotation"),f).oN(S("uModelScale"),[c.x,c.y,c.z]).oN(S("uLocationAxis"),[l.x,l.y,l.z]).oN(S("uModelAlignment"),[u.x,u.y,u.z]).oN(S("uModelSize"),[d.x,d.y,d.z]),this.lz.NO(o,0,{location:b.attribute("aGeoPos"),size:3}).wN(r).kN(n,this.lz.gl.TRIANGLES),!0})),{idCount:x}}$X(t){if(this.jX)return this.jX;const e=this.XS,i=this.HS,s=this.zX,r=this.ZS,n=this.VX,o=this.jS,h=this.dX.Wx(e),a=[],l=Lm.projectionOrthographic(-1,1,-1,1,1,-1);let u;if(this.isEulerRotation)u=Lm.translate(l,r.x/2,r.y/2,r.z/2),u=Lm.rotateXYZ(u,n),u=Lm.translate(u,-r.x/2,-r.y/2,-r.z/2);else{const t=[-o.x,-o.y,-o.z,o.w];u=Lm.translate(l,r.x/2,r.y/2,r.z/2),u=Lm.multiply(u,Lm.quaternionToRotationMatrix(t)),u=Lm.translate(u,-r.x/2,-r.y/2,-r.z/2)}const c=(i.x+1)*(r.x/2),d=(i.y+1)*(r.y/2),f=(i.z+1)*(r.z/2);for(let e=0;et.map((t=>{const e={x:i.vertices[3*t],y:i.vertices[3*t+1],z:i.vertices[3*t+2]},s=r[t],o=this.dX.Yx(s),h=this.dX.hv(o);return{index:t,vertex:e,world:s,axis:o,dist:h?ii(h,n):Ye}})))).flat();o.sort(((t,e)=>t.dist-e.dist));const h=o[0];if(!h)return;const a=this.HX?this.HX[h.index]:void 0;return{coordModel:h.vertex,coordAxis:h.axis,index:h.index,value:a}}dispose(){return super.dispose(),this.NU&&(this.lz.jO(this.NU),this.NU=void 0),this.GU&&(this.lz.jO(this.GU),this.GU=void 0),this.YX&&(this.lz.jO(this.YX),this.YX=void 0),this.XX&&(this.lz.jO(this.XX),this.XX=void 0),this.Gz=void 0,this.qH=void 0,this.UX=void 0,this.HX=void 0,this}dz(){return this.dispose(),this}KS(t){return this.UX=t,this.RX=!0,this.ZS=t.modelSize,this}Re(t){return this.Ie=dn(this.Ie,t),this}Jh(){return this.Ie}tx(t){return this.zX=t,this.jX=void 0,this}YO(){return this.zX}ix(t){return this.XS=t,this.jX=void 0,this}sx(t){return this.HS=t,this.jX=void 0,this}hx(t){return this.VX=t,this.GX=!0,this.isEulerRotation=!0,this.jX=void 0,this}nx(t){return this.jS=t,this.GX=!0,this.isEulerRotation=!1,this.jX=void 0,this}ox(t){return this.cX=t,this}lx(){return this.cX}St(){return He}vt(){return Ye}bt(){return He}xt(){return Ye}kv(){return He}Tv(){return Ye}Pl(){return 0}Dl(){return 0}Fv(){return 0}fa(){return fn(this.Aa,this.Ie)}ya(t){this.Aa=t}}class Sp extends lp{constructor(t,e,i,s){super(t,e,i),this.cX="cull-back",this.GM=[],this.tY=new Sy(this.GM,(t=>t.vertexBuffer&&this.lz.jO(t.vertexBuffer)),!1),this.Tu=[],this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=We,this.al=!1,this.jG=Eg({fillStyleSolid:()=>{const t=this.Vv.getFillStyle();return U(t)&&t},fillStyleIndividual:()=>{const t=this.Vv.getFillStyle();return H(t)&&t},fillStylePalette:()=>{const t=this.Vv.getFillStyle();return j(t)&&t},triangulatedPointStyle:()=>{const t=this.Vv;return Er(t)&&t},wireframeLineStyleSolid:()=>{const t=Er(this.Vv)&&this.Vv,e=t&&t.getWireframeStyle();return cs(e)&&e},wireframeFillStyleSolid:()=>{const t=Er(this.Vv)&&this.Vv,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return U(i)&&i}}),this.ll=void 0,this.io=s,this.Vv=Ur.pointStyle3D,this.gv._(ao);const r=!0===(null==s?void 0:s.individualPointColorEnabled),n=!0===(null==s?void 0:s.individualPointSizeEnabled),o=!0===(null==s?void 0:s.individualLookupValuesEnabled),h=!0===(null==s?void 0:s.individualPointSizeAxisEnabled);let a,l,u,c,d=0;d+=3,r&&(a=d,d+=4),n&&(l=d,d+=1),o&&(u=d,d+=1),h&&(c=d,d+=3);const f=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&H(e)&&e.getFallbackColor()||k,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eoe(t))(r,n,o,h);this.rY={individualPointColorEnabled:r,individualPointSizeEnabled:n,individualLookupValuesEnabled:o,individualPointSizeAxisEnabled:h,attributesPerVertex:d,attributeOffsetCoordinate:0,attributeOffsetColor:a,attributeOffsetSize:l,attributeOffsetLookUpValue:u,attributeOffsetPointSize3D:c,prepareRenderData:(t,e)=>f(t,this.Vv,this.Vv.fillStyle)}}HG(t,e,i,s,r){return{info:{dataPoint:this.Tu[t-e]}}}Os(t){const e=this.al,i=this.rl,s=this.nl,r=s>0,n=this.Vv,o=this.Vv!==this.ZX,h=this.Yo.C(),a=this.Yo.u,l=this.SO();this.ol&&(this.el=ai(this.el,this.ol),this.ol=void 0),r&&(this.Tu=fe(this.Tu,i,{canReturnB:!0}),this.hl+=s);let u=i,c=s;if(e&&(this.GM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=We})),this.tY.HW(),u=this.Tu,c=this.hl),c>0){const t=Math.floor(this.OG.DX/(this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=_t(c,1e5,t);this.tY.GW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:We,vertexBuffer:this.lz.fN(t*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i))})),((t,e,i)=>{this.lz.AN(t.vertexBuffer,t.existingCoordinatesCount*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.jG.fillStyleSolid(o),g=this.jG.fillStyleIndividual(o),m=this.jG.fillStylePalette(o),y=d===_&&_;if(o||l||a){let t;const e=n.getSize(),i=this.rY.individualPointColorEnabled,s=this.rY.individualPointSizeEnabled,r=this.rY.individualPointSizeAxisEnabled,a=this.rY.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw zt.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw zt.alert(t),new Error(t)}const l=this.jG.wireframeLineStyleSolid(o),u=this.jG.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(Er(n)){const r=ce(n.getShape(),{cube:()=>hp(this.lz),sphere:()=>vp(this.lz,n,s)});t={type:"instanced",shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:i,shadingStyle:this.gv.C().type,wireframe:!1!==u}),sm.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.At),normalSource:r.oX})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:y,mousePickingShader:h&&this.lz.VV(sm["3D"],sm.MousePicking(),sm.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.At),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else zr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.lz.VV(sm["3D"],sm.PointSize(c),sm.Color({dataType:i}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:h&&this.lz.VV(sm["3D"],sm.PointSize(c),sm.MousePicking({useVertexId:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}))})}this.KU=t}if(void 0===this.ll&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=He,e=Ye;for(let i=0;it&&(t=s.value)}this.ll={min:e,max:t}}return this.al=!1,this.rl=[],this.nl=0,this.ZX=n,this.gv.u=!1,this}WE(t,e){const i=this.lz.gl,s=this.KU,r=this.hl;if(!s)return{};const n=1===t?s.mousePickingShader:s.shader;if(!n)return{};const o=this.gv.C(),{fillStyleSolid:h,fillStylePaletted:a,useIndividualPointSize:l}=s,u="instanced"===s.type&&s.useIndividualPointSize3D,c="instanced"===s.type&&s.wireframe;return this.lz.OO(n,((r,d,f,g)=>{let m=!1;if(this.lz.bz(n).oN(r("uScale"),this.dX.Vz.YO()).oN(r("uDisp"),this.dX.Vz.HO()).lN(r("uViewProjectionMatrix"),this.bX).WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0),"instanced"===s.type){const{pointSizeAxis:t,pointSizeNWU:e}=s;!1!==t&&!1===u&&this.lz.oN(r("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===l&&this.lz.WO(r("uOffsetNWU"),e).WO(g("uRatioNwuWu"),this.dX.BX())}else if("primitive"===s.type){const{pointSizePixels:t}=s;l||this.lz.WO(r("uPointSize"),t).WO(r("uDevicePixelRatio"),this.lz.MO())}if(1===t);else if("instanced"===s.type?("phong"===o.type&&this.lz.oN(r("uCameraLoc"),this.MX).oN(r("uLightLoc"),this._X).WO(r("uAmbientReflection"),o.ambientReflection).WO(r("uSpecularReflection"),o.specularReflection).WO(r("uDiffuseReflection"),o.diffuseReflection).WO(r("uShininess"),o.shininess).iL(r("uLightColor"),o.specularColor).iL(r("uAmbientColor"),o.ambientColor),c&&this.lz.WO(r("uWireframeThickness"),c.thickness).iL(r("uWireframeColor"),c.fillStyleSolid.getColor()),h&&this.lz.iL(r("uColorDiffuse"),h.getColor()),s.fillStyleEmpty&&this.lz.iL(r("uColorDiffuse"),I)):"primitive"===s.type&&h&&this.lz.iL(r("uColor"),h.getColor()),a){const t=kg(a,this,this.ll);if(!t&&a.lut.percentageValues)return!1;this.lz.fG(f,a.lut,t)}const y=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=y.Wt(e.existingDataPointsCount);this.lz.uN(r("uFirstId"),t),"instanced"===s.type?this.lz.nG(f,i):this.lz.hG(f,i)}i.bindBuffer(i.ARRAY_BUFFER,e.vertexBuffer);const n=d("aPos");if(i.vertexAttribPointer(n,3,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(n,1),i.enableVertexAttribArray(n),s.fillStyleIndividual&&void 0!==this.rY.attributeOffsetColor&&1!==t){const t=d("aColor");i.vertexAttribPointer(t,4,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}if(l&&void 0!==this.rY.attributeOffsetSize){"instanced"===s.type?this.lz.WO(g("uRatioNwuWu"),this.dX.BX()):"primitive"===s.type&&this.lz.WO(r("uDevicePixelRatio"),this.lz.MO());const t=d("instanced"===s.type?"aOffsetNWU":"aPointSize");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}if(u&&void 0!==this.rY.attributeOffsetPointSize3D&&"instanced"===s.type){const t=d("aOffsetAxis");i.vertexAttribPointer(t,3,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}if(s.fillStylePaletted&&"value"===s.fillStylePaletted.getLookUpProperty()&&void 0!==this.rY.attributeOffsetLookUpValue&&1!==t){const t=d("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}"instanced"===s.type?(s.geometry.om(f,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(c)&&1!==t),m=!0):"primitive"===s.type&&(this.lz.om(i.POINTS,e.existingCoordinatesCount),m=!0)})),m})),{idCount:r}}ml(t,e){Array.isArray(t)||(t=[t]),this.rl=fe(this.rl,t,{canReturnB:!0}),this.nl+=t.length;const i=e||oi(t);return this.ol=this.ol?ai(this.ol,i):i,this.ll=void 0,this}Ov(t){return this.Vv="function"==typeof t?t(this.Vv):t,this}QX(){return this.Vv}St(){return this.ol?Math.max(this.ol.max.x,this.el.max.x):this.el.max.x}vt(){return this.ol?Math.min(this.ol.min.x,this.el.min.x):this.el.min.x}bt(){return this.ol?Math.max(this.ol.max.y,this.el.max.y):this.el.max.y}xt(){return this.ol?Math.min(this.ol.min.y,this.el.min.y):this.el.min.y}kv(){return this.ol?Math.max(this.ol.max.z,this.el.max.z):this.el.max.z}Tv(){return this.ol?Math.min(this.ol.min.z,this.el.min.z):this.el.min.z}Pl(){const t=this.Vv,e=t.getSize();return"number"==typeof e?Er(t)?e/2:zr(t)?5:0:0}Dl(){return this.Pl()}Fv(){return this.Pl()}cl(){return this.Tu}ul(){return this.rl}vl(){return this.hl}Sl(){return this.nl}Ot(){return this.al=!0,this.Tu.length=0,this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=void 0,this.ll=void 0,this}dispose(){return super.dispose(),this.tY.XW(),this.KU=void 0,this}dz(){return this.dispose(),this}}const vp=(t,e,i)=>{const s=e.getSize();return mp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class bp extends lp{constructor(t,e,i,s){super(t,e,i),this.cX="disabled",this.Ie=Ur.fillStyle,this.FS=Ur.lineStyle,this.WY=p("bilinear"),this.JX=[],this.KX=void 0,this.KU={},this.qX=!1,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie,wireframeStyleLine:()=>cs(this.FS)&&this.FS,wireframeStyleFill:()=>{const t=this.FS&&this.FS.getFillStyle();return U(t)&&t}}),this.Pi={x:0,z:0},this.Cw={x:1,z:1},this.gv._(oo);const r="columns"===s.dataOrder?s.columns:s.rows,n="columns"===s.dataOrder?s.rows:s.columns;this.io={...s,primaryDimensionVectorsCount:r,secondaryDimensionVectorsCount:n},this.t$=new Array(this.io.primaryDimensionVectorsCount).fill(void 0),this.c_=new By(this.OG,t.OG.nH,t.cs.At,Ot,[],this.io).IS(ut),this.c_.$Y=Ry;const o=this.c_.ZY.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),o={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:s,iFirstGeometryUniqueVector:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:n,normalmapSize:o}})),h=this.c_.ZY.gridTileSizes.map((t=>{const e=o.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary)),i=e[0].sizeGeometryDataVectors;return{...t,tiles:e,sizeGeometryData:i}})),a=o.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,r=i*s;return r>t.cells?{primary:i,secondary:s,cells:r}:t}),{primary:0,secondary:0,cells:0});this.i$={gridTiles:o,gridTileSizes:h,largestGridTileSize:a},this.BS(this.Pi,this.Cw)}HG(t,e,i,s,r){const n=t-e,o=n%(this.io.secondaryDimensionVectorsCount-1),h=Math.floor(n/(this.io.secondaryDimensionVectorsCount-1)),a="columns"===this.io.dataOrder?h:o,l="rows"===this.io.dataOrder?h:o,u=[{x:this.Pi.x+a*this.Cw.x,z:this.Pi.z+l*this.Cw.z,y:this.s$(h,o),intensity:this.e$(h,o),column:"columns"===this.io.dataOrder?h:o,row:"columns"===this.io.dataOrder?o:h},{x:this.Pi.x+(a+("columns"===this.io.dataOrder?1:0))*this.Cw.x,z:this.Pi.z+(l+("rows"===this.io.dataOrder?1:0))*this.Cw.z,y:this.s$(h+1,o),intensity:this.e$(h+1,o),column:"columns"===this.io.dataOrder?h+1:o,row:"columns"===this.io.dataOrder?o:h+1},{x:this.Pi.x+(a+1)*this.Cw.x,z:this.Pi.z+(l+1)*this.Cw.z,y:this.s$(h+1,o+1),intensity:this.e$(h+1,o+1),column:"columns"===this.io.dataOrder?h+1:o+1,row:"columns"===this.io.dataOrder?o+1:h+1},{x:this.Pi.x+(a+("columns"===this.io.dataOrder?0:1))*this.Cw.x,z:this.Pi.z+(l+("rows"===this.io.dataOrder?0:1))*this.Cw.z,y:this.s$(h,o+1),intensity:this.e$(h,o+1),column:"columns"===this.io.dataOrder?h:o+1,row:"columns"===this.io.dataOrder?o+1:h}],c=u.map((t=>this.dX.hv(t))).map((t=>void 0===t?Ye:ii(t,{x:s,y:r}))).map(((t,e)=>({i:e,dist:t})));return c.sort(((t,e)=>t.dist-e.dist)),{info:{dataPoint:{...u[c[0].i]}}}}s$(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.heightmapData[n]}}return 0}e$(t,e){if(this.c_.HY)for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}}h$(t){this.r$=t,this.KX=void 0}BS(t,e){this.Pi=t,this.Cw=e;const i=this.io,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.Cw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.Cw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.Cw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.Cw.z)}},r=new Map;return this.i$.gridTiles.forEach((t=>{const e="columns"===this.io.dataOrder?{x:this.Cw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Cw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Cw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Cw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.io.dataOrder?{x:this.Pi.x+this.Cw.x*t.iFirstVector.primary,z:this.Pi.z+this.Cw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.Cw.x*t.iFirstVector.secondary,z:this.Pi.z+this.Cw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.iH={n$:s,tilesInfo:r},this}LS(){return{start:this.Pi,step:this.Cw,end:{x:this.Pi.x+this.Cw.x*this.io.columns,z:this.Pi.z+this.Cw.z*this.io.rows}}}Os(t){const e=this.JX,i=fn(this.Aa,this.Ie),s=this.jG.fillStyleSolid(i),r=this.jG.fillStylePaletted(i),n=this.FS,o=this.FS!==this.QY,h=this.jG.wireframeStyleLine(o),a=this.jG.wireframeStyleFill(o),l=!1!==a,u=this.WY.u,c=this.WY.C(),d=this.gv.C(),f=this.SO(),g=this.Yo.C();this.c_.Os();const m=this.c_.JY;if(!m)return this;this.o$=this.o$||this.a$(m);const y=this.o$;this.l$(y);const p=Dy(e,y,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Ly(this.lz,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.qX=!0),"phong"===d.type&&(p.size>0||f)){const t=this.lz.gl,e=this.lz.VV(sm["2D"],sm.DrawToNormalTexture({flipXZ:"rows"===this.io.dataOrder,vertexIdSource:this.lz.eG(),normalTextureType:this.lz.gl2?"uint":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN}));y.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.iH)||void 0===r?void 0:r.tilesInfo.get(s.tileData);if(!n||!o)return;const h={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},a=h.x*h.y;this.lz.NN.WE((()=>{this.lz.OO(e,((r,n,h,l)=>(this.lz.bz(e).hG(h,a).GO(r("uTileDimensionsXZ"),["columns"===this.io.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.io.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).rN(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).GO(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).GO(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).UO(r("uHeightmapTexture"),s.heightmapDataTexture,1).om(t.POINTS,a),!0)))}),n,h,void 0,this.cs.In(),0)}))}))}const A=this.KU;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return A.mousePicking=g?this.KU.mousePicking||{shader:this.lz.VV(sm["3D"],sm.MousePicking(),sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:"simple",wireframe:!1,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.KU=A,this.JX.length=0,this.Aa=this.Ie,this.QY=n,this.gv.u=!1,this}a$(t){const e=this.i$.gridTiles.map((e=>{const i=Oy(this.lz,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary),s=t.gridTiles.find((t=>t.iFirstUniqueVector.primary===e.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===e.iFirstUniqueVector.secondary));if(!s)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return{...e,intensityDataTexture:s.intensityDataTexture,heightmapDataTexture:i,normalmap:void 0,tileData:e}})),i=this.i$.gridTileSizes.map((t=>{const i=e.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary));return{...t,tiles:i}})),s=this.lz.zO([0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0]),r=this.lz.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}l$(t){var e;if("phong"===this.gv.C().type)for(let i=0;i{t.normalmapTexture&&(this.lz.fz(t.normalmapTexture),t.normalmapTexture=void 0)}))}WE(t,e){var i,s,r,n;const o=this.lz.gl,h=this.o$;if(!h)return{};const a=this.gv.C(),l=this.KU,u=1===t?null===(i=l.mousePicking)||void 0===i?void 0:i.shader:null===(s=l.surface)||void 0===s?void 0:s.shader;if(!u)return{};const c=1!==t?null===(r=l.surface)||void 0===r?void 0:r.wireframe:void 0,d=1!==t?null===(n=l.surface)||void 0===n?void 0:n.fill:void 0;return this.lz.OO(u,((i,s,r,n)=>{let l=!1;if(this.lz.bz(u).nG(r,this.i$.largestGridTileSize.cells).oN(i("uScale"),this.dX.Vz.YO()).oN(i("uDisp"),this.dX.Vz.HO()).lN(i("uViewProjectionMatrix"),this.bX).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.lz.oN(i("uCameraLoc"),this.MX).oN(i("uLightLoc"),this._X).WO(i("uAmbientReflection"),a.ambientReflection).WO(i("uSpecularReflection"),a.specularReflection).WO(i("uDiffuseReflection"),a.diffuseReflection).WO(i("uShininess"),a.shininess).iL(i("uLightColor"),a.specularColor).iL(i("uAmbientColor"),a.ambientColor),c)){const{wireframeFillSolid:t,wireframeSolid:e}=c,s=e.getThickness()<0?1:e.getThickness();this.lz.iL(i("uWireframeColor"),t.getColor()).WO(i("uWireframeThickness"),s)}return 1===t||"solid"===(null==d?void 0:d.fillMode)&&this.lz.iL(i("uColorDiffuse"),d.fillStyleSolid.getColor()),h.gridTileSizes.forEach((n=>{this.lz.GO(i("uTileDimensionsXZ"),["columns"===this.io.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.io.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).rN(i("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var u;const f=null===(u=this.iH)||void 0===u?void 0:u.tilesInfo.get(a.tileData);if(!f)return;let g=0,y=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.r$){const t=this.r$.fill.iFirstPrimary,e=this.r$.fill.iFirstPrimary+this.r$.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);g=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),y=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(g<0||y<=0)){if("intensity"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e=this.c_.ll;this.lz.fG(r,t.lut,e).UO(i("uTileIntensityValues"),a.intensityDataTexture,2).nN(i("uTileBoundsAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z,f.sizeAxis.x,f.sizeAxis.z])}if("xyz"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e="x"===t.getLookUpProperty()?{min:this.vt(),max:this.St()}:"y"===t.getLookUpProperty()?{min:this.xt(),max:this.bt()}:"z"===t.getLookUpProperty()?{min:this.Tv(),max:this.kv()}:void 0;if(!e&&t.lut.percentageValues)return;this.lz.fG(r,t.lut,e)}1!==t&&"phong"===this.gv.C().type&&a.normalmapTexture&&this.lz.UO(i("uNormalmapTexture"),a.normalmapTexture,3),1===t&&this.lz.uN(i("uFirstId"),e+g),this.lz.NO(h.rectangleLocationsBuffer,0,{location:s("aGeoCellOffset"),size:2},{location:c?s("aTriangleBary"):void 0,size:3}).uN(i("uBaseInstance"),g).GO(i("uTileStartLocationAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z]).GO(i("uTileSizeAxisXZ"),[f.sizeAxis.x,f.sizeAxis.z]).UO(i("uHeightmapTexture"),a.heightmapDataTexture,0).TN(h.rectangleLocationsDrawMode,0,h.rectangleLocationsDrawLength,y),l=!0,o.bindBuffer(o.ARRAY_BUFFER,null)}}))})),l})),{idCount:this.io.columns*this.io.rows}}dispose(){return super.dispose(),this.c_.dispose(),this.o$&&(this.o$.gridTileSizes.forEach((t=>{})),this.o$.gridTiles.forEach((t=>{this.lz.fz(t.heightmapDataTexture),t.normalmapTexture&&this.lz.fz(t.normalmapTexture)})),this.lz.jO(this.o$.rectangleLocationsBuffer),this.o$=void 0),this.KU={},this}dz(){return this.dispose(),this.c_.dz(),this}VS(t){return this.c_.VS(t),this}OS(t){this.JX.push(t),Py(this.i$.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let n=Math.max(t,r.iFirstUniqueVector.primary);n<=Math.min(e,r.iFirstUniqueVector.primary+r.sizeUniqueHeatmapDataVectors.primary-1);n+=1){const t=(n-r.iFirstUniqueVector.primary)*r.sizeHeatmapDataVectors.secondary;let e=this.t$[n];if(e)i=ie.max?s:e.max;else{e={min:Ye,max:He},this.t$[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.KX={min:i,max:s},this.KX}}class Mp extends lp{constructor(t,e,i,s){super(t,e,i),this.cX="disabled",this.eH=0,this.rH={},this.c$=new Map,this.Pi={x:0,z:0},this.Cw={x:1,z:1},this.io={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.n$={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.Cw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.Cw.z:this.Pi.z}};const r=()=>({shape:new bp(this.dX,Ot,this.Qo,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"}).setVisible(!1),hasData:!1});this.GM=[r(),r()]}Os(t){this.GM.forEach((e=>{e.shape.Os(t)}));const e=this.GM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Vt(null===(i=e.shape.c_.ll)||void 0===i?void 0:i.min,Ye)),t.max=Math.max(t.max,Vt(null===(s=e.shape.c_.ll)||void 0===s?void 0:s.max,He)),t}),{min:Ye,max:He}),i=this.GM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Vt(null===(i=e.shape.KX)||void 0===i?void 0:i.min,Ye)),t.max=Math.max(t.max,Vt(null===(s=e.shape.KX)||void 0===s?void 0:s.max,He)),t}),{min:Ye,max:He});return this.GM.forEach((t=>{t.shape.c_.ll=e,t.shape.KX=i})),this}WE(t,e){let i=0;return this.GM.forEach((s=>{if(!s.hasData)return;s.shape.bX=this.bX,s.shape.MX=this.MX,s.shape._X=this._X;const{idCount:r}=s.shape.WE(t,e+i);void 0!==r&&(this.c$.set(s,{idFirst:e+i,idCount:r}),i+=r)})),{idCount:i}}HG(t,e,i,s,r){const n=Array.from(this.c$).find((e=>ti(t,e[1].idFirst,e[1].idFirst+e[1].idCount-1)));return n?n[0].shape.HG(t,n[1].idFirst,n[1].idCount,s,r):{}}BS(t,e){return this.Pi=t,this.Cw=e,this.GM.forEach((t=>{t.shape.BS("columns"===this.io.scrollDimension?{x:t.shape.LS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.LS().start.z},this.Cw)})),"columns"===this.io.scrollDimension?(this.n$.min.z=t.z,this.n$.max.z=this.Pi.z+(this.io.rows-1)*this.Cw.z):(this.n$.min.x=t.x,this.n$.max.x=this.Pi.x+(this.io.columns-1)*this.Cw.x),this}LS(){return{start:this.Pi,step:this.Cw}}Ot(){return this.eH=0,this.rH={},this.n$={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.io.scrollDimension?this.Pi.x+(this.io.columns-1)*this.Cw.x:this.Pi.x,z:"columns"===this.io.scrollDimension?this.Pi.z+(this.io.rows-1)*this.Cw.z:this.Pi.z}},this.GM.forEach((t=>{t.shape.setVisible(!1),t.shape.qX=!1,t.hasData=!1})),this}WS(t){var e;const i=this.GM[0],s=this.GM[1],r=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let n=0;if(!r)return this;do{const e=Math.floor(this.eH/this.io.scrollDimensionSize)%this.GM.length,o=this.GM[e],h=this.eH%this.io.scrollDimensionSize,a=this.io.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,y=this.eH>=this.io.scrollDimensionSize&&c<=this.io.scrollDimensionSize-1,p=l;l&&(o.shape.BS("columns"===this.io.scrollDimension?{x:this.Pi.x+(this.eH-1)*this.Cw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.eH-1)*this.Cw.z},this.Cw),o.shape.setVisible(!0));const A=y?0:1,x=c+(y?1:0);o.shape.h$({fill:{iFirstPrimary:A,amountPrimary:x},wireframe:{iFirstPrimary:A,amountPrimary:x,connectNext:!1}});const S=o===i?s:i,v=c+1,b=1+this.io.scrollDimensionSize-v;S.shape.h$({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;p&&this.rH.yValues&&(i=!0,e.splice(0,0,this.rH.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.io.staticDimensionSize,values:e,type:"y"};o.shape.OS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;p&&this.rH.intensityValues&&(i=!0,e.splice(0,0,this.rH.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.io.staticDimensionSize,values:e,type:"intensity"};o.shape.VS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.eH+=u,n+=u,this.rH=M}while(ne.shape.ES(t))),this}zS(){return this.GM[0].shape.zS()}Re(t){return this.GM.forEach((e=>e.shape.Re(t))),this}Jh(){return this.GM[0].shape.Jh()}IS(t){return this.GM.forEach((e=>e.shape.IS(t))),this}RS(){return this.GM[0].shape.RS()}dz(){return this.dispose(),this.GM.forEach((t=>t.shape.dz())),this}dispose(){return super.dispose(),this.GM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.GM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}_v(t){return super._v(t),this.GM.forEach((e=>e.shape._v(t))),this}St(){return this.n$.max.x}vt(){return this.n$.min.x}bt(){return Math.max(this.GM[0].shape.bt(),this.GM[1].shape.bt())}xt(){return Math.min(this.GM[0].shape.xt(),this.GM[1].shape.xt())}kv(){return this.n$.max.z}Tv(){return this.n$.min.z}Pl(){return 0}Dl(){return 0}Fv(){return 0}ds(t){return super.ds(t),this.GM.forEach((e=>e.shape.ds(t))),this}}class Cp extends Qy{constructor(t,e,i,s){super(t,e,i),this.MX=f(0,0,1),this.d$=f(0,0,-1),this.f$=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.gv=new no,this.At=s}_x(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.At,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.cs.oi();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.MX=t,this}getCameraLocation(){return this.MX}setCameraDirection(t){return this.d$=Ue.normalize(t),this}getCameraDirection(){return this.d$}setLightLocation(t){return this._X=t,this}getLightLocation(){return this._X}A$(){return f(this.f$[0],this.f$[1],this.f$[2])}g$(){return f(this.f$[4],this.f$[5],this.f$[6])}}class Tp extends Cp{constructor(t,e,i,s){super(t,e,i,s),this.Vz=new Zm,this.p$=!0,this.y$="perspective",this.OG=t,this.gl=t.GG(),this.rX=this.tX,this.m$=this.cs.Eo((()=>{this.p$=!0})),this.v$=s.H((()=>{this.p$=!0}))}EO(t){const e=t.vt(),i=t.xt(),s=t.Tv(),r=t.St(),n=t.bt(),o=t.kv();if(e===Ye||r===He||i===Ye||n===He||s===Ye||o===He)return Xe;const h=t.Pl(),a=t.Dl(),l=t.Fv(),u=Math.abs(t.Rs.sv(h)*t.At.x.rt()),c=Math.abs(t.Rs.sv(a)*t.At.y.rt()),d=Math.abs(t.Rs.sv(l)*t.At.z.rt()),f=e-u,g=r+u,m=i-c,y=n+c,p=s-d,A=o+d;let x;return[{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:A},{x:g,y:m,z:A},{x:f,y,z:A},{x:g,y,z:A}].map((e=>t.Rs.hv(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?hi(x,{min:t,max:t}):e})),x||Xe}hv(t){if(this.S$(),this.x$(),!this.bX)return;const e=this.Vz.HO(),i=f(e[0],e[1],e[2]),s=this.Vz.YO(),r=f(s[0],s[1],s[2]),n=Ue.divideVec(Ue.subtractVec(t,i),r),o=this.bX,h=Lm.multiply(o,[n.x,n.y,n.z,1]),a=u(h[0]/h[3],h[1]/h[3]),l=this.cs.oi();return{x:.5*(1+a.x)*l.x,y:.5*(1+a.y)*l.y}}Wx(t){const e=this.Vz.HO(),i=this.Vz.YO(),s=Ue.divideVec(Ue.subtractVec(t,{x:e[0],y:e[1],z:e[2]}),{x:i[0],y:i[1],z:i[2]});return{...t,x:s.x,y:s.y,z:s.z}}Yx(t){const e=this.Vz.HO(),i=this.Vz.YO(),s=Ue.addVec(Ue.multiplyVec(t,{x:i[0],y:i[1],z:i[2]}),{x:e[0],y:e[1],z:e[2]});return{...t,x:s.x,y:s.y,z:s.z}}sv(t){return t/1e3}BX(){return.001}Os(){const t=this.MX,e=this._X,i=this.At.x.u||this.At.y.u||this.At.z.u;if(!e)throw Me(0,(()=>Ce()));const{viewProjectionMatrix:s}=this.S$();this.x$();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.tX.forEach((t=>{t.bX=s,t.MX=r,t._X=n,t.Os(i)})),this}Gx(t){this.y$!==t&&(this.y$=t,this.p$=!0)}Ux(){return this.y$}S$(){if(!this.p$&&this.bX)return{viewProjectionMatrix:this.bX};const t=this._x(),e=t.width/t.height;if("perspective"===this.y$)this.b$=Lm.projectionPerspective(45,e,.1,100);else{let t,i;const s=.5*Ue.length(this.MX);e>1?(t=s,i=t/e):(i=s,t=i*e),this.b$=Lm.projectionOrthographic(-t,t,-i,i,-400,100)}const i=this.MX;this.f$[12]=i.x,this.f$[13]=i.y,this.f$[14]=i.z;const s=this.d$,r=f(0,1,0),n=Ue.multiply(s,-1),o=Ue.normalize(Ue.cross(r,n)),h=Ue.normalize(Ue.cross(n,o));this.f$[0]=o.x,this.f$[1]=o.y,this.f$[2]=o.z,this.f$[4]=h.x,this.f$[5]=h.y,this.f$[6]=h.z,this.f$[8]=n.x,this.f$[9]=n.y,this.f$[10]=n.z,this.M$=Lm.inverse(this.f$);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.At,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,m=(a.y+l.y/2)/u.y,y=Lm.multiply(Lm.translation(Jn(-1,1,g),Jn(-1,1,m),0),Lm.scaling(c,d,1));return this.bX=Lm.multiply(y,Lm.multiply(this.b$,this.M$)),this._$=Lm.inverse(this.bX),this.p$=!1,{viewProjectionMatrix:this.bX}}x$(){this.Vz.PG(this.At.x),this.Vz.DG(this.At.y),this.Vz.BG(this.At.z)}WE(t,e,i){var s;const r=this.gl.MO(),n=this._x(),o={x:n.x*r*e,y:n.y*r*e,width:n.width*r*e,height:n.height*r*e};this.gl.RO(o.x,o.y,o.width,o.height);let h=((null===(s=i[i.length-1])||void 0===s?void 0:s.idLast)||0)+1;const a=Array.from(this.rX.values());for(let e=0;e(this.ji||this.Mn||pm(this.lz.gl)||(t&&(this.w$=!0),this.pn=!0,this.B$||this.ln.zV(t)),this),this.B$=!1,this.UV=t=>{if(this.ji||this.Mn)return;const e=t-this.C$;if(e>=this.ao||-1===this.ao){this.B$=!0,this.C$=t,this.w$=!1;const i=e>50?1e3/60:e;this.yn&&this.yn(i),this.pn=!1,-1!==this.ao&&this.w$&&(this.ln.zV(this.w$),this.pn=!0),this.us.Os(e),this.Dn(),this.Bn(),this.mn&&this.mn(),this.B$=!1,this.R.emit("render"),this.pn&&this.Ms(this.w$)}else this.pn=!0,this.ln.zV()},this.L$=new Map,this.GG=()=>this.lz,this.R$=()=>{var t,e,i;const s=this.Zn(),r=this.k$,n=zt.performance.now(),o=null===(t=this.E$)||void 0===t?void 0:t.z$.reduce(((t,e)=>t?e.V$&&t.V$&&e.V$>t.V$?e:t:e),void 0),h=null==o?void 0:o.V$,a=null===(e=this.Yn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Qn)||void 0===i?void 0:i.timeStamp,u=this.O$;return r?(this.Ms(!0),!1):void 0===o||(void 0===o||!o.N$)&&(void 0!==l&&void 0!==h&&l>h||(void 0!==h&&void 0===s?n-h>=1e3:!(void 0!==h&&void 0!==a&&n-a>=2e3&&(void 0===u||n-u>=2e3))||n-h>=1e3))},this.G$=()=>{var t,e;this.U$=void 0;const i=null===(e=null===(t=this.E$)||void 0===t?void 0:t.W$)||void 0===e?void 0:e.Y$;void 0===i||i>=this.T$||this.H$()},this.Bn=()=>{if(this.ji||this.Mn)return this;const t=this.lz.gl,e=zt.performance.now();this.lz.BO(t.FRAMEBUFFER,this.ln.PV?this.MV[0]:null);const i=this.Z,s=i.x>0&&i.y>0;if(this.Fn.u&&this.lz.PN(this.Fn.C()),t.resize&&s&&t.resize(i.x*this.lz.MO(),i.y*this.lz.MO()),this.lz.LO(0,0,i.x*this.lz.MO(),i.y*this.lz.MO()),this.lz.RO(0,0,i.x*this.lz.MO(),i.y*this.lz.MO()),this.lz.Ot(),s)for(const t of this.fn.values())t.WE(0,1,[]);if(this.io.ro&&s&&(this.U$&&(zt.clearTimeout(this.U$),this.U$=void 0),this.R$()?(this.H$(),this.lz.BO(t.FRAMEBUFFER,this.ln.PV?this.MV[0]:null)):this.U$=zt.setTimeout(this.G$,500)),this.J(),this.nn(),this.Vn&&this.zn(this.Vn),this.ln.PV){const e=this.lz.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.MV[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.MV[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.yV),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),0),t.bindTexture(t.TEXTURE_2D,null);return this.lz.BO(t.FRAMEBUFFER,null),pm(this.lz.gl)?this.ln.gV(0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),[this]):this.ln.zV(),this.k$=!1,this.T$=e,this},this.Dn=()=>{if("use-window"===this.X$.mode){const t=zt.devicePixelRatio||1;this.lz.HN(t)}const t=this.Z;if(0===t.x||0===t.y)return this;this.vo.it(t);for(const t of this.fn.values())t.Os();return this.J(),this},this.ln=t,this.ln.FV){this.$$=zt.document.createElement("canvas"),this.$$.style.width="100%",this.$$.style.height="100%",this.$$.style.display="block",this.$$.style.boxSizing="content-box",this.$$.style.position="absolute";const t=this.$$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new Mt("No Canvas context available.");this.mV=t,this.qr.appendChild(this.$$)}this.ln.HV(this);const r={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let n;if(this.ln.PV&&t.gl2&&(n=new s(this,this.io,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),n||this.ln.PV||(n=new s(this,this.io,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),!n)throw new Mt("No WebGL context available");if(this.lz=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.X$={mode:"fixed",value:e.devicePixelRatio},this.lz.HN(e.devicePixelRatio);else{const t=zt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=zt.devicePixelRatio||1;this.X$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.lz.HN(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.po=this.j$(o),this.mo=this.j$(h),this.Z$(this.po,this.mo),this.nH=this.KF("engine offscreen",1e6),this.Q$=this.KF("engine bg",0);const a="function"==typeof this.ts.lcjsBackgroundFillStyle?It({resourcesBaseUrl:this.io.te,styleFactory:this.ts.lcjsBackgroundFillStyle,apply:t=>this.setBackgroundFillStyle(t)}):this.ts.lcjsBackgroundFillStyle;this.vo=this.Q$.Ee(this.At).Re(a).Le(this.ts.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ve({x:0,y:0});const l=this.KF("engine effects",200001).nX(this.ts.effect);this.hs=l;const u=this.ln.PV,d=this.oi();u&&(this.MV=[n.JO(),n.JO()]);const f=this.lz.gl;u&&(this.F$=f.createRenderbuffer(),this.I$=f.createRenderbuffer()),this.yV=f.createTexture();const g=d.x*this.lz.MO(),m=d.y*this.lz.MO();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.F$);const t=this.lz.gl2.ctx;this.P$=this.ln.aV&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.P$,t.RGBA8,g,m),f.bindRenderbuffer(f.RENDERBUFFER,this.I$),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,m),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.P$,t.DEPTH_COMPONENT16,g,m)}u&&(this.lz.BO(f.FRAMEBUFFER,this.MV[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.F$),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.I$)),f.bindTexture(f.TEXTURE_2D,this.yV),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,m,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),u&&(this.lz.BO(f.FRAMEBUFFER,this.MV[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.yV,0)),this.lz.BO(f.FRAMEBUFFER,null),this.kn(),this.nn(),this.vp=_r(this),this.Sp={ts:this.ts,us:this.us,At:this.At,Ms:t=>this.Ms(t),Zn:()=>this.Zn(),xs:t=>(this.O$=zt.performance.now(),this.xs({x:t.clientX,y:t.clientY})),GD:t=>this.GD(t),io:this.io,Jn:t=>this.Jn(t),hs:this.hs,Uo:t=>this.Uo(t),Wo:t=>this.Wo(t),Xg:{Hg:(t,e,i)=>this.lz.tr(e.family)._z(t,e,i,this.ts.isDark)},Is:()=>!!this.On,Ds:t=>{var e;return(null===(e=this.On)||void 0===e?void 0:e.collectionMember)===t},jR:()=>void 0!==this.wn};const y=()=>{this.Y()};zt.addEventListener("unload",y),this.vn.push((()=>{zt.removeEventListener("unload",y)}))}get J$(){return this.fn}un(t,e){let i=this.L$.get(t);if(!i){const e=this.lz.JN(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.L$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{UD:()=>e.uO,WD:t=>{e.uO?t():o.push(t)}}},this.L$.set(t,i),e.bz(this),e.yO((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new yo(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}GD(t){const e=Array.from(this.L$.values()).find((e=>e.instances.has(t)));if(!e)throw Me(0,(()=>new Error("LightningChart JS error, attempted to use Icon that is disposed. Please check that you are not disposing an Icon that is still in use, or attempting to use a previously disposed Icon!")));return e.sharedEngineReference}xs(t){var e;const i=null===(e=this.E$)||void 0===e?void 0:e.W$;if(!i)return;const s=this.Ne(t.x,t.y),r=Math.round(s.x*this.lz.MO()),n=Math.round(s.y*this.lz.MO());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.K$(i,r+t[0]/i.q$,n+t[1]/i.q$))).reduce(((t,e)=>{if(void 0===e)return t||void 0;const i=1e6*e.layerIndex+e.entityIndex;return!t||i>t.zIndexForComparison?{zIndexForComparison:i,entity:e.entity,collectionMember:e.collectionMember,info:e.info}:t}),void 0)}K$(t,e,i){const s=Math.round(e*t.q$),r=Math.round(i*t.q$);if(s<0||s>=t.Z.x||r<0||r>=t.Z.y)return;const n=4*(s+r*t.Z.x),o=t.tj[n+0],h=t.tj[n+1],a=t.tj[n+2],l=t.tj[n+3];if(void 0===o||void 0===h||void 0===a||void 0===l)return;if(0===o&&0===h&&0===a&&0===l)return;const u=16777216*o+65536*h+256*a+l,c=t.ij.find((t=>u>=t.idFirst&&u<=t.idLast));if(!c)return;const{collectionMember:d,info:f}=c.entity.HG(u,c.idFirst,c.idCount,e,i);return{entity:c.entity,collectionMember:d,entityIndex:c.entityIndex,layerIndex:c.layer.Rn(),info:f}}en(t,e,i){const s=this.lz.gl;this.ln.PV?(this.lz.BO(s.FRAMEBUFFER,this.MV[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.yV,0)):this.lz.BO(s.FRAMEBUFFER,null);const r=this.pV(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.ln.PV||this.Bn(),s.readPixels(0,0,n,o,s.RGBA,s.UNSIGNED_BYTE,h);const a=new ImageData(new Uint8ClampedArray(h),n,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=n,l.height=o,u.putImageData(a,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.ln.PV&&(this.lz.BO(s.FRAMEBUFFER,this.MV[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.F$),this.lz.BO(s.FRAMEBUFFER,this.MV[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.yV,0)),this.lz.BO(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=zt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof ep))throw new Error("Unexpected Engine Layer error");return i}return this.Ln(new ep(this,e,t))}iI(t,e,i){const s=this.Mo(e);if(s){if(Me(0,(()=>{})),!(s instanceof Tp))throw new Error("Unexpected Engine Layer error");return s}return this.Ln(new Tp(this,e,t,i))}oi(){return this.Z}pV(){const t=this.lz.MO();return{x:Math.round(this.Z.x*t),y:Math.round(this.Z.y*t)}}j$(t){return t instanceof Array||(t=[t,t]),t}sj(){return this.ln.vV}ej(){return pm(this.lz.gl)}H$(){var t;const e=this.lz.gl,i=zt.performance.now(),s=this.io.ho,r={x:Math.ceil(this.Z.x*this.lz.MO()*s),y:Math.ceil(this.Z.y*this.lz.MO()*s)};this.E$||(this.E$={q$:s,hj:r,z$:[],W$:void 0});let n=this.E$.z$.find((t=>!t.N$)),o=!1;n||(o=!0,n={N$:!1,Z:r,uG:e.createTexture(),rj:this.lz.JO(),I$:this.lz.KO(),nj:new Uint8Array,V$:void 0},this.E$.z$.push(n));const h=n;(o||h.Z.x!==r.x||h.Z.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.uG),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.x,r.y,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this.lz.BO(e.FRAMEBUFFER,h.rj),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.uG,0),e.bindRenderbuffer(e.RENDERBUFFER,h.I$),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.I$),h.nj=new Uint8Array(r.x*r.y*4),h.Z=r),h.N$=!0,h.V$=i,this.lz.BO(e.FRAMEBUFFER,h.rj),e.clearDepth(1),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(r.x,r.y),this.lz.LO(0,0,r.x,r.y);const a=[];for(const t of this.fn.values())t.WE(1,s,a);this.lz.BO(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.lz.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.E$){const t=this.E$.W$;if(t&&t.Y$>i)return;this.E$.W$={Y$:i,q$:s,Z:r,tj:h.nj,ij:a}}};l?this.lz.oG(l,h.rj,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.nj).then((()=>{this.ji||(h.N$=!1,u())})).catch((t=>{this.ji||(h.N$=!1,zt.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"))})):(this.lz.aG(h.rj,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.nj),h.N$=!1,u())}kn(t){const e=this.lz.MO();if("use-window"===this.X$.mode){const t=zt.devicePixelRatio||1;this.lz.HN(t)}const i=this.Z.x,s=this.Z.y,r=t||{x:this.qr.offsetWidth,y:this.qr.offsetHeight},n=this.lz.MO();if(0!==r.x&&0!==r.y&&(r.x!==i||r.y!==s||e!==n)){this.Z=r,this.At.x.q(0,r.x).it(r.x),this.At.y.q(0,r.y).it(r.y);const t=r.x*n,e=r.y*n,i=this.lz.gl;this.ln.FV&&this.mV&&(this.mV.canvas.width=t,this.mV.canvas.height=e);const s=this.ln.PV;if(this.yV&&(i.bindTexture(i.TEXTURE_2D,this.yV),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),s){const s=this.lz.gl2.ctx;this.F$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.F$),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.P$,s.RGBA8,t,e)),this.I$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.I$),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.P$,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.R.emit("resize",[this.Z.x,this.Z.y])}}Y(){var t;this.ji||(super.Y(),this.U$&&(zt.clearTimeout(this.U$),this.U$=void 0),Array.from(this.lz.Kz.entries()).forEach((([t,e])=>{e.dz(!1),this.lz.Kz.delete(t)})),Array.from(this.lz.sN.values()).forEach((t=>{t.unbindResources()})),this.lz.sN.clear(),this.lz.iN.rO(),this.lz.GN.Y(),this.lz.jO(this.lz.UN),this.lz.jO(this.lz.WN),this.lz.zN.forEach(((t,e)=>{this.lz.gl.deleteBuffer(e)})),this.lz.zN.clear(),this.lz.sG&&(this.lz.jO(this.lz.sG.buffer),this.lz.sG=void 0),this.lz.tN(this.MV[0]),this.lz.tN(this.MV[1]),this.lz.qO(this.F$),this.lz.fz(this.yV),this.lz.qO(this.I$),this.E$&&(this.E$.z$.forEach((t=>{this.lz.qO(t.I$),this.lz.tN(t.rj),this.lz.fz(t.uG)})),this.E$=void 0),this.lz.LN.forEach((t=>this.lz.jO(t))),this.L$.clear(),this.ln.$V(this),this.$$&&(null===(t=this.$$.parentElement)||void 0===t||t.removeChild(this.$$),this.$$=void 0),this.mV&&(this.mV=void 0),this.lz.gl=void 0)}}var Ep="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},kp={exports:{}};!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function s(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this.pO(t||0,e||10,i||"be"))}var n;"object"==typeof kp?kp.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=(void 0).Buffer}catch(t){}function o(t,e,s){for(var r=0,n=Math.min(t.length,s),o=0,h=e;h=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=a}return i(!(240&o),"Invalid character in "+t),r}function h(t,e,s,r){for(var n=0,o=0,h=Math.min(t.length,s),a=e;a=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.pO=function(t,e,s){if("number"==typeof t)return this.oj(t,e,s);if("object"==typeof t)return this.aj(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this.lj(t,r):this.uj(t,e,r),"-"===t[0]&&(this.negative=1),this.cj(),"le"===s&&this.aj(this.toArray(),e,s)},r.prototype.oj=function(t,e,s){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===s&&this.aj(this.toArray(),e,s)},r.prototype.aj=function(t,e,s){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);else if("le"===s)for(r=0,n=0;r>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);return this.cj()},r.prototype.lj=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=6)r=o(t,i,i+6),this.words[s]|=r<>>26-n&4194303,(n+=24)>=26&&(n-=26,s++);i+6!==e&&(r=o(t,e,i+6),this.words[s]|=r<>>26-n&4194303),this.cj()},r.prototype.uj=function(t,e,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=e)s++;s--,r=r/e|0;for(var n=t.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.gj()},r.prototype.gj=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.prototype.inspect=l;function l(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var s=t.length+e.length|0;i.length=s,s=s-1|0;var r=0|t.words[0],n=0|e.words[0],o=r*n,h=67108863&o,a=o/67108864|0;i.words[0]=h;for(var l=1;l>>26,c=67108863&a,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var g=l-f|0;u+=(o=(r=0|t.words[g])*(n=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,a=0|u}return 0!==a?i.words[l]=0|a:i.length--,i.cj()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.cj();var r=this.byteLength(),n=s||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},r.prototype.pj=function(t,e){for(var i=0,s=0,r=0,n=0;r>8&255),i>16&255),6===n?(i>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===n?(i>=0&&(t[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?r.prototype.mj=function(t){return 32-Math.clz32(t)}:r.prototype.mj=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype.vj=function(t){if(0===t)return 26;var e=t,i=0;return!(8191&e)&&(i+=13,e>>>=13),!(127&e)&&(i+=7,e>>>=7),!(15&e)&&(i+=4,e>>>=4),!(3&e)&&(i+=2,e>>>=2),!(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.mj(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var s=0;st.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.Aj(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.cj()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,r=t%26;return this.Aj(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.gj()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.gj();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,y=0|o[2],p=8191&y,A=y>>>13,x=0|o[3],S=8191&x,v=x>>>13,b=0|o[4],M=8191&b,C=b>>>13,T=0|o[5],w=8191&T,E=T>>>13,k=0|o[6],I=8191&k,z=k>>>13,F=0|o[7],R=8191&F,D=F>>>13,P=0|o[8],O=8191&P,L=P>>>13,_=0|o[9],B=8191&_,V=_>>>13,G=0|h[0],N=8191&G,U=G>>>13,Y=0|h[1],H=8191&Y,X=Y>>>13,W=0|h[2],j=8191&W,$=W>>>13,Z=0|h[3],q=8191&Z,K=Z>>>13,J=0|h[4],Q=8191&J,tt=J>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(l+(s=Math.imul(c,N))|0)+((8191&(r=(r=Math.imul(c,U))+Math.imul(d,N)|0))<<13)|0;l=((n=Math.imul(d,U))+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(g,N),r=(r=Math.imul(g,U))+Math.imul(m,N)|0,n=Math.imul(m,U);var pt=(l+(s=s+Math.imul(c,H)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,H)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,N),r=(r=Math.imul(p,U))+Math.imul(A,N)|0,n=Math.imul(A,U),s=s+Math.imul(g,H)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(m,H)|0,n=n+Math.imul(m,X)|0;var At=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(S,N),r=(r=Math.imul(S,U))+Math.imul(v,N)|0,n=Math.imul(v,U),s=s+Math.imul(p,H)|0,r=(r=r+Math.imul(p,X)|0)+Math.imul(A,H)|0,n=n+Math.imul(A,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,j)|0,n=n+Math.imul(m,$)|0;var xt=(l+(s=s+Math.imul(c,q)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(d,q)|0))<<13)|0;l=((n=n+Math.imul(d,K)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(M,N),r=(r=Math.imul(M,U))+Math.imul(C,N)|0,n=Math.imul(C,U),s=s+Math.imul(S,H)|0,r=(r=r+Math.imul(S,X)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(p,j)|0,r=(r=r+Math.imul(p,$)|0)+Math.imul(A,j)|0,n=n+Math.imul(A,$)|0,s=s+Math.imul(g,q)|0,r=(r=r+Math.imul(g,K)|0)+Math.imul(m,q)|0,n=n+Math.imul(m,K)|0;var St=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(w,N),r=(r=Math.imul(w,U))+Math.imul(E,N)|0,n=Math.imul(E,U),s=s+Math.imul(M,H)|0,r=(r=r+Math.imul(M,X)|0)+Math.imul(C,H)|0,n=n+Math.imul(C,X)|0,s=s+Math.imul(S,j)|0,r=(r=r+Math.imul(S,$)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,$)|0,s=s+Math.imul(p,q)|0,r=(r=r+Math.imul(p,K)|0)+Math.imul(A,q)|0,n=n+Math.imul(A,K)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,tt)|0;var vt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((n=n+Math.imul(d,st)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(I,N),r=(r=Math.imul(I,U))+Math.imul(z,N)|0,n=Math.imul(z,U),s=s+Math.imul(w,H)|0,r=(r=r+Math.imul(w,X)|0)+Math.imul(E,H)|0,n=n+Math.imul(E,X)|0,s=s+Math.imul(M,j)|0,r=(r=r+Math.imul(M,$)|0)+Math.imul(C,j)|0,n=n+Math.imul(C,$)|0,s=s+Math.imul(S,q)|0,r=(r=r+Math.imul(S,K)|0)+Math.imul(v,q)|0,n=n+Math.imul(v,K)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(m,it)|0,n=n+Math.imul(m,st)|0;var bt=(l+(s=s+Math.imul(c,nt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ot)|0)+Math.imul(d,nt)|0))<<13)|0;l=((n=n+Math.imul(d,ot)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(R,N),r=(r=Math.imul(R,U))+Math.imul(D,N)|0,n=Math.imul(D,U),s=s+Math.imul(I,H)|0,r=(r=r+Math.imul(I,X)|0)+Math.imul(z,H)|0,n=n+Math.imul(z,X)|0,s=s+Math.imul(w,j)|0,r=(r=r+Math.imul(w,$)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(M,q)|0,r=(r=r+Math.imul(M,K)|0)+Math.imul(C,q)|0,n=n+Math.imul(C,K)|0,s=s+Math.imul(S,Q)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(A,it)|0,n=n+Math.imul(A,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(m,nt)|0,n=n+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,at)|0)|0)+((8191&(r=(r=r+Math.imul(c,lt)|0)+Math.imul(d,at)|0))<<13)|0;l=((n=n+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(O,N),r=(r=Math.imul(O,U))+Math.imul(L,N)|0,n=Math.imul(L,U),s=s+Math.imul(R,H)|0,r=(r=r+Math.imul(R,X)|0)+Math.imul(D,H)|0,n=n+Math.imul(D,X)|0,s=s+Math.imul(I,j)|0,r=(r=r+Math.imul(I,$)|0)+Math.imul(z,j)|0,n=n+Math.imul(z,$)|0,s=s+Math.imul(w,q)|0,r=(r=r+Math.imul(w,K)|0)+Math.imul(E,q)|0,n=n+Math.imul(E,K)|0,s=s+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(C,Q)|0,n=n+Math.imul(C,tt)|0,s=s+Math.imul(S,it)|0,r=(r=r+Math.imul(S,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(A,nt)|0,n=n+Math.imul(A,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(m,at)|0,n=n+Math.imul(m,lt)|0;var Ct=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(B,N),r=(r=Math.imul(B,U))+Math.imul(V,N)|0,n=Math.imul(V,U),s=s+Math.imul(O,H)|0,r=(r=r+Math.imul(O,X)|0)+Math.imul(L,H)|0,n=n+Math.imul(L,X)|0,s=s+Math.imul(R,j)|0,r=(r=r+Math.imul(R,$)|0)+Math.imul(D,j)|0,n=n+Math.imul(D,$)|0,s=s+Math.imul(I,q)|0,r=(r=r+Math.imul(I,K)|0)+Math.imul(z,q)|0,n=n+Math.imul(z,K)|0,s=s+Math.imul(w,Q)|0,r=(r=r+Math.imul(w,tt)|0)+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(C,it)|0,n=n+Math.imul(C,st)|0,s=s+Math.imul(S,nt)|0,r=(r=r+Math.imul(S,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(A,at)|0,n=n+Math.imul(A,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,n=n+Math.imul(m,dt)|0;var Tt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(B,H),r=(r=Math.imul(B,X))+Math.imul(V,H)|0,n=Math.imul(V,X),s=s+Math.imul(O,j)|0,r=(r=r+Math.imul(O,$)|0)+Math.imul(L,j)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(R,q)|0,r=(r=r+Math.imul(R,K)|0)+Math.imul(D,q)|0,n=n+Math.imul(D,K)|0,s=s+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,tt)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,s=s+Math.imul(w,it)|0,r=(r=r+Math.imul(w,st)|0)+Math.imul(E,it)|0,n=n+Math.imul(E,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(C,nt)|0,n=n+Math.imul(C,ot)|0,s=s+Math.imul(S,at)|0,r=(r=r+Math.imul(S,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(A,ct)|0,n=n+Math.imul(A,dt)|0;var wt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(B,j),r=(r=Math.imul(B,$))+Math.imul(V,j)|0,n=Math.imul(V,$),s=s+Math.imul(O,q)|0,r=(r=r+Math.imul(O,K)|0)+Math.imul(L,q)|0,n=n+Math.imul(L,K)|0,s=s+Math.imul(R,Q)|0,r=(r=r+Math.imul(R,tt)|0)+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,s=s+Math.imul(I,it)|0,r=(r=r+Math.imul(I,st)|0)+Math.imul(z,it)|0,n=n+Math.imul(z,st)|0,s=s+Math.imul(w,nt)|0,r=(r=r+Math.imul(w,ot)|0)+Math.imul(E,nt)|0,n=n+Math.imul(E,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(C,at)|0,n=n+Math.imul(C,lt)|0,s=s+Math.imul(S,ct)|0,r=(r=r+Math.imul(S,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var Et=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,mt)|0)+Math.imul(A,gt)|0))<<13)|0;l=((n=n+Math.imul(A,mt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(B,q),r=(r=Math.imul(B,K))+Math.imul(V,q)|0,n=Math.imul(V,K),s=s+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(R,it)|0,r=(r=r+Math.imul(R,st)|0)+Math.imul(D,it)|0,n=n+Math.imul(D,st)|0,s=s+Math.imul(I,nt)|0,r=(r=r+Math.imul(I,ot)|0)+Math.imul(z,nt)|0,n=n+Math.imul(z,ot)|0,s=s+Math.imul(w,at)|0,r=(r=r+Math.imul(w,lt)|0)+Math.imul(E,at)|0,n=n+Math.imul(E,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(C,ct)|0,n=n+Math.imul(C,dt)|0;var kt=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(r=(r=r+Math.imul(S,mt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(B,Q),r=(r=Math.imul(B,tt))+Math.imul(V,Q)|0,n=Math.imul(V,tt),s=s+Math.imul(O,it)|0,r=(r=r+Math.imul(O,st)|0)+Math.imul(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(R,nt)|0,r=(r=r+Math.imul(R,ot)|0)+Math.imul(D,nt)|0,n=n+Math.imul(D,ot)|0,s=s+Math.imul(I,at)|0,r=(r=r+Math.imul(I,lt)|0)+Math.imul(z,at)|0,n=n+Math.imul(z,lt)|0,s=s+Math.imul(w,ct)|0,r=(r=r+Math.imul(w,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var It=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,mt)|0)+Math.imul(C,gt)|0))<<13)|0;l=((n=n+Math.imul(C,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(B,it),r=(r=Math.imul(B,st))+Math.imul(V,it)|0,n=Math.imul(V,st),s=s+Math.imul(O,nt)|0,r=(r=r+Math.imul(O,ot)|0)+Math.imul(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(R,at)|0,r=(r=r+Math.imul(R,lt)|0)+Math.imul(D,at)|0,n=n+Math.imul(D,lt)|0,s=s+Math.imul(I,ct)|0,r=(r=r+Math.imul(I,dt)|0)+Math.imul(z,ct)|0,n=n+Math.imul(z,dt)|0;var zt=(l+(s=s+Math.imul(w,gt)|0)|0)+((8191&(r=(r=r+Math.imul(w,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(zt>>>26)|0,zt&=67108863,s=Math.imul(B,nt),r=(r=Math.imul(B,ot))+Math.imul(V,nt)|0,n=Math.imul(V,ot),s=s+Math.imul(O,at)|0,r=(r=r+Math.imul(O,lt)|0)+Math.imul(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(R,ct)|0,r=(r=r+Math.imul(R,dt)|0)+Math.imul(D,ct)|0,n=n+Math.imul(D,dt)|0;var Ft=(l+(s=s+Math.imul(I,gt)|0)|0)+((8191&(r=(r=r+Math.imul(I,mt)|0)+Math.imul(z,gt)|0))<<13)|0;l=((n=n+Math.imul(z,mt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(B,at),r=(r=Math.imul(B,lt))+Math.imul(V,at)|0,n=Math.imul(V,lt),s=s+Math.imul(O,ct)|0,r=(r=r+Math.imul(O,dt)|0)+Math.imul(L,ct)|0,n=n+Math.imul(L,dt)|0;var Rt=(l+(s=s+Math.imul(R,gt)|0)|0)+((8191&(r=(r=r+Math.imul(R,mt)|0)+Math.imul(D,gt)|0))<<13)|0;l=((n=n+Math.imul(D,mt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(B,ct),r=(r=Math.imul(B,dt))+Math.imul(V,ct)|0,n=Math.imul(V,dt);var Dt=(l+(s=s+Math.imul(O,gt)|0)|0)+((8191&(r=(r=r+Math.imul(O,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Pt=(l+(s=Math.imul(B,gt))|0)+((8191&(r=(r=Math.imul(B,mt))+Math.imul(V,gt)|0))<<13)|0;return l=((n=Math.imul(V,mt))+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=yt,a[1]=pt,a[2]=At,a[3]=xt,a[4]=St,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=Ct,a[9]=Tt,a[10]=wt,a[11]=Et,a[12]=kt,a[13]=It,a[14]=zt,a[15]=Ft,a[16]=Rt,a[17]=Dt,a[18]=Pt,0!==l&&(a[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.cj()}function y(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):y(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),y(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,r=0;r>=26,s+=n/67108864|0,s+=o>>>26,this.words[r]=67108863&o}return 0!==s&&(this.words[r]=s,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>r&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,s=0;s=0);var e,s=t%26,r=(t-s)/26,n=67108863>>>26-s<<26-s;if(0!==s){var o=0;for(e=0;e>>26-s}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),h=67108863^67108863>>>n<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=r);l--){var c=0|this.words[l];this.words[l]=u<<26-n|c>>>n,u=c&h}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.cj()},r.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,r=1<=0);var e=t%26,s=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==e&&s++,this.length=Math.min(s,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[r+s]=67108863&n}for(;r>26,this.words[r+s]=67108863&n;if(0===h)return this.cj();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.cj()},r.prototype.xj=function(t,e){var i=(this.length,t.length),s=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this.mj(o))&&(n=n.ushln(i),s.iushln(i),o=0|n.words[n.length-1]);var h,a=s.length-n.length;if("mod"!==e){(h=new r(null)).length=a+1,h.words=new Array(h.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[n.length+c])+(0|s.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),s.Sj(n,d,c);0!==s.negative;)d--,s.negative=0,s.Sj(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.cj(),s.cj(),"div"!==e&&0!==i&&s.iushrn(i),{div:h||null,mod:s}},r.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):this.negative&t.negative?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this.xj(t,e);var n,o,h},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,s=t.ushrn(1),r=t.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(s*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*s;this.words[r]=n/t|0,s=n%t}return this.cj(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),h=new r(0),a=new r(1),l=0;e.isEven()&&s.isEven();)e.iushrn(1),s.iushrn(1),++l;for(var u=s.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var g=0,m=1;!(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.bj=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),h=new r(0),a=s.clone();e.cmpn(1)>0&&s.cmpn(1)>0;){for(var l=0,u=1;!(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,d=1;!(s.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(s.iushrn(c);c-- >0;)h.isOdd()&&h.iadd(a),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(h)):(s.isub(e),h.isub(o))}return(n=0===e.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var s=0;e.isEven()&&i.isEven();s++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=e.cmp(i);if(r<0){var n=e;e=i,i=n}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,r=1<>>26,h&=67108863,this.words[o]=h}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,s=t<0;if(0!==this.negative&&!s)return-1;if(0===this.negative&&s)return 1;if(this.cj(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:rt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],r=0|t.words[i];if(s!==r){sr&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this).Mj(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.Mj=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.Mj(t)},r.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},r.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},r.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},r.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},r.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},r.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._j(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._j(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.wj(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.wj(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.wj(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.wj(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.wj(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.wj(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function A(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.Cj()}function x(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.kj(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function C(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.bj(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype.Cj=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},A.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.cj(),i},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},s(x,A),x.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.kj=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new S;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return p[t]=e,e},M.prototype.wj=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._j=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).Mj(this):(a(t,t.umod(this.m).Mj(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).Mj(this)},M.prototype.add=function(t,e){this._j(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.Mj(this)},M.prototype.iadd=function(t,e){this._j(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this._j(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.Mj(this)},M.prototype.isub=function(t,e){this._j(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this.wj(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._j(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._j(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var s=this.m.add(new r(1)).iushrn(2);return this.pow(t,s)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var h=new r(1).toRed(this),a=h.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,l).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),g=o;0!==f.cmp(h);){for(var m=f,y=0;0!==m.cmp(h);y++)m=m.redSqr();i(y=0;s--){for(var l=e.words[s],u=a-1;u>=0;u--){var c=l>>u&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++h||0===s&&0===u)&&(n=this.mul(n,i[o]),h=0,o=0)):h=0}a=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new C(t)},s(C,M),C.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},C.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},C.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.Mj(this)},C.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).Mj(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o.Mj(this)},C.prototype.invm=function(t){return this.imod(t.bj(this.m).mul(this.r2)).Mj(this)}}(0,Ep);var Ip=kp.exports;function zp(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,n=255&s;r?i.push(r,n):i.push(n)}return i}const Fp=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const r=1<(r>>1)-1?(r>>1)-i:i,n.isubn(e)):e=0,s[t]=e,n.iushrn(1)}return s},Rp=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,r=0;for(;t.cmpn(-s)>0||e.cmpn(-r)>0;){let n,o,h=t.andln(3)+s&3,a=e.andln(3)+r&3;if(3===h&&(h=-1),3===a&&(a=-1),1&h){const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}else n=0;if(i[0].push(n),1&a){const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}else o=0;i[1].push(o),2*s===n+1&&(s=1-s),2*r===o+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i};class Dp{constructor(t,e){this.type=t,this.p=new Ip(e.p,16),this.red=e.prime?Ip.red(e.prime):Ip.mont(this.p),this.zero=new Ip(0).toRed(this.red),this.one=new Ip(1).toRed(this.red),this.two=new Ip(2).toRed(this.red),this.n=e.n&&new Ip(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.Tj=new Array(4),this.Fj=new Array(4),this.Ij=new Array(4),this.Pj=new Array(4),this.Dj=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.Bj=!0,this.redN=this.n.toRed(this.red))}Lj(t,e){const i=t.Rj(),s=Fp(e,1,this.Dj);let r=(1<=t;r--)e=(e<<1)+s[r];n.push(e)}let o=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(let t=r;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===n[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=n[i];o="affine"===t.type?s>0?o.mixedAdd(r[s-1>>1]):o.mixedAdd(r[-s-1>>1].neg()):s>0?o.add(r[s-1>>1]):o.add(r[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}Vj(t,e,i,s,r){const n=this.Tj,o=this.Fj,h=this.Ij;let a=0;for(let i=0;i=1;t-=2){const s=t-1,r=t;if(1!==n[s]||1!==n[r]){h[s]=Fp(i[s],n[s],this.Dj),h[r]=Fp(i[r],n[r],this.Dj),a=Math.max(h[s].length,a),a=Math.max(h[r].length,a);continue}const l=[e[s],null,null,e[r]];0===e[s].y.cmp(e[r].y)?(l[1]=e[s].add(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg())):0===e[s].y.cmp(e[r].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].add(e[r].neg())):(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=Rp(i[s],i[r]);a=Math.max(c[0].length,a),h[s]=new Array(a),h[r]=new Array(a);for(let t=0;t=0;t--){let e=0;for(;t>=0;){let i=!0;for(let e=0;e=0&&e++,l=l.dblp(e),t<0)break;for(let t=0;t0?i=o[t][e-1>>1]:e<0&&(i=o[t][-e-1>>1].neg()),l="affine"===i.type?l.mixedAdd(i):l.add(i))}}for(let t=0;t=Math.ceil((t.bitLength()+1)/e.step)}Rj(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let r=0;r({a:new Ip(t.a,16),b:new Ip(t.b,16)}))):this.Xj(i),{beta:e,lambda:i,basis:s}}Hj(t){const e=t===this.p?this.red:Ip.mont(t),i=new Ip(2).toRed(e).redInvm(),s=i.redNeg(),r=new Ip(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}Xj(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,r,n,o,h,a,l,u,c=t,d=this.n.clone(),f=new Ip(1),g=new Ip(0),m=new Ip(0),y=new Ip(1),p=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=y.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++p)break;a=l,d=c,c=l,m=f,f=u,y=g,g=o}o=l.neg(),h=u;const A=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(A)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}$j(t){const e=this.endo.basis,i=e[0],s=e[1],r=s.b.mul(t).divRound(this.n),n=i.b.neg().mul(t).divRound(this.n),o=r.mul(i.a),h=n.mul(s.a),a=r.mul(i.b),l=n.mul(s.b);return{k1:t.sub(o).sub(h),k2:a.add(l).neg()}}point(t,e,i){return new Lp(this,t,e,i)}pointFromX(t,e){(t=new Ip(t,16)).red||(t=t.toRed(this.red));const i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b);let s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");const r=s.fromRed().isOdd();return(e&&!r||!e&&r)&&(s=s.redNeg()),this.point(t,s)}validate(t){if(t.inf)return!0;const e=t.x,i=t.y,s=this.a.redMul(e),r=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)}jj(t,e,i){const s=this.Wj,r=this.Yj;let n=0;for(n=0;n":``}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);let e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));const i=e.redSqr().redISub(this.x).redISub(t.x),s=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)}dbl(){if(this.inf)return this;const t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);const e=this.curve.a,i=this.x.redSqr(),s=t.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new Ip(t,16),this.isInfinity()?this:this.Gj(t)?this.curve.Lj(this,t):this.curve.endo?this.curve.jj([this],[t]):this.curve.Ej(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.jj(s,r):this.curve.Vj(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.jj(s,r,!0):this.curve.Vj(1,s,r,2,!0)}eq(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))}neg(t){if(this.inf)return this;const e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){const t=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}}class _p extends Pp{constructor(t,e,i,s){super(t,"jacobian"),null===e&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ip(0)):(this.x=new Ip(e,16),this.y=new Ip(i,16),this.z=new Ip(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}getY(){throw new Error("Method not implemented.")}getX(){throw new Error("Method not implemented.")}pointFromX(t,e){throw new Error("Method not implemented.")}point(t,e,i){throw new Error("Method not implemented.")}jpoint(t,e,i){return new _p(this,t,e,i)}toP(){if(this.isInfinity())return this.curve.point(null,null);const t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),s=this.y.redMul(e).redMul(t);return this.curve.point(i,s)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=t.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(e),r=t.x.redMul(i),n=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),h=s.redSub(r),a=n.redSub(o);if(0===h.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=h.redSqr(),u=l.redMul(h),c=s.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(d)).redISub(n.redMul(u)),g=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(d,f,g)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;const e=this.z.redSqr(),i=this.x,s=t.x.redMul(e),r=this.y,n=t.y.redMul(e).redMul(this.z),o=i.redSub(s),h=r.redSub(n);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const a=o.redSqr(),l=a.redMul(o),u=i.redMul(a),c=h.redSqr().redIAdd(l).redISub(u).redISub(u),d=h.redMul(u.redISub(c)).redISub(r.redMul(l)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)}dblp(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){let e=this;for(let i=0;i=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class Bp{constructor(t){this.curve=new Op(t),this.g=this.curve.g,this.n=this.curve.n}}const Vp={};var Gp;Vp.PresetCurve=Bp,Gp={type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]},Object.defineProperty(Vp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Bp(Gp);return Object.defineProperty(Vp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class Np{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.Kj(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof Np?e:new Np(t,{pub:e,pubEnc:i})}validate(){const t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}getPublic(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub}Kj(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)}verify(t,e){return this.ec.verify(t,e,this)}}function Up(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let r=0,n=e.place;for(let e=0;e>>=0;return!(r<=127)&&(e.place=n,r)}class Yp{constructor(){this.place=0}}class Hp{constructor(t,e){if(t instanceof Hp)return t;this.qj(t,e)||(this.r=new Ip(t.r,16),this.s=new Ip(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}qj(t,e){t=zp(t,e);const i=new Yp;if(48!==t[i.place++])return!1;const s=Up(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Up(t,i);if(!1===r)return!1;let n=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;const o=Up(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let h=t.slice(i.place,o+i.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new Ip(n),this.s=new Ip(h),this.recoveryParam=null,!0}}class Xp{constructor(t){if(!(this instanceof Xp))return new Xp(t);"string"==typeof t&&(t=Vp[t]),t instanceof Vp.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1)}keyFromPublic(t,e){return Np.fromPublic(this,t,e)}tZ(t,e){const i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t}verify(t,e,i,s){t=this.tZ(new Ip(t,16)),i=this.keyFromPublic(i,s);const r=(e=new Hp(e,"hex")).r,n=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;const o=n.invm(this.n),h=o.mul(t).umod(this.n),a=o.mul(r).umod(this.n);if(!this.curve.Bj){const t=this.g.mulAdd(h,i.getPublic(),a);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(r)}const l=this.g.jmulAdd(h,i.getPublic(),a);return!l.isInfinity()&&l.eqXToP(r)}}var Wp,jp={exports:{}};jp.exports=(Wp=Wp||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==Ep&&Ep.crypto&&(i=Ep.crypto),!i)try{i=e}catch(t){}var s=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),n={},o=n.lib={},h=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=h.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,s=this.sigBytes,r=t.sigBytes;if(this.clamp(),s%4)for(var n=0;n>>2]>>>24-n%4*8&255;e[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var h=0;h>>2]=i[h>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new a.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],r=0;r>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new a.init(i,e)}},d=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=h.extend({reset:function(){this.Pw=new a.init,this.iZ=0},sZ:function(t){"string"==typeof t&&(t=d.parse(t)),this.Pw.concat(t),this.iZ+=t.sigBytes},eZ:function(e){var i,s=this.Pw,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.hZ,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,y=l[f-2],p=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[f]=m+l[f-7]+p+l[f-16]}var A=s&r^s&n^r&n,x=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=d+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[f]+l[f];d=c,c=u,u=h,h=o+S|0,o=n,n=r,r=s,s=S+(x+A)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},oZ:function(){var t=this.Pw,i=t.words,s=8*this.iZ,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.eZ(),this.uZ},clone:function(){var t=n.clone.call(this);return t.uZ=this.uZ.clone(),t}});i.SHA256=n.aZ(u),i.HmacSHA256=n.lZ(u)}(Math),t.SHA256}(jp.exports),Jp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({nZ:function(){this.uZ=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},oZ:function(){var t=r.oZ.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.aZ(n),e.HmacSHA224=r.lZ(n),t.SHA224;var e,i,s,r,n}(jp.exports),Qp={exports:{}}.exports=jp.exports.enc.Hex,tA={exports:{}}.exports=jp.exports.enc.Utf8;!function(t){return i=(e=t).lib.WordArray,e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,s=this.cZ;t.clamp();for(var r=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,h=0;h<4&&n+.75*h>>6*(3-h)&63));var a=s.charAt(64);if(a)for(;r.length%4;)r.push(a);return r.join("")},parse:function(t){var e=t.length,s=this.cZ,r=this.dZ;if(!r){r=this.dZ=[];for(var n=0;n>>6-o%4*2;r[n>>>2]|=h<<24-n%4*8,n++}return i.create(r,n)}(t,e,r)},cZ:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(jp.exports),function(t){(function(e){var i=t,s=i.lib,r=s.WordArray,n=s.Hasher,o=i.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=o.MD5=n.extend({nZ:function(){this.uZ=new r.init([1732584193,4023233417,2562383102,271733878])},rZ:function(t,e){for(var i=0;i<16;i++){var s=e+i,r=t[s];t[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var n=this.uZ.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],y=t[e+5],p=t[e+6],A=t[e+7],x=t[e+8],S=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],C=t[e+13],T=t[e+14],w=t[e+15],E=n[0],k=n[1],I=n[2],z=n[3];E=l(E,k,I,z,o,7,h[0]),z=l(z,E,k,I,a,12,h[1]),I=l(I,z,E,k,f,17,h[2]),k=l(k,I,z,E,g,22,h[3]),E=l(E,k,I,z,m,7,h[4]),z=l(z,E,k,I,y,12,h[5]),I=l(I,z,E,k,p,17,h[6]),k=l(k,I,z,E,A,22,h[7]),E=l(E,k,I,z,x,7,h[8]),z=l(z,E,k,I,S,12,h[9]),I=l(I,z,E,k,v,17,h[10]),k=l(k,I,z,E,b,22,h[11]),E=l(E,k,I,z,M,7,h[12]),z=l(z,E,k,I,C,12,h[13]),I=l(I,z,E,k,T,17,h[14]),E=u(E,k=l(k,I,z,E,w,22,h[15]),I,z,a,5,h[16]),z=u(z,E,k,I,p,9,h[17]),I=u(I,z,E,k,b,14,h[18]),k=u(k,I,z,E,o,20,h[19]),E=u(E,k,I,z,y,5,h[20]),z=u(z,E,k,I,v,9,h[21]),I=u(I,z,E,k,w,14,h[22]),k=u(k,I,z,E,m,20,h[23]),E=u(E,k,I,z,S,5,h[24]),z=u(z,E,k,I,T,9,h[25]),I=u(I,z,E,k,g,14,h[26]),k=u(k,I,z,E,x,20,h[27]),E=u(E,k,I,z,C,5,h[28]),z=u(z,E,k,I,f,9,h[29]),I=u(I,z,E,k,A,14,h[30]),E=c(E,k=u(k,I,z,E,M,20,h[31]),I,z,y,4,h[32]),z=c(z,E,k,I,x,11,h[33]),I=c(I,z,E,k,b,16,h[34]),k=c(k,I,z,E,T,23,h[35]),E=c(E,k,I,z,a,4,h[36]),z=c(z,E,k,I,m,11,h[37]),I=c(I,z,E,k,A,16,h[38]),k=c(k,I,z,E,v,23,h[39]),E=c(E,k,I,z,C,4,h[40]),z=c(z,E,k,I,o,11,h[41]),I=c(I,z,E,k,g,16,h[42]),k=c(k,I,z,E,p,23,h[43]),E=c(E,k,I,z,S,4,h[44]),z=c(z,E,k,I,M,11,h[45]),I=c(I,z,E,k,w,16,h[46]),E=d(E,k=c(k,I,z,E,f,23,h[47]),I,z,o,6,h[48]),z=d(z,E,k,I,A,10,h[49]),I=d(I,z,E,k,T,15,h[50]),k=d(k,I,z,E,y,21,h[51]),E=d(E,k,I,z,M,6,h[52]),z=d(z,E,k,I,g,10,h[53]),I=d(I,z,E,k,v,15,h[54]),k=d(k,I,z,E,a,21,h[55]),E=d(E,k,I,z,x,6,h[56]),z=d(z,E,k,I,w,10,h[57]),I=d(I,z,E,k,p,15,h[58]),k=d(k,I,z,E,C,21,h[59]),E=d(E,k,I,z,m,6,h[60]),z=d(z,E,k,I,b,10,h[61]),I=d(I,z,E,k,f,15,h[62]),k=d(k,I,z,E,S,21,h[63]),n[0]=n[0]+E|0,n[1]=n[1]+k|0,n[2]=n[2]+I|0,n[3]=n[3]+z|0},oZ:function(){var t=this.Pw,i=t.words,s=8*this.iZ,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var n=e.floor(s/4294967296),o=s;i[15+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.eZ();for(var h=this.uZ,a=h.words,l=0;l<4;l++){var u=a[l];a[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=n.clone.call(this);return t.uZ=this.uZ.clone(),t}});function l(t,e,i,s,r,n,o){var h=t+(e&i|~e&s)+r+o;return(h<>>32-n)+e}function u(t,e,i,s,r,n,o){var h=t+(e&s|i&~s)+r+o;return(h<>>32-n)+e}function c(t,e,i,s,r,n,o){var h=t+(e^i^s)+r+o;return(h<>>32-n)+e}function d(t,e,i,s,r,n,o){var h=t+(i^(e|~s))+r+o;return(h<>>32-n)+e}i.MD5=n.aZ(a),i.HmacMD5=n.lZ(a)})(Math),t.MD5}(jp.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({nZ:function(){this.uZ=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},rZ:function(t,e){for(var i=this.uZ.words,s=i[0],r=i[1],n=i[2],h=i[3],a=i[4],l=0;l<80;l++){if(l<16)o[l]=0|t[e+l];else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var c=(s<<5|s>>>27)+a+o[l];c+=l<20?1518500249+(r&n|~r&h):l<40?1859775393+(r^n^h):l<60?(r&n|r&h|n&h)-1894007588:(r^n^h)-899497514,a=h,h=n,n=r<<30|r>>>2,r=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+h|0,i[4]=i[4]+a|0},oZ:function(){var t=this.Pw,e=t.words,i=8*this.iZ,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(s+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.eZ(),this.uZ},clone:function(){var t=r.clone.call(this);return t.uZ=this.uZ.clone(),t}}),e.SHA1=r.aZ(h),e.HmacSHA1=r.lZ(h),t.SHA1;var e,i,s,r,n,o,h}(jp.exports),Zp=($p=jp.exports).lib.Base,qp=$p.enc.Utf8,$p.algo.HMAC=Zp.extend({init:function(t,e){t=this.fZ=new t.init,"string"==typeof e&&(e=qp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.AZ=e.clone(),n=this.gZ=e.clone(),o=r.words,h=n.words,a=0;a>>2];t.sigBytes-=e}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:f}),reset:function(){var t;l.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.mZ==this.pZ?t=s.createEncryptor:(t=s.createDecryptor,this.hZ=1),this.MZ&&this.MZ._Z==t?this.MZ.init(this,i&&i.words):(this.MZ=t.call(s,this,i&&i.words),this.MZ._Z=t)},rZ:function(t,e){this.MZ.processBlock(t,e)},oZ:function(){var t,e=this.cfg.padding;return this.mZ==this.pZ?(e.pad(this.Pw,this.blockSize),t=this.eZ(!0)):(t=this.eZ(!0),e.unpad(t)),t},blockSize:4});var g=i.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(h)},parse:function(t){var e,i=h.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=r.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),g.create({ciphertext:i,salt:e})}},y=i.SerializableCipher=s.extend({cfg:s.extend({format:m}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return g.create({ciphertext:n,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.wZ(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},wZ:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),p=(e.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=r.random(8));var n=a.create({keySize:e+i}).compute(t,s),o=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,g.create({key:n,iv:o,salt:s})}},A=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:p}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=y.encrypt.call(this,t,e,r.key,s);return n.mixIn(r),n},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.wZ(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,y.decrypt.call(this,t,e,r.key,s)}})}()}(jp.exports);var eA={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,r[i]=g,n[g]=i;var m=t[i],y=t[m],p=t[y],A=257*t[g]^16843008*g;o[i]=A<<24|A>>>8,h[i]=A<<16|A>>>16,a[i]=A<<8|A>>>24,l[i]=A,A=16843009*p^65537*y^257*m^16843008*i,u[g]=A<<24|A>>>8,c[g]=A<<16|A>>>16,d[g]=A<<8|A>>>24,f[g]=A,i?(i=m^t[t[t[p^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({nZ:function(){if(!this.CZ||this.kZ!==this.vZ){for(var t=this.kZ=this.vZ,e=t.words,i=t.sigBytes/4,s=4*((this.CZ=i+6)+1),n=this.TZ=[],o=0;o6&&o%i==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=g[o/i|0]<<24),n[o]=n[o-i]^l);for(var h=this.FZ=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.IZ(t,e,this.TZ,o,h,a,l,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.IZ(t,e,this.FZ,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},IZ:function(t,e,i,s,r,n,o,h){for(var a=this.CZ,l=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],f=4,g=1;g>>24]^r[u>>>16&255]^n[c>>>8&255]^o[255&d]^i[f++],y=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],p=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],A=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=m,u=y,c=p,d=A}m=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],y=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],p=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],A=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=m,t[e+1]=y,t[e+2]=p,t[e+3]=A},keySize:8});e.AES=i.aZ(m)}(),t.AES}(jp.exports),iA={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.SZ,s=i.blockSize,r=this.xZ,n=this.PZ;r&&(n=this.PZ=r.slice(0),this.xZ=void 0);var o=n.slice(0);i.encryptBlock(o,0),n[s-1]=n[s-1]+1|0;for(var h=0;h>>2]|=t[r]<<24-r%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(jp.exports),rA={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(jp.exports);const nA="aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvYXBwLWRlcGxveW1lbnQv",oA={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vcHl0aG9uLWNoYXJ0cy8="],"-1":["WE1MSHR0cFJlcXVlc3Q=","ZG9jdW1lbnQ=","ZGVmYXVsdFZpZXc=","YQ==","Yg==","bGljZW5zZV9leHBpcmF0aW9uX2RhdGU=","bG9jYXRpb24=","aG9zdG5hbWU=","dGVzdF9kb21haW4=","ZG9tYWlucw==","Y3J5cHRv","U2lnbmF0dXJl","RUNEU0E=","U0hBMjI0d2l0aEVDRFNB","YWxn","Y3VydmU=","c2VjcDI1Nmsx","YWRkRXZlbnRMaXN0ZW5lcg==","cmVtb3ZlRXZlbnRMaXN0ZW5lcg==","bG9hZGVuZA==","ZXJyb3I=","YWJvcnQ=","dGltZW91dA==","cmVzcG9uc2VUZXh0","Q29udGVudC1UeXBl","YXBwbGljYXRpb24vanNvbg==","TWVzc2FnZURpZ2VzdA==","c2hhMjU2","Y3J5cHRvanM=","dXBkYXRlU3RyaW5n","ZGlnZXN0","Y29tcGFueQ==","YXBwVGl0bGU=","bGNqcy1zZXNzaW9u","bG9jYWxTdG9yYWdl","Z2V0SXRlbQ==","c2V0SXRlbQ==","ZA==","dA==","bGNqcy1zZXNzaW9uLTI="],0:["TGljZW5zZQ==","IA==","a2V5","aGFz","ZXhwaXJlZA==","Lg==","dmVyc2lvbg==","aXM=","dG9v","bmV3","b2xk","b3I=","aW52YWxpZA==","MDAwMQ==","SW52YWxpZA==","bnVtYmVy","b2Y=","ZG9tYWlucw==","ZGVwbG95bWVudA==","aW4=","ZG9tYWlu","RGVwbG95bWVudA==","ZG9tYWlu","dmFsaWRhdGlvbg==","ZmFpbGVk","Og==","UE9TVA==","c2VydmVy","cmVzcG9uZGVk","d2l0aA==","dW5leHBlY3RlZA==","dmFsdWU=","cmVxdWVzdA==","VEVTVA==","REVQTE9ZTUVOVA==","S2V5","VGFtcGVyaW5n","YmVlbg==","ZGV0ZWN0ZWQ=","TWlzc2luZw==","TGljZW5zZQ==","aW5mb3JtYXRpb24=","ZG9lcw==","bm90","aW5jbHVkZQ==","cGVybWlzc2lvbg==","dG8=","dXNl","Q2hhcnQ=","M0Q=","WFk=","RGF0YUdyaWQ=","TWFw","UG9sYXI=","RnVubmVs","R2F1Z2U=","UGll","UHlyYW1pZA==","U3BpZGVy","Zm9y","dGhpcw==","VHJhZGluZw==","ZmVhdHVyZXM=","Q2xpY2s=","aGVyZQ==","bW9yZQ==","c3VwcGxpZWQ=","Z2V0","bGljZW5zZQ==","VHJlZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA==","aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vcGx1Z2lu"]},hA=zt,aA=(...t)=>t.slice(1).reduce(((e,i)=>e+hA.atob(oA[t[0]][i].toString())),"");let lA,uA,cA,dA=new Uint8Array([]);const fA=t=>t&&"cGx1Z2lu"in t&&"cHl0aG9u"===t.cGx1Z2lu?aA(-2,3):aA(-2,2);class gA{set e(t){lA=t}get e(){uA={df:!1,ff:!1,Af:!1,gf:!1,pf:!1,yf:!1,mf:!1,vf:!1,Sf:!1,xf:!1,bf:!1,Mf:!1,_f:!1,wf:!1,Cf:!1,kf:!1,Tf:!1,Ff:!1,If:!1,Pf:!1,Df:!1,Bf:!1,Lf:!1,Rf:!1,Ef:!1,zf:!1};const t=dA.length,e=t>=1?dA[0]:void 0,i=t>=2?dA[1]:void 0,s=t>=3?dA[2]:void 0,r=t>=4?dA[3]:void 0;return void 0!==e&&(uA.df=!!(1&e),uA.ff=!!(2&e),uA.Af=!!(4&e),uA.gf=!!(8&e),uA.pf=!!(16&e),uA.yf=!!(32&e),uA.mf=!!(64&e),uA.vf=!!(128&e)),void 0!==i&&(uA.Sf=!!(1&i),uA.xf=!!(2&i),uA.bf=!!(4&i),uA.Mf=!!(8&i),uA._f=!!(16&i),uA.wf=!!(32&i),uA.Cf=!!(64&i),uA.kf=!!(128&i)),void 0!==s&&(uA.Tf=!!(1&s),uA.Ff=!!(2&s),uA.If=!!(4&s),uA.Pf=!!(8&s),uA.Df=!!(16&s),uA.Bf=!!(32&s),uA.Lf=!!(64&s),uA.Rf=!!(128&s)),void 0!==r&&(uA.Ef=!!(1&r)),uA.yf}set l(t){cA=t}get l(){return cA}}let mA=!1;const yA=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},pA=t=>{if(4===t.byteLength)return`${t[0].toString().padStart(2,"0")}${t[1].toString().padStart(2,"0")}${t[2].toString().padStart(2,"0")}${t[3].toString().padStart(2,"0")}`},AA=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),xA=t=>{const e={},i=t.split("-");if(3!==i.length)return{DZ:aA(0,0,1,7,1,12,5)};let s=0;const r=Uint8Array.from(hA.atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const n=r.subarray(s,s+=20),o=new DataView(r.buffer).getUint16(s,!0);s+=2;const h=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return bA(d,f)?e:{DZ:aA(0,0,1,7,1,12,5)}},SA=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(yA(i,2)),e=t.slice(36,40),s=new Uint8Array(4),r=(t=>{let e;const i=[];for(let t=0;t<256;t+=1){e=t;for(let t=0;t<8;t+=1)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}let s=-1;for(let e=0;e>>8^i[255&(s^t[e])];return~s>>>0})(t.slice(0,36));new DataView(s.buffer).setUint32(0,r,!0);const n=t.slice(28,34);let o=0;for(let t=n.length-1;t>0;t-=1)o+=n[t]*2**(8*t);const h=new Date(o);if(AA(h)s[e]===t)))return{};break}case"0002":return xA(t);default:return{DZ:aA(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{DZ:aA(0,0,1,2,1,7,1,12,5)}},vA=t=>{if(!t)return{DZ:aA(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[aA(-1,9)]||t[aA(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(hA[aA(-1,6)][aA(-1,7)])>-1)return{EZ:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(EA(hA[aA(-1,6)][aA(-1,7)],i))return{EZ:!0};const s=t[aA(-1,8)]||t[aA(-1,38)];if(""!==s&&null!=s){if(EA(hA[aA(-1,6)][aA(-1,7)],[s]))return{EZ:!1};if(s===hA[aA(-1,6)][aA(-1,7)])return{EZ:!1}}return{DZ:aA(0,14,1,20,5),LZ:"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvd2ViLWRlcGxveW1lbnQv"}},bA=(t,e)=>{const i=new Xp("secp256k1").keyFromPublic(aA(-4,0),"hex"),s=Jp(t).toString();return i.verify(s,e)},MA=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],r=e[2],n=e[3];if(!bA(r,n))return{DZ:aA(0,21,1,2,1,7,1,12,5)};const o=Qp.parse(r);i=eA.decrypt({ciphertext:Qp.parse(s)},o,{mode:iA,padding:rA,iv:Qp.parse("00000000000000000000000000000001")}).toString(tA)}catch(t){return{DZ:aA(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{DZ:aA(0,21,1,2,1,7,1,12,5)}}if(void 0===e[aA(-1,5)]||null===e[aA(-1,4)]||!e[aA(-1,9)])return{DZ:aA(0,21,1,2,1,7,1,12,5)};const s=parseInt(aA(-3,0),10)||Number(parseInt(aA(-3,0),10));return e[aA(-1,5)]{const e=xA(t),i=e.BZ,s=e.RZ;if(e.DZ||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.RZ,s+16),r=new DataView(t.buffer),o=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":return((t,e)=>{if(!e)return{DZ:aA(0,39,1,40,1,41,5),LZ:nA};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!bA(`${s}-${r}`,n))return{DZ:aA(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(yA(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(aA(-3,0),10)||Number(parseInt(aA(-3,0),10))))return{DZ:aA(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(yA(s,8)),l=Kp(e[aA(-1,31)]).toString(Qp),u=Int32Array.from(yA(l,8)),c=Kp(e[aA(-1,32)]).toString(Qp),d=Int32Array.from(yA(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{DZ:aA(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{DZ:aA(0,39,1,40,1,41,5),LZ:nA};const i=xA(t),s=i.BZ,r=i.RZ;if(i.DZ||void 0===s||void 0===r)return i;const n=s.slice(r,s.length),o=new DataView(n.buffer),h=new Int32Array(8);for(let t=0;td[e]===t))?{}:{DZ:aA(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{DZ:aA(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},TA=(t,e,i=!0,s)=>{mA=!1,e.fo();const r=e.qr,n=!!r&&(r===zt.document.body||zt.document.body.contains(r)),o=r&&n?r:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const r=zt.document.createElement("div");r.id="lcjs-error",o.append(r),r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="black",r.style.boxSizing="border-box",r.style.padding="20px",r.style.font="Arial",r.style.fontSize="20px";let n,h=(t||"LICENSE_ERROR").split("_").join(" ");if(h=(i?aA(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1),s){const t=zt.document.createElement("a");t.href=s,n=t}else n=zt.document.createElement("p1");r.append(n),n.innerHTML=h,n.style.color="red",e.ej()&&hA.console.error(h)}},wA=(t,e,i)=>{e?(t[aA(-1,17)](aA(-1,19),i),t[aA(-1,17)](aA(-1,20),i),t[aA(-1,17)](aA(-1,21),i),t[aA(-1,17)](aA(-1,22),i)):(t[aA(-1,18)](aA(-1,19),i),t[aA(-1,18)](aA(-1,20),i),t[aA(-1,18)](aA(-1,21),i),t[aA(-1,18)](aA(-1,22),i))},EA=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const r=e.findIndex((t=>"*"===t)),n=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(r>i.length-1||!n)}))},kA=new Map;e.AbstractCursor=Ta,e.Animation=Z,e.AnimationEasings=$,e.Animator=q,e.AreaRangeSeries=Uu,e.AreaSeries=Lu,e.AreaSeriesBipolar=_u,e.AreaSeriesMonopolar=Bu,e.AreaSeriesNegative=Vu,e.AreaSeriesPositive=Gu,e.AreaSeriesTypes=Nu,e.AutoFitStrategies=ba,e.AutoFitStrategy=xa,e.Axis=bh,e.Axis3D=nl,e.AxisScrollStrategies=Ks,e.AxisTickStrategies=Js,e.Band=Zs,e.BarChart=Af,e.BarChartBar=mf,e.BarChartCategoryAxis=ff,e.BarChartSorting=xf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=gf,e.BasicSeries=xu,e.BorderedPicture=qn,e.BoxFigure=fu,e.BoxSeries=vu,e.BoxSeries3D=dl,e.Button=th,e.Chart=fa,e.Chart3D=Dl,e.ChartComponent=is,e.ChartWithSeries=Sl,e.ChartXY=Dc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return C(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb")){const e=t.substr(4).slice(0,-1),i=JSON.parse(`[${e}]`);return C(i[0],i[1],i[2])}if(t.startsWith("hsl")){const e=t.substr(4).slice(0,-1).split(",").map(parseFloat),i=((t,e,i)=>{e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,r=t/60,n=s*(1-Math.abs(r%2-1));let o=[];isNaN(t)?o=[0,0,0]:r<=1?o=[s,n,0]:r<=2?o=[n,s,0]:r<=3?o=[0,s,n]:r<=4?o=[0,n,s]:r<=5?o=[n,0,s]:r<=6&&(o=[s,0,n]);const h=i-.5*s;return[Math.round(255*(o[0]+h)),Math.round(255*(o[1]+h)),Math.round(255*(o[2]+h))]})(e[0],e[1],e[2]);return C(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?T(t):T((t=>{const e=E[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),T("#fff")},e.ColorHEX=T,e.ColorHSV=w,e.ColorPalettes=to,e.ColorRGBA=C,e.ColorShadingStyles=lo,e.ColorUint32=t=>C(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=qs,e.Cursor2D=Ea,e.Cursor3D=zl,e.CursorBuilder2D=ka,e.CursorBuilder3D=Fl,e.CursorBuilderXY=yc,e.CursorBuilders=Mf,e.CursorXY=mc,e.CustomTick=Bn,e.Dashboard=gg,e.DashedLine=fo,e.DataGrid=hf,e.DataPatternsNew=Zr,e.DataSetXY=So,e.DateTimeTickStrategy=qh,e.EllipseFigure=bu,e.EllipseSeries=Mu,e.EmptyFill=L,e.EmptyTickStrategy=lr,e.EmptyUIElement=jn,e.Figure=du,e.FigureSeries=pu,e.FontSettings=vr,e.FormattingFunctions=Bi,e.FunnelChart=ed,e.FunnelChartTypes=hd,e.FunnelChartWithLabelsInsideSlices=od,e.FunnelChartWithLabelsOnSides=nd,e.FunnelSlice=qc,e.GaugeChart=Uf,e.GenericAxis=gr,e.GlowEffect=xo,e.HeatmapGridSeries=zu,e.HeatmapGridSeriesIntensityValues=Fu,e.HeatmapScrollingGridSeries=Ru,e.HeatmapScrollingGridSeriesIntensityValues=Du,e.Highlighter=ss,e.Icon=yo,e.ImageFill=Q,e.IndividualPointFill=Y,e.LUT=P,e.LegendBoxBuilders=xh,e.LineAndPointSeries3D=fl,e.LineSeries=xc,e.LineSeries3D=gl,e.LinearGradientFill=ht,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new ht({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Hl,e.MapRegions=Df,e.MapRegionsAfrica=Cf,e.MapRegionsAsia=Tf,e.MapRegionsAustralia=wf,e.MapRegionsCanada=Ef,e.MapRegionsEurope=kf,e.MapRegionsNorthAmerica=Ff,e.MapRegionsSouthAmerica=Rf,e.MapRegionsUSA=zf,e.MapRegionsWorld=If,e.MapTypes=_l,e.MeshModel3D=Il,e.NumericTickStrategy=ra,e.OHLCSeries=lc,e.OHLCSeriesBars=cc,e.OHLCSeriesCandlesticks=uc,e.OHLCSeriesTypes=dc,e.OnScreenMenu=vc,e.OnScreenMenuAnimationsButton=Ps,e.OnScreenMenuButton=ws,e.OnScreenMenuControlBase=ds,e.OnScreenMenuCustomButton=Ls,e.OnScreenMenuOsmToggleButton=_s,e.OnScreenMenuToggleButton=Es,e.OnScreenMenuZoomInButton=ks,e.OnScreenMenuZoomInXButton=Is,e.OnScreenMenuZoomInYButton=zs,e.OnScreenMenuZoomOutButton=Fs,e.OnScreenMenuZoomOutXButton=Rs,e.OnScreenMenuZoomOutYButton=Ds,e.OnScreenMenuZoomToFitButton=Os,e.PalettedFill=W,e.Panel=la,e.ParallelCoordinateAxis=hg,e.ParallelCoordinateChart=lg,e.ParallelCoordinateSeries=ag,e.PhongShadingStyle=ho,e.Picture=Zn,e.PieChart=ja,e.PieChartTypes=Qa,e.PieChartWithLabelsInsideSlices=Ja,e.PieChartWithLabelsOnSides=Ka,e.PieSlice=Ua,e.PixelatedPoints3D=Ir,e.PointCloudSeries3D=Al,e.PointLineAreaSeries=bc,e.PointLineSeries=ju,e.PointLineSeries3D=ml,e.PointSeries=Sc,e.PointSeries3D=pl,e.PointSeriesTypes3D=xl,e.PointStyle3D=Fr,e.PolarAreaSeries=Hc,e.PolarAreaSeriesInterior=Xc,e.PolarAxis=jl,e.PolarAxisAmplitude=Zl,e.PolarAxisTick=$l,e.PolarChart=jc,e.PolarHeatmapSeries=lu,e.PolarLineSeries=uu,e.PolarPointLineSeries=cu,e.PolarPointSeries=Nc,e.PolarPolygon=Uc,e.PolarPolygonSeries=Yc,e.PolarSector=iu,e.PolarSeries=ru,e.PolygonFigure=Cu,e.PolygonSeries=Tu,e.PyramidChart=gd,e.PyramidChartTypes=Sd,e.PyramidChartWithLabelsInsideSlices=xd,e.PyramidChartWithLabelsOnSides=Ad,e.PyramidSlice=ud,e.RadialGradientFill=rt,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new rt({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Ou,e.RectangleFigure=wu,e.RectangleSeries=Eu,e.SegmentFigure=ku,e.SegmentSeries=Iu,e.Series2D=su,e.Series3D=cl,e.SeriesXY=gu,e.SimpleShadingStyle=no,e.Slice=Ga,e.SliceLabelFormatters=Va,e.SliceSorters=Ba,e.SolidFill=N,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new N({color:s(t)})},e.SolidLine=us,e.SpiderAxis=Td,e.SpiderChart=Pd,e.SpiderSeries=wd,e.SplineSeries=qu,e.StepSeries=ac,e.StipplePatterns=uo,e.SurfaceGridSeries3D=Tl,e.SurfaceScrollingGridSeries3D=wl,e.Themes=rg,e.Tick=vh,e.TickStyle=kh,e.TimeFormattingFunctions=Ph,e.TimeTickStrategy=Lh,e.TreeMapChart=Gf,e.TriangulatedPoints3D=wr,e.UIBackgrounds=Ma,e.UICircle=Ro,e.UIColumnGrid=class extends Vo{constructor(){super(...arguments),this.Pd=[]}addColumn(){return this.addElement(Ho,void 0)}getColumn(t,e=!1){return e&&this.Pd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Pd[t]}},e.UIDiamond=Do,e.UIElementBuilders=Ah,e.UIElementColumn=Go,e.UIElementLine=Bo,e.UIElementRow=Vo,e.UIElementWithBackground=Ln,e.UIEmptyBackground=$n,e.UILabel=Io,e.UILayoutBuilders=Ol,e.UILayoutGap=_o,e.UILegendBoxPanel=Ll,e.UIObject=Fn,e.UIOrigins=Vs,e.UIPanel=ca,e.UIPoint=Oo,e.UIPointer=Po,e.UIPolygon=Kn,e.UIRectangle=Fo,e.UIRowGrid=Uo,e.VisibleFill=G,e.ZoomBandChart=Vc,e._translatePoint=yt,e.defaultOsmBackgroundColor=js,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=_,e.emptyLine=ut,e.emptyPoints3D=Cr,e.emptyTick=zh,e.formatLongitudeLatitude=Xl,e.formatNumberAsUnicodeSuperscript=Vi,e.isColor=M,e.isCoordinate3D=kl,e.isCoordinateBarChart=yf,e.isCoordinateClient=ji,e.isCoordinatePolar=eu,e.isCoordinateXY=Zi,e.isDashedLine=go,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=B,e.isEmptyTick=Fh,e.isEmptyTickStrategy=ur,e.isFontSettings=br,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isHitBox=t=>t&&"object"==typeof t&&"figure"in t&&"start"in t&&"end"in t&&"median"in t&&"upperQuartile"in t,e.isHitBox3D=t=>t&&"object"==typeof t&&"xSize"in t&&"ySize"in t&&"zSize"in t,e.isHitEllipse=t=>t&&"object"==typeof t&&"figure"in t&&"x"in t&&"radiusX"in t&&"radiusY"in t,e.isHitHeatmap=At,e.isHitMeshModel=vt,e.isHitOHLC=t=>t&&"object"==typeof t&&"position"in t&&"open"in t&&"high"in t&&"isPacked"in t,e.isHitPolarHeatmap=St,e.isHitPolygon=t=>t&&"object"==typeof t&&"figure"in t&&"x"in t&&"coordinates"in t,e.isHitRectangle=t=>t&&"object"==typeof t&&"figure"in t&&"x1"in t&&"y2"in t&&"height"in t,e.isHitSampleXY=t=>t&&"object"==typeof t&&"x"in t&&"y"in t,e.isHitSegment=t=>t&&"object"==typeof t&&"figure"in t&&"startX"in t&&"endX"in t,e.isHitSurface=xt,e.isIcon=po,e.isImageFill=tt,e.isIndividualPointFill=H,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=at,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=j,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=zr,e.isRadialGradientFill=nt,e.isSeriesSupportedByZoomBandChart=t=>t instanceof xu||t instanceof Lu||t instanceof Uu||t instanceof Fu||t instanceof lc||t instanceof ac||t instanceof bc,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=U,e.isSolidLine=cs,e.isTickStyle=Ih,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=Er,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,n="object"==typeof t?t:void 0,o=new gA;o.e=i;let h=kA.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1,d=!1;try{if(lA){const s=(()=>{if(!lA)return;const t=lA.split("-");if(t.length>0)switch(t[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";case"P001":return"P001";default:return}})(),r=t&&"cGx1Z2lu"in t;if("0001"===s){dA=new Uint8Array([2]);const e=(()=>{if(!lA)return;const t=lA.split("-");return 4===t.length?t[1].startsWith("m")?2:1:0})();if(1===e){const t=MA(lA);h=!t.EZ,i=t,n=!0}else 2===e?(i=CA(lA,t),o=!0):(mA=!0,i=SA(lA),a=!0);r&&(i={DZ:aA(0,0,1,7,1,12,5)})}else if("0002"===s){const e=(()=>{if(!lA)return;const t=lA.split("-");return t.length>=2?Uint8Array.from(hA.atob(t[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)mA=!0,i=SA(lA),a=!0;else if(189===e){const t=MA(lA);h=!t.EZ,i=t,n=!0}else 159===e?(i=CA(lA,t),o=!0):i={DZ:aA(0,0,1,7,1,12,5)};const s=dA.length>3&&2&dA[3];(s&&!r||!s&&r||s&&r&&"cHl0aG9u"!==t.cGx1Z2lu)&&(i={DZ:aA(0,0,1,7,1,12,5)})}else if("T001"===s){const s=((t,e)=>{const i=lA.split("-");if(3!==i.length)return{DZ:aA(0,0,1,7,1,12,5)};const s=`${i[1]}`,r=Array.prototype.reduce.call(hA.atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!bA(s,r))return{DZ:aA(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(hA.atob(i[1]),(t=>t.charCodeAt(n))),h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;ty)return{DZ:aA(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),A=l.subarray(n+=2,n+p);if(dA=new Uint8Array(A),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{zZ:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&bA(t[0],t[2])?{zZ:t[0]}:{DZ:aA(0,0,1,7,1,12,5)}}return{DZ:aA(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.zZ;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={DZ:aA(0,0,1,7,1,12,5)}}else"P001"===s?(i=((t,e)=>{const i=lA.split("-");if(3!==i.length)return{DZ:aA(0,0,1,7,1,12,5)};const s=`${i[0]}-${i[1]}`,r=Array.prototype.reduce.call(hA.atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!bA(s,r))return{DZ:aA(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(hA.atob(i[1]),(t=>t.charCodeAt(0)));n+=1;const h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;tNumber(t)));Date.now()-i<.95*e*1e3&&(f=!0)}}const g=!(d||u||c||i.DZ||n||o||f),m=(()=>{const t=new(hA[aA(-1,0)]);return t.open(aA(0,26),aA(-2,0)),t.setRequestHeader(aA(-1,24),aA(-1,25)),t.withCredentials=!0,t})(),y=new r.Eventer;if(g){let t;try{t=parseInt(lA?lA.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const e=Math.floor(1e6*Math.random());l=(t^e).toString();const i={};let s="",r="",n="";lA=lA||"";const o=aA(-4,0);for(let t=0;t{const o=[],a={Jn:t=>{o.indexOf(t)>=0||(o.push(t),d())},Kn:t=>y.on("logoChange",t),qn:t=>y.off(t)},d=()=>{o.forEach((t=>{const e=p(t);if(!e)return;const{VZ:i,OZ:s}=e,r=s?aA(-2,1):void 0,n=`${aA(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?aA(0,5,1,63,1,64,1,59,1,65,1,41,5):""}`;TA(n,A,!1,r)}))},f=t=>hA.atob(t),p=t=>{const e=Object.values(Sh).includes(t)?t:void 0;if(e){switch(t){case Sh.Af:return uA.df||uA.Af?void 0:{VZ:f(e),OZ:!0};case Sh.mf:return uA.df||uA.mf?void 0:{VZ:f(e),OZ:!0};case Sh.vf:return uA.df||uA.ff||uA.vf?void 0:{VZ:f(e),OZ:!0};case Sh.ff:return uA.df||uA.ff?void 0:{VZ:f(e),OZ:!0};case Sh._f:return uA.df||uA.ff||uA._f?void 0:{VZ:f(e),OZ:!0};case Sh.kf:return uA.df||uA.ff||uA.kf?void 0:{VZ:f(e),OZ:!0};case Sh.Pf:return uA.df||uA.ff||uA.Pf?void 0:{VZ:f(e),OZ:!0};case Sh.Bf:return uA.df||uA.ff||uA.Bf?void 0:{VZ:f(e),OZ:!0};case Sh.Lf:return uA.df||uA.ff||uA.Lf?void 0:{VZ:f(e),OZ:!0};case Sh.Df:return uA.df||uA.ff||uA.Df?void 0:{VZ:f(e),OZ:!0};case Sh.xf:return uA.df||uA.ff||uA.xf?void 0:{VZ:f(e),OZ:!0};case Sh.Cf:return uA.df||uA.ff||uA.Cf?void 0:{VZ:f(e),OZ:!0};case Sh.Mf:return uA.df||uA.ff||uA.Mf?void 0:{VZ:f(e),OZ:!0};case Sh.Tf:return uA.df||uA.ff||uA.Tf?void 0:{VZ:f(e),OZ:!0};case Sh.If:return uA.df||uA.ff||uA.If?void 0:{VZ:f(e),OZ:!0};case Sh.Ff:return uA.df||uA.ff||uA.Ff?void 0:{VZ:f(e),OZ:!0};case Sh.Sf:return uA.df||uA.ff||uA.Sf?void 0:{VZ:f(e),OZ:!0};case Sh.bf:return uA.df||uA.ff||uA.bf?void 0:{VZ:f(e),OZ:!0};case Sh.wf:return uA.df||uA.ff||uA.wf?void 0:{VZ:f(e),OZ:!0};case Sh.Rf:return uA.df||uA.ff||uA.Rf?void 0:{VZ:f(e),OZ:!0};case Sh.Ef:return uA.df||uA.ff||uA.Ef?void 0:{VZ:f(e),OZ:!0};case Sh.df:case Sh.gf:case Sh.yf:case Sh.pf:case Sh.zf:return}return ze(0,"")}},A=new wp(n,r,a);(null==i?void 0:i.DZ)&&TA(i.DZ,A,void 0,i.LZ);const x=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&bA(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return mA=!1,void wA(m,!1,S)}}if(m.readyState===hA[aA(-1,0)].DONE)if(200===m.status){const t=JSON.parse(m[aA(-1,23)]);if(!bA(l+aA(-3,0),t.h)){const t=aA(0,0,1,27,1,28,1,29,1,30,1,31,5);TA(t,A)}hA[aA(-1,34)][aA(-1,36)](aA(-1,39),t.t),hA[aA(-1,34)][aA(-1,36)](aA(-1,33),t.s),mA=!1}else{let e=aA(0,0,1,2,1,7,1,12,5);try{e=t&&"loadend"!==t.type?aA(0,0,1,23,1,32,1,24,5):JSON.parse(m[aA(-1,23)]).message,wA(m,!1,S)}catch(t){console.error(t)}TA(e,A,void 0,"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvZGV2ZWxvcGVyLWxpY2Vuc2Vz")}},S=t=>{x(t)};if(wA(m,!0,S),g?setTimeout((()=>{if(mA){let t=!0;if(s){const e=s.split("-");if(2===e.length&&bA(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&TA(aA(0,25,1,23,1,32,1,24,5),A)}}),1e4):wA(m,!1,S),u){const i=(()=>{const t=new(hA[aA(-1,0)]);return t.open(aA(0,26),aA(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),s=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),r=r=>{if("error"===(null==r?void 0:r.type)){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}if(i.readyState===hA.XMLHttpRequest.DONE){const r=i.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==i.status||r&&"1"!==r){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}else{const r=JSON.parse(i.responseText);if(!bA(s,r.s)){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}void 0!==e&&(e.l=r.l),y.emit("logoChange",r.l)}}else{const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}},n=t=>{r(t)};wA(i,!0,n),i.send(s),setTimeout((()=>{if(i.readyState<2){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}}),1e4)}if(c){const i=(()=>{const t=new(hA[aA(-1,0)]);return t.open(aA(0,26),aA(1,1)),t.setRequestHeader(aA(-1,24),aA(-1,25)),t.withCredentials=!0,t})();let s;try{s=parseInt(lA?lA.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(t){s=Math.floor(1e6*Math.random())}const r=Math.floor(1e6*Math.random());l=(s^r).toString();const n={};let o="",h="";lA=lA||"";const a=aA(-4,0);for(let t=0;t{var r;if("error"===(null==s?void 0:s.type)){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,c)}if(i.readyState===hA.XMLHttpRequest.DONE)if(200===i.status){const s=JSON.parse(i.responseText);if(!bA(l,s.h)){const e=aA(0,0,1,7,1,12,5);TA(e,A,!1,fA(t)),wA(m,!1,c)}const r=s.l.split("-"),n=r[0],o=r[1];if(bA(n,o))void 0!==e&&(e.l=n,y.emit("logoChange",n));else{const e=aA(0,0,1,7,1,12,5);TA(e,A,!1,fA(t))}const h=s.f,a=Uint8Array.from(hA.atob(h),(t=>t.charCodeAt(0)));let u=0;const f=a.subarray(u,u+=20),g=new DataView(a.buffer).getUint16(u,!0);u+=2;const p=Uint8Array.from(Array(g));for(let t=0;t{u(t)};wA(i,!0,c),setTimeout((()=>{if(i.readyState<2){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,c)}}),1e4)}return h?(t=>{let e;mA=!1;const i=()=>{e&&(t.En(e.Rn()),e=void 0);const i=t.oi();e=t.KF("deployment test"),e.Wr(t.At).Sr(aA(0,34,1,33)).Ve({x:i.x/2,y:i.y/2}).La(50).sr(13).Re(new N({color:C(128,128,128,100)})).Da("Arial").Ea(500).setMouseInteractions(!1),t.Dn().Bn()};t.Eo((()=>{i()})),setTimeout(i,0),setInterval((()=>{e&&e.Rn(){var r,n,o,h,a,l,u,c;let d;if(i&&i.license){const t=i.license.split("-");d=t[t.length-1]}const f=null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version,g={vV:null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.canvas,eo:null==i?void 0:i.warnings,IV:"webgl1"===f?1:"webgl2"===f?2:void 0,CV:!1!==(null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.antialias),wV:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,OV:(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.noCanvasStyles)||void 0,WV:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasTransform)||void 0,TV:!1!==(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.useStackingOrder),FV:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useIndividualCanvas),NV:d||void 0},m=new Am(g),y=e=>t(e,m);return{Dashboard:xm(y,e,i,s),ChartXY:bm(y,e,i,s),Spider:Mm(y,e,i,s),Polar:Cm(y,e,i,s),Pie:Tm(y,e,i,s),UIPanel:vm(y,e,i,s),Gauge:wm(y,e,i,s),Funnel:Em(y,e,i,s),Pyramid:km(y,e,i,s),Chart3D:zm(y,e,i,s),Map:Im(y,e,i,s),DataGrid:Fm(y,e,i,s),BarChart:Rm(y,e,i,s),ParallelCoordinateChart:Om(y,e,i,s),ZoomBandChart:Dm(y,e,i,s),TreeMapChart:Pm(y,e,i,s),dispose:m.Y.bind(m),layout:m.jV.bind(m)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Us,e.onScreenMenuControlBaseWidth=Ys,e.onScreenMenuControlOpacity=Hs,e.onScreenMenuDefaultButtonShape=Ws,e.onScreenMenuSpriteURL=Xs,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const r=null==s?void 0:s.formatLabels,n=null==s?void 0:s.alpha;return i.map(((s,o)=>{const h=t+o/(i.length-1)*(e-t);return{color:void 0!==n?s.setA(n):s,value:h,label:r?r(h):void 0}}))},e.saveToFile=na,e.synchronizeAxisIntervals=pt,e.transparentFill=Gs,e.transparentLine=Ns,e.uint32ColorFromObject=t=>z(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=z,e.useCursorFormatterSeriesOverride=ya,e.vec3Utils=Ue,e.xDimensionStrategy=Ch,e.yDimensionStrategy=Th}}]); \ No newline at end of file diff --git a/js/vendor.a864d09e211150426e22.bundle.js.LICENSE.txt b/js/vendor.318c12a9e98430514f0d.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.a864d09e211150426e22.bundle.js.LICENSE.txt rename to js/vendor.318c12a9e98430514f0d.bundle.js.LICENSE.txt diff --git a/js/vendor.a864d09e211150426e22.bundle.js b/js/vendor.a864d09e211150426e22.bundle.js deleted file mode 100644 index 251d2bb..0000000 --- a/js/vendor.a864d09e211150426e22.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.a864d09e211150426e22.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[502],{243:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,TokenFactory:()=>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+=1);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{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,m=e&&e.length,y=m?e[0]*s:t.length,p=i(t,0,y,s,!0),A=[];if(!p||p.next===p.prev)return A;if(m&&(p=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 x=s;xh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,A,s,n,o,g,0),A}function i(t,e,i,s,r){var n,o;if(r===w(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(C(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||!p(s,s.next)&&0!==y(s.prev,s,s.next))s=s.next;else{if(C(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,m,y=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),C(t),t=m.next,y=m.next;else if((t=m)===y){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(y(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,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(y(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,m=ha?h>l?h:l:a>l?a:l,x=u>c?u>f?u:f:c>f?c:f,S=d(m,p,e,i,s),v=d(A,x,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=S&&M&&M.z<=v;){if(b.x>=m&&b.x<=A&&b.y>=p&&b.y<=x&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=m&&M.x<=A&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=S;){if(b.x>=m&&b.x<=A&&b.y>=p&&b.y<=x&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=m&&M.x<=A&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&A(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),C(r),C(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&&m(a,l)){var u=b(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=b(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return y(t.prev,t,e.prev)<0&&y(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 m(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(v(t,e)&&v(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)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||p(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,s){var r=S(y(t,e,i)),n=S(y(t,e,s)),o=S(y(i,s,t)),h=S(y(i,s,e));return r!==n&&o!==h||!(0!==r||!x(t,i,e))||!(0!==n||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==h||!x(i,e,s))}function x(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 S(t){return t>0?1:t<0?-1:0}function v(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new T(t.i,t.x,t.y),s=new T(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 M(t,e,i,s){var r=new T(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 C(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 T(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 w(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}},568:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>C,Iterable:()=>Ms,List:()=>ri,Map:()=>Pe,OrderedMap:()=>Ai,OrderedSet:()=>ns,PairSorting:()=>us,Range:()=>Ui,Record:()=>cs,Repeat:()=>As,Seq:()=>j,Set:()=>Oi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>xs,get:()=>re,getIn:()=>Yi,has:()=>se,hasIn:()=>Xi,hash:()=>ft,is:()=>lt,isAssociative:()=>M,isCollection:()=>A,isImmutable:()=>R,isIndexed:()=>b,isKeyed:()=>S,isList:()=>si,isMap:()=>ot,isOrdered:()=>P,isOrderedMap:()=>ht,isOrderedSet:()=>Fi,isPlainObject:()=>te,isRecord:()=>F,isSeq:()=>I,isSet:()=>zi,isStack:()=>Mi,isValueObject:()=>at,merge:()=>Se,mergeDeep:()=>be,mergeDeepWith:()=>Me,mergeWith:()=>ve,remove:()=>oe,removeIn:()=>de,set:()=>he,setIn:()=>ue,update:()=>ge,updateIn:()=>ae,version:()=>bs});var s="delete",r=32,n=31,o={};function h(t){t&&(t.value=!0)}function a(){}function l(t){return void 0===t.size&&(t.size=t.__iterate(c)),t.size}function u(t,e){if("number"!=typeof e){var i=e>>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?l(t)+e:e}function c(){return!0}function d(t,e,i){return(0===t&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function f(t,e){return m(t,e,0)}function g(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 p="@@__IMMUTABLE_ITERABLE__@@";function A(t){return Boolean(t&&t[p])}var x="@@__IMMUTABLE_KEYED__@@";function S(t){return Boolean(t&&t[x])}var v="@@__IMMUTABLE_INDEXED__@@";function b(t){return Boolean(t&&t[v])}function M(t){return S(t)||b(t)}var C=function(t){return A(t)?t:j(t)},T=function(t){function e(t){return S(t)?t:$(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),w=function(t){function e(t){return b(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),E=function(t){function e(t){return A(t)&&!M(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C);C.Keyed=T,C.Indexed=w,C.Set=E;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var z="@@__IMMUTABLE_RECORD__@@";function F(t){return Boolean(t&&t[z])}function R(t){return A(t)||F(t)}var D="@@__IMMUTABLE_ORDERED__@@";function P(t){return Boolean(t&&t[D])}var O="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",_=O||L,B=function(t){this.next=t};function V(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 G(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!H(t)}function U(t){return t&&"function"==typeof t.next}function Y(t){var e=H(t);return e&&e.call(t)}function H(t){var e=t&&(O&&t[O]||t[L]);if("function"==typeof e)return e}B.prototype.toString=function(){return"[Iterator]"},B.KEYS=0,B.VALUES=1,B.ENTRIES=2,B.prototype.inspect=B.prototype.toSource=function(){return this.toString()},B.prototype[_]=function(){return this};var X=Object.prototype.hasOwnProperty;function W(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 j=function(t){function e(t){return null==t?et():R(t)?t.toSeq():function(t){var e,i,s=rt(t);if(s)return(i=H(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=H(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new J(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 B((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return V(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(C),$=function(t){function e(t){return null==t?et().toKeyedSeq():A(t)?S(t)?t.toSeq():t.fromEntrySeq():F(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(j),Z=function(t){function e(t){return null==t?et():A(t)?S(t)?t.entrySeq():t.toIndexedSeq():F(t)?t.toSeq().entrySeq():st(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}(j),q=function(t){function e(t){return(A(t)&&!M(t)?t:Z(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}(j);j.isSeq=I,j.Keyed=$,j.Set=q,j.Indexed=Z,j.prototype[k]=!0;var K=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[u(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 B((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return V(t,n,i[n])}))},e}(Z),J=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 X.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 B((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return V(t,o,i[o])}))},e}($);J.prototype[D]=!0;var Q,tt=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(U(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(!U(i))return new B(G);var s=0;return new B((function(){var e=i.next();return e.done?e:V(t,s++,e.value)}))},e}(Z);function et(){return Q||(Q=new K([]))}function it(t){var e=rt(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new J(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function st(t){var e=rt(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function rt(t){return W(t)?new K(t):N(t)?new tt(t):void 0}var nt="@@__IMMUTABLE_MAP__@@";function ot(t){return Boolean(t&&t[nt])}function ht(t){return ot(t)&&P(t)}function at(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function lt(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!!(at(t)&&at(e)&&t.equals(e))}var ut="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 ct(t){return t>>>1&1073741824|3221225471&t}var dt=Object.prototype.valueOf;function ft(t){if(null==t)return gt(t);if("function"==typeof t.hashCode)return ct(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==dt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return gt(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 ct(e)}(r);case"string":return r.length>Ct?(void 0===(s=Et[i=r])&&(s=mt(i),wt===Tt&&(wt=0,Et={}),wt++,Et[i]=s),s):mt(r);case"object":case"function":return function(t){var e;if(St&&void 0!==(e=xt.get(t)))return e;if(void 0!==(e=t[Mt]))return e;if(!pt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Mt]))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=At(),St)xt.set(t,e);else{if(void 0!==yt&&!1===yt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(pt)Object.defineProperty(t,Mt,{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[Mt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Mt]=e}}return e}(r);case"symbol":return function(t){var e=vt[t];return void 0!==e||(e=At(),vt[t]=e),e}(r);default:if("function"==typeof r.toString)return mt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function gt(t){return null===t?1108378658:1108378659}function mt(t){for(var e=0,i=0;i=0&&(a.get=function(e,i){return(e=u(this,e))>=0&&en)return{value:void 0,done:!0};var t=r.next();return s||1===e||t.done?t:V(e,a-1,0===e?void 0:t.value[1],t)}))},a}function _t(t,e,i,s){var r=Wt(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(2,n),a=!0,l=0;return new B((function(){var t,n,u;do{if((t=h.next()).done)return s||1===r?t:V(r,l++,0===r?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 2===r?t:V(r,n,u,t)}))},r}function Bt(t,e,i){var s=Wt(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 Ut(t,e,i,s){var r=Wt(t),n=new K(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(1,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=C(t),Y(r?t.reverse():t)})),o=0,h=!1;return new B((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}:V(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Yt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function Ht(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Xt(t){return S(t)?T:b(t)?w:E}function Wt(t){return Object.create((S(t)?$:b(t)?Z:q).prototype)}function jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):j.prototype.cacheResult.call(this)}function $t(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 xe(this,e,t)}function xe(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Te(t,e)}function ve(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Te(e,i,t)}function be(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function Me(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ce(e,i,t)}function Ce(t,e,i){return Te(t,e,function(t){return function e(i,s,r){return ee(i)&&ee(s)&&(n=s,o=j(i),h=j(n),b(o)===b(h)&&S(o)===S(h))?Te(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Te(t,e,i){if(!ee(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(R(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?w:T,o=s?function(e){r===t&&(r=ne(r)),r.push(e)}:function(e,s){var n=X.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=ne(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ce(this,e,t)}function ke(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,We(),(function(t){return Te(t,e)}))}function Ie(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,We(),(function(t){return Ce(t,e)}))}function ze(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Fe(){return this.__ownerID?this:this.__ensureOwner(new a)}function Re(){return this.__ensureOwner()}function De(){return this.__altered}var Pe=function(t){function e(e){return null==e?We():ot(e)&&!P(e)?e:We().withMutations((function(i){var s=t(e);Kt(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 We().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 je(this,t,e)},e.prototype.remove=function(t){return je(this,t,o)},e.prototype.deleteAll=function(t){var e=C(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):We()},e.prototype.sort=function(t){return Ai(Vt(this,t))},e.prototype.sortBy=function(t,e){return Ai(Vt(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 Ue(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?Xe(this.size,this._root,t,this.__hash):0===this.size?We():(this.__ownerID=t,this.__altered=!1,this)},e}(T);Pe.isMap=ot;var Oe=Pe.prototype;Oe[nt]=!0,Oe[s]=Oe.remove,Oe.removeAll=Oe.deleteAll,Oe.setIn=ce,Oe.removeIn=Oe.deleteIn=fe,Oe.update=me,Oe.updateIn=ye,Oe.merge=Oe.concat=pe,Oe.mergeWith=Ae,Oe.mergeDeep=we,Oe.mergeDeepWith=Ee,Oe.mergeIn=ke,Oe.mergeDeepIn=Ie,Oe.withMutations=ze,Oe.wasAltered=De,Oe.asImmutable=Re,Oe["@@transducer/init"]=Oe.asMutable=Fe,Oe["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Oe["@@transducer/result"]=function(t){return t.asImmutable()};var Le=function(t,e){this.ownerID=t,this.entries=e};Le.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=Qe)return function(t,e,i,s){t||(t=new a);for(var r=new Ge(t,ft(i),[i,s]),n=0;n>>t)&n),o=this.bitmap;return o&r?this.nodes[Ke(o&r-1)].get(t+5,e,i,s):s},_e.prototype.update=function(t,e,i,s,h,a,l){void 0===i&&(i=ft(s));var u=(0===e?i:i>>>e)&n,c=1<=ti)return function(t,e,i,s,n){for(var o=0,h=new Array(r),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=n,new Be(t,o+1,h)}(t,m,d,u,p);if(f&&!p&&2===m.length&&Ze(m[1^g]))return m[1^g];if(f&&p&&1===m.length&&Ze(p))return p;var A=t&&t===this.ownerID,x=f?p?d:d^c:d|c,S=f?p?Je(m,g,p,A):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)&n,o=this.nodes[r];return o?o.get(t+5,e,i,s):s},Be.prototype.update=function(t,e,i,s,r,h,a){void 0===i&&(i=ft(s));var l=(0===e?i:i>>>e)&n,u=r===o,c=this.nodes,d=c[l];if(u&&!d)return this;var f=$e(d,t,e+5,i,s,r,h,a);if(f===d)return this;var g=this.count;if(d){if(!f&&--g>>i)&n,a=(0===i?s:s>>>i)&n,l=h===a?[qe(t,e,i+5,s,r)]:(o=new Ge(e,s,r),h>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function Je(t,e,i,s){var r=s?t:Zt(t);return r[e]=i,r}var Qe=8,ti=16,ei=8,ii="@@__IMMUTABLE_LIST__@@";function si(t){return Boolean(t&&t[ii])}var ri=function(t){function e(e){var i=ci();if(null==e)return i;if(si(e))return e;var s=t(e),n=s.size;return 0===n?i:(Kt(n),n>0&&n=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?mi(t,e).set(0,i):mi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=yi(t._capacity)?s=di(s,t.__ownerID,0,e,i,n):r=di(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):ui(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=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ci()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){mi(i,0,e+t.length);for(var s=0;s>>e&n;if(s>=this.array.length)return new oi([],t);var r,o=0===s;if(e>0){var h=this.array[s];if((r=h&&h.removeBefore(t,e-5,i))===h&&o)return this}if(o&&!r)return this;var a=fi(this,t);if(!o)for(var l=0;l>>e&n;if(r>=this.array.length)return this;if(e>0){var o=this.array[r];if((s=o&&o.removeAfter(t,e-5,i))===o&&r===this.array.length-1)return this}var h=fi(this,t);return h.array.splice(r+1),s&&(h.array[r]=s),h};var hi,ai={};function li(t,e){var i=t._origin,s=t._capacity,n=yi(s),o=t._tail;return function t(h,a,l){return 0===a?function(t,h){var a=h===n?o&&o.array:t&&t.array,l=h>i?0:i-h,u=s-h;return u>r&&(u=r),function(){if(l===u)return ai;var t=e?--u:l++;return a&&a[t]}}(h,l):function(n,o,h){var a,l=n&&n.array,u=h>i?0:i-h>>o,c=1+(s-h>>o);return c>r&&(c=r),function(){for(;;){if(a){var i=a();if(i!==ai)return i;a=null}if(u===c)return ai;var s=e?--c:u++;a=t(l&&l[s],o-5,h+(s<>>i&n,u=t&&l0){var c=t&&t.array[l],d=di(c,e,i-5,s,r,o);return d===c?t:((a=fi(t,e)).array[l]=d,a)}return u&&t.array[l]===r?t:(o&&h(o),a=fi(t,e),void 0===r&&l===a.array.length-1?a.array.pop():a.array[l]=r,a)}function fi(t,e){return e&&t&&e===t.ownerID?t:new oi(t?t.array.slice():[],e)}function gi(t,e){if(e>=yi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&n],s-=5;return i}}function mi(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new a,r=t._origin,o=t._capacity,h=r+e,l=void 0===i?o:i<0?o+i:r+i;if(h===r&&l===o)return t;if(h>=l)return t.clear();for(var u=t._level,c=t._root,d=0;h+d<0;)c=new oi(c&&c.array.length?[void 0,c]:[],s),d+=1<<(u+=5);d&&(h+=d,r+=d,l+=d,o+=d);for(var f=yi(o),g=yi(l);g>=1<f?new oi([],s):m;if(m&&g>f&&h5;A-=5){var x=f>>>A&n;p=p.array[x]=fi(p.array[x],s)}p.array[f>>>5&n]=m}if(l=g)h-=g,l-=g,u=5,c=null,y=y&&y.removeBefore(s,0,h);else if(h>r||g>>u&n;if(S!==g>>>u&n)break;S&&(d+=(1<r&&(c=c.removeBefore(s,u,h-d)),c&&g>>5<<5}var pi,Ai=function(t){function e(t){return null==t?Si():ht(t)?t:Si().withMutations((function(e){var i=T(t);Kt(i.size),i.forEach((function(t,i){return e.set(i,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("OrderedMap {","}")},e.prototype.get=function(t,e){var i=this._map.get(t);return void 0!==i?this._list.get(i)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Si()},e.prototype.set=function(t,e){return vi(this,t,e)},e.prototype.remove=function(t){return vi(this,t,o)},e.prototype.__iterate=function(t,e){var i=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],i)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),i=this._list.__ensureOwner(t);return t?xi(e,i,t,this.__hash):0===this.size?Si():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=i,this)},e}(Pe);function xi(t,e,i,s){var r=Object.create(Ai.prototype);return r.size=t?t.size:0,r._map=t,r._list=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Si(){return pi||(pi=xi(We(),ci()))}function vi(t,e,i){var s,n,h=t._map,a=t._list,l=h.get(e),u=void 0!==l;if(i===o){if(!u)return t;a.size>=r&&a.size>=2*h.size?(s=(n=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=n.__ownerID=t.__ownerID)):(s=h.remove(e),n=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=h,n=a.set(l,[e,i])}else s=h.set(e,a.size),n=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=n,t.__hash=void 0,t.__altered=!0,t):xi(s,n)}Ai.isOrderedMap=ht,Ai.prototype[D]=!0,Ai.prototype[s]=Ai.prototype.remove;var bi="@@__IMMUTABLE_STACK__@@";function Mi(t){return Boolean(t&&t[bi])}var Ci=function(t){function e(t){return null==t?ki():Mi(t)?t:ki().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=u(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):Ei(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Mi(e))return e;Kt(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):Ei(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):ki()},e.prototype.slice=function(e,i){if(d(e,i,this.size))return this;var s=f(e,this.size);if(g(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):Ei(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ei(this.size,this._head,t,this.__hash):0===this.size?ki():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new K(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 K(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new B((function(){if(s){var e=s.value;return s=s.next,V(t,i++,e)}return{value:void 0,done:!0}}))},e}(w);Ci.isStack=Mi;var Ti,wi=Ci.prototype;function Ei(t,e,i,s){var r=Object.create(wi);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function ki(){return Ti||(Ti=Ei(0))}wi[bi]=!0,wi.shift=wi.pop,wi.unshift=wi.push,wi.unshiftAll=wi.pushAll,wi.withMutations=ze,wi.wasAltered=De,wi.asImmutable=Re,wi["@@transducer/init"]=wi.asMutable=Fe,wi["@@transducer/step"]=function(t,e){return t.unshift(e)},wi["@@transducer/result"]=function(t){return t.asImmutable()};var Ii="@@__IMMUTABLE_SET__@@";function zi(t){return Boolean(t&&t[Ii])}function Fi(t){return zi(t)&&P(t)}function Ri(t,e){if(t===e)return!0;if(!A(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||S(t)!==S(e)||b(t)!==b(e)||P(t)!==P(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!M(t);if(P(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&<(r[1],t)&&(i||lt(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 h=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!lt(e,t.get(s,o)):!lt(t.get(s,o),e))return h=!1,!1}));return h&&t.size===a}function Di(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 Pi(t){if(!t||"object"!=typeof t)return t;if(!A(t)){if(!ee(t))return t;t=j(t)}if(S(t)){var e={};return t.__iterate((function(t,i){e[i]=Pi(t)})),e}var i=[];return t.__iterate((function(t){i.push(Pi(t))})),i}var Oi=function(t){function e(e){return null==e?Gi():zi(e)&&!P(e)?e:Gi().withMutations((function(i){var s=t(e);Kt(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(T(t).keySeq())},e.intersect=function(t){return(t=C(t).toArray()).length?_i.intersect.apply(e(t.pop()),t):Gi()},e.union=function(t){return(t=C(t).toArray()).length?_i.union.apply(e(t.pop()),t):Gi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Bi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Bi(this,this._map.remove(t))},e.prototype.clear=function(){return Bi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Bi(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=ut(e<<13|e>>>-13,5),e=ut((e=e+3864292196^t)^e>>>16,2246822507),e=ct((e=ut(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+rs(ft(t),ft(e))|0}:function(t,e){s=s+rs(ft(t),ft(e))|0}:e?function(t){s=31*s+ft(t)|0}:function(t){s=s+ft(t)|0}),s)}(this))}});var ji=C.prototype;ji[p]=!0,ji[_]=ji.values,ji.toJSON=ji.toArray,ji.__toStringMapper=ie,ji.inspect=ji.toSource=function(){return this.toString()},ji.chain=ji.flatMap,ji.contains=ji.includes,Di(T,{flip:function(){return Yt(this,Rt(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 $i=T.prototype;$i[x]=!0,$i[_]=ji.entries,$i.toJSON=Wi,$i.__toStringMapper=function(t,e){return ie(e)+": "+ie(t)},Di(w,{toKeyedSeq:function(){return new kt(this,!1)},filter:function(t,e){return Yt(this,Ot(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,Pt(this,!1))},slice:function(t,e){return Yt(this,Lt(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=f(t,t<0?this.count():this.size);var s=this.slice(0,t);return Yt(this,1===i?s:s.concat(Zt(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,Bt(this,t,!1))},get:function(t,e){return(t=u(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=u(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function rs(t,e){return t^e+2654435769+(t<<6)+(t>>2)}qi.has=ji.includes,qi.contains=qi.includes,qi.keys=qi.values,Di($,$i),Di(Z,Zi),Di(q,qi);var ns=function(t){function e(t){return null==t?ls():Fi(t)?t:ls().withMutations((function(e){var i=E(t);Kt(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(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Oi);ns.isOrderedSet=Fi;var os,hs=ns.prototype;function as(t,e){var i=Object.create(hs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function ls(){return os||(os=as(Si()))}hs[D]=!0,hs.zip=Zi.zip,hs.zipWith=Zi.zipWith,hs.zipAll=Zi.zipAll,hs.__empty=ls,hs.__make=as;var us={LeftThenRight:-1,RightThenLeft:1},cs=function(t,e){var i;!function(t){if(F(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(R(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 Ss(t,e,i,s,r,n){if("string"!=typeof i&&!R(i)&&(W(i)||N(i)||te(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,j(i).map((function(s,n){return Ss(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function vs(t,e){return b(e)?e.toList():S(e)?e.toMap():e.toSet()}var bs="4.3.7",Ms=C;const Cs={version:bs,Collection:C,Iterable:C,Seq:j,Map:Pe,OrderedMap:Ai,List:ri,Stack:Ci,Set:Oi,OrderedSet:ns,PairSorting:us,Record:cs,Range:Ui,Repeat:As,is:lt,fromJS:xs,hash:ft,isImmutable:R,isCollection:A,isKeyed:S,isIndexed:b,isAssociative:M,isOrdered:P,isValueObject:at,isPlainObject:te,isSeq:I,isList:si,isMap:ot,isOrderedMap:ht,isStack:Mi,isSet:zi,isOrderedSet:Fi,isRecord:F,get:re,getIn:Yi,has:se,hasIn:Xi,merge:Se,mergeDeep:be,mergeWith:ve,mergeDeepWith:Me,remove:oe,removeIn:de,set:he,setIn:ue,update:ge,updateIn:ae}},377:(t,e,i)=>{Object.defineProperty(e,"o",{value:!0});var s=i(568),r=i(243),n=i(570),o=function(t){if(t&&t.o)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.u=!0}S(){return this.u}}class l extends a{constructor(t,e){super(),this.M=t,this.u=e}_(t){return t!==this.M&&(this.M=t,this.u=!0),this}C(){return this.M}S(){return super.S()}}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]},m=(t,e)=>({min:t,max:e}),y=(t,e,i,s)=>({x:t,y:e,width:i,height:s}),p=(t,e=!0)=>new l(t,e),A=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=A,S=(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}),v=s.Record({type:"color",r:1,g:1,b:1,a:1});class b extends v{constructor(t){super(t)}toUint32(){return void 0!==this.T||(this.T=z(this.getR(),this.getG(),this.getB(),this.getA())),this.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.F||(this.F=new b({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.F}getLighter(){return this.I||(this.I=new b({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.I}getDarker(){return this.P||(this.P=new b({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.P}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const M=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),C=(t,e,i,s=255)=>new b({r:t/255,g:e/255,b:i/255,a:s/255}),T=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new b({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 b({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 b({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 b({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 b({r:s,g:r,b:n})},E={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"},k=new b({}),I=C(0,0,0,0),z=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,F=(t,e)=>t.value-e.value,R=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:C(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),D=t=>{const{steps:e}=t,i=e.length;e.sort(F);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 P extends R{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,D(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(D({...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")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}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 b({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 O=s.Record({type:"fillstyle",fillType:"empty"});class L extends O{toString(){return"emptyFill"}}const _=new L,B=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),V=s.Record({type:"fillstyle",fillType:"solid",color:C(255,255,255)});class G extends V{}class N extends G{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return M(t)?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))}}const U=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class Y extends G{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),X=s.Record({type:"fillstyle",fillType:"palette",lut:new P({steps:[]}),lookUpProperty:"value"});class W extends X{constructor(t){super({...t,fillType:"palette"})}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 j=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),$={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=le(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.L)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.V=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.R.emit("start")}start(){return this.V.includes(this)||this.V.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 Z(t,e,i,s,this.V);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.R.on("start",t,e)}onAnimationEnd(t,e){return this.R.on("end",t,e)}onEveryAnimationEnd(t,e){return this.R.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.R.on("allEnd",t,e)}allOffAnimationEnd(){return this.R.topicOff("end"),this}allOffEveryAnimationEnd(){return this.R.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.R.topicOff("allEnd"),this}offAnimationEnd(t){return this.R.off(t,"end")}offEveryAnimationEnd(t){return this.R.off(t,"everyEnd")}offAllAnimationEnd(t){return this.R.off(t,"allEnd")}finish(t=!0){if(this.L=!0,this.V.splice(this.V.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.R.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.R.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.R.emit("end",e),this.R.emit("everyEnd",e)),e}t&&(this.R.emit("end",void 0),this.R.emit("everyEnd",void 0),this.R.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(Dt):this.values.map(Dt)}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=zt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=$.linear)=>(r,n,h=t)=>{const a=new Z(r,n,h,e,i).start();return s||(s=zt.requestAnimationFrame(o)),a}};var K;e.ImageFitMode=void 0,(K=e.ImageFitMode||(e.ImageFitMode={}))[K.Fill=0]="Fill",K[K.Fit=1]="Fit",K[K.Stretch=2]="Stretch",K[K.Center=3]="Center",K[K.Tile=4]="Tile";const J=s.Record({type:"fillstyle",fillType:"image",source:void 0,surroundingColor:C(0,0,0,0),sourceMissingColor:C(0,0,0,0),fitMode:e.ImageFitMode.Fill});class Q extends J{constructor(t){super(t)}setSource(t){return this.set("source",t)}getSource(){return this.get("source")}setSurroundingColor(t){return M(t)?this.set("surroundingColor",t):this.set("surroundingColor",t(this.get("surroundingColor")))}getSurroundingColor(){return this.get("surroundingColor")}setSourceMissingColor(t){return M(t)?this.set("sourceMissingColor",t):this.set("sourceMissingColor",t(this.get("sourceMissingColor")))}getSourceMissingColor(){return this.get("sourceMissingColor")}setFitMode(t){return this.set("fitMode",t)}getFitMode(){return this.get("fitMode")}toString(){return`imagefill:${this.fitMode}`}}const tt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType);var et,it;e.GradientShape=void 0,(et=e.GradientShape||(e.GradientShape={})).circle="circle",et.ellipse="ellipse",e.GradientExtent=void 0,(it=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",it.closestCorner="closest-corner",it.farthestSide="farthest-side",it.farthestCorner="farthest-corner";const st=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class rt extends st{constructor(t){if(super(t),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 nt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),ot=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],angle:0});class ht extends ot{constructor(t){if(super(t),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?function(t){return 180*t/Math.PI}(t):t)}getAngle(t){return t?Ci(this.get("angle")):this.get("angle")}}const at=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),lt=s.Record({type:"linestyle",lineType:"empty"}),ut=new class extends lt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}N(){return 0}setFillStyle(t){return this}getFillStyle(){return _}},ct=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class dt{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new ft,this.y=new ft,this.z=new ft,this.R=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Je,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(Je,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.W(e),s.y.W(r)}}}Y(){return this.U&&(this.U(),this.U=void 0),this}H(t){return this.R.on("cell-resize",t)}$(t){return this.R.off(t,"cell-resize")}}class ft extends a{constructor(){super(...arguments),this.X=0,this.j=10,this.Z=1}J(){return this.u=!1,this}K(){return this.u=!0,this}getInnerStart(){return this.X}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}q(t,e){return this.X=t,this.j=e,this.tt(),this}it(t){return this.Z=t,this.tt(),this}st(t){return t/this.Z}tt(){const t=this.st(this.j-this.X),e=this.Z;void 0!==this.et&&!1!==Lt(t,this.et)||(this.u=!0,this.ht=e,this.et=t)}rt(){return this.et}nt(){return this.ht}ot(){return this.jnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ct({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new dt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},mt=(t,e,i)=>e===i?t:i.dt(e.ft(t)),yt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Ui?e.x:e.x instanceof Ui?e.x.x:e.x.At,r=e instanceof Ui?e.y:e.y instanceof Ui?e.y.y:e.y.At,n=i instanceof Ui?i.x:i.x instanceof Ui?i.x.x:i.x.At,o=i instanceof Ui?i.y:i.y instanceof Ui?i.y.y:i.y.At;return{...t,x:mt(t.x,s,n),y:mt(t.y,r,o)}},pt=(...t)=>{if(0===t.length)return{remove:Ot};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.yt(s,r,!1,i.getStopped(),"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])}))}}},At=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,xt=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,St=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,vt=t=>t&&"object"==typeof t&&"index"in t;class bt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,bt.prototype)}}class Mt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&zt.alert(s),Object.setPrototypeOf(this,Mt.prototype)}}class Ct extends Mt{constructor(t){super(t),Object.setPrototypeOf(this,Ct.prototype)}}var Tt,wt,Et,kt;e.UISpace=void 0,(Tt=e.UISpace||(e.UISpace={}))[Tt.Content=0]="Content",Tt[Tt.PaddedContent=1]="PaddedContent",Tt[Tt.PaddedBackground=2]="PaddedBackground",Tt[Tt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(wt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[wt.never=0]="never",wt[wt.always=1]="always",wt[wt.whenHovered=2]="whenHovered",wt[wt.whenDragged=3]="whenDragged",wt[wt.whenNotDragged=4]="whenNotDragged",wt[wt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(Et=e.UIDraggingModes||(e.UIDraggingModes={}))[Et.notDraggable=0]="notDraggable",Et[Et.draggable=1]="draggable",Et[Et.onlyHorizontal=2]="onlyHorizontal",Et[Et.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(kt=e.UIDirections||(e.UIDirections={}))[kt.Up=0]="Up",kt[kt.Right=1]="Right",kt[kt.Down=2]="Down",kt[kt.Left=3]="Left";const It=t=>{if(t.resourcesBaseUrl){const e=t.styleFactory(t.resourcesBaseUrl),i=tt(e)&&e.getSource(),s=i&&i instanceof Image?i:void 0;return null==s||s.addEventListener("error",(()=>{De(t.resourcesBaseUrl,s.src,"Theme resource",{shouldCrash:!1})})),e}const e=`${zt.location.origin}/resources`,i=t.styleFactory(e);if(tt(i)){const e=i.getSource();e instanceof Image&&e.addEventListener("error",(()=>{const i=t.styleFactory("https://lcjs-resources.lightningchart.com/v1"),s=tt(i)&&i.getSource(),r=s&&s instanceof Image?s:void 0;zt.console.warn("LightningChart JS warning | fallbacking to publicly hosted asset resources.\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/warning-using-publicly-hosted-resources/"),null==r||r.addEventListener("load",(()=>{t.apply(i)})),null==r||r.addEventListener("error",(()=>{De(t.resourcesBaseUrl,e.src,"Theme resource",{shouldCrash:!1})}))}))}return i},zt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Ft=(t,e)=>t.x===e.x&&t.y===e.y,Rt=t=>t!==Ye&&t!==He&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Dt=t=>t[1],Pt=t=>t.dispose(),Ot=()=>{},Lt=(t,e)=>t===e,_t=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Bt=t=>Array.prototype.concat.apply([],t),Vt=(t,e)=>void 0===t||Number.isNaN(t)?e:t,Gt=t=>t.vt(),Nt=t=>t.St(),Ut=t=>t.xt(),Yt=t=>t.bt(),Ht=t=>t.min.x,Xt=t=>t.max.x,Wt=t=>t.min.y,jt=t=>t.max.y,$t=(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,qt=u(0,1),Kt=u(1,0),Jt=u(0,-1),Qt=u(-1,0),te=u(0,0),ee=t=>{switch(t){case e.UIDirections.Up:return qt;case e.UIDirections.Right:return Kt;case e.UIDirections.Down:return Jt;case e.UIDirections.Left:return Qt;default:return te}},ie=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,se=t=>{t.stopPropagation(),t.preventDefault()},re=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let r=0;for(let e=0;e{if(!e){const e=t.length,s=new i(2*e);let r=0;for(let i=0;i{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)},ae=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ue=le(Math.E),ce=(t,e)=>{const i=e[t];return i?i():void 0},de=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iTi(pi(t,i))-Ti(pi(e,i))))},fe=(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:C(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())),me=t=>255===t.getA()?t:t.setA(255),ye=(()=>{const t=C(0,0,0);return i=>(i=me(i),new rt({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ge(i,t,.5)}]}))})(),pe=(()=>{const t=t=>{var e;if(t){if(U(t)){if(0===t.getColor().getA())return;return t.getColor()}if(nt(t)||at(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}j(t)}};return(e,i,s,r)=>{var n;const o=[];if(r.fill&&o.push(r.fill),r.fill2&&o.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==_&&("stroke"===(null===(n=r.behavior)||void 0===n?void 0:n.priority)?o.unshift(t):o.push(t))}if(r.point3D){const t=r.point3D;o.push(t.getFillStyle())}let h;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=o.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]);h=e&&s?(a=e)===(l=s)||a.getR()===l.getR()&&a.getG()===l.getG()&&a.getB()===l.getB()?ye(a):(a=me(a),l=me(l),new ht({angle:0,stops:[{offset:0,color:l},{offset:.5,color:l},{offset:.5,color:a},{offset:1,color:a}]})):i.uiButtonFillStyle}else{const e=o.reduce(((e,i)=>e||t(i)),void 0);h=e?s?new N({color:e}):ye(e):i.uiButtonFillStyle}var a,l;e.setButtonOnFillStyle(h)}})(),Ae=t=>{const e=t;if(j(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},xe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},Se=(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,be=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),Me=(t,e)=>e(),Ce=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new N({color:C(255,255,255,1)});const Te=t=>t===Xe||t.min.x===Xe.min.x&&t.max.x===Xe.max.x&&t.min.y===Xe.min.y&&t.max.y===Xe.max.y,we=t=>Array.from(new Set(t)),Ee=t=>t.filter((t=>void 0!==t)),ke=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Ie=(t,e,i)=>{e.length<=0||(t.setText(i.label).setOn(e[0].getVisible()),i.style&&t.setButtonOnFillStyle(i.style),i.toggleVisibilityOnClick&&t.onSwitch(((t,i)=>e.forEach((t=>t.setVisible(i))))),t.onMouseEnter((()=>e.forEach((t=>t.setHighlight(!0))))),t.onMouseLeave((()=>e.forEach((t=>t.setHighlight(!1))))),e.forEach((e=>e.onMouseEnter((()=>t.setHighlight(!0))))),e.forEach((e=>e.onMouseLeave((()=>t.setHighlight(!1))))),e.forEach((e=>e.onTouchStart((()=>t.setHighlight(!0))))),e.forEach((e=>e.onTouchEnd((()=>t.setHighlight(!1))))))},ze=(t,e)=>{throw new Error(e)},Fe=t=>{let e;return()=>e||(e=t(),e)},Re=t=>{if(t===ut)return 0;const e=t.getThickness();return e<0?1:1*e},De=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(s.shouldCrash)throw zt.alert(r),new Error(r);zt.console.warn(r)},Pe=(t,e,i,s=0)=>{if(t{const t=new Map;return{Mt:e=>(e.setMouseEnterEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n._t(e,i,s,r)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.wt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ct(e,i,s,r)})),e.setMouseDoubleClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.kt(e,i,s,r)})),e.setMouseDownEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Tt(e,i,s,r)})),e.setMouseUpEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ft(e,i,s,r)})),e.setMouseMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.It(e,i,s,r)})),e.setMouseDragEventHandler(((e,i,s,r,n,o,h)=>{const a=o&&t.get(o);a&&a.Pt(e,i,s,r,n,o,h)})),e.setMouseDragStartEventHandler(((e,i,s,r,n)=>{const o=r&&t.get(r);o&&o.Dt(e,i,s,r,n)})),e.setMouseDragStopEventHandler(((e,i,s,r,n,o)=>{const h=n&&t.get(n);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseWheelEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Lt(e,i,s,r)})),e.setTouchStartEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Rt(e,i,s,r)})),e.setTouchMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Et(e,i,s,r)})),e.setTouchEndEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.zt(e,i,s,r)})),e),Vt:(e,i)=>{t.set(e,i)},Ot:()=>{t.clear()}}},Le={left:0,right:0,top:0,bottom:0},_e=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),Be=(t,e,i)=>{e&&e.Nt();const s=i();return{Gt:t,Nt:()=>{s.forEach((e=>t.Ut(e)))}}},Ve=(t,e,i)=>{let s;const r=()=>(s=i(),s),n={...t,resolve:()=>s||r()};for(const t of Object.keys(e))Object.defineProperty(n,t,{get:function(){return s?s[t]:r()[t]}});return n},Ge=t=>{if(t)return"resolve"in t?t.resolve():t},Ne=t=>{let e=t;return{Wt:t=>{const i=e;return e=i+t,[i,t]}}},Ue={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=>Ue.divide(t,Ue.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(Ue.dot(t,e)/(Ue.length(t)*Ue.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ue.dot(e,t),o=Ue.cross(e,t);return Ue.addVec(Ue.multiply(t,s),Ue.addVec(Ue.multiply(e,(1-s)*n),Ue.multiply(o,r)))},lerp:(t,e,i)=>(i=_t(i,0,1),Ue.addVec(Ue.multiply(t,1-i),Ue.multiply(e,i))),equals:(t,e)=>Lt(t.x,e.x)&&Lt(t.y,e.y)&&Lt(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)})},Ye=Number.MAX_SAFE_INTEGER,He=-Number.MAX_SAFE_INTEGER,Xe=m(u(Ye,Ye),u(He,He)),We=m(f(Ye,Ye,Ye),f(He,He,He)),je=(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))},$e=(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),qe=(t,e)=>({min:{x:Math.min(t[0].x,e[0].x),y:Math.min(t[0].y,e[0].y)},max:{x:Math.max(t[2].x,e[2].x),y:Math.max(t[2].y,e[2].y)}}),Ke=t=>{const e=t.length;for(let i=0;ie+t,Qe=(t,e,i)=>{const s=pi(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=pi(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)},ti=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,ei=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},ii=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},si=(t,e,i)=>yi(t,mi(pi(e,t),i)),ri=(t,e,i)=>Ue.addVec(t,Ue.multiply(Ue.subtractVec(e,t),i));function ni(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:Ye,y:Ye},max:{x:He,y:He}};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},ai=(t,e)=>m(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 li(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}function ui(t,e,i){return u(Math.cos(i)*(t.x-e.x)+Math.sin(i)*(t.y-e.y)+e.x,-Math.sin(i)*(t.x-e.x)+Math.cos(i)*(t.y-e.y)+e.y)}function ci(t,e){return u(t.x-e.x,t.y-e.y)}function di(t){const e=gi(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function fi(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=di(i);const s=Math.PI/2,r=i.x;return i.x=-Math.sin(s)*i.y,i.y=r*Math.sin(s),i}function gi(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function mi(t,e){return u(t.x*e,t.y*e)}function yi(t,e){return u(t.x+e.x,t.y+e.y)}function pi(t,e){return u(t.x-e.x,t.y-e.y)}function Ai(t,e){return u(t.x*e.x,t.y*e.y)}function xi(t,e){return u(t.x/e.x,t.y/e.y)}function Si(t){return mi(t,-1)}function vi(t,e){return t.x*e.x+t.y*e.y}const bi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},Mi=(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 Ci(t){return t*Math.PI/180}function Ti(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function wi(t){return u(Math.cos(t),Math.sin(t))}const Ei=(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)},ki=(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 Ii{constructor(){this.Yt=!0}getInnerStart(){return this.X}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.j-this.X)}q(t,e){return this.Yt=t!==this.X||e!==this.j,this.X=t,this.j=e,this}J(){return this.Yt=!1,this}K(){return this.Yt=!0,this}}class zi extends Ii{constructor(t,e,i,s){if(super(),this.Ht=!0,this.$t=!0,this.Xt=[0,0],this.jt=!0,this.Zt=t,this.Qt=e,this.Jt=i,this.Kt=t,this.qt=e,s){const t=s.G(this.ti.bind(this));this.ti(s.C()),this.ii=()=>s.W(t)}}it(t){return this.Z=t,this.$t=!0,this}si(t){return this.Xt=t.map(Math.abs),this.jt=!0,this}ei(){return this.Zt/this.Jt*this.Z+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.Z-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.Z}getCellSize(){return this.ai(this.Z)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(Je,0),this.Zt=t.reduce(((t,e,i)=>i>=this.Kt?t:t+e),0),this.Qt=t.reduce(((t,e,i)=>i>=this.Kt&&iOi;return!n&&!o||!!r&&(e>t?{start:n?Pi:t,end:o?Oi:e}:{start:o?Oi:t,end:n?Pi:e})}ft(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Pi);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}dt(t){const e=this.ei(),i=(t-e)/(this.hi()-e),s=this.di.scaleStartLog+i*this.di.scaleIntervalLog;return this.ci.number**s}ui(){this.ci&&this.fi()}q(t,e){return super.q(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}it(t){return super.it(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:Ri(t),number:Di(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ft(t)+e;return this.dt(i)}yi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.X),e=this.ci.function(this.j)-t,i=2*this.ei()/this.Z-1,s=2*this.hi()/this.Z-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}mi(){return this.di}}const Ri=t=>"e"===t?ue:le(t),Di=t=>"e"===t?Math.E:t,Pi=.9*10**-20,Oi=1.1*10**25,Li=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],_i=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-je(s,10),0);return t.toFixed(r)},Bi={Numeric:(t,e)=>_i(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let r="",n="";if(i>=1e3&&t>1e3){let e="";for(const i of Li){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),n=i.prefix;break}}r=(s?"-":"")+e}else{let e=String(Math.floor(t));const n=je(t,1e3);for(let t=1;t<=n;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}r=(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-je(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ri(s)(t);return`${s}${Vi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ri(s),n=Math.floor(r(t)),o=t/Di(s)**n;return`${Math.round(o)}×${s}${Vi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ri(s),n=Math.floor(r(t));return`${(t/Di(s)**n).toFixed(2)}×${s}${Vi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ri(s);if("e"===s)return`${Math.floor(r(t))}e`;const n=t.toString();if(t>1)return n;const o=Math.floor(r(t));return t.toFixed(Math.abs(o))},Scientific:(t,e)=>{const i=Math.max(Math.abs(e.getInnerStart()),Math.abs(e.getInnerEnd())),s=Math.floor(Math.log10(i));return 0===t?`0.00e${s<0?"":"+"}${s}`:t.toExponential(2)}},Vi=t=>Math.round(t).toString().split("").map((t=>{switch(t){case"0":return"⁰";case"1":return"¹";case"2":return"²";case"3":return"³";case"4":return"⁴";case"5":return"⁵";case"6":return"⁶";case"7":return"⁷";case"8":return"⁸";case"9":return"⁹";case"-":return"⁻";default:return t}})).join("");class Gi extends zi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.Si=!1,this.xi=0,this.Z=1e3,this.q(0,10),this.tt()}yi(){return this.Si}ut(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.vi){const i=((t,e,i)=>{const s=((t,e)=>{if(eHe&&tHe){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}}ui(){this.tt()}ft(t){return this.ei()+(t-this.X)/(this.j-this.X)*(this.hi()-this.ei())}dt(t){return this.X+(t-this.ei())/(this.hi()-this.ei())*(this.j-this.X)}q(t,e){return super.q(t,e),this.tt(),this}si(t){return super.si(t),this.tt(),this}it(t){return super.it(t),this.bi=Ni(this.j-this.X,this.Xt,this.Z,this.Qt,this.Jt),this.tt(),this}Mi(){return this.vi=!0,this}_i(){return this.vi}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}mi(){return this.di}K(){return super.K(),this.Si=!0,this}J(){return super.J(),this.Si=!1,this}Di(t,e=Bi.Numeric){return e(t,this)}Bi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Li(t){return Ni(t,this.Xt,this.Z,this.Qt,this.Jt)}tt(){let t=this.X,e=this.j,i=0;this.vi&&(t=0,e=this.j-this.X,i=this.X);const s=e-t,r=Ni(s,this.Xt,this.Z,this.Qt,this.Jt);this.Pi=t-this.Xt[0]*r,this.Fi=e+this.Xt[1]*r;const n=this.Fi-this.Pi,o=n-this.Ci,h=Math.abs(o/r),a=s-this.xi,l=Math.abs(a/r);(!this.di||h>=.4||l>=.4)&&(this.xi=s,this.Ci=n,this.bi=r,this.Si=!0);const u=this.Ci*this.Jt/(2*this.Qt),c=-(this.Pi-this.Ci*this.Zt/this.Qt)-u,d=2*this.ei()/this.Z-1,f=2*this.hi()/this.Z-1-d;this.di={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}pi(t,e){return t+this.bi*e}}const Ni=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Ui{Ri(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}J(){return this.x.J(),this.y.J(),this}K(){return this.x.K(),this.y.K(),this}it(t,e){return"object"==typeof t?(this.x.it(t.x),this.y.it(t.y)):(this.x.it(t),this.y.it(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}zi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}Vi(t,e){return this.x.q(t,e),this}Oi(t,e){return this.y.q(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.ni(),y:e-this.y.ni()}}Ni(){return this.x.yi()||this.y.yi()}}class Yi extends Ui{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ct(t,e,i,s){return this.x=new Gi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Gi(t.y,e.y,i.y,s?s.y:void 0),this}_i(){return this.x._i()||this.y._i()}Ui(){return u(this.x.getPixelSize(),this.y.getPixelSize())}mi(){return{x:this.x.mi(),y:this.y.mi()}}pi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Wi(t,e,i,s){const r=this.Ui(),n=fi(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 Hi extends Ui{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ft(t.x),s=this.y.ft(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.dt(r.x),y:this.y.dt(r.y)}}Wi(t,e,i,s){const r={x:this.x.ft(t.x),y:this.y.ft(t.y)},n={x:this.x.ft(e.x),y:this.y.ft(e.y)},o=di(pi(n,r)),h=fi(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.dt(a.x),y:this.y.dt(a.y)}}mi(){const t=this.x.mi(),e=this.y.mi();return{uScaleStart:[this.x.X,this.y.X],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 Xi=(t,e)=>t instanceof Fi||e instanceof Fi?(new Hi).Ri(t,e):(new Yi).Ri(t,e),Wi=t=>"client"===t,ji=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),$i=t=>"relative"===t,Zi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y),qi=(t,e,i)=>{if(t){const t={x:i.x.ei(),y:i.y.ei(),width:i.x.ri(),height:i.y.ri()};e.forEach((e=>{e.Yi=t}))}else e.forEach((t=>{t.Yi=void 0}))},Ki=(t,e)=>{var i;return e?"string"==typeof e?`${t} ${e}`:!1!==(null===(i=e.Hi)||void 0===i?void 0:i.displayInCursor)&&e.getUnits()?`${t} ${e.getUnits()}`:t:t},Ji=t=>{let e=!1,i={type:"linear"};if(t&&(void 0!==t.opposite&&(e=t.opposite),t.type&&"linear-highPrecision"===t.type&&(i={type:"linear-highPrecision"}),t.type&&"logarithmic"===t.type)){let s=10;if(t.base)if("E"===t.base||"e"===t.base||"natural"===t.base)s="e";else if("number"==typeof t.base)s=t.base;else if("string"==typeof t.base)try{s=Number(t.base)}catch(e){console.warn(`Unidentified logarithmic base "${t.base}"`)}i={base:s,type:"logarithmic"}}return{opposite:e,type:i}},Qi=(t,e,i,s=1)=>_t(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),ts=(t,e,i,s=1)=>{const r=i.ft(t),n=i.ft(e);return _t(i.dt(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};var es;e.HighlightModes=void 0,(es=e.HighlightModes||(e.HighlightModes={}))[es.noHighlighting=0]="noHighlighting",es[es.onHover=1]="onHover";class is{constructor(t,i,s,n){this.$i=!0,this.Xi=e.HighlightModes.onHover,this.ji=!1,this.Zi=!0,this.R=new r.Eventer,this.Qi=[],this.Ji=[],this.onMouseEnter=t=>this.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this._t=(t,i,s,r)=>{const n=this.Ki(r,i);this.R.emit("mouseEnter",this,i,n),this.Xi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.wt=(t,i,s)=>{this.R.emit("mouseLeave",this,i,void 0),this.Xi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.It=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseMove",this,e,r)},this.Ct=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseClick",this,e,r)},this.kt=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseDoubleClick",this,e,r)},this.Tt=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseDown",this,e,r)},this.Ft=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseUp",this,e,r)},this.Dt=(t,e,i,s,r)=>{const n=this.Ki(r,e);this.R.emit("mouseDragStart",this,e,i,n)},this.Pt=(t,e,i,s,r,n,o)=>{const h=this.Ki(o,e);this.R.emit("mouseDrag",this,e,i,s,r,h)},this.Bt=(t,e,i,s,r,n)=>{const o=this.Ki(n,e);this.R.emit("mouseDragStop",this,e,i,s,o)},this.Lt=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("mouseWheel",this,e,r)},this.Rt=(t,i,s,r)=>{const n=this.Ki(r,i);this.R.emit("touchStart",this,i,n),this.Xi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Et=(t,e,i,s)=>{const r=this.Ki(s,e);this.R.emit("touchMove",this,e,r)},this.zt=(t,i,s,r)=>{const n=this.Ki(r,i);this.R.emit("touchEnd",this,i,n),this.Xi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.chart=t,this.qi=i,this.ts=s,this.ss=new Map,this.es=n,this.hs=this.es.rs(this,{ns:{themeEffectEnabled:this.ts.effectsText},os:{}}),this.chart.cs.us.ls(this,(t=>{this.ss.forEach(((e,i)=>i.ds(t))),this.Ji.forEach((e=>e.setHighlight(t))),this.Qi.forEach((e=>e.ds(t)))}),{animationEnabled:this.chart.getAnimationsEnabled()})}fs(){}As(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.ss.set(t,{isText:s});const r=Array.from(this.ss);this.hs.ns.gs(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.hs.os.gs(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.$i).setVisible(this.Zi).ds(this.chart.cs.us.ps(this,!0)),i&&t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragStartEventHandler(this.Dt).setMouseDragEventHandler(this.Pt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt);const n=t.onDispose((()=>{t.offDispose(n),this.ss.delete(t)}))}ys(t){this.Qi=t;const e=this.chart.cs.us.ps(this,!0);t.forEach((t=>{t.ds(e).vs(this.Zi)}))}Ki(t,e){}Ss(t){const e=this.chart.cs.xs(t);if(e&&Array.from(this.ss.keys()).includes(e.entity))return this.Ki(e.info,t)}setEffect(t){return this.hs.ns.bs(t&&this.ts.effectsText),this.hs.os.bs(t),this.chart.cs.Ms(),this}getEffect(){return this.hs.ns._s()||this.hs.os._s()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setIcon(t){return this.ws=t,this.chart.cs.Ms(),this}getIcon(){return this.ws}setName(t){return this.Cs=t,this.Ji.forEach((e=>e.setText(t))),this}getName(){return this.Cs||"Component"}dispose(){return this.ji||(this.ji=!0,this.ss.forEach(((t,e)=>e.dispose())),this.qi(this),this.Ji.forEach((t=>{t.dispose()})),this.Ji.length=0,this.R.emit("dispose",this),this.chart.cs.Ms()),this}setVisible(t){return t===this.Zi||(this.Zi=t,this.ss.forEach(((e,i)=>i.setVisible(t))),this.Qi.forEach((e=>e.vs(t))),this.Ji.forEach((e=>e.setOn(t))),this.R.emit("visibleStateChanged",this,this.Zi),this.chart.cs.Ms()),this}getVisible(){return this.Zi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setHighlight(t){return this.chart.cs.us.ks(this,t),this.R.emit("highlight",this,t),this}getHighlight(){return this.chart.cs.us.ps(this)}setAnimationHighlight(t){return this.chart.cs.us.Ts(this,t),this}getAnimationHighlight(){return this.chart.cs.us.Fs(this)}setMouseInteractions(t){return this.$i=t,this.ss.forEach(((e,i)=>i.setMouseInteractions(t))),this.chart.cs.Ms(),this}getMouseInteractions(){return this.$i}getIsUnderMouse(){if(!this.chart.cs.Is())return!1;for(const t of this.ss)if(t[0].Ps)return!0;for(const t of this.Qi)if(this.chart.cs.Ds(t))return!0;return!1}setHighlightOnHover(t){return this.Xi=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Xi!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return this.styleLegendEntry(t,i),Ie(t,[this],{toggleVisibilityOnClick:e,label:this.getName(),style:void 0}),this.Ji.push(t),t.onDispose((()=>{const e=this.Ji.indexOf(t);e>=0&&this.Ji.splice(e,1)})),this}Bs(){return this.ws}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}offDispose(t){return this.R.off(t,"dispose")}}class ss extends is{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ls=!0,this.Rs=t,this.axis=s,this.At=r,this.Es=n,this.zs()}setClipping(t){return this.Ls=t,this.Rs.Ms(),this}getClipping(){return this.Ls}}const rs=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.Us?(this.Gs.splice(t,1),t-=1):this.Gs[t].state&&(s=!0);return this.Ns?0===e.interactions.length&&(this.Gs.push({state:!1,time:i}),this.Ns=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Gs.push({state:!0,time:i}),s=!0,this.Ns=!0),s}Os(t,e,i){if(i){const i=this.Gs.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Ws(t,e),this.Gs.length=0)}}},hs=class{constructor(t,e,i,s=1,r=100){this.Ys=t,this.Hs=e,this.$s=i,this.Xs=s,this.js=r}Vs(t,e){const i=e.interactions.length;if(i===this.Xs){if(void 0!==this.Zs)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=rs(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class ds{constructor(t,e){this.te=t,this.ie=e,this.se=e.rows*Us,this.ee=e.columns*Ys}}var fs,gs;e.OnScreenMenuButtonType=void 0,(fs=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[fs.ZoomIn=0]="ZoomIn",fs[fs.ZoomInX=1]="ZoomInX",fs[fs.ZoomInY=2]="ZoomInY",fs[fs.ZoomOut=3]="ZoomOut",fs[fs.ZoomOutX=4]="ZoomOutX",fs[fs.ZoomOutY=5]="ZoomOutY",fs[fs.ZoomToFit=6]="ZoomToFit",fs[fs.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(gs=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[gs.Circle=0]="Circle",gs[gs.Rectangle=1]="Rectangle",gs[gs.RoundedRectangle=2]="RoundedRectangle";const ms={x:-43,y:0},ys={x:-65,y:0},ps={x:-86,y:0},As={x:-107,y:-1},xs={x:-128,y:-3},Ss={x:-150,y:0},vs={x:-171,y:0},bs={x:-276,y:0},Ms={x:-298,y:0},Cs={x:0,y:0},Ts={x:-21,y:0};class ws extends ds{constructor(t,e,i,s){super(t,i),this.he=zt.document.createElement("button"),this.re=zt.document.createElement("div"),this.ne=zt.document.createElement("label"),this.ie=i,this.oe=e,this.ae=s}le(t,e,i,s){this.ue(t,s),this.ce(),this.de(e),this.fe(),this.ne.textContent=i||"";const r=zt.document.createElement("div");this.Ae(r),this.he.onclick=this.onClick.bind(this),r.appendChild(this.re),r.appendChild(this.ne),this.he.appendChild(r)}fe(){this.he.style.cursor="pointer"}Ae(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}de(t){"string"==typeof t?(this.re.style.backgroundImage=`url(${t})`,this.re.style.backgroundSize="100%",this.re.style.backgroundRepeat="no-repeat",this.re.style.backgroundPosition="center",this.re.style.width="20px",this.re.style.height="20px"):this.applyStyleForSprite(t),this.re.style.margin="auto"}ce(){switch(this.oe){case e.OnScreenMenuButtonShape.RoundedRectangle:this.he.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.he.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.he.style.borderRadius="31px"}}ue(t,e){this.he.style.width=`${this.ee.toString()}px`,this.he.style.height=`${this.se.toString()}px`,this.he.style.backgroundColor=t,this.he.style.opacity=e||Hs,this.he.style.alignItems="center",this.he.style.border="2px solid #707070",this.he.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.re.style.backgroundImage=`url(${this.te}/${Xs})`,this.re.style.backgroundPositionX=`${t.x}px`,this.re.style.backgroundPositionY=`${t.y}px`,this.re.style.backgroundSize="1600%",this.re.style.backgroundRepeat="no-repeat",this.re.style.width="20px",this.re.style.height="20px"}ge(t){return t.appendChild(this.he),t}pe(){return this.he}}class Es extends ws{constructor(t,e,i,s){super(t,e,i,s),this.ye="",this.me="",this.ve=!1,this.ae=s}Se(){this.xe(),this.onToggledStateAction()}be(){this.Me(),this.onInitialStateAction()}Me(){this._e(this.ye)}xe(){this._e(this.me)}_e(t){"string"==typeof t?this.re.style.background=t:(this.re.style.backgroundImage=`url(${this.te}/${Xs})`,this.re.style.backgroundPositionX=`${t.x}px`,this.re.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ve?this.be():this.Se(),this.ve=!this.ve}}class ks extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),ms)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:-1,y:-1})}}class Is extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),As)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:-1,y:0})}}class zs extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),Ss)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:0,y:-1})}}class Fs extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),ys)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:1,y:1})}}class Rs extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),xs)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:1,y:0})}}class Ds extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),vs)}onClick(){const t=this.ae.we();t&&this.ae.zoom(t,{x:0,y:1})}}class Ps extends Es{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.ye=bs,this.me=Ms,this.le(s.onScreenMenuBackgroundColor.toRGBAString(),this.ye)}onToggledStateAction(){this.ae.setAnimationsEnabled(!1)}onInitialStateAction(){this.ae.setAnimationsEnabled(!0)}}class Os extends ws{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ae=e;const s=this.ae.getTheme();this.le(s.onScreenMenuBackgroundColor.toRGBAString(),ps)}onClick(){this.ae.forEachAxis((t=>{t.fit(!0)}))}}class Ls extends ws{constructor(t,e,i){super(t,e.shape||Ws,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.le(r,n,o,h),this.Ce=e.action}onClick(){this.Ce(this.ae)}}class _s extends Es{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.ae=i,this.ke=s,this.ye=Ts,this.me=Cs,this.le(js,this.ye)}Me(){this._e(this.ye),this.he.style.backgroundColor=js,this.he.style.border="2px solid #707070",this.he.style.margin="0px"}xe(){this._e(this.me),this.he.style.background="#FECC00 0% 0% no-repeat padding-box",this.he.style.border="10px solid #BCBCBC12",this.he.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.ke)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.ke)||void 0===t||t.style.setProperty("display","none")}}var Bs;e.MouseStyles=void 0,(Bs=e.MouseStyles||(e.MouseStyles={})).Move="move",Bs.ResizeColumn="col-resize",Bs.ResizeRow="row-resize",Bs.Horizontal="ew-resize",Bs.Vertical="ns-resize",Bs.NorthWest="nw-resize",Bs.NorthEast="ne-resize",Bs.Copy="copy",Bs.CrossHair="crosshair",Bs.Default="default",Bs.Help="help",Bs.Restricted="not-allowed",Bs.None="none",Bs.Point="pointer",Bs.Text="text",Bs.Wait="wait",Bs.ZoomIn="zoom-in",Bs.ZoomOut="zoom-out";const Vs={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)},Gs=new N({color:C(255,255,255,0)}),Ns=new us({thickness:1,fillStyle:Gs}),Us=60,Ys=60,Hs="1.0",Xs="osm/osm-sprite-transparent.png",Ws=e.OnScreenMenuButtonShape.Circle,js="#363636";var $s;e.OSMPosition=void 0,($s=e.OSMPosition||(e.OSMPosition={}))[$s.TopRight=0]="TopRight",$s[$s.TopLeft=1]="TopLeft",$s[$s.BottomLeft=2]="BottomLeft",$s[$s.BottomRight=3]="BottomRight";class Zs extends ss{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Cs="Band",this.Te=0,this.Fe=0,this.Ie=this.ts.bandFillStyle,this.Pe=this.ts.bandStrokeStyle,this.De=!0,this.Be=this.Rs.Ee(this.At).Re(this.Ie).Le(this.Pe).ds(this.getHighlight()),this.As(this.Be)}setValueStart(t){return this.Te=t,this.R.emit("valueChange",this,this.Te,this.Fe),this.Rs.Ms(),this}getValueStart(){return this.Te}setValueEnd(t){return this.Fe=t,this.R.emit("valueChange",this,this.Te,this.Fe),this.Rs.Ms(),this}getValueEnd(){return this.Fe}setFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;return this.Be.Re(e),this.Rs.Ms(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){this.Pe="function"==typeof t?t(this.Pe):t;const e=this.Pe;return this.Be.Le(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}ze(){return this.Be.Ve(this.Es.toVec2(this.Te,this.Es.getHeight(this.At).getInnerStart())).it(this.Es.toVec2(this.Fe-this.Te,this.Es.getHeight(this.At).getInnerInterval())),qi(this.Ls,[this.Be],this.At),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}Oe(t,e){t.ds(e),this.Rs.Ms()}setDefaultMouseInteractions(t){return this.De=t,this}zs(){let t,i;const s=(e,s)=>{if(!this.De)return;const r=yt(this.Rs.cs.Ne(s.x,s.y),this.Rs.cs.At,this.At),n=this.Es.getWidth(r),o=this.axis.At.ft(this.Te),h=this.axis.At.ft(this.Fe),a=(this.axis.At.ft(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this.De)return;const h=this.Es.getWidth(n);t?(this.Te=this.axis.At.pi(this.Te,h),this.Fe=this.axis.At.pi(this.Fe,h)):i?this.Te=this.axis.At.pi(this.Te,h):this.Fe=this.axis.At.pi(this.Fe,h),se(o),this.R.emit("valueChange",this,this.Te,this.Fe),this.Rs.Ms()};this.onMouseMove(((i,r)=>{if(!this.De)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Es.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ge=this.chart.engine.setMouseStyle(n,this.Ge)})),this.onMouseLeave((()=>{this.De&&(this.chart.engine.restoreMouseStyle(this.Ge),this.Ge=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this.De&&0===i&&r(0,0,0,n,e)}));const n=ns(new hs(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class qs extends ss{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Cs="Constant Line",this.M=0,this.Pe=this.ts.constantLineStrokeStyle,this.Ue=!0,this.De=!0,this.We=this.Rs.He(this.At).Ye(this.Pe).ds(this.getHighlight()),this.As(this.We)}setValue(t){return this.M=t,this.R.emit("valueChange",this,this.M),this.Rs.Ms(),this}getValue(){return this.M}setStrokeStyle(t){this.Pe="function"==typeof t?t(this.Pe):t;const e=this.Pe;return this.We.Ye(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}setInteractionMoveByDragging(t){return this.Ue=t,this}getInteractionMoveByDragging(){return this.Ue}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}ze(){return this.We.Xe(this.Es.toVec2(this.M,this.Es.getHeight(this.At).getInnerStart())).$e(this.Es.toVec2(this.M,this.Es.getHeight(this.At).getInnerEnd())),qi(this.Ls,[this.We],this.At),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Pe})}Oe(t,e){t.ds(e),this.Rs.Ms()}setDefaultMouseInteractions(t){return this.De=t,this}zs(){const t=(t,e)=>{this.De&&this.Ue&&(this.M=this.axis.At.pi(this.M,this.Es.getWidth(e)),this.R.emit("valueChange",this,this.M),this.Rs.Ms(),se(t))};this.onMouseMove((()=>{if(this.De&&this.Ue){const t=this.Es.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ge=this.chart.engine.setMouseStyle(t,this.Ge)}})),this.onMouseLeave((()=>{this.De&&this.Ue&&(this.chart.engine.restoreMouseStyle(this.Ge),this.Ge=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.De&&this.Ue&&0===s&&t(i,n)}));const i=ns(new hs(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Ks={fitting:{start:(t,e,i,s)=>e>=t?i:s,end:(t,e,i,s)=>e>=t?s:i,allowIntervalLengthChange:!0},expansion:{start:(t,e,i,s)=>e>=t?it?s:t,end:(t,e,i,s)=>e>=t?s>e?s:e:ie>t?Ks.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Ks.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Ks.regressive.start(t,e,i,s)+(e-t):i{if(e>=t){if(is?s:t}if(s>t)return t+(t-e);const r=t-.5*(t-e);return s{if(e>=t){if(s>e)return e+(e-t);const i=e-.5*(e-t);return sr?r:e},allowIntervalLengthChange:!0}},Js={Empty:"Empty",Numeric:"Numeric",DateTime:"DateTime",Time:"Time"},Qs=t=>void 0!==t.je&&void 0!==t.Ze,tr=t=>void 0!==t.Qe,er=t=>void 0!==t.Je,ir=(t,e)=>[t,e],sr=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Lt(t,0)&&(t=0),Lt(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},or=(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)}},hr=(...t)=>{const e=t.length>0?t.length:0;return(i,s,r,n,o,h)=>{if(s>=e)return;const a=t[s]||1;return i.filter(((t,e)=>e%a==0))}},ar=s.Record({type:"empty-ticks",cursorFormatter:void 0});class lr extends ar{Ke(t){return{qe:[],th:[],ih:this.cursorFormatter?this.cursorFormatter:Bi.Numeric,sh:void 0,eh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}}const ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),cr=(t,e)=>{if(e.has(t))return e.get(t);const i=ni(t.rh.hh());if(Te(i))return i;const s=t.oh.pi(i.min,{x:-5,y:-5}),r=t.oh.pi(i.min,{x:5,y:5}),n=t.oh.pi(i.max,{x:-5,y:-5}),o=t.oh.pi(i.max,{x:5,y:5}),h={min:{x:Math.min(s.x,r.x,n.x,o.x),y:Math.min(s.y,r.y,n.y,o.y)},max:{x:Math.max(s.x,r.x,n.x,o.x),y:Math.max(s.y,r.y,n.y,o.y)}};return e.set(t,h),h},dr=t=>{const e=new Map;if(!ur(t)){for(const i of t.qe)e.set(i,new Map);for(const i of t.th)e.set(i,new Map)}return e},fr=(new lr).Ke({type:"linear"});class gr{constructor(t,e,i,s,n,o,h){this.R=new r.Eventer,this.ah=fr,this.lh=Js.Empty,this.uh=new Map,this.dh=new Map,this.fh=Ks.fitting,this.Ah=!0,this.gh=q((()=>this.chart.cs.Ms()))(300,$.linear),this.ph=!0,this.Zi=!0,this.yh=!1,this.mh=He,this.Sh=!1,this.xh=!1,this.bh=He,this.Mh=He,this._h=He,this.wh=!1,this.Ch="",this.kh={},this.Th=()=>{this.Fh.setMouseInteractions(!0).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMoveTitle",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterTitle",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeaveTitle",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownTitle",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpTitle",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickTitle",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickTitle",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelTitle",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartTitle",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragTitle",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopTitle",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartTitle",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMoveTitle",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndTitle",this,e))),this.Th=void 0},this.Ih=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.uh.get(e),l=(t?t.get(a):void 0)||this.Ph(a,e);l.Dh=!1;const u=this.Bh(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.Lh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Eh!==i||!!t.find((t=>t===e)))).map((t=>$e(e,cr(t,a))?t:void 0)),m=p.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>tr(t.Eh)))&&(t=!1),t&&i.zh&&i.zh.Vh&&!1===i.zh.Vh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.ah.ih(t,this.At),this.Oh=!0,this.Nh=!0,this.chart=t,this.Gh=e,this.ts=s,this.Uh=o,this.At=i,this.Wh=h,"logarithmic"===h.type&&this.setAnimationZoom($.logarithmic(Di(h.base))),this.Yh=o.numeric,this.Hh("Numeric"),this.$h=i.getInnerStart(),this.Xh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setUnits(t,e={}){return this.jh=t,this.Hi=e,this.Zh(),this}getUnits(){return this.jh}setDefaultInterval(t,e){return this.Qh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.wh=!0,this.chart.cs.Ms()),this}getDefaultInterval(){return this.Qh}getTitle(){return this.Ch}setTitle(t){return this.Ch=t,this.Zh(),this}getTitleFillStyle(){return this.Fh.Jh()}setIntervalRestrictions(t){return this.Kh=t,this.chart.cs.Ms(),this}getIntervalRestrictions(){if("function"==typeof this.Kh){const t=this.qh();return this.Kh({curStart:this.$h,curEnd:this.Xh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max})}return this.Kh}setTitleFillStyle(t){return this.Fh.Re(t),this.chart.cs.Ms(),this}getTitleFont(){return this.Fh.tr()}setTitleFont(t){return this.Fh.ir(t),this.chart.cs.Ms(),this}setTitleRotation(t){return this.Fh.sr(t),this.chart.cs.Ms(),this}getTitleRotation(){return this.Fh.er()}setTitleEffect(t){return this.hr.bs(t),this.chart.cs.Ms(),this}getTitleEffect(){return this.hr._s()}Hh(t,e){if(this.uh.size>0&&this.rr(),"Empty"===t){const i=e||(t=>t);this.Yh=i(new lr),this.ah=this.Yh.Ke(this.Wh),this.lh=t}else if("Numeric"===t){"Numeric"!==this.lh&&(this.Yh=this.Uh.numeric);const i=e||(t=>t);this.Yh=i(this.Yh),this.ah=this.Yh.Ke(this.Wh),this.lh=t}else if("DateTime"===t){"DateTime"!==this.lh&&(this.Yh=this.Uh.datetime);const i=e||(t=>t);this.Yh=i(this.Yh),this.ah=this.Yh.Ke(this.Wh),this.lh=t}else if("Time"===t){"Time"!==this.lh&&(this.Yh=this.Uh.time);const i=e||(t=>t);this.Yh=i(this.Yh),this.ah=this.Yh.Ke(this.Wh),this.lh=t}return this.dh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.dh=dr(this.ah),this.chart.cs.Ms(),this}nr(){return this.ah}ar(t){this.ah=t,this.dh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.dh=dr(this.ah),this.chart.cs.Ms()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.yt(void 0!==e?e:this.$h,void 0!==i?i:this.Xh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}yt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=!0,h=Math.abs(e-t);if(Math.abs(this.Xh-this.$h),void 0!==this.ah.sh&&this.ah.sh>h){const i=(e+t)/2,s=this.ah.sh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.ah.eh&&this.ah.ehe?-1:1);n={start:i-s,end:i+s}}const a=this.At.ut(n.start,n.end,this.$h,this.Xh,o);if(!1===a)return this;if(!0===a);else if(n=a,"zoomBandChart"===r)return this;let l;switch(r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return ze(0,""),this}if(this.lr&&this.lr.finishAll(!1),this.gh&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.lr||this.lr.isOver()?this.gh:this.lr.NextAnimation.bind(this);this.lr=e([[this.$h,n.start],[this.Xh,n.end]],(([t,e])=>{this.ur(t,e,o)}),t),this.lr.onAnimationEnd((()=>{this.lr=void 0,l&&(this._h=zt.performance.now())})),this.lr.onAnimationEnd((()=>this.setStopped(s)))}else this.ur(n.start,n.end,o),this.setStopped(s),l&&(this._h=zt.performance.now());return this}getInterval(){return{start:this.$h,end:this.Xh}}setStopped(t){return t===this.yh||(t&&(this.lr&&this.lr.finishAll(!1),this.lr=void 0),this.yh=t,this.R.emit("stoppedStateChanged",this,this.yh),this.mh=zt.performance.now(),this.chart.cs.Ms()),this}getStopped(){return this.yh}onStoppedStateChanged(t){return this.R.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.R.off(t,"stoppedStateChanged")}fit(t,e){const i=this.qh(),s=this.Qh||xr,r="function"==typeof s?s({curStart:this.$h,curEnd:this.Xh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.yt(void 0!==r.start?r.start:this.$h,void 0!==r.end?r.end:this.Xh,void 0!==r.animate?r.animate:void 0===t||t,void 0!==r.stopAxisAfter?r.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.fh=t,this.chart.cs.Ms(),this}getScrollStrategy(){return this.fh}setAnimationScroll(t){return this.Ah=Boolean(t),this.chart.cs.Ms(),this}setAnimationZoom(t,e=300){return this.lr&&(this.lr.finishAll(!1),this.lr=void 0),this.gh=t?q((()=>this.chart.cs.Ms()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ph=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom($.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ph}setVisible(t){const e=this.Zi!==t;return this.Zi=t,this.Fh.setVisible(t),this.cr((e=>{e.rh.setVisible(t)})),e&&this.R.emit("visibleStateChanged",this,this.Zi),this}getVisible(){return this.Zi}onIntervalChange(t){return this.R.on("scaleChange",t)}offIntervalChange(t){return this.R.off(t,"scaleChange")}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}dr(t,e){this.Th&&this.Th();const i=new Map;if(ur(this.ah)||!this.Zi)return this.rr(),i;e=e||new Map;const s=this.Ar(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.kh.physicalAxisSize=h;const a=yr(this.ah,r,n,this.$h,this.Xh,h),l=[];if(this.gr(),l.push(...this.pr(this.ah,r,n,a,e,t,i)),this.yr(this.ah,r,n,a,e,t,l,i),this.mr(),a)for(const[t,e]of this.dh){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.kh.min=r,this.kh.max=n,this.kh.scaleInterval=o,this.kh.physicalAxisSize=h,i}vr(t){const e=t.Eh.Ze;t.rh.Sr(e(t.M,this.At)).Os()}br(t,e){const i=e.je;t.rh.Re(i.getLabelFillStyle()).ir(i.getLabelFont()).sr(i.getLabelRotation())}Ph(t,e){const i=this.dh.get(e);let s=i.get(t);s?(i.delete(t),s.Eh=e,s.vs(!0)):s=this.Mr(t,e);const r=this.uh.get(e)||new Map;return r.set(t,s),this.uh.set(e,r),this.br(s,e),s}Bh(t,e){const i=this._r(t,e);return this.vr(t),i}pr(t,e,i,s,r,n,o){const h=[];for(const a of t.qe){const t=s.get(a);for(const s of t){if(si)continue;const t=this.uh.get(a),l=(t?t.get(s):void 0)||this.Ph(s,a),u=this.Bh(l,n),c=cr(l,r);h.find((t=>$e(c,cr(t,r))))&&l.rh.setVisible(!1),l.Dh=!1,o.set(l,u),h.push(l)}}return h}yr(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.th){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.zh){p=!1;break}const t=u.zh.wr;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const y=this.Lh(m.filter((t=>a.some((e=>Lt(t.M,e))))),g,u,d,n,h,e,i,r,o,l);!0!==y?t=t.concat(y):(d+=1,f=-1,t=[])}y=t,m.forEach((e=>{t.find((t=>t===e))||this.Cr(e)}))}if(l=y,!p)break}}Cr(t){const e=this.uh.get(t.Eh);null==e||e.delete(t.M);const i=this.dh.get(t.Eh);i&&i.has(t.M)?t.dispose():i&&(t.vs(!1),i.set(t.M,t))}cr(t){for(const e of this.uh.values())for(const i of e.values())t(i)}kr(t,e){for(const i of this.uh.values())for(const s of i.values())e=t(e,s);return e}rr(){this.uh.forEach(((t,e)=>{t.forEach((t=>this.Cr(t)))})),this.uh.clear()}gr(){for(const t of this.uh.values())for(const e of t.values())e.Dh=!0}mr(){for(const t of this.uh.values())for(const[e,i]of t.entries())i.Dh&&(i.dispose(),t.delete(e))}Ar(){const t=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart();return m(t,e)}Rh(t,e){return!(t.Dh||0===t.rh.Tr().length||tr(e)&&!0!==e.Fr)}Ir(t,e){return ur(this.ah)||(this.ah.qe.forEach((i=>{e=t(e,i.je)})),this.ah.th.forEach((i=>{(t=>void 0!==t.Ze)(i)&&(e=t(e,i.je))}))),e}qh(){let t=this.Gh.Pr();const e=this.Gh.Dr();let i;if(void 0!==t&&Rt(t)&&void 0!==e&&Rt(e)&&("logarithmic"===this.Wh.type&&(0===t&&(t=Math.min(1,e)),Math.sign(t)!==Math.sign(e)&&(t=Math.min(1,e-.1))),i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,e)):i=m(t,e)),i&&Rt(i.min)&&Rt(i.max))return Lt(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}Br(){if(!this.Oh)return 0;let t=0;const e=this.Gh.Lr();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this.Oh=t,this.chart.cs.Ms(),this}Rr(){var t;const e=this.Sh;let i=!1;if(this.wh&&this.Qh){const t=this.qh();if(t){const e="function"==typeof this.Qh?this.Qh({curStart:this.$h,curEnd:this.Xh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Qh;this.setInterval(e),this.wh=!1}}if(this.fh&&!this.yh){const e=this.qh();if(e){const s=this.$h,r=this.Xh;let n=this.fh.start(s,r,e.min,e.max),o=this.fh.end(s,r,e.min,e.max);const h=null===(t=this.fh.allowIntervalLengthChange)||void 0===t||t,a=Ar(this.Kh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Lt(s,n),u=!1===Lt(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.Ah&&!this.Nh)if(this.Ah){t=!0;const e=l?this.Er(s,n):s,a=u?this.Er(r,o):r;if(!0===this.ur(e,a,h)&&(l&&!1===Lt(e,n)||u&&!1===Lt(a,o))){this.chart.cs.Ms(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.xh=t>=1.4}}else t=!1;t||this.ur(n,o,h),this.Nh=!1}}}return i?(this.Sh!==i&&(this.Sh=i,this.bh=zt.performance.now()),this.zr&&(clearTimeout(this.zr),this.zr=void 0)):!0===e&&void 0===this.zr&&(this.xh=!1,this.zr=setTimeout((()=>{!1!==this.Sh&&(this.Sh=!1,this.bh=zt.performance.now()),this.zr=void 0,this.chart.cs.Ms()}),200)),this}ur(t,e,i){let s={start:t,end:e},r=!0;if(this.Kh){const t=this.qh();s=Ar(this.Kh,t,s,{start:this.$h,end:this.Xh},i)}const n=Math.abs(e-t),o=Math.abs(this.Xh-this.$h);if(void 0!==this.ah.sh&&this.ah.sh>n){const n=(e+t)/2,h=(i?this.ah.sh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.ah.eh&&this.ah.ehe?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.At.ut(s.start,s.end,this.$h,this.Xh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.Br(),l=this.Vr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.At.ut(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.$h,this.Xh,!1),!!h&&(!0===h?this.At.q(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.At.q(s.start,s.end),this.$h=s.start,this.Xh=s.end,this.R.emit("scaleChange",this,s.start,s.end),this.Mh=zt.performance.now(),this.chart.cs.Ms(),r)}Or(){return this.Sh}Nr(){return void 0!==this.lr}Zh(){var t;const e=!1!==(null===(t=this.Hi)||void 0===t?void 0:t.displayOnAxis);this.Fh.Sr(this.jh&&e&&this.Ch?`${this.Ch} (${this.jh})`:this.Ch),this.chart.cs.Ms()}onTitleMouseEnter(t){return this.R.on("mouseEnterTitle",t)}offTitleMouseEnter(t){return this.R.off(t,"mouseEnterTitle")}onTitleMouseMove(t){return this.R.on("mouseMoveTitle",t)}offTitleMouseMove(t){return this.R.off(t,"mouseMoveTitle")}onTitleMouseLeave(t){return this.R.on("mouseLeaveTitle",t)}offTitleMouseLeave(t){return this.R.off(t,"mouseLeaveTitle")}onTitleMouseDown(t){return this.R.on("mouseDownTitle",t)}offTitleMouseDown(t){return this.R.off(t,"mouseDownTitle")}onTitleMouseUp(t){return this.R.on("mouseUpTitle",t)}offTitleMouseUp(t){return this.R.off(t,"mouseUpTitle")}onTitleMouseClick(t){return this.R.on("mouseClickTitle",t)}offTitleMouseClick(t){return this.R.off(t,"mouseClickTitle")}onTitleMouseDoubleClick(t){return this.R.on("mouseDoubleClickTitle",t)}offTitleMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClickTitle")}onTitleMouseDragStart(t){return this.R.on("mouseDragStartTitle",t)}offTitleMouseDragStart(t){return this.R.off(t,"mouseDragStartTitle")}onTitleMouseDrag(t){return this.R.on("mouseDragTitle",t)}offTitleMouseDrag(t){return this.R.off(t,"mouseDragTitle")}onTitleMouseDragStop(t){return this.R.on("mouseDragStopTitle",t)}offTitleMouseDragStop(t){return this.R.off(t,"mouseDragStopTitle")}onTitleMouseWheel(t){return this.R.on("mouseWheelTitle",t)}offTitleMouseWheel(t){return this.R.off(t,"mouseWheelTitle")}onTitleTouchStart(t){return this.R.on("touchStartTitle",t)}offTitleMouseTouchStart(t){return this.R.off(t,"touchStartTitle")}onTitleTouchMove(t){return this.R.on("touchMoveTitle",t)}offTitleTouchMove(t){return this.R.off(t,"touchMoveTitle")}onTitleTouchEnd(t){return this.R.on("touchEndTitle",t)}offTitleTouchEnd(t){return this.R.off(t,"touchEndTitle")}}class mr{constructor(t,e,i,s,r=i.Wr(s).Ur(Le).Gr(Le).setMouseInteractions(!1)){this.Dh=!1,this.ji=!1,this.ss=[],this.Eh=t,this.M=e,this.Yr=i,this.oh=s,this.rh=r,this.ss.push(r)}vs(t){this.ss.forEach((e=>e.setVisible(t)))}dispose(){return this.ji||(this.ji=!0,this.ss.forEach((t=>t.dispose()))),this}}const yr=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.qe){let t=n.Hr(e,i,s,r);t=pr(t),o.set(n,t)}let h;for(const s of t.th){let t;if(void 0===h)t=s.Hr(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.$r&&s.$r>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Ar=(t,e,i,s,r)=>{const n="function"==typeof t?t({curStart:s.start,curEnd:s.end,dataMin:null==e?void 0:e.min,dataMax:null==e?void 0:e.max}):t;if(!n)return i;const o={start:i.start,end:i.end};let h=Math.abs(i.end-i.start);if(void 0!==n.intervalMin&&hn.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*n.intervalMax,o.end=t+.5*Math.sign(i.end-t)*n.intervalMax}return h=Math.abs(i.end-i.start),void 0!==n.startMin&&(o.start=Math.max(o.start,n.startMin),r||Lt(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.startMax&&(o.start=Math.min(o.start,n.startMax),r||Lt(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMin&&(o.end=Math.max(o.end,n.endMin),r||Lt(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMax&&(o.end=Math.min(o.end,n.endMax),r||Lt(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},xr=t=>{if(void 0===t.dataMin||void 0===t.dataMax)return{stopAxisAfter:!1};const e=t.curEnd>=t.curStart;return{start:e?t.dataMin:t.dataMax,end:e?t.dataMax:t.dataMin,stopAxisAfter:!1}},Sr=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class vr extends Sr{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 br=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),Mr=new vr,Cr=new class{getFillStyle(){return _}},Tr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new N,wireframeStyle:ut});class wr extends Tr{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 Er=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),kr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new N});class Ir extends kr{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 zr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),Fr={Triangulated:wr,Pixelated:Ir};class Rr{constructor(t){this.Xr=new Map,this.cs=t}ls(t,e,i){const s=i.animationEnabled;this.Xr.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Xr.delete(t),t.offDispose(r)}))}jr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Xr.delete(t)})),t.offDispose(r)}));return{Zr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Xr.set(t,r)},Qr:()=>{s.forEach((t=>{this.Xr.delete(t)})),s.length=0},Jr:t=>{i=t,s.forEach((t=>{this.Ts(t,i)}))},Kr:()=>i}}ks(t,e){const i=this.Xr.get(t);i&&(i.curUnanimatedHighlightValue=ke(e),this.cs.Ms())}ps(t,e=!1){const i=this.Xr.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Ts(t,e){const i=this.Xr.get(t);i&&(i.animationEnabled=e)}Fs(t){const e=this.Xr.get(t);return!!e&&e.animationEnabled}Os(t){let e=!1;this.Xr.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.cs.Ms(!0)}}const Dr=new Map,Pr=(t,e)=>{const i=t.getSize(),s=t.getFamily(),r=t.getWeight(),n=t.getStyle(),o=t.getVariant(),h=`${n} ${o?"small-caps":"normal"} ${r} ${i}px ${s}`,a=`${h} ${e.toFixed(2)}`;let l=Dr.get(a);return l||(l=((t,e,i,s)=>({font:t,properties:e,dpr:i,id:s}))(h,{type:"font",size:i,family:s,style:n,variant:o,weight:r},e,a),Dr.set(a,l)),l};var Or,Lr;!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"}(Or||(Or={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(Lr||(Lr={}));const _r=t=>({container:t.qr,setMouseStyle:(e,i)=>t.tn(e,i),restoreMouseStyle:e=>t.sn(e),captureFrame:(e,i,s)=>t.en(e,i,s),renderFrame:(e,i,s=!1)=>t.hn(e,i,s),layout:()=>{t.rn(),t.nn(),t.ln.an(),t.Ms()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.un(e,i),onRenderFrame:e=>t.cn(e),offRenderFrame:e=>t.dn(e)}),Br=[];let Vr;const Gr=()=>{if(void 0!==Vr){const t=zt.getComputedStyle(zt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Vr.style.height=zt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Ms()),60),this.gn=u(0,0),this.pn=!1,this.yn=Ot,this.mn=()=>{},this.vn=[],this.Sn=-1,this.xn=[],this.bn=!0,this.ji=!1,this.Mn=!1,this.nn=()=>{const{bottom:t,left:e}=this.qr.getBoundingClientRect();return this.gn=u(Math.floor(e),Math.floor(t)),this},this._n=t=>{if(this.wn){const e=this.wn.entity.Cn;e&&e(this.wn.entity,t,this.wn.button,this.wn.startLocation,this.wn.collectionMember,this.wn.info),this.wn=void 0}},this.rn=()=>{this.kn&&this.kn()},this.tn=(t,e)=>{if(!e){this.qr.style.cursor=t;const e=this.Sn;return this.Sn+=1,this.xn.push([e,t]),e}return this.sn(e),this.tn(t)},this.sn=t=>{const e=t?this.xn.findIndex((e=>e[0]===t)):-1;e>=0?(this.xn.splice(e,1),this.xn.length>0?this.qr.style.cursor=this.xn[this.xn.length-1][1]:this.qr.style.cursor="default"):(this.xn.push([0,"default"]),this.qr.style.cursor="default")},this.Tn=t=>(this.Fn._(t),this),this.In=()=>this.Fn.C(),this.Pn=()=>{this.yn&&this.yn(1e3/60),this.Dn(),this.Bn(),this.mn&&this.mn()},this.Ln=t=>(this.fn.set(t.Rn(),t),this.fn=new Map([...this.fn.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.En=t=>(this.fn.delete(t),this),this.J=()=>(this.Fn.u=!1,this),this.K=()=>(this.Fn.u=!0,this),this.zn=t=>{if(!this.bn)return;const e=this.Vn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.xs({x:t.clientX,y:t.clientY});if(this.On&&((null==s?void 0:s.entity)!==this.On.entity||s.collectionMember!==this.On.collectionMember)&&!this.wn){this.On.entity.Ps=!1;const e=this.On.entity.Nn;e&&e(this.On.entity,t,this.On.collectionMember)}if(s&&s.entity.getMouseInteractions()&&!this.wn)if(s.entity.Ps){if(!i){const e=s.entity.Gn;e&&e(s.entity,t,s.collectionMember,s.info)}}else{s.entity.Ps=!0;const e=s.entity.Un;e&&e(s.entity,t,s.collectionMember,s.info)}if(this.wn){const i=this.wn.entity.Wn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.wn.entity,t,this.wn.button,this.wn.startLocation,s,this.wn.collectionMember,this.wn.info)}this.Yn=t,this.Vn=t,this.On=s?{...s,event:t}:void 0},this.Hn=t=>{if(this.bn=!1,this.Yn=t,this.On&&!this.$n&&!this.wn){this.On.entity.Ps=!1;const e=this.On.entity.Nn;e&&e(this.On.entity,t,this.On.collectionMember),this.On=void 0}},this.Xn=t=>{if(this.bn=!0,this.Yn=t,this.wn&&t.buttons<=0){const e=this.wn.entity.Cn;e&&e(this.wn.entity,t,this.wn.button,this.wn.startLocation,this.wn.collectionMember,this.wn.info),this.wn=void 0}if(this.$n&&t.buttons<=0){const e=this.$n.entity.jn;e&&e(this.$n.entity,t,this.$n.collectionMember,this.$n.info),this.$n=void 0}},this.Zn=()=>this.Yn&&this.Qn?this.Yn.timeStamp>this.Qn.timeStamp?this.Yn:this.Qn:this.Yn||this.Qn,this.ln=t,this.ts=e.theme,this.Jn=i.Jn,this.Kn=i.Kn,this.qn=i.qn,this.io={so:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,te:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:void 0,eo:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,ho:(()=>{const t=null==e?void 0:e.pickingPrecision;if("string"==typeof t){const e=t.toLowerCase();if("best"===e)return 1;if("high"===e)return.5;if("low"===e)return 1/8}return 1/4})(),ro:void 0===(null==e?void 0:e.interactable)||e.interactable,no:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=zt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.qr=t}else this.qr=s;zt.addEventListener("resize",this.rn),this.vn.push((()=>{zt.removeEventListener("resize",this.rn)}))}else{if(void 0===Vr){const t=zt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",zt.document.body.appendChild(t),Vr=t,zt.addEventListener("resize",Gr)}let t=1;for(;null!==zt.document.getElementById(`chart-${t}`);)t+=1;this.qr=zt.document.createElement("div"),this.qr.id=`chart-${t}`,this.qr.style.flex="1",this.qr.style.height="100%",Vr.appendChild(this.qr),Gr(),Br.push(this.rn),this.vn.push((()=>{Vr&&Vr.removeChild(this.qr),Br.includes(this.rn)&&Br.splice(Br.indexOf(this.rn),1),0===Br.length&&Vr&&(zt.document.body.removeChild(Vr),Vr=void 0,zt.removeEventListener("resize",Gr))}))}if(zt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.qr&&this.rn()};this.oo=new zt.ResizeObserver(t.bind(this)),this.oo.observe(this.qr)}""===this.qr.style.position&&(this.qr.style.position="relative"),this.qr.style.boxSizing="content-box",this.qr.addEventListener("fullscreenchange",this.rn),this.qr.addEventListener("webkitfullscreenchange",this.rn);const n=e?e.maxFps:void 0;this.ao=n?-1===n?-1:0!==n?1e3/n:0:0;const o=new Map;let h=!1;const a=(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":o.set(i.pointerId,s);break;default:o.delete(i.pointerId),h=!1}switch(i.interactions=Array.from(o.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(h=!0)};this.qr.onwheel=this.lo(Or.wheel),this.qr.oncontextmenu=this.lo(Or.contextmenu),this.qr.onclick=this.lo(Or.click),this.qr.ondblclick=this.lo(Or.dbclick),this.qr.onlostpointercapture=()=>{h=!1},this.qr.ontouchmove=t=>{h&&t.preventDefault()},this.qr.onpointerover=a(),this.qr.onpointerenter=a(this.Xn),this.qr.onpointerdown=a(this.lo(Or.mouseDown),this.uo(Lr.touchStart)),this.qr.onpointermove=a(this.zn,this.uo(Lr.touchMove)),this.qr.onpointerup=a(this.lo(Or.mouseUp),this.uo(Lr.touchEnd)),this.qr.onpointercancel=a(),this.qr.onpointerout=a(),this.qr.onpointerleave=a(this.Hn,this.uo(Lr.touchEnd)),zt.addEventListener("dragstart",this._n),zt.addEventListener("scroll",this.nn,{passive:!0}),this.Fn=p(new b({r:0,g:0,b:0,a:0})),this.us=new Rr(this)}co(t,e){var i,s,r,n;(null===(i=this.On)||void 0===i?void 0:i.entity)===t.entity&&this.On.collectionMember===t.collectionMember&&(this.On={...e,info:this.On.info,event:this.On.event}),(null===(s=this.do)||void 0===s?void 0:s.entity)===t.entity&&this.do.collectionMember===t.collectionMember&&(this.do={...e,info:this.do.info}),(null===(r=this.$n)||void 0===r?void 0:r.entity)===t.entity&&this.$n.collectionMember===t.collectionMember&&(this.$n={...e,info:this.$n.info,event:this.$n.event}),(null===(n=this.wn)||void 0===n?void 0:n.entity)===t.entity&&this.wn.collectionMember===t.collectionMember&&(this.wn={...e,info:this.wn.info,button:this.wn.button,startLocation:this.wn.startLocation})}fo(){this.Mn=!0,this.yn=void 0,this.mn=void 0}cn(t){return this.R.on("render",t)}dn(t){return this.R.off(t)}Ao(){return this.po}yo(){return this.mo}setBackgroundFillStyle(t){return this.vo.Re(t),this.Ms(),this}getBackgroundFillStyle(){return this.vo.Jh()}setBackgroundStrokeStyle(t){return this.vo.Le(t),this.Ms(),this}getBackgroundStrokeStyle(){return this.vo.So()}xo(t){return this.mn=t,this}bo(t){return this.yn=t,this}Mo(t){return this.fn.get(t)}_o(){return Array.from(this.fn.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}lo(t){return e=>this.wo(t,e)}wo(t,e){if(!this.bn)return;t===Or.contextmenu&&se(e);const i=this.xs({x:e.clientX,y:e.clientY});if(t===Or.mouseUp){if(this.wn){const t=this.wn.entity.Cn;if(t&&t(this.wn.entity,e,this.wn.button,this.wn.startLocation,this.wn.collectionMember,this.wn.info),(null==i?void 0:i.entity)!==this.wn.entity||i.collectionMember!==this.wn.collectionMember){this.wn.entity.Ps=!1;const t=this.wn.entity.Nn;t&&t(this.wn.entity,e,this.wn.collectionMember)}this.wn=void 0}if(this.$n){const t=this.$n.entity.getMouseInteractions()&&this.$n.entity.jn;t&&t(this.$n.entity,e,this.$n.collectionMember,this.$n.info),this.$n=void 0}}else if(i&&i.entity.getMouseInteractions()){const s=t===Or.click?i.entity.Co:t===Or.dbclick?i.entity.ko:t===Or.mouseDown?i.entity.To:t===Or.wheel?i.entity.Fo:t===Or.contextmenu?i.entity.Io:void 0;if(s&&s(i.entity,e,i.collectionMember,i.info),t===Or.mouseDown){this.$n={entity:i.entity,collectionMember:i.collectionMember,event:e,info:i.info};const t=this.$n.event.button,s=i.entity.Po;s&&s(i.entity,e,t,i.collectionMember,i.info),this.wn={entity:i.entity,collectionMember:i.collectionMember,button:t,startLocation:u(e.clientX,e.clientY),info:i.info}}}this.Yn=e,this.On=i?{...i,event:e}:void 0}uo(t){return e=>this.Do(t,e)}Do(t,e){const i=e.interactions.length;if(this.Qn=e,this.do){const s=t===Lr.touchMove?this.do.entity.Bo:t===Lr.touchEnd?this.do.entity.Lo:t===Lr.touchStart?this.do.entity.Ro:void 0;s&&s(this.do.entity,e,this.do.collectionMember,this.do.info),t===Lr.touchEnd&&0===i&&(this.do.entity.Ps=!1,this.do=void 0)}else if(t===Lr.touchStart){for(let t=0;t{t()})),this.vn.length=0}}Ne(t,e){return u(t-this.gn.x,this.gn.y-e)}Go(t,e){return u(t+this.gn.x,this.gn.y-e)}Uo(t){const e=this.Ne(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Wo(t){const e=this.Go(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Hr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=mi(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=mi(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=mi(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=mi(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"ProgressiveX"===t||"RegressiveX"===t?"x":"y",Kr=t=>"ProgressiveX"===t||"ProgressiveY"===t;var Jr;!function(t){t[t.Nearest=0]="Nearest",t[t.NearestX=1]="NearestX",t[t.NearestY=2]="NearestY"}(Jr||(Jr={}));const Qr=(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===Jr.Nearest)return tn(t,e,n,o,c,d);if(i===Jr.NearestX||i===Jr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Jr.NearestX||"y"===a&&i===Jr.NearestY))return rn(t,yt(e,o,n),a,l,c,d);if(i===Jr.NearestX)return en(t,yt(e,o,n),h,c,d);if(i===Jr.NearestY)return sn(t,yt(e,o,n),h,c,d)}},tn=(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=yt(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,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(e))return m;y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Ye,s=m{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,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){if(i*(s?-1:1)<0&&m>r){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.R.on("dispose",t),this.offDispose=t=>this.R.off(t,"dispose"),this.cs=t,this.Zo=e,this.Qo=i,this.Jo=on,on+=1,this.Ko=t.ts.highlightColorOffset}qo(){let t;return this.ta("DataPattern",(e=>(t=e.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?Jr.NearestX:"ProgressiveY"===t||"RegressiveY"===t?Jr.NearestY:Jr.Nearest}ia(t){return void 0!==this.Qo.find((e=>e.type===t))}ta(t,e){var i;return!!this.ia(t)&&!0===e(null===(i=this.Qo.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.ji||(this.Ps&&this.Nn&&this.Nn(this,void 0,void 0),this.ji=!0,this.Zo(this),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}setVisible(t){const e=this.Zi;return this.Zi=t,!t&&e&&(this.Ps&&this.Nn&&this.Nn(this,void 0,void 0),this.Ps=!1),this}getVisible(){return this.Zi}setMouseInteractions(t){const e=this.Yo.C();return this.Yo._(t),t||(e&&this.Ps&&this.Nn&&this.Nn(this,void 0,void 0),this.Ps=!1),this}getMouseInteractions(){return this.Yo.C()}getIsUnderMouse(){return this.Ps}getIsGrabbed(){return this.$o}setMouseMoveEventHandler(t){return this.Gn=t,this}setMouseEnterEventHandler(t){return this.Un=t,this}setMouseLeaveEventHandler(t){return this.Nn=t,this}setMouseClickEventHandler(t){return this.Co=t,this}setMouseDoubleClickEventHandler(t){return this.ko=t,this}setMouseDownEventHandler(t){return this.To=t,this}setMouseUpEventHandler(t){return this.jn=t,this}setMouseWheelEventHandler(t){return this.Fo=t,this}setMouseContextMenuEventHandler(t){return this.Io=t,this}setMouseDragEventHandler(t){return this.Wn=t,this}setMouseDragStartEventHandler(t){return this.Po=t,this}setMouseDragStopEventHandler(t){return this.Cn=t,this}setTouchStartEventHandler(t){return this.Ro=t,this}setTouchMoveEventHandler(t){return this.Bo=t,this}setTouchEndEventHandler(t){return this.Lo=t,this}sa(t){return this.Xo=t,this}ea(){return this.Xo?this.Xo:an}ds(t){return this.jo=t,this}ha(){return this.jo}ra(t){return this.Ko=t,this}na(){return this.Ko}}const an=m(u(0,0),u(0,0));class ln extends hn{constructor(t,e,i,s){super(t,i,s),this.oa=0,this.Rs=e,this.Rs.aa=!0}la(){}ua(t){return this.oa===t||(this.oa=t,this.Rs.aa=!0),this}ca(){return this.oa}}class un extends ln{constructor(t,e,i,s,r){super(t,e,s,r),this.da=!0,this.At=i}}const cn=(t,e,i)=>{if(i instanceof Yi){const s=i.Ui(),r=Ai(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.pi(u(t.min.x,t.min.y),mi(e,-1)),i.pi(u(t.max.x,t.max.y),e))},dn=(t,e)=>"function"==typeof e?e(t):e,fn=(t,e)=>!t||t!==e,gn=t=>t!==_;class mn extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ie=Ur.fillStyle,this.cs=t}Re(t){return this.Ie=dn(this.Ie,t),this}Jh(){return this.Ie}fa(){return fn(this.Aa,this.Ie)}ga(){return((t,e)=>t===_&&e!==_)(this.Aa,this.Ie)}pa(){return gn(this.Ie)}ya(t){this.Aa=t}}class yn extends mn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pe=Ur.lineStyle,this.cs=t}Le(t){return this.Pe="function"==typeof t?t(this.Pe):t,this}So(){return this.Pe}ma(){return!this.va||this.va!==this.Pe}Sa(t){return!this.va||this.va.getThickness()!==t}pa(){return this.Pe!==ut||super.pa()}ga(){return(this.Pe!==ut||this.Ie!==_)&&this.va===ut&&this.Aa===_}xa(t){this.va=t}}class pn extends mn{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}it(t){return this.size._(t),this}}class An extends mn{constructor(t,e,i,s,r,n=p(Ur.font)){super(t,e,i,s,r),this.ba=p(""),this.Ma=p(u(0,0)),this._a=p(0),this.wa=p(0),this.Ca=p(u(0,0)),this.ka=p(0),this.Ta=p(Mr),this.Fa=u(0,0),this.Xt=p(A(1,1,1,1)),this.Ia=p(x(4,4,4,4)),this.font=p(Ur.font),this.Pa=!1,this.font=n}pa(){return gn(this.Ie)&&this.ba.C().length>0}ga(){return!1===this.Pa&&this.pa()}Sr(t){return this.ba._(t),this}Tr(){return this.ba.C()}ir(t){return br(t)?this.Ta._(t):this.Ta._(t(this.Ta.C())),this}tr(){return this.Ta.C()}Da(t){return this.Ta._(this.Ta.C().setFamily(t)),this}Ba(){return this.Ta.C().getFamily()}La(t){return this.Ta._(this.Ta.C().setSize(t)),this}Ra(){return this.Ta.C().getSize()}Ea(t){return this.Ta._(this.Ta.C().setWeight(t)),this}za(){return this.Ta.C().getWeight()}Va(t){return this.Ta._(this.Ta.C().setStyle(t)),this}Oa(){return this.Ta.C().getStyle()}Na(t){return this.Ta._(this.Ta.C().setVariant(t)),this}Ga(){return this.Ta.C().getVariant()}Ve(t){return this.Ma._(t),this}Ua(){return this.Ma.C()}sr(t){return this.ka._(t),this}er(){return this.ka.C()}Wa(t,e){return this.Ca._(u(t,e)),this}Ya(){return this.Ca.C()}Ha(t){return this.wa._(t),this}$a(){return this.wa.C()}Xa(t){return this._a._(t),this}ja(){return this._a.C()}Za(t){return this.wa._(t.x),this._a._(t.y),this}Gr(t){return this.Xt._(t),this}Qa(){return this.Xt.C()}Ur(t){return this.Ia._(t),this}Ja(){return this.Ia.C()}}class xn extends pn{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Ka=[],this.qa=p(e.PointShape.Square),this.ka=p(0),this.tl=p(!1),this.il=p(!1),this.sl=p(!1),this.el=Xe,this.hl=0,this.rl=[],this.nl=0,this.ol=Xe,this.al=!1,this.ll=void 0}ul(){return this.rl}cl(){return this.Ka}dl(t){return this.qa._(t),this}fl(){return this.qa.C()}sr(t){return this.ka._(t),this}er(){return this.ka.C()}Al(t){return this.tl._(t),this}pl(t){return this.il._(t),this}yl(t){return this.sl._(t),this}ml(t,e){return Array.isArray(t)||(t=[t]),this.nl+=t.length,this.rl=fe(this.rl,t,{canReturnB:!0}),this.ol&&(this.ol=e?hi(this.ol,e):void 0),this.ll=void 0,this}Ot(){return this.al=!0,this.Ka.length=0,this.hl=0,this.el=Xe,this.rl=[],this.nl=0,this.ll=void 0,this}vl(){return this.hl}Sl(){return this.nl}}class Sn extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ma=p(u(0,0)),this.Z=p(u(100,100)),this.ka=p(0),this.Fa=p(u(0,0)),this.xl=!1}Os(){return this.bl(),this}Ve(t){const e=this.Ma.C();return t.x===e.x&&t.y===e.y||(this.Ma._(t),this.bl()),this}Ua(){return this.Ma.C()}Ml(t){const e=this.Ma.C();return t!==e.x&&(this.Ma._(u(t,e.y)),this.bl()),this}_l(t){const e=this.Ma.C();return t!==e.y&&(this.Ma._(u(e.x,t)),this.bl()),this}it(t){const e=this.Z.C();return t.x===e.x&&t.y===e.y||(this.Z._(u(t.x,t.y)),this.bl()),this}oi(){return this.Z.C()}wl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(t,e.y)),this.bl()),this}Cl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(e.x,t)),this.bl()),this}sr(t){return this.ka._(t),this}er(){return this.ka.C()}kl(t){const e=this.Fa.C();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.xl=!1,this.bl()):(this.xl=!0,this.Fa._(t))),this}bl(){if(!this.xl){const t=this.Ma.C(),e=this.Z.C(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Fa.C();i.x===s.x&&i.y===s.y||this.Fa._(i)}}}class vn extends yn{constructor(){super(...arguments),this.Ka=[],this.Ma=p(u(0,0)),this.el=Xe,this.Tl=!1}Fl(t){return t=ae(t),this.Ka=t,this.Tl=!0,this}Il(){return this.Ka}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return 0}Dl(){return 0}}class bn extends vn{}class Mn extends mn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Bl=new Array,this.Ll=new Array,this.Rl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.el=Xe,this.El=0,this.zl=!1,this.rl=[Array(),Array()],this.Vl=!1,this.Ol=(new N).setColor(C(42,171,240)),this.al=!1,this.Nl=!1,this.Gl=!1}ml(t,e){const i=this.El-1,s=i>0&&!this.Vl;let[r,n]=s?[[this.Bl[i]],[this.Ll[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=fe(r,e,{canReturnB:!0}),n=fe(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Vl?(this.rl[0]=fe(this.rl[0],r,{canReturnB:!0}),this.rl[1]=fe(this.rl[1],n,{canReturnB:!0})):(this.rl=[r,n],this.Vl=!0),this.el=hi(this.el,e||hi(ni(r),ni(n))),this}Ot(){return this.al=!0,this.Bl.length=0,this.Ll.length=0,this.El=0,this.el=Xe,this}cl(){return[this.Bl,this.Ll]}ul(){return[this.rl[0],this.rl[1]]}Ul(t){return this.Rl._(t),this}Wl(){return this.Rl.C()}Yl(t){return this.Ol="function"==typeof t?t(this.Ol):t,this}Hl(){return this.Ol}vl(){return this.El-(Number(this.Nl)+Number(this.Gl))}Sl(){return this.rl.length}$l(t){return this.Nl=t,this}Xl(){return this.Nl}jl(t){return this.Gl=t,this}Zl(){return this.Gl}ga(){return this.Aa===_&&this.Ql===_&&(this.Ie!==_||this.Ol!==_)}Jl(t){this.Ql=t}pa(){return this.Ol!==_||super.pa()}fa(){return super.fa()||!this.Ql||this.Ql!==this.Ol}}class Cn extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ma=p(u(0,0)),this.Kl=p(0),this.Fi=p(360),this.ql=p(100),this.tu=p(100),this.iu=p(0),this.su=p(void 0),this.eu=u(0,0),this.hu=u(0,0),this.ru=u(0,0)}nu(){return this.ql.C()}ou(){return this.tu.C()}Ua(){return this.Ma.C()}au(){return this.Kl.C()}Ti(){return this.Fi.C()}lu(){return this.iu.C()}uu(){return this.su.C()}cu(){return this.eu}du(){return this.hu}fu(){return this.ru}Ve(t){return this.Ma._(t),this}Au(t){return this.Kl._(t),this}$e(t){return this.Fi._(t),this}gu(t){return this.tu._(t),this.ql._(t),this}pu(t){return this.ql._(t),this}yu(t){return this.tu._(t),this}mu(t){return this.iu._(t<0?0:t),this}vu(t){return this.su._(void 0!==t&&t<=0?void 0:t),this}}var Tn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(Tn||(Tn={}));class wn extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Su=Ur.lineStyle,this.engine=t}Ye(t){return this.Su=((t,e)=>"function"==typeof e?e(t):e)(this.Su,t),this}xu(){return this.Su}ma(){return((t,e)=>!t||t!==e)(this.bu,this.Su)}Mu(t){return((t,e)=>!t||t.getThickness()!==e)(this.bu,t)}ga(){return((t,e)=>t===ut&&e!==ut)(this.bu,this.Su)}pa(){return(t=>t!==ut&&t.getFillStyle()!==_)(this.Su)}_u(t){this.bu=t}}class En extends wn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.wu=!1}_({min:t,max:e}){return t.x===this.Pi.x&&t.y===this.Pi.y&&e.x===this.Fi.x&&e.y===this.Fi.y||(this.wu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}Xe(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.wu=!0,this.Pi=t),this}$e(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.wu=!0,this.Fi=t),this}}class kn extends wn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Cu=void 0,this.ku=0}}class In extends wn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tu=[],this.el=Xe,this.rl=new Array,this.hl=0,this.al=!1,this.Fu=p(void 0),this.Nl=!1,this.Gl=!1}Iu(t){return this.Fu._(t),this}Pu(){return this.Fu.C()}ul(){return this.rl}cl(){return this.Tu}Ot(){return this.al=!0,this.Tu.length=0,this.hl=0,this.rl=[],this.el=Xe,this}vl(){return this.hl-(Number(this.Nl)+Number(this.Gl))}Sl(){return this.rl.length}$l(t){return this.Nl=t,this}Xl(){return this.Nl}jl(t){return this.Gl=t,this}Zl(){return this.Gl}}const zn=t=>{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 Fn{constructor(){this.Zi=!0,this.R=new r.Eventer,this.Du=0,this._t=(t,e,i)=>{0===this.Du&&this.R.emit("mouseEnter",this,e),this.Du+=1},this.wt=(t,e,i)=>{this.Du-=1,this.Du<1&&(this.R.emit("mouseLeave",this,e),this.Du=0)},this.Ct=(t,e,i)=>{this.R.emit("mouseClick",this,e)},this.kt=(t,e,i)=>{this.R.emit("mouseDoubleClick",this,e)},this.Tt=(t,e,i)=>{this.R.emit("mouseDown",this,e)},this.Ft=(t,e,i)=>{this.R.emit("mouseUp",this,e)},this.It=(t,e,i)=>{this.R.emit("mouseMove",this,e)},this.Dt=(t,e,i,s)=>{this.R.emit("mouseDragStart",this,e,i)},this.Pt=(t,e,i,s,r,n)=>{this.R.emit("mouseDrag",this,e,i,s,r)},this.Bt=(t,e,i,s,r)=>{this.R.emit("mouseDragStop",this,e,i,s)},this.Lt=(t,e,i)=>{this.R.emit("mouseWheel",this,e)},this.Rt=(t,e)=>{this.Du+=1,this.R.emit("touchStart",this,e)},this.Et=(t,e)=>{this.R.emit("touchMove",this,e)},this.zt=(t,e)=>{this.Du-=1,this.R.emit("touchEnd",this,e)},this.Bu=t=>(t instanceof un?t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragEventHandler(this.Pt).setMouseDragStartEventHandler(this.Dt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt):(t.onMouseEnter(((t,e)=>this._t(t,e))),t.onMouseLeave(((t,e)=>this.wt(t,e))),t.onMouseClick(((t,e)=>this.Ct(t,e))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e))),t.onMouseDown(((t,e)=>this.Tt(t,e))),t.onMouseUp(((t,e)=>this.Ft(t,e))),t.onMouseMove(((t,e)=>this.It(t,e))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Lt(t,e))),t.onTouchStart(((t,e)=>this.Rt(t,e))),t.onTouchMove(((t,e)=>this.Et(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e)))),t)}onMouseEnter(t){return this.R.on("mouseEnter",t)}onMouseLeave(t){return this.R.on("mouseLeave",t)}onMouseClick(t){return this.R.on("mouseClick",t)}onMouseDoubleClick(t){return this.R.on("mouseDoubleClick",t)}onMouseDown(t){return this.R.on("mouseDown",t)}onMouseUp(t){return this.R.on("mouseUp",t)}onMouseMove(t){return this.R.on("mouseMove",t)}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offMouseEnter(t){return this.R.off(t,"mouseEnter")}offMouseLeave(t){return this.R.off(t,"mouseLeave")}offMouseClick(t){return this.R.off(t,"mouseClick")}offMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClick")}offMouseDown(t){return this.R.off(t,"mouseDown")}offMouseUp(t){return this.R.off(t,"mouseUp")}offMouseMove(t){return this.R.off(t,"mouseMove")}offMouseDragStart(t){return this.R.off(t,"mouseDragStart")}offMouseDrag(t){return this.R.off(t,"mouseDrag")}offMouseDragStop(t){return this.R.off(t,"mouseDragStop")}offMouseWheel(t){return this.R.off(t,"mouseWheel")}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}getIsUnderMouse(){return this.Du>0}setVisible(t){const e=this.Zi!==t;return this.Zi=t,e&&this.R.emit("visibleStateChanged",this,this.Zi),this}getVisible(){return this.Zi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}const Rn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.pi(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.pi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},Ai({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},Ai({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),se(s)}},Dn=(t,e,i,s,r)=>{Rn(t,r,e)},Pn=(t,e,i,s,r)=>{Rn(t,s,r)};class On extends Fn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.ji=!1,this.Lu=void 0,this.Ru=void 0,this.Eu=zn,this.zu=void 0,this.Yo=!0,this.Vu=()=>{const t="function"==typeof this.Eu?this.Eu(this):this.Eu;t&&(this.Ru=this.Rs.cs.tn(t))},this.Ou=()=>{this.Rs.cs.sn(this.Ru)},this.Xt=A(0,0,0,0),this.Rs=t,this.renderingScale=e,this.scale=i,this.Zo=s,this.ts=r,this.Rs.Ms(),this.onMouseEnter(this.Vu),this.onMouseLeave(this.Ou),this.onMouseDrag(Dn);const n=ns(new hs(Ot,Pn,Ot));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.ts=r}setMouseInteractions(t){return this.Nu().forEach((e=>e.setMouseInteractions(t))),this.Yo=t,this}getMouseInteractions(){return this.Yo}setEffect(t){return this.hs=this.hs||this.Rs.cs.hs.rs(this,{Gu:{shapes:this.Nu()}}),this.hs.Gu.bs(t),this}getEffect(){return!!this.hs&&this.hs.Gu._s()}setAutoDispose(t){return this.zu=t,this.Rs.Ms(),this}getAutoDispose(){return this.zu}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Xt.left+this.Xt.right),this.size.y+(this.Xt.bottom+this.Xt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Xt="object"==typeof t?S(this.Xt,t):{left:t,top:t,right:t,bottom:t},this.Rs.Ms(),this}getMargin(){return this.Xt}ze(){if(this.zu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.zu.type&&i.x>=this.zu.maxWidth||"max-height"===this.zu.type&&i.y>=this.zu.maxHeight)&&this.dispose()}return this}Os(){return this}dispose(){return this.ji||(this.Rs.Ms(),this.ji=!0,this.Zo(this),this.R.emit("dispose",this),this.Nu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Nu().forEach((e=>e.setVisible(t))),this.Rs.Ms(),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setPosition(t){return this.position=t,this.Rs.Ms(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,Ai({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,Ai({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.pi(r,{x:this.Xt.left,y:this.Xt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.pi(n,Ai({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Rs.Ms(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Lu=t,this.Rs.Ms(),this}getDraggingMode(){return void 0!==this.Lu?this.Lu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Eu=t,this}getMouseStyle(){return this.Eu}}class Ln extends On{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ia=A(),this.Uu=0,this.Rs=t,this.Wu=s,this.backgroundElement=new this.Wu(this.Rs,this.renderingScale,this.scale,Ot,n),this.Bu(this.backgroundElement)}Nu(){return this.backgroundElement.Nu()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}ze(){return super.ze(),this.ji||(void 0!==this.oa&&(this.backgroundElement.oa=this.oa-.01),this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).ze()),this}Os(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Yu(t).Os(),super.Os()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Ia="object"==typeof t?S(this.Ia,t):{left:t,top:t,right:t,bottom:t},this.Rs.Ms(),this}getPadding(){return this.Ia}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Ia.left+this.Ia.right,i.y+this.Ia.bottom+this.Ia.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Hu()+this.backgroundElement.$u(),i.y+this.backgroundElement.Xu()+this.backgroundElement.ju())),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.pi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.pi(n,Ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Hu(),y:this.backgroundElement.Xu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,Ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.pi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.pi(a,Ai({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return super.setMouseInteractions(t),this.backgroundElement.setMouseInteractions(t),this}getHighlight(){return this.Uu}setHighlight(t){return this.Uu=ke(t),this.backgroundElement.setHighlight(t),this.R.emit("highlight",this,t),this}}const _n=t=>"setBackground"in t;class Bn extends Fn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.M=0,this.Zu=1,this.Qu=!0,this.Ju=new vr,this.Ku=!0,this.ji=!1,this.axisScale=s,this.renderingScale=r,this.qu=o,this.tc=h,this.ic=a,this.Zo=l,this.sc=e,this.hc=i,this.rc=this.Bu(this.sc.He(this.renderingScale)),this.ts=u,this.nc=this.Bu(this.ic.setDirection(this.tc).oc(this.hc,this.renderingScale,n,Ot,this.ts,!1).setOrigin(ee(this.tc))),this.axis=t,this.setMouseInteractions(!1),"major"===this.nc.ac?this.rc.Ye(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.nc.ac?this.rc.Ye(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.nc.ac&&this.rc.Ye(u.cursorGridStrokeStyleX)}setValue(t){return this.M=t,this.hc.Ms(),this.R.emit("valueChange",this,this.M),this}getValue(){return this.M}setTextFormatter(t){return this.lc=t,this.hc.Ms(),this}setTickLength(t){return this.nc.setPointerLength(t),this.sc.Ms(),this}getTickLength(){return this.nc.getPointerLength()}setTickLabelPadding(t){return this.nc.setTickLabelPadding(t),this.sc.Ms(),this}setTickLabelRotation(t){return this.nc.setTextRotation(t),this.sc.Ms(),this}getTickLabelRotation(){return this.nc.getTextRotation()}getTickLabelPadding(){return this.nc.getTickLabelPadding()}setGridStrokeLength(t){return this.Zu=t,this.sc.Ms(),this}getGridStrokeLength(){return this.Zu}setGridStrokeStyle(t){return this.rc.Ye(t),this.sc.Ms(),this}getGridStrokeStyle(){return this.rc.xu()}dispose(){return this.ji||(this.ji=!0,this.rc.dispose(),this.nc.dispose(),this.Zo(this),this.sc.cs.Ms(),this.R.emit("dispose",this)),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMarkerVisible(t){return this.Qu=t,this.hc.Ms(),this}getMarkerVisible(){return this.Qu}setMarker(t){return t(this.nc),this.hc.Ms(),this}getMarker(){return this.nc}setMouseInteractions(t){return this.nc.setMouseInteractions(t),this.rc.setMouseInteractions(t),this}getMouseInteractions(){return this.rc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.Ku=t,this.hc.Ms(),this}getAllocatesAxisSpace(){return this.Ku}isInScale(){return ti(this.M,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}}class Vn extends Bn{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.uc=!1,this.Zo=a,this.sc=e,this.hc=i}dispose(){return this.uc=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.uc=!1;const t=mt(this.M,this.axisScale,this.qu.getWidth(this.renderingScale));this.rc.setVisible(!0).Xe(this.qu.toPoint(t,e)).$e(this.qu.toPoint(t,e-(s+i*this.Zu))),this.Qu?(this.lc&&this.nc.setText(this.lc(this.M,this)),this.nc.setVisible(!0).setPosition(this.qu.toPoint(t,r))):this.nc.setVisible(!1)}else this.rc.setVisible(!1),this.nc.setVisible(!1);return this.nc.Os().ze(),this}cc(){const t=this.nc.Os().getSize();return this.qu.getHeight(t)}}const Gn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Nn=(t,e)=>(pe(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),Un=(t,e,i)=>{i&&_n(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Yn={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}}},Xn={oc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return Un(o,r,n),o}},Wn={oc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return Un(o,r,n),o}};class jn extends On{constructor(){super(...arguments),this.dc=!0}ze(){return super.ze(),this}setMouseInteractions(t){return this.dc=t,this}getMouseInteractions(){return this.dc}Nu(){return[]}}class $n extends jn{onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}Yu(t){return this.size=t,this}Hu(){return 0}$u(){return 0}ju(){return 0}Xu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return _}setStrokeStyle(){return this}getStrokeStyle(){return ut}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Zn extends On{constructor(){super(...arguments),this.R=new r.Eventer,this.Uu=0}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.Uu}setHighlight(t){return this.Uu=t,this.Nu().forEach((e=>e.ds(t))),this.R.emit("highlight",this,t),this.Rs.Ms(),this}}class qn extends Zn{}class Kn extends qn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Rs=t,this.qa=this.Rs.fc(this.renderingScale,Tn.Simple).setVisible(!1).Re(_).Le(ut),this.Bu(this.qa)}Ac(){const t=this.gc();if(t.length>2){const e=ni(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=yi(t,mi(e.min,-1));return this.scale.pi(this.position,yi(s,Ai(mi(yi(this.origin,u(1,1)),-.5),i)))})).map((t=>yt(t,this.scale,this.renderingScale)));this.qa.Fl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.qa&&this.qa.setVisible(!1),this.setContentSize(u(0,0))}ze(){return super.ze(),this.ji||(this.Ac(),void 0!==this.oa&&this.qa.ua(this.oa)),this}Os(){return this.Ac(),super.Os()}setVisible(t){return super.setVisible(t),this.qa.setVisible(t),this}}const Jn=(t,e,i)=>t*(1-i)+e*i,Qn=(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=Jn(i.value,r.value,n),c=Jn(e.value,s.value,h);return Jn(c,u,l)},to={warm:t=>e=>w(60/(t-1)*e,.8,.8),cold:t=>e=>w(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>w(360/t*e,.8,.8),reverseSpectrum:t=>e=>w(360/t*(t-e),.8,.8),flatUI:t=>e=>w(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return w(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return w(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return w(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return w(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return w(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>w(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return w(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return w(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),w(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return w(0,0,s);const r=e.getR()/255,n=e.getG()/255,o=e.getB()/255,h=Math.max(r,n,o),a=Math.min(r,n,o);let l=0;if(h!==a){const t=h-a;switch(h){case r:l=(n-o)/t+(nr=>n=>w(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>eo([{value:0,hex:"#23FF7A"},{value:1/9,hex:"#03E65D"},{value:2/9,hex:"#04D155"},{value:3/9,hex:"#00B849"},{value:4/9,hex:"#00A869"},{value:5/9,hex:"#008F68"},{value:6/9,hex:"#00815E"},{value:7/9,hex:"#017153"},{value:8/9,hex:"#704A85"},{value:1,hex:"#743A70"}],t,e),blueSciFi:t=>e=>eo([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#E2E7FF"},{value:2/9,hex:"#ACB9F8"},{value:3/9,hex:"#889DFF"},{value:4/9,hex:"#547EEF"},{value:5/9,hex:"#4068D8"},{value:6/9,hex:"#2B50B7"},{value:7/9,hex:"#1B3E9F"},{value:8/9,hex:"#8D1395"},{value:1,hex:"#780A74"}],t,e),light:t=>e=>eo([{value:0,hex:"#FECC00"},{value:1/9,hex:"#F7B300"},{value:2/9,hex:"#EF9900"},{value:3/9,hex:"#E88000"},{value:4/9,hex:"#E06600"},{value:5/9,hex:"#DD5A00"},{value:6/9,hex:"#D94D00"},{value:7/9,hex:"#D13300"},{value:8/9,hex:"#C91A00"},{value:1,hex:"#C10000"}],t,e),monochrome:t=>e=>eo([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#EEEEEE"},{value:2/9,hex:"#DCDCDC"},{value:3/9,hex:"#C1C1C1"},{value:4/9,hex:"#A4A2A2"},{value:5/9,hex:"#8B8B8B"},{value:6/9,hex:"#787878"},{value:7/9,hex:"#656565"},{value:8/9,hex:"#565555"},{value:1,hex:"#434343"}],t,e),night:t=>e=>eo([{value:0,hex:"#F0F9E0"},{value:1/9,hex:"#C9DFA4"},{value:2/9,hex:"#B5C796"},{value:3/9,hex:"#8998B7"},{value:4/9,hex:"#6E7E9E"},{value:5/9,hex:"#5C6D8F"},{value:6/9,hex:"#47587A"},{value:7/9,hex:"#374B72"},{value:8/9,hex:"#273C65"},{value:1,hex:"#192847"}],t,e),sunset2:t=>e=>eo([{value:0,hex:"#22334D"},{value:1/9,hex:"#82062C"},{value:2/9,hex:"#AB001D"},{value:3/9,hex:"#D80428"},{value:4/9,hex:"#CF5D1B"},{value:5/9,hex:"#CF8229"},{value:6/9,hex:"#CF9D29"},{value:7/9,hex:"#C4BE25"},{value:8/9,hex:"#E1DC49"},{value:1,hex:"#FFFA67"}],t,e)},eo=(t,e,i)=>{const s=so(e,i),[r,n]=ro(s,t),o=io(t[r]),h=io(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Jn(o.h,h.h,a),s:Jn(o.s,h.s,a),v:Jn(o.v,h.v,a)};return w(l.h,l.s,l.v)},io=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,r=Math.max(e,i,s),n=Math.min(e,i,s);let o=0;const h=r,a=r-n,l=0===r?0:a/r;if(r===n)o=0;else{switch(r){case e:o=(i-s)/a+(i{const i=e/t;return i<0?0:i>1?1:i},ro=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),mo=s.Record({type:"icon",width:void 0,height:void 0,yc:void 0,mc:Ot,vc:Ot});class yo extends mo{constructor(t,e,i,s){super({...s,yc:t,mc:e,vc:i})}dispose(){return this.vc(this),this}setWidth(t){const e=this.set("width",t);return this.mc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.mc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.mc(i),i}oi(){if(!this.yc)return{x:0,y:0};const t=this.yc.width,e=this.yc.height;if(0===t||0===e)return{x:0,y:0};const i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const po=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),Ao=s.Record({type:"glow",color:C(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class xo extends Ao{constructor(t){super(t)}setSpread(t){return this.set("spread","function"==typeof t?t(this.get("spread")):t)}getSpread(){return this.get("spread")}setBlur(t){return this.set("blur","function"==typeof t?t(this.get("blur")):t)}getBlur(){return this.get("blur")}setColor(t){return this.set("color","function"==typeof t?t(this.get("color")):t)}getColor(){return this.get("color")}setOffset(t){return this.set("offset","function"==typeof t?t(this.get("offset")):t)}getOffset(){return this.get("offset")}}class So{constructor(t){this.Sc=0,this.xc=0,this.bc=0,this.Mc=!1,this._c=!0,this.wc=!1,this.Cc={warningDisplayed:!1,expandEvents:[]},this.R=new r.Eventer,this._c=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.kc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.Tc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Fc=void 0!==(null==t?void 0:t.colors)&&t.colors,this.Ic=void 0!==(null==t?void 0:t.ids)&&t.ids,this.Pc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.Dc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.Bc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.Lc=!1!==(null==t?void 0:t.allowInputModification)}add(t){return Array.isArray(t)?this.appendJSON(t,{x:"x",y:"y"}):this.appendSample(t),this}addArraysXY(t,e){return this.appendSamples({xValues:t,yValues:e}),this}appendJSON(t,e={x:"x",y:"y"}){const i=t.length,s=e.x,r=e.y,n=e.lookupValue,o=e.size,h=e.rotation,a=e.color,l=e.id;let u,c,d,f,g,m,y;if(s){u=new this.Bc(i);const e=t[0]&&t[0][s]instanceof Date,r=t[0]&&ko(t[0][s]);if(!r&&t[0]&&"string"==typeof t[0][s])throw new Error("LightningChart JS error - XY coordinate supplied as unrecognized String format. Coordinates must be Numbers, Date objects or ISO 8601 Date strings");if(r)for(let e=0;ea-1&&(this.Sc=0,this.Mc=!0),this.xc=Math.min(this.xc+1,a),this.bc+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:r,rotations:n,start:o,step:h}=t;let a=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(a=void 0!==a?a:0,l=void 0!==l?l:c-a,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:a,f=void 0!==t.offsetColors?t.offsetColors:a,g=void 0!==t.offsetIds?t.offsetIds:a,m=void 0!==t.offsetSizes?t.offsetSizes:a,y=void 0!==t.offsetRotations?t.offsetRotations:a,p=this.Wc(!0),[A,x]=this.Yc(l,t.xValues,"x","ProgressiveX"===p||"RegressiveX"===p||void 0===p?o:void 0,"ProgressiveX"===p||"RegressiveX"===p||void 0===p?h:void 0,a,p),[S,v]=this.Yc(l,t.yValues,"y","ProgressiveY"===p||"RegressiveY"===p?o:void 0,"ProgressiveY"===p||"RegressiveY"===p?h:void 0,a,p),b=this.Gc(i),{samplesCacheX:M,samplesCacheY:C,samplesCacheLookup:T,samplesCacheColors:w,samplesCacheIDs:E,samplesCacheSize:k,samplesCacheRotation:I,maxSampleCount:z,dataPattern:F,incomingDataReplacedCache:R}=this.Rc({appendCount:l,...0===x&&0===v&&0===a&&0===d&&0===f&&0===g&&0===m&&0===y?{incomingDataX:A,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!R&&F&&this._c&&this.zc&&this.Vc){const t=A[x],i=S[v];if(!this.Oc(F,t,i)&&!this.wc)return this.Nc(this.zc,this.Vc,wo(A,x,x+l),wo(S,v,v+l),wo(e,d,d+l),wo(b,f,f+l),wo(s,g,g+l),wo(r,m,m+l),wo(n,y,y+l),F),this}const D=z-this.Sc,P=Math.min(l,D);if(P>0&&(R||(Co(M,A,x,P,this.Sc),Co(C,S,v,P,this.Sc),e&&T&&Co(T,e,d,P,this.Sc),s&&E&&Co(E,s,g,P,this.Sc),b&&w&&Co(w,b,f,P,this.Sc),r&&k&&Co(k,r,m,P,this.Sc),n&&I&&Co(I,n,y,P,this.Sc)),this.Uc(this.Sc,this.Sc+P-1),this.Sc+=P,this.Sc>z-1&&(this.Sc=0,this.Mc=!0)),this.xc=Math.min(this.xc+P,z),this.bc+=P,this.Wc(),l-P>0){const t={xValues:A?wo(A,x+P,void 0):void 0,yValues:S?wo(S,v+P,void 0):void 0,lookupValues:e?wo(e,d+P,void 0):void 0,ids:s?wo(s,g+P,void 0):void 0,colors:b?wo(b,f+P,void 0):void 0,sizes:r?wo(r,m+P,void 0):void 0,rotations:n?wo(n,y+P,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.zc||this.Vc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.zc=this.zc||new this.Bc(i),this.zc.fill(t.x)),void 0!==t.y&&(this.Vc=this.Vc||new this.Bc(i),this.Vc.fill(t.y)),void 0!==t.lookupValue&&(this.Hc=this.Hc||new Float32Array(i),this.Hc.fill(t.lookupValue)),void 0!==t.color){const e=this.Gc([t.color]);e&&(this.$c=this.$c||new Uint32Array(i),this.$c.fill(e[0]))}return void 0!==t.size&&(this.Xc=this.Xc||new Float32Array(i),this.Xc.fill(t.size)),void 0!==t.rotation&&(this.jc=this.jc||new Float32Array(i),this.jc.fill(t.rotation)),this.R.emit("cleared"),this}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a}=e;let l=e.offset,u=e.count;const c=i||s||r||n||o||h||a,d=c?c.length:void 0!==e.x||void 0!==e.y?1:0;if(l=void 0!==l?l:0,u=void 0!==u?u:d-l,u<=0)return this;const f=void 0!==e.offsetLookupValues?e.offsetLookupValues:l,g=void 0!==e.offsetColors?e.offsetColors:l,m=void 0!==e.offsetIds?e.offsetIds:l,y=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,A=this.Gc(n),x=this.bc-1,S=void 0!==this.Zc?Math.max(this.bc-this.Zc,0):0,v=t+u-1,b=Math.max(t,S),M=Math.min(v,x),C=M-b+1;if(this.bc>0&&C>0){const{samplesCacheX:n,samplesCacheY:u,samplesCacheColors:c,samplesCacheIDs:d,samplesCacheLookup:x,samplesCacheSize:v,samplesCacheRotation:T}=this.Rc({appendCount:0}),w=n.length;if(void 0!==this.Zc&&this.Mc&&this.bc%this.Zc!=0){const S=this.bc-this.bc%this.Zc,C=this.bc-1,E=this.bc-this.xc,k=S-1,I=Math.max(b,E),z=Math.min(M,k)-I+1;if(z>0){const S=I-t,b=vo(I,this.bc,w,this.Sc);if(void 0!==e.x)for(let t=b;t0){const S=F-t,b=vo(F,this.bc,w,this.Sc);if(void 0!==e.x)for(let t=b;t0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:y+e,offsetRotations:p+e,count:T})}return this}alterSamplesByID(t,e){if(!this.Ic)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Qc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Gc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.Bc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.Bc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Gc(e.colors),l=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,u=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,c=s.length,d=this.xc,f=this.bc-1,g=Math.max(f-d+1,0);for(let d=0;ds[vo(t,this.bc,c,this.Sc)])),y=vo(m,this.bc,c,this.Sc);s[y]===i&&(void 0!==e.x&&this.zc&&(this.zc[y]=e.x),void 0!==e.y&&this.Vc&&(this.Vc[y]=e.y),void 0!==e.lookupValue&&this.Hc&&(this.Hc[y]=e.lookupValue),void 0!==e.size&&this.Xc&&(this.Xc[y]=e.size),void 0!==e.rotation&&this.jc&&(this.jc[y]=e.rotation),void 0!==r&&this.$c&&(this.$c[y]=r),n&&this.zc&&(this.zc[y]=n[d]),o&&this.Vc&&(this.Vc[y]=o[d]),h&&this.Hc&&(this.Hc[y]=h[d]),a&&this.$c&&(this.$c[y]=a[d]),l&&this.Xc&&(this.Xc[y]=l[d]),u&&this.jc&&(this.jc[y]=u[d]))}return this.R.emit("cleared"),this}clear(){return this.Sc=0,this.xc=0,this.bc=0,this.Mc=!1,this.R.emit("cleared"),this}getSampleCount(){return this.xc}getNextSampleIndex(){return this.bc}setMaxSampleCount(t){if("object"==typeof t){this.Jc&&this.offMaxSampleCountExceeded(this.Jc);const e=t.max,i=t.initial,s=t=>{const i=this.Zc||0;if(void 0!==e&&i>=e)return;let s=Math.max(2*i,t);void 0!==e&&(s=Math.min(s,e)),this.setMaxSampleCount(s)};this.Jc=this.onMaxSampleCountExceeded(((t,e,i,r)=>{s(r)})),void 0===this.Zc&&(void 0!==i?this.setMaxSampleCount(i):this.setMaxSampleCount(Math.min(2*this.xc,void 0!==e?e:Number.MAX_SAFE_INTEGER)))}else if("number"==typeof t){const e=t;if(void 0!==this.Zc&&this.Zc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.zc||!this.Vc)return this.Zc=e,this;if(e===this.Zc)return this;if(this.Mc&&0!==this.Sc)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to expand data set that has exceeded its max sample count. This is currently not supported.");this.Zc=e,this.xct+e.count),0),n=new this.Bc(r),o=new this.Bc(r),h=this.Fc?new Uint32Array(r):void 0,a=this.Tc?new Float32Array(r):void 0,l=this.Ic?new Uint32Array(r):void 0,u=this.Pc?new Float32Array(r):void 0,c=this.Dc?new Float32Array(r):void 0;let d=0;for(const t of s)n.set(this.zc.subarray(t.offset,t.offset+t.count),d),o.set(this.Vc.subarray(t.offset,t.offset+t.count),d),this.Fc&&h&&this.$c&&h.set(this.$c.subarray(t.offset,t.offset+t.count),d),this.Tc&&a&&this.Hc&&a.set(this.Hc.subarray(t.offset,t.offset+t.count),d),this.Ic&&l&&this.Qc&&l.set(this.Qc.subarray(t.offset,t.offset+t.count),d),this.Pc&&u&&this.Xc&&u.set(this.Xc.subarray(t.offset,t.offset+t.count),d),this.Dc&&c&&this.jc&&c.set(this.jc.subarray(t.offset,t.offset+t.count),d),d+=t.count;return{xValues:n,yValues:o,iSampleFirst:i,lookupValues:a,colors:h,ids:l,sizes:u,rotations:c}}onMaxSampleCountExceeded(t){return this.R.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.R.off(t)}Yc(t,e,i,s,r,n,o){if(void 0===e){const e=this.Ec();r=void 0!==r?r:o&&qr(o)===i?Kr(o)?1:-1:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.Bc(t);for(let e=0;ee){l=t;break}const c={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l};this.wc=!0,this.appendSamples(c),this.wc=!1}else{const l=t.length,u=this.xc,f=this.bc-1,y=Math.max(f-u+1,0),p=Mo(m,y,f,c,(t=>d[vo(t,this.bc,l,this.Sc)])),A=p-1,x=p+1,S=d[vo(p,this.bc,l,this.Sc)],v=x<=this.bc-1?d[vo(x,this.bc,l,this.Sc)]:void 0,b=void 0!==v&&(c&&vm)?x+1:c&&Sm?p+1:A+1,M=f-b+1,C=new this.Bc(M),T=new this.Bc(M),w=this.Tc?new Float32Array(M):void 0,E=this.Fc?new Uint32Array(M):void 0,k=this.Ic?new Uint32Array(M):void 0,I=this.Pc?new Float32Array(M):void 0,z=this.Dc?new Float32Array(M):void 0;let F=0;for(let i=b;i<=f;i+=1){const s=vo(i,this.bc,l,this.Sc);C[F]=t[s],T[F]=e[s],w&&this.Hc&&(w[F]=this.Hc[s]),E&&this.$c&&(E[F]=this.$c[s]),k&&this.Qc&&(k[F]=this.Qc[s]),I&&this.Xc&&(I[F]=this.Xc[s]),z&&this.jc&&(z[F]=this.jc[s]),F+=1}this.td(M);const R=new this.Bc(g+M);R.set(i),R.set(C,g);const D=new this.Bc(g+M);let P,O,L,_,B;D.set(s),D.set(T,g),r&&w&&(P=new Float32Array(g+M),P.set(r),P.set(w,g)),n&&E&&(O=new Uint32Array(g+M),O.set(n),O.set(E,g)),o&&k&&(L=new Uint32Array(g+M),L.set(o),L.set(k,g)),h&&I&&(_=new Float32Array(g+M),_.set(h),_.set(I,g)),a&&z&&(B=new Float32Array(g+M),B.set(a),B.set(z,g)),this.wc=!0,this.appendSamples({xValues:R,yValues:D,lookupValues:P,colors:O,ids:L,sizes:_,rotations:B}),this.wc=!1,this.R.emit("cleared")}}Kc(){return this.Wc()}Wc(t=!1){let e;if(this.kc&&"userSpecified"in this.kc)e=this.kc.userSpecified;else if(this.kc&&"autoDetectResult"in this.kc)e=this.kc.autoDetectResult;else if(this.zc&&this.Vc&&this.bc>0&&!t){const t=void 0!==this.Zc&&this.Mc?this.Sc:0,i=this.xc-1,s=void 0!==this.Zc&&this.Mc?0:void 0,r=void 0!==this.Zc&&this.Mc?this.Sc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-t)?[s,r]:[t,i];if(1+o-n>=2){let t,i,s=this.zc[n],r=this.Vc[n];for(let e=n+1;e<=o;e+=1){if(!1!==t){const i=this.zc[e],r=Math.sign(i-s);0!==r&&t&&t.direction!==r?t=!1:0===r||t||(t={direction:r}),s=i}if(!1!==i){const t=this.Vc[e],s=Math.sign(t-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=t}}e=t&&t.direction>0?Zr.ProgressiveX:t&&t.direction<0?Zr.RegressiveX:i&&i.direction>0?Zr.ProgressiveY:i&&i.direction<0?Zr.RegressiveY:void 0,this.kc={autoDetectResult:e},e&&zt.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${e}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${e}'} } to your application when creating series or DataSetXY to clear this warning.`)}}return e}Oc(t,e,i){const s=this.Ec();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.Cc.expandEvents.push({timestamp:i}),this.Cc.expandEvents.length>5)return zt.console.warn("LightningChart JS warning - DataSetXY append operation was performed more than 5 times in 5 seconds.\nAutomatic max sample count control was enabled.\nFor streaming applications, DataSetXY.setMaxSampleCount() or Series.setMaxSampleCount() should be configured explicitly to get rid of this warning."),this.Cc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.Rc(t)}const i=new this.Bc(e);i.set(this.zc),this.zc=i;const s=new this.Bc(e);if(s.set(this.Vc),this.Vc=s,this.Tc){const t=new Float32Array(e);this.Hc&&t.set(this.Hc),this.Hc=t}if(this.Ic){const t=new Uint32Array(e);this.Qc&&t.set(this.Qc),this.Qc=t}if(this.Fc){const t=new Uint32Array(e);this.$c&&t.set(this.$c),this.$c=t}if(this.Pc){const t=new Float32Array(e);this.Xc&&t.set(this.Xc),this.Xc=t}if(this.Dc){const t=new Float32Array(e);this.jc&&t.set(this.jc),this.jc=t}return this.Sc=this.xc,{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.$c,samplesCacheSize:this.Xc,samplesCacheRotation:this.jc,maxSampleCount:e}}if(i>4*e){const t=new this.Bc(e);t.set(this.zc.subarray(0,this.xc)),this.zc=t;const i=new this.Bc(e);if(i.set(this.Vc.subarray(0,this.xc)),this.Vc=i,this.Tc){const t=new Float32Array(e);this.Hc&&t.set(this.Hc.subarray(0,this.xc)),this.Hc=t}if(this.Ic){const t=new Uint32Array(e);this.Qc&&t.set(this.Qc.subarray(0,this.xc)),this.Qc=t}if(this.Fc){const t=new Uint32Array(e);this.$c&&t.set(this.$c.subarray(0,this.xc)),this.$c=t}if(this.Pc){const t=new Float32Array(e);this.Xc&&t.set(this.Xc.subarray(0,this.xc)),this.Xc=t}if(this.Dc){const t=new Float32Array(e);this.jc&&t.set(this.jc.subarray(0,this.xc)),this.jc=t}return{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.$c,samplesCacheSize:this.Xc,samplesCacheRotation:this.jc,maxSampleCount:e}}return{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.$c,samplesCacheSize:this.Xc,samplesCacheRotation:this.jc,maxSampleCount:i}}return t.appendCount+this.xc>this.Zc&&this.R.emit("maxSampleCountExceeded",this,this.xc,this.Zc,this.xc+t.appendCount),this.zc=this.zc||new this.Bc(this.Zc),this.Vc=this.Vc||new this.Bc(this.Zc),this.Hc=this.Hc||(this.Tc?new Float32Array(this.Zc):void 0),this.Qc=this.Qc||(this.Ic?new Uint32Array(this.Zc):void 0),this.$c=this.$c||(this.Fc?new Uint32Array(this.Zc):void 0),this.Xc=this.Xc||(this.Pc?new Float32Array(this.Zc):void 0),this.jc=this.jc||(this.Dc?new Float32Array(this.Zc):void 0),{dataPattern:this.Wc(),samplesCacheX:this.zc,samplesCacheY:this.Vc,samplesCacheLookup:this.Hc,samplesCacheIDs:this.Qc,samplesCacheColors:this.$c,samplesCacheSize:this.Xc,samplesCacheRotation:this.jc,maxSampleCount:this.Zc}}sd(){if(!this.zc||!this.Vc||0===this.xc)return;if(void 0===this.Zc)return this.bc>0?{x:this.zc[0],y:this.Vc[0]}:void 0;if(!this.Mc)return{x:this.zc[0],y:this.Vc[0]};let t=this.Sc-this.xc;return t<0&&(t+=this.Zc),{x:this.zc[t],y:this.Vc[t]}}Ec(){if(!this.zc||!this.Vc||0===this.xc)return;if(void 0===this.Zc){const t=this.xc-1;return t>=0?{x:this.zc[t],y:this.Vc[t]}:void 0}let t=this.Sc-1;return t<0&&(t+=this.Zc),{x:this.zc[t],y:this.Vc[t]}}ed(t){if(!this.zc||!this.Vc)return;const e=this.zc.length,i=this.xc,s=this.bc-1,r=Math.max(s-i+1,0)+t,n=vo(r,this.bc,e,this.Sc);return{x:this.zc[n],y:this.Vc[n],lookupValue:this.Tc&&this.Hc?this.Hc[n]:void 0,id:this.Ic&&this.Qc?this.Qc[n]:void 0,color:this.Fc&&this.$c?this.$c[n]:void 0,size:this.Pc&&this.Xc?this.Xc[n]:void 0,rotation:this.Dc&&this.jc?this.jc[n]:void 0,iSample:r}}hd(t,e,i,s){const r=this.Wc(),n=this.zc,o=this.Vc;if(!n||!o)return;const h=(t,e)=>({x:n[t],y:o[t],lookupValue:this.Tc&&this.Hc?this.Hc[t]:void 0,id:this.Ic&&this.Qc?this.Qc[t]:void 0,color:this.Fc&&this.$c?this.$c[t]:void 0,size:this.Pc&&this.Xc?this.Xc[t]:void 0,rotation:this.Dc&&this.jc?this.jc[t]:void 0,iSample:e}),a=n.length,l=this.xc,u=this.bc-1,c=Math.max(u-l+1,0);if(r){const i=Kr(r),s=this.sd(),n=this.Ec();if(!(s&&n&&this.zc&&this.Vc))return;const o="ProgressiveX"===r||"RegressiveX"===r?"x":"y",l="x"===o?"y":"x",d="x"===o?this.zc:this.Vc,f="x"===l?this.zc:this.Vc,g=t[o],m=Math.min(s[o],n[o]),y=Math.max(s[o],n[o]);if(gy)return;const p=Mo(g,c,u,i,(t=>d[vo(t,this.bc,a,this.Sc)])),A=vo(p,this.bc,a,this.Sc);if(!e)return h(A,p);const x=p-1,S=p+1,v=d[A],b=i?g>=v?S<=u?S:void 0:x>=c?x:void 0:g<=v?S<=u?S:void 0:x>=c?x:void 0;if(void 0===b)return;const M=vo(b,this.bc,a,this.Sc),C=pb?{pos:d[A],val:f[A],iSample:p}:{pos:d[M],val:f[M],iSample:b},w=(g-C.pos)/(T.pos-C.pos),E=Jn(C.val,T.val,w);return"x"===qr(r)?{x:g,y:E,iSample:Jn(C.iSample,T.iSample,w)}:{y:g,x:E,iSample:Jn(C.iSample,T.iSample,w)}}let d,f=Number.MAX_VALUE;const g=yt(t,i,s),m=this.xc-1;for(let t=0;t<=m;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=mt(e,i.x,s.x),o=mt(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,bo=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=Kr(o),l=i.length,u=s-1,c=Math.max(u-r+1,0),d=Mo(t,c,u,a,(t=>i[vo(t,s,l)])),f=Mo(e,c,u,a,(t=>i[vo(t,s,l)])),g=Math.min(d,f),m=Math.max(d,f),y=Math.max(g-h,c),p=Math.min(m+h,u),A=vo(y,s,l),x=vo(p,s,l);return A>x?{iFirstSample:y,iLastSample:p,iFirstSampleDataArray:A,iLastSampleDataArray:x,dataRanges:[{offset:A,count:l-A},{offset:0,count:x+1}]}:{iFirstSample:y,iLastSample:p,iFirstSampleDataArray:A,iLastSampleDataArray:x,dataRanges:[{offset:A,count:x-A+1}]}},Mo=(t,e,i,s,r)=>{const n=i;for(;e!==i;){const n=Math.ceil((e+i)/2),o=r(n);s&&to?i=n-1:e=n}const o=Math.abs(t-r(e));return e{const n=e.length;if(Array.isArray(e))for(let n=0;nvoid 0===t?void 0:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),wo=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)},Eo=/^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|[+-]\d{2}:\d{2})?)?$/,ko=t=>"string"==typeof t&&Eo.test(t)&&!zt.isNaN(Date.parse(t));class Io extends Zn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ba="label",this.qa=this.Rs.Wr(this.renderingScale).Sr(this.ba).Re(_).Gr(Le).Ur(Le),this.setMargin(5),this.Bu(this.qa)}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}ze(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=yt(t,this.scale,this.renderingScale);return this.qa.Ve(i),this}Os(){this.qa.Os(),void 0!==this.oa&&this.qa.ua(this.oa);const t=0===this.ba.length?u(0,0):this.qa.od();return this.setContentSize(t),super.Os()}setText(t){return this.ba=t,this.qa.Sr(this.ba),this.Rs.Ms(),this}getText(){return this.ba}setFont(t){return this.qa.ir(t),this.Rs.Ms(),this}getFont(){return this.qa.tr()}setTextRotation(t){return this.qa.sr(t),this.Rs.Ms(),this}getTextRotation(){return this.qa.er()}}const zo={...Yn,...Xn,uiElement:Io};class Fo extends qn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ad=!1,this.fitTo=this.Yu.bind(this),this.setSize=this.fitTo,this.qa=this.Rs.fc(e).Re(_).Le(ut),this.Bu(this.qa)}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}ze(){void 0!==this.oa&&this.qa.ua(this.oa);const t=ni([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>yt(t,this.scale,this.renderingScale))));return this.ad?this.qa.Fl([{x:(t.min.x+t.max.x)/2,y:t.min.y},{x:t.min.x,y:(t.min.y+t.max.y)/2},{x:(t.min.x+t.max.x)/2,y:t.max.y},{x:t.max.x,y:(t.min.y+t.max.y)/2}]):this.qa.Fl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Yu(t){return this.setContentSize(t),this.Rs.Ms(),this}Hu(){return 0}$u(){return 0}ju(){return 0}Xu(){return 0}}class Ro extends qn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ld=u(0,0),this.qa=t.ud(e).Au(0).$e(360).Re(_).Le(ut),this.Bu(this.qa)}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}ze(){void 0!==this.oa&&this.qa.ua(this.oa);const t=this.getSize(e.UISpace.Content).x/2;return this.qa.pu(t*this.renderingScale.Ui().x).yu(t*this.renderingScale.Ui().y).Ve(yt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).vu(255).Os(),this}Yu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.ld=t,this.Rs.Ms(),this}Hu(){return(this.getSize(e.UISpace.Content).x-this.ld.x)/2}$u(){return(this.getSize(e.UISpace.Content).x-this.ld.x)/2}ju(){return(this.getSize(e.UISpace.Content).y-this.ld.y)/2}Xu(){return(this.getSize(e.UISpace.Content).y-this.ld.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.ld=t,this}}class Do extends Kn{constructor(t,e,i,s,r){super(t,e,i,Tn.Simple,s,r),this.dd=p(u(0,0)),this.fd=!1,this.Rs=t,this.Ac()}gc(){const t=this.dd.C();if(this.fd){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.dd.C().x*this.dd.C().x/4+this.dd.C().y*this.dd.C().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=yi(r,yi(i,s)),o=yi(n,yi(s,mi(i,-1)));return[r,n,o,pi(o,yi(i,s))]}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}Yu(t){return this.dd._(t),this.fd=!1,this.Rs.Ms(),this}Hu(){return this.fd?0:(this.getSize(e.UISpace.Content).x-this.dd.C().x)/2}$u(){return this.fd?0:(this.getSize(e.UISpace.Content).x-this.dd.C().x)/2}ju(){return this.fd?0:(this.getSize(e.UISpace.Content).y-this.dd.C().y)/2}Xu(){return this.fd?0:(this.getSize(e.UISpace.Content).y-this.dd.C().y)/2}fitTo(t){return this.dd._(t),this.fd=!0,this.Rs.Ms(),this}}class Po extends Kn{constructor(t,i,s,r,n){super(t,i,s,Tn.Simple,r,n),this.Ad=p(u(0,0)),this.gd=p(10),this.pd=p(void 0),this.tc=p(e.UIDirections.Right),this.Ac()}Nu(){return[this.qa]}setFillStyle(t){return this.qa.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Jh()}setStrokeStyle(t){return this.qa.Le(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.So()}setDirection(t){return this.tc._(t),this.Rs.Ms(),this}getDirection(){return this.tc.C()}setPointerLength(t){return this.gd._(t),this.Rs.Ms(),this}getPointerLength(){return this.gd.C()}setPointerAngle(t){return this.pd._(t),this.Rs.Ms(),this}getPointerAngle(){let t=this.pd.C();if(void 0===t){const e=this.yd();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)}Yu(t){return this.Ad._(t),this.Rs.Ms(),this}md(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}vd(){return ie(this.tc.C())?this.Ad.C().x:this.Ad.C().y}yd(){return ie(this.tc.C())?this.Ad.C().y:this.Ad.C().x}Hu(){switch(this.tc.C()){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.md()-this.yd());default:return 0}}$u(){switch(this.tc.C()){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.md()-this.yd());default:return 0}}ju(){switch(this.tc.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.md()-this.yd());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}Xu(){switch(this.tc.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.md()-this.yd());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}gc(){const t=ee(this.tc.C()),e=fi(u(0,0),t),i=this.getPointerLength(),s=this.md(),r=this.vd(),n=this.yd();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=yi(yi(o,mi(t,-i)),mi(e,s/2)),a=yi(h,mi(e,(n-s)/2)),l=yi(a,mi(t,-r)),c=yi(yi(o,mi(t,-i)),mi(e,-s/2)),d=yi(c,mi(e,-(n-s)/2)),f=yi(d,mi(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Lt(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Oo extends Zn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Yu.bind(this),this.setSize=this.fitTo,this.Sd=new So,this.qa=this.Rs._d(e).Ye(ut).Md(_).bd(_).xd(this.Sd),this.Bu(this.qa)}Nu(){return[this.qa]}setShape(t){return this.qa.wd(t),this}getShape(){return this.qa.Cd()}setRotation(t){return this.qa.kd(t),this}getRotation(){return this.qa.Td()}setFillStyle(t){return this.qa.bd(t),this.Rs.Ms(),this}getFillStyle(){return this.qa.Fd()}ze(){void 0!==this.oa&&this.qa.ua(this.oa);const t=yt(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.Sd.clear(),i>0){const e=this.qa.Cd(),s=this.qa.Fd(),r=po(e)&&e,n=tt(s)&&s;if(r){const t=i/r.oi().y;this.qa.Id(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.qa.Id(e)}}else this.qa.Id(i);this.Sd.appendSample(t)}return this}Yu(t){return this.setContentSize(t),this.Rs.Ms(),this}Hu(){return 0}$u(){return 0}ju(){return 0}Xu(){return 0}}const Lo={...Yn,...Xn,uiElement:Oo};class _o extends jn{setSize(t){return this.setContentSize(t),this.Rs.Ms(),this}}class Bo extends Ln{constructor(){super(...arguments),this.Pd=[],this.Dd=0,this.Bd=t=>{const e=this.Pd.indexOf(t);e>=0&&this.Pd.splice(e,1)}}getMembers(){return this.Pd}getMemberCount(){return this.Pd.length}setMinimumSize(t){return this.Ld=t,this.Rs.Ms(),this}getMinimumSize(){return this.Ld}addElement(t,e=-1){const i=t.oc(this.Rs,this.renderingScale,this.scale,this.Bd,this.ts,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Pd.splice(e,0,i):this.Pd.push(i),i.setVisible(this.getVisible()),this.Bu(i),this.ji&&(Me(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Pd.slice().forEach(Pt),this}Os(){super.Os();const t=this.oa;return void 0!==t&&this.Pd.forEach(((e,i)=>{e.oa=t+1+.01*i})),this}setVisible(t){return super.setVisible(t),this.Pd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof _o)),0),s=i>0?(this.size.x-this.Dd)/i:0;return this.Pd.reduce(((e,i)=>i instanceof _o?this.scale.pi({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).ze().getPosition(u(1,0)).x),t.x),this}Os(){for(let t=0;tt+ +(e instanceof _o)),0),s=i>0?(this.size.y-this.Dd)/i:0;return this.Pd.reduce(((e,i)=>i instanceof _o?this.scale.pi({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).ze().getPosition(u(0,-1)).y),t.y),this}Os(){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},$o=jo("Text",[]),Zo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.R.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.R.on("switch",(e=>t(this,e)))},offSwitch(t){return this.R.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonSize(t){return this.button.setSize(t),this},getButtonSize(){return this.button.getSize()},setButtonShape(t){return this.button.setButtonShape(t),this},getButtonShape(){return this.button.getButtonShape()}},qo={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},Ko={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()}},Jo={...Yn,...Hn,background:Fo,oc(t,e,i,s,r,n){const o=new Vo(t,e,i,this.background,s,r),h=o.addElement(zo,void 0),a=Object.assign(o,Wo,{setTextLabel:h},$o,{stylableTexts:[h]});return Un(a,r,n),this.applyStylers(a,r)}}.addStyler(Gn),Qo={...Yn,...Hn,background:Po,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},oc(t,i,s,r,n,o){const h=this.direction,a=new Vo(t,i,s,this.background,r,n),l=a.addElement(zo,void 0),u=a.getBackground().setDirection(h),c=Object.assign(a,Wo,{setTextLabel:l},$o,{stylableTexts:[l]},Ko,{pointable:u},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),l.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),l.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),l.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),l.setMargin({left:0})),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 c.ac="other",c.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))),Un(c,n,o),this.applyStylers(c,n)}};class th extends On{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Ns=!1,this.R=new r.Eventer,this.Ed=_,this.zd=_,this.getOn=()=>this.Ns,this.zd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle,this.Vd=this.Bu(new Oo(this.Rs,this.renderingScale,this.scale,Ot,o).setShape(s)).setFillStyle(this.zd)}Nu(){return[...this.Vd.Nu()]}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setOn(t){return this.Ns=t,this.Vd.setFillStyle(t?this.Ed:this.zd),this.Rs.Ms(),this}setOffFillStyle(t){return this.zd="function"==typeof t?t(this.zd):t,this.Ns||this.Vd.setFillStyle(this.zd),this}getOffFillStyle(){return this.zd}setSize(t){return this.Vd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Vd.getSize()}setOnFillStyle(t){return this.Ed="function"==typeof t?t(this.Ed):t,this.Ns&&this.Vd.setFillStyle(this.Ed),this}getOnFillStyle(){return this.Ed}setButtonShape(t){return this.Vd.setShape(t),this.Rs.Ms(),this}getButtonShape(){return this.Vd.getShape()}ze(){return super.ze(),this.Vd.oa=this.oa,this.Vd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).ze(),this}Os(){const t=this.Vd.Os().getSize();return this.setContentSize(t),super.Os()}dispose(){return super.dispose(),this.Vd.dispose(),this}setMouseInteractions(t){return this.Vd.setMouseInteractions(t),this}getMouseInteractions(){return this.Vd.getMouseInteractions()}setHighlight(t){const e=ke(t);return this.Vd.setHighlight(e),this.R.emit("highlight",this,t),this.Rs.Ms(),this}getHighlight(){return this.Vd.getHighlight()}}const eh={...Yn,uiElement:th,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},oc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return Un(o,r,n),o}},ih={...Yn,...Hn,background:Fo,buttonBuilder:eh,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},oc(t,i,s,r,n,o){const h=new Vo(t,i,s,this.background,r,n),a=h.addElement(Ho);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Ho);u.addGap();const c=u.addElement(zo);u.addGap(),h.addGap();const d=Object.assign(h,Wo,{setTextLabel:c},$o,{stylableTexts:[c]},Zo,{button:l},qo);let f;return d.onMouseClick(((t,e)=>{d.getLocked()||d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:5}),Un(d,n,o),this.applyStylers(d,n)}}.addStyler(Gn).addStyler(Nn);class sh extends On{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Od=[],this.Nd=2,this.Gd="",this.Ud=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:_i(t.value,e.min,e.max),this.Wd=0,this.Yd=0,this.Hd=!1,this.Rs=t,this.$d=n,this.Xd=this.Bu(t.Ee(e).Le(ut)),this.jd=this.Bu(t.Wr(e).Re(r.uiTextFillStyle).ir(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Zd=140,this.Qd=25):(this.Zd=160,this.Qd=15)}Nu(){return[this.Xd,this.jd]}Jd(t){this.Kd=t;const e=oh(t,"vertical"===this.$d?0:90,this.Hd);return this.Xd.Re(e),this.Rs.Ms(),this}qd(){return this.Kd}tf(t){return this.Zd=t,this.Rs.Ms(),this}if(){return this.Zd}sf(t){return this.Qd=t,this.Rs.Ms(),this}ef(){return this.Qd}hf(t){return this.Gd=t,this.Rs.Ms(),this}rf(){return this.Gd}nf(t){return this.Ud=t,this.Rs.Ms(),this}setLUTDisplayProportionalSteps(t){if(this.Hd=t,this.Kd){const t=oh(this.Kd,"vertical"===this.$d?0:90,this.Hd);this.Xd.Re(t)}return this.Rs.Ms(),this}getLUTDisplayProportionalSteps(){return this.Hd}setFillStyle(t){return this.jd.Re(t),this.Rs.Ms(),this}getFillStyle(){return this.jd.Jh()}setFont(t){return this.jd.ir(t),this.Rs.Ms(),this}getFont(){return this.jd.tr()}setTextRotation(t){return this.Yd=t,this.jd.sr(t),this.Rs.Ms(),this}getTextRotation(){return this.jd.er()}ze(){var t,i,s,r;if(super.ze(),this.ji||!this.getVisible())return this;const n=this.Kd;if(n){const o=this.renderingScale.Ui(),h=n.min,a=n.max;if("vertical"===this.$d){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=yi(s,{x:this.Xd.oi().x+this.Nd*o.x,y:0}),l={x:r.x,y:r.y+(this.Gd.length>0?this.Wd*o.y+this.jd.oi().y:0)+.5*((null===(t=this.Od[0])||void 0===t?void 0:t.oi().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Od[this.Od.length-1])||void 0===i?void 0:i.oi().y)||0)};this.Xd.Ve({x:s.x,y:l.y}),this.jd.Za({x:-1,y:-1}).Ve(r),n.getSteps().forEach(((t,e)=>{const i=si(l,u,this.Hd?!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.Od[e].Za({x:-1,y:0}).Ve(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.Od.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=yi(t,{x:.5*((null===(s=this.Od[0])||void 0===s?void 0:s.oi().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Od[this.Od.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Gd.length>0?this.Wd*o.x+this.jd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Nd*o.y};this.Xd.Ve(f),this.jd.Za({x:1,y:1}).Ve(c),n.getSteps().forEach(((t,e)=>{const i=si(u,d,this.Hd?!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.Od[e].Za({x:0,y:1}).Ve(i)}))}}return this}Os(){if(this.Kd&&this.getVisible()){const t=this.Kd.getSteps();for(let e=this.Od.length;eMath.max(t,e.Os().od().x)),0),this.jd.Os().od().x),s=(this.Gd.length>0?this.Wd+this.jd.Os().od().y:0)+e+.5*this.Od[0].Os().od().y+.5*this.Od[this.Od.length-1].Os().od().y;this.setContentSize({x:i,y:s})}else{const t=this.Zd,e=this.Qd;this.Xd.it({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Gd.length>0?this.Wd+this.jd.Os().od().x:0,.5*this.Od[this.Od.length-1].Os().od().x),s=t+.5*this.Od[0].Os().od().x+i,r=e+this.Nd+this.Od.reduce(((t,e)=>Math.max(t,e.Os().od().y)),0);this.setContentSize({x:s,y:r})}}else this.Od.forEach((t=>t.dispose())),this.Od.length=0,this.jd.setVisible(!1),this.Xd.setVisible(!1),this.setContentSize({x:0,y:0});return super.Os()}dispose(){return super.dispose(),this.Xd.dispose(),this.Od.forEach(Pt),this.jd.dispose(),this}setMouseInteractions(t){return this.Xd.setMouseInteractions(t),this}getMouseInteractions(){return this.Xd.getMouseInteractions()}}const rh={lutElement:{},setLUT(t){return this.lutElement.Jd(t),this},getLUT(){return this.lutElement.qd()},setLUTLength(t){return this.lutElement.tf(t),this},getLUTLength(){return this.lutElement.if()},setLUTThickness(t){return this.lutElement.sf(t),this},getLUTThickness(){return this.lutElement.ef()},setLookUpUnit(t){return this.lutElement.hf(t),this},getLookUpUnit(){return this.lutElement.rf()},setLUTStepValueFormatter(t){return this.lutElement.nf(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},nh={...Yn,...Hn,background:Fo,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},oc(t,e,i,s,r,n){const o=new Go(t,e,i,this.background,s,r),h=o.addElement({oc:()=>new sh(t,e,i,Ot,r,this.alignment)}),a=Object.assign(o,$o,{stylableTexts:[h]},rh,{lutElement:h});return Un(a,r,n),this.applyStylers(a,r)}}.addStyler(Gn),oh=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new ht({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 sh(t,i,s,Ot,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Wo,{setTextLabel:c},$o,{stylableTexts:[c,d]},jo("LUTText",[d]),Zo,{button:l},rh,{lutElement:d},qo);let g;return f.onMouseClick((()=>{f.getLocked()||f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:5}),this.applyStylers(f,n)}}.addStyler(Gn).addStyler(Nn),ah={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=null==e?void 0:e.matchStyleExactly,r=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof fa?this.addChart(t,i,r,s):"attach"in t?this.addAttachable(t,i,r,s):t&&this.addDashboard(t,i,r,s)),this},addAttachable(t,e,i,s){const r=t.qd&&t.qd(),n=t.Bs&&t.Bs(),o=void 0!==s&&s;let h=i;if(!h){let t=r?hh.setAlignment(this.alignment):ih;void 0!==n&&(t=t.setButtonShape(n)),h=t}const a=this.addElement(h);if(r&&"setLUT"in a){a.setLUT(r.lut);const t=r.lut.getUnits(),e=r.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";a.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(a))),this.entries.push({entry:a,component:t}),t.attach(a,e,o),e||a.setLocked(!0),this},addChart(t,e,i,s){return t.af().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof fa)).forEach((t=>this.addChart(t.panel,e,i,s))),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}},lh={alignment:"vertical",layoutBuilder:Ho,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Xo:Ho}},getAlignment(){return this.alignment},titleBuilder:Jo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},uh={...Yn,...Hn,...lh,background:Fo,oc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).oc(t,e,i,s,r,!1);let h=Object.assign(o,ah,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.ji});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Ho:Xo),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}),Un(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class ch extends On{constructor(t,i,s,r,n){super(t,i,s,r,n),this.lf=10,this.uf=e.UIDirections.Up,this.cf=0,this.ac="major",this.ba=this.Bu(t.Wr(this.renderingScale).Gr(Le).Ur(Le)),this.We=this.Bu(t.He(this.renderingScale))}Nu(){return[this.ba]}ze(){if(super.ze(),this.ji)return this;const t=yt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.uf===e.UIDirections.Right?-this.lf:this.uf===e.UIDirections.Left?this.lf:0,y:this.uf===e.UIDirections.Up?-this.lf:this.uf===e.UIDirections.Down?this.lf:0}),s=this.renderingScale.pi(i,{x:this.uf===e.UIDirections.Right?-this.cf:this.uf===e.UIDirections.Left?this.cf:0,y:this.uf===e.UIDirections.Up?-this.cf:this.uf===e.UIDirections.Down?this.cf:0});return this.We.Xe(t).$e(i),this.ba.Ve(s).Za(this.uf===e.UIDirections.Up?{x:0,y:1}:this.uf===e.UIDirections.Down?{x:0,y:-1}:this.uf===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Os(){const t=this.We.xu().getThickness();return this.size=this.uf===e.UIDirections.Left||this.uf===e.UIDirections.Right?{x:this.lf+this.cf+this.ba.Os().od().x,y:t}:{y:this.lf+this.cf+this.ba.Os().od().y,x:t},super.Os()}dispose(){return super.dispose(),this.ba.dispose(),this.We.dispose(),this}setVisible(t){return super.setVisible(t),this.ba.setVisible(t),this.We.setVisible(t),this}setMouseInteractions(t){return this.ba.setMouseInteractions(t),this.We.setMouseInteractions(t),this}getMouseInteractions(){return this.ba.getMouseInteractions()}getText(){return this.ba.Tr()}setTextFillStyle(t){return this.ba.Re(t),this.Rs.Ms(),this}getTextFillStyle(){return this.ba.Jh()}setTextFont(t){return this.ba.ir(t),this}setTextRotation(t){return this.ba.sr(t),this}getTextRotation(){return this.ba.er()}getTextFont(){return this.ba.tr()}setText(t){return this.ba.Sr(t),this.Rs.Ms(),this}setDirection(t){return this.uf=t,this.Rs.Ms(),this}getDirection(){return this.uf}setPointerLength(t){return this.lf=t,this.Rs.Ms(),this}getPointerLength(){return this.lf}setTickLabelPadding(t){return this.cf=t,this.Rs.Ms(),this}getTickLabelPadding(){return this.cf}setTickStyle(t){return this.We.Ye(t),this.Rs.Ms(),this}getTickStyle(){return this.We.xu()}}const dh={...Yn,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},oc(t,e,i,s,r,n){const o=this.direction,h=new ch(t,e,i,s,r);return Un(h,r,n),h.setDirection(o),this.applyStylers(h,r)}}.addStyler(Gn),fh=dh.addStyler(((t,e)=>(t.ac="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)))),gh=dh.addStyler(((t,e)=>(t.ac="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)))),mh=ih.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),yh=uh.setAlignment("horizontal"),ph=uh.setAlignment("vertical"),Ah={TextBox:Jo,CheckBox:ih,ButtonBox:mh,PointableTextBox:Qo,AxisTickMajor:fh,AxisTickMinor:gh,LUTRange:nh},xh={HorizontalLegendBox:yh,VerticalLegendBox:ph},Sh={df:0,ff:1,Af:2,gf:3,pf:4,yf:5,mf:6,vf:7,Sf:8,xf:9,bf:10,Mf:11,_f:12,wf:13,Cf:14,kf:15,Tf:16,Ff:17,If:18,Pf:19,Df:20,Bf:21,Lf:22,Rf:23,Ef:24,zf:25};class vh extends mr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Vf=r}}class bh extends gr{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,y,p,A){var x,S,v;super(d,c,a,y,p,{numeric:c.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:c.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:c.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},A),this.Of=new Map,this.Nf=void 0,this.Gf=0,this.Uf=[],this.Wf=[],this.fh=Ks.fitting,this.Yf=!0,this.Hf=8,this.$f=void 0,this.Xf=void 0,this.jf=20,this.Zf=1,this.Qf=!0,this.Jf=!0,this.Kf=!0,this.qf=!0,this.tA=!0,this.iA=!0,this.sA=!0,this.eA=!0,this.hA=!0,this.rA=!0,this.nA=this.Gh.defaultDragMouseStyle,this.oA=this.Gh.defaultDragMouseStyle,this.aA=this.Gh.defaultDragMouseStyle,this.lA=this.Gh.defaultDragMouseStyle,this.uA=this.Gh.defaultDragMouseStyle,this.R=new r.Eventer,this.cA=[],this.dA=t=>{const e=this.Wf.indexOf(t);e>=0&&this.Wf.splice(e,1)},this.fA=t=>(this.Wf.indexOf(t)<0&&this.Wf.push(t),this.dA),this.AA="center",this.Rt=(t,e)=>this.R.emit("axisAreaTouch",this,e),this.gA=he(this.cA),this.onAxisInteractionAreaMouseClick=t=>this.R.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.R.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.R.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.R.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.R.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.R.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.R.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.R.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.R.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.R.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.R.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.R.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.R.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.R.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.R.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.R.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.R.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.R.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.R.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.R.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.R.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.R.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.R.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.R.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.R.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.R.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.R.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.R.off(t,"axisAreaTouchEnd"),this.Zd={relative:1},this.pA=0,this.yA=0,this.mA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().cc()):t,this.vA=t=>{const e=this.Uf.indexOf(t);-1!==e&&this.Uf.splice(e,1)},this.SA=(t,e)=>{this.R.emit("axisAreaDoubleClick",this,e),this.qf&&(this.setStopped(!1),se(e))},this.xA=t=>{this.R.emit("axisAreaMouseEnter",this),(this.Jf||this.Qf||this.Kf||this.qf)&&this.bA(t)},this.MA=t=>{this._A(t),this.R.emit("axisAreaMouseLeave",this)},this.wA=(t,e,i)=>{var s,r;this.R.emit("axisAreaMouseDragStart",this,e,i);const n=Vt(null===(s=this.chart.CA.so)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Vt(null===(r=this.chart.CA.so)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Jf?(this.kA(t),se(e)):i===n&&this.Qf&&(this.TA(t,h),se(e))},this.FA=(t,e,i,s,r)=>{var n,o;this.R.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Vt(null===(n=this.chart.CA.so)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Vt(null===(o=this.chart.CA.so)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Jf?(this.IA(t,r),se(e)):i===h&&this.Qf&&(this.PA(t,s,l,r),se(e))},this.DA=(t,e,i,s)=>{var r,n;this.R.emit("axisAreaMouseDragStop",this,e,i,s);const o=Vt(null===(r=this.chart.CA.so)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Vt(null===(n=this.chart.CA.so)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Jf?(this.BA(t),se(e)):i===o&&this.Qf&&(this.LA(t,s,a),se(e)),t.getIsUnderMouse()&&(this.Jf||this.Qf||this.Kf||this.qf)&&this.bA(t)},this.RA=(t,e)=>{if(this.R.emit("axisAreaMouseWheel",this,e),this.Kf){this.setStopped(!0);const t=this.Gh.getWidth(this.EA.cs.Ne(e.clientX,e.clientY)),i=this.At.dt(t);this.zoom(i,be(e)),se(e)}},this.zA=(t,e)=>this.R.emit("axisAreaMouseClick",this,e),this.VA=(t,e)=>this.R.emit("axisAreaMouseDown",this,e),this.OA=(t,e)=>this.R.emit("axisAreaMouseUp",this,e),this.NA=(t,e)=>this.R.emit("axisAreaMouseMove",this,e),this.GA=(t,e,i)=>{this.R.emit("axisAreaTouchStart",this,i),this.Qf&&(this.bA(t),this.TA(t,e),se(i))},this.UA=(t,e,i,s,r)=>{this.R.emit("axisAreaTouch",this,r),this.Qf&&(this.PA(t,e,i,s),se(r))},this.WA=(t,e,i,s)=>{this.R.emit("axisAreaTouchEnd",this,s),this.Qf&&(this.LA(t,e,i),this._A(t),se(s))},this.YA=(t,e,i,s)=>{(this.Jf||this.Kf)&&(this.bA(t),this.kA(t),se(s))},this.HA=(t,e,i,s,r,n)=>{if(this.Jf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.IA(t,e),se(n)}if(this.Kf){const t=this.EA.cs.Ne(e.x,e.y),o=this.EA.cs.Ne(i.x,i.y),h=Math.abs(this.Gh.getWidth(pi(t,s))-this.Gh.getWidth(pi(o,r)))-Math.abs(this.Gh.getWidth(t)-this.Gh.getWidth(o)),a=this.At.pi(this.$h,-h),l=this.At.pi(this.Xh,h);this.ur(a,l,!0),se(n)}},this.$A=(t,e,i,s)=>{(this.Jf||this.Kf)&&(this.BA(t),this._A(t),se(s))},this.XA=(t,e)=>{(this.tA||this.iA)&&this.jA(t)},this.ZA=(t,e)=>{this.QA(t)},this.JA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.tA&&this.KA(t,s)},this.qA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.tA&&this.tg(t,n,s,r)},this.ig=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.tA&&this.sg(t,n,s,r)},this.eg=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.tA||this.iA)&&this.hg(t,r,s),(this.tA||this.iA)&&this.jA(t)},this.rg=(t,e)=>{this.iA&&(this.setStopped(!0),this.zoom(this.$h,be(e)),se(e))},this.ng=(t,e)=>{this.iA&&(this.setStopped(!0),this.zoom(this.Xh,be(e)),se(e))},this.og=(t,e,i)=>{this.tA&&(this.jA(t),this.KA(t,e),se(i))},this.ag=(t,e,i,s,r)=>{this.tA&&(this.tg(t,e,i,s),se(r))},this.lg=(t,e,i,s,r)=>{this.tA&&(this.sg(t,e,i,s),se(r))},this.ug=(t,e,i,s)=>{this.tA&&(this.hg(t,e,i),this.QA(t),se(s))},this.cg=t,this.EA=i,this.dg=n,this.Ag=o,this.chart=d,this.gg=g,this.pg=s,this.es=h,"logarithmic"===A.type&&this.chart.cs.Jn(Sh.Pf),m(this,this.fA),a.yg=this,this.mg=f,this.vg=this.mg>50?1:-1,this.Sg=(v=this.Gh.toPoint(0,-this.vg),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.xg=l,this.bg=this.At instanceof Gi?(new Yi).Ri(this.Gh.toVec2(this.At,this.xg)):(new Hi).Ri(this.Gh.toVec2(this.At,this.xg)),this.Mg=this.chart._g,this.wg=(new Yi).Ri(this.Gh.toVec2(this.Gh.getWidth(this.Mg),this.xg)),this.Cg=this.EA.He(this.bg).setMouseInteractions(!1),this.kg=this.EA.He(this.bg).setMouseInteractions(!1),this.Tg=this.EA.He(this.bg).setMouseInteractions(!1),this.Fg=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Le(ut).ra(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Ig=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Le(c.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.Pg=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Le(ut).ra(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Dg=this.pg.Ee(this.Mg).Re(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Le(ut).ra(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Fh=this.pg.Wr(this.bg).setMouseInteractions(!1).sr(this.Gh.getTitleTextRotation(this.vg)).Ur(Le).Gr(Le),this.chart.cs.us.ls(this.Fg,(t=>this.Fg.ds(t)),{animationEnabled:this.ph}),this.chart.cs.us.ls(this.Pg,(t=>this.Pg.ds(t)),{animationEnabled:this.ph}),this.chart.cs.us.ls(this.Dg,(t=>this.Dg.ds(t)),{animationEnabled:this.ph});const b=ns(new hs(this.GA,this.UA,this.WA,1),new as(this.YA,this.HA,this.$A),new os(this.SA)),M=ns(new hs(this.og,this.ag,this.ug)),C=ns(new hs(this.og,this.lg,this.ug));this.Fg.setMouseEnterEventHandler(this.xA).setMouseLeaveEventHandler(this.MA).setMouseDragStartEventHandler(this.wA).setMouseDragEventHandler(this.FA).setMouseDragStopEventHandler(this.DA).setMouseWheelEventHandler(this.RA).setMouseDoubleClickEventHandler(this.SA).setMouseClickEventHandler(this.zA).setMouseDownEventHandler(this.VA).setMouseUpEventHandler(this.OA).setMouseMoveEventHandler(this.NA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.Pg.setMouseEnterEventHandler(this.XA).setMouseLeaveEventHandler(this.ZA).setMouseDragStartEventHandler(this.JA).setMouseDragEventHandler(this.qA).setMouseDragStopEventHandler(this.eg).setMouseWheelEventHandler(this.rg).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.Dg.setMouseEnterEventHandler(this.XA).setMouseLeaveEventHandler(this.ZA).setMouseDragStartEventHandler(this.JA).setMouseDragEventHandler(this.ig).setMouseDragStopEventHandler(this.eg).setMouseWheelEventHandler(this.ng).setTouchStartEventHandler(C.onTouchStart).setTouchMoveEventHandler(C.onTouchMove).setTouchEndEventHandler(C.onTouchEnd),this.Cg.Ye(c.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.kg.Ye(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Tg.Ye(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Fh.Re(c.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).ir(c.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.hs=h.rs(this,{}),this.hr=this.hs.Bg([this.Fh]).bs(y.effectsText),this.Lg=null!==(x=c.getWidth({x:y.xAxisMarginAfterTicks,y:y.yAxisMarginAfterTicks}))&&void 0!==x?x:7,this.Rg=null!==(S=c.getWidth({x:y.xAxisMarginAfterTitle,y:y.yAxisMarginAfterTitle}))&&void 0!==S?S:7}Or(){return this.Sh}Nr(){return void 0!==this.lr}setTickStrategy(t,e){return super.Hh(t,e)}getTickStrategy(){return this.lh}addBand(t=!0){const e=t?this.Ag:this.dg,i=new Zs(e,this.chart,this.gA,this,this.bg,this.Gh,this.ts,this.es);return this.cA.push(i),i}addConstantLine(t=!0){const e=t?this.Ag:this.dg,i=new qs(e,this.chart,this.gA,this,this.bg,this.Gh,this.ts,this.es);return this.cA.push(i),i}Eg(t){this.cA.forEach(t)}zg(t){return this.cA.map(t)}getHighlighters(){return this.cA}setThickness(t){return"number"==typeof t?(this.Vg=t,this.Og=t):"object"==typeof t&&(this.Vg=t.min,this.Og=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Vg,max:this.Og}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Ng(){return this.Wf}Mr(t,e){return new vh(e,t,this.EA,this.bg,this.bg)}rr(){if(this.Of){for(const t of this.Of)t[1].grid.dispose(),t[1].tick.dispose();this.Of.clear()}super.rr()}_r(t,e){const{tickStart:i}=e,s=t.Eh.je,r=i+s.getTickLength()*this.vg+s.getTickPadding()*this.vg;t.rh.Ve(this.Gh.toPoint(t.M,r)).Za(this.Gh.toPoint(s.getLabelAlignment(),-this.vg)).sr(s.labelRotation).setVisible(this.getVisible())}Gg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Eh.je,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.vg;return{gridStroke:{start:this.Gh.toPoint(t.M,r),end:this.Gh.toPoint(t.M,h)},tickStroke:{start:this.Gh.toPoint(t.M,n),end:this.Gh.toPoint(t.M,a)}}}Er(t,e){return"linear"===this.Wh.type?Qi(t,e,this.At):ts(t,e,this.At)}Ug(t,e){return e instanceof Gi?Qi:ts}Vr(t,e,i){if("logarithmic"!==this.Wh.type){const s=this.At.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.At,r={start:s.X,end:s.j};s.q(t,e).fi();const n={min:s.pi(t,-i),max:s.pi(e,i)};return s.q(r.start,r.end).fi(),n}Os(){if(!this.Zi)return{Wg:0,Yg:0,Qd:0};const t=!(this.uh.size>0),e=this.Fh&&this.Fh.Tr().length>0&&this.getTitleFillStyle()!==_,i=this.Gh.getHeight(e?this.chart.cs.$g.Hg(this.Fh.Tr(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.Rg:0),s=ur(this.ah)?new Map:yr(this.ah,Math.min(this.$h,this.Xh),Math.max(this.$h,this.Xh),this.$h,this.Xh,0),r=this.At;let n=0;s.forEach(((e,i)=>{if(Qs(i)){const s=Math.max(...e.map((e=>{if(!ti(e,this.$h,this.Xh))return 0;const s=this.chart.cs.$g.Hg(i.Ze(e,r),i.je.labelFont,i.je.labelRotation);return t||!s.isEstimate?this.Gh.getHeight(s):0})))+i.je.tickLength+i.je.tickPadding;n=Math.max(n,s)}}));const o=this.Uf.reduce(this.mA,0);n=Math.max(n,o),n+=this.Lg;const h=_t(i+n,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye);return this.Gf=h,{Wg:n,Yg:i,Qd:h}}ze(t){const e=this.getVisible()&&t.Xg>0;this.jg=t;const i=this.Cg.xu(),s=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart(),n=i.getThickness()*this.vg/2,o=this.xg.getInnerInterval(),h=this.mg/100*o,a=h+t.Zg,l=o*this.vg,u=a+n;if(e||this.rr(),!ur(this.ah)&&e){const t=this.At.ri();this.dr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.uh){let s=this.Of.get(e);if(!s)if(e.Qe)s={grid:this.cg[0].Qg(this.bg).setMouseInteractions(!1),tick:this.cg[0].Qg(this.bg).setMouseInteractions(!1)};else if("Jg"in e){const t=Array.from(this.uh.keys()).filter((t=>"Jg"in t)).reverse().indexOf(e),i=this.cg[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.Qg(this.bg).setMouseInteractions(!1),tick:i.Qg(this.bg).setMouseInteractions(!1)}}if(s){s.grid.Ot(),s.tick.Ot();for(const[e,r]of i){const e=this.Gg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Zr().Kg(e.gridStroke.start,e.gridStroke.end),s.tick.Zr().Kg(e.tickStroke.start,e.tickStroke.end)}s.grid.Ye(e.je.getGridStrokeStyle()),s.tick.Ye(e.je.getTickStyle()),this.Of.set(e,s)}}}const c=u,d=c+this.vg*t.qg,f=this.tA||this.iA?Math.min(this.jf,.25*t.Xg):0,g={start:this.Gh.toVec2(this.At.pi(this.At.getInnerStart(),f),c),end:this.Gh.toVec2(this.At.pi(this.At.getInnerEnd(),-f),d)},m=yt(this.Gh.toVec2(this.At.getInnerStart(),d),this.bg,this.Mg),y=yt(g.start,this.bg,this.Mg),p=yt(g.end,this.bg,this.Mg),A=yt(this.Gh.toVec2(this.At.getInnerEnd(),c),this.bg,this.Mg);this.Cg.Xe(this.Gh.toPoint(s,a)).$e(this.Gh.toPoint(r,a)).setVisible(e),this.kg.Xe(this.Gh.toPoint(this.At.pi(this.At.getInnerStart(),this.Hf),a)).$e(this.Gh.toPoint(this.At.getInnerStart(),a)).setVisible(e),this.Tg.Xe(this.Gh.toPoint(this.At.pi(this.At.getInnerEnd(),-this.Hf),a)).$e(this.Gh.toPoint(this.At.getInnerEnd(),a)).setVisible(e);const x=a+t.Wg*this.vg;if(this.Fh.Ve(this.Gh.toPoint(this.Gh.getWidth(yt("center"===this.AA?mi(yi(m,A),.5):"start"===this.AA?m:A,this.Mg,this.bg)),x)).Za(this.Gh.toPoint("center"===this.AA?0:"start"===this.AA?-1:1,-1*this.vg)).setVisible(e).setMouseInteractions(void 0!==["mouseEnterTitle","mouseMoveTitle","mouseLeaveTitle","mouseDownTitle","mouseUpTitle","mouseClickTitle","mouseDoubleClickTitle","mouseDragStartTitle","mouseDragTitle","mouseDragStopTitle","mouseWheelTitle","touchStartTitle","touchMoveTitle","touchEndTitle"].find((t=>this.R.listeners(t).size>0))),this.Nf){const e=this.mg/100*o+t.Zg,i=-this.vg*o-t.Zg,s={start:this.Gh.toVec2(this.Nf.min,u+this.vg*this.Gf),end:this.Gh.toVec2(this.Nf.max,e+i)},r=yt(s.start,this.bg,this.Mg),n=yt(s.end,this.bg,this.Mg);this.Ig.Ve(r).it(pi(n,r)).setVisible(!0)}else this.Ig.setVisible(!1);this.Fg.Ve(y).it(pi(p,y)).setVisible(e),this.Pg.Ve(m).it(pi(y,m)).setVisible(e),this.Dg.Ve(p).it(pi(A,p)).setVisible(e);for(const i of this.Uf)i.update().plot(e,a,l,t.Zg,u);for(const t of this.cA)t.ze()}setLength(t){return this.Zd=t,this.chart.cs.Ms(),this}getLength(){return this.Zd}setMargins(t,e){return this.pA=t,this.yA=e,this.chart.cs.Ms(),this}getMargins(){return{start:this.pA,end:this.yA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.tp,...this.chart.ip,...this.chart.sp,...this.chart.ep].find((t=>t.axis===this)))||void 0===t?void 0:t.iStack)&&void 0!==e?e:0}getParallelIndex(){var t,e;return null!==(e=null===(t=[...this.chart.tp,...this.chart.ip,...this.chart.sp,...this.chart.ep].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}hp(){const t=this.jg;if(!t)return;const e=this.getVisible()&&t.Xg>0,i=this.Cg.xu().getThickness()*this.vg/2,s=this.xg.getInnerInterval(),r=this.mg/100*s+t.Zg,n=s*this.vg,o=r+i;for(const i of this.Uf)i.update().plot(e,r,n,t.Zg,o);for(const t of this.cA)t.ze()}rp(){return this.Gf}np(t,e){e=e||Ah.AxisTickMajor;const i=new Vn(this,t?this.cg[0]:this.pg,this.pg,this.At,this.wg,this.wg,this.Gh,this.Sg,this.vA,this.ts,e).setTextFormatter(this.formatValue);return this.Uf.push(i),i}bA(t){this.chart.cs.us.ks(t,1),this.$f=t.cs.tn(this.nA,this.$f)}_A(t){this.chart.cs.us.ks(t,0),t.cs.sn(this.$f)}kA(t){this.setStopped(!0),t.cs.sn(this.$f)}IA(t,e){const i=-this.Gh.getWidth(e);this.pan(i),this.$f=t.cs.tn(this.oA,this.$f)}pan(t){const e=this.$h,i=this.Xh,s=this.At.pi(e,t),r=this.At.pi(i,t);this.ur(s,r,!1)}zoom(t,e){const i=this.At.ft(this.$h),s=this.At.ft(this.Xh),r=this.At.ft(t),n=_t((r-i)/(s-i),0,1),o=.2*this.At.ri(),h=n*this.Zf*o*-e,a=(1-n)*this.Zf*o*e,l=this.At.pi(this.$h,h),u=this.At.pi(this.Xh,a);this.ur(l,u,!0)}BA(t){this.Nf=void 0,t.cs.sn(this.$f)}TA(t,e){this.setStopped(!0),t.cs.sn(this.$f),this.chart.cs.us.ks(this.Fg,0)}PA(t,e,i,s){const r=yt(this.EA.cs.Ne(i.x,i.y),this.EA.cs.At,this.bg),n=_t(this.Gh.getWidth(r),this.$h,this.Xh),o=this.Gh.getWidth(yt(this.EA.cs.Ne(e.x,e.y),this.EA.cs.At,this.bg));Math.abs(this.At.ft(n)-this.At.ft(o))>10?(this.Nf=m(Math.min(n,o),Math.max(n,o)),this.$f=t.cs.tn(this.aA,this.$f)):(this.Nf=void 0,this.$f=t.cs.tn(this.nA,this.$f)),this.EA.Ms()}LA(t,e,i){if(this.Nf){const t=this.Nf.min,e=this.Nf.max,i=this.Xh{e.vs(t)}));for(const e of this.Of.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.cs.Ms(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ph),this}}var Mh;e.AxisXYTitlePositionOptions=void 0,(Mh=e.AxisXYTitlePositionOptions||(e.AxisXYTitlePositionOptions={})).Start="start",Mh.Center="center",Mh.End="end";const Ch={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Th={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},wh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof bh&&"y"in t&&t.y instanceof bh),Eh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new us,tickLength:7,tickStyle:new us,tickPadding:0,labelFont:new vr,labelFillStyle:new N,labelAlignment:0,labelRotation:0});class kh extends Eh{constructor(t){super(t)}setGridStrokeLength(t){return this.set("gridStrokeLength",t)}getGridStrokeLength(){return this.get("gridStrokeLength")}setGridStrokeStyle(t){return this.set("gridStrokeStyle","function"==typeof t?t(this.get("gridStrokeStyle")):t)}getGridStrokeStyle(){return this.get("gridStrokeStyle")}setTickLength(t){return this.set("tickLength",t)}getTickLength(){return this.get("tickLength")}setTickStyle(t){return this.set("tickStyle","function"==typeof t?t(this.get("tickStyle")):t)}getTickStyle(){return this.get("tickStyle")}setTickPadding(t){return this.set("tickPadding",t)}getTickPadding(){return this.get("tickPadding")}setLabelFillStyle(t){return this.set("labelFillStyle","function"==typeof t?t(this.get("labelFillStyle")):t)}getLabelFillStyle(){return this.get("labelFillStyle")}setLabelFont(t){return this.set("labelFont","function"==typeof t?t(this.get("labelFont")):t)}getLabelFont(){return this.get("labelFont")}setLabelAlignment(t){return this.set("labelAlignment",t)}getLabelAlignment(){return this.get("labelAlignment")}setLabelRotation(t){return this.set("labelRotation",t)}getLabelRotation(){return this.get("labelRotation")}}const Ih=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),zh=new kh({labelFillStyle:_,gridStrokeStyle:ut,tickStyle:ut}),Fh=t=>Ih(t)&&B(t.labelFillStyle)&&ct(t.gridStrokeStyle)&&ct(t.tickStyle),Rh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new kh,minorTickStyle:new kh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Dh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=9e4?"MajorMinutes":i>=10500?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Ph={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}.${Se(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}.${Se(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${Se(s,2)}:${Se(r,2)}:${Se(n,2)}.${Se(o,3)}${h}`}},Oh={MajorHours12:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,rr(t,e,r,void 0,1e6)},fitKeyValues:or({ignore:"first"},2,4)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,36e5,1e6),fitKeyValues:or({},2,3,4,6)},defaultValueFormatter:Ph.hhmmss},MajorHours:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,rr(t,e,r,void 0,1e6)},fitKeyValues:or({ignore:"first"},2,6,12)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,3e5,1e6),fitKeyValues:or({},2,4,6)},defaultValueFormatter:Ph.hhmmss},MajorMinutes15:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),rr(t,e,9e5,void 0,1e6)),fitKeyValues:or({ignore:"first"},2)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,6e4,1e6),fitKeyValues:or({},3,5)},defaultValueFormatter:Ph.hhmmss},MajorMinutes:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,rr(t,e,6e4,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,5e3,1e6),fitKeyValues:or({},2,3,4,6)},defaultValueFormatter:Ph.hhmmss},MajorSeconds15:{major:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,rr(t,e,15e3,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,4)},minor:{format:Ph.hhmmss,getKeyValues:(t,e,i,s)=>sr(t,e,1e3,1e6),fitKeyValues:or({},3,5)},defaultValueFormatter:Ph.hhmmss},MajorSeconds:{major:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,rr(t,e,1e3,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>sr(t,e,100,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmm},MajorMilliseconds100:{major:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,rr(t,e,100,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>sr(t,e,10,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmm},MajorMilliseconds10:{major:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,rr(t,e,10,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmm,getKeyValues:(t,e,i,s)=>sr(t,e,1,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmm},MajorMilliseconds:{major:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,rr(t,e,1,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>sr(t,e,.1,1e6),fitKeyValues:or({},2)},defaultValueFormatter:Ph.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,rr(t,e,.1,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>sr(t,e,.01,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,rr(t,e,.01,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>sr(t,e,.001,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,rr(t,e,.001,void 0,1e6)),fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>sr(t,e,100*1e-6,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,rr(t,e,r,void 0,1e6)},fitKeyValues:or({ignore:"first"},2,5)},minor:{format:Ph.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>sr(t,e,10*1e-6,1e6),fitKeyValues:or({},2,3,5)},defaultValueFormatter:Ph.hhmmssmmmuuunnn},Unknown:{major:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},minor:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},defaultValueFormatter:(t,e,i)=>""}};class Lh extends Rh{Ke(t){const e=this.timeOrigin||0,i=[{rh:"Major ticks",Jg:0,je:this.majorTickStyle,Ze:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Dh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Oh[r].major.format)(t+e,i,s)},Hr:(t,e,i,s)=>{const r=Dh(i,s);return(0,Oh[r].major.getKeyValues)(t,e,i,s)},zh:{wr:(t,e,i,s,r,n)=>{const o=Dh(r,n),h=Oh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},$r:void 0}];return Ih(this.minorTickStyle)&&i.push({rh:"Minor ticks",Jg:1,je:this.minorTickStyle,Ze:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Dh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Oh[r].minor.format)(t+e,i,s)},Hr:(t,e,i,s)=>{const r=Dh(i,s);return(0,Oh[r].minor.getKeyValues)(t,e,i,s)},zh:{wr:(t,e,i,s,r,n)=>{const o=Dh(r,n),h=Oh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},$r:void 0}),{qe:[],th:i,ih:this.cursorFormatter||((t,i,s)=>{const r=Dh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Oh[r].defaultValueFormatter(t+e,i,s)}),sh:1e-4,eh:864e6}}setTickStyle(t){return this.setMajorTickStyle(t).setMinorTickStyle(t)}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTimeOrigin(t){return this.set("timeOrigin",t)}getTimeOrigin(){return this.get("timeOrigin")}setFormattingFunction(t){return this.withMutations((e=>e.set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const _h=(t,e,i,s,r)=>(n,o)=>h=>{const a=new Date(h+n),l={year:o?a.getUTCFullYear():a.getFullYear(),monthIndex:o?a.getUTCMonth():a.getMonth(),day:o?a.getUTCDate():a.getDate(),hours:o?a.getUTCHours():a.getHours(),minutes:o?a.getUTCMinutes():a.getMinutes(),seconds:o?a.getUTCSeconds():a.getSeconds(),millis:o?a.getUTCMilliseconds():a.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return h;const c=l[e];r.includes("year")&&(l.year=Math.floor(l.year/i)*i),r.includes("monthIndex")&&(l.monthIndex=0),r.includes("day")&&(l.day=1),r.includes("hours")&&(l.hours=0),r.includes("minutes")&&(l.minutes=0),r.includes("seconds")&&(l.seconds=0),r.includes("millis")&&(l.millis=0);let d=(0===t?1:t)*i;return-1===t&&!1===u&&(d=0),0!==d&&(l[e]=i*(d>0?Math.floor((c+d)/i):Math.ceil((c+d)/i))),o?Date.UTC(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis)-n:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-n},Bh=(t,e,i,...s)=>_h(-1,t,e,i,s),Vh=(t,e,i,...s)=>_h(-1,t,e,i,s),Gh=(t,e,i,...s)=>_h(0,t,e,i,s),Nh=(t,e,...i)=>_h(1,t,e,void 0,i),Uh=t=>(e,i)=>s=>{const r=new Date(s+e),n=i?r.getUTCDay():r.getDay(),o=1===n&&0===(i?r.getUTCHours():r.getHours())&&0===(i?r.getUTCMinutes():r.getMinutes())&&0===r.getSeconds()&&0===r.getMilliseconds();if(0===t&&!0===o)return s;let h=i?r.getUTCDate():r.getDate();return-1===t&&1===n&&!1===o||(-1===t?h-=n>=2?n-1:n+6:h+=n>0?8-n:1),i?Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),h,0,0,0,0)-e:new Date(r.getFullYear(),r.getMonth(),h,0,0,0,0).getTime()-e},Yh=[{label:"MilliSecond1",unit:1,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:or({offset:0},2,5)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"MilliSecond10",unit:10,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("millis",10,(t=>t.millis%10==0),"millis")},majorTicks:{fitFunction:or({offset:0},2,5)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("millis",100,(t=>t.millis%100==0),"millis")},majorTicks:{fitFunction:or({offset:0},2,5)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:hr(5,10,15,30)},minorTicks:{amount:4,fitFunction:or(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:hr(5,10,15,30)},minorTicks:{amount:12,fitFunction:or(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:hr(3,6,12)},minorTicks:{amount:8,fitFunction:or(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Bh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:or({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:or({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Uh(-1),getNextKeyValueIncludingRef:Uh(0),getNextKeyValue:Uh(1),greatTicks:!0,majorTicks:{fitFunction:or(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Vh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:or(void 0,2,3)},minorTicks:{fitFunction:or(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Vh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:or({ignore:"first"},2,5)},minorTicks:{fitFunction:or(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Vh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:or(void 0,2,4)},minorTicks:{fitFunction:or(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Vh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",100,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0},{label:"Millennium",unit:316224e8,irregular:!0,getPrevKeyValue:Vh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Gh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Nh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],Hh=(t,e,i,s,r)=>{const n=e-t;let o;for(let t=r?0:Yh.length-1;r?t=0;r?t+=1:t-=1){const e=n/Yh[t].unit;if((void 0===i||e>=i)&&(void 0===s||e<=s)){o=Yh[t];break}}return o},Xh=(t,e,i)=>{let s=Hh(e,i,void 0,1,!0);if(void 0!==s&&0===Yh.indexOf(s)&&(s=Yh[1]),void 0===s)return;if("great"===t)return s;const r="major"===t?1:2,n=Yh[Yh.indexOf(s)-r];return void 0===n?Yh[0]:n},Wh=(t,e,i)=>(s,r,n,o)=>{const h=Xh("great",s,r);if(void 0===h)return[];if("Decade"===h.label||"Century"===h.label||"Millennium"===h.label)return[];const a=o>n?s:r,l=(s+r)/2,u=o>n?r:s;if(Yh.indexOf(h)<=Yh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=nr(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=rr(s,r,h.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,r,c);return"left"===i?void 0===d||ti(d,l,u)?[a]:[d]:void 0!==d&&ti(d,l,u)?[d]:[u]},jh=(t,e,i)=>(s,r,n,o)=>{const h=Xh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=nr(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=rr(s,r,h.unit,t,1)}else if("major"===t&&void 0!==h.majorTicks)a=!0===h.irregular?((t,e,i,s)=>{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})(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let r=t,n=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(r),s})(s,r,h.unit);else{if("minor"!==t||void 0===h.minorTicks)return[];if(!0===h.irregular)a=((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r})(s,r,h.getNextKeyValueIncludingRef(e,i),h.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return Yh[Yh.indexOf(t)+1]})(h);if(void 0===t)return[];a=sr(s,r,t.unit/h.minorTicks.amount,1)}}return a},$h=t=>(e,i,s,r,n,o)=>{const h=Xh(t,n,o);if(void 0===h)return;let a;return"major"===t?a=h.majorTicks.fitFunction:h.minorTicks&&(a=h.minorTicks.fitFunction),a?a(e,i,s,r,n,o):void 0},Zh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new kh,majorTickStyle:new kh,minorTickStyle:new kh,formatOptionsMajorCentury:{year:"numeric",hour12:!1},formatOptionsMinorDecade:{year:"numeric",hour12:!1},formatOptionsMajorDecade:{year:"numeric",hour12:!1},formatOptionsMinorYear:{year:"numeric",hour12:!1},formatOptionsMajorYear:{year:"numeric",hour12:!1},formatOptionsMinorMonth:{month:"short",hour12:!1},formatOptionsGreatYear:{year:"numeric",hour12:!1},formatOptionsMajorMonth:{month:"long",hour12:!1},formatOptionsMinorWeek:{day:"numeric",hour12:!1},formatOptionsGreatMonth:{year:"numeric",month:"long",hour12:!1},formatOptionsMajorWeek:{day:"numeric",weekday:"short",hour12:!1},formatOptionsMinorDay:{day:"numeric",weekday:"short",hour12:!1},formatOptionsGreatWeek:(t,e,i)=>{const s=new Date(t),r=(t=>{const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)})(s);return`${new Intl.DateTimeFormat(i,{year:"numeric",month:"long",hour12:!1}).format(s)} Week ${r}`},formatOptionsMajorDay:{weekday:"long",day:"numeric",hour12:!1},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Ph.hhmmssmmm(t-e.getTime())},formatMillisecondRange:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Ph.hhmmssmmm(t-e.getTime())},formatOptionsGreatSecond:{},formatOptionsMajorMilliSecond:{}});class qh extends Zh{Ke(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Yh.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond1":case"MilliSecond10":case"MilliSecond100":return"Great"===e?t.formatOptionsGreatMinute:t.formatMillisecondRange;case"Second":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorSecond:t.formatOptionsMinorSecond;case"Minute":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorMinute:t.formatOptionsMinorMinute;default:case"Hour":return"Great"===e?t.formatOptionsGreatHour:"Major"===e?t.formatOptionsMajorHour:t.formatOptionsMinorHour;case"Day":return"Great"===e?t.formatOptionsGreatDay:"Major"===e?t.formatOptionsMajorDay:t.formatOptionsMinorDay;case"Week":return"Great"===e?t.formatOptionsGreatWeek:"Major"===e?t.formatOptionsMajorWeek:t.formatOptionsMinorWeek;case"Month":return"Great"===e?t.formatOptionsGreatMonth:"Major"===e?t.formatOptionsMajorMonth:t.formatOptionsMinorMonth;case"Year":return"Great"===e?t.formatOptionsGreatYear:"Major"===e?t.formatOptionsMajorYear:t.formatOptionsMinorYear;case"Decade":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorDecade:t.formatOptionsMinorDecade;case"Century":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorCentury:void 0;case"Millennium":return}})(this,t,e);if("object"!=typeof i)return i;try{return new Intl.DateTimeFormat(this.locale,i)}catch(t){let e="";for(const t in i)e+=` ${t}: ${i[t]},`;zt.console.error(`Invalid Intl.DateTimeFormat ( locale: ${this.locale}, formatOptions {${e}} )`)}})),s=new Map;s.set("great",i("Great")),s.set("major",i("Major")),s.set("minor",i("Minor"));const r=t=>String(t),n=(t,i)=>(n,o)=>{let h=n+e;const a=o.getInnerStart(),l=o.getInnerEnd(),u=a>l,c=Xh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Lt(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(n):c.greatTicks.getReferenceKeyValue(e,this.utc)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(n):c.getNextKeyValue(e,this.utc)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[Yh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{rh:"Great ticks (directive)",Jg:0,Je:!0,Hr:jh("great",e,this.utc),$r:void 0},{rh:"Major ticks",Jg:1,je:this.majorTickStyle,Ze:n("major"),Hr:jh("major",e,this.utc),zh:{wr:$h("major")},$r:void 0}];Fh(this.greatTickStyle)||(o.push({rh:"Great ticks (left)",je:this.greatTickStyle.setLabelAlignment(-1),Ze:n("great","left"),Hr:Wh(e,this.utc,"left"),Qe:!0,Fr:!1}),o.push({rh:"Great ticks (right)",je:this.greatTickStyle.setLabelAlignment(1),Ze:n("great","right"),Hr:Wh(e,this.utc,"right"),Qe:!0,Fr:!1})),Fh(this.minorTickStyle)||h.push({rh:"Minor ticks",Jg:2,je:this.minorTickStyle,Ze:n("minor"),Hr:jh("minor",e,this.utc),zh:{wr:$h("minor"),Vh:(t,e,i,s,r,n)=>{const o=Xh("minor",r,n);return!o||"Week"!==o.label}},$r:void 0});const a=this.cursorFormatter;return{qe:o,th:h,ih:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=Hh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()),void 0,1,!0),n=r&&r.unit<=6e4,o=new Date(e+t),h=new Date(e+t);h.setHours(0,0,0,0);const a=n?Ph.hhmmssmmm:Ph.hhmmss;return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric"}).format(o)} ${a(o.getTime()-h.getTime())}`},sh:1,eh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTickStyle(t){return this.setGreatTickStyle(t).setMajorTickStyle(t).setMinorTickStyle(t)}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return this.set("greatTickStyle",t(e))}return this.set("greatTickStyle",t)}getGreatTickStyle(){return this.get("greatTickStyle")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setUTC(t){return this.set("utc",t)}getUTC(){return this.get("utc")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}setFormatting(t,e,i){return this.withMutations((s=>s.set("formatOptionsGreatYear",t||this.formatOptionsGreatYear).set("formatOptionsGreatMonth",t||this.formatOptionsGreatMonth).set("formatOptionsGreatWeek",t||this.formatOptionsGreatWeek).set("formatOptionsGreatDay",t||this.formatOptionsGreatDay).set("formatOptionsGreatHour",t||this.formatOptionsGreatHour).set("formatOptionsGreatMinute",t||this.formatOptionsGreatMinute).set("formatOptionsMajorCentury",e||this.formatOptionsMajorCentury).set("formatOptionsMajorDecade",e||this.formatOptionsMajorDecade).set("formatOptionsMajorYear",e||this.formatOptionsMajorYear).set("formatOptionsMajorMonth",e||this.formatOptionsMajorMonth).set("formatOptionsMajorWeek",e||this.formatOptionsMajorWeek).set("formatOptionsMajorDay",e||this.formatOptionsMajorDay).set("formatOptionsMajorHour",e||this.formatOptionsMajorHour).set("formatOptionsMajorMinute",e||this.formatOptionsMajorMinute).set("formatOptionsMajorSecond",e||this.formatOptionsMajorSecond).set("formatOptionsMinorDecade",i||this.formatOptionsMinorDecade).set("formatOptionsMinorYear",i||this.formatOptionsMinorYear).set("formatOptionsMinorMonth",i||this.formatOptionsMinorMonth).set("formatOptionsMinorWeek",i||this.formatOptionsMinorWeek).set("formatOptionsMinorDay",i||this.formatOptionsMinorDay).set("formatOptionsMinorHour",i||this.formatOptionsMinorHour).set("formatOptionsMinorMinute",i||this.formatOptionsMinorMinute).set("formatOptionsMinorSecond",i||this.formatOptionsMinorSecond)))}setFormattingDecade(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorDecade",t)),e&&(i=i.set("formatOptionsMinorYear",e)),i)))}setFormattingYear(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorYear",t)),e&&(i=i.set("formatOptionsMinorMonth",e)),i)))}setFormattingMonth(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatYear",t)),e&&(s=s.set("formatOptionsMajorMonth",e)),i&&(s=s.set("formatOptionsMinorWeek",i)),s)))}setFormattingWeek(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMonth",t)),e&&(s=s.set("formatOptionsMajorWeek",e)),i&&(s=s.set("formatOptionsMinorDay",i)),s)))}setFormattingDay(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatWeek",t)),e&&(s=s.set("formatOptionsMajorDay",e)),i&&(s=s.set("formatOptionsMinorHour",i)),s)))}setFormattingHour(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatDay",t)),e&&(s=s.set("formatOptionsMajorHour",e)),i&&(s=s.set("formatOptionsMinorMinute",i)),s)))}setFormattingMinute(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatHour",t)),e&&(s=s.set("formatOptionsMajorMinute",e)),i&&(s=s.set("formatOptionsMinorSecond",i)),s)))}setFormattingSecond(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMinute",t)),e&&(s=s.set("formatOptionsMajorSecond",e)),i&&(s=s.set("formatOptionsMinorMillisecond",i)),s)))}setFormattingMilliSecond(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsGreatSecond",t)),e&&(i=i.set("formatOptionsMajorMilliSecond",e)),i)))}}const Kh=(t,e)=>(i,s)=>{const r=s-i;if(e){const e=Math.log10(r/2);let n=10**Math.floor(e-t);const o=1/n;n=Math.round(n*o)/o;const h=Math.round(Math.floor(i/(10*n))*n*10*o)/o;return rr(h,s,n,void 0,o)}const n=Math.log10(r);let o=10**Math.round(n-t);const h=1/o;return o=Math.round(o*h)/h,sr(i,s,o,h)},Jh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Qh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%3==0)):2===e?t.filter(((t,e)=>e%4==0)):3===e?t.filter(((t,e)=>e%5==0)):void 0,ta=or(void 0,2,5),ea=(t,e,i,s,r,n)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,ia=(t,e)=>{const i=Ri(t),s=Di(t);if(e)return(t,e)=>{const r=[],n=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=n-1;t<=o+1;t+=1){const e=s**t;r.push(e)}return r};const r=10===t?9:4;return(t,e)=>{const n=Math.round(i(t)),o=Math.round(i(e)),h=[],a=s**n,l=(s**o-a)/r;for(let i=1;i<=r;i+=1){const s=a+l*i;s>t&&sBi.LogarithmicNoExponents(e,i,void 0,t.base):Bi.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Bi.LogarithmicNoExponents(e,i,void 0,t.base):Bi.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Bi.LogarithmicNoExponents(e,i,void 0,t.base):Bi.Numeric),n=[],o=[];Fh(this.extremeTickStyle)||n.push({rh:"Extreme ticks",je:this.extremeTickStyle,Ze:void 0===e?i:(t,s,r)=>i(e+t,s,r),Hr:ir,Qe:!0,Fr:!0}),o.push({rh:"Major ticks",Jg:0,je:this.majorTickStyle,Ze:void 0===e?s:(t,i,r)=>s(e+t,i,r),Hr:"logarithmic"===t.type?ia(t.base,!0):Kh(0,!0),zh:"logarithmic"===t.type?{wr:Qh}:{wr:Jh},$r:void 0}),Fh(this.minorTickStyle)||o.push({rh:"Minor ticks",Jg:1,je:this.minorTickStyle,Ze:void 0===e?r:(t,i,s)=>r(e+t,i,s),Hr:"logarithmic"===t.type?ia(t.base,!1):Kh(1,!1),zh:"logarithmic"===t.type?{wr:ea}:{wr:ta},$r:50});const h=this.cursorFormatter?this.cursorFormatter:Bi.Numeric;return{qe:n,th:o,ih:void 0===e?h:(t,i,s)=>h(e+t,i,s),sh:1e-9,eh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setExtremeTickStyle(t){if("function"==typeof t){const e=this.get("extremeTickStyle");return this.set("extremeTickStyle",t(e))}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setTickStyle(t){const e=this.setMajorTickStyle(t).setMinorTickStyle(t);return e.extremeTickStyle!==zh?e.setExtremeTickStyle(t):e}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setFormattingFunction(t){return this.withMutations((e=>e.set("extremeFormattingFunction",t).set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getExtremeFormattingFunction(){return this.get("extremeFormattingFunction")}setExtremeFormattingFunction(t){return this.set("extremeFormattingFunction",t)}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const na=(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(zt.navigator.msSaveBlob)zt.navigator.msSaveBlob(r,e);else{const t=zt.document.createElement("a");zt.document.body.appendChild(t);const i=zt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{zt.URL.revokeObjectURL(i),zt.document.body.removeChild(t)}),0)}},oa=(t,i,s,r,n,o)=>{const h=t.oc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},ha=(t,e)=>{if("relative"===t)return e;if(t instanceof Ui)return t;const i=t.x instanceof gr?t.x.At:t.x.x,s=t.y instanceof gr?t.y.At:t.y.y;return Xi(i,s)},aa=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=wh(o)?o:$i(o)?s:void 0;if(h&&Wi(i)){const t=yt(n,h,r.At);return r.Wo({engineX:t.x,engineY:t.y})}if(h&&$i(i))return yt(n,h,s);if(h&&wh(i))return yt(n,h,i)}else{const i=t;if($i(e)){const t=r.Uo(i);return yt({x:t.engineX,y:t.engineY},r.At,s)}if(wh(e)){const t=e,s=r.Uo(i);return yt({x:s.engineX,y:s.engineY},r.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class la{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.op=[],this.ap=[],this.R=new r.Eventer,this.lp=void 0,this.up=void 0,this.cp=void 0,this.Xt=A(0,0,0,0),this.dp=!1,this.ji=!1,this.fp=()=>{this.Ap=!0,this.gp.Ms()},this.pp=t=>e=>{const i=this.op.indexOf(e);-1!==i&&this.op.splice(i,1),this.cs.Ms(),t.Y()},this.yp=t=>{const e=this.ap.indexOf(t);-1!==e&&this.ap.splice(e,1),this.cs.Ms()},this.Ap=!0,this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.CA=t,this.mp=i,this.gp=s,this.removePanel=n,this.ts=e.cs.ts;const l=e.cs.oi();if(this.uiScale=i.d2({scaleXYConstructor:Yi}).Vi(0,100).Oi(0,100).it(l),this._g=i.d2({scaleXYConstructor:Yi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(l),this.engine=e.cs.vp,this.cs=e.cs.Sp,this.hs=this.cs.hs.rs(this,{}),this.xp=()=>e.bp("unidentified ui"),this.Mp=e._p(),this.wp=this.gp.Ee(this.uiScale).Ve(u(0,0)).it(u(100,100)).Re(o).Le(h).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.fp);this.Cp=()=>a.off(t)}else{const t=e.cs.Eo(this.fp);this.kp=e.cs.zo.bind(e.cs,t)}const c=e.cs.Oo((t=>{this.dp=t,this.R.emit("inViewChange",this,t)}));this.Tp=e.cs.No.bind(e.cs,c),this.lp=n}getTheme(){return this.ts}getSizePixels(){return this._g.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.wp.Re(t),this.gp.Ms(),this}getBackgroundFillStyle(){return this.wp.Jh()}setBackgroundStrokeStyle(t){return this.wp.Le(t),this.gp.Ms(),this}getBackgroundStrokeStyle(){return this.wp.So()}translateCoordinate(t,e,i){return aa(t,e,i,this._g,this.cs)}Fp(t){return this.op.push(t),this.cs.Ms(),t}Ip(t){return this.ap.push(t),this.cs.Ms(),t}addUIElement(t=Jo,e=this.uiScale){e=ha(e,this._g);const i=this.xp();return this.Fp(oa(t,i,this.uiScale,e,this.pp(i),this.ts))}addLegendBox(t=uh,i=this.uiScale){i=ha(i,this._g);const s=this.Ip(oa(t,this.Mp,this.uiScale,i,this.yp,this.ts));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Vs.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Vs.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.ap}dispose(){return this.ji||(this.ji=!0,this.kp&&this.kp(),this.Cp&&this.Cp(),ua(this.uiScale),ua(this._g),this.Tp&&this.Tp(),this.up&&this.up(),this.gp.Y(),this.Mp.Y(),this.op.slice().forEach((t=>{t.dispose()})),this.ap.slice().forEach((t=>{t.dispose()})),this.cs.Ms(),this.lp&&this.lp(this),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}saveToFile(t,e,i){return na(this.engine,t,e,i),this}Gr(t){this.Xt=t,this.fp()}J(){return this._g.J(),this.uiScale.J(),this}K(){return this._g.K(),this.uiScale.K(),this}ze(t){if(this.Ap){const t=this.gp.cs.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this._g.it(e,i);const s=[this.Xt.left,this.Xt.right],r=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.zi(r);const n=this.uiScale.getInnerIntervalPixels();this._g.Vi(0,n.x).Ei(s).Oi(0,n.y).zi(r),this.R.emit("resize",this,n.x,n.y,e,i)}this.Ap=!1}Pp(){for(let t=0;t{t.ii&&t.ii()};class ca extends la{constructor(t,e,i,s,r,n){super(t,e,i,e.Bp("uipanel bg",0),s,e.cs.ts.uiPanelBackgroundFillStyle,e.cs.ts.uiPanelBackgroundStrokeStyle,n),this.Dp(r,this._g)}setMinimumSize(t){return this.Ld=t,this.cs.Ms(),this}getMinimumSize(){return this.Ld}ze(t){super.ze(t),super.Pp()}}const da=A(10,10,10,10);class fa extends la{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Lp={},this.Ia=da,this.ph=!0,this.Rp=e.Ep("chart internal ui",0),this.Ch=this.Rp.Wr(this.uiScale).Sr("Chart").Ve(u(50,100)).Za(u(0,1)).ir(h).Re(a).setMouseInteractions(!1),this.zp=this.hs.Bg([this.Ch]).bs(this.ts.effectsText)}setAnimationsEnabled(t){return this.ph=t,this}getAnimationsEnabled(){return this.ph}setTitle(t){return this.Ch.Sr(t),this.cs.Ms(),this}getTitle(){return this.Ch.Tr()}getTitleSize(){return this.Ch.Os().od()}setTitleFillStyle(t){return this.Ch.Re(t),this.fp(),this}getTitleFillStyle(){return this.Ch.Jh()}setTitleFont(t){return this.Ch.ir(t),this.fp(),this}getTitleFont(){return this.Ch.tr()}setTitleRotation(t){return this.Ch.sr(t),this.cs.Ms(),this}getTitleRotation(){return this.Ch.er()}setTitleEffect(t){return this.zp.bs(t),this.cs.Ms(),this}getTitleEffect(){return this.zp._s()}setTitleMargin(t){var e,i;return this.Lp="object"==typeof t?this.Lp?(e=this.Lp,{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.fp(),this}getTitleMargin(){return this.Lp}setPadding(t){return this.Ia="object"==typeof t?S(this.Ia,t):{left:t,top:t,right:t,bottom:t},this.fp(),this}getPadding(){return this.Ia}Vp(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.Rp.Y(),this}}const ga={Np:(t,e)=>t.Jh()!==_&&0!==t.Tr().length&&t.getVisible()?t.Os().od().y:0,Gp(t,e){t.Ve(u(50,100)).Gr({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}},ma=t=>"show-all-interpolated"===t||"show-nearest-interpolated"===t||"show-pointed-interpolated"===t,ya=(t,e)=>{const i="series"in t?t.series:void 0;if(!i||!("getCursorFormattingOverride"in i))return e;const s=i.getCursorFormattingOverride();return s?s(t,e):e},pa=(t,e,i,s,n,o,h)=>{let a,l,u=n,c=o,d=null,f=!0;const g=new r.Eventer;if(s){f=!1;const e=()=>{f=!0,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},i=()=>{t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},r=()=>{f=!1,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},n=()=>{f=!0,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},o=()=>{t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())},h=()=>{f=!1,t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())};s.onSeriesBackgroundMouseEnter(e),s.onSeriesBackgroundMouseMove(i),s.onSeriesBackgroundMouseLeave(r),s.onSeriesBackgroundTouchStart(n),s.onSeriesBackgroundTouchMove(o),s.onSeriesBackgroundTouchEnd(h),s.Wp(((e,i)=>{i.onMouseEnter(((e,s,r)=>{i.Yp()&&(l||t.cs.Ms(),a=r||void 0),t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())})),i.onMouseMove(((e,s,r)=>{i.Yp()&&(l||t.cs.Ms(),a=r||void 0),t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())})),i.onMouseLeave((()=>{i.Yp()&&(l||t.cs.Ms(),a=void 0),t.getCursorMode()&&(l&&m?y.ze(...m):t.cs.Ms())}))}))}let m;const y={setCursor:e=>(e(i),t),getCursor:()=>i,setCursorMode:e=>(u=e,t.cs.Ms(),t),getCursorMode:()=>u,setCustomCursor:t=>{l=t},onCursorTargetChanged:t=>g.on("cursorTargetChanged",t),offCursorTargetChanged:t=>{g.off(t)},setCursorFormatting:e=>(c=e,t.cs.Ms(),t),getCursorFormatting:()=>c,Y:()=>{i.dispose(),e.Y()},ze:(e,s,r,n)=>{m=[e,s,r,n];const o=t.cs.Zn();let y=[];if((null==n?void 0:n.explicitTarget)&&u)y=Array.isArray(n.explicitTarget)?n.explicitTarget:[n.explicitTarget];else if(!e&&u){const t=s.find((t=>t.getIsUnderMouse())),e=o&&t&&(!t.getCursorEnabled||t.getCursorEnabled())&&t.Ss?t.Ss(o):void 0;if(a=e||a,a&&"show-all"!==u&&"show-all-interpolated"!==u)y=[a];else if("show-all"===u||"show-all-interpolated"===u||"show-nearest"===u||"show-nearest-interpolated"===u){if((f||void 0!==t)&&o&&r){for(const t of s){if(!t.getVisible()||t.getCursorEnabled&&!t.getCursorEnabled())continue;if(t.getCursorEnabled&&!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,o,u);e&&y.push(e)}"show-nearest"!==u&&"show-nearest-interpolated"!==u||(y.sort(((t,e)=>h(t,o)-h(e,o))),y.length=1)}}else if(("show-pointed"===u||"show-pointed-interpolated"===u)&&o&&t&&(!t.getCursorEnabled||t.getCursorEnabled())&&r){const e=r(t,o,u);e&&(y=[e])}}y=Ee(y.map((t=>Ge(t))));const p=(null==n?void 0:n.overrideCursorPositions)||((t,e)=>e),A=y[0],x=y.length>0?y:void 0;if(A!==d&&o&&(l&&l(A,x,o),g.emit("cursorTargetChanged",A,x,o),d=A),l)i.getVisible()&&(i.setVisible(!1),i.Os().ze());else{if(y&&y.length>0){const e=c(t,y[0],y);i.setVisible(!0).setPosition(...p(y,y.map((t=>t.cursorPosition)))).setResultTable((t=>t.setContent(e)))}else i.setVisible(!1);(null==n?void 0:n.afterCursorPointedAt)&&n.afterCursorPointedAt(y),i.Os().ze()}},solveNearest:(e,i,s,r)=>{const n=e||t.cs.Zn();if(!n)return[];let o=[];if("show-all"===i||"show-all-interpolated"===i||"show-nearest"===i||"show-nearest-interpolated"===i){for(const t of s){if(!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,n,i);e&&o.push(e)}"show-nearest"!==i&&"show-nearest-interpolated"!==i||(o.sort(((t,e)=>h(t,n)-h(e,n))),o.length=1)}return o=Ee(o.map((t=>Ge(t)))),o},Hp:i};return y};class Aa{constructor(t,e){this.$p=t,this.Xp=e}alter(t){this.jp=void 0!==this.jp?this.jp:this.Xp(),this.Zp=t,this.$p(t)}resetValue(){void 0!==this.Zp&&(void 0!==this.jp&&this.isAltered()&&this.$p(this.jp),this.jp=void 0,this.Zp=void 0)}getNormalValue(){return void 0!==this.jp?this.jp:this.Xp()}isAltered(){return void 0!==this.Zp&&this.Xp()===this.Zp}}class xa{constructor(t){this.Qp=[],this.Hp=t,this.Jp=t.Jp}update(){return this.Jp.getVisible()?!(this.Kp()&&(!this.qp()||(this.resetTable(),this.Jp.Os(),this.Kp()))&&(this.ty(),this.Jp.Os(),this.Kp()&&(this.resetTable(),this.Jp.Os(),1))):(this.qp()&&this.resetTable(),!0)}qp(){for(let t=0;tthis.Jp.setOrigin(t)),(()=>this.Jp.getOrigin())))}ty(){const t=this.Fa.getNormalValue(),e=u(this.iy()?-t.x:t.x,this.sy()?-t.y:t.y);this.Fa.alter(e)}}class va extends xa{constructor(t,e,i){super(t),this.hy=this.ey(new Aa((t=>this.Jp.setTextFont((e=>e.setSize(t)))),(()=>this.Jp.getTextFont().getSize()))),this.ny=e,this.oy=i}ty(){const t=this.hy.getNormalValue(),e=this.ny;if(enew Sa(t),FontSize:(t=5,e=5)=>i=>new va(i,t,e)},Ma={None:$n,Rectangle:Fo,Circle:Ro,Diamond:Do,Pointer:Po};class Ca extends Uo{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ju=this.ts.cursorResultTableTextFont,this.Yd=0,this.ly=this.ts.cursorResultTableTextFillStyle,this.oa=100}setContent(t){let e;void 0===t?e=[]:Array.isArray(t)?(e=[],t.forEach((t=>{e.push(Array.isArray(t)?t:[t])}))):e=[[t]];for(let t=0;t0||n||o)){s=!0;break}}s||(i.unshift(""),i.push(""))}const i=e.length;let s=this.getMembers().length;for(let t=0;t=i)this.getMembers()[t].dispose(),t-=1,s-=1;else{const i=e[t].length;let s=n.getMembers().length;for(let o=0;o=i)n.getMembers()[o].dispose(),o-=1,s-=1;else if(void 0!==u&&u.length>0||c||d){const t=a?this.Ju.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];void 0!==i&&t.set(e,i)}return t})):this.Ju,e=l||this.ly,i=f[o];if(u){let s;i&&i instanceof Io?s=i:(i&&i.dispose(),s=n.addElement(zo,o)),s.setText(u).setFont(t).setFillStyle(e).setTextRotation(this.Yd)}else if(c){let s;i&&i instanceof Oo?s=i:(i&&i.dispose(),s=n.addElement(Lo,o)),s.setFillStyle(e).setShape(c).setSize({y:t.size,x:t.size}),s.setMargin(5)}else if(d){let s;i&&"setTextFillStyleHidden"in(r=i)&&"setText"in r?s=i:(i&&i.dispose(),s=n.addElement(ih.setBackground(Ma.None),o).setOn(!0));const h=d.Bs();void 0!==h&&s.setButtonShape(h),s.setText(d.getName()).setTextFont(t).setTextFillStyle(e).setTextRotation(this.Yd),d.styleLegendEntry(s)}}else{const t=f[o];t&&t instanceof _o||(t&&t.dispose(),n.addGap(void 0,o))}}}}var r;return this.Rs.Ms(),this}setTextFillStyle(t){this.ly="function"==typeof t?t(this.ly):t;for(let t=0;tt.setFillStyle(o.cursorResultTableFillStyle).setStrokeStyle(o.cursorResultTableStrokeStyle))).setTextFillStyle(o.cursorResultTableTextFillStyle).setTextFont(o.cursorResultTableTextFont),this.Sy=ba.Flip(this)}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setPointMarkerVisible(t){return this.gy=t,this.Ay.forEach((e=>e.pointMarker.setVisible(e.targetVisible&&t))),this.Rs.Ms(),this}getPointMarkerVisible(){return this.gy}setPointMarker(t){return this.Ay.forEach((e=>t(e.pointMarker))),this.yy.push(t),this.Rs.Ms(),this}setResultTableVisible(t){return this.py=t,this.Rs.Ms(),this}getResultTableVisible(){return this.py}setResultTable(t){return t(this.Jp),this.Rs.Ms(),this}setAutoFitStrategy(t){return this.Sy&&this.Sy.resetTable(),this.Sy=t?t(this):void 0,this.Rs.Ms(),this}getAutoFitStrategy(){return void 0!==this.Sy}setVisible(t){return this.Zi=t,this.Rs.Ms(),this}getVisible(){return this.Zi}dispose(){return this.Ay.forEach((t=>t.pointMarker.dispose())),this.Jp.dispose(),this.yy.length=0,this.my(this),this.R.emit("dispose"),this}Kp(){const t=this.Jp,i=this.Rs.cs.At,s=yt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=yt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return{x:s.xi.x.getInnerEnd(),y:s.yi.y.getInnerEnd()}}ze(){return this.Sy&&this.Sy.update(),this.Jp.setVisible(this.dp&&this.Zi&&this.py),this.Ay.forEach((t=>t.pointMarker.setVisible(t.targetVisible&&this.dp&&this.Zi&&this.gy))),this.Ay.forEach((t=>t.pointMarker.ze())),this.Jp.ze(),this}Os(){return this.Ay.forEach((t=>t.pointMarker.Os())),this.Jp.Os(),this}xy(t,e){const i=e===this.scale?t:yt(t,e,this.scale);this.Jp.setPosition(i)}}const wa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5)));class Ea extends Ta{setPosition(...t){const e=this.renderingScale,i=ha(t[0].resultTableScale,e),s=i===this.scale?t[0].resultTable:yt(t[0].resultTable,i,this.scale);return this.dp=!1,this.Ay.forEach((t=>{t.targetVisible=!1})),t.forEach(((t,i)=>{const s=ha(t.pointMarkerScale,e),r=s===this.scale?t.pointMarker:yt(t.pointMarker,s,this.scale);let n=this.Ay[i];if(!n){const t=new Oo(this.Rs,this.renderingScale,this.scale,Ot,this.ts).setMouseInteractions(!1).setFillStyle(this.ts.cursorPointMarkerFillStyle).setSize(this.ts.cursorPointMarkerSize).setShape(this.ts.cursorPointMarkerShape);n={pointMarker:t,targetVisible:!0},this.Ay.push(n),this.yy.forEach((e=>e(t)))}n.pointMarker.setPosition(r),n.targetVisible=((t,e,i=e)=>{const s=e!==i?yt(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()})(t.pointMarker,s),n.targetVisible&&(this.dp=!0)})),this.Jp.setPosition(s),this.Rs.Ms(),this}}class ka{constructor(t,e=[]){this.by=[],this.My=(t,e)=>(this.by.forEach((i=>i(t,e))),t),this.addStyler=t=>new ka(this.vy,this.by.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ka(t,this.by.map((t=>t))),this._y=(t,e,i,s,r)=>this.My(new Ea(t,e,i,s,this.vy,r),r),this.vy=t,this.by=e}}const Ia=new ka(Fo,[wa]),za=new ka(Po,[wa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Po&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Fa=Ia,Ra=Ia,Da=Ia,Pa=za,Oa=new ka(Fo,[wa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Vs.LeftBottom)))]),La=Ia;var _a;e.SliceLabelIndices=void 0,(_a=e.SliceLabelIndices||(e.SliceLabelIndices={}))[_a.LabelsInsideSlices=0]="LabelsInsideSlices",_a[_a.LabelsOnSides=1]="LabelsOnSides";const Ba={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},Va={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Ga extends is{constructor(){super(...arguments),this.Cs="Slice",this.M=0}}const Na=(t,e)=>{se(e),t.setExploded(!t.getExploded())};class Ua extends Ga{}class Ya extends Ua{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.wy=!1,this.Cy=_,this.ky=_,this.Ty=this.M,this.Fy=this.wy?1:0,this.Iy=this.getVisible(),this.Py=q((()=>this.chart.cs.Ms())),this.Dy=q((()=>this.chart.cs.Ms())),this.By=()=>{this.Ly=void 0},this.Ry=()=>{this.Ey=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.zy=e.ud(r).ds(this.getHighlight()),this.As(this.zy),this.rh=i.Wr(r).ds(this.getHighlight()),this.As(this.rh,{isText:!0}),this.onMouseClick(Na),this.onTouchEnd(Na)}setValue(t){return this.chart.getAnimationsEnabled()?this.Iy&&this.Vy(this.Ty,t):this.Ty=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setExploded(t){if(t&&!1===this.chart.getMultipleSliceExplosion()){const t=this.chart.getSlices();for(let e=0;e{this.Fy=t,this.chart.cs.Ms()})),this.Ey.onEveryAnimationEnd(this.Ry),this.wy=!this.wy):!1!==this.chart.getMultipleSliceExplosion()||t?(this.Fy=this.wy?0:1,this.wy=!this.wy):(this.Fy=0,this.wy=!this.wy),this.chart.cs.Ms(),this}getExploded(){return this.wy}setVisible(t){return this.Iy=t,!1===t?this.chart.getAnimationsEnabled()&&this.Ty>0?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),this.Vy(this.Ty,0,(()=>super.setVisible(!1)))):(this.Ty=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),super.setVisible(!0),this.Vy(this.Ty,this.M)):(this.Ty=this.M,super.setVisible(!0)),this}Vy(t,e,i){this.Ly=this.Py(300,$.ease)([[t,e]],(([t])=>{this.Ty=t,this.chart.cs.Ms()})),this.Ly.onEveryAnimationEnd(this.By),i&&this.Ly.onAnimationEnd(i)}setStyle(t,e,i,s){this.Cy=t,this.ky=i,this.zy.Re(this.Cy).Le(e),this.rh.Re(this.ky).ir(s);for(let t=0;tyi(e,mi(wi(.5*(t.au()+t.Ti())*Math.PI/180),i)),Xa=(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.Oy.indexOf(t);e>=0&&(this.Oy.splice(e,1),this.Ky())},this.cs.Jn(Sh.Sf),this.qy=e.tm("pieChart bottom",0),this.im=e.tm("pieChart top",1),this.Ch.Sr("Pie Chart"),this.Dp(r,this._g),this.onBackgroundMouseDoubleClick(Wa);const h=ns(new os(Wa));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd);const a=e.sm(),l=Vt(o?o.cursorBuilder:void 0,Ra);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",$a,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Ra){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addSlice(t,e){const i=new Ya(this.$y,this.qy,this.im,this,this._g,this.Jy,this.ts,this.cs.hs);this.$y+=1,i.setName(t);const s=this.ph;return this.ph=!1,i.setValue(e),this.ph=s,i.setEffect(this.Zy),this.rm(i),this.Oy.push(i),this.Ky(),i.setHighlightOnHover(this.Wy),i.onMouseMove((()=>{this.getCursorMode()&&this.cs.Ms()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.bs(t))),this.cs.Ms(),this}getSliceEffect(){return this.Zy}setSliceSorter(t){return this.Ny=t,this.Oy=this.Oy.sort(this.Ny),this.cs.Ms(),this}getSliceSorter(){return this.Ny}setLabelFillStyle(t){this.Hy="function"==typeof t?t(this.Hy):t;for(let t=0;te.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Qy}setLabelFormatter(t){return this.nm=t,this.cs.Ms(),this}getLabelFormatter(){return this.nm}setSliceHighlightOnHover(t){return this.Wy=t,this.Oy.forEach((e=>e.setHighlightOnHover(t))),this}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=ga.Np(this.Ch,this.Lp),i=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+e)),s=u(this.Ia.left+i.x/2,this.Ia.bottom+i.y/2);if(this.Kd){const t=this.Kd;this.Oy.forEach((e=>{this.rm(e,new N({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Oy[t].zy.setVisible(e),this.Oy[t].rh.setVisible(e)}this.Oy=this.Oy.sort(this.Ny);const r=this.Oy.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.om(r,o,s,i)}rm(t,e=this.Gy(t.index,t)){t.setStyle(e,this.Uy,this.Hy,this.Yy)}Ky(){this.Oy=this.Oy.sort(this.Ny),this.cs.Ms()}af(){return this.Oy}dispose(){return super.dispose(),this.Oy.slice().forEach((t=>t.dispose())),this.hm.Y(),this.im.Y(),this.qy.Y(),this}}const $a=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],Za={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},qa=(...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};class Ka extends ja{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.nm=Va.NamePlusValue,this.am=[],this.lm=40,this.um=5,this.dm=10,this.fm=this.ts.pieChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.fm=t;for(let t=0;tt.rh.setVisible(!1))),this.am.forEach((t=>t.setVisible(!1)))}else{Xa(t,e,i,u,this.iu,a);let s=90;const r=t.map(((t,r)=>{const h=360*e[r],a=s-h,l=wi(Ci(.5*(s+a))),c=l.x>=0?-1:1,d=yi(yi(i,mi(l,u+n)),{x:c*-o,y:0});s=a;const f={x:c,y:0};t.rh.Ve(d).Za(f),t.rh.Os();const g=ni(t.rh.hh());return{position:d,alignment:f,shape:t.rh,boundaries:g,sliceAngleVec:l,slice:t}})),l=[];for(let t=0;t{const s=t.slice.zy,r=Ha(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=Mi(t.position.y,r,i),o=t.position;this.Am([r,n,o])}))}}getMinimumSize(){return u(500,300)}Am(t){let e;for(let t=0;t{if(cs(t)){const e=t.getThickness(),i=t.getFillStyle();if(U(i))return 1===e?Cr:new wr({size:e,fillStyle:i,shape:"sphere"})}return Cr};class el{constructor(t,e,i,s,n,o,h,a,l,u){this.R=new r.Eventer,this.M=0,this.Zi=!0,this.ji=!1,this.Yo=!0,this.Ms=t,this.ym=e,this.vm=i,this.Sm=s,this.xm=n,this.bm=o,this.Yd=h,this.ly=a,this.Mm=l,this.lc=u}setValue(t){return t===this.M||(this.M=t,this.Ms(),this.R.emit("valueChange",this,this.M)),this}getValue(){return this.M}setTickStyle(t){return this.vm="function"==typeof t?t(this.vm):t,this.Ms(),this}getTickStyle(){return this.vm}setTickLength(t){return this.Sm=t,this.Ms(),this}getTickLength(){return this.Sm}setGridStrokeStyle(t){return this.xm="function"==typeof t?t(this.xm):t,this.Ms(),this}getGridStrokeStyle(){return this.xm}setTextPadding(t){return this.bm=t,this.Ms(),this}getTextPadding(){return this.bm}setTextRotation(t){return this.Yd=t,this.Ms(),this}getTextRotation(){return this.Yd}setTextFillStyle(t){return this.ly="function"==typeof t?t(this.ly):t,this.Ms(),this}getTextFillStyle(){return this.ly}setTextFont(t){return this.Mm="function"==typeof t?t(this.Mm):t,this.Ms(),this}getTextFont(){return this.Mm}setTextFormatter(t){return this.lc=t,this.Ms(),this}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}dispose(){return this.ji||(this.ji=!0,this.ym(),this.Ms(),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.Zi!==t;return this.Zi=t,e&&(this.R.emit("visibleStateChanged",this,this.Zi),this.Ms()),this}getVisible(){return this.Zi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setMouseInteractions(t){return this.Yo=t,this.Ms(),this}getMouseInteractions(){return this.Yo}}class il extends el{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,a,l),this._m=u,this.wm=c,this.Ia=d}setBackgroundFillStyle(t){return this._m="function"==typeof t?t(this._m):t,this.Ms(),this}getBackgroundFillStyle(){return this._m}setBackgroundStrokeStyle(t){return this.wm="function"==typeof t?t(this.wm):t,this.Ms(),this}getBackgroundStrokeStyle(){return this.wm}setPadding(t){return this.Ia="number"==typeof t?{left:t,top:t,right:t,bottom:t}:{...this.Ia,...t},this.Ms(),this}getPadding(){return this.Ia}}class sl{constructor(t,e,i,s){this.Cm=[],this.km=new Map,this.Tm=t,this.Fm=e,this.Im=i,this.Pm=s}Dm(){this.Im&&this.Im();const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];let i=[];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 s=this.Cm.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.Tm(),this.Cm.push(e));const n=[],o=e.Bm().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Fm(e,n,t.sharedProperties);i=fe(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.Bd(t)}))})),s.forEach((t=>{t.dispose();const e=this.Cm.indexOf(t);e<0?Me(0,(()=>{})):this.Cm.splice(e,1)})),r.forEach((t=>{const e=this.km.get(t.Jo);e&&t.collection.cs.co({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.km.clear(),r.forEach((t=>{this.km.set(t.Jo,t)})),this.Pm&&this.Pm(this.Cm,i)}}}Lm(){this.Cm.forEach((t=>{t.dispose()})),this.Cm.length=0}}class rl{constructor(t){this.Rm=[],this.Em=t}Dm(){return this.zm(),{add:()=>this.fl(),finishPlot:()=>{this.Vm()}}}fl(){let t=this.Rm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Em()},this.Rm.push(t)),t.isFree=!1,t.shape}zm(){this.Rm.forEach((t=>{t.isFree=!0}))}Vm(){this.Rm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Rm.splice(this.Rm.indexOf(t),1)}))}Lm(){this.Rm.forEach((t=>t.shape.dispose())),this.Rm.length=0}}class nl extends gr{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Om({x:t.cs.ts.xAxis3DNumericTicks,y:t.cs.ts.yAxis3DNumericTicks,z:t.cs.ts.zAxis3DNumericTicks}),datetime:e.Om({x:t.cs.ts.xAxis3DDateTimeTicks,y:t.cs.ts.yAxis3DDateTimeTicks,z:t.cs.ts.zAxis3DDateTimeTicks}),time:e.Om({x:t.cs.ts.xAxis3DTimeTicks,y:t.cs.ts.yAxis3DTimeTicks,z:t.cs.ts.zAxis3DTimeTicks})},{type:"linear"}),this.Uf=[],this.Nm=()=>{},this.Gm=()=>{},this.Um=()=>{},this.Wm=()=>{},this.chart=t,this.Ym=r,this.Hm=n,this.$m=o,this.Xm=this.Ym.At;const l=this.Gh.Om({x:this.ts.xAxis3DStrokeStyle,y:this.ts.yAxis3DStrokeStyle,z:this.ts.zAxis3DStrokeStyle});this.jm=this.Ym.gm([Za.InternalUI]).Ye(l).Zm(tl(l)).setMouseInteractions(!1),this.Fh=this.Hm.Wr(this.$m).setMouseInteractions(!1).Re(e.Om({x:t.cs.ts.xAxis3DTitleFillStyle,y:t.cs.ts.yAxis3DTitleFillStyle,z:t.cs.ts.zAxis3DTitleFillStyle})).ir(e.Om({x:t.cs.ts.xAxis3DTitleFont,y:t.cs.ts.yAxis3DTitleFont,z:t.cs.ts.zAxis3DTitleFont})).ua(3),this.Qm=new rl((()=>this.Hm.Wr(this.$m).ua(2).Ur(Le).Gr(Le))),this.Jm=new sl((()=>this.Hm.Km(this.$m).setMouseInteractions(!1).ua(1)),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((({positions:e,existingMember:i})=>{const s=i||t.Zr();return s.Fl(e),s}))))),this.qm=new sl((()=>this.Ym.Qg().setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Ye(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.ml(e)))))),this.hs=a,this.hr=this.hs.Bg([this.Fh]).bs(s.effectsText),this.jm.setMouseEnterEventHandler(this.Nm).setMouseLeaveEventHandler(this.Gm).setMouseDragEventHandler(this.Um).setMouseDragStopEventHandler(this.Wm),i.yg=this}setTickStrategy(t,e){return super.Hh(t,e)}getTickStrategy(){return this.lh}addCustomTick(){const t=new il((()=>this.chart.cs.Ms()),(()=>{const e=this.Uf.indexOf(t);e>=0&&this.Uf.splice(e,1)}),this.ts.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickLength,this.ts.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.ts.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)),_,ut,{left:4,right:4,top:4,bottom:4});return this.Uf.push(t),this.chart.cs.Ms(),t}setStrokeStyle(t){return this.jm.Ye(t).Zm(tl(this.jm.xu())),this.chart.cs.Ms(),this}getStrokeStyle(){return this.jm.xu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.jm.setVisible(t),!1===t&&(this.qm.Lm(),this.Qm.Lm(),this.Jm.Lm()),this.Ym.Ms(),this}Ng(){return this.chart.getSeries()}tv(t){return Math.abs(this.At.st(t)*this.Ym.sv(1))}Vr(t,e,i){const s=Math.abs(this.At.st(e-t)*this.Ym.sv(1));return{min:t-i*s,max:e+i*s}}Mr(t,e){const i=new ol(e,t,this.Hm,this.$m,this.Ym);return i.rh.ua(0),i}_r(t,e){const i=this.ev(e,t.M,t.Eh.je.tickLength,t.Eh.je.tickPadding);return t.rh.Ve(i.labelPosition).Za(i.labelAlignment),i}ev(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),c=Ue.addVec(ri(n,o,l),Ue.multiplyVec(Ue.multiply(h,this.Ym.sv(.5*this.jm.xu().getThickness())),r)),d=Ue.addVec(c,Ue.multiplyVec(Ue.multiply(h,this.Ym.sv(i)),r)),f=this.Ym.hv(d)||u(0,0);return{labelPosition:yi(yt(f,this.chart.cs.At,this.$m),mi(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}rv(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),a=Ue.addVec(ri(r,n,h),Ue.multiplyVec(Ue.multiply(o,this.Ym.sv(.5*this.jm.xu().getThickness())),s)),l=Ue.addVec(a,Ue.multiplyVec(Ue.multiply(o,this.Ym.sv(10)),s)),c=this.Ym.hv(a)||u(0,0),d=this.Ym.hv(l)||u(0,0);return this.Hm.He(this.$m).Xe(c).$e(d).Ye(new us({fillStyle:new N({color:w(120*i)}),thickness:1}))}Er(t,e){return hl(t,e,this.At)}ze(t){if(!this.Zi)return;const e=Math.min(this.$h,this.Xh),i=Math.max(this.$h,this.Xh),s=this.Xm,r=f(s.x.rt(),s.y.rt(),s.z.rt());let n,o;this.nv()?(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.Gh.ov(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Gh.uf,a=this.Ym.hv(n)||u(0,0),l=this.Ym.hv(o)||u(0,0),c=ri(n,o,.5),d=Ue.addVec(c,Ue.multiplyVec(Ue.multiply(h,-1),r)),g=this.Ym.hv(c)||u(0,0),m=this.Ym.hv(d)||u(0,0),y=di(pi(yt(g,this.chart.cs.At,this.$m),yt(m,this.chart.cs.At,this.$m)));this.jm.Ot().ml([n,o]);const{gridlinePositionA:p,gridlinePositionB:A,gridlinePositionC:x}=this.Gh.av(t),S=t=>({x:-1===t.x?this.Xm.x.getInnerStart():1===t.x?this.Xm.x.getInnerEnd():0,y:-1===t.y?this.Xm.y.getInnerStart():1===t.y?this.Xm.y.getInnerEnd():0,z:-1===t.z?this.Xm.z.getInnerStart():1===t.z?this.Xm.z.getInnerEnd():0}),v=S(p),b=S(A),M=S(x),C={physicalAxisSize:gi(pi(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:y,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},T=this.dr(C),w=this.qm.Dm();for(const[t,e]of this.uh)for(const[,i]of e){const e=T.get(i);if(!e)continue;const s=this.lv(C,e);w.add({Jo:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.je.tickStyle}),s.gridStroke&&w.add({Jo:0,positions:s.gridStroke},{lineStyle:t.je.gridStrokeStyle})}const E=this.Qm.Dm(),k=this.Jm.Dm(),I={x:0,y:0};this.Uf.forEach((t=>{if(!t.Zi||t.Mi)return;const s=this.ev(C,t.M,t.Sm,t.bm),r=this.lv(C,s);if(t.ly!==_){const e=E.add().Ve(s.labelPosition).Za(s.labelAlignment).Re(t.ly).ir(t.Mm).Sr(t.lc(t.M)).sr(t.Yd).setMouseInteractions(t.Yo),i=e.Os().oi();if(I.x=Math.max(I.x,i.x),I.y=Math.max(I.y,i.y),t._m!==_){const i=e.hh(),s=[{x:i[0].x-t.Ia.left,y:i[0].y+t.Ia.top},{x:i[1].x+t.Ia.right,y:i[1].y+t.Ia.top},{x:i[2].x+t.Ia.right,y:i[2].y-t.Ia.bottom},{x:i[3].x-t.Ia.left,y:i[3].y-t.Ia.bottom}];k.add({Jo:0,positions:s},{fillStyle:t._m,strokeStyle:t.wm})}}w.add({Jo:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.vm}),r.gridStroke&&w.add({Jo:0,positions:r.gridStroke},{lineStyle:t.xm})})),E.finishPlot(),k.finishPlot(),w.finishPlot();const z=this.kr(((t,e)=>{const i=e.rh.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:I.x,y:I.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.Fh.Za({x:0,y:0}).sr(180*-F/Math.PI);const R=Ue.addVec(c,Ue.multiplyVec(Ue.multiply(h,this.Ym.sv(.5*this.jm.xu().getThickness()+this.Ir(((t,e)=>Math.max(t,e.tickLength)),0))),r)),D=this.Ym.hv(R)||u(0,0),P=yi(yt(D,this.chart.cs.At,this.$m),yi(yi(Ai(z,y),mi(y,this.Ir(((t,e)=>Math.max(t)),0))),Ai(mi(this.Fh.Os().oi(),.5),y)));this.Fh.Ve(P),this.jm.uv={overrideFollowing:!1,skipMousePicking:!1}}lv(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Lt(h,0)||Lt(h,1)||(a=[this.cv()?{...i,x:n.x}:this.dv()?{...i,y:n.y}:this.nv()?{...i,z:n.z}:{x:0,y:0,z:0},this.cv()?{...s,x:n.x}:this.dv()?{...s,y:n.y}:this.nv()?{...s,z:n.z}:{x:0,y:0,z:0},this.cv()?{...r,x:n.x}:this.dv()?{...r,y:n.y}:this.nv()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}rr(){super.rr(),this.qm.Lm(),this.Qm.Lm(),this.Jm.Lm()}cv(){return this.Gh.cv()}dv(){return this.Gh.dv()}nv(){return this.Gh.nv()}}class ol extends mr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.fv=r}}const hl=(t,e,i)=>_t(t+.1*(e-t)+Math.abs(i.rt())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),al=(t,e,i,s)=>({Pr:()=>{const i=t();let s;for(const t of i){if(!t.Av())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},Dr:()=>{const e=t();let s;for(const t of e){if(!t.Av())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Lr:()=>{const e=t();let i;for(const t of e){if(!t.Av())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),ll=t=>({...al(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Lr().y)),Om:t=>t.y,ov:(t,e)=>({x:e.x,y:t.y,z:e.z}),uf:f(-1,0,0),av: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)}},cv:()=>!1,dv:()=>!0,nv:()=>!1}),ul=t=>({...al(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Lr().z)),Om:t=>t.z,ov:(t,e)=>({x:e.x,y:e.y,z:t.z}),uf:f(1,0,0),av: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)}},cv:()=>!1,dv:()=>!1,nv:()=>!0});class cl extends is{constructor(t,e,i,s,r){super(t,e,s,r),this.gv=ao,this.pv=!0,this.yv=!0,this.mv=!0,this.chart=t,this.Ym=i,this.ss=new Map,this.onMouseWheel(this.chart.vv),this.onMouseDrag(this.chart.Sv),this.onMouseDragStop(this.chart.xv),this.onTouchStart(this.chart.bv.onTouchStart),this.onTouchMove(this.chart.bv.onTouchMove),this.onTouchEnd(this.chart.bv.onTouchEnd)}Ki(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ()}}setCursorEnabled(t){return this.pv=t,this}getCursorEnabled(){return this.pv}setCursorFormattingOverride(t){return this.Mv=t,this}getCursorFormattingOverride(){return this.Mv}Yp(){return this.getCursorEnabled()}setAutoScrollingEnabled(t){return this.yv=t,this.chart.cs.Ms(),this}getAutoScrollingEnabled(){return this.yv}setColorShadingStyle(t){return this.gv=t,this.ss.forEach(((e,i)=>i._v(t))),this.Ym.Ms(),this}getColorShadingStyle(){return this.gv}setDepthTestEnabled(t){return this.mv=t,this.ss.forEach(((e,i)=>i.wv(t))),this.Ym.Ms(),this}getDepthTestEnabled(){return this.mv}Cv(){}ze(){}Pm(){}getXMax(){const t=this.qa;return t?t.St():void 0}getXMin(){const t=this.qa;return t?t.vt():void 0}getYMax(){const t=this.qa;return t?t.bt():void 0}getYMin(){const t=this.qa;return t?t.xt():void 0}getZMax(){const t=this.qa;return t?t.kv():void 0}getZMin(){const t=this.qa;return t?t.Tv():void 0}Lr(){const t=this.qa;return t?f(t.Pl(),t.Dl(),t.Fv()):f(0,0,0)}}class dl extends cl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Box Series 3D",this.Iv=.25,this.Pv=!1,this.qd=()=>Ae(this.Ie),this.Ie=ve(this.ts.boxSeries3DFillStyle,r),this.qa=this.Ym.Bv().wv(this.mv).Re(this.Ie).Dv(this.Iv).ds(this.getHighlight()),this.As(this.qa)}invalidateData(t){const e=t.length;if(0===e)return this;this.Pv&&this.chart.cs.Jn(Sh.Df);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;iAe(this.Su.getFillStyle())}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;return this.qa.Ye(e),this.Ym.Ms(),this}getStrokeStyle(){return this.Su}add(t){return this.Pv&&this.chart.cs.Jn(Sh.Df),this.Pv=!0,(t=Array.isArray(t)?t:[t])?(this.qa.ml(t.slice()),this.Ym.Ms(),this):this}clear(){return this.qa.Ot(),this}getPointAmount(){const t=this.qa;return t.vl()+t.Sl()}Av(){return this.yv&&this.getPointAmount()>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Ym.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su})}}class gl extends fl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Line Series 3D",this.Su=ve(s.lineSeries3DStrokeStyle,r),this.Rv=Ur.pointStyle3D,this.Ev(this.Su),this.qa=this.Ym.gm([Za.UserSeries]).wv(this.mv).Ye(this.Su).Zm(this.Rv).ds(this.getHighlight()),this.As(this.qa)}setStrokeStyle(t){super.setStrokeStyle(t),this.Ev(this.Su);const e=this.Rv;return this.qa.Zm(e),this}Ev(t){const e=new Fr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Rv=e}}class ml extends fl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Point Line Series 3D",this.qd=()=>Ae(this.Su.getFillStyle())||Ae(this.Rv.getFillStyle()),this.Rv=ve(s.pointLineSeries3DPointStyle,r),this.Su=ve(s.lineSeries3DStrokeStyle,r),this.zv(),this.qa=this.Ym.gm([Za.UserSeries]).wv(this.mv).Ye(this.Su).Zm(this.Rv).ds(this.getHighlight()),this.As(this.qa)}setPointStyle(t){return this.Rv="function"==typeof t?t(this.Rv):t,this.zv(),this.qa.Zm(this.Rv),this.Ym.Ms(),this}getPointStyle(){return this.Rv}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.Su,i=Math.abs(e.getThickness()),s=this.Rv,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.Rv=s.setSize(i)),this.zv();const n=this.Rv;return this.qa.Zm(n),this.Ym.Ms(),this}zv(){const t=this.Rv,e=t.getSize();this.Rv=t.setSize(e)}Oe(t,e){t.ds(e),this.Ym.Ms()}}class yl extends cl{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Pv=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.chart.cs.Jn(Sh.Bf)}add(t){return this.Pv&&this.chart.cs.Jn(Sh.Df),this.Pv=!0,(t=Array.isArray(t)?t:[t])?(this.qa.ml(t.slice()),this.Ym.Ms(),this):this}clear(){return this.qa.Ot(),this}getPointAmount(){const t=this.qa;return t.vl()+t.Sl()}Av(){return this.yv&&this.getPointAmount()>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Ym.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{point3D:this.Vv})}}class pl extends yl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Cs="Point Series 3D",this.qd=()=>Ae(this.Vv.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.chart.getSeries().length;this.Vv=ve(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.qa=this.Ym.Nv(h).wv(this.mv).Ov(this.Vv).ds(this.getHighlight()),this.As(this.qa)}setPointStyle(t){this.Vv="function"==typeof t?t(this.Vv):t;const e=this.Vv;return this.qa.Ov(e),this.Ym.Ms(),this}getPointStyle(){return this.Vv}}class Al extends yl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Cs="Point Cloud Series 3D",this.qd=()=>Ae(this.Vv.getFillStyle());const o=this.chart.getSeries().length;this.Vv=ve(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.qa=this.Ym.Nv(h).Ov(this.Vv).ds(this.getHighlight()),this.As(this.qa)}setPointStyle(t){this.Vv="function"==typeof t?t(this.Vv):t;const e=this.Vv;return this.qa.Ov(e),this.Ym.Ms(),this}getPointStyle(){return this.Vv}}const xl={Triangulated:pl,Pixelated:Al};class Sl extends fa{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Gv=[],this.Uv=0,this.Wv=t=>{const e=this.Gv.indexOf(t);e>=0&&(this.Gv.splice(e,1),this.R.emit("seriesDispose",this,t))},this.onSeriesBackgroundMouseEnter=t=>this.R.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.R.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.R.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.R.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.R.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.R.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.R.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.R.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.R.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.R.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.R.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.R.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.R.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.R.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.R.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.R.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.R.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.R.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.R.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.R.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.R.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.R.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.R.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.R.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.R.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.R.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.R.off(t,"touchEndSeriesBackground"),this.Yv=this.hs.Bg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Gv.forEach((e=>e.setAnimationHighlight(t))),this}Hv(t,e){this.Yv.gs([e]),t.setMouseMoveEventHandler(((t,e)=>{this.R.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.R.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.R.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.R.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.R.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.R.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.$v.Re(t),this.cs.Ms(),this}getSeriesBackgroundFillStyle(){return this.$v.Jh()}setSeriesBackgroundStrokeStyle(t){return this.Xv.Le(t),this.cs.Ms(),this}getSeriesBackgroundStrokeStyle(){return this.Xv.So()}setSeriesBackgroundEffect(t){return this.Yv.bs(t),this.cs.Ms(),this}getSeriesBackgroundEffect(){return this.Yv._s()}jv(t){this.Gv.push(t),void 0!==this.Zv&&t.setHighlightOnHover(this.Zv),this.R.emit("seriesAdded",this,t)}af(){return this.Gv}setSeriesHighlightOnHover(t){return this.Zv=t,this.Gv.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Gv.slice().forEach(Pt),super.dispose()}Wp(t){return this.R.on("seriesAdded",t)}Qv(t){return this.R.off(t)}Jv(t){return this.R.on("seriesDispose",t)}Kv(t){return this.R.off(t)}}const vl=Ue.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class bl{constructor(t,e,i,s){this.qv=!0,this.tS=!0,this.iS=2*-Math.PI/2160,this.sS=2*Math.PI/2160,this.eS=.1,this.hS=1*Math.PI/180,this.rS=t,this.nS=e,this.oS=i,this.hv=s}getDefaultCameraConfiguration(t,e){const i={direction:vl,location:Ue.multiply(vl,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:i.direction,cameraLocation:i.location,projection:e})||i}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.aS(i,t):"wheel-zoom"===t.type?i=this.lS(i,t):"rotate+zoom"===t.type?i=this.uS(i,t):"fixed-rotate"===t.type?i=this.cS(i,t):"move"===t.type&&(i=this.dS(i,t))})),this.qv?i=this.fS(t.boundingBox,i):this.tS&&(i=this.AS(t.boundingBox,t.projection,i)),i}aS(t,e){const{rotation:i}=e,s=t.location,r=Ue.multiply(Ue.normalize(t.location),-1),{Right:n,Up:o}=this.gS(r);let h=s;const a=this.pS(r),l=i.x*this.iS*a;h=Ue.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.sS,a-this.hS);return 0!==u&&(h=Ue.rotateAroundAxis(h,n,u)),{location:h,direction:Ue.multiply(Ue.normalize(h),-1)}}lS(t,e){const{deltaY:i}=e;this.qv&&this.yS(!1);const s=t.location,r=Ue.multiply(Ue.normalize(s),-1),n=i*this.eS,o=Ue.length(s)*-n;return{direction:r,location:Ue.addVec(s,Ue.multiply(r,o))}}uS(t,e){const{rotation:i,cameraDistance:s}=e;this.qv&&this.yS(!1);let r=this.aS(t,{type:"rotate",rotation:i});const n=r.location,o=Ue.multiply(Ue.normalize(n),-1),h=Ue.multiply(o,-s);return r={direction:Ue.multiply(Ue.normalize(h),-1),location:h},r}cS(t,e){this.qv&&this.yS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.gS(r),h=i.x*this.iS;let a=Ue.normalize(Ue.rotateAroundAxis(r,o,h));const l=i.y*this.sS;return a=Ue.normalize(Ue.rotateAroundAxis(a,n,l)),{location:s,direction:a}}dS(t,e){this.qv&&this.yS(!1),this.tS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.gS(n);return{location:Ue.addVec(r,Ue.multiply(n,.01*s),Ue.multiply(o,.01*i)),direction:n}}projectionChanged(t,e){return this.viewportChanged(t)}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ue.multiply(Ue.normalize(t.cameraLocation),-1)};return this.qv?this.fS(t.boundingBox,e):this.AS(t.boundingBox,t.projection,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ue.multiply(Ue.normalize(t.cameraLocation),-1)};return this.qv?this.fS(t.boundingBox,e):this.AS(t.boundingBox,t.projection,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ue.multiply(Ue.normalize(t.cameraLocation),-1)};if(this.qv)return this.fS(t.boundingBox,e)}fS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.mS(t,s,100,20,1,i,5);const r=this.pS(s.direction);return s=this.vS(s,this.SS(t,s,100,1),r),s}mS(t,e,i,s,r,n,o){return Ml(n,o,(t=>({direction:e.direction,location:Ue.multiply(e.direction,-t)})),(e=>this.xS(t,e)),i,r,"linear",s)}SS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.gS(e.direction),a=this.bS(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:Ue.normalize(Ue.lerp(l.direction,h,t))})),(e=>this.MS(t,e)),0,u,!0,i):Cl(0,c,(t=>({location:l.location,direction:Ue.normalize(Ue.lerp(l.direction,o,t))})),(e=>this.MS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ue.normalize(Ue.lerp(l.direction,n,t))})),(e=>this._S(t,e)),0,u,!0,i):Cl(0,c,(t=>({location:l.location,direction:Ue.normalize(Ue.lerp(l.direction,r,t))})),(e=>this._S(t,e)),0,u,!0,i)),l}xS(t,e){const i=this.bS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}_S(t,e){const i=this.bS(t,!1,e);return Math.abs(i.left-i.right)}MS(t,e){const i=this.bS(t,!1,e);return Math.abs(i.top-i.bottom)}bS(t,e,i){const s=ni(this.wS(t,e,i).map((t=>yt(t,this.rS,this.nS))));return{left:s.min.x,right:this.nS.x.getInnerEnd()-s.max.x,top:this.nS.y.getInnerEnd()-s.max.y,bottom:s.min.y}}wS(t,e,i){const s=this.oS,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.hv(t,i))).filter((t=>void 0!==t))}AS(t,e,i){const s=Ue.length(i.location),r=this.CS(t,e);return sr.max?{direction:i.direction,location:Ue.multiply(i.direction,-r.max)}:i}CS(t,e){return{min:("perspective"===e?.8:.5)*Math.sqrt(t.x**2+t.y**2+t.z**2),max:3*Math.sqrt(t.x**2+t.y**2+t.z**2)}}gS(t){const e=f(0,1,0),i=Ue.normalize(Ue.cross(e,Ue.multiply(t,-1)));let s=Ue.cross(i,t);return s.y=Math.abs(s.y),s=Ue.normalize(s),{Right:i,Up:s,Down:Ue.multiply(s,-1),Left:Ue.multiply(i,-1)}}pS(t){const e={x:0,y:1,z:0},i=Ue.angle(t,e),s=Ue.angle(t,Ue.multiply(e,-1));return Math.min(i,s)}vS(t,e,i){return{location:Ue.lerp(t.location,e.location,i),direction:Ue.normalize(Ue.lerp(t.direction,e.direction,i))}}yS(t){return this.qv=t,this}kS(){return this.qv}}const Ml=(t,e,i,s,r,n,o,h)=>{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)Ae(this.Ie),this.gv=oo;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.Ie=ve(this.ts.surfaceGridSeries3DFillStyle,o),this.FS=ve(this.ts.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.io=h,this.qa=this.Ym.PS(h).Re(this.Ie).IS(this.FS)._v(this.gv).ds(this.getHighlight()),this.As(this.qa),this.setHighlightOnHover(!1)}Ki(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(this.Ie)?this.Ie.lut:void 0}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}DS(){const t=this.TS.start||{x:0,z:0};let e;e=this.TS.end?{x:(this.TS.end.x-t.x)/this.io.columns,z:(this.TS.end.z-t.z)/this.io.rows}:this.TS.step?this.TS.step:{x:1,z:1},this.qa.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.qa.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.qa.LS().step}setEnd(t){return this.TS.end=t,this.DS(),this}getEnd(){return this.qa.LS().end}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.qa.Re(this.Ie),this.Ym.Ms(),this}getFillStyle(){return this.Ie}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.qa.IS(this.FS),this.Ym.Ms(),this}getWireframeStyle(){return this.qa.RS()}setIntensityInterpolation(t){return t=t||"disabled",this.qa.ES(t),this.Ym.Ms(),this}getIntensityInterpolation(){return this.qa.zS()}invalidateIntensityValues(t){if(this.Pv&&this.chart.cs.Jn(Sh.Df),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.io.dataOrder?t.length:t[0].length,rows:"rows"===this.io.dataOrder?t.length:t[0].length},i="columns"===this.io.dataOrder?this.io.columns:this.io.rows,s="columns"===this.io.dataOrder?this.io.rows:this.io.columns;if(e.x>i||e.y>s){if(!0===this.chart.CA.eo){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.io.columns}x${this.io.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.`;zt.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.chart.CA.eo){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.io.columns}x${this.io.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.`;zt.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;eAe(this.Ie),this.chart.cs.Jn(Sh.Df),this.gv=oo;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.Ie=ve(this.ts.surfaceScrollingGridSeries3DFillStyle,o),this.FS=ve(this.ts.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.io=h,this.qa=this.Ym.US(h).Re(this.Ie).IS(this.FS)._v(this.gv).ds(this.getHighlight()),this.As(this.qa),this.setHighlightOnHover(!1)}Ki(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(this.Ie)?this.Ie.lut:void 0}}DS(){const t=this.TS.start||{x:0,z:0};let e;e=this.TS.step?this.TS.step:{x:1,z:1},this.qa.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.qa.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.qa.LS().step}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.qa.Re(this.Ie),this.Ym.Ms(),this}getFillStyle(){return this.Ie}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.qa.IS(this.FS),this.Ym.Ms(),this}getWireframeStyle(){return this.qa.RS()}setIntensityInterpolation(t){return t=t||"disabled",this.qa.ES(t),this.Ym.Ms(),this}getIntensityInterpolation(){return this.qa.zS()}clear(){return this.qa.Ot(),this.Ym.Ms(),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.io.scrollDimension?this.io.rows:this.io.columns;if(i>s-1){if(!0===this.chart.CA.eo){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.io.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.chart.CA.eo){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.io.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.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.qa.WS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Ym.Ms(),this}setCullMode(t){return this.qa.NS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.qa.GS()}Cv(){}ze(){}Pm(){}Av(){return this.yv&&this.getVisible()}Oe(t,e){t.ds(e),this.Ym.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}}const El=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Dl),kl=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y&&"z"in t&&"number"==typeof t.z);class Il extends cl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Mesh Model 3D",this.YS=new Float32Array,this.At={x:1,y:1,z:1},this.HS={x:0,y:0,z:0},this.$S={x:0,y:0,z:0},this.XS={x:0,y:0,z:0},this.jS={w:1,x:0,y:0,z:0},this.ZS={x:0,y:0,z:0},this.el=We,this.qd=()=>Ae(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.chart.getSeries().length;this.qa=this.Ym.QS().wv(this.mv).Re(ve(this.ts.meshModel3DFillStyle||this.ts.pointSeriesFillStyle,o)).ds(this.getHighlight()),this.As(this.qa)}Ki(t,e){const i=this.getFillStyle();return Ve({series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(i)?i.lut:void 0},{cursorPosition:0,index:0,x:0,y:0,z:0,value:0},(()=>{const s=this.qa.JS(t,e);if(s)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart._g,axisLocation:s.coordAxis},...s.coordAxis,index:s.index,value:s.value,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:j(i)?i.lut:void 0}}))}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=He,n=Ye,o=He,h=Ye,a=He,l=Ye;for(let t=0;te(t)))}return r.pointMarker.setPosition(s),this.chart.cs.Ms(),this}}class Fl{constructor(t,e){this.by=[],this.My=(t,e)=>(this.by.forEach((i=>i(t,e))),t),this.addStyler=t=>new Fl(this.vy,this.by.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new Fl(t,this.by.map((t=>t))),this._y=(t,e,i,s,r,n)=>this.My(new zl(t,e,i,s,this.vy,r,n),r),this.vy=t,this.by=e}}const Rl=new Fl(Fo,[(t,e)=>{wa(t)}]);class Dl extends Sl{constructor(t,e,i,s,r,n,o){var h;super(t,e,i,e.Bp("chart3D bg",0),s,e.cs.ts.chart3DBackgroundFillStyle,e.cs.ts.chart3DBackgroundStrokeStyle,e.cs.ts.chart3DTitleFont,e.cs.ts.chart3DTitleFillStyle,n),this.yx=1,this.mx=[],this.vx=2,this.Sx=!0,this.xx=!0,this.bx=!0,this.Mx=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.vn=[],this.kn=()=>{const t=this.Ym._x();this.Cx.wx(t),this.kx.wx(t);const e=this.Tx.viewportChanged(this.Fx());e&&this.Ix(e),this.cs.Ms()},this.Px=!1,this.Sv=(t,e,i,s,r)=>{if(this.Px=!0,this.bx){const t=r;this.mx.push({type:"rotate",rotation:t}),this.cs.Ms(),se(e)}},this.xv=(t,e,i,s,r)=>{this.Px=!1},this.vv=(t,e)=>{if(this.xx){if(this.Sx)Math.sign(this.Mx)!==Math.sign(e.deltaY)?this.Mx=be(e):this.Mx+=be(e);else{const t=be(e);this.mx.push({type:"wheel-zoom",deltaY:t})}this.cs.Ms(),se(e)}},this.cs.Jn(Sh._f),this.Ch.Sr("Chart3D"),this.Dx=i.d3(),this.Dx.x.q(-1,1),this.Dx.y.q(-1,1),this.Dx.z.q(-1,1),this.Ym=e.Bx("chart3D layer3D",0,this.Dx),this.Cx=e.Lx("chart3D series bg",0),this.kx=e.tm("chart3D axis ui",1),this.Rx={x:new nl(this,(h=()=>this.Gv,{...al(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Lr().x)),Om:t=>t.x,ov:(t,e)=>({x:t.x,y:e.y,z:e.z}),uf:f(0,-1,0),av: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)}},cv:()=>!0,dv:()=>!1,nv:()=>!1}),this.Dx.x,this.ts,this.Ym,this.kx,this._g,!1,this.hs),y:new nl(this,ll((()=>this.Gv)),this.Dx.y,this.ts,this.Ym,this.kx,this._g,!1,this.hs),z:new nl(this,ul((()=>this.Gv)),this.Dx.z,this.ts,this.Ym,this.kx,this._g,!1,this.hs)},this.Ex=this.Ym.gm([Za.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.ts.chart3DBoundingBoxStrokeStyle),this.$v=this.Cx.fc(this.cs.At,Tn.Simple).Re(this.ts.chart3DSeriesBackgroundFillStyle).Le(ut).setMouseInteractions(!0),this.Xv=this.Cx.fc(this.cs.At,Tn.Simple).Re(_).Le(this.ts.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Hv(this.$v,this.Xv),this.zx({x:1,y:1,z:1},!0),this.Tx=new bl(this.cs.At,this._g,this.Dx,((t,e)=>(e&&this.Ix(e),this.Ym.hv(t)))),this.Vx=this.Tx.getDefaultCameraConfiguration(this.Ox(this.Nx),this.getProjection()),this.Ix(this.Vx);const a=Vt(o?o.cursorBuilder:void 0,Rl),l=e.sm();let c;this.hm=pa(this,l,a._y(l,this._g,this._g,Ot,this.ts,this),this,"show-pointed",Pl,(()=>0)),this.bv=ns(new as(((t,e,i)=>{c={locationOne:e,locationTwo:i,cameraLocation:this.Ym.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.bx&&!this.xx)return;const o=(c.locationOne.x-c.locationTwo.x)**2+(c.locationOne.y-c.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,a=Ue.length(c.cameraLocation),l=o/h*a,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.mx.push({type:"rotate+zoom",rotation:this.bx?d:{x:0,y:0},cameraDistance:this.xx?l:a}),this.cs.Ms(),se(n)}),(t=>{})),new hs((t=>{}),((t,e,i,s,r)=>{if(this.bx){const t=s;this.mx.push({type:"rotate",rotation:t}),this.cs.Ms(),se(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.bv.onTouchStart),this.onBackgroundTouchMove(this.bv.onTouchMove),this.onBackgroundTouchEnd(this.bv.onTouchEnd),this.onSeriesBackgroundTouchStart(this.bv.onTouchStart),this.onSeriesBackgroundTouchMove(this.bv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.bv.onTouchEnd),this.onBackgroundMouseDrag(this.Sv),this.onBackgroundMouseDragStop(this.xv),this.onBackgroundMouseWheel(this.vv),this.onBackgroundMouseDown(((t,e)=>{se(e)})),this.onSeriesBackgroundMouseDrag(this.Sv),this.onSeriesBackgroundMouseDragStop(this.xv),this.onSeriesBackgroundMouseWheel(this.vv),this.onSeriesBackgroundMouseDown(((t,e)=>{se(e)})),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.kn),this.kn(),this.Dp(r,this._g)}setProjection(t){this.Ym.Gx(t);const e=this.Tx.projectionChanged(this.Fx(),t);return e&&this.Ix(e),this.cs.Ms(),this}getProjection(){return this.Ym.Ux()}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Rl){const e=this.xp(),i=t._y(e,this._g,this._g,this.pp(e),this.ts,this);return this.Fp(i),i}addPointSeries(t){const e=new(t&&t.type||pl)(this,this.Wv,this.Ym,this.ts,this.cs.hs,t);return this.jv(e),e}addLineSeries(t){const e=new gl(this,this.Wv,this.Ym,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPointLineSeries(t){const e=new ml(this,this.Wv,this.Ym,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addSurfaceGridSeries(t){const e=new Tl(this,this.Wv,this.Ym,t,this.ts,this.cs.hs);return this.jv(e),e}addSurfaceScrollingGridSeries(t){const e=new wl(this,this.Wv,this.Ym,t,this.ts,this.cs.hs);return this.jv(e),e}addBoxSeries(t){const e=new dl(this,this.Wv,this.Ym,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addMeshModel(t){const e=new Il(this,this.Wv,this.Ym,this.ts,t,this.cs.hs);return this.jv(e),e}translateCoordinate(t,e,i){if(El(e)||El(i)||kl(t)){if(El(e)&&El(i)&&kl(t)){if("axes"===e.id&&"world"===i.id)return this.Ym.Wx(t);if("world"===e.id&&"axes"===i.id)return this.Ym.Yx(t);if(e.id===i.id)return t}if(El(e)&&Wi(i)&&kl(t)){const e=this.Ym.hv(t);return e?this.cs.Wo({engineX:e.x,engineY:e.y}):{clientX:-1,clientY:-1}}if(El(e)&&$i(i)&&kl(t)){const e=this.Ym.hv(t);return e?yt(e,this.cs.At,this._g):{clientX:-1,clientY:-1}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return aa(t,e,i,this._g,this.cs)}getDefaultAxisX(){return this.Rx.x}getDefaultAxisY(){return this.Rx.y}getDefaultAxisZ(){return this.Rx.z}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}get axisZ(){return this.getDefaultAxisZ()}get zAxis(){return this.getDefaultAxisZ()}getDefaultAxes(){return[this.Rx.x,this.Rx.y,this.Rx.z]}setCameraLocation(t){let e={location:t,direction:Ue.normalize(Ue.multiply(t,-1))};const i=this.Tx.cameraLocationChanged(this.Fx(e));return i&&(e=i),this.Ix(e),this.cs.Ms(),this}getCameraLocation(){return this.Ym.getCameraLocation()}getCameraDirection(){return this.Ym.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.Tx.yS(t);const e=this.Tx.cameraLocationChanged(this.Fx());return e&&this.Ix(e),this}getCameraAutomaticFittingEnabled(){return this.Tx.kS()}onCameraChange(t){return this.R.on("cameraChange",t)}offCameraChange(t){return this.R.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.Ex.Ye(t).Zm(tl(this.Ex.xu())),this.Ym.Ms(),this}getBoundingBoxStrokeStyle(){return this.Ex.xu()}setBoundingBox(t){return this.zx(t,!1),this}zx(t,e){this.Nx=t;const i=this.Ox(t);if(this.Dx.x.it(i.x),this.Dx.y.it(i.y),this.Dx.z.it(-i.z),!e){const t=this.Tx.boundingBoxChanged(this.Fx());t&&this.Ix(t)}this.cs.Ms()}getBoundingBox(){return this.Nx}ze(t){if(ga.Gp(this.Ch,this.Lp),0!==this.Mx){const e=this.Mx*t*.006;this.mx.push({type:"wheel-zoom",deltaY:e}),this.Mx=Math.sign(this.Mx)*Math.max(Math.abs(this.Mx)-.01*t,0),0!==this.Mx&&this.cs.Ms(!0)}const e=this.getCameraDirection();if(this.mx.length>0){const t=this.Tx.applyCameraInteractions(this.Fx(),this.mx);t&&this.Ix(t),this.mx.length=0}this.Hx&&Ue.equals(this.Hx.location,this.Vx.location)&&Ue.equals(this.Hx.direction,this.Vx.direction)||this.R.emit("cameraChange",this,this.getCameraLocation()),this.Hx=this.Vx,super.ze(t);for(let t=0;tthis.Ym.hv(t))),o=this.Ym.hv(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=de(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.vn.length=0,this.Dx.Y(),this.Ym.Y(),this.kx.Y(),this.Cx.Y(),this.hm.Y(),super.dispose()}J(){return this.Dx.x.J(),this.Dx.y.J(),this.Dx.z.J(),super.J()}K(){return super.K()}Ix(t){this.Ym.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ue.addVec(t.location,Ue.multiply(t.direction,-this.vx))),this.Vx=t,this.cs.Ms()}Ox(t){return Ue.divide(t,Ue.length(t)/this.yx)}Fx(t=this.Vx){return{boundingBox:this.Ox(this.Nx),cameraLocation:t.location,cameraDirection:t.direction,projection:this.getProjection()}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.xx=t,this}getMouseInteractionZoom(){return this.xx}setMouseInteractionRotate(t){return this.bx=t,this}getMouseInteractionRotate(){return this.bx}forEachAxis(t){return t(this.Rx.x),t(this.Rx.y),t(this.Rx.z),this}getSeries(){return this.Gv}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.Sx=!!t,this}getAnimationZoom(){return this.Sx}}const Pl=(t,e,i)=>{var s,r;return xt(e)?ya(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Ki(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Ki(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:Ki(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:Ki(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):vt(e)?ya(e,[[e.series],void 0!==e.value?["Value","",{text:Ki(e.value.toFixed(2),null===(r=e.lut)||void 0===r?void 0:r.units),font:{weight:"bold"}}]:[]]):ya(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Ki(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Ki(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:Ki(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}]])},Ol={Column:Ho,Row:Xo};class Ll extends ca{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.$x=new Map,this.Xx=this.addUIElement(Ol.Row).setPosition({x:0,y:100}).setOrigin(Vs.LeftTop).setBackground((t=>t.setFillStyle(_).setStrokeStyle(ut)))}add(t,e){return(t instanceof fa?[t]:t instanceof gg?t.getCells().filter((t=>t.panel instanceof fa)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Xx.addElement(xh.VerticalLegendBox).setBackground((t=>t.setFillStyle(_).setStrokeStyle(ut))).add(t,e).setTitle(t.getTitle());this.$x.set(t,i)})),this.cs.Ms(),this}setLegendBoxes(t){return this.$x.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Xx.getSize()}}const _l={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Bl=(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(),Vl=(t,e)=>{let i=e.geometry;return i=Gl(t,e,i),i=Nl(t,e,i),i},Gl=(t,e,i)=>{if(t===_l.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===_l.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=ni(Bt(i)),h=[];for(let e=0;ethis.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.R.on("mapDataReady",t);return this.tb&&zt.setTimeout((()=>t())),e},this.onViewChange=t=>this.R.on("viewChange",t),this.ib=(t,e,i,s,r)=>{this.At.x.it(s).si([this.Xt.left+this.Ia.left,this.Xt.right+this.Ia.right]),this.At.y.it(r).si([this.Xt.bottom+this.Ia.bottom,this.Xt.top+this.Ia.top+ga.Np(this.Ch,this.Lp)]),this.sb&&this.eb(this.hb,this.At,this.sb)},this._t=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.nb(s),se(t)),this.Kx&&this.cs.us.ks(r,!0),this.ob=r,this.R.emit("mouseEnter",this,t,s))},this.wt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;this.ab(),r&&(this.Kx&&this.cs.us.ks(r,!1),this.ob=void 0,this.R.emit("mouseLeave",this,t,s),t&&se(t))},this.It=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.nb(s),se(t)),this.ob=r,this.R.emit("mouseMove",this,t,s))},this.Ct=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseClick",this,t,s)},this.kt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseDoubleClick",this,t,s)},this.Tt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseDown",this,t,s)},this.Ft=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseUp",this,t,s)},this.Dt=(t,e,i)=>{const s=i;if(!s||!this.tb)return;const r=this.rb(this.tb,s);this.R.emit("mouseDragStart",this,t,e,r)},this.Pt=(t,e,i,s,r)=>{const n=r;if(!n||!this.tb)return;const o=this.rb(this.tb,n);this.R.emit("mouseDrag",this,t,e,i,s,o)},this.Bt=(t,e,i,s)=>{const r=s;if(!r||!this.tb)return;const n=this.rb(this.tb,r);this.R.emit("mouseDragStop",this,t,e,i,n)},this.Lt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i);this.R.emit("mouseWheel",this,t,s)},this.Rt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.nb(s),this.Kx&&this.cs.us.ks(r,!0),this.ob=r,this.R.emit("touchStart",this,t,s),se(t))},this.Et=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;r&&(this.nb(s),this.ob=r,this.R.emit("touchMove",this,t,s),se(t))},this.zt=(t,e)=>{const i=e;if(!i||!this.tb)return;const s=this.rb(this.tb,i),r=null==s?void 0:s.region;this.ab(),r&&(this.Kx&&this.cs.us.ks(r,!1),this.ob=void 0,this.R.emit("touchEnd",this,t,s),se(t))},this.cs.Jn(Sh.Cf),this.ph=!1!==(null==n?void 0:n.animationsEnabled),this.lb=e.tm("mapChart plotting",0),this.onResize(this.ib),this.Ch.Sr("Map Chart");const h=e.sm(),a=Vt(n?n.cursorBuilder:void 0,Oa);this.hm=pa(this,h,a._y(h,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",Wl,(()=>0)),this.ub=this.hs.Bg(),this.Dp(r,this.uiScale),this.cb=this.lb.Km(this.At).setMouseInteractions(this.$i).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).Re(this.ts.mapChartFillStyle).Le(this.ts.mapChartStrokeStyle),this.fb=this.lb.Km(this.At).setMouseInteractions(this.$i).Re(this.ts.mapChartOutlierRegionFillStyle).Le(this.ts.mapChartOutlierRegionStrokeStyle);const l=Vt(n&&n.type,_l.World);this.hb=l,this.Ab(l).then((()=>{this.R.emit("mapDataReady")}))}getRegionUnderMouse(){return this.ob}setFillStyle(t){return this.cb.Re(t),this.cs.Ms(),this}getFillStyle(){return this.cb.Jh()}setStrokeStyle(t){return this.cb.Le(t),this.cs.Ms(),this}getStrokeStyle(){return this.cb.So()}setEffect(t){return this.ub.bs(t),this.cs.Ms(),this}getEffect(){return this.ub._s()}setOutlierRegionFillStyle(t){return this.fb.Re(t),this.cs.Ms(),this}getOutlierRegionFillStyle(){return this.fb.Jh()}setOutlierRegionStrokeStyle(t){return this.fb.Le(t),this.cs.Ms(),this}getOutlierRegionStrokeStyle(){return this.fb.So()}setSeparateRegionFillStyle(t){return this.Zx="function"==typeof t?t(this.Zx):t,this.jx.forEach((t=>t.Re(this.Zx))),this.cs.Ms(),this}getSeparateRegionFillStyle(){return this.Zx}setSeparateRegionStrokeStyle(t){return this.Qx="function"==typeof t?t(this.Qx):t,this.jx.forEach((t=>t.Le(this.Qx))),this.cs.Ms(),this}getSeparateRegionStrokeStyle(){return this.Qx}invalidateRegionValues(t){if(!this.tb||!this.gb)return this.pb=this.pb||[],this.pb.push(t),this;if("function"==typeof t)for(let e=0;e{t.yb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.yb(e.value)}))}}return this.cs.Ms(),this}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}setMouseInteractions(t){return this.$i=t,this.cb.setMouseInteractions(t),this}getMouseInteractions(){return this.$i}setHighlight(t){var e;return t=ke(t),this.Jx=t,null===(e=this.tb)||void 0===e||e.regions.forEach((e=>{this.cs.us.ks(e,t)})),this.R.emit("highlight",this,t),this}getHighlight(){return this.Jx}setAnimationHighlight(t){var e;return null===(e=this.tb)||void 0===e||e.regions.forEach((e=>{this.cs.us.Ts(e,t)})),this}getAnimationHighlight(){var t;return this.cs.us.Fs(null===(t=this.tb)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Kx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Kx}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}offMapDataReady(t){return this.R.off(t,"mapDataReady")}offViewChange(t){return this.R.off(t,"viewChange")}async Ab(t){const e=await((t,e)=>{let i;if(t===_l.World)i="countries_world.json";else if(t===_l.NorthAmerica)i="countries_northAmerica.json";else if(t===_l.SouthAmerica)i="countries_southAmerica.json";else if(t===_l.Africa)i="countries_africa.json";else if(t===_l.Europe)i="countries_europe.json";else if(t===_l.Asia)i="countries_asia.json";else if(t===_l.USA)i="states_usa.json";else if(t===_l.Canada)i="territoriesProvinces_canada.json";else{if(t!==_l.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw zt.alert(e),new Error(e)}i="territories_australia.json"}return new Promise(((t,s)=>{(t=>{if(t.resourcesBaseUrl){const e=`${t.resourcesBaseUrl}${t.fileName}`;return void zt.fetch(e).then((e=>{t.success(e)})).catch((()=>{t.error({url:e})}))}const e=`${zt.location.origin}/resources${t.fileName}`;zt.fetch(e).then((e=>{if(!e.ok)throw new Error;t.success(e)})).catch((()=>{const i=`https://lcjs-resources.lightningchart.com/v1${t.fileName}`;zt.fetch(i).then((e=>{zt.console.warn("LightningChart JS warning | fallbacking publicly hosted asset resources.\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/warning-using-publicly-hosted-resources/"),t.success(e)})).catch((()=>{t.error({url:e})}))}))})({fileName:`/maps/${i}`,resourcesBaseUrl:e,success:e=>e.json().then(t),error:({url:t})=>De(e,t,"Map Chart",{shouldCrash:!0})})}))})(t,this.CA.te);this.gb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Ul[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.fb.Zr().Fl(e);if(t===_l.USA){const t=25.8,e=29.7;this.jx.push(this.lb.Ee(this.At).setMouseInteractions(!1).Re(this.Zx).Le(this.Qx).Ve({x:-126,y:t}).it({x:10,y:e-t}),this.lb.Ee(this.At).setMouseInteractions(!1).Re(this.Zx).Le(this.Qx).Ve({x:-113,y:t}).it({x:7,y:e-t}))}const s=this.cs.us.jr(this.cb,{animationEnabled:this.ph});for(let i=0;i{o.forEach((e=>e.ds(t)))}))}if(this.ub.gs([this.cb]),this.sb=i,this.eb(t,this.At,i),this.tb=e,this.pb){for(const t of this.pb)this.invalidateRegionValues(t);this.pb=void 0}this.cs.Ms()}eb(t,e,i){const s=Yl[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.q(o.min.x,o.max.x),e.y.q(o.min.y,o.max.y);const h=this.At.x.li(),a=this.At.y.li();this.R.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]}})}nb(t){this.mb=t,this.cs.Ms()}ab(){this.mb=void 0,this.cs.Ms()}rb(t,e){const i=Array.from(this.qx.entries()).findIndex((([t,i])=>i.includes(e))),s=null==t?void 0:t.regions[i],r=this.cs.Zn();if(!r)return;const n=this.cs.Uo(r),o=this.gb&&this.gb[i];let h=yt({x:n.engineX,y:n.engineY},this.cs.At,this.At);h={x:_t(h.x,this.At.x.getInnerStart(),this.At.x.getInnerEnd()),y:_t(h.y,this.At.y.getInnerStart(),this.At.y.getInnerEnd())};let a=h.x,l=h.y;const u=s.transform;s.outlier&&u&&(a=(a-u.translate.x-u.vertexBoundaries.min.x)/u.scale.x+u.vertexBoundaries.min.x,l=(l-u.translate.y-u.vertexBoundaries.min.y)/u.scale.y+u.vertexBoundaries.min.y);const c=this.getFillStyle();return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},region:s,value:o,longitude:l,latitude:a,lut:j(c)?c.lut:void 0}}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Oa){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}setAnimationsEnabled(t){return this.ph=!t,this}getAnimationsEnabled(){return this.ph}getMinimumSize(){}af(){return[this]}ze(t){super.ze(t),super.Pp(),ga.Gp(this.Ch,this.Lp);const e=y(this.At.x.ei(),this.At.y.ei(),this.At.x.ri(),this.At.y.ri());return this.lb.wx(e),this.hm.ze(!1,[],void 0,{explicitTarget:this.mb}),this}dispose(){return this.lb.Y(),this.hm.Y(),ua(this.At),super.dispose()}J(){return super.J(),this.At.J(),this}K(){return super.K(),this.At.K(),this}qd(){return Ae(this.getFillStyle())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),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))),this.styleLegendEntry(t,i),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.getFillStyle()})}}const Xl=(t,e)=>{const i=t>0,s=e>0;return`${[Se(Math.abs(0|t),2),"° ",Se(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[Se(Math.abs(0|e),2),"° ",Se(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`},Wl=(t,e,i)=>{var s;const r=[[e.region.name],[Xl(e.longitude,e.latitude)]];return void 0!==e.value&&r.push({text:Ki(e.value.toFixed(1),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}),r};class jl extends gr{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.vb(i),s,r,{numeric:e.Sb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Sb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Sb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.xb=n,this.bb=o,this.Mb=h,this.hs=a,this._b=i,this.wb=e.Sb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Fh=h.Wr(i).setMouseInteractions(!1).ir(e.Sb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Re(e.Sb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.hr=this.hs.Bg([this.Fh]).bs(s.effectsText)}setTickStrategy(t,e){return super.Hh(t,e)}setStrokeStyle(t){return this.wb="function"==typeof t?t(this.wb):t,this.bb.Ms(),this}getStrokeStyle(){return this.wb}Mr(t,e){return new $l(e,t,this._b,this.Mb,this.Cb(this.xb,this._b),this.Mb.He(this._b).setMouseInteractions(!1))}_r(t,e){const i=this.kb(this._b,t);this.Tb&&!1===this.Tb(t)?t.rh.setVisible(!1):t.rh.setVisible(!0).Ve(yi(this.Fb(this._b,t.M),i.padding)).Za(i.alignment).sr(i.rotation).Wa(i.offset.x,i.offset.y),this.Ib(this._b,t.Pb,t.Db,t)}setMouseInteractions(t){return this}ze(){this.dr({physicalAxisSize:0});const t=this.kr(((t,e)=>{const i=e.Eh.je,s=.5*this.wb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.rh.Os().od().y);return Math.max(t,s)}),0);return this.Bb(this._b,this.wb,t),this.Lb(this._b,this.Fh,t),t}}class $l extends mr{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.Pb=r,this.Db=n,r.setMouseInteractions(!1),this.ss.push(r,n)}}class Zl extends jl{constructor(t,e,i,s,r,n,o,h,a){super(t,ql((()=>this.Ng())),e,i,s,r,n,o,h),this.jm=this.bb.He(this._b).setMouseInteractions(!1),this.Rb=a,this.setScrollStrategy(Ks.expansion),this.setTickStrategy(Js.Numeric),this.setTitle("Amplitude")}Ng(){return this.Rb()}Er(t,e){return Qi(t,e,this._b.y)}Vr(t,e,i){const s=2*(e-t),r=this._b.x.Li(s);return{min:t-i*r,max:e+i*r}}Fb(t,e){return{x:t.Eb()?e-t.zb().start:t.zb().start-e,y:0}}Cb(t,e){return t.ud(e)}Ib(t,e,i,s){const r=s.Eh.je,n=t.Eb()?s.M-t.zb().start:t.zb().start-s.M;Lt(s.M,t.zb().start)||Lt(s.M,t.zb().end)?e.setVisible(!1):e.setVisible(!0).Au(0).$e(360).vu(void 0).mu(0).gu(n).vu(60).Re(_).Le(r.gridStrokeStyle);const o=.5*this.wb.getThickness();i.Xe({x:n,y:-o*t.Ui().y}).$e({x:n,y:-(o+r.tickLength)*t.Ui().y}).Ye(r.tickStyle)}kb(t,e){const i=e.Eh.je;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ui().y*-(.5*this.wb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Bb(t,e,i){const s=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;this.jm.Xe({x:0,y:0}).$e({x:s,y:0}).Ye(e)}Lb(t,e,i){const s=t.Eb()?(t.zb().start+t.zb().end)/2-t.zb().start:t.zb().start-(t.zb().start+t.zb().end)/2;e.Za({x:0,y:1}).Ve({x:s,y:-i*t.Ui().y})}}const ql=t=>({...al(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),vb:t=>({getInnerStart:()=>t.zb().start,getInnerEnd:()=>t.zb().end,q:(e,i)=>t.Vb(e,i),ut:(e,i,s,r,n)=>t.y.ut(e,i,s,r,n)}),Sb:t=>t.amplitude});class Kl extends jl{constructor(t,e,i,s,r,n,o,h){super(t,Ql,e,i,s,r,n,o,h),this.Ob=90,this.Nb=12,this.Gb=Jl,this.jm=this.bb.ud(this._b).setMouseInteractions(!1),this.Tb=t=>{let e=180*(t.M-this._b.Ub())/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.fh=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Ob)}setTickStyle(t){return this.Wb="function"==typeof t?t(this.Wb):t,this.Yb(),this.bb.Ms(),this}getTickStyle(){return this.Wb}setTickFormattingFunction(t){return this.Gb=t,this.Yb(),this.bb.Ms(),this}getTickFormattingFunction(){return this.Gb}setClockwise(t){this._b.Hb(t);const e=this.Ob*Math.PI/180;return t?this._b.$b(e+Math.PI/2):this._b.$b(e-Math.PI/2),this.bb.Ms(),this}getClockwise(){return!this._b.Xb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Ob=t;const e=t*Math.PI/180;return this.getClockwise()?this._b.$b(e+Math.PI/2):this._b.$b(e-Math.PI/2),this.bb.Ms(),this}getNorth(){return 180*this._b.Ub()/Math.PI}setDivision(t){return this.Nb=t,this.Yb(),this.bb.Ms(),this}getDivision(){return this.Nb}Ng(){return[]}Er(t,e){return e}Vr(t,e,i){return{min:t,max:e}}Fb(t,e){const i=t.Xb()?1:-1,s=t.Ub(),r=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}Cb(t,e){return t.He(e)}Ib(t,e,i,s){const r=this.Wb,n=t.Xb()?1:-1,o=t.Ub(),h=(s.M-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end,c={x:a*u,y:l*u};e.Xe({x:0,y:0}).$e(c);const d={x:c.x+a*r.tickLength*t.Ui().x,y:c.y+l*r.tickLength*t.Ui().y};i.Xe(c).$e(d),e.Ye(r.gridStrokeStyle),i.Ye(r.tickStyle)}kb(t,e){const i=this.Wb,s=t.Xb()?1:-1,r=t.Ub();let n,o=(e.M-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.Ui().x,l=Math.sin(o)*h*t.Ui().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Bb(t,e,i){const s=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;this.jm.Au(0).$e(360).mu(0).gu(s+.5*e.getThickness()*t.Ui().x).vu(360).Re(_).Le(e)}Lb(t,e,i){const s=t.Ub(),r=this.kb(t,{M:0+s}),n=t.Eb()?t.zb().end-t.zb().start:t.zb().start-t.zb().end;e.Za(r.alignment).sr(r.rotation).Wa(r.offset.x,r.offset.y).Ve(yi({x:n,y:0},r.padding))}Yb(){this.ar({qe:[],th:[{rh:"Radial ticks",Jg:0,je:this.Wb,Ze:this.Gb,Hr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Nb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},zh:{wr:()=>{},Vh:()=>!1},$r:void 0}],ih:Jl,sh:void 0,eh:void 0})}}const Jl=(t,e,i)=>(180*t/Math.PI).toFixed(0),Ql={Pr:()=>{},Dr:()=>{},Lr:()=>{},vb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,q:(t,e)=>{},ut:(e,i,s,r,n)=>t.x.ut(e,i,s,r,n)}),Sb:t=>t.radial},tu=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),eu=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class iu extends is{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Cs="Sector",this.jb=0,this.Zb=1*Math.PI/2,this.Qb=void 0,this.Jb=void 0,this.Rs=t,this._b=s,this.zy=this.Rs.ud(this._b).ds(this.getHighlight()),this.As(this.zy),this.Ie=r.polarSectorFillStyle,this.Pe=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.jb=_t(t,0,360),this.Rs.Ms(),this}getAngleStart(){return this.jb}setAngleEnd(t){return this.Zb=_t(t,0,360),this.Rs.Ms(),this}getAngleEnd(){return this.Zb}setAmplitudeStart(t){return this.Qb=t,this.Rs.Ms(),this}getAmplitudeStart(){return this.Qb}setAmplitudeEnd(t){return this.Jb=t,this.Rs.Ms(),this}getAmplitudeEnd(){return this.Jb}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.Rs.Ms(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}ze(){const t=this._b.zb(),e=180*this._b.Ub()/Math.PI,i=void 0!==this.Qb?_t(this.Qb,t.start,t.end):t.start,s=void 0!==this.Jb?_t(this.Jb,t.start,t.end):t.end,r=this._b.Eb()?i-t.start:t.start-i,n=this._b.Eb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this._b.Xb()?1:-1,l=Math.abs(this.Zb-this.jb);this.zy.Au((this.jb-e)*a).$e((this.Zb-e)*a).mu(100*o/h).gu(h).Re(this.Ie).Le(this.Pe).vu(Math.ceil(l/2))}Oe(t,e){t.ds(e),this.Rs.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}}class su extends is{constructor(){super(...arguments),this.yv=!0,this.pv=!0}setAutoScrollingEnabled(t){return this.yv=t,this.chart.cs.Ms(),this}getAutoScrollingEnabled(){return this.yv}Cv(){}ze(){}Pm(){}setCursorEnabled(t){return this.pv=t,this}getCursorEnabled(){return this.pv}Yp(){return this.getVisible()&&this.getCursorEnabled()}setCursorFormattingOverride(t){return this.Mv=t,this}getCursorFormattingOverride(){return this.Mv}}class ru extends su{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Rs=t,this.chart=e,this.scale=s}getAmplitudeMin(){return this.Kb?this.Kb.min:void 0}getAmplitudeMax(){return this.Kb?this.Kb.max:void 0}}const nu=(t,e)=>{const i=[],s=e.zb().start,r=e.zb().end,n=e.Eb(),o=e.Xb()?1:-1,h=e.Ub(),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=_t(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},ou=t=>{const e={min:Ye,max:He};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},hu=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),au=(t,e)=>{let i=Ti(t);for(e.Xb()||(i*=-1),i+=180*e.Ub()/Math.PI;i<0;)i+=360;i%=360;const s=gi(t),r=e.zb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Jn(r.start,r.end,s/n)}};class lu extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.Cs="Heatmap Series",this.qb=!0,this.Pv=!1,this.qd=()=>Ae(this.Ie);const h=this.chart.getSeries().length;this.Ie=ve(this.ts.polarHeatmapSeriesFillStyle||this.ts.heatmapGridSeriesFillStyle,h);const a=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-a)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:a,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.io=u,this.tM=t.iM(s,[],u).Re(this.Ie).ds(this.getHighlight()),this.As(this.tM);const c=Math.min(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep),d=Math.max(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep);this.Kb={min:c,max:d},this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=yt(s,this.chart.cs.At,this.scale),n=au(r,this.scale),o=ma(e)?this.tM.sM(n):this.tM.hd(n);if(!o)return;const h=nu([o],this.scale)[0];return{cursorPosition:{pointMarker:h,pointMarkerScale:this.scale,resultTable:h,resultTableScale:this.scale},series:this,angle:o.angle,amplitude:o.amplitude,intensity:o.cellValue,annulus:o.iAnnulus,sector:o.iSector,lut:j(this.Ie)?this.Ie.lut:void 0}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0,intensity:0,sector:0,annulus:0,lut:j(this.Ie)?this.Ie.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}invalidateIntensityValues(t){if(this.Pv&&this.chart.cs.Jn(Sh.Df),Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,sectors:"annuli"===this.io.dataOrder?t[0].length:t.length,annuli:"annuli"===this.io.dataOrder?t.length:t[0].length},i="annuli"===this.io.dataOrder?this.io.annuli:this.io.sectors,s="annuli"===this.io.dataOrder?this.io.sectors:this.io.annuli;if(e.x>i||e.y>s){if(!0===this.chart.CA.eo){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nHeatmap ${i}x${s}, input ${e.x}x${e.y}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${h}, input ${e.primary}x${e.secondary} starting at [${i},${r}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const a=Math.max(s-o,0),l=e.primary-a,u=Math.max(n-h,0),c=[];for(let e=0;e0?-u:void 0);if(0===(t={iSector:t.iSector,iAnnulus:t.iAnnulus,values:c}).values.length||0===t.values[0].length)return this}this.tM.VS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Rs.Ms(),this.Pv=!0,this}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.tM.Re(this.Ie),this.Rs.Ms(),this}getFillStyle(){return this.Ie}clear(){return this.tM.Ot(),this.Rs.Ms(),this}setIntensityInterpolation(t){return t=t||"disabled",this.tM.ES(t),this.Rs.Ms(),this}getIntensityInterpolation(){return this.tM.zS()}Av(){return this.yv&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}}class uu extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Line Series",this.eM=[],this.hM=!1,this.rM=!1,this.Su=ve(this.ts.polarLineSeriesStrokeStyle,n),this.nM=t.gm(s,void 0,[Za.UserSeries]).Ye(this.Su).ds(this.getHighlight()),this.As(this.nM)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=this.nM.oM(s);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,"show-nearest")))}setData(t){return 0!==this.eM.length&&this.chart.cs.Jn(Sh.Df),this.eM=hu(t),this.hM=!0,this.Kb=ou(this.eM),this.Rs.Ms(),this}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;return this.nM.Ye(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Su}setConnectDataAutomaticallyEnabled(t){return this.rM=t,this.Rs.Ms(),this}getConnectDataAutomaticallyEnabled(){return this.rM}Av(){return this.yv&&this.eM.length>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){if(this.hM||this.scale.aM()){const t=nu(this.eM,this.scale),e=ni(t);this.rM?(t.push({...t[0]}),this.nM.jl(!0)):this.nM.jl(!1),this.nM.Ot().ml(t).sa(e),this.hM=!1,this.nM.Os()}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su})}}class cu extends ru{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Cs="Point Line Series",this.eM=[],this.hM=!1,this.rM=!1,this.lM=3,this.ka=0,this.uM=e.PointShape.Circle,this.Ie=ve(this.ts.polarPointLineSeriesFillStyle,o),this.Su=ve(this.ts.polarPointLineSeriesStrokeStyle,o),this.nM=t.gm(r,void 0,[Za.UserSeries]).Ye(this.Su).ds(this.getHighlight()),this.As(this.nM),this.cM=t.Nv(r).Re(this.Ie).dl(this.uM).it(this.lM).ds(this.getHighlight()),this.As(this.cM)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=this.nM.oM(s);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.eM.length&&this.chart.cs.Jn(Sh.Df),this.eM=hu(t),this.hM=!0,this.Kb=ou(this.eM),this.Rs.Ms(),this}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;return this.nM.Ye(e),this.Rs.Ms(),this}getStrokeStyle(){return this.Su}setPointFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;return this.cM.Re(e),this.Rs.Ms(),this}getPointFillStyle(){return this.Ie}setPointSize(t){return this.lM=t,this.cM.it(t),this.Rs.Ms(),this}getPointSize(){return this.lM}setPointShape(t){return this.uM=t,this.cM.dl(this.uM),this}getPointShape(){return this.uM}setPointRotation(t){return this.ka=t,this.cM.sr(t),this.Rs.Ms(),this}getPointRotation(){return this.ka}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Su})}setConnectDataAutomaticallyEnabled(t){return this.rM=t,this.Rs.Ms(),this}getConnectDataAutomaticallyEnabled(){return this.rM}Av(){return this.yv&&this.eM.length>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){if(this.hM||this.scale.aM()){const t=nu(this.eM,this.scale),e=ni(t);this.rM?(t.push({...t[0]}),this.nM.jl(!0)):this.nM.jl(!1),this.nM.Ot().ml(t).sa(e),this.cM.Ot().ml(t).sa(e),this.hM=!1,this.nM.Os(),this.cM.Os()}}Bs(){return this.ws||this.uM}}class du extends Fn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Jo=_e(),this.R=new r.Eventer,this.ji=!1,this.dM=s,this.fM=n,this.AM=o,this.gM=h,this.pM=a,this.Rs=t,this.scale=e,this.yM=i,this.ts=l}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}dispose(){return this.yM&&this.yM(this),this.Rs.cs.Ms(),this.R.emit("dispose",this),this.ji=!0,this}setVisible(t){return super.setVisible(t),this.AM(),this.Rs.cs.Ms(),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMouseInteractions(t){return this.gM(this,t),this}getMouseInteractions(){return this.pM(this)}}class fu extends du{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,y,p){super(t,e,i,s,r,n,o,h,p),this.mM=1,this.vM=1,this.Rs=t,this.scale=e,this.dimensionStrategy=a,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=y,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,y)),this.SM=this.ts.boxSeriesBodyFillStyle,this.xM=this.ts.boxSeriesBodyStrokeStyle,this.Su=this.ts.boxSeriesStrokeStyle,this.bM=this.ts.boxSeriesMedianStrokeStyle,this.Os()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.mM=t,this.Os(),this}getBodyWidth(){return this.mM}setBodyFillStyle(t){return this.SM="function"==typeof t?t(this.SM):t,this.fM(),this}getBodyFillStyle(){return this.SM}setBodyStrokeStyle(t){return this.xM="function"==typeof t?t(this.xM):t,this.fM(),this}getBodyStrokeStyle(){return this.xM}setTailWidth(t){return this.vM=t,this.Os(),this}getTailWidth(){return this.vM}setStrokeStyle(t){return this.Su="function"==typeof t?t(this.Su):t,this.fM(),this}getStrokeStyle(){return this.Su}setMedianStrokeStyle(t){return this.bM="function"==typeof t?t(this.bM):t,this.fM(),this}getMedianStrokeStyle(){return this.bM}Os(){this.dM()}getDominantStyle(){return this.getBodyFillStyle()}}class gu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Ls=!0,this.ss=new Map,this.chart=t,this.Rs=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.MM=h,this.scale=Xi(s.At,r.At),this._M=t.wM,t.wM+=1,this.CM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.kM),this.onMouseLeave(this.chart.TM),this.onMouseWheel(this.chart.vv),this.onMouseDragStart(this.chart.FM),this.onMouseDrag(this.chart.Sv),this.onMouseDragStop(this.chart.xv),this.onTouchStart(this.chart.bv.onTouchStart),this.onTouchMove(this.chart.bv.onTouchMove),this.onTouchEnd(this.chart.bv.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}la(){const t=Array.from(this.ss.keys());for(const e of t){const t=e.la();if(t)return t}}setClipping(t){return this.Ls=t,this.Rs.Ms(),this}getClipping(){return this.Ls}attacheAxis(){this.IM=this.axisXAttachHandler(this),this.PM=this.axisYAttachHandler(this)}As(t,e){super.As(t,e),t.ua(this._M)}getName(){const t=this.fs(),e="ProgressiveY"===t||"RegressiveY"===t?this.axisX.getTitle():this.axisY.getTitle();return this.Cs||e.length>0&&e||"Series"}setDrawOrder(t){return this._M=t.seriesDrawOrderIndex,this.ss.forEach(((t,e)=>{e.ua(this._M)})),this.chart.cs.Ms(),this}dispose(){return super.dispose(),this.IM(this),this.PM(this),this}Pm(){super.Pm(),qi(this.Ls,Array.from(this.ss.keys()),this.scale)}getBoundaries(){return m(u(this.getXMin()||0,this.getYMin()||0),u(this.getXMax()||0,this.getYMax()||0))}setCursorEnabled(t){return super.setCursorEnabled(t)}}const mu=(t,e,i,s)=>{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 e=this.DM.findIndex((e=>e===t));e>=0&&this.DM.splice(e,1),this.LM=!0,this.BM=void 0,this.Rs.Ms()},this.dM=()=>{this.BM=void 0,this.LM=!0,this.chart.cs.Ms()},this.fM=()=>{this.LM=!0,this.chart.cs.Ms()},this.AM=()=>{this.BM=void 0,this.LM=!0,this.chart.cs.Ms()},this.gM=(t,e)=>{this.setMouseInteractions(e)},this.RM=t=>this.getMouseInteractions()}ze(){super.ze(),this.LM&&(this.EM(this.DM),this.LM=!1)}clear(){return this.DM.slice().forEach(Pt),this.DM.length=0,this.LM=!0,this.BM=void 0,this.Rs.Ms(),this}zM(t,e){void 0!==e?this.DM.splice(e,0,t):this.DM.push(t),this.LM=!0,this.VM&&this.VM(t),t.onMouseEnter(((t,e)=>this._t(t,e,void 0,{}))),t.onMouseLeave(((t,e)=>this.wt(t,e,void 0))),t.onMouseClick(((t,e)=>this.Ct(t,e,void 0,{}))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e,void 0,{}))),t.onMouseDown(((t,e)=>this.Tt(t,e,void 0,{}))),t.onMouseUp(((t,e)=>this.Ft(t,e,void 0,{}))),t.onMouseMove(((t,e)=>this.It(t,e,void 0,{}))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i,void 0,{}))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r,void 0,{}))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s,void 0,{}))),t.onMouseWheel(((t,e)=>this.Lt(t,e,void 0,{}))),t.onTouchStart(((t,e)=>this.Rt(t,e,void 0,{}))),t.onTouchMove(((t,e)=>this.Et(t,e,void 0,{}))),t.onTouchEnd(((t,e)=>this.zt(t,e,void 0,{}))),this.Rs.Ms()}Av(){return this.yv&&this.DM.length>0&&this.getVisible()}setDefaultStyle(t){this.VM=t,this.DM.forEach(t),t(this.OM);for(let t=0;t0?this.DM[0].getDominantStyle():this.OM.getDominantStyle()})}}const Au=(t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i0?e:0,this.Rs.Ms(),this}add(t){if(0!==this.GM.length&&this.chart.cs.Jn(Sh.Df),Array.isArray(t)?this.YM(t):this.YM([t]),this.Tu.length>0){const t=this.Tu[this.Tu.length-1];this.HM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.HM?this.HM.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.vl()+e.Sl()),this.Tu.length)}clear(){this.$M=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.WM.getXMax(this.GM,this.$M)||0}getXMin(){return this.WM.getXMin(this.GM,this.$M)||0}getYMax(){return this.WM.getYMax(this.GM,this.$M)||0}getYMin(){return this.WM.getYMin(this.GM,this.$M)||0}Lr(){const t=u(0,0);for(const e of this.GM)t.x=Math.max(t.x,e.Pl()),t.y=Math.max(t.y,e.Dl());return t}XM(t,e,i,s){this.WM.XM(t,e,i,s,this.scale,(t=>{}))}Cv(){super.Cv(),this.jM&&this.XM(this.GM,this.getPointAmount(),this.jM,this.UM)}ze(){super.ze();const t=this.getBoundaries();this.Tu.length>0&&(this.ZM(this.Tu),this.Tu=[]);for(const e of this.GM)e.sa(t);return super.ze()}Pm(){super.Pm(),this.$M=void 0,this.Tu.length=0}YM(t){0!==t.length&&(this.$M?this.$M=hi(this.$M,ni(t)):this.$M=ni(t),this.R.emit("dataAdd",this,t,this.$M),this.Tu=fe(this.Tu,t,{canReturnB:!1}),this.Rs.Ms())}QM(){return yu(this.GM)}JM(t){return this.R.on("dataAdd",t)}KM(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}t_(t){return this.R.off(t)}}const Su=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;hyt(this.Es.toPoint((t.start+t.end)/2,t.median),this.scale,this.Rs.cs.At),this.chart.cs.Jn(Sh.If),this.Es=a,this.OM=new fu(this.Rs,this.scale,this.yM,Ot,Ot,Ot,Ot,(t=>!1),this.Es,0,0,0,0,0,0,0,this.ts).dispose(),this.e_=new sl((()=>{const t=this.Rs.Qg(this.scale);return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ye(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Kg(e.start,e.end),i}))))),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],start:r[1].start,end:r[1].end,lowerExtreme:r[1].lowerExtreme,lowerQuartile:r[1].lowerQuartile,median:r[1].median,upperQuartile:r[1].upperQuartile,upperExtreme:r[1].upperExtreme,series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,median:0,lowerQuartile:0,upperQuartile:0,lowerExtreme:0,upperExtreme:0,start:0,end:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){if(!(t instanceof Yi||t instanceof Hi))throw new Error("BoxSeries only supports Linear Axes")}EM(t){const e=this.h_.Dm(),i=this.e_.Dm();t.forEach((t=>{if(!t.getVisible())return;const s=this.Es.toPoint((t.start+t.end-t.mM*(t.end-t.start))/2,t.lowerQuartile),r=this.Es.toPoint((t.end-t.start)*t.mM,t.upperQuartile-t.lowerQuartile),n=this.Es.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Es.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Es.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Es.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Es.toPoint((t.start+t.end-t.vM*(t.end-t.start))/2,t.lowerExtreme),u=this.Es.toPoint((t.start+t.end+t.vM*(t.end-t.start))/2,t.lowerExtreme),c=this.Es.toPoint((t.start+t.end-t.vM*(t.end-t.start))/2,t.upperExtreme),d=this.Es.toPoint((t.start+t.end+t.vM*(t.end-t.start))/2,t.upperExtreme),f=this.Es.toPoint((t.start+t.end-t.mM*(t.end-t.start))/2,t.median),g=this.Es.toPoint((t.start+t.end+t.mM*(t.end-t.start))/2,t.median);e.add({Jo:t.Jo,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+r.y},{x:s.x+r.x,y:s.y+r.y},{x:s.x+r.x,y:s.y}],figure:t},{fillStyle:t.SM,strokeStyle:t.xM}),i.add({Jo:0,start:n,end:o,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:h,end:a,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:l,end:u,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:c,end:d,figure:t},{strokeStyle:t.Su}),i.add({Jo:0,start:f,end:g,figure:t},{strokeStyle:t.bM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new fu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.Es,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.ts);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class bu extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.el=m(u(0,0),u(0,0)),this.Rs=t,this.scale=e,this.Ie=ve(a.ellipseSeriesFillStyle,l),this.Pe=ve(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return this.dimensions=t,this.el=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.dM(),this.Rs.Ms(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.fM(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){return this.Ie}}class Mu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Ellipse Series",this.i_=Oe(),this.s_=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new bu(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,radiusX:0,radiusY:0,drawSteps:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){if(!(t instanceof Yi||t instanceof Hi))throw new Error("EllipseSeries only supports Linear Axes")}EM(t){const e=this.h_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],r=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=r;t+=1){const e=t/r*2*Math.PI,n=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:n,y:o})}const n=t.getFillStyle(),o=t.getStrokeStyle();e.add({Jo:t.Jo,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new bu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class Cu extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.n_=[],this.el=Xe,this.Rs=t,this.scale=e,this.Ie=ve(a.polygonSeriesFillStyle,l),this.Pe=ve(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return this.n_=t,this.el=ni(this.n_),this.dM(),this.Rs.Ms(),this}getDimensions(){return this.n_}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.fM(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){return this.Ie}}class Tu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Polygon Series",this.i_=Oe(),this.s_=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new Cu(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],coordinates:r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,coordinates:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){}EM(t){const e=this.h_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Jo:t.Jo,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new Cu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class wu extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.o_={x:0,y:0,width:0,height:0},this.a_={x1:0,y1:0,x2:0,y2:0},this.el=m(u(0,0),u(0,0)),this.Ie=ve(a.rectangleSeriesFillStyle,l),this.Rs=t,this.scale=e,this.Pe=ve(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return"x"in t?(this.o_=t,this.a_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.a_=t,this.o_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.el=ni([this.o_,u(this.o_.x+this.o_.width,this.o_.y+this.o_.height)]),this.dM(),this.Rs.Ms(),this}getDimensionsPositionAndSize(){return this.o_}getDimensionsTwoPoints(){return this.a_}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.fM(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){return this.Ie}}class Eu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Rectangle Series",this.i_=Oe(),this.s_=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new wu(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.h_=new sl((()=>{const t=this.i_.Mt(this.Rs.Km(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.figure),i})))),(()=>{this.i_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensionsPositionAndSize(),...r[1].getDimensionsTwoPoints(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,x1:0,y1:0,x2:0,y2:0,width:0,height:0,multiHit:0,figure:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){}EM(t){const e=this.h_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensionsTwoPoints(),s=[{x:i.x1,y:i.y1},{x:i.x1,y:i.y2},{x:i.x2,y:i.y2},{x:i.x2,y:i.y1}],r=t.getFillStyle(),n=t.getStrokeStyle();e.add({Jo:t.Jo,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new wu(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class ku extends du{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.el=m(u(0,0),u(0,0)),this.ts=a,this.Rs=t,this.scale=e,this.Pe=ve(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.el}setDimensions(t){return this.dimensions=t,this.el=m(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.dM(),this.Rs.Ms(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.fM(),this}getStrokeStyle(){return this.Pe}getDominantStyle(){const t=this.Pe;return t!==ut?t.getFillStyle():_}}class Iu extends pu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Cs="Segment Series",this.l_=Oe(),this.s_=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return yt(i,this.scale,this.Rs.cs.At)},this.chart.cs.Jn(Sh.If),this.r_=c,this.OM=new ku(this.Rs,this.scale,Ot,Ot,Ot,Ot,Ot,(t=>!1),this.ts,this.r_).dispose(),this.e_=new sl((()=>{const t=this.l_.Mt(this.Rs.Qg(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ye(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Kg(e.start,e.end),this.l_.Vt(i,e.figure),i})))),(()=>{this.l_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.DM.length)return;const r=Su(s,this.DM.filter((t=>t.getVisible())),this.s_,ei);if(!r)return;const n=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,startX:0,startY:0,endX:0,endY:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){}EM(t){const e=this.e_.Dm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},r={x:i.endX,y:i.endY},n=t.getStrokeStyle();e.add({Jo:t.Jo,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new ku(this.Rs,this.scale,this.yM,this.dM,this.fM,this.AM,this.gM,this.RM,this.ts,this.r_).setDimensions(t);return this.zM(e),this.LM=!0,this.chart.cs.Ms(),e}}class zu extends gu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Cs="Heatmap Grid Series",this.TS={},this.chart.cs.Jn(Sh.Ff),this.u_=a,this.ts=l;const d=c;this.Ie=ve(l.heatmapGridSeriesFillStyle,d),this.FS=ve(this.ts.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.io=f,this.c_=this.Rs.d_(this.scale,[],f).Re(this.Ie).IS(this.FS).ds(this.getHighlight()),this.As(this.c_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=yt(s,this.Rs.cs.At,this.scale),n=ma(e)?this.c_.sM(r):this.c_.hd(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:j(this.Ie)?this.Ie.lut:void 0}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,intensity:0,column:0,row:0,lut:j(this.Ie)?this.Ie.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}DS(){const t=this.TS.start||{x:0,y:0};let e;e=this.TS.end?{x:(this.TS.end.x-t.x)/this.io.columns,y:(this.TS.end.y-t.y)/this.io.rows}:this.TS.step?this.TS.step:{x:1,y:1},this.c_.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.c_.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.c_.LS().step}setEnd(t){return this.TS.end=t,this.DS(),this}getEnd(){return this.c_.LS().end}clear(){return this.c_.Ot(),this.Rs.Ms(),this.R.emit("dataClear",this),this}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.c_.IS(this.FS),this.Rs.Ms(),this.R.emit("styleChange",this),this}getWireframeStyle(){return this.FS}setIntensityInterpolation(t){return t=t||"disabled",this.c_.ES(t),this.Rs.Ms(),this.R.emit("styleChange",this),this}getIntensityInterpolation(){return this.c_.zS()}Av(){return this.yv&&this.getVisible()}qd(){return Ae(this.Ie)}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}f_(t){this.c_.f_().forEach((e=>{t.c_.VS(e)}))}t_(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}A_(t){return this.R.on("styleChange",t)}g_(t){return this.R.off(t)}getXMax(){const t=this.c_;return t?t.St():void 0}getXMin(){const t=this.c_;return t?t.vt():void 0}getYMax(){const t=this.c_;return t?t.bt():void 0}getYMin(){const t=this.c_;return t?t.xt():void 0}Lr(){const t=u(0,0);return t.x=Math.max(t.x,this.c_.Pl()),t.y=Math.max(t.y,this.c_.Dl()),t}CM(t){if(!(t instanceof Yi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Yi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){return super.ze(),this.c_.sa(this.getBoundaries()),this}}class Fu extends zu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.Pv=!1}invalidateIntensityValues(t){if(this.Pv&&this.chart.cs.Jn(Sh.Df),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.io.dataOrder?t.length:t[0].length,rows:"rows"===this.io.dataOrder?t.length:t[0].length},i="columns"===this.io.dataOrder?this.io.columns:this.io.rows,s="columns"===this.io.dataOrder?this.io.rows:this.io.columns;if(e.x>i||e.y>s){if(!0===this.chart.CA.eo){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.CA.eo){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.io.columns}x${this.io.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(i)}const i=Math.max(s-o,0),r=e.primary-i,a=Math.max(n-h,0),l=[];for(let e=0;e0?-a:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.c_.VS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.R.emit("invalidateIntensity",this,t),this.Rs.Ms(),this.Pv=!0,this}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.c_.Re(this.Ie),this.R.emit("styleChange",this),this.Rs.Ms(),this}getFillStyle(){return this.Ie}p_(t){return this.R.on("invalidateIntensity",t)}y_(t){return this.R.off(t)}}class Ru extends gu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Cs="Scrolling Heatmap Grid Series",this.TS={},this.chart.cs.Jn(Sh.Ff),this.chart.cs.Jn(Sh.Df);const d=c;this.Ie=ve(l.heatmapScrollingGridSeriesFillStyle,d),this.FS=ve(this.ts.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.io=f,this.m_=this.Rs.v_(this.scale,[],f).Re(this.Ie).IS(this.FS).ds(this.getHighlight()),this.As(this.m_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=yt(s,this.Rs.cs.At,this.scale),n=ma(e)?this.m_.sM(r):this.m_.hd(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:j(this.Ie)?this.Ie.lut:void 0}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,intensity:0,multiHit:0,column:0,row:0,lut:j(this.Ie)?this.Ie.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}DS(){const t=this.TS.start||{x:0,y:0};let e;e=this.TS.step?this.TS.step:{x:1,y:1},this.m_.BS(t,e),this.chart.cs.Ms()}setStart(t){return this.TS.start=t,this.DS(),this}getStart(){return this.m_.LS().start}setStep(t){return this.TS.step=t,this.DS(),this}getStep(){return this.m_.LS().step}clear(){return this.m_.Ot(),this.Rs.Ms(),this}setWireframeStyle(t){return this.FS="function"==typeof t?t(this.FS):t,this.m_.IS(this.FS),this.Rs.Ms(),this}getWireframeStyle(){return this.FS}setPixelInterpolationMode(t){return t=t||"disabled",this.m_.ES(t),this.Rs.Ms(),this}getPixelInterpolationMode(){return this.m_.zS()}setDataCleaning(t){return this.m_.Iu(t),this.Rs.Ms(),this}Av(){return this.yv&&this.getVisible()}qd(){return Ae(this.Ie)}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}Re(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.m_.Re(this.Ie),this.Rs.Ms(),this}CM(t){if(!(t instanceof Yi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Yi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.m_.St()||0}getXMin(){return this.m_.vt()||0}getYMax(){return this.m_.bt()||0}getYMin(){return this.m_.xt()||0}Lr(){const t=u(0,0);return t.x=Math.max(t.x,this.m_.Pl()),t.y=Math.max(t.y,this.m_.Dl()),t}Oe(t,e){t.ds(e),this.Rs.Ms()}}class Du extends Ru{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c)}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.io.scrollDimension?t.length:t[0].length,"rows"===this.io.scrollDimension?t.length:t[0].length,0+i-1),r=this.io.resolution-1;if(s>r){if(!0===this.chart.CA.eo){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.io.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;zt.console.warn(t)}const s=[];for(let i=0;i{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.slice()},this.M_=[],this.__=[],this.w_=!1,this.C_=(t,e)=>{const i=t.oM(e);if(i)return[yt(i[0],this.scale,this.Rs.cs.At),yt(i[1],this.scale,this.Rs.cs.At)]},this.k_=(t,e)=>{const i=t.T_(e);if(i)return[yt(i[0],this.scale,this.Rs.cs.At),yt(i[1],this.scale,this.Rs.cs.At)]},this.qd=()=>Ae(this.F_)||Ae(this.I_),this.P_=t=>{const e=t.length;if(this.GM.length>0){const i=this.GM.length-1,s=this.GM[i];if(e>0){const[e,i]=s.cl(),[r,n]=s.ul();if((r?e.length+r.length:e.length)>=this.jM){const o=r&&r.length>0?r[r.length-1]:e[e.length-1],h=n&&n.length>0?n[n.length-1]:i[e.length-1],a=(o.x+t[0].position)/2,l=bi(a,o,u(t[0].position,t[0].high)).y,c=bi(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.ml(f,m(u(a,c),u(a,l))).jl(!0),this.D_([f].concat(t)).$l(!0)}else s.ml(t)}}else e>0&&this.D_(t)},this.B_=t=>{const e=this.M_,i=t.length;if(this.M_.length>0){if(i>0){const i=e[e.length-1],s=i.cl(),r=i.ul();if(s.length+r.length>=this.jM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=bi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ml(a,m(u(o,h),u(o,h))).jl(!0),e.push(this.L_([a].concat(t),this.$M).$l(!0))}else i.ml(t)}}else i>0&&e.push(this.L_(t))},this.R_=t=>{const e=this.__,i=t.length;if(this.__.length>0){if(i>0){const i=e[e.length-1],s=i.cl(),r=i.ul();if(s.length+r.length>=this.jM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=bi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ml(a,m(u(o,h),u(o,h))).jl(!0),e.push(this.E_([a].concat(t)).$l(!0))}else i.ml(t)}}else i>0&&e.push(this.E_(t))}}fs(){return"ProgressiveX"}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.UM=void 0!==e&&e>0?e:0,this.Rs.Ms(),this}clear(){for(let t=0;tt+e.vl()+e.Sl()),this.Tu.length)}getXMax(){return $t(this.GM,Nt,Math.max,Xt,this.$M)||0}getXMin(){return $t(this.GM,Gt,Math.min,Ht,this.$M)||0}getYMax(){return $t(this.GM,Yt,Math.max,jt,this.$M)||0}getYMin(){return $t(this.GM,Ut,Math.min,Wt,this.$M)||0}Lr(){const t=u(0,0);for(const e of this.GM)t.x=Math.max(t.x,e.Pl()),t.y=Math.max(t.y,e.Dl());return t}Av(){return this.yv&&this.getPointAmount()>0&&this.getVisible()}CM(t){}YM(t,e,i){this.Tu=fe(this.Tu,t,{canReturnB:!1}),this.x_=fe(this.x_,e,{canReturnB:!1}),this.b_=fe(this.b_,i,{canReturnB:!1}),this.Rs.Ms()}z_(t,e,i,s){this.V_(e,i,s),this.YM(Array.isArray(t)?t:[t],e,i)}V_(t,e,i){const s=hi(ni(t),ni(e));this.$M?this.$M=hi(this.$M,s):this.$M=s,i&&(this.$M=hi(this.$M,i))}O_(){const t=this.GM.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const r=Math.ceil(i/e),n=t.length-r;if(n>0&&s>0){const e=n-s>0?s:n;if(e>0){for(let i=0;i0?this.GM[this.GM.length-1]:void 0,i=e?e.cl()[0].length+(e.ul()[0]?e.ul()[0].length:0):void 0;mu(t,i,this.jM,this.P_)}G_(t){const e=this.M_.length>0?this.M_[this.M_.length-1].cl().length+this.M_[this.M_.length-1].ul().length:void 0;mu(t,e,this.jM,this.B_)}U_(t,e){const i=this.M_.length>0?this.M_[this.M_.length-1].cl().length+this.M_[this.M_.length-1].ul().length:void 0;mu(t,i,this.jM,this.B_),mu(e,i,this.jM,this.R_)}D_(t,e){const i=this.Rs.W_(this.scale).ml(t,e).Re(this.F_).Yl(this.I_).Ul(this.Rl).ds(this.getHighlight());return this.GM.push(i),this.As(i),i}Y_(t,e,i){const s=this.Rs.gm(this.scale,void 0,[Za.UserSeries]).ml(t,i).setMouseInteractions(!1).Ye(e).ds(this.getHighlight());return this.As(s),s}L_(t,e){return this.Y_(t,this.H_,e)}E_(t,e){return this.Y_(t,this.X_,e)}j_(t){this.F_="function"==typeof t?t(this.F_):t;const e=this.F_;for(let t=0;t0){const t=this.O_();this.XM(this.GM,this.jM,this.UM,t),this.M_.length>0&&this.XM(this.M_,this.jM,this.UM,t),this.__.length>0&&this.XM(this.__,this.jM,this.UM,t),this.w_=!0}}ze(){if(super.ze(),this.Tu.length>0&&(this.N_(this.Tu),this.sw(this.x_,this.b_),this.w_=!0),this.w_){const t=this.getBoundaries();for(const e of this.GM)e.sa(t);for(const e of this.M_)e.sa(t);for(const e of this.__)e.sa(t)}}Pm(){super.Pm(),this.$M=void 0,this.Tu.length=0,this.x_.length=0,this.b_.length=0}}class Lu extends Ou{constructor(t,e,i,s,r,n,o,h,a=0,l,u){super(t,e,i,s,r,n,o,h,l,u),this.chart.cs.Jn(Sh.Tf),this.ew=a}add(t){0!==this.GM.length&&this.chart.cs.Jn(Sh.Df);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.hw(e),[i,s]=this.rw(t);this.z_(t,i,s,m(u(Ye,this.ew),u(He,this.ew)));const r=this.Tu[this.Tu.length-1];this.HM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.$M)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.HM?this.HM.position+e:0),this.add(Au(t,e,s)),this}JM(t){return this.R.on("dataAdd",t)}KM(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}t_(t){return this.R.off(t)}}class _u extends Lu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u);const c=t.getSeries().length;this.F_=ve(this.ts.areaSeriesBipolarHighFillStyle,c),this.H_=ve(this.ts.areaSeriesBipolarHighStrokeStyle,c),this.I_=ve(this.ts.areaSeriesBipolarLowFillStyle,c),this.X_=ve(this.ts.areaSeriesBipolarLowStrokeStyle,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Pu(s,this.GM,ma(e)?this.k_:this.C_);if(void 0!==r&&void 0!==r[0]){const t=yt(r[0][0],this.Rs.cs.At,this.scale),e=yt(r[0][1],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}hw(t){return this.nw(t)}sw(t,e){return this.U_(t,e)}nw(t){let e=0;const i=[],s=t.length,r=this.ew;return s>0&&(this.ow&&(this.ow.y<=r&&r<=t[0].y||this.ow.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.ow.x+t[0].x),r,r),e+=1),this.ow=t[s-1],1===s?this.aw(t[0],i,e):this.lw(t,i)),i}aw(t,e,i=0){return e[i]=d(t.x,t.y,this.ew),i+1}lw(t,e){let i=0,s=0;const r=t.length-1,n=this.ew;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Jn(r.x,o.x,(h-t)/(s-t));e[i]=d(a,n,n),i+=1}e[i]=d(o.x,o.y,n),i+=1}return i}rw(t){const e=t.length,i=Array(e),s=Array(e),r=this.ew;for(let n=0;nr?(i[n]=u(e.position,e.high),s[n]=u(e.position,r)):e.hight[0]))}setPositiveFillStyle(t){return this.j_(t),this}setNegativeFillStyle(t){return this.Z_(t),this}setPositiveStrokeStyle(t){return this.J_(t),this}setNegativeStrokeStyle(t){return this.K_(t),this}getPositiveFillStyle(){return this.Q_()}getNegativeFillStyle(){return this.Hl()}getPositiveStrokeStyle(){return this.q_()}getNegativeStrokeStyle(){return this.tw()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.F_,fill2:this.I_,behavior:{colorStep:!0}})}}class Bu extends Lu{constructor(){super(...arguments),this.X_=ut}sw(t){return this.G_(t)}rw(t){const e=t.length,i=Array(e);for(let s=0;ss?d(t.x,s,s):d(t.x,t.y,s),i+1}lw(t,e,i=0){let s=0;const r=t.length-1,n=this.ew;for(;sn){const t=Ei(u(He,n),u(Ye,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,n,n),i+=1}else e[i]=d(o.x,o.y,n),i+=1}else{const t=d(r.x,n,n);if(0!==i&&Zt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=Ei(u(He,n),u(Ye,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}QM(){return yu(this.GM,(t=>t[1]))}setFillStyle(t){return this.Z_(t),this}getFillStyle(){return this.Hl()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.I_,stroke:this.H_})}}class Gu extends Bu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u);const d=c;this.F_=ve(this.ts.areaSeriesPositiveFillStyle,d),this.I_=_,this.H_=ve(this.ts.areaSeriesPositiveStrokeStyle,d)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Pu(s,this.GM,ma(e)?this.k_:this.C_);if(void 0!==r&&void 0!==r[0]){const t=yt(r[0][0],this.Rs.cs.At,this.scale),e=yt(r[0][1],this.Rs.cs.At,this.scale),i=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Zt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=Ei(u(He,n),u(Ye,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}QM(){return yu(this.GM,(t=>t[0]||[]))}setFillStyle(t){return this.j_(t),this}getFillStyle(){return this.Q_()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.F_,stroke:this.H_})}}const Nu={Positive:Gu,Negative:Vu,Bipolar:_u};class Uu extends Ou{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.chart.cs.Jn(Sh.Tf);const c=u;this.F_=ve(this.ts.areaRangeSeriesFillStyle,c),this.H_=ve(this.ts.areaRangeSeriesStrokeStyle,c),this.I_=ve(this.ts.areaRangeSeriesFillStyleInverted,c),this.X_=ve(this.ts.areaRangeSeriesStrokeStyleInverted,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Pu(s,this.GM,ma(e)?this.k_:this.C_);if(void 0!==r&&void 0!==r[0]){const t=yt(r[0][0],this.Rs.cs.At,this.scale),e=yt(r[0][1],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.z_(t,i,s);const r=this.Tu[this.Tu.length-1];return this.HM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.$M),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let r=s;r||(r=this.HM?this.HM.position+i:0),this.add(((t,e,i=1,s)=>{const r=void 0!==s?s:0,n=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],r=e.length;for(let t=0;t{const i=[],s=t.length,r=e;if(s>0){let e=0,n=t[0];i[e]=n,e+=1;for(let o=1;o{const i=t*t,s=i*t,r=1-t,n=r*r,o=n*r;return u(o*e[0].x+3*t*n*e[1].x+3*i*r*e[2].x+s*e[3].x,o*e[0].y+3*t*n*e[1].y+3*i*r*e[2].y+s*e[3].y)},Wu=(t,e=32)=>{if(2===t.length)return[t[0],t[1]];const i=(t=>{const e=1e-5,i=t.length-1,s=Array(i);if(i>1){let r=u(0,0),n=u(0,0),o=u(0,0),h=di(pi(t[1],t[0]));const a=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(a*r.x)):1,c=Math.abs(n.x)>e?Math.abs(i/(a*n.x)):1}f[1]=yi(mi(r,l),f[1]),f[2]=pi(f[2],mi(n,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,r=Array(s*e);let n=0;for(let t=0;t{const i=t.hd(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.gw=(t,e)=>{const i=t.T_(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.pw=t=>{if(this.GM.length>0){const e=this.GM[this.GM.length-1];if(t.length>0){const i=e.cl(),s=e.ul(),r=i.length+s.length-+e.Xl();if(r>=this.jM){const n=s.length>0?s[s.length-1]:i[e.Xl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.ml(o,m(u(o.x,o.y),u(o.x,o.y))).jl(!0),this.yw([o].concat(t)).$l(!0)}else e.ml(t,this.$M)}}else t.length>0&&this.yw(t)},this.mw=t=>{if(this.fw.length>0){const e=this.fw[this.fw.length-1];t.length>0&&((e.cl().length+e.ul().length)*this.dw>=this.jM?this.Sw(t):e.ml(t))}else t.length>0&&this.Sw(t)},this.io=y,this.uM=l,this.xw=f,this.bw=ve(c.pointLineSeriesFillStyle,g),this.Su=ve(this.ts.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}QM(){return yu(this.fw)}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;for(let t=0;te.setVisible(t))),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.GM.length)return;const r=this.GM[0].qo()||Jr.NearestX,n=ma(e)?Su(s,this.GM,this.gw,r===Jr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Jr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):Su(s,this.fw,this.Aw,r===Jr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Jr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=yt(n[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}qd(){return Ae(this.bw)||Ae(this.Su.getFillStyle())}Bs(){return this.ws||this.uM}CM(t){}Oe(t,e){t.ds(e),this.Rs.Ms()}ZM(t){const e=this.GM.length>0?this.GM[this.GM.length-1].cl().length+this.GM[this.GM.length-1].ul().length-+this.GM[this.GM.length-1].Xl():void 0;mu(t,e,this.jM,this.pw),mu(t,e,this.jM,this.mw)}Sw(t,e){const i=this.Rs.Nv(this.scale).ml(t,e).setMouseInteractions(this.$i).Re(this.bw).dl(this.uM).it(this.lM).sr(this.ka).Al(this.tl).pl(this.il).yl(this.sl).ds(this.getHighlight());return this.As(i),this.fw.push(i),i}yw(t,e){const i=this.Rs.gm(this.scale,void 0,[Za.UserSeries,...this.xw]).ml(t,e).setMouseInteractions(this.$i).Ye(this.Su).ds(this.getHighlight());return this.As(i),this.GM.push(i),i}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su,fill:this.bw})}getPointAmount(){return this.fw.reduce(((t,e)=>t+e.vl()+e.Sl()),this.Tu.length)}clear(){super.clear();for(let t=0;t{}))}}const $u=(t,e)=>t.ul().length>=e?t.ul().slice(-e):Array.prototype.concat(t.cl(),t.ul()).slice(-e),Zu=(t,e,i)=>{const s=Array.prototype.concat(t.cl(),t.ul()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ot().ml(s).Os()};class qu extends ju{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g){super(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g),this.dw=32,this.jM=8e3,this.Mw=t=>{if(0===t.length)return;const e=this.fw.length;if(e>0){const i=e>1,s=this.fw[e-1];if(i){const i=Array.prototype.concat(s.cl(),s.ul()),r=i.length;if(32*r>=this.jM){const i=$u(s,3),r=Array.prototype.concat(i,t),n=Wu(r,32);Zu(this.GM[e-1],n,32),this.yw(n.slice(66))}else if(r<5){const s=this.fw[e-2],r=$u(s,3),n=Array.prototype.concat(r,i,t),o=Wu(n,32),h=this.GM[e-1],a=o.slice(66);h.Ot().ml(a).Os()}else{const i=this.GM[e-1],r=Array.prototype.concat(i.cl(),i.ul()),n=$u(s,4),o=Array.prototype.concat(n,t),h=Wu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ot().ml(a).Os()}}else{const i=Array.prototype.concat(s.cl(),s.ul()),r=i.length,n=this.GM[e-1];if(32*r>=this.jM){const e=$u(s,3),i=Array.prototype.concat(e,t),r=Wu(i,32);Zu(this.GM[0],r,32),this.yw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=Wu(e,32);n.Ot().ml(s).Os()}else n.ml(t)}}else{const e=t.length>0?Wu(t,32):t,i=ni(e);this.yw(e,i)}this.mw(t)}}ZM(t){const e=this.fw.length,i=this.fw.length>0?this.fw[e-1].cl().length+this.fw[e-1].ul().length:void 0;mu(t,i,Math.ceil(this.jM/this.dw),this.Mw)}}class Ku{constructor(){this.Gi="FreeformPattern",this.Rl={type:"disabled",packager:(t,e,i)=>t.slice()}}XM(t,e,i,s,r,n){if(s>0){const r=Math.trunc((e-s)/i);if(r>0&&t.length>1){const e=t.splice(0,r);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},Qu=s.Record({Rl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class tc extends Qu{XM(t,e,i,s,r,n){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.O_(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.xt();return t?Math.min(i,t):i},ic=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class sc extends tc{_w(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(ic,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(ec,e?e.min.y:void 0)}}const rc=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},nc=(t,e)=>{const i=e.St();return t?Math.max(i,t):i};class oc extends tc{_w(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(nc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(rc,e?e.min.x:void 0)}}const hc={horizontalProgressive:new class extends sc{constructor(){super({Rl:Hr()}),this.Gi="HorizontalProgressivePattern"}O_(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].St():void 0}getXMin(t=[],e){return t.length>0&&t[0].vl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Hr(Ju(t)))}},horizontalRegressive:new class extends sc{constructor(){super({Rl:Xr()}),this.Gi="HorizontalRegressivePattern"}O_(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].vl()>0?t[0].St():e?e.max.x:void 0}getXMin(t=[],e){return void 0!==e?e?e.min.x:void 0:t.length>0?t[t.length-1].vt():void 0}setPrecision(t){return this.set("_columnPackaging",Xr(Ju(t)))}},verticalProgressive:new class extends oc{constructor(){super({Rl:Wr()}),this.Gi="VerticalProgressivePattern"}O_(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getYMin(t=[],e){return t.length>0&&t[0].vl()>0?t[0].xt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Wr(Ju(t)))}},verticalRegressive:new class extends oc{constructor(){super({Rl:jr()}),this.Gi="VerticalRegressivePattern"}O_(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].vl()>0?t[0].bt():e?e.max.y:void 0}getYMin(t=[],e){return void 0!==e?e?e.min.y:void 0:t.length>0?t[t.length-1].xt():void 0}setPrecision(t){return this.set("_columnPackaging",jr(Ju(t)))}},freeform:new Ku};class ac extends ju{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,y){super(t,e,i,s,r,n,o,h,hc.horizontalProgressive,a,c,d,f,g,y),this.pw=t=>{const e=this.GM.length>0?this.GM[this.GM.length-1].cl().length+this.GM[this.GM.length-1].ul().length:void 0;mu(t,e,this.jM,this.ww)},this.ww=t=>{const e=t.length;if(this.GM.length>0){const i=this.GM[this.GM.length-1];if(e>0){const e=i.cl(),s=i.ul(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Hu([r].concat(t),this.Cw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.jM?(i.ml(o,m(u(o.x,o.y),u(o.x,o.y))).jl(!0),this.yw(h).$l(!0),this.Sw(t)):i.ml(h)}}else e>0&&this.yw(Hu(t,this.Cw));this.mw(t)},this.Cw=l,void 0===this.xw.find((t=>"DataPattern"===t.type))&&this.xw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class lc extends gu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.kw=t=>t[4]>=t[1],this.BM=m(c(Ye,Ye),c(He,He)),this.Tw=[],this.Fw=!1,this.Iw=-1,this.Pw=[],this.Dw=!0,this.Bw=!1,this.Lw=4,this.Rw=[1e-7,1e-6,1e-5,1e-4,.001,.01,.1,1,5,10,30,60,300,600,1800,3600,7200,14400,28800,36e3,43200,50400,57600,64800,72e3,86400,172800,259200,345600,432e3,604800,1209600,2592e3,7776e3,10368e3,15552e3,31536e3,15768e4,31536e4,63072e4,7884e5,15768e5,31536e5,3942e6,47304e5,63072e5,7884e6,15768e6,31536e6,3942e7,47304e6,63072e6,7884e7,15768e7,31536e7,63072e7,7884e8,15768e8,31536e8,47304e8,63072e8],this.chart.cs.Jn(Sh.mf)}QM(){return this.Pw}JM(t){return this.R.on("dataAdd",t)}KM(t){return this.R.off(t)}qM(t){return this.R.on("dataClear",t)}t_(t){return this.R.off(t)}Av(){return this.yv&&this.Pw.length>0&&this.getVisible()}Ew(t){if(!(this.Pw.length<1))return[this.Pw[t][0],this.Pw[t][1],this.Pw[t][2],this.Pw[t][3],this.Pw[t][4]]}solveNearest(t,e){if(0===this.Pw.length)return;const i=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}).x,s=void 0!==this.getPackDataState();let r,n,o,h,a;if(s){const t=this.zw;if(!t)return;const e=Pe(i,t.length-1,(e=>t[e][0])),s=void 0!==e&&t[e];if(!s)return;h=s[3],o=s[2],n=s[1],a=s[4],r=s[0]}else{const t=Pe(i,this.Pw.length-1,(t=>this.Pw[t][0])),e=void 0!==t&&this.Pw[t];if(!e)return;r=e[0],n=e[1],o=e[2],h=e[3],a=e[4]}return{cursorPosition:{resultTable:u(r,a),resultTableScale:this.scale,pointMarker:u(r,a),pointMarkerScale:{x:this.axisX,y:this.axisY}},x:r,y:a,open:n,high:o,low:h,close:a,position:r,isPacked:s,series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){return Ve({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,open:0,high:0,low:0,close:0,position:0,isPacked:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}CM(t){if(!(t.x instanceof Gi))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Vw=t.x}Lr(){return u(5,5)}w_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.chart.cs.Jn(Sh.Df);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.Fw=!0;const t=this.Pw.length,i=this.Tw.length,s=e.length;this.Pw.length=t+s,this.Tw.length=i+s;for(let r=0;rthis.Rw[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Iw||this.Fw||this.Bw)){this.Bw=!1,this.Iw=t,this.Fw=!1,this.Nw(),this.zw=[];const e=this.Pw.length;let i=this.Pw[0][0]-this.Pw[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...al(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Lr().x))}),gc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...al(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Lr().y))});class mc extends Ta{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.aC=!1,this.lC=!1,this.uC=!1,this.cC=!1,this.dC=!1,this.fC=new Map,this.AC=new Map,this.gC=[],this.pC=[],this.yC=!0,this.mC=!0,this.vC=!1,this.SC=[],this.xC=new Set,this.bC=!1,this.vy=r,this.MC=n,this._C=o,this.wC=h.cursorGridStrokeStyleX,this.CC=h.cursorGridStrokeStyleY}setKeepWithinAxisBoundaries(t){return this.aC=t,this.Rs.Ms(),this}getKeepWithinAxisBoundaries(){return this.aC}dispose(){return super.dispose(),this.fC.forEach((t=>t.forEach((t=>t.dispose())))),this.AC.forEach((t=>t.forEach((t=>t.dispose())))),this.gC.length=0,this.pC.length=0,this.yy.length=0,this}ze(){return this.vC&&this.setPosition(...this.SC),this.gC.forEach((t=>t.setVisible(this.Zi&&this.dp).setMarkerVisible(this.Zi&&this.dp&&this.yC))),this.pC.forEach((t=>t.setVisible(this.Zi&&this.dp).setMarkerVisible(this.Zi&&this.dp&&this.mC))),super.ze()}Kp(){if(!this.aC)return super.Kp();const t={x:!0,y:!0},i=this.Jp,s=i.getPosition(u(-1,-1),e.UISpace.PaddedBackground),r=i.getPosition(u(1,1),e.UISpace.PaddedBackground);return this.SC.forEach(((e,n)=>{const o=e.pointMarkerScale.x,h=e.pointMarkerScale.y,a=yt(s,i.scale,{x:o,y:h}),l=yt(r,i.scale,{x:o,y:h});ti(a.x,o.$h,o.Xh)&&ti(l.x,o.$h,o.Xh)&&(t.x=!1),ti(a.y,h.$h,h.Xh)&&ti(l.y,h.$h,h.Xh)&&(t.y=!1)})),t}setPosition(...t){if(this.SC=t,this.gC.forEach((t=>t.setVisible(!1))),this.pC.forEach((t=>t.setVisible(!1))),this.gC.length=0,this.pC.length=0,0===t.length)return this;const e=this.renderingScale,i=t[0].resultTable,s=ha(t[0].resultTableScale,e),r=s===this.scale?i:yt(i,s,this.scale);this.Jp.setPosition(r),this.dp=!1,this.Ay.forEach((t=>{t.targetVisible=!1}));const n=new Map;return t.forEach(((t,i)=>{const s=t.pointMarkerScale.x,r=t.pointMarkerScale.y,o=n.get(s)||[],h=n.get(r)||[],a=!o.includes(t.pointMarker.x),l=!h.includes(t.pointMarker.y);o.push(t.pointMarker.x),h.push(t.pointMarker.y),n.set(s,o),n.set(r,h);const c=t.pointMarker,d=Ac(u(c.x,c.y),s,r);if(a){const t=this.Ph(s,!0);t.setValue(c.x),t.setGridStrokeLength(this.lC?d.x:1).setAllocatesAxisSpace(this.bC),this.gC.push(t)}if(l){const t=this.Ph(r,!1);t.setValue(c.y),t.setGridStrokeLength(this.uC?d.y:1).setAllocatesAxisSpace(this.bC),this.pC.push(t)}let f=this.Ay[i];if(!f){const t=new Oo(this.Rs,this.renderingScale,this.scale,Ot,this.ts).setMouseInteractions(!1).setFillStyle(this.ts.cursorPointMarkerFillStyle).setSize(this.ts.cursorPointMarkerSize).setShape(this.ts.cursorPointMarkerShape);f={pointMarker:t,targetVisible:!0},this.Ay.push(f),this.yy.forEach((e=>e(t)))}const g=ha(t.pointMarkerScale,e),m=g===this.scale?t.pointMarker:yt(t.pointMarker,g,this.scale);f.pointMarker.setPosition(m),f.targetVisible=!0;const y=s.getInterval(),p=r.getInterval(),A=Math.min(y.start,y.end),x=Math.max(y.start,y.end),S=Math.min(p.start,p.end),v=Math.max(p.start,p.end);c.x>=A&&c.x<=x&&c.y>=S&&c.y<=v&&(this.dp=!0)})),this}setTickMarkersAllocateAxisSpace(t){return this.bC=t,this.Rs.Ms(),this}getTickMarkersAllocateAxisSpace(){return this.bC}Ph(t,e){this.xC.has(t)||(t.onDispose((()=>{var e;null===(e=i.get(t))||void 0===e||e.forEach((t=>t.dispose())),i.delete(t)})),this.xC.add(t));const i=e?this.fC:this.AC,s=e?this.gC:this.pC,r=i.get(t)||[];i.set(t,r);let n=r.find((t=>!s.includes(t)));return n||(n=e?t.np(!1,this.MC):t.np(!1,this._C),r.push(n),this.br(n,e),n.setMouseInteractions(!1)),n}br(t,e){const i=e?this.wC:this.CC;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.yC:this.mC)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.lC=t,this.Rs.Ms(),this}getGridStrokeXCut(){return this.lC}setGridStrokeYCut(t){return this.uC=t,this.Rs.Ms(),this}getGridStrokeYCut(){return this.uC}setGridStrokeXStyle(t){return this.wC=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.fC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.wC))))),this}getGridStrokeXStyle(){return this.wC}setGridStrokeYStyle(t){return this.CC=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.AC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.CC))))),this}getGridStrokeYStyle(){return this.CC}setTickMarkerXVisible(t){return this.yC=t,this.Rs.Ms(),this}getTickMarkerXVisible(){return this.yC}setTickMarkerYVisible(t){return this.mC=t,this.Rs.Ms(),this}getTickMarkerYVisible(){return this.mC}setTickMarkerX(t){return this.fC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.MC=this.MC.addStyler(t),this.Rs.Ms(),this}setTickMarkerY(t){return this.AC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this._C=this._C.addStyler(t),this.Rs.Ms(),this}}class yc{constructor(t,e,i,s){this.by=[],this.My=(t,e)=>(this.by.forEach((i=>i(t,e))),t),this.addStyler=t=>new yc(this.vy,this.MC,this._C,this.by.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new yc(t,this.MC,this._C,this.by.map((t=>t))),this._y=(t,e,i,s,r)=>this.My(new mc(t,e,i,s,this.vy,this.MC,this._C,r),r),this.vy=t,this.by=s,this.MC=e,this._C=i}}const pc=new yc(Fo,Ah.PointableTextBox,Ah.PointableTextBox,[(t,e)=>{wa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),_n(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),_n(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ac=(t,e,i)=>{const s=e.At,r=i.At;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.vg&&(n=1-n),1===e.vg&&(o=1-o),u(o,n)};class xc extends xu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.GM=[],this.qb=!0,this.jM=void 0,this.Fu=void 0,this.kC=(t,e)=>{const i=t.oM(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.gw=(t,e)=>{const i=t.T_(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.qd=()=>Ae(this.Su.getFillStyle()),this.xw=c,this.io=f,this.Su=ve(this.ts.lineSeriesStrokeStyle,d),this.TC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}fs(){var t,e;return null===(e=null===(t=this.io)||void 0===t?void 0:t.dataPattern)||void 0===e?void 0:e.pattern}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.Su="function"==typeof t?t(this.Su):t;const e=this.Su;for(let t=0;tt.Iu(this.Fu))),this.Rs.Ms(),this}setCursorInterpolationEnabled(t){return this.qb=t,this.Rs.cs.Ms(),this}getCursorInterpolationEnabled(){return this.qb}CM(t){}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY};if(0===this.GM.length)return;const r=this.GM[0].qo()||Jr.NearestX,n=Su(s,this.GM,ma(e)?this.gw:this.kC,r===Jr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Jr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=yt(n[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}ZM(t){let e=this.GM[0];e||(e=this.yw(),this.GM.push(e),this.As(e)),e.ml(t,this.$M)}yw(){return this.Rs.gm(this.scale,this.TC,[Za.UserSeries,...this.xw]).Ye(this.Su).Iu(this.Fu).ds(this.getHighlight())}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{stroke:this.Su})}Oe(t,e){t.ds(e),this.Rs.Ms()}XM(t,e,i,s){}}class Sc extends xu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new Ku,l,u),this.GM=[],this.lM=5,this.ka=0,this.tl=!1,this.il=!1,this.sl=!1,this.jM=void 0,this.Aw=(t,e)=>{const i=t.hd(e);if(i)return yt(i,this.scale,this.Rs.cs.At)},this.io=d,this.uM=a,this.Ie=ve(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Su(s,this.GM,this.Aw,ei);if(void 0!==r){const t=yt(r[0],this.Rs.cs.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}qd(){return Ae(this.Ie)}Bs(){return this.ws||this.uM}CM(t){}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}Oe(t,e){t.ds(e),this.Rs.Ms()}setPointFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;for(let t=0;t{const t=i.engine.container.getBoundingClientRect();this.PC.style.left=`${t.left}px`,this.PC.style.top=`${t.top}px`,this.PC.style.width=`${t.width}px`,this.PC.style.height=`${t.height}px`};n(),i.onResize(n),this.DC(this.PC),this.BC(),this.LC(),this.RC(),this.EC(e),this.chart.zC().push(this)}DC(t){this.VC=zt.document.createElement("div"),this.VC.style.pointerEvents="all",t.append(this.VC),this.OC=zt.document.createElement("div"),this.NC=new _s(this.te,this.oe,this.chart,this.OC),this.GC=zt.document.createElement("table"),this.GC.style.borderSpacing="0",this.VC.appendChild(this.NC.pe()),this.VC.appendChild(this.OC),this.OC.appendChild(this.GC)}LC(){let t=0,e=0,i=0,s=0,r=!1;this.FC=!1,this.VC.onmousedown=n=>{n=n||zt.event,i=n.clientX,s=n.clientY,r=!0,zt.document.onmouseup=t=>{this.FC?this.VC.addEventListener("click",se,!0):this.VC.removeEventListener("click",se,!0),r=!1,this.FC=!1,zt.document.onmouseup=null,zt.document.onmousemove=null},zt.document.onmousemove=n=>{n=n||zt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.FC=!0,this.VC.style.top=this.VC.offsetTop-e+"px",this.VC.style.left=this.VC.offsetLeft-t+"px",this.VC.style.removeProperty("right"),this.VC.style.removeProperty("bottom"))}}}RC(){let t=0,e=0,i=0,s=0,r=!1;this.VC.ontouchstart=n=>{n=n||zt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.VC.ontouchend=()=>{r=!1,zt.document.ontouchend=null,zt.document.ontouchmove=null},this.VC.ontouchmove=n=>{r&&(se(n),n=n||zt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.VC.style.top=this.VC.offsetTop-e+"px",this.VC.style.left=this.VC.offsetLeft-t+"px",this.VC.style.removeProperty("right"),this.VC.style.removeProperty("bottom"))}}}BC(){this.VC.style.setProperty("top","10px"),this.VC.style.setProperty("left","10px"),this.VC.style.position="absolute",this.VC.style.display="flex",this.VC.style.alignItems="flex-start",this.OC.style.setProperty("display","none")}removePositionProperty(){this.VC.style.removeProperty("top"),this.VC.style.removeProperty("left"),this.VC.style.removeProperty("bottom"),this.VC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.VC.style.setProperty("bottom","10px"),this.VC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.VC.style.setProperty("top","10px"),this.VC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.VC.style.setProperty("bottom","10px"),this.VC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.VC.style.setProperty("top","10px"),this.VC.style.setProperty("right","10px")}}EC(t){for(let e=0;e[t.rd((()=>{this.YC+=1,this.YC>1&&this.chart.cs.Jn(Sh.Df),this.chart.cs.Ms()})),t.nd((()=>this.chart.cs.Ms()))])),this.qa.xd(t),this.chart.cs.Ms()),this}getDataSet(){return this.XC()}setStrokeStyle(t){return this.qa.Ye(t),this.Rs.Ms(),this}getStrokeStyle(){return this.qa.xu()}setAreaFillStyle(t){return this.qa.Md(t),this.Rs.Ms(),this}getAreaFillStyle(){return this.qa.jC()}setPointFillStyle(t){return this.qa.bd(t),this.Rs.Ms(),this}getPointFillStyle(){return this.qa.Fd()}setPointSize(t){return this.qa.Id(t),this.Rs.Ms(),this}getPointSize(){return this.qa.ZC()}setPointShape(t){return this.qa.wd(t),this.Rs.Ms(),this}getPointShape(){return this.qa.Cd()}setPointRotation(t){return this.qa.kd(t),this.Rs.Ms(),this}getPointRotation(){return this.qa.Td()}setPointAlignment(t){return this.qa.QC(t),this.chart.cs.Ms(),this}getPointAlignment(){return this.qa.JC()}setCurvePreprocessing(t){return this.qa.HC(t),this.Rs.Ms(),this}getCurvePreprocessing(){return this.qa.KC()}add(t){return this.XC().add(t),this.Rs.Ms(),this}addArraysXY(t,e){return this.XC().addArraysXY(t,e),this.Rs.Ms(),this}appendJSON(t,e){return this.XC().appendJSON(t,e),this.Rs.Ms(),this}appendSample(t){return this.XC().appendSample(t),this.Rs.Ms(),this}appendSamples(t){return this.XC().appendSamples(t),this.Rs.Ms(),this}fill(t){return this.XC().fill(t),this.Rs.Ms(),this}setSamples(t){return this.XC().setSamples(t),this.Rs.Ms(),this}alterSamples(t,e){return this.XC().alterSamples(t,e),this.Rs.Ms(),this}alterSamplesByID(t,e){return this.XC().alterSamplesByID(t,e),this.Rs.Ms(),this}getSampleCount(){return this.XC().getSampleCount()}getNextSampleIndex(){return this.XC().getNextSampleIndex()}clear(){return this.XC().clear(),this.Rs.Ms(),this}setMaxSampleCount(t){return this.XC().setMaxSampleCount(t),this.Rs.Ms(),this}getMaxSampleCount(){return this.XC().getMaxSampleCount()}readBack(t){return this.XC().readBack(t)}onMaxSampleCountExceeded(t){return this.XC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.XC().offMaxSampleCountExceeded(t)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){let i=ma(e);void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.qC(),r=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}),n=s.hd(r,i,this.scale,this.chart._g);if(void 0!==n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,series:this,axisX:this.axisX,axisY:this.axisY}}Ki(t,e){const i=this.getDataSet(),s=null==t?void 0:t.dataPoint;return void 0===i.Kc()||s?s?{cursorPosition:{resultTable:s,resultTableScale:this.scale,pointMarker:s,pointMarkerScale:{x:this.axisX,y:this.axisY}},...s,series:this,axisX:this.axisX,axisY:this.axisY}:void 0:Ve({series:this,axisX:this.axisX,axisY:this.axisY},{x:0,y:0,cursorPosition:0,id:0,rotation:0,size:0,color:0,lookupValue:0,multiHit:0,iSample:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}qC(){return this.XC()}qd(){return Ae(this.getPointFillStyle())||Ae(this.getStrokeStyle().getFillStyle())||Ae(this.getAreaFillStyle())}Av(){var t;const e=null===(t=this.Sd)||void 0===t?void 0:t.Gt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.bc>0}CM(t){}getXMax(){return this.qa.St()}getXMin(){return this.qa.vt()}getYMax(){return this.qa.bt()}getYMin(){return this.qa.xt()}Lr(){return{x:this.qa.Pl(),y:this.qa.Dl()}}Cv(){var t;super.Cv();const e=qr(null!==(t=this.fs())&&void 0!==t?t:"ProgressiveX");this.qa.tk("x"===e?0===this.xAxis.mg?"bottom":"top":0===this.yAxis.mg?"left":"right")}XC(){if(!this.Sd){const t=new So(this.io);t.Fc&&this.chart.cs.Jn(Sh.Lf),t.Pc&&this.chart.cs.Jn(Sh.Bf),this.Sd=Be(t,this.Sd,(()=>[t.rd((()=>{this.YC+=1,this.YC>1&&this.chart.cs.Jn(Sh.Df),this.chart.cs.Ms()})),t.nd((()=>{this.chart.cs.Ms()}))])),this.qa.xd(t)}return this.Sd.Gt}styleLegendEntry(t,e=!1){const i=this.getPointFillStyle(),s=this.getAreaFillStyle();pe(t,this.ts,e,{stroke:this.getStrokeStyle(),fill:i!==_?i:s,behavior:{priority:"stroke"}})}Bs(){return this.ws||this.getPointShape()}Oe(t,e){t.ds(e),this.Rs.Ms()}}const Mc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.At.it(e),t.axis.xg.it(i)})))),Cc=u(10,10);var Tc;e.AxisPosition=void 0,(Tc=e.AxisPosition||(e.AxisPosition={}))[Tc.Top=0]="Top",Tc[Tc.Bottom=1]="Bottom",Tc[Tc.Left=2]="Left",Tc[Tc.Right=3]="Right";const wc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Ec=t=>t.setStopped(!0),kc=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Ic=(t,e)=>{const i="linear-highPrecision"===t.Wh.type||"linear-highPrecision"===e.Wh.type,s="logarithmic"===t.Wh.type||"logarithmic"===e.Wh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Wh.type}, y: ${e.Wh.type})`;throw new Error(i)}};var zc,Fc,Rc;!function(t){t[t.seriesBackground=0]="seriesBackground",t[t.gridLine0=1]="gridLine0",t[t.gridLine1=2]="gridLine1",t[t.gridLine2=3]="gridLine2",t[t.highlightersBelow=4]="highlightersBelow"}(zc||(zc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Fc||(Fc={}));class Dc extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("chartXY bg",0),r,i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.chartXYTitleFont,i.cs.ts.chartXYTitleFillStyle,h),this.ik=this.mp.d2({scaleXYConstructor:Yi}),this.tp=[],this.ip=[],this.ep=[],this.sp=[],this.sk=new Map,this.ek=!0,this.hk=!0,this.rk=!0,this.Zf=2,this.nk=!0,this.ak=!0,this.lk=[],this.uk=this.Rp.Ee(this.ik).Re(_).Le(ut).setMouseInteractions(!1),this.ck=this.Rp.He(this.ik).Ye(ut).setMouseInteractions(!1),this.dk=this.Rp.He(this.ik).Ye(ut).setMouseInteractions(!1),this.fk=this.ts.chartXYZoomingRectangleFillStyle,this.Ak=this.ts.chartXYZoomingRectangleStrokeStyle,this.gk=this.ts.chartXYFittingRectangleFillStyle,this.pk=this.ts.chartXYFittingRectangleStrokeStyle,this.yk=e.MouseStyles.Default,this.mk=e.MouseStyles.Move,this.vk=e.MouseStyles.ZoomIn,this.Sk=e.MouseStyles.Default,this.xk=void 0,this.AA=Pc,this.wM=0,this.bk=(t,e,i)=>{const s=t.solveNearest(e,i);return s&&ti(s.cursorPosition.pointMarker.x,s.axisX.getInterval().start,s.axisX.getInterval().end)&&ti(s.cursorPosition.pointMarker.y,s.axisY.getInterval().start,s.axisY.getInterval().end)?s:void 0},this.Mk=Mc(this.ip,this.tp),this._k=Mc(this.ep,this.sp),this.wk=(t,e,i,s,r)=>{this.Mk(s,r),this._k(r,s),this.ik.it(s,r),this.cs.Ms()},this.Ck=(t,e)=>{this.sk.set(t,e)},this.gg=t=>{const e=this.ip.findIndex((e=>e.axis===t)),i=this.tp.findIndex((e=>e.axis===t)),s=this.ep.findIndex((e=>e.axis===t)),r=this.sp.findIndex((e=>e.axis===t));e>=0&&this.ip.splice(e,1),i>=0&&this.tp.splice(i,1),s>=0&&this.ep.splice(s,1),r>=0&&this.sp.splice(r,1),this.sk.delete(t),this.cs.Ms()},this.addAreaSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Ic(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Nu.Positive)(this,this.Wv,this.lb,e,i,this.kk(e),this.kk(i),this.xp,s,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length);return this.jv(r),r},this.addAreaRangeSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Ic(e,i);const s=new Uu(this,this.Wv,this.lb,e,i,this.kk(e),this.kk(i),this.xp,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length);return this.jv(s),s},this.Tk=!1,this.Fk=!1,this.kM=()=>{(this.ek||this.hk)&&(this.xk=this.engine.setMouseStyle(this.yk))},this.TM=()=>{this.Tk=!1,this.engine.restoreMouseStyle(this.xk)},this.FM=(t,e,i)=>{var s,r;const n=Vt(null===(s=this.CA.so)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Vt(null===(r=this.CA.so)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.xk);const h=this.Rp.cs.Ne(e.clientX,e.clientY);i===n&&(this.ek||this.hk)?(this.Ik(t,h),se(e)):i===o&&this.nk&&(this.xk=this.engine.setMouseStyle(this.mk),this.Fk=!0,se(e))},this.Sv=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Vt(null===(n=this.CA.so)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Vt(null===(o=this.CA.so)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.ek||this.hk)?(this.Pk(t,s,h),se(e)):i===l&&this.nk&&(this.Dk(mi(r,-1)),se(e)),this.cs.Ms()},this.xv=(t,e,i,s)=>{var r,n;const o=Vt(null===(r=this.CA.so)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Vt(null===(n=this.CA.so)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.ek||this.hk)){const i=u(e.clientX,e.clientY);this.Bk(t,s,i),se(e)}else i===h&&this.nk&&se(e);this.engine.restoreMouseStyle(this.xk),this.$v.getIsUnderMouse()&&(this.xk=this.engine.setMouseStyle(this.yk)),this.Tk=!1,this.Fk=!1},this.vv=(t,e)=>{if(this.rk){const t=this.Rp.cs.Ne(e.clientX,e.clientY);this.Lk(t,u(be(e),be(e))),se(e)}},this.Rk=(t,e,i,s)=>{},this.Ek=(t,e,i,s,r,n)=>{if(this.nk){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.Dk(t),se(n),this.Fk=!0}if(this.rk){const t=this.cs.Uo({clientX:e.x,clientY:e.y}),o=this.cs.Uo({clientX:i.x,clientY:i.y}),h=pi(u(Math.abs(t.engineX-s.x-(o.engineX-r.x)),Math.abs(t.engineY-s.y-(o.engineY-r.y))),u(Math.abs(t.engineX-o.engineX),Math.abs(t.engineY-o.engineY)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.yt(t.At.pi(t.getInterval().start,-h.x),t.At.pi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.yt(t.At.pi(t.getInterval().start,-h.y),t.At.pi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),se(n),this.Tk=!0}},this.zk=(t,e,i,s)=>{this.Fk=!1,this.Tk=!1},this.Vk=(t,e,i)=>{(this.hk||this.ek)&&(this.Ik(t,e),se(i))},this.Ok=(t,e,i,s,r)=>{(this.hk||this.ek)&&(this.Pk(t,e,i),se(r))},this.Nk=(t,e,i,s)=>{(this.hk||this.ek)&&(this.Bk(t,e,i),se(s))},this.cs.Jn(Sh.kf),this.setPadding({right:24}),this.Gk=i.Lx("chartXY series bg",zc.seriesBackground),this.Uk=[zc.gridLine0,zc.gridLine1,zc.gridLine2].map((t=>i.Wk(`chartXY gridline #${t}`,t))),this.dg=i.Wk("chartXY highlighters below",zc.highlightersBelow),this.lb=i.tm("chartXY plotting",Fc.plotting),this.Ag=i.tm("chartXY highlighters above",Fc.highlightersAbove),this.EA=i.tm("chartXY fg",Fc.fg),this.ik.x.q(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.Ia.left+this.Ia.right)),this.ik.y.q(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.Ia.bottom+this.Ia.top)),this.ik.it(this.uiScale.oi().x,this.uiScale.oi().y),this.$v=this.Gk.Ee(this.ik).Re(this.ts.chartXYSeriesBackgroundFillStyle).Le(ut),this.Xv=this.EA.Ee(this.ik).Re(_).Le(this.ts.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Hv(this.$v,this.Xv),this.setSeriesBackgroundEffect(!1);const a=Vt(o?o.cursorBuilder:void 0,pc),l=i.sm();this.hm=pa(this,l,a._y(l,this.ik,this.ik,Ot,this.ts),this,"show-all",Bc,((t,e)=>{const i=this.translateCoordinate(t,{x:t.axisX,y:t.axisY},this.coordsClient);return Math.sqrt((i.clientX-e.clientX)**2+(i.clientY-e.clientY)**2)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.wk),this.Ch.Sr("ChartXY"),this.bv=ns(new hs(this.Vk,this.Ok,this.Nk,1),new as(this.Rk,this.Ek,this.zk)),this.onSeriesBackgroundMouseEnter(this.kM),this.onSeriesBackgroundMouseLeave(this.TM),this.onSeriesBackgroundMouseWheel(this.vv),this.onSeriesBackgroundMouseDragStart(this.FM),this.onSeriesBackgroundMouseDrag(this.Sv),this.onSeriesBackgroundMouseDragStop(this.xv),this.onSeriesBackgroundTouchStart(this.bv.onTouchStart),this.onSeriesBackgroundTouchMove(this.bv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.bv.onTouchEnd),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.Dp(n,this.ik)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.hm.solveNearest(t,e,this.Gv,this.bk)}addCursor(t=pc){const e=this.xp(),i=t._y(e,this.ik,this.ik,this.pp(e),this.ts);return i.vC=!0,this.Fp(i),i}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.Ia.left+this.Ia.right,t.y+=this.Xt.top+this.Xt.bottom+this.Ia.top+this.Ia.bottom;const e=this.Ch.Os().od(),i=S(Oc(this.AA||Pc),this.Lp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Yk&&(t.x+=this.Yk.left,t.x+=this.Yk.right,t.y+=this.Yk.top,t.y+=this.Yk.bottom),t.x+=Cc.x,t.y+=Cc.y,t}addAxisX(t){var e,i;const{opposite:s,type:r}=Ji(t);let n;n="linear"===r.type?this.mp.d1({dimension:"x",scale1DConstructor:Gi}):"linear-highPrecision"===r.type?this.mp.d1({dimension:"x",scale1DConstructor:Gi}).Mi():this.mp.d1({dimension:"x",scale1DConstructor:Fi}).Ai(r.base),n.it(this.ik.x.oi());const o=s?this.tp:this.ip,h=new bh(this.Uk,this.EA,this.Rp,this.dg,this.Ag,this.cs.hs,n,this.ik.y,(a=()=>h.Ng(),{...Ch,...fc(a)}),this,s?100:0,this.gg,this.Ck,this.ts,this.ph,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iStack:u,iParallel:l}),this.cs.Ms(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=Ji(t);let n;n="linear"===r.type?this.mp.d1({dimension:"y",scale1DConstructor:Gi}):"linear-highPrecision"===r.type?this.mp.d1({dimension:"y",scale1DConstructor:Gi}).Mi():this.mp.d1({dimension:"y",scale1DConstructor:Fi}).Ai(r.base),n.it(this.ik.y.oi());const o=s?this.sp:this.ep,h=new bh(this.Uk,this.EA,this.Rp,this.dg,this.Ag,this.cs.hs,n,this.ik.x,(a=()=>h.Ng(),{...Th,...gc(a)}),this,s?100:0,this.gg,this.Ck,this.ts,this.ph,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iParallel:l,iStack:u}),this.cs.Ms(),h}swapAxes(t,e){const i=[this.ip,this.ep,this.sp,this.tp],s=i.find((e=>void 0!==e.find((e=>e.axis===t)))),r=i.find((t=>void 0!==t.find((t=>t.axis===e))));if(!s||!r)return this;if(s!==r)throw new Error("LightningChart JS ChartXY.swapAxes does not support swapping Axes that are on different sides.");const n=s.find((e=>e.axis===t)),o=s.find((t=>t.axis===e));if(!n||!o)return this;const h=n.iParallel,a=n.iStack;return n.iParallel=o.iParallel,n.iStack=o.iStack,o.iParallel=h,o.iStack=a,this.cs.Ms(),this}dispose(){return this.hm.Y(),this.Gk.Y(),this.lb.Y(),this.EA.Y(),this.Uk.forEach((t=>t.Y())),this.Ag.Y(),this.dg.Y(),this.zC().forEach((t=>t.dispose())),ua(this.ik),this.ip.slice().forEach((t=>t.axis.dispose())),this.ep.slice().forEach((t=>t.axis.dispose())),this.sp.slice().forEach((t=>t.axis.dispose())),this.tp.slice().forEach((t=>t.axis.dispose())),this.Gv.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.ip,...this.tp].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}getDefaultAxisY(){var t;return null===(t=[...this.ep,...this.sp].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):wc;return Bt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.tp.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis));case e.AxisPosition.Bottom:return this.ip.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis));case e.AxisPosition.Left:return this.ep.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis));case e.AxisPosition.Right:return this.sp.slice().sort(((t,e)=>t.iStack-e.iStack)).map((t=>t.axis))}})))}Hk(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.ip.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.tp.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.ep.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.sp.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.AA=t,this.cs.Ms(),this}getTitlePosition(){return this.AA}$k(t,e,i,s){const r=this.AA||Pc;let n,o=S(Oc(r),this.Lp);this.getTitleFillStyle()===_||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.Ch.Os().od();const h=Math.abs(s)+this.Ia.bottom+this.Xt.bottom,a=Math.abs(i)+this.Ia.top+this.Xt.top,l={left:Math.abs(t)+this.Ia.left+this.Xt.left,right:Math.abs(e)+this.Ia.right+this.Xt.right,top:a,bottom:h},u=this.uiScale.Ui(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Lc(r,u,l,n,o,this.Ia);return this.Ch.Ve(f).Ha(c).Xa(d),g}ze(t){super.ze(t);for(const t of this.Gv)t.Cv();for(const t of this.Gv)t.ze();const e=Ee(this.Gv.map((t=>t.la()))),i=new Set(e.map((t=>t.Xk)));if(1===i.size){const t=Array.from(i)[0],s="x"===t?[this.ip,this.tp]:[this.ep,this.sp],r="y"===t?[this.ip,this.tp]:[this.ep,this.sp];s.forEach((t=>t.forEach((t=>t.axis.Rr())))),e.forEach((t=>t.jk())),r.forEach((t=>t.forEach((t=>t.axis.Rr()))))}else this.ep.forEach((t=>t.axis.Rr())),this.ip.forEach((t=>t.axis.Rr())),this.tp.forEach((t=>t.axis.Rr())),this.sp.forEach((t=>t.axis.Rr()));const s=this.ep.map((t=>t.axis.Os())),r=this.ip.map((t=>t.axis.Os())),n=this.tp.map((t=>t.axis.Os())),o=this.sp.map((t=>t.axis.Os()));let h=!1;this.forEachAxis((t=>{(t.Or()||t.Nr())&&(h=!0)}));const a=this.Tk||this.Fk||!this.ak&&h,l=new Set(this.getAxes().map((t=>t.getStackIndex()))).size>1;this.hm.ze(a,l?this.Gv.sort(((t,e)=>e.axisY.getStackIndex()-t.axisY.getStackIndex())):this.Gv,this.bk,{afterCursorPointedAt:t=>{const e=this.cs.Zn();if(t.length>1&&e){const t=this.cs.Uo(e);this.hm.Hp.xy({x:t.engineX,y:t.engineY},this.cs.At)}},overrideCursorPositions:(t,e)=>t.map((t=>t.multiHit?t.multiHit.map((e=>({...t.cursorPosition,pointMarker:e}))):[t.cursorPosition])).flat()});const c=_c(this.ep,s),d=_c(this.ip,r),f=_c(this.tp,n),g=_c(this.sp,o),m=this.$k(c.thicknessTotal,g.thicknessTotal,f.thicknessTotal,d.thicknessTotal),p=this.ik.x.getCellSize()-(m.left+m.right),A=this.ik.y.getCellSize()-(m.bottom+m.top),x=[m.left,m.right],S=[m.bottom,m.top];this.ik.x.q(0,p),this.ik.y.q(0,A),this.ik.x.si(x),this.ik.y.si(S);const v=(t,e,i,s)=>{let r=0;t.groups.forEach((t=>{let n=0;const o=t.stacks.reduce(((t,e)=>Math.max(t,e.Wg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.pA+e.axis.yA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Zd?e.axis.Zd.pixels:0)),0),l=e-h-a;t.stacks.forEach((s=>{const h=s.axis,a=h.getVisible(),u=Math.max(e-n,0),c=Math.min(a?"pixels"in h.Zd?h.Zd.pixels:h.Zd.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.pA:0,f=a?i[1]+(e-n)-c-h.pA:0;h.At.si([d,f]),h.ze({Wg:o,Yg:s.Yg,Xg:c,Zk:n,qg:o+s.Yg,Zg:r}),a&&(n+=c+h.pA+h.yA)})),r+=s*t.thicknessMax}))};v(c,A,S,-1),v(g,A,S,1),v(d,p,x,-1),v(f,p,x,1),this.Yk={left:c.thicknessTotal,top:f.thicknessTotal,right:g.thicknessTotal,bottom:d.thicknessTotal},this.$v.Ve(u(0,0)).it(u(p,A)),this.Xv.Ve(u(0,0)).it(u(p,A));const b=y(this.ik.x.ei(),this.ik.y.ei(),this.ik.x.ri(),this.ik.y.ri());this.lb.wx(b),this.dg.wx(b),this.Ag.wx(b),this.cp&&this.cp(),super.Pp(),this.ip.forEach((t=>t.axis.hp())),this.tp.forEach((t=>t.axis.hp())),this.ep.forEach((t=>t.axis.hp())),this.sp.forEach((t=>t.axis.hp()));for(const t of this.Gv)t.Pm()}J(){for(let t=0;t=10;h&&c&&l.x===r.x&&this.hk?(this.Tk=!0,this.uk.Re(this.gk).Le(this.pk),this.ck.Ye(this.pk).Xe(r).$e(o),this.dk.Ye(this.pk).Xe(u(r.x,o.y)).$e(u(o.x,r.y)),this.xk=this.engine.setMouseStyle(this.Sk,this.xk)):h&&c&&(this.ek||this.hk)?(this.Tk=!0,this.uk.Re(this.fk).Le(this.Ak),this.ck.Ye(ut),this.dk.Ye(ut),this.xk=this.engine.setMouseStyle(this.vk,this.xk)):(this.Tk=!1,this.uk.Le(ut).Re(_),this.ck.Ye(ut),this.dk.Ye(ut),this.engine.restoreMouseStyle(this.xk)),this.cs.Ms()}Bk(t,e,i){if(this.Tk){const t=this.cs.Uo({clientX:i.x,clientY:i.y}),s=yt({x:t.engineX,y:t.engineY},this.Rp.cs.At,this.ik),r=ti(s.x,this.ik.x.getInnerStart(),this.ik.x.getInnerEnd())&&ti(s.y,this.ik.y.getInnerStart(),this.ik.y.getInnerEnd()),n=i.x>=e.x||!this.hk?"zoom":"fit",o=this.uk.Ua(),h=yi(o,this.uk.oi()),a=Math.min(this.uk.oi().x,this.uk.oi().y)>=10;r&&a&&"zoom"===n&&this.ek?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=yt(o,this.ik,t.bg).x,i=yt(h,this.ik,t.bg).x;t.yt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=yt(o,this.ik,t.bg).y,i=yt(h,this.ik,t.bg).y;t.yt(e,i,!0,!0,"interactionSetInterval")}}))):r&&a&&"fit"===n&&this.hk&&this.forEachAxis(kc)}this.uk.Le(ut).Re(_),this.ck.Ye(ut),this.dk.Ye(ut),this.cs.Ms()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}Dk(t){this.forEachAxisX((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.y)}))}zoom(t,e){this.forEachAxis(Ec),this.forEachAxisX((i=>{i.zoom(i.At.dt(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.At.dt(t.y),e.y)}))}Lk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Ec(i),i.zoom(i.At.dt(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Ec(i),i.zoom(i.At.dt(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}af(){const t=[];return this.forEachAxis((e=>e.Eg((e=>t.push(e))))),super.af().concat(t)}zC(){return this.lk}we(){return this.Vp(this.lb)}setCursorEnabledDuringAxisAnimation(t){return this.ak=t,this}getCursorEnabledDuringAxisAnimation(){return this.ak}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=wh(r)?r:$i(r)?this._g:void 0;if(n&&Wi(i)){const t=yt(s,n,this.cs.At);return this.cs.Wo({engineX:t.x,engineY:t.y})}if(n&&$i(i))return yt(s,n,this._g);if(n&&wh(i))return yt(s,n,i)}else{const i=t;if($i(e)){const t=this.cs.Uo(i);return yt({x:t.engineX,y:t.engineY},this.cs.At,this._g)}if(wh(e)){const t=e,s=this.cs.Uo(i);return yt({x:s.engineX,y:s.engineY},this.cs.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(Rc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Rc.RightTop="right-top",Rc.LeftTop="left-top",Rc.CenterBottom="center-bottom",Rc.RightBottom="right-bottom",Rc.LeftBottom="left-bottom",Rc.SeriesCenterTop="series-center-top",Rc.SeriesRightTop="series-right-top",Rc.SeriesLeftTop="series-left-top",Rc.SeriesCenterBottom="series-center-bottom",Rc.SeriesRightBottom="series-right-bottom",Rc.SeriesLeftBottom="series-left-bottom";const Pc=e.ChartXYTitlePositionOptions.CenterTop,Oc=t=>{switch(t){case"center-top":case"series-center-bottom":return{left:0,right:0,top:0,bottom:5};case"left-top":return{left:20,right:0,top:0,bottom:5};case"right-top":return{left:0,right:20,top:0,bottom:5};case"center-bottom":return{left:0,right:0,top:0,bottom:0};case"left-bottom":return{left:20,right:0,top:0,bottom:0};case"right-bottom":return{left:0,right:20,top:0,bottom:0};case"series-center-top":return{left:0,right:0,top:5,bottom:0};case"series-left-top":return{left:5,right:0,top:5,bottom:0};case"series-right-top":return{left:0,right:5,top:5,bottom:0};case"series-left-bottom":return{left:5,right:0,top:0,bottom:5};case"series-right-bottom":return{left:0,right:5,top:0,bottom:5}}return ze(0,`Unexpected ChartXY title position selection ${t}`)},Lc=(t,e,i,s,r,n)=>{s.x,r.left,r.right;const o=s.y+r.bottom+r.top,h=(r.left-r.right)*e.x,a=(r.bottom-r.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-(n.top+r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i}}return ze(0,`Unexpected ChartXY title position selection ${t}`)},_c=(t,e)=>{const i=[];t.forEach(((t,s)=>{const r=e[s],n=i.find((e=>e.iParallel===t.iParallel));n?(n.stacks.push({...t,...r}),n.stacks.sort(((t,e)=>t.iStack-e.iStack))):i.push({iParallel:t.iParallel,stacks:[{...t,...r}]})}));const s=i.map((t=>{const e=t.stacks.reduce(((t,e)=>Math.max(t,e.Wg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Yg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Qd)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Zd?e.axis.Zd.relative:0)),0);return{...t,ticksSizeMax:e,titleSizeMax:i,sumRelativeSize:r,thicknessMax:s}}));return s.sort(((t,e)=>t.iParallel-e.iParallel)),{groups:s,thicknessTotal:s.reduce(((t,e)=>t+e.thicknessMax),0)}},Bc=(t,e,i)=>{var s;const r=Array.from(new Set(i.map((t=>t.series.fs())))),n=1===r.length&&void 0!==r[0]?r[0]:void 0,o="ProgressiveY"===n||"RegressiveY"===n?{progressiveDimension:"Y",progressiveAxis:e.axisY,valueDimension:"X",hitValueAxis:t=>t.axisX,value:t=>t.x,position:t=>t.y}:{progressiveDimension:"X",progressiveAxis:e.axisX,valueDimension:"Y",hitValueAxis:t=>t.axisY,value:t=>t.y,position:t=>t.x},h=o.progressiveAxis.getTickStrategy();return At(e)?ya(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Ki(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Ki(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:Ki(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):1===i.length?"Time"===h||"DateTime"===h?e.multiHit?[[Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...ya(e,[[e.series,""],[`${o.valueDimension}1`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:[[Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...ya(e,[[e.series,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:e.multiHit?ya(e,[[e.series],[o.progressiveDimension,"",{text:Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[`${o.valueDimension}1`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]]):ya(e,[[e.series],[o.progressiveDimension,"",{text:Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:Ki(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]]):n?[Ki(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),...i.map((t=>t.multiHit?ya(t,[[t.series,""],[`${o.valueDimension}1`,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t.multiHit[0])),o.hitValueAxis(t)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t.multiHit[1])),o.hitValueAxis(t)),font:{weight:"bold"}}]]):ya(t,[[t.series,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()]:i.map((t=>ya(t,[[t.series],[o.progressiveDimension,"",{text:Ki(o.progressiveAxis.formatValue(o.position(t)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:Ki(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()};class Vc{constructor(t,e,i,s,n,o,h){this.coordsRelative="relative",this.coordsClient="client",this.R=new r.Eventer,this.Qk=[],this.Jk=new Map,this.Gv=new Map,this.Kk=(t,e,i)=>{0!==this.Gv.size&&void 0!==[...this.Gv.values()].find((({series:t})=>!0===t.getVisible()))||this.qk.yt(e,i,!1,!1,"zoomBandChart"),this.tT.cs.Ms()},e.cs.Jn(Sh.wf),this.CA=t,this.iT=(null==o?void 0:o.orientation)||"x",this.sT=void 0!==(null==o?void 0:o.useSharedValueAxis)&&o.useSharedValueAxis,this.eT=s,this.qu="x"===this.iT?Ch:Th;const a={...o,defaultAxisX:this.qu.getWidth({x:null==o?void 0:o.defaultAxis,y:void 0}),defaultAxisY:this.qu.getHeight({x:null==o?void 0:o.defaultAxis,y:void 0})};this.tT=new Dc(t,e,i,Ot,n,a,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setCursorMode(void 0),this.engine=this.tT.engine;const l=this.tT.getDefaultAxisX().setMouseInteractions(!1),u=this.tT.getDefaultAxisY().setMouseInteractions(!1);this.qk=this.qu.getWidth({x:l,y:u}).setScrollStrategy(Ks.fitting).setAnimationScroll(!1).setStrokeStyle(ut).setTickStrategy(Js.Empty),(null==o?void 0:o.useSharedValueAxis)?this.hT=this.qu.getHeight({x:l,y:u}):this.qu.getHeight({x:l,y:u}).dispose();const c=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new N({color:this.getTheme().isDark?C(0,0,0,180):C(255,255,255,180)});this.rT=[this.tT.EA.Ee(this.qk.bg).Re(c).Le(ut),this.tT.EA.Ee(this.qk.bg).Re(c).Le(ut)];const d=this.tT.EA.Qg(this.qk.bg).Ye(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.nT={collection:d,members:new Array(5).fill(0).map((t=>d.Zr()))};const f=this.getTheme(),g="function"==typeof f.zoomBandChartKnobFillStyle?It({resourcesBaseUrl:this.CA.te,styleFactory:f.zoomBandChartKnobFillStyle,apply:t=>this.setKnobFillStyle(t)}):f.zoomBandChartKnobFillStyle||_;this.oT=[this.tT.EA.Ee(this.tT._g).Re(g).Le(ut),this.tT.EA.Ee(this.tT._g).Re(g).Le(ut)],this.aT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.lT()}add(t){var e,i,s,r,n;const o=this.Qk.map((t=>t.axis)),h="x"===this.iT?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Kk);this.Qk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.qk.ar(h.nr()),this.uT&&this.uT.remove(),this.uT=pt(...this.Qk.map((t=>t.axis)))}const a=this.qu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.sT)l=this.hT;else{const t=this.Jk.get(a);t?l=t:(l=this.qu.getHeight({x:this.tT.addAxisX.bind(this.tT),y:this.tT.addAxisY.bind(this.tT)})(),this.cT(l)),this.Jk.set(a,l)}const u=this.qu.getWidth({x:this.qk,y:l}),c=this.qu.getHeight({x:this.qk,y:l});let d;const f=[],g=(t,e)=>{const i=t=>{if(0!==t.length)if("x"in t[0]){const i=t;e.add(i)}else{const i=t,s=[];for(let t=0;ti(e)));f.push((()=>t.KM(r)));const n=t.qM((()=>e.clear()));f.push((()=>{t.t_(n)}))};if(t instanceof bc)d=this.tT.addPointLineAreaSeries({...t.io,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setPointAlignment(t.getPointAlignment()).setPointRotation(t.getPointRotation()).setPointShape(t.getPointShape()).setPointSize(t.getPointSize()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.qC());else if(t instanceof xc||t instanceof lc){const i=this.tT.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof xc?null===(e=t.io)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof xc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Gc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof Bu){const e=this.tT.addAreaSeries({xAxis:u,yAxis:c,baseline:t.ew}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof Sc){const e=this.tT.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.io)||void 0===i?void 0:i.pointShape}).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ac){const e=this.tT.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.io)||void 0===s?void 0:s.pointShape,mode:t.Cw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof qu){const e=this.tT.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.io)||void 0===r?void 0:r.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ju){const e=this.tT.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.io)||void 0===n?void 0:n.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Uu){const e=this.tT.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.QM()),i=t.JM(((t,i)=>e.add(i)));f.push((()=>t.KM(i))),d=e;const s=t.qM((()=>e.clear()));f.push((()=>{t.t_(s)}))}else{if(!(t instanceof zu))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.tT.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.u_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.f_(d);const s=t.p_(((t,i)=>e.invalidateIntensityValues(i))),r=t.A_(i);f.push((()=>{t.y_(s),t.g_(r)}));const n=t.qM((()=>e.clear()));f.push((()=>{t.t_(n)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const y=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(y)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.Gv.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.Gv.get(t);if(e){const{clearReferences:i}=e;i(),this.Gv.delete(t),e.series.dispose();const s=this.qu.getHeight({x:t.axisX,y:t.axisY}),r=this.Jk.get(s);r&&0===r.Ng().length&&(this.Jk.delete(s),r.dispose())}const i="x"===this.iT?t.axisX:t.axisY;if(!Array.from(this.Gv.keys()).find((t=>i===("x"===this.iT?t.axisX:t.axisY)))){const t=this.Qk.findIndex((t=>t.axis===i));this.Qk[t].deattach(),this.Qk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.rT.forEach((e=>e.Re(t))),this.tT.cs.Ms(),this}getDefocusOverlayFillStyle(){return this.rT[0].Jh()}setSplitterStrokeStyle(t){return this.nT.collection.Ye(t),this.tT.cs.Ms(),this}getSplitterStrokeStyle(){return this.nT.collection.xu()}setKnobFillStyle(t){return this.oT.forEach((e=>e.Re(t))),this.tT.cs.Ms(),this}getKnobFillStyle(){return this.oT[0].Jh()}setKnobStrokeStyle(t){return this.oT.forEach((e=>e.Le(t))),this.tT.cs.Ms(),this}getKnobStrokeStyle(){return this.oT[0].So()}setKnobSize(t){return this.aT=t,this.tT.cs.Ms(),this}getKnobSize(){return this.aT}getDefaultAxisX(){return this.tT.getDefaultAxisX()}getDefaultAxisY(){return this.tT.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}cT(t){t.setTickStrategy(Js.Empty).setMouseInteractions(!1).setNibStyle(ut).setStrokeStyle(ut)}lT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.iT?null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Gv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.qk.getInterval();Math.abs(this.qk.At.ft(t)-this.qk.At.ft(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(h.start,h.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.qu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const n="x"===this.iT?null===(e=Array.from(this.Gv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.qu.getWidth(this.tT.translateCoordinate(t,this.tT.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),se(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=ns(new hs(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.tT.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.tT.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.iT?null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Gv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.qk.At.pi(o.start,this.qu.getWidth(t)),a=this.qk.At.pi(o.end,this.qu.getWidth(t));i(h,a,!1),se(e)};this.tT.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=ns(new hs(void 0,((t,e,i,r,n)=>s(r,n))));this.tT.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.iT?null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Gv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.qk.getInterval(),a=this.qu.getWidth(this.tT.translateCoordinate(e,this.tT.coordsAxis)),l=this.qk.At.ft(o.start),u=this.qk.At.ft(o.end),c=this.qk.At.ft(a),d=_t((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Zf,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),y=_t(this.qk.At.pi(o.start,g),h.start,h.end),p=_t(this.qk.At.pi(o.end,m),h.start,h.end);i(y,p,!1),se(e)})),this.tT.onSeriesBackgroundTouchStart(r.onTouchStart),this.tT.onSeriesBackgroundTouchMove(r.onTouchMove),this.tT.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.rT.forEach(((s,r)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const r="x"===this.iT?null===(e=Array.from(this.Gv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Gv.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.qu.getWidth(this.tT.translateCoordinate(t,this.tT.coordsAxis)),o=r.getInterval(),h=this.qk.getInterval(),a=_t(n-(o.end-o.start)/2,Math.min(h.start,h.end),Math.max(h.start,h.end)-Math.abs(o.end-o.start)),l=a+(o.end-o.start);i(a,l,!0),se(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=ns(new class{constructor(t,e=300){this.Ns=!1,this.Gs=[],this.Us=300,this.Ws=t,this.Us=e}Vs(t,e){const i=zt.performance.now();let s=!1;for(let t=0;t=this.Us?(this.Gs.splice(t,1),t-=1):this.Gs[t].state&&(s=!0);return this.Ns?0===e.interactions.length&&(this.Gs.push({state:!1,time:i}),this.Ns=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Gs.push({state:!0,time:i}),s=!0,this.Ns=!0),s}Os(t,e,i){if(i&&!this.Ns){const i=this.Gs.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Ws(t,e),this.Gs.length=0)}}}(((t,e)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.tT.getSizePixels()}onResize(t){return this.tT.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.tT.offResize(t)}Gr(t){this.tT.Gr(t)}getMinimumSize(){return this.tT.getMinimumSize()}J(){return this.tT.J()}K(){return this.tT.K()}ze(t){var e,i,s,r;const n=we(Array.from(this.Gv.keys()).map((t=>t.chart))),o="x"===this.iT?null===(e=Array.from(this.Gv.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.Gv.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.iT){const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(0!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),e=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(100!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=n.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.tT.forEachAxisY((t=>t.setThickness(0))),null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.tT.setPadding({left:i+(0===n.length?10:0),right:r+e+(0===n.length?10:0)})}else{const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisX((t=>{if(0!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),e=n.reduce(((t,e)=>{const i=[];e.forEachAxisX((t=>{if(100!==t.mg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.rp())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=n.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.tT.forEachAxisX((t=>t.setThickness(0))),null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.tT.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.tT.ze(t);const h=this.qk.getInterval().start,a=this.qk.getInterval().end,l=_t(o?o.getInterval().start:h,h,a),u=_t(o?o.getInterval().end:a,h,a),c=this.qu.getHeight(this.tT.ik.getInnerIntervalPixels());this.rT[0].Ve(this.qu.toPoint(h,0)).it(this.qu.toPoint(l-h,c)),this.rT[1].Ve(this.qu.toPoint(u,0)).it(this.qu.toPoint(a-u,c)),this.nT.members[0].Kg(this.qu.toPoint(h,c),this.qu.toPoint(l,c)),this.nT.members[1].Kg(this.qu.toPoint(l,c),this.qu.toPoint(l,0)),this.nT.members[2].Kg(this.qu.toPoint(l,0),this.qu.toPoint(u,0)),this.nT.members[3].Kg(this.qu.toPoint(u,0),this.qu.toPoint(u,c)),this.nT.members[4].Kg(this.qu.toPoint(u,c),this.qu.toPoint(a,c));const d=yt(this.qu.toPoint(l,c/2),this.qk.bg,this.tT._g),f=yt(this.qu.toPoint(u,c/2),this.qk.bg,this.tT._g),g=this.aT;this.oT[0].Ve({x:d.x-g.x/2,y:d.y-g.y/2}).it({x:g.x,y:g.y}).sr(this.qu.getWidth({x:0,y:90})),this.oT[1].Ve({x:f.x-g.x/2,y:f.y-g.y/2}).it({x:g.x,y:g.y}).sr(this.qu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.tT.setSeriesBackgroundFillStyle(t),this.tT.cs.Ms(),this}getSeriesBackgroundFillStyle(){return this.tT.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.tT.setSeriesBackgroundStrokeStyle(t),this.tT.cs.Ms(),this}getSeriesBackgroundStrokeStyle(){return this.tT.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.tT.setSeriesBackgroundEffect(t),this.tT.cs.Ms(),this}getSeriesBackgroundEffect(){return this.tT.getSeriesBackgroundEffect()}getTheme(){return this.tT.getTheme()}setTitle(t){return this.tT.setTitle(t),this}getTitle(){return this.tT.getTitle()}setTitleFillStyle(t){return this.tT.setTitleFillStyle(t),this}getTitleFillStyle(){return this.tT.getTitleFillStyle()}setTitleFont(t){return this.tT.setTitleFont(t),this}getTitleFont(){return this.tT.getTitleFont()}setTitleMargin(t){return this.tT.setTitleMargin(t),this}getTitleMargin(){return this.tT.getTitleMargin()}setPadding(t){return this.tT.setPadding(t),this}getPadding(){return this.tT.getPadding()}setBackgroundFillStyle(t){return this.tT.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.tT.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.tT.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.tT.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return aa(t,e,i,this.tT._g,this.tT.cs)}addUIElement(t,e){return this.tT.addUIElement(t,e)}addLegendBox(t,e){return this.tT.addLegendBox(t,e)}getLegendBoxes(){return this.tT.getLegendBoxes()}saveToFile(t,e,i){return this.tT.saveToFile(t,e,i),this}dispose(){return this.tT.dispose(),this.Jk.clear(),this.Gv.clear(),this.eT(this),this}isDisposed(){return this.tT.isDisposed()}onDispose(t){return this.tT.onDispose((()=>t(this)))}offDispose(t){return this.tT.offDispose(t)}}const Gc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof xc||t instanceof Bu?t.getStrokeStyle().getFillStyle():t instanceof Sc||t instanceof ju?t.getPointFillStyle():void 0)(t);return e?new us({thickness:2,fillStyle:e}):void 0};class Nc extends ru{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Cs="Point Series",this.eM=[],this.hM=!1,this.lM=3,this.ka=0,this.Ie=ve(this.ts.polarPointSeriesFillStyle,o),this.Sd=new So({dataPattern:null}),this.qa=t._d(r).Ye(ut).Md(_).bd(this.Ie).wd(e.PointShape.Circle).Id(this.lM).ds(this.getHighlight()).xd(this.Sd),this.As(this.qa)}solveNearest(t,e="show-nearest"){const i=this.chart.translateCoordinate(t,this.chart.coordsAxis),s=nu([i],this.scale)[0],r=this.Sd.hd(s,ma(e),this.scale,this.chart._g);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.eM.length&&this.chart.cs.Jn(Sh.Df),this.eM=hu(t),this.hM=!0,this.Kb=ou(this.eM),this.Rs.Ms(),this}setPointAlignment(t){return this.qa.QC(t),this.chart.cs.Ms(),this}getPointAlignment(){return this.qa.JC()}setPointFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;return this.qa.bd(e),this.Rs.Ms(),this}getPointFillStyle(){return this.Ie}setPointSize(t){return this.lM=t,this.qa.Id(t),this.Rs.Ms(),this}getPointSize(){return this.lM}setPointShape(t){return this.qa.wd(t),this.chart.cs.Ms(),this}getPointShape(){return this.qa.Cd()}setPointRotation(t){return this.ka=t,this.qa.kd(t),this.Rs.Ms(),this}getPointRotation(){return this.ka}Av(){return this.yv&&this.eM.length>0&&this.getVisible()}Oe(t,e){t.ds(e),this.Rs.Ms()}ze(){if(this.hM||this.scale.aM()){const t=nu(this.eM,this.scale),e=ni(t);this.Sd.clear().add(t),this.qa.sa(e),this.hM=!1,this.qa.Os()}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}Bs(){return this.ws||this.getPointShape()}}class Uc{constructor(t,e,i,s){this.R=new r.Eventer,this.dT=!1,this.ae=t,this.fT=e,this.Gv=i,this.qa=s}setGeometry(t){return this.AT=t,this.dT=!0,this.ae.cs.Ms(),this}getGeometry(){return this.AT}setMouseInteractions(t){return this.qa.setMouseInteractions(t),this}dispose(){return this.qa.dispose(),this.fT(this),this.R.emit("dispose",this),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.qa.getVisible()!==t;return this.qa.setVisible(t),e&&this.R.emit("visibleStateChanged",this,t),this.ae.cs.Ms(),this}getVisible(){return this.qa.getVisible()}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Yc extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Polygon Series",this.gT=[],this.pT=[],this.yT=t=>{const e=this.pT.indexOf(t);e>=0&&this.pT.splice(e,1);const i=this.gT.findIndex((e=>e===t.qa));i>=0&&this.gT.splice(i,1),this.Rs.Ms()},this.Ie=ve(this.ts.polarPolygonSeriesFillStyle,n),this.Pe=ve(this.ts.polarPolygonSeriesStrokeStyle,n)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=Su(s,this.gT,((t,e)=>{const i=t.hd(e);if(i)return yt(i,this.scale,t.cs.At)}),ei);if(!r)return;const n=yt(r[0],r[1].cs.At,this.scale);if(!this.mT(r[1]))return;const o=au(n,this.scale);return{cursorPosition:{pointMarker:n,pointMarkerScale:this.scale,resultTable:n,resultTableScale:this.scale},series:this,...o}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}addPolygon(){const t=new Uc(this.chart,this.yT,this,this.vT());return this.pT.push(t),t}setFillStyle(t){this.Ie="function"==typeof t?t(this.Ie):t;const e=this.Ie;for(const t of this.gT)t.Re(e);return this.Rs.Ms(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){this.Pe="function"==typeof t?t(this.Pe):t;const e=this.Pe;for(const t of this.gT)t.Le(e);return this.Rs.Ms(),this}getStrokeStyle(){return this.Pe}Av(){return this.yv&&void 0!==this.pT.find((t=>void 0!==t.ST))&&this.getVisible()}ze(){this.pT.forEach((t=>{(t.dT||this.scale.aM())&&t.xT&&(t.qa.Fl(nu(t.xT,this.scale)),t.dT=!1,t.qa.Os())}))}Cv(){super.Cv();const t=m(Ye,He);this.pT.forEach((e=>{if(!e.AT)return;const i=!e.dT&&e.xT?e.xT:hu(e.AT);e.xT=i;const s=!e.dT&&e.ST?e.ST:ou(i);e.ST=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Kb=t}Oe(t,e){t.ds(e),this.Rs.Ms()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}vT(){const t=this.Rs.fc(this.scale,Tn.Simple).Re(this.Ie).Le(this.Pe).ds(this.getHighlight());return this.gT.push(t),this.As(t),t}mT(t){return this.pT.find((e=>e.qa===t))}}class Hc extends ru{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Area Series",this.eM=[],this.hM=!1,this.rM=!1,this.bT=!1,this.Ie=ve(this.ts.polarAreaSeriesFillStyle,n),this.Pe=ve(this.ts.polarAreaSeriesStrokeStyle,n)}setData(t){0!==this.eM.length&&this.chart.cs.Jn(Sh.Df);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie,stroke:this.Pe})}}class Xc extends Hc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.MT=this.Rs.fc(this.scale,Tn.Simple).ds(this.getHighlight()),this.As(this.MT)}solveNearest(t,e){const i=this.chart.cs.Uo(t),s={x:i.engineX,y:i.engineY},r=this.MT.hd(s);if(!r)return;const n=au(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Ve({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}ze(){if(this.hM||this.scale.aM()){const t=this.eM,e=!0===this.rM?nu(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Lt(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;!Lt(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._T.start}Hb(t){this.wT=t,this.IT=!0}Xb(){return!1===this.wT}$b(t){this.CT=t,this.IT=!0}Ub(){return this.CT}yi(){return this.Si}_i(){return!1}ct(t,e,i,s){return this.x=new Gi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Gi(t.y,e.y,i.y,s?s.y:void 0),this}mi(){return this.di}aM(){return this.FT}BT(){return this.IT}Ui(){return this.PT}J(){return this.u=!1,this.Si=!1,this.FT=!1,this.IT=!1,this}K(){return this.u=!0,this.Si=!0,this.FT=!0,this.IT=!0,this}it(t,e){return"object"==typeof t?(this.Z.x=t.x,this.Z.y=t.y):(this.Z.x=t,this.Z.y=e),this.DT(),this}Ei(t){return this.kT=t,this.DT(),this}zi(t){return this.TT=t,this.DT(),this}ni(){return u(this.kT[0]+this.kT[1],this.TT[0]+this.TT[1])}oi(){return this.Z}DT(){const t=this._T,e=u(this.x.ai(this.Z.x),this.y.ai(this.Z.y)),i=this.kT[0]+this.kT[1],s=this.TT[0]+this.TT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.kT[0]+Math.max((r-2*o)/2,0),this.kT[1]+Math.max((r-2*o)/2,0)],a=[this.TT[0]+Math.max((n-2*o)/2,0),this.TT[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.it(this.Z.x).si(h).q(-l,l),this.y.it(this.Z.y).si(a).q(-l,l),this.PT={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.mi(),y:this.y.mi()},this.K()}pi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Wi(t,e,i,s){const r=this.Ui(),n=fi(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 jc extends Sl{constructor(t,e,i,s,r,n,o){super(t,e,i,e.Bp("polarChart bg",0),s,e.cs.ts.polarChartBackgroundFillStyle,e.cs.ts.polarChartBackgroundStrokeStyle,e.cs.ts.polarChartTitleFont,e.cs.ts.polarChartTitleFillStyle,o),this.coordsClient="client",this.cA=[],this.Yo=!0,this.LT=(t,e,i,s,r)=>{this._b.it(s,r)},this.gA=he(this.cA),this.RT=t=>{this.cA.push(t)},this.ET=()=>this.Gv,this.cs.Jn(Sh.Mf),this.Gk=e.Lx("polarChart series bg",0),this.zT=e.tm("polarChart axis gridlines",0),this.VT=e.tm("polarChart series",1),this.OT=e.tm("polarChart axis lines",2),this.NT=e.tm("polarChart axis ticks",3),this._b=i.d2({scaleXYConstructor:Wc}),this.onResize(this.LT),this.Ch.Sr("Polar Chart"),this.$v=this.Gk.ud(this._b).Re(this.ts.polarChartSeriesBackgroundFillStyle).Le(ut).Au(0).$e(360).mu(0),this.Xv=this.Gk.ud(this._b).Re(_).Le(this.ts.polarChartSeriesBackgroundStrokeStyle).Au(0).$e(360).mu(0),super.Hv(this.$v,this.Xv),this.Dp(r,this._g),this.GT=new Zl(this,this._b,this.ts,!1!==(null==n?void 0:n.animationsEnabled),this.zT,this.OT,this.NT,this.hs,this.ET),this.UT=new Kl(this,this._b,this.ts,!1!==(null==n?void 0:n.animationsEnabled),this.zT,this.OT,this.NT,this.hs),this.coordsAxis={axisAmplitude:this.GT,axisRadial:this.UT};const h=e.sm(),a=Vt(n?n.cursorBuilder:void 0,Pa);this.hm=pa(this,h,a._y(h,this.uiScale,this.uiScale,Ot,this.ts),this,"show-nearest",Zc,((t,e)=>{const i=this.translateCoordinate(t,this.coordsClient);return Math.sqrt((i.clientX-e.clientX)**2+(i.clientY-e.clientY)**2)})),this.setAnimationsEnabled(!1!==(null==n?void 0:n.animationsEnabled))}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.hm.solveNearest(t,e,this.Gv,((t,e,i)=>t.solveNearest(e,i)))}addCursor(t=Pa){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}translateCoordinate(t,e,i){if(i){const e=t,s=this._g,r=i;if(Wi(r)){const t=yt(e,s,this.cs.At);return this.cs.Wo({engineX:t.x,engineY:t.y})}if($i(r))return e;if(tu(r)){const t=yt(e,s,this._b);return au(t,this._b)}}else{const i=t,s=e;if(ji(i)){if(tu(s)){const t=this.cs.Uo(i),e=yt({x:t.engineX,y:t.engineY},this.cs.At,this._b);return au(e,this._b)}if(Wi(s))return i;if($i(s)){const t=this.cs.Uo(i);return yt({x:t.engineX,y:t.engineY},this.cs.At,this._g)}}else if(eu(i)){if(tu(s))return i;const t=nu([i],this._b)[0];if(Wi(s)){const e=yt(t,this._b,this.cs.At),i={engineX:e.x,engineY:e.y};return this.cs.Wo(i)}if($i(s))return yt(t,this._b,this._g)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new uu(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPointSeries(t){const e=new Nc(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPointLineSeries(t){const e=new cu(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addAreaSeries(t){const e=new Xc(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addPolygonSeries(t){const e=new Yc(this.VT,this,this.Wv,this._b,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,this.cs.hs);return this.jv(e),e}addHeatmapSeries(t){const e=new lu(this.VT,this,this.Wv,this._b,this.ts,this.cs.hs,t);return this.jv(e),e}addSector(){const t=new iu(this.VT,this,this.gA,this._b,this.ts,this.cs.hs);return this.RT(t),t}getAmplitudeAxis(){return this.GT}get amplitudeAxis(){return this.GT}get axisAmplitude(){return this.GT}getRadialAxis(){return this.UT}get radialAxis(){return this.UT}get axisRadial(){return this.UT}ze(t){var e,i;super.ze(t),ga.Gp(this.Ch,this.Lp);for(const t of this.Gv)t.Cv();this.GT.Rr(),this.UT.Rr();for(const t of this.Gv)t.ze();for(let t=1;t<=2;t+=1){const e=this.GT.ze(),i=this.UT.ze(),s=ga.Np(this.Ch,this.Lp),r=[this.Ia.left+i,this.Ia.right+i],n=[this.Ia.bottom+i,this.Ia.top+i+s];this._b.Ei(r).zi(n);const o=4;if(!(!this.WT||Math.abs(this.WT.amplitude-e)>=o||Math.abs(this.WT.radial-i)>=o)||1!==t){this.WT={amplitude:e,radial:i};break}}const s=this._b.zb().start,r=this._b.zb().end,n=this._b.Eb()?((null===(e=this.WT)||void 0===e?void 0:e.radial)||0)*this._b.x.getPixelSize()+r-s:((null===(i=this.WT)||void 0===i?void 0:i.radial)||0)*this._b.x.getPixelSize()+s-r;this.$v.gu(n).vu(360),this.Xv.gu(n).vu(360);for(const t of this.cA)t.ze();this.hm.ze(!1,this.Gv,((t,e,i)=>t.solveNearest(e,i)));for(const t of this.Gv)t.Pm();return super.Pp(),this.YT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.GT.setAnimationsEnabled(t),this.UT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.Yo=t,this}getMouseInteractions(){return this.Yo}getMinimumSize(){return u($c,$c)}YT(){}forEachAxis(t){return t(this.GT),t(this.UT),this}dispose(){return this.cA.slice().forEach((t=>t.dispose())),this.hm.Y(),this.Gk.Y(),this.zT.Y(),this.VT.Y(),this.OT.Y(),this.NT.Y(),super.dispose()}af(){return[...this.Gv,...this.cA]}}const $c=300,Zc=(t,e,i)=>{var s;return St(e)?ya(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:Ki(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}],["Intensity","",{text:Ki(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]]):ya(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:Ki(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}]])};class qc extends Ga{}class Kc extends qc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Cs="Slice",this.M=0,this.wy=!1,this.HT=_,this.ky=_,this.Ty=this.M,this.Py=q((()=>this.chart.cs.Ms())),this.By=()=>{this.Ly=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.MT=e.fc(r,Tn.Simple).ds(this.getHighlight()),this.As(this.MT),this.rh=i.Wr(r).ds(this.getHighlight()),this.As(this.rh,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Vy(this.Ty,t):this.Ty=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.Ty>0?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),this.Vy(this.Ty,0,(()=>super.setVisible(!1)))):(this.Ty=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),super.setVisible(!0),this.Vy(this.Ty,this.M)):(this.Ty=this.M,super.setVisible(!0)),this}Vy(t,e,i){this.Ly=this.Py(300,$.ease)([[t,e]],(([t])=>{this.Ty=t,this.chart.cs.Ms()})),this.Ly.onEveryAnimationEnd(this.By),i&&this.Ly.onAnimationEnd(i)}setStyle(t,e,i,s){this.HT=t,this.ky=i,this.MT.Re(this.HT).Le(e),this.rh.Re(this.ky).ir(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},td=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Qc(i,r.x),s=Qc(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},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:a+S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>g.x&&p.MT.Fl([g,d,f,m])}};class ed extends fa{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("funnelChart bg",0),r,i.cs.ts.funnelChartBackgroundFillStyle,i.cs.ts.funnelChartBackgroundStrokeStyle,i.cs.ts.funnelChartTitleFont,i.cs.ts.funnelChartTitleFillStyle,o),this.Oy=[],this.Ny=Ba.None,this.Wy=!0,this.$y=0,this.$T=80,this.XT=20,this.jT=0,this.ZT=e.FunnelSliceModes.VariableHeight,this.Zy=!0,this.Jy=t=>{const e=this.Oy.indexOf(t);e>=0&&(this.Oy.splice(e,1),this.Ky())},this.cs.Jn(Sh.Sf),this.Qy=this.ts.effectsText,this.qy=i.tm("funnelChart bottom",0),this.im=i.tm("funnelChart top",1),this.Ch.Sr("Funnel Chart"),this.Gy=this.ts.funnelChartSliceFillStylePalette,this.Uy=this.ts.funnelChartSliceStrokeStyle,this.Yy=this.ts.funnelChartSliceLabelFont,this.Hy=this.ts.funnelChartSliceLabelFillStyle;const a=i.sm(),l=Vt(h?h.cursorBuilder:void 0,Ra);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",id,(()=>0)),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled)),this.Dp(n,this._g)}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Ra){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addSlice(t,e){const i=new Kc(this.$y,this.qy,this.im,this,this._g,this.Jy,this.ts,this.cs.hs);return this.$y+=1,i.setName(t),i.setValue(e),i.hs.ns.bs(this.Qy),i.hs.os.bs(this.Zy),this.Oy.push(i),this.cs.Ms(),i.setHighlightOnHover(this.Wy),i.onMouseMove((()=>{this.getCursorMode()&&this.cs.Ms()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.bs(t))),this.cs.Ms(),this}getSliceEffect(){return this.Zy}setSliceSorter(t){return this.Ny=t,this.Oy=this.Oy.sort(this.Ny),this.cs.Ms(),this}getSliceSorter(){return this.Ny}setLabelFillStyle(t){return this.Hy="function"==typeof t?t(this.Hy):t,this.cs.Ms(),this}getLabelFillStyle(){return this.Hy}setLabelFont(t){return this.Yy="function"==typeof t?t(this.Yy):t,this.cs.Ms(),this}getLabelFont(){return this.Yy}setLabelEffect(t){return this.Qy=t,this.Oy.forEach((e=>e.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Qy}setLabelFormatter(t){return this.nm=t,this.cs.Ms(),this}getLabelFormatter(){return this.nm}setSliceHighlightOnHover(t){return this.Wy=t,this.Oy.forEach((e=>e.setHighlightOnHover(t))),this}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=ga.Np(this.Ch,this.Lp),i=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+e)),s=u(this.Ia.left+i.x/2,this.Ia.bottom+i.y/2);this.Oy=this.Oy.sort(this.Ny);for(let t=0,{length:e}=this.Oy;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.om(r,o,s,i)}rm(t,e){t.setStyle(this.Kd?new N({color:this.Kd.getColors(t.getAnimatedValue())}):this.Gy(e,t),this.Uy,this.Hy,this.Yy)}Ky(){this.Oy=this.Oy.sort(this.Ny),this.cs.Ms()}af(){return this.Oy}dispose(){return this.Oy.slice().forEach((t=>t.dispose())),this.hm.Y(),this.qy.Y(),this.im.Y(),super.dispose()}}const id=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],sd=(t,i,s)=>{const r=t.Il();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}}},rd=t=>{const e=t.Il();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 nd extends ed{constructor(){super(...arguments),this.nm=Va.NamePlusValue,this.QT=10,this.JT=e.FunnelLabelSide.Left,this.KT=e.SliceLabelIndices.LabelsOnSides,this.am=[],this.fm=this.ts.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.fm=t;for(let t=0;tt.rh.setVisible(!1))),void this.am.forEach((t=>t.setVisible(!1)));this.qT(t,this.JT===e.FunnelLabelSide.Left?-1:1,-1,s,r);for(let t=0;tthis.chart.cs.Ms())),this.By=()=>{this.Ly=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.MT=e.fc(r,Tn.Simple).ds(this.getHighlight()),this.As(this.MT),this.rh=i.Wr(r).ds(this.getHighlight()),this.As(this.rh,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Vy(this.Ty,t):this.Ty=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.Ty>0?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),this.Vy(this.Ty,0,(()=>super.setVisible(!1)))):(this.Ty=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.Ly&&(this.Ly.finish(!1),this.Ly=void 0),super.setVisible(!0),this.Vy(this.Ty,this.M)):(this.Ty=this.M,super.setVisible(!0)),this}Vy(t,e,i){this.Ly=this.Py(300,$.ease)([[t,e]],(([t])=>{this.Ty=t,this.chart.cs.Ms()})),this.Ly.onEveryAnimationEnd(this.By),i&&this.Ly.onAnimationEnd(i)}setStyle(t,e,i,s){this.HT=t,this.ky=i,this.MT.Re(this.HT).Le(e),this.rh.Re(this.ky).ir(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},fd=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=dd(i,r.x),s=dd(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},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:a+S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>=g.x&&p.MT.Fl([g,d,f,m])}};class gd extends fa{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("pyramidChart bg",0),r,i.cs.ts.pyramidChartBackgroundFillStyle,i.cs.ts.pyramidChartBackgroundStrokeStyle,i.cs.ts.pyramidChartTitleFont,i.cs.ts.pyramidChartTitleFillStyle,o),this.Oy=[],this.Ny=Ba.None,this.Gy=this.ts.pyramidChartSliceFillStylePalette,this.Uy=this.ts.pyramidChartSliceStrokeStyle,this.Wy=!0,this.Yy=this.ts.pyramidChartSliceLabelFont,this.Hy=this.ts.pyramidChartSliceLabelFillStyle,this.$y=0,this.$T=0,this.XT=80,this.jT=0,this.ZT=e.PyramidSliceModes.VariableHeight,this.Zy=!0,this.Jy=t=>{const e=this.Oy.indexOf(t);e>=0&&(this.Oy.splice(e,1),this.Ky())},this.cs.Jn(Sh.Sf),this.Qy=this.ts.effectsText,this.qy=i.tm("pyramidChart bottom",0),this.im=i.tm("pyramidChart top",1),this.Ch.Sr("Pyramid Chart");const a=i.sm(),l=Vt(h?h.cursorBuilder:void 0,Ra);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",md,(()=>0)),this.Dp(n,this._g),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled))}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Ra){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addSlice(t,e){const i=new cd(this.$y,this.qy,this.im,this,this._g,this.Jy,this.ts,this.cs.hs);return this.$y+=1,i.setName(t),i.setValue(e),i.hs.ns.bs(this.Qy),i.hs.os.bs(this.Zy),this.Oy.push(i),this.cs.Ms(),i.onMouseMove((()=>{this.getCursorMode()&&this.cs.Ms()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.bs(t))),this.cs.Ms(),this}getSliceEffect(){return this.Zy}setSliceSorter(t){return this.Ny=t,this.Oy=this.Oy.sort(this.Ny),this.cs.Ms(),this}getSliceSorter(){return this.Ny}setLabelFillStyle(t){return this.Hy="function"==typeof t?t(this.Hy):t,this.cs.Ms(),this}getLabelFillStyle(){return this.Hy}setLabelFont(t){return this.Yy="function"==typeof t?t(this.Yy):t,this.cs.Ms(),this}getLabelFont(){return this.Yy}setLabelEffect(t){return this.Qy=t,this.Oy.forEach((e=>e.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Qy}setLabelFormatter(t){return this.nm=t,this.cs.Ms(),this}getLabelFormatter(){return this.nm}setSliceHighlightOnHover(t){return this.Wy=t,this.Oy.forEach((e=>e.setHighlightOnHover(t))),this}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=ga.Np(this.Ch,this.Lp),i=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+e)),s=u(this.Ia.left+i.x/2,this.Ia.bottom+i.y/2);this.Oy=this.Oy.sort(this.Ny);for(let t=0,{length:e}=this.Oy;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.cs.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.cs.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.om(r,o,s,i)}rm(t,e){t.setStyle(this.Kd?new N({color:this.Kd.getColors(t.getAnimatedValue())}):this.Gy(e,t),this.Uy,this.Hy,this.Yy)}Ky(){this.Oy=this.Oy.sort(this.Ny),this.cs.Ms()}af(){return this.Oy}dispose(){return this.Oy.slice().forEach((t=>t.dispose())),this.hm.Y(),this.qy.Y(),this.im.Y(),super.dispose()}}const md=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],yd=(t,i,s)=>{const r=t.Il();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}}},pd=t=>{const e=t.Il();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 Ad extends gd{constructor(){super(...arguments),this.nm=Va.NamePlusValue,this.QT=10,this.JT=e.PyramidLabelSide.Left,this.KT=e.SliceLabelIndices.LabelsOnSides,this.am=[],this.fm=this.ts.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.fm=t;for(let t=0;tt.rh.setVisible(!1))),void this.am.forEach((t=>t.setVisible(!1)));this.qT(t,this.JT===e.PyramidLabelSide.Left?-1:1,-1,s,r);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),Md=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Cd;e.SpiderWebMode=void 0,(Cd=e.SpiderWebMode||(e.SpiderWebMode={}))[Cd.Normal=0]="Normal",Cd[Cd.Circle=1]="Circle";class Td{constructor(t,e,i,s,n,o,h,a){this.R=new r.Eventer,this.iF=t,this.Yr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.sF=h,this.eF=a,this.hF=this.iF.He(this.scale).setMouseInteractions(!1),this.rF=this.Yr.Wr(this.scale).Sr(this.tag).setMouseInteractions(!1),this.nF=this.sF(this,this.iF.gm(this.scale,void 0,[Za.InternalUI])).Ye(this.chart.getNibStyle()),this.eF.gs([this.rF])}om(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.rF.setVisible(!0).Ve(yi(c,u(h.paddingX,h.paddingY))).Ha(h.alignmentX).Xa(h.alignmentY):this.rF.setVisible(!1)}getLabelSize(){return this.rF.ir(this.chart.getAxisLabelFont()).Re(this.chart.getAxisLabelStyle()).Os().oi()}dispose(){this.hF&&this.hF.dispose(),this.rF&&this.rF.dispose(),this.nF&&this.nF.dispose()}}class wd extends su{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Cs="Spider Series",this.Tu=new Map,this.Xi=e.HighlightModes.onHover,this.lM=8,this.ka=0,this.oF=(()=>{const t=q((()=>{}));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)||$.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)}})(),this.aF={},this.lF={},this.Iy=this.getVisible(),this.uF=1,this.cF=((t,e)=>{const i=q((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||$.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.uF=t,this.Rs.cs.Ms()}),(t=>{super.setVisible(t)})),this.chart=t,this.Rs=i,this.uM=r,this.dF=n,this.Rx=o,this.fF=h,this.AF=a,this.scale=s,this.gF=ve(u.spiderSeriesFillStyle,c),this.pF=ve(u.spiderSeriesStrokeStyle,c),this.yF=ve(u.spiderSeriesPointFillStyle,c)}Ki(t,e){const i=this.AF(e);if(void 0!==i&&this.Tu.has(i.tag)){const t=this.Tu.get(i.tag),e=this.fF(i.tag,t);return{cursorPosition:{pointMarker:e,pointMarkerScale:this.scale,resultTable:e,resultTableScale:this.scale},series:this,axis:i.tag,value:t}}}Av(){return this.yv&&this.Tu.size>0&&this.getVisible()}addPoints(...t){this.Tu.size>0&&this.chart.cs.Jn(Sh.Df),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.oF(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.Tu.set(s,r+t*(e-r)),this.Rs.cs.Ms()}))}),{easing:this.aF.easing,durationMs:this.aF.durationMs,onStart:()=>{i=new Map(this.Tu)}})}else for(let e=0;e=3&&(this.MT||(this.MT=this.Rs.fc(this.scale,Tn.Simple).Le(this.pF).Re(this.gF).ds(this.getHighlight()),this.As(this.MT)),this.MT.Fl(t),this.cM||(this.cM=this.Rs.Nv(this.scale).it(this.lM).dl(this.uM).sr(this.ka).Re(this.yF).ds(this.getHighlight()),this.As(this.cM)),this.cM.Ot().ml(t))}}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.gF,stroke:this.pF})}Bs(){return this.ws||this.uM}mF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},kd=t=>ni(t.rF.hh()),Id=t=>ni(t.hh()),zd=(t,i,s,r)=>t.mu(0).Ve(s).Au(90).$e(-270).vu(i===e.SpiderWebMode.Circle?void 0:r.length),Fd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Rd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Dd=()=>{Rd.alignmentX=0,Rd.alignmentY=0,Rd.paddingX=0,Rd.paddingY=0};class Pd extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Bp("spiderChart bg",0),r,i.cs.ts.spiderChartBackgroundFillStyle,i.cs.ts.spiderChartBackgroundStrokeStyle,i.cs.ts.spiderChartTitleFont,i.cs.ts.spiderChartTitleFillStyle,h),this.Ia=A(20,20,20,20),this.axisScale=gt.d1({scale1DConstructor:Gi,dimension:"x"}).q(0,1),this.Rx=[],this.vF=[],this.SF=[],this.xF=Ks.expansion,this.bF=!0,this.MF=Md,this._F=bd,this.Yo=!0,this.wF=e.SpiderWebMode.Normal,this.CF=4,this.kF=this.ts.spiderChartWebStyle,this.TF=this.ts.spiderChartScaleLabelFillStyle,this.FF=this.ts.spiderChartScaleLabelFont,this.IF=5,this.PF=this.ts.spiderChartAxisLabelFillStyle,this.DF=this.ts.spiderChartAxisLabelFont,this.BF=5,this.LF=this.ts.spiderChartAxisStrokeStyle,this.RF=this.ts.spiderChartAxisNibStrokeStyle,this.Hf=10,this.EF=A(),this.hasAxis=t=>this.Rx.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Bi.Numeric),this.zF=()=>{const t=this.Rx.map(kd).concat(this.SF.map(Id));return Ke(t)},this.VF=()=>this.OF.ud(this._g).setMouseInteractions(!1),this.NF=t=>t.dispose(),this.GF=()=>this.EA.Wr(this._g).setMouseInteractions(!1),this.UF=t=>t.dispose(),this.WF=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.YF=(t,e)=>{let i,s;const r=()=>{void 0!==this.HF&&this.HF.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.xF,this.xF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Rx.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Ed(a,this.Rx.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=gi(pi(t.hF.Ii(),t.hF.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.q(i.min,l),se(o),this.cs.Ms()}},o=()=>{if(i=void 0,void 0!==s)if(this.ph){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.$F(),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.HF=this.gp.cs.An(300,$.ease)([[0,1]],(([e])=>{this.axisScale.q(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.HF.onAnimationEnd((()=>{this.HF=void 0,this.xF=i}))}else this.xF=s}else this.xF=s;s=void 0};e.setMouseEnterEventHandler(this.XF).setMouseLeaveEventHandler(this.jF).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=ns(new hs(((t,e,i)=>{this.XF(t),r(),se(i)}),n,((t,e,i,s)=>{this.jF(t),o(),se(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.ZF=t=>{this.bF&&!this.hasAxis(t)&&this.addAxis(t)},this.fF=(t,e)=>{for(const i of this.Rx)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return si(i.hF.Ii(),i.hF.Ti(),t)}},this.AF=t=>{if(0===this.Rx.length)return;const e=pi(this.translateCoordinate(t,this.coordsRelative),this.Rx[0].hF.Ii()),i=Math.atan2(e.y,e.x);let s,r=Ye;for(const t of this.Rx){const e=pi(t.hF.Ti(),t.hF.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.Yo&&(t.Ye(this.RF),this.cs.Ms())},this.jF=t=>{t.Ye(this.RF),this.cs.Ms()},this.cs.Jn(Sh.bf),this.Gk=i.Lx("spiderChart series bg",0),this.OF=i.tm("spiderChart web shapes",0),this.QF=i.tm("spiderChart axis bg",1),this.lb=i.tm("spiderChart plotting",2),this.EA=i.tm("spiderChart fg",3),this.eF=this.hs.Bg().bs(this.ts.effectsText),this.Ch.Sr("Spider Chart"),this.$v=this.Gk.ud(this._g).Re(this.ts.spiderChartSeriesBackgroundFillStyle).Le(ut).Au(90).$e(-270).mu(0),this.Xv=this.Gk.ud(this._g).Re(_).Le(this.ts.spiderChartSeriesBackgroundStrokeStyle).Au(90).$e(-270).mu(0),super.Hv(this.$v,this.Xv);const a=i.sm(),l=Vt(o?o.cursorBuilder:void 0,za);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),this,"show-pointed",Od,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.Dp(n,this._g)}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=za){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Td(this.QF,this.EA,this._g,this,t,this.axisScale,this.YF,this.eF);this.Rx.push(e)}}else t&&this.Rx.push(t);return this.eF.gs(this.Rx.map((t=>t.rF))),this.cs.Ms(),this}addSeries(t){const i=void 0!==(null==t?void 0:t.pointShape)?t.pointShape:e.PointShape.Circle,s=void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Gv.length,r=new wd(this,this.lb,this._g,i,this.ZF,this.Rx,this.fF,this.AF,this.Wv,this.ts,s,this.cs.hs);return this.jv(r),r}getSeriesCount(){return this.Gv.length}setWebMode(t){return this.wF=t,this.cs.Ms(),this}getWebMode(){return this.wF}setWebCount(t){return this.CF=t,this.cs.Ms(),this}getWebCount(){return this.CF}setWebStyle(t){return this.kF="function"==typeof t?t(this.kF):t,this.cs.Ms(),this}getWebStyle(){return this.kF}setScaleLabelStyle(t){return this.TF="function"==typeof t?t(this.TF):t,this.cs.Ms(),this}getScaleLabelStyle(){return this.TF}setScaleLabelFont(t){return this.FF="function"==typeof t?t(this.FF):t,this.cs.Ms(),this}getScaleLabelFont(){return this.FF}setScaleLabelPadding(t){return this.IF=t,this.cs.Ms(),this}getScaleLabelPadding(){return this.IF}setScaleLabelStrategy(t){return this.MF=t,this.cs.Ms(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.cs.Ms(),this}setAxisLabelStyle(t){return this.PF="function"==typeof t?t(this.PF):t,this.cs.Ms(),this}getAxisLabelStyle(){return this.PF}setAxisLabelFont(t){return this.DF="function"==typeof t?t(this.DF):t,this.cs.Ms(),this}getAxisLabelFont(){return this.DF}setAxisLabelEffect(t){return this.eF.bs(t),this.cs.Ms(),this}getAxisLabelEffect(){return this.eF._s()}setAxisLabelPadding(t){return this.BF=t,this.cs.Ms(),this}getAxisLabelPadding(){return this.BF}setAxisLabelStrategy(t){return this._F=t,this.cs.Ms(),this}setAxisStyle(t){return this.LF="function"==typeof t?t(this.LF):t,this.cs.Ms(),this}getAxisStyle(){return this.LF}setNibStyle(t){return this.RF="function"==typeof t?t(this.RF):t,this.cs.Ms(),this}getNibStyle(){return this.RF}setNibLength(t){return this.Hf=t,this.cs.Ms(),this}getNibLength(){return this.Hf}setAutoAxis(t){return this.bF=t,this}getAutoAxis(){return this.bF}setMouseInteractions(t){return this.Yo=t,this}getMouseInteractions(){return this.Yo}setAxisScrollStrategy(t){return this.xF=t,this.cs.Ms(),this}getAxisScrollStrategy(){return this.xF}setAxisInterval(t,e=0){return this.axisScale.q(e,t),this.cs.Ms(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp);const e=this.Rx.length,i=ga.Np(this.Ch,this.Lp),s=u(this._g.x.getInnerInterval()-(this.Ia.left+this.Ia.right),this._g.y.getInnerInterval()-(this.Ia.bottom+this.Ia.top+i)),r=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this._F){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?r.right=Math.max(r.right,l.x+.5*(1-a.alignmentX)*h.x-t):r.left=Math.max(r.left,-l.x+.5*(a.alignmentX+1)*h.x-t),o>0?r.top=Math.max(r.top,l.y+.5*(1-a.alignmentY)*h.y-t):r.bottom=Math.max(r.bottom,-l.y+.5*(a.alignmentY+1)*h.y-t)}}if(this.xF){const t=this.$F();if(void 0!==t){const e=this.xF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.xF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.q(e,i)}}const n=u(this._g.x.getInnerStart()+(r.left+this._g.x.getInnerInterval()-r.right)/2,this._g.y.getInnerStart()+(r.bottom+this._g.y.getInnerInterval()-r.top)/2),o=Math.min(s.x/2-(r.left+r.right)/2,s.y/2-(r.bottom+r.top)/2);this.EF=A(this.Xt.left+this.Ia.left+r.left,this.Xt.top+this.Ia.top+i+r.top,this.Xt.right+this.Ia.right+r.right,this.Xt.bottom+this.Ia.bottom+r.bottom),this.om(n,o);for(const t of this.Gv)t.Cv();for(const t of this.Gv)t.ze();super.Pp(),this.hm.ze(!1,this.Gv,void 0);for(const t of this.Gv)t.Pm()}dispose(){return this.Gk.Y(),this.OF.Y(),this.QF.Y(),this.lb.Y(),this.EA.Y(),this.hm.Y(),super.dispose()}getMinimumSize(){return u(this.EF.left+this.EF.right+100,this.EF.bottom+this.EF.top+100)}om(t,e){const i=this.Rx.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];zd(h,i,s,n);const u=r*((l+1)/e);h.gu(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=si(n,o[a],s);e.Ve(yi(c,u(y.paddingX,y.paddingY))).Ha(y.alignmentX).Xa(y.alignmentY).Sr(l(s))}}}for(let e=f;e1;for(const s of this.Rx)for(const r of this.Gv){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Od=(t,e,i)=>ya(e,[[e.series],[e.axis],[{text:t.formatValue(e.value),font:{weight:"bold"}}]]),Ld=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99998/e),o=Math.floor(99999/(e+1)),h=Math.floor(89999/(e+1)),a=510001+e*h;let l=0;return{JF:()=>{const e=t.KF("dashboard ui",a+l);return l+=1,e},qF:()=>t.KF("dashboard legend",51e4),tI:e=>{const a=1+e*i,l=100001+e*s,u=200002+e*r,c=300002+e*n,d=400001+e*o,f=510001+e*h;let g=0;return{cs:t,Bp:(e,i)=>{const s=a+i;return t.KF(e,s)},Lx:(e,i)=>{const s=l+i;return t.KF(e,s)},Wk:(e,i)=>{const s=u+i;return t.KF(e,s)},tm:(e,i)=>{const s=c+i;return t.KF(e,s)},Bx:(e,i,s)=>{const r=c+i;return t.iI(e,r,s)},Ep:(e,i)=>{const s=d+i;return t.KF(e,s)},bp:e=>{const i=f+g,s=t.KF(e,i);return g+=1,s},_p:()=>t.KF("panel legend",500002+e),sm:()=>t.KF("panel cursor",600001+e)}}}};class _d{constructor(t){this.R=new r.Eventer,this.M=t}_(t){return this.M=t,this.R.emit("set",t),this}C(){return this.M}G(t){return this.R.on("set",t)}W(t){return this.R.off(t,"set")}}const Bd={yh:!1,mh:0,Sh:!1,bh:0,xh:!1,Mh:0,_h:0,fh:Ks.fitting},Vd=t=>{if(!t||"object"!=typeof t||null===t)return!1;const e=t.type;return!(!e||!["spark-line","spark-bar","spark-win-loss","spark-area","spark-pie"].includes(e))},Gd=(t,e,i,s,r,n,o,h)=>{const{type:a,data:l}=t;if(0===l.length)return;const u=[s,r];"spark-line"===a&&Zd(t,e,u,n,o,h),"spark-bar"===a&&qd({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&qd({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Kd(t,e,u,n,o,h),"spark-pie"===a&&Jd(t,e,u,n,o,h)},Nd=(t,e,i,s)=>({x:Yd(t.x,e.x,i.x,s),y:Hd(t.y,e.y,i.y,s)}),Ud=(t,e,i,s)=>({position:Yd(t.position,e.x,i.x,s),high:Hd(t.high,e.y,i.y,s),low:Hd(t.low,e.y,i.y,s)}),Yd=(t,e,i,s)=>{const r=_t(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Hd=(t,e,i,s)=>{const r=_t(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Xd=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Wd(a,e,i,r,n,o,h),"axis-band"===a.type&&jd(a,i,r,n,o,h),"constant-line"===a.type&&$d(a,i,s,r,n,o,h)},Wd=(t,i,s,r,n,o,h)=>{const{value:a,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===a&&(f=i[0]),"end"===a&&(f=i[i.length-1]),"min"===a){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof a||(f=Nd(a,s,r,n),((t,e)=>{const i=e[0],s=e[1],r=t.x,n=t.y;return i.x<=r&&r<=i.x+s.x&&i.y<=n&&n<=i.y+s.y})(f,n)))&&o.pointSet.add().Ot().dl(void 0!==u?u:e.PointShape.Circle).sr(d||0).it(c||5).Re(l||h.sparkPointChartFillStyle).ml(f)},jd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(He,Ye),f=u(He,Ye);"x"===o&&(d=Nd({x:h,y:He},e,i,s),f=Nd({x:a,y:Ye},e,i,s)),"y"===o&&(d=Nd({x:He,y:h},e,i,s),f=Nd({x:Ye,y:a},e,i,s));const g=s[0],m=s[1],y=_t(d.x,g.x,g.x+m.x),p=_t(d.y,g.y,g.y+m.y),A=_t(f.x,g.x,g.x+m.x),x=_t(f.y,g.y,g.y+m.y);r.rect.add().Ml(y)._l(p).it(u(A-y,x-p)).Re(l||n.sparkChartBandFillStyle).Le(c||n.sparkChartBandStrokeStyle).Le(ut)},$d=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,y=[];if("y"===h&&d<=c&&c<=f){const t=Nd(u(g,c),{x:g,y:d},s,r),e=Nd(u(m,c),{x:g,y:d},s,r);y.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=Nd(u(c,d),{x:g,y:d},s,r),e=Nd(u(c,f),{x:g,y:d},s,r);y.push([t,e])}y.length>0&&n.line.add().Ye(l||o.sparkChartConstantLineStrokeStyle).Xe(y[0][0]).$e(y[0][1])},Zd=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.eo&&zt.console.warn("LightningChart JS warning: SparkLineChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=Ye,c=He,d=Ye,f=He;for(let t=0;tNd(t,{x:u,y:d},g,i)));e.lineSet.add().ds(n).Ye(o||s.sparkLineChartStrokeStyle).Ot().ml(m),a&&Xd(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},qd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,y=f/d*1;let p=Ye,A=He;if(g)p=-1,A=1;else for(const t of o)p=Math.min(p,t),A=Math.max(A,t);const x={x:0,y:g?-1:Math.min(0,p)},S={x:1*o.length+(o.length-1)*y,y:g?2:Math.max(A,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*y,y:g?t>=m?1:0:t},r=Nd({x:1*e+e*y,y:g?t>=m?0:-1:0},x,S,i),n=Nd(s,x,S,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().ds(n).Ve(t.position).Cl(t.height).wl(t.width).Re((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Le(a||s.sparkBarChartStrokeStyle)}))},Kd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.eo&&zt.console.warn("LightningChart JS warning: SparkAreaChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=Ye,f=He,g=Ye,m=He;for(let t=0;t{const{data:o,strokeStyle:h}=t,a=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=a.reduce(((t,e)=>t+e),0),d=Nd(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().ds(n).Ve(d).gu(g).mu(0).Au(m).$e(m+r).Re(l[i]||ve(s.sparkPieChartFillStyle,i)).Le(h||s.sparkPieChartStrokeStyle),m+=r}))};var Qd,tf,ef;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(Qd||(Qd={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(tf||(tf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(ef||(ef={}));class sf extends Fn{constructor(t,e,i,s,r){super(),this.Ns=!1,this.o_={x:0,y:0,height:20,width:20},this.sI={x:10,y:10},this.Rs=t,this.eI=r,this.hI=new Fo(t,e,i,Ot,s).setMouseInteractions(!0),this.rI=t.fc(e,Tn.Simple).Re(s.dataGridScrollBarButtonArrowFillStyle).Le(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Bu(this),this.hI.onMouseEnter((t=>t.setHighlight(1))),this.hI.onMouseLeave((t=>t.setHighlight(0)))}nI(){switch(this.eI){case ef.Up:this.rI.Fl([{x:this.o_.x,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y-this.sI.y/2},{x:this.o_.x-this.sI.x/2,y:this.o_.y-this.sI.y/2}]);break;case ef.Down:this.rI.Fl([{x:this.o_.x-this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x,y:this.o_.y-this.sI.y/2}]);break;case ef.Left:this.rI.Fl([{x:this.o_.x-this.sI.x/2,y:this.o_.y},{x:this.o_.x+this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y-this.sI.y/2}]);break;case ef.Right:this.rI.Fl([{x:this.o_.x-this.sI.x/2,y:this.o_.y+this.sI.y/2},{x:this.o_.x+this.sI.x/2,y:this.o_.y},{x:this.o_.x-this.sI.x/2,y:this.o_.y-this.sI.y/2}])}}Ve(t){return this.o_.x=t.x,this.o_.y=t.y,this}Ua(){return u(this.o_.x,this.o_.y)}it(t){return this.o_.height=t.x,this.o_.width=t.y,this}oi(){return{x:this.o_.height,y:this.o_.width}}onMouseDown(t){return this.hI.onMouseDown(t)}onMouseUp(t){return this.hI.onMouseUp(t)}setFillStyle(t){return this.hI.setFillStyle(t),this}getFillStyle(){return this.hI.getFillStyle()}setStrokeStyle(t){return this.hI.setStrokeStyle(t),this}getStrokeStyle(){return this.hI.getStrokeStyle()}ze(){return this.hI.ze(),this.nI(),this}Os(){return this.hI.setSize(u(this.o_.height,this.o_.width)).setPosition(u(this.o_.x,this.o_.y)),this}setVisible(t){return this.hI.setVisible(t),this.rI.setVisible(t),this}dispose(){return this.hI.dispose(),this.rI.dispose(),this}setMouseInteractions(t){return this.hI.setMouseInteractions(t),this}getMouseInteractions(){return this.hI.getMouseInteractions()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.hI.getHighlight()}setHighlight(t){return this.hI.setHighlight(ke(t)),this.R.emit("highlight",this,Boolean(t)),this.Rs.Ms(),this}}const rf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class nf{constructor(t,i,s,n,o,h,a){this.dd={x:0,y:0},this.o_={x:0,y:0,height:0,width:0},this.R=new r.Eventer,this.oI={min:u(0,0),max:u(0,0)},this.aI=!1,this.lI=!1,this.uI={x:0,y:0},this.Ru=void 0,this.cI=u(0,0),this.dI={x:0,y:0},this.fI=0,this.AI=15,this.gI=(t,i)=>{this.aI=!0,this.EA.Ms();const s=this.pI.getDraggingMode();this.Ru=this.EA.cs.tn(s===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:s===e.UIDraggingModes.draggable?e.MouseStyles.Move:s===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.yI&&clearInterval(this.yI)},this.mI=()=>{this.aI=!1,this.EA.Ms(),this.EA.cs.sn(this.Ru)},this.vI=t=>(this.lI=!0,this.uI=yt(this.EA.cs.Ne(t.x,t.y),this.EA.cs.At,this.scale),!0),this.SI=(t,e)=>(this.xI(e),this.yI=setInterval((()=>this.xI(e)),300),!0),this.bI=()=>(clearInterval(this.yI),!0),this.MI=(t,i)=>{const s=this.pI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=yt(this.EA.cs.Ne(t.x,t.y),this.EA.cs.At,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?rf(n.x,this.scale.x):this.o_.x,r!==e.UIDraggingModes.onlyHorizontal?rf(n.y,this.scale.y):this.o_.y),h=u(o.x-this.uI.x,o.y-this.uI.y),a=u(this.pI.getPosition().x+h.x,this.pI.getPosition().y+h.y),l=this._I(a),c={x:Math.abs(this.cI.x-l.x),y:Math.abs(this.cI.y-l.y)};return this.wI(c),this.dI.y>h.y&&(this.uI=n),this.ze(),!0}return!1},this.CI=(t,e)=>{this.lI=!1,se(e),this.EA.Ms()},this.EA=t,this.gp=i,this.scale=n,this.contentScale=o,this.kI=a,this.TI=new sf(t,s,n,h,a===Qd.UpToDown?ef.Up:ef.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.FI=new sf(t,s,n,h,a===Qd.UpToDown?ef.Down:ef.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.pI=new Fo(t,s,n,Ot,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===Qd.UpToDown?e.UIDraggingModes.onlyVertical:a===Qd.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.II=new Fo(i,s,n,Ot,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.pI.onMouseEnter(this.gI),this.pI.onMouseLeave(this.mI),this.pI.onMouseDragStart(((t,e)=>this.vI(u(e.clientX,e.clientY))&&se(e))),this.pI.onMouseDrag(((t,e)=>this.MI(u(e.clientX,e.clientY))&&se(e))),this.pI.onMouseDragStop(this.CI),this.pI.onTouchStart(((t,e)=>this.vI(u(e.clientX,e.clientY))&&se(e))),this.pI.onTouchMove(((t,e)=>this.MI(u(e.clientX,e.clientY))&&se(e))),this.pI.onTouchEnd(this.CI),this.TI.onMouseDown(((t,e)=>this.SI(t,e)&&se(e))),this.FI.onMouseDown(((t,e)=>this.SI(t,e)&&se(e))),this.TI.onMouseUp(((t,e)=>this.bI()&&se(e))),this.FI.onMouseUp(((t,e)=>this.bI()&&se(e))),this.II.onMouseWheel(((t,e)=>this.DI(e))),this.pI.onMouseWheel(((t,e)=>this.DI(e))),this.II.onMouseDown(((t,e)=>this.SI(t,e)&&se(e))),this.II.onMouseUp(((t,e)=>this.bI()&&se(e)))}BI(t){return this.o_=t,this}wl(t){return this.o_.width=t,this}LI(){return this.o_.width}RI(t){return this.cI=t,this}EI(t){return this.dd=t,this}zI(){return this.dd}VI(t){return this.AI=t,this}OI(){return this.kI}NI(t){let e;switch(this.kI){case Qd.UpToDown:return e=t>0?Math.min(this.cI.y-this.oI.max.y,this.dI.y+t):Math.max(0,this.dI.y+t),e!==this.dI.y&&(this.wI({x:0,y:e}),this.ze(),!0);case Qd.LeftToRight:return e=Math.min(this.oI.max.x-this.cI.x,this.dI.x+t),e!==this.dI.x&&(this.wI({y:0,x:e}),this.ze(),!0);default:return!1}}GI(t){let e;switch(this.kI){case Qd.UpToDown:return e=Math.max(0,this.dI.y-t),e!==this.dI.y&&(this.wI({x:0,y:e}),this.ze(),!0);case Qd.LeftToRight:return e=t>0?Math.max(0,this.dI.x-t):Math.min(this.oI.max.x-this.cI.x,this.dI.x-t),e!==this.dI.x&&(this.wI({x:e,y:0}),this.ze(),!0);default:return!0}}UI(t){switch(this.kI){case Qd.UpToDown:return this.R.on("scrollY",t);case Qd.LeftToRight:return this.R.on("scrollX",t)}return this.R.on("scrollY",t)}_I(t){switch(this.kI){case Qd.UpToDown:if(t.y>this.oI.min.y)return u(t.x,this.oI.min.y);if(t.ythis.oI.max.x)return u(this.oI.max.x,t.y)}return t}DI(t){t.deltaY>0&&this.WI()&&se(t),t.deltaY<0&&this.YI()&&se(t)}xI(t){const e=yt(this.EA.cs.Ne(t.clientX,t.clientY),this.EA.cs.At,this.scale);let i;const s=this.pI.getPosition(),r=this.pI.getSize();this.HI(e,s,r)?clearInterval(this.yI):(i=this.kI===Qd.UpToDown?u(0,e.y-s.y>0?this.AI:-this.AI):u(s.x-e.x>0?this.AI:-this.AI,0),(i.x>0||i.y>0)&&this.$I(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.XI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}HI(t,e,i){return this.kI===Qd.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.o_.height?Math.min(this.cI.y-this.oI.max.y,this.dI.y+t):0,e!==this.dI.y&&(this.wI({x:0,y:e}),this.ze(),!0)}case Qd.LeftToRight:{const e=Math.min(this.oI.max.x-this.cI.x,this.dI.x+t);return e!==this.dI.x&&(this.wI({y:0,x:e}),this.ze(),!0)}default:return!1}}YI(){return this.$I(this.AI)}WI(){return this.XI(this.AI)}wI(t){if(t.x===this.dI.x&&t.y===this.dI.y)return;let e;switch(this.dI=t,this.kI){case Qd.UpToDown:e=this.dI.y*this.fI*this.contentScale.Ui().y,this.R.emit("scrollY",tf.Vertical,e),this.EA.cs.Ms();break;case Qd.LeftToRight:e=this.dI.x*this.fI*this.contentScale.Ui().x,this.R.emit("scrollX",tf.Horizontal,e)}}setVisible(t){return this.TI.setVisible(t),this.FI.setVisible(t),this.II.setVisible(t),this.pI.setVisible(t),this}dispose(){return this.TI.dispose(),this.FI.dispose(),this.II.dispose(),this.pI.dispose(),this.yI&&clearInterval(this.yI),this}Os(){switch(this.ZI(),this.QI(),this.kI){case Qd.UpToDown:this.TI.Ve({x:this.o_.x,y:this.o_.y+this.o_.height-this.TI.oi().x/2}).it(u(this.o_.width,this.o_.width)).Os(),this.FI.Ve({x:this.o_.x,y:this.o_.y+10}).it(u(this.o_.width,this.o_.width)).Os(),this.II.setSize({x:this.o_.width,y:this.o_.height-2*this.TI.oi().x}).setPosition({x:this.o_.x,y:this.o_.y+this.FI.oi().y+this.II.getSize().y/2}),this.pI.setSize(u(this.o_.width,this.JI())),this.cI={x:this.o_.x,y:this.TI.Ua().y-this.TI.oi().y/2-this.pI.getSize().y/2},this.jI({min:{x:this.o_.x,y:this.TI.Ua().y-this.TI.oi().y/2-this.pI.getSize().y/2},max:{x:this.o_.x,y:this.FI.Ua().y+this.FI.oi().x/2+this.pI.getSize().y/2}});break;case Qd.LeftToRight:this.TI.Ve({x:this.o_.x,y:this.o_.y}).it(u(this.o_.height,this.o_.height)).Os(),this.FI.Ve({x:this.o_.x+this.o_.width-this.FI.oi().x,y:this.o_.y}).it(u(this.o_.height,this.o_.height)).Os(),this.II.setSize({y:this.o_.height,x:this.o_.width-2*this.TI.oi().y}).setPosition({x:this.o_.x+this.TI.oi().x/2+this.II.getSize().x/2,y:this.o_.y}),this.pI.setSize(u(this.JI(),this.o_.height)),this.cI={x:this.TI.Ua().x+this.TI.oi().x/2+this.pI.getSize().x/2,y:this.o_.y},this.jI({min:{x:this.TI.Ua().x+this.TI.oi().x/2+this.pI.getSize().x/2,y:this.o_.y},max:{x:this.FI.Ua().x-this.FI.oi().x/2-this.pI.getSize().x/2,y:this.o_.y}})}return this.KI(),this}ZI(){switch(this.kI){case Qd.UpToDown:this.qI()||this.setVisible(!1),this.qI()&&this.setVisible(!0);break;case Qd.LeftToRight:this.tP()||this.setVisible(!1),this.tP()&&this.setVisible(!0)}}QI(){switch(this.kI){case Qd.UpToDown:this.qI()||this.wI({x:0,y:0});break;case Qd.LeftToRight:this.tP()||this.wI({x:0,y:0})}}qI(){return this.dd.x>this.o_.height}tP(){return this.dd.y>this.o_.width}JI(){switch(this.kI){case Qd.UpToDown:return this.o_.height*(this.o_.height-2*this.TI.oi().x)/this.dd.x;case Qd.LeftToRight:return this.o_.width*(this.o_.width-2*this.TI.oi().y)/this.dd.y;default:return 0}}KI(){switch(this.kI){case Qd.UpToDown:this.fI=(this.dd.x-this.o_.height)/(this.oI.min.y-this.oI.max.y);break;case Qd.LeftToRight:this.fI=(this.dd.y-this.o_.width)/(this.oI.max.x-this.oI.min.x)}}ze(){switch(this.TI.ze(),this.FI.ze(),this.II.ze(),this.kI){case Qd.UpToDown:this.pI.setPosition({x:this.o_.x,y:this.TI.Ua().y-this.TI.oi().y/2-this.pI.getSize().y/2-this.dI.y}).ze();break;case Qd.LeftToRight:this.pI.setPosition({y:this.o_.y,x:this.TI.Ua().x+this.TI.oi().x/2+this.pI.getSize().x/2+this.dI.x}).ze()}return this}}class of{constructor(t,e,i,s,r,n,o){switch(this.EA=t,this.gp=e,this.scale=s,this.contentScale=r,o){case tf.Vertical:this.iP=this.sP(i,n,Qd.UpToDown);break;case tf.Horizontal:this.eP=this.sP(i,n,Qd.LeftToRight);break;case tf.Both:this.iP=this.sP(i,n,Qd.UpToDown),this.eP=this.sP(i,n,Qd.LeftToRight)}this.hP=ns(new hs(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.eP)||void 0===n?void 0:n.GI(s.x))&&se(r),0!==s.y&&(null===(o=this.iP)||void 0===o?void 0:o.NI(s.y))&&se(r)})))}sP(t,e,i){return new nf(this.EA,this.gp,t,this.scale,this.contentScale,e,i)}LI(){return 20}EI(t){var e,i;return null===(e=this.iP)||void 0===e||e.EI(t),null===(i=this.eP)||void 0===i||i.EI(t),this}rP(t){var e;return null===(e=this.eP)||void 0===e||e.VI(t),this}nP(t){var e;return null===(e=this.iP)||void 0===e||e.VI(t),this}oP(t){const e=this.iP;return e&&e.DI(t),this}aP(t){return this.hP.onTouchStart(this,t),this}lP(t){return this.hP.onTouchMove(this,t),this}uP(t){return this.hP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.eP)||void 0===e||e.UI(t),null===(i=this.iP)||void 0===i||i.UI(t),this}dispose(){var t,e;return null===(t=this.iP)||void 0===t||t.dispose(),null===(e=this.eP)||void 0===e||e.dispose(),this}ze(){var t,e;return null===(t=this.iP)||void 0===t||t.ze(),null===(e=this.eP)||void 0===e||e.ze(),this}Os(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.iP)||void 0===t||t.BI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.eP)||void 0===e||e.BI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.iP)||void 0===i||i.Os(),null===(s=this.eP)||void 0===s||s.Os(),this}}class hf extends fa{constructor(t,e,i,s,r,n){super(t,e,i,e.Bp("dataGrid bg",0),s,e.cs.ts.dataGridBackgroundFillStyle,e.cs.ts.dataGridBackgroundStrokeStyle,e.cs.ts.dataGridTitleFont,e.cs.ts.dataGridTitleFillStyle,n),this.cP=[],this.dP=[],this.fP=[],this.AP=new Map,this.gP=!0,this.pP=!0,this.yP=!0,this.mP=!0,this.vP=!0,this.SP=!0,this.xP=!0,this.bP=!0,this.MP=!0,this._P=!0,this.wP=!0,this.CP=!0,this.kP=!0,this.TP=!0,this.FP=!0,this.IP=!0,this.PP=new Set,this.DP=new Set,this.BP=!0,this.LP=!0,this.RP=(t,e)=>{t.borders=void 0===e?df:{...t.borders,...e},this.EP(t),this.CP=!0,this.cs.Ms()},this.EP=t=>{t.borders&&(!1===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.VP,bottom:!1}})),!1===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.VP,top:!1}})),!1===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.VP,right:!1}})),!1===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.VP,left:!1}})),!0===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.VP,bottom:!0}})),!0===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.VP,top:!0}})),!0===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.VP,right:!0}})),!0===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.VP,left:!0}})))},this.OP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseEnter,i,e)},this.NP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseLeave,i,e)},this.GP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseClick,i,e)},this.UP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDoubleClick,i,e)},this.WP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDown,i,e)},this.YP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseUp,i,e)},this.HP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseMove,i,e)},this.$P=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDrag,i,e)},this.XP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDragStart,i,e)},this.jP=(t,e)=>{const i=this.AP.get(t);i&&this.R.emit(af.cellMouseDragStop,i,e)},this.ZP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellMouseWheel,i,e),!e.defaultPrevented&&this.BP&&this.QP.oP(e))},this.JP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellTouchStart,i,e),!e.defaultPrevented&&this.LP&&this.QP.aP(e))},this.KP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellTouchMove,i,e),!e.defaultPrevented&&this.LP&&this.QP.lP(e))},this.qP=(t,e)=>{const i=this.AP.get(t);i&&(this.R.emit(af.cellTouchEnd,i,e),!e.defaultPrevented&&this.LP&&this.QP.uP(e))},this.cs.Jn(Sh.Af),this.Ch.Sr("Data Grid"),this.tD=i.d2({scaleXYConstructor:Yi}),this.tD.x.yg=Bd,this.iD=i.d2({scaleXYConstructor:Yi}),this.sD={x:0,y:0},this.eD=this.ts.dataGridTextFont,this.hD=this.ts.dataGridTextFillStyle,this.VP={top:!0,bottom:!0,left:!0,right:!0},this.rD=this.ts.dataGridCellBackgroundFillStyle,this.nD=this.ts.dataGridBorderStrokeStyle,this.oD="left-center",this.aD={left:5,right:5,bottom:5,top:5},this.lD=e.Lx("dataGrid grid bg",0),this.uD=e.Lx("dataGrid cell bg",1),this.cD=e.tm("dataGrid cell content",0),this.dD=e.tm("dataGrid scrollbar bg",1),this.fD=e.tm("dataGrid scrollbar fg",2),this.QP=this.AD(),this.onBackgroundMouseWheel(((t,e)=>{this.BP&&this.QP.oP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.LP&&this.QP.aP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.LP&&this.QP.lP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.LP&&this.QP.uP(e)})),this.gD=this.lD.Ee(this.tD).Re(this.ts.dataGridBackgroundFillStyle).Le(ut).setMouseInteractions(!1),this.pD=this.cD.Qg(this.tD).setMouseInteractions(!1),this.yD=new rl((()=>this.uD.Ee(this.tD).setMouseInteractions(!0).setMouseEnterEventHandler(this.OP).setMouseLeaveEventHandler(this.NP).setMouseClickEventHandler(this.GP).setMouseDoubleClickEventHandler(this.UP).setMouseDownEventHandler(this.WP).setMouseUpEventHandler(this.YP).setMouseMoveEventHandler(this.HP).setMouseDragEventHandler(this.$P).setMouseDragStartEventHandler(this.XP).setMouseDragStopEventHandler(this.jP).setMouseWheelEventHandler(this.ZP).setTouchStartEventHandler(this.JP).setTouchMoveEventHandler(this.KP).setTouchEndEventHandler(this.qP))),this.mD=new rl((()=>this.cD.Ee(this.tD).setMouseInteractions(!1))),this.vD=new rl((()=>this.cD.Wr(this.tD).setMouseInteractions(!1))),this.SD=new rl((()=>this.cD.gm(this.tD,{},[Za.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.xD=new rl((()=>this.cD.He(this.tD).setMouseInteractions(!1))),this.bD=new rl((()=>this.cD.Nv(this.tD).setMouseInteractions(!1))),this.MD=new rl((()=>this.cD.Ee(this.tD).setMouseInteractions(!1))),this._D=new rl((()=>this.cD.W_(this.tD).setMouseInteractions(!1))),this.wD=new rl((()=>this.cD.ud(this.tD).setMouseInteractions(!1))),this.Dp(r,this.uiScale),this.onResize((()=>{this.gP=!0,this.cs.Ms(),this.tD.it(this._g.oi()),this.iD.it(this._g.oi())})),this.CD=this.hs.Bg([this.gD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}af(){return[]}dispose(){return super.dispose(),this.lD.Y(),this.uD.Y(),this.cD.Y(),this.dD.Y(),this.fD.Y(),ua(this.tD),ua(this.iD),this.QP.dispose(),this.vD.Lm(),this.yD.Lm(),this.mD.Lm(),this.SD.Lm(),this.xD.Lm(),this.bD.Lm(),this.MD.Lm(),this._D.Lm(),this.wD.Lm(),this}J(){return super.J(),this.tD.J(),this.iD.J(),this}K(){return super.K(),this.tD.K(),this.iD.K(),this}setBackgroundEffect(t){return this.CD.bs(t),this.cs.Ms(),this}getBackgroundEffect(){return this.CD._s()}setInteractionScrollOnWheel(t){return this.BP=t,this}getInteractionScrollOnWheel(){return this.BP}setInteractionPanOnTouch(t){return this.LP=t,this}getInteractionPanOnTouch(){return this.LP}onCellMouseEnter(t){return this.R.on(af.cellMouseEnter,t)}offCellMouseEnter(t){return this.R.off(t)}onCellMouseLeave(t){return this.R.on(af.cellMouseLeave,t)}offCellMouseLeave(t){return this.R.off(t)}onCellMouseClick(t){return this.R.on(af.cellMouseClick,t)}offCellMouseClick(t){return this.R.off(t)}onCellMouseDoubleClick(t){return this.R.on(af.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.R.off(t)}onCellMouseDown(t){return this.R.on(af.cellMouseDown,t)}offCellMouseDown(t){return this.R.off(t)}onCellMouseUp(t){return this.R.on(af.cellMouseUp,t)}offCellMouseUp(t){return this.R.off(t)}onCellMouseMove(t){return this.R.on(af.cellMouseMove,t)}offCellMouseMove(t){return this.R.off(t)}onCellMouseDrag(t){return this.R.on(af.cellMouseDrag,t)}offCellMouseDrag(t){return this.R.off(t)}onCellMouseDragStart(t){return this.R.on(af.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.R.off(t)}onCellMouseDragStop(t){return this.R.on(af.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.R.off(t)}onCellMouseWheel(t){return this.R.on(af.cellMouseWheel,t)}offCellMouseWheel(t){return this.R.off(t)}onCellTouchStart(t){return this.R.on(af.cellTouchStart,t)}offCellTouchStart(t){return this.R.off(t)}onCellTouchMove(t){return this.R.on(af.cellTouchMove,t)}offCellTouchMove(t){return this.R.off(t)}onCellTouchEnd(t){return this.R.on(af.cellTouchEnd,t)}offCellTouchEnd(t){return this.R.off(t)}setGridBackgroundFillStyle(t){return this.gD.Re(t),this.cs.Ms(),this}getGridBackgroundFillStyle(){return this.gD.Jh()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const n=i,o=s,h=r;let a=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.dP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.dP.splice(this.dP.indexOf(i),1):(i.min=e,i.max=e),this.SP=!0,this.cs.Ms(),this}setRowHeight(t,e){let i=this.fP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.fP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.fP.splice(this.fP.indexOf(i),1):(i.min=e,i.max=e),this.SP=!0,this.cs.Ms(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.TD(t,(t=>this.FD(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.ID(t,(t=>this.FD(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.zP(t,e,(t=>this.FD(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.aD={...this.aD,...t},this.PD((t=>this.FD(t,this.aD))),this}setCellBorders(t,e,i){return this.zP(t,e,(t=>this.RP(t,i))),this}setRowBorders(t,e){return this.ID(t,(t=>this.RP(t,e))),this}setColumnBorders(t,e){return this.TD(t,(t=>this.RP(t,e))),this}setCellsBorders(t){return this.VP=void 0===t?df:t,this.PD((t=>this.RP(t,this.VP))),this}setCellsBorderStrokeStyle(t){return this.nD="function"==typeof t?t(this.nD):t,this.TP=!0,this.cs.Ms(),this}setColumnTextFillStyle(t,e){return this.TD(t,(t=>this.DD(t,e))),this}setRowTextFillStyle(t,e){return this.ID(t,(t=>this.DD(t,e))),this}setCellTextFillStyle(t,e,i){return this.zP(t,e,(t=>this.DD(t,i))),this}setCellsTextFillStyle(t){return this.hD="function"==typeof t?t(this.hD):t,this.PD((t=>this.DD(t,this.hD))),this}setColumnTextFont(t,e){return this.TD(t,(t=>this.BD(t,e))),this}setRowTextFont(t,e){return this.ID(t,(t=>this.BD(t,e))),this}setCellTextFont(t,e,i){return this.zP(t,e,(t=>this.BD(t,i))),this}setCellsTextFont(t){return this.eD="function"==typeof t?t(this.eD):t,this.PD((t=>this.BD(t,this.eD))),this}setColumnContentAlignment(t,e){return this.TD(t,(t=>this.LD(t,e))),this}setRowContentAlignment(t,e){return this.ID(t,(t=>this.LD(t,e))),this}setCellContentAlignment(t,e,i){return this.zP(t,e,(t=>this.LD(t,i))),this}setCellsContentAlignment(t){return this.oD=t,this.PD((t=>this.LD(t,this.oD))),this}setCellBackgroundFillStyle(t,e,i){return this.zP(t,e,(t=>this.RD(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.TD(t,(t=>this.RD(t,e))),this}setRowBackgroundFillStyle(t,e){return this.ID(t,(t=>this.RD(t,e))),this}setCellsBackgroundFillStyle(t){return this.rD="function"==typeof t?t(this.rD):t,this.PD((t=>this.RD(t,this.rD))),this}setCellHighlight(t,e,i){return this.zP(t,e,(t=>{t.highlight=ke(i)})),this.kP=!0,this.cs.Ms(),this}setColumnHighlight(t,e){const i=ke(e);return this.TD(t,(t=>{t.highlight=i})),this.kP=!0,this.cs.Ms(),this}setRowHighlight(t,e){const i=ke(e);return this.ID(t,(t=>{t.highlight=i})),this.kP=!0,this.cs.Ms(),this}removeCell(t,e){return this.zP(t,e,(t=>this.cP.splice(this.cP.indexOf(t),1))),this.vP=!0,this.cs.Ms(),this}removeRow(t){return this.ID(t,(t=>this.cP.splice(this.cP.indexOf(t),1))),this.cP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.vP=!0,this.cs.Ms(),this}removeColumn(t){return this.TD(t,(t=>this.cP.splice(this.cP.indexOf(t),1))),this.cP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.vP=!0,this.cs.Ms(),this}removeCells(){return this.cP.splice(0),this.vP=!0,this.cs.Ms(),this}getColumnMax(){return 0===this.cP.length?0:this.cP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.cP.length?0:this.cP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}ze(t){super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp();const e=Math.round(this.nD.N()),i=e/2;let s=this.pP||this.yP||this.mP||this.vP||this.SP||this.xP||this.wP||this.CP||this.TP||this.IP;if(s){this.cP.forEach((t=>{this.DP.add(t.column)})),this.cP.forEach((t=>{this.PP.add(t.row)}));const t=this.vD.Dm(),r=this.ED(i,t);t.finishPlot();const n=this.zD(this.DP.size,r),o=this.VD(this.PP.size,r),h=n.reduce(Je,0)+e,a=o.reduce(Je,0)+e,l=new Array(n.length+1).fill(0).map(((t,e)=>n.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===n[e])),e=this.OD.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.OD={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.yP||this.mP||this.vP||this.bP||this.MP||this._P||this.CP||this.kP||this.TP||this.gP||this.IP;if((r||this.FP)&&this.OD){const t=this._g.getInnerIntervalPixels(),s=ga.Np(this.Ch,this.Lp),n=[this.Ia.left+i,this.Ia.right+i],o=[this.Ia.bottom+i,this.Ia.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.Ia.left,this.Ia.right],l=[this.Ia.bottom,this.Ia.top+s],u={x:Math.round(t.x-a[0]-a[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.iD.Ei(n).zi(o).Vi(0,h.x).Oi(0,h.y),this.QP.EI({x:this.OD.dataGridHeight,y:this.OD.dataGridWidth}).Os().ze();const d={x:Math.round(this.sD.x),y:Math.round(Math.min(0,this.sD.y))};this.tD.Ei(a).zi(l).Vi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.gD.Ve({x:c.x,y:c.y});const f={x:this.tD.x.ei(),y:this.tD.y.ei()+this.QP.LI(),width:this.tD.x.ri()+e-this.QP.LI(),height:this.tD.y.ri()+e};this.cD.wx(f),this.uD.wx(f),this.lD.wx(f);const g=this.OD,m=[{x:this.tD.x.getInnerStart(),y:this.tD.y.getInnerStart()},{x:this.tD.x.getInnerEnd(),y:this.tD.y.getInnerStart()},{x:this.tD.x.getInnerEnd(),y:this.tD.y.getInnerEnd()},{x:this.tD.x.getInnerStart(),y:this.tD.y.getInnerEnd()}];g.cellsContentSizes.forEach((t=>{var e;const i={x:c.x+g.columnWidthsCumulative[t.cell.column],y:c.y-g.rowHeightsCumulative[t.cell.row+t.cell.rowSpan]},s={x:i.x+g.columnWidths[t.cell.column],y:i.y+g.rowHeights[t.cell.row]},r=Ze([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.ND(c,this.OD,e)}this.gP=!1,this.pP=!1,this.yP=!1,this.mP=!1,this.vP=!1,this.SP=!1,this.xP=!1,this.bP=!1,this.MP=!1,this._P=!1,this.wP=!1,this.CP=!1,this.kP=!1,this.TP=!1,this.FP=!1,this.IP=!1}ED(t,e){const i=[],s={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.cP){const{content:r}=t,n={...this.aD,...t.padding};let o,h,a,l={x:0,y:0};if("string"==typeof r||"number"==typeof r){const i=String(r);o=e.add(),l=o.Sr(i).ir(t.textFont||this.eD).Os().od()}if(Vd(r)&&(h=r,l={x:200,y:50}),po(r)){const t=this.cs.GD(r);t.UD()?(a=r,l=a.oi()):t.WD((()=>{this.IP=!0,this.cs.Ms()}))}if(o||h||a){n.top=Math.round(n.top),n.left=Math.round(n.left),n.right=Math.round(n.right),n.bottom=Math.round(n.bottom);const e={x:Math.round(l.x+n.left+n.right+s.left+s.right),y:Math.round(l.y+n.top+n.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:h,icon:a,cellPadding:n,cellMargin:s})}}return i}ND(t,i,s){const{dataGridWidth:r,dataGridHeight:n,cellsContentSizes:o,columnWidths:h,columnWidthsCumulative:a,rowHeights:l,rowHeightsCumulative:u}=i,c={x:r-s,y:-n+s};this.gD.it(c),this.pD.Ye(this.nD),this.AP.clear();const d={cellBackground:this.yD.Dm(),cellIconRect:this.mD.Dm(),lineSet:this.SD.Dm(),line:this.xD.Dm(),pointSet:this.bD.Dm(),rect:this.MD.Dm(),junction:this._D.Dm(),arc:this.wD.Dm()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,y={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},A={x:p.x+m.left,y:p.y+m.bottom},x={x:A.x+g.left,y:A.y+g.bottom},S={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:S.x-m.left-m.right,y:S.y-m.top-m.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=cf(x,b,r.contentAlignment||this.oD);n.Ve(t[0]).Za({x:t[1],y:t[2]}).Re(this.YD(r.textFillStyle||this.hD,r.content,this.hD)).ds(r.highlight)}const M=this.YD(r.backgroundFillStyle||this.rD,r.content);if(M!==_){const t=d.cellBackground.add();t.Ve(p).it(S).Re(M).Le(ut).ds(r.highlight),this.AP.set(t,y)}const C=r.borders||this.VP;if(C&&uf(p,S,C,s,f),o){const t=x,e=b;Gd(o,d,this.tD,t,e,this.ts,this.CA,r.highlight)}if(c){const t=c.oi(),i=cf(x,b,r.contentAlignment||this.oD);d.cellIconRect.add().Ve({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).it(t).Re(new Q({source:c.yc,fitMode:e.ImageFitMode.Stretch})).Le(ut).ds(r.highlight)}}this.pD.Ot();for(const t of f)this.pD.Zr().Kg(t[0],t[1]);d.cellBackground.finishPlot(),d.cellIconRect.finishPlot(),d.lineSet.finishPlot(),d.line.finishPlot(),d.pointSet.finishPlot(),d.rect.finishPlot(),d.junction.finishPlot(),d.arc.finishPlot()}zD(t,e){const i=new Array(t).fill(0);for(const t of this.DP.values()){const s=e.filter((e=>t>=e.cell.column&&t+1<=e.cell.column+e.cell.columnSpan)).reduce(((t,e)=>{const i=e.contentSize.x/e.cell.columnSpan;return Math.max(t,i)}),0),r=this.dP.find((e=>e.column===t)),n=r?_t(s,void 0!==r.min?r.min:He,void 0!==r.max?r.max:Ye):s;i[t]=n}return i}VD(t,e){const i=new Array(t).fill(0);for(const t of this.PP.values()){const s=e.filter((e=>t>=e.cell.row&&t+1<=e.cell.row+e.cell.rowSpan)).reduce(((t,e)=>{const i=e.contentSize.y/e.cell.rowSpan;return Math.max(t,i)}),0),r=this.fP.find((e=>e.row===t)),n=r?_t(s,void 0!==r.min?r.min:He,void 0!==r.max?r.max:Ye):s;i[t]=n}return i}YD(t,e,i){if(j(t)){try{const i=Number(e);return new N({color:t.getPalette().getColors(i)})}catch(t){}return i||_}return t}DD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.hD):e,this._P=!0,this.cs.Ms()}BD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.eD):e,this.wP=!0,this.cs.Ms()}RD(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.rD):e,this.MP=!0,this.cs.Ms()}LD(t,e){t.contentAlignment=e,this.bP=!0,this.cs.Ms()}FD(t,e){t.padding={...t.padding,...e},this.xP=!0,this.cs.Ms()}kD(t,e,i){let s=this.zP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.cP.push(s),this.mP=!0),"string"==typeof s.content||"number"==typeof s.content?this.pP=!0:this.yP=!0,this.cs.Ms()}PD(t){this.cP.forEach((e=>t(e)))}zP(t,e,i){const s=this.cP.find((i=>t>=i.column&&t+1<=i.column+i.columnSpan&&e>=i.row&&e+1<=i.row+i.rowSpan));return s&&i&&i(s),s}TD(t,e){const i=this.cP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}ID(t,e){const i=this.cP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}AD(){return new of(this.fD,this.dD,this.iD,this.iD,this.tD,this.ts,tf.Both).onScroll(((t,e)=>{this.OD&&(t===tf.Vertical&&(this.sD.y=-e),t===tf.Horizontal&&(this.sD.x=e),this.FP=!0,this.cs.Ms())})).rP(50).nP(12)}}const af={cellMouseEnter:"cellMouseEnter",cellMouseLeave:"cellMouseLeave",cellMouseClick:"cellMouseClick",cellMouseDoubleClick:"cellMouseDoubleClick",cellMouseDown:"cellMouseDown",cellMouseUp:"cellMouseUp",cellMouseMove:"cellMouseMove",cellMouseDrag:"cellMouseDrag",cellMouseDragStart:"cellMouseDragStart",cellMouseDragStop:"cellMouseDragStop",cellMouseWheel:"cellMouseWheel",cellTouchStart:"cellTouchStart",cellTouchMove:"cellTouchMove",cellTouchEnd:"cellTouchEnd"};var lf;e.DataGridCellContentAlignmentOptions=void 0,(lf=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",lf.RightCenter="right-center",lf.LeftCenter="left-center",lf.RightTop="right-top",lf.LeftTop="left-top",lf.RightBottom="right-bottom",lf.LeftBottom="left-bottom",lf.CenterTop="center-top",lf.CenterBottom="center-bottom";const uf=(t,e,i,s,r)=>{const n={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},h={x:t.x+e.x,y:t.y},a={x:t.x+e.x,y:t.y+e.y};i.top&&r.push([o,a]),i.bottom&&r.push([n,h]),i.left&&r.push([n,o]),i.right&&r.push([h,a])},cf=(t,e,i)=>{const s=t.x,r=t.x+e.x,n=t.x+e.x/2,o=t.y+e.y,h=t.y,a=t.y+e.y/2;switch(i){case"left-center":return[u(s,a),-1,0];case"right-center":return[u(r,a),1,0];case"center":return[u(n,a),0,0];case"left-bottom":return[u(s,h),-1,-1];case"right-bottom":return[u(r,h),1,-1];case"center-bottom":return[u(n,h),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(r,o),1,1];case"center-top":return[u(n,o),0,1]}return ze(0,`Unidentified DataGrid cell content alignment option: ${i}`)},df={top:!1,bottom:!1,left:!1,right:!1};class ff extends gr{constructor(t,e,i,s,r,n){super(t,{Dr(){},Pr(){},Lr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.hs=n,this.Rs=r,this.Fh=r.Wr(t.HD).ir(this.ts.barChartCategoryAxisTitleFont||this.ts.xAxisTitleFont).Re(this.ts.barChartCategoryAxisTitleFillStyle||this.ts.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Es.getWidth({x:0,y:-90})),this.hr=this.hs.Bg([this.Fh]).bs(e.effectsText),this.$D=r.He(t.HD).Ye(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Vg=t,this.Og=t):"object"==typeof t&&(this.Vg=t.min,this.Og=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Vg,max:this.Og}}setStrokeStyle(t){return this.$D.Ye(t),this.chart.cs.Ms(),this}getStrokeStyle(){return this.$D.xu()}Os(){if(!this.Zi)return{Wg:0,Yg:0,Qd:_t(0,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye)};const t=this.$D.xu().N()/2,e=this.chart.Es.getHeight(this.Fh.Os().od());return{Wg:t,Yg:e,Qd:t+e}}ze(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.$D.Xe(this.chart.Es.toPoint(r.start,n.start)).$e(this.chart.Es.toPoint(r.end,n.start)).setVisible(this.Zi),this.Fh.Ve(this.chart.Es.toPoint(.5*(r.start+r.end),this.chart.valueAxis.At.pi(n.start,-(t.Wg+s.labelMarginBeforeCategoryAxisPixels)))).Za(this.chart.Es.toPoint(0,1)).setVisible(this.Zi)}setMouseInteractions(t){return this}Mr(t,e){return new mr(e,t,this.Rs,this.chart.HD)}_r(t,e){return{}}Er(t,e){return e}Vr(t,e,i){return{min:t,max:e}}}class gf extends gr{constructor(t,e,i,s,r,n,o){super(t,{Dr:()=>{var e;if(t.XD){if("positive"===t.jD||"bipolar"===t.jD){if("after-bar"===(null===(e=t.ZD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.XD.max,Math.min(this.chart.Es.getHeight(this.chart.QD())+t.ZD.labelMargin,.3*e))}return t.XD.max}return t.JD?_t(-1,-1e-6,t.XD.max):0}},Pr:()=>{var e;if(t.XD){if("negative"===t.jD||"bipolar"===t.jD){if("after-bar"===(null===(e=t.ZD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.XD.min,-Math.min(this.chart.Es.getHeight(this.chart.QD())+t.ZD.labelMargin,.3*e))}return t.XD.min}return t.JD?_t(1,1e-6,t.XD.min):0}},Lr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.hs=n,this.Rs=r,this.Fh=r.Wr(t.HD).ir(this.ts.barChartValueAxisTitleFont||this.ts.yAxisTitleFont).Re(this.ts.barChartValueAxisTitleFillStyle||this.ts.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Es.getHeight({x:0,y:-90})),this.hr=this.hs.Bg([this.Fh]).bs(e.effectsText),this.$D=r.He(t.HD).Ye(e.barChartValueAxisStrokeStyle||this.ts.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Vg=t,this.Og=t):"object"==typeof t&&(this.Vg=t.min,this.Og=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Vg,max:this.Og}}setStrokeStyle(t){return this.$D.Ye(t),this.chart.cs.Ms(),this}getStrokeStyle(){return this.$D.xu()}setTickStrategy(t,e){return super.Hh(t,e)}Os(t){if(!this.Zi)return this.rr(),{Wg:0,Yg:0,Qd:_t(0,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye)};const e=this.chart.Es.getWidth(this.chart.HD).ri(),i=this.At.ri();this.dr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.uh.values())for(const e of t.values()){const t=e.Eh.je,i=this.chart.Es.getWidth(e.rh.od()),r=t.getTickLength()+t.getTickPadding()+i;s=Math.max(s,r)}const r=s+this.$D.xu().N()/2,n=this.chart.Es.getWidth(this.Fh.Os().od());return{Wg:r,Yg:n,Qd:_t(r+n,void 0!==this.Vg?this.Vg:0,void 0!==this.Og?this.Og:Ye)}}ze(t){const e=this.getInterval();this.$D.Xe(this.chart.Es.toPoint(-.5,this.$h)).$e(this.chart.Es.toPoint(-.5,this.Xh)).setVisible(this.Zi);const i="logarithmic"===this.Wh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Es.toPoint(this.chart.categoryAxis.At.pi(-.5,t.Wg*this.chart.Es.KD),i),r=this.chart.Es.toPoint(this.chart.Es.qD,0);this.Fh.Ve(s).Za(r).setVisible(this.Zi)}setMouseInteractions(t){return this}Mr(t,e){return new mr(e,t,this.Rs,this.chart.HD)}_r(t,e){const i=t.Eh.je,s=this.chart.Es.toPoint(-.5,t.M),r=this.chart.HD.pi(s,this.chart.Es.toPoint(i.getTickLength()*this.chart.Es.KD,0)),n=this.chart.HD.pi(s,this.chart.Es.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Es.KD,0)),o=this.chart.HD.pi(r,this.chart.Es.toPoint(i.getTickPadding()*this.chart.Es.KD,0));t.rh.Ve(o).Za(this.chart.Es.toPoint(this.chart.Es.qD,i.getLabelAlignment())).sr(i.getLabelRotation()),i.tickStyle!==ut&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==ut&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}Er(t,e){return"linear"===this.Wh.type?Qi(t,e,this.At):ts(t,e,this.At)}Vr(t,e,i){return{min:t,max:e}}}class mf extends su{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Jo=_e(),this.M=0,this.tB=!1,this.chart=t,this.chart=t,this.category=r,this.subCategory=n,this.Cs=r,this.Ie=ve(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Pe=ve(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.chart.iB()})),this.onDispose((()=>{this.chart.iB(),this.chart.sB.delete(this.category),this.chart.eB.delete(this)}))}Ki(t,e){const i=this.chart.cs.Uo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.chart.cs.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.chart.cs.At},category:this.category,subCategory:this.subCategory,bar:this,value:this.getValue()}}setValue(t){return this.tB=!0,this.M=t,this.chart.iB(),this.chart.cs.Ms(),this.chart.sB.delete(this.category),this.chart.eB.delete(this),this}getValue(){return this.M}get value(){return this.M}setFillStyle(t){return this.Ie="function"==typeof t?t(this.Ie):t,this.chart.iB(),this}getFillStyle(){return this.Ie}setStrokeStyle(t){return this.Pe="function"==typeof t?t(this.Pe):t,this.chart.iB(),this}getStrokeStyle(){return this.Pe}Av(){return this.yv}setEffect(t){return this.chart.setBarsEffect(t),this}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:this.Ie})}}const yf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),pf=(t,e,i)=>{const s=t.Od.filter((t=>void 0!==t)),r=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),n=Math.ceil(r/(e/s.length));return n<=1?s:s.filter(((t,e)=>e%n==0))};class Af extends Sl{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.Bp("barChart bg",0),s,e.cs.ts.barChartBackgroundFillStyle||e.cs.ts.chartXYBackgroundFillStyle,e.cs.ts.barChartBackgroundStrokeStyle||e.cs.ts.chartXYBackgroundStrokeStyle,e.cs.ts.barChartTitleFont||e.cs.ts.chartXYTitleFont,e.cs.ts.barChartTitleFillStyle||e.cs.ts.chartXYTitleFillStyle,n),this.coordsBars="barChart",this.hB=xf.Descending,this.rB=this.ts.barChartCategoryLabels,this.ZD=this.ts.barChartValueLabelsAfterBars,this.nB=!1,this.i_=Oe(),this.sB=new Map,this.eB=new Map,this.jD="positive",this.oB="columns",this.aB=!0,this.lB=new Map,this.uB={speed:1},this.Ly={speed:1},this.cB=.08,this.dB=[],this.kn=(t,e,i,s,r)=>{this.HD.it(s,r)},this.cs.Jn(Sh.vf),this.Es="horizontal"===(null==o?void 0:o.type)?vf:Sf,this.Ch.Sr("Bar Chart"),this.fB=e.tm("barChart plotting 1",0),this.AB=e.tm("barChart plotting 2",1),this.JD="logarithmic"===(null===(h=null==o?void 0:o.valueAxis)||void 0===h?void 0:h.type),this.JD?"horizontal"===this.Es.gB?(a=i.d1({scale1DConstructor:Gi,dimension:"y"}),this.HD=(new Hi).Ri(i.d1({scale1DConstructor:Fi,dimension:"x"}),a)):(a=i.d1({scale1DConstructor:Gi,dimension:"x"}),this.HD=(new Hi).Ri(a,i.d1({scale1DConstructor:Fi,dimension:"y"}))):(this.HD=i.d2({scaleXYConstructor:Yi}),a=this.Es.getWidth(this.HD)),this.pB=this.hs.Bg(),this.h_=new sl((()=>this.i_.Mt(this.fB.Km(this.HD).ua(0))),((t,e,i)=>(t.Re(i.fillStyle).Le(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Zr();return i.Fl(e.vertices),this.i_.Vt(i,e.bar),e.bar.ys([i]),i})))),(()=>{this.i_.Ot()}),(t=>{this.pB.gs(t)})),this.$v=this.gp.Ee(this.HD).Re(this.ts.barChartSeriesBackgroundFillStyle||_).Le(ut),this.Xv=this.gp.Ee(this.HD).Re(_).Le(this.ts.barChartSeriesBackgroundStrokeStyle||ut).setMouseInteractions(!1),super.Hv(this.$v,this.Xv),this.categoryAxis=new ff(this,this.ts,!1!==(null==o?void 0:o.animationsEnabled),a,this.AB,this.hs);const l=Ji(null==o?void 0:o.valueAxis);this.valueAxis=new gf(this,this.ts,!1!==(null==o?void 0:o.animationsEnabled),this.Es.getHeight(this.HD),this.AB,this.hs,l.type),this.yB=new rl((()=>this.AB.Wr(this.HD).Ur(Le).Gr(Le).ua(1))),this.mB=new sl((()=>this.gp.Qg(this.HD).setMouseInteractions(!1)),((t,e,i)=>(t.Ye(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Zr()).Kg(e[0],e[1]))))));const u=e.sm(),c=Vt(o?o.cursorBuilder:void 0,Fa);this.hm=pa(this,u,c._y(u,this.uiScale,this.uiScale,Ot,this.ts),this,"show-pointed",bf,(()=>0)),this.onResize(this.kn),this.Dp(r,this.HD),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.Gv}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Fa){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}setBarsMargin(t){return this.cB=_t(t,0,.49),this.nB=!0,this.cs.Ms(),this}getBarsMargin(){return this.cB}setBarsEffect(t){return this.pB.bs(t),this.cs.Ms(),this}getBarsEffect(){return this.pB._s()}setData(t){let e;if(Array.isArray(t))e=[],t.forEach(((t,i)=>{"string"==typeof t?e.push({category:t}):"number"==typeof t?e.push({category:`Category ${i+1}`,value:t}):"object"==typeof t&&e.push(t)}));else{e=[];const i=Object.keys(t);for(const s of i){const i=t[s];e.push({category:s,value:"number"==typeof i?i:void 0})}}return this.vB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.vB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.vB("groups",i),this}vB(t,e){this.Gv.length>0&&this.cs.Jn(Sh.Df),this.oB=t,this.dB=e.map((t=>({category:t.category,subCategory:t.subCategory}))),this.SB(e);const i=we(e.map((t=>t.category))),s=i.length,r=we(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.Gv.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),n=r.includes(t.subCategory)?r.indexOf(t.subCategory):void 0;e=new mf(this,this.Wv,this.ts,this.cs.hs,t.category,t.subCategory,Vt(n,s)),this.jv(e),this.lB.set(e,{category:s,valueStart:this.JD?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.Gv.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.lB.delete(t))})),this.categoryAxis.setInterval(this.Es.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.XD=0===this.Gv.length?void 0:"stacks"!==t?this.Gv.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Ye,max:He}):{min:0,max:i.reduce(((t,i)=>Math.max(t,e.reduce(((t,e)=>e.category!==i?t:void 0!==e.value?t+e.value:t),0))),0)},this.XD&&(this.jD=this.XD.min>=0?"positive":this.XD.max<=0?"negative":"bipolar",("bipolar"===this.jD||"negative"===this.jD)&&this.JD))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.SB(this.Gv),this.sB.clear(),this.eB.clear(),this.nB=!0,this.cs.Ms()}setCategoryLabels(t){const e="function"==typeof t?this.rB?t(this.rB):this.rB:t;return this.rB=e?{...this.ts.barChartCategoryLabels,...e}:void 0,this.sB.clear(),this.cs.Ms(),this}getCategoryLabels(){return this.rB}setValueLabels(t){var e;const i="function"==typeof t?this.ZD?t(this.ZD):this.ZD:t,s=(null==i?void 0:i.position)||(null===(e=this.ZD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.ZD={...this.ts.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.ZD={...this.ts.barChartValueLabelsInsideBars,...i}):this.ZD=void 0,this.eB.clear(),this.cs.Ms(),this}getValueLabels(){return this.ZD}setLabelFittingEnabled(t){return this.aB=t,this.cs.Ms(),this}getLabelFittingEnabled(){return this.aB}getBar(t,e){if(("groups"===this.oB||"stacks"===this.oB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.Gv.find((i=>i.category===t&&(void 0===e||e===i.subCategory)));if(!i)throw new Error(`BarChart.getBar() no such bar: "${t}" ${e?`"${e}"`:""}`);return i}getBars(){return this.Gv}setSorting(t){this.hB=t;const e=this.Gv.slice();return this.Gv.length=0,this.Gv.push(...Ee(this.dB.map((t=>e.find((e=>e.category===t.category&&(void 0===t.subCategory||t.subCategory===e.subCategory))))))),this.SB(this.Gv),this.cs.Ms(),this}getSorting(){return this.hB}setAnimationCategoryPosition(t,e=1){return this.uB=t?{speed:e}:void 0,this.cs.Ms(),this}setAnimationValues(t,e=1){return this.Ly=t?{speed:e}:void 0,this.cs.Ms(),this}translateCoordinate(t,e,i){if(i&&Zi(t)&&$i(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(ji(t))r=this.cs.Uo(t);else if(Zi(t)){const e=yt(t,this._g,this.cs.At);r={engineX:e.x,engineY:e.y}}else{if(!yf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=yt(this.Es.toPoint(t.iCategory,t.value),this.HD,this.cs.At);r={engineX:e.x,engineY:e.y}}}if(Wi(s))return this.cs.Wo(r);if("barChart"===s){const t=yt({x:r.engineX,y:r.engineY},this.cs.At,this.HD);return{iCategory:this.Es.getWidth(t),value:this.Es.getHeight(t)}}if($i(s))return yt({x:r.engineX,y:r.engineY},this.cs.At,this._g);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}af(){if("columns"===this.oB)return this.Gv;const t=we(Ee(this.Gv.map((t=>t.subCategory))));return Ee(t.map((t=>{const e=this.Gv.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,r)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(r):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,r){return Ie(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}ze(t){var e,i;super.ze(t);const s=this.yB.Dm(),r=this.mB.Dm(),n=this.Gv.filter((t=>t.getVisible()&&t.tB)),o=we(n.map((t=>t.category))),h=we(Ee(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.uB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.uB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.At,c=u instanceof Gi?(t,e)=>{var i;return Qi(t,e,u,(null===(i=this.Ly)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return ts(t,e,u,(null===(i=this.Ly)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.oB?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.JD?1e-6:0,valueEnd:t.value}}))):"groups"===this.oB?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.cB),r=this.cB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.JD?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.JD?1e-6:0;i.forEach(((e,i)=>{d.push({bar:e,position:{category:o.indexOf(t),valueStart:s,valueEnd:s+e.value}}),s+=e.value}))}))),d.forEach((t=>{const{bar:e,position:i}=t;let s,r,n=this.lB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.uB&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+a*t+l*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.Ly&&n.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-n.valueEnd);r=c(n.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-r)&&(r=i.valueEnd)}else r=i.valueEnd;this.lB.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.cs.Ms(!0),s===n.category&&r===n.valueEnd||(this.nB=!0)})),ga.Gp(this.Ch,this.Lp);const f=n.length>0;this.categoryAxis.Rr(),this.valueAxis.Rr();const g=this.categoryAxis.setVisible(f).Os(),m=this.valueAxis.setVisible(f).Os(r),{labelMarginBeforeCategoryAxisPixels:y}=f?this.xB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.ze(g,s,r,{labelMarginBeforeCategoryAxisPixels:y}),this.valueAxis.ze(m);const p=this.categoryAxis.getThickness(),A=_t(g.Qd+y,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Ye),x={x:Math.min(this.HD.x.getInnerStart(),this.HD.x.getInnerEnd()),y:Math.min(this.HD.y.getInnerStart(),this.HD.y.getInnerEnd())},S=Math.max(this.HD.x.getInnerStart(),this.HD.x.getInnerEnd()),v=Math.max(this.HD.y.getInnerStart(),this.HD.y.getInnerEnd()),b={x:S-x.x,y:v-x.y};this.$v.Ve(x),this.$v.it(b),this.Xv.Ve(x),this.Xv.it(b),super.Pp(),this.hm.ze(!1,this.Gv,void 0);const M=ga.Np(this.Ch,this.Lp);if(this.HD.zi([this.Xt.bottom+this.Ia.bottom+("vertical"===this.Es.gB?A:0),this.Xt.top+this.Ia.top+M+("horizontal"===this.Es.gB?m.Qd:0)]),this.HD.Ei([this.Xt.left+this.Ia.left+this.Es.getHeight({x:A,y:m.Qd}),this.Xt.right+this.Ia.right]),this.fB.wx({x:this.HD.x.ei(),y:this.HD.y.ei(),width:this.HD.x.ri(),height:this.HD.y.ri()}),this.cp&&this.cp(),this.nB){const t=this.h_.Dm(),e="groups"===this.oB?1/(h.length+2*(h.length+1)*this.cB):1-2*this.cB;n.forEach((i=>{const s=this.lB.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Es.toPoint(r,s.valueStart),this.Es.toPoint(r,s.valueEnd),this.Es.toPoint(n,s.valueEnd),this.Es.toPoint(n,s.valueStart)];t.add({Jo:i.Jo,vertices:o,bar:i},{fillStyle:i.Ie,strokeStyle:i.Pe})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.nB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(t),this.setAnimationValues(t),this.valueAxis.setAnimationsEnabled(t),this.categoryAxis.setAnimationsEnabled(t),this}dispose(){return this.AB.Y(),this.fB.Y(),this.hm.Y(),super.dispose()}SB(t){const e=this.hB;e&&t.sort(((i,s)=>e({category:i.category,value:t.reduce(((t,e)=>t+(e.category===i.category&&e.value||0)),0)},{category:s.category,value:t.reduce(((t,e)=>t+(e.category===s.category&&e.value||0)),0)})))}xB(t,e,i,s){let r=0;const n=this.rB,o=this.ZD,h=this.valueAxis.getInterval(),a=this.Es.getWidth({x:this.HD.x.ri(),y:this.HD.y.ri()});if(n&&n.labelFillStyle!==_){const o=n.tickLength+n.labelMargin,l=this.Es.toPoint(0,1),u={Od:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),r=n.formatter(t,s);if(!r)return;const a=i;return void 0!==a?{text:r,position:this.Es.toPoint(a,this.valueAxis.At.pi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.bB(t,s)}:void 0})),Ju:n.labelFont,At:this.HD},c=u?this.aB?pf(u,a,this.Es.getWidth):u.Od:[];c.forEach((t=>{t&&i.add().Sr(t.text).Ve(t.position).Za(t.alignment).sr(t.rotation).Re(n.labelFillStyle).ir(n.labelFont)})),n.tickStyle!==ut&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Es.getWidth(t.position);s.add({positions:[this.Es.toPoint(e,this.valueAxis.At.getInnerStart()),this.Es.toPoint(e,this.valueAxis.At.pi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Es.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==_){let t;"after-bar"===o.position?t={Od:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.lB.get(t);return void 0!==s?{text:i,position:this.Es.toPoint(s.category,this.valueAxis.At.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Es.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.MB(t)}:void 0})),Ju:o.labelFont,At:this.HD}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Od:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.lB.get(t);if(void 0===s)return;const r="bipolar"===this.jD?Math.sign(s.valueEnd):"negative"===this.jD?-1:1,n=this.Es.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*r:"inside-bar-centered"===o.position?0:-1*r);return{text:i,position:this.Es.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.At.pi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.At.pi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.MB(t)}})),Ju:o.labelFont,At:this.HD}),t&&(t?this.aB?pf(t,a,this.Es.getWidth):t.Od:[]).forEach((t=>{t&&i.add().Sr(t.text).Ve(t.position).Za(t.alignment).sr(t.rotation).Re(o.labelFillStyle).ir(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}bB(t,e){if(!this.rB||this.rB.labelFillStyle===_)return{x:0,y:0};const i=this.sB.get(t);if(i)return i;const s=this.rB.formatter(t,e),r=this.cs.$g.Hg(s,this.rB.labelFont,this.rB.labelRotation);return r.isEstimate?this.cs.Ms(!0):this.sB.set(t,r),r}MB(t){if(!this.ZD||this.ZD.labelFillStyle===_)return{x:0,y:0};const e=this.eB.get(t);if(e)return e;const i=this.cs.$g.Hg(this.ZD.formatter(t,t.category,t.value),this.ZD.labelFont,this.ZD.labelRotation);return i.isEstimate?this.cs.Ms(!0):this.eB.set(t,i),i}QD(){return this.Gv.reduce(((t,e)=>{const i=this.MB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}iB(){this.nB=!0,this.cs.Ms()}getMinimumSize(){return{x:200,y:200}}}const xf={Disabled:void 0,None:void 0,Ascending:(t,e)=>t.value-e.value,Descending:(t,e)=>e.value-t.value,Alphabetical:(t,e)=>t.category.localeCompare(e.category)},Sf={...Ch,gB:"vertical",KD:-1,qD:1},vf={...Th,gB:"horizontal",KD:1,qD:-1},bf=(t,e,i)=>{const s=[[e.bar]],r=t.valueAxis.getTitle();return r&&s.push([r]),e.subCategory?s.push([e.subCategory,"",{text:Ki(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}]):s.push({text:Ki(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}),s},Mf={XY:pc,Spider:za,BarChart:Fa,Map:Oa,Polar:Pa,D3:Rl},Cf={Angola:{name:"Angola",ISO_A3:"AGO"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Gabon:{name:"Gabon",ISO_A3:"GAB"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Namibia:{name:"Namibia",ISO_A3:"NAM"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Oman:{name:"Oman",ISO_A3:"OMN"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},Somalia:{name:"Somalia",ISO_A3:"SOM"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"}},Tf={Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Armenia:{name:"Armenia",ISO_A3:"ARM"},Australia:{name:"Australia",ISO_A3:"AUS"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},China:{name:"China",ISO_A3:"CHN"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},India:{name:"India",ISO_A3:"IND"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Nepal:{name:"Nepal",ISO_A3:"NPL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Philippines:{name:"Philippines",ISO_A3:"PHL"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Palestine:{name:"Palestine",ISO_A3:"PSE"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Russia:{name:"Russia",ISO_A3:"RUS"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Singapore:{name:"Singapore",ISO_A3:"SGP"},Syria:{name:"Syria",ISO_A3:"SYR"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Yemen:{name:"Yemen",ISO_A3:"YEM"}},wf={"New South Wales":{name:"New South Wales"},Victoria:{name:"Victoria"},Queensland:{name:"Queensland"},"South Australia":{name:"South Australia"},"Western Australia":{name:"Western Australia"},Tasmania:{name:"Tasmania"},"Northern Territory":{name:"Northern Territory"},"Australian Capital Territory":{name:"Australian Capital Territory"},"Other Territories":{name:"Other Territories"}},Ef={"British Columbia":{name:"British Columbia"},Quebec:{name:"Quebec"},Nunavut:{name:"Nunavut"},"Prince Edward Island":{name:"Prince Edward Island"},Saskatchewan:{name:"Saskatchewan"},Yukon:{name:"Yukon"},Manitoba:{name:"Manitoba"},Ontario:{name:"Ontario"},"New Brunswick":{name:"New Brunswick"},"Northwest Territories":{name:"Northwest Territories"},Alberta:{name:"Alberta"},"Newfoundland and Labrador":{name:"Newfoundland and Labrador"},"Nova Scotia":{name:"Nova Scotia"}},kf={Albania:{name:"Albania",ISO_A3:"ALB"},Austria:{name:"Austria",ISO_A3:"AUT"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Denmark:{name:"Denmark",ISO_A3:"DNK"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Finland:{name:"Finland",ISO_A3:"FIN"},France:{name:"France",ISO_A3:"FRA"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Greece:{name:"Greece",ISO_A3:"GRC"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Italy:{name:"Italy",ISO_A3:"ITA"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Malta:{name:"Malta",ISO_A3:"MLT"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Poland:{name:"Poland",ISO_A3:"POL"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Romania:{name:"Romania",ISO_A3:"ROU"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Russia:{name:"Russia",ISO_A3:"RUS"},Turkey:{name:"Turkey",ISO_A3:"TUR"}},If={Aruba:{name:"Aruba",ISO_A3:"ABW"},Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},Angola:{name:"Angola",ISO_A3:"AGO"},Anguilla:{name:"Anguilla",ISO_A3:"AIA"},Albania:{name:"Albania",ISO_A3:"ALB"},Aland:{name:"Aland",ISO_A3:"ALA"},Andorra:{name:"Andorra",ISO_A3:"AND"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Argentina:{name:"Argentina",ISO_A3:"ARG"},Armenia:{name:"Armenia",ISO_A3:"ARM"},"American Samoa":{name:"American Samoa",ISO_A3:"ASM"},Antarctica:{name:"Antarctica",ISO_A3:"ATA"},"French Southern and Antarctic Lands":{name:"French Southern and Antarctic Lands",ISO_A3:"ATF"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},Australia:{name:"Australia",ISO_A3:"AUS"},Austria:{name:"Austria",ISO_A3:"AUT"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belize:{name:"Belize",ISO_A3:"BLZ"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},Canada:{name:"Canada",ISO_A3:"CAN"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Chile:{name:"Chile",ISO_A3:"CHL"},China:{name:"China",ISO_A3:"CHN"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Cyprus No Mans Area":{name:"Cyprus No Mans Area",ISO_A3:"-99"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},"Cook Islands":{name:"Cook Islands",ISO_A3:"COK"},Colombia:{name:"Colombia",ISO_A3:"COL"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Cuba:{name:"Cuba",ISO_A3:"CUB"},Curaçao:{name:"Curaçao",ISO_A3:"CUW"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},"Northern Cyprus":{name:"Northern Cyprus",ISO_A3:"-99"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Dominica:{name:"Dominica",ISO_A3:"DMA"},Denmark:{name:"Denmark",ISO_A3:"DNK"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},"Dhekelia Sovereign Base Area":{name:"Dhekelia Sovereign Base Area",ISO_A3:"-99"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Finland:{name:"Finland",ISO_A3:"FIN"},Fiji:{name:"Fiji",ISO_A3:"FJI"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},France:{name:"France",ISO_A3:"FRA"},"Faroe Islands":{name:"Faroe Islands",ISO_A3:"FRO"},"Federated States of Micronesia":{name:"Federated States of Micronesia",ISO_A3:"FSM"},Gabon:{name:"Gabon",ISO_A3:"GAB"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Guernsey:{name:"Guernsey",ISO_A3:"GGY"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Greece:{name:"Greece",ISO_A3:"GRC"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},Guam:{name:"Guam",ISO_A3:"GUM"},Guyana:{name:"Guyana",ISO_A3:"GUY"},"Hong Kong S.A.R.":{name:"Hong Kong S.A.R.",ISO_A3:"HKG"},"Heard Island and McDonald Islands":{name:"Heard Island and McDonald Islands",ISO_A3:"HMD"},Honduras:{name:"Honduras",ISO_A3:"HND"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},"Isle of Man":{name:"Isle of Man",ISO_A3:"IMN"},India:{name:"India",ISO_A3:"IND"},"Indian Ocean Territories":{name:"Indian Ocean Territories",ISO_A3:"-99"},"British Indian Ocean Territory":{name:"British Indian Ocean Territory",ISO_A3:"IOT"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Israel:{name:"Israel",ISO_A3:"ISR"},Italy:{name:"Italy",ISO_A3:"ITA"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},Jersey:{name:"Jersey",ISO_A3:"JEY"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},"Baykonur Cosmodrome":{name:"Baykonur Cosmodrome",ISO_A3:"-99"},"Siachen Glacier":{name:"Siachen Glacier",ISO_A3:"-99"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},Kiribati:{name:"Kiribati",ISO_A3:"KIR"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},Liechtenstein:{name:"Liechtenstein",ISO_A3:"LIE"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},"Macao S.A.R":{name:"Macao S.A.R",ISO_A3:"MAC"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Mexico:{name:"Mexico",ISO_A3:"MEX"},"Marshall Islands":{name:"Marshall Islands",ISO_A3:"MHL"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},"Northern Mariana Islands":{name:"Northern Mariana Islands",ISO_A3:"MNP"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Namibia:{name:"Namibia",ISO_A3:"NAM"},"New Caledonia":{name:"New Caledonia",ISO_A3:"NCL"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Niue:{name:"Niue",ISO_A3:"NIU"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Nepal:{name:"Nepal",ISO_A3:"NPL"},"New Zealand":{name:"New Zealand",ISO_A3:"NZL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Panama:{name:"Panama",ISO_A3:"PAN"},"Pitcairn Islands":{name:"Pitcairn Islands",ISO_A3:"PCN"},Peru:{name:"Peru",ISO_A3:"PER"},"Spratly Islands":{name:"Spratly Islands",ISO_A3:"-99"},Philippines:{name:"Philippines",ISO_A3:"PHL"},Palau:{name:"Palau",ISO_A3:"PLW"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},Poland:{name:"Poland",ISO_A3:"POL"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Palestine:{name:"Palestine",ISO_A3:"PSE"},"French Polynesia":{name:"French Polynesia",ISO_A3:"PYF"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Romania:{name:"Romania",ISO_A3:"ROU"},Russia:{name:"Russia",ISO_A3:"RUS"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},Singapore:{name:"Singapore",ISO_A3:"SGP"},"South Georgia and South Sandwich Islands":{name:"South Georgia and South Sandwich Islands",ISO_A3:"SGS"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Solomon Islands":{name:"Solomon Islands",ISO_A3:"SLB"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Somalia:{name:"Somalia",ISO_A3:"SOM"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},"Sao Tome and Principe":{name:"Sao Tome and Principe",ISO_A3:"STP"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},"East Timor":{name:"East Timor",ISO_A3:"TLS"},Tonga:{name:"Tonga",ISO_A3:"TON"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Tuvalu:{name:"Tuvalu",ISO_A3:"TUV"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},"United States Minor Outlying Islands":{name:"United States Minor Outlying Islands",ISO_A3:"UMI"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"US Naval Base Guantanamo Bay":{name:"US Naval Base Guantanamo Bay",ISO_A3:"-99"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Vanuatu:{name:"Vanuatu",ISO_A3:"VUT"},"Wallis and Futuna":{name:"Wallis and Futuna",ISO_A3:"WLF"},"Akrotiri Sovereign Base Area":{name:"Akrotiri Sovereign Base Area",ISO_A3:"-99"},Samoa:{name:"Samoa",ISO_A3:"WSM"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"}},zf={Alabama:{name:"Alabama"},Alaska:{name:"Alaska"},Arizona:{name:"Arizona"},Arkansas:{name:"Arkansas"},California:{name:"California"},Colorado:{name:"Colorado"},Connecticut:{name:"Connecticut"},Delaware:{name:"Delaware"},"District of Columbia":{name:"District of Columbia"},Florida:{name:"Florida"},Georgia:{name:"Georgia"},Hawaii:{name:"Hawaii"},Idaho:{name:"Idaho"},Illinois:{name:"Illinois"},Indiana:{name:"Indiana"},Iowa:{name:"Iowa"},Kansas:{name:"Kansas"},Kentucky:{name:"Kentucky"},Louisiana:{name:"Louisiana"},Maine:{name:"Maine"},Maryland:{name:"Maryland"},Massachusetts:{name:"Massachusetts"},Michigan:{name:"Michigan"},Minnesota:{name:"Minnesota"},Mississippi:{name:"Mississippi"},Missouri:{name:"Missouri"},Montana:{name:"Montana"},Nebraska:{name:"Nebraska"},Nevada:{name:"Nevada"},"New Hampshire":{name:"New Hampshire"},"New Jersey":{name:"New Jersey"},"New Mexico":{name:"New Mexico"},"New York":{name:"New York"},"North Carolina":{name:"North Carolina"},"North Dakota":{name:"North Dakota"},Ohio:{name:"Ohio"},Oklahoma:{name:"Oklahoma"},Oregon:{name:"Oregon"},Pennsylvania:{name:"Pennsylvania"},"Rhode Island":{name:"Rhode Island"},"South Carolina":{name:"South Carolina"},"South Dakota":{name:"South Dakota"},Tennessee:{name:"Tennessee"},Texas:{name:"Texas"},Utah:{name:"Utah"},Vermont:{name:"Vermont"},Virginia:{name:"Virginia"},Washington:{name:"Washington"},"West Virginia":{name:"West Virginia"},Wisconsin:{name:"Wisconsin"},Wyoming:{name:"Wyoming"}},Ff={Anguilla:{name:"Anguilla",ISO_A3:"AIA"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Canada:{name:"Canada",ISO_A3:"CAN"},Cuba:{name:"Cuba",ISO_A3:"CUB"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},Dominica:{name:"Dominica",ISO_A3:"DMA"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Mexico:{name:"Mexico",ISO_A3:"MEX"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"}},Rf={Argentina:{name:"Argentina",ISO_A3:"ARG"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Chile:{name:"Chile",ISO_A3:"CHL"},Colombia:{name:"Colombia",ISO_A3:"COL"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},Guyana:{name:"Guyana",ISO_A3:"GUY"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Panama:{name:"Panama",ISO_A3:"PAN"},Peru:{name:"Peru",ISO_A3:"PER"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Honduras:{name:"Honduras",ISO_A3:"HND"}},Df={World:If,USA:zf,NorthAmerica:Ff,SouthAmerica:Rf,Canada:Ef,Europe:kf,Asia:Tf,Africa:Cf,Australia:wf},Pf=(t,e)=>Math.abs(t)+Math.abs(e);function Of(t,e){const i=t.reduce(Pf,0),s=(r=t,Math.max(...r.map((t=>t))));var r;const n=(t=>Math.min(...t.map((t=>t))))(t);return Math.max(e**2*s/i**2,i**2/(e**2*n))}const Lf=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},_f=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(Pf,0),h=t.map((t=>t.animatedValue)).reduce(Pf,0),a=t.map((t=>t.animatedValue*n*r/h)),l=a.reduce(((t,e)=>t+e),0),u=a.map((t=>t/l*100)),c=a.filter(((t,e)=>u[e])),d={children:[],id:0,parentID:-1,name:"Main Rectangle",value:o,animatedValue:h,x:i,y:s,width:r,height:n,nodeIndex:-1,userNode:{name:"Main Rectangle",value:o}};if(1===t.length){const i={...t[0],x:e.x,y:e.y,width:e.width,height:e.height,userNode:{...t[0].userNode,value:t[0].value}};d.children.push(i)}else Vf(c,Lf(d).value,t,d);return d.children},Bf=(t,e,i,s,r)=>{const n=t.reduce(Pf,0)/e;t.forEach(((t,e)=>{const o=Math.abs(t)/n,{x:h,y:a,children:l}=r,u=s[l.length],c={...u,x:h,y:a,width:i?n:o,height:i?o:n,userNode:{...u.userNode,value:u.value}};i?r.y-=o:r.x+=o,l.push(c)})),i?(r.x+=n,r.y+=e,r.width-=n):(r.x-=e,r.y-=n,r.height-=n)},Vf=(t,e,i,s)=>{const r=[{children:t,width:e,row:[]}];for(;r.length>0;){const t=r.pop();if(!t)continue;const{children:e,width:n,row:o}=t;let h=0;const a=[...o];for(;hl)){Bf(a,n,Lf(s).vertical,i,s),r.push({children:e.slice(h),width:Lf(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&Bf(a,n,Lf(s).vertical,i,s)}};class Gf extends fa{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.Bp("treeMapChart bg",0),r,i.cs.ts.treeMapChartBackgroundFillStyle||i.cs.ts.chartXYSeriesBackgroundFillStyle,i.cs.ts.treeMapChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.treeMapChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.treeMapChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,h),this._B=new Map,this.wB=[],this.CB={},this.kB=p([]),this.Ly={speed:1},this.TB=Ye,this.FB=!0,this.IB="Go Back",this.PB=[],this.DB=this.ts.treeMapChartPathLabelFillStyle||this.ts.uiTextFillStyle,this.BB=this.ts.treeMapChartPathLabelFont||this.ts.uiTextFont,this.LB=this.ts.treeMapChartLabelHeaderFillStyle||this.ts.uiTextFillStyle,this.RB=this.ts.treeMapChartLabelHeaderFont||this.ts.uiTextFont,this.EB=this.ts.treeMapChartLabelFillStyle||this.ts.uiTextFillStyle,this.zB=this.ts.treeMapChartLabelFont||this.ts.uiTextFont,this.$i=!0,this.Kx=!0,this.VB=!1,this.OB=this.ts.treeMapChartParentColor||I,this.NB=this.ts.treeMapChartNodeStrokeStyle||this.ts.uiBackgroundStrokeStyle,this.onNodeMouseEnter=t=>this.R.on("mouseEnter",t),this.onNodeMouseLeave=t=>this.R.on("mouseLeave",t),this.onNodeMouseClick=t=>this.R.on("mouseClick",t),this.onNodeMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onNodeMouseDown=t=>this.R.on("mouseDown",t),this.onNodeMouseUp=t=>this.R.on("mouseUp",t),this.onNodeMouseMove=t=>this.R.on("mouseMove",t),this.offNodeMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offNodeMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offNodeMouseClick=t=>this.R.off(t,"mouseClick"),this.offNodeMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offNodeMouseDown=t=>this.R.off(t,"mouseDown"),this.offNodeMouseUp=t=>this.R.off(t,"mouseUp"),this.offNodeMouseMove=t=>this.R.off(t,"mouseMove"),this.offNodeMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offNodeMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offNodeMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offNodeMouseWheel=t=>this.R.off(t,"mouseWheel"),this.ib=(t,e,i,s,r)=>{this.cs.Ms(),this.VB=!0},this._t=(t,i)=>{const s=this.GB(i);s&&(this.mb=this.UB(s,t),this.Kx&&this.cs.us.ks(i,!0),this.FB&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.mb),this.cs.Ms())},this.wt=(t,i)=>{this.GB(i)&&(this.mb=void 0,this.Kx&&this.cs.us.ks(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.R.emit("mouseLeave",this,t,this.mb),this.cs.Ms())},this.It=(t,i)=>{const s=this.GB(i);s&&(this.mb=this.UB(s,t),this.Kx&&this.cs.us.ks(i,!0),this.FB&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.mb),this.cs.Ms())},this.Ct=(t,e)=>{const i=this.GB(e);if(i){if(this.FB){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.CB[i.parentID]:void 0;e&&(this.kB._([e]),this.mb=void 0,this.R.emit("viewChange",this.kB.C()),this.VB=!0),t&&se(t)}this.R.emit("mouseClick",this,t,this.UB(i,t)),this.cs.Ms()}},this.kt=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseDoubleClick",this,t,this.UB(i,t))},this.Tt=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseDown",this,t,this.UB(i,t))},this.Ft=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseUp",this,t,this.UB(i,t))},this.Dt=(t,e,i)=>{const s=this.GB(i);s&&this.R.emit("mouseDragStart",this,t,e,this.UB(s,t))},this.Pt=(t,e,i,s,r)=>{const n=this.GB(r);n&&this.R.emit("mouseDrag",this,t,e,i,s,this.UB(n,t))},this.Bt=(t,e,i,s)=>{const r=this.GB(s);r&&this.R.emit("mouseDragStop",this,t,e,i,this.UB(r,t))},this.Lt=(t,e)=>{const i=this.GB(e);i&&this.R.emit("mouseWheel",this,t,this.UB(i,t))},this.Rt=(t,e)=>{const i=this.GB(e);i&&(this.mb=this.UB(i,t),this.Kx&&this.cs.us.ks(e,!0),this.R.emit("touchStart",this,t,this.mb),this.cs.Ms(),se(t))},this.Et=(t,e)=>{const i=this.GB(e);i&&(this.mb=this.UB(i,t),this.Kx&&this.cs.us.ks(e,!0),this.R.emit("touchMove",this,t,this.mb),this.cs.Ms(),se(t))},this.zt=(t,e)=>{const i=this.GB(e);if(i){if(this.mb=void 0,this.FB){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.CB[i.parentID]:void 0;e&&(this.kB._([e]),this.R.emit("viewChange",this.kB.C()),this.VB=!0),t&&se(t)}this.Kx&&this.cs.us.ks(e,!1),this.R.emit("touchEnd",this,t,this.mb),this.cs.Ms(),se(t)}},this.WB=t=>{const e=this.CB[this.PB[t].id]?[this.CB[this.PB[t].id]]:this.wB;this.kB._(e),this.R.emit("viewChange",e),this.VB=!0,this.cs.Ms()},this.ts.treeMapChartNodeColors)this.YB=this.ts.treeMapChartNodeColors;else{const t=this.ts.pointSeriesFillStyle,e=t=>U(t)?t.getColor():I;this.YB="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.cs.Jn(Sh.Rf),this.qy=i.Lx("TreeMapChart plotting",0),this.im=i.Lx("TreeMap UI plotting",1),this.onResize(this.ib),this.Ch.Sr("TreeMap Chart");const a=i.sm(),l=Vt(o?o.cursorBuilder:void 0,Da);this.hm=pa(this,a,l._y(a,this.uiScale,this.uiScale,Ot,this.ts),void 0,"show-pointed",Nf,(()=>0)),this.HB=this.hs.Bg(),this.Dp(n,this.uiScale),this.cb=this.qy.Km(this._g).Re(new Y).Le(this.NB),this.$B=this.cs.us.jr(this,{animationEnabled:!1!==(null==o?void 0:o.animationsEnabled)}),this.XB=new rl((()=>this.im.Wr(this._g).setMouseInteractions(!1))),this.jB=new rl((()=>this.im.Wr(this.uiScale))),this.cb.setMouseInteractions(this.$i).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setData(t){t=Array.isArray(t)?t.slice():[t];const{ZB:e}=(()=>{let t=0;return{ZB:e=>{var i;const s=e.map(((t,e)=>({node:t,parent:null}))),r=[];for(;s.length>0;){const e=s.pop();if(!e)continue;const{node:n,parent:o}=e;t+=1;const h={id:t,parentID:null==o?void 0:o.id,name:n.name,value:Number(n.value)||0,animatedValue:Number(n.value)||0,children:[],nodeIndex:o?o.nodeIndex:-1,userNode:n};o?o.children.push(h):r.push(h),null===(i=n.children)||void 0===i||i.forEach((t=>{s.push({node:t,parent:h})}))}const n=t=>{t.children.forEach(n),t.children.length>0&&(t.value+=t.children.reduce(((t,e)=>t+e.value),0),t.animatedValue+=t.children.reduce(((t,e)=>t+e.animatedValue),0),t.children.sort(((t,e)=>e.animatedValue-t.animatedValue)))};r.forEach(n);const o=1===e.length?r[0].children:r;return o.sort(((t,e)=>e.animatedValue-t.animatedValue)),o.forEach(((t,e)=>{t.nodeIndex=e;const i=e=>{e.children.forEach((e=>{e.nodeIndex=t.nodeIndex,i(e)}))};i(t)})),r}}})(),i=e(t);return i.forEach((t=>{const e=this.CB[t.id];e&&this.QB(t,e)})),this.mb=void 0,this.kB._(i),this.wB=i,this.CB=this.JB(i),this.VB=!0,this.cs.Ms(),this}setAnimationValues(t,e=1){return this.Ly=t?{speed:e}:void 0,this.cs.Ms(),this}setInitPathButtonText(t){return this.IB=t,this.VB=!0,this.cs.Ms(),this}setDisplayedLevelsCount(t){return this.TB=t,this.VB=!0,this.cs.Ms(),this}setDrillDownEnabled(t){return this.FB=t,this.VB=!0,this.cs.Ms(),this}setDrillDownNode(t){var e,i;if(this.mb=void 0,void 0===t)this.kB._(this.wB);else{const s=[...this.wB];for(;s.length>0;){const r=s.pop();if(r){if(void 0!==r.value&&r.userNode===t||r.parentID&&Array.isArray(t)&&(null===(i=null===(e=this.CB[r.parentID])||void 0===e?void 0:e.userNode)||void 0===i?void 0:i.children)===t){const t=r.children.length?r:r.parentID?this.CB[r.parentID]:this.wB[0];this.kB._([t]);break}if(r.children)for(let t=r.children.length-1;t>=0;t-=1)s.push(r.children[t])}}}return this.R.emit("viewChange",this.kB.C()),this.VB=!0,this.cs.Ms(),this}setNodeColoring(t){return t instanceof Array?(this.cb.Re(new Y),this.YB=t):this.cb.Re(t),this.VB=!0,this.cs.Ms(),this}setParentNodeColor(t){return this.OB=t,this.VB=!0,this.cs.Ms(),this}setPathLabelFillStyle(t){return this.DB="function"==typeof t?t(this.DB):t,this.VB=!0,this.cs.Ms(),this}getPathLabelFillStyle(){return this.DB}setPathLabelFont(t){return br(t)?this.BB=t:this.BB=t(this.BB),this.VB=!0,this.cs.Ms(),this}getPathLabelFont(){return this.BB}setHeaderFont(t){return br(t)?this.RB=t:this.RB=t(this.RB),this.VB=!0,this.cs.Ms(),this}getHeaderFont(){return this.RB}setHeaderFillStyle(t){return this.LB="function"==typeof t?t(this.LB):t,this.VB=!0,this.cs.Ms(),this}getHeaderFillStyle(){return this.LB}setLabelFont(t){return br(t)?this.zB=t:this.zB=t(this.zB),this.VB=!0,this.cs.Ms(),this}getLabelFont(){return this.zB}setLabelFillStyle(t){return this.EB="function"==typeof t?t(this.EB):t,this.VB=!0,this.cs.Ms(),this}getLabelFillStyle(){return this.EB}setNodeBorderStyle(t){return this.cb.Le(t),this.VB=!0,this.cs.Ms(),this}getNodeBorderStyle(){return this.cb.So()}setNodeEffect(t){return this.HB.bs(t),this.cs.Ms(),this}getNodeEffect(){return this.HB._s()}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=Da){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}onNodeMouseDragStart(t){return this.R.on("mouseDragStart",t)}onNodeMouseDrag(t){return this.R.on("mouseDrag",t)}onNodeMouseDragStop(t){return this.R.on("mouseDragStop",t)}onNodeMouseWheel(t){return this.R.on("mouseWheel",t)}onNodeTouchStart(t){return this.R.on("touchStart",t)}onNodeTouchMove(t){return this.R.on("touchMove",t)}onNodeTouchEnd(t){return this.R.on("touchEnd",t)}onViewChange(t){return this.R.on("viewChange",t)}offNodeTouchStart(t){return this.R.off(t,"touchStart")}offNodeTouchMove(t){return this.R.off(t,"touchMove")}offNodeTouchEnd(t){return this.R.off(t,"touchEnd")}offViewChange(t){return this.R.off(t,"viewChange")}setMouseInteractions(t){return this.$i=t,this.cb.setMouseInteractions(t),this}getMouseInteractions(){return this.$i}setAnimationHighlight(t){return this.$B.Jr(t),this}getAnimationHighlight(){return this.$B.Kr()}setHighlightOnHover(t){return this.Kx=t,this}getHighlightOnHover(){return this.Kx}UB(t,e){const i=this.cs.Uo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.cs.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.cs.At},name:t.name,value:t.value,node:t.userNode}}getMinimumSize(){}af(){return[this]}ze(t){super.ze(t),super.Pp(),ga.Gp(this.Ch,this.Lp);const i=ga.Np(this.Ch,this.Lp);if(this.VB&&this.kB.C().length){this.cb.Ot(),this._B.clear(),this.$B.Qr(),this.ph&&this.KB(t);const s=_f({data:this.kB.C(),dimensions:{x:0+this.Ia.left,y:this._g.y.getInnerEnd()-i-this.Ia.top,width:this._g.x.getInnerEnd()-this.Ia.right-this.Ia.left,height:this._g.y.getInnerEnd()-i-this.Ia.top-this.Ia.bottom}}),r=this.XB.Dm();this.qB(s,r),r.finishPlot(),this.tL(),this.wB!==this.kB.C()&&this.wB.length>1&&this.PB.unshift({name:this.IB,id:0});let n=0;const o=this.jB.Dm(),h=this.BB;this.PB.forEach(((t,i)=>{const s=o.add(),r=this.cs.$g.Hg(t.name,h,0);s.Sr(`← ${t.name}`).ir(h).Ve({x:0,y:100}).Za({x:-1,y:1}).Gr({left:this.Ia.left+n,top:this.Ia.top,right:0,bottom:0}).Re(this.DB).setMouseClickEventHandler((t=>this.WB(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.kB.C().every((t=>t.value===t.animatedValue))?this.VB=!1:this.cs.Ms(!0)}return this.hm.ze(!1,[],void 0,{explicitTarget:this.mb}),this}dispose(){return this.im.Y(),this.qy.Y(),this.hm.Y(),this.cb.dispose(),this._B.clear(),this.XB.Lm(),this.jB.Lm(),super.dispose()}J(){return super.J(),this}K(){return super.K(),this}qd(){return Ae(this.cb.Jh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),pe(t,this.ts,i,{}),this}qB(t,e,i=!1,s=0){const r=t.map(((t,e)=>({node:t,isChild:i,visibleDepth:s})));for(;r.length>0;){const t=r.pop();if(!t)continue;const{node:i,visibleDepth:s,opacity:n}=t,{x:o,y:h,height:a,width:l,children:u,animatedValue:c,name:d,nodeIndex:f}=i,g=this.YB,m=0===s&&1===this.kB.C().length?this.OB:g[f%g.length],y=[{x:o,y:h},{x:o,y:h-a},{x:l+o,y:h-a},{x:l+o,y:h}],p=this.cb.Zr().Fl(y).iL(m.setA(m.getA()*((null!=n?n:255)/255))).yb(c);this._B.set(p,i),this.$B.Zr(p,(t=>p.ds(t)));const A=o+5,x=h+25+5,S=Math.max(a-25-5,0),v=Math.max(l-5-5,0);if(u&&u.length&&s15&&S>15){const t=_f({data:u,dimensions:{x:v>0?A:o,y:S>0?h-25:x,width:v,height:S}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.wB.length||this.wB===this.kB.C()?255:n?n/(s+1):255-e*o;r.push({node:t[e],isChild:!0,visibleDepth:s+1,opacity:h})}}const b=0===s&&1===this.kB.C().length?this.LB:this.EB,M=0===s?this.RB:this.zB,C=this.sL(d,l-25,M),T=this.cs.$g.Hg(C,M,0),w=e.add();l-25>T.x&&a>25?w.Sr(C).Ve({x:o+5,y:h-2.5}).Za({x:-1,y:1}).Re(b).ir(M):w.Sr("")}}JB(t){const e={},i=[...t];for(;i.length>0;){const t=i.pop();t&&(e[t.id]=t,t.children&&i.push(...t.children))}return e}GB(t){if(!this.VB&&t)return this._B.get(t)}tL(){this.PB=[];const t=this.kB.C()[0].id;let e=this.CB[t].parentID;for(;e;)this.PB.push({name:this.CB[e].name,id:e}),e=this.CB[e].parentID;return this.PB.reverse()}sL(t,e,i){let s=this.cs.$g.Hg(t,i,0).x;if(s<=e)return t;const r=t.split(" ");let n=t;for(;r.length>1&&s>e;)r.pop(),n=`${r.join(" ")}...`,s=this.cs.$g.Hg(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.cs.$g.Hg(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.cs.$g.Hg(n,i,0).x;return n.length<=3&&s>e?"":n}KB(t){var e;const i=[...this.wB];for(;i.length>0;){const s=i.pop();if(!s)continue;const r=s.value-s.animatedValue;if(Math.abs(r)<.0015*s.value||void 0===this.Ly)s.animatedValue=s.value;else{const i=r/255*((null===(e=this.Ly)||void 0===e?void 0:e.speed)||1)*t;s.animatedValue+=i,(r>0&&s.animatedValue>s.value||r<0&&s.animatedValue0&&i.push(...s.children)}}QB(t,e){const i=[{current:t,previous:e}];for(;i.length>0;){const t=i.pop();if(!t)continue;const{current:e,previous:s}=t;e.animatedValue=this.ph?s.animatedValue:e.value,s.nodeIndex<0?e.nodeIndex=0:e.nodeIndex=s.nodeIndex;const r=new Map(s.children.map((t=>[t.id,t])));e.children.forEach(((t,e)=>{const n=r.get(t.id);i.push({current:t,previous:n||s})}))}}}const Nf=(t,e,i)=>[[e.name],[{text:e.value.toString(),font:{weight:"bold"}}]];class Uf extends fa{constructor(t,e,i,s,r,n,o){super(t,e,i,e.Bp("gaugeChart bg",0),s,e.cs.ts.gaugeChartBackgroundFillStyle,e.cs.ts.gaugeChartBackgroundStrokeStyle,e.cs.ts.gaugeChartTitleFont,e.cs.ts.gaugeChartTitleFillStyle,n),this.hu=this.ts.gaugeChartStartAngle,this.ru=this.ts.gaugeChartEndAngle,this.eL={start:0,end:100},this.M=0,this.hL=[],this.rL=this.ts.gaugeChartBarThickness,this.nL=this.ts.gaugeChartValueIndicatorThickness,this.oL=this.ts.gaugeChartNeedleLength,this.aL=this.ts.gaugeChartNeedleThickness,this.lL=this.ts.gaugeChartNeedleFillStyle,this.uL=this.ts.gaugeChartNeedleStrokeStyle,this.cL=this.ts.gaugeChartRoundedEdges,this.dL=!0,this.fL=!0,this.AL=!0,this.gL=[],this.pL=[],this.yL=!0,this.mL=!0,this.Ty=this.M,this.vL=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.SL=this.ts.gaugeChartBarGradient,this.xL=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.bL=this.ts.gaugeChartTickFont,this.ML=this.ts.gaugeChartValueLabelFont,this._L=this.ts.gaugeChartValueLabelFillStyle,this.wL=this.ts.gaugeChartUnitLabelFont,this.CL=this.ts.gaugeChartUnitLabelFillStyle,this.kL=this.ts.gaugeChartTickFillStyle,this.TL=this.ts.gaugeChartBarColor,this.FL=this.ts.gaugeChartGlowColor,this.IL=this.ts.gaugeChartGlowColor.getA(),this.PL=1,this.DL=1,this.BL=this.ts.gaugeChartNeedleAlignment,this.LL=!1,this.RL=this.ts.gaugeChartGapBetweenBarAndValueIndicators,this.EL=this.ts.gaugeChartBarStrokeStyle,this.zL=!1,this.cs.Jn(Sh.xf),this.Ch.Sr("Gauge Chart"),this.Dp(r,this._g),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.VL=this.TL,this.OL=this.FL,this.NL=C(0,0,0,0),this.GL=this.hs.Bg(),this.UL=this.hs.Bg().bs(this.ts.effectsText),this.WL=this.gp.fc(this._g).Le(this.EL).setMouseInteractions(!1),this.YL=this.gp.ud(this._g).Au(0).$e(360).mu(0).Le(ut).setMouseInteractions(!1),this.HL=this.Rp.He(this._g).Ye(this.ts.gaugeChartNeedleStrokeStyle).setMouseInteractions(!1),this.$L=this.Rp.He(this._g).Ye(new us({thickness:this.aL,fillStyle:this.lL})).setMouseInteractions(!1),this.XL=this.Rp.Wr(this._g).ir(this.ML).Re(this._L).setMouseInteractions(!1),this.jd=this.Rp.Wr(this._g).ir(this.wL).Re(this.CL).Sr("").setMouseInteractions(!1),this.jL=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1),this.ZL=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1),this.GL.gs([this.WL]),this.UL.gs([this.XL,this.jd,this.jL,this.ZL]),this.QL(),this.onResize((()=>{this.LL=!0}))}QL(){this.$L.Ye((t=>t.setThickness(this.aL))),this.HL.Ye((t=>t.setThickness(2*this.uL.getThickness()+this.aL)))}setAnimationsEnabled(t){return this.ph=t,this.mL=t,this.yL=t,this}setInterval(t,e){return this.eL={start:t,end:e},this.LL=!0,this.cs.Ms(),this}getInterval(){return this.eL}setTickFillStyle(t){return this.kL="function"==typeof t?t(this.kL):t,this.pL.forEach((e=>{e.start.Re(t),e.end.Re(t)})),this.jL.Re(t),this.ZL.Re(t),this.LL=!0,this.cs.Ms(),this}getTickFillStyle(){return this.kL}setTickFont(t){return this.bL="function"==typeof t?t(this.bL):t,this.pL.forEach((e=>{e.start.ir(t),e.end.ir(t)})),this.jL.ir(t),this.ZL.ir(t),this.LL=!0,this.cs.Ms(),this}getTickFont(){return this.bL}setTickFormatter(t){return this.vL=t,this.LL=!0,this.cs.Ms(),this}getTickFormatter(){return this.vL}setValueLabelFillStyle(t){return this._L="function"==typeof t?t(this._L):t,this.XL.Re(t),this.LL=!0,this.cs.Ms(),this}getValueLabelFillStyle(){return this.XL.Jh()}setValueLabelFont(t){return this.ML="function"==typeof t?t(this.ML):t,this.XL.ir(t),this.LL=!0,this.cs.Ms(),this}getValueLabelFont(){return this.XL.tr()}setValueFormatter(t){return this.xL="string"==typeof t?e=>t:t,this.LL=!0,this.cs.Ms(),this}getValueLabel(){return this.XL.Tr()||this.xL}setUnitLabelFillStyle(t){return this.CL="function"==typeof t?t(this.CL):t,this.jd.Re(t),this.LL=!0,this.cs.Ms(),this}getUnitLabelFillStyle(){return this.jd.Jh()}setUnitLabelFont(t){return this.wL="function"==typeof t?t(this.wL):t,this.jd.ir(t),this.LL=!0,this.cs.Ms(),this}getUnitLabelFont(){return this.jd.tr()}setUnitLabel(t){return this.jd.Sr(t),this.LL=!0,this.cs.Ms(),this}getUnitLabel(){return this.jd.Tr()}setNeedleFillStyle(t){return this.lL="function"==typeof t?t(this.lL):t,this.$L.Ye((e=>e.setFillStyle(t))),this.LL=!0,this.cs.Ms(),this}getNeedleFillStyle(){return this.$L.xu().getFillStyle()}setNeedleThickness(t){return this.aL=t,this.QL(),this.LL=!0,this.cs.Ms(),this}getNeedleThickness(){return this.aL}setNeedleStrokeStyle(t){return this.uL="function"==typeof t?t(this.uL):t,this.HL.Ye(t),this.QL(),this.LL=!0,this.cs.Ms(),this}getNeedleStrokeStyle(){return this.HL.xu()}setNeedleLength(t){return this.oL=t,this.LL=!0,this.cs.Ms(),this}getNeedleLength(){return this.oL}setBarColor(t){return this.TL=t,this.LL=!0,this.cs.Ms(),this}getBarColor(){return this.VL}setBarGradient(t){return this.SL=t,this.LL=!0,this.cs.Ms(),this}getBarGradient(){return this.SL}setBarStrokeStyle(t){return this.EL="function"==typeof t?t(this.EL):t,this.WL.Le(t),this.LL=!0,this.cs.Ms(),this}getBarStrokeStyle(){return this.WL.So()}setBarThickness(t){return this.rL=t,this.LL=!0,this.cs.Ms(),this}getBarThickness(){return this.rL}setAngleInterval(t,e){return Math.abs(t-e)>360&&(e=t{t.dispose()})),this.gL.length=0,this.pL.forEach((t=>{t.start.dispose(),t.end.dispose()})),this.pL.length=0,this.hL.forEach((t=>{const e=this.gp.fc(this._g).Le(ut).Re(new N({color:t.color})).setMouseInteractions(!1);this.gL.push(e);const i=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1),s=this.gp.Wr(this._g).ir(this.bL).Re(this.kL).setMouseInteractions(!1);this.pL.push({start:i,end:s})})),this.GL.gs([this.WL,...this.gL]),this.UL.gs([this.XL,this.jd,this.jL,this.ZL,...this.pL.map((t=>[t.start,t.end])).flat()]),this.LL=!0,this.cs.Ms(),this}getValueIndicators(){return this.hL}setValueIndicatorThickness(t){return this.nL=t,this.LL=!0,this.cs.Ms(),this}getValueIndicatorThickness(){return this.nL}setAutomaticBarColoring(t){return this.AL=!!t,this.LL=!0,this.cs.Ms(),this}getAutomaticBarColoring(){return this.AL}setGlowColor(t){return void 0===t?(this.dL=!1,this.OL=void 0):"object"==typeof t&&"auto"in t?(this.fL=t.auto,t.auto&&(this.OL=void 0),void 0!==t.alpha&&(this.IL=t.alpha),this.dL=!0):(this.OL=t,this.IL=t.getA(),this.fL=!1,this.dL=!0),this.LL=!0,this.cs.Ms(),this}getAutomaticGlowColoring(){return this.fL}setNeedleAlignment(t){return this.BL=t,this.LL=!0,this.cs.Ms(),this}getNeedleAlignment(){return this.BL}setGapBetweenBarAndValueIndicators(t){return this.RL=t,this.LL=!0,this.cs.Ms(),this}getGapBetweenBarAndValueIndicators(){return this.RL}setBarEffect(t){return this.GL.bs(t),this.cs.Ms(),this}getBarEffect(){return this.GL._s()}setLabelEffect(t){return this.UL.bs(t),this.cs.Ms(),this}getLabelEffect(){return this.UL._s()}ze(t){var i;if(super.ze(t),ga.Gp(this.Ch,this.Lp),super.Pp(),this.Ty!==this.M){if(this.yL){const e=5e-4*t,i=.003*t,s=Math.sign(this.M-this.Ty);this.Ty=this.Ty+e*s+i*this.PL*(this.M-this.Ty),s!==Math.sign(this.M-this.Ty)?this.Ty=this.M:this.cs.Ms(!0)}else this.Ty=this.M;this.LL=!0}let s=this.hL.find((t=>this.Ty>=t.start&&this.Ty<=t.end));if(s||(this.Tyt.start===this.eL.start)):this.Ty>this.eL.end&&(s=this.hL.find((t=>t.end===this.eL.end)))),this.VL=this.AL&&s?s.color:this.TL,this.mL){if(this.NL!==this.VL){const e=this.NL.getR(),i=this.NL.getG(),s=this.NL.getB(),r=this.VL.getR(),n=this.VL.getG(),o=this.VL.getB(),h=Math.sign(r-e),a=Math.sign(n-i),l=Math.sign(o-s),u=.005*t,c=.003*t;this.NL=C(e+u*h+c*this.DL*(r-e),i+u*a+c*this.DL*(n-i),s+u*l+c*this.DL*(o-s));const d=Math.abs(r-this.NL.getR()),f=Math.abs(n-this.NL.getG()),g=Math.abs(o-this.NL.getB());d<1&&f<1&&g<1?this.NL=this.VL:this.cs.Ms(!0),this.LL=!0}}else this.NL=this.VL;if(this.LL){let t=Ye,r=He,n=Ye,o=He;if(new Array(100).fill(0).forEach(((e,i,s)=>{const h=this.hu+i/s.length*(this.ru-this.hu),a=Math.sin(h*Math.PI/180),l=Math.cos(h*Math.PI/180);ar&&(r=a),lo&&(o=l)})),this.SL?this.WL.Re(new rt({stops:[{offset:0,color:T("#000000")},{offset:1,color:this.NL}],position:{x:.5,y:.5}})):this.WL.Re(new N({color:this.NL})),this.dL){const t=this.fL&&s?this.NL:null!==(i=this.OL)&&void 0!==i?i:this.FL;this.YL.Re(new rt({stops:[{offset:0,color:t.setA(this.IL)},{offset:1,color:t.setA(0)}],position:{x:.5,y:.5},extent:e.GradientExtent.farthestSide}))}else this.YL.Re(_);const h=this.vL(this.eL.start),a=this.vL(this.eL.end);let l=0,u=0;const c=this.cs.$g.Hg(h,this.jL.tr(),this.jL.er()),d=this.cs.$g.Hg(a,this.ZL.tr(),this.ZL.er());c.x>l&&(l=c.x),c.y>u&&(u=c.y),d.x>l&&(l=d.x),d.y>u&&(u=d.y),this.pL.forEach(((t,e)=>{if(e>=this.hL.length)return;const i=this.hL[e],s=this.vL(i.start),r=this.vL(i.end),n=this.cs.$g.Hg(s,t.start.tr(),t.start.er()),o=this.cs.$g.Hg(r,t.end.tr(),t.end.er());n.x>l&&(l=n.x),n.y>u&&(u=n.y),o.x>l&&(l=o.x),o.y>u&&(u=o.y)}));const f=this.hL.length>0?this.nL:0,g=this._g.getInnerIntervalPixels(),m=ga.Np(this.Ch,this.Lp),y={x:g.x-(this.Ia.left+this.Ia.right),y:g.y-(this.Ia.bottom+this.Ia.top)-m},p={x:this.Ia.left+.5*y.x,y:this.Ia.bottom+.5*y.y},A=f+2*this.RL+this.rL/2,x=l+A,S=u+A,v=S+m,b=y.y-(v+S),M=y.x-(x+x),C=Math.max(0,b0;if(this.WL.setVisible(F),this.gL.forEach((t=>t.setVisible(F))),this.$L.setVisible(F),this.HL.setVisible(F),this.YL.setVisible(F),this.jd.setVisible(F),this.XL.setVisible(F),this.jL.setVisible(F),this.ZL.setVisible(F),this.pL.forEach((t=>{t.start.setVisible(F),t.end.setVisible(F)})),!F)return;const R={x:p.x-.5*I,y:p.y-.5*k};this.YL.Ve(p).gu(.5*Math.min(y.x,y.y)),this.XL.Ve(R).Sr(this.xL(this.Ty)),this.jd.Ve({x:R.x,y:R.y-this.XL.od().y-this.jd.od().y/4});const D=Xf(this.eL,this.hu,this.ru,this.Ty,z,w+this.BL*(this.oL/2+this.rL/2)),P=D.angle*(Math.PI/180),O=.5*this.oL,L=Math.cos(P),B=Math.sin(P);this.$L.Xe({x:D.x+O*L,y:D.y+O*B}).$e({x:D.x-O*L,y:D.y-O*B}),this.HL.Xe({x:D.x+O*L,y:D.y+O*B}).$e({x:D.x-O*L,y:D.y-O*B});const V=Yf(z,w,this.hu,this.ru,this.rL,this.cL,!1,!1);this.WL.Fl(V).sa({min:{x:z.x-w,y:z.y-w},max:{x:z.x+w,y:z.y+w}});const G=z.y+w,U=z.y-w,Y=z.x+w,H=z.x-w,[X,W]=this.eL.start{var i,s;const r=t.start>=X&&t.end<=W;this.gL[e].setVisible(r),this.pL[e].start.setVisible(r),this.pL[e].end.setVisible(r);const n=Xf(this.eL,this.hu,this.ru,t.start,z,$),o=Xf(this.eL,this.hu,this.ru,t.end,z,$),h=Yf(z,j,n.angle,o.angle,this.nL,this.cL,!(0===e),!(e===this.hL.length-1));this.gL[e].Fl(h);const a=this.eL.start===t.start||this.eL.end===t.start,l=this.eL.start===t.end||this.eL.end===t.end||this.hL.some((e=>e.start===t.end&&e!==t));this.pL[e].start.Ve({x:n.x,y:n.y}).Za({x:Math.min(1,Math.max(-1,2*(n.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(n.y-G)/(U-G)-1))}).Sr(null!==(i=t.startLabel)&&void 0!==i?i:a?"":this.vL(t.start)),this.pL[e].end.Ve({x:o.x,y:o.y}).Za({x:Math.min(1,Math.max(-1,2*(o.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(o.y-G)/(U-G)-1))}).Sr(null!==(s=t.endLabel)&&void 0!==s?s:l?"":this.vL(t.end))}));const Z=this.hL.some((t=>t.start=t.start&&this.eL.start<=t.end:this.eL.start<=t.start&&this.eL.start>=t.end)),q=Xf(this.eL,this.hu,this.ru,this.eL.start,z,Z?$:j-this.RL);this.jL.Ve({x:q.x,y:q.y}).Za({x:Math.min(1,Math.max(-1,2*(q.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(q.y-G)/(U-G)-1))}).Sr(h);const K=this.hL.some((t=>t.start=t.start&&this.eL.end<=t.end:this.eL.end<=t.start&&this.eL.end>=t.end)),J=Xf(this.eL,this.hu,this.ru,this.eL.end,z,K?$:j-this.RL);this.ZL.Ve({x:J.x,y:J.y}).Za({x:Math.min(1,Math.max(-1,2*(J.x-Y)/(H-Y)-1)),y:Math.min(1,Math.max(-1,2*(J.y-G)/(U-G)-1))}).Sr(a),this.LL=!1}}getMinimumSize(){return{x:150,y:150}}af(){return[this]}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.setMouseInteractions(!1),pe(t,this.ts,i,{fill:new N({color:this.getBarColor()})}),this}}const Yf=(t,e,i,s,r,n=!0,o=!0,h=!0)=>{const a=[],l=.5*r,u=i>s,c=Math.sign(i-s),d=-1*c;if(n){const t=l/(2*Math.PI*e)*360+.1;o&&(i+=t*d),h&&(s+=t*c)}else i+=.1*d,s+=.1*c;const f=Hf(t,e+l,i,s,u);if(a.push(...f),n){const r={x:t.x+e*Math.cos(s*(Math.PI/180)),y:t.y+e*Math.sin(s*(Math.PI/180))};let n;n=i>s?Hf(r,l,s+180,s+360,u):Hf(r,l,s-180,s-360,u),a.push(...n)}const g=Hf(t,e-l,s,i,!u);if(a.push(...g),n){const r={x:t.x+e*Math.cos(i*(Math.PI/180)),y:t.y+e*Math.sin(i*(Math.PI/180))};let n;n=i>s?Hf(r,l,i-180,i-360,u):Hf(r,l,i+180,i+360,u),a.push(...n)}return a},Hf=(t,e,i,s,r)=>{it>s:t=>t{const[o,h]=t.start{const s=(t=>{const i=new N({color:t.uiStrokeColorContrastHigh}),s=new N({color:t.uiStrokeColorContrastMedium}),r=new N({color:t.uiStrokeColorContrastLow}),n=new vr({family:t.fontFamily,weight:"normal",style:"normal"}),o=n.setSize(18*t.fontScaler),h=n.setSize(16*t.fontScaler),a=n.setSize(14*t.fontScaler),l=n.setSize(10*t.fontScaler),u=n.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=n.setSize(13*t.fontScaler),d=new us({thickness:2,fillStyle:r}),f=new N({color:t.dataHighlightOverlayColor}),g=new us({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new N({color:t.stroke}))),y=t=>m[t%m.length],p=m.map((t=>new us({thickness:2,fillStyle:t}))),A=t=>p[t%p.length],x=t.dataColorPalette.map((t=>new N({color:t.border}))).map((t=>new us({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new ht({angle:0,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new ht({angle:180,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),w=t=>M[t%M.length],E=t.dataColorPalette.map((t=>{const e=t.area;return new ht({angle:180,stops:[{color:ge(e,C(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ge(e,C(0,0,0,e.getA()),.3),offset:1}]})})),k=t=>E[t%E.length],I=t.dataColorPaletteInverted.map((t=>new N({color:t.border}))).map((t=>new us({thickness:2,fillStyle:t}))),z=t=>I[t%I.length],F=new N({color:t.dataColorPositive}),R=new N({color:t.dataColorNegative}),D=new us({thickness:1,fillStyle:new N({color:t.dataStrokeColorContrastHigh.setA(50)})}),P=new us({thickness:2,fillStyle:t.axisLineFillStyle}),O=ut,L=new N({color:C(0,0,0,1)}),B=new us({thickness:1,fillStyle:t.axisGridMajorFillStyle}),V=ut,G=a,U=t.axisLabelMajorFillStyle,Y=new us({thickness:1,fillStyle:t.axisGridMajorFillStyle}),H=new us({thickness:1,fillStyle:t.axisTickMajorFillStyle}),X=a,W=t.axisLabelMajorFillStyle,j=new us({thickness:1,fillStyle:t.axisGridMinorFillStyle}),$=new us({thickness:1,fillStyle:t.axisTickMinorFillStyle}),Z=l,q=t.axisLabelMinorFillStyle,K=zh,J=new kh({gridStrokeStyle:B,tickStyle:V,tickLength:50,tickPadding:-14,labelFont:G,labelFillStyle:U}),Q=new kh({gridStrokeStyle:Y,tickStyle:H,tickLength:7,tickPadding:5,labelFont:X,labelFillStyle:W}),tt=new kh({gridStrokeStyle:j,tickStyle:$,tickLength:4,tickPadding:10,labelFont:Z,labelFillStyle:q}),et=new ra({extremeTickStyle:K,majorTickStyle:Q,minorTickStyle:tt}),it=new qh({greatTickStyle:J,majorTickStyle:Q,minorTickStyle:tt}),st=new Lh({majorTickStyle:Q,minorTickStyle:tt}),rt=new N({color:t.dataHighlightOverlayColor}),nt=new us({thickness:1,fillStyle:s}),ot=new us({thickness:2,fillStyle:s}),at=t=>new Fr.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),lt=m[0],ct=t.uiTextFillStyle,dt=t.legendBackgroundFillStyle,ft=new us({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),gt=ye(t.legendButtonDefaultColor),mt=ye(t.isDark?C(70,70,70,255):C(170,170,170,255)),yt=new N({color:t.isDark?C(70,70,70,255):C(170,170,170,255)}),pt=new us({thickness:1,fillStyle:i}),At=new fo({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:uo.DashedEqual,patternScale:3}),xt=new us({thickness:1,fillStyle:t.cursorGridFillStyle}),St=t.zoomBandChartDefocusOverlayFillStyle,vt=new us({thickness:2,fillStyle:new N({color:t.zoomBandChartSplitterColor})}),bt=new N({color:t.uiBackgroundColor});let Mt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:ut,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new us({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:ut,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:A,pointLineSeriesStrokeStyle:A,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:A,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:A,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:ut,segmentSeriesStrokeStyle:A,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:ut,boxSeriesStrokeStyle:new us({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new us({thickness:1,fillStyle:new N({color:C(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:F,ohlcCandleBodyFillStyleNegative:R,ohlcCandleTailStrokeStylePositive:new us({thickness:1,fillStyle:new N({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new us({thickness:1,fillStyle:new N({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new us({thickness:2,fillStyle:F}),ohlcBarStrokeStyleNegative:new us({thickness:2,fillStyle:R}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:D,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:D,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:z,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:z,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:z,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:P,xAxisNibStyle:O,xAxisOverlayStyle:L,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:ut,xAxisNumericTicks:et,xAxisDateTimeTicks:it,xAxisTimeTicks:st,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:P,yAxisNibStyle:O,yAxisOverlayStyle:L,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:ut,yAxisNumericTicks:et,yAxisDateTimeTicks:it,yAxisTimeTicks:st,bandFillStyle:rt,bandStrokeStyle:nt,constantLineStrokeStyle:ot,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:ut,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:_,barChartSeriesBackgroundStrokeStyle:ut,barChartBarFillStyle:y,barChartBarStrokeStyle:new us({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:P,barChartValueAxisTicks:et.setMajorTickStyle((t=>t.setGridStrokeStyle(ut))).setMinorTickStyle((t=>t.setGridStrokeStyle(ut))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:P,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:et.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:ut,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:ut,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:P,xAxis3DNumericTicks:et,xAxis3DDateTimeTicks:it,xAxis3DTimeTicks:st,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:P,yAxis3DNumericTicks:et,yAxis3DDateTimeTicks:it,yAxis3DTimeTicks:st,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:P,zAxis3DNumericTicks:et,zAxis3DDateTimeTicks:it,zAxis3DTimeTicks:st,lineSeries3DStrokeStyle:A,pointLineSeries3DStrokeStyle:A,pointLineSeries3DPointStyle:at,pointSeries3DPointStyle:at,pointCloudSeries3DPointStyle:t=>new Fr.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:D,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:D,boxSeries3DFillStyle:y,meshModel3DFillStyle:y(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:ut,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:rt,polarSectorStrokeStyle:nt,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:P,polarAmplitudeAxisNumericTicks:et,polarAmplitudeAxisDateTimeTicks:it,polarAmplitudeAxisTimeTicks:st,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:P,polarRadialAxisTickStyle:Q,polarLineSeriesStrokeStyle:A,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:A,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:k,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:k,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:ut,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:lt,mapChartStrokeStyle:new us({thickness:1,fillStyle:new N({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:_,mapChartOutlierRegionStrokeStyle:new us({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:dt,mapChartSeparateRegionStrokeStyle:ft,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:ut,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:lt,dataGridCellBackgroundFillStyle:new N({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new us({thickness:.4,fillStyle:new N({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:ut,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ft,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ft,dataGridScrollBarButtonArrowFillStyle:gt,dataGridScrollBarButtonArrowStrokeStyle:ft,sparkLineChartStrokeStyle:A(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:ft,sparkChartBandFillStyle:rt,sparkChartBandStrokeStyle:nt,sparkChartConstantLineStrokeStyle:ot,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:ut,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new us({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new us({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new us({thickness:2,fillStyle:i}),spiderSeriesFillStyle:k,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:ut,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:ft,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:pt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:ut,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:ft,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:pt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:ut,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:ft,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:pt,gaugeChartValueLabelFont:c.setSize(60),gaugeChartUnitLabelFont:c.setSize(40),gaugeChartTickFont:c.setSize(30),gaugeChartBarThickness:40,gaugeChartValueIndicatorThickness:10,gaugeChartRoundedEdges:!0,gaugeChartNeedleLength:40,gaugeChartStartAngle:225,gaugeChartEndAngle:-45,gaugeChartNeedleAlignment:0,gaugeChartGapBetweenBarAndValueIndicators:10,gaugeChartTickFillStyle:t.uiTextFillStyle,gaugeChartBarGradient:!0,gaugeChartBarStrokeStyle:ut,gaugeChartUnitLabelFillStyle:t.uiTextFillStyle,gaugeChartValueLabelFillStyle:t.uiTextFillStyle,gaugeChartBarColor:C(255,255,255),gaugeChartGlowColor:C(255,255,64),gaugeChartNeedleFillStyle:new N({color:C(255,255,255)}),gaugeChartNeedleThickness:10,gaugeChartNeedleStrokeStyle:new us({thickness:2,fillStyle:new N({color:C(0,0,0)})}),gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:ut,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:ut,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new us({thickness:1,fillStyle:new N({color:T("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:ct,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:ut,zoomBandChartDefocusOverlayFillStyle:St,zoomBandChartSplitterStrokeStyle:vt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:C(254,204,0,.7),parallelCoordinateChartBackgroundFillStyle:t.panelBackgroundFillStyle,parallelCoordinateChartBackgroundStrokeStyle:ut,parallelCoordinateChartTitleFont:o,parallelCoordinateChartTitleFillStyle:t.titleFillStyle,parallelCoordinateChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,parallelCoordinateChartSeriesBackgroundStrokeStyle:d,parallelCoordinateChartSeriesColor:e=>t.dataColorPalette[e%t.dataColorPalette.length].stroke,parallelCoordinateChartSeriesColorUnselected:t.dataColorUnselected,parallelCoordinateChartSeriesLineThickness:2,parallelCoordinateChartPointedSeriesLineStyle:p[0],parallelCoordinateAxisTitleFont:h,parallelCoordinateAxisTitleFillStyle:t.axisTitleFillStyle,parallelCoordinateAxisNumericTicks:et,parallelCoordinateAxisDateTimeTicks:it,parallelCoordinateAxisTimeTicks:st,parallelCoordinateAxisStrokeStyle:P,parallelCoordinateAxisRangeSelectorFillStyle:t.seriesBackgroundFillStyle,parallelCoordinateAxisRangeSelectorStrokeStyle:ft,parallelCoordinateAxisBackgroundFillStyle:new ht({angle:90,stops:[{offset:0,color:t.isDark?C(0,0,0,0):C(255,255,255,0)},{offset:1,color:t.isDark?C(0,0,0,255):C(255,255,255,180)}]}),uiButtonFillStyle:gt,uiButtonFillStyleHidden:mt,uiButtonStrokeStyle:ft,uiButtonSize:10,uiBackgroundFillStyle:dt,uiBackgroundStrokeStyle:ft,uiTextFillStyle:ct,uiTextFillStyleHidden:yt,uiTextFont:c,legendTitleFillStyle:ct,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:dt,cursorTickMarkerXBackgroundStrokeStyle:ft,cursorTickMarkerXTextFillStyle:ct,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:dt,cursorTickMarkerYBackgroundStrokeStyle:ft,cursorTickMarkerYTextFillStyle:ct,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:At.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:dt,cursorResultTableStrokeStyle:ft,cursorResultTableTextFillStyle:ct,cursorResultTableTextFont:c,cursorGridStrokeStyleX:At,cursorGridStrokeStyleY:At,cursor3DGridStrokeStyleX:xt,cursor3DGridStrokeStyleY:xt,cursor3DGridStrokeStyleZ:xt,cursor3DTickStrokeStyleX:Q.tickStyle,cursor3DTickStrokeStyleY:Q.tickStyle,cursor3DTickStrokeStyleZ:Q.tickStyle,cursor3DTickLabelFillStyleX:ct,cursor3DTickLabelFillStyleY:ct,cursor3DTickLabelFillStyleZ:ct,cursor3DTickLabelFontX:c,cursor3DTickLabelFontY:c,cursor3DTickLabelFontZ:c,cursor3DTickLabelBackgroundFillStyleX:bt,cursor3DTickLabelBackgroundFillStyleY:bt,cursor3DTickLabelBackgroundFillStyleZ:bt,cursor3DTickLabelBackgroundStrokeStyleX:ft,cursor3DTickLabelBackgroundStrokeStyleY:ft,cursor3DTickLabelBackgroundStrokeStyleZ:ft,cursor3DTickLabelPaddingX:{left:4,right:4,top:4,bottom:4},cursor3DTickLabelPaddingY:{left:4,right:4,top:4,bottom:4},cursor3DTickLabelPaddingZ:{left:4,right:4,top:4,bottom:4}};return t.overrideThemeProperties&&(Mt={...Mt,...t.overrideThemeProperties}),Mt})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},jf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.src=s,i},$f=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ge(e[s%e.length].stroke,C(255,255,255),.5);return new rt({stops:[{color:ge(r,C(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ge(r,C(30,30,30),.5*i).setA(100),offset:1}]})},Zf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ge(e[s%e.length].stroke,C(255,255,255),.2);return new rt({stops:[{color:ge(r,C(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ge(r,C(0,0,0),.2*i),offset:1}]})},qf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ge(e[s%e.length].stroke,C(255,255,255),.2);return new ht({angle:90,stops:[{color:ge(r,C(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ge(r,C(30,30,30),.5*i),offset:1}]})},Kf=(t,e,i)=>(()=>{const i=new Map;return s=>{const r=i.get(s);if(r)return r;const n=(i=>{const s=!0===t?e[i%e.length].stroke:ge(e[i%e.length].stroke,C(255,255,255),.3);return new ht({angle:90,stops:[{color:ge(s,C(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ge(s,C(30,30,30),.5),offset:1}]})})(s);return i.set(s,n),n}})(),Jf=Fe((()=>{const t=C(255,255,255),i=new N({color:t}),s=!0,r=new xo({spread:1,blur:9,offset:{x:0,y:0},color:C(0,0,0,150)}),n=new rt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:C(50,51,52)},{offset:.5,color:C(14,15,16)},{offset:1,color:C(0,0,0)}]}),o=new N({color:C(45,45,45)}),h=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(120,120,120,100)},{offset:1,color:C(0,0,0,50)}]}),a=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(30,30,30,200)},{offset:1,color:C(0,0,0,255)}]}),l=new N({color:C(255,255,220)}),u=new N({color:C(255,255,166)}),c=new N({color:C(255,255,220)}),d=new N({color:C(255,255,220,130)}),f=new N({color:C(255,255,200)}),g=f,m=g,y=new ht({angle:45,stops:[{offset:0,color:C(230,230,230)},{offset:1,color:C(150,150,150)}]}),p=new N({color:C(220,220,220)}),A=new N({color:C(200,200,200,50)}),x=new N({color:C(200,200,200,150)}),S=new N({color:C(200,200,200,20)}),v=new N({color:C(220,220,220)}),b=new ht({angle:0,stops:[{offset:0,color:C(10,10,10,220)},{offset:1,color:C(30,30,30,220)}]}),M=i,w=C(255,255,200),E=b,k=M,I=C(20,20,20),z=C(0,0,0),F=t,R=C(150,150,150),D=C(50,50,50),P=C(50,50,50),O=C(100,100,100),L=C(200,200,200),_=[C(255,255,91,255),C(255,205,91,255),C(255,155,91,255),C(255,196,188,255),C(255,148,184,255),C(219,148,198,255),C(235,196,224,255),C(169,148,198,255),C(148,226,198,255),C(148,255,176,255),C(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),B=t.setA(20),V=C(176,255,157,255),G=C(255,112,76,255),U={mapChartFillStyle:new ht({angle:135,stops:[{color:C(255,255,91,255),offset:0},{color:C(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:$f(s,_,.5),pieChartSliceFillStylePalette:Zf(s,_,1),funnelChartSliceFillStylePalette:qf(s,_,1),pyramidChartSliceFillStylePalette:qf(s,_,1),rectangleSeriesFillStyle:Kf(s,_),gaugeChartBarColor:C(255,255,91,255),gaugeChartGlowColor:C(255,255,91,64)},Y=new N({color:C(176,255,157,255)}),H=new N({color:C(255,146,146,255)}),X=new N({color:C(176,255,157,255)}),W=new N({color:C(230,63,63,255)}),j=new N({color:C(176,255,157,120)}),$=new N({color:C(229,63,63,180)}),Z=new N({color:C(27,37,36,255)}),q=new N({color:C(62,27,27,255)}),K=[C(255,0,0),C(255,255,0),C(0,255,0)],J=[C(10,10,255),C(10,190,255),C(251,255,0),C(255,38,0)],tt=[C(255,255,0),C(255,204,0),C(255,128,0),C(255,0,0)],et=[C(0,0,0),C(167,4,69,255),C(255,0,0),C(252,252,168,255)],it=new rt({stops:[{color:C(61,61,80,100),offset:0},{color:C(44,44,55,30),offset:1}]}),st=new N({color:C(148,148,198,255)}),nt=j.getColor().setA(255),ot=C(100,100,100),at=[C(255,241,149,200),C(255,230,65,200),C(238,211,32,200),C(238,176,32,200),C(255,159,13,200),C(254,120,37,200),C(253,91,56,200),C(253,75,84,200),C(254,95,124,200),C(227,56,160,200),C(226,53,134,200),C(216,90,166,200),C(254,151,206,200),C(237,151,254,200),C(243,177,255,200),C(233,133,252,200),C(210,101,230,200),C(178,61,200,200),C(193,81,156,200),C(217,95,145,200)];return Wf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:A,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:I,uiBackgroundBorderColor:z,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:R,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:O,dataStrokeColorContrastLow:L,dataColorPalette:_,dataColorPaletteInverted:[{area:C(190,50,50,100),border:C(210,80,80)}],dataHighlightOverlayColor:B,dataColorPositive:V,dataColorNegative:G,zoomBandChartDefocusOverlayFillStyle:new N({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(255,255,255,24),overrideThemeProperties:U,treeMapChartParentColor:T("#181E21"),treeMapChartNodeColors:at,treeMapChartLabelFillStyle:new N({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new N({color:C(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:H,positiveFillStyle:X,negativeFillStyle:W,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:Z,negativeBackgroundFillStyle:q,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),Qf=Fe((()=>{const t=C(255,255,255),i=new N({color:t}),s=!0,r=new xo({spread:0,blur:9,offset:{x:0,y:0},color:C(105,255,236,40)}),n=new N({color:C(2,21,30)}),o=new rt({stops:[{color:C(19,40,66,150),offset:0},{color:C(0,0,0,150),offset:1}]}),h=new N({color:C(0,5,8,150)}),a=i,l=i,u=i,c=new N({color:C(255,255,220,130)}),d=i,f=i,g=f,m=new N({color:C(20,224,250,255)}),y=i,p=new N({color:C(61,94,110,100)}),A=new N({color:C(61,94,110,255)}),x=new N({color:C(61,94,110,40)}),S=i,v=new N({color:C(0,18,23,255)}),b=i,M=t,w=new N({color:C(0,17,22,240)}),E=i,k=C(0,38,48,220),I=C(0,0,0),z=t,F=C(150,150,150),R=C(19,78,93),D=C(50,50,50),P=C(0,36,48),O=C(200,200,200),L=[C(45,253,253,255),C(44,172,247,255),C(46,100,248,255),C(96,84,199,255),C(184,104,245,255),C(98,160,218,255),C(43,238,245,255),C(38,140,206,255),C(112,96,224,255),C(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),_=t.setA(50),B=C(3,217,194,255),V=C(230,63,63,255),G={mapChartFillStyle:new ht({angle:135,stops:[{color:C(118,248,231,255),offset:0},{color:C(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:$f(s,L,1),pieChartSliceFillStylePalette:Zf(s,L,1),funnelChartSliceFillStylePalette:qf(s,L,1),pyramidChartSliceFillStylePalette:qf(s,L,1),rectangleSeriesFillStyle:Kf(s,L),gaugeChartBarColor:C(3,217,194,255),gaugeChartGlowColor:C(3,217,194,120)},U=new N({color:C(45,253,253,255)}),Y=new N({color:C(255,146,146,255)}),H=new N({color:C(45,253,253,255)}),X=new N({color:C(230,63,63,255)}),W=new N({color:C(1,190,164,120)}),j=new N({color:C(229,63,63,180)}),$=new N({color:C(1,53,57,255)}),Z=new N({color:C(62,27,27,255)}),q=[C(1,104,119,255),C(0,165,144,255),C(0,246,214,255)],K=[C(0,87,95,255),C(0,125,124,255),C(1,209,182,255),C(0,255,221,255),C(218,112,112,255),C(172,47,47,255)],J=[C(126,255,253,255),C(50,233,230,255),C(0,196,193,255),C(62,138,178,255),C(139,88,191,255),C(162,55,143,255)],tt=[C(13,31,52,255),C(101,50,118,255),C(1,142,172,255),C(2,196,170,255),C(0,255,221,255)],et=new rt({stops:[{color:C(122,103,254,70),offset:0},{color:C(178,168,255,10),offset:1}]}),it=new N({color:C(122,103,254,255)}),st=W.getColor().setA(255),nt=C(15,83,83),ot=[C(139,252,252,150),C(60,239,239,150),C(2,201,201,150),C(26,159,159,150),C(15,146,187,150),C(65,168,200,150),C(67,146,207,150),C(64,108,209,150),C(189,64,233,150),C(219,84,238,150),C(192,55,212,150),C(212,98,229,150),C(248,110,211,150),C(251,154,225,150),C(251,154,184,150),C(233,105,144,150),C(255,133,170,150),C(249,110,135,150),C(245,72,101,150),C(210,57,84,150)];return Wf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Q({source:jf(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:z,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:R,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:O,dataColorPalette:L,dataColorPaletteInverted:[{area:C(170,60,210,100),border:C(210,100,250)}],dataHighlightOverlayColor:_,dataColorPositive:B,dataColorNegative:V,zoomBandChartDefocusOverlayFillStyle:new N({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(255,255,255,24),overrideThemeProperties:G,treeMapChartParentColor:T("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new N({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new N({color:C(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:nt})})),tg=Fe((()=>{const t=!1,i=new xo({spread:0,blur:6,offset:{x:2,y:-2},color:C(0,0,0,30)}),s=new rt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:C(255,255,255)},{offset:1,color:C(255,255,255)}]}),r=new N({color:C(219,227,233,255)}),n=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(255,255,255,200)},{offset:1,color:C(240,244,246,200)}]}),o=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(255,255,255,255)},{offset:1,color:C(255,255,255,255)}]}),h=new N({color:C(33,43,49)}),a=new N({color:C(33,43,49)}),l=new N({color:C(33,43,49)}),u=new N({color:C(33,43,49,150)}),c=new N({color:C(33,43,49)}),d=c,f=d,g=new ht({angle:45,stops:[{offset:0,color:C(225,225,225)},{offset:1,color:C(225,225,225)}]}),m=new N({color:C(150,150,150,255)}),y=new N({color:C(150,150,150,170)}),p=new N({color:C(150,150,150,150)}),A=new N({color:C(150,150,150,100)}),x=new N({color:C(60,70,80)}),S=new ht({angle:0,stops:[{offset:0,color:C(255,255,255,240)},{offset:1,color:C(255,255,255,240)}]}),v=new N({color:C(168,186,199)}),b=C(255,255,200),M=new N({color:C(255,255,255,240)}),w=new N({color:C(128,146,159,255)}),E=C(255,255,255,255),k=C(168,168,199,255),I=C(168,186,199,255),z=C(168,186,199,255),F=C(168,186,199,255),R=C(168,186,199,255),D=C(100,100,100),P=C(200,200,200),O=[C(28,181,140,255),C(255,132,0,255),C(240,39,39,255),C(86,121,251,255),C(2,181,213,255),C(13,212,158,255),C(22,167,3,255),C(234,103,232,255),C(62,183,179,255),C(140,93,3,255),C(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),L=C(150,150,150,80),_=C(46,182,120,255),B=C(255,66,66,255),V=new us({thickness:2,fillStyle:new N({color:C(168,186,199,255)})}),G={mapChartFillStyle:new ht({angle:-45,stops:[{color:C(2,181,213,255),offset:0},{color:C(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:$f(t,O,.8),pieChartSliceFillStylePalette:Zf(t,O,.8),funnelChartSliceFillStylePalette:qf(t,O,.5),pyramidChartSliceFillStylePalette:qf(t,O,.5),rectangleSeriesFillStyle:Kf(t,O),gaugeChartBarColor:C(46,182,120,255),gaugeChartGlowColor:C(46,182,120,120),chartXYSeriesBackgroundStrokeStyle:V,chart3DSeriesBackgroundStrokeStyle:V,polarChartSeriesBackgroundStrokeStyle:V,spiderChartSeriesBackgroundStrokeStyle:V,dataGridTextFillStyle:new N({color:C(0,88,64,255)})},U=new N({color:C(4,146,108,255)}),Y=new N({color:C(240,39,39,255)}),H=new N({color:C(28,181,140,255)}),X=new N({color:C(230,88,88,255)}),W=new N({color:C(28,181,140,180)}),j=new N({color:C(230,88,88,180)}),$=new N({color:C(229,243,228)}),Z=new N({color:C(232,225,216)}),q=[C(193,48,48,255),C(240,234,60,255),C(45,191,55,255)],K=[C(10,19,255,255),C(15,191,250,255),C(249,255,2,255),C(253,133,0,255),C(255,24,0,255)],J=[C(50,99,213),C(8,179,77),C(255,246,0),C(255,126,0),C(189,36,30)],tt=[C(16,64,176),C(8,179,77),C(255,246,0),C(255,126,0),C(168,6,0)],et=new N({color:C(185,198,207,255)}),it=new rt({stops:[{color:C(151,190,220,10),offset:0},{color:C(151,190,220,50),offset:1}]}),st=W.getColor().setA(255),nt=C(150,150,150),ot=[C(255,243,136,125),C(254,237,99,125),C(255,216,109,125),C(255,172,100,125),C(255,133,101,125),C(255,113,142,125),C(230,103,129,125),C(242,126,219,125),C(255,155,235,125),C(255,181,240,125),C(203,143,255,125),C(208,154,255,125),C(171,188,255,125),C(197,209,255,125),C(171,187,255,125),C(84,167,239,125),C(38,196,214,125),C(38,214,196,125),C(69,225,141,125),C(36,191,88,125)];return Wf({isDark:t,highlightColorOffset:C(-60,-60,-60,60),highlightColorOffsetAxisOverlay:C(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:p,axisGridMinorFillStyle:A,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:z,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:R,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:P,dataColorPalette:O,dataColorPaletteInverted:[{area:C(190,50,50,100),border:C(210,80,80)}],dataHighlightOverlayColor:L,dataColorPositive:_,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new N({color:C(255,255,255,180)}),zoomBandChartSplitterColor:T("#505D65"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(0,0,0,24),overrideThemeProperties:G,treeMapChartParentColor:T("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new N({color:C(0,0,0)}),treeMapChartLabelHeaderFillStyle:new N({color:C(33,33,33)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:C(0,0,0),highlightDataGridColor:st,unfocusedDataColor:nt})})),eg=Fe((()=>{const t=!1,i=new rt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:C(255,255,255)},{offset:1,color:C(255,255,255)}]}),s=new N({color:C(214,236,216,255)}),r=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(233,244,231,70)},{offset:1,color:C(233,244,231,200)}]}),n=new rt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:C(255,255,255,255)},{offset:1,color:C(255,255,255,255)}]}),o=new N({color:C(1,61,53)}),h=new N({color:C(1,61,53)}),a=new N({color:C(1,61,53)}),l=new N({color:C(1,61,53,150)}),u=new N({color:C(1,61,53)}),c=u,d=c,f=new ht({angle:45,stops:[{offset:0,color:C(225,225,225)},{offset:1,color:C(225,225,225)}]}),g=new N({color:C(188,211,186,255)}),m=new N({color:C(188,211,186,150)}),y=new N({color:C(188,211,186,50)}),p=new N({color:C(188,211,186,50)}),A=new N({color:C(104,148,111,255)}),x=new ht({angle:0,stops:[{offset:0,color:C(255,255,255,240)},{offset:1,color:C(255,255,255,240)}]}),S=new N({color:C(104,148,111)}),v=C(255,255,200),b=new N({color:C(255,255,255,240)}),M=new N({color:C(104,148,111,255)}),w=C(255,255,255,255),E=C(179,201,183,255),k=C(188,211,186,255),I=C(188,211,186,255),z=C(188,211,186,255),F=C(188,211,186,255),R=C(100,100,100),D=C(200,200,200),P=[C(138,195,142,255),C(193,161,114,255),C(178,99,99,255),C(142,156,210,255),C(154,209,219,255),C(164,212,199,255),C(104,156,97,255),C(196,147,195,255),C(92,190,187,255),C(126,100,51,255),C(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),O=C(150,150,150,80),L=C(46,182,84,255),_=C(232,96,96,255),B=new us({thickness:2,fillStyle:new N({color:C(188,211,186,255)})}),V={mapChartFillStyle:new ht({angle:-45,stops:[{color:C(118,160,121,255),offset:0},{color:C(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:$f(t,P,.8),pieChartSliceFillStylePalette:Zf(t,P,.8),pyramidChartSliceFillStylePalette:qf(t,P,.5),funnelChartSliceFillStylePalette:qf(t,P,.5),rectangleSeriesFillStyle:Kf(t,P),gaugeChartBarColor:C(46,182,84,255),gaugeChartGlowColor:C(46,182,84,120),chartXYSeriesBackgroundStrokeStyle:B,chart3DSeriesBackgroundStrokeStyle:B,polarChartSeriesBackgroundStrokeStyle:B,spiderChartSeriesBackgroundStrokeStyle:B,dataGridTextFillStyle:new N({color:C(77,66,21,255)})},G=new N({color:C(93,151,97,255)}),U=new N({color:C(178,99,99,255)}),Y=new N({color:C(138,195,142,255)}),H=new N({color:C(178,99,99,255)}),X=new N({color:C(138,195,142,180)}),W=new N({color:C(178,99,99,180)}),j=new N({color:C(224,240,237)}),$=new N({color:C(251,227,227)}),Z=[C(178,99,99,255),C(215,224,111,255),C(80,186,88,255)],q=[C(62,64,142,255),C(66,131,77,255),C(250,250,135,255),C(202,161,78,255),C(179,53,53,255)],K=[C(64,86,138),C(123,192,205),C(255,252,149),C(220,155,92),C(184,78,74)],J=[C(64,86,138),C(123,192,205),C(255,252,149),C(220,155,92),C(132,60,57)],tt=new N({color:C(185,198,207,255)}),et=new rt({stops:[{color:C(151,190,220,10),offset:0},{color:C(151,190,220,50),offset:1}]}),it=X.getColor().setA(255),st=C(150,150,150),nt=[C(242,239,210,150),C(243,238,183,150),C(210,222,136,150),C(204,217,148,150),C(157,190,124,150),C(143,178,72,150),C(198,147,88,150),C(216,148,71,150),C(229,142,103,150),C(225,174,152,150),C(219,149,203,150),C(216,188,209,150),C(109,198,189,150),C(172,206,202,150),C(164,223,217,150),C(174,215,233,150),C(203,225,235,150),C(220,227,243,150),C(207,213,227,150),C(171,182,209,150)];return Wf({isDark:t,highlightColorOffset:C(-60,-60,-60,60),highlightColorOffsetAxisOverlay:C(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:y,axisGridMinorFillStyle:p,cursorGridFillStyle:A,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:w,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:z,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:R,dataStrokeColorContrastLow:D,dataColorPalette:P,dataColorPaletteInverted:[{area:C(210,70,70,100),border:C(200,110,110)}],dataHighlightOverlayColor:O,dataColorPositive:L,dataColorNegative:_,zoomBandChartDefocusOverlayFillStyle:new N({color:C(255,255,255,180)}),zoomBandChartSplitterColor:T("#446A40"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(0,0,0,24),overrideThemeProperties:V,treeMapChartParentColor:T("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new N({color:C(0,0,0)}),treeMapChartLabelHeaderFillStyle:new N({color:C(33,33,33)})},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:q,intensityColorPalette:K,spectrogramColorPalette:J,bollingerFillStyle:et,bollingerBorderFillStyle:tt,highlightPointColor:C(0,0,0),highlightDataGridColor:it,unfocusedDataColor:st})})),ig=Fe((()=>{const t=C(255,255,255),i=new N({color:t}),s=!0,r=new xo({spread:1,blur:9,offset:{x:0,y:0},color:C(255,255,255,30)}),n=new N({color:C(6,15,36)}),o=new rt({stops:[{color:C(46,13,87,50),offset:0},{color:C(0,0,0,150),offset:1}]}),h=new N({color:C(0,5,8,150)}),a=i,l=i,u=i,c=new N({color:C(255,255,220,130)}),d=i,f=i,g=f,m=new ht({angle:45,stops:[{offset:0,color:C(241,133,255,255)},{offset:1,color:C(115,207,238,255)}]}),y=i,p=new N({color:C(61,94,110,100)}),A=new N({color:C(61,94,110,255)}),x=new N({color:C(61,94,110,40)}),S=i,v=new N({color:C(0,18,23,255)}),b=i,M=C(115,207,238,255),w=new N({color:C(0,17,22,240)}),E=i,k=C(0,38,48,255),I=C(0,0,0),z=t,F=C(150,150,150),R=C(19,57,93),D=C(50,50,50),P=C(0,17,48),O=C(200,200,200),L=[C(20,211,237,255),C(98,147,252,255),C(164,73,250,255),C(129,117,253,255),C(95,134,252,255),C(22,133,212,255),C(35,200,242,255),C(104,121,233,255),C(137,69,232,255),C(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),_=t.setA(50),B=C(3,217,194,255),V=C(243,21,110,255),G={mapChartFillStyle:new ht({angle:135,stops:[{color:C(118,248,231,255),offset:0},{color:C(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:$f(s,L,.5),pieChartSliceFillStylePalette:Zf(s,L,2),funnelChartSliceFillStylePalette:qf(s,L,1),pyramidChartSliceFillStylePalette:qf(s,L,1),rectangleSeriesFillStyle:Kf(s,L),gaugeChartBarColor:C(3,217,194,255),gaugeChartGlowColor:C(3,217,194,150)},U=new N({color:C(20,211,237,255)}),Y=new N({color:C(253,145,178,255)}),H=new N({color:C(20,211,237,255)}),X=new N({color:C(239,68,121,255)}),W=new N({color:C(20,211,237,120)}),j=new N({color:C(239,68,121,180)}),$=new N({color:C(1,53,57,255)}),Z=new N({color:C(94,19,42,255)}),q=[C(174,51,132,255),C(204,107,218,255),C(189,215,253,255)],K=[C(0,63,95,255),C(0,149,255,255),C(0,225,255,255),C(255,154,254,255),C(204,98,170,255),C(139,39,84,255)],J=[C(197,241,255,255),C(70,210,255,255),C(0,164,217,255),C(90,99,222,255),C(138,75,192,255),C(151,27,162,255)],tt=[C(13,31,52,255),C(129,54,130,255),C(131,108,176,255),C(7,162,213,255),C(26,247,255,255)],et=new rt({stops:[{color:C(219,42,235,60),offset:0},{color:C(237,73,252,10),offset:1}]}),it=new N({color:C(237,73,252,255)}),st=W.getColor().setA(255),nt=C(8,70,100),ot=[C(149,230,255,150),C(93,213,243,150),C(20,189,223,150),C(5,151,181,150),C(2,138,198,150),C(2,113,198,150),C(97,148,236,150),C(93,111,230,150),C(151,120,223,150),C(128,87,227,150),C(153,52,230,150),C(179,92,245,150),C(248,110,211,150),C(255,155,228,150),C(251,88,207,150),C(255,0,162,150),C(214,73,177,150),C(209,71,159,150),C(238,101,169,150),C(210,57,134,150)];return Wf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Q({source:jf(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:z,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:R,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:O,dataColorPalette:L,dataColorPaletteInverted:[{area:C(41,130,255,100),border:C(45,110,240)}],dataHighlightOverlayColor:_,dataColorPositive:B,dataColorNegative:V,zoomBandChartDefocusOverlayFillStyle:new N({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#DB77FF"),zoomBandChartKnobFillStyle:t=>new Q({source:jf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},dataColorUnselected:C(255,255,255,24),overrideThemeProperties:G,treeMapChartParentColor:T("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new N({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new N({color:C(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:nt})})),sg={};Object.defineProperty(sg,"darkGold",{get:Jf,enumerable:!0}),Object.defineProperty(sg,"turquoiseHexagon",{get:Qf,enumerable:!0}),Object.defineProperty(sg,"light",{get:tg,enumerable:!0}),Object.defineProperty(sg,"lightNature",{get:eg,enumerable:!0}),Object.defineProperty(sg,"cyberSpace",{get:ig,enumerable:!0});const rg=sg,ng=rg.darkGold;class og extends el{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.JL=u}setLabelAlignment(t){return this.JL=t,this.Ms(),this}getLabelAlignment(){return this.JL}}class hg extends gr{constructor(t,i,s,r,n,o,h){let a;super(t,{Dr:()=>t.KL?t.KL[this.key].max:void 0,Pr:()=>t.KL?t.KL[this.key].min:void 0,Lr:()=>{}},o,i,s,{numeric:i.parallelCoordinateAxisNumericTicks||i.yAxisNumericTicks,datetime:i.parallelCoordinateAxisDateTimeTicks||i.yAxisDateTimeTicks,time:i.parallelCoordinateAxisTimeTicks||i.yAxisTimeTicks},{type:"linear"}),this.qL=[],this.Uf=[],this.tR=!0,this.iR=8,this.ji=!1,this.sR=(t,i)=>{this.eR=this.chart.engine.setMouseStyle(e.MouseStyles.Vertical,this.eR)},this.hR=(t,e)=>{this.chart.engine.restoreMouseStyle(this.eR)},this.rR=(t,e)=>{const i=this.qL.find((e=>e.shape===t));if(!i)return;if(!i.mouseInteractions)return;const s=this.chart.cs.Uo(e),r=yt({x:s.engineX,y:s.engineY},this.chart.cs.At,this.chart.nR),n=this.chart.nR.y.pi(t.xt(),10),o=this.chart.nR.y.pi(t.bt(),-10);r.y<=n?this.oR={selector:i,type:"scaleMin"}:r.y>=o?this.oR={selector:i,type:"scaleMax"}:this.oR={selector:i,type:"move"},se(e)},this.aR=(t,e,i)=>{if(void 0===this.lR)return;if(!this.oR)return;const{selector:s,type:r}=this.oR;if(!s.mouseInteractions)return;const n=.05*Math.abs(this.Xh-this.$h);if("move"===r){const t=s.max-s.min,e=this.chart.uR(s.max,this.lR,this).y,r=this.chart.nR.y.pi(e,i.y),n=this.chart.cR(r,this.lR,this);s.max=_t(n,Math.max(this.$h,this.Xh),Math.min(this.$h,this.Xh)+t),s.min=s.max-t}else if("scaleMax"===r){const t=this.chart.uR(s.max,this.lR,this).y,e=this.chart.nR.y.pi(t,i.y),r=this.chart.cR(e,this.lR,this);s.max=_t(r,s.min+n,Math.max(this.$h,this.Xh))}else if("scaleMin"===r){const t=this.chart.uR(s.min,this.lR,this).y,e=this.chart.nR.y.pi(t,i.y),r=this.chart.cR(e,this.lR,this);s.min=_t(r,s.max-n,Math.min(this.$h,this.Xh))}this.chart.dR(),se(e)},this.fR=(t,e)=>{const i=this.qL.find((e=>e.shape===t));if(!i)return;if(!i.mouseInteractions)return;const s=this.qL.indexOf(i);s>=0&&this.qL.splice(s,1),i.shape.dispose(),this.chart.dR(),se(e)},this.AR=t=>{this.tR&&(this.addRangeSelector(),se(t))},this.chart=t,this.key=r,this.userID=n,this.hs=this.chart.cs.hs.rs(this,{}),this.Rs=h,this.gR=h.Ee(t.nR).Re(this.ts.parallelCoordinateAxisBackgroundFillStyle||_).Le(ut).setMouseInteractions(!1),this.Fh=h.Wr(t.nR).ir(this.ts.parallelCoordinateAxisTitleFont||this.ts.yAxisTitleFont).Re(this.ts.parallelCoordinateAxisTitleFillStyle||this.ts.yAxisTitleFillStyle).setMouseInteractions(!1).Gr(Le).Ur(Le),this.hr=this.hs.Bg([this.Fh]).bs(i.effectsText),this.$D=h.He(t.nR).Ye(i.parallelCoordinateAxisStrokeStyle||i.yAxisStrokeStyle),this.setAnimationsEnabled(!1),this.onIntervalChange(((e,i,s)=>{t.pR(this,i,s)})),this.$D.setMouseEnterEventHandler((()=>{this.tR&&(a=this.chart.engine.setMouseStyle(e.MouseStyles.Point))})),this.$D.setMouseLeaveEventHandler((()=>{this.chart.engine.restoreMouseStyle(a)})),this.$D.setMouseDoubleClickEventHandler(((t,e)=>this.AR(e)));const l=ns(new os(((t,e)=>{this.AR(e)})));this.$D.setTouchStartEventHandler(l.onTouchStart),this.$D.setTouchMoveEventHandler(l.onTouchMove),this.$D.setTouchEndEventHandler(l.onTouchEnd),this.setTitle(r)}setBackgroundFillStyle(t){return this.gR.Re(t),this.Rs.Ms(),this}getBackgroundFillStyle(){return this.gR.Jh()}setStrokeStyle(t){const e="function"==typeof t?t(this.$D.xu()):t,i=e.getFillStyle();return j(i)?(this.yR=i.lut,this.chart.mR=!0):this.yR=void 0,this.$D.Ye(e),this.chart.cs.Ms(),this}getStrokeStyle(){return this.$D.xu()}setMouseInteractionRangeSelectors(t){return this.tR=t,this}getMouseInteractionRangeSelectors(){return this.tR}setTickStrategy(t,e){return super.Hh(t,e)}getTickStrategy(){return this.lh}addRangeSelector(){const t=this.Ar(),e=this.Rs.Ee(this.chart.nR).Re(this.ts.parallelCoordinateAxisRangeSelectorFillStyle||this.ts.dataGridScrollBarFillStyle).Le(this.ts.parallelCoordinateAxisRangeSelectorStrokeStyle||this.ts.dataGridScrollBarStrokeStyle).setMouseEnterEventHandler(this.sR).setMouseLeaveEventHandler(this.hR).setMouseDragStartEventHandler(((t,e)=>this.rR(t,e))).setMouseDragEventHandler(((t,e,i,s,r)=>this.aR(t,e,r))).setMouseDoubleClickEventHandler(this.fR).setMouseInteractions(!0),i=ns(new hs(((t,e,i)=>this.rR(t,i)),((t,e,i,s,r)=>this.aR(t,r,s)),((t,e,i,s)=>{}),1));e.setTouchStartEventHandler(i.onTouchStart),e.setTouchMoveEventHandler(i.onTouchMove),e.setTouchEndEventHandler(i.onTouchEnd);const s={min:t.min+.25*(t.max-t.min),max:t.max-.25*(t.max-t.min),shape:e,mouseInteractions:!0};this.qL.push(s),this.chart.dR();const r={setInterval:(t,e)=>(s.min=Math.min(t,e),s.max=Math.max(t,e),this.chart.dR(),r),setMouseInteractions:t=>(s.mouseInteractions=t,r),dispose:()=>{const t=this.qL.indexOf(s);return t>=0&&(this.qL.splice(t,1),this.chart.dR()),r}};return r}addCustomTick(){const t=new og((()=>this.chart.cs.Ms()),(()=>{const e=this.Uf.indexOf(t);e>=0&&this.Uf.splice(e,1)}),(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.tickStyle,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.tickLength,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.gridStrokeStyle,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.tickPadding,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelRotation,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelFillStyle,(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelFont,(t=>this.formatValue(t)),(this.ts.parallelCoordinateAxisNumericTicks||this.ts.yAxisNumericTicks).majorTickStyle.labelAlignment);return this.Uf.push(t),this.chart.cs.Ms(),t}Os(){if(!this.Zi)return{Wg:0,vR:0,SR:0,Qd:0};const t=!(this.uh.size>0),e=this.Fh&&this.Fh.Tr().length>0&&this.getTitleFillStyle()!==_?this.chart.cs.$g.Hg(this.Fh.Tr(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0},i=ur(this.ah)?new Map:yr(this.ah,Math.min(this.$h,this.Xh),Math.max(this.$h,this.Xh),this.$h,this.Xh,0),s=this.At;let r=0;i.forEach(((e,i)=>{if(Qs(i)){const n=Math.max(...e.map((e=>{if(!ti(e,this.$h,this.Xh))return 0;const r=this.chart.cs.$g.Hg(i.Ze(e,s),i.je.labelFont,i.je.labelRotation);return t||!r.isEstimate?r.x:0})))+i.je.tickLength+i.je.tickPadding;r=Math.max(r,n)}}));const n=this.Uf.reduce(((t,e)=>Math.max(t,e.Zi?this.chart.cs.$g.Hg(e.lc(e.M),e.Mm,e.Yd).x+e.Sm+e.bm:0)),0);r=Math.max(r,n);const o=e.y+this.iR;r=Math.max(r,e.x/2);const h=r;return{Wg:r,vR:o,SR:e.x,Qd:h}}ze(t,e,i,s){this.lR=s;const r=Math.min(this.$h,this.Xh),n=Math.max(this.$h,this.Xh),o=this.chart.nR.y.ri(),h=this.$D.xu(),a=cs(h)?h.getThickness()/2:0,l=this.dr({physicalAxisSize:o,parallelAxisIndex:s,halfAxisThickness:a});for(const[t,e]of this.uh)for(const[,s]of e){const e=l.get(s);e&&i.add({positions:[e.positionTicklineStart,e.positionTicklineEnd]},{lineStyle:t.je.tickStyle})}this.Uf.forEach((t=>{if(!t.Zi||t.Mn)return;const o=this.ev(s,a,t.M,t.Sm,t.bm,t.JL);i.add({positions:[o.positionTicklineStart,o.positionTicklineEnd]},{lineStyle:t.vm}),e.add().Ve(o.positionLabel).Za(o.alignmentLabel).Re(t.ly).ir(t.Mm).Sr(t.lc(t.M)).sr(t.Yd).setMouseInteractions(t.Yo)})),this.$D.Xe({x:s,y:0}).$e({x:s,y:1}),this.Fh.Ve({x:s,y:this.chart.nR.y.pi(0,-(a+this.iR))}).sr(this.getTitleRotation()).Za({x:0,y:1});const u=0===s?s:this.chart.nR.x.pi(s,-1.2*t.Wg);this.gR.Ve({x:u,y:0}).it({x:s-u,y:1});const c=this.chart.nR.Ui();this.qL.forEach((t=>{const e=this.chart.uR(t.min,s,this),i=this.chart.uR(t.max,s,this),r={x:s-10*c.x*.5,y:e.y},n=s+10*c.x*.5,o=i.y;t.shape.Ve(r).it({x:n-r.x,y:o-r.y})}))}Y(){this.gR.dispose(),this.Fh.dispose(),this.$D.dispose(),this.qL.forEach((t=>t.shape.dispose())),this.qL.length=0,this.rr(),this.mr(),this.ji=!0,this.R.emit("dispose")}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setMouseInteractions(t){return this.setMouseInteractionRangeSelectors(t),this}Mr(t,e){return new mr(e,t,this.Rs,this.chart.nR)}_r(t,e){const i=t.Eh.je,s=this.getInterval(),r=this.ev(e.parallelAxisIndex,e.halfAxisThickness,t.M,i.getTickLength(),i.getTickPadding(),2*(t.M-s.start)/(s.end-s.start)-1);return t.rh.Ve(r.positionLabel).Za(r.alignmentLabel).sr(i.getLabelRotation()),r}ev(t,e,i,s,r,n){const o=this.chart.nR.pi({x:t,y:(i-this.$h)/(this.Xh-this.$h)},{x:0-e,y:0}),h=this.chart.nR.pi(o,{x:-s,y:0});return{positionTicklineStart:o,positionTicklineEnd:h,positionLabel:this.chart.nR.pi(h,{x:-r,y:0}),alignmentLabel:{x:1,y:n}}}Er(t,e){return Qi(t,e,this.At)}Vr(t,e,i){return{min:t,max:e}}}class ag extends su{constructor(t,e,i,s,r){super(t,e,i,s),this.Cs="Parallel Coordinate Series",this.xR=!1,this.ae=t;const n=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.ae.getSeries().length;this.bR=ve(this.ts.parallelCoordinateChartSeriesColor,n)||(()=>{const t=ve(this.ts.lineSeriesStrokeStyle,n).getFillStyle();return(U(t)?t.getColor():void 0)||C(255,255,0)})(),this.onVisibleStateChanged((()=>{this.ae.MR()})),this.onDispose((()=>{this.ae.MR()})),this.setHighlightOnHover(!1)}setData(t){const e=void 0!==this._R;return this._R=this.ae.wR(t),e&&this.ae.CR(),this}getData(){return this._R}setColor(t){const e="function"==typeof t?t(this.bR):t;return e===this.bR||(this.bR=e,this.ae.cs.Ms(),this.ae.kR(this)),this}getColor(){return this.bR}Av(){return this.getAutoScrollingEnabled()}Cv(){}ze(){}Pm(){}styleLegendEntry(t,e=!1){pe(t,this.ts,e,{fill:new N({color:this.bR})})}Yp(){return super.Yp()&&!this.xR}}class lg extends Sl{constructor(t,e,i,s,r,n,o){var h,a;super(t,e,i,e.Bp("parallelAxisChart bg",0),s,e.cs.ts.parallelCoordinateChartBackgroundFillStyle||e.cs.ts.chartXYBackgroundFillStyle,e.cs.ts.parallelCoordinateChartBackgroundStrokeStyle||e.cs.ts.chartXYBackgroundStrokeStyle,e.cs.ts.parallelCoordinateChartTitleFont||e.cs.ts.chartXYTitleFont,e.cs.ts.parallelCoordinateChartTitleFillStyle||e.cs.ts.chartXYTitleFillStyle,n),this.axes=[],this.TR=!0,this.FR=Oe(),this.IR=new Map,this.PR=this.ts.parallelCoordinateChartSeriesColorUnselected||C(255,255,255,30),this.DR=p({resolution:32}),this.BR=!0,this.mR=!1,this.LR=!1,this.RR=!0,this.ER=!1,this.zR=!1,this.VR=!1,this.OR=!1,this.kn=(t,e,i,s,r)=>{this.nR.it(s,r)},this.Ch.Sr("Parallel Coordinate Chart"),this.cs.Jn(Sh.Ef),this.nR=this.mp.d2({scaleXYConstructor:Yi}).Oi(0,1),this.Dp(r,this.nR),this.$v=this.gp.Ee(this.nR).Ve({x:0,y:0}).it({x:0,y:1}).Re(this.ts.parallelCoordinateChartSeriesBackgroundFillStyle||this.ts.chartXYSeriesBackgroundFillStyle).Le(ut).setMouseInteractions(!0),this.Xv=this.gp.Ee(this.nR).Ve({x:0,y:0}).it({x:0,y:1}).Re(_).Le(this.ts.parallelCoordinateChartSeriesBackgroundStrokeStyle||this.ts.chartXYBackgroundStrokeStyle).setMouseInteractions(!1),super.Hv(this.$v,this.Xv),this.setSeriesBackgroundEffect(!1),this.NR=new us({thickness:null!==(h=this.ts.parallelCoordinateChartSeriesLineThickness)&&void 0!==h?h:2,fillStyle:new Y}),this.GR=new us({thickness:null!==(a=this.ts.parallelCoordinateChartSeriesLineThickness)&&void 0!==a?a:2,fillStyle:new N({color:this.ts.parallelCoordinateChartSeriesColorUnselected})}),this.UR=this.FR.Mt(this.gp.Qg(this.nR)).Ye(this.NR),this.UR.ku=5e4,this.WR=this.gp.Qg(this.nR).Ye(this.ts.parallelCoordinateChartPointedSeriesLineStyle||ve(this.ts.lineSeriesStrokeStyle,0)).setMouseInteractions(!1),this.YR=new rl((()=>this.gp.Wr(this.nR))),this.HR=new sl((()=>this.gp.Qg(this.nR).setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Ye(i.lineStyle),e.map((({positions:e})=>t.Zr().Kg(e[0],e[1]))))));const l=e.sm(),u=Vt(o?o.cursorBuilder:void 0,La);this.hm=pa(this,l,u._y(l,this.uiScale,this.uiScale,Ot,this.ts),this,"show-nearest",ug,(()=>0)),this.onResize(this.kn)}setCursor(t){return this.hm.setCursor(t),this}getCursor(){return this.hm.getCursor()}setCursorMode(t){return this.hm.setCursorMode(t),this}getCursorMode(){return this.hm.getCursorMode()}setCustomCursor(t){return this.hm.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.hm.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.hm.offCursorTargetChanged(t)}setCursorFormatting(t){return this.hm.setCursorFormatting(t),this}getCursorFormatting(){return this.hm.getCursorFormatting()}addCursor(t=La){const e=this.xp(),i=t._y(e,this.uiScale,this.uiScale,this.pp(e),this.ts);return this.Fp(i),i}onSelectedSeriesChanged(t){return this.R.on("selectedSeriesChanged",t)}offSelectedSeriesChanged(t){return this.R.off(t)}setMouseInteractionRangeSelectors(t){return this.BR=t,this.forEachAxis((t=>t.setMouseInteractionRangeSelectors(this.BR))),this}getMouseInteractionRangeSelectors(){return this.BR}setMouseInteractions(t){return this.setMouseInteractionRangeSelectors(t),this}setUnselectedSeriesColor(t){return this.PR="function"==typeof t?t(this.PR):t,this.GR=new us({thickness:this.getSeriesStrokeThickness(),fillStyle:new N({color:this.PR})}),this.cs.Ms(),this}getUnselectedSeriesColor(){return this.PR}setPointedSeriesStrokeStyle(t){return this.WR.Ye(t),this.cs.Ms(),this}getPointedSeriesStrokeStyle(){return this.WR.xu()}setSpline(t,e){return t?this.DR._({resolution:void 0!==(null==e?void 0:e.resolution)?e.resolution:32}):this.DR._(void 0),this.cs.Ms(),this}setAxes(t){const e=Array.isArray(t)?t.map(((t,e)=>({key:t,id:e}))):"object"==typeof t?Object.entries(t).map(((t,e)=>({key:t[0],id:t[1]}))):void 0;if(!e)return this;const i=e.filter((t=>void 0===this.axes.find((e=>e.key===t.key)))),s=this.axes.filter((t=>void 0===e.find((e=>t.key===e.key))));return i.forEach((t=>{const e=this.$R(),i=new hg(this,this.ts,!this.ph,t.key,t.id,e,this.gp);i.setMouseInteractionRangeSelectors(this.BR);const s=i.onVisibleStateChanged((t=>{this.RR=!0}));i.onDispose((()=>{i.offVisibleStateChanged(s)})),this.axes.push(i)})),s.forEach((t=>{t.Y();const e=this.axes.indexOf(t);e>=0&&this.axes.splice(e,1)})),this.axes=e.map((t=>this.axes.find((e=>e.key===t.key)))),this.RR=!0,this.KL=void 0,this.cs.Ms(),this}getAxis(t){const e=this.XR(t);if(!e)throw new Error(`ParallelAxisChart.getAxis | no such axis: "${t}". Found: ${this.axes.map((t=>void 0!==t.userID?`${t.key}, ${t.userID}`:t.key)).join(", ")}`);return e}hasAxis(t){return void 0!==this.XR(t)}addSeries(t){const e=new ag(this,this.Wv,this.ts,this.cs.hs,t);return super.jv(e),this.zR=!0,this.KL=void 0,this.cs.Ms(),e}setSeriesStrokeThickness(t){return this.NR=this.NR.setThickness(t),this.GR=this.GR.setThickness(t),this.UR.Ye(this.NR),this.cs.Ms(),this}getSeriesStrokeThickness(){return this.NR.getThickness()}setLUT(t){return this.Kd=t,this.Kd&&0===this.Kd.lut.units.length&&(this.Kd.lut=this.Kd.lut.setUnits(this.Kd.axis.getTitle())),this.OR=!0,this.cs.Ms(),this}ze(t){super.ze(t);const e=this.axes.filter((t=>t.getVisible()));this.nR.Vi(0,e.length-1),this.$v.it({x:e.length-1,y:1}),this.Xv.it({x:e.length-1,y:1});const i=void 0===this.KL;if(!this.KL){const t={};e.forEach((e=>{t[e.key]={min:Ye,max:He}})),this.Gv.forEach((e=>{e._R&&Object.entries(e._R).forEach((([e,i])=>{const s=t[e];s&&!Number.isNaN(i)&&(s.min=Math.min(s.min,i),s.max=Math.max(s.max,i))}))})),this.KL=t}if(this.VR||this.ER||this.zR){const t=e.map(((t,e)=>t.qL));this.Gv.forEach((i=>{const s=i._R;if(!s)return;let r=!1;for(let i=0;iti(s[n.key],t.min,t.max)));if(o.length>0&&!h){r=!0;break}}i.xR=r}));const i=this.Gv.filter((t=>!t.xR));this.R.emit("selectedSeriesChanged",this,i)}for(const t of this.Gv)t.Cv();for(const t of this.Gv)t.ze();super.Pp();const s=!this.$v.getIsUnderMouse()&&void 0===this.Gv.find((t=>t.getIsUnderMouse()))||this.cs.jR()?void 0:this.ZR();if(this.hm.ze(!1,this.Gv,void 0,{explicitTarget:s,afterCursorPointedAt:t=>{const e=this.cs.Zn();if(t.length>1&&e){const t=this.cs.Uo(e);this.hm.Hp.xy({x:t.engineX,y:t.engineY},this.cs.At)}}}),ga.Gp(this.Ch,this.Lp),e.length>=2){const t=this.YR.Dm(),s=this.HR.Dm(),r=e.map((t=>(t.Rr(),t.Os())));r.forEach(((i,r)=>e[r].ze(i,t,s,r))),t.finishPlot(),s.finishPlot();const n=ga.Np(this.Ch,this.Lp);this.nR.Ei([this.Xt.left+this.Ia.left+r[0].Qd,this.Xt.right+this.Ia.right+r[r.length-1].SR/2]),this.nR.zi([this.Xt.bottom+this.Ia.bottom+r.reduce(((t,e)=>Math.max(t,e.vR)),0),this.Xt.top+this.Ia.top+n]),t.finishPlot(),s.finishPlot(),(i||this.mR)&&e.forEach(((t,e)=>{if(!t.yR)return;const i=t.yR.steps.map((i=>({...i,value:this.uR(i.value,e,t).y}))),s=t.yR.setSteps(i);t.$D.Ye((t=>t.setFillStyle(new W({lookUpProperty:"y",lut:s}))))}));const o=this.RR||this.ER||this.TR||this.DR.u;o&&(this.UR.Ot(),this.FR.Ot(),this.IR.clear(),this.Gv.forEach((t=>{const i=t._R;if(!t.getVisible()||!i)return;const s=this.QR(t,i,e,this.UR,this.FR);this.IR.set(t,s),t.ys(s)}))),(o||this.VR||this.OR||this.ER)&&this.JR(this.Gv),!o&&this.zR&&this.Gv.forEach((t=>{if(t.Qi.length>0)return;const i=t._R;if(!t.getVisible()||!i)return;const s=this.QR(t,i,e,this.UR,this.FR);this.IR.set(t,s),t.ys(s),this.JR([t])})),this.Gv.find((t=>t._R&&Object.keys(t._R).length>0))&&(this.LR=!0)}const r=1===(null==s?void 0:s.length)?s[0]:void 0;(r!==this.KR||this.ER)&&(this.WR.Ot(),r&&r.series._R?(this.QR(r.series,r.series._R,e,this.WR,void 0),this.UR.Ye(this.GR)):this.UR.Ye(this.NR));for(const t of this.Gv)t.Pm();this.TR=!1,this.VR=!1,this.RR=!1,this.ER=!1,this.zR=!1,this.OR=!1,this.DR.u=!1,this.mR=!1,this.KR=r}JR(t){const e=this.Kd&&{lut:this.Kd.lut,key:this.Kd.axis.key};t.forEach((t=>{const i=t._R,s=this.IR.get(t);if(!i||!s)return;let r;if(t.xR)r=this.PR;else if(e){const t=i[e.key];r=e.lut.getColors(t)}else r=t.bR;s.forEach((t=>t.iL(r)))}))}MR(){this.ER=!0,this.cs.Ms()}CR(){this.LR&&this.cs.Jn(Sh.Df),this.ER=!0,this.cs.Ms()}XR(t){return this.axes.find((e=>e.key===t))||this.axes.find((e=>e.userID===t))}$R(){return gt.d1({scale1DConstructor:Gi,dimension:"x"}).q(0,1)}wR(t){if(this.KL=void 0,this.cs.Ms(),Array.isArray(t)){const e={};return t.forEach(((t,i)=>{var s;if("number"==typeof t){const r=null===(s=this.axes[i])||void 0===s?void 0:s.key;if(!r)throw new Error("ParallelCoordinateSeries Axis count doesnt match supplied data");e[r]=t}else"object"==typeof t&&(e[t.key]=t.value)})),e}if("object"==typeof t)return t;throw new Error("ParallelCoordinateSeries unidentified data format")}pR(t,e,i){this.TR=!0,this.cs.Ms()}uR(t,e,i){return{x:e,y:(t-i.At.X)/(i.At.j-i.At.X)}}cR(t,e,i){const s=i.getInterval();return s.start+t*(s.end-s.start)}kR(t){this.OR=!0,this.cs.Ms()}dR(){this.VR=!0,this.cs.Ms()}getSeries(){return this.Gv}af(){const t=[],e=this.Kd;return e&&t.push({qd:()=>({lut:e.lut,lookUpProperty:void 0}),attach:(t,i)=>{t.setText("Value based color").setOn(!0),t.onSwitch(((t,i)=>{this.setLUT(i?e:void 0)}))}}),t}getMinimumSize(){return{x:200,y:200}}forEachAxis(t){return this.axes.slice().forEach((e=>t(e))),this}addLegendBox(t,e){const i=super.addLegendBox(t,e);return void 0!==e&&e!==this.uiScale||void 0!==t&&"vertical"!==t.getAlignment()||i.setOrigin(Vs.RightCenter).setPosition({x:this.uiScale.x.dt(this.uiScale.x.hi()-this.Ia.right),y:mt(this._g.y.dt(this._g.y.ei()+this._g.y.ri()/2),this._g.y,this.uiScale.y)}),i}QR(t,e,i,s,r){const n=[];let o;for(let h=0;ht.getVisible()))[r],o=n.key,h=Ee(this.Gv.map((t=>{if(!t._R||!t.Yp())return;const e=t._R[o],i=this.uR(e,r,n);return{cursorPosition:{pointMarker:i,pointMarkerScale:this.nR,resultTable:i,resultTableScale:this.nR},value:e,series:t,axis:n}})));return"show-nearest"===t?[h.sort(((t,e)=>Math.abs(t.cursorPosition.pointMarker.y-s.y)-Math.abs(e.cursorPosition.pointMarker.y-s.y)))[0]]:("show-nearest-interpolated"!==t&&"show-all-interpolated"!==t||zt.console.warn('LightningChart JS ParallelCoordinateChart does not support "interpolated" cursor modes.'),h)}}}const ug=(t,e,i)=>{if(i.length>1)return[[i[0].axis.getTitle()],...Ee(i.map((t=>{const e=t.series.getData(),i=e?e[t.axis.key]:void 0;if(void 0!==i)return ya(t,[[t.series,"",Ki(t.axis.formatValue(i),t.axis)]])})).flat())];const s=i[0],r=[[s.series]];return t.axes.forEach((e=>{const i=s.series.getData();if(!i)return;const n=i[e.key];if(void 0===n)return;const o=t.axes.filter((t=>t.getVisible()))[s.cursorPosition.pointMarker.x]===e?{weight:"bold"}:{};r.push([{text:e.getTitle(),font:o},"",{text:e.formatValue(n),font:o}])})),r},cg=(t,e)=>e?t.x:t.y,dg=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),fg=(t,e,i,s,r,n)=>{const o=e.length,h=Math.sign(s),a=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)a.push(cg(r,n)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=a.map((t=>0));let c=a[i-1]+s;for(let e=i;e>0&&edg(t,h,n,e))).reduce(((t,e)=>Math.max(t,cg(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>cg(r,n)-s||-1===h&&c<0+s){u.fill(0);break}if(e!==i&&(1===h?o>c:oa[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/cg(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class gg{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.ji=!1,this.cP=new Array,this.R=new r.Eventer,this.qR=[],this.ap=[],this.tE=void 0,this.iE=!0,this.sE=!0,this.eE=!0,this.dp=!1,this.hE=!0,this.rE=()=>{this.hE=!0,this.cs.Ms()},this.nE=[],this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.oE=t=>{for(let e=0;e{const e=this.qR.indexOf(t);e>=0&&this.qR.splice(e,1)},this.yp=t=>{const e=this.ap.indexOf(t);e>=0&&this.ap.splice(e,1)},this.lE=(t,e,i,s,r)=>{if(this.uE(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.cP.push(n),this.cE(n),this.iE=!0,t}throw new bt("Out of dashboard range.")},this.dE=e.numberOfRows,this.fE=e.numberOfColumns,this.CA=t,this.AE=e,this.gE=s;const o=this.fE*this.dE;this.pE={x:new _d(new Array(this.fE).fill(1)),y:new _d(new Array(this.dE).fill(1))},this.ts=i.ts,this.yE=this.ts.dashboardSplitterStyle,this.ph=!1!==(null==e?void 0:e.animationsEnabled),this.mE=Ld(i,o),this.vE=i.KF("dashboard splitters",500001),this.MM=()=>this.mE.JF(),this.Mp=this.mE.qF(),this.hs=i.hs.rs(this,{SE:{}}),this.hs.SE.bs(this.ts.effectsDashboardSplitters);const h=i.oi();this.uiScale=gt.d2({scaleXYConstructor:Yi}).Vi(0,100).Oi(0,100).it(h),this._g=gt.d2({scaleXYConstructor:Yi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(h),this.xE=i.bE.bind(i),this.ME=i._E.bind(i),this.wE=i.CE.bind(i),this.kE=i.TE.bind(i),this.Ao=i.Ao.bind(i),this.yo=i.yo.bind(i),this.engine=i.vp,this.cs=i.Sp,i.Eo((()=>this.rE())),i.Ms();const a=i.Oo((t=>{this.dp=t,this.R.emit("inViewChange",this,t)}));this.Tp=i.No.bind(i,a),this.FE(),this.setAnimationsEnabled(this.ph);const l=(t=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.R);this.createChartXY=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Dc(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Pd(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new jc(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=mg(t,this.AE,this.ph),i=e&&e.type?e.type:Ka;return this.lE(new i(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Uf(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=mg(t,this.AE,this.ph),i=e&&e.type?e.type:nd;return this.lE(new i(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=mg(t,this.AE,this.ph),i=t&&t.type?t.type:Ad;return this.lE(new i(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new ca(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Ll(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Vc(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=mg(t,this.AE,this.ph);return this.lE(new Hl(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=mg(t,this.AE,this.ph),i=new Dl(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=mg(t,this.AE,this.ph),i=new hf(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=mg(t,this.AE,this.ph),i=new Af(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createParallelCoordinateChart=t=>{const e=mg(t,this.AE,this.ph),i=new lg(this.CA,this.mE.tI(this.IE(t.columnIndex,t.rowIndex)),this.PE(e,this.pE),this.oE,n,l,e);return this.lE(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}IE(t,e){return t+e*this.fE}PE(t,e){return{d1:i=>new i.scale1DConstructor("x"===i.dimension?t.columnIndex:t.rowIndex,"x"===i.dimension?t.columnSpan:t.rowSpan,"x"===i.dimension?this.fE:this.dE,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ct({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.fE,y:this.dE},e),d3:()=>new dt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.fE,y:this.dE},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.xE(t[0]),this.ME(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.wE(t[0]),this.kE(t[1]),this}getWidth(){return this.Ao()}getHeight(){return this.yo()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.vE.Ms(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.vE.Ms(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.ts}setSplitterStyle(t){const e=this.yE;return this.yE="function"==typeof t?t(this.yE):t,this.DE(e),this}getSplitterStyle(){return this.yE}setSplitterEffect(t){return this.hs.SE.bs(t),this.cs.Ms(),this}getSplitterEffect(){return this.hs.SE._s()}setAnimationHighlight(t){return this.eE=t,this.nE.forEach((e=>this.cs.us.Ts(e.line,t))),this}getAnimationHighlight(){return this.eE}DE(t){for(const t of this.nE)t.line.Ye(this.yE);this.FE()}setColumnWidth(t,e){const i=this.pE.x.C();return t>=0&&t=e.length)throw new bt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.pE.y.C();return t>=0&&t=e.length)throw new bt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this._g.getInnerIntervalPixels()}onResize(t){return this.R.on("resize",t)}offResize(t){return this.R.off(t,"resize")}BE(t,e,i){if(i&&Math.abs(t.x)>0)this.LE(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.RE(e,t.y)}for(const t of this.cP)t.panel.K();this.rE()}RE(t,e){const i=fg(this.cP,this.pE.y.C(),t,e,this._g.oi(),!1);this.pE.y._(i),this.rE()}LE(t,e){const i=fg(this.cP,this.pE.x.C(),t,e,this._g.oi(),!0);this.pE.x._(i),this.rE()}EE(){this.nE.forEach((t=>t.line.dispose())),this.nE.length=0;for(let t=1;t<=this.fE-1;t+=1)for(let e=0;e<=this.dE-1;e+=1)if(void 0!==this.cP.find((i=>ti(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=ns(new hs((()=>{this.zE(t)}),((e,i,s,r,n)=>{this.BE(r,t,!0),se(n)}),(()=>{this.VE(t)}))),s=this.vE.He(this._g).Ye(this.yE).setMouseEnterEventHandler((()=>{this.zE(t)})).setMouseLeaveEventHandler((()=>{this.VE(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.BE(n,t,!0),se(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.eE}),this.nE.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.dE-1;t+=1)for(let e=0;e<=this.fE-1;e+=1)if(void 0!==this.cP.find((i=>ti(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=ns(new hs((()=>{this.OE(t)}),((e,i,s,r,n)=>{this.BE(r,t,!1),se(n)}),(()=>{this.NE(t)}))),s=this.vE.He(this._g).Ye(this.yE).setMouseEnterEventHandler((()=>{this.OE(t)})).setMouseLeaveEventHandler((()=>{this.NE(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.BE(n,t,!1),se(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.eE}),this.nE.push({row:t,column:e,line:s,alignment:"horizontal"})}this.hs.SE.gs(this.nE.map((t=>t.line)))}GE(){const t=this._g.oi(),e=this.pE.x.C(),i=e.reduce(((t,e)=>t+e)),s=this.pE.y.C(),r=s.reduce(((t,e)=>t+e));this.nE.forEach((n=>{if("vertical"===n.alignment){const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(o.x,t.y*s.slice(0,n.row+1).reduce(((t,e)=>t+e),0)/r);n.line.Xe(o).$e(h)}else{const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(t.x*e.slice(0,n.column+1).reduce(((t,e)=>t+e),0)/i,o.y);n.line.Xe(o).$e(h)}}))}zE(t){this.nE.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.cs.us.ks(e.line,1),this.vE.UE(e.line))})),this.tE=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.cs.Ms()}OE(t){this.nE.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.cs.us.ks(e.line,1),this.vE.UE(e.line))})),this.tE=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.cs.Ms()}VE(t){this.nE.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.cs.us.ks(e.line,0)})),this.engine.restoreMouseStyle(this.tE),this.cs.Ms()}NE(t){this.nE.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.cs.us.ks(e.line,0)})),this.engine.restoreMouseStyle(this.tE),this.cs.Ms()}setAnimationsEnabled(t){return this.ph=t,this.getCells().filter((t=>t.panel instanceof fa)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ph),this}getAnimationsEnabled(){return this.ph}getCells(){return this.cP.slice()}dispose(){return this.ji||(this.Tp&&this.Tp(),this.cP.slice().forEach((t=>t.panel.dispose())),this.qR.slice().forEach((t=>t.dispose())),this.ap.slice().forEach((t=>t.dispose())),this.ji=!0,this.gE(),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}getIsInView(){return this.dp}saveToFile(t,e,i){return na(this.engine,t,e,i),this}WE(t){if(this.hE){const t=this.cs.At.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this._g.it(e,i);const s=this.uiScale.getInnerIntervalPixels();this._g.Vi(0,s.x).Oi(0,s.y),this.R.emit("resize",this,s.x,s.y,e,i),this.sE=!0}this.iE&&(this.EE(),this.iE=!1,this.sE=!0),this.sE&&(this.GE(),this.sE=!1);for(const e of this.cP)e.panel.ze(t);return this.qR.forEach((t=>t.Os())),this.qR.forEach((t=>t.ze())),this.ap.forEach((t=>t.Os())),this.ap.forEach((t=>t.ze())),this.hE=!1,this}J(){for(const t of this.cP)t.panel.J();return this._g.x.J(),this._g.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}K(){for(const t of this.cP)t.panel.K();return this._g.x.K(),this._g.y.K(),this.uiScale.x.K(),this.uiScale.y.K(),this}translateCoordinate(t,e,i){return aa(t,e,i,this._g,this.cs)}addUIElement(t=Jo,e=this.uiScale){e=ha(e,this._g);const i=oa(t,this.MM(),this.uiScale,e,this.aE,this.ts);return this.qR.push(i),i}addLegendBox(t=uh,i=this.uiScale){i=ha(i,this._g);const s=oa(t,this.Mp,this.uiScale,i,this.yp,this.ts);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.ap.push(s),s}getLegendBoxes(){return this.ap}uE(t,e,i,s){return e>=0&&t>=0&&e+s<=this.dE&&t+i<=this.fE}cE(t){const e=this.yE,i=e===ut?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Gr(s)}FE(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this._g.x.si([0,0]),this._g.y.si([0,0]);for(const t of this.cP)this.cE(t);this.cs.Ms()}}const mg=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,animationsEnabled:void 0!==t.animationsEnabled?t.animationsEnabled:i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},yg=(t,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAsa2NhQlgAACxranVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAALEVqdW1iAAAAR2p1bWRjMm1hABEAEIAAAKoAOJtxA3Vybjp1dWlkOjlmZDBkZjkzLTVmMDMtNDczYi1hZThhLTFhNDM4NmMzNmJhYQAAAAGzanVtYgAAAClqdW1kYzJhcwARABCAAACqADibcQNjMnBhLmFzc2VydGlvbnMAAAAA12p1bWIAAAAmanVtZGNib3IAEQAQgAAAqgA4m3EDYzJwYS5hY3Rpb25zAAAAAKljYm9yoWdhY3Rpb25zgaNmYWN0aW9ua2MycGEuZWRpdGVkbXNvZnR3YXJlQWdlbnRtQWRvYmUgRmlyZWZseXFkaWdpdGFsU291cmNlVHlwZXhTaHR0cDovL2N2LmlwdGMub3JnL25ld3Njb2Rlcy9kaWdpdGFsc291cmNldHlwZS9jb21wb3NpdGVXaXRoVHJhaW5lZEFsZ29yaXRobWljTWVkaWEAAACranVtYgAAAChqdW1kY2JvcgARABCAAACqADibcQNjMnBhLmhhc2guZGF0YQAAAAB7Y2JvcqVqZXhjbHVzaW9uc4GiZXN0YXJ0GCFmbGVuZ3RoGSx3ZG5hbWVuanVtYmYgbWFuaWZlc3RjYWxnZnNoYTI1NmRoYXNoWCBvErgv+J0u7bVCYViyMUgw5yMb8idAv1erA3/DALx9NWNwYWRIAAAAAAAAAAAAAAIDanVtYgAAACRqdW1kYzJjbAARABCAAACqADibcQNjMnBhLmNsYWltAAAAAddjYm9yqGhkYzp0aXRsZW9HZW5lcmF0ZWQgaW1hZ2VpZGM6Zm9ybWF0aWltYWdlL3BuZ2ppbnN0YW5jZUlEeCh4bXAuaWlkOjI3NEMxQjdDN0E0MDExRUVBQkZFQUNFQjJDOTA0NzVCb2NsYWltX2dlbmVyYXRvcng2QWRvYmVfUGhvdG9zaG9wLzI1LjIuMCBhZG9iZV9jMnBhLzAuNy42IGMycGEtcnMvMC4yNS4ydGNsYWltX2dlbmVyYXRvcl9pbmZvgb9kbmFtZW9BZG9iZSBQaG90b3Nob3BndmVyc2lvbmYyNS4yLjD/aXNpZ25hdHVyZXgZc2VsZiNqdW1iZj1jMnBhLnNpZ25hdHVyZWphc3NlcnRpb25zgqJjdXJseCdzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnNkaGFzaFggSmnBvf+o3kEweL4k7cz4MTrB0WSVNFZxoA1rBrM31K+iY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggL2g6Dghd536quyA5vPlS/9NGA5WvLRkkKJmqn0VxCoFjYWxnZnNoYTI1NgAAKEBqdW1iAAAAKGp1bWRjMmNzABEAEIAAAKoAOJtxA2MycGEuc2lnbmF0dXJlAAAAKBBjYm9y0oREoQE4JKNmc2lnVHN0oWl0c3RUb2tlbnOBoWN2YWxZDjYwgg4yMAMCAQAwgg4pBgkqhkiG9w0BBwKggg4aMIIOFgIBAzEPMA0GCWCGSAFlAwQCAQUAMIGCBgsqhkiG9w0BCRABBKBzBHEwbwIBAQYJYIZIAYb9bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHj4VpJDPzaO0x4hOPnj/w1GTHuwXU0IpBf4VVocIQzoAhB3SsxvHza2JR1fKj3Mjr0yGA8yMDIzMTEwMzExNTcyNloCCQCyOL6wAOGCbaCCC70wggUHMIIC76ADAgECAhAFHp6R1x6RCrvkPVzt0N3ZMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE7MDkGA1UEAxMyRGlnaUNlcnQgVHJ1c3RlZCBHNCBSU0E0MDk2IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMjMwOTA4MDAwMDAwWhcNMzQxMjA3MjM1OTU5WjBYMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xMDAuBgNVBAMTJ0RpZ2lDZXJ0IEFkb2JlIEFBVEwgVGltZXN0YW1wIFJlc3BvbmRlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE0srlH5A/+15/MFl1asNh8Q8TubOsEVfu0qlJrF0smjtwL1IeHZ/AB7J59u1Trpho1BDN85lfTY30rNBsfT+myjggGLMIIBhzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAgBgNVHSAEGTAXMAgGBmeBDAEEAjALBglghkgBhv1sBwEwHwYDVR0jBBgwFoAUuhbZbU2FL3MpdpovdYxqII+eyG8wHQYDVR0OBBYEFLA1qlbDIamLztO4vIsWJVed7zThMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcmwwgZAGCCsGAQUFBwEBBIGDMIGAMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wWAYIKwYBBQUHMAKGTGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcnQwDQYJKoZIhvcNAQELBQADggIBAHgrjELHhBCEWJSCyRX7lsL0C9LJgbX1ryVYySNRxHkMR2LqC7PQZRJgDNR+kJop8P5v2Bzp/jMrzw4U4pY6rYv3I8HpFlJa4uBwUTIUgHWpi8Xxd1JEEX94POODi7HySekX60A055BozFb7GGVaxb0LreQTRXnkr6ggPNUPX9Gh+2ScOxlTdQQLgZbkdYvxo3Ap6cy9riZijRxOZqiOyWSxMUhgKxeKzwrFW6Xbe0awNhOUXZzIxc4ixpKzWSItpPJ30ZiBQn49U3ADYTnshbN9ZkTA1pHf/Nov2ZUvvddkZ8UYvwo9vBvLTDvnmABnRMBKaXYAs3ZCvw9CkDPOWTeUJMFRAtmUx52ohaA3nD8bCJ6UfpQ2pFfOdShwpb6GKv0g+BgcdIG2LHPJ0Ufmr+XmpgZgq/HIge0hjcCADpjDgq2z4B0L4xtAA1M8MrUx02hxb7104nFKqMuv5zJTQl3sgwqXUyP+9zHQP9y/Z5Fx/AQWrOXCW56dV7P4cFBJl8zHqinlhkOStZ1m22+9Hlq+eC0hJ2lkF1LuzRdJJb/51LXoPKRnopFDng6XpoD7eG6w4YpAx9+P00JuUoBsYSrdsuFiyWyQQGBAnjI69ggbSLcW+hJytuinaxawVlItJkS2eV5Z4XsxPg7f82uRkdtN0hTHeI93CN3OWeRebnK7MIIGrjCCBJagAwIBAgIQBzY3tyRUfNhHrP0oZipeWzANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMjIwMzIzMDAwMDAwWhcNMzcwMzIyMjM1OTU5WjBjMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRpZ2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxoY1BkmzwT1ySVFVxyUDxPKRN6mXUaHW0oPRnkyibaCwzIP5WvYRoUQVQl+kiPNo+n3znIkLf50fng8zH1ATCyZzlm34V6gCff1DtITaEfFzsbPuK4CEiiIY3+vaPcQXf6sZKz5C3GeO6lE98NZW1OcoLevTsbV15x8GZY2UKdPZ7Gnf2ZCHRgB720RBidx8ald68Dd5n12sy+iEZLRS8nZH92GDGd1ftFQLIWhuNyG7QKxfst5Kfc71ORJn7w6lY2zkpsUdzTYNXNXmG6jBZHRAp8ByxbpOH7G1WE15/tePc5OsLDnipUjW8LAxE6lXKZYnLvWHpo9OdhVVJnCYJn+gGkcgQ+NDY4B7dW4nJZCYOjgRs/b2nuY7W+yB3iIU2YIqx5K/oN7jPqJz+ucfWmyU8lKVEStYdEAoq3NDzt9KoRxrOMUp88qqlnNCaJ+2RrOdOqPVA+C/8KI8ykLcGEh/FDTP0kyr75s9/g64ZCr6dSgkQe1CvwWcZklSUPRR8zZJTYsg0ixXNXkrqPNFYLwjjVj33GHek/45wPmyMKVM1+mYSlg+0wOI/rOP015LdhJRk8mMDDtbiiKowSYI+RQQEgN9XyO7ZONj4KbhPvbCdLI/Hgl27KtdRnXiYKNYCQEoAA6EVO7O6V3IXjASvUaetdN2udIOa5kM0jO0zbECAwEAAaOCAV0wggFZMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLoW2W1NhS9zKXaaL3WMaiCPnshvMB8GA1UdIwQYMBaAFOzX44LScV1kTN8uZz/nupiuHA9PMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAKBggrBgEFBQcDCDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcnQwQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcmwwIAYDVR0gBBkwFzAIBgZngQwBBAIwCwYJYIZIAYb9bAcBMA0GCSqGSIb3DQEBCwUAA4ICAQB9WY7Ak7ZvmKlEIgF+ZtbYIULhsBguEE0TzzBTzr8Y+8dQXeJLKftwig2qKWn8acHPHQfpPmDI2AvlXFvXbYf6hCAlNDFnzbYSlm/EUExiHQwIgqgWvalWzxVzjQEiJc6VaT9Hd/tydBTX/6tPiix6q4XNQ1/tYLaqT5Fmniye4Iqs5f2MvGQmh2ySvZ180HAKfO+ovHVPulr3qRCyXen/KFSJ8NWKcXZl2szwcqMj+sAngkSumScbqyQeJsG33irr9p6xeZmBo1aGqwpFyd/EjaDnmPv7pp1yr8THwcFqcdnGE4AJxLafzYeHJLtPo0m5d2aR8XKc6UsCUqc3fpNTrDsdCEkPlM05et3/JWOZJyw9P2un8WbDQc1PtkCbISFA0LcTJM3cHXg65J6t5TRxktcma+Q4c6umAU+9Pzt4rUyt+8SVe+0KXzM5h0F4ejjpnOHdI/0dKNPH+ejxmF/7K9h+8kaddSweJywm228Vex4Ziza4k9Tm8heZWcpw8De/mADfIBZPJ/tgZxahZrrdVcA6KYawmKAr7ZVBtzrVFZgxtGIJDwq9gdkT/r+k0fNX2bwE+oLeMt8EifAAzV3C+dAjfwAL5HYCJtnwZXZCpimHCUcr5n8apIUP/JiW9lVUKx+A+sDyDivl1vupL0QVSucTDh3bNzgaoSv27dZ8/DGCAbgwggG0AgEBMHcwYzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMTswOQYDVQQDEzJEaWdpQ2VydCBUcnVzdGVkIEc0IFJTQTQwOTYgU0hBMjU2IFRpbWVTdGFtcGluZyBDQQIQBR6ekdcekQq75D1c7dDd2TANBglghkgBZQMEAgEFAKCB0TAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTIzMTEwMzExNTcyNlowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQU2Rq5M/4XremCHqYT9aQ6cU4+fn0wLwYJKoZIhvcNAQkEMSIEIGmY+GsCefCDmP0PFcYjdxBUfi0EgKYuEZb9pUMyLNuVMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEIILa8ZSVezaEAkWP1ScAaf5ixxRW+p4Lhqv4J+hTICfZMAoGCCqGSM49BAMCBEcwRQIgcxxuf7QHV9Fkpj1VhPrFqhNFh8dZzl8qUU/2N3Sr4eoCIQDKu0KGYL++CSsDAXjJciMDbr5ImTy3jw0yQU5GYYeLimd4NWNoYWluglkGMzCCBi8wggQXoAMCAQICEBtbCzvasORd8vMNnlTR2tIwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEiMCAGA1UEAxMZQWRvYmUgUHJvZHVjdCBTZXJ2aWNlcyBHMzAeFw0yMzAyMDEwMDAwMDBaFw0yNDAyMDEyMzU5NTlaMIGhMREwDwYDVQQDDAhjYWktcHJvZDEcMBoGA1UECwwTQ29udGVudCBDcmVkZW50aWFsczETMBEGA1UECgwKQWRvYmUgSW5jLjERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAgMCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMSQwIgYJKoZIhvcNAQkBFhVncnAtY2FpLW9wc0BhZG9iZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv0wCnfYY9lkHDsykrTG7FYlnYHBcyualuD5u9ULjzv+FsTWOLg8Nhrz9RTxI9EeBbu3Wm7f4vqPsQYfxkEp0wIa6DVmEOZhbAeRfbhybWQ/D4Wvvck4mEZR+QZmTpIn7HX61gbtMFHlJUxkYBctIoAt9TBAFbz9d5Ig2WG0bsH39b6/8USXnIIk4FB6dtBRT1xeEwSDtwOd1YBpXXNBJmRWHXNJZZ85of2tBTesg/kMvTrOJJxYDZ97U416wcvbVomlees+NXUY3/ZB4xH+NsZils7m1bL2v2hSnHiLoqZeUKklbHUmT4ZpjrZCdtuIsWm5j2PPXKr7HKUuCbZSXBAgMBAAWjggGMMIIBiDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAeBgNVHSUEFzAVBgkqhkiG9y8BAQwGCCsGAQUFBwMEMIGOBgNVHSAEgYYwgYMwgYAGCSqGSIb3LwECAzBzMHEGCCsGAQUFBwICMGUMY1lvdSBhcmUgbm90IHBlcm1pdHRlZCB0byB1c2UgdGhpcyBMaWNlbnNlIENlcnRpZmljYXRlIGV4Y2VwdCBhcyBwZXJtaXR0ZWQgYnkgdGhlIGxpY2Vuc2UgYWdyZWVtZW50LjBdBgNVHR8EVjBUMFKgUKBOhkxodHRwOi8vcGtpLWNybC5zeW1hdXRoLmNvbS9jYV83YTVjM2EwYzczMTE3NDA2YWRkMTkzMTJiYzFiYzIzZi9MYXRlc3RDUkwuY3JsMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMB8GA1UdIwQYMBaAFFcpejJNzP7kNU7AHyRzznNTq99qMA0GCSqGSIb3DQEBCwUAA4ICAQBXjlGa3yAK/Gijn6n/JNU9FZm72MP6vc5czrWe9y0T+EawuRvhpD5Edi1TnXkrpe8sMkgSjTGdbY+yGhq8zlCWQeXN1/aWo3L9Xr1uNxY/oVpLn0uWWfnfJ7yR9gKl/yoMfhjydT4t1fXHi/MhfhrWSVRHqX2U31UFGz/e298P2kv+vqhzpIUo1bj+jibtoPLMMQcCOTtKiJOTh4o3VSZpwQDERCzo91NkF+LnZjwYl6fE5USIkg/oCoomXxSPpowybDrcRJ9ilbtJcER48/LGgwzv/c7OYdron4PnEXm1FkOaVj+QRf7OwiNTizonhIzLR5Vfp0QHOWv/bPzvCjPQd+Xr0Q4032WlSxQwostNTAPtoVAU4OCwVH3Ech38emJ00/6fkDCdr7MN8/4n2LSNrMUvaBEZdmLqDCBnO02dbFrmpg3pTc0FqRQ4GL/88pjRNSMy5tU9SoQnSCGYqIsjfL8AzgPEGiXXRgABYc1uXecf4/eayb3K2MPs7hnWTbUKpHHJIwxpdN3vTGdZNWpz9Oxfuo3eELQlkTvACHgqkaXi/FAanHe5PChn6fr1/4cNF8goD0buPApgS3zzwqjRhxrH8ISwPfJn8JqzurMaLDMnnc18tHzUiMtX73jf6oXh7voCxX/T4D3nFPlxU3om2cpcLQ1Wd4026x18rlSGR1kGpTCCBqEwggSJoAMCAQICEAyotlR7iebSBol1zYubieIwDQYJKoZIhvcNAQELBQAwbDELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEZMBcGA1UEAxMQQWRvYmUgUm9vdCBDQSBHMjAeFw0xNjExMjkwMDAwMDBaFw00MTExMjgyMzU5NTlaMHUxCzAJBgNVBAYTAlVTMSMwIQYDVQQKExpBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZDEdMBsGA1UECxMUQWRvYmUgVHJ1c3QgU2VydmljZXMxIjAgBgNVBAMTGUFkb2JlIFByb2R1Y3QgU2VydmljZXMgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3Hy69vQmzXEhs/gyDrmwB6lF4JaSAPomnsbKIZNr2iXaB+fkd85X8eJiNmI7P5O4cVT4Nc1p3zrESqBV4ZUyW8gcZ78QdwoHG8QNd2VNcHnMgSR+XT9Iafsnq9Nfww3Jt9KL3l5ANQ5n1+MJqr48EWNLll942bOL/JH4ywDSMoqhZqtJEIUUUGlQVBZ8CAvJc7LE6ddA5C52PE2Ppa7RfQgHXf4gfXVZwpxYRZcziPiOHqEvLb0J3cShUbejFxV6cwX8QyAPa1ePHg1RtM0HX+D34xHo3DkyGnmT+Ddq00TEDGG26AL5PdINKFIQl+zaq6KJFQe1fdGE5wrWzU4mBPmzaz3EbLn+7FWlwAhorYqIMldbfHE3ydc+aTU1JW7+bG19qmvhO9IluGtTtQDeqFBj2fg6faxsfVfVPD7stN6TwoIDlkOCE4RE+Iin8m3z3eqi/VsTmsmRqBxWDRaqOHz02EJoEDxXJG3ei+UbIIp01XZQvdufm90WxOTuqqan2ZqTPX9K5VdjEh/ovr7xFc5q1dZo+Sa5y4sTVM854/tLU3klOgUKzzSXYPYS3GhBcYJHjwr9xNRHnNX99D6F0g7OijScWfvtjxh13aTv/H0ETvymah4yfDpVdh9cK5YSCPqnuOlsujFAyhYwJXOWDvZZU2EkWVLDhoPx9zp7N4QIDAQABo4IBNDCCATAwEgYDVR0TAQH/BAgwBgEB/wIBADA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vY3JsLmFkb2JlLmNvbS9hZG9iZXJvb3RnMi5jcmwwDgYDVR0PAQH/BAQDAgEGMBQGA1UdJQQNMAsGCSqGSIb3LwEBBzBXBgNVHSAEUDBOMEwGCSqGSIb3LwECAzA/MD0GCCsGAQUFBwIBFjFodHRwczovL3d3dy5hZG9iZS5jb20vbWlzYy9wa2kvcHJvZF9zdmNlX2Nwcy5odG1sMCQGA1UdEQQdMBukGTAXMRUwEwYDVQQDEwxTWU1DLTQwOTYtMzMwHQYDVR0OBBYEFFcpejJNzP7kNU7AHyRzznNTq99qMB8GA1UdIwQYMBaAFKYc4W1UJEyoj0hyv26pjNXk7DHUMA0GCSqGSIb3DQEBCwUAA4ICAQBxzuUHjKbcLdzI4DtlXgCSgZXrlSAkr59pOF3JfPG42qVNAGU7JcEYXJ6+WbfcGwY7WYMl+jO7IvJPb7shXFYW9bnJgxX7lLU14KExchmcLNY1ee6IhBJ2Y8PzZMRUKSd5CkURPg0PBLGjz/KR/DofHx+G4rPTCOGORYxeYrd01lci5hVxvKccvIk7MD69ZTewfZPSM+0WnsU3f0Zmd7hgbRpUyWceG0eHFpdUKK/ZFWhHjDVC28odCnN885tHncKXviItK0ZUUo/AIthFKlhEXsnq9VL9fFbgvO83ZvpUQo5y8mY3cuGnEVGXdhjNb53CfC1u4dbpYmWaN99subUzEsUaUb3loLPfVfzDOpg2y9v37kBdy/wuXr20teY7U62xj/fAgs1QSnhUtlMTfCqbefyEycKVmKIrJkJLsvgTSYKVvH4FFIwfd5WjqOC97jX98rcVAzhAI0iSkazsWOMvL6m0L4nLJapx+85GsVX8Y6AHmEP4bmCElwil6KAP+UewJFiw5rmwV2pESHAhYuZJa03B8tl0nd2QJzvJGmbeBqXqpF9ORinFM3HErK8puRokOjFH2+1asLeI2tB31W/ELdNe27Ogduq6Z6qBwCp59YX27qydDhD0WRfN64kCs25K88iGAGNW2CAfTDS+b+WYJBiIL9jXYZ4LF+BiUvfdu2NwYWRZC70AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZZAQBKX2Q2ihN2fLDLReHISpfOF0xIqNpOZXbBwZ0XanWG98erbIBdawl7r9nVma/uZjYH457wp00TVpKYUTJHMnzJMKskvM2Df4K6t5pUKGtJqEvMXLUy3g9kJq53aYDwikcUE+8wv+CYtu/+vii4XYSXQIxT4NN+JKoTDXmrNH1G46Nmpfq6SKk0g9GQ2brbkW3fzGR0xDxY3BXRy71guSBxN9TAbQGqUjMnkIyBcwV9wUQ2oCW9oIMNKASjW0CRkcFEzzmrQ+y+zHYpNvUaG7QehHcyhvOec3plzlyP6DZeQWp3PHA5bmonI8t5j6Qj15X1KnQiXuJ0rW+xoMA89aIVmpx4VgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOSaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjYyYTdmYWExLWJmZTMtMjE0Ny04MjAwLWMxM2NlMGU4ZTc1NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzRDMUI3RDdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzRDMUI3QzdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMiAoMjAyMzEwMjQubS4yMzc0IDRhYjk0MzkpICAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphYjQzZjNjYy1hNTY4LTRkNGQtOTdiZC1iYjk0YjBlZjhjYmQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjJhN2ZhYTEtYmZlMy0yMTQ3LTgyMDAtYzEzY2UwZThlNzU0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HNvo5wAADZFJREFUeNrsXFtPVUkW3gc4yP0qDigKON517FFbHRGn1TamjaOJvvhsjIkvPplgfEKe1AefNDE+GP+AmWTszPTYcbpn2piJzc1GWwlOekRBEBFQ7jeZ9ZVrnVkUtfc5CGp3h5VU9qUuu3bVV9+67DonND4+7omEQiHPJaWlpYlxcXGLKX8epTCdB5aXNnHU6c2bN5POcaREp+O9dHxSX1/f5s3KL1ImYCkasMrKyvIISJspD+AyZSTpOrodDSaIBpQCkwtgSM8oVd2/f39M2quoqAijmcrKyjG/l7L77vde+v6sfCRgbdu2LY3AtJNSgg0qDa5oTOViKQtM9nXTgQMHaqmpPEoLKXUQqJpcYIqPj/cSEhLMUZgUbYyNjZkjRPpu50n+VEUvKtditMEb7Xom5OrVqzvpkOXIukFps5XXTunO4cOHR7heKp1/ye1gEX9BCcdv6H4330cbCyh9iXrRgJUQ1FmarFWUIqDS4ApiCT9AobxMpj24uI/209LSvMLCwiLKz6fyQModAlW73TeAac6cOV5SUpIBlasv9qKRvgBYIyMj3tDQkDmPdaLRPzwrHA6bhGsNWr9xsMfEZnC7XDSg+tzv4lRCCRPfjJtHjhzpu3LlCkDVx4BKZICsx9gy4PT4rmFQQbIpdfM5ynX7gWrS/Phl7NixI0SDWCCD52Is14vqAXIByoluAkl+fr43f/58Lyvr7cIaHh4OJSYmfkug6rXZApOamprqUb6vned3X4CBujj29/cbkEl/7EUj74o+og4S2gh6xkypk6mUPXnyZN25c+fCDKzm8vLyOuQzqCAtJ06cuH/+/PkwAytMLCR57VjQFy5cmKeAiXJZGOeLFy/iPBVt4Nqeb60dogKLBm9O/FvxXIwVxBAaUBpgixYt8np7e7329vYJZUtKSkwSefHihVdTU9N2586dXrtfmNj09HQz0dMRvAsYD0dhLryrvG8s7/w+ZCrPcJSdx8duAb+6l0WgWqeu/8uMZMoDWCTr+BpMVoZ8jLUq18XXgdohEFg0cXF6kF2s5Uf9NqBwxL0FCxaYSXz58qWZSNzr6+vzioqKIm01NTV5ZLgbT9HuExgGAzBdUOmJEeb6EKD5AJKt1KJ9TwAFNrpz6tSpljNnzgiQuuh8DbNSNx9HlF0mx26/cbTHLy6AsSKGcVCyjWepJwnS2trqbdiwwZyDJaDyUBbslZmZGTG6Hz9+7D18+NDdUSqTkpIyY6B6V5b4mYsBAIGm27rXR/f+DFXGKm5Ega6P7a5lqvw6sbMIcFkKlCUAI6esQI0QBCwBjxirNqCkDACSkZFhQKLVCSassbHR27Jli6kvsnDhQnN8/vy5t3Hjxsj95ubmSQ6CVoEA5a8IBO+LsSKgoskPKxaC1DKo1mmDXF1/AwAyCO+rNoX1FrANVqLA6V6sfuGGgwcPphBovrCBIuwCgRp7+vSpAUd2dra5bmtrM6pvdHTUu3fvnrGdNHhEbt265XV1dXn79+9/y8V0XltbGwkDkKpsqqqqqhG2AmgBrFn5+Qo0Uyw21gRm0kwCLwqAAgC2b99u2AQCVYWyACtUGkRUoC2bNm0yYBIBe/l5ncKaWmg1hrj/47TCRu32ebUam4LyAweEymK1QG+PUdk3PmXCrGZicrej9e99CD0znvs4NsPtRh2fmMMNLmBBYHgDmTC4ly1bNslWAbhu375tyh06dGgCw2kB+yDEAIEh39HR4RsjE+/NkgJKf0DwlNJ3jkndi2Yo/QXOZ5RxWElpOaUqSk99QLWPErzUr2OcD+j7T+GPUKqZocldyu2mWWbMv1mt4T3q2OObSVnNz46MD49xMfelE85ArOGGiA2FSR0cHDRggVe3fv16Lzc317cXCBeUlZUZu8sVBLUF7YrnaDMWygsjWpLJx1eOvCS8LKX+GFeYdPS1T356wLOC7NcOK/g4HSbaSmku2zZtlo0D6l8U5R2mIxmO91/F79iP8aY+lmhAR2Us09PXr439hAles2ZNoK2Tl5dnwgorV66clHfz5k1v165dk8CFuJYfWwm4/Twgn4FMZqO0U00OPg/lsgck0k3Ae6JACq8HamsAJgPl9fOAzef8VLpey1HtVGXUQoZ45b7QawzgojqpauJNZIYnpEXUFpWZw8ZxMqsdEdgUixlUqPMt1RlygE8mv4jO5/M7tFHZXs4HI+uJG4YFQvldnF+sAPRGjd8SSjl8fzGVG6I6Dxk76GcKl8uOlbESh4eHDVOBpWCcQ/1F88qQv2fPnknlnjx5YsIJOBYXF/9/NqhtANcV8ZbYlc8zswJYJJ8H5Eem7A3WxEYmjdVcigycyltBeV/RsVANbDKDrJnL5jom+Dsa+A5e0WDOn7g/Kx3PR/06qpPDjBS28gG6e6pfDT6gimeV5LF6iqh4focxHo84Ne8hzv8ng2sJA6tfjUedROkZbPkqRhbie8JauTEBi7y6ePncAQaaO3fulKLaWgDQgYEBoxrh+WlgiW3l9znFNtp5IBN5kv0YS6vJYgYVVlU120mfUPot58sqbeaBxJh8zqs7TIN+i573R2aMfykGQD2w21dcfx2DMI3yXjOosLqH6Fr6U8VqDHGhzVw2ns8T2BaTWNMefrc09a7PA1R1iNuuYibZwfXmUB8Qq/qrZa9tZjs1i65fcRswHf5O1zuYgZ7yeG1jdq3SbM9gauFF8yimOBYABaN66dKlUwKVS0TVQT2+evVqgjcIYAWxXxQ12O/jcWUq0MlqvwtQsIeo8zOUWoQHOcCTNMbqQsqPcTARE5PCk/+a64woB6HPYf/JMzq57KgqW8AAaKa8Jn4fbfOlKe92wGeoMq13GFQqdwD95aDmZ5Q+Z9AJwwwoYL5Wn3vqHH2JCOU9pkMjg7jWMgH8GYtspVx8cIwW6QYDrV271rccgATGAkhgm8GTfPDggbd161YTWIUqdLGVnPt4lQKsQQebJTCVj7CNlO4YmAwFlCUaBAo0XVR/nK6T+RqTNh5g7GuwLrTyMxlMfY760r/eKI4J+hJSffA1rlm9o989DK5SLtOmnpOm+pCr6zNoojpJVK6HnxFbuKGiomI5u5hRQVVdXW0+0UjowGa97u6Jn5ewewExMIAN3mA0lepjX8nLgsYXMy2P8SAmWJM6zGoJhnkrr7BEBRwbJLYHJJ/zQ5gwZhx7IkMMkEFWfZF8BcxOFU9zAes33L9+yzERMKLP66nMM8V4HjNFpgPI0r9kft4AmwLjzE4wD0Z58S0OMCvk/RMDgB1zHGtZtIoIgopKe/TokRNYnZ2dzroAIsAFo93Vrq0OAxgLdPZ7TZBsLOtBAl2vZbvqE1VWT4JWM/YkDfJk4P4+GtxqR5l07otrYjMdk6Ydj24ebxjwO23CZ6A+YGegiJOn+vY3xcC9jncY5TwA7E92+zGEW/r5+CnbUjdijbXYbJXs8E6ck11aWmp2G+B7oC1Qc2AsP+AAVHqT3RR3Vd5nQ9dO93hw6ik95hX9H7jonF/PIQBjj7ARC9f5rhUTQrlWrt/L9e/y/XbOq1ce0ihfy0A85useZop6K2gJ8P8A0FACo/7De7tV5Qd4sgIa8QDp2IBoDTNOvU7Mlo1sQ44rwNSzwS3t19l14WWq/tb4qLW76rn3Yp2gSd8KCVjwWMqC1JP6nmei8Ddu3DBRdgmI4jshDHbkByVpQ5+rY9P3339fk5OT46m9RVMNLGLQf2cxdCGff62M3I8m1EcY73nqVg4nhBYe/FK+EwJH+E4cpAozgxoQlhEQwGNctWqVUW2rV6+OGOx++96jbcm193bJBrx3lBQV3NRu8o+xgCrWvervsoddWD8pKamQ40Py9QEM00htNrzrnvxY3yeW/kUTIRlbO7kYa4OlxyMsZG87loQ8Yhdv9+7dJkIPYGk28mOrFStWGOMeux+wdx0foq9fvx7Z3QDGgmeK9D63y8j74D2QpI+unZHTAZdsgJzKxE33vfQzowEuluC3q57eyx/EWBn2DQQ3MdDa9bd/xrV8+fLIpx8beH4/HigoKHgbKi4u9s6ePeuVl5cbYOkOIxwB0M30Bj+0DRDhy4LE7KSfszJ9SbAMd0+5vxEjG6EB+SWMRq3eepycnGwMdq0mfX7aNWHbsrAhovvXrl2bpCKRB2DDSZjuKpd2AVa0qX9EMSszK3GOmEWCjopLgBMJE4GEyZajVh8OA9zJXBpUOL98+bJ37Ngxr6WlRbPbuIABrILPS+8KAtRD/3t6ekzsTBbLLKg+HLC0GrxLkzCmAaWTDSptm0QDGf92cMKvdy5duuQdPXpU6+sB7TAAWFCzOI8VTCiLOoinIeaGNqbyO8JZmXlg3a2srPyJANQqQHIBTIPLBlYQc8GTxM5SAdHevXvNr3NgSylGe2Z7owAG2AZHcSbshHJgOJQDoCSeNgumj2hjMbAMqHBBE/IAv0imiU6AjSUGvN9Pv1z2lAtc2AiILTg4r6mpMfGP48ePew0NDdJGU21t7SuXaysAt3e26l85z7LSx5cJ4YbTp0/PJVBN2G6wb9++PJrAzdif5fpBhTaK/f70I1qygPeMrqvq6upi0nmuPyWZlY8XJPWNY7mEVJX5GyNK8yiFg34J7fM3RYEgIyCN09H8jVF1dfXs3xj9CoD1PwEGAKorJqR4atjIAAAAAElFTkSuQmCC",s)=>{let r,n=0,o=0;const h=[],a=t=>{const i=new zt.Image;i.src=t,i.onload=()=>{h.forEach((t=>{var s;const r=new Q({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Xd)||void 0===s||s.Re(r),n=i.width,o=i.height,c(t)}))}};a(i);const l=t.Kn((t=>a(t)));let u;if(new zt.Image instanceof zt.HTMLImageElement){const t=new zt.Image;t.src=i,u=new Q({source:t,fitMode:e.ImageFitMode.Stretch})}else if(zt.lcjs_setup){const t=new zt.Image;t.src=i;const s=zt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),u=new Q({source:s,fitMode:e.ImageFitMode.Stretch})}else u=new N({color:T("#f00")});const c=t=>{if(t.Xd){const e=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-(3+n),y:3}),i=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-3,y:3+o}),s={x:i.x-e.x,y:i.y-e.y};t.Xd.Ve(e).it(s)}r&&r.Ms()};return r=t.KF("logo",Number.MAX_SAFE_INTEGER),i=>{const n={At:i};return(i=>{const n=s&&"cGx1Z2lu"in s&&"cHl0aG9u"===s.cGx1Z2lu?Ag:pg;i.Xd&&i.Xd.dispose(),r&&(i.Xd=r.Ee(i.At).Re(u).setMouseInteractions(!0).Le(ut).setMouseEnterEventHandler((()=>{t.tn(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.tn(e.MouseStyles.None)})).setMouseClickEventHandler(n).setTouchEndEventHandler(n),c(i))})(n),h.push(n),{Os:()=>c(n),Y:()=>(e=>{e.Xd&&(e.Xd.dispose(),e.Xd=void 0);const i=h.indexOf(e);i>=0&&h.splice(i,1),h.length<=0&&t.qn(l)})(n)}}},pg=()=>zt.open("https://lightningchart.com/lightningchart-js/"),Ag=()=>zt.open("https://lightningchart.com/python-charts/");class xg{constructor(){this.YE=this.UI.bind(this),zt.addEventListener("scroll",this.YE,{passive:!0})}Y(){this.YE&&zt.removeEventListener("scroll",this.YE),this.YE=void 0}}class Sg{constructor(t,e){this.Fa=t,this.Z=e,this.HE=!0,this.$E=null,this.XE=null}}class vg{constructor(t){this.jE=!1,this.ZE=1,this.QE=t,this.JE={Fa:u(0,0),Z:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),HE:!0,$E:null,XE:null},this.KE=u(64,64),this.qE=new Uint8ClampedArray(this.KE.x*this.KE.y*this.ZE)}tz(t,e){if(!t.HE)return null;if(t.$E&&t.XE){const i=this.tz(t.$E,e);return null!==i?i:this.tz(t.XE,e)}const i=c(t.Z.x,t.Z.y);if(t.Fa.x+t.Z.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.KE.x-t.Fa.x-1),t.Fa.y+t.Z.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.KE.y-t.Fa.y-1),t.Z.x===e.x&&t.Z.y===e.y)return t.HE=!1,t;if(i.xt.Z.y)),h?(s=new Sg(yi(t.Fa,{x:0,y:1}),u(t.Z.x,e.y)),r=new Sg(yi(t.Fa,{x:0,y:e.y+1}),u(t.Z.x,t.Z.y-1-e.y))):(s=new Sg(yi(t.Fa,{x:1,y:0}),u(e.x,t.Z.y)),r=new Sg(yi(t.Fa,{x:e.x+1,y:0}),u(t.Z.x-1-e.x,t.Z.y))),t.$E=s,t.XE=r,this.tz(t.$E,e)}iz(t,e){const i={sz:!1,Fa:null};let s=this.tz(this.JE,e);if(null===s)for(;null===s&&this.KE.xthis.QE||t.y>this.QE)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.ZE);for(let i=0;i{this.lz.fz(t)})),this.az.clear(),this}Az(t,e){const i=this.oz.get(e);if(i)return i.get(t)}gz(t,e,i){let s=this.oz.get(e);if(s||(s=new Map,this.oz.set(e,s)),s.has(t.glyph))return Mg.Success;const r=this.uz.iz(i,t.size);if(!r||!r.Fa)return Mg.Fail;r.sz&&this.pz();const n=this.uz.rz(r.nz);if(!n)return Mg.Fail;let o=this.az.get(r.nz);if(!o){const t=this.lz.gl.createTexture();if(!t)throw new Mt("Failed to create texture for font!");o=t,this.az.set(r.nz,t)}const h=r.Fa,a=n.KE.x,l=n.KE.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,y=(h.x+t.size.x)/a,p=h.y/l,A=[g,m,y,m,g,p,g,p,y,m,y,p],x=[u,c,d,c,u,f,u,f,d,c,d,f],S={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:x,texCoords:A,packerId:r.nz,texture:o};s.set(t.glyph,S);const v=this.lz.gl;return v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.bindTexture(v.TEXTURE_2D,o),v.texImage2D(v.TEXTURE_2D,0,v.LUMINANCE,n.KE.x,n.KE.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.lz.yz?n.qE:new Uint8Array(n.qE)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.bindTexture(v.TEXTURE_2D,null),r.sz?Mg.Resize:Mg.Success}pz(){this.oz.forEach((t=>{t.forEach(((e,i)=>{const s=this.uz.rz(e.packerId);if(!s)return;const r=e.origin,n=s.KE.x,o=s.KE.y,h=r.x/n,a=(r.y+e.size.y)/o,l=(r.x+e.size.x)/n,u=r.y/o,c=[h,a,l,a,h,u,h,u,l,a,l,u];e.texCoords=c,t.set(i,e)}))}))}}const wg=t=>{if(t instanceof Yi||t instanceof Wc)return t._i()?"linear-highPrecision":"linear";if(t instanceof Hi){const e={};return t.x instanceof Fi&&(e.x={base:t.x.gi()}),t.y instanceof Fi&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},Eg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let r=!1;i[e]=t=>{if(!t)return r;const e=s();return r=e,e}})),i},kg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.vt(),max:e.St()}:"y"===t.getLookUpProperty()?{min:e.xt(),max:e.bt()}:"z"===t.getLookUpProperty()?{min:e.Tv(),max:e.kv()}:void 0,Ig=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),zg=t=>(e,i)=>i%2?e:e+t;class Fg{constructor(t){this.mz=new Map,this.vz=xe("font"),this.Sz=new Map,this.xz=new Set,this.lz=t}dz(t=!1){return(t||0===this.xz.size)&&(this.mz.forEach(((t,e)=>{t.dz(),this.mz.delete(e)})),this.xz.clear()),this}bz(t){this.xz.add(t)}Mz(t){this.xz.delete(t)}_z(t,e,i,s){const r=zt.devicePixelRatio,n=`${s?"dark":"light"} - ${Pr(e,r).id}`,o=this.Sz.get(n),h=this.mz.get(o);let a=0,l=0,u=0;const c=t.split(""),d=e.size,f=.45*e.size*r,g=Math.round(1*e.size);let m=!1;for(let t=0;t{if(0===i||360===i||180===i||i%180==0)return{x:t,y:e};if(90===i||-90===i||(i+90)%180==0)return{x:e,y:t};const s=i*Math.PI/180,r=Math.cos(s),n=Math.sin(s);return{x:Math.abs(t*r)+Math.abs(e*n),y:Math.abs(t*n)+Math.abs(e*r)}})(u/r,(l-a+1)/r,i);return{x:y.x,y:y.y,isEstimate:m}}wz(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.Sz.get(s);r||(r=this.vz(),this.mz.set(r,new Tg(this.lz)),this.Sz.set(s,r));const n=this.mz.get(r);if(!n)throw new Mt("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),c=new Map;let d=0;const f=e.properties.size;for(let t=0;t{t.ba.u=!0})),t=-1,d=0,h=0,o=0,c.clear(),this.lz.cs.Ms(!0);continue}if(l===Mg.Fail)throw new Mt("Failed to create glyph");if(a=n.Az(s,f),!a)throw new Mt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(a.texture);t||(t={vertices:[],texCoords:[]},c.set(a.texture,t)),t.vertices.push(...a.vertices.map(zg(r))),t.texCoords.push(...a.texCoords),h=Math.max(h,a.baseline),o=Math.min(o,a.baseline-(a.size.y-1))}d+=a.advanceX}a=d;const g=m(u(0,o),u(a,h)),y=[];return c.forEach(((t,e)=>{y.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[y,g]}}class Rg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>Dg(t)));for(const i of e)t=i(t);return`${we(this.modifiers.filter((t=>Pg(t)))).map((t=>t.kz)).join("\n")}\n${t}`}}const Dg=t=>"function"==typeof t,Pg=t=>t&&"object"==typeof t&&"Tz"in t,Og=(...t)=>e=>{t=t.reverse();for(let i of t)"string"==typeof i&&(i=i.includes("{")||i.endsWith(";")?i:`${i};`,i=i.trim(),e=e.replace("void main(void)",`${i}\nvoid main(void)`));return e},Lg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),_g=(...t)=>e=>{const i=t.filter((t=>t));for(let t=0;ti=>{for(let t=0;t{if(!n.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${n}\n)`)})),n},Vg=(t,...e)=>i=>{const s=e.filter((t=>"string"==typeof t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},Gg=(...t)=>e=>{for(let i of t)if("string"==typeof i){i=i.endsWith(";")?i:`${i};`,i=i.trim(),i=i.startsWith("\t")?i:`\t${i}`;const t=e.lastIndexOf("}");e=`${e.substring(0,t-1)}\n${i}\n}`}return e},Ng=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Og(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Og(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Gg(`\t${r} = ${s};`)(i)},Ug=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Yg={roundUnsigned:{Tz:"roundUnsigned",kz:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{Tz:"linearStep",kz:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{Tz:"decodeUbyteRGBAEncodedFloat",kz:"\n // Denormalize 8-bit color channels to integers in the range 0 to 255.\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n \n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n \n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n \n // Decode a 32-bit float from the RGBA color channels of a texel.\n float decodeUbyteRGBAEncodedFloat(vec4 rgba, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(rgba, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n "},texelFetchWithFallback:{webgl2:{Tz:"texelFetchWithFallback",kz:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{Tz:"texelFetchWithFallback",kz:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},texelFetchUnsignedWithFallback:{webgl2:{Tz:"texelFetchUnsignedWithFallback",kz:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{Tz:"texelFetchUnsignedWithFallback",kz:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},modulus:{Tz:"modulus",kz:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{Tz:"computeScreenSpaceWireframe",kz:"#extension GL_OES_standard_derivatives : enable\nfloat computeScreenSpaceWireframe (vec3 barycentric, float lineWidth) {\n vec3 dist = fwidth(barycentric);\n vec3 smoothed = smoothstep(dist * ((lineWidth * 0.5) - 0.5), dist * ((lineWidth * 0.5) + 0.5), barycentric);\n return 1.0 - min(min(smoothed.x, smoothed.y), smoothed.z);\n}"}},Hg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Og("uniform vec4 uFallbackColor")],n=[],o=[];for(let t=0;t= uLUTValue${s}) {\n colorLookup = uLUTColor${s};\n }`,...i.slice(0,-1).map(((t,e)=>`if (value >= uLUTValue${e} && value <= uLUTValue${e+1}) {\ncolorLookup = uLUTColor${e} + vec4(uLUTColor${e+1}.r - uLUTColor${e}.r, uLUTColor${e+1}.g - uLUTColor${e}.g, uLUTColor${e+1}.b - uLUTColor${e}.b, uLUTColor${e+1}.a - uLUTColor${e}.a) * (value - uLUTValue${e})/(uLUTValue${e+1} - uLUTValue${e});} `)),"colorFragment = colorLookup")):r.push(Vg("colorFragment =","vec4 colorLookup = vec4(uLUTValue0)","float value = "+(e.percentageValues?`clamp((${t} - uMinValue) / (uMaxValue - uMinValue), 0.0, 1.0);`:`${t}`),`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorLookup = uFallbackColor;\n } else if (${t} < uLUTValue0) { colorLookup = uLUTColor0;} ${i.slice().reverse().map((t=>{const e=i.indexOf(t);return`else if (value >= uLUTValue${e}) { colorLookup = uLUTColor${e};} `})).join("")}`,"colorFragment = colorLookup")),r},Xg=[Og("uniform sampler2D uMaskTexture"),Og("varying vec2 vMaskTextureCoord"),Vg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Wg=[Og("uniform sampler2D uMaskTexture"),Og("varying vec2 vMaskTextureCoord"),Vg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],jg=[Og("varying vec3 vPosWorld;","varying vec3 vNormal;","uniform vec3 uCameraLoc;","uniform vec3 uLightLoc;","uniform vec4 uLightColor;","uniform vec4 uAmbientColor;","uniform float uShininess;","uniform float uAmbientReflection;","uniform float uDiffuseReflection;","uniform float uSpecularReflection;"),Vg("colorFragment =","float ambientReflection = uAmbientReflection","float diffuseReflection = uDiffuseReflection","float specularReflection = uSpecularReflection","vec3 ambientColor = uAmbientColor.rgb","vec3 diffuseColor = colorFragment.rgb","vec3 specularColor = uLightColor.rgb","vec3 vNormalNormalized = normalize(vNormal)","vNormalNormalized = (float(gl_FrontFacing) * 2.0 - 1.0) * vNormalNormalized","vec3 lightDir = normalize( uLightLoc - vPosWorld )","float lambertian = abs(dot(vNormalNormalized, lightDir))","float specular = 0.0","vec3 R = reflect(-lightDir, vNormalNormalized)","vec3 V = normalize(uCameraLoc - vPosWorld)","float specAngle = max(dot(R,V),0.0)","specular = pow(specAngle, uShininess)","colorFragment = vec4(ambientReflection * ambientColor + diffuseReflection * lambertian * diffuseColor + specularReflection * specular * specularColor, colorFragment.a)")],$g=(t,...e)=>{var i,s,r;if("linear-highPrecision"!==t||0===e.length)return{vertexShaderModifiers:[],fragmentShaderModifiers:[]};const n=e[0];return{vertexShaderModifiers:[Og("varying vec4 d"),Gg(`d = vec4(${e[0]}.x, ${null!==(i=e[1])&&void 0!==i?i:n}.x, ${null!==(s=e[2])&&void 0!==s?s:n}.x, ${null!==(r=e[3])&&void 0!==r?r:n}.x)`)],idFragment:"hpfix",fragmentShaderModifiers:[Og("varying vec4 d"),Gg("if (d.z == -100.0 + d.z / 10.0) { gl_FragColor = d; }")]}};class Zg extends Error{constructor(t,e,i){super(`Dynamic shader generation error\n(id: ${e})\n ${i?`when applying feature: ${i.idVertex?`vert: ${i.idVertex}`:""} ${i.idFragment?`frag: ${i.idFragment}`:""}`:""} | ${t}`)}}const qg=(...t)=>{let e="";for(const i of t){if("object"!=typeof i){e+=`${String(i)},`;continue}const t=[{prefix:"",obj:i}];for(;t.length>0;){const{prefix:i,obj:s}=t.shift();e+=`${i}:`;const r=Object.keys(s).sort();for(const i of r){const r=s[i];"object"==typeof r&&r.__proto__===Object.prototype||Array.isArray(r)?t.push({prefix:i,obj:r}):e+=`${i}=${String(r)},`}}}return e},Kg=t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Iz})),Jg=t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Pz})),Qg=(t,e,...i)=>{const s=[],r=e?"vec3":"vec2",{axisWorldTranslation:n,scaling:o,translation:h,offset:a,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Og("attribute vec3 aNormal"),_g("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(_g(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(_g(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))})):i.forEach((e=>{!0!==t.splitPosAttribute?s.push(_g(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),_g(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(_g(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),_g(`${r} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),a&&a.rotation){const t=a.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Og("attribute float aRotDeg"),Og("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(_g(`vec2 ${t} = vec2(sin((aRotDeg + uBaseRotDeg) * 0.01745329252), cos((aRotDeg + uBaseRotDeg) * 0.01745329252))`,`vec2 rotatedGeo = vec2(${e}.x * ${t}.y + ${e}.y * ${t}.x, ${e}.y * ${t}.y - ${e}.x * ${t}.x)`))}else{const i=`${e}Rot`;s.push(Og(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(_g(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Og(`attribute ${r} aInstanceGeo`)),!0===l){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXY");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${e?`vec3(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x, ${t.variableNameAxisCoord}.z)`:`vec2(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`}`)}))}if(!0===u){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXZ");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = vec3(${t.variableNameAxisCoord}.z, ${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`)}))}if(o){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",r=e?"vec3":"vec2";s.push(Og(`${o.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===h.dataType?"a":"u")+"TranslationAxis",r=e?"vec3":"vec2";s.push(Og(`${h.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===a.dataType?"a":"u")+"OffsetAxis",o=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${o} ${t}`));const h=a.halved?" * 0.5":"",l=a.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${r} ${u} = ${t} * ${l}${h} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${r} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===n||"linear"===n)s.push(Og(`uniform ${r} uDisp`,`uniform ${r} uScale`)),i.forEach((t=>{f.push(`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===n)s.push(Og(`uniform ${r} uDisp`,`uniform ${r} uScale`,`uniform ${r} uScaleStart_highpart`,`uniform ${r} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${r} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${r} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===n)s.push(Og("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Og("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Og(`uniform ${r} uScaleStart`,`uniform ${r} uScaleStartLog`,`uniform ${r} uScaleInterval`,`uniform ${r} uScaleIntervalLog`,`uniform ${r} uViewportStart`,`uniform ${r} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=n[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${Di(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Og(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),r=n[1][t];if(void 0===r)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const n=r.base,o="e"===n;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${n}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${r} ${e.variableNameWorldCoord} = uViewportStart + ${r}(${o.join(", ")}) * uViewportSize`)}))}if(a&&"px"===a.sizeUnit){s.push(Og("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Og("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${n} ${e}`));const o=a.halved?" * 0.5":"",h=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e}${o} * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${h}`)}))}if(a&&"scale"===a.sizeUnit){s.push(Og("uniform vec2 uRatioPxClip")),s.push(Og("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Og("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Og(`${a.dataType} float ${e}`));const r=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e} * uSizePixels * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${r}`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(a&&"nwu"===a.sizeUnit){s.push(Og("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Og(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Og("uniform vec2 uViewportSizePx")),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = 2.0 * floor(((${t.variableNameWorldCoord} + 1.0) * 0.5) * uViewportSizePx + 0.5) / uViewportSizePx - 1.0`)}))),s.push(Bg("gl_Position =",...f)),s},tm=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(Vg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(Vg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==n[0])throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");{const t=[`${o} ${i}_percent = (${i} - uViewportStart) / uViewportSize`];(e?["x","y","z"]:["x","y"]).forEach((e=>{const s=e.toUpperCase(),r=n[1][e];if(void 0===r)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const n=r.base,o="e"===n?"1.0":`cLog${n}`;t.push(`float pos${s}Back = pow(2.71828, (${i}_percent.${e} * uScaleIntervalLog.${e} + uScaleStartLog.${e}) / ${o})`)}})),t.push(`${o} ${s} = ${o}(posXBack, posYBack${e?", posZBack":""})`),r.push(Vg(i,...t))}}return r},em=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Dz})))(t)?[Lg("attribute vec4 aColor"),Lg("vColor = aColor"),Og("attribute vec4 aColorA"),Og("attribute vec4 aColorB"),Gg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],im=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Bz})))(t)?[Lg("attribute float aLookupValue"),Lg("vLookupValue = aLookupValue"),Og("attribute float aLookupValueA"),Og("attribute float aLookupValueB"),Gg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],sm={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"2DCompose":{idFeature:"2DCompose",apply:t=>({idVertex:"2DCompose",idFragment:"2DCompose",defaultVertexShader:"2DMatrix",defaultFragmentShader:"Empty"})},"3D":{idFeature:"3D",Fz:{Iz:!0},apply:t=>({idVertex:"3D",idFragment:"3D",defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",apply:e=>{const i="uniform"===t?"u":"a";return{idVertex:`SizePrimitive:${qg(t)}`,idFragment:void 0,vertexShaderModifiers:[Og(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Gg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTextureText,r=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",Fz:{Pz:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,Bz:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,Dz:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${qg(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Og("uniform vec4 uColor"),Vg("colorFragment =","colorFragment = uColor"),...s?Xg:[],...r?Wg:[]);else if("attribute"===i)a="colorAttribute",u.push(Ng("attribute vec4 aColor","varying vec4 vColor")),d.push(Og("varying vec4 vColor"),Vg("colorFragment =","colorFragment = vColor"),...s?Xg:[],...r?Wg:[]);else if("texture"===i)a="colorTexCoord",u.push(Ng("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Og("varying vec2 vTextureCoord"),Og("uniform sampler2D uColorTexture"),Og("uniform vec4 uColor"),Vg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Xg:[],...r?Wg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Og("attribute vec2 aTextureCoord"),Og("varying vec2 vTextureCoord"),Gg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Og("varying vec2 vTextureCoord"),Og("uniform sampler2D uColorTexture"),_g("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Ng("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Og("uniform sampler2D uColorTexture"),Og("varying vec2 vTextureCoord"),Vg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Og("uniform sampler2D uColorTexture"),Og("varying vec2 vTextureCoord"),Og("uniform vec4 uColor"),Vg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }"));else if(Array.isArray(i)&&"lookup"===i[0]){const t=i[1];if("value"===t)a="lookup:value",u.push(Ng("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Ng(e,"varying float vLookupValue"))}d.push(Og("varying float vLookupValue"),...Hg("vLookupValue",i[2]),...s?Xg:[],...r?Wg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();nt(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Og("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Og(...Bt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Yg.linearStep,Vg("colorFragment =","vec2 uv = vec2((((gl_FragCoord.x)-uBounds.x)/(uBounds.z))*uAspect,((gl_FragCoord.y)-uBounds.y)/(uBounds.w))","float mixVal = distance(uv/uDistance, uCenter/uDistance)","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, mixVal))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"colorFragment = color"),...s?Xg:[],...r?Wg:[])):at(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Og("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Og(...Bt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Yg.linearStep,Vg("colorFragment =","vec2 uv = gl_FragCoord.xy - uBounds.xy","float magnitude = ((uv.x-uStartPoint.x) * (uEndPoint.x-uStartPoint.x) + (uv.y-uStartPoint.y) * (uEndPoint.y-uStartPoint.y)) / (pow(uEndPoint.x - uStartPoint.x, 2.0) + pow(uEndPoint.y-uStartPoint.y,2.0))","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, magnitude))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"colorFragment = color"),...s?Xg:[],...r?Wg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Ng("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Og("uniform float uOpacity"),Vg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:u,fragmentShader:c,fragmentShaderModifiers:d,idVertex:a,idFragment:l}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${qg(t)}`;return{idFeature:"ColorShaded3D",Fz:{Pz:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,Bz:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Ng("normal","varying vec3 vNormal"),Ng("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Og("uniform vec4 uColorDiffuse"),Vg("colorFragment =","colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Ng("attribute vec4 aColor","varying vec4 vColor")),a.push(Og("varying vec4 vColor"),Vg("colorFragment =","colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Ng("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Ng(e,"varying float vLookupValue"))}a.push(Og("varying float vLookupValue"),...Hg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Ng("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Og("varying vec3 vTriangleBary"),Og("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Yg.computeScreenSpaceWireframe,Vg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...jg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=$g(t.axisWorldTranslation,"posAxis_hprecision"),s=[],r=Kg(e),n=t.coordType?t.coordType:r?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?s.push(Og(`attribute ${n} aPos`)):s.push(Og("attribute float aPosX"),Og("attribute float aPosY"),r&&Og("attribute float aPosZ")):!0===t.splitPosAttribute?s.push(Og("attribute float aPos_highpartX"),Og("attribute float aPos_lowpartX"),Og("attribute float aPos_highpartY"),Og("attribute float aPos_lowpartY")):s.push(Og(`attribute ${n} aPos_highpart`),Og(`attribute ${n} aPos_lowpart`)),s.push(...Qg(t,r,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),s.push(...i.vertexShaderModifiers),{idVertex:`VertexLocation:${qg(t)}`,idFragment:i.idFragment,vertexShaderModifiers:s,fragmentShaderModifiers:i.fragmentShaderModifiers}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Og("attribute vec3 aGeoPos"),Og("uniform mat4 uModelRotation"),Og("uniform mat4 uModelRotationNormals"),Og("uniform vec3 uLocationAxis"),Og("uniform vec3 uModelAlignment"),Og("uniform vec3 uModelScale"),Og("uniform vec3 uModelSize"),...Qg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Bg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&Vg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Jg(e)?tm({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${qg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>{const e=$g(t.axisWorldTranslation,"locationA_hprecision","locationB_hprecision");return{idFeature:"LineInstanced2D",apply:i=>({idVertex:`LineInstanced2D:${qg(t)}`,idFragment:e.idFragment,vertexShaderModifiers:[Og("uniform float uThicknessPixels"),Og("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA"),Og("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA_highpart"),Og("attribute vec2 aLocationB_highpart"),Og("attribute vec2 aLocationA_lowpart"),Og("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationAX"),Og("attribute float aLocationAY"),Og("attribute float aLocationBX"),Og("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationA_highpartX"),Og("attribute float aLocationA_highpartY"),Og("attribute float aLocationB_highpartX"),Og("attribute float aLocationB_highpartY"),Og("attribute float aLocationA_lowpartX"),Og("attribute float aLocationA_lowpartY"),Og("attribute float aLocationB_lowpartX"),Og("attribute float aLocationB_lowpartY")]:[],Og("attribute vec2 aSegmentPosition"),Og("attribute float aSegmentSide"),...Qg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Og("uniform vec2 uMinSegmentPixelVector"),Vg("worldB = ",t.ensureMinimumSegmentLength&&"float segmentLengthPixels = sqrt(pow(worldB.x - worldA.x, 2.0) + pow(worldB.y - worldA.y, 2.0)) / length(uRatioPxClip)",t.ensureMinimumSegmentLength&&"if (segmentLengthPixels == 0.0 || segmentLengthPixels < length(uMinSegmentPixelVector)) {\n worldB = worldA + uMinSegmentPixelVector * uRatioPxClip;\n }","vec2 directionBasis = worldB - worldA","vec2 directionBasisNorm = normalize(directionBasis)","vec2 perpendBasisNorm = vec2(-directionBasisNorm.y, directionBasisNorm.x)","vec2 offset = mix(worldA, worldB, aSegmentSide)","vec2 thicknessDirection = aSegmentPosition.x * directionBasisNorm + aSegmentPosition.y * perpendBasisNorm","vec2 posWorld = offset + thicknessDirection * uThicknessPixels * uRatioPxClip"),...im(i),...em(i),...Jg(i)?tm(t,!1,"posWorld","posAxis"):[],...e.vertexShaderModifiers],fragmentShaderModifiers:e.fragmentShaderModifiers})}},Area2D:t=>({idFeature:"Area2D",apply:e=>{const i=$g(t.axisWorldTranslation,"locationA_hprecision","locationB_hprecision");return{idVertex:`Area2D:${qg(t)}`,idFragment:i.idFragment,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA"),Og("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Og("attribute vec2 aLocationA_highpart"),Og("attribute vec2 aLocationB_highpart"),Og("attribute vec2 aLocationA_lowpart"),Og("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationAX"),Og("attribute float aLocationAY"),Og("attribute float aLocationBX"),Og("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Og("attribute float aLocationA_highpartX"),Og("attribute float aLocationA_highpartY"),Og("attribute float aLocationB_highpartX"),Og("attribute float aLocationB_highpartY"),Og("attribute float aLocationA_lowpartX"),Og("attribute float aLocationA_lowpartY"),Og("attribute float aLocationB_lowpartX"),Og("attribute float aLocationB_lowpartY")]:[],Og("attribute float aCurveOrBaseline"),Og("attribute float aSegmentSide"),...Qg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Vg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","bottom"===t.fill?"float baseline = min(posCoord.y, -1.0)":"top"===t.fill?"float baseline = max(posCoord.y, 1.0)":"left"===t.fill?"float baseline = min(posCoord.x, -1.0)":"float baseline = max(posCoord.x, 1.0)","vec2 posWorld = "+("bottom"===t.fill||"top"===t.fill?"vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))":"vec2(mix(posCoord.x, baseline, aCurveOrBaseline), posCoord.y)")),...im(e),...em(e),...Jg(e)?tm(t,!1,"posWorld","posAxis"):[],...i.vertexShaderModifiers],fragmentShaderModifiers:i.fragmentShaderModifiers}}}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${qg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Og("uniform float uOffsetWU"),Og("attribute vec3 aLocationA"),Og("attribute vec3 aLocationB"),Og("attribute float aSegmentPosition"),Og("attribute float aPerpendHorizontal"),Og("attribute float aPerpendVertical"),...Qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Kg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Vg("worldB = ","vec3 directionBasis = worldB - worldA","vec3 directionBasisNorm = normalize(directionBasis)","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(directionBasis.y), 0.9 ) ))","vec3 horizontalBasis = normalize( cross( notParallel, directionBasisNorm ) )","vec3 verticalBasis = normalize( cross( horizontalBasis, directionBasisNorm ) )","vec3 normal = aPerpendHorizontal * horizontalBasis + aPerpendVertical * verticalBasis","vec3 posWorld = worldA + aSegmentPosition * directionBasis + normal * uOffsetWU * 0.5"),...Jg(e)?tm({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Og("attribute vec3 aEdge"),Og("uniform float uEdgeRoundness"),Vg("posWorld =","vec3 boxSizeWorld = abs( aOffsetAxis / uScale )","float boxMinDimensionWorldXZ = min( boxSizeWorld.x, boxSizeWorld.z )","vec3 edgeRoundAmount = uEdgeRoundness * vec3( boxMinDimensionWorldXZ, min( boxMinDimensionWorldXZ, boxSizeWorld.y ), boxMinDimensionWorldXZ )","posWorld = posWorld + aEdge * edgeRoundAmount")]})},ColorGrid2D:t=>{const e=t.flipXY,i=t.intensityTextureType,s=t.littleEndian;return{idFeature:"ColorGrid2D",apply:(r,n)=>({idVertex:void 0,idFragment:`ColorGrid2D:${qg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Og("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Yg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?_g("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions - 1.0)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensions - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensions - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${e?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${e?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${e?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${e?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===i?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${s})`),"float intensity01 = "+("float"===i?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${s})`),"float intensity10 = "+("float"===i?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${s})`),"float intensity11 = "+("float"===i?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${s})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${e?"lerpFactors.y":"lerpFactors.x"})`):_g("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellIndexNormalized = cellIndex / uTileDimensions",`vec4 sample0 = texture2D(uTileIntensityValues, ${e?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...Hg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,h)=>{const a=[],l=[];return a.push(Og("uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB","attribute"===i&&"attribute float aVertexID"),void 0!==i&&Yg.roundUnsigned,Yg.modulus,Yg.texelFetchWithFallback[h],"ubyte"===r&&Yg.decodeUbyteRGBAEncodedFloat,_g(void 0===i?"int iVertex = gl_VertexID":"int iVertex = int(roundUnsigned(aVertexID))","int iSecondary = modulus(iVertex, (uTileDimensions.y - 1))","int iPrimary = iVertex / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(uTileDimensions) - 1.0","vec2 halfTexelWorld = 2.0 / (uTileDimensionsMinus1 * 2.0)","vec2 posWorld = vec2(-1.0 + halfTexelWorld.y + iCell.y * 2.0 * halfTexelWorld.y, -1.0 + halfTexelWorld.x + iCell.x * 2.0 * halfTexelWorld.x)","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec3 posAxis0 = vec3(\n uTileStartLocationAxisXZ.x + iCell.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`} ,\n uTileStartLocationAxisXZ.y + iCell.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell1 = iCell + vec2(1.0, 0.0)",`vec3 posAxis1 = vec3(\n uTileStartLocationAxisXZ.x + iCell1.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell1.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell2 = iCell + vec2(0.0, 1.0)",`vec3 posAxis2 = vec3(\n uTileStartLocationAxisXZ.x + iCell2.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell2.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell3 = iCell + vec2(1.0, 1.0)",`vec3 posAxis3 = vec3(\n uTileStartLocationAxisXZ.x + iCell3.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell3.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec3 normal = normalize(cross(posAxis2 - posAxis0, posAxis1 - posAxis0) + cross(posAxis1 - posAxis3, posAxis2 - posAxis3))","uint"===s?"vNormalRGB = uvec3(((normal / 2.0) + 0.5) * float(-1u))":"vNormalRGB = (normal / 2.0) + 0.5","gl_PointSize = 1.0")),l.push(Og("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),_g("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${qg(t)}`,idFragment:`DrawToNormalTexture:${qg(t)}`,vertexShaderModifiers:a,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,r=t.shadingStyle,n=t.wireframe,o=t.normalTextureType,h=t.heightmapTextureType,a=t.intensityTextureType,l=t.littleEndian;return{idFeature:"SurfaceGrid",Fz:{Lz:!0},apply:(u,c)=>{const d=[],f=[];return d.push(Og("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture"),Yg.modulus,Yg.texelFetchWithFallback[c],"ubyte"===h&&Yg.decodeUbyteRGBAEncodedFloat,_g("int iSecondary = modulus(iInstance + uBaseInstance, (uTileDimensions.y - 1))","int iPrimary = (iInstance + uBaseInstance) / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 iCellVertex = iCell + aGeoCellOffset","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","vec2 ySampleCoordinate = vec2(iCellVertex.y, iCellVertex.x) / vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x)","float y = "+("float"===h?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${l})`),"vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)","vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * "+(s?"vec2(iCellVertex.y, iCellVertex.x)":"iCellVertex"),"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)")),d.push(...Qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(Ng("posWorld","varying vec3 vPosWorld"),..."uint"===o?[Yg.texelFetchUnsignedWithFallback[c],Gg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Gg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Gg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Og("varying vec3 vNormal",..."uint"===o?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Og("varying vec3 vTriangleBary")),"uniform"===e?f.push(Og("uniform vec4 uColorDiffuse"),Vg("colorFragment =","colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]&&("value"===e[1]?(d.push(Ng("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Og("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===a&&Yg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?_g("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = (vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensionsXZ - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensionsXZ - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${s?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${s?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${s?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${s?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===a?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${l})`),"float intensity01 = "+("float"===a?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${l})`),"float intensity10 = "+("float"===a?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${l})`),"float intensity11 = "+("float"===a?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${l})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${s?"lerpFactors.y":"lerpFactors.x"})`):_g("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = floor((vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ)","vec2 cellIndexNormalized = cellIndex / (uTileDimensionsXZ - 1.0)",`vec4 sample0 = texture2D(uTileIntensityValues, ${s?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = sample0.x"),...Hg("intensityP",e[2]))):(d.push(Ng(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Og("varying float vLookupValue"),...Hg("vLookupValue",e[2])))),"phong"===r&&f.push(...jg),n&&(d.push(Og("attribute vec3 aTriangleBary"),Ng("aTriangleBary","varying vec3 vTriangleBary")),f.push(Og("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Yg.computeScreenSpaceWireframe,Vg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)",e?"if (edge > 0.0) {\n colorFragment = vec4(mix(colorFragment.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorFragment.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorFragment = uWireframeColor;\n } else {\n discard;\n }"))),{idVertex:`SurfaceGrid:${qg(t)}`,idFragment:`SurfaceGrid:${qg(t)}`,vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${qg(t)}`,idFragment:`DebugSurfaceGridNormals:${qg(t)}`,vertexShaderModifiers:[Og("attribute float aNormalArrow","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===t.instanceIdSource&&"attribute float aInstanceID",..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),Yg.roundUnsigned,Yg.modulus,Yg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Yg.decodeUbyteRGBAEncodedFloat,_g(void 0===t.instanceIdSource?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","float y00 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y = (y00 + y01 + y10 + y11) / 4.0","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * (0.5 + ${t.flipXZ?"vec2(iCell.y, iCell.x)":"iCell"})`,"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)",..."uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"],"vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"),..."uint"===t.normalTextureType?[Yg.texelFetchUnsignedWithFallback[i]]:[],...Qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),Vg("posWorld =","vec3 dirArrow = normalWorld","vec3 posArrowStart = posWorld","vec3 posArrowEnd = posWorld + dirArrow * 0.010","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(dirArrow.y), 0.9 ) ))","vec3 dirArrowLeft = normalize(-dirArrow + 0.50 * normalize(cross(dirArrow, notParallel)))","vec3 dirArrowRight = normalize(-dirArrow + 0.50 * normalize(cross(notParallel, dirArrow)))","vec3 posArrowLeft = posArrowEnd + dirArrowLeft * 0.0025","vec3 posArrowRight = posArrowEnd + dirArrowRight * 0.0025","if (aNormalArrow == 0.0) {\n posWorld = posArrowStart;\n } else if (aNormalArrow == 1.0) {\n posWorld = posArrowEnd;\n } else if (aNormalArrow == 2.0) {\n posWorld = posArrowLeft;\n } else if (aNormalArrow == 3.0) {\n posWorld = posArrowRight;\n }")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Gg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Og("uniform vec3 uCameraLoc"),Vg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Og("attribute float aSegmentInside"),Og("varying float vSegmentInside"),Og("varying float vSegmentSide"),Vg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Ug("#extension GL_OES_standard_derivatives : enable"),Og("uniform float uAALimit"),Og("varying float vSegmentInside"),Og("varying float vSegmentSide"),Vg("antiAliasFactor = ","\n float dist = (uAALimit - vSegmentInside);\n vec2 ddist = vec2(dFdx(dist), dFdy(dist));\n float pixelDist = dist / length(ddist);\n // additional blurring\n pixelDist *= 0.5;\n\n float aa = clamp(0.5 - pixelDist, 0.0, 1.0);\n if((vSegmentSide <= 0.0 || vSegmentSide >= 1.0) && aa <=0.99){\n aa *= 0.5;\n }\n antiAliasFactor = aa;\n ")]})},Glow1D:t=>({idFeature:"Glow1D",apply:()=>{const e=Math.round(t.spreadPx),i=Math.round(t.blurPx),s=e+i,r=t.firstPass,n=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);n.push(r?{x:t.toFixed(1),y:"0.0",distPx:e.toFixed(1)}:{x:"0.0",y:t.toFixed(1),distPx:e.toFixed(1)})}return{idVertex:`Glow1D:${qg(t)}`,idFragment:`Glow1D:${qg(t)}`,vertexShaderModifiers:[Ng("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Og("uniform sampler2D uTexture"),Og("varying vec2 vTextureCoord"),Og("uniform vec2 uTextureSize"),r&&Og("uniform vec2 uOffsetPx"),!r&&Og("uniform sampler2D uTextureFirstGlowPass"),!r&&Og("uniform vec4 uGlowColor"),Vg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...r?[]:["float inverseIntensity =\n 0.25 * texture2D(uTexture, vTextureCoord).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, -oneTexel.y)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, oneTexel.y)).a","antiAliasFactor *= 1.0 - (inverseIntensity * inverseIntensity)","if (antiAliasFactor <= 0.0) { discard; }"],"float distancePx = 255.0","vec2 sample_tx = vec2(0.0)",...r?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...n.map(((t,e)=>[`sample_tx = texCoordOffset + oneTexel * vec2(${t.x}, ${t.y})`,`if (distancePx > ${t.distPx} && sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0 && texture2D(uTexture, sample_tx).a > 0.0) { distancePx = ${t.distPx}; }`])).flat(),"colorFragment = vec4(distancePx / 255.0, 0.0, 0.0, 1.0)"]:["vec4 sample_horizontal = vec4(0.0)","float horizontal_dist = 255.0","float min_horizontal_dist = 255.0",...n.map(((t,e)=>[`sample_tx = vTextureCoord + oneTexel * vec2(${t.x}, ${t.y})`,"if (sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0) {\n sample_horizontal = texture2D(uTextureFirstGlowPass, sample_tx);\n horizontal_dist = sample_horizontal.r * 255.0;\n }","if (sample_horizontal.a < 0.9) { horizontal_dist = 255.0; }","min_horizontal_dist = min(min_horizontal_dist, horizontal_dist)",`distancePx = min(distancePx, pow(horizontal_dist * horizontal_dist + ${t.y} * ${t.y}, 0.5))`])).flat(),`if (distancePx > ${s.toFixed(1)}) { discard; }`,"vec4 pixelGlowColor = vec4(0.0, 0.0, 0.0, 0.0)",`if (distancePx > ${e.toFixed(1)}) {\n float lerpAmount = (distancePx - ${e.toFixed(1)}) / ${(i+1).toFixed(1)};\n pixelGlowColor = mix(uGlowColor, vec4(uGlowColor.rgb, 0.0), 1.0 - (1.0 - lerpAmount) * (1.0 - lerpAmount));\n } else {\n pixelGlowColor = uGlowColor;\n }`,"colorFragment = pixelGlowColor"])]}}}),MousePicking:t=>{const e=!!(null==t?void 0:t.customMousePickingIdInput),i=!e&&!!(null==t?void 0:t.useVertexId),s=!e&&!!(null==t?void 0:t.useAttribute),r=!e&&!i&&!s;return{idFeature:"MousePicking",Fz:{Lz:r,Rz:i},apply:(n,o)=>{const h="webgl2"===o?"flat":"",a="webgl2"===o?"int":"float";return{idVertex:`MousePicking:${qg(t)}`,idFragment:`MousePicking:${qg(t)}`,vertexShaderModifiers:[...r?[Og(`${h} varying ${a} vPickingIdOffset`),Gg(`vPickingIdOffset = ${a}(iInstance)`)]:[],...i?[Og(`${h} varying ${a} vPickingIdOffset`),Gg(`vPickingIdOffset = ${a}(iVertex)`)]:[],...s?[Og("attribute float aPickingIdOffset",`${h} varying ${a} vPickingIdOffset`),Gg(`vPickingIdOffset = ${a}(aPickingIdOffset)`)]:[]],fragmentShaderModifiers:[Og("uniform int uFirstId"),...e?[]:[Og(`${h} varying ${a} vPickingIdOffset`),_g("int mousePickingIdOffset = "+("int"===a?"vPickingIdOffset":"int(floor(vPickingIdOffset + 0.5))"))],Vg("colorFragment =","int remainder = mousePickingIdOffset + uFirstId","int r = remainder / 16777216","remainder -= r * 16777216","int g = remainder / 65536","remainder -= g * 65536","int b = remainder / 256","remainder -= b * 256","int a = remainder","colorFragment = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, float(a) / 255.0)"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd").replace("if (fragColorEnd.a <= 0.0) { discard; }","")]}}}},AttributeHighlight:{idFeature:"AttributeHighlight",apply:t=>({idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",vertexShaderModifiers:[Ng("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",apply:(t,e)=>({idVertex:"StippleTexture",idFragment:"StippleTexture",vertexShaderModifiers:[Og("attribute vec2 aLengthSoFar"),Og("varying float vLengthSoFar"),Og("uniform vec2 uStippleCount"),Gg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Og("uniform sampler2D uStippleTexture"),Og("uniform float uStippleScale"),Og("varying float vLengthSoFar"),"webgl1"===e&&Og("uniform float uStippleTextureWidthLimiter"),Vg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},StippleTextureInstanced:{idFeature:"StippleTextureInstanced",apply:(t,e)=>({idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",vertexShaderModifiers:[Og("attribute vec2 aLengthSoFarA"),Og("attribute vec2 aLengthSoFarB"),Og("varying float vLengthSoFar"),Og("uniform vec2 uStippleCount"),Gg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Og("uniform sampler2D uStippleTexture"),Og("uniform float uStippleScale"),Og("varying float vLengthSoFar"),"webgl1"===e&&Og("uniform float uStippleTextureWidthLimiter"),Vg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},PolarHeatmap:t=>({idFeature:"PolarHeatmap",apply:(e,i)=>{const s="dataType"in t,r="interpolation"in t?t:void 0,n=r?r.flipXY:void 0,o="bilinear"===(null==r?void 0:r.interpolation),h=null==r?void 0:r.intensityTextureType,a=null==r?void 0:r.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${qg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Og("uniform vec2 uViewportSize","uniform vec2 uScale","uniform vec2 uDisp","uniform float uSectors","uniform float uAnnuli","uniform float uAmplitudeStart","uniform float uAmplitudeStep","uniform float uAmplitudeAxisStart","uniform float uAmplitudeAxisEnd","uniform float uAngleOffset","uniform float uAngleDirection",r&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),Yg.texelFetchWithFallback[i],"ubyte"===h&&Yg.decodeUbyteRGBAEncodedFloat,_g("vec2 posWorld = (2.0 * gl_FragCoord.xy / uViewportSize) - 1.0","vec2 posAxis = posWorld * uScale + uDisp","float amplitudeAxisInterval = uAmplitudeAxisEnd - uAmplitudeAxisStart","float amplitude = uAmplitudeAxisStart + sign(amplitudeAxisInterval) * sqrt(posAxis.x * posAxis.x + posAxis.y * posAxis.y)","float iAnnulus = (amplitude - uAmplitudeStart) / uAmplitudeStep"),r&&Vg("iAnnulus","float angRad = atan(posAxis.y, posAxis.x) * uAngleDirection + uAngleOffset","if (angRad < 0.0) { angRad = angRad + 2.0 * 3.1415926538; }","if (angRad > 2.0 * 3.1415926538) { angRad = angRad - 2.0 * 3.1415926538; }","float iSector = uSectors * angRad / (2.0 * 3.1415926538)","vec2 cellIndex = vec2(iSector, iAnnulus)","ivec2 cellStart = ivec2(floor(cellIndex))","ivec2 cellEnd = cellStart + ivec2(1)","if (cellEnd.x >= int(uSectors)) { cellEnd = ivec2(0, cellEnd.y); }",n&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",n&&"cellStart = ivec2(cellStart.y, cellStart.x)",n&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)"),s&&Vg("colorFragment =","colorFragment = uColor"),r&&Vg("cellEnd","vec2 tileDimensions = "+(n?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),o&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",o&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",o&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",o&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",o&&"float intensity00 = "+("float"===h?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${a})`),o&&"float intensity01 = "+("float"===h?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${a})`),o&&"float intensity10 = "+("float"===h?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${a})`),o&&"float intensity11 = "+("float"===h?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${a})`),o&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",o&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",o&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",o&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!o&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!o&&"float intensityP = "+("float"===h?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${a})`)),...r?Hg("intensityP",r.lut):[]]}}})},rm={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","2DMatrix":"\nvoid main(void) {\n gl_Position = posWorld;\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},nm={FragmentShader:"\nuniform float uIsHighlighted;\nuniform vec4 uHighlightColorOffset;\nuniform float uRenderEffectMask;\nvoid main(void) {\n vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0);\n float antiAliasFactor = 1.0;\n vec4 fragColorEnd = colorFragment;\n if (fragColorEnd.a <= 0.0) { discard; }\n fragColorEnd = clamp(fragColorEnd + uIsHighlighted * uHighlightColorOffset, vec4(0.0), vec4(1.0));\n fragColorEnd = mix(fragColorEnd, vec4(1.0), uRenderEffectMask * fragColorEnd.a * 1000.0);\n gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor);\n}\n",Empty:"\nvoid main(void) {\n}\n"};class om{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new Ct(`Could not find ${this.Ez()} ${this.zz()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}Ez(){return this.id.toString()}zz(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class hm extends om{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class am extends om{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class lm{constructor(t,e,i,s){this.Vz=new Map,this.Oz=new Map,this.Nz=i,this.Gz=i.createProgram(),this.Uz=`${t.Ez()} vertex`,this.Wz=`${e.Ez()} fragment`,i.attachShader(this.Gz,t.shader),i.attachShader(this.Gz,e.shader),i.bindAttribLocation(this.Gz,0,"aPos"),i.linkProgram(this.Gz),i.deleteShader(t.shader),i.deleteShader(e.shader),this.allAttributeNames=t.info.allAttributeNames,this.allUniformNames=Array.from(new Set(t.info.allUniformNames.concat(e.info.allUniformNames)).values()),this.vertexSharedRemovedVariables=t.info.removedVariableNames,this.fragmentSharedRemovedVariables=e.info.removedVariableNames}get vertexShaderSrc(){return""}get fragmentShaderSrc(){return""}Yz(t){return Me(0,(()=>Ce()))}$z(t){const e=this.Xz(t);if(void 0===e)throw this.Yz(`Could not get ${t} uniform from ${this.Uz} and ${this.Wz} shaders.`);return e}Xz(t){const e=this.Vz.get(t);if(e)return e;const i=this.Nz.getUniformLocation(this.Gz,t);return i?(this.Vz.set(t,i),i):void 0}jz(t){const e=this.Zz(t);if(void 0===e)throw this.Yz(`Could not get ${t} attribute from ${this.Uz} and ${this.Wz} shaders.`);return e}Zz(t){const e=this.Oz.get(t);if(e||0===e)return e;const i=this.Nz.getAttribLocation(this.Gz,t);return i>=0?(this.Oz.set(t,i),i):void 0}Y(){this.Nz.deleteProgram(this.Gz)}}const um=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,cm=t=>{let e;try{e=zt.getComputedStyle(t)}catch(t){return null}return e};function dm(t){const e=cm(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=cm(ym(t)),i=e?e.display:"auto";return"flex"===i||"inline-flex"===i}(t))||+e.opacity<1||"transform"in e&&"none"!==e.transform||"webkitTransform"in e&&"none"!==e.webkitTransform||"mixBlendMode"in e&&"normal"!==e.mixBlendMode||"filter"in e&&"none"!==e.filter||"webkitFilter"in e&&"none"!==e.webkitFilter||"isolation"in e&&"isolate"===e.isolation||!!um.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function fm(t){let e=t.length;for(;e--;)if(dm(t[e]))return t[e];return null}function gm(t){var e;return t&&Number((null===(e=cm(t))||void 0===e?void 0:e.zIndex)||0)||0}function mm(t){const e=[];for(;t;)e.push(t),t=ym(t);return e}function ym(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}const pm=t=>t&&"resize"in t;class Am extends xg{constructor(t){if(super(),this.Qz=new Map,this.Jz=new Map,this.Kz=new Map,this.qz=!0,this.tV=null,this.iV=null,this.sV=null,this.eV=null,this.hV=0,this.rV=0,this.nV=0,this.oV=!1,this.aV=!0,this.ji=!1,this.lV=xe(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.Z={x:100,y:100},this.uV=()=>{this.cV&&clearTimeout(this.cV),this.cV=setTimeout((()=>this.an()),12)},this.dV=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.Qz.get(i);if(t){const s=t.fV();t.AV(e),e?this.Jz.set(i,t):this.Jz.delete(i),s!==e&&t.Ms()}}},this.gV=(t,e,i,s,r)=>{const n=r[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.iV.Gz),o.clear(o.COLOR_BUFFER_BIT),n.qr.getBoundingClientRect()){const t=n.pV();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.yV),o.uniform1i(this.hV,0),o.uniformMatrix4fv(this.rV,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.sV),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.nV,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.mV&&(n.mV.clearRect(0,0,n.mV.canvas.width,n.mV.canvas.height),n.mV.drawImage(this.vV,0,this.vV.height-t.y,t.x,t.y,0,0,n.mV.canvas.width,n.mV.canvas.height))}},this.SV=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.iV.Gz),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.qr.getBoundingClientRect();if(r){const i=r.right-r.left,o=r.bottom-r.top,h=r.left,a=s-r.bottom;n.viewport(h*this.xV-t*this.xV,a*this.xV+e*this.xV,i*this.xV,o*this.xV)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.yV),n.uniform1i(this.hV,0),n.uniformMatrix4fv(this.rV,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.sV),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.nV,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.bV=(t,e,i,s,r)=>{const n=r[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const h=n.pV();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.MV[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.vV.height-h.y,h.x,this.vV.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.mV&&(n.mV.clearRect(0,0,n.mV.canvas.width,n.mV.canvas.height),n.mV.drawImage(this.vV,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this._V=(t,e,i,s,r)=>{const n=this.gl2.ctx;n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.qr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.pV();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.MV[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.xV-t*this.xV,l*this.xV+e*this.xV,(a-t+o)*this.xV,(l+e+h)*this.xV,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.cV=void 0,this.io=t,!zt.requestAnimationFrame||!zt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.wV)e=!0===t.wV?zt.devicePixelRatio||1:t.wV||1;else{const t=zt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=zt.devicePixelRatio||1)}this.xV=e,t.eo=!0===t.eo,this.aV=!1!==t.CV,this.kV=!1!==t.TV,this.FV=t.FV||!1;let i=!1;if(t.vV)if("string"==typeof t.vV){const e=zt.document.getElementById(t.vV);if(!e)throw new Error(`Canvas "${t.vV}" doesn't exist.`);this.vV=e,i=!0}else this.vV=t.vV,i=!0;else this.vV=zt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.IV&&t.IV){const e=this.vV.getContext("webgl",{...s,antialias:!!t.CV})||this.vV.getContext("experimental-webgl",{...s,antialias:!!t.CV});this.gl=e,this.PV=!1}else{const t=this.vV.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.PV=!0}if(!this.gl)throw new Mt("No WebGL context available."+((null==t?void 0:t.IV)?`\nSelected explicit target: WebGL ${t.IV}`:""));const r=[];if(this.DV={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.DV).forEach((t=>{null===this.DV[t]&&r.push(t)})),this.PV)this.BV=!0;else{const t={ANGLE_instanced_arrays:this.gl.getExtension("ANGLE_instanced_arrays"),EXT_blend_minmax:this.gl.getExtension("EXT_blend_minmax"),OES_element_index_uint:this.gl.getExtension("OES_element_index_uint"),OES_standard_derivatives:this.gl.getExtension("OES_standard_derivatives"),OES_vertex_array_object:this.gl.getExtension("OES_vertex_array_object")};t.OES_standard_derivatives||(this.qz=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.BV=!!e.OES_texture_float,this.gl1={ctx:this.gl,DV:t,optional:e}}const n=r;if(n.length>0&&!1!==t.eo){const t=zt.document.createElement("div");t.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",t.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";const e=zt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),zt.document.body.appendChild(t),t.appendChild(e),zt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.LV=this.FV?this.RV(this.PV?this.bV.bind(this):this.gV.bind(this)).bind(this):this.EV(this.PV?this._V.bind(this):this.SV.bind(this)).bind(this),zt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.vV&&this.zV()};this.oo=new zt.ResizeObserver(t.bind(this)),this.oo.observe(this.vV)}if(this.VV=((t,e)=>{const i=t,s=new Map,r=new Map,n=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},h=(t,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(t.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(t.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(t.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(e){const e=t.match(/#extension.*/g);e&&n.push(...e),t=t.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");const e=s.find((t=>"fragOutput"===t.type));t=(t=e?`out ${e.fragOutput} fragOutput;\n${t}`:`out vec4 fragOutput;\n${t}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:t=`${r.join("\n")}\n${t}`,info:o}};return(...t)=>{const a=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,y,p;try{const e=zt.performance.now();l=t.filter((t=>!1!==t&&void 0!==t)),u=((t,e)=>{const i=t.map((i=>i.apply(t,e))),s=i.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),r=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),n=`vert: ${s} frag: ${r}`;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(h||(o=t.defaultVertexShader)),t.vertexShader){if(o&&h&&o!==t.vertexShader)throw new Zg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,n,t);o=t.vertexShader,h=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(a||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&a&&u!==t.fragmentShader)throw new Zg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,n,t);u=t.fragmentShader,a=!0}if(t.fragmentShaderModifiers)for(const e of t.fragmentShaderModifiers)void 0!==e&&!1!==e&&c.push(e);t.hints&&t.hints.forEach((t=>{t&&d.push(t)}))})),!!t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Lz}))&&("webgl1"===e?l.push(Og("attribute float aInstanceID"),_g("int iInstance = int(aInstanceID)")):l.push(_g("int iInstance = gl_InstanceID"))),!!t.find((t=>{var e;return null===(e=t.Fz)||void 0===e?void 0:e.Rz}))&&("webgl1"===e?l.push(Og("attribute float aVertexID"),_g("int iVertex = int(aVertexID)")):l.push(_g("int iVertex = gl_VertexID"))),!o)throw new Zg("No vertex shader template defined",n);if(!u)throw new Zg("Fragment shader not defined",n);return{id:n,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:r,template:u,modifiers:c},hints:d}})(l,a);const A=n.get(u.id);if(c="new",A)return c="existing",g=A.vertexShaderSrc,m=A.fragmentShaderSrc,A;const x=u.vertexShader.id;let S=s.get(x);if(S)g=S.src,d="existing";else{d="new";const t=new Rg(u.vertexShader.modifiers).build(rm[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,y=r,S=new hm(x,e,i,r),s.set(x,S),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)m=b.src,f="existing";else{f="new";const t=nm[v.template],e=new Rg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);m=s,p=n,b=new am(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const C=new lm(S,b,i,u);return n.set(u.id,C),o.programs+=1,o.totalMs+=zt.performance.now()-e,C}catch(t){throw Me(0,(()=>{const t="Unexpected LightningChart JS rendering error.\nThis can mean a bug in the library, or that it is simply used in unsupported manner (passing wrong type to method, using disposed component, etc).";return zt.alert(t),new Error(t)}))}}})(this.gl,!this.PV),this.Cz=(()=>{const t=zt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new Mt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,r,n)=>{const o=`${s.style} ${s.weight} ${s.size*r}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const h=e.measureText(i);if(0===h.width)return;const a=void 0!==h.actualBoundingBoxLeft&&void 0!==h.actualBoundingBoxRight?Math.ceil(h.actualBoundingBoxLeft+h.actualBoundingBoxRight):Math.ceil(h.width),l=h.width,c=Math.round(s.size*r),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",n?(e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff"):(e.fillStyle="rgba(255,255,255,0)",e.fillRect(0,0,t.width,t.height),e.fillStyle="#000"),e.fillText(i,d,c);const f=e.getImageData(0,0,t.width,t.height);let g=0,m=0;const y=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),zt.addEventListener("resize",this.uV,{passive:!0}),!this.PV){if(this.iV=this.VV(sm["2DCompose"],sm.Color({dataType:"texture-coord-calc-gpu"}),sm.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.iV.Gz)throw new Mt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.iV.Gz,"uColorTexture");if(!e)throw new Mt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.iV.Gz,"uMatrix");if(!i)throw new Mt("Unable to setup composition shader! Failed to find uMatrix");this.hV=e,this.rV=i,this.nV=t.getAttribLocation(this.iV.Gz,"aPos"),this.sV=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.sV),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this.eV=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.eV),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,0,0,1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null)}}RV(t){return e=>{this.tV=null;const i=this.gl.canvas,s=Array.from(this.Jz.values());this.oV=!1,s.forEach((s=>{const r=s.pV();(this.Z.x{this.tV=null,"style"in this.gl.canvas&&!this.io.WV&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.vV.clientHeight,r=this.vV.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.xV&&i.height===s*this.xV||(i.width=r*this.xV,i.height=s*this.xV);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.Jz.values());this.oV=!1,h.sort(((t,e)=>t.YV()-e.YV())).forEach((t=>{t.pn&&t.UV(e)})),t(n,o,r,s,h),this.oV&&this.zV()}}zV(t){return pm(this.gl)||(!this.oV&&t&&(this.oV=!0),this.tV||this.ji||(this.tV=zt.requestAnimationFrame(this.LV))),this}HV(t){const e=this.lV();return t.qr.setAttribute("data-lcjs-engine-id",e),this.Qz.set(e,t),t.$V(this.Qz.size-1),t.AV(!0),this.Jz.set(e,t),this.GV&&this.GV.observe(t.qr),this.cV&&clearTimeout(this.cV),this.cV=setTimeout((()=>this.an()),0),this}XV(t){const e=t.qr.getAttribute("data-lcjs-engine-id");return e?(this.Qz.delete(e),this.Jz.delete(e),this.GV&&this.GV.unobserve(t.qr),t.qr.removeAttribute("data-lcjs-engine-id"),this):this}an(){if(this.GV){const t=this.GV.takeRecords();for(let e=0;efunction(t,e){if(t===e)return 0;const i={a:mm(t),b:mm(e)};let s;for(;i.a[i.a.length-1]===i.b[i.b.length-1];)t=i.a.pop(),e=i.b.pop(),s=t;const r=gm(fm(i.a)),n=gm(fm(i.b));if(r===n&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let r=t.length;for(;r--;){const i=t[r];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(r-n)}(t.qr,e.qr))).forEach(((t,e)=>t.$V(e))),this.zV(!0),this}UI(){return this.zV(),this}jV(){this.ji||this.Qz.forEach((t=>t.vp.layout()))}Y(){var t;if(this.ji)return;this.ji=!0,super.Y(),this.tV&&(zt.cancelAnimationFrame(this.tV),this.tV=null),this.oV=!1,this.oo&&(this.oo.disconnect(),this.oo=void 0),this.GV&&(this.GV.disconnect(),this.GV=void 0),zt.removeEventListener("resize",this.uV),this.uV=void 0,this.Qz.forEach((t=>{t.Y()})),this.Qz.clear(),Array.from(this.Kz.values()).forEach((t=>{t.dz(!0)})),this.Kz.clear();const e=this.gl;e.deleteBuffer(this.sV),e.deleteBuffer(this.eV),this.vV&&!this.io.vV?(this.vV.width=1,this.vV.height=1,null===(t=this.vV.parentElement)||void 0===t||t.removeChild(this.vV),this.vV=void 0):this.vV=void 0,this.VV=void 0,this.Cz=void 0,this.LV=()=>{},this.DV.WEBGL_lose_context&&this.DV.WEBGL_lose_context.loseContext()}}const xm=(t,e,i,s)=>r=>{const n={theme:ng,...i,...r},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new gg(o.io,r,o,o.Y.bind(o),h);return o.bo((t=>a.WE(t))).xo((()=>a.J())).Ms(),a},Sm=(t,e)=>{t.bo((t=>{e.ze(t)})).xo((()=>e.J())).Ms()},vm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new ca(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h);return Sm(o,a),a},bm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Dc(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Mm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Pd(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Cm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new jc(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Tm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new(r&&r.type?r.type:Ka)(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},wm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Uf(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Em=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new(r&&r.type?r.type:nd)(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},km=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new(r&&r.type?r.type:Ad)(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Im=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Hl(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r,void 0);return Sm(o,a),a},zm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Dl(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Fm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new hf(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0);return Sm(o,a),a},Rm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Af(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0,r);return Sm(o,a),a},Dm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Vc(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Pm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e||s?yg(o,s,null==i?void 0:i.licenseInformation):void 0,a=new Gf(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,r);return Sm(o,a),a},Om=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ng},o=t(n),h=e?yg(o,s):void 0,a=new lg(o.io,Ld(o,1).tI(0),gt,o.Y.bind(o),h,void 0);return Sm(o,a),a},Lm={translation:(t,e,i)=>[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1],xRotation(t){const e=Math.cos(t),i=Math.sin(t);return[1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1]},yRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1]},zRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1]},scaling:(t,e,i)=>[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1],translate:(t,e,i,s)=>Lm.multiply(t,Lm.translation(e,i,s)),xRotate:(t,e)=>Lm.multiply(t,Lm.xRotation(e)),yRotate:(t,e)=>Lm.multiply(t,Lm.yRotation(e)),zRotate:(t,e)=>Lm.multiply(t,Lm.zRotation(e)),rotateXYZ(t,e){let i=Lm.xRotate(t,e.x);return i=Lm.yRotate(i,e.y),i=Lm.zRotate(i,e.z),i},scale:(t,e,i,s)=>Lm.multiply(t,Lm.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],p=e[15],A=t[0],x=t[1],S=t[2],v=t[3],b=t[4],M=t[5],C=t[6],T=t[7],w=t[8],E=t[9],k=t[10],I=t[11],z=t[12],F=t[13],R=t[14],D=t[15],P=[];return P[0]=i*A+s*b+r*w+n*z,P[1]=i*x+s*M+r*E+n*F,P[2]=i*S+s*C+r*k+n*R,P[3]=i*v+s*T+r*I+n*D,P[4]=o*A+h*b+a*w+l*z,P[5]=o*x+h*M+a*E+l*F,P[6]=o*S+h*C+a*k+l*R,P[7]=o*v+h*T+a*I+l*D,P[8]=u*A+c*b+d*w+f*z,P[9]=u*x+c*M+d*E+f*F,P[10]=u*S+c*C+d*k+f*R,P[11]=u*v+c*T+d*I+f*D,P[12]=g*A+m*b+y*w+p*z,P[13]=g*x+m*M+y*E+p*F,P[14]=g*S+m*C+y*k+p*R,P[15]=g*v+m*T+y*I+p*D,P},inverse(t){const e=[],i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],y=t[14],p=t[15],A=d*p,x=y*f,S=a*p,v=y*l,b=a*f,M=d*l,C=r*p,T=y*n,w=r*f,E=d*n,k=r*l,I=a*n,z=u*m,F=g*c,R=o*m,D=g*h,P=o*c,O=u*h,L=i*m,_=g*s,B=i*c,V=u*s,G=i*h,N=o*s,U=A*h+v*c+b*m-(x*h+S*c+M*m),Y=x*s+C*c+E*m-(A*s+T*c+w*m),H=S*s+T*h+k*m-(v*s+C*h+I*m),X=M*s+w*h+I*c-(b*s+E*h+k*c),W=1/(i*U+o*Y+u*H+g*X);return e[0]=W*U,e[1]=W*Y,e[2]=W*H,e[3]=W*X,e[4]=W*(x*o+S*u+M*g-(A*o+v*u+b*g)),e[5]=W*(A*i+T*u+w*g-(x*i+C*u+E*g)),e[6]=W*(v*i+C*o+I*g-(S*i+T*o+k*g)),e[7]=W*(b*i+E*o+k*u-(M*i+w*o+I*u)),e[8]=W*(z*l+D*f+P*p-(F*l+R*f+O*p)),e[9]=W*(F*n+L*f+V*p-(z*n+_*f+B*p)),e[10]=W*(R*n+_*l+G*p-(D*n+L*l+N*p)),e[11]=W*(O*n+B*l+N*f-(P*n+V*l+G*f)),e[12]=W*(R*d+O*y+F*a-(P*y+z*a+D*d)),e[13]=W*(B*y+z*r+_*d-(L*d+V*y+F*r)),e[14]=W*(L*a+N*y+D*r-(G*y+R*r+_*a)),e[15]=W*(G*d+P*r+V*a-(B*a+N*d+O*r)),e},projectionPerspective(t,e,i,s){const r=1/Math.tan(t*Math.PI/180/2),n=1/(i-s);return[r/e,0,0,0,0,r,0,0,0,0,(i+s)*n,-1,0,0,i*s*n*2,0]},projectionOrthographic:(t,e,i,s,r,n)=>[2/(e-t),0,0,0,0,2/(s-i),0,0,0,0,2/(r-n),0,(t+e)/(t-e),(i+s)/(i-s),(r+n)/(r-n),1],quaternionToRotationMatrix(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]),i=[t[0]/e,t[1]/e,t[2]/e,t[3]/e],s=i[0]+i[0],r=i[1]+i[1],n=i[2]+i[2],o=i[0]*s,h=i[0]*r,a=i[0]*n,l=i[1]*r,u=i[1]*n,c=i[2]*n,d=i[3]*s,f=i[3]*r,g=i[3]*n;return[1-(l+c),h-g,a+f,0,h+g,1-(o+c),u-d,0,a-f,u+d,1-(o+l),0,0,0,0,1]}};function _m(t,i,s,r,n,o){let h=i.x.ft(t.max.x),a=i.x.ft(t.min.x),l=i.y.ft(t.max.y),u=i.y.ft(t.min.y),c=h-a,d=l-u;if(c<1){const t=(a+h)/2;a=t-.5,h=t+.5,c=1}if(d<1){const t=(u+l)/2;u=t-.5,l=t+.5,d=1}const f=c/d,g=c*s.x,m=d*s.y,y=c-g,p=d-m,A=g>y?[y,g]:[g,y],x=m>p?[p,m]:[m,p];let S,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(S=A[0]/c,v=x[0]/d,n===e.GradientShape.circle){const t=Math.min(S*f,v);b=t,M=t}else b=S*f,M=v;break;case e.GradientExtent.farthestSide:if(S=A[1]/c,v=x[1]/d,n===e.GradientShape.circle){const t=Math.max(S*f,v);b=t,M=t}else b=S*f,M=v;break;case e.GradientExtent.closestCorner:if(v=x[0]/d,n===e.GradientShape.circle){S=A[0]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=A[0]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=x[1]/d,n===e.GradientShape.circle){S=A[1]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=A[1]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(b,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Bm(t,e,i,s){const r=e.x.ft(t.max.x),n=e.x.ft(t.min.x),o=e.y.ft(t.max.y),h=e.y.ft(t.min.y),a=r-n,l=o-h,c=Math.abs(a*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(a/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(a/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[n*s,h*s,a*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class Vm{constructor(t){this.lz=t}}class Gm{constructor(){this.ZV=new Array,this.QV=t=>(this.ZV.push(t),t),this.JV=this.QV(new Map),this.KV=this.QV(new Map),this.qV=this.QV(new Map),this.tO=this.QV(new Map),this.iO=this.QV(new Map),this.sO=this.QV(new Map),this.eO=this.QV(new Map),this.hO=this.QV(new Map)}rO(){this.ZV.forEach((t=>{t.forEach((t=>t.rO())),t.clear()}))}}const Nm=(t,e,i)=>()=>{t.nO=e,i&&i()},Um=(t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,y=1;switch(n){case e.ImageFitMode.Fill:u{this.cO=!0,this.pO()})),this.yc.addEventListener("error",(()=>{this.dO=!0})),this.yc.complete&&(this.cO=!0,this.pO());else if(this.yc instanceof zt.HTMLVideoElement){const t=this;this.yc.addEventListener("canplay",(function(){t.aO=this.videoHeight,t.oO=this.videoWidth,t.cO=!0,t.pO()}),!0),this.yc.addEventListener("play",Nm(this,!0,(()=>this.pO()))),this.yc.addEventListener("playing",Nm(this,!0,(()=>this.pO()))),this.yc.addEventListener("pause",Nm(this,!1)),this.yc.addEventListener("ended",Nm(this,!1)),this.yc.readyState>=1&&(this.oO=this.yc.videoWidth,this.aO=this.yc.videoHeight,this.nO=!this.yc.paused,this.cO=!0,this.pO())}else this.cO=!0,this.pO()}bz(t){0===this.AO.size&&this.cO&&this.pO(),this.AO.add(t)}Mz(t){this.AO.delete(t),0===this.AO.size&&this.unbindResources()}yO(t){this.fO.add(t),this.uO&&(t(),this.mO(t))}mO(t){this.fO.delete(t)}pO(){if(this.dO||this.uO||!this.cO)return;const t=this.Nz.gl;if(!this.gO&&this.yc&&t){this.gO=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.gO),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.yc,o=this.oO>0?this.oO:n.width,h=this.aO>0?this.aO:n.height;t.texImage2D(t.TEXTURE_2D,e,i,s,r,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.oO=o,this.aO=h,t.bindTexture(t.TEXTURE_2D,null)}this.uO=!0,this.fO&&this.fO.forEach((t=>{t(),this.mO(t)}))}Os(){const t=this.Nz.gl;if(!this.dO&&this.uO&&this.gO){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.yc;n&&(t.bindTexture(t.TEXTURE_2D,this.gO),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}vO(){return this.gO}unbindResources(){return this.uO&&(this.gO&&(this.Nz.fz(this.gO),this.gO=null),this.uO=!1),this}}class Hm extends hn{constructor(t,e,i){super(t.cs,e,i),this.mv=!0,this.uv={},this.gv=p(oo),this.Rs=t,this.At=t.At}SO(){var t;return this.gv.u&&this.gv.C().type!==(null===(t=this.xO)||void 0===t?void 0:t.type)}wv(t){return this.mv=t,this}bO(t){return this.uv=t,this}}class Xm{constructor(t){this.ZO=[],this.lz=t}QO(t,e){((t,e,i,s)=>{const r=t.MO(),n=Math.round(Math.min(i.spread,10)*r),o=Math.round(Math.min(i.blur,10)*r),h={x:Math.round(i.offset.x*r),y:Math.round(i.offset.y*r)},a=t._O(),l=t.wO(),u=t.CO(),c=t.kO(),d=t.TO();t.FO("disabled"),t.wv(!1),t.IO(!1);const f=e.PO(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.MO(),o=t.DO();t.BO(r.FRAMEBUFFER,s.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,s.depthBuffer),r.bindTexture(r.TEXTURE_2D,s.texture),r.clearDepth(1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);const h=s.sizeDpr;t.LO(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof ln?s=e.Yi||e.Rs.Op():e instanceof Hm&&(s=e.Rs._x()),s){const e=s.x+i.left,r=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),h=Math.max(s.height-(i.bottom+i.top),0);t.RO(e*n,r*n,o*n,h*n)}else t.IO(!1);e.WE(2,0)})),t.BO(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.IO(!1)})(t,s,{left:g+(h.x<0?-h.x:0),top:g+(h.y>0?h.y:0),right:g+(h.x>0?h.x:0),bottom:g+(h.y<0?-h.y:0)},f);let m=f;const y=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;i$e(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=hi(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof ln||t instanceof Hm?t.Rs.EO(t):Xe;if(Te(e))return Xe;const r={min:{x:Math.max(e.min.x-i.left,0),y:Math.max(e.min.y-i.bottom,0)},max:{x:Math.min(e.max.x+i.right,s.x),y:Math.min(e.max.y+i.top,s.y)}};return r.max.x<=r.min.x||r.max.y<=r.min.y?Xe:r})).filter((t=>!Te(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=xi(t.min,s),i=xi(t.max,s),r=e,n=i;o[h+0]=e.x,o[h+1]=e.y,o[h+2]=r.x,o[h+3]=r.y,o[h+4]=i.x,o[h+5]=e.y,o[h+6]=n.x,o[h+7]=r.y,o[h+8]=i.x,o[h+9]=i.y,o[h+10]=n.x,o[h+11]=n.y,o[h+12]=i.x,o[h+13]=i.y,o[h+14]=n.x,o[h+15]=n.y,o[h+16]=e.x,o[h+17]=i.y,o[h+18]=r.x,o[h+19]=n.y,o[h+20]=e.x,o[h+21]=e.y,o[h+22]=r.x,o[h+23]=r.y,h+=24})),{vertexBuffer:t.zO(o),vertexCount:n}})(t,s,{left:y+(h.x<0?-h.x:0),top:y+(h.y>0?h.y:0),right:y+(h.x>0?h.x:0),bottom:y+(h.y<0?-h.y:0)},e.VO()),A=e.PO(f,m),x=t.VV(sm["2D"],sm.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl,h=t.DO();t.BO(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearDepth(1),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.LO(0,0,i.sizeDpr.x,i.sizeDpr.y),t.OO(s,((h,a,l,u)=>(t.bz(s),n&&n(h),t.WO(h("uIsHighlighted"),0).iL(h("uHighlightColorOffset"),k).WO(h("uRenderEffectMask"),0).UO(h("uTexture"),e.texture,0).GO(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GO(h("uScale"),i.uniforms.YO()).GO(h("uDisp"),i.uniforms.HO()).GO(h("uScaling"),[i.size.x,i.size.y]).GO(h("uTranslationAxis"),[0,0]).NO(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).om(o.TRIANGLES,r.vertexCount,0),!0))),t.BO(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,A,x,p,((e,i,s,r)=>(t.GO(e("uOffsetPx"),[h.x,h.y]),!0))),m=A,t.IO(l),t.$O(d);const S=t.VV(sm["2D"],sm.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r)=>{const n=t.gl,o={x:t.cs.oi().x,y:t.cs.oi().y};t.LO(0,0,o.x*t.MO(),o.y*t.MO());const h=gt.d2({scaleXYConstructor:Yi}).it(o).Vi(0,o.x).Oi(0,o.y),a=new $m;a.XO(h),t.OO(i,((h,l,u,c)=>(t.bz(i),r&&r(h),t.WO(h("uIsHighlighted"),0).iL(h("uHighlightColorOffset"),k).WO(h("uRenderEffectMask"),0).UO(h("uTexture"),e.texture,0).GO(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GO(h("uScale"),a.YO()).GO(h("uDisp"),a.HO()).GO(h("uScaling"),[o.x,o.y]).GO(h("uTranslationAxis"),[0,0]).NO(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).om(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.UO(e("uTextureFirstGlowPass"),A.texture,1).iL(e("uGlowColor"),i.color),!0))),t.LO(a.x,a.y,a.width,a.height),t.FO(u),t.wv(c),t.jO(p.vertexBuffer)})(this.lz,this,e,t)}VO(){const t=this.lz.cs.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}PO(...t){const e=this.ZO,i=this.VO(),s={x:Math.ceil(i.x*this.lz.MO()),y:Math.ceil(i.y*this.lz.MO())},r=this.lz.gl,n=e.find((e=>!t.includes(e)));if(n)return n.sizeDpr.x===s.x&&n.sizeDpr.y===s.y||(n.size=i,n.sizeDpr=s,r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindRenderbuffer(r.RENDERBUFFER,n.depthBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),n.scale.it(i).Vi(0,i.x).Oi(0,i.y),n.uniforms.XO(n.scale)),n;const o=r.createTexture(),h=this.lz.JO(),a=this.lz.KO();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.lz.DO();this.lz.BO(r.FRAMEBUFFER,h),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0),r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a),r.bindTexture(r.TEXTURE_2D,null),this.lz.BO(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=gt.d2({scaleXYConstructor:Yi}).it(i).Vi(0,i.x).Oi(0,i.y),c=new $m;c.XO(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}Y(){[this.ZO].forEach((t=>{t.forEach((t=>{this.lz.qO(t.depthBuffer),this.lz.tN(t.frameBuffer),this.lz.fz(t.texture)})),t.length=0}))}}class Wm{constructor(t,i,s,r,n=!0){this.iN=new Gm,this.sN=new Map,this.eN=new Map,this.hN=[],this.wV=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(zt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.mv=!1,this.GO=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.rN=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.nN=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.oN=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.aN=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.lN=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.iL=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.WO=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.uN=(t,e)=>(this.gl.uniform1i(t,e),this),this.UO=(t,e,i)=>{if(void 0===t)return this;if(e){const s=this.gl.TEXTURE0+i;return this.gl.activeTexture(s),this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.uniform1i(t,i),this}throw new Mt("Could not bind a texture.")},this.cN=t=>(((t,i)=>{i===e.ImageFitMode.Tile?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE))})(this.gl,t),this),this.zO=(t,e=!1,i,s=Float32Array)=>{const r=t.length,n=this.dN(r,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof s?t:new s(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new Mt("Could not create vertex buffer")},this.fN=(t,e,i,s=Float32Array)=>{const r=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),e&&e.length===t?this.gl.bufferData(this.gl.ARRAY_BUFFER,e instanceof s?e:new s(e),this.gl.STATIC_DRAW):(this.gl.bufferData(this.gl.ARRAY_BUFFER,new s(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof s?e:new s(e))),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new Mt("Could not create vertex buffer")},this.AN=(t,e,i,s=Float32Array)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*s.BYTES_PER_ELEMENT,i instanceof s?i:new s(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.gN=(t,e,i,s,r)=>{if(s&&t&&(t.usedSize=0),!t){const t=e.length+i,s=new r(t);return s.set(e),{buffer:this.fN(t,s,void 0,r),dataCache:s,preallocSize:t,usedSize:e.length}}if(t.usedSize+e.length>t.preallocSize){const s=t.usedSize+e.length+i,n=new r(s);return n.set(t.dataCache),n.set(e,t.usedSize),{buffer:this.fN(s,n,t.buffer,r),dataCache:n,preallocSize:s,usedSize:t.usedSize+e.length}}return t.dataCache.set(e,t.usedSize),this.AN(t.buffer,t.usedSize,e,r),t.usedSize+=e.length,t},this.pN=(t,e,i=!1)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,i?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.yN=(t,e)=>{const i=t.length,s=this.dN(i,e);if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new Mt("Could not create index buffer")},this.mN=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new Mt("Could not create float buffer")},this.vN=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,2,this.gl.FLOAT,!1,0,0)),this),this.SN=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,3,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t)),this),this.NO=(t,e,...i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);const s=i.length;let r=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let n=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),n+=e.size}if(void 0!==e)for(let t=0;t-1&&this.xN(s,e)}return this},this.bN=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.MN=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,0,0)),this),this._N=(t,e,i)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t),void 0!==i&&this.xN(t,i)),this),this.wN=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.CN=null,this.om=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.kN=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.TN=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.DV.ANGLE_instanced_arrays)return zt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.DV.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.FN=(t,e,i,s,r=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,r,i,s),this.gl1)){if(!this.gl1.DV.ANGLE_instanced_arrays)return zt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.DV.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.xN=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.DV.ANGLE_instanced_arrays)return zt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.DV.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.IN=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=this.DO();this.BO(this.gl.FRAMEBUFFER,e),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,i,0);const o=this.wO();o&&this.IO(!1),t(),o&&this.IO(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.BO(this.gl.FRAMEBUFFER,n)},this.Ot=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.PN=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.bz=t=>(this.gl.useProgram(t.Gz),this),this.DN=!1,this.LN=[],this.cs=t,this.CA=i,this.cs=t,this.gl=s.ctx,this.RN=s.antialias,this.EN=!!this.cs.ln.qz&&s.lineAntialias,this.BV=this.cs.ln.BV,this.zN=new Map,this.gl1=this.cs.ln.gl1,this.gl2=this.cs.ln.gl2,n&&(this.$O(!0),this.VN()),this.DV=this.cs.ln.DV,this.cz=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.yz=this.ON(),this.VV=this.cs.ln.VV,this.NN=new qm(this),this.Cz=this.cs.ln.Cz,this.GN=new Xm(this),this.Kz=this.cs.ln.Kz,this.UN=this.zO([0,0,1,0,1,1,0,1]),this.WN=this.zO([0,0,1,0,0,1,0,1,1,0,1,1])}FO(t){return t!==this.YN&&(this.YN=t,"disabled"===t?this.gl.disable(this.gl.CULL_FACE):"cull-back"===t?(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)):"cull-front"===t&&(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.FRONT))),this}CO(){return this.YN||"disabled"}wv(t){return t!==this.mv&&(this.mv=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}kO(){return this.mv}HN(t){return this.wV=t,this}MO(){return this.wV}dN(t,e){let i;if(e){const s=this.zN.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.jO(e)}return i||(i=this.gl.createBuffer(),this.zN.set(i,{size:t})),i}$N(t,e=this.gl.RGBA,i=!1,s,r,n=!1,o=this.gl.UNSIGNED_BYTE,h=e){const a=this.gl.createTexture();if(!a)throw new Mt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),t&&null===r?this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,e,o,t):r&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,r.x,r.y,0,e,o,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),i?(this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR),this.gl.generateMipmap(this.gl.TEXTURE_2D)):this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),a}fz(t){this.gl.deleteTexture(t)}JO(){const t=this.gl.createFramebuffer();if(!t)throw new Mt("Couldn't reserve Framebuffer.");return t}BO(t,e){this.CN=e,this.gl.bindFramebuffer(t,e)}DO(){return this.CN}tN(t){this.gl.deleteFramebuffer(t)}KO(){const t=this.gl.createRenderbuffer();if(!t)throw new Mt("Couldn't reserve Render buffer.");return t}qO(t){this.gl.deleteRenderbuffer(t)}LO(t,e,i,s){return this.gl.viewport(t,e,i,s),this.XN&&t===this.XN.x&&e===this.XN.y&&i===this.XN.width&&s===this.XN.height||(this.XN={x:t,y:e,width:i,height:s}),this}_O(){return this.XN||{x:0,y:0,width:0,height:0}}RO(t,e,i,s){return this.IO(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}IO(t){return t===this.jN||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.jN=t),this}$O(t){return t!==this.DN&&(this.DN=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}TO(){return this.DN}VN(t,e,i,s){return t?(void 0!==t&&void 0!==e&&(void 0!==i&&void 0!==s?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e)),this):(this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA),this)}wO(){return void 0!==this.jN&&this.jN}OO(t,e){const i=new Km(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}jO(t){t&&(this.gl.deleteBuffer(t),this.zN.delete(t))}ZN(t,e,i){this.GO(t.uniform("uCenter"),e.center).GO(t.uniform("uDistance"),e.distance).nN(t.uniform("uBounds"),e.bounds).WO(t.uniform("uAspect"),e.aspectRatio);const s=i.getColorStops();if(s.length<2)throw new Error("Minimum two color stops required");for(let e=0;e=t)return this.sG.buffer;this.sG&&(this.jO(this.sG.buffer),this.sG=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.LN.splice(this.LN.indexOf(l),1)}))}aG(t,e,i,s,r,n,o,h){const a=this.gl,l=this.DO();this.BO(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.BO(this.gl.FRAMEBUFFER,l)}lG(t){const e=this.eN.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new Mt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let r=255;for(let e=0;e{t-=1;for(let e=1;e<32;e<<=1)t|=t>>1;return t+1})(s.length);for(let e=s.length;e{})),this;this.WO(s("uMinValue"),i.min),this.WO(s("uMaxValue"),i.max)}return this}AG(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.yc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.zO(o(t.texture.oO,t.texture.aO,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.Mz(t),this.jO(i.texCoordsBuffer));const r=this.JN(h);r.bz(t);const n=s?s.getSourceMissingColor():Gs.color;e={texture:r,source:h,texCoordsBuffer:this.zO([]),sourceMissingTexture:this.$N(new Uint8Array([n.getR(),n.getG(),n.getB(),n.getA()]),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{e&&h&&(l(e),this.cs.Ms())}},r.yO(e.textureReadyCallback),l(e)}return e&&e.texture.uO&&e.texture.lO&&e.texture.nO&&(e.texture.Os(),this.cs.Ms()),n&&e&&e.texture.uO&&l(e),e}i&&this.gG(t,i)}gG(t,e){e&&(e.texture.Mz(t),e.texture.mO(e.textureReadyCallback),this.fz(e.sourceMissingTexture),this.jO(e.texCoordsBuffer))}pG(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.At,a=this.MO();this.WO(r("uIsHighlighted"),1===e||2===e?0:i.jo).iL(r("uHighlightColorOffset"),1===e||2===e?I:i.Ko).WO(r("uRenderEffectMask"),2===e?1:0).GO(n("uRatioPxClip"),[2/this.cs.oi().x,2/this.cs.oi().y]).WO(n("uDevicePixelRatio"),a),h instanceof Yi||h instanceof Wc?this.GO(r("uScale"),s.uniforms.YO()).GO(r("uDisp"),s.uniforms.HO()).GO(n("uScaleStart_highpart"),s.uniforms.yG()).GO(n("uScaleStart_lowpart"),s.uniforms.mG()):h instanceof Hi&&this.GO(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).GO(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).GO(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).GO(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).GO(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).GO(r("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const l=!0===s.coordsHighPrecision;if(s.coordsX)if(l){const t=o("aPos_highpartX"),e=o("aPos_lowpartX");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsX),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this._N(o("aPosX"),s.coordsX);if(s.coordsY)if(l){const t=o("aPos_highpartY"),e=o("aPos_lowpartY");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsY),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this._N(o("aPosY"),s.coordsY);if(1===e)this.uN(r("uFirstId"),s.idFirst);else{if(s.fillStyleSolid&&this.iL(r("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this._N(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.xN(t,s.lookupValueAttribDivisor)}this.fG(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.QN(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.ZN(t,s.radialGradientInfo,s.fillStyleRadialGradient)}if(s.fillStyleIndividual&&null!==s.colorBuffer){if(!s.colorBuffer)return!1;const t=o("aColor");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.colorBuffer),this.gl.vertexAttribPointer(t,4,this.gl.UNSIGNED_BYTE,!0,0,0),this.gl.enableVertexAttribArray(t),void 0!==s.colorAttribDivisor&&this.xN(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.vO();this.iL(n("uColor"),s.fillStyleImage.getSurroundingColor()).UO(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).NO(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).cN(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.vO();this.UO(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).NO(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return void 0!==s.useInstanceID&&this.nG(t,s.useInstanceID),void 0!==s.useVertexID&&this.hG(t,s.useVertexID),!0}vG(t,e,i){if(t)return Bm(i||e.ea(),e.At,t.getAngle(!0),this.MO())}SG(t,e,i){if(t)return _m(i||e.ea(),e.At,t.getPosition(),t.getExtent(),t.getShape(),this.MO())}}const jm=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void zt.setTimeout(o,r)};zt.setTimeout(o,0)}))})(t,h,{retryTimeout:10}).then((()=>(t.deleteSync(h),t.bindBuffer(e,i),t.getBufferSubData(e,s,r,n,o),t.bindBuffer(e,null),r))).catch((t=>{throw t}))};class $m{XO(t){if(t instanceof Yi||t instanceof Wc){const e=t.mi();this.xG=e.x.scaling,this.bG=-e.x.displacement,this.MG=e.y.scaling,this._G=-e.y.displacement;const i=Math.fround(e.x.highPrecisionOffset),s=Math.fround(e.y.highPrecisionOffset);this.wG=i,this.CG=e.x.highPrecisionOffset-i,this.kG=s,this.TG=e.y.highPrecisionOffset-s}else t instanceof Hi&&(this.MixedScaleXY=t.mi());return this}HO(){return[this.bG,this._G]}YO(){return[this.xG,this.MG]}yG(){return[this.wG,this.kG]}mG(){return[this.CG,this.TG]}}class Zm{constructor(){this.xG=0,this.MG=0,this.FG=0,this.bG=0,this._G=0,this.IG=0}PG(t){return this.xG=t.rt(),this.bG=t.getInnerStart()+.5*this.xG*t.nt(),this}DG(t){return this.MG=t.rt(),this._G=t.getInnerStart()+.5*this.MG*t.nt(),this}BG(t){return this.FG=t.rt(),this.IG=t.getInnerStart()+.5*this.FG*t.nt(),this}YO(){return[this.xG,this.MG,this.FG]}HO(){return[this.bG,this._G,this.IG]}LG(t,e,i,s,r){const n=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=Lm.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class qm{constructor(t){this.lz=t}WE(t,e,i,s,r,n=0){const o=this.lz,h=void 0===s;if(!(s=s||o.JO()))throw new Mt("Could not bind a framebuffer.");const a=o._O(),l=o.TO();o.$O(!1),o.IN((()=>{o.LO(0,0,i.x,i.y),t()}),s,e,n),h&&o.tN(s),this.lz.PN(r),this.lz.LO(a.x,a.y,a.width,a.height),o.$O(l)}}class Km{constructor(t,e){this.EG=[],this.zG=[],this.uniform=t=>{const e=this.shader.$z(t);return this.zG.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.Xz(t);return this.zG.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.jz(t);return this.EG.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.EG)this.glUtils.bN(t.location),this.glUtils.xN(t.location,0)}}class Jm extends ln{constructor(t,e,i,s,r){super(t,e,i,s),this.VG=new Map,this.OG=t,this.NG=e,this.lz=t.GG(),this.UG=r,this.NG=e}dz(){return this}WE(t,e){if(!this.UG||0!==t||0===this.VG.size)return{};const i=Array.from(this.VG.values()).map((t=>t.WG.filter((t=>t.YG)).map((t=>t.ss)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===i.length)return{};const s=this.UG;return this.lz.GN.QO(i,s),{}}HG(t,e,i,s,r){return{}}Os(){return this}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Pl(){return 0}Dl(){return 0}rs(t,e){const i={WG:[]},s=(t,e)=>{const s={ss:t||[],YG:void 0===e||e};i.WG.push(s);const r={gs:t=>(s.ss=t,r),bs:t=>(s.YG=t,r),_s:()=>s.YG};return r},r={};Object.keys(e).forEach((t=>{const i=e[t],n=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,h=s(n,o);r[t]=h}));const n={Bg:s,...r};this.VG.set(t,i);const o=t.onDispose((()=>{this.VG.delete(t),t.offDispose(o)}));return n}}function Qm(t,e,i,s,r,n=Math.floor(Math.sqrt(s>r?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]}const ty=(t,e,i)=>((t,e,i)=>{const s=[];let r=0;const n=mi(e,i/2);let o,h,a,l,c=t[t.length-1],d=0;for(let i=0;i0&&(c=t[i-1]),Ft(o,c)&&(c=yi(o,di(mi(pi(h,o),-1)))),Ft(o,h)&&(h=yi(o,di(mi(pi(c,o),-1))));const f=xi(c,e),g=xi(o,e),m=xi(h,e),y=di(pi(g,f)),p=di(pi(m,g)),A=yi(y,p),x=u(-A.y,A.x),S=u(-y.y,y.x),v=1/vi(x,S),b=gi(x),M=di(pi(y,p)),C=Math.sign(vi(x,M))||1,T=Ai(x,mi(n,v)),w=Ai(x,mi(n,-v));if(b<1||v===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},a={x:0,y:0};const l=u(-p.y,p.x),f=Math.sign(vi(y,x))||C,g=Ai(S,mi(n,f)),m=Ai(l,mi(n,f));1===C?(t=g,e=w,i=m,a=w):(t=T,e=g,i=T,a=m);const A=4*ei(c,o),b=4*ei(o,h);(v>A||v>b)&&(1===C?(t=g,e=m,i=m,a=g):(t=m,e=g,i=g,a=m));const M=yi(o,t),E=yi(o,e),k=yi(o,i),I=yi(o,a);s[r]=M,r+=1,s[r]=E,r+=1,s[r]=k,r+=1,s[r]=I,r+=1,d=4}else{const t=yi(o,T),e=yi(o,w);s[r]=t,r+=1,s[r]=e,r+=1,d=2}l=a,a=t[i]}return s[r]=s[0],r+=1,s[r]=s[1],r+=1,[s,d,[l,a]]})(t,e,i)[0];class ey extends Cn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.$G=Xe,this.XG=Xe,this.jG=Eg({arcStyleSolid:()=>U(this.Ie)&&this.Ie,arcStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,arcStyleLinearGradient:()=>at(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG()}ZG(t,e){let i=0,s=Array(0),r=0;if(void 0!==e){const r=t.length,n=Array(r+e.length);let o=0,h=0;for(;o0?Qm(this.Ma.C(),this.Kl.C(),this.Fi.C(),this.ql.C()*l/100,this.tu.C()*l/100,a)[0]:[this.Ma.C()],d=h.length-1;if(2===d){const t=(h[d-1].x+h[1].x)/2,e=(h[d-1].y+h[1].y)/2;this.eu=u(t,e)}else{const t=Math.floor(d/2);this.eu=u(h[t].x,h[t].y)}this.hu=h[1];const f=h.length-1;this.ru=h[f],this.iu.C()&&(h.shift(),c.shift());let g=!1;(this.Ma.u||this.Kl.u||this.Fi.u||this.ql.u||this.tu.u||this.iu.u||this.su.u||s)&&(this.XG=m(u(this.Ua().x-n,this.Ua().y-o),u(this.Ua().x+n,this.Ua().y+o)),g=!0,this.Ma.u=!1,this.Kl.u=!1,this.Fi.u=!1,this.ql.u=!1,this.tu.u=!1,this.iu.u=!1,this.su.u=!1);const y=this.fa();(g||y)&&this.Ie!==_&&(this.iu.C()?(this.JG&&this.lz.jO(this.JG),[this.KG,this.JG,this.qG,this.tU]=this.ZG(h,c)):(this.JG&&this.lz.jO(this.JG),[this.KG,this.JG,this.qG,this.tU]=this.ZG(h,void 0)),nt(this.Ie)?this.iU=_m(this.XG,this.At,this.Ie.getPosition(),this.Ie.getExtent(),this.Ie.getShape(),this.lz.MO()):at(this.Ie)?this.sU=Bm(this.XG,this.At,this.Ie.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0));const p=this.jG.arcStyleSolid(y),A=this.jG.arcStyleLinearGradient(y),x=this.jG.arcStyleRadialGradient(y),S=p||A||x;y&&(this.eU=S?this.lz.VV(sm["2D"],sm.Color({dataType:nt(this.Ie)||at(this.Ie)?["gradient",this.Ie]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.ya(this.Ie));const v=this.Pe;if(cs(v)&&(g||this.Sa(v.getThickness())||s)){this.iu.C()?360===i?(h.pop(),c.pop(),[this.hU,this.rU]=this.QG(h,void 0,v.getThickness(),r),this.nU&&this.hU?this.lz.pN(this.nU,this.hU,!0):!this.nU&&this.hU?this.nU=this.lz.zO(this.hU,!0):this.nU&&!this.hU&&(this.lz.jO(this.nU),this.nU=void 0),[this.oU,this.aU]=this.QG(c,void 0,v.getThickness(),r),this.lU&&this.oU?this.lz.pN(this.lU,this.oU,!0):!this.lU&&this.oU?this.lU=this.lz.zO(this.oU,!0):this.lU&&!this.oU&&(this.lz.jO(this.lU),this.lU=void 0)):([this.hU,this.rU]=this.QG(h,c,v.getThickness(),r),this.nU&&this.hU?this.lz.pN(this.nU,this.hU,!0):!this.nU&&this.hU?this.nU=this.lz.zO(this.hU,!0):this.nU&&!this.hU&&(this.lz.jO(this.nU),this.nU=void 0),this.oU&&(this.lU&&this.lz.jO(this.lU),this.lU=void 0,this.aU=0)):(360===i&&(h.shift(),h.pop()),[this.hU,this.rU]=this.QG(h,void 0,v.getThickness(),r),this.nU&&this.hU?this.lz.pN(this.nU,this.hU,!0):!this.nU&&this.hU?this.nU=this.lz.zO(this.hU,!0):this.nU&&!this.hU&&(this.lz.jO(this.nU),this.nU=void 0));const t=v.getFillStyle();nt(t)?this.uU=_m(this.XG,this.At,t.getPosition(),t.getExtent(),t.getShape(),this.lz.MO()):at(t)?this.cU=Bm(this.XG,this.At,t.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),this.dU=t===_?void 0:this.lz.VV(sm["2D"],sm.Color({dataType:nt(t)||at(t)?["gradient",t]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})),this.xa(v)}if(g){let t=1,e=1;cs(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.$G=m(u(this.XG.min.x-t,this.XG.min.y-e),u(this.XG.max.x+t,this.XG.max.y+e))}this.fU=e&&S?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.AU=e&&this.Pe!==ut?this.AU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0}return this}WE(t,e){if(this.pa()){const i=1===t?this.fU:this.eU,s=this.Ie,r=this.JG;i&&r&&this.lz.bz(i).OO(i,((i,n,o,h)=>{if(this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(h("uScaleStart_highpart"),this.Vz.yG()).GO(h("uScaleStart_lowpart"),this.Vz.mG()).qN(o,r,this.At._i(),void 0).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t)this.lz.uN(i("uFirstId"),e).nG(o,1);else if(U(s))this.lz.iL(i("uColor"),s.getColor());else if(nt(s)){if(!this.iU)return!1;this.lz.ZN(o,this.iU,s)}else if(at(s)){if(!this.sU)return!1;this.lz.QN(o,this.sU,s)}return this.lz.om(this.tU,this.qG),!0}));const n=this.Pe;cs(n)&&(void 0!==this.nU&&this.gU(t,this.nU,this.rU,n,e),void 0!==this.lU&&this.gU(t,this.lU,this.aU,n,e))}return{idCount:1}}HG(t,e,i,s,r){return{}}gU(t,e,i,s,r){const n=1===t?this.AU:this.dU,o=s.getFillStyle();n&&this.lz.bz(n).OO(n,((n,h,a,l)=>{if(this.lz.GO(n("uScale"),this.Vz.YO()).GO(n("uDisp"),this.Vz.HO()).qN(a,e,this.At._i(),void 0).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),1===t)this.lz.uN(n("uFirstId"),r).nG(a,1);else if(U(o))this.lz.iL(n("uColor"),o.getColor());else if(nt(o)){if(!this.uU)return!1;this.lz.ZN(a,this.uU,o)}else if(at(o)){if(!this.cU)return!1;this.lz.QN(a,this.cU,o)}const u=s.getThickness(),c=-1===u||1===u;return this.lz.om(c?this.lz.gl.LINE_LOOP:this.lz.gl.TRIANGLE_STRIP,i),!0}))}dz(){return this.pU&&(this.lz.jO(this.pU),this.pU=void 0),this.yU&&(this.lz.jO(this.yU),this.yU=void 0),this.JG&&(this.lz.jO(this.JG),this.JG=void 0),this.nU&&(this.lz.jO(this.nU),this.nU=void 0),this.lU&&(this.lz.jO(this.lU),this.lU=void 0),this.eU=void 0,this.dU=void 0,this.fU=void 0,this.AU=void 0,this}St(){return this.XG.max.x}vt(){return this.XG.min.x}bt(){return this.XG.max.y}xt(){return this.XG.min.y}Pl(){return Re(this.Pe)}Dl(){return Re(this.Pe)}}class iy{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}mU(t){return this.first=t,this.second=t+1,this.third=t+2,this.fourth=t+3,this.fifth=t+4,this.sixth=t+5,t+=6,this}vU(){return this.first=this.second,this.second=this.third,this.third=this.fourth,this.fourth=this.fifth,this.fifth=this.sixth,this.sixth+=1,this}SU(){return this.first=this.third,this.second=this.fourth,this.third=this.fifth,this.fourth=this.sixth,this.fifth=this.fourth+1,this.sixth=this.fifth+1,this}xU(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.vU(),this}bU(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.third,e[i+2]=this.second,e[i+3]=this.third,e[i+4]=this.fourth,e[i+5]=this.second,i+=6,t.position=i,t.next&&this.SU(),this}MU(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new iy).mU(t))(),ry=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||sy.vU(),n.push(t,e),r.push(sy.first,sy.second,sy.third),h=void 0,o=void 0,r.push(sy.third,sy.fourth,sy.second),a=sy.third,sy.SU(),l&&n.push(i,s),[o,h,a]),ny=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||sy.vU(),o.push(t,e),r.push(sy.first,sy.second,sy.third);const c=Ei(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(sy.third,sy.fourth,sy.fifth),l=sy.fourth),sy.SU(),u&&o.push(i,s),[h,a,l]},oy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||sy.vU(),r.push(t,e),s.push(sy.first,sy.second,sy.third),n=i,o=void 0,h=sy.third,l?r.push(i):a=!0,[n,o,h,a]),hy=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||sy.vU(),sy.vU()):a>0&&(sy.vU(),u>0&&(u-=1)),n.push(t),r.push(sy.first,sy.second,sy.third),a=sy.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),ay=(t,e=0)=>{sy.mU(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],y=!1,p=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=ry(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=ny(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,y]=oy(g,m,d,o,h,a,l,u,y,t):d.y===f.y?(a=g,y&&(h.push(g),y=!1,sy.vU()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=hy(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=hy(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class ly extends Mn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.wU=0,this.Ka=Array(),this.CU=0,this.kU=new Uint16Array(0),this.TU=new Uint16Array(0),this.jG=Eg({hightFillSolid:()=>U(this.Ie)&&this.Ie,hightFillRadialGradient:()=>nt(this.Ie)&&this.Ie,hightFillLinearGradient:()=>at(this.Ie)&&this.Ie,hightFillPaletted:()=>j(this.Ie)&&this.Ie,lowFillSolid:()=>U(this.Ol)&&this.Ol,lowFillRadialGradient:()=>nt(this.Ol)&&this.Ol,lowFillLinearGradient:()=>at(this.Ol)&&this.Ol,lowFillPaletted:()=>j(this.Ol)&&this.Ol}),this.OG=t,this.NG=e,this.lz=t.GG()}Os(){const t=this.ga(),e=this.Yo.C(),i=this.al;if(this.pa()){this.Vz.XO(this.At);const s=this.At instanceof Hi==0,r=s?this.At.Ui():void 0,n=this.Wl(),o=this.At.Ni()||t,h=i||this.Rl.u||o&&"disabled"!==n.type;if(h){if(this.wU=0,this.kU=new Uint16Array(0),this.TU=new Uint16Array(0),this.Ka.length=0,this.CU=0,this.El>1){const[t,e,i,o]=ay([s?n.packager(this.Bl,r,.5):this.Bl,s?n.packager(this.Ll,r,.5):this.Ll]);this.wU=o,this.kU=e,this.TU=i,this.Ka=t,this.CU=t.length}this.Rl.u=!1}if(this.Vl&&this.rl[0].length>1){const[t,e]=this.rl,i=t.length,[o,h,a,l,u]=ay([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.wU);this.wU=l;const c=o.length;for(let t=u;t0||this.El>0?1:u;s{if(this.lz.qN(h,i,this.At._i(),void 0).wN(n).WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(r("uScale"),this.Vz.YO()).GO(r("uDisp"),this.Vz.HO()).GO(a("uScaleStart_highpart"),this.Vz.yG()).GO(a("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(a("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(a("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(a("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(a("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(r("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(r("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(r("uFirstId"),e).nG(h,1);else if(U(s))this.lz.iL(r("uColor"),s.getColor());else if(nt(s)){if(!this.PU)return!1;this.lz.ZN(h,this.PU,s)}else if(at(s)){if(!this.DU)return!1;this.lz.QN(h,this.DU,s)}else if(j(s)){const t=kg(s,this,void 0);if(!t&&s.lut.percentageValues)return!1;this.lz.fG(h,s.lut,t)}return this.lz.kN(this.zU),!0}))}const n=1===t?this.fU:this.FU;if(n&&this.BU&&this.LU){const s=this.BU,r=this.LU;this.lz.bz(n).OO(n,((n,o,h,a)=>{if(this.lz.qN(h,s,this.At._i(),void 0).wN(r).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(n("uScale"),this.Vz.YO()).GO(n("uDisp"),this.Vz.HO()).GO(a("uScaleStart_highpart"),this.Vz.yG()).GO(a("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(a("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(a("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(a("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(a("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(n("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(n("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(n("uFirstId"),e).nG(h,1);else if(U(i))this.lz.iL(n("uColor"),i.getColor());else if(nt(i)){if(!this.iU)return!1;this.lz.ZN(h,this.iU,i)}else if(at(i)){if(!this.sU)return!1;this.lz.QN(h,this.sU,i)}else if(j(i)){const t=kg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.lz.fG(h,i.lut,t)}return this.lz.kN(this.RU),!0}))}return{idCount:1}}HG(t,e,i,s,r){return{}}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return 0}Dl(){return 0}oM(t){this.Sl()>0&&this.Os();const[e,i]=this.cl(),s=e.length>2&&e[1].x0&&this.Os();const[e,i]=this.cl(),s=e.length;if(0===s)return;const r=this.Nl?1:0,n=s-(this.Gl?2:1),o=e.length>2&&e[1].x{const i=1===e?.5*Math.PI:1.5*Math.PI;for(let s=0;s<=this.VU;s+=1){const r=i-s*Math.PI/this.VU;t.push(.5*Math.cos(r),.5*Math.sin(r),e,0)}})),t.push(0,0,1,1),t.push(0,0,0,1);const e=t.length/4,i=[];for(let t=0;t((t,e)=>{let i=t.iN.tO.get(e);return i||(i=new uy(t,e),t.iN.tO.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),dy={YU:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i)}},HU:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.xN(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.xN(r,1),h.enableVertexAttribArray(r)},$U:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.xN(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.xN(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.xN(i,1),h.enableVertexAttribArray(i)}},XU:(t,e,i,s,r,n,o,h,a,l)=>{const u=t.gl;u.bindBuffer(u.ARRAY_BUFFER,i),u.vertexAttribPointer(s,n,a,h,2*n*l,o*l),t.xN(s,1),u.enableVertexAttribArray(s),u.vertexAttribPointer(r,n,a,h,2*n*l,(o+n)*l),t.xN(r,1),u.enableVertexAttribArray(r)},WE:(t,e,i,s,r,n,o)=>{const h=t.GG(),{uniform:a,uniformOptional:l}=i,u=1/t.io.ho,c=(r?Math.max(n,u):Math.max(n,0))+1;h.WO(a("uThicknessPixels"),c).WO(l("uAALimit"),1-(c-1)/c).GO(a("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.bz(i,s).om(o)}},fy={YU:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t);const e=o("aPos_lowpart");h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},HU:(t,e,i,s,r,n)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,r,o.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},$U:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart"),e=o("aPos_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t),h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},jU:(t,e)=>{const i=t.GG();i.om(i.gl.LINE_STRIP,e,0)},ZU:(t,e)=>{const i=t.GG();i.om(i.gl.LINES,2*e,0)}};class gy extends En{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.el=Xe,this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,strokeFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},strokeFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t}}),this.OG=t,this.NG=e,this.lz=t.GG(),this.QU=this.lz.EN}Os(){const t=this.ma(),e=this.Su,i=this.jG.lineStyleSolid(t),s=this.jG.lineStyleDashed(t),r=i||s,n=this.jG.strokeFillSolid(t),o=this.jG.strokeFillLinearGradient(t),h=this.jG.strokeFillRadialGradient(t),a=this.jG.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Ii(),d=this.Ti(),f=this.Yo.C(),g=this.Yo.u,y=e.N();if(s&&this.At instanceof Hi)return zt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.Vz.XO(this.At),this.wu&&(this.JU=this.lz.zO(ne([c,d],this.At._i()),!1,this.JU),this.el=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.pa()&&r&&l&&y>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.KU=t?{type:"triangulated",shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),this.QU?sm.AliasedEdge:void 0,s&&sm.StippleTextureInstanced),mousePickingShader:f?this.lz.VV(sm["2D"],sm.MousePicking(),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),s&&sm.StippleTextureInstanced):void 0,geometry:cy(this.lz,y),thickness:y,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.uU=_m(cn(this.el,{x:this.Pl(),y:this.Dl()},this.At),this.At,h.getPosition(),h.getExtent(),h.getShape(),this.lz.MO()):o?this.cU=Bm(cn(this.el,{x:this.Pl(),y:this.Dl()},this.At),this.At,o.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),s){if(t||this.wu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.qU=this.lz.zO(t,!1,this.qU)}this.tW=this.lz.lG(s.getPattern())}else this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.tW=void 0;return this._u(e),this.wu=!1,this.Yo.u=!1,this}WE(t,e){var i,s;const r=this.JU;if(!r)return{};const n=this.KU;if(!n)return{};const{fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l,lineStyleDashed:u,thickness:c}=n,d=1===t?null===(i=this.KU)||void 0===i?void 0:i.mousePickingShader:null===(s=this.KU)||void 0===s?void 0:s.shader;return d?(this.lz.bz(d).OO(d,((i,s,d,f)=>{if(this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(f("uScaleStart_highpart"),this.Vz.yG()).GO(f("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(f("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(f("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(f("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(f("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(i("uFirstId"),e).nG(d,1);else if(o)this.lz.iL(i("uColor"),o.getColor());else if(a){if(!this.uU)return!1;this.lz.ZN(d,this.uU,a)}else if(h){if(!this.cU)return!1;this.lz.QN(d,this.cU,h)}else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.lz.fG(d,l.lut,t)}if(u){if(!this.qU||!this.tW)return!1;dy.HU(this.lz,d,this.qU,s("aLengthSoFarA"),s("aLengthSoFarB"),2,0),this.lz.GO(i("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(f("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(i("uStippleScale"),u.getPatternScale()).UO(i("uStippleTexture"),this.tW.uG,1)}return dy.YU(this.At._i(),this.lz,r,d,this.At._i()?4:2,0),dy.WE(this.OG,n.geometry,d,this.QU&&1!==t,1===t,c,1),!0})),{idCount:1}):{}}HG(t,e,i,s,r){return{}}dispose(){return super.dispose(),this.KU=void 0,this.JU&&(this.lz.jO(this.JU),this.JU=void 0),this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.tW=void 0,this}dz(){return this}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return Re(this.Su)}Dl(){return Re(this.Su)}}class my extends kn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.iW=[],this.sW=!1,this.eW=!1,this.hW=!1,this.rW=!1,this.nW=!1,this.Vz=new $m,this.el=Xe,this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,lineFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},lineFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},lineFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},lineIndividualPointFill:()=>{const t=this.Su.getFillStyle();return H(t)&&t}}),this.OG=t,this.NG=e,this.lz=t.GG(),this.QU=this.lz.EN,this.oW=t.io.no}Zr(){const t={vs:e=>this.aW(t,e),ds:e=>this.lW(t,e),Kg:(e,i)=>this.uW(t,e,i),iL:e=>this.cW(t,e),Pi:{x:0,y:0},Fi:{x:0,y:0},jo:0,bR:void 0,dW:this.iW.length,fW:!0,AW:!0};return this.eW=!0,this.iW.push(t),t}Ot(){var t;return this.iW.length=0,this.sW=!0,this.Ps&&this.Nn&&(null===(t=this.cs.On)||void 0===t?void 0:t.entity)===this&&this.Nn(this,void 0,this.cs.On.collectionMember),this}gW(){return this.iW.length}C(t){const e=this.iW[t];return[e.Pi,e.Fi]}Bm(){return this.iW}Bd(t){var e;const i=this.iW.indexOf(t);i>=0&&(this.iW.splice(i,1),t.AW||(this.sW=!0),this.Ps&&this.Nn&&(null===(e=this.cs.On)||void 0===e?void 0:e.entity)===this&&this.Nn(this,void 0,this.cs.On.collectionMember))}aW(t,e){if(e&&!t.fW)t.dW=this.iW.length,this.iW.push(t);else if(!e){const e=this.iW.indexOf(t);this.iW.splice(e,1)}return t.fW=e,t.AW||(this.rW=!0),t}lW(t,e){return t.jo=e,t.AW||(this.hW=!0),t}uW(t,e,i){return t.Pi=e,t.Fi=i,t.AW||(this.sW=!0),t}cW(t,e){return t.bR=e,t.AW||(this.nW=!0),t}Os(){const t=this.Yo.C(),e=this.Yo.u,i=this.ma(),s=this.Su,r=this.iW,n=this.hW,o=this.sW,h=this.rW,a=this.nW,l=this.eW,u=this.jG.lineStyleSolid(i),c=this.jG.lineStyleDashed(i),d=u||c,f=this.jG.lineFillSolid(i),g=this.jG.lineIndividualPointFill(i),m=this.jG.lineFillRadialGradient(i),y=this.jG.lineFillLinearGradient(i),p=f||g||y||m,A=s.N(),x=c?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(c&&this.At instanceof Hi)return zt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.Vz.XO(this.At);const S=this.ku,v=o||h,b=!v&&l;if(v||b){const t=v?r:r.filter((t=>t.AW)),e=[],i=t.length;let s=Ye,n=Ye,o=He,h=He;for(let r=0;r0&&e;this.KU=i?"triangulated"===x?{type:"triangulated",shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW,ensureMinimumSegmentLength:void 0!==this.Cu}),this.QU?sm.AliasedEdge:void 0,c&&sm.StippleTextureInstanced,sm.AttributeHighlight),mousePicking:t?{shader:this.lz.VV(sm["2D"],sm.MousePicking({useAttribute:!0}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW,ensureMinimumSegmentLength:void 0!==this.Cu}),c&&sm.StippleTextureInstanced,sm.AttributeHighlight)}:void 0,geometry:cy(this.lz,A,!1),thickness:A,lineStyleSolid:u,lineStyleDashed:c,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:y,fillStyleRadialGradient:m}:{type:"primitive",shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW}),sm.AttributeHighlight),mousePicking:t?{shader:this.lz.VV(sm["2D"],sm.MousePicking({useAttribute:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,snapToNearestPixel:this.oW}),sm.AttributeHighlight)}:void 0,lineStyleSolid:u,lineStyleDashed:c,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:y,fillStyleRadialGradient:m}:void 0}if(c){if(i||v||b){const t=v||i?r:r.filter((t=>t.AW)),e=new Float32Array(4*t.length);let s=0;for(let i=0;it.AW)),i=new Float32Array(e.length*t);let s=0;e.forEach((e=>{for(let r=0;rt.AW)),e=new Uint32Array(2*t.length);let s=0;t.forEach((t=>{const i=(t.bR||g.color).toUint32();for(let t=s;tt.AW)),s=new Float32Array(i.length*t);let n=0;i.forEach((e=>{for(let i=0;i{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(m("uScaleStart_highpart"),this.Vz.yG()).GO(m("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(m("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(m("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(m("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(m("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.oW&&this.lz.GO(m("uViewportSizePx"),[this.cs.oi().x*this.lz.MO(),this.cs.oi().y*this.lz.MO()]),void 0!==this.Cu&&this.lz.GO(i("uMinSegmentPixelVector"),[this.Cu.x,this.Cu.y]),this.lz.iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.lz.uN(i("uFirstId"),e),!n)return!1;"triangulated"===h?this.lz.NO(n.buffer,1,{location:f("aPickingIdOffset"),size:1}):this.lz._N(f("aPickingIdOffset"),n.buffer)}else if(a)this.lz.iL(i("uColor"),a.getColor());else if(l){if(!this.yW)return!1;if("triangulated"===h)dy.XU(this.lz,g,this.yW.buffer,f("aColorA"),f("aColorB"),4,0,!0,this.lz.gl.UNSIGNED_BYTE,1);else{const t=f("aColor");this.lz.gl.bindBuffer(this.lz.gl.ARRAY_BUFFER,this.yW.buffer),this.lz.gl.vertexAttribPointer(t,4,this.lz.gl.UNSIGNED_BYTE,!0,0,0),this.lz.gl.enableVertexAttribArray(t)}}else if(c){if(!this.iU)return!1;this.lz.ZN(g,this.iU,c)}else if(u){if(!this.sU)return!1;this.lz.QN(g,this.sU,u)}if(d){if(!this.qU||!this.tW)return!1;dy.XU(this.lz,g,this.qU.buffer,f("aLengthSoFarA"),f("aLengthSoFarB"),2,0,!1,this.lz.gl.FLOAT,Float32Array.BYTES_PER_ELEMENT),this.lz.GO(i("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(m("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(i("uStippleScale"),d.getPatternScale()).UO(i("uStippleTexture"),this.tW.uG,0)}if("triangulated"===h){const{geometry:e,thickness:i}=o;dy.$U(this.At._i(),this.lz,s.buffer,g,this.At._i()?4:2,0),this.lz.NO(r.buffer,1,{location:f("aIsHighlighted"),size:1}),dy.WE(this.OG,e,g,this.QU&&1!==t,1===t,i,this.iW.length)}else fy.$U(this.At._i(),this.lz,s.buffer,g,this.At._i()?4:2,0),this.lz._N(f("aIsHighlighted"),r.buffer),fy.ZU(this.OG,this.iW.length);return!0})),{idCount:this.iW.length}):{}}dispose(){return super.dispose(),this.KU=void 0,this.JU&&(this.lz.jO(this.JU.buffer),this.JU=void 0),this.qU&&(this.lz.jO(this.qU.buffer),this.qU=void 0),this.pW&&(this.lz.jO(this.pW.buffer),this.pW=void 0),this.mW&&(this.lz.jO(this.mW.buffer),this.mW=void 0),this.yW&&(this.lz.jO(this.yW.buffer),this.yW=void 0),this.tW=void 0,this}HG(t,e,i,s,r){return{collectionMember:this.iW.find((i=>e+i.dW===t))}}dz(){return this}ds(t){super.ds(t);for(const e of this.iW)e.ds(t);return this}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return Re(this.Su)}Dl(){return Re(this.Su)}}class yy{constructor(t,e){this.vW=!1,this.SW=!1,this.xW=!1,this.At=t,this.bW=e,this.bW.ta("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.vW="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.vW="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.SW=!0),!0===t.regularProgressiveStep&&(this.xW=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.vW?t[0].x:t[0].y,end:"x"===this.vW?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.vW?"x"===this.vW?function(t){const e=t.length;if(e>0){const i=Math.max(t[e-1].x,t[0].x),s=Math.min(t[e-1].x,t[0].x);let r=t[0].y,n=t[0].y;for(let i=0;ir&&(r=e.y),e.y0){const i=Math.max(t[e-1].y,t[0].y),s=Math.min(t[e-1].y,t[0].y);let r=t[0].x,n=t[0].x;for(let i=0;ir&&(r=e.x),e.x{!1===t.allowDataGrouping&&(this.MW=!0)}))}TW(t,e=!1){if(this.MW||!this.vW||"linear"!==this.kW.type)return!1;!1===e&&this.FW&&(clearTimeout(this.FW),this.FW=void 0);const i="x"===this.vW?this.kW.scale.x.yg:this.kW.scale.y.yg;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const r=t[0],n=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.vW?r.x:r.y,"x"===this.vW?n.x:n.y,s),h=this.kW.scale,a=Math.abs("x"===this.vW?h.Ui().x:h.Ui().y),l=a/o,u=Math.floor(l*py),c=u*o,d=zt.performance.now(),f=!(d-i._h<500)&&(i.yh?d-i.Mh<1e3:d-i.mh<2e3||i.xh),g=s>2*this._W.totalDataPointsAtTime;if(f&&!g)return this.FW=setTimeout((()=>this.IW(t)),1e3),!1;const m=u>=10,y=this._W.enabled?this._W.columnWidthAxis/a<1.5:void 0,p=this._W.enabled&&u>this._W.dataPointsPerColumn?u/this._W.dataPointsPerColumn>=2:void 0;let A;!0===this._W.enabled?y?p&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):A=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return A?(x&&(this._W=A),!0):(x&&(this._W={...this._W,totalDataPointsAtTime:s}),!1)}PW(){this.DW=void 0,this.wW.length=0,this.FW&&(clearTimeout(this.FW),this.FW=void 0)}BW(t){if(0===t.length)return t;if(this.MW||!this.vW||"linear"!==this.kW.type||!this._W.enabled)return t;let e;e=this.wW.length>0?fe(this.wW,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.DW,h=-1,a=-1,l=0,u=0;if("x"!==this.vW||this.SW)if("x"===this.vW&&this.SW){const t=this._W.columnWidthAxis;let c=this.DW?this.DW.x:e[0].x,d=c-t;for(let f=0;f=d?((!r||i.y>r.y)&&(r=i,h=f),(!n||i.y=d?((!r||i.x>r.x)&&(r=i,h=f),(!n||i.xr.x)&&(r=i,h=f),(!n||i.xr.y)&&(r=i,h=f),(!n||i.y0&&(this.DW=s[c-1]),s}LW(t){if(this.vW&&"linear"===this.kW.type){const e="x"===this.vW?this.kW.scale.x.yg:this.kW.scale.y.yg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.fh===Ks.progressive||e.fh===Ks.regressive){const e=Math.abs("x"===this.vW?this.kW.scale.x.getInnerInterval():this.kW.scale.y.getInnerInterval());if(this._W.enabled)return 2*e/this._W.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.vW?s.x:s.y,"x"===this.vW?r.x:r.y,i)}}}RW(t,e,i){if(!this.vW)return e;const s=i.length;let r=rn(i,t.min,this.vW,this.SW,0,s-1);void 0===r&&(r=this.SW?s-1:0);let n=rn(i,t.max,this.vW,this.SW,0,s-1);return void 0===n&&(n=this.SW?0:s-1),1+Math.abs(n-r)}EW(){this.FW&&(clearTimeout(this.FW),this.FW=void 0)}IW(t){this.TW(t,!0)&&this.Ms()}}class xy extends yy{renderVisibleOnly(t,e,i=!1){const s=this.At.x.getInnerStart(),r=this.At.x.getInnerEnd(),n=Math.min(s,r),o=Math.max(s,r),h=this.At.y.getInnerStart(),a=this.At.y.getInnerEnd(),l=Math.min(h,a),u=Math.max(h,a);t.forEach(((t,s)=>{t.existingCoordinatesCount<=1||!1===i&&(t.boundaries.max.xo||t.boundaries.max.yu)||e(t)}))}}class Sy{constructor(t,e,i){this.zW=e,this.VW=i,this.OW=t,this.NW=[]}GW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.OW[this.OW.length-1];do{const t=this.OW.length;let r;h||(h=this.UW(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.VW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.OW[t-1].lastDataPoint;e?(n.splice(0,0,e),a=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(h)r=Math.min(o,h.allocatedCoordinatesCount-h.existingCoordinatesCount),s(h,n.slice(0,r),r,a);else{const t=Math.ceil(e)+a;r=Math.min(t,o);const s={...i(t,n.slice(0,r),r,a),isDropped:!1};this.OW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.WW()}YW(t){const e=t,i=this.OW.indexOf(e);i>=0&&this.OW.splice(i,1),e.droppedTimestamp=zt.performance.now(),this.NW.push(e)}HW(){this.OW.slice().forEach((t=>this.YW(t)))}$W(){this.OW.forEach((t=>this.zW(t))),this.NW.forEach((t=>this.zW(t))),this.OW.length=0,this.NW.length=0}UW(t,e){const i=2*t/3,s=4*t/3,r=this.NW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.NW[r];return this.NW.splice(r,1),this.OW.push(t),t}}WW(){if(this.NW.length>5){const t=zt.performance.now();for(let e=0;e=1e4)&&(this.zW(i),this.NW.splice(e,1),e-=1)}}}}class vy extends yy{XW(t,e){if(!e||"object"!=typeof e)return 0;const i=this.At.x.getInnerStart(),s=this.At.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.At.y.getInnerStart(),h=this.At.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.jW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.ZW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.QW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}jW(t,e,i,s,r,n){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let h=0,a=o;for(let i=0;ie&&(h+=1,a-=s.existingDataPointsCount)}return h}QW(t,e,i,s,r,n){if(void 0===e||!this.vW)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.vW?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.vW?a.boundaries.max.x2))break;o+=1}return o}ZW(t,e,i,s,r,n){if(void 0===e||0===e)return 0;let o=0,h=0;for(let a=t.length-1;a>=0;a-=1){const l=t[a];if(h>e)if(this.vW){if(this.SW?"x"===this.vW?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.vW?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}JW(t,e){const i=t.reduce(((t,e)=>hi(t,e.boundaries)),Xe);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.vW||this.SW?"x"===this.vW&&this.SW?i.max.x=Math.min(i.max.x,t):"y"!==this.vW||this.SW?"y"===this.vW&&this.SW&&(i.max.y=Math.min(i.max.y,t)):i.min.y=Math.max(i.min.y,t):i.min.x=Math.max(i.min.x,t)}return i}}class by extends In{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Vz=new $m,this.GM=[],this.KW=new xy(this.At,this),this.qW=new Ay(this.At,this,(()=>this.cs.Ms())),this.tY=new Sy(this.GM,(t=>{t.coordsBuffer&&this.lz.jO(t.coordsBuffer),t.qU&&this.lz.jO(t.qU)}),!0),this.iY=new vy(this.At,this),this.sY=0,this.eY=0,this.hY=!1,this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,strokeFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},strokeFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t}}),this.NG=e,this.io=n,this.KU={type:"none"},this.lz=t.GG(),this.OG=t,this.QU=this.lz.EN;const o=this.At._i(),h=!0===(null==n?void 0:n.individualLookupValuesEnabled);let a,l,u,c=0;o||(a=c,c+=2),o&&(l=c,c+=4),h&&(u=c,c+=1);const d=((t,e)=>e?(e,i)=>((t,e)=>{if(!e){const e=t.length,i=new Float32Array(3*e);for(let s=0,r=0;sne(e,t,Float32Array))(o,h);this.rY={individualLookupValuesEnabled:h,attributesPerVertex:c,attributeOffsetCoordinateLowPrecision:a,attributeOffsetCoordinateHighPrecision:l,attributeOffsetLookUpValue:u,prepareRenderData:(t,e)=>d(t,this.Su.getFillStyle())}}nY(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.Yo.C(),h=this.Yo.u,a=this.jG.lineStyleSolid(i),l=this.jG.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.jG.strokeFillSolid(i),f=this.jG.strokeFillLinearGradient(i),g=this.jG.strokeFillRadialGradient(i),m=this.jG.strokeFillPaletted(i),y=d||f||g||m,p=this.rY.individualLookupValuesEnabled;if(l&&this.At instanceof Hi)return zt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.Tu=fe(this.Tu,s,{canReturnB:!0}),this.hl+=r);let A=this.Fu.u;const x=this.iY.XW(this.GM,this.Fu.C());if(x>0){let t=0;for(let e=0;e{t.qU&&(this.lz.jO(t.qU),t.qU=void 0)})),this.hY=!1),v&&(this.qW.PW(),this.GM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Xe,t.lastDataPoint=void 0})),this.tY.HW(),S=this.Tu,this.sY=0,this.eY=0);const b=this.qW.BW(S),M=b.length;if(M>0){let t=this.qW.LW(this.Tu)||(this.ta("ApplicationType",(t=>"InternalUI"===t.type))?this.hl:1e5);M/t>10&&(t=M/10),this.tY.GW(b,t,((t,e,i,s)=>{const r=this.KW.calculateUserDataPointsBoundaries(e),n=this.qW.RW(r,i,this.Tu)-s;return this.oY=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.lz.fN(t*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),lastDataPoint:e[i-1],qU:this.hY?this.lz.fN(2*t,this.nY(e,i,this.oY)):void 0}}),((t,e,i,s)=>{const r=hi(t.boundaries,this.KW.calculateUserDataPointsBoundaries(e)),n=this.qW.RW(r,t.existingCoordinatesCount+i,this.Tu)-(t.jointPointsCount+s);this.lz.AN(t.coordsBuffer,t.existingCoordinatesCount*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),this.hY&&t.qU&&this.lz.AN(t.qU,2*t.existingCoordinatesCount,this.nY(e,i,this.oY)),this.oY=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(A&&(this.el=this.iY.JW(this.GM,this.Fu.C())),this.Vz.XO(this.At),g?this.uU=_m(this.Xo||this.el,this.At,g.getPosition(),g.getExtent(),g.getShape(),this.lz.MO()):f?this.cU=Bm(this.Xo||this.el,this.At,f.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw zt.alert(t),new Error(t)}if(y&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.KU="primitive"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}),l&&sm.StippleTexture),mousePickingShader:o?this.lz.VV(sm["2D"],sm.MousePicking({useVertexId:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}),l&&sm.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),this.QU?sm.AliasedEdge:void 0,l&&sm.StippleTextureInstanced),mousePickingShader:o?this.lz.VV(sm["2D"],sm.MousePicking(),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0}),l&&sm.StippleTextureInstanced):void 0,geometry:cy(this.lz,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.KU={type:"none"}}return this.tW=l?this.lz.lG(l.getPattern()):void 0,this._u(e),this.al=!1,this.rl=[],this.Yo.u=!1,this.Fu.u=!1,this}WE(t,e){const i=this.lz.gl,s=this.KU;if(!s||"none"===s.type)return{};const r=1===t?s.mousePickingShader:s.shader;if(!r)return{};const{lineStyleDashed:n,fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l}=s;return this.lz.bz(r).OO(r,((r,u,c,d)=>{let f=!1;if(this.lz.WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(r("uScale"),this.Vz.YO()).GO(r("uDisp"),this.Vz.HO()).GO(d("uScaleStart_highpart"),this.Vz.yG()).GO(d("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(d("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(d("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(d("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(d("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(r("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(r("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t);else if(o)this.lz.iL(r("uColor"),o.getColor());else if(a){if(!this.uU)return!1;this.lz.ZN(c,this.uU,a)}else if(h){if(!this.cU)return!1;this.lz.QN(c,this.cU,h)}else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.lz.fG(c,l.lut,t)}const g=Ne(e);return this.KW.renderVisibleOnly(this.GM,(e=>{const{coordsBuffer:o}=e;if(!o)return;if(1===t){const[t,i]=g.Wt(e.existingDataPointsCount);this.lz.uN(r("uFirstId"),t),"triangulated"===s.type?this.lz.nG(c,i):this.lz.hG(c,i)}i.bindBuffer(i.ARRAY_BUFFER,o);const h="triangulated"===s.type?dy.YU:fy.YU;if(this.At._i()||void 0===this.rY.attributeOffsetCoordinateLowPrecision?this.At._i()&&void 0!==this.rY.attributeOffsetCoordinateHighPrecision&&h(!0,this.lz,o,c,this.rY.attributesPerVertex,this.rY.attributeOffsetCoordinateHighPrecision):h(!1,this.lz,o,c,this.rY.attributesPerVertex,this.rY.attributeOffsetCoordinateLowPrecision),n){if(!e.qU||!this.tW)return;"triangulated"===s.type?dy.HU(this.lz,c,e.qU,u("aLengthSoFarA"),u("aLengthSoFarB"),2,0):fy.HU(this.lz,c,e.qU,u("aLengthSoFar"),2,0),this.lz.GO(r("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(d("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(r("uStippleScale"),n.getPatternScale()).UO(r("uStippleTexture"),this.tW.uG,1)}if(l&&"value"===l.lookUpProperty&&void 0!==this.rY.attributeOffsetLookUpValue&&1!==t)if("triangulated"===s.type){const t=u("aLookupValueA");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(t,1),i.enableVertexAttribArray(t);const e=u("aLookupValueB");i.vertexAttribPointer(e,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.rY.attributeOffsetLookUpValue+this.rY.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(e,1),i.enableVertexAttribArray(e)}else{const t=u("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),i.enableVertexAttribArray(t)}if("triangulated"===s.type){const{thickness:i}=s;dy.WE(this.OG,s.geometry,c,this.QU&&1!==t,1===t,i,e.existingCoordinatesCount-1)}else fy.jU(this.OG,e.existingCoordinatesCount);f=!0}),void 0===this.Yi),i.bindBuffer(i.ARRAY_BUFFER,null),f})),{idCount:this.hl}}HG(t,e,i,s,r){return{}}ml(t,e){return Array.isArray(t)||(t=[t]),this.rl=fe(this.rl,t,{canReturnB:!0}),this.el=hi(this.el,e||e||this.KW.calculateUserDataPointsBoundaries(t)),this}Ot(){return super.Ot(),this.sY=0,this.eY=0,this.oY=void 0,this}dispose(){return super.dispose(),this.tY.$W(),this.qW.EW(),this.KU={type:"none"},this.tW=void 0,this}dz(){return this}oM(t){this.Sl()>0&&this.Os();const e=this.cl(),i=Qr(e,t,this.qo(),this.Nl,this.Gl,this.At,this.engine.At,this.el,this.KW.vW,this.KW.SW);return void 0!==i?e[i]:void 0}T_(t){this.Sl()>0&&this.Os();const e=this.cl(),i=e.length;if(0===i)return;const s=this.Nl?1:0,r=i-(this.Gl?2:1),n=this.qo();if(n===Jr.Nearest){let s,r,n=Ye;for(let o=0;o1}om(t,e,i,s,r){return"object"==typeof s?e?this.lz._N(t.attribute("aOffsetScale"),e,1).GO(t.uniform("uSizePixels"),[s.width,s.height]):this.lz.WO(t.uniform("uOffsetScale"),s.scale).GO(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.lz._N(t.attribute("aOffsetPixels"),e,1):this.lz.WO(t.uniform("uOffsetPixels"),s):this.lz.WO(t.uniform("uPointSize"),s),r?this.lz.NO(this.qE,0,{location:t.attribute("aInstanceGeo"),size:2}).TN(this.WU,0,this.uY,i):this.lz.om(this.lz.gl.POINTS,i),this}rO(){this.lz.jO(this.qE)}}const Cy=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new My(t,i,t.gl.TRIANGLE_FAN,e)},Ty=(t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05),u(-.05,-.5),u(i,-.5),u(i,.5),u(i,.5),u(-.05,.5),u(-.05,-.5)];return new My(t,s,t.gl.TRIANGLES,e)},wy=(t,i,s)=>{if(po(t))return wy(e.PointShape.Square,i,s);let r=i.iN.JV.get(t);if(t===e.PointShape.Circle||t===e.PointShape.HollowCircle){const n=s<=3?4:s<=5?8:s<=10?16:24;return t===e.PointShape.Circle?(r=i.iN.KV.get(n)||((t,e,i=0)=>{const s=function(t=25){return Qm(u(0,0),0,360,.5,.5,t)[0]}(e);return new My(t,s,t.gl.TRIANGLE_FAN,i)})(i,n),i.iN.KV.set(n,r),r):(r=i.iN.qV.get(n)||((t,e,i=0)=>{const s=[],r=2*Math.PI/e;for(let t=0;t<=e;t+=1){const e=t*r,i=Math.cos(e),n=Math.sin(e);s.push({x:.5*i,y:.5*n}),s.push({x:.3*i,y:.3*n})}return new My(t,s,t.gl.TRIANGLE_STRIP,i)})(i,n),i.iN.qV.set(n,r),r)}if(!r){switch(t){case e.PointShape.Triangle:r=((t,e=0)=>{const i=function(){const t=[],e=2/1.73205080757;return t.push(u(-e/2,.3333333333333333)),t.push(u(0,-.6666666666666666)),t.push(u(e/2,.3333333333333333)),t}();return new My(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=Cy(i);break;case e.PointShape.Plus:r=Ty(i);break;case e.PointShape.Cross:r=Ty(i,45);break;case e.PointShape.Diamond:r=Cy(i,45);break;case e.PointShape.Arrow:r=((t,e=0)=>{const i=.05,s=[u(-.05,-.5),u(i,-.5),u(i,.45),u(i,.45),u(-.05,.45),u(-.05,-.5),u(-.5,0),u(-.4,0),u(0,.4),u(0,.4),u(0,.5),u(-.5,0),u(.5,0),u(.4,0),u(0,.4),u(0,.4),u(0,.5),u(.5,0)];return new My(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new My(t,[{x:0,y:0},{x:0,y:.5},{x:.1,y:.1},{x:.5,y:.1},{x:.2,y:-.1},{x:.3,y:-.5},{x:0,y:-.25},{x:-.3,y:-.5},{x:-.2,y:-.1},{x:-.5,y:.1},{x:-.1,y:.1},{x:0,y:.5}],t.gl.TRIANGLE_FAN,e))(i);break;case e.PointShape.Minus:r=((t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05)];return new My(t,s,t.gl.TRIANGLES,e)})(i);break;default:return ze(0,"LightningChart JS unidentified point shape")}i.iN.JV.set(t,r)}return r};class Ey extends xn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.$G=m(c(He,He),c(Ye,Ye)),this.jG=Eg({pointStyleSolid:()=>U(this.Ie)&&this.Ie,pointStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,pointStyleLinearGradient:()=>at(this.Ie)&&this.Ie,pointStylePaletted:()=>j(this.Ie)&&this.Ie,pointStyleIndividual:()=>H(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG()}Os(){var t;const e=this.Yo.C(),i=this.Yo.u,s=this.rl,r=s.length,n=r>0,o=this.qa.C(),h=this.Ie,a=this.size.C(),l=this.qa.u||this.ka.u,u=this.At.Ni(),c=this.size.u||this.qa.u,d=this.al||s&&s.length>0,f=u||c,g=this.fa(),m=this.jG.pointStyleSolid(g),y=this.jG.pointStyleRadialGradient(g),p=this.jG.pointStyleLinearGradient(g),A=this.jG.pointStylePaletted(g),x=this.jG.pointStyleIndividual(g),S=m||y||p||A||x;if(n&&(this.Ka=fe(this.Ka,s,{canReturnB:!0}),this.hl+=r),n||this.al){this.el=this.ol?hi(this.el,this.ol):hi(this.el,ni(this.Ka));const t=ne(this.Ka,this.At._i());this.fY=this.hl,this.AY=this.lz.zO(t,!1,this.AY)}this.Vz.XO(this.At),h!==_?f&&(this.gY&&(this.gY=void 0),a>1||this.tl.C()?a<=1&&!this.tl.C()?this.WU=this.lz.gl.POINTS:(this.gY=wy(o,this.lz,this.tl.C()?25:a),this.WU=this.gY.WU):this.WU=this.lz.gl.POINTS):this.gY&&(this.gY=void 0);const v=(null===(t=this.gY)||void 0===t?void 0:t.cY)||0,b=this.ka.C()+v;if(c||g||i||l){const t=this.tl.C()?"attribute":"uniform",i=a<=1&&sm.PointSize(t),s=sm.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.il.C()||b%360!=0)&&{dataType:this.il.C()?"attribute":"uniform"}}:void 0,axisWorldTranslation:wg(this.At),normalSource:void 0});this.Gz=S?this.lz.VV(sm["2D"],i,s,m?sm.Color({dataType:"uniform"}):x?sm.Color({dataType:"attribute"}):A?sm.Color({dataType:["lookup",A.getLookUpProperty(),A.lut]}):y?sm.Color({dataType:["gradient",y]}):p?sm.Color({dataType:["gradient",p]}):void 0):void 0,this.fU=e&&S?this.lz.VV(sm["2D"],i,s,sm.MousePicking()):void 0}if(d||g){const t=this.Ka.length;if(H(h)&&this.fY&&this.fY>0){const e=h.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&a>1){const e=new Float32Array(t);for(let i=0;i0&&a>1){const e=new Float32Array(2*t),i=Ci(b),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.ll={min:e,max:t}}return this.Aa=h,this.qa.u=!1,this.size.u=!1,this.ka.u=!1,this.Yo.u=!1,this.al=!1,this}WE(t,e){const i=1===t?this.fU:this.Gz,s=this.AY,r=this.fY,n=this.hl;return i&&s&&r&&(this.lz.bz(i),this.lz.OO(i,((i,o,h,a)=>{var l;if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(a("uScaleStart_highpart"),this.Vz.yG()).GO(a("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(a("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(a("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(a("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(a("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.lz.qN(h,s,this.At._i(),this.gY?1:void 0).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).WO(a("uDevicePixelRatio"),this.lz.MO()),this.gY){const t=o("aInstanceGeo");this.lz.vN(t,this.gY.qE).xN(t,0)}if(1===t)this.lz.uN(i("uFirstId"),e).nG(h,n);else if(U(this.Ie))this.lz.iL(i("uColor"),this.Ie.getColor());else if(H(this.Ie)&&this.pY){const t=o("aColor");this.lz.MN(t,this.pY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}else if(j(this.Ie)){if("value"===this.Ie.getLookUpProperty()&&this.vY){const t=o("aLookupValue");this.lz._N(t,this.vY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}const t=kg(this.Ie,this,this.ll);if(!t&&this.Ie.lut.percentageValues)return!1;this.lz.fG(h,this.Ie.lut,t)}else if(nt(this.Ie)){if(!this.iU)return!1;this.lz.ZN(h,this.iU,this.Ie)}else if(at(this.Ie)){if(!this.sU)return!1;this.lz.QN(h,this.sU,this.Ie)}if(this.yY&&this.WU!==this.lz.gl.POINTS){const t=o("aOffsetPixels");this.lz._N(t,this.yY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}else if(this.WU!==this.lz.gl.POINTS){const t=i("uOffsetPixels");this.lz.WO(t,this.size.C())}const u=((null===(l=this.gY)||void 0===l?void 0:l.cY)||0)+this.ka.C();if(this.mY&&this.WU!==this.lz.gl.POINTS){const t=o("aRot");this.lz.vN(t,this.mY),this.WU!==this.lz.gl.POINTS&&this.lz.xN(t,1)}else if(this.WU!==this.lz.gl.POINTS&&u%360!=0){const t=Ci(u),e=Math.sin(t),s=Math.cos(t);this.lz.GO(i("uRot"),[e,s])}if(this.WU===this.lz.gl.POINTS)this.lz.WO(i("uPointSize"),this.size.C());else{const t={x:2/this.cs.oi().x,y:2/this.cs.oi().y};this.lz.GO(i("uRatioPxClip"),[t.x,t.y])}let c=!1;return this.WU===this.lz.gl.POINTS?(this.lz.om(this.WU,r),c=!0):this.gY&&(this.lz.TN(this.WU,0,this.gY.uY,r),c=!0),c}))),{idCount:n}}HG(t,e,i,s,r){return{}}hd(t){this.Sl()>0&&this.Os();const e=this.cl(),i=Qr(e,t,this.qo(),!1,!1,this.At,this.cs.At,this.el,void 0,void 0);return void 0!==i?e[i]:void 0}Re(t){return super.Re(t)}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return this.tl.C()?25:this.size.C()}Dl(){return this.tl.C()?25:this.size.C()}dz(){return this.AY&&(this.lz.jO(this.AY),this.AY=void 0),this.gY&&(this.gY=void 0),this.pY&&(this.lz.jO(this.pY),this.pY=void 0),this.mY&&(this.lz.jO(this.mY),this.mY=void 0),this.vY&&(this.lz.jO(this.vY),this.vY=void 0),this}}class ky extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.KU={fill:void 0,border:void 0},this.Vz=new $m,this.el=Xe,this.SY=!1,this.xY=!1,this.bY=!1,this.MY=!1,this._Y=!1,this.Pd=[],this.jG=Eg({polygonStyleSolid:()=>U(this.Ie)&&this.Ie,polygonStyleImage:()=>tt(this.Ie)&&this.Ie,polygonStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,polygonStyleLinearGradient:()=>at(this.Ie)&&this.Ie,polygonStylePaletted:()=>j(this.Ie)&&this.Ie,polygonStyleIndividual:()=>H(this.Ie)&&this.Ie,lineStyleSolid:()=>cs(this.Pe)&&this.Pe,lineStyleDashed:()=>go(this.Pe)&&this.Pe,lineStyleFilled:()=>{const t=this.Pe&&this.Pe.getFillStyle();return U(t)&&t}}),this.OG=t,this.NG=e,this.lz=t.GG(),this.QU=this.lz.EN}Zr(){const t={vs:e=>this.aW(t,e),ds:e=>this.lW(t,e),Fl:e=>this.wY(t,e),yb:e=>this.CY(t,e),iL:e=>this.cW(t,e),Ka:[],M:void 0,kY:void 0,jo:0,fW:!0,TY:this.Pd.length};return this.Pd.push(t),t}Ot(){var t;return this.Pd.length=0,this.SY=!0,this.Ps&&this.Nn&&(null===(t=this.cs.On)||void 0===t?void 0:t.entity)===this&&this.Nn(this,void 0,this.cs.On.collectionMember),this}Bm(){return this.Pd}Bd(t){var e;const i=this.Pd.indexOf(t);i>=0&&(this.Pd.splice(i,1),this._Y=!0,this.Ps&&this.Nn&&(null===(e=this.cs.On)||void 0===e?void 0:e.entity)===this&&this.cs.On.collectionMember===t&&this.Nn(this,void 0,this.cs.On.collectionMember))}aW(t,e){var i;return t.fW=e,this._Y=!0,this.Ps&&this.Nn&&(null===(i=this.cs.On)||void 0===i?void 0:i.entity)===this&&this.cs.On.collectionMember===t&&!t.fW&&this.Nn(this,void 0,this.cs.On.collectionMember),t}lW(t,e){return t.jo=e,this.MY=!0,t}wY(t,e){return t.Ka=e,this.SY=!0,t}CY(t,e){return t.M=e,this.xY=!0,t}cW(t,e){return t.kY=null==e?void 0:e.toUint32(),this.bY=!0,t}Os(){const t=this.Yo.C(),e=this.Yo.u,i=this.fa(),s=this.MY,r=this.SY,n=this.xY,o=this.bY,a=this._Y,l=this.Pe,u=this.ma(),c=this.Pd.filter((t=>t.fW&&t.Ka.length>0));if(this.Vz.XO(this.At),(r||a)&&(this.el=hi(...c.map((t=>ni(t.Ka))))),r||a){const t=c.map((t=>[...t.Ka,t.Ka[0],{x:Number.NaN,y:Number.NaN}])).flat(),e=ne(t,!1,Float64Array),i=this.At._i()?ne(t,!0):e;this.JU=this.lz.zO(i,!1,this.JU);let s=[];c.reduce(((t,i)=>{const r=t,n=2*(i.Ka.length+1),o=new Float64Array(e.buffer,r,n),a=h.default(o,void 0,2),l=t/(2*Float64Array.BYTES_PER_ELEMENT);for(let t=0;tt+e.Ka.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Ka.length+2;for(let r=i;rt+e.Ka.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Ka.length+2;for(let r=i;rt+e.Ka.length+2),0),e=new Float32Array(t);let i=0;const s={min:Ye,max:He};c.forEach((t=>{const r=void 0!==t.M?t.M:-34028234663852886e22,n=t.Ka.length+2;for(let t=i;tt+e.Ka.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():k.toUint32();c.forEach((t=>{const r=void 0!==t.kY?t.kY:s,n=t.Ka.length+2;for(let t=i;tt+e.Ka.length),2*c.length),e=new Float32Array(2*t);let i=0;c.forEach((t=>{let s=t.Ka[0],r=0,n=0;for(const o of t.Ka)r+=Math.abs(o.x-s.x),n+=Math.abs(o.y-s.y),e[i]=r,e[i+1]=n,i+=2,s=o;e[i+0]=r+Math.abs(t.Ka[0].x-s.x),e[i+1]=n+Math.abs(t.Ka[0].y-s.y),e[i+2]=Number.NaN,e[i+3]=Number.NaN,i+=4})),this.qU=this.lz.zO(e,!1,this.qU)}this.tW=this.lz.lG(S.getPattern())}else this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.tW=void 0;return this.zY=this.lz.AG(this,this.zY,p,void 0,r||a||this.At.Ni(),((t,e,i)=>this.VY(t,e,i,c))),this.MY=!1,this._Y=!1,this.SY=!1,this.xY=!1,this.bY=!1,this.Yo.u=!1,this.ya(this.Ie),this.xa(l),this}WE(t,e){var i,s;const{fill:r,border:n}=this.KU,o=this.JU,h=this.DY,a=this.BY;if(!o||!h)return{};if(r){const{fillStyleSolid:s,fillStyleLinearGradient:n,fillStyleRadialGradient:l,fillStylePaletted:u,fillStyleImage:c,fillStyleIndividual:d}=r,f=this.FY,g=this.IY,m=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;m&&o&&f&&void 0!==g&&this.lz.bz(m).OO(m,((i,r,m,y)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(y("uScaleStart_highpart"),this.Vz.yG()).GO(y("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(y("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(y("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(y("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(y("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.lz.qN(m,o,this.At._i(),void 0).wN(f)._N(r("aIsHighlighted"),h).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.lz.uN(i("uFirstId"),e),!a)return!1;this.lz._N(r("aPickingIdOffset"),a)}else if(s)this.lz.iL(i("uColor"),s.getColor());else if(l){if(!this.iU)return!1;this.lz.ZN(m,this.iU,l)}else if(n){if(!this.sU)return!1;this.lz.QN(m,this.sU,n)}else if(u){const t=kg(u,this,this.LY);if(!t&&u.lut.percentageValues)return!1;if(this.lz.fG(m,u.lut,t),"value"===u.getLookUpProperty()){if(!this.RY)return!1;this.lz._N(r("aLookupValue"),this.RY)}}else if(c){if(!this.zY)return!1;this.lz.iL(y("uColor"),c.getSurroundingColor()).UO(i("uColorTexture"),this.zY.texture.vO()||this.zY.sourceMissingTexture,0).NO(this.zY.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).cN(c.fitMode)}else if(d){if(!this.EY)return!1;const t=r("aColor");this.lz.gl.bindBuffer(this.lz.gl.ARRAY_BUFFER,this.EY),this.lz.gl.vertexAttribPointer(t,4,this.lz.gl.UNSIGNED_BYTE,!0,0,0),this.lz.gl.enableVertexAttribArray(t)}return this.lz.kN(g,void 0,void 0,this.lz.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:i,fillStyleSolid:r,thickness:l,lineStyleDashed:u}=n,c=this.PY,d=1===t?null===(s=n.mousePicking)||void 0===s?void 0:s.shader:n.shader;d&&o&&c&&this.lz.bz(d).OO(d,((s,n,d,f)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(s("uScale"),this.Vz.YO()).GO(s("uDisp"),this.Vz.HO()).GO(f("uScaleStart_highpart"),this.Vz.yG()).GO(f("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(f("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(f("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(f("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(f("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(s("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(s("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),this.lz.NO(h,1,{location:n("aIsHighlighted"),size:1}).iL(s("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0),1===t){if(this.lz.uN(s("uFirstId"),e),!a)return!1;this.lz._N(n("aPickingIdOffset"),a,1)}else r&&this.lz.iL(s("uColor"),r.getColor());if(u){if(!this.tW||!this.qU)return!1;dy.HU(this.lz,d,this.qU,n("aLengthSoFarA"),n("aLengthSoFarB"),2,0),this.lz.GO(s("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(f("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(s("uStippleScale"),u.getPatternScale()).UO(s("uStippleTexture"),this.tW.uG,1)}return dy.YU(this.At._i(),this.lz,o,d,this.At._i()?4:2,0),dy.WE(this.OG,i,d,this.QU&&1!==t,1===t,l,c),!0}))}return{idCount:this.Pd.length}}VY(t,e,i,s){const r=yt({x:this.el.min.x,y:this.el.min.y},this.At,this.cs.At),n=yt({x:this.el.max.x,y:this.el.max.y},this.At,this.cs.At),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Um(t,e,o.x,o.y,i),a=h[1],l=h[4],u=h[6],c=h[7],d=s.reduce(((t,e)=>t+e.Ka.length+2),0),f=new Float32Array(2*d),g=this.el.max.x-this.el.min.x,m=this.el.max.y-this.el.min.y,y=l-u,p=c-a;let A=0;for(const t of s){for(const e of t.Ka){const t=u+y*((e.x-this.el.min.x)/g),i=a+p*((e.y-this.el.min.y)/m);f[A]=t,f[A+1]=i,A+=2}const e=u+y*((t.Ka[0].x-this.el.min.x)/g),i=a+p*((t.Ka[0].y-this.el.min.y)/m);f[A]=e,f[A+1]=i,A+=2,f[A]=Number.NaN,f[A+1]=Number.NaN,A+=2}return f}HG(t,e,i,s,r){return{collectionMember:this.Pd.find((i=>e+i.TY===t))}}dz(){return this.FY&&(this.lz.jO(this.FY),this.FY=void 0),this.JU&&(this.lz.jO(this.JU),this.JU=void 0),this.DY&&(this.lz.jO(this.DY),this.DY=void 0),this.BY&&(this.lz.jO(this.BY),this.BY=void 0),this.RY&&(this.lz.jO(this.RY),this.RY=void 0),this.EY&&(this.lz.jO(this.EY),this.EY=void 0),this.qU&&(this.lz.jO(this.qU),this.qU=void 0),this.KU={fill:void 0,border:void 0},this.zY=this.lz.gG(this,this.zY),this}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return Re(this.Pe)}Dl(){return Re(this.Pe)}}class Iy extends Sn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.OY=Xe,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,fillStyleLinearGradient:()=>at(this.Ie)&&this.Ie,fillStyleImage:()=>tt(this.Ie)&&this.Ie,strokeStyleSolid:()=>cs(this.Pe)&&this.Pe,strokeFillSolid:()=>{const t=this.Pe.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Pe.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Pe.getFillStyle();return nt(t)&&t}}),this.VY=(t,e,i)=>{const s=yt(this.Ua(),this.At,this.cs.At),r=pi(yt(yi(this.Ua(),this.oi()),this.At,this.cs.At),s);return Um(t,e,r.x,r.y,i)},this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e}Os(){super.Os();const t=this.Yo.C(),e=this.fa(),i=this.Ma.u||this.Z.u||this.ka.u||this.Fa.u,s=this.Pe,r=this.ma(),n=s.getThickness(),o=this.ka.C();this.Vz.XO(this.At);const h=this.At.Ni();if(i){const t=this.Z.C();this.Ka=function(t,e,i,s,r){const n=((t,e,i)=>[t,u(t.x+e,t.y),u(t.x+e,t.y+i),u(t.x,t.y+i)])(t,e,i);if(0!==s||s%360!=0){const t=s*Math.PI/180;n[0]=ui(n[0],r,t),n[1]=ui(n[1],r,t),n[2]=ui(n[2],r,t),n[3]=ui(n[3],r,t)}return n}(this.Ma.C(),t.x,t.y,o,this.Fa.C());const e=ne(this.Ka,this.At._i());this.JG=this.lz.zO(e,!1,this.JG),this.qG=this.Ka.length,this.OY=ni(this.Ka)}const a=this.jG.fillStyleSolid(e),l=this.jG.fillStyleRadialGradient(e),c=this.jG.fillStyleLinearGradient(e),d=this.jG.fillStyleImage(e),f=a||l||c||d;e&&(this.eU=f?this.lz.VV(sm["2D"],a&&sm.Color({dataType:"uniform"}),c&&sm.Color({dataType:["gradient",c]}),l&&sm.Color({dataType:["gradient",l]}),d&&sm.Color({dataType:["image",d]}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),l?this.iU=_m(this.Xo||this.OY,this.At,l.getPosition(),l.getExtent(),l.getShape(),this.lz.MO()):c?this.sU=Bm(this.Xo||this.OY,this.At,c.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0),this.zY=this.lz.AG(this,this.zY,d,void 0,h||i,this.VY);const g=this.jG.strokeStyleSolid(r),m=this.jG.strokeFillSolid(r),y=this.jG.strokeFillLinearGradient(r),p=this.jG.strokeFillRadialGradient(r),A=g,x=m||y||p;if(A&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.hU,this.NY]=[this.Ka,void 0];else{const t=this.At;[this.hU,this.NY]=t instanceof Hi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Wi(s,r,h,-h),i.Wi(r,s,-h,-h),i.Wi(o,n,-h,-h),i.Wi(n,o,h,-h),i.Wi(s,r,-h,h),i.Wi(r,s,h,h),i.Wi(o,n,h,h),i.Wi(n,o,-h,h)],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Ka,n,t):((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=u(e.x*i*.5,e.y*i*.5),a=di(ci(r,s)),l=di(ci(o,s)),c=Si(a),d=Si(l);return[[yi(s,yi(mi(c,h.x),mi(d,h.y))),yi(r,yi(mi(a,h.x),mi(d,h.y))),yi(o,yi(mi(c,h.x),mi(l,h.y))),yi(n,yi(mi(a,h.x),mi(l,h.y))),yi(s,yi(mi(a,h.x),mi(l,h.y))),yi(r,yi(mi(c,h.x),mi(l,h.y))),yi(o,yi(mi(a,h.x),mi(d,h.y))),yi(n,yi(mi(c,h.x),mi(d,h.y)))],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Ka,t.Ui(),n)}this.nU=this.lz.zO(ne(this.hU,this.At._i()),!1,this.nU),this.NY?(this.GU=this.lz.yN(new Uint16Array(this.NY),this.GU),this.rU=this.NY.length):(this.GU&&this.lz.jO(this.GU),this.GU=void 0,this.rU=this.hU.length)}return r&&(this.dU=A&&x?this.lz.VV(sm["2D"],sm.Color({dataType:p?["gradient",p]:y?["gradient",y]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),p?this.uU=_m(this.OY,this.At,p.getPosition(),p.getExtent(),p.getShape(),this.lz.MO()):y?this.cU=Bm(this.OY,this.At,y.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),this.fU=t&&f?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.AU=t&&this.Pe!==ut?this.AU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.ya(this.Ie),this.xa(s),this.Ma.u=!1,this.ka.u=!1,this.Z.u=!1,this.Fa.u=!1,this}WE(t,e){const i=1===t?this.fU:this.eU,s=this.JG,r=this.qG,n=this.jG.fillStyleSolid(!1),o=this.jG.fillStyleRadialGradient(!1),h=this.jG.fillStyleLinearGradient(!1),a=this.jG.fillStyleImage(!1);i&&s&&r&&this.Ie!==_&&(this.lz.bz(i),this.lz.OO(i,((i,l,u,c)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(c("uScaleStart_highpart"),this.Vz.yG()).GO(c("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(c("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(c("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(c("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(c("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(i("uFirstId"),e).nG(u,1);else if(n)this.lz.iL(i("uColor"),n.getColor());else if(o){if(!this.iU)return!1;this.lz.ZN(u,this.iU,o)}else if(h){if(!this.sU)return!1;this.lz.QN(u,this.sU,h)}else if(a){if(!this.zY)return!1;const t=this.zY&&this.zY.texture.vO();this.lz.iL(c("uColor"),a.getSurroundingColor()).UO(i("uColorTexture"),t||this.zY.sourceMissingTexture,0).NO(this.zY.texCoordsBuffer,void 0,{location:l("aTextureCoord"),size:2}).cN(a.fitMode)}return this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).qN(u,s,this.At._i(),void 0).om(this.lz.gl.TRIANGLE_FAN,r),!0})));const l=1===t?this.AU:this.dU,u=this.jG.strokeStyleSolid(!1),c=this.jG.strokeFillSolid(!1),d=this.jG.strokeFillLinearGradient(!1),f=this.jG.strokeFillRadialGradient(!1),g=this.nU;return l&&g&&u&&(this.lz.bz(l),this.lz.OO(l,((i,s,r,n)=>{if(this.At instanceof Yi||this.At instanceof Wc?this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(n("uScaleStart_highpart"),this.Vz.yG()).GO(n("uScaleStart_lowpart"),this.Vz.mG()):this.At instanceof Hi&&this.lz.GO(n("uScaleStart"),this.Vz.MixedScaleXY.uScaleStart).GO(n("uScaleStartLog"),this.Vz.MixedScaleXY.uScaleStartLog).GO(n("uScaleInterval"),this.Vz.MixedScaleXY.uScaleInterval).GO(n("uScaleIntervalLog"),this.Vz.MixedScaleXY.uScaleIntervalLog).GO(i("uViewportStart"),this.Vz.MixedScaleXY.uViewportStart).GO(i("uViewportSize"),this.Vz.MixedScaleXY.uViewportSize),1===t)this.lz.uN(i("uFirstId"),e).nG(r,1);else if(c)this.lz.iL(i("uColor"),c.getColor());else if(f){if(!this.uU)return!1;this.lz.ZN(r,this.uU,f)}else if(d){if(!this.cU)return!1;this.lz.QN(r,this.cU,d)}return this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).qN(r,g,this.At._i(),void 0),this.GU?this.lz.wN(this.GU).kN(this.rU):this.lz.om(this.lz.gl.LINE_LOOP,this.rU),!0}))),{idCount:1}}HG(t,e,i,s,r){return{}}dz(){return this.GU&&(this.lz.jO(this.GU),this.GU=void 0),this.JG&&(this.lz.jO(this.JG),this.JG=void 0),this.nU&&(this.lz.jO(this.nU),this.nU=void 0),this.zY=this.lz.gG(this,this.zY),this.eU=void 0,this.dU=void 0,this.fU=void 0,this.AU=void 0,this}St(){return Math.max(this.Ma.C().x,this.Ma.C().x+this.Z.C().x)}vt(){return Math.min(this.Ma.C().x,this.Ma.C().x+this.Z.C().x)}bt(){return Math.max(this.Ma.C().y,this.Ma.C().y+this.Z.C().y)}xt(){return Math.min(this.Ma.C().y,this.Ma.C().y+this.Z.C().y)}Pl(){return Re(this.Pe)}Dl(){return Re(this.Pe)}}class zy extends bn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vz=new $m,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie,fillStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,fillStyleLinearGradient:()=>at(this.Ie)&&this.Ie,fillStyleImage:()=>tt(this.Ie)&&this.Ie,strokeLineStyleSolid:()=>cs(this.Pe)&&this.Pe,strokeLineSolidFill:()=>{const t=this.Pe.getFillStyle();return U(t)&&t},strokeLinearGradientFill:()=>{const t=this.Pe.getFillStyle();return at(t)&&t},strokeRadialGradientFill:()=>{const t=this.Pe.getFillStyle();return nt(t)&&t}}),this.VY=(t,e,i)=>{const s=yt({x:this.el.min.x,y:this.el.min.y},this.At,this.cs.At),r=yt({x:this.el.max.x,y:this.el.max.y},this.At,this.cs.At),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Um(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Ka.length),d=this.el.max.x-this.el.min.x,f=this.el.max.y-this.el.min.y,g=a-l,m=u-h;let y=0;for(const t of this.Ka){const e=l+g*((t.x-this.el.min.x)/d),i=h+m*((t.y-this.el.min.y)/f);c[y]=e,c[y+1]=i,y+=2}return c},this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e}hd(t){let e,i=Number.MAX_VALUE;for(const s of this.Ka){const r=ei(yt(s,this.At,this.cs.At),t);r=3,r=this.Pe,n=this.ma(),o=r.getThickness(),a=this.Sa(o);this.Vz.XO(this.At),this.PT=this.At.Ui();const l=this.At.Ni();if(i&&(this.el=ni(this.Ka)),i&&s){const t=ne(this.Ka,this.At._i());this.JG=this.lz.zO(t,!1,this.JG),this.GY=new Uint16Array(h.default(t)),this.UY=this.lz.yN(this.GY,this.UY),this.qG=this.GY.length}const u=this.jG.fillStyleSolid(e),c=this.jG.fillStylePaletted(e),d=this.jG.fillStyleRadialGradient(e),f=this.jG.fillStyleLinearGradient(e),g=this.jG.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.eU=m?this.lz.VV(sm["2D"],u&&sm.Color({dataType:"uniform"}),f&&sm.Color({dataType:["gradient",f]}),d&&sm.Color({dataType:["gradient",d]}),c&&sm.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&sm.Color({dataType:["image",g]}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),d?this.iU=_m(this.Xo||this.el,this.At,d.getPosition(),d.getExtent(),d.getShape(),this.lz.MO()):f?this.sU=Bm(this.Xo||this.el,this.At,f.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0),this.zY=this.lz.AG(this,this.zY,g,void 0,l||i,this.VY),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Ka:ty(this.Ka,this.PT,o);this.hU=ne(t,this.At._i()),this.nU=this.lz.zO(this.hU,!0,this.nU),this.rU=t.length}const y=this.jG.strokeLineStyleSolid(n),p=this.jG.strokeLineSolidFill(n),A=this.jG.strokeLinearGradientFill(n),x=this.jG.strokeRadialGradientFill(n),S=y,v=p||A||x;return n&&(this.dU=S&&v?this.lz.VV(sm["2D"],sm.Color({dataType:x?["gradient",x]:A?["gradient",A]:"uniform"}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0),x?this.uU=_m(this.Xo||this.el,this.At,x.getPosition(),x.getExtent(),x.getShape(),this.lz.MO()):A?this.cU=Bm(this.Xo||this.el,this.At,A.getAngle(!0),this.lz.MO()):(this.uU=void 0,this.cU=void 0),this.fU=t&&m?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.AU=t&&this.Pe!==ut?this.fU||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})):void 0,this.Tl=!1,this.ya(this.Ie),this.xa(r),this}WE(t,e){const i=1===t?this.fU:this.eU,s=this.JG,r=this.qG,n=this.jG.fillStyleSolid(!1),o=this.jG.fillStyleRadialGradient(!1),h=this.jG.fillStyleLinearGradient(!1),a=this.jG.fillStylePaletted(!1),l=this.jG.fillStyleImage(!1);i&&s&&r&&this.lz.bz(i).OO(i,((i,r,u,c)=>{if(this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).GO(c("uScaleStart_highpart"),this.Vz.yG()).GO(c("uScaleStart_lowpart"),this.Vz.mG()).qN(u,s,this.At._i(),void 0).wN(this.UY).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1===t)this.lz.uN(i("uFirstId"),e).nG(u,1);else if(n)this.lz.iL(i("uColor"),n.getColor());else if(o){if(!this.iU)return!1;this.lz.ZN(u,this.iU,o)}else if(h){if(!this.sU)return!1;this.lz.QN(u,this.sU,h)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.lz.fG(u,a.lut,t)}else if(l){if(!this.zY)return!1;this.lz.iL(c("uColor"),l.getSurroundingColor()).UO(i("uColorTexture"),this.zY.texture.vO()||this.zY.sourceMissingTexture,0).NO(this.zY.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).cN(l.fitMode)}return this.lz.kN(this.qG),!0}));const u=1===t?this.AU:this.dU,c=this.Pe,d=this.nU,f=this.rU;return u&&d&&f&&this.lz.bz(u).OO(u,((i,s,r,n)=>{this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).qN(r,d,this.At._i(),void 0);const o=c.getFillStyle();if(1===t)this.lz.uN(i("uFirstId"),e).nG(r,1);else if(U(o))this.lz.iL(i("uColor"),o.getColor());else if(nt(o)){if(!this.uU)return!1;this.lz.ZN(r,this.uU,o)}else if(at(o)){if(!this.cU)return!1;this.lz.QN(r,this.cU,o)}const h=c.getThickness(),a=-1===h||1===h;return this.lz.om(a?this.lz.gl.LINE_LOOP:this.lz.gl.TRIANGLE_STRIP,this.rU),!0})),{idCount:1}}HG(t,e,i,s,r){return{}}dz(){return this.UY&&(this.lz.jO(this.UY),this.UY=void 0),this.JG&&(this.lz.jO(this.JG),this.JG=void 0),this.nU&&(this.lz.jO(this.nU),this.nU=void 0),this.eU=void 0,this.dU=void 0,this.fU=void 0,this.AU=void 0,this.zY=this.lz.gG(this,this.zY),this}}const Fy=(t,e)=>{let i=0;const s=[];for(;i0;n-=o?1:0,n-=i+n{let i=0;const s=[];for(;i0;n-=o?1:0,n-=0;const h=Math.min(n,t-r),a=i-(o?1:0),l={start:a,startUnique:r,sizeData:Math.min(e,t-a),sizeUniqueData:h};s.push(l),i+=h}return s},Dy=(t,e,i,s)=>{if(i){const t=new Map;return e.gridTiles.forEach((e=>{t.set(e,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:e.sizeHeatmapDataVectors}]})})),t}const r=new Map;for(let i=0;i{const e=t.iFirstVector,i=s(t),o={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},h=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ze(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const c=(d=a,f=h,m(u(Math.max(Math.min(d[0].x,d[2].x),Math.min(f[0].x,f[2].x)),Math.max(Math.min(d[0].y,d[2].y),Math.min(f[0].y,f[2].y))),u(Math.min(Math.max(d[0].x,d[2].x),Math.max(f[0].x,f[2].x)),Math.min(Math.max(d[0].y,d[2].y),Math.max(f[0].y,f[2].y)))));var d,f;const g={primary:c.min.x-e.primary,secondary:c.min.y-e.secondary},y={primary:1+c.max.x-c.min.x,secondary:1+c.max.y-c.min.y};let p=!1;const A=[{x:g.primary,y:g.secondary},{x:g.primary+y.primary,y:g.secondary},{x:g.primary+y.primary,y:g.secondary+y.secondary},{x:g.primary,y:g.secondary+y.secondary}];for(let t=0;t{if(1!==t.length||0!==e.startPrimary||0!==e.startSecondary||e.lengthPrimary!==t[0].sizeHeatmapDataVectors.primary||e.lengthSecondary!==t[0].sizeHeatmapDataVectors.secondary)t.forEach((t=>{const s=i(t),r=Math.max(e.startPrimary,t.iFirstVector.primary),n=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),h=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=r;i<=n;i+=1){const r=i-e.startPrimary,n=e.values[r],a=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=h;i+=1){const r=i-e.startSecondary,o=i-t.iFirstVector.secondary,h=n[r];s[a+o]=h}}}));else{const s=t[0],r=i(s);for(let t=0;t{var s,r;const n=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(n)return t.$N(null,n.RED,!1,!0,{x:e,y:i},!1,n.FLOAT,n.R32F);const o=t.gl;return(null===(r=t.gl1)||void 0===r?void 0:r.optional.OES_texture_float)?t.$N(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.$N(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Ly=(t,e,i,s)=>{e.forEach(((e,r)=>{var n,o;const h=i(r),a=s(r),l=t.gl;l.bindTexture(l.TEXTURE_2D,a),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(n=t.gl2)||void 0===n?void 0:n.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/r.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*r.sizeHeatmapDataVectors.secondary,n=s+e.tileInvalidationLength.primary*r.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,h.subarray(s,n));else if(null===(i=t.gl1)||void 0===i?void 0:i.optional.OES_texture_float)l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,h.subarray(s,n));else{const t=new Uint8Array(h.buffer).subarray(4*s,4*n);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,h):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,h):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(h.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class _y extends mn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.WY=p("bilinear"),this.Pi={x:0,y:0},this.Cw={x:1,y:1},this.FS=Ur.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.io={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}ES(t){return this.WY._(t),this}zS(){return this.WY.C()}BS(t,e){return this.Pi=t,this.Cw=e,this}LS(){return{start:this.Pi,step:this.Cw,end:{x:this.Pi.x+this.Cw.x*this.io.columns,y:this.Pi.y+this.Cw.y*this.io.rows}}}IS(t){return this.FS="function"==typeof t?t(this.FS):t,this}RS(){return this.FS}}class By extends _y{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Vz=new $m,this.KU={},this.YY=[],this.HY=!1,this.al=!1,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie,wireframeStyleLine:()=>cs(this.FS)&&this.FS,wireframeStyleFill:()=>{const t=this.FS&&this.FS.getFillStyle();return U(t)&&t}}),this.$Y=Fy,this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e;const o=Math.min(this.lz.cz,void 0!==n.jY?n.jY:2048),h={x:Math.min(o,this.io.primaryDimensionVectorsCount),y:Math.min(o,this.io.secondaryDimensionVectorsCount)},a=((t,e,i)=>{const s=[],r=i(t.primaryDimensionVectorsCount,e.x),n=i(t.secondaryDimensionVectorsCount,e.y);let o;return r.forEach((t=>n.forEach((e=>{const i={iFirstVector:{primary:t.start,secondary:e.start},iFirstUniqueVector:{primary:t.startUnique,secondary:e.startUnique},sizeHeatmapDataVectors:{primary:t.sizeData,secondary:e.sizeData},sizeUniqueHeatmapDataVectors:{primary:t.sizeUniqueData,secondary:e.sizeUniqueData}};s.push(i)})))),o=[],s.forEach((t=>{let e=o.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},o.push(e)),e.tiles.push(t)})),{gridTiles:s,gridTileSizes:o}})(this.io,h,this.$Y),l=a.gridTiles.map((t=>{const e=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,intensityData:e,hasIntensityData:!1}})),u=a.gridTileSizes.map((t=>({...t,tiles:l.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary))})));this.ZY={gridTiles:l,gridTileSizes:u},this.BS(this.Pi,this.Cw)}Os(){const t=this.YY,e=this.Ie,i=this.fa(),s=this.FS,r=s!==this.QY,n=this.jG.fillStylePaletted(i),o=this.jG.fillStyleSolid(i),h=this.WY.u,a=this.WY.C(),l=this.al,u=this.Yo.C();this.JY=this.JY||this.KY();const c=this.JY,d=Dy(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Ly(this.lz,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.HY=!0),this.Vz.XO(this.At);const f=this.KU;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.lz.VV(sm["2D"],sm.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.io.dataOrder,intensityTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),flipXY:"rows"===this.io.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.lz.VV(sm["2D"],sm.Color({dataType:"uniform"}),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),flipXY:"rows"===this.io.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.jG.wireframeStyleLine(r),e=this.jG.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.lz.VV(sm["2D"],sm.Color({dataType:"uniform"}),sm.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.io.dataOrder,axisWorldTranslation:wg(this.At),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.lz.VV(sm["2D"],sm.Color({dataType:"uniform"}),sm.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.io.dataOrder,axisWorldTranslation:wg(this.At),normalSource:void 0})),geometry:cy(this.lz,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.qY=this.qY||this.tH():this.qY&&(this.lz.jO(this.qY.wireframeCoordinatesBuffer),this.qY=void 0)}if(f.mousePicking=u?this.KU.mousePicking||{shader:this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),flipXY:"rows"===this.io.dataOrder,normalSource:void 0}))}:void 0,this.KU=f,void 0===this.ll&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Ye,e=He;this.JY.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.ll={min:t,max:e}}return this.al=!1,this.YY.length=0,this.ya(e),this.QY=s,this.WY.u=!1,this}KY(){const t=this.ZY.gridTiles.map((t=>{const e=Oy(this.lz,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.ZY.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.lz.zO([0,0,1,0,0,1,1,1]),s=this.lz.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}tH(){const t=this.io.primaryDimensionVectorsCount+1+this.io.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.io.dataOrder?{x:this.Pi.x+this.Cw.x*t.iFirstVector.primary,y:this.Pi.y+this.Cw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.Cw.x*t.iFirstVector.secondary,y:this.Pi.y+this.Cw.y*t.iFirstVector.primary},i="columns"===this.io.dataOrder?{x:this.Cw.x*t.sizeHeatmapDataVectors.primary,y:this.Cw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Cw.x*t.sizeHeatmapDataVectors.secondary,y:this.Cw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.io.dataOrder?{x:this.Pi.x+this.Cw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.Cw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.Cw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.Cw.y*t.iFirstUniqueVector.primary},n="columns"===this.io.dataOrder?{x:this.Cw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Cw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Cw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Cw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.iH={boundaries:s,tilesInfo:r},this}WE(t,e){var i,s;const r=this.JY,n=this.iH,o=1===t?null===(i=this.KU.mousePicking)||void 0===i?void 0:i.shader:null===(s=this.KU.tile)||void 0===s?void 0:s.shader;if(this.KU.tile&&o&&r&&n){const i=o,s=this.KU.tile,h={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.Cw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.Cw.y)},a={x:h.x/this.io.columns,y:h.y/this.io.rows},l=this.At.Ui(),u={x:a.x/l.x,y:a.y/l.y};if("solid"===s.renderMode||1===t)this.lz.bz(i).OO(i,((i,n,o)=>{if(1===t)this.lz.uN(i("uFirstId"),e).nG(o,1);else if("solid"===s.renderMode){const{fillStyleSolid:t}=s;this.lz.iL(i("uColor"),t.getColor())}return this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).NO(r.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).GO(i("uScaling"),[this.Cw.x*this.io.columns,this.Cw.y*this.io.rows]).GO(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).om(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),!0}));else if("paletted"===s.renderMode){const{fillStylePaletted:e}=s,o=this.ll;this.lz.OO(i,((s,h,a)=>{let l=!1;var c,d;return this.lz.bz(i).GO(s("uScale"),this.Vz.YO()).GO(s("uDisp"),this.Vz.HO()).fG(a,e.lut,o).NO(r.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).WO(s("uIsHighlighted"),this.jo).iL(s("uHighlightColorOffset"),2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0),c=t=>{this.lz.GO(s("uTileDimensions"),["columns"===this.io.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.io.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const i=n.tilesInfo.get(t.tileData);if(!i)return;let o;const h=this.lz.MO();if("bilinear"===this.WY.C()){const t=(this.At.x.ft(i.startLocationAxis.x)+u.x/2)*h,e=(this.At.y.ft(i.startLocationAxis.y)+u.y/2)*h;o=[t,e,(this.At.x.ft(i.startLocationAxis.x+i.sizeAxis.x)-u.x/2)*h-t,(this.At.y.ft(i.startLocationAxis.y+i.sizeAxis.y)-u.y/2)*h-e]}else{const t=this.At.x.ft(i.startLocationAxis.x)*h,e=this.At.y.ft(i.startLocationAxis.y)*h;o=[t,e,this.At.x.ft(i.startLocationAxis.x+i.sizeAxis.x)*h-t,this.At.y.ft(i.startLocationAxis.y+i.sizeAxis.y)*h-e]}this.lz.nN(s("uTileBounds"),o).GO(s("uScaling"),[i.renderSizeAxis.x,i.renderSizeAxis.y]).GO(s("uTranslationAxis"),[i.startRenderLocationAxis.x,i.startRenderLocationAxis.y]).UO(s("uTileIntensityValues"),t.intensityDataTexture,1).om(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),l=!0},r.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),l}))}}const h=this.qY,a=this.KU.wireframe,l=1===t||null==a?void 0:a.shader;if(h&&a&&l&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.lz.bz(l).OO(l,((i,s,r)=>((this.At instanceof Yi||this.At instanceof Wc)&&this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()),this.lz.WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).iL(i("uColor"),e.getColor()).NO(h.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).GO(i("uScaling"),[this.Cw.x,this.Cw.y]).GO(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).om(this.lz.gl.LINES,2*h.wireframeSegmentsLength),!0)))}else if(h&&a&&l&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.lz.bz(l).OO(l,((r,n,o)=>((this.At instanceof Yi||this.At instanceof Wc)&&this.lz.GO(r("uScale"),this.Vz.YO()).GO(r("uDisp"),this.Vz.HO()),this.lz.WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0).iL(r("uColor"),s.getColor()).WO(r("uThicknessPixels"),i.getThickness()).GO(r("uRatioPxClip"),[2/this.cs.oi().x,2/this.cs.oi().y]).NO(h.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).GO(r("uScaling"),[this.Cw.x,this.Cw.y]).GO(r("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.bz(o,!1).om(h.wireframeSegmentsLength),!0)))}return{idCount:1}}HG(t,e,i,s,r){return{}}VS(t){return this.YY.push(t),Py(this.ZY.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.ll=void 0,this}Ot(){return this.HY&&(this.ZY.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.al=!0,this.HY=!1,this.ll=void 0),this}dispose(){super.dispose();const t=this.JY;t&&(t.gridTiles.forEach((t=>{this.lz.fz(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.lz.jO(t.rectangleLocationsBuffer)),this.JY=void 0;const e=this.qY;return e&&this.lz.jO(e.wireframeCoordinatesBuffer),this.qY=void 0,this.KU={},this}dz(){return this.dispose(),this}hd(t){const e=t,i="columns"===this.io.dataOrder?e.x:e.y,s="columns"===this.io.dataOrder?e.y:e.x,r="columns"===this.io.dataOrder?this.Pi.x:this.Pi.y,n="columns"===this.io.dataOrder?this.Pi.y:this.Pi.x;let o=(i-r)/("columns"===this.io.dataOrder?this.Cw.x:this.Cw.y),h=(s-n)/("columns"===this.io.dataOrder?this.Cw.y:this.Cw.x);o=Math.floor(_t(o,0,this.io.primaryDimensionVectorsCount-1)),h=Math.floor(_t(h,0,this.io.secondaryDimensionVectorsCount-1));const a=this.sH(o,h),l="columns"===this.io.dataOrder?{x:this.Pi.x+(o+.5)*this.Cw.x,y:this.Pi.y+(h+.5)*this.Cw.y}:{x:this.Pi.x+(h+.5)*this.Cw.x,y:this.Pi.y+(o+.5)*this.Cw.y},u="columns"===this.io.dataOrder?o:h,c="columns"===this.io.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}sM(t){const e=this.iH;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.io.dataOrder?i.x:i.y,r="columns"===this.io.dataOrder?i.y:i.x,n="columns"===this.io.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.io.dataOrder?this.Pi.y:this.Pi.x,h="columns"===this.io.dataOrder?this.Cw.x:this.Cw.y,a="columns"===this.io.dataOrder?this.Cw.y:this.Cw.x,l=_t((s-n)/h-.5,0,this.io.primaryDimensionVectorsCount-1),u=_t((r-o)/a-.5,0,this.io.secondaryDimensionVectorsCount-1),c=_t(Math.ceil(l)-1,0,this.io.primaryDimensionVectorsCount-1),d=_t(Math.ceil(u)-1,0,this.io.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.sH(c,d)},g={point:{x:c,y:d+1},value:this.sH(c,d+1)},m={point:{x:c+1,y:d},value:this.sH(c+1,d)},y={point:{x:c+1,y:d+1},value:this.sH(c+1,d+1)},p=Qn({x:l,y:u},f,g,m,y);if(void 0===p)return;const A=_t(Math.floor(l+.5),0,this.io.primaryDimensionVectorsCount-1),x=_t(Math.floor(u+.5),0,this.io.secondaryDimensionVectorsCount-1),S="columns"===this.io.dataOrder?A:x,v="columns"===this.io.dataOrder?x:A,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}sH(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}return 0}St(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.min.x)||0}bt(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.max.y)||0}xt(){var t;return(null===(t=this.iH)||void 0===t?void 0:t.boundaries.min.y)||0}Pl(){return 0}Dl(){return 0}f_(){const t=[];return this.ZY.gridTiles.forEach((e=>{if(!e.hasIntensityData)return;const i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((t=>new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)));for(let t=0;t0?"ProgressiveX":"RegressiveX":this.Cw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.iY=new vy(this.At,this));const t=this.iY.XW(this.GM,this.Fu.C());if(t>0){for(let e=0;e0?this.GM[0].boundaries.min.x:Ye:this.el.min.y=this.GM.length>0?this.GM[0].boundaries.min.y:Ye}this.GM.forEach((t=>t.shape.Os()));const e=this.GM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Vt(null===(i=e.shape.ll)||void 0===i?void 0:i.min,Ye)),t.max=Math.max(t.max,Vt(null===(s=e.shape.ll)||void 0===s?void 0:s.max,He)),t}),{min:Ye,max:He});return this.GM.forEach((t=>{t.shape.ll=e})),this.Fu.u=!1,this}WE(t,e){let i=0;return this.GM.forEach((s=>{const{idCount:r}=s.shape.WE(t,e+i);void 0!==r&&(i+=r)})),{idCount:i}}HG(t,e,i,s,r){return{}}WS(t){if(0===t.length)return this;let e=0;const i=this.hH.dataPerSegment,s=t.length;do{let r=this.GM[this.GM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.io.scrollDimension?i:this.io.resolution,rows:"rows"===this.io.scrollDimension?i:this.io.resolution,heatmapDataType:this.io.heatmapDataType,dataOrder:this.io.scrollDimension};let e="columns"===this.io.scrollDimension?{x:this.Pi.x+this.Cw.x*this.eH,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.Cw.y*this.eH};this.GM.length>0&&(e="columns"===this.io.scrollDimension?{x:e.x-1*this.Cw.x,y:e.y}:{x:e.x,y:e.y-1*this.Cw.y},o=!0);const s=new By(this.OG,this.NG,this.At,Ot,[],t).ES(this.WY.C()).Re(this.Ie).IS(this.FS).BS(e,this.Cw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.eH,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.xt()},max:{x:s.St(),y:s.bt()}}},this.GM.push(r),n=i-(o?1:0)}const h=s-e,a=Math.min(n,h),l=t.slice(e,e+a),u={type:"intensity",values:l,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:a,lengthSecondary:this.io.resolution};o&&(u.values.unshift(this.rH),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.VS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.rH=l[l.length-1],this.eH+=a,e+=a}while(e{const n=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const h=i-n,a=Math.min(s,o),l=a-h+1,u=e.slice(h-i,a-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:r,startPrimary:h,lengthPrimary:l,values:u};t.shape.VS(c)}));const n=this.eH-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().dz()})),this.GM.length=0,this.el="columns"===this.io.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.io.resolution*this.Cw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.io.resolution*this.Cw.x,y:this.Pi.y}),this.eH=0,this.rH=void 0,this}BS(t,e){return super.BS(t,e),this.GM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.BS(r,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.xt()},max:{x:i.shape.St(),y:i.shape.bt()}}})),this.GM.length>0?this.el=hi(...this.GM.map((t=>t.boundaries))):this.el="columns"===this.io.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.io.resolution*this.Cw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.io.resolution*this.Cw.x,y:this.Pi.y}),this}Re(t){return super.Re(t),this.GM.forEach((t=>t.shape.Re(this.Ie))),this}IS(t){return super.IS(t),this.GM.forEach((t=>t.shape.IS(this.FS))),this}ES(t){return super.ES(t),this.GM.forEach((e=>e.shape.ES(t))),this}dispose(){return super.dispose(),this.GM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.GM.forEach((e=>e.shape.setVisible(t))),this}dz(){return this.GM.forEach((t=>t.shape.dz())),this}hd(t){const e=yt(t,this.At,this.engine.At),i=this.GM.reduce(((i,s)=>{const r=s.shape.hd(t);if(r){const t=ii(yt(r,this.At,this.engine.At),e);if(void 0===i||t=this.eH||"rows"===this.io.scrollDimension&&e>=this.eH)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}sM(t){const e=yt(t,this.At,this.engine.At),i=this.GM.reduce(((i,s)=>{const r=s.shape.sM(t);if(r){const t=ii(yt(r,this.At,this.engine.At),e);if(void 0===i||t=this.eH||"rows"===this.io.scrollDimension&&e>=this.eH)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}Pl(){return 0}Dl(){return 0}ds(t){return super.ds(t),this.GM.forEach((e=>e.shape.ds(t))),this}}class Ny extends mn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.WY=p("bilinear"),this.FS=Ur.lineStyle,this.io=n}ES(t){return this.WY._(t),this}zS(){return this.WY.C()}IS(t){return this.FS="function"==typeof t?t(this.FS):t,this}RS(){return this.FS}}class Uy extends Ny{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Vz=new $m,this.KU={},this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e,this.c_=new By(this.OG,t.nH,t.At,Ot,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",jY:this.lz.cz}).IS(ut);const o=2*Math.PI/360,h=new Float32Array(724);let a=0;h[a+0]=0,h[a+1]=0,a+=2;for(let t=0;t<=360;t+=1){const e=t*o,i=Math.cos(e),s=Math.sin(e);h[a+0]=i,h[a+1]=s,a+=2}this.oH={vertexBuffer:this.lz.zO(h),drawMode:this.lz.gl.TRIANGLE_FAN,drawLength:362}}Os(){const t=this.fa(),e=this.Ie,i=this.jG.fillStyleSolid(t),s=this.jG.fillStylePaletted(t),r=i||s,n=this.WY.C(),o=this.WY.u,h=this.Yo.C(),a=this.Yo.u;return this.Vz.XO(this.At),this.c_.Os(),this.c_.JY?((t||o)&&(this.KU.fill=r?{shader:this.lz.VV(sm["2D"],sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),normalSource:void 0}),s&&sm.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.io.dataOrder,lut:s.lut}),i&&sm.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.KU.mousePicking=h?{shader:this.lz.VV(sm["2D"],sm.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.At),normalSource:void 0}),sm.MousePicking())}:void 0),this.ya(e),this.WY.u=!1,this.Yo.u=!1,this):this}WE(t,e){var i;const{vertexBuffer:s,drawLength:r,drawMode:n}=this.oH,o=this.c_.JY;if(!this.KU.fill||!o)return{};const{fillStylePaletted:h,fillStyleSolid:a}=this.KU.fill,l=1===t?null===(i=this.KU.mousePicking)||void 0===i?void 0:i.shader:this.KU.fill.shader;if(!l)return{};const u=this.At.zb(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this.io.amplitudeStart,this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep),g=Math.max(this.io.amplitudeStart,this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep);let m;return m=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.lz.bz(l).OO(l,((i,l,u,c)=>{if(this.lz.GO(i("uScale"),this.Vz.YO()).GO(i("uDisp"),this.Vz.HO()).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0).GO(c("uViewportSize"),[this.OG.oi().x*this.lz.MO()/(1===t?this.cs.io.ho:1),this.OG.oi().y*this.lz.MO()/(1===t?this.cs.io.ho:1)]).GO(i("uScaling"),[m,m]).GO(i("uTranslationAxis"),[0,0]).NO(s,void 0,{location:l("aPos"),size:2}).WO(c("uAngleOffset"),this.At.Ub()%(2*Math.PI)).WO(c("uAngleDirection"),this.At.Xb()?1:-1).WO(c("uSectors"),this.io.sectors).WO(c("uAnnuli"),this.io.annuli),1===t)this.lz.uN(i("uFirstId"),e).nG(u,1);else{if(h){const t=this.c_.ll;this.lz.WO(i("uAmplitudeStart"),this.io.amplitudeStart).WO(i("uAmplitudeStep"),this.io.amplitudeStep).WO(i("uAmplitudeAxisStart"),this.At.zb().start).WO(i("uAmplitudeAxisEnd"),this.At.zb().end).fG(u,h.lut,t).UO(i("uTileIntensityValues"),o.gridTiles[0].intensityDataTexture,0)}a&&this.lz.iL(i("uColor"),a.getColor())}return this.lz.om(n,r),!0})),{idCount:1}}HG(t,e,i,s,r){return{}}VS(t){return this.c_.VS(t),this}Ot(){return this.c_.Ot(),this}dispose(){return super.dispose(),this.c_.dispose(),this.KU={},this.lz.jO(this.oH.vertexBuffer),this}dz(){return this.dispose(),this}Re(t){return super.Re(t),this.c_.Re(this.Ie),this}hd(t){const e=this.io.amplitudeStart,i=this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);(t.angle<0||t.angle>360||t.amplituder)&&(t.angle=_t(t.angle,0,360),t.amplitude=_t(t.amplitude,r,r));let n=Math.round((t.angle-0)/360*this.io.sectors);n>=this.io.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.io.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.sH(o,n),angle:n*(360/this.io.sectors),amplitude:e+o*(i-e)/(this.io.annuli-1)}}sM(t){const e=this.io.amplitudeStart,i=this.io.amplitudeStart+(this.io.annuli-1)*this.io.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);(t.angle<0||t.angle>360||t.amplituder)&&(t.angle=_t(t.angle,0,360),t.amplitude=_t(t.amplitude,r,r));const n=(t.angle-0)/360*this.io.sectors,o=(t.amplitude-e)/(i-e)*(this.io.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.sH(a,h)},u={point:{x:a,y:h+1},value:this.sH(a,h+1)},c={point:{x:a+1,y:h},value:this.sH(a+1,h)},d={point:{x:a+1,y:h+1},value:this.sH(a+1,h+1)},f=Qn({x:o,y:n},l,u,c,d);if(void 0!==f)return{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}}sH(t,e){const i="annuli"===this.io.dataOrder?t:e,s="annuli"===this.io.dataOrder?e:t;for(let t=0;t=e.iFirstVector.primary&&i<=e.iFirstVector.primary+e.sizeHeatmapDataVectors.primary-1&&s>=e.iFirstVector.secondary&&s<=e.iFirstVector.secondary+e.sizeHeatmapDataVectors.secondary-1){const t=i-e.iFirstVector.primary,r=s-e.iFirstVector.secondary,n=t*e.sizeHeatmapDataVectors.secondary+r;return e.intensityData[n]}}return 0}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Pl(){return 0}Dl(){return 0}}class Yy extends Vm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.OU();this.NU=t.zO(e),this.UU=s,this.WU=i}bz(t){return this.lz.NO(this.NU,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}om(t,e,i){return this.lz.TN(void 0!==e?e:this.WU,i||0,this.UU,t),this}OU(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.lz.gl.TRIANGLES,drawSize:6}}rO(){this.lz.jO(this.NU)}}const Hy=t=>{let e=t.iN.iO.get(void 0);return e||(e=new Yy(t),t.iN.iO.set(void 0,e),e)};class Xy extends wn{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.aH=Ur.fillStyle,this.lH=p("bottom"),this.uH=Ur.fillStyle,this.cH=p(e.PointShape.Circle),this.dH=p(5),this.fH=p(0),this.AH=p(void 0),this.$C=!0,this.gH={x:0,y:0}}tk(t){this.lH.C()!==t&&this.lH._(t)}Md(t){return this.aH=dn(this.aH,t),this}jC(){return this.aH}pH(){return fn(this.yH,this.aH)}mH(){return fn(this.vH,this.uH)}bd(t){return this.uH=dn(this.uH,t),tt(this.uH)&&(this.wd(e.PointShape.Square),this.Id(1)),this}Fd(){return this.uH}wd(t){return this.cH._(t),po(this.cH.C())&&this.Id(1),this}Cd(){return this.cH.C()}Id(t){return this.dH._(t),this}ZC(){return this.dH.C()}kd(t){return this.fH._(t),this}Td(){return this.fH.C()}QC(t){return this.gH=t,this}JC(){return this.gH}HC(t){return this.AH._(t),this}KC(){return this.AH.C()}}class Wy extends yy{constructor(t,e){super(t,e),this.MW=!1,this._W={enabled:!1,totalDataPointsAtTime:0},this.kW=t instanceof Yi?{type:"linear",scale:t}:{type:"unknown"},this.bW.ta("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.MW=!0)}))}SH(t,e){const i=null==t?void 0:t.zc,s=null==t?void 0:t.Vc,r=null==t?void 0:t.xc,n=null==t?void 0:t.Sc,o=null==t?void 0:t.Kc();if(!t||this.MW||!o||"linear"!==this.kW.type||!i||!s||void 0===r||void 0===n||!e){const t=this._W.enabled;return this._W={enabled:!1,totalDataPointsAtTime:null!=r?r:0},{cpStateChanged:t,cpActive:!1}}const h=qr(o),a=t.Ec(),l=t.sd(),u=a?a[h]:void 0,c=l?l[h]:void 0;if(r<2||void 0===u||void 0===c||c===u){const t=this._W.enabled;return this._W={enabled:!1,totalDataPointsAtTime:null!=r?r:0},{cpStateChanged:t,cpActive:!1}}const d=this.calculateAvgStepBetweenDataPoints(c,u,r),f=this.kW.scale,g=Math.abs(f.Ui()[h]),m=g/d,y=Math.floor(.8*m),p=y*d,A=y>=4,x=this._W.enabled?this._W.columnWidthAxis/g<1.5:void 0,S=this._W.enabled&&y>this._W.dataPointsPerColumn?y/this._W.dataPointsPerColumn>=2:void 0;let v;return!0===this._W.enabled?x?S&&(v={enabled:!0,columnWidthAxis:p,dataPointsPerColumn:y,totalDataPointsAtTime:r}):v=A?{enabled:!0,columnWidthAxis:p,dataPointsPerColumn:y,totalDataPointsAtTime:r}:{enabled:!1,totalDataPointsAtTime:r}:A&&(v={enabled:!0,columnWidthAxis:p,dataPointsPerColumn:y,totalDataPointsAtTime:r}),this._W=v||{...this._W,totalDataPointsAtTime:r},!!v&&this.PW(),{cpStateChanged:!!v,cpActive:this._W.enabled}}xH(t,e){var i,s,r;const n=t.zc,o=t.Vc,h=t.bc,a=t.xc,l=t.Sc;if(this.MW||!this._W.enabled||!n||!o||void 0===e)return;const u=qr(e),c=Kr(e),d="x"===u?n:o,f="x"===u?o:n,g=d.length,m="x"===u?this.At.x:this.At.y,y=this._W.columnWidthAxis,p=Math.min(m.getInnerStart(),m.getInnerEnd()),A=Math.max(m.getInnerStart(),m.getInnerEnd()),x=bo(p,A,d,h,a,l,e,1);if(!x)return;const S=d[x.iFirstSampleDataArray];if(this.bH){if(this.bH.iFirstPackedSample0)if(this.bH.packedColumnsCount-=t,this.bH.packedColumnsCount>0){this.bH.packedDataProg.splice(0,2*t),this.bH.packedDataValues.splice(0,2*t),this.bH.packedDataColors&&this.bH.packedDataColors.splice(0,2*t),this.bH.packedDataLookupValues&&this.bH.packedDataLookupValues.splice(0,2*t),this.bH.origin+=t*y;const e=Mo(this.bH.origin,Math.max(h-1-g+1,0),h-1,c,(t=>d[vo(t,h,g)])),i=vo(e,h,g);this.bH.iFirstPackedSample=d[i]>=this.bH.origin?e:e+1}else this.bH=void 0}if(void 0!==(null===(i=this.bH)||void 0===i?void 0:i.iLastPackedSample)&&this.bH.iLastPackedSample>x.iLastSample){const t=d[x.iLastSampleDataArray],e=Math.min(Math.floor((this.bH.origin+this.bH.packedColumnsCount*y-t)/y),this.bH.packedColumnsCount);if(e>0)if(this.bH.packedColumnsCount-=e,this.bH.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.bH.packedDataProg.pop(),this.bH.packedDataValues.pop(),this.bH.packedDataColors&&this.bH.packedDataColors.pop(),this.bH.packedDataLookupValues&&this.bH.packedDataLookupValues.pop();const t=Mo(this.bH.origin+this.bH.packedColumnsCount*y,Math.max(h-1-g+1,0),h-1,c,(t=>d[vo(t,h,g)])),i=vo(t,h,g);this.bH.iLastPackedSample=d[i]<=this.bH.origin+this.bH.packedColumnsCount*y?t:t-1}else this.bH=void 0}}const v=this.bH||{origin:S,packedColumnsCount:0,packedDataProg:[],packedDataValues:[],packedDataColors:t.$c?[]:void 0,packedDataLookupValues:t.Hc?[]:void 0,packedDataSize:t.Xc?[]:void 0,packedDataRotation:t.jc?[]:void 0,iFirstPackedSample:x.iFirstSample,iLastPackedSample:void 0},b=(t,e,i,s)=>{let r=Math.min(t,t+i*y),n=Math.max(t,t+i*y),o=s;const a=[];let l=He,u=He,c=-1,m=Ye,S=Ye,b=-1,M=0;for(;o<=x.iLastSample&&o>=x.iFirstSample;){const s=o%g,x=d[s],C=f[s];if(r<=x&&x<=n)M+=1,Number.isNaN(C)||(C>u&&(l=x,u=C,c=o),C0)l=l===He?Number.NaN:l,u=u===He?Number.NaN:u,m=m===Ye?Number.NaN:m,S=S===Ye?Number.NaN:S,c0?(v.packedDataProg.push(l),v.packedDataValues.push(u),v.packedDataProg.push(m),v.packedDataValues.push(S)):(v.packedDataProg.unshift(m),v.packedDataValues.unshift(S),v.packedDataProg.unshift(l),v.packedDataValues.unshift(u))):(a.push({iFirst:b,iSecond:c}),e>0?(v.packedDataProg.push(m),v.packedDataValues.push(S),v.packedDataProg.push(l),v.packedDataValues.push(u)):(v.packedDataProg.unshift(l),v.packedDataValues.unshift(u),v.packedDataProg.unshift(m),v.packedDataValues.unshift(S)));else{const t=e>0?v.iLastPackedSample:v.iFirstPackedSample;if(void 0===t)a.push({iFirst:0,iSecond:0}),e>0?(v.packedDataProg.push(Number.NaN),v.packedDataValues.push(Number.NaN),v.packedDataProg.push(Number.NaN),v.packedDataValues.push(Number.NaN)):(v.packedDataProg.unshift(Number.NaN),v.packedDataValues.unshift(Number.NaN),v.packedDataProg.unshift(Number.NaN),v.packedDataValues.unshift(Number.NaN));else{const s=vo(t,h,g),o=d[s],l=f[s],u=(r+n)/2,c=u-i*y/6,m=l+(c-o)/(x-o)*(C-l),p=u+i*y/6,A=l+(p-o)/(x-o)*(C-l);a.push({iFirst:t,iSecond:t}),e>0?(v.packedDataProg.push(c),v.packedDataValues.push(m),v.packedDataProg.push(p),v.packedDataValues.push(A)):(v.packedDataProg.unshift(c),v.packedDataValues.unshift(m),v.packedDataProg.unshift(p),v.packedDataValues.unshift(A))}}if(v.packedColumnsCount+=1,e>0?v.iLastPackedSample=o-1:(v.iFirstPackedSample=o+1,v.origin=r),r=Math.min(t+a.length*i*y,t+(a.length+1)*i*y),n=Math.max(t+a.length*i*y,t+(a.length+1)*i*y),M=0,l=He,u=He,c=-1,m=Ye,S=Ye,b=-1,rA)break}}return a},M=b(v.origin+v.packedColumnsCount*y,1,1*(Kr(e)?1:-1),void 0!==(null===(s=this.bH)||void 0===s?void 0:s.iLastPackedSample)?this.bH.iLastPackedSample+1:x.iFirstSample),C=b(v.origin,-1,-1*(Kr(e)?1:-1),void 0!==(null===(r=this.bH)||void 0===r?void 0:r.iFirstPackedSample)?this.bH.iFirstPackedSample-1:x.iFirstSample),T=t.$c&&v.packedDataColors?[t.$c,v.packedDataColors]:void 0,w=t.Hc&&v.packedDataLookupValues?[t.Hc,v.packedDataLookupValues]:void 0,E=t.Xc&&v.packedDataSize?[t.Xc,v.packedDataSize]:void 0,k=t.jc&&v.packedDataRotation?[t.jc,v.packedDataRotation]:void 0;if(T||w||E||k){for(const t of M){const e=vo(t.iFirst,h,g),i=vo(t.iSecond,h,g);T&&T[1].push(T[0][e],T[0][i]),w&&w[1].push(w[0][e],w[0][i]),E&&E[1].push(E[0][e],E[0][i]),k&&k[1].push(k[0][e],k[0][i])}for(const t of C){const e=vo(t.iFirst,h,g),i=vo(t.iSecond,h,g);T&&T[1].unshift(T[0][i],T[0][e]),w&&w[1].unshift(w[0][i],w[0][e]),E&&E[1].unshift(E[0][i],E[0][e]),k&&k[1].unshift(k[0][i],k[0][e])}}return this.bH=v.packedColumnsCount>0?v:void 0,{x:"x"===u?v.packedDataProg:v.packedDataValues,y:"y"===u?v.packedDataProg:v.packedDataValues,color:v.packedDataColors,lookup:v.packedDataLookupValues,size:v.packedDataSize,rotation:v.packedDataRotation}}PW(){this.bH=void 0}EW(){}}class jy extends Xy{constructor(t,e,i,s){super(t,e,i,s),this.Vz=new $m,this.qW=new Wy(this.At,this),this.jG=Eg({lineStyleSolid:()=>cs(this.Su)&&this.Su,lineStyleDashed:()=>go(this.Su)&&this.Su,strokeFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},strokeFillLinearGradient:()=>{const t=this.Su.getFillStyle();return at(t)&&t},strokeFillRadialGradient:()=>{const t=this.Su.getFillStyle();return nt(t)&&t},strokeFillIndividual:()=>{const t=this.Su.getFillStyle();return H(t)&&t},strokeFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t},areaFillSolid:()=>U(this.aH)&&this.aH,areaFillLinearGradient:()=>at(this.aH)&&this.aH,areaFillRadialGradient:()=>nt(this.aH)&&this.aH,areaFillIndividual:()=>H(this.aH)&&this.aH,areaFillPaletted:()=>j(this.aH)&&this.aH,markerFillSolid:()=>U(this.uH)&&this.uH,markerFillLinearGradient:()=>at(this.uH)&&this.uH,markerFillRadialGradient:()=>nt(this.uH)&&this.uH,markerFillPaletted:()=>j(this.uH)&&this.uH,markerFillIndividual:()=>H(this.uH)&&this.uH,markerFillImage:()=>tt(this.uH)&&this.uH,markerShapeIcon:()=>{const t=this.cH.C();return po(t)&&t}}),this.Sd=p(void 0),this.MH=[],this.al=!1,this._H=[],this.wH=void 0,this.VY=(t,e,i)=>{var s;const r=null===(s=this.CH)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.oi().x,o=r.oi().y),Um(t,e,n*this.dH.C(),o*this.dH.C(),i)},this.NG=e,this.KU={type:"none"},this.lz=t.GG(),this.OG=t,this.QU=this.lz.EN}xd(t){return this.Sd._(Be(t,this.Sd.C(),(()=>[t.rd(((e,i)=>{this.MH.push({min:e,max:i}),void 0===t.Kc()&&this.kH&&this._H.push({min:e,max:i})})),t.nd((()=>{this.al=!0,this.kH=void 0,this.wH=void 0,this.qW.PW()}))]))),this.wH=void 0,this}la(){var t;const e=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt,i=null==e?void 0:e.Kc();return i&&{Xk:qr(i),jk:()=>this.TH()}}TH(){var t,i,s,r,n,o,h,a,l,c,d,f,g;const m=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt,y=this.Sd.u,p=null==m?void 0:m.zc,A=null==m?void 0:m.Vc;if(!m||!p||!A)return;const x=m.Kc(),S=x&&this.At[qr(x)],v=m.Hc,b=m.$c,M=m.Xc,C=m.jc,T=m.bc,w=m.xc,E=m.Sc,k=y||this.ma()||this.pH()||this.mH()||this.lH.u,I=this.jG.lineStyleSolid(k),z=this.jG.lineStyleDashed(k),F=I||z,R=F&&F.getThickness(),D=this.jG.strokeFillSolid(k),P=this.jG.strokeFillLinearGradient(k),O=this.jG.strokeFillRadialGradient(k),L=this.jG.strokeFillIndividual(k),_=this.jG.strokeFillPaletted(k),B=D||P||O||L||_,V=this.jG.areaFillSolid(k),G=this.jG.areaFillLinearGradient(k),N=this.jG.areaFillRadialGradient(k),U=this.jG.areaFillIndividual(k),Y=this.jG.areaFillPaletted(k),H=V||G||N||U||Y,X=this.jG.markerFillSolid(k),W=this.jG.markerFillLinearGradient(k),j=this.jG.markerFillRadialGradient(k),$=this.jG.markerFillPaletted(k),Z=this.jG.markerFillIndividual(k),q=this.jG.markerFillImage(k),K=X||W||j||$||Z||q,J=this.cH.C(),Q=this.cH.u,tt=this.jG.markerShapeIcon(Q),et=this.dH.C(),it=this.dH.u,st=this.AH.u,rt=this.MH.length>0||st,nt=this.al,ot=nt?[m.qc()]:(t=>{const e=[];for(const i of t){let t=!1;for(const s of e)if(i.min>=s.min&&i.min<=s.max||i.max>=s.min&&i.max<=s.max){s.min=Math.min(s.min,i.min),s.max=Math.min(s.max,i.max),t=!0;break}t||e.push(i)}return e})(this.MH),ht=!!z,at=this.Yo.C(),lt=this.Yo.u,ut=this.$C&&(!!F||!!H),{cpStateChanged:ct,cpActive:dt}=this.qW.SH(m,ut);if(x&&dt&&S&&(ct||nt||rt||S.Yt||k)){const t=this.qW.xH(m,x);if(t){const e=!ct&&!nt&&!k;this.FH=$y(this.lz,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ht,this.FH,e,x,1e3,this.At._i(),(t=>re(t,this.At._i()))),this.IH={min:Ye,max:He};const i="x"===qr(x)?t.y:t.x,s=i.length;for(let t=0;tthis.BH.iLastSample||k){let t,i,s,r,n,h;if(1===c.dataRanges.length){const e=c.dataRanges[0];t=p.subarray(e.offset,e.offset+e.count),i=A.subarray(e.offset,e.offset+e.count),s=b?b.subarray(e.offset,e.offset+e.count):void 0,r=v?v.subarray(e.offset,e.offset+e.count):void 0,n=M?M.subarray(e.offset,e.offset+e.count):void 0,h=C?C.subarray(e.offset,e.offset+e.count):void 0}else{const e=c.dataRanges[0],o=c.dataRanges[1],a=e.count+o.count;t=new Float32Array(a),t.set(p.subarray(e.offset),0),t.set(p.subarray(o.offset,o.offset+o.count),e.count),i=new Float32Array(a),i.set(A.subarray(e.offset),0),i.set(A.subarray(o.offset,o.offset+o.count),e.count),b&&(s=new Uint32Array(a),s.set(b.subarray(e.offset),0),s.set(b.subarray(o.offset,o.offset+o.count),e.count)),v&&(r=new Float32Array(a),r.set(v.subarray(e.offset),0),r.set(v.subarray(o.offset,o.offset+o.count),e.count)),M&&(n=new Float32Array(a),n.set(M.subarray(e.offset),0),n.set(M.subarray(o.offset,o.offset+o.count),e.count)),C&&(h=new Float32Array(a),h.set(C.subarray(e.offset),0),h.set(C.subarray(o.offset,o.offset+o.count),e.count))}const a=!ct&&!nt&&!k;this.DH=$y(this.lz,[t,i],s,r,n,h,ht,this.DH,a,x,1e3,this.At._i(),(t=>re(t,this.At._i())));let l=t,d=i,f=s,g=r;const m=this.AH.C();if(m){const n="spline"===m.type?((t,e,i)=>{const s=qr(i),r="x"===s?t.xValues:t.yValues,n="x"===s?t.yValues:t.xValues,{lookupValues:o,colors:h}=t;if(r.length<=2)return{xValues:Array.from(t.xValues),yValues:Array.from(t.yValues),lookupValues:o?Array.from(o):void 0,colors:h?Array.from(h):void 0};const a=((t,e)=>{const i=1e-5,s=t.length-1,r=Array(s);if(s>1){let n=u(0,0),o=u(0,0),h=u(0,0),a=di(pi({x:t[1],y:e[1]},{x:t[0],y:e[0]}));const l=3;let c=0,d=0;for(let f=0;fi?Math.abs(e/(l*n.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=yi(mi(n,c),g[1]),g[2]=pi(g[2],mi(o,d)),r[f]=g}}return r.length>0?r:[]})(r,n),l=a.length,c=[],d=[],f=[],g=[];for(let t=0;t{const{lookupValues:r,colors:n}=t,o=qr(s),h="x"===o?t.xValues:t.yValues,a="x"===o?t.yValues:t.xValues,l=[],u=[],c=[],d=[],f=h.length,g=i;if(f>0){let t=0,e=h[0],i=a[0];l[t]=e,u[t]=i,t+=1;for(let s=1;sre(t,this.At._i()))),this.BH=c}}else this.PH=void 0;if(!x&&(nt||rt||k)){if(!this.FH||this.FH.bufferSize{var s,r,n,o;const h=p.subarray(i.min,i.max+1),a=A.subarray(i.min,i.max+1);if(this.lz.AN(t,i.min*(this.At._i()?2:1),re(h,this.At._i())),this.lz.AN(e,i.min*(this.At._i()?2:1),re(a,this.At._i())),b&&(null===(s=this.FH)||void 0===s?void 0:s.bufferColors)){const t=b.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferColors,i.min,t,Uint32Array)}if(v&&(null===(r=this.FH)||void 0===r?void 0:r.bufferLookupValues)){const t=v.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferLookupValues,i.min,t,Float32Array)}if(C&&(null===(n=this.FH)||void 0===n?void 0:n.bufferRotations)){const t=C.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferRotations,i.min,t,Float32Array)}if(M&&(null===(o=this.FH)||void 0===o?void 0:o.bufferSizes)){const t=M.subarray(i.min,i.max+1);this.lz.AN(this.FH.bufferSizes,i.min,t,Float32Array)}})),this.FH.valueCount=m.xc}this.DH=this.FH}if(k||it||Q||lt){if(B&&F&&!1!==R){const t=-1===R?"primitive":"triangulated",e=_?["lookup",_.lookUpProperty,_.lut]:L?"attribute":P?["gradient",P]:O?["gradient",O]:"uniform";this.KU="primitive"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),z&&sm.StippleTexture),lineStyleSolid:I,lineStyleDashed:z,fillStyleSolid:D,fillStyleLinearGradient:P,fillStyleRadialGradient:O,fillStyleIndividual:L,fillStylePaletted:_,mousePickingShader:at&&this.lz.VV(sm["2D"],sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),z&&sm.StippleTexture,sm.MousePicking({useVertexId:!0}))}:"triangulated"===t?{type:t,shader:this.lz.VV(sm["2D"],sm.Color({dataType:e}),sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),this.QU?sm.AliasedEdge:void 0,z&&sm.StippleTextureInstanced),geometry:cy(this.lz,R),thickness:R,lineStyleSolid:I,lineStyleDashed:z,fillStyleSolid:D,fillStyleLinearGradient:P,fillStyleRadialGradient:O,fillStyleIndividual:L,fillStylePaletted:_,mousePickingShader:at&&this.lz.VV(sm["2D"],sm.LineInstanced2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0}),z&&sm.StippleTextureInstanced,sm.MousePicking())}:{type:"none"}}else this.KU={type:"none"};if(this.LH=H?{shader:this.lz.VV(sm["2D"],Y&&sm.Color({dataType:["lookup",Y.lookUpProperty,Y.lut]}),U&&sm.Color({dataType:"attribute"}),V&&sm.Color({dataType:"uniform"}),G&&sm.Color({dataType:["gradient",G]}),N&&sm.Color({dataType:["gradient",N]}),sm.Area2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0,fill:this.lH.C()})),geometry:Hy(this.lz),fillStyleSolid:V,fillStyleLinearGradient:G,fillStyleRadialGradient:N,fillStyleIndividual:U,fillStylePaletted:Y,mousePickingShader:at&&this.lz.VV(sm["2D"],sm.Area2D({axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0,fill:this.lH.C()}),sm.MousePicking())}:void 0,K){const t=!(!q&&!tt),e=et>1||t,i=M?"attribute":"uniform",s=!e&&sm.PointSize("uniform"),r=sm.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:C?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:C?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:wg(this.At),normalSource:void 0,splitPosAttribute:!0});this.CH={shader:this.lz.VV(sm["2D"],s,r,X&&sm.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!tt}),W&&sm.Color({dataType:["gradient",W],overrideOpacity:!0,maskTexture:!!tt}),j&&sm.Color({dataType:["gradient",j],overrideOpacity:!0,maskTexture:!!tt}),$&&sm.Color({dataType:["lookup",$.getLookUpProperty(),$.getPalette()],overrideOpacity:!0,maskTexture:!!tt}),Z&&sm.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!tt}),q&&sm.Color({dataType:["image",q],overrideOpacity:!0,maskTexture:!!tt})),geometry:wy(J,this.lz,"uniform"===i?et:25),fillStyleSolid:X,fillStyleLinearGradient:W,fillStyleRadialGradient:j,fillStylePaletted:$,fillStyleIndividual:Z,fillStyleImage:q,mousePickingShader:at&&this.lz.VV(sm["2D"],s,r,sm.MousePicking({useVertexId:!e})),shapeIcon:tt,pointSizeAsScale:t,instancedRendering:e}}else this.CH=void 0}if((void 0===this.wH||rt)&&v&&(Ig(_)||Ig(Y)||Ig($))){const t=this.wH?ot:[m.qc()];let e=this.wH?this.wH.max:He,i=this.wH?this.wH.min:Ye;const s=v;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.wH={min:i,max:e}}this.zY=this.lz.AG(this,this.zY,q,tt,it,this.VY),this.tW=z?this.lz.lG(z.getPattern()):void 0,this._u(this.Su),this.yH=this.aH,this.vH=this.uH,this.cH.u=!1,this.dH.u=!1,this.MH.length=0,this.al=!1,this.AH.u=!1,this.Sd.u=!1,this.Yo.u=!1,this.lH.u=!1}Os(){this.TH();const t=this.jG.strokeFillLinearGradient(!1),e=this.jG.strokeFillRadialGradient(!1),i=this.jG.areaFillLinearGradient(!1),s=this.jG.areaFillRadialGradient(!1),r=this.jG.markerFillLinearGradient(!1),n=this.jG.markerFillRadialGradient(!1);let o;this.Vz.XO(this.At);const h=this.lH.C();o="bottom"===h||"top"===h?cn({min:{x:this.vt(),y:Math.min(this.At.y.getInnerStart(),this.At.y.getInnerEnd(),this.xt(),this.bt())},max:{x:this.St(),y:Math.max(this.At.y.getInnerStart(),this.At.y.getInnerEnd(),this.xt(),this.bt())}},{x:this.Pl(),y:this.Dl()},this.At):cn({min:{x:Math.min(this.At.x.getInnerStart(),this.At.x.getInnerEnd(),this.vt(),this.St()),y:this.xt()},max:{x:Math.max(this.At.x.getInnerStart(),this.At.x.getInnerEnd(),this.vt(),this.St()),y:this.bt()}},{x:this.Pl()/2,y:this.Dl()/2},this.At);const a=cn({min:{x:this.vt(),y:this.xt()},max:{x:this.St(),y:this.bt()}},{x:this.Pl(),y:this.Dl()},this.At);return this.RH=this.lz.vG(t,this,a),this.EH=this.lz.SG(e,this,a),this.zH=this.lz.vG(i,this,o),this.VH=this.lz.SG(s,this,o),this.OH=this.lz.vG(r,this,a),this.NH=this.lz.SG(n,this,a),this}WE(t,e){var i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p,A,x,S;const v=this.lz.gl,b=null===(i=this.FH)||void 0===i?void 0:i.bufferX,M=null===(s=this.FH)||void 0===s?void 0:s.bufferY,C=null===(r=this.FH)||void 0===r?void 0:r.bufferColors,T=null===(n=this.FH)||void 0===n?void 0:n.bufferLookupValues,w=null===(o=this.FH)||void 0===o?void 0:o.valueCount,E=null===(h=this.DH)||void 0===h?void 0:h.valueCount,k=null===(a=this.Sd.C())||void 0===a?void 0:a.Gt,I=null==k?void 0:k.Kc(),z=Math.max((null===(l=this.FH)||void 0===l?void 0:l.valueCount)||0,(null===(u=this.DH)||void 0===u?void 0:u.valueCount)||0);if(!b||!M||!k)return{};const F=(e,i,s)=>{if(qy(this.lz,e,this.At._i(),b,"aLocation","X",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),qy(this.lz,e,this.At._i(),M,"aLocation","Y",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!C)return!1;qy(this.lz,e,!1,C,"aColor","",4,!0,v.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!T)return!1;qy(this.lz,e,!1,T,"aLookupValue","",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},R=1===t?null===(c=this.LH)||void 0===c?void 0:c.mousePickingShader:null===(d=this.LH)||void 0===d?void 0:d.shader;if(this.LH&&R&&void 0!==w&&w>0&&I&&2!==t){const i=this.LH;this.lz.bz(R).OO(R,((s,r,n,o)=>!!this.lz.pG(n,t,this,{uniforms:this.Vz,idFirst:e,useInstanceID:1===t?z:void 0,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStylePaletted:i.fillStylePaletted,linearGradientInfo:this.zH,radialGradientInfo:this.VH,lookupValueRange:i.fillStylePaletted?kg(i.fillStylePaletted,this,this.wH):void 0,lookupValueBuffer:null})&&!!F(n,i.fillStyleIndividual,i.fillStylePaletted)&&(null==i||i.geometry.bz(n).om(w-1),!0)))}const D="none"===this.KU.type?void 0:1===t?this.KU.mousePickingShader:this.KU.shader;if("none"!==this.KU.type&&D&&void 0!==w&&w>0){const i=this.KU;this.lz.bz(D).OO(D,((s,r,n,o)=>{var h,a;if(!this.lz.pG(n,t,this,{uniforms:this.Vz,idFirst:e,useInstanceID:1===t&&"triangulated"===i.type?z:void 0,useVertexID:1===t&&"primitive"===i.type?z:void 0,fillStyleSolid:i.fillStyleSolid,fillStylePaletted:i.fillStylePaletted,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStyleIndividual:i.fillStyleIndividual,linearGradientInfo:this.RH,radialGradientInfo:this.EH,lookupValueRange:i.fillStylePaletted?kg(i.fillStylePaletted,this,this.wH):void 0,lookupValueBuffer:"primitive"===i.type?T:null,colorBuffer:"primitive"===i.type?C:null,coordsX:"primitive"===i.type?b:void 0,coordsY:"primitive"===i.type?M:void 0,coordsHighPrecision:this.At._i()}))return!1;if(i.lineStyleDashed){if(!this.tW)return!1;this.lz.GO(s("uStippleCount"),[this.cs.oi().x/this.tW.dG,this.cs.oi().y/this.tW.dG]).WO(o("uStippleTextureWidthLimiter"),this.tW.cG/this.tW.dG).WO(s("uStippleScale"),i.lineStyleDashed.getPatternScale()).UO(s("uStippleTexture"),this.tW.uG,1)}if("primitive"===i.type){if(i.lineStyleDashed){if(!(null===(h=this.FH)||void 0===h?void 0:h.bufferLengthSoFar))return!1;this.lz.vN(r("aLengthSoFar"),this.FH.bufferLengthSoFar)}fy.jU(this.OG,w)}else{if(!F(n,i.fillStyleIndividual,i.fillStylePaletted))return!1;if(i.lineStyleDashed){if(!(null===(a=this.FH)||void 0===a?void 0:a.bufferLengthSoFar))return!1;qy(this.lz,n,!1,this.FH.bufferLengthSoFar,"aLengthSoFar","",2,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}dy.WE(this.OG,i.geometry,n,this.QU&&1!==t,1===t,i.thickness,w-1)}return!0}))}const P=null===(f=this.DH)||void 0===f?void 0:f.bufferX,O=null===(g=this.DH)||void 0===g?void 0:g.bufferY,L=null===(m=this.DH)||void 0===m?void 0:m.bufferColors,_=null===(y=this.DH)||void 0===y?void 0:y.bufferLookupValues,B=null===(p=this.DH)||void 0===p?void 0:p.bufferSizes,V=null===(A=this.DH)||void 0===A?void 0:A.bufferRotations,G=1===t?null===(x=this.CH)||void 0===x?void 0:x.mousePickingShader:null===(S=this.CH)||void 0===S?void 0:S.shader,N=this.CH;let U=1;if(I&&(R||D)){const t="x"===qr(I)?this.vt():this.xt(),e="x"===qr(I)?this.St():this.bt(),i="x"===qr(I)?this.At.x:this.At.y,s=this.Sd?Math.abs((e-t)/k.getSampleCount()):0,r=i.getInnerInterval()/s,n=this.dH.C(),o=i.ri()/n/1,h=2*o;U=r<=o?1:Math.max(1-(r-o)/(h-o),0)}if(G&&N&&P&&O&&U>0&&void 0!==E&&E>0){const i=N,s=i.instancedRendering?1:0;this.lz.bz(G).OO(G,((r,n,o,h)=>{if(!this.lz.pG(o,t,this,{uniforms:this.Vz,idFirst:e,useInstanceID:i.instancedRendering&&1===t?z:void 0,useVertexID:i.instancedRendering||1!==t?void 0:z,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,linearGradientInfo:this.OH,radialGradientInfo:this.NH,fillStylePaletted:i.fillStylePaletted,fillStyleIndividual:i.fillStyleIndividual,lookupValueRange:i.fillStylePaletted?kg(i.fillStylePaletted,this,this.wH):void 0,lookupValueBuffer:_,lookupValueAttribDivisor:s,colorBuffer:L,colorAttribDivisor:s,fillStyleImage:i.fillStyleImage,texturedFillGLInfo:this.zY,texCoordAttribDivisor:0,maskTexture:i.shapeIcon&&this.zY,maskTextureCoordsAttribDivisor:0}))return!1;if(this.At._i()?this.lz.NO(P,s,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).NO(O,s,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.lz._N(n("aPosX"),P,s)._N(n("aPosY"),O,s),1!==t&&this.lz.WO(r("uOpacity"),U),i.instancedRendering)if(V)this.lz._N(n("aRotDeg"),V,s).WO(r("uBaseRotDeg"),i.geometry.cY);else{const t=Ci(this.fH.C()+i.geometry.cY),e=Math.sin(t),s=Math.cos(t);this.lz.GO(r("uRot"),[e,s])}return this.lz.GO(h("uOffsetAlignment"),[-this.gH.x/2,-this.gH.y/2]),i.geometry.om(o,B,E,i.pointSizeAsScale&&this.zY?{scale:this.dH.C(),width:i.shapeIcon?i.shapeIcon.oi().x:this.zY.texture.oO,height:i.shapeIcon?i.shapeIcon.oi().y:this.zY.texture.aO}:this.dH.C(),i.instancedRendering),!0}))}return{idCount:z}}HG(t,e,i,s,r){var n;const o=null===(n=this.Sd.C())||void 0===n?void 0:n.Gt;if(null==o?void 0:o.Kc())return{};const h=t-e;return{info:{dataPoint:null==o?void 0:o.ed(h)}}}dispose(){var t,e,i,s,r,n,o,h,a,l,u,c,d;return super.dispose(),this.lz.jO(null===(t=this.FH)||void 0===t?void 0:t.bufferX),this.lz.jO(null===(e=this.FH)||void 0===e?void 0:e.bufferY),this.lz.jO(null===(i=this.FH)||void 0===i?void 0:i.bufferColors),this.lz.jO(null===(s=this.FH)||void 0===s?void 0:s.bufferLookupValues),this.lz.jO(null===(r=this.FH)||void 0===r?void 0:r.bufferRotations),this.lz.jO(null===(n=this.FH)||void 0===n?void 0:n.bufferSizes),this.lz.jO(null===(o=this.DH)||void 0===o?void 0:o.bufferX),this.lz.jO(null===(h=this.DH)||void 0===h?void 0:h.bufferY),this.lz.jO(null===(a=this.DH)||void 0===a?void 0:a.bufferColors),this.lz.jO(null===(l=this.DH)||void 0===l?void 0:l.bufferLookupValues),this.lz.jO(null===(u=this.DH)||void 0===u?void 0:u.bufferRotations),this.lz.jO(null===(c=this.DH)||void 0===c?void 0:c.bufferSizes),this.KU={type:"none"},this.LH=void 0,this.CH=void 0,this.qW.PW(),null===(d=this.Sd.C())||void 0===d||d.Nt(),this.FH=void 0,this.DH=void 0,this.RH=void 0,this.EH=void 0,this.zH=void 0,this.VH=void 0,this.OH=void 0,this.NH=void 0,this.lz.gG(this,this.zY),this}dz(){return this.dispose(),this}GH(t){if(!this.kH){const{xValues:e,yValues:i}=t.readBack();this.kH={min:{x:Ye,y:Ye},max:{x:He,y:He}};const s=e.length;for(let t=0;tthis.kH.max.x?s:this.kH.max.x,this.kH.max.y=r>this.kH.max.y?r:this.kH.max.y}return this._H.length=0,this.kH}const e=t.zc,i=t.Vc;if(this._H.length>0&&e&&i){for(const t of this._H){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.kH.min.x=tthis.kH.max.x?t:this.kH.max.x,this.kH.max.y=r>this.kH.max.y?r:this.kH.max.y}this._H.length=0}return this.kH}return this.kH}St(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?(null===(e=n.Ec())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.sd())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.IH)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.IH)||void 0===r?void 0:r.max)||0:this.GH(n).max.x}vt(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?(null===(e=n.sd())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Ec())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.IH)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.IH)||void 0===r?void 0:r.min)||0:this.GH(n).min.x}bt(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?Vt(null===(e=this.IH)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Vt(null===(i=this.IH)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Vt(null===(s=n.Ec())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Vt(null===(r=n.sd())||void 0===r?void 0:r.y,0):this.GH(n).max.y}xt(){var t,e,i,s,r;const n=null===(t=this.Sd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.Kc();return"ProgressiveX"===o?Vt(null===(e=this.IH)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Vt(null===(i=this.IH)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Vt(null===(s=n.sd())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Vt(null===(r=n.Ec())||void 0===r?void 0:r.y,0):this.GH(n).min.y}Pl(){var t,e;let i=this.dH.C();this.zY&&(i=Math.max(this.zY.texture.oO,this.zY.texture.aO)*this.dH.C());const s=Math.max(Re(this.Su),(null===(t=this.Sd.C())||void 0===t?void 0:t.Gt.Pc)?25:i),r=null===(e=this.Sd.C())||void 0===e?void 0:e.Gt.Kc();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}Dl(){var t,e;let i=this.dH.C();this.zY&&(i=Math.max(this.zY.texture.oO,this.zY.texture.aO)*this.dH.C());const s=Math.max(Re(this.Su),(null===(t=this.Sd.C())||void 0===t?void 0:t.Gt.Pc)?25:i),r=null===(e=this.Sd.C())||void 0===e?void 0:e.Gt.Kc();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const $y=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{const f=qr(l),g=Kr(l),m=e[0],y=e[1],p=m.length,A=m[0],x=m[p-1],S=y[0],v=y[p-1],b=c?2:1;if(h&&a&&h.firstX&&h.lastX&&h.firstY&&h.lastY&&("ProgressiveX"===l&&A>=h.firstX||"RegressiveX"===l&&A<=h.firstX||"ProgressiveY"===l&&S>=h.firstY||"RegressiveY"===l&&S<=h.firstY)){const e="x"===f?m:y,a="x"===f?h.lastX:h.lastY,l=Mo(a,0,p-1,g,(t=>e[t]));if(e[l]===a){const e=h.bufferSize-h.valueCount,a=l+1,u=p-a;if(0===u)return h;if(e>=u){const e=wo(m,a,void 0),l=wo(y,a,void 0);if(t.AN(h.bufferX,h.valueCount*b,d(e)),t.AN(h.bufferY,h.valueCount*b,d(l)),i&&h.bufferColors){const e=i.slice(a);t.AN(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(a);t.AN(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(a);t.AN(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(a);t.AN(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Zy(e,l,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.AN(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=x,h.lastY=v,h}}}const M=p+u,C=t.fN(M*b,d(m),null==h?void 0:h.bufferX),T=t.fN(M*b,d(y),null==h?void 0:h.bufferY),w=i?t.fN(M,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,E=s?t.fN(M,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,k=r?t.fN(M,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,I=n?t.fN(M,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let z,F=0,R=0;if(o){const e=Zy(m,y,m[0],y[0],0,0);z=t.fN(2*M,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),F=e[1],R=e[2]}return{bufferX:C,bufferY:T,bufferColors:w,bufferLookupValues:E,bufferSizes:k,bufferRotations:I,bufferSize:M,bufferLengthSoFar:z,valueCount:p,firstX:A,lastX:x,firstY:S,lastY:v,lengthSoFarX:F,lengthSoFarY:R}},Zy=(t,e,i,s,r,n)=>{const o=t.length,h=new Float32Array(2*o);if(0===o)return[h,0,0];let a=0,l=i,u=s,c=r,d=n;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${r}A_highpart${n}`),c=e.attribute(`${r}A_lowpart${n}`),d=e.attribute(`${r}B_highpart${n}`),f=e.attribute(`${r}B_lowpart${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,2*o*l,0*l),u.vertexAttribPointer(c,o,a,h,2*o*l,o*l),t.xN(i,1),t.xN(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,a,h,2*o*l,2*o*l),u.vertexAttribPointer(f,o,a,h,2*o*l,3*o*l),t.xN(d,1),t.xN(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${r}A${n}`),c=e.attribute(`${r}B${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,o*l,0*l),u.vertexAttribPointer(c,o,a,h,o*l,o*l),t.xN(i,1),t.xN(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Ky={translation:(t,e)=>[1,0,0,0,1,0,t,e,1],rotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:(t,e)=>[t,0,0,0,e,0,0,0,1],translate:(t,e,i)=>Ky.multiply(t,Ky.translation(e,i)),rotate:(t,e)=>Ky.multiply(t,Ky.rotation(e)),scale:(t,e,i)=>Ky.multiply(t,Ky.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],y=e[5],p=e[6],A=e[7],x=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+m*n+y*a,g*s+m*o+y*l,g*r+m*h+y*u,p*i+A*n+x*a,p*s+A*o+x*l,p*r+A*h+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Jy extends An{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UH=[],this.Vz=new $m,this.WH=[u(0,0),u(0,0),u(0,0),u(0,0)],this.YH=m(u(0,0),u(0,0)),this.HH=m(u(0,0),u(0,0)),this.$H=u(0,0),this.XH=u(0,0),this.PT=u(0,0),this.jH=u(0,0),this.ZH=0,this.QH=0,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleRadialGradient:()=>nt(this.Ie)&&this.Ie,fillStyleLinearGradient:()=>at(this.Ie)&&this.Ie}),this.OG=t,this.NG=e,this.lz=t.GG(),this.NG=e,this.oW=t.io.no}Os(){const t=this.pa(),e=this.ga(),i=this.Yo.C();if(t){const t=this.fa(),s=this.jG.fillStyleSolid(t),r=this.jG.fillStyleRadialGradient(t),n=this.jG.fillStyleLinearGradient(t),o=s||r||n,h=this.lz,a=this.lz.MO(),l=a!==this.QH;if(this.QH=a,this.Vz.XO(this.At),this.Ta.u||l){this.JH&&this.JH.Mz(this),this.font._(Pr(this.Ta.C(),a));const t=this.font.C();this.JH=this.lz.tr(t.properties.family),this.JH.bz(this)}const c=this.font.u,d=c||this.ba.u;if(d&&this.JH){const t=this.font.C();[this.KH,this.HH]=this.JH.wz(this.ba.C(),t,this.OG.ts.isDark),this.UH.forEach((t=>{t.texCoordBuff&&h.jO(t.texCoordBuff),t.vertexBuff&&h.jO(t.vertexBuff)})),this.UH=this.KH.map((t=>({texCoordBuff:h.zO(t.texCoords,!1),texture:t.texture,info:t}))),this.Ta.u=!1,this.font.u=!1,this.ba.u=!1}const f=this.At.Ni()||e,g=this.Ma.u||this.wa.u||this._a.u||this.Ca.u||this.Ia.u||this.Xt.u||d||f,m=this.Ia.C(),y=mi(u(this.wa.C()+1,this._a.C()+1),.5);if(g&&this.KH&&(this.$H=u(-(m.left*a+this.HH.max.x-this.HH.min.x+m.right*a)*y.x-this.HH.min.x+m.right*a,-(m.bottom*a+this.HH.max.y-this.HH.min.y+m.top*a)*y.y-this.HH.min.y+m.top*a)),(g||f||this.ka.u||this.fa())&&this.Ie!==_){if(this.KH){const t=yi(this.Ma.C(),this.Ca.C()),e=yt(t,this.At,this.cs.At),i=mi(e,a);this.jH=i;const s=Ci(this.ka.C());this.ZH=s,d&&this.UH.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.zO(e.vertices,!0,t.vertexBuff))}));const r=this.Xt.C(),n=[yi(ui(u((this.HH.min.x+(-r.left-m.left)*a+this.$H.x)/a,(this.HH.max.y+(r.top+m.top)*a+this.$H.y)/a),this.Fa,s),e),yi(ui(u((this.HH.max.x+(r.right+m.right)*a+this.$H.x)/a,(this.HH.max.y+(r.top+m.top)*a+this.$H.y)/a),this.Fa,s),e),yi(ui(u((this.HH.max.x+(r.right+m.right)*a+this.$H.x)/a,(this.HH.min.y+(-r.bottom-m.bottom)*a+this.$H.y)/a),this.Fa,s),e),yi(ui(u((this.HH.min.x+(-r.left-m.left)*a+this.$H.x)/a,(this.HH.min.y+(-r.bottom-m.bottom)*a+this.$H.y)/a),this.Fa,s),e)];this.WH=[yt(n[0],this.cs.At,this.At),yt(n[1],this.cs.At,this.At),yt(n[2],this.cs.At,this.At),yt(n[3],this.cs.At,this.At)];const o=ni(n);this.XH=u(-(o.max.x-o.min.x)*a*y.x-o.min.x*a+this.jH.x,-(o.max.y-o.min.y)*a*y.y-o.min.y*a+this.jH.y),this.Hg=pi(o.max,o.min);const l=ni(this.WH),c=this.At.pi(l.min,this.XH),f=this.At.pi(l.max,this.XH);this.YH=ni([c,f])}r?this.iU=_m(this.YH,this.At,r.getPosition(),r.getExtent(),r.getShape(),this.lz.MO()):n?this.sU=Bm(this.YH,this.At,n.getAngle(!0),this.lz.MO()):(this.iU=void 0,this.sU=void 0)}(this.fa()||c)&&(this.Gz=o?this.lz.VV(sm["2D"],sm.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.oW}),sm.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.qH=i&&o?this.qH||this.lz.VV(sm["2D"],sm.MousePicking(),sm.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.oW})):void 0,this.Ma.u=!1,this.wa.u=!1,this._a.u=!1,this.Ca.u=!1,this.ka.u=!1,this.ya(this.Ie)}return this.Pa=t,this}WE(t,e){if(this.pa()){const i=1===t?this.qH:this.Gz;if(!i||0===this.UH.length)return{};const s=this.jG.fillStyleSolid(!1),r=this.jG.fillStyleRadialGradient(!1),n=this.jG.fillStyleLinearGradient(!1),o=this.cs.pV(),h=o.x,a=o.y;let l=Ky.projection(h,a,-1);const u=Ky.translation(this.$H.x,this.$H.y),c=Ky.translation(this.XH.x,this.XH.y);l=Ky.translate(l,this.jH.x,this.jH.y),l=Ky.multiply(l,c),l=Ky.rotate(l,this.ZH),l=Ky.multiply(l,u),1===t&&(l=Ky.scale(l,this.HH.max.x,this.HH.max.y)),this.lz.bz(i).OO(i,((i,h,a,u)=>{if(this.lz.aN(i("uMatrix"),l).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),this.oW&&this.lz.GO(u("uViewportSizePx"),[o.x*this.lz.MO(),o.y*this.lz.MO()]),1===t)this.lz.uN(i("uFirstId"),e).nG(a,1);else if(s)this.lz.iL(i("uColor"),s.getColor());else if(r&&this.iU){this.lz.GO(i("uCenter"),this.iU.center).GO(i("uDistance"),this.iU.distance).nN(i("uBounds"),this.iU.bounds).WO(i("uAspect"),this.iU.aspectRatio);const t=r.getColorStops();for(let e=0;e{this.lz.vN(h("aPos"),t.vertexBuff).vN(h("aMaskTextureCoord"),t.texCoordBuff).UO(i("uMaskTexture"),t.texture,0).om(this.lz.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return{idCount:1}}HG(t,e,i,s,r){return{}}hh(){return this.pa()?this.WH:[]}od(){return this.pa()&&this.Hg?this.Hg:u(0,0)}oi(){if(this.pa()&&this.YH){const t=this.YH;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}dz(){return this.UH.forEach((t=>{t.texCoordBuff&&this.lz.jO(t.texCoordBuff),t.vertexBuff&&this.lz.jO(t.vertexBuff)})),this.UH=[],this.JH&&this.JH.Mz(this),this}St(){return this.YH.max.x}vt(){return this.YH.min.x}bt(){return this.YH.max.y}xt(){return this.YH.min.y}Pl(){return 0}Dl(){return 0}}class Qy{constructor(t,e,i){this.t$=new Set,this.i$=t=>(this.t$.add(t),t),this.s$=t=>(this.t$.delete(t),t.dz(),this),this.cs=t,this.oa=e,this.e$=i}UE(t){this.t$.delete(t)&&this.t$.add(t)}Y(){for(const t of this.t$)t.dz().dispose();this.cs.En(this.oa)}Ms(){return this.cs.Ms(),this}Rn(){return this.oa}}class tp extends Qy{constructor(){super(...arguments),this.h$=p(void 0),this.aa=!1}wx(t){return this.h$._(t),this}Op(){return this.h$.C()}}class ep extends tp{constructor(t,e,i){super(t,e,i),this.OG=t,this.gl=t.GG(),this.r$=this.t$}EO(t){const e=t instanceof un&&t;if(!e)return Xe;const i=e.vt(),s=e.St(),r=e.xt(),n=e.bt();if(i===Ye||s===He||r===Ye||n===He)return Xe;const o=e.Pl(),h=e.Dl(),a=cn({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.At),l={min:yt(a.min,e.At,t.cs.At),max:yt(a.max,e.At,t.cs.At)},u=this.h$.C();let c;if(u){if(c={min:{x:Math.min(l.min.x,u.x),y:Math.min(l.min.y,u.y)},max:{x:Math.max(l.max.x,u.x+u.width),y:Math.max(l.max.y,u.y+u.height)}},c.max.xt.ca()-e.ca()));this.t$.clear();for(const e of t)this.t$.add(e)}for(const t of this.t$)t.Os();return this}WE(t,e,i){var s;const r=this.h$.C();let n;if(r){const t=r.x*this.gl.MO()*e,i=r.y*this.gl.MO()*e,s=Math.ceil(t),o=Math.ceil(i);n=[s,o,Math.floor(t+r.width*this.gl.MO()*e)-s,Math.floor(i+r.height*this.gl.MO()*e)-o],this.gl.RO(n[0],n[1],n[2],n[3])}if(1!==t){for(const i of this.t$)if(i.getVisible()){if(i.Yi){const t=i.Yi.x*this.gl.MO()*e,s=i.Yi.y*this.gl.MO()*e,r=Math.ceil(t),n=Math.ceil(s),o=Math.floor(t+i.Yi.width*this.gl.MO()*e)-r,h=Math.floor(s+i.Yi.height*this.gl.MO()*e)-n;this.gl.RO(r,n,o,h)}i.WE(t,0),i.Yi&&n&&this.gl.RO(n[0],n[1],n[2],n[3])}}else{let r=((null===(s=i[i.length-1])||void 0===s?void 0:s.idLast)||0)+1;const o=Array.from(this.r$.values());for(let s=0;s{const e=new Float32Array(324);let i=0;return e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,{vertices:e,drawSize:i/9,drawMode:t.TRIANGLES}};class np extends ip{constructor(t,e){super(t),this.o$="attribute",this.a$=e;const{vertices:i,indices:s}=op();this.qE=t.zO(i),this.GU=t.yN(s),this.UU=s.length,this.WU=t.gl.TRIANGLES}om(t,e,i,s){return this.lz.NO(this.qE,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).wN(this.GU).WO(t.uniform("uEdgeRoundness"),this.a$/2).FN(this.WU,this.UU,0,e),this}rO(){this.lz.jO(this.qE),this.lz.jO(this.GU)}l$(t){return this.a$=t,this}u$(){return this.a$}}const op=()=>{const t=[{normal:{x:0,y:1,z:0},perpendA:{x:0,y:0,z:1},perpendB:{x:-1,y:0,z:0}},{normal:{x:0,y:0,z:-1},perpendA:{x:0,y:1,z:0},perpendB:{x:-1,y:0,z:0}},{normal:{x:-1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:1}},{normal:{x:1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:-1}},{normal:{x:0,y:0,z:1},perpendA:{x:0,y:1,z:0},perpendB:{x:1,y:0,z:0}},{normal:{x:0,y:-1,z:0},perpendA:{x:0,y:0,z:-1},perpendB:{x:-1,y:0,z:0}}],e=[];let i=0;const s=[];let r=0;for(const n of t){const{normal:t,perpendA:o,perpendB:h}=n,a=Ue.multiply(o,-1),l=Ue.multiply(h,-1),u=i;e[i]={thicknessDirection:Ue.addVec(t,o,h),edge:Ue.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ue.addVec(t,a,h),edge:Ue.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ue.addVec(t,a,l),edge:Ue.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ue.addVec(t,o,l),edge:Ue.addVec(a,h),normal:t},i+=1,s[r+0]=d,s[r+1]=u,s[r+2]=f,s[r+3]=d,s[r+4]=c,s[r+5]=u,r+=6;const g=[{A:o,B:h},{A:a,B:h},{A:a,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=Ue.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const r=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const n of r)for(let r=0;r<8;r+=1){const o=.5*r/7,h=Ue.normalize(Ue.lerp(t,n.direction,o)),a=Math.PI/2-Ue.angle(h,t),l=Ue.addVec(Ue.multiply(Ue.multiply(n.direction,-1),1-Math.cos(a)),Ue.multiply(Ue.multiply(t,-1),1-Math.sin(a)),Ue.multiply(n.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:h,edge:l};const c=e[i];i+=1,n.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.iN.hO.get(e);return i||(i=void 0!==e&&e>0?new np(t,_t(e,0,1)):new sp(t),t.iN.hO.set(e,i),i)};class ap extends Hm{_v(t){return this.xO=this.gv.C(),this.gv._(t),this}NS(t){return this.c$=t,this}GS(){return this.c$}}class lp extends ap{constructor(t,e,i){super(t,e,i),this.d$=t,this.OG=t.OG,this.lz=this.OG.GG()}}class up extends lp{constructor(t,e,i){super(t,e,i),this.c$="cull-back",this.el=We,this.f$={},this.A$=[],this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleIndividual:()=>H(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie}),this.Ie=Ur.fillStyle,this.gv._(ao)}Os(t){const e=this.A$,i=this.Ie,s=i!==_,r=this.g$,n=this.fa()||this.p$!==r,o=this.SO(),h=this.Yo.C(),a=this.Yo.u;if(s){for(const t of e)t.id=void 0!==t.id?String(t.id):void 0,t.xSize=void 0!==t.xSize&&t.xSize<0?-t.xSize:t.xSize,t.ySize=void 0!==t.ySize&&t.ySize<0?-t.ySize:t.ySize,t.zSize=void 0!==t.zSize&&t.zSize<0?-t.zSize:t.zSize;const t=this.y$||0;let s=t;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.f$[e]||(s+=1)}let r,l=!1,u=!1;if(l=s!==t,u=l,r=!u&&(e.length<100?"chunks":"all"),l){const e=11*s,i=new Float32Array(e);this.lY&&i.set(this.lY),this.lY=i,this.m$=e,this.v$=11*t}const c=H(i)?i.getFallbackColor():void 0;for(const t of e){const e=t.id,i=void 0!==e&&this.f$[e],s=[t.xCenter,t.yCenter,t.zCenter,t.xSize,t.ySize,t.zSize,t.color?t.color.r:c?c.r:void 0,t.color?t.color.g:c?c.g:void 0,t.color?t.color.b:c?c.b:void 0,t.color?t.color.a:c?c.a:void 0,t.value];if(i){for(let t=0;t<11;t+=1)s[t]=void 0!==s[t]?s[t]:i.buffer[t];i.buffer.set(s)}else{const t=this.v$,i=new Float32Array(this.lY.buffer,t*Float32Array.BYTES_PER_ELEMENT,11);i.set(s),void 0!==e&&(this.f$[e]={location:t,buffer:i}),this.v$+=11}}if(u&&(this.NU=this.lz.zO(this.lY,!0)),"all"===r)this.lz.AN(this.NU,0,this.lY);else if("chunks"===r)for(const t of e){const e=t.id;if(void 0!==e){const t=this.f$[e];this.lz.AN(this.NU,t.location,t.buffer)}}if(n||o||a){const t=this.jG.fillStyleSolid(n),e=this.jG.fillStyleIndividual(n),i=this.jG.fillStylePaletted(n);t||e||i?(this.S$=hp(this.lz,this.x$()),this.Gz=this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:e?"attribute":i?["lookup",i.getLookUpProperty(),i.lut]:"uniform",shadingStyle:this.gv.C().type}),sm.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:wg(this.At),normalSource:this.S$.o$}),void 0!==this.g$&&sm.RoundedEdges3D),this.qH=h?this.lz.VV(sm["3D"],sm.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:wg(this.At),normalSource:void 0}),sm.MousePicking(),void 0!==this.g$&&sm.RoundedEdges3D):void 0):(this.S$=void 0,this.Gz=void 0,this.qH=void 0)}if(e.length>0){const t=m({x:Ye,y:Ye,z:Ye},{x:He,y:He,z:He});for(let e=0;en?t.max.x:n,t.max.y=t.max.y>l?t.max.y:l,t.max.z=t.max.z>f?t.max.z:f}this.el=t}this.y$=s,this.A$.length=0}return this.ya(i),this.p$=r,this.gv.u=!1,this.Yo.u=!1,this}WE(t,e){const i=1===t?this.qH:this.Gz,s=this.S$,r=this.NU,n=this.Ie,o=this.y$,h=this.gv.C(),a=o||0;return i&&r&&void 0!==o&&this.lz.OO(i,((l,u,c)=>{let d=!1;const f=u("aPos"),g=u("aOffsetAxis");this.lz.bz(i).oN(l("uScale"),this.d$.Vz.YO()).oN(l("uDisp"),this.d$.Vz.HO()).lN(l("uViewProjectionMatrix"),this.b$).WO(l("uIsHighlighted"),1===t||2===t?0:this.jo).iL(l("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(l("uRenderEffectMask"),2===t?1:0);const m={location:f,size:3},y={location:g,size:3},p={location:void 0,size:4};if(1!==t&&"phong"===h.type&&this.lz.oN(l("uCameraLoc"),this.M$).oN(l("uLightLoc"),this._$).WO(l("uAmbientReflection"),h.ambientReflection).WO(l("uSpecularReflection"),h.specularReflection).WO(l("uDiffuseReflection"),h.diffuseReflection).WO(l("uShininess"),h.shininess).iL(l("uLightColor"),h.specularColor).iL(l("uAmbientColor"),h.ambientColor),1===t)this.lz.uN(l("uFirstId"),e).nG(c,a);else if(U(n))this.lz.iL(l("uColorDiffuse"),n.getColor());else if(H(n)){const t=u("aColor");p.location=t}else if(j(n)){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.lz.fG(c,n.lut,t)}return r&&(this.lz.NO(r,1,m,y,p,{location:void 0,size:1}),s.om(c,o,"phong"===h.type&&1!==t,!1),d=!0),d})),{idCount:a}}HG(t,e,i,s,r){const n=11*(t-e);if(!this.lY)return{};const o=this.lY[n+0],h=this.lY[n+1],a=this.lY[n+2],l=this.lY[n+3],u=this.lY[n+4],c=this.lY[n+5],d=Vt(this.lY[n+6],void 0),f=Vt(this.lY[n+7],void 0),g=Vt(this.lY[n+8],void 0),m=Vt(this.lY[n+9],void 0),y=Vt(this.lY[n+10],void 0);let p;for(const t of Object.keys(this.f$))if(this.f$[t].location===n){p=t;break}return{info:{dataPoint:{x:o,y:h,z:a,xSize:l,ySize:u,zSize:c,r:d,g:f,b:g,a:m,intensity:y,id:p}}}}dispose(){return super.dispose(),this.NU&&(this.lz.jO(this.NU),this.NU=void 0),this.Gz=void 0,this}dz(){return this.dispose(),this}Lv(t){this.A$=fe(this.A$,t,{canReturnB:!0})}Re(t){return this.Ie=dn(this.Ie,t),this}Jh(){return this.Ie}Dv(t){return this.g$=void 0!==t&&t>0?_t(t,0,1):void 0,this}x$(){return this.g$}St(){return this.el.max.x}vt(){return this.el.min.x}bt(){return this.el.max.y}xt(){return this.el.min.y}kv(){return this.el.max.z}Tv(){return this.el.min.z}Pl(){return 0}Dl(){return 0}Fv(){return 0}fa(){return fn(this.Aa,this.Ie)}ya(t){this.Aa=t}}class cp extends Vm{constructor(t,e){super(t),this.o$="custom",this.VU=e;const{vertices:i,drawSize:s}=this.OU();this.NU=t.zO(i),this.UU=s}bz(t){return this.lz.NO(this.NU,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}om(t){return this.lz.TN(this.lz.gl.TRIANGLE_STRIP,0,this.UU,t),this}OU(){const t=this.VU,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const r=2*Math.PI*s/t,n=Math.cos(r),o=Math.sin(r);for(const t of[0,1])e[i+0]=t,e[i+1]=n,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}rO(){this.lz.jO(this.NU)}}const dp=(t,e=16)=>{let i=t.iN.sO.get(e);return i||(i=new cp(t,e),t.iN.sO.set(e,i),i)};class fp extends lp{constructor(t,e,i){super(t,e,i),this.c$="cull-back",this.w$=We,this.C$=[],this.k$=!1,this.Su=Ur.lineStyle,this.gv._(oo)}Os(t){const e=this.k$,i=this.Su,s=this.bu!==i,r=this.SO(),n=e;if(e){const t=oe(this.C$);this.T$=this.lz.zO(t,!1,this.T$)}if(n&&(this.w$=oi(this.C$)),s||r){const t=8,e=cs(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.KU=void 0,U(e)&&("primitive"===s?this.KU={type:s,shader:this.lz.VV(sm["3D"],sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}),sm.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.KU={type:s,shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:"uniform",shadingStyle:this.gv.C().type}),sm.LineInstanced3D({axisWorldTranslation:wg(this.At)})),geometry:dp(this.lz,t),fillStyle:e}))}return this.k$=!1,this.bu=i,this.gv.u=!1,this}WE(t,e){if(1===t)return{};const i=this.lz.gl,s=this.KU,r=this.T$,n=this.Su,o=this.gv.C();if(s&&r&&cs(n))switch(s.type){case"instanced":{const e=.5*this.Rs.sv(n.thickness),h=s.fillStyle.getColor(),a=s.shader,l=s.geometry;this.lz.OO(a,((s,n,u)=>{this.lz.bz(a).oN(s("uScale"),this.d$.Vz.YO()).oN(s("uDisp"),this.d$.Vz.HO()).lN(s("uViewProjectionMatrix"),this.b$).iL(s("uColorDiffuse"),h).WO(s("uOffsetWU"),e).WO(s("uIsHighlighted"),this.jo).iL(s("uHighlightColorOffset"),2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0),"phong"===o.type&&this.lz.oN(s("uCameraLoc"),this.M$).oN(s("uLightLoc"),this._$).WO(s("uAmbientReflection"),o.ambientReflection).WO(s("uSpecularReflection"),o.specularReflection).WO(s("uDiffuseReflection"),o.diffuseReflection).WO(s("uShininess"),o.shininess).iL(s("uLightColor"),o.specularColor).iL(s("uAmbientColor"),o.ambientColor),i.bindBuffer(i.ARRAY_BUFFER,r);const c=n("aLocationA"),d=n("aLocationB");return i.vertexAttribPointer(c,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(c,1),i.enableVertexAttribArray(c),i.vertexAttribPointer(d,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(d,1),i.enableVertexAttribArray(d),l.bz(u).om(this.C$.length/2),!0}));break}case"primitive":{const e=cs(n)?n.getFillStyle():void 0,o=e&&U(e)?e.getColor():void 0;if(o){const e=s.shader;this.lz.OO(e,((s,n)=>(this.lz.bz(e).oN(s("uScale"),this.d$.Vz.YO()).oN(s("uDisp"),this.d$.Vz.HO()).lN(s("uViewProjectionMatrix"),this.b$).iL(s("uColor"),o).WO(s("uIsHighlighted"),this.jo).iL(s("uHighlightColorOffset"),2===t?I:this.Ko).WO(s("uRenderEffectMask"),2===t?1:0).NO(r,void 0,{location:n("aPos"),size:3}).om(i.LINES,this.C$.length),!0)))}break}}return{idCount:this.C$.length}}HG(t,e,i,s,r){return{}}ml(t){for(let e=0;e{const l=e*r,u=Math.PI/2-t*n,c=Math.cos(u),d=c*Math.cos(l),f=c*Math.sin(l),g=Math.sin(u);i[s]=d,i[s+1]=g,i[s+2]=f,i[s+3]=o,i[s+4]=h,i[s+5]=a,s+=6};for(let i=0;i0&&(o(i,s,1,0,0),o(i,s+1,1,1,0),o(i+1,s,0,0,1)),i{this.lz.CA.eo&&s>i.length&&zt.console.warn("LightningChart JS unexpected error scenario, sphere geometry buffer size mismatch.\nA point series 3D component might have missing points.\n\nThis warning can be omitted with LightningChartOptions.warnings")})),{vertices:i,drawSize:s/6}}rO(){this.lz.jO(this.NU)}}const mp=(t,e)=>{const i=Math.round(e);i<3&&Me(0,Ot);const s=i;let r=t.iN.eO.get(Array.from(t.iN.eO.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new gp(t,i,s),t.iN.eO.set({sectors:i,stacks:s},r),r)};class yp extends lp{constructor(t,e,i){super(t,e,i),this.c$="cull-back",this.GM=[],this.KU={},this.tY=new Sy(this.GM,(t=>t.vertexBuffer&&this.lz.jO(t.vertexBuffer)),!0),this.Tu=[],this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=We,this.jG=Eg({lineStyleSolid:()=>{const t=this.Su;return cs(t)&&t},lineFillSolid:()=>{const t=this.Su.getFillStyle();return U(t)&&t},lineFillPaletted:()=>{const t=this.Su.getFillStyle();return j(t)&&t},jointStyleTriangulatedPoints:()=>Er(this.Rv)&&this.Rv,jointSizeTriangulated:()=>{const t=this.Rv;return Er(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Rv.getFillStyle();return U(t)&&t},jointFillPaletted:()=>{const t=this.Rv.getFillStyle();return j(t)&&t},wireframeLineStyleSolid:()=>{const t=Er(this.Rv)&&this.Rv.getWireframeStyle();return cs(t)&&t},wireframeFillSolid:()=>{const t=Er(this.Rv)&&this.Rv.getWireframeStyle(),e=t&&t.getFillStyle();return U(e)&&e}}),this.al=!1,this.Su=Ur.lineStyle,this.Rv=Ur.pointStyle3D,this.gv._(ao),this.rY={attributesPerVertex:3,prepareRenderData:(t,e)=>oe(t)}}HG(t,e,i,s,r){return{info:{dataPoint:this.Tu[t-e]}}}Os(t){const e=this.al,i=this.rl,s=this.nl,r=s>0,n=this.Su,o=n!==this.bu,h=this.Rv,a=h!==this.P$,l=this.SO(),u=this.Yo.u,c=this.Yo.C();this.ol&&(this.el=ai(this.el,this.ol),this.ol=void 0),r&&(this.Tu=fe(this.Tu,i,{canReturnB:!0}),this.hl+=s);let d=i,f=s;if(e&&(this.GM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=We})),this.tY.HW(),d=this.Tu,f=this.hl),f>0){const t=1e5,e=Math.floor(this.OG.D$/(this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.ta("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=_t(i,t,e);this.tY.GW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:We,vertexBuffer:this.lz.fN(t*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i))})),((t,e,i,s)=>{this.lz.AN(t.vertexBuffer,t.existingCoordinatesCount*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||a||l||u){const t={},e=this.jG.lineStyleSolid(o),i=this.jG.lineFillSolid(o),s=this.jG.lineFillPaletted(o),r=i||s,h=this.jG.jointStyleTriangulatedPoints(a),l=this.jG.jointSizeTriangulated(a),u=this.jG.jointFillSolid(a),d=this.jG.jointFillPaletted(a),f=u||d,g=this.jG.wireframeLineStyleSolid(a),m=this.jG.wireframeFillSolid(a),y=n.getThickness()<0||1===n.getThickness()&&this.ta("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===y&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.lz.VV(sm["3D"],sm.Color({dataType:p}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})),mousePicking:c?{shader:this.lz.VV(sm["3D"],sm.MousePicking({useVertexId:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}))}:void 0}:"instanced"===y&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:p,shadingStyle:this.gv.C().type}),sm.LineInstanced3D({axisWorldTranslation:wg(this.At)})),geometry:pp(this.lz,e.getThickness()),mousePicking:c?{shader:this.lz.VV(sm["3D"],sm.MousePicking(),sm.LineInstanced3D({axisWorldTranslation:wg(this.At)}))}:void 0}),t.markers=void 0,f&&h){const e=ce(h.getShape(),{cube:()=>hp(this.lz),sphere:()=>Ap(this.lz,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.gv.C().type,wireframe:!1!==m}),sm.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.At),normalSource:e.o$})),mousePicking:c?{shader:this.lz.VV(sm["3D"],sm.MousePicking(),sm.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.At),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.KU=t}return this.al=!1,this.rl=[],this.nl=0,this.bu=n,this.P$=h,this.gv.u=!1,this.Yo.u=!1,this}WE(t,e){var i,s;const r=this.lz.gl,{lines:n,markers:o}=this.KU,h=this.gv.C(),a=this.hl,l=1===t?null===(i=null==n?void 0:n.mousePicking)||void 0===i?void 0:i.shader:null==n?void 0:n.shader;if(n&&l&&"instanced"===n.type){const i=l,{geometry:s,lineStyleSolid:o,fillStyleSolid:a,fillStylePaletted:u}=n;this.lz.OO(i,((n,l,c)=>{let d=!1;if(this.lz.bz(i).oN(n("uScale"),this.d$.Vz.YO()).oN(n("uDisp"),this.d$.Vz.HO()).lN(n("uViewProjectionMatrix"),this.b$).WO(n("uOffsetWU"),this.Rs.sv(o.getThickness())).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.lz.oN(n("uCameraLoc"),this.M$).oN(n("uLightLoc"),this._$).WO(n("uAmbientReflection"),h.ambientReflection).WO(n("uSpecularReflection"),h.specularReflection).WO(n("uDiffuseReflection"),h.diffuseReflection).WO(n("uShininess"),h.shininess).iL(n("uLightColor"),h.specularColor).iL(n("uAmbientColor"),h.ambientColor),1===t);else if(a)this.lz.iL(n("uColorDiffuse"),a.getColor());else if(u){const t=kg(u,this,void 0);if(!t&&u.lut.percentageValues)return!1;this.lz.fG(c,u.lut,t)}const f=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=f.Wt(e.existingDataPointsCount);this.lz.uN(n("uFirstId"),t).nG(c,i)}r.bindBuffer(r.ARRAY_BUFFER,e.vertexBuffer);const i=l("aLocationA"),o=l("aLocationB");r.vertexAttribPointer(i,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(i,1),r.enableVertexAttribArray(i),r.vertexAttribPointer(o,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.lz.xN(o,1),r.enableVertexAttribArray(o),s.bz(c).om(e.existingCoordinatesCount-1),d=!0})),d}))}if(n&&l&&"primitive"===n.type){const i=l,{fillStyleSolid:s,fillStylePaletted:o}=n;this.lz.OO(i,((n,h,a)=>{let l=!1;if(this.lz.bz(i).oN(n("uScale"),this.d$.Vz.YO()).oN(n("uDisp"),this.d$.Vz.HO()).lN(n("uViewProjectionMatrix"),this.b$).WO(n("uIsHighlighted"),1===t||2===t?0:this.jo).iL(n("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(n("uRenderEffectMask"),2===t?1:0),1===t);else if(s)this.lz.iL(n("uColor"),s.getColor());else if(o){const t=kg(o,this,void 0);if(!t&&o.lut.percentageValues)return!1;this.lz.fG(a,o.lut,t)}const u=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=u.Wt(e.existingDataPointsCount);this.lz.uN(n("uFirstId"),t).hG(a,i)}this.lz.NO(e.vertexBuffer,void 0,{location:h("aPos"),size:3}).om(r.LINE_STRIP,e.existingCoordinatesCount),l=!0})),l}))}const u=1===t?null===(s=null==o?void 0:o.mousePicking)||void 0===s?void 0:s.shader:null==o?void 0:o.shader;if(o&&u){const i=u,{geometry:s,fillStyleSolid:r,fillStylePaletted:n,pointSizeAxis:a,pointSizeNWU:l,wireframe:c}=o;this.lz.OO(i,((o,u,d,f)=>{let g=!1;if(this.lz.bz(i).oN(o("uScale"),this.d$.Vz.YO()).oN(o("uDisp"),this.d$.Vz.HO()).lN(o("uViewProjectionMatrix"),this.b$).WO(f("uRatioNwuWu"),this.d$.B$()).WO(o("uIsHighlighted"),1===t||2===t?0:this.jo).iL(o("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(o("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.lz.oN(o("uCameraLoc"),this.M$).oN(o("uLightLoc"),this._$).WO(o("uAmbientReflection"),h.ambientReflection).WO(o("uSpecularReflection"),h.specularReflection).WO(o("uDiffuseReflection"),h.diffuseReflection).WO(o("uShininess"),h.shininess).iL(o("uLightColor"),h.specularColor).iL(o("uAmbientColor"),h.ambientColor),1===t);else if(r)this.lz.iL(o("uColorDiffuse"),r.getColor());else if(n){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.lz.fG(d,n.lut,t)}c&&1!==t&&this.lz.WO(o("uWireframeThickness"),c.thickness).iL(o("uWireframeColor"),c.fillStyleSolid.getColor()),!1!==a&&this.lz.oN(o("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.lz.WO(o("uOffsetNWU"),l);const m=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=m.Wt(e.existingDataPointsCount);this.lz.uN(o("uFirstId"),t).nG(d,i)}this.lz.NO(e.vertexBuffer,1,{location:u("aPos"),size:3}),s.om(d,e.existingCoordinatesCount,"phong"===h.type&&1!==t,Boolean(c)&&1!==t),g=!0})),g}))}return{idCount:a}}ml(t,e){Array.isArray(t)||(t=[t]),this.rl=fe(this.rl,t,{canReturnB:!0}),this.nl+=t.length;const i=e||oi(t);return this.ol=this.ol?ai(this.ol,i):i,this}Ye(t){return this.Su="function"==typeof t?t(this.Su):t,this}xu(){return this.Su}Zm(t){return this.Rv="function"==typeof t?t(this.Rv):t,this}L$(){return this.Rv}St(){return this.ol?Math.max(this.ol.max.x,this.el.max.x):this.el.max.x}vt(){return this.ol?Math.min(this.ol.min.x,this.el.min.x):this.el.min.x}bt(){return this.ol?Math.max(this.ol.max.y,this.el.max.y):this.el.max.y}xt(){return this.ol?Math.min(this.ol.min.y,this.el.min.y):this.el.min.y}kv(){return this.ol?Math.max(this.ol.max.z,this.el.max.z):this.el.max.z}Tv(){return this.ol?Math.min(this.ol.min.z,this.el.min.z):this.el.min.z}Pl(){return Re(this.Su)}Dl(){return Re(this.Su)}Fv(){return Re(this.Su)}cl(){return this.Tu}ul(){return this.rl}vl(){return this.hl}Sl(){return this.nl}Ot(){return this.al=!0,this.Tu.length=0,this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=void 0,this}dispose(){return super.dispose(),this.tY.$W(),this.KU={},this}dz(){return this.dispose(),this}}const pp=(t,e)=>dp(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Ap=(t,e)=>{const i=e.getSize();return mp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class xp extends lp{constructor(t,e,i){super(t,e,i),this.c$="disabled",this.R$=!1,this.E$=!1,this.z$={x:1,y:1,z:1},this.$S={x:0,y:0,z:0},this.HS={x:0,y:0,z:0},this.V$={x:0,y:0,z:0},this.jS={x:0,y:0,z:0,w:1},this.ZS={x:1,y:1,z:1},this.O$=Lm.projectionOrthographic(-1,1,-1,1,1,-1),this.N$=Lm.projectionOrthographic(-1,1,-1,1,1,-1),this.G$=!1,this.isEulerRotation=!0,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStyleValuePalette:()=>j(this.Ie)&&"value"===this.Ie.lookUpProperty&&this.Ie}),this.Ie=Ur.fillStyle,this.gv._(ao)}Os(t){var e;const i=this.SO(),s=this.Yo.C(),r=this.Yo.u,n=this.fa();this.jG.fillStyleSolid(n);const o=this.jG.fillStyleValuePalette(n),h=this.V$,a=this.ZS;if(this.R$&&this.U$&&(this.NU=this.lz.zO(this.U$.vertices,void 0,this.NU),this.GU=this.lz.yN(this.U$.indices,this.GU),this.W$=this.U$.indices.length),"phong"===this.gv.C().type&&(i||this.R$)&&(null===(e=this.U$)||void 0===e?void 0:e.normals)&&(this.Y$=this.lz.zO(this.U$.normals,void 0,this.Y$)),!this.H$&&o&&"value"===o.lookUpProperty&&this.U$&&(this.H$=new Float32Array(this.U$.vertices.length/3),this.E$=!0),this.H$&&this.E$&&(this.$$=this.lz.zO(this.H$,void 0,this.$$)),i||n||r){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.Gz=this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.gv.C().type,wireframe:!1}),sm.Model3D({normalSource:"phong"===this.gv.C().type?"attribute":void 0})),this.qH=s?this.lz.VV(sm["3D"],sm.MousePicking({useVertexId:!0}),sm.Model3D({normalSource:void 0})):void 0}if(this.G$){const t=Lm.projectionOrthographic(-1,1,-1,1,1,-1);if(this.isEulerRotation)this.N$=Lm.rotateXYZ(t,h),this.O$=Lm.translate(t,a.x/2,a.y/2,a.z/2),this.O$=Lm.rotateXYZ(this.O$,h),this.O$=Lm.translate(this.O$,-a.x/2,-a.y/2,-a.z/2);else{const e=[-this.jS.x,-this.jS.y,-this.jS.z,this.jS.w];this.N$=Lm.quaternionToRotationMatrix(e),this.O$=Lm.translate(t,a.x/2,a.y/2,a.z/2),this.O$=Lm.multiply(this.O$,this.N$),this.O$=Lm.translate(this.O$,-a.x/2,-a.y/2,-a.z/2)}this.G$=!1}return this.gv.u=!1,this.ya(this.Ie),this.Yo.u=!1,this.R$=!1,this.E$=!1,this}WE(t,e){const i=1===t?this.qH:this.Gz,s=1===t,r=this.GU,n=this.W$,o=this.NU,h=this.Y$,a=this.$$,l=this.$S,u=this.HS,c=this.z$,d=this.ZS,f=this.O$,g=this.N$,m=this.jG.fillStyleValuePalette(!1),y=this.jG.fillStyleSolid(!1),p=this.gv.C(),A={location:void 0,size:1};if(!(i&&o&&r&&n&&this.U$))return{};const x=this.U$.vertices.length;return this.lz.OO(i,((S,v,b,M)=>{if(this.lz.bz(i).oN(S("uScale"),this.d$.Vz.YO()).oN(S("uDisp"),this.d$.Vz.HO()).lN(S("uViewProjectionMatrix"),this.b$).WO(S("uIsHighlighted"),1===t||2===t?0:this.jo).iL(S("uHighlightColorOffset"),this.Ko).WO(S("uRenderEffectMask"),2===t?1:0),s)this.lz.uN(S("uFirstId"),e).hG(b,x);else{if(this.Ie===_)return!1;if(y)this.lz.iL(S("uColorDiffuse"),y.getColor());else if(m){if(!a)return!1;const t=m.getPalette();A.location=v("aLookupValue"),this.lz.fG(b,t,void 0).NO(a,void 0,A)}}return"phong"!==p.type||s||(this.lz.oN(S("uCameraLoc"),this.M$).oN(S("uLightLoc"),this._$).WO(S("uAmbientReflection"),p.ambientReflection).WO(S("uSpecularReflection"),p.specularReflection).WO(S("uDiffuseReflection"),p.diffuseReflection).WO(S("uShininess"),p.shininess).iL(S("uLightColor"),p.specularColor).iL(S("uAmbientColor"),p.ambientColor).lN(S("uModelRotationNormals"),g),h&&this.lz.NO(h,void 0,{location:b.attribute("aNormal"),size:3})),this.lz.lN(S("uModelRotation"),f).oN(S("uModelScale"),[c.x,c.y,c.z]).oN(S("uLocationAxis"),[l.x,l.y,l.z]).oN(S("uModelAlignment"),[u.x,u.y,u.z]).oN(S("uModelSize"),[d.x,d.y,d.z]),this.lz.NO(o,0,{location:b.attribute("aGeoPos"),size:3}).wN(r).kN(n,this.lz.gl.TRIANGLES),!0})),{idCount:x}}X$(t){if(this.j$)return this.j$;const e=this.$S,i=this.HS,s=this.z$,r=this.ZS,n=this.V$,o=this.jS,h=this.d$.Wx(e),a=[],l=Lm.projectionOrthographic(-1,1,-1,1,1,-1);let u;if(this.isEulerRotation)u=Lm.translate(l,r.x/2,r.y/2,r.z/2),u=Lm.rotateXYZ(u,n),u=Lm.translate(u,-r.x/2,-r.y/2,-r.z/2);else{const t=[-o.x,-o.y,-o.z,o.w];u=Lm.translate(l,r.x/2,r.y/2,r.z/2),u=Lm.multiply(u,Lm.quaternionToRotationMatrix(t)),u=Lm.translate(u,-r.x/2,-r.y/2,-r.z/2)}const c=(i.x+1)*(r.x/2),d=(i.y+1)*(r.y/2),f=(i.z+1)*(r.z/2);for(let e=0;et.map((t=>{const e={x:i.vertices[3*t],y:i.vertices[3*t+1],z:i.vertices[3*t+2]},s=r[t],o=this.d$.Yx(s),h=this.d$.hv(o);return{index:t,vertex:e,world:s,axis:o,dist:h?ii(h,n):Ye}})))).flat();o.sort(((t,e)=>t.dist-e.dist));const h=o[0];if(!h)return;const a=this.H$?this.H$[h.index]:void 0;return{coordModel:h.vertex,coordAxis:h.axis,index:h.index,value:a}}dispose(){return super.dispose(),this.NU&&(this.lz.jO(this.NU),this.NU=void 0),this.GU&&(this.lz.jO(this.GU),this.GU=void 0),this.Y$&&(this.lz.jO(this.Y$),this.Y$=void 0),this.$$&&(this.lz.jO(this.$$),this.$$=void 0),this.Gz=void 0,this.qH=void 0,this.U$=void 0,this.H$=void 0,this}dz(){return this.dispose(),this}KS(t){return this.U$=t,this.R$=!0,this.ZS=t.modelSize,this}Re(t){return this.Ie=dn(this.Ie,t),this}Jh(){return this.Ie}tx(t){return this.z$=t,this.j$=void 0,this}YO(){return this.z$}ix(t){return this.$S=t,this.j$=void 0,this}sx(t){return this.HS=t,this.j$=void 0,this}hx(t){return this.V$=t,this.G$=!0,this.isEulerRotation=!0,this.j$=void 0,this}nx(t){return this.jS=t,this.G$=!0,this.isEulerRotation=!1,this.j$=void 0,this}ox(t){return this.c$=t,this}lx(){return this.c$}St(){return He}vt(){return Ye}bt(){return He}xt(){return Ye}kv(){return He}Tv(){return Ye}Pl(){return 0}Dl(){return 0}Fv(){return 0}fa(){return fn(this.Aa,this.Ie)}ya(t){this.Aa=t}}class Sp extends lp{constructor(t,e,i,s){super(t,e,i),this.c$="cull-back",this.GM=[],this.tY=new Sy(this.GM,(t=>t.vertexBuffer&&this.lz.jO(t.vertexBuffer)),!1),this.Tu=[],this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=We,this.al=!1,this.jG=Eg({fillStyleSolid:()=>{const t=this.Vv.getFillStyle();return U(t)&&t},fillStyleIndividual:()=>{const t=this.Vv.getFillStyle();return H(t)&&t},fillStylePalette:()=>{const t=this.Vv.getFillStyle();return j(t)&&t},triangulatedPointStyle:()=>{const t=this.Vv;return Er(t)&&t},wireframeLineStyleSolid:()=>{const t=Er(this.Vv)&&this.Vv,e=t&&t.getWireframeStyle();return cs(e)&&e},wireframeFillStyleSolid:()=>{const t=Er(this.Vv)&&this.Vv,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return U(i)&&i}}),this.ll=void 0,this.io=s,this.Vv=Ur.pointStyle3D,this.gv._(ao);const r=!0===(null==s?void 0:s.individualPointColorEnabled),n=!0===(null==s?void 0:s.individualPointSizeEnabled),o=!0===(null==s?void 0:s.individualLookupValuesEnabled),h=!0===(null==s?void 0:s.individualPointSizeAxisEnabled);let a,l,u,c,d=0;d+=3,r&&(a=d,d+=4),n&&(l=d,d+=1),o&&(u=d,d+=1),h&&(c=d,d+=3);const f=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&H(e)&&e.getFallbackColor()||k,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eoe(t))(r,n,o,h);this.rY={individualPointColorEnabled:r,individualPointSizeEnabled:n,individualLookupValuesEnabled:o,individualPointSizeAxisEnabled:h,attributesPerVertex:d,attributeOffsetCoordinate:0,attributeOffsetColor:a,attributeOffsetSize:l,attributeOffsetLookUpValue:u,attributeOffsetPointSize3D:c,prepareRenderData:(t,e)=>f(t,this.Vv,this.Vv.fillStyle)}}HG(t,e,i,s,r){return{info:{dataPoint:this.Tu[t-e]}}}Os(t){const e=this.al,i=this.rl,s=this.nl,r=s>0,n=this.Vv,o=this.Vv!==this.Z$,h=this.Yo.C(),a=this.Yo.u,l=this.SO();this.ol&&(this.el=ai(this.el,this.ol),this.ol=void 0),r&&(this.Tu=fe(this.Tu,i,{canReturnB:!0}),this.hl+=s);let u=i,c=s;if(e&&(this.GM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=We})),this.tY.HW(),u=this.Tu,c=this.hl),c>0){const t=Math.floor(this.OG.D$/(this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=_t(c,1e5,t);this.tY.GW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:We,vertexBuffer:this.lz.fN(t*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i))})),((t,e,i)=>{this.lz.AN(t.vertexBuffer,t.existingCoordinatesCount*this.rY.attributesPerVertex,this.rY.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.jG.fillStyleSolid(o),g=this.jG.fillStyleIndividual(o),m=this.jG.fillStylePalette(o),y=d===_&&_;if(o||l||a){let t;const e=n.getSize(),i=this.rY.individualPointColorEnabled,s=this.rY.individualPointSizeEnabled,r=this.rY.individualPointSizeAxisEnabled,a=this.rY.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw zt.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw zt.alert(t),new Error(t)}const l=this.jG.wireframeLineStyleSolid(o),u=this.jG.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(Er(n)){const r=ce(n.getShape(),{cube:()=>hp(this.lz),sphere:()=>vp(this.lz,n,s)});t={type:"instanced",shader:this.lz.VV(sm["3D"],sm.ColorShaded3D({dataType:i,shadingStyle:this.gv.C().type,wireframe:!1!==u}),sm.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.At),normalSource:r.o$})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:y,mousePickingShader:h&&this.lz.VV(sm["3D"],sm.MousePicking(),sm.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.At),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else zr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.lz.VV(sm["3D"],sm.PointSize(c),sm.Color({dataType:i}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:h&&this.lz.VV(sm["3D"],sm.PointSize(c),sm.MousePicking({useVertexId:!0}),sm.VertexLocation({axisWorldTranslation:wg(this.At),normalSource:void 0}))})}this.KU=t}if(void 0===this.ll&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=He,e=Ye;for(let i=0;it&&(t=s.value)}this.ll={min:e,max:t}}return this.al=!1,this.rl=[],this.nl=0,this.Z$=n,this.gv.u=!1,this}WE(t,e){const i=this.lz.gl,s=this.KU,r=this.hl;if(!s)return{};const n=1===t?s.mousePickingShader:s.shader;if(!n)return{};const o=this.gv.C(),{fillStyleSolid:h,fillStylePaletted:a,useIndividualPointSize:l}=s,u="instanced"===s.type&&s.useIndividualPointSize3D,c="instanced"===s.type&&s.wireframe;return this.lz.OO(n,((r,d,f,g)=>{let m=!1;if(this.lz.bz(n).oN(r("uScale"),this.d$.Vz.YO()).oN(r("uDisp"),this.d$.Vz.HO()).lN(r("uViewProjectionMatrix"),this.b$).WO(r("uIsHighlighted"),1===t||2===t?0:this.jo).iL(r("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(r("uRenderEffectMask"),2===t?1:0),"instanced"===s.type){const{pointSizeAxis:t,pointSizeNWU:e}=s;!1!==t&&!1===u&&this.lz.oN(r("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===l&&this.lz.WO(r("uOffsetNWU"),e).WO(g("uRatioNwuWu"),this.d$.B$())}else if("primitive"===s.type){const{pointSizePixels:t}=s;l||this.lz.WO(r("uPointSize"),t).WO(r("uDevicePixelRatio"),this.lz.MO())}if(1===t);else if("instanced"===s.type?("phong"===o.type&&this.lz.oN(r("uCameraLoc"),this.M$).oN(r("uLightLoc"),this._$).WO(r("uAmbientReflection"),o.ambientReflection).WO(r("uSpecularReflection"),o.specularReflection).WO(r("uDiffuseReflection"),o.diffuseReflection).WO(r("uShininess"),o.shininess).iL(r("uLightColor"),o.specularColor).iL(r("uAmbientColor"),o.ambientColor),c&&this.lz.WO(r("uWireframeThickness"),c.thickness).iL(r("uWireframeColor"),c.fillStyleSolid.getColor()),h&&this.lz.iL(r("uColorDiffuse"),h.getColor()),s.fillStyleEmpty&&this.lz.iL(r("uColorDiffuse"),I)):"primitive"===s.type&&h&&this.lz.iL(r("uColor"),h.getColor()),a){const t=kg(a,this,this.ll);if(!t&&a.lut.percentageValues)return!1;this.lz.fG(f,a.lut,t)}const y=Ne(e);return this.GM.forEach((e=>{if(1===t){const[t,i]=y.Wt(e.existingDataPointsCount);this.lz.uN(r("uFirstId"),t),"instanced"===s.type?this.lz.nG(f,i):this.lz.hG(f,i)}i.bindBuffer(i.ARRAY_BUFFER,e.vertexBuffer);const n=d("aPos");if(i.vertexAttribPointer(n,3,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(n,1),i.enableVertexAttribArray(n),s.fillStyleIndividual&&void 0!==this.rY.attributeOffsetColor&&1!==t){const t=d("aColor");i.vertexAttribPointer(t,4,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}if(l&&void 0!==this.rY.attributeOffsetSize){"instanced"===s.type?this.lz.WO(g("uRatioNwuWu"),this.d$.B$()):"primitive"===s.type&&this.lz.WO(r("uDevicePixelRatio"),this.lz.MO());const t=d("instanced"===s.type?"aOffsetNWU":"aPointSize");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}if(u&&void 0!==this.rY.attributeOffsetPointSize3D&&"instanced"===s.type){const t=d("aOffsetAxis");i.vertexAttribPointer(t,3,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}if(s.fillStylePaletted&&"value"===s.fillStylePaletted.getLookUpProperty()&&void 0!==this.rY.attributeOffsetLookUpValue&&1!==t){const t=d("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.rY.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.rY.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.lz.xN(t,1),i.enableVertexAttribArray(t)}"instanced"===s.type?(s.geometry.om(f,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(c)&&1!==t),m=!0):"primitive"===s.type&&(this.lz.om(i.POINTS,e.existingCoordinatesCount),m=!0)})),m})),{idCount:r}}ml(t,e){Array.isArray(t)||(t=[t]),this.rl=fe(this.rl,t,{canReturnB:!0}),this.nl+=t.length;const i=e||oi(t);return this.ol=this.ol?ai(this.ol,i):i,this.ll=void 0,this}Ov(t){return this.Vv="function"==typeof t?t(this.Vv):t,this}Q$(){return this.Vv}St(){return this.ol?Math.max(this.ol.max.x,this.el.max.x):this.el.max.x}vt(){return this.ol?Math.min(this.ol.min.x,this.el.min.x):this.el.min.x}bt(){return this.ol?Math.max(this.ol.max.y,this.el.max.y):this.el.max.y}xt(){return this.ol?Math.min(this.ol.min.y,this.el.min.y):this.el.min.y}kv(){return this.ol?Math.max(this.ol.max.z,this.el.max.z):this.el.max.z}Tv(){return this.ol?Math.min(this.ol.min.z,this.el.min.z):this.el.min.z}Pl(){const t=this.Vv,e=t.getSize();return"number"==typeof e?Er(t)?e/2:zr(t)?5:0:0}Dl(){return this.Pl()}Fv(){return this.Pl()}cl(){return this.Tu}ul(){return this.rl}vl(){return this.hl}Sl(){return this.nl}Ot(){return this.al=!0,this.Tu.length=0,this.hl=0,this.rl=[],this.nl=0,this.el=We,this.ol=void 0,this.ll=void 0,this}dispose(){return super.dispose(),this.tY.$W(),this.KU=void 0,this}dz(){return this.dispose(),this}}const vp=(t,e,i)=>{const s=e.getSize();return mp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class bp extends lp{constructor(t,e,i,s){super(t,e,i),this.c$="disabled",this.Ie=Ur.fillStyle,this.FS=Ur.lineStyle,this.WY=p("bilinear"),this.J$=[],this.K$=void 0,this.KU={},this.q$=!1,this.jG=Eg({fillStyleSolid:()=>U(this.Ie)&&this.Ie,fillStylePaletted:()=>j(this.Ie)&&this.Ie,wireframeStyleLine:()=>cs(this.FS)&&this.FS,wireframeStyleFill:()=>{const t=this.FS&&this.FS.getFillStyle();return U(t)&&t}}),this.Pi={x:0,z:0},this.Cw={x:1,z:1},this.gv._(oo);const r="columns"===s.dataOrder?s.columns:s.rows,n="columns"===s.dataOrder?s.rows:s.columns;this.io={...s,primaryDimensionVectorsCount:r,secondaryDimensionVectorsCount:n},this.tX=new Array(this.io.primaryDimensionVectorsCount).fill(void 0),this.c_=new By(this.OG,t.OG.nH,t.cs.At,Ot,[],this.io).IS(ut),this.c_.$Y=Ry;const o=this.c_.ZY.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),o={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:s,iFirstGeometryUniqueVector:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:n,normalmapSize:o}})),h=this.c_.ZY.gridTileSizes.map((t=>{const e=o.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary)),i=e[0].sizeGeometryDataVectors;return{...t,tiles:e,sizeGeometryData:i}})),a=o.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,r=i*s;return r>t.cells?{primary:i,secondary:s,cells:r}:t}),{primary:0,secondary:0,cells:0});this.iX={gridTiles:o,gridTileSizes:h,largestGridTileSize:a},this.BS(this.Pi,this.Cw)}HG(t,e,i,s,r){const n=t-e,o=n%(this.io.secondaryDimensionVectorsCount-1),h=Math.floor(n/(this.io.secondaryDimensionVectorsCount-1)),a="columns"===this.io.dataOrder?h:o,l="rows"===this.io.dataOrder?h:o,u=[{x:this.Pi.x+a*this.Cw.x,z:this.Pi.z+l*this.Cw.z,y:this.sX(h,o),intensity:this.eX(h,o),column:"columns"===this.io.dataOrder?h:o,row:"columns"===this.io.dataOrder?o:h},{x:this.Pi.x+(a+("columns"===this.io.dataOrder?1:0))*this.Cw.x,z:this.Pi.z+(l+("rows"===this.io.dataOrder?1:0))*this.Cw.z,y:this.sX(h+1,o),intensity:this.eX(h+1,o),column:"columns"===this.io.dataOrder?h+1:o,row:"columns"===this.io.dataOrder?o:h+1},{x:this.Pi.x+(a+1)*this.Cw.x,z:this.Pi.z+(l+1)*this.Cw.z,y:this.sX(h+1,o+1),intensity:this.eX(h+1,o+1),column:"columns"===this.io.dataOrder?h+1:o+1,row:"columns"===this.io.dataOrder?o+1:h+1},{x:this.Pi.x+(a+("columns"===this.io.dataOrder?0:1))*this.Cw.x,z:this.Pi.z+(l+("rows"===this.io.dataOrder?0:1))*this.Cw.z,y:this.sX(h,o+1),intensity:this.eX(h,o+1),column:"columns"===this.io.dataOrder?h:o+1,row:"columns"===this.io.dataOrder?o+1:h}],c=u.map((t=>this.d$.hv(t))).map((t=>void 0===t?Ye:ii(t,{x:s,y:r}))).map(((t,e)=>({i:e,dist:t})));return c.sort(((t,e)=>t.dist-e.dist)),{info:{dataPoint:{...u[c[0].i]}}}}sX(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.heightmapData[n]}}return 0}eX(t,e){if(this.c_.HY)for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}}hX(t){this.rX=t,this.K$=void 0}BS(t,e){this.Pi=t,this.Cw=e;const i=this.io,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.Cw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.Cw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.Cw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.Cw.z)}},r=new Map;return this.iX.gridTiles.forEach((t=>{const e="columns"===this.io.dataOrder?{x:this.Cw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Cw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Cw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Cw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.io.dataOrder?{x:this.Pi.x+this.Cw.x*t.iFirstVector.primary,z:this.Pi.z+this.Cw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.Cw.x*t.iFirstVector.secondary,z:this.Pi.z+this.Cw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.iH={nX:s,tilesInfo:r},this}LS(){return{start:this.Pi,step:this.Cw,end:{x:this.Pi.x+this.Cw.x*this.io.columns,z:this.Pi.z+this.Cw.z*this.io.rows}}}Os(t){const e=this.J$,i=fn(this.Aa,this.Ie),s=this.jG.fillStyleSolid(i),r=this.jG.fillStylePaletted(i),n=this.FS,o=this.FS!==this.QY,h=this.jG.wireframeStyleLine(o),a=this.jG.wireframeStyleFill(o),l=!1!==a,u=this.WY.u,c=this.WY.C(),d=this.gv.C(),f=this.SO(),g=this.Yo.C();this.c_.Os();const m=this.c_.JY;if(!m)return this;this.oX=this.oX||this.aX(m);const y=this.oX;this.lX(y);const p=Dy(e,y,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Ly(this.lz,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.q$=!0),"phong"===d.type&&(p.size>0||f)){const t=this.lz.gl,e=this.lz.VV(sm["2D"],sm.DrawToNormalTexture({flipXZ:"rows"===this.io.dataOrder,vertexIdSource:this.lz.eG(),normalTextureType:this.lz.gl2?"uint":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN}));y.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.iH)||void 0===r?void 0:r.tilesInfo.get(s.tileData);if(!n||!o)return;const h={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},a=h.x*h.y;this.lz.NN.WE((()=>{this.lz.OO(e,((r,n,h,l)=>(this.lz.bz(e).hG(h,a).GO(r("uTileDimensionsXZ"),["columns"===this.io.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.io.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).rN(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).GO(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).GO(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).UO(r("uHeightmapTexture"),s.heightmapDataTexture,1).om(t.POINTS,a),!0)))}),n,h,void 0,this.cs.In(),0)}))}))}const A=this.KU;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(A.surface={shader:this.lz.VV(sm["3D"],sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return A.mousePicking=g?this.KU.mousePicking||{shader:this.lz.VV(sm["3D"],sm.MousePicking(),sm.SurfaceGrid({axisWorldTranslation:wg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.io.dataOrder,shadingStyle:"simple",wireframe:!1,normalTextureType:this.lz.gl2?"uint":"ubyte",intensityTextureType:this.lz.BV?"float":"ubyte",heightmapTextureType:this.lz.BV?"float":"ubyte",littleEndian:this.lz.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.KU=A,this.J$.length=0,this.Aa=this.Ie,this.QY=n,this.gv.u=!1,this}aX(t){const e=this.iX.gridTiles.map((e=>{const i=Oy(this.lz,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary),s=t.gridTiles.find((t=>t.iFirstUniqueVector.primary===e.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===e.iFirstUniqueVector.secondary));if(!s)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return{...e,intensityDataTexture:s.intensityDataTexture,heightmapDataTexture:i,normalmap:void 0,tileData:e}})),i=this.iX.gridTileSizes.map((t=>{const i=e.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary));return{...t,tiles:i}})),s=this.lz.zO([0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0]),r=this.lz.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}lX(t){var e;if("phong"===this.gv.C().type)for(let i=0;i{t.normalmapTexture&&(this.lz.fz(t.normalmapTexture),t.normalmapTexture=void 0)}))}WE(t,e){var i,s,r,n;const o=this.lz.gl,h=this.oX;if(!h)return{};const a=this.gv.C(),l=this.KU,u=1===t?null===(i=l.mousePicking)||void 0===i?void 0:i.shader:null===(s=l.surface)||void 0===s?void 0:s.shader;if(!u)return{};const c=1!==t?null===(r=l.surface)||void 0===r?void 0:r.wireframe:void 0,d=1!==t?null===(n=l.surface)||void 0===n?void 0:n.fill:void 0;return this.lz.OO(u,((i,s,r,n)=>{let l=!1;if(this.lz.bz(u).nG(r,this.iX.largestGridTileSize.cells).oN(i("uScale"),this.d$.Vz.YO()).oN(i("uDisp"),this.d$.Vz.HO()).lN(i("uViewProjectionMatrix"),this.b$).WO(i("uIsHighlighted"),1===t||2===t?0:this.jo).iL(i("uHighlightColorOffset"),1===t||2===t?I:this.Ko).WO(i("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.lz.oN(i("uCameraLoc"),this.M$).oN(i("uLightLoc"),this._$).WO(i("uAmbientReflection"),a.ambientReflection).WO(i("uSpecularReflection"),a.specularReflection).WO(i("uDiffuseReflection"),a.diffuseReflection).WO(i("uShininess"),a.shininess).iL(i("uLightColor"),a.specularColor).iL(i("uAmbientColor"),a.ambientColor),c)){const{wireframeFillSolid:t,wireframeSolid:e}=c,s=e.getThickness()<0?1:e.getThickness();this.lz.iL(i("uWireframeColor"),t.getColor()).WO(i("uWireframeThickness"),s)}return 1===t||"solid"===(null==d?void 0:d.fillMode)&&this.lz.iL(i("uColorDiffuse"),d.fillStyleSolid.getColor()),h.gridTileSizes.forEach((n=>{this.lz.GO(i("uTileDimensionsXZ"),["columns"===this.io.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.io.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).rN(i("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var u;const f=null===(u=this.iH)||void 0===u?void 0:u.tilesInfo.get(a.tileData);if(!f)return;let g=0,y=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.rX){const t=this.rX.fill.iFirstPrimary,e=this.rX.fill.iFirstPrimary+this.rX.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);g=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),y=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(g<0||y<=0)){if("intensity"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e=this.c_.ll;this.lz.fG(r,t.lut,e).UO(i("uTileIntensityValues"),a.intensityDataTexture,2).nN(i("uTileBoundsAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z,f.sizeAxis.x,f.sizeAxis.z])}if("xyz"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e="x"===t.getLookUpProperty()?{min:this.vt(),max:this.St()}:"y"===t.getLookUpProperty()?{min:this.xt(),max:this.bt()}:"z"===t.getLookUpProperty()?{min:this.Tv(),max:this.kv()}:void 0;if(!e&&t.lut.percentageValues)return;this.lz.fG(r,t.lut,e)}1!==t&&"phong"===this.gv.C().type&&a.normalmapTexture&&this.lz.UO(i("uNormalmapTexture"),a.normalmapTexture,3),1===t&&this.lz.uN(i("uFirstId"),e+g),this.lz.NO(h.rectangleLocationsBuffer,0,{location:s("aGeoCellOffset"),size:2},{location:c?s("aTriangleBary"):void 0,size:3}).uN(i("uBaseInstance"),g).GO(i("uTileStartLocationAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z]).GO(i("uTileSizeAxisXZ"),[f.sizeAxis.x,f.sizeAxis.z]).UO(i("uHeightmapTexture"),a.heightmapDataTexture,0).TN(h.rectangleLocationsDrawMode,0,h.rectangleLocationsDrawLength,y),l=!0,o.bindBuffer(o.ARRAY_BUFFER,null)}}))})),l})),{idCount:this.io.columns*this.io.rows}}dispose(){return super.dispose(),this.c_.dispose(),this.oX&&(this.oX.gridTileSizes.forEach((t=>{})),this.oX.gridTiles.forEach((t=>{this.lz.fz(t.heightmapDataTexture),t.normalmapTexture&&this.lz.fz(t.normalmapTexture)})),this.lz.jO(this.oX.rectangleLocationsBuffer),this.oX=void 0),this.KU={},this}dz(){return this.dispose(),this.c_.dz(),this}VS(t){return this.c_.VS(t),this}OS(t){this.J$.push(t),Py(this.iX.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let n=Math.max(t,r.iFirstUniqueVector.primary);n<=Math.min(e,r.iFirstUniqueVector.primary+r.sizeUniqueHeatmapDataVectors.primary-1);n+=1){const t=(n-r.iFirstUniqueVector.primary)*r.sizeHeatmapDataVectors.secondary;let e=this.tX[n];if(e)i=ie.max?s:e.max;else{e={min:Ye,max:He},this.tX[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.K$={min:i,max:s},this.K$}}class Mp extends lp{constructor(t,e,i,s){super(t,e,i),this.c$="disabled",this.eH=0,this.rH={},this.cX=new Map,this.Pi={x:0,z:0},this.Cw={x:1,z:1},this.io={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.nX={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.Cw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.Cw.z:this.Pi.z}};const r=()=>({shape:new bp(this.d$,Ot,this.Qo,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"}).setVisible(!1),hasData:!1});this.GM=[r(),r()]}Os(t){this.GM.forEach((e=>{e.shape.Os(t)}));const e=this.GM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Vt(null===(i=e.shape.c_.ll)||void 0===i?void 0:i.min,Ye)),t.max=Math.max(t.max,Vt(null===(s=e.shape.c_.ll)||void 0===s?void 0:s.max,He)),t}),{min:Ye,max:He}),i=this.GM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Vt(null===(i=e.shape.K$)||void 0===i?void 0:i.min,Ye)),t.max=Math.max(t.max,Vt(null===(s=e.shape.K$)||void 0===s?void 0:s.max,He)),t}),{min:Ye,max:He});return this.GM.forEach((t=>{t.shape.c_.ll=e,t.shape.K$=i})),this}WE(t,e){let i=0;return this.GM.forEach((s=>{if(!s.hasData)return;s.shape.b$=this.b$,s.shape.M$=this.M$,s.shape._$=this._$;const{idCount:r}=s.shape.WE(t,e+i);void 0!==r&&(this.cX.set(s,{idFirst:e+i,idCount:r}),i+=r)})),{idCount:i}}HG(t,e,i,s,r){const n=Array.from(this.cX).find((e=>ti(t,e[1].idFirst,e[1].idFirst+e[1].idCount-1)));return n?n[0].shape.HG(t,n[1].idFirst,n[1].idCount,s,r):{}}BS(t,e){return this.Pi=t,this.Cw=e,this.GM.forEach((t=>{t.shape.BS("columns"===this.io.scrollDimension?{x:t.shape.LS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.LS().start.z},this.Cw)})),"columns"===this.io.scrollDimension?(this.nX.min.z=t.z,this.nX.max.z=this.Pi.z+(this.io.rows-1)*this.Cw.z):(this.nX.min.x=t.x,this.nX.max.x=this.Pi.x+(this.io.columns-1)*this.Cw.x),this}LS(){return{start:this.Pi,step:this.Cw}}Ot(){return this.eH=0,this.rH={},this.nX={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.io.scrollDimension?this.Pi.x+(this.io.columns-1)*this.Cw.x:this.Pi.x,z:"columns"===this.io.scrollDimension?this.Pi.z+(this.io.rows-1)*this.Cw.z:this.Pi.z}},this.GM.forEach((t=>{t.shape.setVisible(!1),t.shape.q$=!1,t.hasData=!1})),this}WS(t){var e;const i=this.GM[0],s=this.GM[1],r=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let n=0;if(!r)return this;do{const e=Math.floor(this.eH/this.io.scrollDimensionSize)%this.GM.length,o=this.GM[e],h=this.eH%this.io.scrollDimensionSize,a=this.io.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,y=this.eH>=this.io.scrollDimensionSize&&c<=this.io.scrollDimensionSize-1,p=l;l&&(o.shape.BS("columns"===this.io.scrollDimension?{x:this.Pi.x+(this.eH-1)*this.Cw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.eH-1)*this.Cw.z},this.Cw),o.shape.setVisible(!0));const A=y?0:1,x=c+(y?1:0);o.shape.hX({fill:{iFirstPrimary:A,amountPrimary:x},wireframe:{iFirstPrimary:A,amountPrimary:x,connectNext:!1}});const S=o===i?s:i,v=c+1,b=1+this.io.scrollDimensionSize-v;S.shape.hX({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;p&&this.rH.yValues&&(i=!0,e.splice(0,0,this.rH.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.io.staticDimensionSize,values:e,type:"y"};o.shape.OS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;p&&this.rH.intensityValues&&(i=!0,e.splice(0,0,this.rH.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.io.staticDimensionSize,values:e,type:"intensity"};o.shape.VS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.eH+=u,n+=u,this.rH=M}while(ne.shape.ES(t))),this}zS(){return this.GM[0].shape.zS()}Re(t){return this.GM.forEach((e=>e.shape.Re(t))),this}Jh(){return this.GM[0].shape.Jh()}IS(t){return this.GM.forEach((e=>e.shape.IS(t))),this}RS(){return this.GM[0].shape.RS()}dz(){return this.dispose(),this.GM.forEach((t=>t.shape.dz())),this}dispose(){return super.dispose(),this.GM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.GM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}_v(t){return super._v(t),this.GM.forEach((e=>e.shape._v(t))),this}St(){return this.nX.max.x}vt(){return this.nX.min.x}bt(){return Math.max(this.GM[0].shape.bt(),this.GM[1].shape.bt())}xt(){return Math.min(this.GM[0].shape.xt(),this.GM[1].shape.xt())}kv(){return this.nX.max.z}Tv(){return this.nX.min.z}Pl(){return 0}Dl(){return 0}Fv(){return 0}ds(t){return super.ds(t),this.GM.forEach((e=>e.shape.ds(t))),this}}class Cp extends Qy{constructor(t,e,i,s){super(t,e,i),this.M$=f(0,0,1),this.dX=f(0,0,-1),this.fX=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.gv=new no,this.At=s}_x(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.At,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.cs.oi();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.M$=t,this}getCameraLocation(){return this.M$}setCameraDirection(t){return this.dX=Ue.normalize(t),this}getCameraDirection(){return this.dX}setLightLocation(t){return this._$=t,this}getLightLocation(){return this._$}AX(){return f(this.fX[0],this.fX[1],this.fX[2])}gX(){return f(this.fX[4],this.fX[5],this.fX[6])}}class Tp extends Cp{constructor(t,e,i,s){super(t,e,i,s),this.Vz=new Zm,this.pX=!0,this.yX="perspective",this.OG=t,this.gl=t.GG(),this.r$=this.t$,this.mX=this.cs.Eo((()=>{this.pX=!0})),this.vX=s.H((()=>{this.pX=!0}))}EO(t){const e=t.vt(),i=t.xt(),s=t.Tv(),r=t.St(),n=t.bt(),o=t.kv();if(e===Ye||r===He||i===Ye||n===He||s===Ye||o===He)return Xe;const h=t.Pl(),a=t.Dl(),l=t.Fv(),u=Math.abs(t.Rs.sv(h)*t.At.x.rt()),c=Math.abs(t.Rs.sv(a)*t.At.y.rt()),d=Math.abs(t.Rs.sv(l)*t.At.z.rt()),f=e-u,g=r+u,m=i-c,y=n+c,p=s-d,A=o+d;let x;return[{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:A},{x:g,y:m,z:A},{x:f,y,z:A},{x:g,y,z:A}].map((e=>t.Rs.hv(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?hi(x,{min:t,max:t}):e})),x||Xe}hv(t){if(this.SX(),this.xX(),!this.b$)return;const e=this.Vz.HO(),i=f(e[0],e[1],e[2]),s=this.Vz.YO(),r=f(s[0],s[1],s[2]),n=Ue.divideVec(Ue.subtractVec(t,i),r),o=this.b$,h=Lm.multiply(o,[n.x,n.y,n.z,1]),a=u(h[0]/h[3],h[1]/h[3]),l=this.cs.oi();return{x:.5*(1+a.x)*l.x,y:.5*(1+a.y)*l.y}}Wx(t){const e=this.Vz.HO(),i=this.Vz.YO(),s=Ue.divideVec(Ue.subtractVec(t,{x:e[0],y:e[1],z:e[2]}),{x:i[0],y:i[1],z:i[2]});return{...t,x:s.x,y:s.y,z:s.z}}Yx(t){const e=this.Vz.HO(),i=this.Vz.YO(),s=Ue.addVec(Ue.multiplyVec(t,{x:i[0],y:i[1],z:i[2]}),{x:e[0],y:e[1],z:e[2]});return{...t,x:s.x,y:s.y,z:s.z}}sv(t){return t/1e3}B$(){return.001}Os(){const t=this.M$,e=this._$,i=this.At.x.u||this.At.y.u||this.At.z.u;if(!e)throw Me(0,(()=>Ce()));const{viewProjectionMatrix:s}=this.SX();this.xX();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.t$.forEach((t=>{t.b$=s,t.M$=r,t._$=n,t.Os(i)})),this}Gx(t){this.yX!==t&&(this.yX=t,this.pX=!0)}Ux(){return this.yX}SX(){if(!this.pX&&this.b$)return{viewProjectionMatrix:this.b$};const t=this._x(),e=t.width/t.height;if("perspective"===this.yX)this.bX=Lm.projectionPerspective(45,e,.1,100);else{let t,i;const s=.5*Ue.length(this.M$);e>1?(t=s,i=t/e):(i=s,t=i*e),this.bX=Lm.projectionOrthographic(-t,t,-i,i,-400,100)}const i=this.M$;this.fX[12]=i.x,this.fX[13]=i.y,this.fX[14]=i.z;const s=this.dX,r=f(0,1,0),n=Ue.multiply(s,-1),o=Ue.normalize(Ue.cross(r,n)),h=Ue.normalize(Ue.cross(n,o));this.fX[0]=o.x,this.fX[1]=o.y,this.fX[2]=o.z,this.fX[4]=h.x,this.fX[5]=h.y,this.fX[6]=h.z,this.fX[8]=n.x,this.fX[9]=n.y,this.fX[10]=n.z,this.MX=Lm.inverse(this.fX);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.At,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,m=(a.y+l.y/2)/u.y,y=Lm.multiply(Lm.translation(Jn(-1,1,g),Jn(-1,1,m),0),Lm.scaling(c,d,1));return this.b$=Lm.multiply(y,Lm.multiply(this.bX,this.MX)),this._X=Lm.inverse(this.b$),this.pX=!1,{viewProjectionMatrix:this.b$}}xX(){this.Vz.PG(this.At.x),this.Vz.DG(this.At.y),this.Vz.BG(this.At.z)}WE(t,e,i){var s;const r=this.gl.MO(),n=this._x(),o={x:n.x*r*e,y:n.y*r*e,width:n.width*r*e,height:n.height*r*e};this.gl.RO(o.x,o.y,o.width,o.height);let h=((null===(s=i[i.length-1])||void 0===s?void 0:s.idLast)||0)+1;const a=Array.from(this.r$.values());for(let e=0;e(this.ji||this.Mn||pm(this.lz.gl)||(t&&(this.wX=!0),this.pn=!0,this.BX||this.ln.zV(t)),this),this.BX=!1,this.UV=t=>{if(this.ji||this.Mn)return;const e=t-this.CX;if(e>=this.ao||-1===this.ao){this.BX=!0,this.CX=t,this.wX=!1;const i=e>50?1e3/60:e;this.yn&&this.yn(i),this.pn=!1,-1!==this.ao&&this.wX&&(this.ln.zV(this.wX),this.pn=!0),this.us.Os(e),this.Dn(),this.Bn(),this.mn&&this.mn(),this.BX=!1,this.R.emit("render"),this.pn&&this.Ms(this.wX)}else this.pn=!0,this.ln.zV()},this.LX=new Map,this.GG=()=>this.lz,this.RX=()=>{var t,e,i;const s=this.Zn(),r=this.kX,n=zt.performance.now(),o=null===(t=this.EX)||void 0===t?void 0:t.zX.reduce(((t,e)=>t?e.VX&&t.VX&&e.VX>t.VX?e:t:e),void 0),h=null==o?void 0:o.VX,a=null===(e=this.Yn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Qn)||void 0===i?void 0:i.timeStamp,u=this.OX;return r?(this.Ms(!0),!1):void 0===o||(void 0===o||!o.NX)&&(void 0!==l&&void 0!==h&&l>h||(void 0!==h&&void 0===s?n-h>=1e3:!(void 0!==h&&void 0!==a&&n-a>=2e3&&(void 0===u||n-u>=2e3))||n-h>=1e3))},this.GX=()=>{var t,e;this.UX=void 0;const i=null===(e=null===(t=this.EX)||void 0===t?void 0:t.WX)||void 0===e?void 0:e.YX;void 0===i||i>=this.TX||this.HX()},this.Bn=()=>{if(this.ji||this.Mn)return this;const t=this.lz.gl,e=zt.performance.now();this.lz.BO(t.FRAMEBUFFER,this.ln.PV?this.MV[0]:null);const i=this.Z,s=i.x>0&&i.y>0;if(this.Fn.u&&this.lz.PN(this.Fn.C()),t.resize&&s&&t.resize(i.x*this.lz.MO(),i.y*this.lz.MO()),this.lz.LO(0,0,i.x*this.lz.MO(),i.y*this.lz.MO()),this.lz.RO(0,0,i.x*this.lz.MO(),i.y*this.lz.MO()),this.lz.Ot(),s)for(const t of this.fn.values())t.WE(0,1,[]);if(this.io.ro&&s&&(this.UX&&(zt.clearTimeout(this.UX),this.UX=void 0),this.RX()?(this.HX(),this.lz.BO(t.FRAMEBUFFER,this.ln.PV?this.MV[0]:null)):this.UX=zt.setTimeout(this.GX,500)),this.J(),this.nn(),this.Vn&&this.zn(this.Vn),this.ln.PV){const e=this.lz.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.MV[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.MV[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.yV),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),0),t.bindTexture(t.TEXTURE_2D,null);return this.lz.BO(t.FRAMEBUFFER,null),pm(this.lz.gl)?this.ln.gV(0,0,this.Z.x*this.lz.MO(),this.Z.y*this.lz.MO(),[this]):this.ln.zV(),this.kX=!1,this.TX=e,this},this.Dn=()=>{if("use-window"===this.$X.mode){const t=zt.devicePixelRatio||1;this.lz.HN(t)}const t=this.Z;if(0===t.x||0===t.y)return this;this.vo.it(t);for(const t of this.fn.values())t.Os();return this.J(),this},this.ln=t,this.ln.FV){this.XX=zt.document.createElement("canvas"),this.XX.style.width="100%",this.XX.style.height="100%",this.XX.style.display="block",this.XX.style.boxSizing="content-box",this.XX.style.position="absolute";const t=this.XX.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new Mt("No Canvas context available.");this.mV=t,this.qr.appendChild(this.XX)}this.ln.HV(this);const r={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let n;if(this.ln.PV&&t.gl2&&(n=new s(this,this.io,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),n||this.ln.PV||(n=new s(this,this.io,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),!n)throw new Mt("No WebGL context available");if(this.lz=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.$X={mode:"fixed",value:e.devicePixelRatio},this.lz.HN(e.devicePixelRatio);else{const t=zt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=zt.devicePixelRatio||1;this.$X=i?{mode:"use-window"}:{mode:"fixed",value:s},this.lz.HN(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.po=this.jX(o),this.mo=this.jX(h),this.ZX(this.po,this.mo),this.nH=this.KF("engine offscreen",1e6),this.QX=this.KF("engine bg",0);const a="function"==typeof this.ts.lcjsBackgroundFillStyle?It({resourcesBaseUrl:this.io.te,styleFactory:this.ts.lcjsBackgroundFillStyle,apply:t=>this.setBackgroundFillStyle(t)}):this.ts.lcjsBackgroundFillStyle;this.vo=this.QX.Ee(this.At).Re(a).Le(this.ts.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ve({x:0,y:0});const l=this.KF("engine effects",200001).n$(this.ts.effect);this.hs=l;const u=this.ln.PV,d=this.oi();u&&(this.MV=[n.JO(),n.JO()]);const f=this.lz.gl;u&&(this.FX=f.createRenderbuffer(),this.IX=f.createRenderbuffer()),this.yV=f.createTexture();const g=d.x*this.lz.MO(),m=d.y*this.lz.MO();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.FX);const t=this.lz.gl2.ctx;this.PX=this.ln.aV&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.PX,t.RGBA8,g,m),f.bindRenderbuffer(f.RENDERBUFFER,this.IX),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,m),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.PX,t.DEPTH_COMPONENT16,g,m)}u&&(this.lz.BO(f.FRAMEBUFFER,this.MV[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.FX),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.IX)),f.bindTexture(f.TEXTURE_2D,this.yV),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,m,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),u&&(this.lz.BO(f.FRAMEBUFFER,this.MV[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.yV,0)),this.lz.BO(f.FRAMEBUFFER,null),this.kn(),this.nn(),this.vp=_r(this),this.Sp={ts:this.ts,us:this.us,At:this.At,Ms:t=>this.Ms(t),Zn:()=>this.Zn(),xs:t=>(this.OX=zt.performance.now(),this.xs({x:t.clientX,y:t.clientY})),GD:t=>this.GD(t),io:this.io,Jn:t=>this.Jn(t),hs:this.hs,Uo:t=>this.Uo(t),Wo:t=>this.Wo(t),$g:{Hg:(t,e,i)=>this.lz.tr(e.family)._z(t,e,i,this.ts.isDark)},Is:()=>!!this.On,Ds:t=>{var e;return(null===(e=this.On)||void 0===e?void 0:e.collectionMember)===t},jR:()=>void 0!==this.wn};const y=()=>{this.Y()};zt.addEventListener("unload",y),this.vn.push((()=>{zt.removeEventListener("unload",y)}))}get JX(){return this.fn}un(t,e){let i=this.LX.get(t);if(!i){const e=this.lz.JN(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.LX.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{UD:()=>e.uO,WD:t=>{e.uO?t():o.push(t)}}},this.LX.set(t,i),e.bz(this),e.yO((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new yo(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}GD(t){const e=Array.from(this.LX.values()).find((e=>e.instances.has(t)));if(!e)throw Me(0,(()=>new Error("LightningChart JS error, attempted to use Icon that is disposed. Please check that you are not disposing an Icon that is still in use, or attempting to use a previously disposed Icon!")));return e.sharedEngineReference}xs(t){var e;const i=null===(e=this.EX)||void 0===e?void 0:e.WX;if(!i)return;const s=this.Ne(t.x,t.y),r=Math.round(s.x*this.lz.MO()),n=Math.round(s.y*this.lz.MO());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.KX(i,r+t[0]/i.qX,n+t[1]/i.qX))).reduce(((t,e)=>{if(void 0===e)return t||void 0;const i=1e6*e.layerIndex+e.entityIndex;return!t||i>t.zIndexForComparison?{zIndexForComparison:i,entity:e.entity,collectionMember:e.collectionMember,info:e.info}:t}),void 0)}KX(t,e,i){const s=Math.round(e*t.qX),r=Math.round(i*t.qX);if(s<0||s>=t.Z.x||r<0||r>=t.Z.y)return;const n=4*(s+r*t.Z.x),o=t.tj[n+0],h=t.tj[n+1],a=t.tj[n+2],l=t.tj[n+3];if(void 0===o||void 0===h||void 0===a||void 0===l)return;if(0===o&&0===h&&0===a&&0===l)return;const u=16777216*o+65536*h+256*a+l,c=t.ij.find((t=>u>=t.idFirst&&u<=t.idLast));if(!c)return;const{collectionMember:d,info:f}=c.entity.HG(u,c.idFirst,c.idCount,e,i);return{entity:c.entity,collectionMember:d,entityIndex:c.entityIndex,layerIndex:c.layer.Rn(),info:f}}en(t,e,i){const s=this.lz.gl;this.ln.PV?(this.lz.BO(s.FRAMEBUFFER,this.MV[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.yV,0)):this.lz.BO(s.FRAMEBUFFER,null);const r=this.pV(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.ln.PV||this.Bn(),s.readPixels(0,0,n,o,s.RGBA,s.UNSIGNED_BYTE,h);const a=new ImageData(new Uint8ClampedArray(h),n,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=n,l.height=o,u.putImageData(a,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.ln.PV&&(this.lz.BO(s.FRAMEBUFFER,this.MV[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.FX),this.lz.BO(s.FRAMEBUFFER,this.MV[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.yV,0)),this.lz.BO(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=zt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof ep))throw new Error("Unexpected Engine Layer error");return i}return this.Ln(new ep(this,e,t))}iI(t,e,i){const s=this.Mo(e);if(s){if(Me(0,(()=>{})),!(s instanceof Tp))throw new Error("Unexpected Engine Layer error");return s}return this.Ln(new Tp(this,e,t,i))}oi(){return this.Z}pV(){const t=this.lz.MO();return{x:Math.round(this.Z.x*t),y:Math.round(this.Z.y*t)}}jX(t){return t instanceof Array||(t=[t,t]),t}sj(){return this.ln.vV}ej(){return pm(this.lz.gl)}HX(){var t;const e=this.lz.gl,i=zt.performance.now(),s=this.io.ho,r={x:Math.ceil(this.Z.x*this.lz.MO()*s),y:Math.ceil(this.Z.y*this.lz.MO()*s)};this.EX||(this.EX={qX:s,hj:r,zX:[],WX:void 0});let n=this.EX.zX.find((t=>!t.NX)),o=!1;n||(o=!0,n={NX:!1,Z:r,uG:e.createTexture(),rj:this.lz.JO(),IX:this.lz.KO(),nj:new Uint8Array,VX:void 0},this.EX.zX.push(n));const h=n;(o||h.Z.x!==r.x||h.Z.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.uG),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.x,r.y,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this.lz.BO(e.FRAMEBUFFER,h.rj),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.uG,0),e.bindRenderbuffer(e.RENDERBUFFER,h.IX),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.IX),h.nj=new Uint8Array(r.x*r.y*4),h.Z=r),h.NX=!0,h.VX=i,this.lz.BO(e.FRAMEBUFFER,h.rj),e.clearDepth(1),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(r.x,r.y),this.lz.LO(0,0,r.x,r.y);const a=[];for(const t of this.fn.values())t.WE(1,s,a);this.lz.BO(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.lz.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.EX){const t=this.EX.WX;if(t&&t.YX>i)return;this.EX.WX={YX:i,qX:s,Z:r,tj:h.nj,ij:a}}};l?this.lz.oG(l,h.rj,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.nj).then((()=>{this.ji||(h.NX=!1,u())})).catch((t=>{this.ji||(h.NX=!1,zt.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"))})):(this.lz.aG(h.rj,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.nj),h.NX=!1,u())}kn(t){const e=this.lz.MO();if("use-window"===this.$X.mode){const t=zt.devicePixelRatio||1;this.lz.HN(t)}const i=this.Z.x,s=this.Z.y,r=t||{x:this.qr.offsetWidth,y:this.qr.offsetHeight},n=this.lz.MO();if(0!==r.x&&0!==r.y&&(r.x!==i||r.y!==s||e!==n)){this.Z=r,this.At.x.q(0,r.x).it(r.x),this.At.y.q(0,r.y).it(r.y);const t=r.x*n,e=r.y*n,i=this.lz.gl;this.ln.FV&&this.mV&&(this.mV.canvas.width=t,this.mV.canvas.height=e);const s=this.ln.PV;if(this.yV&&(i.bindTexture(i.TEXTURE_2D,this.yV),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),s){const s=this.lz.gl2.ctx;this.FX&&(i.bindRenderbuffer(i.RENDERBUFFER,this.FX),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.PX,s.RGBA8,t,e)),this.IX&&(i.bindRenderbuffer(i.RENDERBUFFER,this.IX),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.PX,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.R.emit("resize",[this.Z.x,this.Z.y])}}Y(){var t;this.ji||(super.Y(),this.UX&&(zt.clearTimeout(this.UX),this.UX=void 0),Array.from(this.lz.Kz.entries()).forEach((([t,e])=>{e.dz(!1),this.lz.Kz.delete(t)})),Array.from(this.lz.sN.values()).forEach((t=>{t.unbindResources()})),this.lz.sN.clear(),this.lz.iN.rO(),this.lz.GN.Y(),this.lz.jO(this.lz.UN),this.lz.jO(this.lz.WN),this.lz.zN.forEach(((t,e)=>{this.lz.gl.deleteBuffer(e)})),this.lz.zN.clear(),this.lz.sG&&(this.lz.jO(this.lz.sG.buffer),this.lz.sG=void 0),this.lz.tN(this.MV[0]),this.lz.tN(this.MV[1]),this.lz.qO(this.FX),this.lz.fz(this.yV),this.lz.qO(this.IX),this.EX&&(this.EX.zX.forEach((t=>{this.lz.qO(t.IX),this.lz.tN(t.rj),this.lz.fz(t.uG)})),this.EX=void 0),this.lz.LN.forEach((t=>this.lz.jO(t))),this.LX.clear(),this.ln.XV(this),this.XX&&(null===(t=this.XX.parentElement)||void 0===t||t.removeChild(this.XX),this.XX=void 0),this.mV&&(this.mV=void 0),this.lz.gl=void 0)}}var Ep="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},kp={exports:{}};!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function s(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this.pO(t||0,e||10,i||"be"))}var n;"object"==typeof kp?kp.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=(void 0).Buffer}catch(t){}function o(t,e,s){for(var r=0,n=Math.min(t.length,s),o=0,h=e;h=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=a}return i(!(240&o),"Invalid character in "+t),r}function h(t,e,s,r){for(var n=0,o=0,h=Math.min(t.length,s),a=e;a=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.pO=function(t,e,s){if("number"==typeof t)return this.oj(t,e,s);if("object"==typeof t)return this.aj(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this.lj(t,r):this.uj(t,e,r),"-"===t[0]&&(this.negative=1),this.cj(),"le"===s&&this.aj(this.toArray(),e,s)},r.prototype.oj=function(t,e,s){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===s&&this.aj(this.toArray(),e,s)},r.prototype.aj=function(t,e,s){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);else if("le"===s)for(r=0,n=0;r>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);return this.cj()},r.prototype.lj=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=6)r=o(t,i,i+6),this.words[s]|=r<>>26-n&4194303,(n+=24)>=26&&(n-=26,s++);i+6!==e&&(r=o(t,e,i+6),this.words[s]|=r<>>26-n&4194303),this.cj()},r.prototype.uj=function(t,e,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=e)s++;s--,r=r/e|0;for(var n=t.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.gj()},r.prototype.gj=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.prototype.inspect=l;function l(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var s=t.length+e.length|0;i.length=s,s=s-1|0;var r=0|t.words[0],n=0|e.words[0],o=r*n,h=67108863&o,a=o/67108864|0;i.words[0]=h;for(var l=1;l>>26,c=67108863&a,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var g=l-f|0;u+=(o=(r=0|t.words[g])*(n=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,a=0|u}return 0!==a?i.words[l]=0|a:i.length--,i.cj()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.cj();var r=this.byteLength(),n=s||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},r.prototype.pj=function(t,e){for(var i=0,s=0,r=0,n=0;r>8&255),i>16&255),6===n?(i>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===n?(i>=0&&(t[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?r.prototype.mj=function(t){return 32-Math.clz32(t)}:r.prototype.mj=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype.vj=function(t){if(0===t)return 26;var e=t,i=0;return!(8191&e)&&(i+=13,e>>>=13),!(127&e)&&(i+=7,e>>>=7),!(15&e)&&(i+=4,e>>>=4),!(3&e)&&(i+=2,e>>>=2),!(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.mj(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var s=0;st.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.Aj(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.cj()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,r=t%26;return this.Aj(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.gj()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.gj();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,y=0|o[2],p=8191&y,A=y>>>13,x=0|o[3],S=8191&x,v=x>>>13,b=0|o[4],M=8191&b,C=b>>>13,T=0|o[5],w=8191&T,E=T>>>13,k=0|o[6],I=8191&k,z=k>>>13,F=0|o[7],R=8191&F,D=F>>>13,P=0|o[8],O=8191&P,L=P>>>13,_=0|o[9],B=8191&_,V=_>>>13,G=0|h[0],N=8191&G,U=G>>>13,Y=0|h[1],H=8191&Y,X=Y>>>13,W=0|h[2],j=8191&W,$=W>>>13,Z=0|h[3],q=8191&Z,K=Z>>>13,J=0|h[4],Q=8191&J,tt=J>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(l+(s=Math.imul(c,N))|0)+((8191&(r=(r=Math.imul(c,U))+Math.imul(d,N)|0))<<13)|0;l=((n=Math.imul(d,U))+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(g,N),r=(r=Math.imul(g,U))+Math.imul(m,N)|0,n=Math.imul(m,U);var pt=(l+(s=s+Math.imul(c,H)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,H)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,N),r=(r=Math.imul(p,U))+Math.imul(A,N)|0,n=Math.imul(A,U),s=s+Math.imul(g,H)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(m,H)|0,n=n+Math.imul(m,X)|0;var At=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(S,N),r=(r=Math.imul(S,U))+Math.imul(v,N)|0,n=Math.imul(v,U),s=s+Math.imul(p,H)|0,r=(r=r+Math.imul(p,X)|0)+Math.imul(A,H)|0,n=n+Math.imul(A,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,j)|0,n=n+Math.imul(m,$)|0;var xt=(l+(s=s+Math.imul(c,q)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(d,q)|0))<<13)|0;l=((n=n+Math.imul(d,K)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(M,N),r=(r=Math.imul(M,U))+Math.imul(C,N)|0,n=Math.imul(C,U),s=s+Math.imul(S,H)|0,r=(r=r+Math.imul(S,X)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(p,j)|0,r=(r=r+Math.imul(p,$)|0)+Math.imul(A,j)|0,n=n+Math.imul(A,$)|0,s=s+Math.imul(g,q)|0,r=(r=r+Math.imul(g,K)|0)+Math.imul(m,q)|0,n=n+Math.imul(m,K)|0;var St=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(w,N),r=(r=Math.imul(w,U))+Math.imul(E,N)|0,n=Math.imul(E,U),s=s+Math.imul(M,H)|0,r=(r=r+Math.imul(M,X)|0)+Math.imul(C,H)|0,n=n+Math.imul(C,X)|0,s=s+Math.imul(S,j)|0,r=(r=r+Math.imul(S,$)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,$)|0,s=s+Math.imul(p,q)|0,r=(r=r+Math.imul(p,K)|0)+Math.imul(A,q)|0,n=n+Math.imul(A,K)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,tt)|0;var vt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((n=n+Math.imul(d,st)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(I,N),r=(r=Math.imul(I,U))+Math.imul(z,N)|0,n=Math.imul(z,U),s=s+Math.imul(w,H)|0,r=(r=r+Math.imul(w,X)|0)+Math.imul(E,H)|0,n=n+Math.imul(E,X)|0,s=s+Math.imul(M,j)|0,r=(r=r+Math.imul(M,$)|0)+Math.imul(C,j)|0,n=n+Math.imul(C,$)|0,s=s+Math.imul(S,q)|0,r=(r=r+Math.imul(S,K)|0)+Math.imul(v,q)|0,n=n+Math.imul(v,K)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(m,it)|0,n=n+Math.imul(m,st)|0;var bt=(l+(s=s+Math.imul(c,nt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ot)|0)+Math.imul(d,nt)|0))<<13)|0;l=((n=n+Math.imul(d,ot)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(R,N),r=(r=Math.imul(R,U))+Math.imul(D,N)|0,n=Math.imul(D,U),s=s+Math.imul(I,H)|0,r=(r=r+Math.imul(I,X)|0)+Math.imul(z,H)|0,n=n+Math.imul(z,X)|0,s=s+Math.imul(w,j)|0,r=(r=r+Math.imul(w,$)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(M,q)|0,r=(r=r+Math.imul(M,K)|0)+Math.imul(C,q)|0,n=n+Math.imul(C,K)|0,s=s+Math.imul(S,Q)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(A,it)|0,n=n+Math.imul(A,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(m,nt)|0,n=n+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,at)|0)|0)+((8191&(r=(r=r+Math.imul(c,lt)|0)+Math.imul(d,at)|0))<<13)|0;l=((n=n+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(O,N),r=(r=Math.imul(O,U))+Math.imul(L,N)|0,n=Math.imul(L,U),s=s+Math.imul(R,H)|0,r=(r=r+Math.imul(R,X)|0)+Math.imul(D,H)|0,n=n+Math.imul(D,X)|0,s=s+Math.imul(I,j)|0,r=(r=r+Math.imul(I,$)|0)+Math.imul(z,j)|0,n=n+Math.imul(z,$)|0,s=s+Math.imul(w,q)|0,r=(r=r+Math.imul(w,K)|0)+Math.imul(E,q)|0,n=n+Math.imul(E,K)|0,s=s+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(C,Q)|0,n=n+Math.imul(C,tt)|0,s=s+Math.imul(S,it)|0,r=(r=r+Math.imul(S,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(A,nt)|0,n=n+Math.imul(A,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(m,at)|0,n=n+Math.imul(m,lt)|0;var Ct=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(B,N),r=(r=Math.imul(B,U))+Math.imul(V,N)|0,n=Math.imul(V,U),s=s+Math.imul(O,H)|0,r=(r=r+Math.imul(O,X)|0)+Math.imul(L,H)|0,n=n+Math.imul(L,X)|0,s=s+Math.imul(R,j)|0,r=(r=r+Math.imul(R,$)|0)+Math.imul(D,j)|0,n=n+Math.imul(D,$)|0,s=s+Math.imul(I,q)|0,r=(r=r+Math.imul(I,K)|0)+Math.imul(z,q)|0,n=n+Math.imul(z,K)|0,s=s+Math.imul(w,Q)|0,r=(r=r+Math.imul(w,tt)|0)+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(C,it)|0,n=n+Math.imul(C,st)|0,s=s+Math.imul(S,nt)|0,r=(r=r+Math.imul(S,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(A,at)|0,n=n+Math.imul(A,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,n=n+Math.imul(m,dt)|0;var Tt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(B,H),r=(r=Math.imul(B,X))+Math.imul(V,H)|0,n=Math.imul(V,X),s=s+Math.imul(O,j)|0,r=(r=r+Math.imul(O,$)|0)+Math.imul(L,j)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(R,q)|0,r=(r=r+Math.imul(R,K)|0)+Math.imul(D,q)|0,n=n+Math.imul(D,K)|0,s=s+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,tt)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,s=s+Math.imul(w,it)|0,r=(r=r+Math.imul(w,st)|0)+Math.imul(E,it)|0,n=n+Math.imul(E,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(C,nt)|0,n=n+Math.imul(C,ot)|0,s=s+Math.imul(S,at)|0,r=(r=r+Math.imul(S,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(A,ct)|0,n=n+Math.imul(A,dt)|0;var wt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(B,j),r=(r=Math.imul(B,$))+Math.imul(V,j)|0,n=Math.imul(V,$),s=s+Math.imul(O,q)|0,r=(r=r+Math.imul(O,K)|0)+Math.imul(L,q)|0,n=n+Math.imul(L,K)|0,s=s+Math.imul(R,Q)|0,r=(r=r+Math.imul(R,tt)|0)+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,s=s+Math.imul(I,it)|0,r=(r=r+Math.imul(I,st)|0)+Math.imul(z,it)|0,n=n+Math.imul(z,st)|0,s=s+Math.imul(w,nt)|0,r=(r=r+Math.imul(w,ot)|0)+Math.imul(E,nt)|0,n=n+Math.imul(E,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(C,at)|0,n=n+Math.imul(C,lt)|0,s=s+Math.imul(S,ct)|0,r=(r=r+Math.imul(S,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var Et=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,mt)|0)+Math.imul(A,gt)|0))<<13)|0;l=((n=n+Math.imul(A,mt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(B,q),r=(r=Math.imul(B,K))+Math.imul(V,q)|0,n=Math.imul(V,K),s=s+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(R,it)|0,r=(r=r+Math.imul(R,st)|0)+Math.imul(D,it)|0,n=n+Math.imul(D,st)|0,s=s+Math.imul(I,nt)|0,r=(r=r+Math.imul(I,ot)|0)+Math.imul(z,nt)|0,n=n+Math.imul(z,ot)|0,s=s+Math.imul(w,at)|0,r=(r=r+Math.imul(w,lt)|0)+Math.imul(E,at)|0,n=n+Math.imul(E,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(C,ct)|0,n=n+Math.imul(C,dt)|0;var kt=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(r=(r=r+Math.imul(S,mt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(B,Q),r=(r=Math.imul(B,tt))+Math.imul(V,Q)|0,n=Math.imul(V,tt),s=s+Math.imul(O,it)|0,r=(r=r+Math.imul(O,st)|0)+Math.imul(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(R,nt)|0,r=(r=r+Math.imul(R,ot)|0)+Math.imul(D,nt)|0,n=n+Math.imul(D,ot)|0,s=s+Math.imul(I,at)|0,r=(r=r+Math.imul(I,lt)|0)+Math.imul(z,at)|0,n=n+Math.imul(z,lt)|0,s=s+Math.imul(w,ct)|0,r=(r=r+Math.imul(w,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var It=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,mt)|0)+Math.imul(C,gt)|0))<<13)|0;l=((n=n+Math.imul(C,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(B,it),r=(r=Math.imul(B,st))+Math.imul(V,it)|0,n=Math.imul(V,st),s=s+Math.imul(O,nt)|0,r=(r=r+Math.imul(O,ot)|0)+Math.imul(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(R,at)|0,r=(r=r+Math.imul(R,lt)|0)+Math.imul(D,at)|0,n=n+Math.imul(D,lt)|0,s=s+Math.imul(I,ct)|0,r=(r=r+Math.imul(I,dt)|0)+Math.imul(z,ct)|0,n=n+Math.imul(z,dt)|0;var zt=(l+(s=s+Math.imul(w,gt)|0)|0)+((8191&(r=(r=r+Math.imul(w,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(zt>>>26)|0,zt&=67108863,s=Math.imul(B,nt),r=(r=Math.imul(B,ot))+Math.imul(V,nt)|0,n=Math.imul(V,ot),s=s+Math.imul(O,at)|0,r=(r=r+Math.imul(O,lt)|0)+Math.imul(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(R,ct)|0,r=(r=r+Math.imul(R,dt)|0)+Math.imul(D,ct)|0,n=n+Math.imul(D,dt)|0;var Ft=(l+(s=s+Math.imul(I,gt)|0)|0)+((8191&(r=(r=r+Math.imul(I,mt)|0)+Math.imul(z,gt)|0))<<13)|0;l=((n=n+Math.imul(z,mt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(B,at),r=(r=Math.imul(B,lt))+Math.imul(V,at)|0,n=Math.imul(V,lt),s=s+Math.imul(O,ct)|0,r=(r=r+Math.imul(O,dt)|0)+Math.imul(L,ct)|0,n=n+Math.imul(L,dt)|0;var Rt=(l+(s=s+Math.imul(R,gt)|0)|0)+((8191&(r=(r=r+Math.imul(R,mt)|0)+Math.imul(D,gt)|0))<<13)|0;l=((n=n+Math.imul(D,mt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(B,ct),r=(r=Math.imul(B,dt))+Math.imul(V,ct)|0,n=Math.imul(V,dt);var Dt=(l+(s=s+Math.imul(O,gt)|0)|0)+((8191&(r=(r=r+Math.imul(O,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Pt=(l+(s=Math.imul(B,gt))|0)+((8191&(r=(r=Math.imul(B,mt))+Math.imul(V,gt)|0))<<13)|0;return l=((n=Math.imul(V,mt))+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=yt,a[1]=pt,a[2]=At,a[3]=xt,a[4]=St,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=Ct,a[9]=Tt,a[10]=wt,a[11]=Et,a[12]=kt,a[13]=It,a[14]=zt,a[15]=Ft,a[16]=Rt,a[17]=Dt,a[18]=Pt,0!==l&&(a[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.cj()}function y(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):y(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),y(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,r=0;r>=26,s+=n/67108864|0,s+=o>>>26,this.words[r]=67108863&o}return 0!==s&&(this.words[r]=s,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>r&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,s=0;s=0);var e,s=t%26,r=(t-s)/26,n=67108863>>>26-s<<26-s;if(0!==s){var o=0;for(e=0;e>>26-s}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),h=67108863^67108863>>>n<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=r);l--){var c=0|this.words[l];this.words[l]=u<<26-n|c>>>n,u=c&h}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.cj()},r.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,r=1<=0);var e=t%26,s=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==e&&s++,this.length=Math.min(s,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[r+s]=67108863&n}for(;r>26,this.words[r+s]=67108863&n;if(0===h)return this.cj();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.cj()},r.prototype.xj=function(t,e){var i=(this.length,t.length),s=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this.mj(o))&&(n=n.ushln(i),s.iushln(i),o=0|n.words[n.length-1]);var h,a=s.length-n.length;if("mod"!==e){(h=new r(null)).length=a+1,h.words=new Array(h.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[n.length+c])+(0|s.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),s.Sj(n,d,c);0!==s.negative;)d--,s.negative=0,s.Sj(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.cj(),s.cj(),"div"!==e&&0!==i&&s.iushrn(i),{div:h||null,mod:s}},r.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):this.negative&t.negative?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this.xj(t,e);var n,o,h},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,s=t.ushrn(1),r=t.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(s*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*s;this.words[r]=n/t|0,s=n%t}return this.cj(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),h=new r(0),a=new r(1),l=0;e.isEven()&&s.isEven();)e.iushrn(1),s.iushrn(1),++l;for(var u=s.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var g=0,m=1;!(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.bj=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),h=new r(0),a=s.clone();e.cmpn(1)>0&&s.cmpn(1)>0;){for(var l=0,u=1;!(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,d=1;!(s.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(s.iushrn(c);c-- >0;)h.isOdd()&&h.iadd(a),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(h)):(s.isub(e),h.isub(o))}return(n=0===e.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var s=0;e.isEven()&&i.isEven();s++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=e.cmp(i);if(r<0){var n=e;e=i,i=n}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,r=1<>>26,h&=67108863,this.words[o]=h}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,s=t<0;if(0!==this.negative&&!s)return-1;if(0===this.negative&&s)return 1;if(this.cj(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:rt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],r=0|t.words[i];if(s!==r){sr&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this).Mj(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.Mj=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.Mj(t)},r.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},r.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},r.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},r.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},r.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},r.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._j(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._j(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.wj(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.wj(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.wj(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.wj(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.wj(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.wj(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function A(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.Cj()}function x(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.kj(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function C(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.bj(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype.Cj=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},A.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.cj(),i},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},s(x,A),x.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.kj=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new S;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return p[t]=e,e},M.prototype.wj=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._j=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).Mj(this):(a(t,t.umod(this.m).Mj(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).Mj(this)},M.prototype.add=function(t,e){this._j(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.Mj(this)},M.prototype.iadd=function(t,e){this._j(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this._j(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.Mj(this)},M.prototype.isub=function(t,e){this._j(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this.wj(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._j(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._j(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var s=this.m.add(new r(1)).iushrn(2);return this.pow(t,s)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var h=new r(1).toRed(this),a=h.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,l).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),g=o;0!==f.cmp(h);){for(var m=f,y=0;0!==m.cmp(h);y++)m=m.redSqr();i(y=0;s--){for(var l=e.words[s],u=a-1;u>=0;u--){var c=l>>u&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++h||0===s&&0===u)&&(n=this.mul(n,i[o]),h=0,o=0)):h=0}a=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new C(t)},s(C,M),C.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},C.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},C.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.Mj(this)},C.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).Mj(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o.Mj(this)},C.prototype.invm=function(t){return this.imod(t.bj(this.m).mul(this.r2)).Mj(this)}}(0,Ep);var Ip=kp.exports;function zp(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,n=255&s;r?i.push(r,n):i.push(n)}return i}const Fp=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const r=1<(r>>1)-1?(r>>1)-i:i,n.isubn(e)):e=0,s[t]=e,n.iushrn(1)}return s},Rp=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,r=0;for(;t.cmpn(-s)>0||e.cmpn(-r)>0;){let n,o,h=t.andln(3)+s&3,a=e.andln(3)+r&3;if(3===h&&(h=-1),3===a&&(a=-1),1&h){const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}else n=0;if(i[0].push(n),1&a){const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}else o=0;i[1].push(o),2*s===n+1&&(s=1-s),2*r===o+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i};class Dp{constructor(t,e){this.type=t,this.p=new Ip(e.p,16),this.red=e.prime?Ip.red(e.prime):Ip.mont(this.p),this.zero=new Ip(0).toRed(this.red),this.one=new Ip(1).toRed(this.red),this.two=new Ip(2).toRed(this.red),this.n=e.n&&new Ip(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.Tj=new Array(4),this.Fj=new Array(4),this.Ij=new Array(4),this.Pj=new Array(4),this.Dj=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.Bj=!0,this.redN=this.n.toRed(this.red))}Lj(t,e){const i=t.Rj(),s=Fp(e,1,this.Dj);let r=(1<=t;r--)e=(e<<1)+s[r];n.push(e)}let o=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(let t=r;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===n[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=n[i];o="affine"===t.type?s>0?o.mixedAdd(r[s-1>>1]):o.mixedAdd(r[-s-1>>1].neg()):s>0?o.add(r[s-1>>1]):o.add(r[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}Vj(t,e,i,s,r){const n=this.Tj,o=this.Fj,h=this.Ij;let a=0;for(let i=0;i=1;t-=2){const s=t-1,r=t;if(1!==n[s]||1!==n[r]){h[s]=Fp(i[s],n[s],this.Dj),h[r]=Fp(i[r],n[r],this.Dj),a=Math.max(h[s].length,a),a=Math.max(h[r].length,a);continue}const l=[e[s],null,null,e[r]];0===e[s].y.cmp(e[r].y)?(l[1]=e[s].add(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg())):0===e[s].y.cmp(e[r].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].add(e[r].neg())):(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=Rp(i[s],i[r]);a=Math.max(c[0].length,a),h[s]=new Array(a),h[r]=new Array(a);for(let t=0;t=0;t--){let e=0;for(;t>=0;){let i=!0;for(let e=0;e=0&&e++,l=l.dblp(e),t<0)break;for(let t=0;t0?i=o[t][e-1>>1]:e<0&&(i=o[t][-e-1>>1].neg()),l="affine"===i.type?l.mixedAdd(i):l.add(i))}}for(let t=0;t=Math.ceil((t.bitLength()+1)/e.step)}Rj(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let r=0;r({a:new Ip(t.a,16),b:new Ip(t.b,16)}))):this.$j(i),{beta:e,lambda:i,basis:s}}Hj(t){const e=t===this.p?this.red:Ip.mont(t),i=new Ip(2).toRed(e).redInvm(),s=i.redNeg(),r=new Ip(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}$j(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,r,n,o,h,a,l,u,c=t,d=this.n.clone(),f=new Ip(1),g=new Ip(0),m=new Ip(0),y=new Ip(1),p=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=y.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++p)break;a=l,d=c,c=l,m=f,f=u,y=g,g=o}o=l.neg(),h=u;const A=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(A)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}Xj(t){const e=this.endo.basis,i=e[0],s=e[1],r=s.b.mul(t).divRound(this.n),n=i.b.neg().mul(t).divRound(this.n),o=r.mul(i.a),h=n.mul(s.a),a=r.mul(i.b),l=n.mul(s.b);return{k1:t.sub(o).sub(h),k2:a.add(l).neg()}}point(t,e,i){return new Lp(this,t,e,i)}pointFromX(t,e){(t=new Ip(t,16)).red||(t=t.toRed(this.red));const i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b);let s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");const r=s.fromRed().isOdd();return(e&&!r||!e&&r)&&(s=s.redNeg()),this.point(t,s)}validate(t){if(t.inf)return!0;const e=t.x,i=t.y,s=this.a.redMul(e),r=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)}jj(t,e,i){const s=this.Wj,r=this.Yj;let n=0;for(n=0;n":``}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);let e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));const i=e.redSqr().redISub(this.x).redISub(t.x),s=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)}dbl(){if(this.inf)return this;const t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);const e=this.curve.a,i=this.x.redSqr(),s=t.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new Ip(t,16),this.isInfinity()?this:this.Gj(t)?this.curve.Lj(this,t):this.curve.endo?this.curve.jj([this],[t]):this.curve.Ej(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.jj(s,r):this.curve.Vj(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.jj(s,r,!0):this.curve.Vj(1,s,r,2,!0)}eq(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))}neg(t){if(this.inf)return this;const e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){const t=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}}class _p extends Pp{constructor(t,e,i,s){super(t,"jacobian"),null===e&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ip(0)):(this.x=new Ip(e,16),this.y=new Ip(i,16),this.z=new Ip(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}getY(){throw new Error("Method not implemented.")}getX(){throw new Error("Method not implemented.")}pointFromX(t,e){throw new Error("Method not implemented.")}point(t,e,i){throw new Error("Method not implemented.")}jpoint(t,e,i){return new _p(this,t,e,i)}toP(){if(this.isInfinity())return this.curve.point(null,null);const t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),s=this.y.redMul(e).redMul(t);return this.curve.point(i,s)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=t.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(e),r=t.x.redMul(i),n=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),h=s.redSub(r),a=n.redSub(o);if(0===h.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=h.redSqr(),u=l.redMul(h),c=s.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(d)).redISub(n.redMul(u)),g=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(d,f,g)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;const e=this.z.redSqr(),i=this.x,s=t.x.redMul(e),r=this.y,n=t.y.redMul(e).redMul(this.z),o=i.redSub(s),h=r.redSub(n);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const a=o.redSqr(),l=a.redMul(o),u=i.redMul(a),c=h.redSqr().redIAdd(l).redISub(u).redISub(u),d=h.redMul(u.redISub(c)).redISub(r.redMul(l)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)}dblp(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){let e=this;for(let i=0;i=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class Bp{constructor(t){this.curve=new Op(t),this.g=this.curve.g,this.n=this.curve.n}}const Vp={};var Gp;Vp.PresetCurve=Bp,Gp={type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]},Object.defineProperty(Vp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Bp(Gp);return Object.defineProperty(Vp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class Np{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.Kj(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof Np?e:new Np(t,{pub:e,pubEnc:i})}validate(){const t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}getPublic(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub}Kj(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)}verify(t,e){return this.ec.verify(t,e,this)}}function Up(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let r=0,n=e.place;for(let e=0;e>>=0;return!(r<=127)&&(e.place=n,r)}class Yp{constructor(){this.place=0}}class Hp{constructor(t,e){if(t instanceof Hp)return t;this.qj(t,e)||(this.r=new Ip(t.r,16),this.s=new Ip(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}qj(t,e){t=zp(t,e);const i=new Yp;if(48!==t[i.place++])return!1;const s=Up(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Up(t,i);if(!1===r)return!1;let n=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;const o=Up(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let h=t.slice(i.place,o+i.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new Ip(n),this.s=new Ip(h),this.recoveryParam=null,!0}}class Xp{constructor(t){if(!(this instanceof Xp))return new Xp(t);"string"==typeof t&&(t=Vp[t]),t instanceof Vp.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1)}keyFromPublic(t,e){return Np.fromPublic(this,t,e)}tZ(t,e){const i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t}verify(t,e,i,s){t=this.tZ(new Ip(t,16)),i=this.keyFromPublic(i,s);const r=(e=new Hp(e,"hex")).r,n=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;const o=n.invm(this.n),h=o.mul(t).umod(this.n),a=o.mul(r).umod(this.n);if(!this.curve.Bj){const t=this.g.mulAdd(h,i.getPublic(),a);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(r)}const l=this.g.jmulAdd(h,i.getPublic(),a);return!l.isInfinity()&&l.eqXToP(r)}}var Wp,jp={exports:{}};jp.exports=(Wp=Wp||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==Ep&&Ep.crypto&&(i=Ep.crypto),!i)try{i=e}catch(t){}var s=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),n={},o=n.lib={},h=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=h.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,s=this.sigBytes,r=t.sigBytes;if(this.clamp(),s%4)for(var n=0;n>>2]>>>24-n%4*8&255;e[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var h=0;h>>2]=i[h>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new a.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],r=0;r>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new a.init(i,e)}},d=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=h.extend({reset:function(){this.Pw=new a.init,this.iZ=0},sZ:function(t){"string"==typeof t&&(t=d.parse(t)),this.Pw.concat(t),this.iZ+=t.sigBytes},eZ:function(e){var i,s=this.Pw,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.hZ,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,y=l[f-2],p=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[f]=m+l[f-7]+p+l[f-16]}var A=s&r^s&n^r&n,x=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=d+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[f]+l[f];d=c,c=u,u=h,h=o+S|0,o=n,n=r,r=s,s=S+(x+A)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},oZ:function(){var t=this.Pw,i=t.words,s=8*this.iZ,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.eZ(),this.uZ},clone:function(){var t=n.clone.call(this);return t.uZ=this.uZ.clone(),t}});i.SHA256=n.aZ(u),i.HmacSHA256=n.lZ(u)}(Math),t.SHA256}(jp.exports),Jp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({nZ:function(){this.uZ=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},oZ:function(){var t=r.oZ.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.aZ(n),e.HmacSHA224=r.lZ(n),t.SHA224;var e,i,s,r,n}(jp.exports),Qp={exports:{}}.exports=jp.exports.enc.Hex,tA={exports:{}}.exports=jp.exports.enc.Utf8;!function(t){return i=(e=t).lib.WordArray,e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,s=this.cZ;t.clamp();for(var r=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,h=0;h<4&&n+.75*h>>6*(3-h)&63));var a=s.charAt(64);if(a)for(;r.length%4;)r.push(a);return r.join("")},parse:function(t){var e=t.length,s=this.cZ,r=this.dZ;if(!r){r=this.dZ=[];for(var n=0;n>>6-o%4*2;r[n>>>2]|=h<<24-n%4*8,n++}return i.create(r,n)}(t,e,r)},cZ:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(jp.exports),function(t){(function(e){var i=t,s=i.lib,r=s.WordArray,n=s.Hasher,o=i.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=o.MD5=n.extend({nZ:function(){this.uZ=new r.init([1732584193,4023233417,2562383102,271733878])},rZ:function(t,e){for(var i=0;i<16;i++){var s=e+i,r=t[s];t[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var n=this.uZ.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],y=t[e+5],p=t[e+6],A=t[e+7],x=t[e+8],S=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],C=t[e+13],T=t[e+14],w=t[e+15],E=n[0],k=n[1],I=n[2],z=n[3];E=l(E,k,I,z,o,7,h[0]),z=l(z,E,k,I,a,12,h[1]),I=l(I,z,E,k,f,17,h[2]),k=l(k,I,z,E,g,22,h[3]),E=l(E,k,I,z,m,7,h[4]),z=l(z,E,k,I,y,12,h[5]),I=l(I,z,E,k,p,17,h[6]),k=l(k,I,z,E,A,22,h[7]),E=l(E,k,I,z,x,7,h[8]),z=l(z,E,k,I,S,12,h[9]),I=l(I,z,E,k,v,17,h[10]),k=l(k,I,z,E,b,22,h[11]),E=l(E,k,I,z,M,7,h[12]),z=l(z,E,k,I,C,12,h[13]),I=l(I,z,E,k,T,17,h[14]),E=u(E,k=l(k,I,z,E,w,22,h[15]),I,z,a,5,h[16]),z=u(z,E,k,I,p,9,h[17]),I=u(I,z,E,k,b,14,h[18]),k=u(k,I,z,E,o,20,h[19]),E=u(E,k,I,z,y,5,h[20]),z=u(z,E,k,I,v,9,h[21]),I=u(I,z,E,k,w,14,h[22]),k=u(k,I,z,E,m,20,h[23]),E=u(E,k,I,z,S,5,h[24]),z=u(z,E,k,I,T,9,h[25]),I=u(I,z,E,k,g,14,h[26]),k=u(k,I,z,E,x,20,h[27]),E=u(E,k,I,z,C,5,h[28]),z=u(z,E,k,I,f,9,h[29]),I=u(I,z,E,k,A,14,h[30]),E=c(E,k=u(k,I,z,E,M,20,h[31]),I,z,y,4,h[32]),z=c(z,E,k,I,x,11,h[33]),I=c(I,z,E,k,b,16,h[34]),k=c(k,I,z,E,T,23,h[35]),E=c(E,k,I,z,a,4,h[36]),z=c(z,E,k,I,m,11,h[37]),I=c(I,z,E,k,A,16,h[38]),k=c(k,I,z,E,v,23,h[39]),E=c(E,k,I,z,C,4,h[40]),z=c(z,E,k,I,o,11,h[41]),I=c(I,z,E,k,g,16,h[42]),k=c(k,I,z,E,p,23,h[43]),E=c(E,k,I,z,S,4,h[44]),z=c(z,E,k,I,M,11,h[45]),I=c(I,z,E,k,w,16,h[46]),E=d(E,k=c(k,I,z,E,f,23,h[47]),I,z,o,6,h[48]),z=d(z,E,k,I,A,10,h[49]),I=d(I,z,E,k,T,15,h[50]),k=d(k,I,z,E,y,21,h[51]),E=d(E,k,I,z,M,6,h[52]),z=d(z,E,k,I,g,10,h[53]),I=d(I,z,E,k,v,15,h[54]),k=d(k,I,z,E,a,21,h[55]),E=d(E,k,I,z,x,6,h[56]),z=d(z,E,k,I,w,10,h[57]),I=d(I,z,E,k,p,15,h[58]),k=d(k,I,z,E,C,21,h[59]),E=d(E,k,I,z,m,6,h[60]),z=d(z,E,k,I,b,10,h[61]),I=d(I,z,E,k,f,15,h[62]),k=d(k,I,z,E,S,21,h[63]),n[0]=n[0]+E|0,n[1]=n[1]+k|0,n[2]=n[2]+I|0,n[3]=n[3]+z|0},oZ:function(){var t=this.Pw,i=t.words,s=8*this.iZ,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var n=e.floor(s/4294967296),o=s;i[15+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.eZ();for(var h=this.uZ,a=h.words,l=0;l<4;l++){var u=a[l];a[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=n.clone.call(this);return t.uZ=this.uZ.clone(),t}});function l(t,e,i,s,r,n,o){var h=t+(e&i|~e&s)+r+o;return(h<>>32-n)+e}function u(t,e,i,s,r,n,o){var h=t+(e&s|i&~s)+r+o;return(h<>>32-n)+e}function c(t,e,i,s,r,n,o){var h=t+(e^i^s)+r+o;return(h<>>32-n)+e}function d(t,e,i,s,r,n,o){var h=t+(i^(e|~s))+r+o;return(h<>>32-n)+e}i.MD5=n.aZ(a),i.HmacMD5=n.lZ(a)})(Math),t.MD5}(jp.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({nZ:function(){this.uZ=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},rZ:function(t,e){for(var i=this.uZ.words,s=i[0],r=i[1],n=i[2],h=i[3],a=i[4],l=0;l<80;l++){if(l<16)o[l]=0|t[e+l];else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var c=(s<<5|s>>>27)+a+o[l];c+=l<20?1518500249+(r&n|~r&h):l<40?1859775393+(r^n^h):l<60?(r&n|r&h|n&h)-1894007588:(r^n^h)-899497514,a=h,h=n,n=r<<30|r>>>2,r=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+h|0,i[4]=i[4]+a|0},oZ:function(){var t=this.Pw,e=t.words,i=8*this.iZ,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(s+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.eZ(),this.uZ},clone:function(){var t=r.clone.call(this);return t.uZ=this.uZ.clone(),t}}),e.SHA1=r.aZ(h),e.HmacSHA1=r.lZ(h),t.SHA1;var e,i,s,r,n,o,h}(jp.exports),Zp=($p=jp.exports).lib.Base,qp=$p.enc.Utf8,$p.algo.HMAC=Zp.extend({init:function(t,e){t=this.fZ=new t.init,"string"==typeof e&&(e=qp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.AZ=e.clone(),n=this.gZ=e.clone(),o=r.words,h=n.words,a=0;a>>2];t.sigBytes-=e}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:f}),reset:function(){var t;l.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.mZ==this.pZ?t=s.createEncryptor:(t=s.createDecryptor,this.hZ=1),this.MZ&&this.MZ._Z==t?this.MZ.init(this,i&&i.words):(this.MZ=t.call(s,this,i&&i.words),this.MZ._Z=t)},rZ:function(t,e){this.MZ.processBlock(t,e)},oZ:function(){var t,e=this.cfg.padding;return this.mZ==this.pZ?(e.pad(this.Pw,this.blockSize),t=this.eZ(!0)):(t=this.eZ(!0),e.unpad(t)),t},blockSize:4});var g=i.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(h)},parse:function(t){var e,i=h.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=r.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),g.create({ciphertext:i,salt:e})}},y=i.SerializableCipher=s.extend({cfg:s.extend({format:m}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return g.create({ciphertext:n,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.wZ(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},wZ:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),p=(e.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=r.random(8));var n=a.create({keySize:e+i}).compute(t,s),o=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,g.create({key:n,iv:o,salt:s})}},A=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:p}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=y.encrypt.call(this,t,e,r.key,s);return n.mixIn(r),n},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.wZ(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,y.decrypt.call(this,t,e,r.key,s)}})}()}(jp.exports);var eA={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,r[i]=g,n[g]=i;var m=t[i],y=t[m],p=t[y],A=257*t[g]^16843008*g;o[i]=A<<24|A>>>8,h[i]=A<<16|A>>>16,a[i]=A<<8|A>>>24,l[i]=A,A=16843009*p^65537*y^257*m^16843008*i,u[g]=A<<24|A>>>8,c[g]=A<<16|A>>>16,d[g]=A<<8|A>>>24,f[g]=A,i?(i=m^t[t[t[p^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({nZ:function(){if(!this.CZ||this.kZ!==this.vZ){for(var t=this.kZ=this.vZ,e=t.words,i=t.sigBytes/4,s=4*((this.CZ=i+6)+1),n=this.TZ=[],o=0;o6&&o%i==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=g[o/i|0]<<24),n[o]=n[o-i]^l);for(var h=this.FZ=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.IZ(t,e,this.TZ,o,h,a,l,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.IZ(t,e,this.FZ,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},IZ:function(t,e,i,s,r,n,o,h){for(var a=this.CZ,l=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],f=4,g=1;g>>24]^r[u>>>16&255]^n[c>>>8&255]^o[255&d]^i[f++],y=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],p=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],A=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=m,u=y,c=p,d=A}m=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],y=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],p=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],A=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=m,t[e+1]=y,t[e+2]=p,t[e+3]=A},keySize:8});e.AES=i.aZ(m)}(),t.AES}(jp.exports),iA={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.SZ,s=i.blockSize,r=this.xZ,n=this.PZ;r&&(n=this.PZ=r.slice(0),this.xZ=void 0);var o=n.slice(0);i.encryptBlock(o,0),n[s-1]=n[s-1]+1|0;for(var h=0;h>>2]|=t[r]<<24-r%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(jp.exports),rA={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(jp.exports);const nA="aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvYXBwLWRlcGxveW1lbnQv",oA={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vcHl0aG9uLWNoYXJ0cy8="],"-1":["WE1MSHR0cFJlcXVlc3Q=","ZG9jdW1lbnQ=","ZGVmYXVsdFZpZXc=","YQ==","Yg==","bGljZW5zZV9leHBpcmF0aW9uX2RhdGU=","bG9jYXRpb24=","aG9zdG5hbWU=","dGVzdF9kb21haW4=","ZG9tYWlucw==","Y3J5cHRv","U2lnbmF0dXJl","RUNEU0E=","U0hBMjI0d2l0aEVDRFNB","YWxn","Y3VydmU=","c2VjcDI1Nmsx","YWRkRXZlbnRMaXN0ZW5lcg==","cmVtb3ZlRXZlbnRMaXN0ZW5lcg==","bG9hZGVuZA==","ZXJyb3I=","YWJvcnQ=","dGltZW91dA==","cmVzcG9uc2VUZXh0","Q29udGVudC1UeXBl","YXBwbGljYXRpb24vanNvbg==","TWVzc2FnZURpZ2VzdA==","c2hhMjU2","Y3J5cHRvanM=","dXBkYXRlU3RyaW5n","ZGlnZXN0","Y29tcGFueQ==","YXBwVGl0bGU=","bGNqcy1zZXNzaW9u","bG9jYWxTdG9yYWdl","Z2V0SXRlbQ==","c2V0SXRlbQ==","ZA==","dA==","bGNqcy1zZXNzaW9uLTI="],0:["TGljZW5zZQ==","IA==","a2V5","aGFz","ZXhwaXJlZA==","Lg==","dmVyc2lvbg==","aXM=","dG9v","bmV3","b2xk","b3I=","aW52YWxpZA==","MDAwMQ==","SW52YWxpZA==","bnVtYmVy","b2Y=","ZG9tYWlucw==","ZGVwbG95bWVudA==","aW4=","ZG9tYWlu","RGVwbG95bWVudA==","ZG9tYWlu","dmFsaWRhdGlvbg==","ZmFpbGVk","Og==","UE9TVA==","c2VydmVy","cmVzcG9uZGVk","d2l0aA==","dW5leHBlY3RlZA==","dmFsdWU=","cmVxdWVzdA==","VEVTVA==","REVQTE9ZTUVOVA==","S2V5","VGFtcGVyaW5n","YmVlbg==","ZGV0ZWN0ZWQ=","TWlzc2luZw==","TGljZW5zZQ==","aW5mb3JtYXRpb24=","ZG9lcw==","bm90","aW5jbHVkZQ==","cGVybWlzc2lvbg==","dG8=","dXNl","Q2hhcnQ=","M0Q=","WFk=","RGF0YUdyaWQ=","TWFw","UG9sYXI=","RnVubmVs","R2F1Z2U=","UGll","UHlyYW1pZA==","U3BpZGVy","Zm9y","dGhpcw==","VHJhZGluZw==","ZmVhdHVyZXM=","Y2xpY2s=","aGVyZQ==","bW9yZQ==","c3VwcGxpZWQ=","Z2V0","bGljZW5zZQ==","VHJlZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA==","aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vcGx1Z2lu"]},hA=zt,aA=(...t)=>t.slice(1).reduce(((e,i)=>e+hA.atob(oA[t[0]][i].toString())),"");let lA,uA,cA,dA=new Uint8Array([]);const fA=t=>t&&"cGx1Z2lu"in t&&"cHl0aG9u"===t.cGx1Z2lu?aA(-2,3):aA(-2,2);class gA{set e(t){lA=t}get e(){uA={df:!1,ff:!1,Af:!1,gf:!1,pf:!1,yf:!1,mf:!1,vf:!1,Sf:!1,xf:!1,bf:!1,Mf:!1,_f:!1,wf:!1,Cf:!1,kf:!1,Tf:!1,Ff:!1,If:!1,Pf:!1,Df:!1,Bf:!1,Lf:!1,Rf:!1,Ef:!1,zf:!1};const t=dA.length,e=t>=1?dA[0]:void 0,i=t>=2?dA[1]:void 0,s=t>=3?dA[2]:void 0,r=t>=4?dA[3]:void 0;return void 0!==e&&(uA.df=!!(1&e),uA.ff=!!(2&e),uA.Af=!!(4&e),uA.gf=!!(8&e),uA.pf=!!(16&e),uA.yf=!!(32&e),uA.mf=!!(64&e),uA.vf=!!(128&e)),void 0!==i&&(uA.Sf=!!(1&i),uA.xf=!!(2&i),uA.bf=!!(4&i),uA.Mf=!!(8&i),uA._f=!!(16&i),uA.wf=!!(32&i),uA.Cf=!!(64&i),uA.kf=!!(128&i)),void 0!==s&&(uA.Tf=!!(1&s),uA.Ff=!!(2&s),uA.If=!!(4&s),uA.Pf=!!(8&s),uA.Df=!!(16&s),uA.Bf=!!(32&s),uA.Lf=!!(64&s),uA.Rf=!!(128&s)),void 0!==r&&(uA.Ef=!!(1&r)),uA.yf}set l(t){cA=t}get l(){return cA}}let mA=!1;const yA=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},pA=t=>{if(4===t.byteLength)return`${t[0].toString().padStart(2,"0")}${t[1].toString().padStart(2,"0")}${t[2].toString().padStart(2,"0")}${t[3].toString().padStart(2,"0")}`},AA=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),xA=t=>{const e={},i=t.split("-");if(3!==i.length)return{DZ:aA(0,0,1,7,1,12,5)};let s=0;const r=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const n=r.subarray(s,s+=20),o=new DataView(r.buffer).getUint16(s,!0);s+=2;const h=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return bA(d,f)?e:{DZ:aA(0,0,1,7,1,12,5)}},SA=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(yA(i,2)),e=t.slice(36,40),s=new Uint8Array(4),r=(t=>{let e;const i=[];for(let t=0;t<256;t+=1){e=t;for(let t=0;t<8;t+=1)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}let s=-1;for(let e=0;e>>8^i[255&(s^t[e])];return~s>>>0})(t.slice(0,36));new DataView(s.buffer).setUint32(0,r,!0);const n=t.slice(28,34);let o=0;for(let t=n.length-1;t>0;t-=1)o+=n[t]*2**(8*t);const h=new Date(o);if(AA(h)s[e]===t)))return{};break}case"0002":return xA(t);default:return{DZ:aA(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{DZ:aA(0,0,1,2,1,7,1,12,5)}},vA=t=>{if(!t)return{DZ:aA(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[aA(-1,9)]||t[aA(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(hA[aA(-1,6)][aA(-1,7)])>-1)return{EZ:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(EA(hA[aA(-1,6)][aA(-1,7)],i))return{EZ:!0};const s=t[aA(-1,8)]||t[aA(-1,38)];if(""!==s&&null!=s){if(EA(hA[aA(-1,6)][aA(-1,7)],[s]))return{EZ:!1};if(s===hA[aA(-1,6)][aA(-1,7)])return{EZ:!1}}return{DZ:aA(0,14,1,20,5),LZ:"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvd2ViLWRlcGxveW1lbnQv"}},bA=(t,e)=>{const i=new Xp("secp256k1").keyFromPublic(aA(-4,0),"hex"),s=Jp(t).toString();return i.verify(s,e)},MA=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],r=e[2],n=e[3];if(!bA(r,n))return{DZ:aA(0,21,1,2,1,7,1,12,5)};const o=Qp.parse(r);i=eA.decrypt({ciphertext:Qp.parse(s)},o,{mode:iA,padding:rA,iv:Qp.parse("00000000000000000000000000000001")}).toString(tA)}catch(t){return{DZ:aA(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{DZ:aA(0,21,1,2,1,7,1,12,5)}}if(void 0===e[aA(-1,5)]||null===e[aA(-1,4)]||!e[aA(-1,9)])return{DZ:aA(0,21,1,2,1,7,1,12,5)};const s=parseInt(aA(-3,0),10)||Number(parseInt(aA(-3,0),10));return e[aA(-1,5)]{const e=xA(t),i=e.BZ,s=e.RZ;if(e.DZ||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.RZ,s+16),r=new DataView(t.buffer),o=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":return((t,e)=>{if(!e)return{DZ:aA(0,39,1,40,1,41,5),LZ:nA};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!bA(`${s}-${r}`,n))return{DZ:aA(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(yA(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(aA(-3,0),10)||Number(parseInt(aA(-3,0),10))))return{DZ:aA(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(yA(s,8)),l=Kp(e[aA(-1,31)]).toString(Qp),u=Int32Array.from(yA(l,8)),c=Kp(e[aA(-1,32)]).toString(Qp),d=Int32Array.from(yA(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{DZ:aA(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{DZ:aA(0,39,1,40,1,41,5),LZ:nA};const i=xA(t),s=i.BZ,r=i.RZ;if(i.DZ||void 0===s||void 0===r)return i;const n=s.slice(r,s.length),o=new DataView(n.buffer),h=new Int32Array(8);for(let t=0;td[e]===t))?{}:{DZ:aA(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{DZ:aA(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},TA=(t,e,i=!0,s)=>{mA=!1,e.fo();const r=e.qr,n=!!r&&(r===zt.document.body||zt.document.body.contains(r)),o=r&&n?r:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const r=zt.document.createElement("div");r.id="lcjs-error",o.append(r),r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="black",r.style.boxSizing="border-box",r.style.padding="20px",r.style.font="Arial",r.style.fontSize="20px";let n,h=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(h=(i?aA(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1),s){const t=zt.document.createElement("a");t.href=s,n=t}else n=zt.document.createElement("p1");r.append(n),n.innerHTML=h,n.style.color="red",e.ej()&&hA.console.error(h)}},wA=(t,e,i)=>{e?(t[aA(-1,17)](aA(-1,19),i),t[aA(-1,17)](aA(-1,20),i),t[aA(-1,17)](aA(-1,21),i),t[aA(-1,17)](aA(-1,22),i)):(t[aA(-1,18)](aA(-1,19),i),t[aA(-1,18)](aA(-1,20),i),t[aA(-1,18)](aA(-1,21),i),t[aA(-1,18)](aA(-1,22),i))},EA=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const r=e.findIndex((t=>"*"===t)),n=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(r>i.length-1||!n)}))},kA=new Map;e.AbstractCursor=Ta,e.Animation=Z,e.AnimationEasings=$,e.Animator=q,e.AreaRangeSeries=Uu,e.AreaSeries=Lu,e.AreaSeriesBipolar=_u,e.AreaSeriesMonopolar=Bu,e.AreaSeriesNegative=Vu,e.AreaSeriesPositive=Gu,e.AreaSeriesTypes=Nu,e.AutoFitStrategies=ba,e.AutoFitStrategy=xa,e.Axis=bh,e.Axis3D=nl,e.AxisScrollStrategies=Ks,e.AxisTickStrategies=Js,e.Band=Zs,e.BarChart=Af,e.BarChartBar=mf,e.BarChartCategoryAxis=ff,e.BarChartSorting=xf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=gf,e.BasicSeries=xu,e.BorderedPicture=qn,e.BoxFigure=fu,e.BoxSeries=vu,e.BoxSeries3D=dl,e.Button=th,e.Chart=fa,e.Chart3D=Dl,e.ChartComponent=is,e.ChartWithSeries=Sl,e.ChartXY=Dc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return C(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb")){const e=t.substr(4).slice(0,-1),i=JSON.parse(`[${e}]`);return C(i[0],i[1],i[2])}if(t.startsWith("hsl")){const e=t.substr(4).slice(0,-1).split(",").map(parseFloat),i=((t,e,i)=>{e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,r=t/60,n=s*(1-Math.abs(r%2-1));let o=[];isNaN(t)?o=[0,0,0]:r<=1?o=[s,n,0]:r<=2?o=[n,s,0]:r<=3?o=[0,s,n]:r<=4?o=[0,n,s]:r<=5?o=[n,0,s]:r<=6&&(o=[s,0,n]);const h=i-.5*s;return[Math.round(255*(o[0]+h)),Math.round(255*(o[1]+h)),Math.round(255*(o[2]+h))]})(e[0],e[1],e[2]);return C(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?T(t):T((t=>{const e=E[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),T("#fff")},e.ColorHEX=T,e.ColorHSV=w,e.ColorPalettes=to,e.ColorRGBA=C,e.ColorShadingStyles=lo,e.ColorUint32=t=>C(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=qs,e.Cursor2D=Ea,e.Cursor3D=zl,e.CursorBuilder2D=ka,e.CursorBuilder3D=Fl,e.CursorBuilderXY=yc,e.CursorBuilders=Mf,e.CursorXY=mc,e.CustomTick=Bn,e.Dashboard=gg,e.DashedLine=fo,e.DataGrid=hf,e.DataPatternsNew=Zr,e.DataSetXY=So,e.DateTimeTickStrategy=qh,e.EllipseFigure=bu,e.EllipseSeries=Mu,e.EmptyFill=L,e.EmptyTickStrategy=lr,e.EmptyUIElement=jn,e.Figure=du,e.FigureSeries=pu,e.FontSettings=vr,e.FormattingFunctions=Bi,e.FunnelChart=ed,e.FunnelChartTypes=hd,e.FunnelChartWithLabelsInsideSlices=od,e.FunnelChartWithLabelsOnSides=nd,e.FunnelSlice=qc,e.GaugeChart=Uf,e.GenericAxis=gr,e.GlowEffect=xo,e.HeatmapGridSeries=zu,e.HeatmapGridSeriesIntensityValues=Fu,e.HeatmapScrollingGridSeries=Ru,e.HeatmapScrollingGridSeriesIntensityValues=Du,e.Highlighter=ss,e.Icon=yo,e.ImageFill=Q,e.IndividualPointFill=Y,e.LUT=P,e.LegendBoxBuilders=xh,e.LineAndPointSeries3D=fl,e.LineSeries=xc,e.LineSeries3D=gl,e.LinearGradientFill=ht,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new ht({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Hl,e.MapRegions=Df,e.MapRegionsAfrica=Cf,e.MapRegionsAsia=Tf,e.MapRegionsAustralia=wf,e.MapRegionsCanada=Ef,e.MapRegionsEurope=kf,e.MapRegionsNorthAmerica=Ff,e.MapRegionsSouthAmerica=Rf,e.MapRegionsUSA=zf,e.MapRegionsWorld=If,e.MapTypes=_l,e.MeshModel3D=Il,e.NumericTickStrategy=ra,e.OHLCSeries=lc,e.OHLCSeriesBars=cc,e.OHLCSeriesCandlesticks=uc,e.OHLCSeriesTypes=dc,e.OnScreenMenu=vc,e.OnScreenMenuAnimationsButton=Ps,e.OnScreenMenuButton=ws,e.OnScreenMenuControlBase=ds,e.OnScreenMenuCustomButton=Ls,e.OnScreenMenuOsmToggleButton=_s,e.OnScreenMenuToggleButton=Es,e.OnScreenMenuZoomInButton=ks,e.OnScreenMenuZoomInXButton=Is,e.OnScreenMenuZoomInYButton=zs,e.OnScreenMenuZoomOutButton=Fs,e.OnScreenMenuZoomOutXButton=Rs,e.OnScreenMenuZoomOutYButton=Ds,e.OnScreenMenuZoomToFitButton=Os,e.PalettedFill=W,e.Panel=la,e.ParallelCoordinateAxis=hg,e.ParallelCoordinateChart=lg,e.ParallelCoordinateSeries=ag,e.PhongShadingStyle=ho,e.Picture=Zn,e.PieChart=ja,e.PieChartTypes=Qa,e.PieChartWithLabelsInsideSlices=Ja,e.PieChartWithLabelsOnSides=Ka,e.PieSlice=Ua,e.PixelatedPoints3D=Ir,e.PointCloudSeries3D=Al,e.PointLineAreaSeries=bc,e.PointLineSeries=ju,e.PointLineSeries3D=ml,e.PointSeries=Sc,e.PointSeries3D=pl,e.PointSeriesTypes3D=xl,e.PointStyle3D=Fr,e.PolarAreaSeries=Hc,e.PolarAreaSeriesInterior=Xc,e.PolarAxis=jl,e.PolarAxisAmplitude=Zl,e.PolarAxisTick=$l,e.PolarChart=jc,e.PolarHeatmapSeries=lu,e.PolarLineSeries=uu,e.PolarPointLineSeries=cu,e.PolarPointSeries=Nc,e.PolarPolygon=Uc,e.PolarPolygonSeries=Yc,e.PolarSector=iu,e.PolarSeries=ru,e.PolygonFigure=Cu,e.PolygonSeries=Tu,e.PyramidChart=gd,e.PyramidChartTypes=Sd,e.PyramidChartWithLabelsInsideSlices=xd,e.PyramidChartWithLabelsOnSides=Ad,e.PyramidSlice=ud,e.RadialGradientFill=rt,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new rt({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Ou,e.RectangleFigure=wu,e.RectangleSeries=Eu,e.SegmentFigure=ku,e.SegmentSeries=Iu,e.Series2D=su,e.Series3D=cl,e.SeriesXY=gu,e.SimpleShadingStyle=no,e.Slice=Ga,e.SliceLabelFormatters=Va,e.SliceSorters=Ba,e.SolidFill=N,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new N({color:s(t)})},e.SolidLine=us,e.SpiderAxis=Td,e.SpiderChart=Pd,e.SpiderSeries=wd,e.SplineSeries=qu,e.StepSeries=ac,e.StipplePatterns=uo,e.SurfaceGridSeries3D=Tl,e.SurfaceScrollingGridSeries3D=wl,e.Themes=rg,e.Tick=vh,e.TickStyle=kh,e.TimeFormattingFunctions=Ph,e.TimeTickStrategy=Lh,e.TreeMapChart=Gf,e.TriangulatedPoints3D=wr,e.UIBackgrounds=Ma,e.UICircle=Ro,e.UIColumnGrid=class extends Vo{constructor(){super(...arguments),this.Pd=[]}addColumn(){return this.addElement(Ho,void 0)}getColumn(t,e=!1){return e&&this.Pd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Pd[t]}},e.UIDiamond=Do,e.UIElementBuilders=Ah,e.UIElementColumn=Go,e.UIElementLine=Bo,e.UIElementRow=Vo,e.UIElementWithBackground=Ln,e.UIEmptyBackground=$n,e.UILabel=Io,e.UILayoutBuilders=Ol,e.UILayoutGap=_o,e.UILegendBoxPanel=Ll,e.UIObject=Fn,e.UIOrigins=Vs,e.UIPanel=ca,e.UIPoint=Oo,e.UIPointer=Po,e.UIPolygon=Kn,e.UIRectangle=Fo,e.UIRowGrid=Uo,e.VisibleFill=G,e.ZoomBandChart=Vc,e._translatePoint=yt,e.defaultOsmBackgroundColor=js,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=_,e.emptyLine=ut,e.emptyPoints3D=Cr,e.emptyTick=zh,e.formatLongitudeLatitude=Xl,e.formatNumberAsUnicodeSuperscript=Vi,e.isColor=M,e.isCoordinate3D=kl,e.isCoordinateBarChart=yf,e.isCoordinateClient=ji,e.isCoordinatePolar=eu,e.isCoordinateXY=Zi,e.isDashedLine=go,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=B,e.isEmptyTick=Fh,e.isEmptyTickStrategy=ur,e.isFontSettings=br,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isHitBox=t=>t&&"object"==typeof t&&"figure"in t&&"start"in t&&"end"in t&&"median"in t&&"upperQuartile"in t,e.isHitBox3D=t=>t&&"object"==typeof t&&"xSize"in t&&"ySize"in t&&"zSize"in t,e.isHitEllipse=t=>t&&"object"==typeof t&&"figure"in t&&"x"in t&&"radiusX"in t&&"radiusY"in t,e.isHitHeatmap=At,e.isHitMeshModel=vt,e.isHitOHLC=t=>t&&"object"==typeof t&&"position"in t&&"open"in t&&"high"in t&&"isPacked"in t,e.isHitPolarHeatmap=St,e.isHitPolygon=t=>t&&"object"==typeof t&&"figure"in t&&"x"in t&&"coordinates"in t,e.isHitRectangle=t=>t&&"object"==typeof t&&"figure"in t&&"x1"in t&&"y2"in t&&"height"in t,e.isHitSampleXY=t=>t&&"object"==typeof t&&"x"in t&&"y"in t,e.isHitSegment=t=>t&&"object"==typeof t&&"figure"in t&&"startX"in t&&"endX"in t,e.isHitSurface=xt,e.isIcon=po,e.isIndividualPointFill=H,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=at,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=j,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=zr,e.isRadialGradientFill=nt,e.isSeriesSupportedByZoomBandChart=t=>t instanceof xu||t instanceof Lu||t instanceof Uu||t instanceof Fu||t instanceof lc||t instanceof ac||t instanceof bc,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=U,e.isSolidLine=cs,e.isTickStyle=Ih,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=Er,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,n="object"==typeof t?t:void 0,o=new gA;o.e=i;let h=kA.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1,d=!1;try{if(lA){const s=(()=>{if(!lA)return;const t=lA.split("-");if(t.length>0)switch(t[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";case"P001":return"P001";default:return}})(),r=t&&"cGx1Z2lu"in t;if("0001"===s){dA=new Uint8Array([2]);const e=(()=>{if(!lA)return;const t=lA.split("-");return 4===t.length?t[1].startsWith("m")?2:1:0})();if(1===e){const t=MA(lA);h=!t.EZ,i=t,n=!0}else 2===e?(i=CA(lA,t),o=!0):(mA=!0,i=SA(lA),a=!0);r&&(i={DZ:aA(0,0,1,7,1,12,5)})}else if("0002"===s){const e=(()=>{if(!lA)return;const t=lA.split("-");return t.length>=2?Uint8Array.from(atob(t[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)mA=!0,i=SA(lA),a=!0;else if(189===e){const t=MA(lA);h=!t.EZ,i=t,n=!0}else 159===e?(i=CA(lA,t),o=!0):i={DZ:aA(0,0,1,7,1,12,5)};const s=dA.length>3&&2&dA[3];(s&&!r||!s&&r||s&&r&&"cHl0aG9u"!==t.cGx1Z2lu)&&(i={DZ:aA(0,0,1,7,1,12,5)})}else if("T001"===s){const s=((t,e)=>{const i=lA.split("-");if(3!==i.length)return{DZ:aA(0,0,1,7,1,12,5)};const s=`${i[1]}`,r=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!bA(s,r))return{DZ:aA(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(n))),h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;ty)return{DZ:aA(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),A=l.subarray(n+=2,n+p);if(dA=new Uint8Array(A),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{zZ:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&bA(t[0],t[2])?{zZ:t[0]}:{DZ:aA(0,0,1,7,1,12,5)}}return{DZ:aA(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.zZ;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={DZ:aA(0,0,1,7,1,12,5)}}else"P001"===s?(i=((t,e)=>{const i=lA.split("-");if(3!==i.length)return{DZ:aA(0,0,1,7,1,12,5)};const s=`${i[0]}-${i[1]}`,r=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!bA(s,r))return{DZ:aA(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));n+=1;const h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;tNumber(t)));Date.now()-i<.95*e*1e3&&(f=!0)}}const g=!(d||u||c||i.DZ||n||o||f),m=(()=>{const t=new(hA[aA(-1,0)]);return t.open(aA(0,26),aA(-2,0)),t.setRequestHeader(aA(-1,24),aA(-1,25)),t.withCredentials=!0,t})(),y=new r.Eventer;if(g){let t;try{t=parseInt(lA?lA.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const e=Math.floor(1e6*Math.random());l=(t^e).toString();const i={};let s="",r="",n="";lA=lA||"";const o=aA(-4,0);for(let t=0;t{const o=[],a={Jn:t=>{o.indexOf(t)>=0||(o.push(t),d())},Kn:t=>y.on("logoChange",t),qn:t=>y.off(t)},d=()=>{o.forEach((t=>{const e=p(t);if(!e)return;const{VZ:i,OZ:s}=e,r=s?aA(-2,1):void 0,n=`${aA(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?aA(0,1,63,1,64,1,59,1,65,1,41):""}`;TA(n,A,!1,r)}))},f=t=>t.toLowerCase().split("_").join(" "),p=t=>{var e;const i=null===(e=Object.entries(Sh).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case Sh.Af:return uA.df||uA.Af?void 0:{VZ:f(i),OZ:!0};case Sh.mf:return uA.df||uA.mf?void 0:{VZ:f(i),OZ:!0};case Sh.vf:return uA.df||uA.ff||uA.vf?void 0:{VZ:f(i)};case Sh.ff:return uA.df||uA.ff?void 0:{VZ:f(i)};case Sh._f:return uA.df||uA.ff||uA._f?void 0:{VZ:f(i)};case Sh.kf:return uA.df||uA.ff||uA.kf?void 0:{VZ:f(i)};case Sh.Pf:return uA.df||uA.ff||uA.Pf?void 0:{VZ:f(i)};case Sh.Bf:return uA.df||uA.ff||uA.Bf?void 0:{VZ:f(i)};case Sh.Lf:return uA.df||uA.ff||uA.Lf?void 0:{VZ:f(i)};case Sh.Df:return uA.df||uA.ff||uA.Df?void 0:{VZ:f(i)};case Sh.xf:return uA.df||uA.ff||uA.xf?void 0:{VZ:f(i)};case Sh.Cf:return uA.df||uA.ff||uA.Cf?void 0:{VZ:f(i)};case Sh.Mf:return uA.df||uA.ff||uA.Mf?void 0:{VZ:f(i)};case Sh.Tf:return uA.df||uA.ff||uA.Tf?void 0:{VZ:f(i)};case Sh.If:return uA.df||uA.ff||uA.If?void 0:{VZ:f(i)};case Sh.Ff:return uA.df||uA.ff||uA.Ff?void 0:{VZ:f(i)};case Sh.Sf:return uA.df||uA.ff||uA.Sf?void 0:{VZ:f(i)};case Sh.bf:return uA.df||uA.ff||uA.bf?void 0:{VZ:f(i)};case Sh.wf:return uA.df||uA.ff||uA.wf?void 0:{VZ:f(i)};case Sh.Rf:return uA.df||uA.ff||uA.Rf?void 0:{VZ:f(i)};case Sh.Ef:return uA.df||uA.ff||uA.Ef?void 0:{VZ:f(i)};case Sh.df:case Sh.gf:case Sh.yf:case Sh.pf:case Sh.zf:return}return ze(0,"")}},A=new wp(n,r,a);(null==i?void 0:i.DZ)&&TA(i.DZ,A,void 0,i.LZ);const x=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&bA(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return mA=!1,void wA(m,!1,S)}}if(m.readyState===hA[aA(-1,0)].DONE)if(200===m.status){const t=JSON.parse(m[aA(-1,23)]);if(!bA(l+aA(-3,0),t.h)){const t=aA(0,0,1,27,1,28,1,29,1,30,1,31,5);TA(t,A)}hA[aA(-1,34)][aA(-1,36)](aA(-1,39),t.t),hA[aA(-1,34)][aA(-1,36)](aA(-1,33),t.s),mA=!1}else{let e=aA(0,0,1,2,1,7,1,12,5);try{e=t&&"loadend"!==t.type?aA(0,0,1,23,1,32,1,24,5):JSON.parse(m[aA(-1,23)]).message,wA(m,!1,S)}catch(t){console.error(t)}TA(e,A,void 0,"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvZGV2ZWxvcGVyLWxpY2Vuc2Vz")}},S=t=>{x(t)};if(wA(m,!0,S),g?setTimeout((()=>{if(mA){let t=!0;if(s){const e=s.split("-");if(2===e.length&&bA(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&TA(aA(0,25,1,23,1,32,1,24,5),A)}}),1e4):wA(m,!1,S),u){const i=(()=>{const t=new(hA[aA(-1,0)]);return t.open(aA(0,26),aA(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),s=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),r=r=>{if("error"===(null==r?void 0:r.type)){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}if(i.readyState===hA.XMLHttpRequest.DONE){const r=i.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==i.status||r&&"1"!==r){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}else{const r=JSON.parse(i.responseText);if(!bA(s,r.s)){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}void 0!==e&&(e.l=r.l),y.emit("logoChange",r.l)}}else{const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}},n=t=>{r(t)};wA(i,!0,n),i.send(s),setTimeout((()=>{if(i.readyState<2){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,n)}}),1e4)}if(c){const i=(()=>{const t=new(hA[aA(-1,0)]);return t.open(aA(0,26),aA(1,1)),t.setRequestHeader(aA(-1,24),aA(-1,25)),t.withCredentials=!0,t})();let s;try{s=parseInt(lA?lA.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(t){s=Math.floor(1e6*Math.random())}const r=Math.floor(1e6*Math.random());l=(s^r).toString();const n={};let o="",h="";lA=lA||"";const a=aA(-4,0);for(let t=0;t{var r;if("error"===(null==s?void 0:s.type)){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,c)}if(i.readyState===hA.XMLHttpRequest.DONE)if(200===i.status){const s=JSON.parse(i.responseText);if(!bA(l,s.h)){const e=aA(0,0,1,7,1,12,5);TA(e,A,!1,fA(t)),wA(m,!1,c)}const r=s.l.split("-"),n=r[0],o=r[1];if(bA(n,o))void 0!==e&&(e.l=n,y.emit("logoChange",n));else{const e=aA(0,0,1,7,1,12,5);TA(e,A,!1,fA(t))}const h=s.f,a=Uint8Array.from(atob(h),(t=>t.charCodeAt(0)));let u=0;const f=a.subarray(u,u+=20),g=new DataView(a.buffer).getUint16(u,!0);u+=2;const p=Uint8Array.from(Array(g));for(let t=0;t{u(t)};wA(i,!0,c),setTimeout((()=>{if(i.readyState<2){const e=aA(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);TA(e,A,!1,fA(t)),wA(m,!1,c)}}),1e4)}return h?(t=>{let e;mA=!1;const i=()=>{e&&(t.En(e.Rn()),e=void 0);const i=t.oi();e=t.KF("deployment test"),e.Wr(t.At).Sr(aA(0,34,1,33)).Ve({x:i.x/2,y:i.y/2}).La(50).sr(13).Re(new N({color:C(128,128,128,100)})).Da("Arial").Ea(500).setMouseInteractions(!1),t.Dn().Bn()};t.Eo((()=>{i()})),setTimeout(i,0),setInterval((()=>{e&&e.Rn(){var r,n,o,h,a,l,u,c;let d;if(i&&i.license){const t=i.license.split("-");d=t[t.length-1]}const f=null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version,g={vV:null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.canvas,eo:null==i?void 0:i.warnings,IV:"webgl1"===f?1:"webgl2"===f?2:void 0,CV:!1!==(null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.antialias),wV:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,OV:(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.noCanvasStyles)||void 0,WV:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasTransform)||void 0,TV:!1!==(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.useStackingOrder),FV:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useIndividualCanvas),NV:d||void 0},m=new Am(g),y=e=>t(e,m);return{Dashboard:xm(y,e,i,s),ChartXY:bm(y,e,i,s),Spider:Mm(y,e,i,s),Polar:Cm(y,e,i,s),Pie:Tm(y,e,i,s),UIPanel:vm(y,e,i,s),Gauge:wm(y,e,i,s),Funnel:Em(y,e,i,s),Pyramid:km(y,e,i,s),Chart3D:zm(y,e,i,s),Map:Im(y,e,i,s),DataGrid:Fm(y,e,i,s),BarChart:Rm(y,e,i,s),ParallelCoordinateChart:Om(y,e,i,s),ZoomBandChart:Dm(y,e,i,s),TreeMapChart:Pm(y,e,i,s),dispose:m.Y.bind(m),layout:m.jV.bind(m)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Us,e.onScreenMenuControlBaseWidth=Ys,e.onScreenMenuControlOpacity=Hs,e.onScreenMenuDefaultButtonShape=Ws,e.onScreenMenuSpriteURL=Xs,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const r=null==s?void 0:s.formatLabels,n=null==s?void 0:s.alpha;return i.map(((s,o)=>{const h=t+o/(i.length-1)*(e-t);return{color:void 0!==n?s.setA(n):s,value:h,label:r?r(h):void 0}}))},e.saveToFile=na,e.synchronizeAxisIntervals=pt,e.transparentFill=Gs,e.transparentLine=Ns,e.uint32ColorFromObject=t=>z(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=z,e.useCursorFormatterSeriesOverride=ya,e.vec3Utils=Ue,e.xDimensionStrategy=Ch,e.yDimensionStrategy=Th}}]); \ No newline at end of file