From 461198a9ee36712d31a767d335dd377a811b9988 Mon Sep 17 00:00:00 2001 From: niiloArction Date: Tue, 5 Nov 2024 18:46:52 +0000 Subject: [PATCH] deploy: 9fc0950007721ce650eb83315821c63efe33cf72 --- index.html | 2 +- js/vendor.7a933c81db5cb7e8cce1.bundle.js | 2 ++ ...SE.txt => vendor.7a933c81db5cb7e8cce1.bundle.js.LICENSE.txt} | 0 js/vendor.a2fc4f246becc51c9c1c.bundle.js | 2 -- 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 js/vendor.7a933c81db5cb7e8cce1.bundle.js rename js/{vendor.a2fc4f246becc51c9c1c.bundle.js.LICENSE.txt => vendor.7a933c81db5cb7e8cce1.bundle.js.LICENSE.txt} (100%) delete mode 100644 js/vendor.a2fc4f246becc51c9c1c.bundle.js diff --git a/index.html b/index.html index 19b1475..b9fb191 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.7a933c81db5cb7e8cce1.bundle.js b/js/vendor.7a933c81db5cb7e8cce1.bundle.js new file mode 100644 index 0000000..ded349b --- /dev/null +++ b/js/vendor.7a933c81db5cb7e8cce1.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.7a933c81db5cb7e8cce1.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,y=e&&e.length,m=y?e[0]*s:t.length,p=i(t,0,m,s,!0),A=[];if(!p||p.next===p.prev)return A;if(y&&(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===R(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!==m(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,y,m=t;t.prev!==t.next;)if(g=t.prev,y=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(y.i/i|0),C(t),t=y.next,m=y.next;else if((t=y)===m){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,y=s.next;y!==e;){if(y.x>=u&&y.x<=d&&y.y>=c&&y.y<=f&&g(r,h,n,a,o,l,y.x,y.y)&&m(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(m(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,y=ha?h>l?h:l:a>l?a:l,x=u>c?u>f?u:f:c>f?c:f,S=d(y,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>=y&&b.x<=A&&b.y>=p&&b.y<=x&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=y&&M.x<=A&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=S;){if(b.x>=y&&b.x<=A&&b.y>=p&&b.y<=x&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=y&&M.x<=A&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.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&&y(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 m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function y(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)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||p(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,s){var r=S(m(t,e,i)),n=S(m(t,e,s)),o=S(m(i,s,t)),h=S(m(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 m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function 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 R(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:()=>Yi,Record:()=>cs,Repeat:()=>As,Seq:()=>X,Set:()=>Li,Stack:()=>Ci,default:()=>Cs,fromJS:()=>xs,get:()=>re,getIn:()=>Gi,has:()=>se,hasIn:()=>Wi,hash:()=>ft,is:()=>lt,isAssociative:()=>M,isCollection:()=>A,isImmutable:()=>D,isIndexed:()=>b,isKeyed:()=>S,isList:()=>si,isMap:()=>ot,isOrdered:()=>P,isOrderedMap:()=>ht,isOrderedSet:()=>Fi,isPlainObject:()=>te,isRecord:()=>F,isSeq:()=>E,isSet:()=>Ii,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&&!m(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function f(t,e){return y(t,e,0)}function g(t,e){return y(t,e,e)}function y(t,e,i){return void 0===t?i:m(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function m(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:X(t)},T=function(t){function e(t){return S(t)?t:j(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),R=function(t){function e(t){return b(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 A(t)&&!M(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C);C.Keyed=T,C.Indexed=R,C.Set=w;var k="@@__IMMUTABLE_SEQ__@@";function E(t){return Boolean(t&&t[k])}var I="@@__IMMUTABLE_RECORD__@@";function F(t){return Boolean(t&&t[I])}function D(t){return A(t)||F(t)}var B="@@__IMMUTABLE_ORDERED__@@";function P(t){return Boolean(t&&t[B])}var L="function"==typeof Symbol&&Symbol.iterator,V="@@iterator",z=L||V,_=function(t){this.next=t};function N(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 O(){return{value:void 0,done:!0}}function U(t){return!!Array.isArray(t)||!!H(t)}function Y(t){return t&&"function"==typeof t.next}function G(t){var e=H(t);return e&&e.call(t)}function H(t){var e=t&&(L&&t[L]||t[V]);if("function"==typeof e)return e}_.prototype.toString=function(){return"[Iterator]"},_.KEYS=0,_.VALUES=1,_.ENTRIES=2,_.prototype.inspect=_.prototype.toSource=function(){return this.toString()},_.prototype[z]=function(){return this};var W=Object.prototype.hasOwnProperty;function K(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 X=function(t){function e(t){return null==t?et():D(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 q(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 _((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return N(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(C),j=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}(X),$=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}(X),Z=function(t){function e(t){return(A(t)&&!M(t)?t:$(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}(X);X.isSeq=E,X.Keyed=j,X.Set=Z,X.Indexed=$,X.prototype[k]=!0;var Q=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 _((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return N(t,n,i[n])}))},e}($),q=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 W.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 _((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return N(t,o,i[o])}))},e}(j);q.prototype[B]=!0;var J,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=G(this._collection),s=0;if(Y(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=G(this._collection);if(!Y(i))return new _(O);var s=0;return new _((function(){var e=i.next();return e.done?e:N(t,s++,e.value)}))},e}($);function et(){return J||(J=new Q([]))}function it(t){var e=rt(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new q(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 K(t)?new Q(t):U(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=wt[i=r])&&(s=yt(i),Rt===Tt&&(Rt=0,wt={}),Rt++,wt[i]=s),s):yt(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!==mt&&!1===mt(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 yt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function gt(t){return null===t?1108378658:1108378659}function yt(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:N(e,a-1,0===e?void 0:t.value[1],t)}))},a}function zt(t,e,i,s){var r=Kt(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 _((function(){var t,n,u;do{if((t=h.next()).done)return s||1===r?t:N(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:N(r,n,u,t)}))},r}function _t(t,e,i){var s=Kt(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 Yt(t,e,i,s){var r=Kt(t),n=new Q(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),G(r?t.reverse():t)})),o=0,h=!1;return new _((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}:N(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Gt(t,e){return t===e?t:E(t)?e:t.constructor(e)}function Ht(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Wt(t){return S(t)?T:b(t)?R:w}function Kt(t){return Object.create((S(t)?j:b(t)?$:Z).prototype)}function Xt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function jt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[i]=arguments[i+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return 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=X(i),h=X(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(D(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?R:T,o=s?function(e){r===t&&(r=ne(r)),r.push(e)}:function(e,s){var n=W.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,Ke(),(function(t){return Te(t,e)}))}function Ee(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,Ke(),(function(t){return Ce(t,e)}))}function Ie(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 De(){return this.__ensureOwner()}function Be(){return this.__altered}var Pe=function(t){function e(e){return null==e?Ke():ot(e)&&!P(e)?e:Ke().withMutations((function(i){var s=t(e);Qt(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 Ke().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 Xe(this,t,e)},e.prototype.remove=function(t){return Xe(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):Ke()},e.prototype.sort=function(t){return Ai(Nt(this,t))},e.prototype.sortBy=function(t,e){return Ai(Nt(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 Ye(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?We(this.size,this._root,t,this.__hash):0===this.size?Ke():(this.__ownerID=t,this.__altered=!1,this)},e}(T);Pe.isMap=ot;var Le=Pe.prototype;Le[nt]=!0,Le[s]=Le.remove,Le.removeAll=Le.deleteAll,Le.setIn=ce,Le.removeIn=Le.deleteIn=fe,Le.update=ye,Le.updateIn=me,Le.merge=Le.concat=pe,Le.mergeWith=Ae,Le.mergeDeep=Re,Le.mergeDeepWith=we,Le.mergeIn=ke,Le.mergeDeepIn=Ee,Le.withMutations=Ie,Le.wasAltered=Be,Le.asImmutable=De,Le["@@transducer/init"]=Le.asMutable=Fe,Le["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Le["@@transducer/result"]=function(t){return t.asImmutable()};var Ve=function(t,e){this.ownerID=t,this.entries=e};Ve.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=Je)return function(t,e,i,s){t||(t=new a);for(var r=new Oe(t,ft(i),[i,s]),n=0;n>>t)&n),o=this.bitmap;return o&r?this.nodes[Qe(o&r-1)].get(t+5,e,i,s):s},ze.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 _e(t,o+1,h)}(t,y,d,u,p);if(f&&!p&&2===y.length&&$e(y[1^g]))return y[1^g];if(f&&p&&1===y.length&&$e(p))return p;var A=t&&t===this.ownerID,x=f?p?d:d^c:d|c,S=f?p?qe(y,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},_e.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=je(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?[Ze(t,e,i+5,s,r)]:(o=new Oe(e,s,r),h>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function qe(t,e,i,s){var r=s?t:$t(t);return r[e]=i,r}var Je=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:(Qt(n),n>0&&n=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?yi(t,e).set(0,i):yi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=mi(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){yi(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=mi(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>=mi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&n],s-=5;return i}}function yi(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=mi(o),g=mi(l);g>=1<f?new oi([],s):y;if(y&&g>f&&h5;A-=5){var x=f>>>A&n;p=p.array[x]=fi(p.array[x],s)}p.array[f>>>5&n]=y}if(l=g)h-=g,l-=g,u=5,c=null,m=m&&m.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);Qt(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(Ke(),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[B]=!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):wi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Mi(e))return e;Qt(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):wi(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):wi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?wi(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 Q(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 Q(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new _((function(){if(s){var e=s.value;return s=s.next,N(t,i++,e)}return{value:void 0,done:!0}}))},e}(R);Ci.isStack=Mi;var Ti,Ri=Ci.prototype;function wi(t,e,i,s){var r=Object.create(Ri);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function ki(){return Ti||(Ti=wi(0))}Ri[bi]=!0,Ri.shift=Ri.pop,Ri.unshift=Ri.push,Ri.unshiftAll=Ri.pushAll,Ri.withMutations=Ie,Ri.wasAltered=Be,Ri.asImmutable=De,Ri["@@transducer/init"]=Ri.asMutable=Fe,Ri["@@transducer/step"]=function(t,e){return t.unshift(e)},Ri["@@transducer/result"]=function(t){return t.asImmutable()};var Ei="@@__IMMUTABLE_SET__@@";function Ii(t){return Boolean(t&&t[Ei])}function Fi(t){return Ii(t)&&P(t)}function Di(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 Bi(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=X(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 Li=function(t){function e(e){return null==e?Oi():Ii(e)&&!P(e)?e:Oi().withMutations((function(i){var s=t(e);Qt(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?zi.intersect.apply(e(t.pop()),t):Oi()},e.union=function(t){return(t=C(t).toArray()).length?zi.union.apply(e(t.pop()),t):Oi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return _i(this,this._map.set(t,t))},e.prototype.remove=function(t){return _i(this,this._map.remove(t))},e.prototype.clear=function(){return _i(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=_i(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 Xi=C.prototype;Xi[p]=!0,Xi[z]=Xi.values,Xi.toJSON=Xi.toArray,Xi.__toStringMapper=ie,Xi.inspect=Xi.toSource=function(){return this.toString()},Xi.chain=Xi.flatMap,Xi.contains=Xi.includes,Bi(T,{flip:function(){return Gt(this,Dt(this))},mapEntries:function(t,e){var i=this,s=0;return Gt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Gt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var ji=T.prototype;ji[x]=!0,ji[z]=Xi.entries,ji.toJSON=Ki,ji.__toStringMapper=function(t,e){return ie(e)+": "+ie(t)},Bi(R,{toKeyedSeq:function(){return new kt(this,!1)},filter:function(t,e){return Gt(this,Lt(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 Gt(this,Pt(this,!1))},slice:function(t,e){return Gt(this,Vt(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=f(t,t<0?this.count():this.size);var s=this.slice(0,t);return Gt(this,1===i?s:s.concat($t(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 Gt(this,_t(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)}Zi.has=Xi.includes,Zi.contains=Zi.includes,Zi.keys=Zi.values,Bi(j,ji),Bi($,$i),Bi(Z,Zi);var ns=function(t){function e(t){return null==t?ls():Fi(t)?t:ls().withMutations((function(e){var i=w(t);Qt(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}(Li);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[B]=!0,hs.zip=$i.zip,hs.zipWith=$i.zipWith,hs.zipAll=$i.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(D(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&&!D(i)&&(K(i)||U(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,X(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:X,Map:Pe,OrderedMap:Ai,List:ri,Stack:Ci,Set:Li,OrderedSet:ns,PairSorting:us,Record:cs,Range:Yi,Repeat:As,is:lt,fromJS:xs,hash:ft,isImmutable:D,isCollection:A,isKeyed:S,isIndexed:b,isAssociative:M,isOrdered:P,isValueObject:at,isPlainObject:te,isSeq:E,isList:si,isMap:ot,isOrderedMap:ht,isStack:Mi,isSet:Ii,isOrderedSet:Fi,isRecord:F,get:re,getIn:Gi,has:se,hasIn:Wi,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]},y=(t,e)=>({min:t,max:e}),m=(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=I(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}`)}},R=(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})},w={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({}),E=C(0,0,0,0),I=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,F=(t,e)=>t.value-e.value,D=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}),B=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 D{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,B(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(B({...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 L=s.Record({type:"fillstyle",fillType:"empty"});class V extends L{toString(){return"emptyFill"}}const z=new V,_=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),N=s.Record({type:"fillstyle",fillType:"solid",color:C(255,255,255)});class O extends N{}class U extends O{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 Y=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class G extends O{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),W=s.Record({type:"fillstyle",fillType:"palette",lut:new P({steps:[]}),lookUpProperty:"value"}),K=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),X={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=se(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 j(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(wt):this.values.map(wt)}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=Ct.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=X.linear)=>(r,n,h=t)=>{const a=new j(r,n,h,e,i).start();return s||(s=Ct.requestAnimationFrame(o)),a}};var Z,Q;e.GradientShape=void 0,(Z=e.GradientShape||(e.GradientShape={})).circle="circle",Z.ellipse="ellipse",e.GradientExtent=void 0,(Q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",Q.closestCorner="closest-corner",Q.farthestSide="farthest-side",Q.farthestCorner="farthest-corner";const q=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 J extends q{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 tt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),et=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],angle:0});class it extends et{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?Ai(this.get("angle")):this.get("angle")}}const st=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),rt=s.Record({type:"linestyle",lineType:"empty"}),nt=new class extends rt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}N(){return 0}setFillStyle(t){return this}getFillStyle(){return z}},ot=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ht{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new at,this.y=new at,this.z=new at,this.R=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ke,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(Ke,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.U(e),s.y.U(r)}}}Y(){return this.W&&(this.W(),this.W=void 0),this}H(t){return this.R.on("cell-resize",t)}$(t){return this.R.off(t,"cell-resize")}}class at 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!==It(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 ht({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ut=(t,e,i)=>e===i?t:i.dt(e.ft(t)),ct=(t,e,i)=>{if(e===i)return t;const s=e instanceof Vi?e.x:e.x instanceof Vi?e.x.x:e.x.At,r=e instanceof Vi?e.y:e.y instanceof Vi?e.y.y:e.y.At,n=i instanceof Vi?i.x:i.x instanceof Vi?i.x.x:i.x.At,o=i instanceof Vi?i.y:i.y instanceof Vi?i.y.y:i.y.At;return{...t,x:ut(t.x,s,n),y:ut(t.y,r,o)}},dt=(...t)=>{if(0===t.length)return{remove:Et};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])}))}}},ft=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,gt=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,yt=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,mt=t=>t&&"object"==typeof t&&"index"in t;class pt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,pt.prototype)}}class At extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&Ct.alert(s),Object.setPrototypeOf(this,At.prototype)}}class xt extends At{constructor(t){super(t),Object.setPrototypeOf(this,xt.prototype)}}var St,vt,bt,Mt;e.UISpace=void 0,(St=e.UISpace||(e.UISpace={}))[St.Content=0]="Content",St[St.PaddedContent=1]="PaddedContent",St[St.PaddedBackground=2]="PaddedBackground",St[St.Everything=3]="Everything",e.UIVisibilityModes=void 0,(vt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[vt.never=0]="never",vt[vt.always=1]="always",vt[vt.whenHovered=2]="whenHovered",vt[vt.whenDragged=3]="whenDragged",vt[vt.whenNotDragged=4]="whenNotDragged",vt[vt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(bt=e.UIDraggingModes||(e.UIDraggingModes={}))[bt.notDraggable=0]="notDraggable",bt[bt.draggable=1]="draggable",bt[bt.onlyHorizontal=2]="onlyHorizontal",bt[bt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(Mt=e.UIDirections||(e.UIDirections={}))[Mt.Up=0]="Up",Mt[Mt.Right=1]="Right",Mt[Mt.Down=2]="Down",Mt[Mt.Left=3]="Left";const Ct="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Tt=(t,e)=>t.x===e.x&&t.y===e.y,Rt=t=>t!==ze&&t!==_e&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,wt=t=>t[1],kt=t=>t.dispose(),Et=()=>{},It=(t,e)=>t===e,Ft=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Dt=t=>Array.prototype.concat.apply([],t),Bt=(t,e)=>void 0===t||Number.isNaN(t)?e:t,Pt=t=>t.vt(),Lt=t=>t.St(),Vt=t=>t.xt(),zt=t=>t.bt(),_t=t=>t.min.x,Nt=t=>t.max.x,Ot=t=>t.min.y,Ut=t=>t.max.y,Yt=(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,Ht=u(0,1),Wt=u(1,0),Kt=u(0,-1),Xt=u(-1,0),jt=u(0,0),$t=t=>{switch(t){case e.UIDirections.Up:return Ht;case e.UIDirections.Right:return Wt;case e.UIDirections.Down:return Kt;case e.UIDirections.Left:return Xt;default:return jt}},Zt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Qt=t=>{t.stopPropagation(),t.preventDefault()},qt=(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)},ie=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},re=se(Math.E),ne=(t,e)=>{const i=e[t];return i?i():void 0},oe=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;ixi(ci(t,i))-xi(ci(e,i))))},he=(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())),le=t=>255===t.getA()?t:t.setA(255),ue=(()=>{const t=C(0,0,0);return i=>(i=le(i),new J({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ae(i,t,.5)}]}))})(),ce=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(tt(t)||st(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}K(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!==z&&("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()?ue(a):(a=le(a),l=le(l),new it({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 U({color:e}):ue(e):i.uiButtonFillStyle}var a,l;e.setButtonOnFillStyle(h)}})(),de=t=>{const e=t;if(K(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},fe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ge=(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,me=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),pe=(t,e)=>e(),Ae=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:C(255,255,255,1)});const xe=t=>t===Ne||t.min.x===Ne.min.x&&t.max.x===Ne.max.x&&t.min.y===Ne.min.y&&t.max.y===Ne.max.y,Se=t=>Array.from(new Set(t)),ve=t=>t.filter((t=>void 0!==t)),be=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Me=(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))))))},Ce=(t,e)=>{throw new Error(e)},Te=t=>{let e;return()=>e||(e=t(),e)},Re=t=>{if(t===nt)return 0;const e=t.getThickness();return e<0?1:1*e},we=(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 Ct.alert(r),new Error(r);Ct.console.warn(r)},ke=(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()}}},Ie={left:0,right:0,top:0,bottom:0},Fe=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Nt();const s=i();return{Gt:t,Nt:()=>{s.forEach((e=>t.Wt(e)))}}},Be=(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},Pe=t=>{if(t)return"resolve"in t?t.resolve():t},Le=t=>{let e=t;return{Ut:t=>{const i=e;return e=i+t,[i,t]}}},Ve={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=>Ve.divide(t,Ve.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(Ve.dot(t,e)/(Ve.length(t)*Ve.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ve.dot(e,t),o=Ve.cross(e,t);return Ve.addVec(Ve.multiply(t,s),Ve.addVec(Ve.multiply(e,(1-s)*n),Ve.multiply(o,r)))},lerp:(t,e,i)=>(i=Ft(i,0,1),Ve.addVec(Ve.multiply(t,1-i),Ve.multiply(e,i))),equals:(t,e)=>It(t.x,e.x)&&It(t.y,e.y)&&It(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)})},ze=Number.MAX_SAFE_INTEGER,_e=-Number.MAX_SAFE_INTEGER,Ne=y(u(ze,ze),u(_e,_e)),Oe=y(f(ze,ze,ze),f(_e,_e,_e)),Ue=(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))},Ye=(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),He=(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)}}),We=t=>{const e=t.length;for(let i=0;ie+t,Xe=(t,e,i)=>{const s=ci(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ci(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)},je=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,$e=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ze=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},Qe=(t,e,i)=>ui(t,li(ci(e,t),i)),qe=(t,e,i)=>Ve.addVec(t,Ve.multiply(Ve.subtractVec(e,t),i));function Je(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:ze,y:ze},max:{x:_e,y:_e}};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},ii=(t,e)=>y(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 si(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 ri(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 ni(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t){const e=ai(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function hi(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=oi(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 ai(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function li(t,e){return u(t.x*e,t.y*e)}function ui(t,e){return u(t.x+e.x,t.y+e.y)}function ci(t,e){return u(t.x-e.x,t.y-e.y)}function di(t,e){return u(t.x*e.x,t.y*e.y)}function fi(t,e){return u(t.x/e.x,t.y/e.y)}function gi(t){return li(t,-1)}function yi(t,e){return t.x*e.x+t.y*e.y}const mi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},pi=(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 Ai(t){return t*Math.PI/180}function xi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function Si(t){return u(Math.cos(t),Math.sin(t))}const vi=(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)},bi=(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 Mi{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 Ci extends Mi{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.U(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(Ke,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&&iEi;return!n&&!o||!!r&&(e>t?{start:n?ki:t,end:o?Ei:e}:{start:o?Ei:t,end:n?ki:e})}ft(t){const e=this.ei(),i=this.hi(),s=Math.max(t,ki);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:wi(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?re:se(t),wi=t=>"e"===t?Math.E:t,ki=.9*10**-4,Ei=1.1*10**25,Ii=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Fi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Ue(s,10),0);return t.toFixed(r)},Di={Numeric:(t,e)=>Fi(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 Ii){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=Ue(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-Ue(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ri(s)(t);return`${s}${Bi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ri(s),n=Math.floor(r(t)),o=t/wi(s)**n;return`${Math.round(o)}×${s}${Bi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ri(s),n=Math.floor(r(t));return`${(t/wi(s)**n).toFixed(2)}×${s}${Bi(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)}},Bi=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 Pi extends Ci{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(e_e&&t_e){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=Li(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=Di.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 Li(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=Li(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 Li=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Vi{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 zi extends Vi{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ct(t,e,i,s){return this.x=new Pi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Pi(t.y,e.y,i.y,s?s.y:void 0),this}_i(){return this.x._i()||this.y._i()}Wi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}mi(){return{x:this.x.mi(),y:this.y.mi()}}pi(t,e){const i=this.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(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 _i extends Vi{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)}}Ui(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=oi(ci(n,r)),h=hi(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 Ni=(t,e)=>t instanceof Ti||e instanceof Ti?(new _i).Ri(t,e):(new zi).Ri(t,e),Oi=t=>"client"===t,Ui=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Yi=t=>"relative"===t,Gi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y),Hi=(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}))},Wi=(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},Ki=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}},Xi=(t,e,i,s=1)=>Ft(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),ji=(t,e,i,s=1)=>{const r=i.ft(t),n=i.ft(e);return Ft(i.dt(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};var $i;e.HighlightModes=void 0,($i=e.HighlightModes||(e.HighlightModes={}))[$i.noHighlighting=0]="noHighlighting",$i[$i.onHover=1]="onHover";class Zi{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(){for(const t of this.ss)if(t[0].Is)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),Me(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}Ps(){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 Qi extends Zi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ds=!0,this.Bs=t,this.axis=s,this.At=r,this.Ls=n,this.Rs()}setClipping(t){return this.Ds=t,this.Bs.Ms(),this}getClipping(){return this.Ds}}const qi=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.Ns?(this.Os.splice(t,1),t-=1):this.Os[t].state&&(s=!0);return this.Vs?0===e.interactions.length&&(this.Os.push({state:!1,time:i}),this.Vs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Os.push({state:!0,time:i}),s=!0,this.Vs=!0),s}zs(t,e,i){if(i){const i=this.Os.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Gs(t,e),this.Os.length=0)}}},es=class{constructor(t,e,i,s=1,r=100){this.Ws=t,this.Us=e,this.Ys=i,this.Hs=s,this.$s=r}Es(t,e){const i=e.interactions.length;if(i===this.Hs){if(void 0!==this.Xs)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=qi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class os{constructor(t,e){this.Ks=t,this.qs=e,this.te=e.rows*Vs,this.ie=e.columns*zs}}var hs,as;e.OnScreenMenuButtonType=void 0,(hs=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[hs.ZoomIn=0]="ZoomIn",hs[hs.ZoomInX=1]="ZoomInX",hs[hs.ZoomInY=2]="ZoomInY",hs[hs.ZoomOut=3]="ZoomOut",hs[hs.ZoomOutX=4]="ZoomOutX",hs[hs.ZoomOutY=5]="ZoomOutY",hs[hs.ZoomToFit=6]="ZoomToFit",hs[hs.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(as=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[as.Circle=0]="Circle",as[as.Rectangle=1]="Rectangle",as[as.RoundedRectangle=2]="RoundedRectangle";const ls={x:-43,y:0},us={x:-65,y:0},cs={x:-86,y:0},ds={x:-107,y:-1},fs={x:-128,y:-3},gs={x:-150,y:0},ys={x:-171,y:0},ms={x:-276,y:0},ps={x:-298,y:0},As={x:0,y:0},xs={x:-21,y:0};class Ss extends os{constructor(t,e,i,s){super(t,i),this.se=Ct.document.createElement("button"),this.ee=Ct.document.createElement("div"),this.he=Ct.document.createElement("label"),this.qs=i,this.re=e,this.ne=s}oe(t,e,i,s){this.ae(t,s),this.le(),this.ue(e),this.ce(),this.he.textContent=i||"";const r=Ct.document.createElement("div");this.de(r),this.se.onclick=this.onClick.bind(this),r.appendChild(this.ee),r.appendChild(this.he),this.se.appendChild(r)}ce(){this.se.style.cursor="pointer"}de(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}ue(t){"string"==typeof t?(this.ee.style.backgroundImage=`url(${t})`,this.ee.style.backgroundSize="100%",this.ee.style.backgroundRepeat="no-repeat",this.ee.style.backgroundPosition="center",this.ee.style.width="20px",this.ee.style.height="20px"):this.applyStyleForSprite(t),this.ee.style.margin="auto"}le(){switch(this.re){case e.OnScreenMenuButtonShape.RoundedRectangle:this.se.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.se.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.se.style.borderRadius="31px"}}ae(t,e){this.se.style.width=`${this.ie.toString()}px`,this.se.style.height=`${this.te.toString()}px`,this.se.style.backgroundColor=t,this.se.style.opacity=e||_s,this.se.style.alignItems="center",this.se.style.border="2px solid #707070",this.se.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.ee.style.backgroundImage=`url(${this.Ks}/${Ns})`,this.ee.style.backgroundPositionX=`${t.x}px`,this.ee.style.backgroundPositionY=`${t.y}px`,this.ee.style.backgroundSize="1600%",this.ee.style.backgroundRepeat="no-repeat",this.ee.style.width="20px",this.ee.style.height="20px"}fe(t){return t.appendChild(this.se),t}Ae(){return this.se}}class vs extends Ss{constructor(t,e,i,s){super(t,e,i,s),this.ge="",this.pe="",this.ye=!1,this.ne=s}me(){this.ve(),this.onToggledStateAction()}Se(){this.xe(),this.onInitialStateAction()}xe(){this.be(this.ge)}ve(){this.be(this.pe)}be(t){"string"==typeof t?this.ee.style.background=t:(this.ee.style.backgroundImage=`url(${this.Ks}/${Ns})`,this.ee.style.backgroundPositionX=`${t.x}px`,this.ee.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ye?this.Se():this.me(),this.ye=!this.ye}}class bs extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),ls)}onClick(){const t=this.ne.Me();t&&this.ne.zoom(t,{x:-1,y:-1})}}class Ms extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),ds)}onClick(){const t=this.ne.Me();t&&this.ne.zoom(t,{x:-1,y:0})}}class Cs extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),gs)}onClick(){const t=this.ne.Me();t&&this.ne.zoom(t,{x:0,y:-1})}}class Ts extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),us)}onClick(){const t=this.ne.Me();t&&this.ne.zoom(t,{x:1,y:1})}}class Rs extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),fs)}onClick(){const t=this.ne.Me();t&&this.ne.zoom(t,{x:1,y:0})}}class ws extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),ys)}onClick(){const t=this.ne.Me();t&&this.ne.zoom(t,{x:0,y:1})}}class ks extends vs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.ge=ms,this.pe=ps,this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),this.ge)}onToggledStateAction(){this.ne.setAnimationsEnabled(!1)}onInitialStateAction(){this.ne.setAnimationsEnabled(!0)}}class Es extends Ss{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ne=e;const s=this.ne.getTheme();this.oe(s.onScreenMenuBackgroundColor.toRGBAString(),cs)}onClick(){this.ne.forEachAxis((t=>{t.fit(!0)}))}}class Is extends Ss{constructor(t,e,i){super(t,e.shape||Os,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.oe(r,n,o,h),this._e=e.action}onClick(){this._e(this.ne)}}class Fs extends vs{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.ne=i,this.we=s,this.ge=xs,this.pe=As,this.oe(Us,this.ge)}xe(){this.be(this.ge),this.se.style.backgroundColor=Us,this.se.style.border="2px solid #707070",this.se.style.margin="0px"}ve(){this.be(this.pe),this.se.style.background="#FECC00 0% 0% no-repeat padding-box",this.se.style.border="10px solid #BCBCBC12",this.se.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.we)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.we)||void 0===t||t.style.setProperty("display","none")}}var Ds;e.MouseStyles=void 0,(Ds=e.MouseStyles||(e.MouseStyles={})).Move="move",Ds.ResizeColumn="col-resize",Ds.ResizeRow="row-resize",Ds.Horizontal="ew-resize",Ds.Vertical="ns-resize",Ds.NorthWest="nw-resize",Ds.NorthEast="ne-resize",Ds.Copy="copy",Ds.CrossHair="crosshair",Ds.Default="default",Ds.Help="help",Ds.Restricted="not-allowed",Ds.None="none",Ds.Point="pointer",Ds.Text="text",Ds.Wait="wait",Ds.ZoomIn="zoom-in",Ds.ZoomOut="zoom-out";const Bs={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)},Ps=new U({color:C(255,255,255,0)}),Ls=new rs({thickness:1,fillStyle:Ps}),Vs=60,zs=60,_s="1.0",Ns="osm/osm-sprite-transparent.png",Os=e.OnScreenMenuButtonShape.Circle,Us="#363636";var Ys;e.OSMPosition=void 0,(Ys=e.OSMPosition||(e.OSMPosition={}))[Ys.TopRight=0]="TopRight",Ys[Ys.TopLeft=1]="TopLeft",Ys[Ys.BottomLeft=2]="BottomLeft",Ys[Ys.BottomRight=3]="BottomRight";class Gs extends Qi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Cs="Band",this.Ce=0,this.ke=0,this.Te=this.ts.bandFillStyle,this.Fe=this.ts.bandStrokeStyle,this.Ie=!0,this.Pe=this.Bs.Le(this.At).Be(this.Te).De(this.Fe).ds(this.getHighlight()),this.As(this.Pe)}setValueStart(t){return this.Ce=t,this.R.emit("valueChange",this,this.Ce,this.ke),this.Bs.Ms(),this}getValueStart(){return this.Ce}setValueEnd(t){return this.ke=t,this.R.emit("valueChange",this,this.Ce,this.ke),this.Bs.Ms(),this}getValueEnd(){return this.ke}setFillStyle(t){this.Te="function"==typeof t?t(this.Te):t;const e=this.Te;return this.Pe.Be(e),this.Bs.Ms(),this}getFillStyle(){return this.Te}setStrokeStyle(t){this.Fe="function"==typeof t?t(this.Fe):t;const e=this.Fe;return this.Pe.De(e),this.Bs.Ms(),this}getStrokeStyle(){return this.Fe}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}Re(){return this.Pe.Ee(this.Ls.toVec2(this.Ce,this.Ls.getHeight(this.At).getInnerStart())).it(this.Ls.toVec2(this.ke-this.Ce,this.Ls.getHeight(this.At).getInnerInterval())),Hi(this.Ds,[this.Pe],this.At),this}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te,stroke:this.Fe})}ze(t,e){t.ds(e),this.Bs.Ms()}setDefaultMouseInteractions(t){return this.Ie=t,this}Rs(){let t,i;const s=(e,s)=>{if(!this.Ie)return;const r=ct(this.Bs.cs.Ve(s.x,s.y),this.Bs.cs.At,this.At),n=this.Ls.getWidth(r),o=this.axis.At.ft(this.Ce),h=this.axis.At.ft(this.ke),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.Ie)return;const h=this.Ls.getWidth(n);t?(this.Ce=this.axis.At.pi(this.Ce,h),this.ke=this.axis.At.pi(this.ke,h)):i?this.Ce=this.axis.At.pi(this.Ce,h):this.ke=this.axis.At.pi(this.ke,h),Qt(o),this.R.emit("valueChange",this,this.Ce,this.ke),this.Bs.Ms()};this.onMouseMove(((i,r)=>{if(!this.Ie)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Ls.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Oe=this.chart.engine.setMouseStyle(n,this.Oe)})),this.onMouseLeave((()=>{this.Ie&&(this.chart.engine.restoreMouseStyle(this.Oe),this.Oe=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this.Ie&&0===i&&r(0,0,0,n,e)}));const n=Ji(new es(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Hs extends Qi{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.Fe=this.ts.constantLineStrokeStyle,this.Ne=!0,this.Ie=!0,this.Ge=this.Bs.Ue(this.At).We(this.Fe).ds(this.getHighlight()),this.As(this.Ge)}setValue(t){return this.M=t,this.R.emit("valueChange",this,this.M),this.Bs.Ms(),this}getValue(){return this.M}setStrokeStyle(t){this.Fe="function"==typeof t?t(this.Fe):t;const e=this.Fe;return this.Ge.We(e),this.Bs.Ms(),this}getStrokeStyle(){return this.Fe}setInteractionMoveByDragging(t){return this.Ne=t,this}getInteractionMoveByDragging(){return this.Ne}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}Re(){return this.Ge.He(this.Ls.toVec2(this.M,this.Ls.getHeight(this.At).getInnerStart())).Ye(this.Ls.toVec2(this.M,this.Ls.getHeight(this.At).getInnerEnd())),Hi(this.Ds,[this.Ge],this.At),this}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{stroke:this.Fe})}ze(t,e){t.ds(e),this.Bs.Ms()}setDefaultMouseInteractions(t){return this.Ie=t,this}Rs(){const t=(t,e)=>{this.Ie&&this.Ne&&(this.M=this.axis.At.pi(this.M,this.Ls.getWidth(e)),this.R.emit("valueChange",this,this.M),this.Bs.Ms(),Qt(t))};this.onMouseMove((()=>{if(this.Ie&&this.Ne){const t=this.Ls.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Oe=this.chart.engine.setMouseStyle(t,this.Oe)}})),this.onMouseLeave((()=>{this.Ie&&this.Ne&&(this.chart.engine.restoreMouseStyle(this.Oe),this.Oe=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.Ie&&this.Ne&&0===s&&t(i,n)}));const i=Ji(new es(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Ws={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?Ws.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Ws.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Ws.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.$e,js=t=>void 0!==t.Xe,$s=(t,e)=>[t,e],Zs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{It(t,0)&&(t=0),It(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},Js=(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)}},tr=(...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))}},er=s.Record({type:"empty-ticks",cursorFormatter:void 0});class ir extends er{je(t){return{Ze:[],Qe:[],Je:this.cursorFormatter?this.cursorFormatter:Di.Numeric,Ke:void 0,qe:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}}const sr=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),rr=(t,e)=>{if(e.has(t))return e.get(t);const i=Je(t.ih.th());if(xe(i))return i;const s=t.sh.pi(i.min,{x:-5,y:-5}),r=t.sh.pi(i.min,{x:5,y:5}),n=t.sh.pi(i.max,{x:-5,y:-5}),o=t.sh.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},nr=t=>{const e=new Map;if(!sr(t)){for(const i of t.Ze)e.set(i,new Map);for(const i of t.Qe)e.set(i,new Map)}return e},or=(new ir).je({type:"linear"});class hr{constructor(t,e,i,s,n,o,h){this.R=new r.Eventer,this.eh=or,this.hh=Ks.Empty,this.rh=new Map,this.oh=new Map,this.ah=Ws.fitting,this.lh=!0,this.uh=$((()=>this.chart.cs.Ms()))(300,X.linear),this.dh=!0,this.Zi=!0,this.fh=!1,this.Ah=_e,this.gh=!1,this.ph=!1,this.yh=_e,this.mh=_e,this.Sh=_e,this.xh=!1,this.bh="",this.Mh={},this._h=()=>{this.wh.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._h=void 0},this.Ch=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.rh.get(e),l=(t?t.get(a):void 0)||this.kh(a,e);l.Th=!1;const u=this.Fh(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.Ih=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Dh!==i||!!t.find((t=>t===e)))).map((t=>Ye(e,rr(t,a))?t:void 0)),y=p.some((t=>void 0!==t))}else y=!1;if(y){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Xs(t.Dh)))&&(t=!1),t&&i.Bh&&i.Bh.Lh&&!1===i.Bh.Lh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.eh.Je(t,this.At),this.Rh=!0,this.Eh=!0,this.chart=t,this.zh=e,this.ts=s,this.Vh=o,this.At=i,this.Oh=h,"logarithmic"===h.type&&this.setAnimationZoom(X.logarithmic(wi(h.base))),this.Nh=o.numeric,this.Gh("Numeric"),this.Wh=i.getInnerStart(),this.Uh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setUnits(t,e={}){return this.Yh=t,this.Hi=e,this.Hh(),this}getUnits(){return this.Yh}setDefaultInterval(t,e){return this.$h=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.xh=!0,this.chart.cs.Ms()),this}getDefaultInterval(){return this.$h}getTitle(){return this.bh}setTitle(t){return this.bh=t,this.Hh(),this}getTitleFillStyle(){return this.wh.Xh()}setIntervalRestrictions(t){return this.jh=t,this.chart.cs.Ms(),this}getIntervalRestrictions(){return this.jh}setTitleFillStyle(t){return this.wh.Be(t),this.chart.cs.Ms(),this}getTitleFont(){return this.wh.Zh()}setTitleFont(t){return this.wh.Qh(t),this.chart.cs.Ms(),this}setTitleRotation(t){return this.wh.Jh(t),this.chart.cs.Ms(),this}getTitleRotation(){return this.wh.Kh()}setTitleEffect(t){return this.qh.bs(t),this.chart.cs.Ms(),this}getTitleEffect(){return this.qh._s()}Gh(t,e){if(this.rh.size>0&&this.tr(),"Empty"===t){const i=e||(t=>t);this.Nh=i(new ir),this.eh=this.Nh.je(this.Oh),this.hh=t}else if("Numeric"===t){"Numeric"!==this.hh&&(this.Nh=this.Vh.numeric);const i=e||(t=>t);this.Nh=i(this.Nh),this.eh=this.Nh.je(this.Oh),this.hh=t}else if("DateTime"===t){"DateTime"!==this.hh&&(this.Nh=this.Vh.datetime);const i=e||(t=>t);this.Nh=i(this.Nh),this.eh=this.Nh.je(this.Oh),this.hh=t}else if("Time"===t){"Time"!==this.hh&&(this.Nh=this.Vh.time);const i=e||(t=>t);this.Nh=i(this.Nh),this.eh=this.Nh.je(this.Oh),this.hh=t}return this.oh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.oh=nr(this.eh),this.chart.cs.Ms(),this}ir(){return this.eh}sr(t){this.eh=t,this.oh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.oh=nr(this.eh),this.chart.cs.Ms()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.yt(void 0!==e?e:this.Wh,void 0!==i?i:this.Uh,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.Uh-this.Wh),void 0!==this.eh.Ke&&this.eh.Ke>h){const i=(e+t)/2,s=this.eh.Ke/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.eh.qe&&this.eh.qee?-1:1);n={start:i-s,end:i+s}}const a=this.At.ut(n.start,n.end,this.Wh,this.Uh,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 Ce(0,""),this}if(this.er&&this.er.finishAll(!1),this.uh&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.er||this.er.isOver()?this.uh:this.er.NextAnimation.bind(this);this.er=e([[this.Wh,n.start],[this.Uh,n.end]],(([t,e])=>{this.hr(t,e,o)}),t),this.er.onAnimationEnd((()=>{this.er=void 0,l&&(this.Sh=Ct.performance.now())})),this.er.onAnimationEnd((()=>this.setStopped(s)))}else this.hr(n.start,n.end,o),this.setStopped(s),l&&(this.Sh=Ct.performance.now());return this}getInterval(){return{start:this.Wh,end:this.Uh}}setStopped(t){return t===this.fh||(t&&(this.er&&this.er.finishAll(!1),this.er=void 0),this.fh=t,this.R.emit("stoppedStateChanged",this,this.fh),this.Ah=Ct.performance.now(),this.chart.cs.Ms()),this}getStopped(){return this.fh}onStoppedStateChanged(t){return this.R.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.R.off(t,"stoppedStateChanged")}fit(t,e){const i=this.rr(),s=this.$h||dr,r="function"==typeof s?s({curStart:this.Wh,curEnd:this.Uh,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.Wh,void 0!==r.end?r.end:this.Uh,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.ah=t,this.chart.cs.Ms(),this}getScrollStrategy(){return this.ah}setAnimationScroll(t){return this.lh=Boolean(t),this.chart.cs.Ms(),this}setAnimationZoom(t,e=300){return this.er&&(this.er.finishAll(!1),this.er=void 0),this.uh=t?$((()=>this.chart.cs.Ms()))(e,t):void 0,this}setAnimationsEnabled(t){return this.dh=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.dh}setVisible(t){const e=this.Zi!==t;return this.Zi=t,this.wh.setVisible(t),this.nr((e=>{e.ih.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")}ar(t,e){this._h&&this._h();const i=new Map;if(sr(this.eh)||!this.Zi)return this.tr(),i;e=e||new Map;const s=this.lr(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Mh.physicalAxisSize=h;const a=lr(this.eh,r,n,this.Wh,this.Uh,h),l=[];if(this.ur(),l.push(...this.cr(this.eh,r,n,a,e,t,i)),this.dr(this.eh,r,n,a,e,t,l,i),this.Ar(),a)for(const[t,e]of this.oh){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.Mh.min=r,this.Mh.max=n,this.Mh.scaleInterval=o,this.Mh.physicalAxisSize=h,i}gr(t){const e=t.Dh.pr;t.ih.yr(e(t.M,this.At)).zs()}mr(t,e){const i=e.vr;t.ih.Be(i.getLabelFillStyle()).Qh(i.getLabelFont()).Jh(i.getLabelRotation())}kh(t,e){const i=this.oh.get(e);let s=i.get(t);s?(i.delete(t),s.Dh=e,s.vs(!0)):s=this.Sr(t,e);const r=this.rh.get(e)||new Map;return r.set(t,s),this.rh.set(e,r),this.mr(s,e),s}Fh(t,e){const i=this.br(t,e);return this.gr(t),i}cr(t,e,i,s,r,n,o){const h=[];for(const a of t.Ze){const t=s.get(a);for(const s of t){if(si)continue;const t=this.rh.get(a),l=(t?t.get(s):void 0)||this.kh(s,a),u=this.Fh(l,n),c=rr(l,r);h.find((t=>Ye(c,rr(t,r))))&&l.ih.setVisible(!1),l.Th=!1,o.set(l,u),h.push(l)}}return h}dr(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Qe){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.Bh){p=!1;break}const t=u.Bh.Mr;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.Ih(y.filter((t=>a.some((e=>It(t.M,e))))),g,u,d,n,h,e,i,r,o,l);!0!==m?t=t.concat(m):(d+=1,f=-1,t=[])}m=t,y.forEach((e=>{t.find((t=>t===e))||this._r(e)}))}if(l=m,!p)break}}_r(t){const e=this.rh.get(t.Dh);null==e||e.delete(t.M);const i=this.oh.get(t.Dh);i&&i.has(t.M)?t.dispose():i&&(t.vs(!1),i.set(t.M,t))}nr(t){for(const e of this.rh.values())for(const i of e.values())t(i)}wr(t,e){for(const i of this.rh.values())for(const s of i.values())e=t(e,s);return e}tr(){this.rh.forEach(((t,e)=>{t.forEach((t=>this._r(t)))})),this.rh.clear()}ur(){for(const t of this.rh.values())for(const e of t.values())e.Th=!0}Ar(){for(const t of this.rh.values())for(const[e,i]of t.entries())i.Th&&(i.dispose(),t.delete(e))}lr(){const t=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart();return y(t,e)}Ph(t,e){return!(t.Th||0===t.ih.Cr().length||Xs(e)&&!0!==e.kr)}Tr(t,e){return sr(this.eh)||(this.eh.Ze.forEach((i=>{e=t(e,i.vr)})),this.eh.Qe.forEach((i=>{(t=>void 0!==t.pr)(i)&&(e=t(e,i.vr))}))),e}rr(){let t=this.zh.Fr();const e=this.zh.Ir();let i;if(void 0!==t&&Rt(t)&&void 0!==e&&Rt(e)&&("logarithmic"===this.Oh.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=y(t,e)),i&&Rt(i.min)&&Rt(i.max))return It(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}Pr(){if(!this.Rh)return 0;let t=0;const e=this.zh.Dr();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this.Rh=t,this.chart.cs.Ms(),this}Br(){var t;const e=this.gh;let i=!1;if(this.xh&&this.$h){const t=this.rr(),e="function"==typeof this.$h?this.$h({curStart:this.Wh,curEnd:this.Uh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.$h;this.setInterval(e),this.xh=!1}if(this.ah&&!this.fh){const e=this.rr();if(e){const s=this.Wh,r=this.Uh;let n=this.ah.start(s,r,e.min,e.max),o=this.ah.end(s,r,e.min,e.max);const h=null===(t=this.ah.allowIntervalLengthChange)||void 0===t||t,a=cr(this.jh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===It(s,n),u=!1===It(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.lh&&!this.Eh)if(this.lh){t=!0;const e=l?this.Lr(s,n):s,a=u?this.Lr(r,o):r;if(!0===this.hr(e,a,h)&&(l&&!1===It(e,n)||u&&!1===It(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.ph=t>=1.4}}else t=!1;t||this.hr(n,o,h),this.Eh=!1}}}return i?(this.gh!==i&&(this.gh=i,this.yh=Ct.performance.now()),this.Rr&&(clearTimeout(this.Rr),this.Rr=void 0)):!0===e&&void 0===this.Rr&&(this.ph=!1,this.Rr=setTimeout((()=>{!1!==this.gh&&(this.gh=!1,this.yh=Ct.performance.now()),this.Rr=void 0,this.chart.cs.Ms()}),200)),this}hr(t,e,i){let s={start:t,end:e},r=!0;if(this.jh){const t=this.rr();s=cr(this.jh,t,s,{start:this.Wh,end:this.Uh},i)}const n=Math.abs(e-t),o=Math.abs(this.Uh-this.Wh);if(void 0!==this.eh.Ke&&this.eh.Ke>n){const n=(e+t)/2,h=(i?this.eh.Ke/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.eh.qe&&this.eh.qee?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.At.ut(s.start,s.end,this.Wh,this.Uh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.Pr(),l=this.Er(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.Wh,this.Uh,!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.Wh=s.start,this.Uh=s.end,this.R.emit("scaleChange",this,s.start,s.end),this.mh=Ct.performance.now(),this.chart.cs.Ms(),r)}zr(){return this.gh}Vr(){return void 0!==this.er}Hh(){var t;const e=!1!==(null===(t=this.Hi)||void 0===t?void 0:t.displayOnAxis);this.wh.yr(this.Yh&&e&&this.bh?`${this.bh} (${this.Yh})`:this.bh),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 ar{constructor(t,e,i,s,r=i.Gr(s).Nr(Ie).Or(Ie).setMouseInteractions(!1)){this.Th=!1,this.ji=!1,this.ss=[],this.Dh=t,this.M=e,this.Wr=i,this.sh=s,this.ih=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 lr=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Ze){let t=n.Ur(e,i,s,r);t=ur(t),o.set(n,t)}let h;for(const s of t.Qe){let t;if(void 0===h)t=s.Ur(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.Yr&&s.Yr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),cr=(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||It(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||It(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||It(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||It(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},dr=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}},fr=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class gr extends fr{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 yr=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),mr=new gr,pr=new class{getFillStyle(){return z}},Ar=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:nt});class xr extends Ar{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 Sr=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),vr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class br extends vr{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 Mr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),Cr={Triangulated:xr,Pixelated:br};class Tr{constructor(t){this.Hr=new Map,this.cs=t}ls(t,e,i){const s=i.animationEnabled;this.Hr.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Hr.delete(t),t.offDispose(r)}))}$r(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Hr.delete(t)})),t.offDispose(r)}));return{Xr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Hr.set(t,r)},jr:()=>{s.forEach((t=>{this.Hr.delete(t)})),s.length=0},Zr:t=>{i=t,s.forEach((t=>{this.Ts(t,i)}))},Qr:()=>i}}ks(t,e){const i=this.Hr.get(t);i&&(i.curUnanimatedHighlightValue=be(e),this.cs.Ms())}ps(t,e=!1){const i=this.Hr.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Ts(t,e){const i=this.Hr.get(t);i&&(i.animationEnabled=e)}Fs(t){const e=this.Hr.get(t);return!!e&&e.animationEnabled}zs(t){let e=!1;this.Hr.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 Rr=new Map,wr=(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=Rr.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),Rr.set(a,l)),l};var kr,Er;!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"}(kr||(kr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(Er||(Er={}));const Ir=t=>({container:t.Jr,setMouseStyle:(e,i)=>t.Kr(e,i),restoreMouseStyle:e=>t.qr(e),captureFrame:(e,i,s)=>t.tn(e,i,s),renderFrame:(e,i,s=!1)=>t.sn(e,i,s),layout:()=>{t.en(),t.hn(),t.nn.rn(),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.an(e,i),onRenderFrame:e=>t.ln(e),offRenderFrame:e=>t.un(e)}),Fr=[];let Dr;const Br=()=>{if(void 0!==Dr){const t=Ct.getComputedStyle(Ct.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Dr.style.height=Ct.innerHeight-e+"px",(()=>{for(let t=0;tthis.Ms()),60),this.fn=u(0,0),this.An=!1,this.gn=Et,this.pn=()=>{},this.yn=[],this.mn=-1,this.vn=[],this.Sn=!0,this.ji=!1,this.xn=!1,this.hn=()=>{const{bottom:t,left:e}=this.Jr.getBoundingClientRect();return this.fn=u(Math.floor(e),Math.floor(t)),this},this.bn=t=>{if(this.Mn){const e=this.Mn.entity._n;e&&e(this.Mn.entity,t,this.Mn.button,this.Mn.startLocation,this.Mn.collectionMember,this.Mn.info),this.Mn=void 0}},this.en=()=>{this.wn&&this.wn()},this.Kr=(t,e)=>{if(!e){this.Jr.style.cursor=t;const e=this.mn;return this.mn+=1,this.vn.push([e,t]),e}return this.qr(e),this.Kr(t)},this.qr=t=>{const e=t?this.vn.findIndex((e=>e[0]===t)):-1;e>=0?(this.vn.splice(e,1),this.vn.length>0?this.Jr.style.cursor=this.vn[this.vn.length-1][1]:this.Jr.style.cursor="default"):(this.vn.push([0,"default"]),this.Jr.style.cursor="default")},this.Cn=t=>(this.kn._(t),this),this.Tn=()=>this.kn.C(),this.Fn=()=>{this.gn&&this.gn(1e3/60),this.In(),this.Pn(),this.pn&&this.pn()},this.Dn=t=>(this.cn.set(t.Bn(),t),this.cn=new Map([...this.cn.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Ln=t=>(this.cn.delete(t),this),this.J=()=>(this.kn.u=!1,this),this.K=()=>(this.kn.u=!0,this),this.Rn=t=>{if(!this.Sn)return;const e=this.En,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.xs({x:t.clientX,y:t.clientY});if(this.zn&&((null==s?void 0:s.entity)!==this.zn.entity||s.collectionMember!==this.zn.collectionMember)&&!this.Mn){this.zn.entity.Is=!1;const e=this.zn.entity.Vn;e&&e(this.zn.entity,t,this.zn.collectionMember)}if(s&&s.entity.getMouseInteractions()&&!this.Mn)if(s.entity.Is){if(!i){const e=s.entity.On;e&&e(s.entity,t,s.collectionMember,s.info)}}else{s.entity.Is=!0;const e=s.entity.Nn;e&&e(s.entity,t,s.collectionMember,s.info)}if(this.Mn){const i=this.Mn.entity.Gn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.Mn.entity,t,this.Mn.button,this.Mn.startLocation,s,this.Mn.collectionMember,this.Mn.info)}this.Wn=t,this.En=t,this.zn=s?{...s,event:t}:void 0},this.Un=t=>{if(this.Sn=!1,this.Wn=t,this.zn&&!this.Yn&&!this.Mn){this.zn.entity.Is=!1;const e=this.zn.entity.Vn;e&&e(this.zn.entity,t,this.zn.collectionMember),this.zn=void 0}},this.Hn=t=>{if(this.Sn=!0,this.Wn=t,this.Mn&&t.buttons<=0){const e=this.Mn.entity._n;e&&e(this.Mn.entity,t,this.Mn.button,this.Mn.startLocation,this.Mn.collectionMember,this.Mn.info),this.Mn=void 0}if(this.Yn&&t.buttons<=0){const e=this.Yn.entity.$n;e&&e(this.Yn.entity,t,this.Yn.collectionMember,this.Yn.info),this.Yn=void 0}},this.Xn=()=>this.Wn&&this.jn?this.Wn.timeStamp>this.jn.timeStamp?this.Wn:this.jn:this.Wn||this.jn,this.nn=t,this.ts=e.theme,this.Zn=i.Zn,this.Qn=i.Qn,this.Jn=i.Jn,this.Kn={qn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Ks:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${Ct.location.origin}/resources`,io:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,so:(()=>{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})(),eo:void 0===(null==e?void 0:e.interactable)||e.interactable,ho:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=Ct.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Jr=t}else this.Jr=s;Ct.addEventListener("resize",this.en),this.yn.push((()=>{Ct.removeEventListener("resize",this.en)}))}else{if(void 0===Dr){const t=Ct.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",Ct.document.body.appendChild(t),Dr=t,Ct.addEventListener("resize",Br)}let t=1;for(;null!==Ct.document.getElementById(`chart-${t}`);)t+=1;this.Jr=Ct.document.createElement("div"),this.Jr.id=`chart-${t}`,this.Jr.style.flex="1",this.Jr.style.height="100%",Dr.appendChild(this.Jr),Br(),Fr.push(this.en),this.yn.push((()=>{Dr&&Dr.removeChild(this.Jr),Fr.includes(this.en)&&Fr.splice(Fr.indexOf(this.en),1),0===Fr.length&&Dr&&(Ct.document.body.removeChild(Dr),Dr=void 0,Ct.removeEventListener("resize",Br))}))}if(Ct.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Jr&&this.en()};this.ro=new Ct.ResizeObserver(t.bind(this)),this.ro.observe(this.Jr)}""===this.Jr.style.position&&(this.Jr.style.position="relative"),this.Jr.style.boxSizing="content-box",this.Jr.addEventListener("fullscreenchange",this.en),this.Jr.addEventListener("webkitfullscreenchange",this.en);const n=e?e.maxFps:void 0;this.no=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.Jr.onwheel=this.oo(kr.wheel),this.Jr.oncontextmenu=this.oo(kr.contextmenu),this.Jr.onclick=this.oo(kr.click),this.Jr.ondblclick=this.oo(kr.dbclick),this.Jr.onlostpointercapture=()=>{h=!1},this.Jr.ontouchmove=t=>{h&&t.preventDefault()},this.Jr.onpointerover=a(),this.Jr.onpointerenter=a(this.Hn),this.Jr.onpointerdown=a(this.oo(kr.mouseDown),this.ao(Er.touchStart)),this.Jr.onpointermove=a(this.Rn,this.ao(Er.touchMove)),this.Jr.onpointerup=a(this.oo(kr.mouseUp),this.ao(Er.touchEnd)),this.Jr.onpointercancel=a(),this.Jr.onpointerout=a(),this.Jr.onpointerleave=a(this.Un,this.ao(Er.touchEnd)),Ct.addEventListener("dragstart",this.bn),Ct.addEventListener("scroll",this.hn,{passive:!0}),this.kn=p(new b({r:0,g:0,b:0,a:0})),this.us=new Tr(this)}lo(t,e){var i,s,r,n;(null===(i=this.zn)||void 0===i?void 0:i.entity)===t.entity&&this.zn.collectionMember===t.collectionMember&&(this.zn={...e,info:this.zn.info,event:this.zn.event}),(null===(s=this.uo)||void 0===s?void 0:s.entity)===t.entity&&this.uo.collectionMember===t.collectionMember&&(this.uo={...e,info:this.uo.info}),(null===(r=this.Yn)||void 0===r?void 0:r.entity)===t.entity&&this.Yn.collectionMember===t.collectionMember&&(this.Yn={...e,info:this.Yn.info,event:this.Yn.event}),(null===(n=this.Mn)||void 0===n?void 0:n.entity)===t.entity&&this.Mn.collectionMember===t.collectionMember&&(this.Mn={...e,info:this.Mn.info,button:this.Mn.button,startLocation:this.Mn.startLocation})}co(){this.xn=!0,this.gn=void 0,this.pn=void 0}ln(t){return this.R.on("render",t)}un(t){return this.R.off(t)}do(){return this.fo}Ao(){return this.po}setBackgroundFillStyle(t){return this.yo.Be(t),this}getBackgroundFillStyle(){return this.yo.Xh()}setBackgroundStrokeStyle(t){return this.yo.De(t),this}getBackgroundStrokeStyle(){return this.yo.mo()}vo(t){return this.pn=t,this}So(t){return this.gn=t,this}xo(t){return this.cn.get(t)}bo(){return Array.from(this.cn.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}oo(t){return e=>this.Mo(t,e)}Mo(t,e){if(!this.Sn)return;t===kr.contextmenu&&Qt(e);const i=this.xs({x:e.clientX,y:e.clientY});if(t===kr.mouseUp){if(this.Mn){const t=this.Mn.entity._n;if(t&&t(this.Mn.entity,e,this.Mn.button,this.Mn.startLocation,this.Mn.collectionMember,this.Mn.info),(null==i?void 0:i.entity)!==this.Mn.entity||i.collectionMember!==this.Mn.collectionMember){this.Mn.entity.Is=!1;const t=this.Mn.entity.Vn;t&&t(this.Mn.entity,e,this.Mn.collectionMember)}this.Mn=void 0}if(this.Yn){const t=this.Yn.entity.getMouseInteractions()&&this.Yn.entity.$n;t&&t(this.Yn.entity,e,this.Yn.collectionMember,this.Yn.info),this.Yn=void 0}}else if(i&&i.entity.getMouseInteractions()){const s=t===kr.click?i.entity._o:t===kr.dbclick?i.entity.wo:t===kr.mouseDown?i.entity.Co:t===kr.wheel?i.entity.ko:t===kr.contextmenu?i.entity.To:void 0;if(s&&s(i.entity,e,i.collectionMember,i.info),t===kr.mouseDown){this.Yn={entity:i.entity,collectionMember:i.collectionMember,event:e,info:i.info};const t=this.Yn.event.button,s=i.entity.Fo;s&&s(i.entity,e,t,i.collectionMember,i.info),this.Mn={entity:i.entity,collectionMember:i.collectionMember,button:t,startLocation:u(e.clientX,e.clientY),info:i.info}}}this.Wn=e,this.zn=i?{...i,event:e}:void 0}ao(t){return e=>this.Io(t,e)}Io(t,e){const i=e.interactions.length;if(this.jn=e,this.uo){const s=t===Er.touchMove?this.uo.entity.Po:t===Er.touchEnd?this.uo.entity.Do:t===Er.touchStart?this.uo.entity.Bo:void 0;s&&s(this.uo.entity,e,this.uo.collectionMember,this.uo.info),t===Er.touchEnd&&0===i&&(this.uo.entity.Is=!1,this.uo=void 0)}else if(t===Er.touchStart){for(let t=0;t{t()})),this.yn.length=0}}Ve(t,e){return u(t-this.fn.x,this.fn.y-e)}Oo(t,e){return u(t+this.fn.x,this.fn.y-e)}No(t){const e=this.Ve(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Go(t){const e=this.Oo(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const zr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=li(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=li(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=li(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=li(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===Gr.Nearest)return Wr(t,e,n,o,c,d);if(i===Gr.NearestX||i===Gr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Gr.NearestX||"y"===a&&i===Gr.NearestY))return jr(t,ct(e,o,n),a,l,c,d);if(i===Gr.NearestX)return Kr(t,ct(e,o,n),h,c,d);if(i===Gr.NearestY)return Xr(t,ct(e,o,n),h,c,d)}},Wr=(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=ct(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,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const e=h-(o?t[y].x:t[y].y);if(e*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(e))return y;m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){const i=y>r?Math.abs(h-(o?t[y-1].x:t[y-1].y)):ze,s=y{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,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const i=h-(o?t[y].x:t[y].y);if(i*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(i))return{a:y,b:y,lerpAmount:0};m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){if(i*(s?-1:1)<0&&y>r){const i=t[y-1],s=t[y];return{a:y-1,b:y,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(ythis.R.on("dispose",t),this.offDispose=t=>this.R.off(t,"dispose"),this.cs=t,this.Xo=e,this.jo=i,this.Zo=Zr,Zr+=1,this.Qo=t.ts.highlightColorOffset}Jo(){let t;return this.Ko("DataPattern",(e=>(t=e.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?Gr.NearestX:"ProgressiveY"===t||"RegressiveY"===t?Gr.NearestY:Gr.Nearest}qo(t){return void 0!==this.jo.find((e=>e.type===t))}Ko(t,e){var i;return!!this.qo(t)&&!0===e(null===(i=this.jo.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.ji||(this.Is&&this.Vn&&this.Vn(this,void 0,void 0),this.ji=!0,this.Xo(this),this.R.emit("dispose",this)),this}isDisposed(){return this.ji}setVisible(t){const e=this.Zi;return this.Zi=t,!t&&e&&(this.Is&&this.Vn&&this.Vn(this,void 0,void 0),this.Is=!1),this}getVisible(){return this.Zi}setMouseInteractions(t){const e=this.Wo.C();return this.Wo._(t),t||(e&&this.Is&&this.Vn&&this.Vn(this,void 0,void 0),this.Is=!1),this}getMouseInteractions(){return this.Wo.C()}getIsUnderMouse(){return this.Is}getIsGrabbed(){return this.Yo}setMouseMoveEventHandler(t){return this.On=t,this}setMouseEnterEventHandler(t){return this.Nn=t,this}setMouseLeaveEventHandler(t){return this.Vn=t,this}setMouseClickEventHandler(t){return this._o=t,this}setMouseDoubleClickEventHandler(t){return this.wo=t,this}setMouseDownEventHandler(t){return this.Co=t,this}setMouseUpEventHandler(t){return this.$n=t,this}setMouseWheelEventHandler(t){return this.ko=t,this}setMouseContextMenuEventHandler(t){return this.To=t,this}setMouseDragEventHandler(t){return this.Gn=t,this}setMouseDragStartEventHandler(t){return this.Fo=t,this}setMouseDragStopEventHandler(t){return this._n=t,this}setTouchStartEventHandler(t){return this.Bo=t,this}setTouchMoveEventHandler(t){return this.Po=t,this}setTouchEndEventHandler(t){return this.Do=t,this}ta(t){return this.Ho=t,this}ia(){return this.Ho?this.Ho:qr}ds(t){return this.$o=t,this}sa(){return this.$o}ea(t){return this.Qo=t,this}ha(){return this.Qo}}const qr=y(u(0,0),u(0,0));class Jr extends Qr{constructor(t,e,i,s){super(t,i,s),this.ra=0,this.Bs=e,this.Bs.na=!0}oa(t){return this.ra===t||(this.ra=t,this.Bs.na=!0),this}aa(){return this.ra}}class tn extends Jr{constructor(t,e,i,s,r){super(t,e,s,r),this.la=!0,this.At=i}}const en=(t,e,i)=>{if(i instanceof zi){const s=i.Wi(),r=di(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return y(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return y(i.pi(u(t.min.x,t.min.y),li(e,-1)),i.pi(u(t.max.x,t.max.y),e))},sn=(t,e)=>"function"==typeof e?e(t):e,rn=(t,e)=>!t||t!==e,nn=t=>t!==z;class on extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Te=Lr.fillStyle,this.cs=t}Be(t){return this.Te=sn(this.Te,t),this}Xh(){return this.Te}ua(){return rn(this.ca,this.Te)}da(){return((t,e)=>t===z&&e!==z)(this.ca,this.Te)}fa(){return nn(this.Te)}Aa(t){this.ca=t}}class hn extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Fe=Lr.lineStyle,this.cs=t}De(t){return this.Fe="function"==typeof t?t(this.Fe):t,this}mo(){return this.Fe}ga(){return!this.pa||this.pa!==this.Fe}ya(t){return!this.pa||this.pa.getThickness()!==t}fa(){return this.Fe!==nt||super.fa()}da(){return(this.Fe!==nt||this.Te!==z)&&this.pa===nt&&this.ca===z}ma(t){this.pa=t}}class an extends on{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 ln extends on{constructor(t,e,i,s,r,n=p(Lr.font)){super(t,e,i,s,r),this.va=p(""),this.Sa=p(u(0,0)),this.xa=p(0),this.ba=p(0),this.Ma=p(u(0,0)),this._a=p(0),this.wa=p(mr),this.Ca=u(0,0),this.Xt=p(A(1,1,1,1)),this.ka=p(x(4,4,4,4)),this.font=p(Lr.font),this.Ta=!1,this.font=n}fa(){return nn(this.Te)&&this.va.C().length>0}da(){return!1===this.Ta&&this.fa()}yr(t){return this.va._(t),this}Cr(){return this.va.C()}Qh(t){return yr(t)?this.wa._(t):this.wa._(t(this.wa.C())),this}Zh(){return this.wa.C()}Fa(t){return this.wa._(this.wa.C().setFamily(t)),this}Ia(){return this.wa.C().getFamily()}Pa(t){return this.wa._(this.wa.C().setSize(t)),this}Da(){return this.wa.C().getSize()}Ba(t){return this.wa._(this.wa.C().setWeight(t)),this}La(){return this.wa.C().getWeight()}Ra(t){return this.wa._(this.wa.C().setStyle(t)),this}Ea(){return this.wa.C().getStyle()}za(t){return this.wa._(this.wa.C().setVariant(t)),this}Va(){return this.wa.C().getVariant()}Ee(t){return this.Sa._(t),this}Oa(){return this.Sa.C()}Jh(t){return this._a._(t),this}Kh(){return this._a.C()}Na(t,e){return this.Ma._(u(t,e)),this}Ga(){return this.Ma.C()}Wa(t){return this.ba._(t),this}Ua(){return this.ba.C()}Ya(t){return this.xa._(t),this}Ha(){return this.xa.C()}$a(t){return this.ba._(t.x),this.xa._(t.y),this}Or(t){return this.Xt._(t),this}Xa(){return this.Xt.C()}Nr(t){return this.ka._(t),this}ja(){return this.ka.C()}}class un extends an{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Za=[],this.Qa=p(e.PointShape.Square),this._a=p(0),this.Ja=p(!1),this.Ka=p(!1),this.qa=p(!1),this.tl=Ne,this.il=0,this.sl=[],this.el=0,this.hl=Ne,this.rl=!1,this.nl=void 0}ol(){return this.sl}al(){return this.Za}ll(t){return this.Qa._(t),this}ul(){return this.Qa.C()}Jh(t){return this._a._(t),this}Kh(){return this._a.C()}cl(t){return this.Ja._(t),this}dl(t){return this.Ka._(t),this}fl(t){return this.qa._(t),this}Al(t,e){return Array.isArray(t)||(t=[t]),this.el+=t.length,this.sl=he(this.sl,t,{canReturnB:!0}),this.hl&&(this.hl=e?ei(this.hl,e):void 0),this.nl=void 0,this}Ot(){return this.rl=!0,this.Za.length=0,this.il=0,this.tl=Ne,this.sl=[],this.el=0,this.nl=void 0,this}pl(){return this.il}yl(){return this.el}}class cn extends hn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Sa=p(u(0,0)),this.Z=p(u(100,100)),this._a=p(0),this.Ca=p(u(0,0)),this.ml=!1}zs(){return this.vl(),this}Ee(t){const e=this.Sa.C();return t.x===e.x&&t.y===e.y||(this.Sa._(t),this.vl()),this}Oa(){return this.Sa.C()}Sl(t){const e=this.Sa.C();return t!==e.x&&(this.Sa._(u(t,e.y)),this.vl()),this}xl(t){const e=this.Sa.C();return t!==e.y&&(this.Sa._(u(e.x,t)),this.vl()),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.vl()),this}oi(){return this.Z.C()}bl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(t,e.y)),this.vl()),this}Ml(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(e.x,t)),this.vl()),this}Jh(t){return this._a._(t),this}Kh(){return this._a.C()}_l(t){const e=this.Ca.C();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.ml=!1,this.vl()):(this.ml=!0,this.Ca._(t))),this}vl(){if(!this.ml){const t=this.Sa.C(),e=this.Z.C(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Ca.C();i.x===s.x&&i.y===s.y||this.Ca._(i)}}}class dn extends hn{constructor(){super(...arguments),this.Za=[],this.Sa=p(u(0,0)),this.tl=Ne,this.wl=!1}Cl(t){return t=ie(t),this.Za=t,this.wl=!0,this}kl(){return this.Za}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return 0}Fl(){return 0}}class fn extends dn{}class gn extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Il=new Array,this.Pl=new Array,this.Dl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.tl=Ne,this.Bl=0,this.Ll=!1,this.sl=[Array(),Array()],this.Rl=!1,this.El=(new U).setColor(C(42,171,240)),this.rl=!1,this.zl=!1,this.Vl=!1}Al(t,e){const i=this.Bl-1,s=i>0&&!this.Rl;let[r,n]=s?[[this.Il[i]],[this.Pl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=he(r,e,{canReturnB:!0}),n=he(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Rl?(this.sl[0]=he(this.sl[0],r,{canReturnB:!0}),this.sl[1]=he(this.sl[1],n,{canReturnB:!0})):(this.sl=[r,n],this.Rl=!0),this.tl=ei(this.tl,e||ei(Je(r),Je(n))),this}Ot(){return this.rl=!0,this.Il.length=0,this.Pl.length=0,this.Bl=0,this.tl=Ne,this}al(){return[this.Il,this.Pl]}ol(){return[this.sl[0],this.sl[1]]}Ol(t){return this.Dl._(t),this}Nl(){return this.Dl.C()}Gl(t){return this.El="function"==typeof t?t(this.El):t,this}Wl(){return this.El}pl(){return this.Bl-(Number(this.zl)+Number(this.Vl))}yl(){return this.sl.length}Ul(t){return this.zl=t,this}Yl(){return this.zl}Hl(t){return this.Vl=t,this}$l(){return this.Vl}da(){return this.ca===z&&this.Xl===z&&(this.Te!==z||this.El!==z)}jl(t){this.Xl=t}fa(){return this.El!==z||super.fa()}ua(){return super.ua()||!this.Xl||this.Xl!==this.El}}class yn extends hn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Sa=p(u(0,0)),this.Zl=p(0),this.Fi=p(360),this.Ql=p(100),this.Jl=p(100),this.Kl=p(0),this.ql=p(void 0),this.tu=u(0,0),this.iu=u(0,0),this.su=u(0,0)}eu(){return this.Ql.C()}hu(){return this.Jl.C()}Oa(){return this.Sa.C()}ru(){return this.Zl.C()}Ti(){return this.Fi.C()}nu(){return this.Kl.C()}ou(){return this.ql.C()}au(){return this.tu}lu(){return this.iu}uu(){return this.su}Ee(t){return this.Sa._(t),this}cu(t){return this.Zl._(t),this}Ye(t){return this.Fi._(t),this}du(t){return this.Jl._(t),this.Ql._(t),this}fu(t){return this.Ql._(t),this}Au(t){return this.Jl._(t),this}gu(t){return this.Kl._(t<0?0:t),this}pu(t){return this.ql._(void 0!==t&&t<=0?void 0:t),this}}var mn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(mn||(mn={}));class pn extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.yu=Lr.lineStyle,this.engine=t}We(t){return this.yu=((t,e)=>"function"==typeof e?e(t):e)(this.yu,t),this}mu(){return this.yu}ga(){return((t,e)=>!t||t!==e)(this.vu,this.yu)}Su(t){return((t,e)=>!t||t.getThickness()!==e)(this.vu,t)}da(){return((t,e)=>t===nt&&e!==nt)(this.vu,this.yu)}fa(){return(t=>t!==nt&&t.getFillStyle()!==z)(this.yu)}xu(t){this.vu=t}}class An extends pn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.bu=!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.bu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}He(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.bu=!0,this.Pi=t),this}Ye(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.bu=!0,this.Fi=t),this}}class xn extends pn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Mu=void 0}}class Sn extends pn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._u=[],this.tl=Ne,this.sl=new Array,this.il=0,this.rl=!1,this.wu=p(void 0),this.zl=!1,this.Vl=!1}Cu(t){return this.wu._(t),this}ku(){return this.wu.C()}ol(){return this.sl}al(){return this._u}Ot(){return this.rl=!0,this._u.length=0,this.il=0,this.sl=[],this.tl=Ne,this}pl(){return this.il-(Number(this.zl)+Number(this.Vl))}yl(){return this.sl.length}Ul(t){return this.zl=t,this}Yl(){return this.zl}Hl(t){return this.Vl=t,this}$l(){return this.Vl}}const vn=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 bn{constructor(){this.Zi=!0,this.R=new r.Eventer,this.Tu=0,this._t=(t,e,i)=>{0===this.Tu&&this.R.emit("mouseEnter",this,e),this.Tu+=1},this.wt=(t,e,i)=>{this.Tu-=1,this.Tu<1&&(this.R.emit("mouseLeave",this,e),this.Tu=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.Tu+=1,this.R.emit("touchStart",this,e)},this.Et=(t,e)=>{this.R.emit("touchMove",this,e)},this.zt=(t,e)=>{this.Tu-=1,this.R.emit("touchEnd",this,e)},this.Fu=t=>(t instanceof tn?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.Tu>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 Mn=(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()},di({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},di({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),Qt(s)}},Cn=(t,e,i,s,r)=>{Mn(t,r,e)},Tn=(t,e,i,s,r)=>{Mn(t,s,r)};class Rn extends bn{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.Iu=void 0,this.Pu=void 0,this.Du=vn,this.Bu=void 0,this.Wo=!0,this.Lu=()=>{const t="function"==typeof this.Du?this.Du(this):this.Du;t&&(this.Pu=this.Bs.cs.Kr(t))},this.Ru=()=>{this.Bs.cs.qr(this.Pu)},this.Xt=A(0,0,0,0),this.Bs=t,this.renderingScale=e,this.scale=i,this.Xo=s,this.ts=r,this.Bs.Ms(),this.onMouseEnter(this.Lu),this.onMouseLeave(this.Ru),this.onMouseDrag(Cn);const n=Ji(new es(Et,Tn,Et));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.ts=r}setMouseInteractions(t){return this.Eu().forEach((e=>e.setMouseInteractions(t))),this.Wo=t,this}getMouseInteractions(){return this.Wo}setEffect(t){return this.hs=this.hs||this.Bs.cs.hs.rs(this,{zu:{shapes:this.Eu()}}),this.hs.zu.bs(t),this}getEffect(){return!!this.hs&&this.hs.zu._s()}setAutoDispose(t){return this.Bu=t,this.Bs.Ms(),this}getAutoDispose(){return this.Bu}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.Bs.Ms(),this}getMargin(){return this.Xt}Re(){if(this.Bu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Bu.type&&i.x>=this.Bu.maxWidth||"max-height"===this.Bu.type&&i.y>=this.Bu.maxHeight)&&this.dispose()}return this}zs(){return this}dispose(){return this.ji||(this.Bs.Ms(),this.ji=!0,this.Xo(this),this.R.emit("dispose",this),this.Eu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Eu().forEach((e=>e.setVisible(t))),this.Bs.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.Bs.Ms(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,di({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,di({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,di({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Bs.Ms(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Iu=t,this.Bs.Ms(),this}getDraggingMode(){return void 0!==this.Iu?this.Iu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Du=t,this}getMouseStyle(){return this.Du}}class wn extends Rn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.ka=A(),this.Vu=0,this.Bs=t,this.Ou=s,this.backgroundElement=new this.Ou(this.Bs,this.renderingScale,this.scale,Et,n),this.Fu(this.backgroundElement)}Eu(){return this.backgroundElement.Eu()}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}Re(){return super.Re(),this.ji||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Re(),this}zs(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Nu(t).zs(),super.zs()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.ka="object"==typeof t?S(this.ka,t):{left:t,top:t,right:t,bottom:t},this.Bs.Ms(),this}getPadding(){return this.ka}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.ka.left+this.ka.right,i.y+this.ka.bottom+this.ka.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Gu()+this.backgroundElement.Wu(),i.y+this.backgroundElement.Uu()+this.backgroundElement.Yu())),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,di({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Gu(),y:this.backgroundElement.Uu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,di({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,di({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.Vu}setHighlight(t){return this.Vu=be(t),this.backgroundElement.setHighlight(t),this.R.emit("highlight",this,t),this}}const kn=t=>"setBackground"in t;class En extends bn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.M=0,this.Hu=1,this.$u=!0,this.Xu=new gr,this.ju=!0,this.ji=!1,this.axisScale=s,this.renderingScale=r,this.Zu=o,this.Qu=h,this.Ju=a,this.Xo=l,this.Ku=e,this.qu=i,this.tc=this.Fu(this.Ku.Ue(this.renderingScale)),this.ts=u,this.ic=this.Fu(this.Ju.setDirection(this.Qu).sc(this.qu,this.renderingScale,n,Et,this.ts,!1).setOrigin($t(this.Qu))),this.axis=t,this.setMouseInteractions(!1),"major"===this.ic.hc?this.tc.We(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.ic.hc?this.tc.We(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.ic.hc&&this.tc.We(u.cursorGridStrokeStyleX)}setValue(t){return this.M=t,this.qu.Ms(),this.R.emit("valueChange",this,this.M),this}getValue(){return this.M}setTextFormatter(t){return this.rc=t,this.qu.Ms(),this}setTickLength(t){return this.ic.setPointerLength(t),this.Ku.Ms(),this}getTickLength(){return this.ic.getPointerLength()}setTickLabelPadding(t){return this.ic.setTickLabelPadding(t),this.Ku.Ms(),this}setTickLabelRotation(t){return this.ic.setTextRotation(t),this.Ku.Ms(),this}getTickLabelRotation(){return this.ic.getTextRotation()}getTickLabelPadding(){return this.ic.getTickLabelPadding()}setGridStrokeLength(t){return this.Hu=t,this.Ku.Ms(),this}getGridStrokeLength(){return this.Hu}setGridStrokeStyle(t){return this.tc.We(t),this.Ku.Ms(),this}getGridStrokeStyle(){return this.tc.mu()}dispose(){return this.ji||(this.ji=!0,this.tc.dispose(),this.ic.dispose(),this.Xo(this),this.Ku.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.$u=t,this.qu.Ms(),this}getMarkerVisible(){return this.$u}setMarker(t){return t(this.ic),this.qu.Ms(),this}getMarker(){return this.ic}setMouseInteractions(t){return this.ic.setMouseInteractions(t),this.tc.setMouseInteractions(t),this}getMouseInteractions(){return this.tc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.ju=t,this.qu.Ms(),this}getAllocatesAxisSpace(){return this.ju}isInScale(){return je(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 In extends En{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.nc=!1,this.Xo=a,this.Ku=e,this.qu=i}dispose(){return this.nc=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.nc=!1;const t=ut(this.M,this.axisScale,this.Zu.getWidth(this.renderingScale));this.tc.setVisible(!0).He(this.Zu.toPoint(t,e)).Ye(this.Zu.toPoint(t,e-(s+i*this.Hu))),this.$u?(this.rc&&this.ic.setText(this.rc(this.M,this)),this.ic.setVisible(!0).setPosition(this.Zu.toPoint(t,r))):this.ic.setVisible(!1)}else this.tc.setVisible(!1),this.ic.setVisible(!1);return this.ic.zs().Re(),this}oc(){const t=this.ic.zs().getSize();return this.Zu.getHeight(t)}}const Fn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Dn=(t,e)=>(ce(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),Bn=(t,e,i)=>{i&&kn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Pn={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}},Ln={background:void 0,setBackground(t){return{...this,background:t}}},Vn={sc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return Bn(o,r,n),o}},zn={sc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return Bn(o,r,n),o}};class _n extends Rn{constructor(){super(...arguments),this.ac=!0}Re(){return super.Re(),this}setMouseInteractions(t){return this.ac=t,this}getMouseInteractions(){return this.ac}Eu(){return[]}}class Nn extends _n{onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}Nu(t){return this.size=t,this}Gu(){return 0}Wu(){return 0}Yu(){return 0}Uu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return z}setStrokeStyle(){return this}getStrokeStyle(){return nt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class On extends Rn{constructor(){super(...arguments),this.R=new r.Eventer,this.Vu=0}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.Vu}setHighlight(t){return this.Vu=t,this.Eu().forEach((e=>e.ds(t))),this.R.emit("highlight",this,t),this.Bs.Ms(),this}}class Un extends On{}class Yn extends Un{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Bs=t,this.Qa=this.Bs.lc(this.renderingScale,mn.Simple).setVisible(!1).Be(z).De(nt),this.Fu(this.Qa)}uc(){const t=this.cc();if(t.length>2){const e=Je(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=ui(t,li(e.min,-1));return this.scale.pi(this.position,ui(s,di(li(ui(this.origin,u(1,1)),-.5),i)))})).map((t=>ct(t,this.scale,this.renderingScale)));this.Qa.Cl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Qa&&this.Qa.setVisible(!1),this.setContentSize(u(0,0))}Re(){return super.Re(),this.ji||this.uc(),this}zs(){return this.uc(),super.zs()}setVisible(t){return super.setVisible(t),this.Qa.setVisible(t),this}}const Gn=(t,e,i)=>t*(1-i)+e*i,Hn=(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=Gn(i.value,r.value,n),c=Gn(e.value,s.value,h);return Gn(c,u,l)},Wn={warm:t=>e=>R(60/(t-1)*e,.8,.8),cold:t=>e=>R(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>R(360/t*e,.8,.8),reverseSpectrum:t=>e=>R(360/t*(t-e),.8,.8),flatUI:t=>e=>R(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return R(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return R(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return R(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return R(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return R(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>R(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return R(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return R(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),R(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return R(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=>R(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Kn([{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=>Kn([{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=>Kn([{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=>Kn([{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=>Kn([{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=>Kn([{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)},Kn=(t,e,i)=>{const s=jn(e,i),[r,n]=$n(s,t),o=Xn(t[r]),h=Xn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Gn(o.h,h.h,a),s:Gn(o.s,h.s,a),v:Gn(o.v,h.v,a)};return R(l.h,l.s,l.v)},Xn=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},$n=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType),no={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},oo=s.Record({type:"linestyle",lineType:"dashed",pattern:no.DashedEqual,fillStyle:new U({color:C(255,255,255)}),thickness:1,patternScale:3});class ho extends oo{constructor(t){super({...t,lineType:"dashed"})}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setThickness(t){return"function"==typeof t?this.set("thickness",t(this.getThickness())):this.set("thickness",t)}getThickness(){return this.get("thickness")}N(){const t=this.getThickness();return t<0?1:t}setPattern(t){return"function"==typeof t?this.set("pattern",t(this.getPattern())):this.set("pattern",t)}getPattern(){return this.get("pattern")}setPatternScale(t){return"function"==typeof t?this.set("patternScale",t(this.getPatternScale())):this.set("patternScale",t)}getPatternScale(){return this.get("patternScale")}}const ao=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),lo=s.Record({type:"icon",width:void 0,height:void 0,dc:void 0,fc:Et,Ac:Et});class uo extends lo{constructor(t,e,i,s){super({...s,dc:t,fc:e,Ac:i})}dispose(){return this.Ac(this),this}setWidth(t){const e=this.set("width",t);return this.fc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.fc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.fc(i),i}oi(){if(!this.dc)return{x:0,y:0};const t=this.dc.width,e=this.dc.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 co=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),fo=s.Record({type:"glow",color:C(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class go extends fo{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 yo{constructor(t){this.gc=0,this.yc=0,this.mc=0,this.vc=!1,this.Sc=!0,this.xc=!1,this.bc={warningDisplayed:!1,expandEvents:[]},this.R=new r.Eventer,this.Sc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.Mc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this._c=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.wc=void 0!==(null==t?void 0:t.colors)&&t.colors,this.Cc=void 0!==(null==t?void 0:t.ids)&&t.ids,this.kc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.Tc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.Fc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.Ic=!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,y,m;if(s){u=new this.Fc(i);const e=t[0]&&t[0][s]instanceof Date;if(t[0]&&"string"==typeof t[0][s])for(let e=0;ea-1&&(this.gc=0,this.vc=!0),this.yc=Math.min(this.yc+1,a),this.mc+=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,y=void 0!==t.offsetSizes?t.offsetSizes:a,m=void 0!==t.offsetRotations?t.offsetRotations:a,p=this.Oc(!0),[A,x]=this.Nc(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),[S,v]=this.Nc(l,t.yValues,"y","ProgressiveY"===p||"RegressiveY"===p?o:void 0,"ProgressiveY"===p||"RegressiveY"===p?h:void 0,a),b=this.zc(i),{samplesCacheX:M,samplesCacheY:C,samplesCacheLookup:T,samplesCacheColors:R,samplesCacheIDs:w,samplesCacheSize:k,samplesCacheRotation:E,maxSampleCount:I,dataPattern:F,incomingDataReplacedCache:D}=this.Pc({appendCount:l,...0===x&&0===v&&0===a&&0===d&&0===f&&0===g&&0===y&&0===m?{incomingDataX:A,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!D&&F&&this.Sc&&this.Bc&&this.Lc){const t=A[x],i=S[v];if(!this.Rc(F,t,i)&&!this.xc)return this.Ec(this.Bc,this.Lc,vo(A,x,x+l),vo(S,v,v+l),vo(e,d,d+l),vo(b,f,f+l),vo(s,g,g+l),vo(r,y,y+l),vo(n,m,m+l),F),this}const B=I-this.gc,P=Math.min(l,B);if(P>0&&(D||(xo(M,A,x,P,this.gc),xo(C,S,v,P,this.gc),e&&T&&xo(T,e,d,P,this.gc),s&&w&&xo(w,s,g,P,this.gc),b&&R&&xo(R,b,f,P,this.gc),r&&k&&xo(k,r,y,P,this.gc),n&&E&&xo(E,n,m,P,this.gc)),this.Vc(this.gc,this.gc+P-1),this.gc+=P,this.gc>I-1&&(this.gc=0,this.vc=!0)),this.yc=Math.min(this.yc+P,I),this.mc+=P,this.Oc(),l-P>0){const t={xValues:A?vo(A,x+P,void 0):void 0,yValues:S?vo(S,v+P,void 0):void 0,lookupValues:e?vo(e,d+P,void 0):void 0,ids:s?vo(s,g+P,void 0):void 0,colors:b?vo(b,f+P,void 0):void 0,sizes:r?vo(r,y+P,void 0):void 0,rotations:n?vo(n,m+P,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.Bc||this.Lc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.Bc=this.Bc||new this.Fc(i),this.Bc.fill(t.x)),void 0!==t.y&&(this.Lc=this.Lc||new this.Fc(i),this.Lc.fill(t.y)),void 0!==t.lookupValue&&(this.Gc=this.Gc||new Float32Array(i),this.Gc.fill(t.lookupValue)),void 0!==t.color){const e=this.zc([t.color]);e&&(this.Wc=this.Wc||new Uint32Array(i),this.Wc.fill(e[0]))}return void 0!==t.size&&(this.Uc=this.Uc||new Float32Array(i),this.Uc.fill(t.size)),void 0!==t.rotation&&(this.Yc=this.Yc||new Float32Array(i),this.Yc.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,y=void 0!==e.offsetIds?e.offsetIds:l,m=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,A=this.zc(n),x=this.mc-1,S=void 0!==this.Hc?Math.max(this.mc-this.Hc,0):0,v=t+u-1,b=Math.max(t,S),M=Math.min(v,x),C=M-b+1;if(this.mc>0&&C>0){const{samplesCacheX:n,samplesCacheY:u,samplesCacheColors:c,samplesCacheIDs:d,samplesCacheLookup:x,samplesCacheSize:v,samplesCacheRotation:T}=this.Pc({appendCount:0}),R=n.length;if(void 0!==this.Hc&&this.vc&&this.mc%this.Hc!=0){const S=this.mc-this.mc%this.Hc,C=this.mc-1,w=this.mc-this.yc,k=S-1,E=Math.max(b,w),I=Math.min(M,k)-E+1;if(I>0){const S=E-t,b=mo(E,this.mc,R,this.gc);if(void 0!==e.x)for(let t=b;t0){const S=F-t,b=mo(F,this.mc,R,this.gc);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:y+e,offsetSizes:m+e,offsetRotations:p+e,count:T})}return this}alterSamplesByID(t,e){if(!this.Cc)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.$c;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.zc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.Fc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.Fc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.zc(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.yc,f=this.mc-1,g=Math.max(f-d+1,0);for(let d=0;ds[mo(t,this.mc,c,this.gc)])),m=mo(y,this.mc,c,this.gc);s[m]===i&&(void 0!==e.x&&this.Bc&&(this.Bc[m]=e.x),void 0!==e.y&&this.Lc&&(this.Lc[m]=e.y),void 0!==e.lookupValue&&this.Gc&&(this.Gc[m]=e.lookupValue),void 0!==e.size&&this.Uc&&(this.Uc[m]=e.size),void 0!==e.rotation&&this.Yc&&(this.Yc[m]=e.rotation),void 0!==r&&this.Wc&&(this.Wc[m]=r),n&&this.Bc&&(this.Bc[m]=n[d]),o&&this.Lc&&(this.Lc[m]=o[d]),h&&this.Gc&&(this.Gc[m]=h[d]),a&&this.Wc&&(this.Wc[m]=a[d]),l&&this.Uc&&(this.Uc[m]=l[d]),u&&this.Yc&&(this.Yc[m]=u[d]))}return this.R.emit("cleared"),this}clear(){return this.gc=0,this.yc=0,this.mc=0,this.vc=!1,this.R.emit("cleared"),this}getSampleCount(){return this.yc}getNextSampleIndex(){return this.mc}setMaxSampleCount(t){if("object"==typeof t){this.Xc&&this.offMaxSampleCountExceeded(this.Xc);const e=t.max,i=t.initial,s=t=>{const i=this.Hc||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.Xc=this.onMaxSampleCountExceeded(((t,e,i,r)=>{s(r)})),void 0===this.Hc&&(void 0!==i?this.setMaxSampleCount(i):this.setMaxSampleCount(Math.min(2*this.yc,void 0!==e?e:Number.MAX_SAFE_INTEGER)))}else if("number"==typeof t){const e=t;if(void 0!==this.Hc&&this.Hc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.Bc||!this.Lc)return this.Hc=e,this;if(e===this.Hc)return this;if(this.vc&&0!==this.gc)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.Hc=e,this.yct+e.count),0),n=new this.Fc(r),o=new this.Fc(r),h=this.wc?new Uint32Array(r):void 0,a=this._c?new Float32Array(r):void 0,l=this.Cc?new Uint32Array(r):void 0,u=this.kc?new Float32Array(r):void 0,c=this.Tc?new Float32Array(r):void 0;let d=0;for(const t of s)n.set(this.Bc.subarray(t.offset,t.offset+t.count),d),o.set(this.Lc.subarray(t.offset,t.offset+t.count),d),this.wc&&h&&this.Wc&&h.set(this.Wc.subarray(t.offset,t.offset+t.count),d),this._c&&a&&this.Gc&&a.set(this.Gc.subarray(t.offset,t.offset+t.count),d),this.Cc&&l&&this.$c&&l.set(this.$c.subarray(t.offset,t.offset+t.count),d),this.kc&&u&&this.Uc&&u.set(this.Uc.subarray(t.offset,t.offset+t.count),d),this.Tc&&c&&this.Yc&&c.set(this.Yc.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)}Nc(t,e,i,s,r,n){if(void 0===e){const e=this.Dc();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.Fc(t);for(let e=0;et){e=s;break}const l={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:e};this.xc=!0,this.appendSamples(l),this.xc=!1}else{const l=t.length,u=this.yc,f=this.mc-1,g=Math.max(f-u+1,0),y=Ao(d,g,f,(e=>t[mo(e,this.mc,l,this.gc)])),m=y-1,p=y+1,A=t[mo(y,this.mc,l,this.gc)],x=p<=this.mc-1?t[mo(p,this.mc,l,this.gc)]:void 0,S=void 0!==x&&x0&&!t){const t=void 0!==this.Hc&&this.vc?this.gc:0,i=this.yc-1,s=void 0!==this.Hc&&this.vc?0:void 0,r=void 0!==this.Hc&&this.vc?this.gc-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.Bc[n],r=this.Lc[n];for(let e=n+1;e<=o;e+=1){if(!1!==t){const i=this.Bc[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.Lc[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?Yr.ProgressiveX:t&&t.direction<0?Yr.RegressiveX:i&&i.direction>0?Yr.ProgressiveY:i&&i.direction<0?Yr.RegressiveY:void 0,this.Mc={autoDetectResult:e},e&&Ct.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 get clear this warning.`)}}if(e&&"ProgressiveX"!==e)throw new Error("LightningChart JS New XY rework beta features do not yet support other data patterns than ProgressiveX. This will be introduced in near future.");return e}Rc(t,e,i){const s=this.Dc();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.bc.expandEvents.push({timestamp:i}),this.bc.expandEvents.length>5)return Ct.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.bc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.Pc(t)}const i=new this.Fc(e);i.set(this.Bc),this.Bc=i;const s=new this.Fc(e);if(s.set(this.Lc),this.Lc=s,this._c){const t=new Float32Array(e);this.Gc&&t.set(this.Gc),this.Gc=t}if(this.Cc){const t=new Uint32Array(e);this.$c&&t.set(this.$c),this.$c=t}if(this.wc){const t=new Uint32Array(e);this.Wc&&t.set(this.Wc),this.Wc=t}if(this.kc){const t=new Float32Array(e);this.Uc&&t.set(this.Uc),this.Uc=t}if(this.Tc){const t=new Float32Array(e);this.Yc&&t.set(this.Yc),this.Yc=t}return this.gc=this.yc,{dataPattern:this.Oc(),samplesCacheX:this.Bc,samplesCacheY:this.Lc,samplesCacheLookup:this.Gc,samplesCacheIDs:this.$c,samplesCacheColors:this.Wc,samplesCacheSize:this.Uc,samplesCacheRotation:this.Yc,maxSampleCount:e}}if(i>4*e){const t=new this.Fc(e);t.set(this.Bc.subarray(0,this.yc)),this.Bc=t;const i=new this.Fc(e);if(i.set(this.Lc.subarray(0,this.yc)),this.Lc=i,this._c){const t=new Float32Array(e);this.Gc&&t.set(this.Gc.subarray(0,this.yc)),this.Gc=t}if(this.Cc){const t=new Uint32Array(e);this.$c&&t.set(this.$c.subarray(0,this.yc)),this.$c=t}if(this.wc){const t=new Uint32Array(e);this.Wc&&t.set(this.Wc.subarray(0,this.yc)),this.Wc=t}if(this.kc){const t=new Float32Array(e);this.Uc&&t.set(this.Uc.subarray(0,this.yc)),this.Uc=t}if(this.Tc){const t=new Float32Array(e);this.Yc&&t.set(this.Yc.subarray(0,this.yc)),this.Yc=t}return{dataPattern:this.Oc(),samplesCacheX:this.Bc,samplesCacheY:this.Lc,samplesCacheLookup:this.Gc,samplesCacheIDs:this.$c,samplesCacheColors:this.Wc,samplesCacheSize:this.Uc,samplesCacheRotation:this.Yc,maxSampleCount:e}}return{dataPattern:this.Oc(),samplesCacheX:this.Bc,samplesCacheY:this.Lc,samplesCacheLookup:this.Gc,samplesCacheIDs:this.$c,samplesCacheColors:this.Wc,samplesCacheSize:this.Uc,samplesCacheRotation:this.Yc,maxSampleCount:i}}return t.appendCount+this.yc>this.Hc&&this.R.emit("maxSampleCountExceeded",this,this.yc,this.Hc,this.yc+t.appendCount),this.Bc=this.Bc||new this.Fc(this.Hc),this.Lc=this.Lc||new this.Fc(this.Hc),this.Gc=this.Gc||(this._c?new Float32Array(this.Hc):void 0),this.$c=this.$c||(this.Cc?new Uint32Array(this.Hc):void 0),this.Wc=this.Wc||(this.wc?new Uint32Array(this.Hc):void 0),this.Uc=this.Uc||(this.kc?new Float32Array(this.Hc):void 0),this.Yc=this.Yc||(this.Tc?new Float32Array(this.Hc):void 0),{dataPattern:this.Oc(),samplesCacheX:this.Bc,samplesCacheY:this.Lc,samplesCacheLookup:this.Gc,samplesCacheIDs:this.$c,samplesCacheColors:this.Wc,samplesCacheSize:this.Uc,samplesCacheRotation:this.Yc,maxSampleCount:this.Hc}}Jc(){if(!this.Bc||!this.Lc||0===this.yc)return;if(void 0===this.Hc)return this.mc>0?{x:this.Bc[0],y:this.Lc[0]}:void 0;if(!this.vc)return{x:this.Bc[0],y:this.Lc[0]};let t=this.gc-this.yc;return t<0&&(t+=this.Hc),{x:this.Bc[t],y:this.Lc[t]}}Dc(){if(!this.Bc||!this.Lc||0===this.yc)return;if(void 0===this.Hc){const t=this.yc-1;return t>=0?{x:this.Bc[t],y:this.Lc[t]}:void 0}let t=this.gc-1;return t<0&&(t+=this.Hc),{x:this.Bc[t],y:this.Lc[t]}}Kc(t){if(!this.Bc||!this.Lc)return;const e=this.Bc.length,i=this.yc,s=this.mc-1,r=Math.max(s-i+1,0)+t,n=mo(r,this.mc,e,this.gc);return{x:this.Bc[n],y:this.Lc[n],lookupValue:this._c&&this.Gc?this.Gc[n]:void 0,id:this.Cc&&this.$c?this.$c[n]:void 0,color:this.wc&&this.Wc?this.Wc[n]:void 0,size:this.kc&&this.Uc?this.Uc[n]:void 0,rotation:this.Tc&&this.Yc?this.Yc[n]:void 0,iSample:r}}qc(t,e,i,s){const r=this.Oc(),n=this.Bc,o=this.Lc;if(!n||!o)return;const h=(t,e)=>({x:n[t],y:o[t],lookupValue:this._c&&this.Gc?this.Gc[t]:void 0,id:this.Cc&&this.$c?this.$c[t]:void 0,color:this.wc&&this.Wc?this.Wc[t]:void 0,size:this.kc&&this.Uc?this.Uc[t]:void 0,rotation:this.Tc&&this.Yc?this.Yc[t]:void 0,iSample:e}),a=n.length,l=this.yc,u=this.mc-1,c=Math.max(u-l+1,0);if(r){const i=this.Jc(),s=this.Dc();if(!(i&&s&&this.Bc&&this.Lc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.Bc:this.Lc,d="x"===o?this.Bc:this.Lc,f=t[n],g=Math.min(i[n],s[n]),y=Math.max(i[n],s[n]);if(fy)return;const m=Ao(f,c,u,(t=>l[mo(t,this.mc,a,this.gc)])),p=mo(m,this.mc,a,this.gc);if(!e)return h(p,m);const A=m-1,x=m+1,S=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?x<=u?x:void 0:A>=c?A:void 0;if(void 0===S)return;const v=mo(S,this.mc,a,this.gc),b=l[p],M=d[p],C=l[v],T=d[v],R=Math.min(b,C),w=R===b?M:T,k=Math.max(b,C),E=R===b?m:S,I=(f-R)/(k-R),F=Gn(w,k===b?M:T,I);return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:F,iSample:E+I}:{x:F,y:f,iSample:E+I}}let d,f=Number.MAX_VALUE;const g=ct(t,i,s),y=this.yc-1;for(let t=0;t<=y;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ut(e,i.x,s.x),o=ut(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,po=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=i.length,l=s-1,u=Math.max(l-r+1,0),c=Ao(t,u,l,(t=>i[mo(t,s,a)])),d=Ao(e,u,l,(t=>i[mo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),y=mo(f,s,a),m=mo(g,s,a);return y>m?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:a-y},{offset:0,count:m+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:m-y+1}]}},Ao=(t,e,i,s)=>{const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t{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),vo=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class bo extends On{constructor(t,e,i,s,r){super(t,e,i,s,r),this.va="label",this.Qa=this.Bs.Gr(this.renderingScale).yr(this.va).Be(z).Or(Ie).Nr(Ie),this.setMargin(5),this.Fu(this.Qa)}Eu(){return[this.Qa]}setFillStyle(t){return this.Qa.Be(t),this.Bs.Ms(),this}getFillStyle(){return this.Qa.Xh()}Re(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ct(t,this.scale,this.renderingScale);return this.Qa.Ee(i),this}zs(){this.Qa.zs();const t=0===this.va.length?u(0,0):this.Qa.ed();return this.setContentSize(t),super.zs()}setText(t){return this.va=t,this.Qa.yr(this.va),this.Bs.Ms(),this}getText(){return this.va}setFont(t){return this.Qa.Qh(t),this.Bs.Ms(),this}getFont(){return this.Qa.Zh()}setTextRotation(t){return this.Qa.Jh(t),this.Bs.Ms(),this}getTextRotation(){return this.Qa.Kh()}}const Mo={...Pn,...Vn,uiElement:bo};class Co extends Un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.hd=!1,this.fitTo=this.Nu.bind(this),this.setSize=this.fitTo,this.Qa=this.Bs.lc(e).Be(z).De(nt),this.Fu(this.Qa)}Eu(){return[this.Qa]}setFillStyle(t){return this.Qa.Be(t),this.Bs.Ms(),this}getFillStyle(){return this.Qa.Xh()}setStrokeStyle(t){return this.Qa.De(t),this.Bs.Ms(),this}getStrokeStyle(){return this.Qa.mo()}Re(){const t=Je([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ct(t,this.scale,this.renderingScale))));return this.hd?this.Qa.Cl([{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.Cl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Nu(t){return this.setContentSize(t),this.Bs.Ms(),this}Gu(){return 0}Wu(){return 0}Yu(){return 0}Uu(){return 0}}class To extends Un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.rd=u(0,0),this.Qa=t.nd(e).cu(0).Ye(360).Be(z).De(nt),this.Fu(this.Qa)}Eu(){return[this.Qa]}setFillStyle(t){return this.Qa.Be(t),this.Bs.Ms(),this}getFillStyle(){return this.Qa.Xh()}setStrokeStyle(t){return this.Qa.De(t),this.Bs.Ms(),this}getStrokeStyle(){return this.Qa.mo()}Re(){const t=this.getSize(e.UISpace.Content).x/2;return this.Qa.fu(t*this.renderingScale.Wi().x).Au(t*this.renderingScale.Wi().y).Ee(ct(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).pu(255).zs(),this}Nu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.rd=t,this.Bs.Ms(),this}Gu(){return(this.getSize(e.UISpace.Content).x-this.rd.x)/2}Wu(){return(this.getSize(e.UISpace.Content).x-this.rd.x)/2}Yu(){return(this.getSize(e.UISpace.Content).y-this.rd.y)/2}Uu(){return(this.getSize(e.UISpace.Content).y-this.rd.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.rd=t,this}}class Ro extends Yn{constructor(t,e,i,s,r){super(t,e,i,mn.Simple,s,r),this.od=p(u(0,0)),this.ad=!1,this.Bs=t,this.uc()}cc(){const t=this.od.C();if(this.ad){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.od.C().x*this.od.C().x/4+this.od.C().y*this.od.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=ui(r,ui(i,s)),o=ui(n,ui(s,li(i,-1)));return[r,n,o,ci(o,ui(i,s))]}Eu(){return[this.Qa]}setFillStyle(t){return this.Qa.Be(t),this.Bs.Ms(),this}getFillStyle(){return this.Qa.Xh()}setStrokeStyle(t){return this.Qa.De(t),this.Bs.Ms(),this}getStrokeStyle(){return this.Qa.mo()}Nu(t){return this.od._(t),this.ad=!1,this.Bs.Ms(),this}Gu(){return this.ad?0:(this.getSize(e.UISpace.Content).x-this.od.C().x)/2}Wu(){return this.ad?0:(this.getSize(e.UISpace.Content).x-this.od.C().x)/2}Yu(){return this.ad?0:(this.getSize(e.UISpace.Content).y-this.od.C().y)/2}Uu(){return this.ad?0:(this.getSize(e.UISpace.Content).y-this.od.C().y)/2}fitTo(t){return this.od._(t),this.ad=!0,this.Bs.Ms(),this}}class wo extends Yn{constructor(t,i,s,r,n){super(t,i,s,mn.Simple,r,n),this.ld=p(u(0,0)),this.ud=p(10),this.dd=p(void 0),this.Qu=p(e.UIDirections.Right),this.uc()}Eu(){return[this.Qa]}setFillStyle(t){return this.Qa.Be(t),this.Bs.Ms(),this}getFillStyle(){return this.Qa.Xh()}setStrokeStyle(t){return this.Qa.De(t),this.Bs.Ms(),this}getStrokeStyle(){return this.Qa.mo()}setDirection(t){return this.Qu._(t),this.Bs.Ms(),this}getDirection(){return this.Qu.C()}setPointerLength(t){return this.ud._(t),this.Bs.Ms(),this}getPointerLength(){return this.ud.C()}setPointerAngle(t){return this.dd._(t),this.Bs.Ms(),this}getPointerAngle(){let t=this.dd.C();if(void 0===t){const e=this.fd();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)}Nu(t){return this.ld._(t),this.Bs.Ms(),this}Ad(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}gd(){return Zt(this.Qu.C())?this.ld.C().x:this.ld.C().y}fd(){return Zt(this.Qu.C())?this.ld.C().y:this.ld.C().x}Gu(){switch(this.Qu.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.Ad()-this.fd());default:return 0}}Wu(){switch(this.Qu.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.Ad()-this.fd());default:return 0}}Yu(){switch(this.Qu.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ad()-this.fd());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}Uu(){switch(this.Qu.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ad()-this.fd());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}cc(){const t=$t(this.Qu.C()),e=hi(u(0,0),t),i=this.getPointerLength(),s=this.Ad(),r=this.gd(),n=this.fd();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ui(ui(o,li(t,-i)),li(e,s/2)),a=ui(h,li(e,(n-s)/2)),l=ui(a,li(t,-r)),c=ui(ui(o,li(t,-i)),li(e,-s/2)),d=ui(c,li(e,-(n-s)/2)),f=ui(d,li(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:It(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class ko extends On{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Nu.bind(this),this.setSize=this.fitTo,this.pd=new yo,this.Qa=this.Bs.Sd(e).We(nt).vd(z).md(z).yd(this.pd),this.Fu(this.Qa)}Eu(){return[this.Qa]}setShape(t){return this.Qa.xd(t),this}getShape(){return this.Qa.bd()}setRotation(t){return this.Qa.Md(t),this}getRotation(){return this.Qa._d()}setFillStyle(t){return this.Qa.md(t),this.Bs.Ms(),this}getFillStyle(){return this.Qa.wd()}Re(){const t=ct(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.pd.clear(),i>0){const e=this.Qa.bd(),s=this.Qa.wd(),r=co(e)&&e,n=ro(s)&&s;if(r){const t=i/r.oi().y;this.Qa.Cd(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.Qa.Cd(e)}}else this.Qa.Cd(i);this.pd.appendSample(t)}return this}Nu(t){return this.setContentSize(t),this.Bs.Ms(),this}Gu(){return 0}Wu(){return 0}Yu(){return 0}Uu(){return 0}}const Eo={...Pn,...Vn,uiElement:ko};class Io extends _n{setSize(t){return this.setContentSize(t),this.Bs.Ms(),this}}class Fo extends wn{constructor(){super(...arguments),this.kd=[],this.Td=0,this.Fd=t=>{const e=this.kd.indexOf(t);e>=0&&this.kd.splice(e,1)}}getMembers(){return this.kd}getMemberCount(){return this.kd.length}setMinimumSize(t){return this.Id=t,this.Bs.Ms(),this}getMinimumSize(){return this.Id}addElement(t,e=-1){const i=t.sc(this.Bs,this.renderingScale,this.scale,this.Fd,this.ts,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.kd.splice(e,0,i):this.kd.push(i),i.setVisible(this.getVisible()),this.Fu(i),this.ji&&(pe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.kd.slice().forEach(kt),this}setVisible(t){return super.setVisible(t),this.kd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Io)),0),s=i>0?(this.size.x-this.Td)/i:0;return this.kd.reduce(((e,i)=>i instanceof Io?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)).Re().getPosition(u(1,0)).x),t.x),this}zs(){for(let t=0;tt+ +(e instanceof Io)),0),s=i>0?(this.size.y-this.Td)/i:0;return this.kd.reduce(((e,i)=>i instanceof Io?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)).Re().getPosition(u(0,-1)).y),t.y),this}zs(){for(let t=0;t{const i={},s=`stylable${t}s`;return i[s]=e,i[`set${t}FillStyle`]=function(t){return this[s].forEach((e=>e.setFillStyle(t))),this},i[`get${t}FillStyle`]=function(){return this[s][0].getFillStyle()},i[`set${t}Font`]=function(t){return this[s].forEach((e=>e.setFont(t))),this},i[`get${t}Font`]=function(){return this[s][0].getFont()},i[`set${t}Rotation`]=function(t){return this[s].forEach((e=>e.setTextRotation(t))),this},i[`get${t}Rotation`]=function(){return this[s][0].getTextRotation()},i},Uo=Oo("Text",[]),Yo={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()}},Go={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},Ho={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()}},Wo={...Pn,...Ln,background:Co,sc(t,e,i,s,r,n){const o=new Do(t,e,i,this.background,s,r),h=o.addElement(Mo,void 0),a=Object.assign(o,No,{setTextLabel:h},Uo,{stylableTexts:[h]});return Bn(a,r,n),this.applyStylers(a,r)}}.addStyler(Fn),Ko={...Pn,...Ln,background:wo,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},sc(t,i,s,r,n,o){const h=this.direction,a=new Do(t,i,s,this.background,r,n),l=a.addElement(Mo,void 0),u=a.getBackground().setDirection(h),c=Object.assign(a,No,{setTextLabel:l},Uo,{stylableTexts:[l]},Ho,{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.hc="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))),Bn(c,n,o),this.applyStylers(c,n)}};class Xo extends Rn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Vs=!1,this.R=new r.Eventer,this.Dd=z,this.Bd=z,this.getOn=()=>this.Vs,this.Bd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle,this.Ld=this.Fu(new ko(this.Bs,this.renderingScale,this.scale,Et,o).setShape(s)).setFillStyle(this.Bd)}Eu(){return[...this.Ld.Eu()]}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setOn(t){return this.Vs=t,this.Ld.setFillStyle(t?this.Dd:this.Bd),this.Bs.Ms(),this}setOffFillStyle(t){return this.Bd="function"==typeof t?t(this.Bd):t,this.Vs||this.Ld.setFillStyle(this.Bd),this}getOffFillStyle(){return this.Bd}setSize(t){return this.Ld.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Ld.getSize()}setOnFillStyle(t){return this.Dd="function"==typeof t?t(this.Dd):t,this.Vs&&this.Ld.setFillStyle(this.Dd),this}getOnFillStyle(){return this.Dd}setButtonShape(t){return this.Ld.setShape(t),this.Bs.Ms(),this}getButtonShape(){return this.Ld.getShape()}Re(){return super.Re(),this.Ld.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Re(),this}zs(){const t=this.Ld.zs().getSize();return this.setContentSize(t),super.zs()}dispose(){return super.dispose(),this.Ld.dispose(),this}setMouseInteractions(t){return this.Ld.setMouseInteractions(t),this}getMouseInteractions(){return this.Ld.getMouseInteractions()}setHighlight(t){const e=be(t);return this.Ld.setHighlight(e),this.R.emit("highlight",this,t),this.Bs.Ms(),this}getHighlight(){return this.Ld.getHighlight()}}const jo={...Pn,uiElement:Xo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},sc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return Bn(o,r,n),o}},$o={...Pn,...Ln,background:Co,buttonBuilder:jo,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},sc(t,i,s,r,n,o){const h=new Do(t,i,s,this.background,r,n),a=h.addElement(zo);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(zo);u.addGap();const c=u.addElement(Mo);u.addGap(),h.addGap();const d=Object.assign(h,No,{setTextLabel:c},Uo,{stylableTexts:[c]},Yo,{button:l},Go);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}),Bn(d,n,o),this.applyStylers(d,n)}}.addStyler(Fn).addStyler(Dn);class Zo extends Rn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Rd=[],this.Ed=2,this.zd="",this.Vd=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Fi(t.value,e.min,e.max),this.Od=0,this.Nd=0,this.Gd=!1,this.Bs=t,this.Wd=n,this.Ud=this.Fu(t.Le(e).De(nt)),this.Yd=this.Fu(t.Gr(e).Be(r.uiTextFillStyle).Qh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Hd=140,this.$d=25):(this.Hd=160,this.$d=15)}Eu(){return[this.Ud,this.Yd]}Xd(t){this.jd=t;const e=Jo(t,"vertical"===this.Wd?0:90,this.Gd);return this.Ud.Be(e),this.Bs.Ms(),this}Zd(){return this.jd}Qd(t){return this.Hd=t,this.Bs.Ms(),this}Jd(){return this.Hd}Kd(t){return this.$d=t,this.Bs.Ms(),this}qd(){return this.$d}tf(t){return this.zd=t,this.Bs.Ms(),this}if(){return this.zd}sf(t){return this.Vd=t,this.Bs.Ms(),this}setLUTDisplayProportionalSteps(t){if(this.Gd=t,this.jd){const t=Jo(this.jd,"vertical"===this.Wd?0:90,this.Gd);this.Ud.Be(t)}return this.Bs.Ms(),this}getLUTDisplayProportionalSteps(){return this.Gd}setFillStyle(t){return this.Yd.Be(t),this.Bs.Ms(),this}getFillStyle(){return this.Yd.Xh()}setFont(t){return this.Yd.Qh(t),this.Bs.Ms(),this}getFont(){return this.Yd.Zh()}setTextRotation(t){return this.Nd=t,this.Yd.Jh(t),this.Bs.Ms(),this}getTextRotation(){return this.Yd.Kh()}Re(){var t,i,s,r;if(super.Re(),this.ji||!this.getVisible())return this;const n=this.jd;if(n){const o=this.renderingScale.Wi(),h=n.min,a=n.max;if("vertical"===this.Wd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ui(s,{x:this.Ud.oi().x+this.Ed*o.x,y:0}),l={x:r.x,y:r.y+(this.zd.length>0?this.Od*o.y+this.Yd.oi().y:0)+.5*((null===(t=this.Rd[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.Rd[this.Rd.length-1])||void 0===i?void 0:i.oi().y)||0)};this.Ud.Ee({x:s.x,y:l.y}),this.Yd.$a({x:-1,y:-1}).Ee(r),n.getSteps().forEach(((t,e)=>{const i=Qe(l,u,this.Gd?!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.Rd[e].$a({x:-1,y:0}).Ee(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.Rd.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ui(t,{x:.5*((null===(s=this.Rd[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.Rd[this.Rd.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.zd.length>0?this.Od*o.x+this.Yd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Ed*o.y};this.Ud.Ee(f),this.Yd.$a({x:1,y:1}).Ee(c),n.getSteps().forEach(((t,e)=>{const i=Qe(u,d,this.Gd?!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.Rd[e].$a({x:0,y:1}).Ee(i)}))}}return this}zs(){if(this.jd&&this.getVisible()){const t=this.jd.getSteps();for(let e=this.Rd.length;eMath.max(t,e.zs().ed().x)),0),this.Yd.zs().ed().x),s=(this.zd.length>0?this.Od+this.Yd.zs().ed().y:0)+e+.5*this.Rd[0].zs().ed().y+.5*this.Rd[this.Rd.length-1].zs().ed().y;this.setContentSize({x:i,y:s})}else{const t=this.Hd,e=this.$d;this.Ud.it({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.zd.length>0?this.Od+this.Yd.zs().ed().x:0,.5*this.Rd[this.Rd.length-1].zs().ed().x),s=t+.5*this.Rd[0].zs().ed().x+i,r=e+this.Ed+this.Rd.reduce(((t,e)=>Math.max(t,e.zs().ed().y)),0);this.setContentSize({x:s,y:r})}}else this.Rd.forEach((t=>t.dispose())),this.Rd.length=0,this.Yd.setVisible(!1),this.Ud.setVisible(!1),this.setContentSize({x:0,y:0});return super.zs()}dispose(){return super.dispose(),this.Ud.dispose(),this.Rd.forEach(kt),this.Yd.dispose(),this}setMouseInteractions(t){return this.Ud.setMouseInteractions(t),this}getMouseInteractions(){return this.Ud.getMouseInteractions()}}const Qo={lutElement:{},setLUT(t){return this.lutElement.Xd(t),this},getLUT(){return this.lutElement.Zd()},setLUTLength(t){return this.lutElement.Qd(t),this},getLUTLength(){return this.lutElement.Jd()},setLUTThickness(t){return this.lutElement.Kd(t),this},getLUTThickness(){return this.lutElement.qd()},setLookUpUnit(t){return this.lutElement.tf(t),this},getLookUpUnit(){return this.lutElement.if()},setLUTStepValueFormatter(t){return this.lutElement.sf(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},qo={...Pn,...Ln,background:Co,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},sc(t,e,i,s,r,n){const o=new Bo(t,e,i,this.background,s,r),h=o.addElement({sc:()=>new Zo(t,e,i,Et,r,this.alignment)}),a=Object.assign(o,Uo,{stylableTexts:[h]},Qo,{lutElement:h});return Bn(a,r,n),this.applyStylers(a,r)}}.addStyler(Fn),Jo=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new it({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 Zo(t,i,s,Et,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,No,{setTextLabel:c},Uo,{stylableTexts:[c,d]},Oo("LUTText",[d]),Yo,{button:l},Qo,{lutElement:d},Go);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(Fn).addStyler(Dn),eh={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 oa?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.Zd&&t.Zd(),n=t.Ps&&t.Ps(),o=void 0!==s&&s;let h=i;if(!h){let t=r?th.setAlignment(this.alignment):$o;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.ef().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof oa)).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}},ih={alignment:"vertical",layoutBuilder:zo,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?_o:zo}},getAlignment(){return this.alignment},titleBuilder:Wo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},sh={...Pn,...Ln,...ih,background:Co,sc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).sc(t,e,i,s,r,!1);let h=Object.assign(o,eh,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.ji});h.entries=[];const a=h.addElement("horizontal"===this.alignment?zo:_o),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}),Bn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class rh extends Rn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.hf=10,this.rf=e.UIDirections.Up,this.nf=0,this.hc="major",this.va=this.Fu(t.Gr(this.renderingScale).Or(Ie).Nr(Ie)),this.Ge=this.Fu(t.Ue(this.renderingScale))}Eu(){return[this.va]}Re(){if(super.Re(),this.ji)return this;const t=ct(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.rf===e.UIDirections.Right?-this.hf:this.rf===e.UIDirections.Left?this.hf:0,y:this.rf===e.UIDirections.Up?-this.hf:this.rf===e.UIDirections.Down?this.hf:0}),s=this.renderingScale.pi(i,{x:this.rf===e.UIDirections.Right?-this.nf:this.rf===e.UIDirections.Left?this.nf:0,y:this.rf===e.UIDirections.Up?-this.nf:this.rf===e.UIDirections.Down?this.nf:0});return this.Ge.He(t).Ye(i),this.va.Ee(s).$a(this.rf===e.UIDirections.Up?{x:0,y:1}:this.rf===e.UIDirections.Down?{x:0,y:-1}:this.rf===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}zs(){const t=this.Ge.mu().getThickness();return this.size=this.rf===e.UIDirections.Left||this.rf===e.UIDirections.Right?{x:this.hf+this.nf+this.va.zs().ed().x,y:t}:{y:this.hf+this.nf+this.va.zs().ed().y,x:t},super.zs()}dispose(){return super.dispose(),this.va.dispose(),this.Ge.dispose(),this}setVisible(t){return super.setVisible(t),this.va.setVisible(t),this.Ge.setVisible(t),this}setMouseInteractions(t){return this.va.setMouseInteractions(t),this.Ge.setMouseInteractions(t),this}getMouseInteractions(){return this.va.getMouseInteractions()}getText(){return this.va.Cr()}setTextFillStyle(t){return this.va.Be(t),this.Bs.Ms(),this}getTextFillStyle(){return this.va.Xh()}setTextFont(t){return this.va.Qh(t),this}setTextRotation(t){return this.va.Jh(t),this}getTextRotation(){return this.va.Kh()}getTextFont(){return this.va.Zh()}setText(t){return this.va.yr(t),this.Bs.Ms(),this}setDirection(t){return this.rf=t,this.Bs.Ms(),this}getDirection(){return this.rf}setPointerLength(t){return this.hf=t,this.Bs.Ms(),this}getPointerLength(){return this.hf}setTickLabelPadding(t){return this.nf=t,this.Bs.Ms(),this}getTickLabelPadding(){return this.nf}setTickStyle(t){return this.Ge.We(t),this.Bs.Ms(),this}getTickStyle(){return this.Ge.mu()}}const nh={...Pn,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},sc(t,e,i,s,r,n){const o=this.direction,h=new rh(t,e,i,s,r);return Bn(h,r,n),h.setDirection(o),this.applyStylers(h,r)}}.addStyler(Fn),oh=nh.addStyler(((t,e)=>(t.hc="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)))),hh=nh.addStyler(((t,e)=>(t.hc="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)))),ah=$o.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),lh=sh.setAlignment("horizontal"),uh=sh.setAlignment("vertical"),ch={TextBox:Wo,CheckBox:$o,ButtonBox:ah,PointableTextBox:Ko,AxisTickMajor:oh,AxisTickMinor:hh,LUTRange:qo},dh={HorizontalLegendBox:lh,VerticalLegendBox:uh},fh={af:0,lf:1,uf:2,cf:3,df:4,ff:5,Af:6,gf:7,pf:8,yf:9,mf:10,vf:11,Sf:12,xf:13,bf:14,Mf:15,_f:16,wf:17,Cf:18,kf:19,Tf:20,Ff:21,If:22,Pf:23};class gh extends ar{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Df=r}}class yh extends hr{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,m,p,A){var x,S,v;super(d,c,a,m,p,{numeric:c.getWidth({x:m.xAxisNumericTicks,y:m.yAxisNumericTicks}),datetime:c.getWidth({x:m.xAxisDateTimeTicks,y:m.yAxisDateTimeTicks}),time:c.getWidth({x:m.xAxisTimeTicks,y:m.yAxisTimeTicks})},A),this.Bf=new Map,this.Lf=void 0,this.Rf=0,this.Ef=[],this.zf=[],this.ah=Ws.fitting,this.Vf=!0,this.Of=8,this.Nf=void 0,this.Gf=void 0,this.Wf=20,this.Uf=1,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=!0,this.jf=!0,this.Zf=!0,this.Qf=!0,this.Jf=!0,this.Kf=!0,this.qf=!0,this.tA=this.zh.defaultDragMouseStyle,this.iA=this.zh.defaultDragMouseStyle,this.sA=this.zh.defaultDragMouseStyle,this.eA=this.zh.defaultDragMouseStyle,this.hA=this.zh.defaultDragMouseStyle,this.R=new r.Eventer,this.rA=[],this.nA=t=>{const e=this.zf.indexOf(t);e>=0&&this.zf.splice(e,1)},this.oA=t=>(this.zf.indexOf(t)<0&&this.zf.push(t),this.nA),this.aA="center",this.Rt=(t,e)=>this.R.emit("axisAreaTouch",this,e),this.lA=ee(this.rA),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.Hd={relative:1},this.uA=0,this.cA=0,this.dA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().oc()):t,this.fA=t=>{const e=this.Ef.indexOf(t);-1!==e&&this.Ef.splice(e,1)},this.AA=(t,e)=>{this.R.emit("axisAreaDoubleClick",this,e),this.Xf&&(this.setStopped(!1),Qt(e))},this.gA=t=>{this.R.emit("axisAreaMouseEnter",this),(this.Hf||this.Yf||this.$f||this.Xf)&&this.pA(t)},this.yA=t=>{this.mA(t),this.R.emit("axisAreaMouseLeave",this)},this.vA=(t,e,i)=>{var s,r;this.R.emit("axisAreaMouseDragStart",this,e,i);const n=Bt(null===(s=this.chart.SA.qn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Bt(null===(r=this.chart.SA.qn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Hf?(this.xA(t),Qt(e)):i===n&&this.Yf&&(this.bA(t,h),Qt(e))},this.MA=(t,e,i,s,r)=>{var n,o;this.R.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Bt(null===(n=this.chart.SA.qn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Bt(null===(o=this.chart.SA.qn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Hf?(this._A(t,r),Qt(e)):i===h&&this.Yf&&(this.wA(t,s,l,r),Qt(e))},this.CA=(t,e,i,s)=>{var r,n;this.R.emit("axisAreaMouseDragStop",this,e,i,s);const o=Bt(null===(r=this.chart.SA.qn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Bt(null===(n=this.chart.SA.qn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Hf?(this.kA(t),Qt(e)):i===o&&this.Yf&&(this.TA(t,s,a),Qt(e)),t.getIsUnderMouse()&&(this.Hf||this.Yf||this.$f||this.Xf)&&this.pA(t)},this.FA=(t,e)=>{if(this.R.emit("axisAreaMouseWheel",this,e),this.$f){this.setStopped(!0);const t=this.zh.getWidth(this.IA.cs.Ve(e.clientX,e.clientY)),i=this.At.dt(t);this.zoom(i,me(e)),Qt(e)}},this.PA=(t,e)=>this.R.emit("axisAreaMouseClick",this,e),this.DA=(t,e)=>this.R.emit("axisAreaMouseDown",this,e),this.BA=(t,e)=>this.R.emit("axisAreaMouseUp",this,e),this.LA=(t,e)=>this.R.emit("axisAreaMouseMove",this,e),this.RA=(t,e,i)=>{this.R.emit("axisAreaTouchStart",this,i),this.Yf&&(this.pA(t),this.bA(t,e),Qt(i))},this.EA=(t,e,i,s,r)=>{this.R.emit("axisAreaTouch",this,r),this.Yf&&(this.wA(t,e,i,s),Qt(r))},this.zA=(t,e,i,s)=>{this.R.emit("axisAreaTouchEnd",this,s),this.Yf&&(this.TA(t,e,i),this.mA(t),Qt(s))},this.VA=(t,e,i,s)=>{(this.Hf||this.$f)&&(this.pA(t),this.xA(t),Qt(s))},this.OA=(t,e,i,s,r,n)=>{if(this.Hf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this._A(t,e),Qt(n)}if(this.$f){const t=this.IA.cs.Ve(e.x,e.y),o=this.IA.cs.Ve(i.x,i.y),h=Math.abs(this.zh.getWidth(ci(t,s))-this.zh.getWidth(ci(o,r)))-Math.abs(this.zh.getWidth(t)-this.zh.getWidth(o)),a=this.At.pi(this.Wh,-h),l=this.At.pi(this.Uh,h);this.hr(a,l,!0),Qt(n)}},this.NA=(t,e,i,s)=>{(this.Hf||this.$f)&&(this.kA(t),this.mA(t),Qt(s))},this.GA=(t,e)=>{(this.jf||this.Zf)&&this.WA(t)},this.UA=(t,e)=>{this.YA(t)},this.HA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.jf&&this.$A(t,s)},this.XA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.jf&&this.jA(t,n,s,r)},this.ZA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.jf&&this.QA(t,n,s,r)},this.JA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.jf||this.Zf)&&this.KA(t,r,s),(this.jf||this.Zf)&&this.WA(t)},this.qA=(t,e)=>{this.Zf&&(this.setStopped(!0),this.zoom(this.Wh,me(e)),Qt(e))},this.tg=(t,e)=>{this.Zf&&(this.setStopped(!0),this.zoom(this.Uh,me(e)),Qt(e))},this.ig=(t,e,i)=>{this.jf&&(this.WA(t),this.$A(t,e),Qt(i))},this.sg=(t,e,i,s,r)=>{this.jf&&(this.jA(t,e,i,s),Qt(r))},this.eg=(t,e,i,s,r)=>{this.jf&&(this.QA(t,e,i,s),Qt(r))},this.hg=(t,e,i,s)=>{this.jf&&(this.KA(t,e,i),this.YA(t),Qt(s))},this.rg=t,this.IA=i,this.ng=n,this.og=o,this.chart=d,this.ag=g,this.lg=s,this.es=h,"logarithmic"===A.type&&this.chart.cs.Zn(fh.kf),y(this,this.oA),a.ug=this,this.cg=f,this.dg=this.cg>50?1:-1,this.Ag=(v=this.zh.toPoint(0,-this.dg),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.gg=l,this.pg=this.At instanceof Pi?(new zi).Ri(this.zh.toVec2(this.At,this.gg)):(new _i).Ri(this.zh.toVec2(this.At,this.gg)),this.yg=this.chart.mg,this.vg=(new zi).Ri(this.zh.toVec2(this.zh.getWidth(this.yg),this.gg)),this.Sg=this.IA.Ue(this.pg).setMouseInteractions(!1),this.xg=this.IA.Ue(this.pg).setMouseInteractions(!1),this.bg=this.IA.Ue(this.pg).setMouseInteractions(!1),this.Mg=this.lg.Le(this.yg).Be(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).De(nt).ea(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this._g=this.lg.Le(this.yg).Be(c.getWidth({x:m.xAxisZoomingBandFillStyle,y:m.yAxisZoomingBandFillStyle})).De(c.getWidth({x:m.xAxisZoomingBandStrokeStyle,y:m.yAxisZoomingBandStrokeStyle})),this.wg=this.lg.Le(this.yg).Be(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).De(nt).ea(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.Cg=this.lg.Le(this.yg).Be(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).De(nt).ea(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.wh=this.lg.Gr(this.pg).setMouseInteractions(!1).Jh(this.zh.getTitleTextRotation(this.dg)).Nr(Ie).Or(Ie),this.chart.cs.us.ls(this.Mg,(t=>this.Mg.ds(t)),{animationEnabled:this.dh}),this.chart.cs.us.ls(this.wg,(t=>this.wg.ds(t)),{animationEnabled:this.dh}),this.chart.cs.us.ls(this.Cg,(t=>this.Cg.ds(t)),{animationEnabled:this.dh});const b=Ji(new es(this.RA,this.EA,this.zA,1),new is(this.VA,this.OA,this.NA),new ts(this.AA)),M=Ji(new es(this.ig,this.sg,this.hg)),C=Ji(new es(this.ig,this.eg,this.hg));this.Mg.setMouseEnterEventHandler(this.gA).setMouseLeaveEventHandler(this.yA).setMouseDragStartEventHandler(this.vA).setMouseDragEventHandler(this.MA).setMouseDragStopEventHandler(this.CA).setMouseWheelEventHandler(this.FA).setMouseDoubleClickEventHandler(this.AA).setMouseClickEventHandler(this.PA).setMouseDownEventHandler(this.DA).setMouseUpEventHandler(this.BA).setMouseMoveEventHandler(this.LA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.wg.setMouseEnterEventHandler(this.GA).setMouseLeaveEventHandler(this.UA).setMouseDragStartEventHandler(this.HA).setMouseDragEventHandler(this.XA).setMouseDragStopEventHandler(this.JA).setMouseWheelEventHandler(this.qA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.Cg.setMouseEnterEventHandler(this.GA).setMouseLeaveEventHandler(this.UA).setMouseDragStartEventHandler(this.HA).setMouseDragEventHandler(this.ZA).setMouseDragStopEventHandler(this.JA).setMouseWheelEventHandler(this.tg).setTouchStartEventHandler(C.onTouchStart).setTouchMoveEventHandler(C.onTouchMove).setTouchEndEventHandler(C.onTouchEnd),this.Sg.We(c.getWidth({x:m.xAxisStrokeStyle,y:m.yAxisStrokeStyle})),this.xg.We(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.bg.We(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.wh.Be(c.getWidth({x:m.xAxisTitleFillStyle,y:m.yAxisTitleFillStyle})).Qh(c.getWidth({x:m.xAxisTitleFont,y:m.yAxisTitleFont})),this.hs=h.rs(this,{}),this.qh=this.hs.kg([this.wh]).bs(m.effectsText),this.Tg=null!==(x=c.getWidth({x:m.xAxisMarginAfterTicks,y:m.yAxisMarginAfterTicks}))&&void 0!==x?x:7,this.Fg=null!==(S=c.getWidth({x:m.xAxisMarginAfterTitle,y:m.yAxisMarginAfterTitle}))&&void 0!==S?S:7}zr(){return this.gh}Vr(){return void 0!==this.er}setTickStrategy(t,e){return super.Gh(t,e)}getTickStrategy(){return this.hh}addBand(t=!0){const e=t?this.og:this.ng,i=new Gs(e,this.chart,this.lA,this,this.pg,this.zh,this.ts,this.es);return this.rA.push(i),i}addConstantLine(t=!0){const e=t?this.og:this.ng,i=new Hs(e,this.chart,this.lA,this,this.pg,this.zh,this.ts,this.es);return this.rA.push(i),i}Ig(t){this.rA.forEach(t)}Pg(t){return this.rA.map(t)}getHighlighters(){return this.rA}setThickness(t){return"number"==typeof t?(this.Dg=t,this.Bg=t):"object"==typeof t&&(this.Dg=t.min,this.Bg=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Dg,max:this.Bg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Lg(){return this.zf}Sr(t,e){return new gh(e,t,this.IA,this.pg,this.pg)}tr(){if(this.Bf){for(const t of this.Bf)t[1].grid.dispose(),t[1].tick.dispose();this.Bf.clear()}super.tr()}br(t,e){const{tickStart:i}=e,s=t.Dh.vr,r=i+s.getTickLength()*this.dg+s.getTickPadding()*this.dg;t.ih.Ee(this.zh.toPoint(t.M,r)).$a(this.zh.toPoint(s.getLabelAlignment(),-this.dg)).Jh(s.labelRotation).setVisible(this.getVisible())}Rg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Dh.vr,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.dg;return{gridStroke:{start:this.zh.toPoint(t.M,r),end:this.zh.toPoint(t.M,h)},tickStroke:{start:this.zh.toPoint(t.M,n),end:this.zh.toPoint(t.M,a)}}}Lr(t,e){return"linear"===this.Oh.type?Xi(t,e,this.At):ji(t,e,this.At)}Eg(t,e){return e instanceof Pi?Xi:ji}Er(t,e,i){if("logarithmic"!==this.Oh.type){const s=this.At.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.At;return{min:s.pi(t,-i),max:s.pi(e,i)}}zs(){if(!this.Zi)return{zg:0,Vg:0,$d:0};const t=!(this.rh.size>0),e=this.wh&&this.wh.Cr().length>0&&this.getTitleFillStyle()!==z,i=this.zh.getHeight(e?this.chart.cs.Ng.Og(this.wh.Cr(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.Fg:0),s=sr(this.eh)?new Map:lr(this.eh,Math.min(this.Wh,this.Uh),Math.max(this.Wh,this.Uh),this.Wh,this.Uh,0),r=this.At;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.vr&&void 0!==t.pr)(i)){const s=Math.max(...e.map((e=>{if(!je(e,this.Wh,this.Uh))return 0;const s=this.chart.cs.Ng.Og(i.pr(e,r),i.vr.labelFont,i.vr.labelRotation);return t||!s.isEstimate?this.zh.getHeight(s):0})))+i.vr.tickLength+i.vr.tickPadding;n=Math.max(n,s)}}));const o=this.Ef.reduce(this.dA,0);n=Math.max(n,o),n+=this.Tg;const h=Ft(i+n,void 0!==this.Dg?this.Dg:0,void 0!==this.Bg?this.Bg:ze);return this.Rf=h,{zg:n,Vg:i,$d:h}}Re(t){const e=this.getVisible()&&t.Gg>0;this.Wg=t;const i=this.Sg.mu(),s=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart(),n=i.getThickness()*this.dg/2,o=this.gg.getInnerInterval(),h=this.cg/100*o,a=h+t.Ug,l=o*this.dg,u=a+n;if(e||this.tr(),!sr(this.eh)&&e){const t=this.At.ri();this.ar({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.rh){let s=this.Bf.get(e);if(!s)if(e.$e)s={grid:this.rg[0].Yg(this.pg).setMouseInteractions(!1),tick:this.rg[0].Yg(this.pg).setMouseInteractions(!1)};else if("Hg"in e){const t=Array.from(this.rh.keys()).filter((t=>"Hg"in t)).reverse().indexOf(e),i=this.rg[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.Yg(this.pg).setMouseInteractions(!1),tick:i.Yg(this.pg).setMouseInteractions(!1)}}if(s){s.grid.Ot(),s.tick.Ot();for(const[e,r]of i){const e=this.Rg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Xr().$g(e.gridStroke.start,e.gridStroke.end),s.tick.Xr().$g(e.tickStroke.start,e.tickStroke.end)}s.grid.We(e.vr.getGridStrokeStyle()),s.tick.We(e.vr.getTickStyle()),this.Bf.set(e,s)}}}const c=u,d=c+this.dg*t.Xg,f=this.jf||this.Zf?Math.min(this.Wf,.25*t.Gg):0,g={start:this.zh.toVec2(this.At.pi(this.At.getInnerStart(),f),c),end:this.zh.toVec2(this.At.pi(this.At.getInnerEnd(),-f),d)},y=ct(this.zh.toVec2(this.At.getInnerStart(),d),this.pg,this.yg),m=ct(g.start,this.pg,this.yg),p=ct(g.end,this.pg,this.yg),A=ct(this.zh.toVec2(this.At.getInnerEnd(),c),this.pg,this.yg);this.Sg.He(this.zh.toPoint(s,a)).Ye(this.zh.toPoint(r,a)).setVisible(e),this.xg.He(this.zh.toPoint(this.At.pi(this.At.getInnerStart(),this.Of),a)).Ye(this.zh.toPoint(this.At.getInnerStart(),a)).setVisible(e),this.bg.He(this.zh.toPoint(this.At.pi(this.At.getInnerEnd(),-this.Of),a)).Ye(this.zh.toPoint(this.At.getInnerEnd(),a)).setVisible(e);const x=a+t.zg*this.dg;if(this.wh.Ee(this.zh.toPoint(this.zh.getWidth(ct("center"===this.aA?li(ui(y,A),.5):"start"===this.aA?y:A,this.yg,this.pg)),x)).$a(this.zh.toPoint("center"===this.aA?0:"start"===this.aA?-1:1,-1*this.dg)).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.Lf){const e=this.cg/100*o+t.Ug,i=-this.dg*o-t.Ug,s={start:this.zh.toVec2(this.Lf.min,u+this.dg*this.Rf),end:this.zh.toVec2(this.Lf.max,e+i)},r=ct(s.start,this.pg,this.yg),n=ct(s.end,this.pg,this.yg);this._g.Ee(r).it(ci(n,r)).setVisible(!0)}else this._g.setVisible(!1);this.Mg.Ee(m).it(ci(p,m)).setVisible(e),this.wg.Ee(y).it(ci(m,y)).setVisible(e),this.Cg.Ee(p).it(ci(A,p)).setVisible(e);for(const i of this.Ef)i.update().plot(e,a,l,t.Ug,u);for(const t of this.rA)t.Re()}setLength(t){return this.Hd=t,this.chart.cs.Ms(),this}getLength(){return this.Hd}setMargins(t,e){return this.uA=t,this.cA=e,this.chart.cs.Ms(),this}getMargins(){return{start:this.uA,end:this.cA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.jg,...this.chart.Zg,...this.chart.Qg,...this.chart.Jg].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.jg,...this.chart.Zg,...this.chart.Qg,...this.chart.Jg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Kg(){const t=this.Wg;if(!t)return;const e=this.getVisible()&&t.Gg>0,i=this.Sg.mu().getThickness()*this.dg/2,s=this.gg.getInnerInterval(),r=this.cg/100*s+t.Ug,n=s*this.dg,o=r+i;for(const i of this.Ef)i.update().plot(e,r,n,t.Ug,o);for(const t of this.rA)t.Re()}qg(){return this.Rf}tp(t,e){e=e||ch.AxisTickMajor;const i=new In(this,t?this.rg[0]:this.lg,this.lg,this.At,this.vg,this.vg,this.zh,this.Ag,this.fA,this.ts,e).setTextFormatter(this.formatValue);return this.Ef.push(i),i}pA(t){this.chart.cs.us.ks(t,1),this.Nf=t.cs.Kr(this.tA,this.Nf)}mA(t){this.chart.cs.us.ks(t,0),t.cs.qr(this.Nf)}xA(t){this.setStopped(!0),t.cs.qr(this.Nf)}_A(t,e){const i=-this.zh.getWidth(e);this.pan(i),this.Nf=t.cs.Kr(this.iA,this.Nf)}pan(t){const e=this.Wh,i=this.Uh,s=this.At.pi(e,t),r=this.At.pi(i,t);this.hr(s,r,!1)}zoom(t,e){const i=this.At.ft(this.Wh),s=this.At.ft(this.Uh),r=this.At.ft(t),n=Ft((r-i)/(s-i),0,1),o=.2*this.At.ri(),h=n*this.Uf*o*-e,a=(1-n)*this.Uf*o*e,l=this.At.pi(this.Wh,h),u=this.At.pi(this.Uh,a);this.hr(l,u,!0)}kA(t){this.Lf=void 0,t.cs.qr(this.Nf)}bA(t,e){this.setStopped(!0),t.cs.qr(this.Nf),this.chart.cs.us.ks(this.Mg,0)}wA(t,e,i,s){const r=ct(this.IA.cs.Ve(i.x,i.y),this.IA.cs.At,this.pg),n=Ft(this.zh.getWidth(r),this.Wh,this.Uh),o=this.zh.getWidth(ct(this.IA.cs.Ve(e.x,e.y),this.IA.cs.At,this.pg));Math.abs(this.At.ft(n)-this.At.ft(o))>10?(this.Lf=y(Math.min(n,o),Math.max(n,o)),this.Nf=t.cs.Kr(this.sA,this.Nf)):(this.Lf=void 0,this.Nf=t.cs.Kr(this.tA,this.Nf)),this.IA.Ms()}TA(t,e,i){if(this.Lf){const t=this.Lf.min,e=this.Lf.max,i=this.Uh{e.vs(t)}));for(const e of this.Bf.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.dh),this}}var mh;e.AxisXYTitlePositionOptions=void 0,(mh=e.AxisXYTitlePositionOptions||(e.AxisXYTitlePositionOptions={})).Start="start",mh.Center="center",mh.End="end";const ph={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Ah={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},xh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof yh&&"y"in t&&t.y instanceof yh),Sh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new rs,tickLength:7,tickStyle:new rs,tickPadding:0,labelFont:new gr,labelFillStyle:new U,labelAlignment:0,labelRotation:0});class vh extends Sh{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 bh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),Mh=new vh({labelFillStyle:z,gridStrokeStyle:nt,tickStyle:nt}),Ch=t=>bh(t)&&_(t.labelFillStyle)&&ot(t.gridStrokeStyle)&&ot(t.tickStyle),Th=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new vh,minorTickStyle:new vh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Rh=(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"},wh={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}${ge(s,2)}:${ge(r,2)}:${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`}},kh={MajorHours12:{major:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Qs(t,e,r,void 0,1e6)},fitKeyValues:Js({ignore:"first"},2,4)},minor:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,36e5,1e6),fitKeyValues:Js({},2,3,4,6)},defaultValueFormatter:wh.hhmmss},MajorHours:{major:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Qs(t,e,r,void 0,1e6)},fitKeyValues:Js({ignore:"first"},2,6,12)},minor:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,3e5,1e6),fitKeyValues:Js({},2,4,6)},defaultValueFormatter:wh.hhmmss},MajorMinutes15:{major:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Qs(t,e,9e5,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2)},minor:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,6e4,1e6),fitKeyValues:Js({},3,5)},defaultValueFormatter:wh.hhmmss},MajorMinutes:{major:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Qs(t,e,6e4,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,5e3,1e6),fitKeyValues:Js({},2,3,4,6)},defaultValueFormatter:wh.hhmmss},MajorSeconds15:{major:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Qs(t,e,15e3,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,4)},minor:{format:wh.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,1e3,1e6),fitKeyValues:Js({},3,5)},defaultValueFormatter:wh.hhmmss},MajorSeconds:{major:{format:wh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Qs(t,e,1e3,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,100,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.hhmmssmmm},MajorMilliseconds100:{major:{format:wh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Qs(t,e,100,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,10,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.hhmmssmmm},MajorMilliseconds10:{major:{format:wh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Qs(t,e,10,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,1,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.hhmmssmmm},MajorMilliseconds:{major:{format:wh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Qs(t,e,1,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.1,1e6),fitKeyValues:Js({},2)},defaultValueFormatter:wh.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:wh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Qs(t,e,.1,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.01,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:wh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Qs(t,e,.01,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.001,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.hhmmssmmmuuu},MajorMicroseconds:{major:{format:wh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Qs(t,e,.001,void 0,1e6)),fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,100*1e-6,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:wh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Qs(t,e,r,void 0,1e6)},fitKeyValues:Js({ignore:"first"},2,5)},minor:{format:wh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,10*1e-6,1e6),fitKeyValues:Js({},2,3,5)},defaultValueFormatter:wh.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 Eh extends Th{je(t){const e=this.timeOrigin||0,i=[{ih:"Major ticks",Hg:0,vr:this.majorTickStyle,pr:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Rh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,kh[r].major.format)(t+e,i,s)},Ur:(t,e,i,s)=>{const r=Rh(i,s);return(0,kh[r].major.getKeyValues)(t,e,i,s)},Bh:{Mr:(t,e,i,s,r,n)=>{const o=Rh(r,n),h=kh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Yr:void 0}];return bh(this.minorTickStyle)&&i.push({ih:"Minor ticks",Hg:1,vr:this.minorTickStyle,pr:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Rh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,kh[r].minor.format)(t+e,i,s)},Ur:(t,e,i,s)=>{const r=Rh(i,s);return(0,kh[r].minor.getKeyValues)(t,e,i,s)},Bh:{Mr:(t,e,i,s,r,n)=>{const o=Rh(r,n),h=kh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Yr:void 0}),{Ze:[],Qe:i,Je:this.cursorFormatter||((t,i,s)=>{const r=Rh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return kh[r].defaultValueFormatter(t+e,i,s)}),Ke:1e-4,qe: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 Ih=(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},Fh=(t,e,i,...s)=>Ih(-1,t,e,i,s),Dh=(t,e,i,...s)=>Ih(-1,t,e,i,s),Bh=(t,e,i,...s)=>Ih(0,t,e,i,s),Ph=(t,e,...i)=>Ih(1,t,e,void 0,i),Lh=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},Vh=[{label:"MilliSecond1",unit:1,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:Js(void 0,2)}},{label:"MilliSecond10",unit:10,irregular:!1,greatTicks:{getReferenceKeyValue:Fh("millis",10,(t=>t.millis%10==0),"millis")},majorTicks:{fitFunction:Js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:Js(void 0,2)}},{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:{getReferenceKeyValue:Fh("millis",100,(t=>t.millis%100==0),"millis")},majorTicks:{fitFunction:Js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:Js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Fh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:tr(5,10,15,30)},minorTicks:{amount:4,fitFunction:Js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Fh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:tr(5,10,15,30)},minorTicks:{amount:12,fitFunction:Js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Fh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:tr(3,6,12)},minorTicks:{amount:8,fitFunction:Js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Fh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Js({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Js({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Lh(-1),getNextKeyValueIncludingRef:Lh(0),getNextKeyValue:Lh(1),greatTicks:!0,majorTicks:{fitFunction:Js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Dh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Bh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Js(void 0,2,3)},minorTicks:{fitFunction:Js(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Dh("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:Bh("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:Ph("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Js({ignore:"first"},2,5)},minorTicks:{fitFunction:Js(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Dh("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:Bh("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:Ph("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Js(void 0,2,4)},minorTicks:{fitFunction:Js(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Dh("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:Bh("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:Ph("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:Dh("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:Bh("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:Ph("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],zh=(t,e,i,s,r)=>{const n=e-t;let o;for(let t=r?0:Vh.length-1;r?t=0;r?t+=1:t-=1){const e=n/Vh[t].unit;if((void 0===i||e>=i)&&(void 0===s||e<=s)){o=Vh[t];break}}return o},_h=(t,e,i)=>{let s=zh(e,i,void 0,1,!0);if(void 0!==s&&0===Vh.indexOf(s)&&(s=Vh[1]),void 0===s)return;if("great"===t)return s;const r="major"===t?1:2,n=Vh[Vh.indexOf(s)-r];return void 0===n?Vh[0]:n},Nh=(t,e,i)=>(s,r,n,o)=>{const h=_h("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(Vh.indexOf(h)<=Vh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=qs(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Qs(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||je(d,l,u)?[a]:[d]:void 0!==d&&je(d,l,u)?[d]:[u]},Oh=(t,e,i)=>(s,r,n,o)=>{const h=_h(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=qs(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Qs(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 Vh[Vh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Zs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Uh=t=>(e,i,s,r,n,o)=>{const h=_h(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},Yh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new vh,majorTickStyle:new vh,minorTickStyle:new vh,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),wh.hhmmssmmm(t-e.getTime())},formatMillisecondRange:t=>{const e=new Date(t);return e.setHours(0,0,0,0),wh.hhmmssmmm(t-e.getTime())},formatOptionsGreatSecond:{},formatOptionsMajorMilliSecond:{}});class Gh extends Yh{je(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Vh.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]},`;Ct.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=_h(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=It(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[Vh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{ih:"Great ticks (directive)",Hg:0,Xe:!0,Ur:Oh("great",e,this.utc),Yr:void 0},{ih:"Major ticks",Hg:1,vr:this.majorTickStyle,pr:n("major"),Ur:Oh("major",e,this.utc),Bh:{Mr:Uh("major")},Yr:void 0}];Ch(this.greatTickStyle)||(o.push({ih:"Great ticks (left)",vr:this.greatTickStyle.setLabelAlignment(-1),pr:n("great","left"),Ur:Nh(e,this.utc,"left"),$e:!0,kr:!1}),o.push({ih:"Great ticks (right)",vr:this.greatTickStyle.setLabelAlignment(1),pr:n("great","right"),Ur:Nh(e,this.utc,"right"),$e:!0,kr:!1})),Ch(this.minorTickStyle)||h.push({ih:"Minor ticks",Hg:2,vr:this.minorTickStyle,pr:n("minor"),Ur:Oh("minor",e,this.utc),Bh:{Mr:Uh("minor"),Lh:(t,e,i,s,r,n)=>{const o=_h("minor",r,n);return!o||"Week"!==o.label}},Yr:void 0});const a=this.cursorFormatter;return{Ze:o,Qe:h,Je:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=zh(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?wh.hhmmssmmm:wh.hhmmss;return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric"}).format(o)} ${a(o.getTime()-h.getTime())}`},Ke:1,qe: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 Hh=(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 Qs(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,Zs(i,s,o,h)},Wh=(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,Kh=(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,Xh=Js(void 0,2,5),jh=(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,$h=(t,e)=>{const i=Ri(t),s=wi(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&&sDi.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),n=[],o=[];Ch(this.extremeTickStyle)||n.push({ih:"Extreme ticks",vr:this.extremeTickStyle,pr:void 0===e?i:(t,s,r)=>i(e+t,s,r),Ur:$s,$e:!0,kr:!0}),o.push({ih:"Major ticks",Hg:0,vr:this.majorTickStyle,pr:void 0===e?s:(t,i,r)=>s(e+t,i,r),Ur:"logarithmic"===t.type?$h(t.base,!0):Hh(0,!0),Bh:"logarithmic"===t.type?{Mr:Kh}:{Mr:Wh},Yr:void 0}),Ch(this.minorTickStyle)||o.push({ih:"Minor ticks",Hg:1,vr:this.minorTickStyle,pr:void 0===e?r:(t,i,s)=>r(e+t,i,s),Ur:"logarithmic"===t.type?$h(t.base,!1):Hh(1,!1),Bh:"logarithmic"===t.type?{Mr:jh}:{Mr:Xh},Yr:50});const h=this.cursorFormatter?this.cursorFormatter:Di.Numeric;return{Ze:n,Qe:o,Je:void 0===e?h:(t,i,s)=>h(e+t,i,s),Ke:1e-9,qe: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!==Mh?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 qh=(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(Ct.navigator.msSaveBlob)Ct.navigator.msSaveBlob(r,e);else{const t=Ct.document.createElement("a");Ct.document.body.appendChild(t);const i=Ct.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{Ct.URL.revokeObjectURL(i),Ct.document.body.removeChild(t)}),0)}},Jh=(t,i,s,r,n,o)=>{const h=t.sc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},ta=(t,e)=>{if("relative"===t)return e;if(t instanceof Vi)return t;const i=t.x instanceof hr?t.x.At:t.x.x,s=t.y instanceof hr?t.y.At:t.y.y;return Ni(i,s)},ea=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=xh(o)?o:Yi(o)?s:void 0;if(h&&Oi(i)){const t=ct(n,h,r.At);return r.Go({engineX:t.x,engineY:t.y})}if(h&&Yi(i))return ct(n,h,s);if(h&&xh(i))return ct(n,h,i)}else{const i=t;if(Yi(e)){const t=r.No(i);return ct({x:t.engineX,y:t.engineY},r.At,s)}if(xh(e)){const t=e,s=r.No(i);return ct({x:s.engineX,y:s.engineY},r.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class ia{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.ip=[],this.sp=[],this.R=new r.Eventer,this.ep=void 0,this.hp=void 0,this.rp=void 0,this.Xt=A(0,0,0,0),this.np=!1,this.ji=!1,this.op=()=>{this.ap=!0,this.lp.Ms()},this.up=t=>e=>{const i=this.ip.indexOf(e);-1!==i&&this.ip.splice(i,1),this.cs.Ms(),t.Y()},this.cp=t=>{const e=this.sp.indexOf(t);-1!==e&&this.sp.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.SA=t,this.dp=i,this.lp=s,this.removePanel=n,this.ts=e.cs.ts;const l=e.cs.oi();if(this.uiScale=i.d2({scaleXYConstructor:zi}).Vi(0,100).Oi(0,100).it(l),this.mg=i.d2({scaleXYConstructor:zi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(l),this.engine=e.cs.fp,this.cs=e.cs.Ap,this.hs=this.cs.hs.rs(this,{}),this.gp=()=>e.pp("unidentified ui"),this.yp=e.mp(),this.vp=this.lp.Le(this.uiScale).Ee(u(0,0)).it(u(100,100)).Be(o).De(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.op);this.Sp=()=>a.off(t)}else{const t=e.cs.Lo(this.op);this.xp=e.cs.Ro.bind(e.cs,t)}const c=e.cs.zo((t=>{this.np=t,this.R.emit("inViewChange",this,t)}));this.bp=e.cs.Vo.bind(e.cs,c),this.ep=n}getTheme(){return this.ts}getSizePixels(){return this.mg.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.vp.Be(t),this.lp.Ms(),this}getBackgroundFillStyle(){return this.vp.Xh()}setBackgroundStrokeStyle(t){return this.vp.De(t),this.lp.Ms(),this}getBackgroundStrokeStyle(){return this.vp.mo()}translateCoordinate(t,e,i){return ea(t,e,i,this.mg,this.cs)}Mp(t){return this.ip.push(t),this.cs.Ms(),t}_p(t){return this.sp.push(t),this.cs.Ms(),t}addUIElement(t=Wo,e=this.uiScale){e=ta(e,this.mg);const i=this.gp();return this.Mp(Jh(t,i,this.uiScale,e,this.up(i),this.ts))}addLegendBox(t=sh,i=this.uiScale){i=ta(i,this.mg);const s=this._p(Jh(t,this.yp,this.uiScale,i,this.cp,this.ts));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Bs.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Bs.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.sp}dispose(){return this.ji||(this.ji=!0,this.xp&&this.xp(),this.Sp&&this.Sp(),sa(this.uiScale),sa(this.mg),this.bp&&this.bp(),this.hp&&this.hp(),this.lp.Y(),this.yp.Y(),this.ip.slice().forEach((t=>{t.dispose()})),this.sp.slice().forEach((t=>{t.dispose()})),this.cs.Ms(),this.ep&&this.ep(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 qh(this.engine,t,e,i),this}Or(t){this.Xt=t,this.op()}J(){return this.mg.J(),this.uiScale.J(),this}K(){return this.mg.K(),this.uiScale.K(),this}Re(t){if(this.ap){const t=this.lp.cs.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.mg.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.mg.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}wp(){for(let t=0;t{t.ii&&t.ii()};class ra extends ia{constructor(t,e,i,s,r,n){super(t,e,i,e.kp("uipanel bg",0),s,e.cs.ts.uiPanelBackgroundFillStyle,e.cs.ts.uiPanelBackgroundStrokeStyle,n),this.Cp(r,this.mg)}setMinimumSize(t){return this.Id=t,this.cs.Ms(),this}getMinimumSize(){return this.Id}Re(t){super.Re(t),super.wp()}}const na=A(10,10,10,10);class oa extends ia{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Tp={},this.ka=na,this.dh=!0,this.Fp=e.Ip("chart internal ui",0),this.bh=this.Fp.Gr(this.uiScale).yr("Chart").Ee(u(50,100)).$a(u(0,1)).Qh(h).Be(a).setMouseInteractions(!1),this.Pp=this.hs.kg([this.bh]).bs(this.ts.effectsText)}setAnimationsEnabled(t){return this.dh=t,this}getAnimationsEnabled(){return this.dh}setTitle(t){return this.bh.yr(t),this.cs.Ms(),this}getTitle(){return this.bh.Cr()}getTitleSize(){return this.bh.zs().ed()}setTitleFillStyle(t){return this.bh.Be(t),this.op(),this}getTitleFillStyle(){return this.bh.Xh()}setTitleFont(t){return this.bh.Qh(t),this.op(),this}getTitleFont(){return this.bh.Zh()}setTitleRotation(t){return this.bh.Jh(t),this.cs.Ms(),this}getTitleRotation(){return this.bh.Kh()}setTitleEffect(t){return this.Pp.bs(t),this.cs.Ms(),this}getTitleEffect(){return this.Pp._s()}setTitleMargin(t){var e,i;return this.Tp="object"==typeof t?this.Tp?(e=this.Tp,{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.op(),this}getTitleMargin(){return this.Tp}setPadding(t){return this.ka="object"==typeof t?S(this.ka,t):{left:t,top:t,right:t,bottom:t},this.op(),this}getPadding(){return this.ka}Dp(t){const e=t.Bp(),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.Fp.Y(),this}}const ha={Lp:(t,e)=>t.Xh()!==z&&0!==t.Cr().length&&t.getVisible()?t.zs().ed().y:0,Rp(t,e){t.Ee(u(50,100)).Or({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}},aa=t=>"show-all-interpolated"===t||"show-nearest-interpolated"===t||"show-pointed-interpolated"===t,la=(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},ua=(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&&y?m.Re(...y):t.cs.Ms())},i=()=>{t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())},r=()=>{f=!1,t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())},n=()=>{f=!0,t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())},o=()=>{t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())},h=()=>{f=!1,t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())};s.onSeriesBackgroundMouseEnter(e),s.onSeriesBackgroundMouseMove(i),s.onSeriesBackgroundMouseLeave(r),s.onSeriesBackgroundTouchStart(n),s.onSeriesBackgroundTouchMove(o),s.onSeriesBackgroundTouchEnd(h),s.Ep(((e,i)=>{i.onMouseEnter(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())):l||t.cs.Ms()})),i.onMouseMove(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())):l||t.cs.Ms()})),i.onMouseLeave((()=>{i.getCursorEnabled()?(a=void 0,t.getCursorMode()&&(l&&y?m.Re(...y):t.cs.Ms())):l||t.cs.Ms()}))}))}let y;const m={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()},Re:(e,s,r,n)=>{y=[e,s,r,n];const o=t.cs.Xn();let m=[];if((null==n?void 0:n.explicitTarget)&&u)m=[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)m=[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&&m.push(e)}"show-nearest"!==u&&"show-nearest-interpolated"!==u||(m.sort(((t,e)=>h(t,o)-h(e,o))),m.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&&(m=[e])}}m=ve(m.map((t=>Pe(t))));const p=(null==n?void 0:n.overrideCursorPositions)||((t,e)=>e),A=m[0],x=m.length>0?m: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.zs().Re());else{if(m&&m.length>0){const e=c(t,m[0],m);i.setVisible(!0).setPosition(...p(m,m.map((t=>t.cursorPosition)))).setResultTable((t=>t.setContent(e)))}else i.setVisible(!1);(null==n?void 0:n.afterCursorPointedAt)&&n.afterCursorPointedAt(m),i.zs().Re()}},solveNearest:(e,i,s,r)=>{const n=e||t.cs.Xn();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=ve(o.map((t=>Pe(t)))),o},zp:i};return m};class ca{constructor(t,e){this.Vp=t,this.Op=e}alter(t){this.Np=void 0!==this.Np?this.Np:this.Op(),this.Gp=t,this.Vp(t)}resetValue(){void 0!==this.Gp&&(void 0!==this.Np&&this.isAltered()&&this.Vp(this.Np),this.Np=void 0,this.Gp=void 0)}getNormalValue(){return void 0!==this.Np?this.Np:this.Op()}isAltered(){return void 0!==this.Gp&&this.Op()===this.Gp}}class da{constructor(t,e){this.Wp=[],this.Yp=t,this.At=e}update(){return this.Yp.getVisible()?!(this.Hp()&&(!this.$p()||(this.resetTable(),this.Yp.zs(),this.Hp()))&&(this.Xp(),this.Yp.zs(),this.Hp()&&(this.resetTable(),this.Yp.zs(),1))):(this.$p()&&this.resetTable(),!0)}$p(){for(let t=0;t{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Yp,this.At)}jp(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Yp,this.At)}Zp(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Yp,this.At)}Qp(t){return this.Wp.push(t),t}}class fa extends da{constructor(){super(...arguments),this.Ca=this.Qp(new ca((t=>this.Yp.setOrigin(t)),(()=>this.Yp.getOrigin())))}Xp(){const t=this.Ca.getNormalValue(),e=u(this.jp()?-t.x:t.x,this.Zp()?-t.y:t.y);this.Ca.alter(e)}}class ga extends da{constructor(t,e,i,s){super(t,e),this.Jp=this.Qp(new ca((t=>this.Yp.setTextFont((e=>e.setSize(t)))),(()=>this.Yp.getTextFont().getSize()))),this.Kp=i,this.qp=s}Xp(){const t=this.Jp.getNormalValue(),e=this.Kp;if(enew fa(t,e),FontSize:(t=5,e=5)=>(i,s)=>new ga(i,s,t,e)},ma={None:Nn,Rectangle:Co,Circle:To,Diamond:Ro,Pointer:wo};class pa extends Lo{constructor(){super(...arguments),this.Xu=this.ts.cursorResultTableTextFont,this.Nd=0,this.ty=this.ts.cursorResultTableTextFillStyle}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.Xu.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];void 0!==i&&t.set(e,i)}return t})):this.Xu,e=l||this.ty,i=f[o];if(u){let s;i&&i instanceof bo?s=i:(i&&i.dispose(),s=n.addElement(Mo,o)),s.setText(u).setFont(t).setFillStyle(e).setTextRotation(this.Nd)}else if(c){let s;i&&i instanceof ko?s=i:(i&&i.dispose(),s=n.addElement(Eo,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($o.setBackground(ma.None),o).setOn(!0));const h=d.Ps();void 0!==h&&s.setButtonShape(h),s.setText(d.getName()).setTextFont(t).setTextFillStyle(e).setTextRotation(this.Nd),d.styleLegendEntry(s)}}else{const t=f[o];t&&t instanceof Io||(t&&t.dispose(),n.addGap(void 0,o))}}}}var r;return this.Bs.Ms(),this}setTextFillStyle(t){this.ty="function"==typeof t?t(this.ty):t;for(let t=0;tt.setFillStyle(o.cursorResultTableFillStyle).setStrokeStyle(o.cursorResultTableStrokeStyle))).setTextFillStyle(o.cursorResultTableTextFillStyle).setTextFont(o.cursorResultTableTextFont),this.uy=ya.Flip(this.Yp,this.scale)}isDisposed(){return this.ji}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setPointMarkerVisible(t){return this.ey=t,this.sy.forEach((e=>e.pointMarker.setVisible(e.targetVisible&&t))),this.Bs.Ms(),this}getPointMarkerVisible(){return this.ey}setPointMarker(t){return this.sy.forEach((e=>t(e.pointMarker))),this.ny.push(t),this.Bs.Ms(),this}setResultTableVisible(t){return this.hy=t,this.Bs.Ms(),this}getResultTableVisible(){return this.hy}setResultTable(t){return t(this.Yp),this.Bs.Ms(),this}setAutoFitStrategy(t){return this.uy&&this.uy.resetTable(),this.uy=t?t(this.Yp,this.Bs.cs.At):void 0,this.Bs.Ms(),this}getAutoFitStrategy(){return void 0!==this.uy}setVisible(t){return this.Zi=t,this.Bs.Ms(),this}getVisible(){return this.Zi}dispose(){return this.sy.forEach((t=>t.pointMarker.dispose())),this.Yp.dispose(),this.ny.length=0,this.oy(this),this.R.emit("dispose"),this}Re(){return this.uy&&this.uy.update(),this.Yp.setVisible(this.np&&this.Zi&&this.hy),this.sy.forEach((t=>t.pointMarker.setVisible(t.targetVisible&&this.np&&this.Zi&&this.ey))),this.sy.forEach((t=>t.pointMarker.Re())),this.Yp.Re(),this}zs(){return this.sy.forEach((t=>t.pointMarker.zs())),this.Yp.zs(),this}Ay(t,e){const i=e===this.scale?t:ct(t,e,this.scale);this.Yp.setPosition(i)}}const xa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5)));class Sa extends Aa{constructor(){super(...arguments),this.Sa={x:0,y:0}}setPosition(t){const e=this.renderingScale,i=ta(t.resultTableScale,e),s=i===this.scale?t.resultTable:ct(t.resultTable,i,this.scale),r=ta(t.pointMarkerScale,e),n=r===this.scale?t.pointMarker:ct(t.pointMarker,r,this.scale);this.Sa=n;let o=this.sy[0];if(!o){const t=new ko(this.Bs,this.renderingScale,this.scale,Et,this.ts).setMouseInteractions(!1).setFillStyle(this.ts.cursorPointMarkerFillStyle).setSize(this.ts.cursorPointMarkerSize).setShape(this.ts.cursorPointMarkerShape);o={pointMarker:t,targetVisible:!0},this.sy.push(o),this.ny.forEach((e=>e(t)))}return o.pointMarker.setPosition(n),this.Yp.setPosition(s),this.Bs.Ms(),this}zs(){return super.zs(),this.np=((t,e,i=e)=>{const s=e!==i?ct(t,e,i):t;return s.x>=i.x.getInnerStart()&&s.x<=i.x.getInnerEnd()&&s.y>=i.y.getInnerStart()&&s.y<=i.y.getInnerEnd()})(this.Sa,this.scale),this}}class va{constructor(t,e=[]){this.gy=[],this.py=(t,e)=>(this.gy.forEach((i=>i(t,e))),t),this.addStyler=t=>new va(this.ly,this.gy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new va(t,this.gy.map((t=>t))),this.yy=(t,e,i,s,r)=>this.py(new Sa(t,e,i,s,this.ly,r),r),this.ly=t,this.gy=e}}const ba=new va(Co,[xa]),Ma=new va(wo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof wo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Ca=ba,Ta=ba,Ra=ba,wa=Ma,ka=new va(Co,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Bs.LeftBottom)))]);var Ea;e.SliceLabelIndices=void 0,(Ea=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Ea.LabelsInsideSlices=0]="LabelsInsideSlices",Ea[Ea.LabelsOnSides=1]="LabelsOnSides";const Ia={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},Fa={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Da extends Zi{constructor(){super(...arguments),this.Cs="Slice",this.M=0}}const Ba=(t,e)=>{Qt(e),t.setExploded(!t.getExploded())};class Pa extends Da{}class La extends Pa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.my=!1,this.vy=z,this.Sy=z,this.xy=this.M,this.by=this.my?1:0,this.My=this.getVisible(),this._y=$((()=>this.chart.cs.Ms())),this.wy=$((()=>this.chart.cs.Ms())),this.Cy=()=>{this.ky=void 0},this.Ty=()=>{this.Fy=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.Iy=e.nd(r).ds(this.getHighlight()),this.As(this.Iy),this.ih=i.Gr(r).ds(this.getHighlight()),this.As(this.ih,{isText:!0}),this.onMouseClick(Ba),this.onTouchEnd(Ba)}setValue(t){return this.chart.getAnimationsEnabled()?this.My&&this.Py(this.xy,t):this.xy=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.by=t,this.chart.cs.Ms()})),this.Fy.onEveryAnimationEnd(this.Ty),this.my=!this.my):!1!==this.chart.getMultipleSliceExplosion()||t?(this.by=this.my?0:1,this.my=!this.my):(this.by=0,this.my=!this.my),this.chart.cs.Ms(),this}getExploded(){return this.my}setVisible(t){return this.My=t,!1===t?this.chart.getAnimationsEnabled()&&this.xy>0?(this.ky&&(this.ky.finish(!1),this.ky=void 0),this.Py(this.xy,0,(()=>super.setVisible(!1)))):(this.xy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.ky&&(this.ky.finish(!1),this.ky=void 0),super.setVisible(!0),this.Py(this.xy,this.M)):(this.xy=this.M,super.setVisible(!0)),this}Py(t,e,i){this.ky=this._y(300,X.ease)([[t,e]],(([t])=>{this.xy=t,this.chart.cs.Ms()})),this.ky.onEveryAnimationEnd(this.Cy),i&&this.ky.onAnimationEnd(i)}setStyle(t,e,i,s){this.vy=t,this.Sy=i,this.Iy.Be(this.vy).De(e),this.ih.Be(this.Sy).Qh(s);for(let t=0;tui(e,li(Si(.5*(t.ru()+t.Ti())*Math.PI/180),i)),za=(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.Dy.indexOf(t);e>=0&&(this.Dy.splice(e,1),this.Hy())},this.cs.Zn(fh.pf),this.$y=e.Xy("pieChart bottom",0),this.jy=e.Xy("pieChart top",1),this.bh.yr("Pie Chart"),this.Cp(r,this.mg),this.onBackgroundMouseDoubleClick(_a);const h=Ji(new ts(_a));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd);const a=e.Zy(),l=Bt(o?o.cursorBuilder:void 0,Ta);this.Qy=ua(this,a,l.yy(a,this.uiScale,this.uiScale,Et,this.ts),void 0,"show-pointed",Oa,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Ta){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}addSlice(t,e){const i=new La(this.Oy,this.$y,this.jy,this,this.mg,this.Yy,this.ts,this.cs.hs);this.Oy+=1,i.setName(t);const s=this.dh;return this.dh=!1,i.setValue(e),this.dh=s,i.setEffect(this.Wy),this.Jy(i),this.Dy.push(i),this.Hy(),i.setHighlightOnHover(this.Ey),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.Wy}setSliceSorter(t){return this.By=t,this.Dy=this.Dy.sort(this.By),this.cs.Ms(),this}getSliceSorter(){return this.By}setLabelFillStyle(t){this.Vy="function"==typeof t?t(this.Vy):t;for(let t=0;te.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Uy}setLabelFormatter(t){return this.Ky=t,this.cs.Ms(),this}getLabelFormatter(){return this.Ky}setSliceHighlightOnHover(t){return this.Ey=t,this.Dy.forEach((e=>e.setHighlightOnHover(t))),this}Re(t){super.Re(t),ha.Rp(this.bh,this.Tp),super.wp();const e=ha.Lp(this.bh,this.Tp),i=u(this.mg.x.getInnerInterval()-(this.ka.left+this.ka.right),this.mg.y.getInnerInterval()-(this.ka.bottom+this.ka.top+e)),s=u(this.ka.left+i.x/2,this.ka.bottom+i.y/2);if(this.jd){const t=this.jd;this.Dy.forEach((e=>{this.Jy(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Dy[t].Iy.setVisible(e),this.Dy[t].ih.setVisible(e)}this.Dy=this.Dy.sort(this.By);const r=this.Dy.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.No(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.qy(r,o,s,i)}Jy(t,e=this.Ly(t.index,t)){t.setStyle(e,this.Ry,this.Vy,this.zy)}Hy(){this.Dy=this.Dy.sort(this.By),this.cs.Ms()}ef(){return this.Dy}dispose(){return super.dispose(),this.Dy.slice().forEach((t=>t.dispose())),this.Qy.Y(),this.jy.Y(),this.$y.Y(),this}}const Oa=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],Ua={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ya=(...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 Ga extends Na{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Ky=Fa.NamePlusValue,this.tm=[],this.im=40,this.sm=5,this.hm=10,this.rm=this.ts.pieChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.rm=t;for(let t=0;tt.ih.setVisible(!1))),this.tm.forEach((t=>t.setVisible(!1)))}else{za(t,e,i,u,this.Kl,a);let s=90;const r=t.map(((t,r)=>{const h=360*e[r],a=s-h,l=Si(Ai(.5*(s+a))),c=l.x>=0?-1:1,d=ui(ui(i,li(l,u+n)),{x:c*-o,y:0});s=a;const f={x:c,y:0};t.ih.Ee(d).$a(f),t.ih.zs();const g=Je(t.ih.th());return{position:d,alignment:f,shape:t.ih,boundaries:g,sliceAngleVec:l,slice:t}})),l=[];for(let t=0;t{const s=t.slice.Iy,r=Va(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=pi(t.position.y,r,i),o=t.position;this.nm([r,n,o])}))}}getMinimumSize(){return u(500,300)}nm(t){let e;for(let t=0;t{if(ns(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?pr:new xr({size:e,fillStyle:i,shape:"sphere"})}return pr};class Xa{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.Ms=t,this.lm=e,this.um=i,this.dm=s,this.fm=n,this.Am=o,this.Nd=h,this.ty=a,this.gm=l,this.rc=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.um="function"==typeof t?t(this.um):t,this.Ms(),this}getTickStyle(){return this.um}setTickLength(t){return this.dm=t,this.Ms(),this}getTickLength(){return this.dm}setGridStrokeStyle(t){return this.fm="function"==typeof t?t(this.fm):t,this.Ms(),this}getGridStrokeStyle(){return this.fm}setTextPadding(t){return this.Am=t,this.Ms(),this}getTextPadding(){return this.Am}setTextRotation(t){return this.Nd=t,this.Ms(),this}getTextRotation(){return this.Nd}setTextFillStyle(t){return this.ty="function"==typeof t?t(this.ty):t,this.Ms(),this}getTextFillStyle(){return this.ty}setTextFont(t){return this.gm="function"==typeof t?t(this.gm):t,this.Ms(),this}getTextFont(){return this.gm}setTextFormatter(t){return this.rc=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.lm(),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")}}class ja extends Xa{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.pm=u,this.ym=c,this.ka=d}setBackgroundFillStyle(t){return this.pm="function"==typeof t?t(this.pm):t,this.Ms(),this}getBackgroundFillStyle(){return this.pm}setBackgroundStrokeStyle(t){return this.ym="function"==typeof t?t(this.ym):t,this.Ms(),this}getBackgroundStrokeStyle(){return this.ym}setPadding(t){return this.ka="number"==typeof t?{left:t,top:t,right:t,bottom:t}:{...this.ka,...t},this.Ms(),this}getPadding(){return this.ka}}class $a{constructor(t,e,i,s){this.vm=[],this.Sm=new Map,this.xm=t,this.bm=e,this.Mm=i,this._m=s}wm(){this.Mm&&this.Mm();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.vm.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.xm(),this.vm.push(e));const n=[],o=e.Cm().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.bm(e,n,t.sharedProperties);i=he(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.Fd(t)}))})),s.forEach((t=>{t.dispose();const e=this.vm.indexOf(t);e<0?pe(0,(()=>{})):this.vm.splice(e,1)})),r.forEach((t=>{const e=this.Sm.get(t.Zo);e&&t.collection.cs.lo({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.Sm.clear(),r.forEach((t=>{this.Sm.set(t.Zo,t)})),this._m&&this._m(this.vm,i)}}}km(){this.vm.forEach((t=>{t.dispose()})),this.vm.length=0}}class Za{constructor(t){this.Tm=[],this.Fm=t}wm(){return this.Im(),{add:()=>this.ul(),finishPlot:()=>{this.Pm()}}}ul(){let t=this.Tm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Fm()},this.Tm.push(t)),t.isFree=!1,t.shape}Im(){this.Tm.forEach((t=>{t.isFree=!0}))}Pm(){this.Tm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Tm.splice(this.Tm.indexOf(t),1)}))}km(){this.Tm.forEach((t=>t.shape.dispose())),this.Tm.length=0}}class Qa extends hr{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Dm({x:t.cs.ts.xAxis3DNumericTicks,y:t.cs.ts.yAxis3DNumericTicks,z:t.cs.ts.zAxis3DNumericTicks}),datetime:e.Dm({x:t.cs.ts.xAxis3DDateTimeTicks,y:t.cs.ts.yAxis3DDateTimeTicks,z:t.cs.ts.zAxis3DDateTimeTicks}),time:e.Dm({x:t.cs.ts.xAxis3DTimeTicks,y:t.cs.ts.yAxis3DTimeTicks,z:t.cs.ts.zAxis3DTimeTicks})},{type:"linear"}),this.Ef=[],this.Bm=()=>{},this.Lm=()=>{},this.Rm=()=>{},this.Em=()=>{},this.chart=t,this.zm=r,this.Vm=n,this.Om=o,this.Nm=this.zm.At;const l=this.zh.Dm({x:this.ts.xAxis3DStrokeStyle,y:this.ts.yAxis3DStrokeStyle,z:this.ts.zAxis3DStrokeStyle});this.Gm=this.zm.om([Ua.InternalUI]).We(l).Wm(Ka(l)).setMouseInteractions(!1),this.wh=this.Vm.Gr(this.Om).setMouseInteractions(!1).Be(e.Dm({x:t.cs.ts.xAxis3DTitleFillStyle,y:t.cs.ts.yAxis3DTitleFillStyle,z:t.cs.ts.zAxis3DTitleFillStyle})).Qh(e.Dm({x:t.cs.ts.xAxis3DTitleFont,y:t.cs.ts.yAxis3DTitleFont,z:t.cs.ts.zAxis3DTitleFont})).oa(3),this.Um=new Za((()=>this.Vm.Gr(this.Om).oa(2).Nr(Ie).Or(Ie))),this.Ym=new $a((()=>this.Vm.Hm(this.Om).setMouseInteractions(!1).oa(1)),((t,e,i)=>(t.Be(i.fillStyle).De(i.strokeStyle),e.map((({positions:e,existingMember:i})=>{const s=i||t.Xr();return s.Cl(e),s}))))),this.$m=new $a((()=>this.zm.Yg().setMouseInteractions(!1)),((t,e,i)=>(t.Ot().We(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.Al(e)))))),this.hs=a,this.qh=this.hs.kg([this.wh]).bs(s.effectsText),this.Gm.setMouseEnterEventHandler(this.Bm).setMouseLeaveEventHandler(this.Lm).setMouseDragEventHandler(this.Rm).setMouseDragStopEventHandler(this.Em),i.ug=this}setTickStrategy(t,e){return super.Gh(t,e)}getTickStrategy(){return this.hh}addCustomTick(){const t=new ja((()=>this.chart.cs.Ms()),(()=>{const e=this.Ef.indexOf(t);e>=0&&this.Ef.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)),z,nt,{left:4,right:4,top:4,bottom:4});return this.Ef.push(t),this.chart.cs.Ms(),t}setStrokeStyle(t){return this.Gm.We(t).Wm(Ka(this.Gm.mu())),this.chart.cs.Ms(),this}getStrokeStyle(){return this.Gm.mu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Gm.setVisible(t),!1===t&&(this.$m.km(),this.Um.km(),this.Ym.km()),this.zm.Ms(),this}Lg(){return this.chart.getSeries()}Xm(t){return Math.abs(this.At.st(t)*this.zm.jm(1))}Er(t,e,i){const s=Math.abs(this.At.st(e-t)*this.zm.jm(1));return{min:t-i*s,max:e+i*s}}Sr(t,e){const i=new qa(e,t,this.Vm,this.Om,this.zm);return i.ih.oa(0),i}br(t,e){const i=this.Zm(e,t.M,t.Dh.vr.tickLength,t.Dh.vr.tickPadding);return t.ih.Ee(i.labelPosition).$a(i.labelAlignment),i}Zm(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=Ve.addVec(qe(n,o,l),Ve.multiplyVec(Ve.multiply(h,this.zm.jm(.5*this.Gm.mu().getThickness())),r)),d=Ve.addVec(c,Ve.multiplyVec(Ve.multiply(h,this.zm.jm(i)),r)),f=this.zm.Qm(d)||u(0,0);return{labelPosition:ui(ct(f,this.chart.cs.At,this.Om),li(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Jm(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=Ve.addVec(qe(r,n,h),Ve.multiplyVec(Ve.multiply(o,this.zm.jm(.5*this.Gm.mu().getThickness())),s)),l=Ve.addVec(a,Ve.multiplyVec(Ve.multiply(o,this.zm.jm(10)),s)),c=this.zm.Qm(a)||u(0,0),d=this.zm.Qm(l)||u(0,0);return this.Vm.Ue(this.Om).He(c).Ye(d).We(new rs({fillStyle:new U({color:R(120*i)}),thickness:1}))}Lr(t,e){return Ja(t,e,this.At)}Re(t){if(!this.Zi)return;const e=Math.min(this.Wh,this.Uh),i=Math.max(this.Wh,this.Uh),s=this.Nm,r=f(s.x.rt(),s.y.rt(),s.z.rt());let n,o;this.Km()?(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.zh.qm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.zh.rf,a=this.zm.Qm(n)||u(0,0),l=this.zm.Qm(o)||u(0,0),c=qe(n,o,.5),d=Ve.addVec(c,Ve.multiplyVec(Ve.multiply(h,-1),r)),g=this.zm.Qm(c)||u(0,0),y=this.zm.Qm(d)||u(0,0),m=oi(ci(ct(g,this.chart.cs.At,this.Om),ct(y,this.chart.cs.At,this.Om)));this.Gm.Ot().Al([n,o]);const{gridlinePositionA:p,gridlinePositionB:A,gridlinePositionC:x}=this.zh.tv(t),S=t=>({x:-1===t.x?this.Nm.x.getInnerStart():1===t.x?this.Nm.x.getInnerEnd():0,y:-1===t.y?this.Nm.y.getInnerStart():1===t.y?this.Nm.y.getInnerEnd():0,z:-1===t.z?this.Nm.z.getInnerStart():1===t.z?this.Nm.z.getInnerEnd():0}),v=S(p),b=S(A),M=S(x),C={physicalAxisSize:ai(ci(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},T=this.ar(C),R=this.$m.wm();for(const[t,e]of this.rh)for(const[,i]of e){const e=T.get(i);if(!e)continue;const s=this.sv(C,e);R.add({Zo:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.vr.tickStyle}),s.gridStroke&&R.add({Zo:0,positions:s.gridStroke},{lineStyle:t.vr.gridStrokeStyle})}const w=this.Um.wm(),k=this.Ym.wm(),E={x:0,y:0};this.Ef.forEach((t=>{if(!t.Zi||t.Mi)return;const s=this.Zm(C,t.M,t.dm,t.Am),r=this.sv(C,s);if(t.ty!==z){const e=w.add().Ee(s.labelPosition).$a(s.labelAlignment).Be(t.ty).Qh(t.gm).yr(t.rc(t.M)).Jh(t.Nd),i=e.zs().oi();if(E.x=Math.max(E.x,i.x),E.y=Math.max(E.y,i.y),t.pm!==z){const i=e.th(),s=[{x:i[0].x-t.ka.left,y:i[0].y+t.ka.top},{x:i[1].x+t.ka.right,y:i[1].y+t.ka.top},{x:i[2].x+t.ka.right,y:i[2].y-t.ka.bottom},{x:i[3].x-t.ka.left,y:i[3].y-t.ka.bottom}];k.add({Zo:0,positions:s},{fillStyle:t.pm,strokeStyle:t.ym})}}R.add({Zo:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.um}),r.gridStroke&&R.add({Zo:0,positions:r.gridStroke},{lineStyle:t.fm})})),w.finishPlot(),k.finishPlot(),R.finishPlot();const I=this.wr(((t,e)=>{const i=e.ih.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:E.x,y:E.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.wh.$a({x:0,y:0}).Jh(180*-F/Math.PI);const D=Ve.addVec(c,Ve.multiplyVec(Ve.multiply(h,this.zm.jm(.5*this.Gm.mu().getThickness()+this.Tr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),B=this.zm.Qm(D)||u(0,0),P=ui(ct(B,this.chart.cs.At,this.Om),ui(ui(di(I,m),li(m,this.Tr(((t,e)=>Math.max(t)),0))),di(li(this.wh.zs().oi(),.5),m)));this.wh.Ee(P),this.Gm.ev={overrideFollowing:!1,skipMousePicking:!1}}sv(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return It(h,0)||It(h,1)||(a=[this.hv()?{...i,x:n.x}:this.rv()?{...i,y:n.y}:this.Km()?{...i,z:n.z}:{x:0,y:0,z:0},this.hv()?{...s,x:n.x}:this.rv()?{...s,y:n.y}:this.Km()?{...s,z:n.z}:{x:0,y:0,z:0},this.hv()?{...r,x:n.x}:this.rv()?{...r,y:n.y}:this.Km()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}tr(){super.tr(),this.$m.km(),this.Um.km(),this.Ym.km()}hv(){return this.zh.hv()}rv(){return this.zh.rv()}Km(){return this.zh.Km()}}class qa extends ar{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.nv=r}}const Ja=(t,e,i)=>Ft(t+.1*(e-t)+Math.abs(i.rt())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),tl=(t,e,i,s)=>({Fr:()=>{const i=t();let s;for(const t of i){if(!t.ov())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},Ir:()=>{const e=t();let s;for(const t of e){if(!t.ov())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Dr:()=>{const e=t();let i;for(const t of e){if(!t.ov())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),el=t=>({...tl(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Dr().y)),Dm:t=>t.y,qm:(t,e)=>({x:e.x,y:t.y,z:e.z}),rf:f(-1,0,0),tv: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)}},hv:()=>!1,rv:()=>!0,Km:()=>!1}),il=t=>({...tl(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Dr().z)),Dm:t=>t.z,qm:(t,e)=>({x:e.x,y:e.y,z:t.z}),rf:f(1,0,0),tv: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)}},hv:()=>!1,rv:()=>!1,Km:()=>!0});class sl extends Zi{constructor(t,e,i,s,r){super(t,e,s,r),this.av=Jn,this.lv=!0,this.uv=!0,this.cv=!0,this.chart=t,this.zm=i,this.ss=new Map,this.onMouseWheel(this.chart.dv),this.onMouseDrag(this.chart.fv),this.onMouseDragStop(this.chart.Av),this.onTouchStart(this.chart.gv.onTouchStart),this.onTouchMove(this.chart.gv.onTouchMove),this.onTouchEnd(this.chart.gv.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.mg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ()}}setCursorEnabled(t){return this.lv=t,this}getCursorEnabled(){return this.lv}setCursorFormattingOverride(t){return this.pv=t,this}getCursorFormattingOverride(){return this.pv}setAutoScrollingEnabled(t){return this.uv=t,this.chart.cs.Ms(),this}getAutoScrollingEnabled(){return this.uv}setColorShadingStyle(t){return this.av=t,this.ss.forEach(((e,i)=>i.yv(t))),this.zm.Ms(),this}getColorShadingStyle(){return this.av}setDepthTestEnabled(t){return this.cv=t,this.ss.forEach(((e,i)=>i.mv(t))),this.zm.Ms(),this}getDepthTestEnabled(){return this.cv}vv(){}Re(){}_m(){}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.Sv():void 0}getZMin(){const t=this.Qa;return t?t.xv():void 0}Dr(){const t=this.Qa;return t?f(t.Tl(),t.Fl(),t.bv()):f(0,0,0)}}class rl extends sl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Box Series 3D",this.Mv=.25,this._v=!1,this.Zd=()=>de(this.Te),this.Te=ye(this.ts.boxSeries3DFillStyle,r),this.Qa=this.zm.Cv().mv(this.cv).Be(this.Te).wv(this.Mv).ds(this.getHighlight()),this.As(this.Qa)}invalidateData(t){const e=t.length;if(0===e)return this;this._v&&this.chart.cs.Zn(fh.Tf);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;ide(this.yu.getFillStyle())}setStrokeStyle(t){this.yu="function"==typeof t?t(this.yu):t;const e=this.yu;return this.Qa.We(e),this.zm.Ms(),this}getStrokeStyle(){return this.yu}add(t){return this._v&&this.chart.cs.Zn(fh.Tf),this._v=!0,(t=Array.isArray(t)?t:[t])?(this.Qa.Al(t.slice()),this.zm.Ms(),this):this}clear(){return this.Qa.Ot(),this}getPointAmount(){const t=this.Qa;return t.pl()+t.yl()}ov(){return this.uv&&this.getPointAmount()>0&&this.getVisible()}ze(t,e){t.ds(e),this.zm.Ms()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{stroke:this.yu})}}class ol extends nl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Line Series 3D",this.yu=ye(s.lineSeries3DStrokeStyle,r),this.Tv=Lr.pointStyle3D,this.Fv(this.yu),this.Qa=this.zm.om([Ua.UserSeries]).mv(this.cv).We(this.yu).Wm(this.Tv).ds(this.getHighlight()),this.As(this.Qa)}setStrokeStyle(t){super.setStrokeStyle(t),this.Fv(this.yu);const e=this.Tv;return this.Qa.Wm(e),this}Fv(t){const e=new Cr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Tv=e}}class hl extends nl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Point Line Series 3D",this.Zd=()=>de(this.yu.getFillStyle())||de(this.Tv.getFillStyle()),this.Tv=ye(s.pointLineSeries3DPointStyle,r),this.yu=ye(s.lineSeries3DStrokeStyle,r),this.Iv(),this.Qa=this.zm.om([Ua.UserSeries]).mv(this.cv).We(this.yu).Wm(this.Tv).ds(this.getHighlight()),this.As(this.Qa)}setPointStyle(t){return this.Tv="function"==typeof t?t(this.Tv):t,this.Iv(),this.Qa.Wm(this.Tv),this.zm.Ms(),this}getPointStyle(){return this.Tv}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.yu,i=Math.abs(e.getThickness()),s=this.Tv,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.Tv=s.setSize(i)),this.Iv();const n=this.Tv;return this.Qa.Wm(n),this.zm.Ms(),this}Iv(){const t=this.Tv,e=t.getSize();this.Tv=t.setSize(e)}ze(t,e){t.ds(e),this.zm.Ms()}}class al extends sl{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this._v=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.chart.cs.Zn(fh.Ff)}add(t){return this._v&&this.chart.cs.Zn(fh.Tf),this._v=!0,(t=Array.isArray(t)?t:[t])?(this.Qa.Al(t.slice()),this.zm.Ms(),this):this}clear(){return this.Qa.Ot(),this}getPointAmount(){const t=this.Qa;return t.pl()+t.yl()}ov(){return this.uv&&this.getPointAmount()>0&&this.getVisible()}ze(t,e){t.ds(e),this.zm.Ms()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{point3D:this.Pv})}}class ll extends al{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Cs="Point Series 3D",this.Zd=()=>de(this.Pv.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.chart.getSeries().length;this.Pv=ye(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Qa=this.zm.Bv(h).mv(this.cv).Dv(this.Pv).ds(this.getHighlight()),this.As(this.Qa)}setPointStyle(t){this.Pv="function"==typeof t?t(this.Pv):t;const e=this.Pv;return this.Qa.Dv(e),this.zm.Ms(),this}getPointStyle(){return this.Pv}}class ul extends al{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Cs="Point Cloud Series 3D",this.Zd=()=>de(this.Pv.getFillStyle());const o=this.chart.getSeries().length;this.Pv=ye(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Qa=this.zm.Bv(h).Dv(this.Pv).ds(this.getHighlight()),this.As(this.Qa)}setPointStyle(t){this.Pv="function"==typeof t?t(this.Pv):t;const e=this.Pv;return this.Qa.Dv(e),this.zm.Ms(),this}getPointStyle(){return this.Pv}}const cl={Triangulated:ll,Pixelated:ul};class dl extends oa{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Lv=[],this.Rv=0,this.Ev=t=>{const e=this.Lv.indexOf(t);e>=0&&(this.Lv.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.zv=this.hs.kg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Lv.forEach((e=>e.setAnimationHighlight(t))),this}Vv(t,e){this.zv.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.Ov.Be(t),this.cs.Ms(),this}getSeriesBackgroundFillStyle(){return this.Ov.Xh()}setSeriesBackgroundStrokeStyle(t){return this.Nv.De(t),this.cs.Ms(),this}getSeriesBackgroundStrokeStyle(){return this.Nv.mo()}setSeriesBackgroundEffect(t){return this.zv.bs(t),this.cs.Ms(),this}getSeriesBackgroundEffect(){return this.zv._s()}Gv(t){this.Lv.push(t),void 0!==this.Wv&&t.setHighlightOnHover(this.Wv),this.R.emit("seriesAdded",this,t)}ef(){return this.Lv}setSeriesHighlightOnHover(t){return this.Wv=t,this.Lv.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Lv.slice().forEach(kt),super.dispose()}Ep(t){return this.R.on("seriesAdded",t)}Uv(t){return this.R.off(t)}Yv(t){return this.R.on("seriesDispose",t)}Hv(t){return this.R.off(t)}}const fl=Ve.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class gl{constructor(t,e,i,s){this.$v=!0,this.Xv=!0,this.jv=2*-Math.PI/2160,this.Zv=2*Math.PI/2160,this.Qv=.1,this.Jv=1*Math.PI/180,this.Kv=t,this.qv=e,this.tS=i,this.Qm=s}getDefaultCameraConfiguration(t){const e={direction:fl,location:Ve.multiply(fl,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:e.direction,cameraLocation:e.location})||e}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.iS(i,t):"wheel-zoom"===t.type?i=this.sS(i,t):"rotate+zoom"===t.type?i=this.eS(i,t):"fixed-rotate"===t.type?i=this.hS(i,t):"move"===t.type&&(i=this.rS(i,t))})),this.$v?i=this.nS(t.boundingBox,i):this.Xv&&(i=this.oS(t.boundingBox,i)),i}iS(t,e){const{rotation:i}=e,s=t.location,r=Ve.multiply(Ve.normalize(t.location),-1),{Right:n,Up:o}=this.aS(r);let h=s;const a=this.lS(r),l=i.x*this.jv*a;h=Ve.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Zv,a-this.Jv);return 0!==u&&(h=Ve.rotateAroundAxis(h,n,u)),{location:h,direction:Ve.multiply(Ve.normalize(h),-1)}}sS(t,e){const{deltaY:i}=e;this.$v&&this.uS(!1);const s=t.location,r=Ve.multiply(Ve.normalize(s),-1),n=i*this.Qv,o=Ve.length(s)*-n;return{direction:r,location:Ve.addVec(s,Ve.multiply(r,o))}}eS(t,e){const{rotation:i,cameraDistance:s}=e;this.$v&&this.uS(!1);let r=this.iS(t,{type:"rotate",rotation:i});const n=r.location,o=Ve.multiply(Ve.normalize(n),-1),h=Ve.multiply(o,-s);return r={direction:Ve.multiply(Ve.normalize(h),-1),location:h},r}hS(t,e){this.$v&&this.uS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.aS(r),h=i.x*this.jv;let a=Ve.normalize(Ve.rotateAroundAxis(r,o,h));const l=i.y*this.Zv;return a=Ve.normalize(Ve.rotateAroundAxis(a,n,l)),{location:s,direction:a}}rS(t,e){this.$v&&this.uS(!1),this.Xv=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.aS(n);return{location:Ve.addVec(r,Ve.multiply(n,.01*s),Ve.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ve.multiply(Ve.normalize(t.cameraLocation),-1)};return this.$v?this.nS(t.boundingBox,e):this.oS(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ve.multiply(Ve.normalize(t.cameraLocation),-1)};return this.$v?this.nS(t.boundingBox,e):this.oS(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ve.multiply(Ve.normalize(t.cameraLocation),-1)};if(this.$v)return this.nS(t.boundingBox,e)}nS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.cS(t,s,100,20,1,i,5);const r=this.lS(s.direction);return s=this.dS(s,this.fS(t,s,100,1),r),s}cS(t,e,i,s,r,n,o){return yl(n,o,(t=>({direction:e.direction,location:Ve.multiply(e.direction,-t)})),(e=>this.AS(t,e)),i,r,"linear",s)}fS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.aS(e.direction),a=this.gS(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:Ve.normalize(Ve.lerp(l.direction,h,t))})),(e=>this.pS(t,e)),0,u,!0,i):ml(0,c,(t=>({location:l.location,direction:Ve.normalize(Ve.lerp(l.direction,o,t))})),(e=>this.pS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ve.normalize(Ve.lerp(l.direction,n,t))})),(e=>this.yS(t,e)),0,u,!0,i):ml(0,c,(t=>({location:l.location,direction:Ve.normalize(Ve.lerp(l.direction,r,t))})),(e=>this.yS(t,e)),0,u,!0,i)),l}AS(t,e){const i=this.gS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}yS(t,e){const i=this.gS(t,!1,e);return Math.abs(i.left-i.right)}pS(t,e){const i=this.gS(t,!1,e);return Math.abs(i.top-i.bottom)}gS(t,e,i){const s=Je(this.mS(t,e,i).map((t=>ct(t,this.Kv,this.qv))));return{left:s.min.x,right:this.qv.x.getInnerEnd()-s.max.x,top:this.qv.y.getInnerEnd()-s.max.y,bottom:s.min.y}}mS(t,e,i){const s=this.tS,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.Qm(t,i))).filter((t=>void 0!==t))}oS(t,e){const i=Ve.length(e.location),s=this.vS(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)de(this.Te),this.av=Qn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.Te=ye(this.ts.surfaceGridSeries3DFillStyle,o),this.bS=ye(this.ts.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Kn=h,this.Qa=this.zm._S(h).Be(this.Te).MS(this.bS).yv(this.av).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.mg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:K(this.Te)?this.Te.lut:void 0}}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}wS(){const t=this.xS.start||{x:0,z:0};let e;e=this.xS.end?{x:(this.xS.end.x-t.x)/this.Kn.columns,z:(this.xS.end.z-t.z)/this.Kn.rows}:this.xS.step?this.xS.step:{x:1,z:1},this.Qa.CS(t,e),this.chart.cs.Ms()}setStart(t){return this.xS.start=t,this.wS(),this}getStart(){return this.Qa.kS().start}setStep(t){return this.xS.step=t,this.wS(),this}getStep(){return this.Qa.kS().step}setEnd(t){return this.xS.end=t,this.wS(),this}getEnd(){return this.Qa.kS().end}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.Qa.Be(this.Te),this.zm.Ms(),this}getFillStyle(){return this.Te}setWireframeStyle(t){return this.bS="function"==typeof t?t(this.bS):t,this.Qa.MS(this.bS),this.zm.Ms(),this}getWireframeStyle(){return this.Qa.TS()}setIntensityInterpolation(t){return t=t||"disabled",this.Qa.FS(t),this.zm.Ms(),this}getIntensityInterpolation(){return this.Qa.IS()}invalidateIntensityValues(t){if(this._v&&this.chart.cs.Zn(fh.Tf),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.Kn.dataOrder?t.length:t[0].length,rows:"rows"===this.Kn.dataOrder?t.length:t[0].length},i="columns"===this.Kn.dataOrder?this.Kn.columns:this.Kn.rows,s="columns"===this.Kn.dataOrder?this.Kn.rows:this.Kn.columns;if(e.x>i||e.y>s){if(!0===this.chart.SA.io){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Kn.columns}x${this.Kn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;Ct.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.SA.io){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Kn.columns}x${this.Kn.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.`;Ct.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.SA.io){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Kn.columns}x${this.Kn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;Ct.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.SA.io){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Kn.columns}x${this.Kn.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.`;Ct.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;ede(this.Te),this.chart.cs.Zn(fh.Tf),this.av=Qn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.Te=ye(this.ts.surfaceScrollingGridSeries3DFillStyle,o),this.bS=ye(this.ts.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Kn=h,this.Qa=this.zm.RS(h).Be(this.Te).MS(this.bS).yv(this.av).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.mg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:K(this.Te)?this.Te.lut:void 0}}wS(){const t=this.xS.start||{x:0,z:0};let e;e=this.xS.step?this.xS.step:{x:1,z:1},this.Qa.CS(t,e),this.chart.cs.Ms()}setStart(t){return this.xS.start=t,this.wS(),this}getStart(){return this.Qa.kS().start}setStep(t){return this.xS.step=t,this.wS(),this}getStep(){return this.Qa.kS().step}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.Qa.Be(this.Te),this.zm.Ms(),this}getFillStyle(){return this.Te}setWireframeStyle(t){return this.bS="function"==typeof t?t(this.bS):t,this.Qa.MS(this.bS),this.zm.Ms(),this}getWireframeStyle(){return this.Qa.TS()}setIntensityInterpolation(t){return t=t||"disabled",this.Qa.FS(t),this.zm.Ms(),this}getIntensityInterpolation(){return this.Qa.IS()}clear(){return this.Qa.Ot(),this.zm.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.Kn.scrollDimension?this.Kn.rows:this.Kn.columns;if(i>s-1){if(!0===this.chart.SA.io){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Kn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;Ct.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.chart.SA.io){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Kn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;Ct.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.ES({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.zm.Ms(),this}setCullMode(t){return this.Qa.BS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Qa.LS()}vv(){}Re(){}_m(){}ov(){return this.uv&&this.getVisible()}ze(t,e){t.ds(e),this.zm.Ms()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}}const xl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Tl),Sl=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 vl extends sl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Cs="Mesh Model 3D",this.zS=new Float32Array,this.At={x:1,y:1,z:1},this.VS={x:0,y:0,z:0},this.OS={x:0,y:0,z:0},this.NS={x:0,y:0,z:0},this.GS={x:0,y:0,z:0},this.tl=Oe,this.Zd=()=>de(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.chart.getSeries().length;this.Qa=this.zm.WS().mv(this.cv).Be(ye(this.ts.meshModel3DFillStyle||this.ts.pointSeriesFillStyle,o)).ds(this.getHighlight()),this.As(this.Qa)}Ki(t,e){const i=this.getFillStyle();return Be({series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:K(i)?i.lut:void 0},{cursorPosition:0,index:0,x:0,y:0,z:0,value:0},(()=>{const s=this.Qa.US(t,e);if(s)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.mg,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:K(i)?i.lut:void 0}}))}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=_e,n=ze,o=_e,h=ze,a=_e,l=ze;for(let t=0;te(t)))}return r.pointMarker.setPosition(s),this.chart.cs.Ms(),this}}class Ml{constructor(t,e){this.gy=[],this.py=(t,e)=>(this.gy.forEach((i=>i(t,e))),t),this.addStyler=t=>new Ml(this.ly,this.gy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new Ml(t,this.gy.map((t=>t))),this.yy=(t,e,i,s,r,n)=>this.py(new bl(t,e,i,s,this.ly,r,n),r),this.ly=t,this.gy=e}}const Cl=new Ml(Co,[(t,e)=>{xa(t)}]);class Tl extends dl{constructor(t,e,i,s,r,n,o){var h;super(t,e,i,e.kp("chart3D bg",0),s,e.cs.ts.chart3DBackgroundFillStyle,e.cs.ts.chart3DBackgroundStrokeStyle,e.cs.ts.chart3DTitleFont,e.cs.ts.chart3DTitleFillStyle,n),this.ix=1,this.sx=[],this.hx=2,this.nx=!0,this.ox=!0,this.lx=!0,this.ux=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.yn=[],this.wn=()=>{const t=this.zm.Ax();this.yx.gx(t),this.mx.gx(t);const e=this.vx.viewportChanged(this.Sx());e&&this.xx(e),this.cs.Ms()},this.bx=!1,this.fv=(t,e,i,s,r)=>{if(this.bx=!0,this.lx){const t=r;this.sx.push({type:"rotate",rotation:t}),this.cs.Ms(),Qt(e)}},this.Av=(t,e,i,s,r)=>{this.bx=!1},this.dv=(t,e)=>{if(this.ox){if(this.nx)Math.sign(this.ux)!==Math.sign(e.deltaY)?this.ux=me(e):this.ux+=me(e);else{const t=me(e);this.sx.push({type:"wheel-zoom",deltaY:t})}this.cs.Ms(),Qt(e)}},this.cs.Zn(fh.Sf),this.bh.yr("Chart3D"),this.Mx=i.d3(),this.Mx.x.q(-1,1),this.Mx.y.q(-1,1),this.Mx.z.q(-1,1),this.zm=e._x("chart3D layer3D",0,this.Mx),this.yx=e.wx("chart3D series bg",0),this.mx=e.Xy("chart3D axis ui",1),this.Cx={x:new Qa(this,(h=()=>this.Lv,{...tl(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Dr().x)),Dm:t=>t.x,qm:(t,e)=>({x:t.x,y:e.y,z:e.z}),rf:f(0,-1,0),tv: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)}},hv:()=>!0,rv:()=>!1,Km:()=>!1}),this.Mx.x,this.ts,this.zm,this.mx,this.mg,!1,this.hs),y:new Qa(this,el((()=>this.Lv)),this.Mx.y,this.ts,this.zm,this.mx,this.mg,!1,this.hs),z:new Qa(this,il((()=>this.Lv)),this.Mx.z,this.ts,this.zm,this.mx,this.mg,!1,this.hs)},this.kx=this.zm.om([Ua.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.ts.chart3DBoundingBoxStrokeStyle),this.Ov=this.yx.lc(this.cs.At,mn.Simple).Be(this.ts.chart3DSeriesBackgroundFillStyle).De(nt).setMouseInteractions(!0),this.Nv=this.yx.lc(this.cs.At,mn.Simple).Be(z).De(this.ts.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Vv(this.Ov,this.Nv),this.Tx({x:1,y:1,z:1},!0),this.vx=new gl(this.cs.At,this.mg,this.Mx,((t,e)=>(e&&this.xx(e),this.zm.Qm(t)))),this.Fx=this.vx.getDefaultCameraConfiguration(this.Ix(this.Px)),this.xx(this.Fx);const a=Bt(o?o.cursorBuilder:void 0,Cl),l=e.Zy();let c;this.Qy=ua(this,l,a.yy(l,this.mg,this.mg,Et,this.ts,this),this,"show-pointed",Rl,(()=>0)),this.gv=Ji(new is(((t,e,i)=>{c={locationOne:e,locationTwo:i,cameraLocation:this.zm.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.lx&&!this.ox)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=Ve.length(c.cameraLocation),l=o/h*a,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.sx.push({type:"rotate+zoom",rotation:this.lx?d:{x:0,y:0},cameraDistance:this.ox?l:a}),this.cs.Ms(),Qt(n)}),(t=>{})),new es((t=>{}),((t,e,i,s,r)=>{if(this.lx){const t=s;this.sx.push({type:"rotate",rotation:t}),this.cs.Ms(),Qt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.gv.onTouchStart),this.onBackgroundTouchMove(this.gv.onTouchMove),this.onBackgroundTouchEnd(this.gv.onTouchEnd),this.onSeriesBackgroundTouchStart(this.gv.onTouchStart),this.onSeriesBackgroundTouchMove(this.gv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.gv.onTouchEnd),this.onBackgroundMouseDrag(this.fv),this.onBackgroundMouseDragStop(this.Av),this.onBackgroundMouseWheel(this.dv),this.onBackgroundMouseDown(((t,e)=>{Qt(e)})),this.onSeriesBackgroundMouseDrag(this.fv),this.onSeriesBackgroundMouseDragStop(this.Av),this.onSeriesBackgroundMouseWheel(this.dv),this.onSeriesBackgroundMouseDown(((t,e)=>{Qt(e)})),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.wn),this.wn(),this.Cp(r,this.mg)}setProjection(t){this.zm.Dx(t);const e=this.vx.viewportChanged(this.Sx());return e&&this.xx(e),this.cs.Ms(),this}getProjection(){return this.zm.Bx()}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Cl){const e=this.gp(),i=t.yy(e,this.mg,this.mg,this.up(e),this.ts,this);return this.Mp(i),i}addPointSeries(t){const e=new(t&&t.type||ll)(this,this.Ev,this.zm,this.ts,this.cs.hs,t);return this.Gv(e),e}addLineSeries(t){const e=new ol(this,this.Ev,this.zm,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addPointLineSeries(t){const e=new hl(this,this.Ev,this.zm,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addSurfaceGridSeries(t){const e=new pl(this,this.Ev,this.zm,t,this.ts,this.cs.hs);return this.Gv(e),e}addSurfaceScrollingGridSeries(t){const e=new Al(this,this.Ev,this.zm,t,this.ts,this.cs.hs);return this.Gv(e),e}addBoxSeries(t){const e=new rl(this,this.Ev,this.zm,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addMeshModel(t){const e=new vl(this,this.Ev,this.zm,this.ts,t,this.cs.hs);return this.Gv(e),e}translateCoordinate(t,e,i){if(xl(e)||xl(i)||Sl(t)){if(xl(e)&&xl(i)&&Sl(t)){if("axes"===e.id&&"world"===i.id)return this.zm.Lx(t);if("world"===e.id&&"axes"===i.id)return this.zm.Rx(t);if(e.id===i.id)return t}if(xl(e)&&Oi(i)&&Sl(t)){const e=this.zm.Qm(t);return e?this.cs.Go({engineX:e.x,engineY:e.y}):{clientX:-1,clientY:-1}}if(xl(e)&&Yi(i)&&Sl(t)){const e=this.zm.Qm(t);return e?ct(e,this.cs.At,this.mg):{clientX:-1,clientY:-1}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return ea(t,e,i,this.mg,this.cs)}getDefaultAxisX(){return this.Cx.x}getDefaultAxisY(){return this.Cx.y}getDefaultAxisZ(){return this.Cx.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.Cx.x,this.Cx.y,this.Cx.z]}setCameraLocation(t){let e={location:t,direction:Ve.normalize(Ve.multiply(t,-1))};const i=this.vx.cameraLocationChanged(this.Sx(e));return i&&(e=i),this.xx(e),this.cs.Ms(),this}getCameraLocation(){return this.zm.getCameraLocation()}getCameraDirection(){return this.zm.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.vx.uS(t);const e=this.vx.cameraLocationChanged(this.Sx());return e&&this.xx(e),this}getCameraAutomaticFittingEnabled(){return this.vx.SS()}onCameraChange(t){return this.R.on("cameraChange",t)}offCameraChange(t){return this.R.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.kx.We(t).Wm(Ka(this.kx.mu())),this.zm.Ms(),this}getBoundingBoxStrokeStyle(){return this.kx.mu()}setBoundingBox(t){return this.Tx(t,!1),this}Tx(t,e){this.Px=t;const i=this.Ix(t);if(this.Mx.x.it(i.x),this.Mx.y.it(i.y),this.Mx.z.it(-i.z),!e){const t=this.vx.boundingBoxChanged(this.Sx());t&&this.xx(t)}this.cs.Ms()}getBoundingBox(){return this.Px}Re(t){if(ha.Rp(this.bh,this.Tp),0!==this.ux){const e=this.ux*t*.006;this.sx.push({type:"wheel-zoom",deltaY:e}),this.ux=Math.sign(this.ux)*Math.max(Math.abs(this.ux)-.01*t,0),0!==this.ux&&this.cs.Ms(!0)}const e=this.getCameraDirection();if(this.sx.length>0){const t=this.vx.applyCameraInteractions(this.Sx(),this.sx);t&&this.xx(t),this.sx.length=0}this.Ex&&Ve.equals(this.Ex.location,this.Fx.location)&&Ve.equals(this.Ex.direction,this.Fx.direction)||this.R.emit("cameraChange",this,this.getCameraLocation()),this.Ex=this.Fx,super.Re(t);for(let t=0;tthis.zm.Qm(t))),o=this.zm.Qm(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=oe(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.yn.length=0,this.Mx.Y(),this.zm.Y(),this.mx.Y(),this.yx.Y(),this.Qy.Y(),super.dispose()}J(){return this.Mx.x.J(),this.Mx.y.J(),this.Mx.z.J(),super.J()}K(){return super.K()}xx(t){this.zm.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ve.addVec(t.location,Ve.multiply(t.direction,-this.hx))),this.Fx=t,this.cs.Ms()}Ix(t){return Ve.divide(t,Ve.length(t)/this.ix)}Sx(t=this.Fx){return{boundingBox:this.Ix(this.Px),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.ox=t,this}getMouseInteractionZoom(){return this.ox}setMouseInteractionRotate(t){return this.lx=t,this}getMouseInteractionRotate(){return this.lx}forEachAxis(t){return t(this.Cx.x),t(this.Cx.y),t(this.Cx.z),this}getSeries(){return this.Lv}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.nx=!!t,this}getAnimationZoom(){return this.nx}}const Rl=(t,e,i)=>{var s,r;return gt(e)?la(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Wi(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Wi(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:Wi(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:Wi(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):mt(e)?la(e,[[e.series],void 0!==e.value?["Value","",{text:Wi(e.value.toFixed(2),null===(r=e.lut)||void 0===r?void 0:r.units),font:{weight:"bold"}}]:[]]):la(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Wi(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Wi(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:Wi(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}]])},wl={Column:zo,Row:_o};class kl extends ra{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.zx=new Map,this.Vx=this.addUIElement(wl.Row).setPosition({x:0,y:100}).setOrigin(Bs.LeftTop).setBackground((t=>t.setFillStyle(z).setStrokeStyle(nt)))}add(t,e){return(t instanceof oa?[t]:t instanceof bf?t.getCells().filter((t=>t.panel instanceof oa)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Vx.addElement(dh.VerticalLegendBox).setBackground((t=>t.setFillStyle(z).setStrokeStyle(nt))).add(t,e).setTitle(t.getTitle());this.zx.set(t,i)})),this.cs.Ms(),this}setLegendBoxes(t){return this.zx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Vx.getSize()}}const El={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Il=(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(),Fl=(t,e)=>{let i=e.geometry;return i=Dl(t,e,i),i=Bl(t,e,i),i},Dl=(t,e,i)=>{if(t===El.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===El.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=Je(Dt(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.Hx&&Ct.setTimeout((()=>t())),e},this.onViewChange=t=>this.R.on("viewChange",t),this.$x=(t,e,i,s,r)=>{this.At.x.it(s).si([this.Xt.left+this.ka.left,this.Xt.right+this.ka.right]),this.At.y.it(r).si([this.Xt.bottom+this.ka.bottom,this.Xt.top+this.ka.top+ha.Lp(this.bh,this.Tp)]),this.Xx&&this.jx(this.Zx,this.At,this.Xx)},this._t=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Jx(s),Qt(t)),this.Ux&&this.cs.us.ks(r,!0),this.Kx=r,this.R.emit("mouseEnter",this,t,s))},this.wt=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i),r=null==s?void 0:s.region;this.qx(),r&&(this.Ux&&this.cs.us.ks(r,!1),this.Kx=void 0,this.R.emit("mouseLeave",this,t,s),t&&Qt(t))},this.It=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Jx(s),Qt(t)),this.Kx=r,this.R.emit("mouseMove",this,t,s))},this.Ct=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i);this.R.emit("mouseClick",this,t,s)},this.kt=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i);this.R.emit("mouseDoubleClick",this,t,s)},this.Tt=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i);this.R.emit("mouseDown",this,t,s)},this.Ft=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i);this.R.emit("mouseUp",this,t,s)},this.Dt=(t,e,i)=>{const s=i;if(!s||!this.Hx)return;const r=this.Qx(this.Hx,s);this.R.emit("mouseDragStart",this,t,e,r)},this.Pt=(t,e,i,s,r)=>{const n=r;if(!n||!this.Hx)return;const o=this.Qx(this.Hx,n);this.R.emit("mouseDrag",this,t,e,i,s,o)},this.Bt=(t,e,i,s)=>{const r=s;if(!r||!this.Hx)return;const n=this.Qx(this.Hx,r);this.R.emit("mouseDragStop",this,t,e,i,n)},this.Lt=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i);this.R.emit("mouseWheel",this,t,s)},this.Rt=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i),r=null==s?void 0:s.region;r&&(this.Jx(s),this.Ux&&this.cs.us.ks(r,!0),this.Kx=r,this.R.emit("touchStart",this,t,s),Qt(t))},this.Et=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i),r=null==s?void 0:s.region;r&&(this.Jx(s),this.Kx=r,this.R.emit("touchMove",this,t,s),Qt(t))},this.zt=(t,e)=>{const i=e;if(!i||!this.Hx)return;const s=this.Qx(this.Hx,i),r=null==s?void 0:s.region;this.qx(),r&&(this.Ux&&this.cs.us.ks(r,!1),this.Kx=void 0,this.R.emit("touchEnd",this,t,s),Qt(t))},this.cs.Zn(fh.bf),this.dh=!1!==(null==n?void 0:n.animationsEnabled),this.tb=e.Xy("mapChart plotting",0),this.onResize(this.$x),this.bh.yr("Map Chart");const h=e.Zy(),a=Bt(n?n.cursorBuilder:void 0,ka);this.Qy=ua(this,h,a.yy(h,this.uiScale,this.uiScale,Et,this.ts),void 0,"show-pointed",_l,(()=>0)),this.ib=this.hs.kg(),this.Cp(r,this.uiScale),this.sb=this.tb.Hm(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))).Be(this.ts.mapChartFillStyle).De(this.ts.mapChartStrokeStyle),this.eb=this.tb.Hm(this.At).setMouseInteractions(this.$i).Be(this.ts.mapChartOutlierRegionFillStyle).De(this.ts.mapChartOutlierRegionStrokeStyle);const l=Bt(n&&n.type,El.World);this.Zx=l,this.hb(l).then((()=>{this.R.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Kx}setFillStyle(t){return this.sb.Be(t),this.cs.Ms(),this}getFillStyle(){return this.sb.Xh()}setStrokeStyle(t){return this.sb.De(t),this.cs.Ms(),this}getStrokeStyle(){return this.sb.mo()}setEffect(t){return this.ib.bs(t),this.cs.Ms(),this}getEffect(){return this.ib._s()}setOutlierRegionFillStyle(t){return this.eb.Be(t),this.cs.Ms(),this}getOutlierRegionFillStyle(){return this.eb.Xh()}setOutlierRegionStrokeStyle(t){return this.eb.De(t),this.cs.Ms(),this}getOutlierRegionStrokeStyle(){return this.eb.mo()}setSeparateRegionFillStyle(t){return this.Nx="function"==typeof t?t(this.Nx):t,this.Ox.forEach((t=>t.Be(this.Nx))),this.cs.Ms(),this}getSeparateRegionFillStyle(){return this.Nx}setSeparateRegionStrokeStyle(t){return this.Gx="function"==typeof t?t(this.Gx):t,this.Ox.forEach((t=>t.De(this.Gx))),this.cs.Ms(),this}getSeparateRegionStrokeStyle(){return this.Gx}invalidateRegionValues(t){if(!this.Hx||!this.rb)return this.nb=this.nb||[],this.nb.push(t),this;if("function"==typeof t)for(let e=0;e{t.ob(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.ob(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.sb.setMouseInteractions(t),this}getMouseInteractions(){return this.$i}setHighlight(t){var e;return t=be(t),this.Wx=t,null===(e=this.Hx)||void 0===e||e.regions.forEach((e=>{this.cs.us.ks(e,t)})),this.R.emit("highlight",this,t),this}getHighlight(){return this.Wx}setAnimationHighlight(t){var e;return null===(e=this.Hx)||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.Hx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Ux=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Ux}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 hb(t){const e=await((t,e)=>{let i;if(t===El.World)i="countries_world.json";else if(t===El.NorthAmerica)i="countries_northAmerica.json";else if(t===El.SouthAmerica)i="countries_southAmerica.json";else if(t===El.Africa)i="countries_africa.json";else if(t===El.Europe)i="countries_europe.json";else if(t===El.Asia)i="countries_asia.json";else if(t===El.USA)i="states_usa.json";else if(t===El.Canada)i="territoriesProvinces_canada.json";else{if(t!==El.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw Ct.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return Ct.fetch(s).then((t=>t.json())).catch((t=>{we(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.SA.Ks);this.rb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Pl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.eb.Xr().Cl(e);if(t===El.USA){const t=25.8,e=29.7;this.Ox.push(this.tb.Le(this.At).setMouseInteractions(!1).Be(this.Nx).De(this.Gx).Ee({x:-126,y:t}).it({x:10,y:e-t}),this.tb.Le(this.At).setMouseInteractions(!1).Be(this.Nx).De(this.Gx).Ee({x:-113,y:t}).it({x:7,y:e-t}))}const s=this.cs.us.$r(this.sb,{animationEnabled:this.dh});for(let i=0;i{o.forEach((e=>e.ds(t)))}))}if(this.ib.gs([this.sb]),this.Xx=i,this.jx(t,this.At,i),this.Hx=e,this.nb){for(const t of this.nb)this.invalidateRegionValues(t);this.nb=void 0}this.cs.Ms()}jx(t,e,i){const s=Ll[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]}})}Jx(t){this.ab=t,this.cs.Ms()}qx(){this.ab=void 0,this.cs.Ms()}Qx(t,e){const i=Array.from(this.Yx.entries()).findIndex((([t,i])=>i.includes(e))),s=null==t?void 0:t.regions[i],r=this.cs.Xn();if(!r)return;const n=this.cs.No(r),o=this.rb&&this.rb[i];let h=ct({x:n.engineX,y:n.engineY},this.cs.At,this.At);h={x:Ft(h.x,this.At.x.getInnerStart(),this.At.x.getInnerEnd()),y:Ft(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:K(c)?c.lut:void 0}}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=ka){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}setAnimationsEnabled(t){return this.dh=!t,this}getAnimationsEnabled(){return this.dh}getMinimumSize(){}ef(){return[this]}Re(t){super.Re(t),super.wp(),ha.Rp(this.bh,this.Tp);const e=m(this.At.x.ei(),this.At.y.ei(),this.At.x.ri(),this.At.y.ri());return this.tb.gx(e),this.Qy.Re(!1,[],void 0,{explicitTarget:this.ab}),this}dispose(){return this.tb.Y(),this.Qy.Y(),sa(this.At),super.dispose()}J(){return super.J(),this.At.J(),this}K(){return super.K(),this.At.K(),this}Zd(){return de(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){ce(t,this.ts,e,{fill:this.getFillStyle()})}}const zl=(t,e)=>{const i=t>0,s=e>0;return`${[ge(Math.abs(0|t),2),"° ",ge(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ge(Math.abs(0|e),2),"° ",ge(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`},_l=(t,e,i)=>{var s;const r=[[e.region.name],[zl(e.longitude,e.latitude)]];return void 0!==e.value&&r.push({text:Wi(e.value.toFixed(1),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}),r};class Nl extends hr{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.lb(i),s,r,{numeric:e.ub({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.ub({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.ub({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.cb=n,this.fb=o,this.Ab=h,this.hs=a,this.gb=i,this.pb=e.ub({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.wh=h.Gr(i).setMouseInteractions(!1).Qh(e.ub({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Be(e.ub({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.qh=this.hs.kg([this.wh]).bs(s.effectsText)}setTickStrategy(t,e){return super.Gh(t,e)}setStrokeStyle(t){return this.pb="function"==typeof t?t(this.pb):t,this.fb.Ms(),this}getStrokeStyle(){return this.pb}Sr(t,e){return new Ol(e,t,this.gb,this.Ab,this.yb(this.cb,this.gb),this.Ab.Ue(this.gb).setMouseInteractions(!1))}br(t,e){const i=this.mb(this.gb,t);this.vb&&!1===this.vb(t)?t.ih.setVisible(!1):t.ih.setVisible(!0).Ee(ui(this.Sb(this.gb,t.M),i.padding)).$a(i.alignment).Jh(i.rotation).Na(i.offset.x,i.offset.y),this.xb(this.gb,t.bb,t.Mb,t)}setMouseInteractions(t){return this}Re(){this.ar({physicalAxisSize:0});const t=this.wr(((t,e)=>{const i=e.Dh.vr,s=.5*this.pb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.ih.zs().ed().y);return Math.max(t,s)}),0);return this._b(this.gb,this.pb,t),this.wb(this.gb,this.wh,t),t}}class Ol extends ar{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.bb=r,this.Mb=n,r.setMouseInteractions(!1),this.ss.push(r,n)}}class Ul extends Nl{constructor(t,e,i,s,r,n,o,h,a){super(t,Yl((()=>this.Lg())),e,i,s,r,n,o,h),this.Gm=this.fb.Ue(this.gb).setMouseInteractions(!1),this.Cb=a,this.setScrollStrategy(Ws.expansion),this.setTickStrategy(Ks.Numeric),this.setTitle("Amplitude")}Lg(){return this.Cb()}Lr(t,e){return Xi(t,e,this.gb.y)}Er(t,e,i){const s=2*(e-t),r=this.gb.x.Li(s);return{min:t-i*r,max:e+i*r}}Sb(t,e){return{x:t.kb()?e-t.Tb().start:t.Tb().start-e,y:0}}yb(t,e){return t.nd(e)}xb(t,e,i,s){const r=s.Dh.vr,n=t.kb()?s.M-t.Tb().start:t.Tb().start-s.M;It(s.M,t.Tb().start)||It(s.M,t.Tb().end)?e.setVisible(!1):e.setVisible(!0).cu(0).Ye(360).pu(void 0).gu(0).du(n).pu(60).Be(z).De(r.gridStrokeStyle);const o=.5*this.pb.getThickness();i.He({x:n,y:-o*t.Wi().y}).Ye({x:n,y:-(o+r.tickLength)*t.Wi().y}).We(r.tickStyle)}mb(t,e){const i=e.Dh.vr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.pb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}_b(t,e,i){const s=t.kb()?t.Tb().end-t.Tb().start:t.Tb().start-t.Tb().end;this.Gm.He({x:0,y:0}).Ye({x:s,y:0}).We(e)}wb(t,e,i){const s=t.kb()?(t.Tb().start+t.Tb().end)/2-t.Tb().start:t.Tb().start-(t.Tb().start+t.Tb().end)/2;e.$a({x:0,y:1}).Ee({x:s,y:-i*t.Wi().y})}}const Yl=t=>({...tl(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),lb:t=>({getInnerStart:()=>t.Tb().start,getInnerEnd:()=>t.Tb().end,q:(e,i)=>t.Fb(e,i),ut:(e,i,s,r,n)=>t.y.ut(e,i,s,r,n)}),ub:t=>t.amplitude});class Gl extends Nl{constructor(t,e,i,s,r,n,o,h){super(t,Wl,e,i,s,r,n,o,h),this.Ib=90,this.Pb=12,this.Db=Hl,this.Gm=this.fb.nd(this.gb).setMouseInteractions(!1),this.vb=t=>{let e=180*(t.M-this.gb.Bb())/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.ah=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Ib)}setTickStyle(t){return this.Lb="function"==typeof t?t(this.Lb):t,this.Rb(),this.fb.Ms(),this}getTickStyle(){return this.Lb}setTickFormattingFunction(t){return this.Db=t,this.Rb(),this.fb.Ms(),this}getTickFormattingFunction(){return this.Db}setClockwise(t){this.gb.Eb(t);const e=this.Ib*Math.PI/180;return t?this.gb.zb(e+Math.PI/2):this.gb.zb(e-Math.PI/2),this.fb.Ms(),this}getClockwise(){return!this.gb.Vb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Ib=t;const e=t*Math.PI/180;return this.getClockwise()?this.gb.zb(e+Math.PI/2):this.gb.zb(e-Math.PI/2),this.fb.Ms(),this}getNorth(){return 180*this.gb.Bb()/Math.PI}setDivision(t){return this.Pb=t,this.Rb(),this.fb.Ms(),this}getDivision(){return this.Pb}Lg(){return[]}Lr(t,e){return e}Er(t,e,i){return{min:t,max:e}}Sb(t,e){const i=t.Vb()?1:-1,s=t.Bb(),r=t.kb()?t.Tb().end-t.Tb().start:t.Tb().start-t.Tb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}yb(t,e){return t.Ue(e)}xb(t,e,i,s){const r=this.Lb,n=t.Vb()?1:-1,o=t.Bb(),h=(s.M-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.kb()?t.Tb().end-t.Tb().start:t.Tb().start-t.Tb().end,c={x:a*u,y:l*u};e.He({x:0,y:0}).Ye(c);const d={x:c.x+a*r.tickLength*t.Wi().x,y:c.y+l*r.tickLength*t.Wi().y};i.He(c).Ye(d),e.We(r.gridStrokeStyle),i.We(r.tickStyle)}mb(t,e){const i=this.Lb,s=t.Vb()?1:-1,r=t.Bb();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.Wi().x,l=Math.sin(o)*h*t.Wi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}_b(t,e,i){const s=t.kb()?t.Tb().end-t.Tb().start:t.Tb().start-t.Tb().end;this.Gm.cu(0).Ye(360).gu(0).du(s+.5*e.getThickness()*t.Wi().x).pu(360).Be(z).De(e)}wb(t,e,i){const s=t.Bb(),r=this.mb(t,{M:0+s}),n=t.kb()?t.Tb().end-t.Tb().start:t.Tb().start-t.Tb().end;e.$a(r.alignment).Jh(r.rotation).Na(r.offset.x,r.offset.y).Ee(ui({x:n,y:0},r.padding))}Rb(){this.sr({Ze:[],Qe:[{ih:"Radial ticks",Hg:0,vr:this.Lb,pr:this.Db,Ur:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Pb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},Bh:{Mr:()=>{},Lh:()=>!1},Yr:void 0}],Je:Hl,Ke:void 0,qe:void 0})}}const Hl=(t,e,i)=>(180*t/Math.PI).toFixed(0),Wl={Fr:()=>{},Ir:()=>{},Dr:()=>{},lb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,q:(t,e)=>{},ut:(e,i,s,r,n)=>t.x.ut(e,i,s,r,n)}),ub:t=>t.radial},Kl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Xl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class jl extends Zi{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Cs="Sector",this.Ob=0,this.Nb=1*Math.PI/2,this.Gb=void 0,this.Wb=void 0,this.Bs=t,this.gb=s,this.Iy=this.Bs.nd(this.gb).ds(this.getHighlight()),this.As(this.Iy),this.Te=r.polarSectorFillStyle,this.Fe=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.Ob=Ft(t,0,360),this.Bs.Ms(),this}getAngleStart(){return this.Ob}setAngleEnd(t){return this.Nb=Ft(t,0,360),this.Bs.Ms(),this}getAngleEnd(){return this.Nb}setAmplitudeStart(t){return this.Gb=t,this.Bs.Ms(),this}getAmplitudeStart(){return this.Gb}setAmplitudeEnd(t){return this.Wb=t,this.Bs.Ms(),this}getAmplitudeEnd(){return this.Wb}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.Bs.Ms(),this}getFillStyle(){return this.Te}setStrokeStyle(t){return this.Fe="function"==typeof t?t(this.Fe):t,this.Bs.Ms(),this}getStrokeStyle(){return this.Fe}Re(){const t=this.gb.Tb(),e=180*this.gb.Bb()/Math.PI,i=void 0!==this.Gb?Ft(this.Gb,t.start,t.end):t.start,s=void 0!==this.Wb?Ft(this.Wb,t.start,t.end):t.end,r=this.gb.kb()?i-t.start:t.start-i,n=this.gb.kb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.gb.Vb()?1:-1,l=Math.abs(this.Nb-this.Ob);this.Iy.cu((this.Ob-e)*a).Ye((this.Nb-e)*a).gu(100*o/h).du(h).Be(this.Te).De(this.Fe).pu(Math.ceil(l/2))}ze(t,e){t.ds(e),this.Bs.Ms()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te,stroke:this.Fe})}}class $l extends Zi{constructor(){super(...arguments),this.uv=!0,this.lv=!0}setAutoScrollingEnabled(t){return this.uv=t,this.chart.cs.Ms(),this}getAutoScrollingEnabled(){return this.uv}vv(){}Re(){}_m(){}setCursorEnabled(t){return this.lv=t,this}getCursorEnabled(){return this.lv}setCursorFormattingOverride(t){return this.pv=t,this}getCursorFormattingOverride(){return this.pv}}class Zl extends $l{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Bs=t,this.chart=e,this.scale=s}getAmplitudeMin(){return this.Ub?this.Ub.min:void 0}getAmplitudeMax(){return this.Ub?this.Ub.max:void 0}}const Ql=(t,e)=>{const i=[],s=e.Tb().start,r=e.Tb().end,n=e.kb(),o=e.Vb()?1:-1,h=e.Bb(),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=Ft(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},ql=t=>{const e={min:ze,max:_e};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Jl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),tu=(t,e)=>{let i=xi(t);for(e.Vb()||(i*=-1),i+=180*e.Bb()/Math.PI;i<0;)i+=360;i%=360;const s=ai(t),r=e.Tb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Gn(r.start,r.end,s/n)}};class eu extends Zl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.Cs="Heatmap Series",this.Yb=!0,this._v=!1,this.Zd=()=>de(this.Te);const h=this.chart.getSeries().length;this.Te=ye(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.Kn=u,this.Hb=t.$b(s,[],u).Be(this.Te).ds(this.getHighlight()),this.As(this.Hb);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.Ub={min:c,max:d},this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.chart.cs.At,this.scale),n=tu(r,this.scale),o=aa(e)?this.Hb.Xb(n):this.Hb.qc(n);if(!o)return;const h=Ql([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:K(this.Te)?this.Te.lut:void 0}}Ki(t,e){return Be({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0,intensity:0,sector:0,annulus:0,lut:K(this.Te)?this.Te.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}invalidateIntensityValues(t){if(this._v&&this.chart.cs.Zn(fh.Tf),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.Kn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Kn.dataOrder?t.length:t[0].length},i="annuli"===this.Kn.dataOrder?this.Kn.annuli:this.Kn.sectors,s="annuli"===this.Kn.dataOrder?this.Kn.sectors:this.Kn.annuli;if(e.x>i||e.y>s){if(!0===this.chart.SA.io){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.`;Ct.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.SA.io){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.`;Ct.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.Hb.PS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Bs.Ms(),this._v=!0,this}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.Hb.Be(this.Te),this.Bs.Ms(),this}getFillStyle(){return this.Te}clear(){return this.Hb.Ot(),this.Bs.Ms(),this}setIntensityInterpolation(t){return t=t||"disabled",this.Hb.FS(t),this.Bs.Ms(),this}getIntensityInterpolation(){return this.Hb.IS()}ov(){return this.uv&&this.getVisible()}ze(t,e){t.ds(e),this.Bs.Ms()}Re(){}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}}class iu extends Zl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Line Series",this.jb=[],this.Zb=!1,this.Qb=!1,this.yu=ye(this.ts.polarLineSeriesStrokeStyle,n),this.Jb=t.om(s,void 0,[Ua.UserSeries]).We(this.yu).ds(this.getHighlight()),this.As(this.Jb)}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=this.Jb.Kb(s);if(!r)return;const n=tu(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Be({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,"show-nearest")))}setData(t){return 0!==this.jb.length&&this.chart.cs.Zn(fh.Tf),this.jb=Jl(t),this.Zb=!0,this.Ub=ql(this.jb),this.Bs.Ms(),this}setStrokeStyle(t){this.yu="function"==typeof t?t(this.yu):t;const e=this.yu;return this.Jb.We(e),this.Bs.Ms(),this}getStrokeStyle(){return this.yu}setConnectDataAutomaticallyEnabled(t){return this.Qb=t,this.Bs.Ms(),this}getConnectDataAutomaticallyEnabled(){return this.Qb}ov(){return this.uv&&this.jb.length>0&&this.getVisible()}ze(t,e){t.ds(e),this.Bs.Ms()}Re(){if(this.Zb||this.scale.qb()){const t=Ql(this.jb,this.scale),e=Je(t);this.Qb?(t.push({...t[0]}),this.Jb.Hl(!0)):this.Jb.Hl(!1),this.Jb.Ot().Al(t).ta(e),this.Zb=!1,this.Jb.zs()}}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{stroke:this.yu})}}class su extends Zl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Cs="Point Line Series",this.jb=[],this.Zb=!1,this.Qb=!1,this.tM=3,this._a=0,this.iM=e.PointShape.Circle,this.Te=ye(this.ts.polarPointLineSeriesFillStyle,o),this.yu=ye(this.ts.polarPointLineSeriesStrokeStyle,o),this.Jb=t.om(r,void 0,[Ua.UserSeries]).We(this.yu).ds(this.getHighlight()),this.As(this.Jb),this.sM=t.Bv(r).Be(this.Te).ll(this.iM).it(this.tM).ds(this.getHighlight()),this.As(this.sM)}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=this.Jb.Kb(s);if(!r)return;const n=tu(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Be({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.jb.length&&this.chart.cs.Zn(fh.Tf),this.jb=Jl(t),this.Zb=!0,this.Ub=ql(this.jb),this.Bs.Ms(),this}setStrokeStyle(t){this.yu="function"==typeof t?t(this.yu):t;const e=this.yu;return this.Jb.We(e),this.Bs.Ms(),this}getStrokeStyle(){return this.yu}setPointFillStyle(t){this.Te="function"==typeof t?t(this.Te):t;const e=this.Te;return this.sM.Be(e),this.Bs.Ms(),this}getPointFillStyle(){return this.Te}setPointSize(t){return this.tM=t,this.sM.it(t),this.Bs.Ms(),this}getPointSize(){return this.tM}setPointShape(t){return this.iM=t,this.sM.ll(this.iM),this}getPointShape(){return this.iM}setPointRotation(t){return this._a=t,this.sM.Jh(t),this.Bs.Ms(),this}getPointRotation(){return this._a}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te,stroke:this.yu})}setConnectDataAutomaticallyEnabled(t){return this.Qb=t,this.Bs.Ms(),this}getConnectDataAutomaticallyEnabled(){return this.Qb}ov(){return this.uv&&this.jb.length>0&&this.getVisible()}ze(t,e){t.ds(e),this.Bs.Ms()}Re(){if(this.Zb||this.scale.qb()){const t=Ql(this.jb,this.scale),e=Je(t);this.Qb?(t.push({...t[0]}),this.Jb.Hl(!0)):this.Jb.Hl(!1),this.Jb.Ot().Al(t).ta(e),this.sM.Ot().Al(t).ta(e),this.Zb=!1,this.Jb.zs(),this.sM.zs()}}Ps(){return this.ws||this.iM}}class ru extends bn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Zo=Fe(),this.R=new r.Eventer,this.ji=!1,this.eM=s,this.hM=n,this.rM=o,this.nM=h,this.oM=a,this.Bs=t,this.scale=e,this.aM=i,this.ts=l}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}dispose(){return this.aM&&this.aM(this),this.Bs.cs.Ms(),this.R.emit("dispose",this),this.ji=!0,this}setVisible(t){return super.setVisible(t),this.rM(),this.Bs.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.nM(this,t),this}getMouseInteractions(){return this.oM(this)}}class nu extends ru{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,p){super(t,e,i,s,r,n,o,h,p),this.lM=1,this.uM=1,this.Bs=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=m,this.boundaries=y(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,m)),this.cM=this.ts.boxSeriesBodyFillStyle,this.dM=this.ts.boxSeriesBodyStrokeStyle,this.yu=this.ts.boxSeriesStrokeStyle,this.fM=this.ts.boxSeriesMedianStrokeStyle,this.zs()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.lM=t,this.zs(),this}getBodyWidth(){return this.lM}setBodyFillStyle(t){return this.cM="function"==typeof t?t(this.cM):t,this.hM(),this}getBodyFillStyle(){return this.cM}setBodyStrokeStyle(t){return this.dM="function"==typeof t?t(this.dM):t,this.hM(),this}getBodyStrokeStyle(){return this.dM}setTailWidth(t){return this.uM=t,this.zs(),this}getTailWidth(){return this.uM}setStrokeStyle(t){return this.yu="function"==typeof t?t(this.yu):t,this.hM(),this}getStrokeStyle(){return this.yu}setMedianStrokeStyle(t){return this.fM="function"==typeof t?t(this.fM):t,this.hM(),this}getMedianStrokeStyle(){return this.fM}zs(){this.eM()}getDominantStyle(){return this.getBodyFillStyle()}}class ou extends $l{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Ds=!0,this.ss=new Map,this.chart=t,this.Bs=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.AM=h,this.scale=Ni(s.At,r.At),this.gM=t.pM,t.pM+=1,this.yM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.mM),this.onMouseLeave(this.chart.vM),this.onMouseWheel(this.chart.dv),this.onMouseDragStart(this.chart.SM),this.onMouseDrag(this.chart.fv),this.onMouseDragStop(this.chart.Av),this.onTouchStart(this.chart.gv.onTouchStart),this.onTouchMove(this.chart.gv.onTouchMove),this.onTouchEnd(this.chart.gv.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}xM(){const t=Array.from(this.ss.keys());for(const e of t)if(e.bM)return e.bM}setClipping(t){return this.Ds=t,this.Bs.Ms(),this}getClipping(){return this.Ds}attacheAxis(){this.MM=this.axisXAttachHandler(this),this._M=this.axisYAttachHandler(this)}As(t,e){super.As(t,e),t.oa(this.gM)}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.gM=t.seriesDrawOrderIndex,this.ss.forEach(((t,e)=>{e.oa(this.gM)})),this.chart.cs.Ms(),this}dispose(){return super.dispose(),this.MM(this),this._M(this),this}_m(){super._m(),Hi(this.Ds,Array.from(this.ss.keys()),this.scale)}getBoundaries(){return y(u(this.getXMin()||0,this.getYMin()||0),u(this.getXMax()||0,this.getYMax()||0))}setCursorEnabled(t){return super.setCursorEnabled(t)}}const hu=(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.wM.findIndex((e=>e===t));e>=0&&this.wM.splice(e,1),this.kM=!0,this.CM=void 0,this.Bs.Ms()},this.eM=()=>{this.CM=void 0,this.kM=!0,this.chart.cs.Ms()},this.hM=()=>{this.kM=!0,this.chart.cs.Ms()},this.rM=()=>{this.CM=void 0,this.kM=!0,this.chart.cs.Ms()},this.nM=(t,e)=>{this.setMouseInteractions(e)},this.TM=t=>this.getMouseInteractions()}Re(){super.Re(),this.kM&&(this.FM(this.wM),this.kM=!1)}clear(){return this.wM.slice().forEach(kt),this.wM.length=0,this.kM=!0,this.CM=void 0,this.Bs.Ms(),this}IM(t,e){void 0!==e?this.wM.splice(e,0,t):this.wM.push(t),this.kM=!0,this.PM&&this.PM(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.Bs.Ms()}ov(){return this.uv&&this.wM.length>0&&this.getVisible()}setDefaultStyle(t){this.PM=t,this.wM.forEach(t),t(this.DM);for(let t=0;t0?this.wM[0].getDominantStyle():this.DM.getDominantStyle()})}}const uu=(t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i0?e:0,this.Bs.Ms(),this}add(t){if(0!==this.LM.length&&this.chart.cs.Zn(fh.Tf),Array.isArray(t)?this.zM(t):this.zM([t]),this._u.length>0){const t=this._u[this._u.length-1];this.VM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.VM?this.VM.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.pl()+e.yl()),this._u.length)}clear(){this.OM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.EM.getXMax(this.LM,this.OM)||0}getXMin(){return this.EM.getXMin(this.LM,this.OM)||0}getYMax(){return this.EM.getYMax(this.LM,this.OM)||0}getYMin(){return this.EM.getYMin(this.LM,this.OM)||0}Dr(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Tl()),t.y=Math.max(t.y,e.Fl());return t}NM(t,e,i,s){this.EM.NM(t,e,i,s,this.scale,(t=>{}))}vv(){super.vv(),this.GM&&this.NM(this.LM,this.getPointAmount(),this.GM,this.RM)}Re(){super.Re();const t=this.getBoundaries();this._u.length>0&&(this.WM(this._u),this._u=[]);for(const e of this.LM)e.ta(t);return super.Re()}_m(){super._m(),this.OM=void 0,this._u.length=0}zM(t){0!==t.length&&(this.OM?this.OM=ei(this.OM,Je(t)):this.OM=Je(t),this.R.emit("dataAdd",this,t,this.OM),this._u=he(this._u,t,{canReturnB:!1}),this.Bs.Ms())}UM(){return au(this.LM)}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}const du=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;hct(this.Ls.toPoint((t.start+t.end)/2,t.median),this.scale,this.Bs.cs.At),this.chart.cs.Zn(fh.Cf),this.Ls=a,this.DM=new nu(this.Bs,this.scale,this.aM,Et,Et,Et,Et,(t=>!1),this.Ls,0,0,0,0,0,0,0,this.ts).dispose(),this.QM=new $a((()=>{const t=this.Bs.Yg(this.scale);return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.We(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.$g(e.start,e.end),i}))))),this.JM=new $a((()=>{const t=this.jM.Mt(this.Bs.Hm(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Be(i.fillStyle).De(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.Cl(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=du(s,this.wM.filter((t=>t.getVisible())),this.ZM,$e);if(!r)return;const n=ct(r[0],this.Bs.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 Be({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())))}yM(t){if(!(t instanceof zi||t instanceof _i))throw new Error("BoxSeries only supports Linear Axes")}FM(t){const e=this.JM.wm(),i=this.QM.wm();t.forEach((t=>{if(!t.getVisible())return;const s=this.Ls.toPoint((t.start+t.end-t.lM*(t.end-t.start))/2,t.lowerQuartile),r=this.Ls.toPoint((t.end-t.start)*t.lM,t.upperQuartile-t.lowerQuartile),n=this.Ls.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Ls.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Ls.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Ls.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Ls.toPoint((t.start+t.end-t.uM*(t.end-t.start))/2,t.lowerExtreme),u=this.Ls.toPoint((t.start+t.end+t.uM*(t.end-t.start))/2,t.lowerExtreme),c=this.Ls.toPoint((t.start+t.end-t.uM*(t.end-t.start))/2,t.upperExtreme),d=this.Ls.toPoint((t.start+t.end+t.uM*(t.end-t.start))/2,t.upperExtreme),f=this.Ls.toPoint((t.start+t.end-t.lM*(t.end-t.start))/2,t.median),g=this.Ls.toPoint((t.start+t.end+t.lM*(t.end-t.start))/2,t.median);e.add({Zo:t.Zo,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.cM,strokeStyle:t.dM}),i.add({Zo:0,start:n,end:o,figure:t},{strokeStyle:t.yu}),i.add({Zo:0,start:h,end:a,figure:t},{strokeStyle:t.yu}),i.add({Zo:0,start:l,end:u,figure:t},{strokeStyle:t.yu}),i.add({Zo:0,start:c,end:d,figure:t},{strokeStyle:t.yu}),i.add({Zo:0,start:f,end:g,figure:t},{strokeStyle:t.fM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new nu(this.Bs,this.scale,this.aM,this.eM,this.hM,this.rM,this.nM,this.TM,this.Ls,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.ts);return this.IM(e),this.kM=!0,this.chart.cs.Ms(),e}}class gu extends ru{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.tl=y(u(0,0),u(0,0)),this.Bs=t,this.scale=e,this.Te=ye(a.ellipseSeriesFillStyle,l),this.Fe=ye(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.tl}setDimensions(t){return this.dimensions=t,this.tl=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.eM(),this.Bs.Ms(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.hM(),this}getFillStyle(){return this.Te}setStrokeStyle(t){return this.Fe="function"==typeof t?t(this.Fe):t,this.hM(),this}getStrokeStyle(){return this.Fe}getDominantStyle(){return this.Te}}class yu extends lu{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.jM=Ee(),this.ZM=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ct(i,this.scale,this.Bs.cs.At)},this.chart.cs.Zn(fh.Cf),this.KM=c,this.DM=new gu(this.Bs,this.scale,Et,Et,Et,Et,Et,(t=>!1),this.ts,this.KM).dispose(),this.JM=new $a((()=>{const t=this.jM.Mt(this.Bs.Hm(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Be(i.fillStyle).De(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.Cl(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=du(s,this.wM.filter((t=>t.getVisible())),this.ZM,$e);if(!r)return;const n=ct(r[0],this.Bs.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 Be({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())))}yM(t){if(!(t instanceof zi||t instanceof _i))throw new Error("EllipseSeries only supports Linear Axes")}FM(t){const e=this.JM.wm();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({Zo:t.Zo,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new gu(this.Bs,this.scale,this.aM,this.eM,this.hM,this.rM,this.nM,this.TM,this.ts,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.cs.Ms(),e}}class mu extends ru{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.qM=[],this.tl=Ne,this.Bs=t,this.scale=e,this.Te=ye(a.polygonSeriesFillStyle,l),this.Fe=ye(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.tl}setDimensions(t){return this.qM=t,this.tl=Je(this.qM),this.eM(),this.Bs.Ms(),this}getDimensions(){return this.qM}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.hM(),this}getFillStyle(){return this.Te}setStrokeStyle(t){return this.Fe="function"==typeof t?t(this.Fe):t,this.hM(),this}getStrokeStyle(){return this.Fe}getDominantStyle(){return this.Te}}class pu extends lu{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.jM=Ee(),this.ZM=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ct(i,this.scale,this.Bs.cs.At)},this.chart.cs.Zn(fh.Cf),this.KM=c,this.DM=new mu(this.Bs,this.scale,Et,Et,Et,Et,Et,(t=>!1),this.ts,this.KM).dispose(),this.JM=new $a((()=>{const t=this.jM.Mt(this.Bs.Hm(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Be(i.fillStyle).De(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.Cl(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=du(s,this.wM.filter((t=>t.getVisible())),this.ZM,$e);if(!r)return;const n=ct(r[0],this.Bs.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 Be({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())))}yM(t){}FM(t){const e=this.JM.wm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Zo:t.Zo,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new mu(this.Bs,this.scale,this.aM,this.eM,this.hM,this.rM,this.nM,this.TM,this.ts,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.cs.Ms(),e}}class Au extends ru{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.t_={x:0,y:0,width:0,height:0},this.i_={x1:0,y1:0,x2:0,y2:0},this.tl=y(u(0,0),u(0,0)),this.Te=ye(a.rectangleSeriesFillStyle,l),this.Bs=t,this.scale=e,this.Fe=ye(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.tl}setDimensions(t){return"x"in t?(this.t_=t,this.i_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.i_=t,this.t_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.tl=Je([this.t_,u(this.t_.x+this.t_.width,this.t_.y+this.t_.height)]),this.eM(),this.Bs.Ms(),this}getDimensionsPositionAndSize(){return this.t_}getDimensionsTwoPoints(){return this.i_}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.hM(),this}getFillStyle(){return this.Te}setStrokeStyle(t){return this.Fe="function"==typeof t?t(this.Fe):t,this.hM(),this}getStrokeStyle(){return this.Fe}getDominantStyle(){return this.Te}}class xu extends lu{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.jM=Ee(),this.ZM=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ct(i,this.scale,this.Bs.cs.At)},this.chart.cs.Zn(fh.Cf),this.KM=c,this.DM=new Au(this.Bs,this.scale,Et,Et,Et,Et,Et,(t=>!1),this.ts,this.KM).dispose(),this.JM=new $a((()=>{const t=this.jM.Mt(this.Bs.Hm(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Be(i.fillStyle).De(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.Cl(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=du(s,this.wM.filter((t=>t.getVisible())),this.ZM,$e);if(!r)return;const n=ct(r[0],this.Bs.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 Be({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())))}yM(t){}FM(t){const e=this.JM.wm();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({Zo:t.Zo,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Au(this.Bs,this.scale,this.aM,this.eM,this.hM,this.rM,this.nM,this.TM,this.ts,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.cs.Ms(),e}}class Su extends ru{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.tl=y(u(0,0),u(0,0)),this.ts=a,this.Bs=t,this.scale=e,this.Fe=ye(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.tl}setDimensions(t){return this.dimensions=t,this.tl=y(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.eM(),this.Bs.Ms(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Fe="function"==typeof t?t(this.Fe):t,this.hM(),this}getStrokeStyle(){return this.Fe}getDominantStyle(){const t=this.Fe;return t!==nt?t.getFillStyle():z}}class vu extends lu{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.s_=Ee(),this.ZM=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ct(i,this.scale,this.Bs.cs.At)},this.chart.cs.Zn(fh.Cf),this.KM=c,this.DM=new Su(this.Bs,this.scale,Et,Et,Et,Et,Et,(t=>!1),this.ts,this.KM).dispose(),this.QM=new $a((()=>{const t=this.s_.Mt(this.Bs.Yg(this.scale));return this.As(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.We(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.$g(e.start,e.end),this.s_.Vt(i,e.figure),i})))),(()=>{this.s_.Ot()}),((t,e)=>{this.ys(e)}))}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=du(s,this.wM.filter((t=>t.getVisible())),this.ZM,$e);if(!r)return;const n=ct(r[0],this.Bs.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 Be({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())))}yM(t){}FM(t){const e=this.QM.wm();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({Zo:t.Zo,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Su(this.Bs,this.scale,this.aM,this.eM,this.hM,this.rM,this.nM,this.TM,this.ts,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.cs.Ms(),e}}class bu extends ou{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.xS={},this.chart.cs.Zn(fh.wf),this.e_=a,this.ts=l;const d=c;this.Te=ye(l.heatmapGridSeriesFillStyle,d),this.bS=ye(this.ts.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Kn=f,this.h_=this.Bs.r_(this.scale,[],f).Be(this.Te).MS(this.bS).ds(this.getHighlight()),this.As(this.h_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Bs.cs.At,this.scale),n=aa(e)?this.h_.Xb(r):this.h_.qc(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:K(this.Te)?this.Te.lut:void 0}}Ki(t,e){return Be({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,intensity:0,column:0,row:0,lut:K(this.Te)?this.Te.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}wS(){const t=this.xS.start||{x:0,y:0};let e;e=this.xS.end?{x:(this.xS.end.x-t.x)/this.Kn.columns,y:(this.xS.end.y-t.y)/this.Kn.rows}:this.xS.step?this.xS.step:{x:1,y:1},this.h_.CS(t,e),this.chart.cs.Ms()}setStart(t){return this.xS.start=t,this.wS(),this}getStart(){return this.h_.kS().start}setStep(t){return this.xS.step=t,this.wS(),this}getStep(){return this.h_.kS().step}setEnd(t){return this.xS.end=t,this.wS(),this}getEnd(){return this.h_.kS().end}clear(){return this.h_.Ot(),this.Bs.Ms(),this.R.emit("dataClear",this),this}setWireframeStyle(t){return this.bS="function"==typeof t?t(this.bS):t,this.h_.MS(this.bS),this.Bs.Ms(),this.R.emit("styleChange",this),this}getWireframeStyle(){return this.bS}setIntensityInterpolation(t){return t=t||"disabled",this.h_.FS(t),this.Bs.Ms(),this.R.emit("styleChange",this),this}getIntensityInterpolation(){return this.h_.IS()}ov(){return this.uv&&this.getVisible()}Zd(){return de(this.Te)}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}n_(t){this.h_.n_().forEach((e=>{t.h_.PS(e)}))}XM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}o_(t){return this.R.on("styleChange",t)}a_(t){return this.R.off(t)}getXMax(){const t=this.h_;return t?t.St():void 0}getXMin(){const t=this.h_;return t?t.vt():void 0}getYMax(){const t=this.h_;return t?t.bt():void 0}getYMin(){const t=this.h_;return t?t.xt():void 0}Dr(){const t=u(0,0);return t.x=Math.max(t.x,this.h_.Tl()),t.y=Math.max(t.y,this.h_.Fl()),t}yM(t){if(!(t instanceof zi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof zi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}ze(t,e){t.ds(e),this.Bs.Ms()}Re(){return super.Re(),this.h_.ta(this.getBoundaries()),this}}class Mu 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,c),this._v=!1}invalidateIntensityValues(t){if(this._v&&this.chart.cs.Zn(fh.Tf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Kn.dataOrder?t.length:t[0].length,rows:"rows"===this.Kn.dataOrder?t.length:t[0].length},i="columns"===this.Kn.dataOrder?this.Kn.columns:this.Kn.rows,s="columns"===this.Kn.dataOrder?this.Kn.rows:this.Kn.columns;if(e.x>i||e.y>s){if(!0===this.chart.SA.io){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Kn.columns}x${this.Kn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;Ct.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.SA.io){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Kn.columns}x${this.Kn.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.`;Ct.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.h_.PS({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.Bs.Ms(),this._v=!0,this}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.h_.Be(this.Te),this.R.emit("styleChange",this),this.Bs.Ms(),this}getFillStyle(){return this.Te}l_(t){return this.R.on("invalidateIntensity",t)}u_(t){return this.R.off(t)}}class Cu extends ou{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.xS={},this.chart.cs.Zn(fh.wf),this.chart.cs.Zn(fh.Tf);const d=c;this.Te=ye(l.heatmapScrollingGridSeriesFillStyle,d),this.bS=ye(this.ts.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Kn=f,this.c_=this.Bs.d_(this.scale,[],f).Be(this.Te).MS(this.bS).ds(this.getHighlight()),this.As(this.c_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Bs.cs.At,this.scale),n=aa(e)?this.c_.Xb(r):this.c_.qc(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:K(this.Te)?this.Te.lut:void 0}}Ki(t,e){return Be({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,intensity:0,multiHit:0,column:0,row:0,lut:K(this.Te)?this.Te.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}wS(){const t=this.xS.start||{x:0,y:0};let e;e=this.xS.step?this.xS.step:{x:1,y:1},this.c_.CS(t,e),this.chart.cs.Ms()}setStart(t){return this.xS.start=t,this.wS(),this}getStart(){return this.c_.kS().start}setStep(t){return this.xS.step=t,this.wS(),this}getStep(){return this.c_.kS().step}clear(){return this.c_.Ot(),this.Bs.Ms(),this}setWireframeStyle(t){return this.bS="function"==typeof t?t(this.bS):t,this.c_.MS(this.bS),this.Bs.Ms(),this}getWireframeStyle(){return this.bS}setPixelInterpolationMode(t){return t=t||"disabled",this.c_.FS(t),this.Bs.Ms(),this}getPixelInterpolationMode(){return this.c_.IS()}setDataCleaning(t){return this.c_.Cu(t),this.Bs.Ms(),this}ov(){return this.uv&&this.getVisible()}Zd(){return de(this.Te)}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}Be(t){return this.Te="function"==typeof t?t(this.Te):t,this.c_.Be(this.Te),this.Bs.Ms(),this}yM(t){if(!(t instanceof zi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof zi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.c_.St()||0}getXMin(){return this.c_.vt()||0}getYMax(){return this.c_.bt()||0}getYMin(){return this.c_.xt()||0}Dr(){const t=u(0,0);return t.x=Math.max(t.x,this.c_.Tl()),t.y=Math.max(t.y,this.c_.Fl()),t}ze(t,e){t.ds(e),this.Bs.Ms()}}class Tu extends Cu{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.Kn.scrollDimension?t.length:t[0].length,"rows"===this.Kn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Kn.resolution-1;if(s>r){if(!0===this.chart.SA.io){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Kn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;Ct.console.warn(t)}const s=[];for(let i=0;i{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.slice()},this.p_=[],this.y_=[],this.m_=!1,this.v_=(t,e)=>{const i=t.Kb(e);if(i)return[ct(i[0],this.scale,this.Bs.cs.At),ct(i[1],this.scale,this.Bs.cs.At)]},this.S_=(t,e)=>{const i=t.x_(e);if(i)return[ct(i[0],this.scale,this.Bs.cs.At),ct(i[1],this.scale,this.Bs.cs.At)]},this.Zd=()=>de(this.b_)||de(this.M_),this.__=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM.length-1,s=this.LM[i];if(e>0){const[e,i]=s.al(),[r,n]=s.ol();if((r?e.length+r.length:e.length)>=this.GM){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=mi(a,o,u(t[0].position,t[0].high)).y,c=mi(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.Al(f,y(u(a,c),u(a,l))).Hl(!0),this.w_([f].concat(t)).Ul(!0)}else s.Al(t)}}else e>0&&this.w_(t)},this.C_=t=>{const e=this.p_,i=t.length;if(this.p_.length>0){if(i>0){const i=e[e.length-1],s=i.al(),r=i.ol();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Al(a,y(u(o,h),u(o,h))).Hl(!0),e.push(this.k_([a].concat(t),this.OM).Ul(!0))}else i.Al(t)}}else i>0&&e.push(this.k_(t))},this.T_=t=>{const e=this.y_,i=t.length;if(this.y_.length>0){if(i>0){const i=e[e.length-1],s=i.al(),r=i.ol();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Al(a,y(u(o,h),u(o,h))).Hl(!0),e.push(this.F_([a].concat(t)).Ul(!0))}else i.Al(t)}}else i>0&&e.push(this.F_(t))}}fs(){return"ProgressiveX"}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.RM=void 0!==e&&e>0?e:0,this.Bs.Ms(),this}clear(){for(let t=0;tt+e.pl()+e.yl()),this._u.length)}getXMax(){return Yt(this.LM,Lt,Math.max,Nt,this.OM)||0}getXMin(){return Yt(this.LM,Pt,Math.min,_t,this.OM)||0}getYMax(){return Yt(this.LM,zt,Math.max,Ut,this.OM)||0}getYMin(){return Yt(this.LM,Vt,Math.min,Ot,this.OM)||0}Dr(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Tl()),t.y=Math.max(t.y,e.Fl());return t}ov(){return this.uv&&this.getPointAmount()>0&&this.getVisible()}yM(t){}zM(t,e,i){this._u=he(this._u,t,{canReturnB:!1}),this.A_=he(this.A_,e,{canReturnB:!1}),this.g_=he(this.g_,i,{canReturnB:!1}),this.Bs.Ms()}I_(t,e,i,s){this.P_(e,i,s),this.zM(Array.isArray(t)?t:[t],e,i)}P_(t,e,i){const s=ei(Je(t),Je(e));this.OM?this.OM=ei(this.OM,s):this.OM=s,i&&(this.OM=ei(this.OM,i))}D_(){const t=this.LM.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.LM[this.LM.length-1]:void 0,i=e?e.al()[0].length+(e.ol()[0]?e.ol()[0].length:0):void 0;hu(t,i,this.GM,this.__)}L_(t){const e=this.p_.length>0?this.p_[this.p_.length-1].al().length+this.p_[this.p_.length-1].ol().length:void 0;hu(t,e,this.GM,this.C_)}R_(t,e){const i=this.p_.length>0?this.p_[this.p_.length-1].al().length+this.p_[this.p_.length-1].ol().length:void 0;hu(t,i,this.GM,this.C_),hu(e,i,this.GM,this.T_)}w_(t,e){const i=this.Bs.E_(this.scale).Al(t,e).Be(this.b_).Gl(this.M_).Ol(this.Dl).ds(this.getHighlight());return this.LM.push(i),this.As(i),i}z_(t,e,i){const s=this.Bs.om(this.scale,void 0,[Ua.UserSeries]).Al(t,i).setMouseInteractions(!1).We(e).ds(this.getHighlight());return this.As(s),s}k_(t,e){return this.z_(t,this.V_,e)}F_(t,e){return this.z_(t,this.O_,e)}N_(t){this.b_="function"==typeof t?t(this.b_):t;const e=this.b_;for(let t=0;t0){const t=this.D_();this.NM(this.LM,this.GM,this.RM,t),this.p_.length>0&&this.NM(this.p_,this.GM,this.RM,t),this.y_.length>0&&this.NM(this.y_,this.GM,this.RM,t),this.m_=!0}}Re(){if(super.Re(),this._u.length>0&&(this.B_(this._u),this.Z_(this.A_,this.g_),this.m_=!0),this.m_){const t=this.getBoundaries();for(const e of this.LM)e.ta(t);for(const e of this.p_)e.ta(t);for(const e of this.y_)e.ta(t)}}_m(){super._m(),this.OM=void 0,this._u.length=0,this.A_.length=0,this.g_.length=0}}class ku extends wu{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.Zn(fh._f),this.Q_=a}add(t){0!==this.LM.length&&this.chart.cs.Zn(fh.Tf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.J_(e),[i,s]=this.K_(t);this.I_(t,i,s,y(u(ze,this.Q_),u(_e,this.Q_)));const r=this._u[this._u.length-1];this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.VM?this.VM.position+e:0),this.add(uu(t,e,s)),this}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}class Eu extends ku{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.b_=ye(this.ts.areaSeriesBipolarHighFillStyle,c),this.V_=ye(this.ts.areaSeriesBipolarHighStrokeStyle,c),this.M_=ye(this.ts.areaSeriesBipolarLowFillStyle,c),this.O_=ye(this.ts.areaSeriesBipolarLowStrokeStyle,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=Ru(s,this.LM,aa(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Bs.cs.At,this.scale),e=ct(r[0][1],this.Bs.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]}}}J_(t){return this.q_(t)}Z_(t,e){return this.R_(t,e)}q_(t){let e=0;const i=[],s=t.length,r=this.Q_;return s>0&&(this.tw&&(this.tw.y<=r&&r<=t[0].y||this.tw.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.tw.x+t[0].x),r,r),e+=1),this.tw=t[s-1],1===s?this.iw(t[0],i,e):this.sw(t,i)),i}iw(t,e,i=0){return e[i]=d(t.x,t.y,this.Q_),i+1}sw(t,e){let i=0,s=0;const r=t.length-1,n=this.Q_;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Gn(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}K_(t){const e=t.length,i=Array(e),s=Array(e),r=this.Q_;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.N_(t),this}setNegativeFillStyle(t){return this.G_(t),this}setPositiveStrokeStyle(t){return this.U_(t),this}setNegativeStrokeStyle(t){return this.Y_(t),this}getPositiveFillStyle(){return this.W_()}getNegativeFillStyle(){return this.Wl()}getPositiveStrokeStyle(){return this.H_()}getNegativeStrokeStyle(){return this.X_()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.b_,fill2:this.M_,behavior:{colorStep:!0}})}}class Iu extends ku{constructor(){super(...arguments),this.O_=nt}Z_(t){return this.L_(t)}K_(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}sw(t,e,i=0){let s=0;const r=t.length-1,n=this.Q_;for(;sn){const t=vi(u(_e,n),u(ze,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&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=vi(u(_e,n),u(ze,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}UM(){return au(this.LM,(t=>t[1]))}setFillStyle(t){return this.G_(t),this}getFillStyle(){return this.Wl()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.M_,stroke:this.V_})}}class Du extends Iu{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.b_=ye(this.ts.areaSeriesPositiveFillStyle,d),this.M_=z,this.V_=ye(this.ts.areaSeriesPositiveStrokeStyle,d)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=Ru(s,this.LM,aa(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Bs.cs.At,this.scale),e=ct(r[0][1],this.Bs.cs.At,this.scale),i=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=vi(u(_e,n),u(ze,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}UM(){return au(this.LM,(t=>t[0]||[]))}setFillStyle(t){return this.N_(t),this}getFillStyle(){return this.W_()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.b_,stroke:this.V_})}}const Bu={Positive:Du,Negative:Fu,Bipolar:Eu};class Pu extends wu{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.Zn(fh._f);const c=u;this.b_=ye(this.ts.areaRangeSeriesFillStyle,c),this.V_=ye(this.ts.areaRangeSeriesStrokeStyle,c),this.M_=ye(this.ts.areaRangeSeriesFillStyleInverted,c),this.O_=ye(this.ts.areaRangeSeriesStrokeStyleInverted,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=Ru(s,this.LM,aa(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Bs.cs.At,this.scale),e=ct(r[0][1],this.Bs.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.I_(t,i,s);const r=this._u[this._u.length-1];return this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM),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.VM?this.VM.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)},_u=(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=oi(ci(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]=ui(li(r,l),f[1]),f[2]=ci(f[2],li(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.qc(e);if(i)return ct(i,this.scale,this.Bs.cs.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Bs.cs.At)},this.lw=t=>{if(this.LM.length>0){const e=this.LM[this.LM.length-1];if(t.length>0){const i=e.al(),s=e.ol(),r=i.length+s.length-+e.Yl();if(r>=this.GM){const n=s.length>0?s[s.length-1]:i[e.Yl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.Al(o,y(u(o.x,o.y),u(o.x,o.y))).Hl(!0),this.uw([o].concat(t)).Ul(!0)}else e.Al(t,this.OM)}}else t.length>0&&this.uw(t)},this.cw=t=>{if(this.nw.length>0){const e=this.nw[this.nw.length-1];t.length>0&&((e.al().length+e.ol().length)*this.rw>=this.GM?this.dw(t):e.Al(t))}else t.length>0&&this.dw(t)},this.Kn=m,this.iM=l,this.fw=f,this.Aw=ye(c.pointLineSeriesFillStyle,g),this.yu=ye(this.ts.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}UM(){return au(this.nw)}setStrokeStyle(t){this.yu="function"==typeof t?t(this.yu):t;const e=this.yu;for(let t=0;te.setVisible(t))),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Jo()||Gr.NearestX,n=aa(e)?du(s,this.LM,this.aw,r===Gr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Gr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):du(s,this.nw,this.ow,r===Gr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Gr.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=ct(n[0],this.Bs.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}}}Zd(){return de(this.Aw)||de(this.yu.getFillStyle())}Ps(){return this.ws||this.iM}yM(t){}ze(t,e){t.ds(e),this.Bs.Ms()}WM(t){const e=this.LM.length>0?this.LM[this.LM.length-1].al().length+this.LM[this.LM.length-1].ol().length-+this.LM[this.LM.length-1].Yl():void 0;hu(t,e,this.GM,this.lw),hu(t,e,this.GM,this.cw)}dw(t,e){const i=this.Bs.Bv(this.scale).Al(t,e).setMouseInteractions(this.$i).Be(this.Aw).ll(this.iM).it(this.tM).Jh(this._a).cl(this.Ja).dl(this.Ka).fl(this.qa).ds(this.getHighlight());return this.As(i),this.nw.push(i),i}uw(t,e){const i=this.Bs.om(this.scale,void 0,[Ua.UserSeries,...this.fw]).Al(t,e).setMouseInteractions(this.$i).We(this.yu).ds(this.getHighlight());return this.As(i),this.LM.push(i),i}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{stroke:this.yu,fill:this.Aw})}getPointAmount(){return this.nw.reduce(((t,e)=>t+e.pl()+e.yl()),this._u.length)}clear(){super.clear();for(let t=0;t{}))}}const Ou=(t,e)=>t.ol().length>=e?t.ol().slice(-e):Array.prototype.concat(t.al(),t.ol()).slice(-e),Uu=(t,e,i)=>{const s=Array.prototype.concat(t.al(),t.ol()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ot().Al(s).zs()};class Yu extends Nu{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.rw=32,this.GM=8e3,this.gw=t=>{if(0===t.length)return;const e=this.nw.length;if(e>0){const i=e>1,s=this.nw[e-1];if(i){const i=Array.prototype.concat(s.al(),s.ol()),r=i.length;if(32*r>=this.GM){const i=Ou(s,3),r=Array.prototype.concat(i,t),n=_u(r,32);Uu(this.LM[e-1],n,32),this.uw(n.slice(66))}else if(r<5){const s=this.nw[e-2],r=Ou(s,3),n=Array.prototype.concat(r,i,t),o=_u(n,32),h=this.LM[e-1],a=o.slice(66);h.Ot().Al(a).zs()}else{const i=this.LM[e-1],r=Array.prototype.concat(i.al(),i.ol()),n=Ou(s,4),o=Array.prototype.concat(n,t),h=_u(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ot().Al(a).zs()}}else{const i=Array.prototype.concat(s.al(),s.ol()),r=i.length,n=this.LM[e-1];if(32*r>=this.GM){const e=Ou(s,3),i=Array.prototype.concat(e,t),r=_u(i,32);Uu(this.LM[0],r,32),this.uw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=_u(e,32);n.Ot().Al(s).zs()}else n.Al(t)}}else{const e=t.length>0?_u(t,32):t,i=Je(e);this.uw(e,i)}this.cw(t)}}WM(t){const e=this.nw.length,i=this.nw.length>0?this.nw[e-1].al().length+this.nw[e-1].ol().length:void 0;hu(t,i,Math.ceil(this.GM/this.rw),this.gw)}}class Gu{constructor(){this.Gi="FreeformPattern",this.Dl={type:"disabled",packager:(t,e,i)=>t.slice()}}NM(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}},Wu=s.Record({Dl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class Ku extends Wu{NM(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.D_(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},ju=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class $u extends Ku{pw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(ju,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Xu,e?e.min.y:void 0)}}const Zu=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},Qu=(t,e)=>{const i=e.St();return t?Math.max(i,t):i};class qu extends Ku{pw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(Qu,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Zu,e?e.min.x:void 0)}}const Ju={horizontalProgressive:new class extends $u{constructor(){super({Dl:zr()}),this.Gi="HorizontalProgressivePattern"}D_(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].pl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",zr(Hu(t)))}},horizontalRegressive:new class extends $u{constructor(){super({Dl:_r()}),this.Gi="HorizontalRegressivePattern"}D_(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].pl()>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",_r(Hu(t)))}},verticalProgressive:new class extends qu{constructor(){super({Dl:Nr()}),this.Gi="VerticalProgressivePattern"}D_(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].pl()>0?t[0].xt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Nr(Hu(t)))}},verticalRegressive:new class extends qu{constructor(){super({Dl:Or()}),this.Gi="VerticalRegressivePattern"}D_(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].pl()>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",Or(Hu(t)))}},freeform:new Gu};class tc extends Nu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,m){super(t,e,i,s,r,n,o,h,Ju.horizontalProgressive,a,c,d,f,g,m),this.lw=t=>{const e=this.LM.length>0?this.LM[this.LM.length-1].al().length+this.LM[this.LM.length-1].ol().length:void 0;hu(t,e,this.GM,this.yw)},this.yw=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM[this.LM.length-1];if(e>0){const e=i.al(),s=i.ol(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Vu([r].concat(t),this.mw);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.GM?(i.Al(o,y(u(o.x,o.y),u(o.x,o.y))).Hl(!0),this.uw(h).Ul(!0),this.dw(t)):i.Al(h)}}else e>0&&this.uw(Vu(t,this.mw));this.cw(t)},this.mw=l,void 0===this.fw.find((t=>"DataPattern"===t.type))&&this.fw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class ec extends ou{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Sw=t=>t[4]>=t[1],this.CM=y(c(ze,ze),c(_e,_e)),this.xw=[],this.bw=!1,this.Mw=-1,this._w=[],this.ww=!0,this.Cw=!1,this.kw=4,this.Tw=[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.Zn(fh.Af)}UM(){return this._w}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}ov(){return this.uv&&this._w.length>0&&this.getVisible()}Fw(t){if(!(this._w.length<1))return[this._w[t][0],this._w[t][1],this._w[t][2],this._w[t][3],this._w[t][4]]}solveNearest(t,e){if(0===this._w.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.Iw;if(!t)return;const e=ke(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=ke(i,this._w.length-1,(t=>this._w[t][0])),e=void 0!==t&&this._w[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 Be({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())))}yM(t){if(!(t.x instanceof Pi))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Pw=t.x}Dr(){return u(5,5)}m_(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.Zn(fh.Tf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.bw=!0;const t=this._w.length,i=this.xw.length,s=e.length;this._w.length=t+s,this.xw.length=i+s;for(let r=0;rthis.Tw[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Mw||this.bw||this.Cw)){this.Cw=!1,this.Mw=t,this.bw=!1,this.Bw(),this.Iw=[];const e=this._w.length;let i=this._w[0][0]-this._w[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...tl(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Dr().x))}),oc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...tl(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Dr().y))});class hc extends Aa{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.iC=!1,this.sC=!1,this.eC=!1,this.hC=!1,this.rC=new Map,this.nC=new Map,this.oC=[],this.aC=[],this.lC=!0,this.uC=!0,this.cC=!1,this.dC=[],this.fC=new Set,this.AC=!1,this.ly=r,this.gC=n,this.pC=o,this.yC=h.cursorGridStrokeStyleX,this.mC=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.rC.forEach((t=>t.forEach((t=>t.dispose())))),this.nC.forEach((t=>t.forEach((t=>t.dispose())))),this.oC.length=0,this.aC.length=0,this.ny.length=0,this}Re(){return this.cC&&this.setPosition(...this.dC),this.oC.forEach((t=>t.setVisible(this.Zi&&this.np).setMarkerVisible(this.Zi&&this.np&&this.lC))),this.aC.forEach((t=>t.setVisible(this.Zi&&this.np).setMarkerVisible(this.Zi&&this.np&&this.uC))),super.Re()}setPosition(...t){if(this.dC=t,this.oC.forEach((t=>t.setVisible(!1))),this.aC.forEach((t=>t.setVisible(!1))),this.oC.length=0,this.aC.length=0,0===t.length)return this;const e=this.renderingScale,i=t[0].resultTable,s=ta(t[0].resultTableScale,e),r=s===this.scale?i:ct(i,s,this.scale);this.Yp.setPosition(r),this.np=!1,this.sy.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=uc(u(c.x,c.y),s,r);if(a){const t=this.kh(s,!0);t.setValue(c.x),t.setGridStrokeLength(this.iC?d.x:1).setAllocatesAxisSpace(this.AC),this.oC.push(t)}if(l){const t=this.kh(r,!1);t.setValue(c.y),t.setGridStrokeLength(this.sC?d.y:1).setAllocatesAxisSpace(this.AC),this.aC.push(t)}let f=this.sy[i];if(!f){const t=new ko(this.Bs,this.renderingScale,this.scale,Et,this.ts).setMouseInteractions(!1).setFillStyle(this.ts.cursorPointMarkerFillStyle).setSize(this.ts.cursorPointMarkerSize).setShape(this.ts.cursorPointMarkerShape);f={pointMarker:t,targetVisible:!0},this.sy.push(f),this.ny.forEach((e=>e(t)))}const g=ta(t.pointMarkerScale,e),y=g===this.scale?t.pointMarker:ct(t.pointMarker,g,this.scale);f.pointMarker.setPosition(y),f.targetVisible=!0;const m=s.getInterval(),p=r.getInterval(),A=Math.min(m.start,m.end),x=Math.max(m.start,m.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.np=!0)})),this}setTickMarkersAllocateAxisSpace(t){return this.AC=t,this.Bs.Ms(),this}getTickMarkersAllocateAxisSpace(){return this.AC}kh(t,e){this.fC.has(t)||(t.onDispose((()=>{var e;null===(e=i.get(t))||void 0===e||e.forEach((t=>t.dispose())),i.delete(t)})),this.fC.add(t));const i=e?this.rC:this.nC,s=e?this.oC:this.aC,r=i.get(t)||[];i.set(t,r);let n=r.find((t=>!s.includes(t)));return n||(n=e?t.tp(!1,this.gC):t.tp(!1,this.pC),r.push(n),this.mr(n,e),n.setMouseInteractions(!1)),n}mr(t,e){const i=e?this.yC:this.mC;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.lC:this.uC)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.iC=t,this.Bs.Ms(),this}getGridStrokeXCut(){return this.iC}setGridStrokeYCut(t){return this.sC=t,this.Bs.Ms(),this}getGridStrokeYCut(){return this.sC}setGridStrokeXStyle(t){return this.yC=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.rC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.yC))))),this}getGridStrokeXStyle(){return this.yC}setGridStrokeYStyle(t){return this.mC=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.nC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.mC))))),this}getGridStrokeYStyle(){return this.mC}setTickMarkerXVisible(t){return this.lC=t,this.Bs.Ms(),this}getTickMarkerXVisible(){return this.lC}setTickMarkerYVisible(t){return this.uC=t,this.Bs.Ms(),this}getTickMarkerYVisible(){return this.uC}setTickMarkerX(t){return this.rC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.gC=this.gC.addStyler(t),this.Bs.Ms(),this}setTickMarkerY(t){return this.nC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.pC=this.pC.addStyler(t),this.Bs.Ms(),this}}class ac{constructor(t,e,i,s){this.gy=[],this.py=(t,e)=>(this.gy.forEach((i=>i(t,e))),t),this.addStyler=t=>new ac(this.ly,this.gC,this.pC,this.gy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ac(t,this.gC,this.pC,this.gy.map((t=>t))),this.yy=(t,e,i,s,r)=>this.py(new hc(t,e,i,s,this.ly,this.gC,this.pC,r),r),this.ly=t,this.gy=s,this.gC=e,this.pC=i}}const lc=new ac(Co,ch.PointableTextBox,ch.PointableTextBox,[(t,e)=>{xa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),kn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),kn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),uc=(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.dg&&(n=1-n),1===e.dg&&(o=1-o),u(o,n)};class cc extends cu{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.LM=[],this.Yb=!0,this.GM=void 0,this.wu=void 0,this.vC=(t,e)=>{const i=t.Kb(e);if(i)return ct(i,this.scale,this.Bs.cs.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Bs.cs.At)},this.Zd=()=>de(this.yu.getFillStyle()),this.fw=c,this.Kn=f,this.yu=ye(this.ts.lineSeriesStrokeStyle,d),this.SC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}fs(){var t,e;return null===(e=null===(t=this.Kn)||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.yu="function"==typeof t?t(this.yu):t;const e=this.yu;for(let t=0;tt.Cu(this.wu))),this.Bs.Ms(),this}setCursorInterpolationEnabled(t){return this.Yb=t,this.Bs.cs.Ms(),this}getCursorInterpolationEnabled(){return this.Yb}yM(t){}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Jo()||Gr.NearestX,n=du(s,this.LM,aa(e)?this.aw:this.vC,r===Gr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===Gr.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=ct(n[0],this.Bs.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}}}WM(t){let e=this.LM[0];e||(e=this.uw(),this.LM.push(e),this.As(e)),e.Al(t,this.OM)}uw(){return this.Bs.om(this.scale,this.SC,[Ua.UserSeries,...this.fw]).We(this.yu).Cu(this.wu).ds(this.getHighlight())}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{stroke:this.yu})}ze(t,e){t.ds(e),this.Bs.Ms()}NM(t,e,i,s){}}class dc extends cu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new Gu,l,u),this.LM=[],this.tM=5,this._a=0,this.Ja=!1,this.Ka=!1,this.qa=!1,this.GM=void 0,this.ow=(t,e)=>{const i=t.qc(e);if(i)return ct(i,this.scale,this.Bs.cs.At)},this.Kn=d,this.iM=a,this.Te=ye(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=du(s,this.LM,this.ow,$e);if(void 0!==r){const t=ct(r[0],this.Bs.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}}}Zd(){return de(this.Te)}Ps(){return this.ws||this.iM}yM(t){}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}ze(t,e){t.ds(e),this.Bs.Ms()}setPointFillStyle(t){this.Te="function"==typeof t?t(this.Te):t;const e=this.Te;for(let t=0;t{const t=i.engine.container.getBoundingClientRect();this.MC.style.left=`${t.left}px`,this.MC.style.top=`${t.top}px`,this.MC.style.width=`${t.width}px`,this.MC.style.height=`${t.height}px`};n(),i.onResize(n),this._C(this.MC),this.wC(),this.CC(),this.kC(),this.TC(e),this.chart.FC().push(this)}_C(t){this.IC=Ct.document.createElement("div"),this.IC.style.pointerEvents="all",t.append(this.IC),this.PC=Ct.document.createElement("div"),this.DC=new Fs(this.Ks,this.re,this.chart,this.PC),this.BC=Ct.document.createElement("table"),this.BC.style.borderSpacing="0",this.IC.appendChild(this.DC.Ae()),this.IC.appendChild(this.PC),this.PC.appendChild(this.BC)}CC(){let t=0,e=0,i=0,s=0,r=!1;this.xC=!1,this.IC.onmousedown=n=>{n=n||Ct.event,i=n.clientX,s=n.clientY,r=!0,Ct.document.onmouseup=t=>{this.xC?this.IC.addEventListener("click",Qt,!0):this.IC.removeEventListener("click",Qt,!0),r=!1,this.xC=!1,Ct.document.onmouseup=null,Ct.document.onmousemove=null},Ct.document.onmousemove=n=>{n=n||Ct.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.xC=!0,this.IC.style.top=this.IC.offsetTop-e+"px",this.IC.style.left=this.IC.offsetLeft-t+"px",this.IC.style.removeProperty("right"),this.IC.style.removeProperty("bottom"))}}}kC(){let t=0,e=0,i=0,s=0,r=!1;this.IC.ontouchstart=n=>{n=n||Ct.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.IC.ontouchend=()=>{r=!1,Ct.document.ontouchend=null,Ct.document.ontouchmove=null},this.IC.ontouchmove=n=>{r&&(Qt(n),n=n||Ct.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.IC.style.top=this.IC.offsetTop-e+"px",this.IC.style.left=this.IC.offsetLeft-t+"px",this.IC.style.removeProperty("right"),this.IC.style.removeProperty("bottom"))}}}wC(){this.IC.style.setProperty("top","10px"),this.IC.style.setProperty("left","10px"),this.IC.style.position="absolute",this.IC.style.display="flex",this.IC.style.alignItems="flex-start",this.PC.style.setProperty("display","none")}removePositionProperty(){this.IC.style.removeProperty("top"),this.IC.style.removeProperty("left"),this.IC.style.removeProperty("bottom"),this.IC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.IC.style.setProperty("bottom","10px"),this.IC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.IC.style.setProperty("top","10px"),this.IC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.IC.style.setProperty("bottom","10px"),this.IC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.IC.style.setProperty("top","10px"),this.IC.style.setProperty("right","10px")}}TC(t){for(let e=0;e[t.td((()=>{this.EC+=1,this.EC>1&&this.chart.cs.Zn(fh.Tf),this.chart.cs.Ms()})),t.sd((()=>this.chart.cs.Ms()))])),this.Qa.yd(t),this.chart.cs.Ms()),this}getDataSet(){return this.OC()}setStrokeStyle(t){return this.Qa.We(t),this.Bs.Ms(),this}getStrokeStyle(){return this.Qa.mu()}setAreaFillStyle(t){return this.Qa.vd(t),this.Bs.Ms(),this}getAreaFillStyle(){return this.Qa.NC()}setPointFillStyle(t){return this.Qa.md(t),this.Bs.Ms(),this}getPointFillStyle(){return this.Qa.wd()}setPointSize(t){return this.Qa.Cd(t),this.Bs.Ms(),this}getPointSize(){return this.Qa.GC()}setPointShape(t){return this.Qa.xd(t),this.Bs.Ms(),this}getPointShape(){return this.Qa.bd()}setPointRotation(t){return this.Qa.Md(t),this.Bs.Ms(),this}getPointRotation(){return this.Qa._d()}setPointAlignment(t){return this.Qa.WC(t),this.chart.cs.Ms(),this}getPointAlignment(){return this.Qa.UC()}setCurvePreprocessing(t){return this.Qa.zC(t),this.Bs.Ms(),this}getCurvePreprocessing(){return this.Qa.YC()}add(t){return this.OC().add(t),this.Bs.Ms(),this}addArraysXY(t,e){return this.OC().addArraysXY(t,e),this.Bs.Ms(),this}appendJSON(t,e){return this.OC().appendJSON(t,e),this.Bs.Ms(),this}appendSample(t){return this.OC().appendSample(t),this.Bs.Ms(),this}appendSamples(t){return this.OC().appendSamples(t),this.Bs.Ms(),this}fill(t){return this.OC().fill(t),this.Bs.Ms(),this}setSamples(t){return this.OC().setSamples(t),this.Bs.Ms(),this}alterSamples(t,e){return this.OC().alterSamples(t,e),this.Bs.Ms(),this}alterSamplesByID(t,e){return this.OC().alterSamplesByID(t,e),this.Bs.Ms(),this}getSampleCount(){return this.OC().getSampleCount()}getNextSampleIndex(){return this.OC().getNextSampleIndex()}clear(){return this.OC().clear(),this.Bs.Ms(),this}setMaxSampleCount(t){return this.OC().setMaxSampleCount(t),this.Bs.Ms(),this}getMaxSampleCount(){return this.OC().getMaxSampleCount()}readBack(t){return this.OC().readBack(t)}onMaxSampleCountExceeded(t){return this.OC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.OC().offMaxSampleCountExceeded(t)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){let i=aa(e);void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.HC(),r=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}),n=s.qc(r,i,this.scale,this.chart.mg);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.jc()||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:Be({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())))}HC(){return this.OC()}Zd(){return de(this.getPointFillStyle())||de(this.getStrokeStyle().getFillStyle())||de(this.getAreaFillStyle())}ov(){var t;const e=null===(t=this.pd)||void 0===t?void 0:t.Gt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.mc>0}yM(t){}getXMax(){return this.Qa.St()}getXMin(){return this.Qa.vt()}getYMax(){return this.Qa.bt()}getYMin(){return this.Qa.xt()}Dr(){return{x:this.Qa.Tl(),y:this.Qa.Fl()}}OC(){if(!this.pd){const t=new yo(this.Kn);t.wc&&this.chart.cs.Zn(fh.If),t.kc&&this.chart.cs.Zn(fh.Ff),this.pd=De(t,this.pd,(()=>[t.td((()=>{this.EC+=1,this.EC>1&&this.chart.cs.Zn(fh.Tf),this.chart.cs.Ms()})),t.sd((()=>{this.chart.cs.Ms()}))])),this.Qa.yd(t)}return this.pd.Gt}styleLegendEntry(t,e=!1){const i=this.getPointFillStyle(),s=this.getAreaFillStyle();ce(t,this.ts,e,{stroke:this.getStrokeStyle(),fill:i!==z?i:s,behavior:{priority:"stroke"}})}Ps(){return this.ws||this.getPointShape()}ze(t,e){t.ds(e),this.Bs.Ms()}}const yc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.At.it(e),t.axis.gg.it(i)})))),mc=u(10,10);var pc;e.AxisPosition=void 0,(pc=e.AxisPosition||(e.AxisPosition={}))[pc.Top=0]="Top",pc[pc.Bottom=1]="Bottom",pc[pc.Left=2]="Left",pc[pc.Right=3]="Right";const Ac=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),xc=t=>t.setStopped(!0),Sc=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,vc=(t,e)=>{const i="linear-highPrecision"===t.Oh.type||"linear-highPrecision"===e.Oh.type,s="logarithmic"===t.Oh.type||"logarithmic"===e.Oh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Oh.type}, y: ${e.Oh.type})`;throw new Error(i)}};var bc,Mc,Cc;!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"}(bc||(bc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Mc||(Mc={}));class Tc extends dl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.kp("chartXY bg",0),r,i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.chartXYTitleFont,i.cs.ts.chartXYTitleFillStyle,h),this.$C=this.dp.d2({scaleXYConstructor:zi}),this.jg=[],this.Zg=[],this.Jg=[],this.Qg=[],this.XC=new Map,this.jC=!0,this.ZC=!0,this.QC=!0,this.Uf=2,this.JC=!0,this.KC=!0,this.qC=[],this.tk=this.Fp.Le(this.$C).Be(z).De(nt).setMouseInteractions(!1),this.ik=this.Fp.Ue(this.$C).We(nt).setMouseInteractions(!1),this.sk=this.Fp.Ue(this.$C).We(nt).setMouseInteractions(!1),this.ek=this.ts.chartXYZoomingRectangleFillStyle,this.hk=this.ts.chartXYZoomingRectangleStrokeStyle,this.rk=this.ts.chartXYFittingRectangleFillStyle,this.nk=this.ts.chartXYFittingRectangleStrokeStyle,this.ak=e.MouseStyles.Default,this.lk=e.MouseStyles.Move,this.uk=e.MouseStyles.ZoomIn,this.ck=e.MouseStyles.Default,this.dk=void 0,this.aA=Rc,this.pM=0,this.fk=(t,e,i)=>{const s=t.solveNearest(e,i);return s&&je(s.cursorPosition.pointMarker.x,s.axisX.getInterval().start,s.axisX.getInterval().end)&&je(s.cursorPosition.pointMarker.y,s.axisY.getInterval().start,s.axisY.getInterval().end)?s:void 0},this.Ak=yc(this.Zg,this.jg),this.gk=yc(this.Jg,this.Qg),this.pk=(t,e,i,s,r)=>{this.Ak(s,r),this.gk(r,s),this.$C.it(s,r),this.cs.Ms()},this.yk=(t,e)=>{this.XC.set(t,e)},this.ag=t=>{const e=this.Zg.findIndex((e=>e.axis===t)),i=this.jg.findIndex((e=>e.axis===t)),s=this.Jg.findIndex((e=>e.axis===t)),r=this.Qg.findIndex((e=>e.axis===t));e>=0&&this.Zg.splice(e,1),i>=0&&this.jg.splice(i,1),s>=0&&this.Jg.splice(s,1),r>=0&&this.Qg.splice(r,1),this.XC.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();vc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Bu.Positive)(this,this.Ev,this.tb,e,i,this.mk(e),this.mk(i),this.gp,s,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length);return this.Gv(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();vc(e,i);const s=new Pu(this,this.Ev,this.tb,e,i,this.mk(e),this.mk(i),this.gp,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length);return this.Gv(s),s},this.vk=!1,this.Sk=!1,this.mM=()=>{(this.jC||this.ZC)&&(this.dk=this.engine.setMouseStyle(this.ak))},this.vM=()=>{this.vk=!1,this.engine.restoreMouseStyle(this.dk)},this.SM=(t,e,i)=>{var s,r;const n=Bt(null===(s=this.SA.qn)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Bt(null===(r=this.SA.qn)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.dk);const h=this.Fp.cs.Ve(e.clientX,e.clientY);i===n&&(this.jC||this.ZC)?(this.xk(t,h),Qt(e)):i===o&&this.JC&&(this.dk=this.engine.setMouseStyle(this.lk),this.Sk=!0,Qt(e))},this.fv=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Bt(null===(n=this.SA.qn)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Bt(null===(o=this.SA.qn)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.jC||this.ZC)?(this.bk(t,s,h),Qt(e)):i===l&&this.JC&&(this.Mk(li(r,-1)),Qt(e)),this.cs.Ms()},this.Av=(t,e,i,s)=>{var r,n;const o=Bt(null===(r=this.SA.qn)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Bt(null===(n=this.SA.qn)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.jC||this.ZC)){const i=u(e.clientX,e.clientY);this._k(t,s,i),Qt(e)}else i===h&&this.JC&&Qt(e);this.engine.restoreMouseStyle(this.dk),this.Ov.getIsUnderMouse()&&(this.dk=this.engine.setMouseStyle(this.ak)),this.vk=!1,this.Sk=!1},this.dv=(t,e)=>{if(this.QC){const t=this.Fp.cs.Ve(e.clientX,e.clientY);this.wk(t,u(me(e),me(e))),Qt(e)}},this.Ck=(t,e,i,s)=>{},this.kk=(t,e,i,s,r,n)=>{if(this.JC){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.Mk(t),Qt(n),this.Sk=!0}if(this.QC){const t=this.cs.No({clientX:e.x,clientY:e.y}),o=this.cs.No({clientX:i.x,clientY:i.y}),h=ci(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")})),Qt(n),this.vk=!0}},this.Tk=(t,e,i,s)=>{this.Sk=!1,this.vk=!1},this.Fk=(t,e,i)=>{(this.ZC||this.jC)&&(this.xk(t,e),Qt(i))},this.Ik=(t,e,i,s,r)=>{(this.ZC||this.jC)&&(this.bk(t,e,i),Qt(r))},this.Pk=(t,e,i,s)=>{(this.ZC||this.jC)&&(this._k(t,e,i),Qt(s))},this.cs.Zn(fh.Mf),this.setPadding({right:24}),this.Dk=i.wx("chartXY series bg",bc.seriesBackground),this.Bk=[bc.gridLine0,bc.gridLine1,bc.gridLine2].map((t=>i.Lk(`chartXY gridline #${t}`,t))),this.ng=i.Lk("chartXY highlighters below",bc.highlightersBelow),this.tb=i.Xy("chartXY plotting",Mc.plotting),this.og=i.Xy("chartXY highlighters above",Mc.highlightersAbove),this.IA=i.Xy("chartXY fg",Mc.fg),this.$C.x.q(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.ka.left+this.ka.right)),this.$C.y.q(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.ka.bottom+this.ka.top)),this.$C.it(this.uiScale.oi().x,this.uiScale.oi().y),this.Ov=this.Dk.Le(this.$C).Be(this.ts.chartXYSeriesBackgroundFillStyle).De(nt),this.Nv=this.IA.Le(this.$C).Be(z).De(this.ts.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Vv(this.Ov,this.Nv),this.setSeriesBackgroundEffect(!1);const a=Bt(o?o.cursorBuilder:void 0,lc),l=i.Zy();this.Qy=ua(this,l,a.yy(l,this.$C,this.$C,Et,this.ts),this,"show-all",Ic,((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.pk),this.bh.yr("ChartXY"),this.gv=Ji(new es(this.Fk,this.Ik,this.Pk,1),new is(this.Ck,this.kk,this.Tk)),this.onSeriesBackgroundMouseEnter(this.mM),this.onSeriesBackgroundMouseLeave(this.vM),this.onSeriesBackgroundMouseWheel(this.dv),this.onSeriesBackgroundMouseDragStart(this.SM),this.onSeriesBackgroundMouseDrag(this.fv),this.onSeriesBackgroundMouseDragStop(this.Av),this.onSeriesBackgroundTouchStart(this.gv.onTouchStart),this.onSeriesBackgroundTouchMove(this.gv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.gv.onTouchEnd),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.Cp(n,this.$C)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.Lv}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.Qy.solveNearest(t,e,this.Lv,this.fk)}addCursor(t=lc){const e=this.gp(),i=t.yy(e,this.$C,this.$C,this.up(e),this.ts);return i.cC=!0,this.Mp(i),i}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.ka.left+this.ka.right,t.y+=this.Xt.top+this.Xt.bottom+this.ka.top+this.ka.bottom;const e=this.bh.zs().ed(),i=S(wc(this.aA||Rc),this.Tp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Rk&&(t.x+=this.Rk.left,t.x+=this.Rk.right,t.y+=this.Rk.top,t.y+=this.Rk.bottom),t.x+=mc.x,t.y+=mc.y,t}addAxisX(t){var e,i;const{opposite:s,type:r}=Ki(t);let n;n="linear"===r.type?this.dp.d1({dimension:"x",scale1DConstructor:Pi}):"linear-highPrecision"===r.type?this.dp.d1({dimension:"x",scale1DConstructor:Pi}).Mi():this.dp.d1({dimension:"x",scale1DConstructor:Ti}).Ai(r.base),n.it(this.$C.x.oi());const o=s?this.jg:this.Zg,h=new yh(this.Bk,this.IA,this.Fp,this.ng,this.og,this.cs.hs,n,this.$C.y,(a=()=>h.Lg(),{...ph,...nc(a)}),this,s?100:0,this.ag,this.yk,this.ts,this.dh,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}=Ki(t);let n;n="linear"===r.type?this.dp.d1({dimension:"y",scale1DConstructor:Pi}):"linear-highPrecision"===r.type?this.dp.d1({dimension:"y",scale1DConstructor:Pi}).Mi():this.dp.d1({dimension:"y",scale1DConstructor:Ti}).Ai(r.base),n.it(this.$C.y.oi());const o=s?this.Qg:this.Jg,h=new yh(this.Bk,this.IA,this.Fp,this.ng,this.og,this.cs.hs,n,this.$C.x,(a=()=>h.Lg(),{...Ah,...oc(a)}),this,s?100:0,this.ag,this.yk,this.ts,this.dh,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.Zg,this.Jg,this.Qg,this.jg],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.Qy.Y(),this.Dk.Y(),this.tb.Y(),this.IA.Y(),this.Bk.forEach((t=>t.Y())),this.og.Y(),this.ng.Y(),this.FC().forEach((t=>t.dispose())),sa(this.$C),this.Zg.slice().forEach((t=>t.axis.dispose())),this.Jg.slice().forEach((t=>t.axis.dispose())),this.Qg.slice().forEach((t=>t.axis.dispose())),this.jg.slice().forEach((t=>t.axis.dispose())),this.Lv.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.Zg,...this.jg].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.Jg,...this.Qg].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):Ac;return Dt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.jg.map((t=>t.axis));case e.AxisPosition.Bottom:return this.Zg.map((t=>t.axis));case e.AxisPosition.Left:return this.Jg.map((t=>t.axis));case e.AxisPosition.Right:return this.Qg.map((t=>t.axis))}})))}Ek(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.Zg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.jg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.Jg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Qg.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}zk(t,e,i,s){const r=this.aA||Rc;let n,o=S(wc(r),this.Tp);this.getTitleFillStyle()===z||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.bh.zs().ed();const h=Math.abs(s)+this.ka.bottom+this.Xt.bottom,a=Math.abs(i)+this.ka.top+this.Xt.top,l={left:Math.abs(t)+this.ka.left+this.Xt.left,right:Math.abs(e)+this.ka.right+this.Xt.right,top:a,bottom:h},u=this.uiScale.Wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=kc(r,u,l,n,o,this.ka);return this.bh.Ee(f).Wa(c).Ya(d),g}Re(t){super.Re(t);for(const t of this.Lv)t.vv();for(const t of this.Lv)t.Re();const e=ve(this.Lv.map((t=>t.xM()))),i=new Set(e.map((t=>t.Vk)));if(1===i.size){const t=Array.from(i)[0],s="x"===t?[this.Zg,this.jg]:[this.Jg,this.Qg],r="y"===t?[this.Zg,this.jg]:[this.Jg,this.Qg];s.forEach((t=>t.forEach((t=>t.axis.Br())))),e.forEach((t=>t.Ok())),r.forEach((t=>t.forEach((t=>t.axis.Br()))))}else this.Jg.forEach((t=>t.axis.Br())),this.Zg.forEach((t=>t.axis.Br())),this.jg.forEach((t=>t.axis.Br())),this.Qg.forEach((t=>t.axis.Br()));const s=this.Jg.map((t=>t.axis.zs())),r=this.Zg.map((t=>t.axis.zs())),n=this.jg.map((t=>t.axis.zs())),o=this.Qg.map((t=>t.axis.zs()));let h=!1;this.forEachAxis((t=>{(t.zr()||t.Vr())&&(h=!0)}));const a=this.vk||this.Sk||!this.KC&&h,l=new Set(this.getAxes().map((t=>t.getStackIndex()))).size>1;this.Qy.Re(a,l?this.Lv.sort(((t,e)=>e.axisY.getStackIndex()-t.axisY.getStackIndex())):this.Lv,this.fk,{afterCursorPointedAt:t=>{const e=this.cs.Xn();if(t.length>1&&e){const t=this.cs.No(e);this.Qy.zp.Ay({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=Ec(this.Jg,s),d=Ec(this.Zg,r),f=Ec(this.jg,n),g=Ec(this.Qg,o),y=this.zk(c.thicknessTotal,g.thicknessTotal,f.thicknessTotal,d.thicknessTotal),p=this.$C.x.getCellSize()-(y.left+y.right),A=this.$C.y.getCellSize()-(y.bottom+y.top),x=[y.left,y.right],S=[y.bottom,y.top];this.$C.x.q(0,p),this.$C.y.q(0,A),this.$C.x.si(x),this.$C.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.zg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.uA+e.axis.cA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Hd?e.axis.Hd.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.Hd?h.Hd.pixels:h.Hd.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.uA:0,f=a?i[1]+(e-n)-c-h.uA:0;h.At.si([d,f]),h.Re({zg:o,Vg:s.Vg,Gg:c,Nk:n,Xg:o+s.Vg,Ug:r}),a&&(n+=c+h.uA+h.cA)})),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.Rk={left:c.thicknessTotal,top:f.thicknessTotal,right:g.thicknessTotal,bottom:d.thicknessTotal},this.Ov.Ee(u(0,0)).it(u(p,A)),this.Nv.Ee(u(0,0)).it(u(p,A));const b=m(this.$C.x.ei(),this.$C.y.ei(),this.$C.x.ri(),this.$C.y.ri());this.tb.gx(b),this.ng.gx(b),this.og.gx(b),this.rp&&this.rp(),super.wp(),this.Zg.forEach((t=>t.axis.Kg())),this.jg.forEach((t=>t.axis.Kg())),this.Jg.forEach((t=>t.axis.Kg())),this.Qg.forEach((t=>t.axis.Kg()));for(const t of this.Lv)t._m()}J(){for(let t=0;t=10;h&&c&&l.x===r.x&&this.ZC?(this.vk=!0,this.tk.Be(this.rk).De(this.nk),this.ik.We(this.nk).He(r).Ye(o),this.sk.We(this.nk).He(u(r.x,o.y)).Ye(u(o.x,r.y)),this.dk=this.engine.setMouseStyle(this.ck,this.dk)):h&&c&&(this.jC||this.ZC)?(this.vk=!0,this.tk.Be(this.ek).De(this.hk),this.ik.We(nt),this.sk.We(nt),this.dk=this.engine.setMouseStyle(this.uk,this.dk)):(this.vk=!1,this.tk.De(nt).Be(z),this.ik.We(nt),this.sk.We(nt),this.engine.restoreMouseStyle(this.dk)),this.cs.Ms()}_k(t,e,i){if(this.vk){const t=this.cs.No({clientX:i.x,clientY:i.y}),s=ct({x:t.engineX,y:t.engineY},this.Fp.cs.At,this.$C),r=je(s.x,this.$C.x.getInnerStart(),this.$C.x.getInnerEnd())&&je(s.y,this.$C.y.getInnerStart(),this.$C.y.getInnerEnd()),n=i.x>=e.x||!this.ZC?"zoom":"fit",o=this.tk.Oa(),h=ui(o,this.tk.oi()),a=Math.min(this.tk.oi().x,this.tk.oi().y)>=10;r&&a&&"zoom"===n&&this.jC?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=ct(o,this.$C,t.pg).x,i=ct(h,this.$C,t.pg).x;t.yt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=ct(o,this.$C,t.pg).y,i=ct(h,this.$C,t.pg).y;t.yt(e,i,!0,!0,"interactionSetInterval")}}))):r&&a&&"fit"===n&&this.ZC&&this.forEachAxis(Sc)}this.tk.De(nt).Be(z),this.ik.We(nt),this.sk.We(nt),this.cs.Ms()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}Mk(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(xc),this.forEachAxisX((i=>{i.zoom(i.At.dt(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.At.dt(t.y),e.y)}))}wk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(xc(i),i.zoom(i.At.dt(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(xc(i),i.zoom(i.At.dt(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}ef(){const t=[];return this.forEachAxis((e=>e.Ig((e=>t.push(e))))),super.ef().concat(t)}FC(){return this.qC}Me(){return this.Dp(this.tb)}setCursorEnabledDuringAxisAnimation(t){return this.KC=t,this}getCursorEnabledDuringAxisAnimation(){return this.KC}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=xh(r)?r:Yi(r)?this.mg:void 0;if(n&&Oi(i)){const t=ct(s,n,this.cs.At);return this.cs.Go({engineX:t.x,engineY:t.y})}if(n&&Yi(i))return ct(s,n,this.mg);if(n&&xh(i))return ct(s,n,i)}else{const i=t;if(Yi(e)){const t=this.cs.No(i);return ct({x:t.engineX,y:t.engineY},this.cs.At,this.mg)}if(xh(e)){const t=e,s=this.cs.No(i);return ct({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,(Cc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Cc.RightTop="right-top",Cc.LeftTop="left-top",Cc.CenterBottom="center-bottom",Cc.RightBottom="right-bottom",Cc.LeftBottom="left-bottom",Cc.SeriesCenterTop="series-center-top",Cc.SeriesRightTop="series-right-top",Cc.SeriesLeftTop="series-left-top",Cc.SeriesCenterBottom="series-center-bottom",Cc.SeriesRightBottom="series-right-bottom",Cc.SeriesLeftBottom="series-left-bottom";const Rc=e.ChartXYTitlePositionOptions.CenterTop,wc=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 Ce(0,`Unexpected ChartXY title position selection ${t}`)},kc=(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 Ce(0,`Unexpected ChartXY title position selection ${t}`)},Ec=(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.zg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Vg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.$d)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Hd?e.axis.Hd.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)}},Ic=(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 ft(e)?la(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:Wi(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:Wi(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:Wi(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?[[Wi(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...la(e,[[e.series,""],[`${o.valueDimension}1`,"",{text:Wi(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Wi(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:[[Wi(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...la(e,[[e.series,"",{text:Wi(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:e.multiHit?la(e,[[e.series],[o.progressiveDimension,"",{text:Wi(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[`${o.valueDimension}1`,"",{text:Wi(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Wi(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]]):la(e,[[e.series],[o.progressiveDimension,"",{text:Wi(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:Wi(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]]):n?[Wi(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),...i.map((t=>t.multiHit?la(t,[[t.series,""],[`${o.valueDimension}1`,"",{text:Wi(o.hitValueAxis(t).formatValue(o.value(t.multiHit[0])),o.hitValueAxis(t)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:Wi(o.hitValueAxis(t).formatValue(o.value(t.multiHit[1])),o.hitValueAxis(t)),font:{weight:"bold"}}]]):la(t,[[t.series,"",{text:Wi(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()]:i.map((t=>la(t,[[t.series],[o.progressiveDimension,"",{text:Wi(o.progressiveAxis.formatValue(o.position(t)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:Wi(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()};class Fc{constructor(t,e,i,s,n,o,h){this.coordsRelative="relative",this.coordsClient="client",this.R=new r.Eventer,this.Gk=[],this.Wk=new Map,this.Lv=new Map,this.Uk=(t,e,i)=>{0!==this.Lv.size&&void 0!==[...this.Lv.values()].find((({series:t})=>!0===t.getVisible()))||this.Yk.yt(e,i,!1,!1,"zoomBandChart"),this.Hk.cs.Ms()},e.cs.Zn(fh.xf),this.SA=t,this.$k=(null==o?void 0:o.orientation)||"x",this.Xk=void 0!==(null==o?void 0:o.useSharedValueAxis)&&o.useSharedValueAxis,this.jk=s,this.Zu="x"===this.$k?ph:Ah;const a={...o,defaultAxisX:this.Zu.getWidth({x:null==o?void 0:o.defaultAxis,y:void 0}),defaultAxisY:this.Zu.getHeight({x:null==o?void 0:o.defaultAxis,y:void 0})};this.Hk=new Tc(t,e,i,Et,n,a,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setCursorMode(void 0),this.engine=this.Hk.engine;const l=this.Hk.getDefaultAxisX().setMouseInteractions(!1),u=this.Hk.getDefaultAxisY().setMouseInteractions(!1);this.Yk=this.Zu.getWidth({x:l,y:u}).setScrollStrategy(Ws.fitting).setAnimationScroll(!1).setStrokeStyle(nt).setTickStrategy(Ks.Empty),(null==o?void 0:o.useSharedValueAxis)?this.Zk=this.Zu.getHeight({x:l,y:u}):this.Zu.getHeight({x:l,y:u}).dispose();const c=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new U({color:this.getTheme().isDark?C(0,0,0,180):C(255,255,255,180)});this.Qk=[this.Hk.IA.Le(this.Yk.pg).Be(c).De(nt),this.Hk.IA.Le(this.Yk.pg).Be(c).De(nt)];const d=this.Hk.IA.Yg(this.Yk.pg).We(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.Jk={collection:d,members:new Array(5).fill(0).map((t=>d.Xr()))};const f=this.getTheme(),g="function"==typeof f.zoomBandChartKnobFillStyle?f.zoomBandChartKnobFillStyle(this.SA.Ks):f.zoomBandChartKnobFillStyle||z;this.Kk=[this.Hk.IA.Le(this.Hk.mg).Be(g).De(nt),this.Hk.IA.Le(this.Hk.mg).Be(g).De(nt)],this.qk=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.tT()}add(t){var e,i,s,r,n;const o=this.Gk.map((t=>t.axis)),h="x"===this.$k?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Uk);this.Gk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Yk.sr(h.ir()),this.iT&&this.iT.remove(),this.iT=dt(...this.Gk.map((t=>t.axis)))}const a=this.Zu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.Xk)l=this.Zk;else{const t=this.Wk.get(a);t?l=t:(l=this.Zu.getHeight({x:this.Hk.addAxisX.bind(this.Hk),y:this.Hk.addAxisY.bind(this.Hk)})(),this.sT(l)),this.Wk.set(a,l)}const u=this.Zu.getWidth({x:this.Yk,y:l}),c=this.Zu.getHeight({x:this.Yk,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.HM(r)));const n=t.$M((()=>e.clear()));f.push((()=>{t.XM(n)}))};if(t instanceof gc)d=this.Hk.addPointLineAreaSeries({...t.Kn,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.HC());else if(t instanceof cc||t instanceof ec){const i=this.Hk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof cc?null===(e=t.Kn)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof cc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Dc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof Iu){const e=this.Hk.addAreaSeries({xAxis:u,yAxis:c,baseline:t.Q_}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof dc){const e=this.Hk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.Kn)||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 tc){const e=this.Hk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.Kn)||void 0===s?void 0:s.pointShape,mode:t.mw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Yu){const e=this.Hk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.Kn)||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 Nu){const e=this.Hk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.Kn)||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 Pu){const e=this.Hk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.UM()),i=t.YM(((t,i)=>e.add(i)));f.push((()=>t.HM(i))),d=e;const s=t.$M((()=>e.clear()));f.push((()=>{t.XM(s)}))}else{if(!(t instanceof bu))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.Hk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.e_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.n_(d);const s=t.l_(((t,i)=>e.invalidateIntensityValues(i))),r=t.o_(i);f.push((()=>{t.u_(s),t.a_(r)}));const n=t.$M((()=>e.clear()));f.push((()=>{t.XM(n)}))}}d.setMouseInteractions(!1);const y=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(y)}));const m=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(m)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.Lv.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.Lv.get(t);if(e){const{clearReferences:i}=e;i(),this.Lv.delete(t),e.series.dispose();const s=this.Zu.getHeight({x:t.axisX,y:t.axisY}),r=this.Wk.get(s);r&&0===r.Lg().length&&(this.Wk.delete(s),r.dispose())}const i="x"===this.$k?t.axisX:t.axisY;if(!Array.from(this.Lv.keys()).find((t=>i===("x"===this.$k?t.axisX:t.axisY)))){const t=this.Gk.findIndex((t=>t.axis===i));this.Gk[t].deattach(),this.Gk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.Qk.forEach((e=>e.Be(t))),this.Hk.cs.Ms(),this}getDefocusOverlayFillStyle(){return this.Qk[0].Xh()}setSplitterStrokeStyle(t){return this.Jk.collection.We(t),this.Hk.cs.Ms(),this}getSplitterStrokeStyle(){return this.Jk.collection.mu()}setKnobFillStyle(t){return this.Kk.forEach((e=>e.Be(t))),this.Hk.cs.Ms(),this}getKnobFillStyle(){return this.Kk[0].Xh()}setKnobStrokeStyle(t){return this.Kk.forEach((e=>e.De(t))),this.Hk.cs.Ms(),this}getKnobStrokeStyle(){return this.Kk[0].mo()}setKnobSize(t){return this.qk=t,this.Hk.cs.Ms(),this}getKnobSize(){return this.qk}getDefaultAxisX(){return this.Hk.getDefaultAxisX()}getDefaultAxisY(){return this.Hk.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}sT(t){t.setTickStrategy(Ks.Empty).setMouseInteractions(!1).setNibStyle(nt).setStrokeStyle(nt)}tT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.$k?null===(s=Array.from(this.Lv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Lv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Yk.getInterval();Math.abs(this.Yk.At.ft(t)-this.Yk.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.Zu.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.$k?null===(e=Array.from(this.Lv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Lv.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.Zu.getWidth(this.Hk.translateCoordinate(t,this.Hk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),Qt(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=Ji(new es(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.Hk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.Hk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.$k?null===(s=Array.from(this.Lv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Lv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Yk.At.pi(o.start,this.Zu.getWidth(t)),a=this.Yk.At.pi(o.end,this.Zu.getWidth(t));i(h,a,!1),Qt(e)};this.Hk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=Ji(new es(void 0,((t,e,i,r,n)=>s(r,n))));this.Hk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.$k?null===(s=Array.from(this.Lv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Lv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Yk.getInterval(),a=this.Zu.getWidth(this.Hk.translateCoordinate(e,this.Hk.coordsAxis)),l=this.Yk.At.ft(o.start),u=this.Yk.At.ft(o.end),c=this.Yk.At.ft(a),d=Ft((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Uf,g=d*f*-Math.sign(e.deltaY),y=(1-d)*f*Math.sign(e.deltaY),m=Ft(this.Yk.At.pi(o.start,g),h.start,h.end),p=Ft(this.Yk.At.pi(o.end,y),h.start,h.end);i(m,p,!1),Qt(e)})),this.Hk.onSeriesBackgroundTouchStart(r.onTouchStart),this.Hk.onSeriesBackgroundTouchMove(r.onTouchMove),this.Hk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.Qk.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.$k?null===(e=Array.from(this.Lv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Lv.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.Zu.getWidth(this.Hk.translateCoordinate(t,this.Hk.coordsAxis)),o=r.getInterval(),h=this.Yk.getInterval(),a=Ft(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),Qt(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=Ji(new class{constructor(t,e=300){this.Vs=!1,this.Os=[],this.Ns=300,this.Gs=t,this.Ns=e}Es(t,e){const i=Ct.performance.now();let s=!1;for(let t=0;t=this.Ns?(this.Os.splice(t,1),t-=1):this.Os[t].state&&(s=!0);return this.Vs?0===e.interactions.length&&(this.Os.push({state:!1,time:i}),this.Vs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Os.push({state:!0,time:i}),s=!0,this.Vs=!0),s}zs(t,e,i){if(i&&!this.Vs){const i=this.Os.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Gs(t,e),this.Os.length=0)}}}(((t,e)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.Hk.getSizePixels()}onResize(t){return this.Hk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.Hk.offResize(t)}Or(t){this.Hk.Or(t)}getMinimumSize(){return this.Hk.getMinimumSize()}J(){return this.Hk.J()}K(){return this.Hk.K()}Re(t){var e,i,s,r;const n=Se(Array.from(this.Lv.keys()).map((t=>t.chart))),o="x"===this.$k?null===(e=Array.from(this.Lv.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.Lv.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.$k){const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(0!==t.cg)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.qg())}));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.cg)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.qg())}));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.Hk.forEachAxisY((t=>t.setThickness(0))),null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.Hk.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.cg)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.qg())}));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.cg)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.qg())}));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.Hk.forEachAxisX((t=>t.setThickness(0))),null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.Hk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.Hk.Re(t);const h=this.Yk.getInterval().start,a=this.Yk.getInterval().end,l=Ft(o?o.getInterval().start:h,h,a),u=Ft(o?o.getInterval().end:a,h,a),c=this.Zu.getHeight(this.Hk.$C.getInnerIntervalPixels());this.Qk[0].Ee(this.Zu.toPoint(h,0)).it(this.Zu.toPoint(l-h,c)),this.Qk[1].Ee(this.Zu.toPoint(u,0)).it(this.Zu.toPoint(a-u,c)),this.Jk.members[0].$g(this.Zu.toPoint(h,c),this.Zu.toPoint(l,c)),this.Jk.members[1].$g(this.Zu.toPoint(l,c),this.Zu.toPoint(l,0)),this.Jk.members[2].$g(this.Zu.toPoint(l,0),this.Zu.toPoint(u,0)),this.Jk.members[3].$g(this.Zu.toPoint(u,0),this.Zu.toPoint(u,c)),this.Jk.members[4].$g(this.Zu.toPoint(u,c),this.Zu.toPoint(a,c));const d=ct(this.Zu.toPoint(l,c/2),this.Yk.pg,this.Hk.mg),f=ct(this.Zu.toPoint(u,c/2),this.Yk.pg,this.Hk.mg),g=this.qk;this.Kk[0].Ee({x:d.x-g.x/2,y:d.y-g.y/2}).it({x:g.x,y:g.y}).Jh(this.Zu.getWidth({x:0,y:90})),this.Kk[1].Ee({x:f.x-g.x/2,y:f.y-g.y/2}).it({x:g.x,y:g.y}).Jh(this.Zu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.Hk.setSeriesBackgroundFillStyle(t),this.Hk.cs.Ms(),this}getSeriesBackgroundFillStyle(){return this.Hk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.Hk.setSeriesBackgroundStrokeStyle(t),this.Hk.cs.Ms(),this}getSeriesBackgroundStrokeStyle(){return this.Hk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.Hk.setSeriesBackgroundEffect(t),this.Hk.cs.Ms(),this}getSeriesBackgroundEffect(){return this.Hk.getSeriesBackgroundEffect()}getTheme(){return this.Hk.getTheme()}setTitle(t){return this.Hk.setTitle(t),this}getTitle(){return this.Hk.getTitle()}setTitleFillStyle(t){return this.Hk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.Hk.getTitleFillStyle()}setTitleFont(t){return this.Hk.setTitleFont(t),this}getTitleFont(){return this.Hk.getTitleFont()}setTitleMargin(t){return this.Hk.setTitleMargin(t),this}getTitleMargin(){return this.Hk.getTitleMargin()}setPadding(t){return this.Hk.setPadding(t),this}getPadding(){return this.Hk.getPadding()}setBackgroundFillStyle(t){return this.Hk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.Hk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.Hk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.Hk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return ea(t,e,i,this.Hk.mg,this.Hk.cs)}addUIElement(t,e){return this.Hk.addUIElement(t,e)}addLegendBox(t,e){return this.Hk.addLegendBox(t,e)}getLegendBoxes(){return this.Hk.getLegendBoxes()}saveToFile(t,e,i){return this.Hk.saveToFile(t,e,i),this}dispose(){return this.Hk.dispose(),this.Wk.clear(),this.Lv.clear(),this.jk(this),this}isDisposed(){return this.Hk.isDisposed()}onDispose(t){return this.Hk.onDispose((()=>t(this)))}offDispose(t){return this.Hk.offDispose(t)}}const Dc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof cc||t instanceof Iu?t.getStrokeStyle().getFillStyle():t instanceof dc||t instanceof Nu?t.getPointFillStyle():void 0)(t);return e?new rs({thickness:2,fillStyle:e}):void 0};class Bc extends Zl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Cs="Point Series",this.jb=[],this.Zb=!1,this.tM=3,this._a=0,this.Te=ye(this.ts.polarPointSeriesFillStyle,o),this.pd=new yo({dataPattern:null}),this.Qa=t.Sd(r).We(nt).vd(z).md(this.Te).xd(e.PointShape.Circle).Cd(this.tM).ds(this.getHighlight()).yd(this.pd),this.As(this.Qa)}solveNearest(t,e="show-nearest"){const i=this.chart.translateCoordinate(t,this.chart.coordsAxis),s=Ql([i],this.scale)[0],r=this.pd.qc(s,aa(e),this.scale,this.chart.mg);if(!r)return;const n=tu(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Be({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.jb.length&&this.chart.cs.Zn(fh.Tf),this.jb=Jl(t),this.Zb=!0,this.Ub=ql(this.jb),this.Bs.Ms(),this}setPointAlignment(t){return this.Qa.WC(t),this.chart.cs.Ms(),this}getPointAlignment(){return this.Qa.UC()}setPointFillStyle(t){this.Te="function"==typeof t?t(this.Te):t;const e=this.Te;return this.Qa.md(e),this.Bs.Ms(),this}getPointFillStyle(){return this.Te}setPointSize(t){return this.tM=t,this.Qa.Cd(t),this.Bs.Ms(),this}getPointSize(){return this.tM}setPointShape(t){return this.Qa.xd(t),this.chart.cs.Ms(),this}getPointShape(){return this.Qa.bd()}setPointRotation(t){return this._a=t,this.Qa.Md(t),this.Bs.Ms(),this}getPointRotation(){return this._a}ov(){return this.uv&&this.jb.length>0&&this.getVisible()}ze(t,e){t.ds(e),this.Bs.Ms()}Re(){if(this.Zb||this.scale.qb()){const t=Ql(this.jb,this.scale),e=Je(t);this.pd.clear().add(t),this.Qa.ta(e),this.Zb=!1,this.Qa.zs()}}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}Ps(){return this.ws||this.getPointShape()}}class Pc{constructor(t,e,i,s){this.R=new r.Eventer,this.eT=!1,this.ne=t,this.hT=e,this.Lv=i,this.Qa=s}setGeometry(t){return this.rT=t,this.eT=!0,this.ne.cs.Ms(),this}getGeometry(){return this.rT}setMouseInteractions(t){return this.Qa.setMouseInteractions(t),this}dispose(){return this.Qa.dispose(),this.hT(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.ne.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 Lc extends Zl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Polygon Series",this.nT=[],this.oT=[],this.aT=t=>{const e=this.oT.indexOf(t);e>=0&&this.oT.splice(e,1);const i=this.nT.findIndex((e=>e===t.Qa));i>=0&&this.nT.splice(i,1),this.Bs.Ms()},this.Te=ye(this.ts.polarPolygonSeriesFillStyle,n),this.Fe=ye(this.ts.polarPolygonSeriesStrokeStyle,n)}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=du(s,this.nT,((t,e)=>{const i=t.qc(e);if(i)return ct(i,this.scale,t.cs.At)}),$e);if(!r)return;const n=ct(r[0],r[1].cs.At,this.scale);if(!this.lT(r[1]))return;const o=tu(n,this.scale);return{cursorPosition:{pointMarker:n,pointMarkerScale:this.scale,resultTable:n,resultTableScale:this.scale},series:this,...o}}Ki(t,e){return Be({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}addPolygon(){const t=new Pc(this.chart,this.aT,this,this.uT());return this.oT.push(t),t}setFillStyle(t){this.Te="function"==typeof t?t(this.Te):t;const e=this.Te;for(const t of this.nT)t.Be(e);return this.Bs.Ms(),this}getFillStyle(){return this.Te}setStrokeStyle(t){this.Fe="function"==typeof t?t(this.Fe):t;const e=this.Fe;for(const t of this.nT)t.De(e);return this.Bs.Ms(),this}getStrokeStyle(){return this.Fe}ov(){return this.uv&&void 0!==this.oT.find((t=>void 0!==t.cT))&&this.getVisible()}Re(){this.oT.forEach((t=>{(t.eT||this.scale.qb())&&t.dT&&(t.Qa.Cl(Ql(t.dT,this.scale)),t.eT=!1,t.Qa.zs())}))}vv(){super.vv();const t=y(ze,_e);this.oT.forEach((e=>{if(!e.rT)return;const i=!e.eT&&e.dT?e.dT:Jl(e.rT);e.dT=i;const s=!e.eT&&e.cT?e.cT:ql(i);e.cT=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Ub=t}ze(t,e){t.ds(e),this.Bs.Ms()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te,stroke:this.Fe})}uT(){const t=this.Bs.lc(this.scale,mn.Simple).Be(this.Te).De(this.Fe).ds(this.getHighlight());return this.nT.push(t),this.As(t),t}lT(t){return this.oT.find((e=>e.Qa===t))}}class Vc extends Zl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Cs="Area Series",this.jb=[],this.Zb=!1,this.Qb=!1,this.fT=!1,this.Te=ye(this.ts.polarAreaSeriesFillStyle,n),this.Fe=ye(this.ts.polarAreaSeriesStrokeStyle,n)}setData(t){0!==this.jb.length&&this.chart.cs.Zn(fh.Tf);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te,stroke:this.Fe})}}class zc extends Vc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.AT=this.Bs.lc(this.scale,mn.Simple).ds(this.getHighlight()),this.As(this.AT)}solveNearest(t,e){const i=this.chart.cs.No(t),s={x:i.engineX,y:i.engineY},r=this.AT.qc(s);if(!r)return;const n=tu(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Ki(t,e){return Be({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}Re(){if(this.Zb||this.scale.qb()){const t=this.jb,e=!0===this.Qb?Ql(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(It(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;!It(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.gT.start}Eb(t){this.pT=t,this.xT=!0}Vb(){return!1===this.pT}zb(t){this.yT=t,this.xT=!0}Bb(){return this.yT}yi(){return this.Si}_i(){return!1}ct(t,e,i,s){return this.x=new Pi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Pi(t.y,e.y,i.y,s?s.y:void 0),this}mi(){return this.di}qb(){return this.ST}_T(){return this.xT}Wi(){return this.bT}J(){return this.u=!1,this.Si=!1,this.ST=!1,this.xT=!1,this}K(){return this.u=!0,this.Si=!0,this.ST=!0,this.xT=!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.MT(),this}Ei(t){return this.mT=t,this.MT(),this}zi(t){return this.vT=t,this.MT(),this}ni(){return u(this.mT[0]+this.mT[1],this.vT[0]+this.vT[1])}oi(){return this.Z}MT(){const t=this.gT,e=u(this.x.ai(this.Z.x),this.y.ai(this.Z.y)),i=this.mT[0]+this.mT[1],s=this.vT[0]+this.vT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.mT[0]+Math.max((r-2*o)/2,0),this.mT[1]+Math.max((r-2*o)/2,0)],a=[this.vT[0]+Math.max((n-2*o)/2,0),this.vT[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.bT={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.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(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 Nc extends dl{constructor(t,e,i,s,r,n,o){super(t,e,i,e.kp("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.rA=[],this.Wo=!0,this.wT=(t,e,i,s,r)=>{this.gb.it(s,r)},this.lA=ee(this.rA),this.CT=t=>{this.rA.push(t)},this.kT=()=>this.Lv,this.cs.Zn(fh.vf),this.Dk=e.wx("polarChart series bg",0),this.TT=e.Xy("polarChart axis gridlines",0),this.FT=e.Xy("polarChart series",1),this.IT=e.Xy("polarChart axis lines",2),this.PT=e.Xy("polarChart axis ticks",3),this.gb=i.d2({scaleXYConstructor:_c}),this.onResize(this.wT),this.bh.yr("Polar Chart"),this.Ov=this.Dk.nd(this.gb).Be(this.ts.polarChartSeriesBackgroundFillStyle).De(nt).cu(0).Ye(360).gu(0),this.Nv=this.Dk.nd(this.gb).Be(z).De(this.ts.polarChartSeriesBackgroundStrokeStyle).cu(0).Ye(360).gu(0),super.Vv(this.Ov,this.Nv),this.Cp(r,this.mg),this.DT=new Ul(this,this.gb,this.ts,!1!==(null==n?void 0:n.animationsEnabled),this.TT,this.IT,this.PT,this.hs,this.kT),this.BT=new Gl(this,this.gb,this.ts,!1!==(null==n?void 0:n.animationsEnabled),this.TT,this.IT,this.PT,this.hs),this.coordsAxis={axisAmplitude:this.DT,axisRadial:this.BT};const h=e.Zy(),a=Bt(n?n.cursorBuilder:void 0,wa);this.Qy=ua(this,h,a.yy(h,this.uiScale,this.uiScale,Et,this.ts),this,"show-nearest",Uc,((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.Lv}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.Qy.solveNearest(t,e,this.Lv,((t,e,i)=>t.solveNearest(e,i)))}addCursor(t=wa){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}translateCoordinate(t,e,i){if(i){const e=t,s=this.mg,r=i;if(Oi(r)){const t=ct(e,s,this.cs.At);return this.cs.Go({engineX:t.x,engineY:t.y})}if(Yi(r))return e;if(Kl(r)){const t=ct(e,s,this.gb);return tu(t,this.gb)}}else{const i=t,s=e;if(Ui(i)){if(Kl(s)){const t=this.cs.No(i),e=ct({x:t.engineX,y:t.engineY},this.cs.At,this.gb);return tu(e,this.gb)}if(Oi(s))return i;if(Yi(s)){const t=this.cs.No(i);return ct({x:t.engineX,y:t.engineY},this.cs.At,this.mg)}}else if(Xl(i)){if(Kl(s))return i;const t=Ql([i],this.gb)[0];if(Oi(s)){const e=ct(t,this.gb,this.cs.At),i={engineX:e.x,engineY:e.y};return this.cs.Go(i)}if(Yi(s))return ct(t,this.gb,this.mg)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new iu(this.FT,this,this.Ev,this.gb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addPointSeries(t){const e=new Bc(this.FT,this,this.Ev,this.gb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addPointLineSeries(t){const e=new su(this.FT,this,this.Ev,this.gb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addAreaSeries(t){const e=new zc(this.FT,this,this.Ev,this.gb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addPolygonSeries(t){const e=new Lc(this.FT,this,this.Ev,this.gb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lv.length,this.cs.hs);return this.Gv(e),e}addHeatmapSeries(t){const e=new eu(this.FT,this,this.Ev,this.gb,this.ts,this.cs.hs,t);return this.Gv(e),e}addSector(){const t=new jl(this.FT,this,this.lA,this.gb,this.ts,this.cs.hs);return this.CT(t),t}getAmplitudeAxis(){return this.DT}get amplitudeAxis(){return this.DT}get axisAmplitude(){return this.DT}getRadialAxis(){return this.BT}get radialAxis(){return this.BT}get axisRadial(){return this.BT}Re(t){var e,i;super.Re(t),ha.Rp(this.bh,this.Tp);for(const t of this.Lv)t.vv();this.DT.Br(),this.BT.Br();for(const t of this.Lv)t.Re();for(let t=1;t<=2;t+=1){const e=this.DT.Re(),i=this.BT.Re(),s=ha.Lp(this.bh,this.Tp),r=[this.ka.left+i,this.ka.right+i],n=[this.ka.bottom+i,this.ka.top+i+s];this.gb.Ei(r).zi(n);const o=4;if(!(!this.LT||Math.abs(this.LT.amplitude-e)>=o||Math.abs(this.LT.radial-i)>=o)||1!==t){this.LT={amplitude:e,radial:i};break}}const s=this.gb.Tb().start,r=this.gb.Tb().end,n=this.gb.kb()?((null===(e=this.LT)||void 0===e?void 0:e.radial)||0)*this.gb.x.getPixelSize()+r-s:((null===(i=this.LT)||void 0===i?void 0:i.radial)||0)*this.gb.x.getPixelSize()+s-r;this.Ov.du(n).pu(360),this.Nv.du(n).pu(360);for(const t of this.rA)t.Re();this.Qy.Re(!1,this.Lv,((t,e,i)=>t.solveNearest(e,i)));for(const t of this.Lv)t._m();return super.wp(),this.RT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.DT.setAnimationsEnabled(t),this.BT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.Wo=t,this}getMouseInteractions(){return this.Wo}getMinimumSize(){return u(Oc,Oc)}RT(){}forEachAxis(t){return t(this.DT),t(this.BT),this}dispose(){return this.rA.slice().forEach((t=>t.dispose())),this.Qy.Y(),this.Dk.Y(),this.TT.Y(),this.FT.Y(),this.IT.Y(),this.PT.Y(),super.dispose()}ef(){return[...this.Lv,...this.rA]}}const Oc=300,Uc=(t,e,i)=>{var s;return yt(e)?la(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:Wi(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}],["Intensity","",{text:Wi(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]]):la(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:Wi(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}]])};class Yc extends Da{}class Gc extends Yc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Cs="Slice",this.M=0,this.my=!1,this.ET=z,this.Sy=z,this.xy=this.M,this._y=$((()=>this.chart.cs.Ms())),this.Cy=()=>{this.ky=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.AT=e.lc(r,mn.Simple).ds(this.getHighlight()),this.As(this.AT),this.ih=i.Gr(r).ds(this.getHighlight()),this.As(this.ih,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Py(this.xy,t):this.xy=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.xy>0?(this.ky&&(this.ky.finish(!1),this.ky=void 0),this.Py(this.xy,0,(()=>super.setVisible(!1)))):(this.xy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.ky&&(this.ky.finish(!1),this.ky=void 0),super.setVisible(!0),this.Py(this.xy,this.M)):(this.xy=this.M,super.setVisible(!0)),this}Py(t,e,i){this.ky=this._y(300,X.ease)([[t,e]],(([t])=>{this.xy=t,this.chart.cs.Ms()})),this.ky.onEveryAnimationEnd(this.Cy),i&&this.ky.onAnimationEnd(i)}setStyle(t,e,i,s){this.ET=t,this.Sy=i,this.AT.Be(this.ET).De(e),this.ih.Be(this.Sy).Qh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Kc=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Wc(i,r.x),s=Wc(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},y={x:0,y:n.bottom},m=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:y.x-A*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>g.x&&p.AT.Cl([g,d,f,y])}};class Xc extends oa{constructor(t,i,s,r,n,o,h){super(t,i,s,i.kp("funnelChart bg",0),r,i.cs.ts.funnelChartBackgroundFillStyle,i.cs.ts.funnelChartBackgroundStrokeStyle,i.cs.ts.funnelChartTitleFont,i.cs.ts.funnelChartTitleFillStyle,o),this.Dy=[],this.By=Ia.None,this.Ey=!0,this.Oy=0,this.zT=80,this.VT=20,this.OT=0,this.NT=e.FunnelSliceModes.VariableHeight,this.Wy=!0,this.Yy=t=>{const e=this.Dy.indexOf(t);e>=0&&(this.Dy.splice(e,1),this.Hy())},this.cs.Zn(fh.pf),this.Uy=this.ts.effectsText,this.$y=i.Xy("funnelChart bottom",0),this.jy=i.Xy("funnelChart top",1),this.bh.yr("Funnel Chart"),this.Ly=this.ts.funnelChartSliceFillStylePalette,this.Ry=this.ts.funnelChartSliceStrokeStyle,this.zy=this.ts.funnelChartSliceLabelFont,this.Vy=this.ts.funnelChartSliceLabelFillStyle;const a=i.Zy(),l=Bt(h?h.cursorBuilder:void 0,Ta);this.Qy=ua(this,a,l.yy(a,this.uiScale,this.uiScale,Et,this.ts),void 0,"show-pointed",jc,(()=>0)),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled)),this.Cp(n,this.mg)}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Ta){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}addSlice(t,e){const i=new Gc(this.Oy,this.$y,this.jy,this,this.mg,this.Yy,this.ts,this.cs.hs);return this.Oy+=1,i.setName(t),i.setValue(e),i.hs.ns.bs(this.Uy),i.hs.os.bs(this.Wy),this.Dy.push(i),this.cs.Ms(),i.setHighlightOnHover(this.Ey),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.Wy}setSliceSorter(t){return this.By=t,this.Dy=this.Dy.sort(this.By),this.cs.Ms(),this}getSliceSorter(){return this.By}setLabelFillStyle(t){return this.Vy="function"==typeof t?t(this.Vy):t,this.cs.Ms(),this}getLabelFillStyle(){return this.Vy}setLabelFont(t){return this.zy="function"==typeof t?t(this.zy):t,this.cs.Ms(),this}getLabelFont(){return this.zy}setLabelEffect(t){return this.Uy=t,this.Dy.forEach((e=>e.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Uy}setLabelFormatter(t){return this.Ky=t,this.cs.Ms(),this}getLabelFormatter(){return this.Ky}setSliceHighlightOnHover(t){return this.Ey=t,this.Dy.forEach((e=>e.setHighlightOnHover(t))),this}Re(t){super.Re(t),ha.Rp(this.bh,this.Tp),super.wp();const e=ha.Lp(this.bh,this.Tp),i=u(this.mg.x.getInnerInterval()-(this.ka.left+this.ka.right),this.mg.y.getInnerInterval()-(this.ka.bottom+this.ka.top+e)),s=u(this.ka.left+i.x/2,this.ka.bottom+i.y/2);this.Dy=this.Dy.sort(this.By);for(let t=0,{length:e}=this.Dy;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.No(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.qy(r,o,s,i)}Jy(t,e){t.setStyle(this.jd?new U({color:this.jd.getColors(t.getAnimatedValue())}):this.Ly(e,t),this.Ry,this.Vy,this.zy)}Hy(){this.Dy=this.Dy.sort(this.By),this.cs.Ms()}ef(){return this.Dy}dispose(){return this.Dy.slice().forEach((t=>t.dispose())),this.Qy.Y(),this.$y.Y(),this.jy.Y(),super.dispose()}}const jc=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],$c=(t,i,s)=>{const r=t.kl();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}}},Zc=t=>{const e=t.kl();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 Qc extends Xc{constructor(){super(...arguments),this.Ky=Fa.NamePlusValue,this.GT=10,this.WT=e.FunnelLabelSide.Left,this.UT=e.SliceLabelIndices.LabelsOnSides,this.tm=[],this.rm=this.ts.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.rm=t;for(let t=0;tt.ih.setVisible(!1))),void this.tm.forEach((t=>t.setVisible(!1)));this.YT(t,this.WT===e.FunnelLabelSide.Left?-1:1,-1,s,r);for(let t=0;tthis.chart.cs.Ms())),this.Cy=()=>{this.ky=void 0},this.index=t,this.chart=s,this.scale=r,this.qi=n,this.AT=e.lc(r,mn.Simple).ds(this.getHighlight()),this.As(this.AT),this.ih=i.Gr(r).ds(this.getHighlight()),this.As(this.ih,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Py(this.xy,t):this.xy=t,this.M=t,this.chart.cs.Ms(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.xy>0?(this.ky&&(this.ky.finish(!1),this.ky=void 0),this.Py(this.xy,0,(()=>super.setVisible(!1)))):(this.xy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.ky&&(this.ky.finish(!1),this.ky=void 0),super.setVisible(!0),this.Py(this.xy,this.M)):(this.xy=this.M,super.setVisible(!0)),this}Py(t,e,i){this.ky=this._y(300,X.ease)([[t,e]],(([t])=>{this.xy=t,this.chart.cs.Ms()})),this.ky.onEveryAnimationEnd(this.Cy),i&&this.ky.onAnimationEnd(i)}setStyle(t,e,i,s){this.ET=t,this.Sy=i,this.AT.Be(this.ET).De(e),this.ih.Be(this.Sy).Qh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},nd=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=rd(i,r.x),s=rd(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},y={x:0,y:n.bottom},m=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:y.x-A*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>=g.x&&p.AT.Cl([g,d,f,y])}};class od extends oa{constructor(t,i,s,r,n,o,h){super(t,i,s,i.kp("pyramidChart bg",0),r,i.cs.ts.pyramidChartBackgroundFillStyle,i.cs.ts.pyramidChartBackgroundStrokeStyle,i.cs.ts.pyramidChartTitleFont,i.cs.ts.pyramidChartTitleFillStyle,o),this.Dy=[],this.By=Ia.None,this.Ly=this.ts.pyramidChartSliceFillStylePalette,this.Ry=this.ts.pyramidChartSliceStrokeStyle,this.Ey=!0,this.zy=this.ts.pyramidChartSliceLabelFont,this.Vy=this.ts.pyramidChartSliceLabelFillStyle,this.Oy=0,this.zT=0,this.VT=80,this.OT=0,this.NT=e.PyramidSliceModes.VariableHeight,this.Wy=!0,this.Yy=t=>{const e=this.Dy.indexOf(t);e>=0&&(this.Dy.splice(e,1),this.Hy())},this.cs.Zn(fh.pf),this.Uy=this.ts.effectsText,this.$y=i.Xy("pyramidChart bottom",0),this.jy=i.Xy("pyramidChart top",1),this.bh.yr("Pyramid Chart");const a=i.Zy(),l=Bt(h?h.cursorBuilder:void 0,Ta);this.Qy=ua(this,a,l.yy(a,this.uiScale,this.uiScale,Et,this.ts),void 0,"show-pointed",hd,(()=>0)),this.Cp(n,this.mg),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled))}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Ta){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}addSlice(t,e){const i=new sd(this.Oy,this.$y,this.jy,this,this.mg,this.Yy,this.ts,this.cs.hs);return this.Oy+=1,i.setName(t),i.setValue(e),i.hs.ns.bs(this.Uy),i.hs.os.bs(this.Wy),this.Dy.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.Wy}setSliceSorter(t){return this.By=t,this.Dy=this.Dy.sort(this.By),this.cs.Ms(),this}getSliceSorter(){return this.By}setLabelFillStyle(t){return this.Vy="function"==typeof t?t(this.Vy):t,this.cs.Ms(),this}getLabelFillStyle(){return this.Vy}setLabelFont(t){return this.zy="function"==typeof t?t(this.zy):t,this.cs.Ms(),this}getLabelFont(){return this.zy}setLabelEffect(t){return this.Uy=t,this.Dy.forEach((e=>e.hs.ns.bs(t))),this.cs.Ms(),this}getLabelEffect(){return this.Uy}setLabelFormatter(t){return this.Ky=t,this.cs.Ms(),this}getLabelFormatter(){return this.Ky}setSliceHighlightOnHover(t){return this.Ey=t,this.Dy.forEach((e=>e.setHighlightOnHover(t))),this}Re(t){super.Re(t),ha.Rp(this.bh,this.Tp),super.wp();const e=ha.Lp(this.bh,this.Tp),i=u(this.mg.x.getInnerInterval()-(this.ka.left+this.ka.right),this.mg.y.getInnerInterval()-(this.ka.bottom+this.ka.top+e)),s=u(this.ka.left+i.x/2,this.ka.bottom+i.y/2);this.Dy=this.Dy.sort(this.By);for(let t=0,{length:e}=this.Dy;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.No(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.qy(r,o,s,i)}Jy(t,e){t.setStyle(this.jd?new U({color:this.jd.getColors(t.getAnimatedValue())}):this.Ly(e,t),this.Ry,this.Vy,this.zy)}Hy(){this.Dy=this.Dy.sort(this.By),this.cs.Ms()}ef(){return this.Dy}dispose(){return this.Dy.slice().forEach((t=>t.dispose())),this.Qy.Y(),this.$y.Y(),this.jy.Y(),super.dispose()}}const hd=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],ad=(t,i,s)=>{const r=t.kl();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}}},ld=t=>{const e=t.kl();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 ud extends od{constructor(){super(...arguments),this.Ky=Fa.NamePlusValue,this.GT=10,this.WT=e.PyramidLabelSide.Left,this.UT=e.SliceLabelIndices.LabelsOnSides,this.tm=[],this.rm=this.ts.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.rm=t;for(let t=0;tt.ih.setVisible(!1))),void this.tm.forEach((t=>t.setVisible(!1)));this.YT(t,this.WT===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),yd=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var md;e.SpiderWebMode=void 0,(md=e.SpiderWebMode||(e.SpiderWebMode={}))[md.Normal=0]="Normal",md[md.Circle=1]="Circle";class pd{constructor(t,e,i,s,n,o,h,a){this.R=new r.Eventer,this.$T=t,this.Wr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.XT=h,this.jT=a,this.ZT=this.$T.Ue(this.scale).setMouseInteractions(!1),this.QT=this.Wr.Gr(this.scale).yr(this.tag).setMouseInteractions(!1),this.JT=this.XT(this,this.$T.om(this.scale,void 0,[Ua.InternalUI])).We(this.chart.getNibStyle()),this.jT.gs([this.QT])}qy(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.QT.setVisible(!0).Ee(ui(c,u(h.paddingX,h.paddingY))).Wa(h.alignmentX).Ya(h.alignmentY):this.QT.setVisible(!1)}getLabelSize(){return this.QT.Qh(this.chart.getAxisLabelFont()).Be(this.chart.getAxisLabelStyle()).zs().oi()}dispose(){this.ZT&&this.ZT.dispose(),this.QT&&this.QT.dispose(),this.JT&&this.JT.dispose()}}class Ad extends $l{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Cs="Spider Series",this._u=new Map,this.Xi=e.HighlightModes.onHover,this.tM=8,this._a=0,this.KT=(()=>{const t=$((()=>{}));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)||X.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.qT={},this.tF={},this.My=this.getVisible(),this.iF=1,this.sF=((t,e)=>{const i=$((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||X.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.iF=t,this.Bs.cs.Ms()}),(t=>{super.setVisible(t)})),this.chart=t,this.Bs=i,this.iM=r,this.eF=n,this.Cx=o,this.hF=h,this.rF=a,this.scale=s,this.nF=ye(u.spiderSeriesFillStyle,c),this.oF=ye(u.spiderSeriesStrokeStyle,c),this.aF=ye(u.spiderSeriesPointFillStyle,c)}Ki(t,e){const i=this.rF(e);if(void 0!==i&&this._u.has(i.tag)){const t=this._u.get(i.tag),e=this.hF(i.tag,t);return{cursorPosition:{pointMarker:e,pointMarkerScale:this.scale,resultTable:e,resultTableScale:this.scale},series:this,axis:i.tag,value:t}}}ov(){return this.uv&&this._u.size>0&&this.getVisible()}addPoints(...t){this._u.size>0&&this.chart.cs.Zn(fh.Tf),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.KT(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this._u.set(s,r+t*(e-r)),this.Bs.cs.Ms()}))}),{easing:this.qT.easing,durationMs:this.qT.durationMs,onStart:()=>{i=new Map(this._u)}})}else for(let e=0;e=3&&(this.AT||(this.AT=this.Bs.lc(this.scale,mn.Simple).De(this.oF).Be(this.nF).ds(this.getHighlight()),this.As(this.AT)),this.AT.Cl(t),this.sM||(this.sM=this.Bs.Bv(this.scale).it(this.tM).ll(this.iM).Jh(this._a).Be(this.aF).ds(this.getHighlight()),this.As(this.sM)),this.sM.Ot().Al(t))}}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.nF,stroke:this.oF})}Ps(){return this.ws||this.iM}lF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Sd=t=>Je(t.QT.th()),vd=t=>Je(t.th()),bd=(t,i,s,r)=>t.gu(0).Ee(s).cu(90).Ye(-270).pu(i===e.SpiderWebMode.Circle?void 0:r.length),Md={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Cd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Td=()=>{Cd.alignmentX=0,Cd.alignmentY=0,Cd.paddingX=0,Cd.paddingY=0};class Rd extends dl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.kp("spiderChart bg",0),r,i.cs.ts.spiderChartBackgroundFillStyle,i.cs.ts.spiderChartBackgroundStrokeStyle,i.cs.ts.spiderChartTitleFont,i.cs.ts.spiderChartTitleFillStyle,h),this.ka=A(20,20,20,20),this.axisScale=lt.d1({scale1DConstructor:Pi,dimension:"x"}).q(0,1),this.Cx=[],this.uF=[],this.cF=[],this.dF=Ws.expansion,this.fF=!0,this.AF=yd,this.gF=gd,this.Wo=!0,this.pF=e.SpiderWebMode.Normal,this.yF=4,this.mF=this.ts.spiderChartWebStyle,this.vF=this.ts.spiderChartScaleLabelFillStyle,this.SF=this.ts.spiderChartScaleLabelFont,this.xF=5,this.bF=this.ts.spiderChartAxisLabelFillStyle,this.MF=this.ts.spiderChartAxisLabelFont,this._F=5,this.wF=this.ts.spiderChartAxisStrokeStyle,this.CF=this.ts.spiderChartAxisNibStrokeStyle,this.Of=10,this.kF=A(),this.hasAxis=t=>this.Cx.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Di.Numeric),this.TF=()=>{const t=this.Cx.map(Sd).concat(this.cF.map(vd));return We(t)},this.FF=()=>this.IF.nd(this.mg).setMouseInteractions(!1),this.PF=t=>t.dispose(),this.DF=()=>this.IA.Gr(this.mg).setMouseInteractions(!1),this.BF=t=>t.dispose(),this.LF=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.RF=(t,e)=>{let i,s;const r=()=>{void 0!==this.EF&&this.EF.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.dF,this.dF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Cx.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=xd(a,this.Cx.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ai(ci(t.ZT.Ii(),t.ZT.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.q(i.min,l),Qt(o),this.cs.Ms()}},o=()=>{if(i=void 0,void 0!==s)if(this.dh){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.zF(),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.EF=this.lp.cs.dn(300,X.ease)([[0,1]],(([e])=>{this.axisScale.q(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.EF.onAnimationEnd((()=>{this.EF=void 0,this.dF=i}))}else this.dF=s}else this.dF=s;s=void 0};e.setMouseEnterEventHandler(this.VF).setMouseLeaveEventHandler(this.OF).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Ji(new es(((t,e,i)=>{this.VF(t),r(),Qt(i)}),n,((t,e,i,s)=>{this.OF(t),o(),Qt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.NF=t=>{this.fF&&!this.hasAxis(t)&&this.addAxis(t)},this.hF=(t,e)=>{for(const i of this.Cx)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Qe(i.ZT.Ii(),i.ZT.Ti(),t)}},this.rF=t=>{if(0===this.Cx.length)return;const e=ci(this.translateCoordinate(t,this.coordsRelative),this.Cx[0].ZT.Ii()),i=Math.atan2(e.y,e.x);let s,r=ze;for(const t of this.Cx){const e=ci(t.ZT.Ti(),t.ZT.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.Wo&&(t.We(this.CF),this.cs.Ms())},this.OF=t=>{t.We(this.CF),this.cs.Ms()},this.cs.Zn(fh.mf),this.Dk=i.wx("spiderChart series bg",0),this.IF=i.Xy("spiderChart web shapes",0),this.GF=i.Xy("spiderChart axis bg",1),this.tb=i.Xy("spiderChart plotting",2),this.IA=i.Xy("spiderChart fg",3),this.jT=this.hs.kg().bs(this.ts.effectsText),this.bh.yr("Spider Chart"),this.Ov=this.Dk.nd(this.mg).Be(this.ts.spiderChartSeriesBackgroundFillStyle).De(nt).cu(90).Ye(-270).gu(0),this.Nv=this.Dk.nd(this.mg).Be(z).De(this.ts.spiderChartSeriesBackgroundStrokeStyle).cu(90).Ye(-270).gu(0),super.Vv(this.Ov,this.Nv);const a=i.Zy(),l=Bt(o?o.cursorBuilder:void 0,Ma);this.Qy=ua(this,a,l.yy(a,this.uiScale,this.uiScale,Et,this.ts),this,"show-pointed",wd,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.Cp(n,this.mg)}getSeries(){return this.Lv}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Ma){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new pd(this.GF,this.IA,this.mg,this,t,this.axisScale,this.RF,this.jT);this.Cx.push(e)}}else t&&this.Cx.push(t);return this.jT.gs(this.Cx.map((t=>t.QT))),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.Lv.length,r=new Ad(this,this.tb,this.mg,i,this.NF,this.Cx,this.hF,this.rF,this.Ev,this.ts,s,this.cs.hs);return this.Gv(r),r}getSeriesCount(){return this.Lv.length}setWebMode(t){return this.pF=t,this.cs.Ms(),this}getWebMode(){return this.pF}setWebCount(t){return this.yF=t,this.cs.Ms(),this}getWebCount(){return this.yF}setWebStyle(t){return this.mF="function"==typeof t?t(this.mF):t,this.cs.Ms(),this}getWebStyle(){return this.mF}setScaleLabelStyle(t){return this.vF="function"==typeof t?t(this.vF):t,this.cs.Ms(),this}getScaleLabelStyle(){return this.vF}setScaleLabelFont(t){return this.SF="function"==typeof t?t(this.SF):t,this.cs.Ms(),this}getScaleLabelFont(){return this.SF}setScaleLabelPadding(t){return this.xF=t,this.cs.Ms(),this}getScaleLabelPadding(){return this.xF}setScaleLabelStrategy(t){return this.AF=t,this.cs.Ms(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.cs.Ms(),this}setAxisLabelStyle(t){return this.bF="function"==typeof t?t(this.bF):t,this.cs.Ms(),this}getAxisLabelStyle(){return this.bF}setAxisLabelFont(t){return this.MF="function"==typeof t?t(this.MF):t,this.cs.Ms(),this}getAxisLabelFont(){return this.MF}setAxisLabelEffect(t){return this.jT.bs(t),this.cs.Ms(),this}getAxisLabelEffect(){return this.jT._s()}setAxisLabelPadding(t){return this._F=t,this.cs.Ms(),this}getAxisLabelPadding(){return this._F}setAxisLabelStrategy(t){return this.gF=t,this.cs.Ms(),this}setAxisStyle(t){return this.wF="function"==typeof t?t(this.wF):t,this.cs.Ms(),this}getAxisStyle(){return this.wF}setNibStyle(t){return this.CF="function"==typeof t?t(this.CF):t,this.cs.Ms(),this}getNibStyle(){return this.CF}setNibLength(t){return this.Of=t,this.cs.Ms(),this}getNibLength(){return this.Of}setAutoAxis(t){return this.fF=t,this}getAutoAxis(){return this.fF}setMouseInteractions(t){return this.Wo=t,this}getMouseInteractions(){return this.Wo}setAxisScrollStrategy(t){return this.dF=t,this.cs.Ms(),this}getAxisScrollStrategy(){return this.dF}setAxisInterval(t,e=0){return this.axisScale.q(e,t),this.cs.Ms(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Re(t){super.Re(t),ha.Rp(this.bh,this.Tp);const e=this.Cx.length,i=ha.Lp(this.bh,this.Tp),s=u(this.mg.x.getInnerInterval()-(this.ka.left+this.ka.right),this.mg.y.getInnerInterval()-(this.ka.bottom+this.ka.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.gF){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.dF){const t=this.zF();if(void 0!==t){const e=this.dF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.dF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.q(e,i)}}const n=u(this.mg.x.getInnerStart()+(r.left+this.mg.x.getInnerInterval()-r.right)/2,this.mg.y.getInnerStart()+(r.bottom+this.mg.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.kF=A(this.Xt.left+this.ka.left+r.left,this.Xt.top+this.ka.top+i+r.top,this.Xt.right+this.ka.right+r.right,this.Xt.bottom+this.ka.bottom+r.bottom),this.qy(n,o);for(const t of this.Lv)t.vv();for(const t of this.Lv)t.Re();super.wp(),this.Qy.Re(!1,this.Lv,void 0);for(const t of this.Lv)t._m()}dispose(){return this.Dk.Y(),this.IF.Y(),this.GF.Y(),this.tb.Y(),this.IA.Y(),this.Qy.Y(),super.dispose()}getMinimumSize(){return u(this.kF.left+this.kF.right+100,this.kF.bottom+this.kF.top+100)}qy(t,e){const i=this.Cx.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];bd(h,i,s,n);const u=r*((l+1)/e);h.du(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=Qe(n,o[a],s);e.Ee(ui(c,u(m.paddingX,m.paddingY))).Wa(m.alignmentX).Ya(m.alignmentY).yr(l(s))}}}for(let e=f;e1;for(const s of this.Cx)for(const r of this.Lv){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 y(t,e)}}const wd=(t,e,i)=>la(e,[[e.series],[e.axis],[{text:t.formatValue(e.value),font:{weight:"bold"}}]]),kd=(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{WF:()=>{const e=t.UF("dashboard ui",a+l);return l+=1,e},YF:()=>t.UF("dashboard legend",51e4),HF: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,kp:(e,i)=>{const s=a+i;return t.UF(e,s)},wx:(e,i)=>{const s=l+i;return t.UF(e,s)},Lk:(e,i)=>{const s=u+i;return t.UF(e,s)},Xy:(e,i)=>{const s=c+i;return t.UF(e,s)},_x:(e,i,s)=>{const r=c+i;return t.$F(e,r,s)},Ip:(e,i)=>{const s=d+i;return t.UF(e,s)},pp:e=>{const i=f+g,s=t.UF(e,i);return g+=1,s},mp:()=>t.UF("panel legend",500002+e),Zy:()=>t.UF("panel cursor",600001+e)}}}};class Ed{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)}U(t){return this.R.off(t,"set")}}const Id={fh:!1,Ah:0,gh:!1,yh:0,ph:!1,mh:0,Sh:0,ah:Ws.fitting},Fd=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))},Dd=(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&&Ud(t,e,u,n,o,h),"spark-bar"===a&&Yd({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Yd({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Gd(t,e,u,n,o,h),"spark-pie"===a&&Hd(t,e,u,n,o,h)},Bd=(t,e,i,s)=>({x:Ld(t.x,e.x,i.x,s),y:Vd(t.y,e.y,i.y,s)}),Pd=(t,e,i,s)=>({position:Ld(t.position,e.x,i.x,s),high:Vd(t.high,e.y,i.y,s),low:Vd(t.low,e.y,i.y,s)}),Ld=(t,e,i,s)=>{const r=Ft(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Vd=(t,e,i,s)=>{const r=Ft(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},zd=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&_d(a,e,i,r,n,o,h),"axis-band"===a.type&&Nd(a,i,r,n,o,h),"constant-line"===a.type&&Od(a,i,s,r,n,o,h)},_d=(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=Bd(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().ll(void 0!==u?u:e.PointShape.Circle).Jh(d||0).it(c||5).Be(l||h.sparkPointChartFillStyle).Al(f)},Nd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(_e,ze),f=u(_e,ze);"x"===o&&(d=Bd({x:h,y:_e},e,i,s),f=Bd({x:a,y:ze},e,i,s)),"y"===o&&(d=Bd({x:_e,y:h},e,i,s),f=Bd({x:ze,y:a},e,i,s));const g=s[0],y=s[1],m=Ft(d.x,g.x,g.x+y.x),p=Ft(d.y,g.y,g.y+y.y),A=Ft(f.x,g.x,g.x+y.x),x=Ft(f.y,g.y,g.y+y.y);r.rect.add().Sl(m).xl(p).it(u(A-m,x-p)).Be(l||n.sparkChartBandFillStyle).De(c||n.sparkChartBandStrokeStyle).De(nt)},Od=(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,y=i.x,m=[];if("y"===h&&d<=c&&c<=f){const t=Bd(u(g,c),{x:g,y:d},s,r),e=Bd(u(y,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=y){const t=Bd(u(c,d),{x:g,y:d},s,r),e=Bd(u(c,f),{x:g,y:d},s,r);m.push([t,e])}m.length>0&&n.line.add().We(l||o.sparkChartConstantLineStrokeStyle).He(m[0][0]).Ye(m[0][1])},Ud=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.io&&Ct.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=ze,c=_e,d=ze,f=_e;for(let t=0;tBd(t,{x:u,y:d},g,i)));e.lineSet.add().ds(n).We(o||s.sparkLineChartStrokeStyle).Ot().Al(y),a&&zd(a,y,{x:u,y:d},{x:c,y:f},g,i,e,s)},Yd=(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,y=l||0,m=f/d*1;let p=ze,A=_e;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)*m,y:g?2:Math.max(A,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*m,y:g?t>=y?1:0:t},r=Bd({x:1*e+e*m,y:g?t>=y?0:-1:0},x,S,i),n=Bd(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).Ee(t.position).Ml(t.height).bl(t.width).Be((i=t.value,g?(i>=y?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).De(a||s.sparkBarChartStrokeStyle)}))},Gd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.io&&Ct.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=ze,f=_e,g=ze,y=_e;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=Bd(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 y=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().ds(n).Ee(d).du(g).gu(0).cu(y).Ye(y+r).Be(l[i]||ye(s.sparkPieChartFillStyle,i)).De(h||s.sparkPieChartStrokeStyle),y+=r}))};var Wd,Kd,Xd;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(Wd||(Wd={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(Kd||(Kd={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(Xd||(Xd={}));class jd extends bn{constructor(t,e,i,s,r){super(),this.Vs=!1,this.t_={x:0,y:0,height:20,width:20},this.XF={x:10,y:10},this.Bs=t,this.jF=r,this.ZF=new Co(t,e,i,Et,s).setMouseInteractions(!0),this.QF=t.lc(e,mn.Simple).Be(s.dataGridScrollBarButtonArrowFillStyle).De(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Fu(this),this.ZF.onMouseEnter((t=>t.setHighlight(1))),this.ZF.onMouseLeave((t=>t.setHighlight(0)))}JF(){switch(this.jF){case Xd.Up:this.QF.Cl([{x:this.t_.x,y:this.t_.y+this.XF.y/2},{x:this.t_.x+this.XF.x/2,y:this.t_.y-this.XF.y/2},{x:this.t_.x-this.XF.x/2,y:this.t_.y-this.XF.y/2}]);break;case Xd.Down:this.QF.Cl([{x:this.t_.x-this.XF.x/2,y:this.t_.y+this.XF.y/2},{x:this.t_.x+this.XF.x/2,y:this.t_.y+this.XF.y/2},{x:this.t_.x,y:this.t_.y-this.XF.y/2}]);break;case Xd.Left:this.QF.Cl([{x:this.t_.x-this.XF.x/2,y:this.t_.y},{x:this.t_.x+this.XF.x/2,y:this.t_.y+this.XF.y/2},{x:this.t_.x+this.XF.x/2,y:this.t_.y-this.XF.y/2}]);break;case Xd.Right:this.QF.Cl([{x:this.t_.x-this.XF.x/2,y:this.t_.y+this.XF.y/2},{x:this.t_.x+this.XF.x/2,y:this.t_.y},{x:this.t_.x-this.XF.x/2,y:this.t_.y-this.XF.y/2}])}}Ee(t){return this.t_.x=t.x,this.t_.y=t.y,this}Oa(){return u(this.t_.x,this.t_.y)}it(t){return this.t_.height=t.x,this.t_.width=t.y,this}oi(){return{x:this.t_.height,y:this.t_.width}}onMouseDown(t){return this.ZF.onMouseDown(t)}onMouseUp(t){return this.ZF.onMouseUp(t)}setFillStyle(t){return this.ZF.setFillStyle(t),this}getFillStyle(){return this.ZF.getFillStyle()}setStrokeStyle(t){return this.ZF.setStrokeStyle(t),this}getStrokeStyle(){return this.ZF.getStrokeStyle()}Re(){return this.ZF.Re(),this.JF(),this}zs(){return this.ZF.setSize(u(this.t_.height,this.t_.width)).setPosition(u(this.t_.x,this.t_.y)),this}setVisible(t){return this.ZF.setVisible(t),this.QF.setVisible(t),this}dispose(){return this.ZF.dispose(),this.QF.dispose(),this}setMouseInteractions(t){return this.ZF.setMouseInteractions(t),this}getMouseInteractions(){return this.ZF.getMouseInteractions()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.ZF.getHighlight()}setHighlight(t){return this.ZF.setHighlight(be(t)),this.R.emit("highlight",this,Boolean(t)),this.Bs.Ms(),this}}const $d=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Zd{constructor(t,i,s,n,o,h,a){this.od={x:0,y:0},this.t_={x:0,y:0,height:0,width:0},this.R=new r.Eventer,this.KF={min:u(0,0),max:u(0,0)},this.qF=!1,this.tI=!1,this.iI={x:0,y:0},this.Pu=void 0,this.sI=u(0,0),this.eI={x:0,y:0},this.hI=0,this.rI=15,this.nI=(t,i)=>{this.qF=!0,this.IA.Ms();const s=this.oI.getDraggingMode();this.Pu=this.IA.cs.Kr(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.aI&&clearInterval(this.aI)},this.lI=()=>{this.qF=!1,this.IA.Ms(),this.IA.cs.qr(this.Pu)},this.uI=t=>(this.tI=!0,this.iI=ct(this.IA.cs.Ve(t.x,t.y),this.IA.cs.At,this.scale),!0),this.cI=(t,e)=>(this.dI(e),this.aI=setInterval((()=>this.dI(e)),300),!0),this.fI=()=>(clearInterval(this.aI),!0),this.AI=(t,i)=>{const s=this.oI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=ct(this.IA.cs.Ve(t.x,t.y),this.IA.cs.At,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?$d(n.x,this.scale.x):this.t_.x,r!==e.UIDraggingModes.onlyHorizontal?$d(n.y,this.scale.y):this.t_.y),h=u(o.x-this.iI.x,o.y-this.iI.y),a=u(this.oI.getPosition().x+h.x,this.oI.getPosition().y+h.y),l=this.gI(a),c={x:Math.abs(this.sI.x-l.x),y:Math.abs(this.sI.y-l.y)};return this.pI(c),this.eI.y>h.y&&(this.iI=n),this.Re(),!0}return!1},this.yI=(t,e)=>{this.tI=!1,Qt(e),this.IA.Ms()},this.IA=t,this.lp=i,this.scale=n,this.contentScale=o,this.mI=a,this.vI=new jd(t,s,n,h,a===Wd.UpToDown?Xd.Up:Xd.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.SI=new jd(t,s,n,h,a===Wd.UpToDown?Xd.Down:Xd.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.oI=new Co(t,s,n,Et,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===Wd.UpToDown?e.UIDraggingModes.onlyVertical:a===Wd.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.xI=new Co(i,s,n,Et,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.oI.onMouseEnter(this.nI),this.oI.onMouseLeave(this.lI),this.oI.onMouseDragStart(((t,e)=>this.uI(u(e.clientX,e.clientY))&&Qt(e))),this.oI.onMouseDrag(((t,e)=>this.AI(u(e.clientX,e.clientY))&&Qt(e))),this.oI.onMouseDragStop(this.yI),this.oI.onTouchStart(((t,e)=>this.uI(u(e.clientX,e.clientY))&&Qt(e))),this.oI.onTouchMove(((t,e)=>this.AI(u(e.clientX,e.clientY))&&Qt(e))),this.oI.onTouchEnd(this.yI),this.vI.onMouseDown(((t,e)=>this.cI(t,e)&&Qt(e))),this.SI.onMouseDown(((t,e)=>this.cI(t,e)&&Qt(e))),this.vI.onMouseUp(((t,e)=>this.fI()&&Qt(e))),this.SI.onMouseUp(((t,e)=>this.fI()&&Qt(e))),this.xI.onMouseWheel(((t,e)=>this.bI(e))),this.oI.onMouseWheel(((t,e)=>this.bI(e))),this.xI.onMouseDown(((t,e)=>this.cI(t,e)&&Qt(e))),this.xI.onMouseUp(((t,e)=>this.fI()&&Qt(e)))}MI(t){return this.t_=t,this}bl(t){return this.t_.width=t,this}_I(){return this.t_.width}wI(t){return this.sI=t,this}CI(t){return this.od=t,this}kI(){return this.od}TI(t){return this.rI=t,this}FI(){return this.mI}II(t){let e;switch(this.mI){case Wd.UpToDown:return e=t>0?Math.min(this.sI.y-this.KF.max.y,this.eI.y+t):Math.max(0,this.eI.y+t),e!==this.eI.y&&(this.pI({x:0,y:e}),this.Re(),!0);case Wd.LeftToRight:return e=Math.min(this.KF.max.x-this.sI.x,this.eI.x+t),e!==this.eI.x&&(this.pI({y:0,x:e}),this.Re(),!0);default:return!1}}DI(t){let e;switch(this.mI){case Wd.UpToDown:return e=Math.max(0,this.eI.y-t),e!==this.eI.y&&(this.pI({x:0,y:e}),this.Re(),!0);case Wd.LeftToRight:return e=t>0?Math.max(0,this.eI.x-t):Math.min(this.KF.max.x-this.sI.x,this.eI.x-t),e!==this.eI.x&&(this.pI({x:e,y:0}),this.Re(),!0);default:return!0}}BI(t){switch(this.mI){case Wd.UpToDown:return this.R.on("scrollY",t);case Wd.LeftToRight:return this.R.on("scrollX",t)}return this.R.on("scrollY",t)}gI(t){switch(this.mI){case Wd.UpToDown:if(t.y>this.KF.min.y)return u(t.x,this.KF.min.y);if(t.ythis.KF.max.x)return u(this.KF.max.x,t.y)}return t}bI(t){t.deltaY>0&&this.LI()&&Qt(t),t.deltaY<0&&this.RI()&&Qt(t)}dI(t){const e=ct(this.IA.cs.Ve(t.clientX,t.clientY),this.IA.cs.At,this.scale);let i;const s=this.oI.getPosition(),r=this.oI.getSize();this.EI(e,s,r)?clearInterval(this.aI):(i=this.mI===Wd.UpToDown?u(0,e.y-s.y>0?this.rI:-this.rI):u(s.x-e.x>0?this.rI:-this.rI,0),(i.x>0||i.y>0)&&this.zI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.VI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}EI(t,e,i){return this.mI===Wd.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.t_.height?Math.min(this.sI.y-this.KF.max.y,this.eI.y+t):0,e!==this.eI.y&&(this.pI({x:0,y:e}),this.Re(),!0)}case Wd.LeftToRight:{const e=Math.min(this.KF.max.x-this.sI.x,this.eI.x+t);return e!==this.eI.x&&(this.pI({y:0,x:e}),this.Re(),!0)}default:return!1}}RI(){return this.zI(this.rI)}LI(){return this.VI(this.rI)}pI(t){if(t.x===this.eI.x&&t.y===this.eI.y)return;let e;switch(this.eI=t,this.mI){case Wd.UpToDown:e=this.eI.y*this.hI*this.contentScale.Wi().y,this.R.emit("scrollY",Kd.Vertical,e),this.IA.cs.Ms();break;case Wd.LeftToRight:e=this.eI.x*this.hI*this.contentScale.Wi().x,this.R.emit("scrollX",Kd.Horizontal,e)}}setVisible(t){return this.vI.setVisible(t),this.SI.setVisible(t),this.xI.setVisible(t),this.oI.setVisible(t),this}dispose(){return this.vI.dispose(),this.SI.dispose(),this.xI.dispose(),this.oI.dispose(),this.aI&&clearInterval(this.aI),this}zs(){switch(this.NI(),this.GI(),this.mI){case Wd.UpToDown:this.vI.Ee({x:this.t_.x,y:this.t_.y+this.t_.height-this.vI.oi().x/2}).it(u(this.t_.width,this.t_.width)).zs(),this.SI.Ee({x:this.t_.x,y:this.t_.y+10}).it(u(this.t_.width,this.t_.width)).zs(),this.xI.setSize({x:this.t_.width,y:this.t_.height-2*this.vI.oi().x}).setPosition({x:this.t_.x,y:this.t_.y+this.SI.oi().y+this.xI.getSize().y/2}),this.oI.setSize(u(this.t_.width,this.WI())),this.sI={x:this.t_.x,y:this.vI.Oa().y-this.vI.oi().y/2-this.oI.getSize().y/2},this.OI({min:{x:this.t_.x,y:this.vI.Oa().y-this.vI.oi().y/2-this.oI.getSize().y/2},max:{x:this.t_.x,y:this.SI.Oa().y+this.SI.oi().x/2+this.oI.getSize().y/2}});break;case Wd.LeftToRight:this.vI.Ee({x:this.t_.x,y:this.t_.y}).it(u(this.t_.height,this.t_.height)).zs(),this.SI.Ee({x:this.t_.x+this.t_.width-this.SI.oi().x,y:this.t_.y}).it(u(this.t_.height,this.t_.height)).zs(),this.xI.setSize({y:this.t_.height,x:this.t_.width-2*this.vI.oi().y}).setPosition({x:this.t_.x+this.vI.oi().x/2+this.xI.getSize().x/2,y:this.t_.y}),this.oI.setSize(u(this.WI(),this.t_.height)),this.sI={x:this.vI.Oa().x+this.vI.oi().x/2+this.oI.getSize().x/2,y:this.t_.y},this.OI({min:{x:this.vI.Oa().x+this.vI.oi().x/2+this.oI.getSize().x/2,y:this.t_.y},max:{x:this.SI.Oa().x-this.SI.oi().x/2-this.oI.getSize().x/2,y:this.t_.y}})}return this.UI(),this}NI(){switch(this.mI){case Wd.UpToDown:this.YI()||this.setVisible(!1),this.YI()&&this.setVisible(!0);break;case Wd.LeftToRight:this.HI()||this.setVisible(!1),this.HI()&&this.setVisible(!0)}}GI(){switch(this.mI){case Wd.UpToDown:this.YI()||this.pI({x:0,y:0});break;case Wd.LeftToRight:this.HI()||this.pI({x:0,y:0})}}YI(){return this.od.x>this.t_.height}HI(){return this.od.y>this.t_.width}WI(){switch(this.mI){case Wd.UpToDown:return this.t_.height*(this.t_.height-2*this.vI.oi().x)/this.od.x;case Wd.LeftToRight:return this.t_.width*(this.t_.width-2*this.vI.oi().y)/this.od.y;default:return 0}}UI(){switch(this.mI){case Wd.UpToDown:this.hI=(this.od.x-this.t_.height)/(this.KF.min.y-this.KF.max.y);break;case Wd.LeftToRight:this.hI=(this.od.y-this.t_.width)/(this.KF.max.x-this.KF.min.x)}}Re(){switch(this.vI.Re(),this.SI.Re(),this.xI.Re(),this.mI){case Wd.UpToDown:this.oI.setPosition({x:this.t_.x,y:this.vI.Oa().y-this.vI.oi().y/2-this.oI.getSize().y/2-this.eI.y}).Re();break;case Wd.LeftToRight:this.oI.setPosition({y:this.t_.y,x:this.vI.Oa().x+this.vI.oi().x/2+this.oI.getSize().x/2+this.eI.x}).Re()}return this}}class Qd{constructor(t,e,i,s,r,n,o){switch(this.IA=t,this.lp=e,this.scale=s,this.contentScale=r,o){case Kd.Vertical:this.$I=this.XI(i,n,Wd.UpToDown);break;case Kd.Horizontal:this.jI=this.XI(i,n,Wd.LeftToRight);break;case Kd.Both:this.$I=this.XI(i,n,Wd.UpToDown),this.jI=this.XI(i,n,Wd.LeftToRight)}this.ZI=Ji(new es(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.jI)||void 0===n?void 0:n.DI(s.x))&&Qt(r),0!==s.y&&(null===(o=this.$I)||void 0===o?void 0:o.II(s.y))&&Qt(r)})))}XI(t,e,i){return new Zd(this.IA,this.lp,t,this.scale,this.contentScale,e,i)}_I(){return 20}CI(t){var e,i;return null===(e=this.$I)||void 0===e||e.CI(t),null===(i=this.jI)||void 0===i||i.CI(t),this}QI(t){var e;return null===(e=this.jI)||void 0===e||e.TI(t),this}JI(t){var e;return null===(e=this.$I)||void 0===e||e.TI(t),this}KI(t){const e=this.$I;return e&&e.bI(t),this}qI(t){return this.ZI.onTouchStart(this,t),this}tP(t){return this.ZI.onTouchMove(this,t),this}iP(t){return this.ZI.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.jI)||void 0===e||e.BI(t),null===(i=this.$I)||void 0===i||i.BI(t),this}dispose(){var t,e;return null===(t=this.$I)||void 0===t||t.dispose(),null===(e=this.jI)||void 0===e||e.dispose(),this}Re(){var t,e;return null===(t=this.$I)||void 0===t||t.Re(),null===(e=this.jI)||void 0===e||e.Re(),this}zs(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.$I)||void 0===t||t.MI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.jI)||void 0===e||e.MI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.$I)||void 0===i||i.zs(),null===(s=this.jI)||void 0===s||s.zs(),this}}class qd extends oa{constructor(t,e,i,s,r,n){super(t,e,i,e.kp("dataGrid bg",0),s,e.cs.ts.dataGridBackgroundFillStyle,e.cs.ts.dataGridBackgroundStrokeStyle,e.cs.ts.dataGridTitleFont,e.cs.ts.dataGridTitleFillStyle,n),this.sP=[],this.eP=[],this.hP=[],this.rP=new Map,this.nP=!0,this.oP=!0,this.aP=!0,this.lP=!0,this.uP=!0,this.cP=!0,this.dP=!0,this.fP=!0,this.AP=!0,this.gP=!0,this.pP=!0,this.yP=!0,this.mP=!0,this.vP=!0,this.SP=!0,this.xP=!0,this.bP=new Set,this.MP=new Set,this._P=!0,this.wP=!0,this.CP=(t,e)=>{t.borders=void 0===e?rf:{...t.borders,...e},this.kP(t),this.yP=!0,this.cs.Ms()},this.kP=t=>{t.borders&&(!1===t.borders.top&&this.TP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.FP,bottom:!1}})),!1===t.borders.bottom&&this.TP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.FP,top:!1}})),!1===t.borders.left&&this.TP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.FP,right:!1}})),!1===t.borders.right&&this.TP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.FP,left:!1}})),!0===t.borders.top&&this.TP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.FP,bottom:!0}})),!0===t.borders.bottom&&this.TP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.FP,top:!0}})),!0===t.borders.left&&this.TP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.FP,right:!0}})),!0===t.borders.right&&this.TP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.FP,left:!0}})))},this.IP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseEnter,i,e)},this.PP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseLeave,i,e)},this.DP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseClick,i,e)},this.BP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseDoubleClick,i,e)},this.LP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseDown,i,e)},this.RP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseUp,i,e)},this.EP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseMove,i,e)},this.zP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseDrag,i,e)},this.VP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseDragStart,i,e)},this.OP=(t,e)=>{const i=this.rP.get(t);i&&this.R.emit(Jd.cellMouseDragStop,i,e)},this.NP=(t,e)=>{const i=this.rP.get(t);i&&(this.R.emit(Jd.cellMouseWheel,i,e),!e.defaultPrevented&&this._P&&this.GP.KI(e))},this.WP=(t,e)=>{const i=this.rP.get(t);i&&(this.R.emit(Jd.cellTouchStart,i,e),!e.defaultPrevented&&this.wP&&this.GP.qI(e))},this.UP=(t,e)=>{const i=this.rP.get(t);i&&(this.R.emit(Jd.cellTouchMove,i,e),!e.defaultPrevented&&this.wP&&this.GP.tP(e))},this.YP=(t,e)=>{const i=this.rP.get(t);i&&(this.R.emit(Jd.cellTouchEnd,i,e),!e.defaultPrevented&&this.wP&&this.GP.iP(e))},this.cs.Zn(fh.uf),this.bh.yr("Data Grid"),this.HP=i.d2({scaleXYConstructor:zi}),this.HP.x.ug=Id,this.$P=i.d2({scaleXYConstructor:zi}),this.XP={x:0,y:0},this.jP=this.ts.dataGridTextFont,this.ZP=this.ts.dataGridTextFillStyle,this.FP={top:!0,bottom:!0,left:!0,right:!0},this.QP=this.ts.dataGridCellBackgroundFillStyle,this.JP=this.ts.dataGridBorderStrokeStyle,this.KP="left-center",this.qP={left:5,right:5,bottom:5,top:5},this.tD=e.wx("dataGrid grid bg",0),this.iD=e.wx("dataGrid cell bg",1),this.sD=e.Xy("dataGrid cell content",0),this.eD=e.Xy("dataGrid scrollbar bg",1),this.hD=e.Xy("dataGrid scrollbar fg",2),this.GP=this.rD(),this.onBackgroundMouseWheel(((t,e)=>{this._P&&this.GP.KI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.wP&&this.GP.qI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.wP&&this.GP.tP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.wP&&this.GP.iP(e)})),this.nD=this.tD.Le(this.HP).Be(this.ts.dataGridBackgroundFillStyle).De(nt).setMouseInteractions(!1),this.oD=this.sD.Yg(this.HP).setMouseInteractions(!1),this.aD=new Za((()=>this.iD.Le(this.HP).setMouseInteractions(!0).setMouseEnterEventHandler(this.IP).setMouseLeaveEventHandler(this.PP).setMouseClickEventHandler(this.DP).setMouseDoubleClickEventHandler(this.BP).setMouseDownEventHandler(this.LP).setMouseUpEventHandler(this.RP).setMouseMoveEventHandler(this.EP).setMouseDragEventHandler(this.zP).setMouseDragStartEventHandler(this.VP).setMouseDragStopEventHandler(this.OP).setMouseWheelEventHandler(this.NP).setTouchStartEventHandler(this.WP).setTouchMoveEventHandler(this.UP).setTouchEndEventHandler(this.YP))),this.lD=new Za((()=>this.sD.Le(this.HP).setMouseInteractions(!1))),this.uD=new Za((()=>this.sD.Gr(this.HP).setMouseInteractions(!1))),this.cD=new Za((()=>this.sD.om(this.HP,{},[Ua.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.dD=new Za((()=>this.sD.Ue(this.HP).setMouseInteractions(!1))),this.fD=new Za((()=>this.sD.Bv(this.HP).setMouseInteractions(!1))),this.AD=new Za((()=>this.sD.Le(this.HP).setMouseInteractions(!1))),this.gD=new Za((()=>this.sD.E_(this.HP).setMouseInteractions(!1))),this.pD=new Za((()=>this.sD.nd(this.HP).setMouseInteractions(!1))),this.Cp(r,this.uiScale),this.onResize((()=>{this.nP=!0,this.cs.Ms(),this.HP.it(this.mg.oi()),this.$P.it(this.mg.oi())})),this.yD=this.hs.kg([this.nD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}ef(){return[]}dispose(){return super.dispose(),this.tD.Y(),this.iD.Y(),this.sD.Y(),this.eD.Y(),this.hD.Y(),sa(this.HP),sa(this.$P),this.GP.dispose(),this.uD.km(),this.aD.km(),this.lD.km(),this.cD.km(),this.dD.km(),this.fD.km(),this.AD.km(),this.gD.km(),this.pD.km(),this}J(){return super.J(),this.HP.J(),this.$P.J(),this}K(){return super.K(),this.HP.K(),this.$P.K(),this}setBackgroundEffect(t){return this.yD.bs(t),this.cs.Ms(),this}getBackgroundEffect(){return this.yD._s()}setInteractionScrollOnWheel(t){return this._P=t,this}getInteractionScrollOnWheel(){return this._P}setInteractionPanOnTouch(t){return this.wP=t,this}getInteractionPanOnTouch(){return this.wP}onCellMouseEnter(t){return this.R.on(Jd.cellMouseEnter,t)}offCellMouseEnter(t){return this.R.off(t)}onCellMouseLeave(t){return this.R.on(Jd.cellMouseLeave,t)}offCellMouseLeave(t){return this.R.off(t)}onCellMouseClick(t){return this.R.on(Jd.cellMouseClick,t)}offCellMouseClick(t){return this.R.off(t)}onCellMouseDoubleClick(t){return this.R.on(Jd.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.R.off(t)}onCellMouseDown(t){return this.R.on(Jd.cellMouseDown,t)}offCellMouseDown(t){return this.R.off(t)}onCellMouseUp(t){return this.R.on(Jd.cellMouseUp,t)}offCellMouseUp(t){return this.R.off(t)}onCellMouseMove(t){return this.R.on(Jd.cellMouseMove,t)}offCellMouseMove(t){return this.R.off(t)}onCellMouseDrag(t){return this.R.on(Jd.cellMouseDrag,t)}offCellMouseDrag(t){return this.R.off(t)}onCellMouseDragStart(t){return this.R.on(Jd.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.R.off(t)}onCellMouseDragStop(t){return this.R.on(Jd.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.R.off(t)}onCellMouseWheel(t){return this.R.on(Jd.cellMouseWheel,t)}offCellMouseWheel(t){return this.R.off(t)}onCellTouchStart(t){return this.R.on(Jd.cellTouchStart,t)}offCellTouchStart(t){return this.R.off(t)}onCellTouchMove(t){return this.R.on(Jd.cellTouchMove,t)}offCellTouchMove(t){return this.R.off(t)}onCellTouchEnd(t){return this.R.on(Jd.cellTouchEnd,t)}offCellTouchEnd(t){return this.R.off(t)}setGridBackgroundFillStyle(t){return this.nD.Be(t),this.cs.Ms(),this}getGridBackgroundFillStyle(){return this.nD.Xh()}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.eP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.eP.splice(this.eP.indexOf(i),1):(i.min=e,i.max=e),this.cP=!0,this.cs.Ms(),this}setRowHeight(t,e){let i=this.hP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.hP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.hP.splice(this.hP.indexOf(i),1):(i.min=e,i.max=e),this.cP=!0,this.cs.Ms(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.vD(t,(t=>this.SD(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.xD(t,(t=>this.SD(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.TP(t,e,(t=>this.SD(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.qP={...this.qP,...t},this.bD((t=>this.SD(t,this.qP))),this}setCellBorders(t,e,i){return this.TP(t,e,(t=>this.CP(t,i))),this}setRowBorders(t,e){return this.xD(t,(t=>this.CP(t,e))),this}setColumnBorders(t,e){return this.vD(t,(t=>this.CP(t,e))),this}setCellsBorders(t){return this.FP=void 0===t?rf:t,this.bD((t=>this.CP(t,this.FP))),this}setCellsBorderStrokeStyle(t){return this.JP="function"==typeof t?t(this.JP):t,this.vP=!0,this.cs.Ms(),this}setColumnTextFillStyle(t,e){return this.vD(t,(t=>this.MD(t,e))),this}setRowTextFillStyle(t,e){return this.xD(t,(t=>this.MD(t,e))),this}setCellTextFillStyle(t,e,i){return this.TP(t,e,(t=>this.MD(t,i))),this}setCellsTextFillStyle(t){return this.ZP="function"==typeof t?t(this.ZP):t,this.bD((t=>this.MD(t,this.ZP))),this}setColumnTextFont(t,e){return this.vD(t,(t=>this._D(t,e))),this}setRowTextFont(t,e){return this.xD(t,(t=>this._D(t,e))),this}setCellTextFont(t,e,i){return this.TP(t,e,(t=>this._D(t,i))),this}setCellsTextFont(t){return this.jP="function"==typeof t?t(this.jP):t,this.bD((t=>this._D(t,this.jP))),this}setColumnContentAlignment(t,e){return this.vD(t,(t=>this.wD(t,e))),this}setRowContentAlignment(t,e){return this.xD(t,(t=>this.wD(t,e))),this}setCellContentAlignment(t,e,i){return this.TP(t,e,(t=>this.wD(t,i))),this}setCellsContentAlignment(t){return this.KP=t,this.bD((t=>this.wD(t,this.KP))),this}setCellBackgroundFillStyle(t,e,i){return this.TP(t,e,(t=>this.CD(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.vD(t,(t=>this.CD(t,e))),this}setRowBackgroundFillStyle(t,e){return this.xD(t,(t=>this.CD(t,e))),this}setCellsBackgroundFillStyle(t){return this.QP="function"==typeof t?t(this.QP):t,this.bD((t=>this.CD(t,this.QP))),this}setCellHighlight(t,e,i){return this.TP(t,e,(t=>{t.highlight=be(i)})),this.mP=!0,this.cs.Ms(),this}setColumnHighlight(t,e){const i=be(e);return this.vD(t,(t=>{t.highlight=i})),this.mP=!0,this.cs.Ms(),this}setRowHighlight(t,e){const i=be(e);return this.xD(t,(t=>{t.highlight=i})),this.mP=!0,this.cs.Ms(),this}removeCell(t,e){return this.TP(t,e,(t=>this.sP.splice(this.sP.indexOf(t),1))),this.uP=!0,this.cs.Ms(),this}removeRow(t){return this.xD(t,(t=>this.sP.splice(this.sP.indexOf(t),1))),this.sP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.uP=!0,this.cs.Ms(),this}removeColumn(t){return this.vD(t,(t=>this.sP.splice(this.sP.indexOf(t),1))),this.sP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.uP=!0,this.cs.Ms(),this}removeCells(){return this.sP.splice(0),this.uP=!0,this.cs.Ms(),this}getColumnMax(){return 0===this.sP.length?0:this.sP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.sP.length?0:this.sP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Re(t){super.Re(t),ha.Rp(this.bh,this.Tp),super.wp();const e=Math.round(this.JP.N()),i=e/2;let s=this.oP||this.aP||this.lP||this.uP||this.cP||this.dP||this.pP||this.yP||this.vP||this.xP;if(s){this.sP.forEach((t=>{this.MP.add(t.column)})),this.sP.forEach((t=>{this.bP.add(t.row)}));const t=this.uD.wm(),r=this.kD(i,t);t.finishPlot();const n=this.TD(this.MP.size,r),o=this.FD(this.bP.size,r),h=n.reduce(Ke,0)+e,a=o.reduce(Ke,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.ID.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.ID={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.aP||this.lP||this.uP||this.fP||this.AP||this.gP||this.yP||this.mP||this.vP||this.nP||this.xP;if((r||this.SP)&&this.ID){const t=this.mg.getInnerIntervalPixels(),s=ha.Lp(this.bh,this.Tp),n=[this.ka.left+i,this.ka.right+i],o=[this.ka.bottom+i,this.ka.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.ka.left,this.ka.right],l=[this.ka.bottom,this.ka.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.$P.Ei(n).zi(o).Vi(0,h.x).Oi(0,h.y),this.GP.CI({x:this.ID.dataGridHeight,y:this.ID.dataGridWidth}).zs().Re();const d={x:Math.round(this.XP.x),y:Math.round(Math.min(0,this.XP.y))};this.HP.Ei(a).zi(l).Vi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.nD.Ee({x:c.x,y:c.y});const f={x:this.HP.x.ei(),y:this.HP.y.ei()+this.GP._I(),width:this.HP.x.ri()+e-this.GP._I(),height:this.HP.y.ri()+e};this.sD.gx(f),this.iD.gx(f),this.tD.gx(f);const g=this.ID,y=[{x:this.HP.x.getInnerStart(),y:this.HP.y.getInnerStart()},{x:this.HP.x.getInnerEnd(),y:this.HP.y.getInnerStart()},{x:this.HP.x.getInnerEnd(),y:this.HP.y.getInnerEnd()},{x:this.HP.x.getInnerStart(),y:this.HP.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=Ge([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],y);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.PD(c,this.ID,e)}this.nP=!1,this.oP=!1,this.aP=!1,this.lP=!1,this.uP=!1,this.cP=!1,this.dP=!1,this.fP=!1,this.AP=!1,this.gP=!1,this.pP=!1,this.yP=!1,this.mP=!1,this.vP=!1,this.SP=!1,this.xP=!1}kD(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.sP){const{content:r}=t,n={...this.qP,...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.yr(i).Qh(t.textFont||this.jP).zs().ed()}if(Fd(r)&&(h=r,l={x:200,y:50}),co(r)){const t=this.cs.DD(r);t.BD()?(a=r,l=a.oi()):t.LD((()=>{this.xP=!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}PD(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.nD.it(c),this.oD.We(this.JP),this.rP.clear();const d={cellBackground:this.aD.wm(),cellIconRect:this.lD.wm(),lineSet:this.cD.wm(),line:this.dD.wm(),pointSet:this.fD.wm(),rect:this.AD.wm(),junction:this.gD.wm(),arc:this.pD.wm()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:y}=i,m={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+y.left,y:p.y+y.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-y.left-y.right,y:S.y-y.top-y.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=sf(x,b,r.contentAlignment||this.KP);n.Ee(t[0]).$a({x:t[1],y:t[2]}).Be(this.RD(r.textFillStyle||this.ZP,r.content,this.ZP)).ds(r.highlight)}const M=this.RD(r.backgroundFillStyle||this.QP,r.content);if(M!==z){const t=d.cellBackground.add();t.Ee(p).it(S).Be(M).De(nt).ds(r.highlight),this.rP.set(t,m)}const C=r.borders||this.FP;if(C&&ef(p,S,C,s,f),o){const t=x,e=b;Dd(o,d,this.HP,t,e,this.ts,this.SA,r.highlight)}if(c){const t=c.oi(),i=sf(x,b,r.contentAlignment||this.KP);d.cellIconRect.add().Ee({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).it(t).Be(new so({source:c.dc,fitMode:e.ImageFitMode.Stretch})).De(nt).ds(r.highlight)}}this.oD.Ot();for(const t of f)this.oD.Xr().$g(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()}TD(t,e){const i=new Array(t).fill(0);for(const t of this.MP.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.eP.find((e=>e.column===t)),n=r?Ft(s,void 0!==r.min?r.min:_e,void 0!==r.max?r.max:ze):s;i[t]=n}return i}FD(t,e){const i=new Array(t).fill(0);for(const t of this.bP.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.hP.find((e=>e.row===t)),n=r?Ft(s,void 0!==r.min?r.min:_e,void 0!==r.max?r.max:ze):s;i[t]=n}return i}RD(t,e,i){if(K(t)){try{const i=Number(e);return new U({color:t.getPalette().getColors(i)})}catch(t){}return i||z}return t}MD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.ZP):e,this.gP=!0,this.cs.Ms()}_D(t,e){t.textFont="function"==typeof e?e(t.textFont||this.jP):e,this.pP=!0,this.cs.Ms()}CD(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.QP):e,this.AP=!0,this.cs.Ms()}wD(t,e){t.contentAlignment=e,this.fP=!0,this.cs.Ms()}SD(t,e){t.padding={...t.padding,...e},this.dP=!0,this.cs.Ms()}mD(t,e,i){let s=this.TP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.sP.push(s),this.lP=!0),"string"==typeof s.content||"number"==typeof s.content?this.oP=!0:this.aP=!0,this.cs.Ms()}bD(t){this.sP.forEach((e=>t(e)))}TP(t,e,i){const s=this.sP.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}vD(t,e){const i=this.sP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}xD(t,e){const i=this.sP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}rD(){return new Qd(this.hD,this.eD,this.$P,this.$P,this.HP,this.ts,Kd.Both).onScroll(((t,e)=>{this.ID&&(t===Kd.Vertical&&(this.XP.y=-e),t===Kd.Horizontal&&(this.XP.x=e),this.SP=!0,this.cs.Ms())})).QI(50).JI(12)}}const Jd={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 tf;e.DataGridCellContentAlignmentOptions=void 0,(tf=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",tf.RightCenter="right-center",tf.LeftCenter="left-center",tf.RightTop="right-top",tf.LeftTop="left-top",tf.RightBottom="right-bottom",tf.LeftBottom="left-bottom",tf.CenterTop="center-top",tf.CenterBottom="center-bottom";const ef=(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])},sf=(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 Ce(0,`Unidentified DataGrid cell content alignment option: ${i}`)},rf={top:!1,bottom:!1,left:!1,right:!1};class nf extends hr{constructor(t,e,i,s,r,n){super(t,{Ir(){},Fr(){},Dr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.hs=n,this.Bs=r,this.wh=r.Gr(t.ED).Qh(this.ts.barChartCategoryAxisTitleFont||this.ts.xAxisTitleFont).Be(this.ts.barChartCategoryAxisTitleFillStyle||this.ts.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Ls.getWidth({x:0,y:-90})),this.qh=this.hs.kg([this.wh]).bs(e.effectsText),this.zD=r.Ue(t.ED).We(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Dg=t,this.Bg=t):"object"==typeof t&&(this.Dg=t.min,this.Bg=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Dg,max:this.Bg}}setStrokeStyle(t){return this.zD.We(t),this.chart.cs.Ms(),this}getStrokeStyle(){return this.zD.mu()}zs(){if(!this.Zi)return{zg:0,Vg:0,$d:Ft(0,void 0!==this.Dg?this.Dg:0,void 0!==this.Bg?this.Bg:ze)};const t=this.zD.mu().N()/2,e=this.chart.Ls.getHeight(this.wh.zs().ed());return{zg:t,Vg:e,$d:t+e}}Re(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.zD.He(this.chart.Ls.toPoint(r.start,n.start)).Ye(this.chart.Ls.toPoint(r.end,n.start)).setVisible(this.Zi),this.wh.Ee(this.chart.Ls.toPoint(.5*(r.start+r.end),this.chart.valueAxis.At.pi(n.start,-(t.zg+s.labelMarginBeforeCategoryAxisPixels)))).$a(this.chart.Ls.toPoint(0,1)).setVisible(this.Zi)}setMouseInteractions(t){return this}Sr(t,e){return new ar(e,t,this.Bs,this.chart.ED)}br(t,e){return{}}Lr(t,e){return e}Er(t,e,i){return{min:t,max:e}}}class of extends hr{constructor(t,e,i,s,r,n,o){super(t,{Ir:()=>{var e;if(t.VD){if("positive"===t.OD||"bipolar"===t.OD){if("after-bar"===(null===(e=t.ND)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.VD.max,Math.min(this.chart.Ls.getHeight(this.chart.GD())+t.ND.labelMargin,.3*e))}return t.VD.max}return t.WD?Ft(-1,-1e-6,t.VD.max):0}},Fr:()=>{var e;if(t.VD){if("negative"===t.OD||"bipolar"===t.OD){if("after-bar"===(null===(e=t.ND)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.VD.min,-Math.min(this.chart.Ls.getHeight(this.chart.GD())+t.ND.labelMargin,.3*e))}return t.VD.min}return t.WD?Ft(1,1e-6,t.VD.min):0}},Dr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.hs=n,this.Bs=r,this.wh=r.Gr(t.ED).Qh(this.ts.barChartValueAxisTitleFont||this.ts.yAxisTitleFont).Be(this.ts.barChartValueAxisTitleFillStyle||this.ts.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Ls.getHeight({x:0,y:-90})),this.qh=this.hs.kg([this.wh]).bs(e.effectsText),this.zD=r.Ue(t.ED).We(e.barChartValueAxisStrokeStyle||this.ts.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Dg=t,this.Bg=t):"object"==typeof t&&(this.Dg=t.min,this.Bg=t.max),this.chart.cs.Ms(),this}getThickness(){return{min:this.Dg,max:this.Bg}}setStrokeStyle(t){return this.zD.We(t),this.chart.cs.Ms(),this}getStrokeStyle(){return this.zD.mu()}setTickStrategy(t,e){return super.Gh(t,e)}zs(t){if(!this.Zi)return this.tr(),{zg:0,Vg:0,$d:Ft(0,void 0!==this.Dg?this.Dg:0,void 0!==this.Bg?this.Bg:ze)};const e=this.chart.Ls.getWidth(this.chart.ED).ri(),i=this.At.ri();this.ar({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.rh.values())for(const e of t.values()){const t=e.Dh.vr,i=this.chart.Ls.getWidth(e.ih.ed()),r=t.getTickLength()+t.getTickPadding()+i;s=Math.max(s,r)}const r=s+this.zD.mu().N()/2,n=this.chart.Ls.getWidth(this.wh.zs().ed());return{zg:r,Vg:n,$d:Ft(r+n,void 0!==this.Dg?this.Dg:0,void 0!==this.Bg?this.Bg:ze)}}Re(t){const e=this.getInterval();this.zD.He(this.chart.Ls.toPoint(-.5,this.Wh)).Ye(this.chart.Ls.toPoint(-.5,this.Uh)).setVisible(this.Zi);const i="logarithmic"===this.Oh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Ls.toPoint(this.chart.categoryAxis.At.pi(-.5,t.zg*this.chart.Ls.UD),i),r=this.chart.Ls.toPoint(this.chart.Ls.YD,0);this.wh.Ee(s).$a(r).setVisible(this.Zi)}setMouseInteractions(t){return this}Sr(t,e){return new ar(e,t,this.Bs,this.chart.ED)}br(t,e){const i=t.Dh.vr,s=this.chart.Ls.toPoint(-.5,t.M),r=this.chart.ED.pi(s,this.chart.Ls.toPoint(i.getTickLength()*this.chart.Ls.UD,0)),n=this.chart.ED.pi(s,this.chart.Ls.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Ls.UD,0)),o=this.chart.ED.pi(r,this.chart.Ls.toPoint(i.getTickPadding()*this.chart.Ls.UD,0));t.ih.Ee(o).$a(this.chart.Ls.toPoint(this.chart.Ls.YD,i.getLabelAlignment())).Jh(i.getLabelRotation()),i.tickStyle!==nt&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==nt&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}Lr(t,e){return"linear"===this.Oh.type?Xi(t,e,this.At):ji(t,e,this.At)}Er(t,e,i){return{min:t,max:e}}}class hf extends $l{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Zo=Fe(),this.M=0,this.HD=!1,this.chart=t,this.chart=t,this.category=r,this.subCategory=n,this.Cs=r,this.Te=ye(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Fe=ye(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.chart.$D()})),this.onDispose((()=>{this.chart.$D(),this.chart.XD.delete(this.category),this.chart.jD.delete(this)}))}Ki(t,e){const i=this.chart.cs.No(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.HD=!0,this.M=t,this.chart.$D(),this.chart.cs.Ms(),this.chart.XD.delete(this.category),this.chart.jD.delete(this),this}getValue(){return this.M}get value(){return this.M}setFillStyle(t){return this.Te="function"==typeof t?t(this.Te):t,this.chart.$D(),this}getFillStyle(){return this.Te}setStrokeStyle(t){return this.Fe="function"==typeof t?t(this.Fe):t,this.chart.$D(),this}getStrokeStyle(){return this.Fe}ov(){return this.uv}setEffect(t){return this.chart.setBarsEffect(t),this}styleLegendEntry(t,e=!1){ce(t,this.ts,e,{fill:this.Te})}}const af=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),lf=(t,e,i)=>{const s=t.Rd.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 uf extends dl{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.kp("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.ZD=cf.Descending,this.QD=this.ts.barChartCategoryLabels,this.ND=this.ts.barChartValueLabelsAfterBars,this.JD=!1,this.jM=Ee(),this.XD=new Map,this.jD=new Map,this.OD="positive",this.KD="columns",this.qD=!0,this.tB=new Map,this.iB={speed:1},this.ky={speed:1},this.sB=.08,this.eB=[],this.wn=(t,e,i,s,r)=>{this.ED.it(s,r)},this.cs.Zn(fh.gf),this.Ls="horizontal"===(null==o?void 0:o.type)?ff:df,this.bh.yr("Bar Chart"),this.hB=e.Xy("barChart plotting 1",0),this.rB=e.Xy("barChart plotting 2",1),this.WD="logarithmic"===(null===(h=null==o?void 0:o.valueAxis)||void 0===h?void 0:h.type),this.WD?"horizontal"===this.Ls.nB?(a=i.d1({scale1DConstructor:Pi,dimension:"y"}),this.ED=(new _i).Ri(i.d1({scale1DConstructor:Ti,dimension:"x"}),a)):(a=i.d1({scale1DConstructor:Pi,dimension:"x"}),this.ED=(new _i).Ri(a,i.d1({scale1DConstructor:Ti,dimension:"y"}))):(this.ED=i.d2({scaleXYConstructor:zi}),a=this.Ls.getWidth(this.ED)),this.oB=this.hs.kg(),this.JM=new $a((()=>this.jM.Mt(this.hB.Hm(this.ED).oa(0))),((t,e,i)=>(t.Be(i.fillStyle).De(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Xr();return i.Cl(e.vertices),this.jM.Vt(i,e.bar),e.bar.ys([i]),i})))),(()=>{this.jM.Ot()}),(t=>{this.oB.gs(t)})),this.Ov=this.lp.Le(this.ED).Be(this.ts.barChartSeriesBackgroundFillStyle||z).De(nt),this.Nv=this.lp.Le(this.ED).Be(z).De(this.ts.barChartSeriesBackgroundStrokeStyle||nt).setMouseInteractions(!1),super.Vv(this.Ov,this.Nv),this.categoryAxis=new nf(this,this.ts,!1!==(null==o?void 0:o.animationsEnabled),a,this.rB,this.hs);const l=Ki(null==o?void 0:o.valueAxis);this.valueAxis=new of(this,this.ts,!1!==(null==o?void 0:o.animationsEnabled),this.Ls.getHeight(this.ED),this.rB,this.hs,l.type),this.aB=new Za((()=>this.rB.Gr(this.ED).Nr(Ie).Or(Ie).oa(1))),this.lB=new $a((()=>this.lp.Yg(this.ED).setMouseInteractions(!1)),((t,e,i)=>(t.We(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Xr()).$g(e[0],e[1]))))));const u=e.Zy(),c=Bt(o?o.cursorBuilder:void 0,Ca);this.Qy=ua(this,u,c.yy(u,this.uiScale,this.uiScale,Et,this.ts),this,"show-pointed",gf,(()=>0)),this.onResize(this.wn),this.Cp(r,this.ED),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.Lv}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Ca){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(i),i}setBarsMargin(t){return this.sB=Ft(t,0,.49),this.JD=!0,this.cs.Ms(),this}getBarsMargin(){return this.sB}setBarsEffect(t){return this.oB.bs(t),this.cs.Ms(),this}getBarsEffect(){return this.oB._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.uB("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.uB("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.uB("groups",i),this}uB(t,e){this.Lv.length>0&&this.cs.Zn(fh.Tf),this.KD=t,this.eB=e.map((t=>t.category)),this.cB(e);const i=Se(e.map((t=>t.category))),s=i.length,r=Se(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.Lv.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 hf(this,this.Ev,this.ts,this.cs.hs,t.category,t.subCategory,Bt(n,s)),this.Gv(e),this.tB.set(e,{category:s,valueStart:this.WD?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.Lv.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.tB.delete(t))})),this.categoryAxis.setInterval(this.Ls.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.VD=0===this.Lv.length?void 0:"stacks"!==t?this.Lv.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:ze,max:_e}):{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.VD&&(this.OD=this.VD.min>=0?"positive":this.VD.max<=0?"negative":"bipolar",("bipolar"===this.OD||"negative"===this.OD)&&this.WD))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.cB(this.Lv),this.XD.clear(),this.jD.clear(),this.JD=!0,this.cs.Ms()}setCategoryLabels(t){const e="function"==typeof t?this.QD?t(this.QD):this.QD:t;return this.QD=e?{...this.ts.barChartCategoryLabels,...e}:void 0,this.XD.clear(),this.cs.Ms(),this}getCategoryLabels(){return this.QD}setValueLabels(t){var e;const i="function"==typeof t?this.ND?t(this.ND):this.ND:t,s=(null==i?void 0:i.position)||(null===(e=this.ND)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.ND={...this.ts.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.ND={...this.ts.barChartValueLabelsInsideBars,...i}):this.ND=void 0,this.jD.clear(),this.cs.Ms(),this}getValueLabels(){return this.ND}setLabelFittingEnabled(t){return this.qD=t,this.cs.Ms(),this}getLabelFittingEnabled(){return this.qD}getBar(t,e){if(("groups"===this.KD||"stacks"===this.KD)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.Lv.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.Lv}setSorting(t){this.ZD=t;const e=this.Lv.slice();return this.Lv.length=0,this.Lv.push(...ve(this.eB.map((t=>e.find((e=>e.category===t)))))),this.cB(this.Lv),this.cs.Ms(),this}getSorting(){return this.ZD}setAnimationCategoryPosition(t,e=1){return this.iB=t?{speed:e}:void 0,this.cs.Ms(),this}setAnimationValues(t,e=1){return this.ky=t?{speed:e}:void 0,this.cs.Ms(),this}translateCoordinate(t,e,i){if(i&&Gi(t)&&Yi(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Ui(t))r=this.cs.No(t);else if(Gi(t)){const e=ct(t,this.mg,this.cs.At);r={engineX:e.x,engineY:e.y}}else{if(!af(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=ct(this.Ls.toPoint(t.iCategory,t.value),this.ED,this.cs.At);r={engineX:e.x,engineY:e.y}}}if(Oi(s))return this.cs.Go(r);if("barChart"===s){const t=ct({x:r.engineX,y:r.engineY},this.cs.At,this.ED);return{iCategory:this.Ls.getWidth(t),value:this.Ls.getHeight(t)}}if(Yi(s))return ct({x:r.engineX,y:r.engineY},this.cs.At,this.mg);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}ef(){if("columns"===this.KD)return this.Lv;const t=Se(ve(this.Lv.map((t=>t.subCategory))));return ve(t.map((t=>{const e=this.Lv.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 Me(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Re(t){var e,i;super.Re(t);const s=this.aB.wm(),r=this.lB.wm(),n=this.Lv.filter((t=>t.getVisible()&&t.HD)),o=Se(n.map((t=>t.category))),h=Se(ve(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.iB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.iB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.At,c=u instanceof Pi?(t,e)=>{var i;return Xi(t,e,u,(null===(i=this.ky)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return ji(t,e,u,(null===(i=this.ky)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.KD?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.WD?1e-6:0,valueEnd:t.value}}))):"groups"===this.KD?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.sB),r=this.sB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.WD?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.WD?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.tB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.iB&&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.ky&&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.tB.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.JD=!0)})),ha.Rp(this.bh,this.Tp);const f=n.length>0;this.categoryAxis.Br(),this.valueAxis.Br();const g=this.categoryAxis.setVisible(f).zs(),y=this.valueAxis.setVisible(f).zs(r),{labelMarginBeforeCategoryAxisPixels:m}=f?this.dB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Re(g,s,r,{labelMarginBeforeCategoryAxisPixels:m}),this.valueAxis.Re(y);const p=this.categoryAxis.getThickness(),A=Ft(g.$d+m,void 0!==p.min?p.min:0,void 0!==p.max?p.max:ze),x={x:Math.min(this.ED.x.getInnerStart(),this.ED.x.getInnerEnd()),y:Math.min(this.ED.y.getInnerStart(),this.ED.y.getInnerEnd())},S=Math.max(this.ED.x.getInnerStart(),this.ED.x.getInnerEnd()),v=Math.max(this.ED.y.getInnerStart(),this.ED.y.getInnerEnd()),b={x:S-x.x,y:v-x.y};this.Ov.Ee(x),this.Ov.it(b),this.Nv.Ee(x),this.Nv.it(b),super.wp(),this.Qy.Re(!1,this.Lv,void 0);const M=ha.Lp(this.bh,this.Tp);if(this.ED.zi([this.Xt.bottom+this.ka.bottom+("vertical"===this.Ls.nB?A:0),this.Xt.top+this.ka.top+M+("horizontal"===this.Ls.nB?y.$d:0)]),this.ED.Ei([this.Xt.left+this.ka.left+this.Ls.getHeight({x:A,y:y.$d}),this.Xt.right+this.ka.right]),this.hB.gx({x:this.ED.x.ei(),y:this.ED.y.ei(),width:this.ED.x.ri(),height:this.ED.y.ri()}),this.rp&&this.rp(),this.JD){const t=this.JM.wm(),e="groups"===this.KD?1/(h.length+2*(h.length+1)*this.sB):1-2*this.sB;n.forEach((i=>{const s=this.tB.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Ls.toPoint(r,s.valueStart),this.Ls.toPoint(r,s.valueEnd),this.Ls.toPoint(n,s.valueEnd),this.Ls.toPoint(n,s.valueStart)];t.add({Zo:i.Zo,vertices:o,bar:i},{fillStyle:i.Te,strokeStyle:i.Fe})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.JD=!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.rB.Y(),this.hB.Y(),this.Qy.Y(),super.dispose()}cB(t){const e=this.ZD;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)})))}dB(t,e,i,s){let r=0;const n=this.QD,o=this.ND,h=this.valueAxis.getInterval(),a=this.Ls.getWidth({x:this.ED.x.ri(),y:this.ED.y.ri()});if(n&&n.labelFillStyle!==z){const o=n.tickLength+n.labelMargin,l=this.Ls.toPoint(0,1),u={Rd: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.Ls.toPoint(a,this.valueAxis.At.pi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.fB(t,s)}:void 0})),Xu:n.labelFont,At:this.ED},c=u?this.qD?lf(u,a,this.Ls.getWidth):u.Rd:[];c.forEach((t=>{t&&i.add().yr(t.text).Ee(t.position).$a(t.alignment).Jh(t.rotation).Be(n.labelFillStyle).Qh(n.labelFont)})),n.tickStyle!==nt&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Ls.getWidth(t.position);s.add({positions:[this.Ls.toPoint(e,this.valueAxis.At.getInnerStart()),this.Ls.toPoint(e,this.valueAxis.At.pi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Ls.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==z){let t;"after-bar"===o.position?t={Rd:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.tB.get(t);return void 0!==s?{text:i,position:this.Ls.toPoint(s.category,this.valueAxis.At.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Ls.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.AB(t)}:void 0})),Xu:o.labelFont,At:this.ED}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Rd:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.tB.get(t);if(void 0===s)return;const r="bipolar"===this.OD?Math.sign(s.valueEnd):"negative"===this.OD?-1:1,n=this.Ls.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.Ls.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.AB(t)}})),Xu:o.labelFont,At:this.ED}),t&&(t?this.qD?lf(t,a,this.Ls.getWidth):t.Rd:[]).forEach((t=>{t&&i.add().yr(t.text).Ee(t.position).$a(t.alignment).Jh(t.rotation).Be(o.labelFillStyle).Qh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}fB(t,e){if(!this.QD||this.QD.labelFillStyle===z)return{x:0,y:0};const i=this.XD.get(t);if(i)return i;const s=this.QD.formatter(t,e),r=this.cs.Ng.Og(s,this.QD.labelFont,this.QD.labelRotation);return r.isEstimate?this.cs.Ms(!0):this.XD.set(t,r),r}AB(t){if(!this.ND||this.ND.labelFillStyle===z)return{x:0,y:0};const e=this.jD.get(t);if(e)return e;const i=this.cs.Ng.Og(this.ND.formatter(t,t.category,t.value),this.ND.labelFont,this.ND.labelRotation);return i.isEstimate?this.cs.Ms(!0):this.jD.set(t,i),i}GD(){return this.Lv.reduce(((t,e)=>{const i=this.AB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}$D(){this.JD=!0,this.cs.Ms()}getMinimumSize(){return{x:200,y:200}}}const cf={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)},df={...ph,nB:"vertical",UD:-1,YD:1},ff={...Ah,nB:"horizontal",UD:1,YD:-1},gf=(t,e,i)=>{const s=[[e.bar]],r=t.valueAxis.getTitle();return r&&s.push([r]),e.subCategory?s.push([e.subCategory,"",{text:Wi(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}]):s.push({text:Wi(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}),s};class yf extends oa{constructor(t,e,i,s,r,n,o){super(t,e,i,e.kp("gaugeChart bg",0),s,e.cs.ts.gaugeChartBackgroundFillStyle,e.cs.ts.gaugeChartBackgroundStrokeStyle,e.cs.ts.gaugeChartTitleFont,e.cs.ts.gaugeChartTitleFillStyle,n),this.iu=this.ts.gaugeChartStartAngle,this.su=this.ts.gaugeChartEndAngle,this.gB={start:0,end:100},this.M=0,this.pB=[],this.yB=this.ts.gaugeChartBarThickness,this.mB=this.ts.gaugeChartValueIndicatorThickness,this.vB=this.ts.gaugeChartNeedleLength,this.SB=this.ts.gaugeChartNeedleThickness,this.xB=this.ts.gaugeChartNeedleFillStyle,this.bB=this.ts.gaugeChartNeedleStrokeStyle,this.MB=this.ts.gaugeChartRoundedEdges,this._B=!0,this.wB=!0,this.CB=!0,this.kB=[],this.TB=[],this.FB=!0,this.IB=!0,this.xy=this.M,this.PB=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.DB=this.ts.gaugeChartBarGradient,this.BB=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.LB=this.ts.gaugeChartTickFont,this.RB=this.ts.gaugeChartValueLabelFont,this.EB=this.ts.gaugeChartValueLabelFillStyle,this.zB=this.ts.gaugeChartUnitLabelFont,this.VB=this.ts.gaugeChartUnitLabelFillStyle,this.OB=this.ts.gaugeChartTickFillStyle,this.NB=this.ts.gaugeChartBarColor,this.GB=this.ts.gaugeChartGlowColor,this.WB=this.ts.gaugeChartGlowColor.getA(),this.UB=1,this.YB=1,this.HB=this.ts.gaugeChartNeedleAlignment,this.$B=!1,this.XB=this.ts.gaugeChartGapBetweenBarAndValueIndicators,this.jB=this.ts.gaugeChartBarStrokeStyle,this.ZB=!1,this.cs.Zn(fh.yf),this.bh.yr("Gauge Chart"),this.Cp(r,this.mg),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.QB=this.NB,this.JB=this.GB,this.KB=C(0,0,0,0),this.qB=this.hs.kg(),this.tL=this.hs.kg().bs(this.ts.effectsText),this.iL=this.lp.lc(this.mg).De(this.jB).setMouseInteractions(!1),this.sL=this.lp.nd(this.mg).cu(0).Ye(360).gu(0).De(nt).setMouseInteractions(!1),this.eL=this.Fp.Ue(this.mg).We(this.ts.gaugeChartNeedleStrokeStyle).setMouseInteractions(!1),this.hL=this.Fp.Ue(this.mg).We(new rs({thickness:this.SB,fillStyle:this.xB})).setMouseInteractions(!1),this.rL=this.Fp.Gr(this.mg).Qh(this.RB).Be(this.EB).setMouseInteractions(!1),this.Yd=this.Fp.Gr(this.mg).Qh(this.zB).Be(this.VB).yr("").setMouseInteractions(!1),this.nL=this.lp.Gr(this.mg).Qh(this.LB).Be(this.OB).setMouseInteractions(!1),this.oL=this.lp.Gr(this.mg).Qh(this.LB).Be(this.OB).setMouseInteractions(!1),this.qB.gs([this.iL]),this.tL.gs([this.rL,this.Yd,this.nL,this.oL]),this.aL(),this.onResize((()=>{this.$B=!0}))}aL(){this.hL.We((t=>t.setThickness(this.SB))),this.eL.We((t=>t.setThickness(2*this.bB.getThickness()+this.SB)))}setAnimationsEnabled(t){return this.dh=t,this.IB=t,this.FB=t,this}setInterval(t,e){return this.gB={start:t,end:e},this.$B=!0,this.cs.Ms(),this}getInterval(){return this.gB}setTickFillStyle(t){return this.OB="function"==typeof t?t(this.OB):t,this.TB.forEach((e=>{e.start.Be(t),e.end.Be(t)})),this.nL.Be(t),this.oL.Be(t),this.$B=!0,this.cs.Ms(),this}getTickFillStyle(){return this.OB}setTickFont(t){return this.LB="function"==typeof t?t(this.LB):t,this.TB.forEach((e=>{e.start.Qh(t),e.end.Qh(t)})),this.nL.Qh(t),this.oL.Qh(t),this.$B=!0,this.cs.Ms(),this}getTickFont(){return this.LB}setTickFormatter(t){return this.PB=t,this.$B=!0,this.cs.Ms(),this}getTickFormatter(){return this.PB}setValueLabelFillStyle(t){return this.EB="function"==typeof t?t(this.EB):t,this.rL.Be(t),this.$B=!0,this.cs.Ms(),this}getValueLabelFillStyle(){return this.rL.Xh()}setValueLabelFont(t){return this.RB="function"==typeof t?t(this.RB):t,this.rL.Qh(t),this.$B=!0,this.cs.Ms(),this}getValueLabelFont(){return this.rL.Zh()}setValueFormatter(t){return this.BB="string"==typeof t?e=>t:t,this.$B=!0,this.cs.Ms(),this}getValueLabel(){return this.rL.Cr()||this.BB}setUnitLabelFillStyle(t){return this.VB="function"==typeof t?t(this.VB):t,this.Yd.Be(t),this.$B=!0,this.cs.Ms(),this}getUnitLabelFillStyle(){return this.Yd.Xh()}setUnitLabelFont(t){return this.zB="function"==typeof t?t(this.zB):t,this.Yd.Qh(t),this.$B=!0,this.cs.Ms(),this}getUnitLabelFont(){return this.Yd.Zh()}setUnitLabel(t){return this.Yd.yr(t),this.$B=!0,this.cs.Ms(),this}getUnitLabel(){return this.Yd.Cr()}setNeedleFillStyle(t){return this.xB="function"==typeof t?t(this.xB):t,this.hL.We((e=>e.setFillStyle(t))),this.$B=!0,this.cs.Ms(),this}getNeedleFillStyle(){return this.hL.mu().getFillStyle()}setNeedleThickness(t){return this.SB=t,this.aL(),this.$B=!0,this.cs.Ms(),this}getNeedleThickness(){return this.SB}setNeedleStrokeStyle(t){return this.bB="function"==typeof t?t(this.bB):t,this.eL.We(t),this.aL(),this.$B=!0,this.cs.Ms(),this}getNeedleStrokeStyle(){return this.eL.mu()}setNeedleLength(t){return this.vB=t,this.$B=!0,this.cs.Ms(),this}getNeedleLength(){return this.vB}setBarColor(t){return this.NB=t,this.$B=!0,this.cs.Ms(),this}getBarColor(){return this.QB}setBarGradient(t){return this.DB=t,this.$B=!0,this.cs.Ms(),this}getBarGradient(){return this.DB}setBarStrokeStyle(t){return this.jB="function"==typeof t?t(this.jB):t,this.iL.De(t),this.$B=!0,this.cs.Ms(),this}getBarStrokeStyle(){return this.iL.mo()}setBarThickness(t){return this.yB=t,this.$B=!0,this.cs.Ms(),this}getBarThickness(){return this.yB}setAngleInterval(t,e){return Math.abs(t-e)>360&&(e=t{t.dispose()})),this.kB.length=0,this.TB.forEach((t=>{t.start.dispose(),t.end.dispose()})),this.TB.length=0,this.pB.forEach((t=>{const e=this.lp.lc(this.mg).De(nt).Be(new U({color:t.color})).setMouseInteractions(!1);this.kB.push(e);const i=this.lp.Gr(this.mg).Qh(this.LB).Be(this.OB).setMouseInteractions(!1),s=this.lp.Gr(this.mg).Qh(this.LB).Be(this.OB).setMouseInteractions(!1);this.TB.push({start:i,end:s})})),this.qB.gs([this.iL,...this.kB]),this.tL.gs([this.rL,this.Yd,this.nL,this.oL,...this.TB.map((t=>[t.start,t.end])).flat()]),this.$B=!0,this.cs.Ms(),this}getValueIndicators(){return this.pB}setValueIndicatorThickness(t){return this.mB=t,this.$B=!0,this.cs.Ms(),this}getValueIndicatorThickness(){return this.mB}setAutomaticBarColoring(t){return this.CB=!!t,this.$B=!0,this.cs.Ms(),this}getAutomaticBarColoring(){return this.CB}setGlowColor(t){return void 0===t?(this._B=!1,this.JB=void 0):"object"==typeof t&&"auto"in t?(this.wB=t.auto,t.auto&&(this.JB=void 0),void 0!==t.alpha&&(this.WB=t.alpha),this._B=!0):(this.JB=t,this.WB=t.getA(),this.wB=!1,this._B=!0),this.$B=!0,this.cs.Ms(),this}getAutomaticGlowColoring(){return this.wB}setNeedleAlignment(t){return this.HB=t,this.$B=!0,this.cs.Ms(),this}getNeedleAlignment(){return this.HB}setGapBetweenBarAndValueIndicators(t){return this.XB=t,this.$B=!0,this.cs.Ms(),this}getGapBetweenBarAndValueIndicators(){return this.XB}setBarEffect(t){return this.qB.bs(t),this.cs.Ms(),this}getBarEffect(){return this.qB._s()}setLabelEffect(t){return this.tL.bs(t),this.cs.Ms(),this}getLabelEffect(){return this.tL._s()}Re(t){var i;if(super.Re(t),ha.Rp(this.bh,this.Tp),super.wp(),this.xy!==this.M){if(this.FB){const e=5e-4*t,i=.003*t,s=Math.sign(this.M-this.xy);this.xy=this.xy+e*s+i*this.UB*(this.M-this.xy),s!==Math.sign(this.M-this.xy)?this.xy=this.M:this.cs.Ms(!0)}else this.xy=this.M;this.$B=!0}const s=this.pB.find((t=>this.xy>=t.start&&this.xy<=t.end));if(this.QB=this.CB&&s?s.color:this.NB,this.IB){if(this.KB!==this.QB){const e=this.KB.getR(),i=this.KB.getG(),s=this.KB.getB(),r=this.QB.getR(),n=this.QB.getG(),o=this.QB.getB(),h=Math.sign(r-e),a=Math.sign(n-i),l=Math.sign(o-s),u=.005*t,c=.003*t;this.KB=C(e+u*h+c*this.YB*(r-e),i+u*a+c*this.YB*(n-i),s+u*l+c*this.YB*(o-s));const d=Math.abs(r-this.KB.getR()),f=Math.abs(n-this.KB.getG()),g=Math.abs(o-this.KB.getB());d<1&&f<1&&g<1?this.KB=this.QB:this.cs.Ms(!0),this.$B=!0}}else this.KB=this.QB;if(this.$B){let t=ze,r=_e,n=ze,o=_e;if(new Array(100).fill(0).forEach(((e,i,s)=>{const h=this.iu+i/s.length*(this.su-this.iu),a=Math.sin(h*Math.PI/180),l=Math.cos(h*Math.PI/180);ar&&(r=a),lo&&(o=l)})),this.DB?this.iL.Be(new J({stops:[{offset:0,color:T("#000000")},{offset:1,color:this.KB}],position:{x:.5,y:.5}})):this.iL.Be(new U({color:this.KB})),this._B){const t=this.wB&&s?this.KB:null!==(i=this.JB)&&void 0!==i?i:this.GB;this.sL.Be(new J({stops:[{offset:0,color:t.setA(this.WB)},{offset:1,color:t.setA(0)}],position:{x:.5,y:.5},extent:e.GradientExtent.farthestSide}))}else this.sL.Be(z);const h=this.PB(this.gB.start),a=this.PB(this.gB.end);let l=0,u=0;const c=this.cs.Ng.Og(h,this.nL.Zh(),this.nL.Kh()),d=this.cs.Ng.Og(a,this.oL.Zh(),this.oL.Kh());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.TB.forEach(((t,e)=>{if(e>=this.pB.length)return;const i=this.pB[e],s=this.PB(i.start),r=this.PB(i.end),n=this.cs.Ng.Og(s,t.start.Zh(),t.start.Kh()),o=this.cs.Ng.Og(r,t.end.Zh(),t.end.Kh());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.pB.length>0?this.mB:0,g=this.mg.getInnerIntervalPixels(),y=ha.Lp(this.bh,this.Tp),m={x:g.x,y:g.y-y},p={x:.5*m.x,y:.5*m.y},A=f+2*this.XB+this.yB/2,x=l+A,S=u+A,v=S+y,b=g.y-(v+S),M=g.x-(x+x),C=.5*Math.max(this.yB/2,b{var i,s;const r=t.start>=G&&t.end<=H;this.kB[e].setVisible(r),this.TB[e].start.setVisible(r),this.TB[e].end.setVisible(r);const n=Af(this.gB,this.iu,this.su,t.start,E,K),o=Af(this.gB,this.iu,this.su,t.end,E,K),h=mf(E,W,n.angle,o.angle,this.mB,this.MB,!(0===e),!(e===this.pB.length-1));this.kB[e].Cl(h);const a=this.gB.start===t.start||this.gB.end===t.start,l=this.gB.start===t.end||this.gB.end===t.end||this.pB.some((e=>e.start===t.end&&e!==t));this.TB[e].start.Ee({x:n.x,y:n.y}).$a({x:Math.min(1,Math.max(-1,2*(n.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(n.y-_)/(N-_)-1))}).yr(null!==(i=t.startLabel)&&void 0!==i?i:a?"":this.PB(t.start)),this.TB[e].end.Ee({x:o.x,y:o.y}).$a({x:Math.min(1,Math.max(-1,2*(o.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(o.y-_)/(N-_)-1))}).yr(null!==(s=t.endLabel)&&void 0!==s?s:l?"":this.PB(t.end))}));const X=this.pB.some((t=>t.start=t.start&&this.gB.start<=t.end:this.gB.start<=t.start&&this.gB.start>=t.end)),j=Af(this.gB,this.iu,this.su,this.gB.start,E,X?K:W-this.XB);this.nL.Ee({x:j.x,y:j.y}).$a({x:Math.min(1,Math.max(-1,2*(j.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(j.y-_)/(N-_)-1))}).yr(h);const $=this.pB.some((t=>t.start=t.start&&this.gB.end<=t.end:this.gB.end<=t.start&&this.gB.end>=t.end)),Z=Af(this.gB,this.iu,this.su,this.gB.end,E,$?K:W-this.XB);this.oL.Ee({x:Z.x,y:Z.y}).$a({x:Math.min(1,Math.max(-1,2*(Z.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(Z.y-_)/(N-_)-1))}).yr(a),this.$B=!1}}getMinimumSize(){return{x:150,y:150}}ef(){return[this]}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.setMouseInteractions(!1),ce(t,this.ts,i,{fill:new U({color:this.getBarColor()})}),this}}const mf=(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=pf(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?pf(r,l,s+180,s+360,u):pf(r,l,s-180,s-360,u),a.push(...n)}const g=pf(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?pf(r,l,i-180,i-360,u):pf(r,l,i+180,i+360,u),a.push(...n)}return a},pf=(t,e,i,s,r)=>{it>s:t=>t{const[o,h]=t.starte?t.x:t.y,Sf=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),vf=(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(xf(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&&eSf(t,h,n,e))).reduce(((t,e)=>Math.max(t,xf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>xf(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))/xf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class bf{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.ji=!1,this.sP=new Array,this.R=new r.Eventer,this.lL=[],this.sp=[],this.uL=void 0,this.cL=!0,this.dL=!0,this.fL=!0,this.np=!1,this.AL=!0,this.gL=()=>{this.AL=!0,this.cs.Ms()},this.pL=[],this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.yL=t=>{for(let e=0;e{const e=this.lL.indexOf(t);e>=0&&this.lL.splice(e,1)},this.cp=t=>{const e=this.sp.indexOf(t);e>=0&&this.sp.splice(e,1)},this.vL=(t,e,i,s,r)=>{if(this.SL(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.sP.push(n),this.xL(n),this.cL=!0,t}throw new pt("Out of dashboard range.")},this.bL=e.numberOfRows,this.ML=e.numberOfColumns,this.SA=t,this._L=e,this.wL=s;const o=this.ML*this.bL;this.CL={x:new Ed(new Array(this.ML).fill(1)),y:new Ed(new Array(this.bL).fill(1))},this.ts=i.ts,this.kL=this.ts.dashboardSplitterStyle,this.dh=!1!==(null==e?void 0:e.animationsEnabled),this.TL=kd(i,o),this.FL=i.UF("dashboard splitters",500001),this.AM=()=>this.TL.WF(),this.yp=this.TL.YF(),this.hs=i.hs.rs(this,{IL:{}}),this.hs.IL.bs(this.ts.effectsDashboardSplitters);const h=i.oi();this.uiScale=lt.d2({scaleXYConstructor:zi}).Vi(0,100).Oi(0,100).it(h),this.mg=lt.d2({scaleXYConstructor:zi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(h),this.PL=i.DL.bind(i),this.BL=i.LL.bind(i),this.RL=i.EL.bind(i),this.zL=i.VL.bind(i),this.do=i.do.bind(i),this.Ao=i.Ao.bind(i),this.engine=i.fp,this.cs=i.Ap,i.Lo((()=>this.gL())),i.Ms();const a=i.zo((t=>{this.np=t,this.R.emit("inViewChange",this,t)}));this.bp=i.Vo.bind(i,a),this.OL(),this.setAnimationsEnabled(this.dh);const l=(t=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.R);this.createChartXY=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new Tc(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new Rd(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new Nc(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Mf(t,this._L,this.dh),i=e&&e.type?e.type:Ga;return this.vL(new i(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new yf(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Mf(t,this._L,this.dh),i=e&&e.type?e.type:Qc;return this.vL(new i(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Mf(t,this._L,this.dh),i=t&&t.type?t.type:ud;return this.vL(new i(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new ra(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new kl(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new Fc(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Mf(t,this._L,this.dh);return this.vL(new Vl(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Mf(t,this._L,this.dh),i=new Tl(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l,e);return this.vL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Mf(t,this._L,this.dh),i=new qd(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l);return this.vL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Mf(t,this._L,this.dh),i=new uf(this.SA,this.TL.HF(this.NL(t.columnIndex,t.rowIndex)),this.GL(e,this.CL),this.yL,n,l,e);return this.vL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}NL(t,e){return t+e*this.ML}GL(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.ML:this.bL,"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.ML,y:this.bL},e),d3:()=>new ht({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ML,y:this.bL},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.PL(t[0]),this.BL(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.RL(t[0]),this.zL(t[1]),this}getWidth(){return this.do()}getHeight(){return this.Ao()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.FL.Ms(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.FL.Ms(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.ts}setSplitterStyle(t){const e=this.kL;return this.kL="function"==typeof t?t(this.kL):t,this.WL(e),this}getSplitterStyle(){return this.kL}setSplitterEffect(t){return this.hs.IL.bs(t),this.cs.Ms(),this}getSplitterEffect(){return this.hs.IL._s()}setAnimationHighlight(t){return this.fL=t,this.pL.forEach((e=>this.cs.us.Ts(e.line,t))),this}getAnimationHighlight(){return this.fL}WL(t){for(const t of this.pL)t.line.We(this.kL);this.OL()}setColumnWidth(t,e){const i=this.CL.x.C();return t>=0&&t=e.length)throw new pt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.CL.y.C();return t>=0&&t=e.length)throw new pt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.mg.getInnerIntervalPixels()}onResize(t){return this.R.on("resize",t)}offResize(t){return this.R.off(t,"resize")}UL(t,e,i){if(i&&Math.abs(t.x)>0)this.YL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.HL(e,t.y)}for(const t of this.sP)t.panel.K();this.gL()}HL(t,e){const i=vf(this.sP,this.CL.y.C(),t,e,this.mg.oi(),!1);this.CL.y._(i),this.gL()}YL(t,e){const i=vf(this.sP,this.CL.x.C(),t,e,this.mg.oi(),!0);this.CL.x._(i),this.gL()}$L(){this.pL.forEach((t=>t.line.dispose())),this.pL.length=0;for(let t=1;t<=this.ML-1;t+=1)for(let e=0;e<=this.bL-1;e+=1)if(void 0!==this.sP.find((i=>je(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Ji(new es((()=>{this.XL(t)}),((e,i,s,r,n)=>{this.UL(r,t,!0),Qt(n)}),(()=>{this.jL(t)}))),s=this.FL.Ue(this.mg).We(this.kL).setMouseEnterEventHandler((()=>{this.XL(t)})).setMouseLeaveEventHandler((()=>{this.jL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.UL(n,t,!0),Qt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.fL}),this.pL.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.bL-1;t+=1)for(let e=0;e<=this.ML-1;e+=1)if(void 0!==this.sP.find((i=>je(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Ji(new es((()=>{this.ZL(t)}),((e,i,s,r,n)=>{this.UL(r,t,!1),Qt(n)}),(()=>{this.QL(t)}))),s=this.FL.Ue(this.mg).We(this.kL).setMouseEnterEventHandler((()=>{this.ZL(t)})).setMouseLeaveEventHandler((()=>{this.QL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.UL(n,t,!1),Qt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.fL}),this.pL.push({row:t,column:e,line:s,alignment:"horizontal"})}this.hs.IL.gs(this.pL.map((t=>t.line)))}JL(){const t=this.mg.oi(),e=this.CL.x.C(),i=e.reduce(((t,e)=>t+e)),s=this.CL.y.C(),r=s.reduce(((t,e)=>t+e));this.pL.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.He(o).Ye(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.He(o).Ye(h)}}))}XL(t){this.pL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.cs.us.ks(e.line,1),this.FL.KL(e.line))})),this.uL=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.cs.Ms()}ZL(t){this.pL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.cs.us.ks(e.line,1),this.FL.KL(e.line))})),this.uL=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.cs.Ms()}jL(t){this.pL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.cs.us.ks(e.line,0)})),this.engine.restoreMouseStyle(this.uL),this.cs.Ms()}QL(t){this.pL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.cs.us.ks(e.line,0)})),this.engine.restoreMouseStyle(this.uL),this.cs.Ms()}setAnimationsEnabled(t){return this.dh=t,this.getCells().filter((t=>t.panel instanceof oa)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.dh),this}getAnimationsEnabled(){return this.dh}getCells(){return this.sP.slice()}dispose(){return this.ji||(this.bp&&this.bp(),this.sP.slice().forEach((t=>t.panel.dispose())),this.lL.slice().forEach((t=>t.dispose())),this.sp.slice().forEach((t=>t.dispose())),this.ji=!0,this.wL(),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.np}saveToFile(t,e,i){return qh(this.engine,t,e,i),this}qL(t){if(this.AL){const t=this.cs.At.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.mg.it(e,i);const s=this.uiScale.getInnerIntervalPixels();this.mg.Vi(0,s.x).Oi(0,s.y),this.R.emit("resize",this,s.x,s.y,e,i),this.dL=!0}this.cL&&(this.$L(),this.cL=!1,this.dL=!0),this.dL&&(this.JL(),this.dL=!1);for(const e of this.sP)e.panel.Re(t);return this.lL.forEach((t=>t.zs())),this.lL.forEach((t=>t.Re())),this.sp.forEach((t=>t.zs())),this.sp.forEach((t=>t.Re())),this.AL=!1,this}J(){for(const t of this.sP)t.panel.J();return this.mg.x.J(),this.mg.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}K(){for(const t of this.sP)t.panel.K();return this.mg.x.K(),this.mg.y.K(),this.uiScale.x.K(),this.uiScale.y.K(),this}translateCoordinate(t,e,i){return ea(t,e,i,this.mg,this.cs)}addUIElement(t=Wo,e=this.uiScale){e=ta(e,this.mg);const i=Jh(t,this.AM(),this.uiScale,e,this.mL,this.ts);return this.lL.push(i),i}addLegendBox(t=sh,i=this.uiScale){i=ta(i,this.mg);const s=Jh(t,this.yp,this.uiScale,i,this.cp,this.ts);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.sp.push(s),s}getLegendBoxes(){return this.sp}SL(t,e,i,s){return e>=0&&t>=0&&e+s<=this.bL&&t+i<=this.ML}xL(t){const e=this.kL,i=e===nt?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Or(s)}OL(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this.mg.x.si([0,0]),this.mg.y.si([0,0]);for(const t of this.sP)this.xL(t);this.cs.Ms()}}const Mf=(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},Cf={XY:lc,Spider:Ma,BarChart:Ca,Map:ka,Polar:wa,D3:Cl},Tf={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"}},Rf={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"}},kf={"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"}},Ef={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"}},Ff={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"}},Df={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"}},Bf={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"}},Pf={World:If,USA:Ff,NorthAmerica:Df,SouthAmerica:Bf,Canada:kf,Europe:Ef,Asia:Rf,Africa:Tf,Australia:wf},Lf=(t,e)=>Math.abs(t)+Math.abs(e);function Vf(t,e){const i=t.reduce(Lf,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 zf=({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(Lf,0),h=t.map((t=>t.animatedValue)).reduce(Lf,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 Of(c,zf(d).value,t,d);return d.children},Nf=(t,e,i,s,r)=>{const n=t.reduce(Lf,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)},Of=(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)){Nf(a,n,zf(s).vertical,i,s),r.push({children:e.slice(h),width:zf(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&Nf(a,n,zf(s).vertical,i,s)}};class Uf extends oa{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.kp("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.tR=new Map,this.iR=[],this.sR={},this.eR=p([]),this.ky={speed:1},this.hR=ze,this.rR=!0,this.nR="Go Back",this.oR=[],this.aR=this.ts.treeMapChartPathLabelFillStyle||this.ts.uiTextFillStyle,this.lR=this.ts.treeMapChartPathLabelFont||this.ts.uiTextFont,this.uR=this.ts.treeMapChartLabelHeaderFillStyle||this.ts.uiTextFillStyle,this.cR=this.ts.treeMapChartLabelHeaderFont||this.ts.uiTextFont,this.dR=this.ts.treeMapChartLabelFillStyle||this.ts.uiTextFillStyle,this.fR=this.ts.treeMapChartLabelFont||this.ts.uiTextFont,this.$i=!0,this.Ux=!0,this.AR=!1,this.gR=this.ts.treeMapChartParentColor||E,this.pR=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.$x=(t,e,i,s,r)=>{this.cs.Ms(),this.AR=!0},this._t=(t,i)=>{const s=this.yR(i);s&&(this.ab=this.mR(s,t),this.Ux&&this.cs.us.ks(i,!0),this.rR&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.ab),this.cs.Ms())},this.wt=(t,i)=>{this.yR(i)&&(this.ab=void 0,this.Ux&&this.cs.us.ks(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.R.emit("mouseLeave",this,t,this.ab),this.cs.Ms())},this.It=(t,i)=>{const s=this.yR(i);s&&(this.ab=this.mR(s,t),this.Ux&&this.cs.us.ks(i,!0),this.rR&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.ab),this.cs.Ms())},this.Ct=(t,e)=>{const i=this.yR(e);if(i){if(this.rR){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.sR[i.parentID]:void 0;e&&(this.eR._([e]),this.ab=void 0,this.R.emit("viewChange",this.eR.C()),this.AR=!0),t&&Qt(t)}this.R.emit("mouseClick",this,t,this.mR(i,t)),this.cs.Ms()}},this.kt=(t,e)=>{const i=this.yR(e);i&&this.R.emit("mouseDoubleClick",this,t,this.mR(i,t))},this.Tt=(t,e)=>{const i=this.yR(e);i&&this.R.emit("mouseDown",this,t,this.mR(i,t))},this.Ft=(t,e)=>{const i=this.yR(e);i&&this.R.emit("mouseUp",this,t,this.mR(i,t))},this.Dt=(t,e,i)=>{const s=this.yR(i);s&&this.R.emit("mouseDragStart",this,t,e,this.mR(s,t))},this.Pt=(t,e,i,s,r)=>{const n=this.yR(r);n&&this.R.emit("mouseDrag",this,t,e,i,s,this.mR(n,t))},this.Bt=(t,e,i,s)=>{const r=this.yR(s);r&&this.R.emit("mouseDragStop",this,t,e,i,this.mR(r,t))},this.Lt=(t,e)=>{const i=this.yR(e);i&&this.R.emit("mouseWheel",this,t,this.mR(i,t))},this.Rt=(t,e)=>{const i=this.yR(e);i&&(this.ab=this.mR(i,t),this.Ux&&this.cs.us.ks(e,!0),this.R.emit("touchStart",this,t,this.ab),this.cs.Ms(),Qt(t))},this.Et=(t,e)=>{const i=this.yR(e);i&&(this.ab=this.mR(i,t),this.Ux&&this.cs.us.ks(e,!0),this.R.emit("touchMove",this,t,this.ab),this.cs.Ms(),Qt(t))},this.zt=(t,e)=>{const i=this.yR(e);if(i){if(this.ab=void 0,this.rR){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.sR[i.parentID]:void 0;e&&(this.eR._([e]),this.R.emit("viewChange",this.eR.C()),this.AR=!0),t&&Qt(t)}this.Ux&&this.cs.us.ks(e,!1),this.R.emit("touchEnd",this,t,this.ab),this.cs.Ms(),Qt(t)}},this.vR=t=>{const e=this.sR[this.oR[t].id]?[this.sR[this.oR[t].id]]:this.iR;this.eR._(e),this.R.emit("viewChange",e),this.AR=!0,this.cs.Ms()},this.ts.treeMapChartNodeColors)this.SR=this.ts.treeMapChartNodeColors;else{const t=this.ts.pointSeriesFillStyle,e=t=>Y(t)?t.getColor():E;this.SR="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.cs.Zn(fh.Pf),this.$y=i.wx("TreeMapChart plotting",0),this.jy=i.wx("TreeMap UI plotting",1),this.onResize(this.$x),this.bh.yr("TreeMap Chart");const a=i.Zy(),l=Bt(o?o.cursorBuilder:void 0,Ra);this.Qy=ua(this,a,l.yy(a,this.uiScale,this.uiScale,Et,this.ts),void 0,"show-pointed",Yf,(()=>0)),this.xR=this.hs.kg(),this.Cp(n,this.uiScale),this.sb=this.$y.Hm(this.mg).Be(new G).De(this.pR),this.bR=this.cs.us.$r(this,{animationEnabled:!1!==(null==o?void 0:o.animationsEnabled)}),this.MR=new Za((()=>this.jy.Gr(this.mg).setMouseInteractions(!1))),this._R=new Za((()=>this.jy.Gr(this.uiScale))),this.sb.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{wR:e}=(()=>{let t=0;return{wR: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.sR[t.id];e&&this.CR(t,e)})),this.ab=void 0,this.eR._(i),this.iR=i,this.sR=this.kR(i),this.AR=!0,this.cs.Ms(),this}setAnimationValues(t,e=1){return this.ky=t?{speed:e}:void 0,this.cs.Ms(),this}setInitPathButtonText(t){return this.nR=t,this.AR=!0,this.cs.Ms(),this}setDisplayedLevelsCount(t){return this.hR=t,this.AR=!0,this.cs.Ms(),this}setDrillDownEnabled(t){return this.rR=t,this.AR=!0,this.cs.Ms(),this}setDrillDownNode(t){var e,i;if(this.ab=void 0,void 0===t)this.eR._(this.iR);else{const s=[...this.iR];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.sR[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.sR[r.parentID]:this.iR[0];this.eR._([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.eR.C()),this.AR=!0,this.cs.Ms(),this}setNodeColoring(t){return t instanceof Array?(this.sb.Be(new G),this.SR=t):this.sb.Be(t),this.AR=!0,this.cs.Ms(),this}setParentNodeColor(t){return this.gR=t,this.AR=!0,this.cs.Ms(),this}setPathLabelFillStyle(t){return this.aR="function"==typeof t?t(this.aR):t,this.AR=!0,this.cs.Ms(),this}getPathLabelFillStyle(){return this.aR}setPathLabelFont(t){return yr(t)?this.lR=t:this.lR=t(this.lR),this.AR=!0,this.cs.Ms(),this}getPathLabelFont(){return this.lR}setHeaderFont(t){return yr(t)?this.cR=t:this.cR=t(this.cR),this.AR=!0,this.cs.Ms(),this}getHeaderFont(){return this.cR}setHeaderFillStyle(t){return this.uR="function"==typeof t?t(this.uR):t,this.AR=!0,this.cs.Ms(),this}getHeaderFillStyle(){return this.uR}setLabelFont(t){return yr(t)?this.fR=t:this.fR=t(this.fR),this.AR=!0,this.cs.Ms(),this}getLabelFont(){return this.fR}setLabelFillStyle(t){return this.dR="function"==typeof t?t(this.dR):t,this.AR=!0,this.cs.Ms(),this}getLabelFillStyle(){return this.dR}setNodeBorderStyle(t){return this.sb.De(t),this.AR=!0,this.cs.Ms(),this}getNodeBorderStyle(){return this.sb.mo()}setNodeEffect(t){return this.xR.bs(t),this.cs.Ms(),this}getNodeEffect(){return this.xR._s()}setCursor(t){return this.Qy.setCursor(t),this}getCursor(){return this.Qy.getCursor()}setCursorMode(t){return this.Qy.setCursorMode(t),this}getCursorMode(){return this.Qy.getCursorMode()}setCustomCursor(t){return this.Qy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.Qy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.Qy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.Qy.setCursorFormatting(t),this}getCursorFormatting(){return this.Qy.getCursorFormatting()}addCursor(t=Ra){const e=this.gp(),i=t.yy(e,this.uiScale,this.uiScale,this.up(e),this.ts);return this.Mp(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.sb.setMouseInteractions(t),this}getMouseInteractions(){return this.$i}setAnimationHighlight(t){return this.bR.Zr(t),this}getAnimationHighlight(){return this.bR.Qr()}setHighlightOnHover(t){return this.Ux=t,this}getHighlightOnHover(){return this.Ux}mR(t,e){const i=this.cs.No(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(){}ef(){return[this]}Re(t){super.Re(t),super.wp(),ha.Rp(this.bh,this.Tp);const i=ha.Lp(this.bh,this.Tp);if(this.AR&&this.eR.C().length){this.sb.Ot(),this.tR.clear(),this.bR.jr(),this.dh&&this.TR(t);const s=_f({data:this.eR.C(),dimensions:{x:0+this.ka.left,y:this.mg.y.getInnerEnd()-i-this.ka.top,width:this.mg.x.getInnerEnd()-this.ka.right-this.ka.left,height:this.mg.y.getInnerEnd()-i-this.ka.top-this.ka.bottom}}),r=this.MR.wm();this.FR(s,r),r.finishPlot(),this.IR(),this.iR!==this.eR.C()&&this.iR.length>1&&this.oR.unshift({name:this.nR,id:0});let n=0;const o=this._R.wm(),h=this.lR;this.oR.forEach(((t,i)=>{const s=o.add(),r=this.cs.Ng.Og(t.name,h,0);s.yr(`← ${t.name}`).Qh(h).Ee({x:0,y:100}).$a({x:-1,y:1}).Or({left:this.ka.left+n,top:this.ka.top,right:0,bottom:0}).Be(this.aR).setMouseClickEventHandler((t=>this.vR(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.eR.C().every((t=>t.value===t.animatedValue))?this.AR=!1:this.cs.Ms(!0)}return this.Qy.Re(!1,[],void 0,{explicitTarget:this.ab}),this}dispose(){return this.jy.Y(),this.$y.Y(),this.Qy.Y(),this.sb.dispose(),this.tR.clear(),this.MR.km(),this._R.km(),super.dispose()}J(){return super.J(),this}K(){return super.K(),this}Zd(){return de(this.sb.Xh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),ce(t,this.ts,i,{}),this}FR(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.SR,y=0===s&&1===this.eR.C().length?this.gR:g[f%g.length],m=[{x:o,y:h},{x:o,y:h-a},{x:l+o,y:h-a},{x:l+o,y:h}],p=this.sb.Xr().Cl(m).PR(y.setA(n||250)).ob(c);this.tR.set(p,i),this.bR.Xr(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.iR.length||this.iR===this.eR.C()?250:n?n/(s+1):250-e*o;r.push({node:t[e],isChild:!0,visibleDepth:s+1,opacity:h})}}const b=0===s&&1===this.eR.C().length?this.uR:this.dR,M=0===s?this.cR:this.fR,C=this.DR(d,l-25,M),T=this.cs.Ng.Og(C,M,0),R=e.add();l-25>T.x&&a>25?R.yr(C).Ee({x:o+5,y:h-2.5}).$a({x:-1,y:1}).Be(b).Qh(M):R.yr("")}}kR(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}yR(t){if(!this.AR&&t)return this.tR.get(t)}IR(){this.oR=[];const t=this.eR.C()[0].id;let e=this.sR[t].parentID;for(;e;)this.oR.push({name:this.sR[e].name,id:e}),e=this.sR[e].parentID;return this.oR.reverse()}DR(t,e,i){let s=this.cs.Ng.Og(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.Ng.Og(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.cs.Ng.Og(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.cs.Ng.Og(n,i,0).x;return n.length<=3&&s>e?"":n}TR(t){var e;const i=[...this.iR];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.ky)s.animatedValue=s.value;else{const i=r/250*((null===(e=this.ky)||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)}}CR(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.dh?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 Yf=(t,e,i)=>[[e.name],[{text:e.value.toString(),font:{weight:"bold"}}]],Gf=(t,i)=>{const s=(t=>{const i=new U({color:t.uiStrokeColorContrastHigh}),s=new U({color:t.uiStrokeColorContrastMedium}),r=new U({color:t.uiStrokeColorContrastLow}),n=new gr({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 rs({thickness:2,fillStyle:r}),f=new U({color:t.dataHighlightOverlayColor}),g=new rs({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),y=t.dataColorPalette.map((t=>new U({color:t.stroke}))),m=t=>y[t%y.length],p=y.map((t=>new rs({thickness:2,fillStyle:t}))),A=t=>p[t%p.length],x=t.dataColorPalette.map((t=>new U({color:t.border}))).map((t=>new rs({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new it({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 it({angle:180,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),R=t=>M[t%M.length],w=t.dataColorPalette.map((t=>{const e=t.area;return new it({angle:180,stops:[{color:ae(e,C(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,C(0,0,0,e.getA()),.3),offset:1}]})})),k=t=>w[t%w.length],E=t.dataColorPaletteInverted.map((t=>new U({color:t.border}))).map((t=>new rs({thickness:2,fillStyle:t}))),I=t=>E[t%E.length],F=new U({color:t.dataColorPositive}),D=new U({color:t.dataColorNegative}),B=new rs({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastHigh.setA(50)})}),P=new rs({thickness:2,fillStyle:t.axisLineFillStyle}),L=nt,V=new U({color:C(0,0,0,1)}),_=new rs({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=nt,O=a,Y=t.axisLabelMajorFillStyle,G=new rs({thickness:1,fillStyle:t.axisGridMajorFillStyle}),H=new rs({thickness:1,fillStyle:t.axisTickMajorFillStyle}),W=a,K=t.axisLabelMajorFillStyle,X=new rs({thickness:1,fillStyle:t.axisGridMinorFillStyle}),j=new rs({thickness:1,fillStyle:t.axisTickMinorFillStyle}),$=l,Z=t.axisLabelMinorFillStyle,Q=Mh,q=new vh({gridStrokeStyle:_,tickStyle:N,tickLength:50,tickPadding:-14,labelFont:O,labelFillStyle:Y}),J=new vh({gridStrokeStyle:G,tickStyle:H,tickLength:7,tickPadding:5,labelFont:W,labelFillStyle:K}),tt=new vh({gridStrokeStyle:X,tickStyle:j,tickLength:4,tickPadding:10,labelFont:$,labelFillStyle:Z}),et=new Qh({extremeTickStyle:Q,majorTickStyle:J,minorTickStyle:tt}),st=new Gh({greatTickStyle:q,majorTickStyle:J,minorTickStyle:tt}),rt=new Eh({majorTickStyle:J,minorTickStyle:tt}),ot=new U({color:t.dataHighlightOverlayColor}),ht=new rs({thickness:1,fillStyle:s}),at=new rs({thickness:2,fillStyle:s}),lt=t=>new Cr.Triangulated({shape:"sphere",size:10,fillStyle:y[t%y.length]}),ut=y[0],ct=t.uiTextFillStyle,dt=t.legendBackgroundFillStyle,ft=new rs({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),gt=ue(t.legendButtonDefaultColor),yt=ue(t.isDark?C(70,70,70,255):C(170,170,170,255)),mt=new U({color:t.isDark?C(70,70,70,255):C(170,170,170,255)}),pt=new rs({thickness:1,fillStyle:i}),At=new ho({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:no.DashedEqual,patternScale:3}),xt=new rs({thickness:1,fillStyle:t.cursorGridFillStyle}),St=t.zoomBandChartDefocusOverlayFillStyle,vt=new rs({thickness:2,fillStyle:new U({color:t.zoomBandChartSplitterColor})}),bt=new U({color:t.uiBackgroundColor});let Mt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:nt,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new rs({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:nt,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:A,pointLineSeriesStrokeStyle:A,pointLineSeriesFillStyle:m,pointSeriesFillStyle:m,ellipseSeriesFillStyle:m,ellipseSeriesStrokeStyle:A,polygonSeriesFillStyle:m,polygonSeriesStrokeStyle:A,rectangleSeriesFillStyle:m,rectangleSeriesStrokeStyle:nt,segmentSeriesStrokeStyle:A,boxSeriesBodyFillStyle:m(0),boxSeriesBodyStrokeStyle:nt,boxSeriesStrokeStyle:new rs({thickness:1,fillStyle:y[0]}),boxSeriesMedianStrokeStyle:new rs({thickness:1,fillStyle:new U({color:C(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:F,ohlcCandleBodyFillStyleNegative:D,ohlcCandleTailStrokeStylePositive:new rs({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new rs({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new rs({thickness:2,fillStyle:F}),ohlcBarStrokeStyleNegative:new rs({thickness:2,fillStyle:D}),heatmapGridSeriesFillStyle:m,heatmapGridSeriesWireframeStyle:B,heatmapScrollingGridSeriesFillStyle:m,heatmapScrollingGridSeriesWireframeStyle:B,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:R,areaRangeSeriesStrokeStyleInverted:I,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:R,areaSeriesBipolarLowStrokeStyle:I,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:R,areaSeriesNegativeStrokeStyle:I,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:P,xAxisNibStyle:L,xAxisOverlayStyle:V,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:nt,xAxisNumericTicks:et,xAxisDateTimeTicks:st,xAxisTimeTicks:rt,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:P,yAxisNibStyle:L,yAxisOverlayStyle:V,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:nt,yAxisNumericTicks:et,yAxisDateTimeTicks:st,yAxisTimeTicks:rt,bandFillStyle:ot,bandStrokeStyle:ht,constantLineStrokeStyle:at,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:nt,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:z,barChartSeriesBackgroundStrokeStyle:nt,barChartBarFillStyle:m,barChartBarStrokeStyle:new rs({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:P,barChartValueAxisTicks:et.setMajorTickStyle((t=>t.setGridStrokeStyle(nt))).setMinorTickStyle((t=>t.setGridStrokeStyle(nt))),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:nt,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:nt,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:P,xAxis3DNumericTicks:et,xAxis3DDateTimeTicks:st,xAxis3DTimeTicks:rt,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:P,yAxis3DNumericTicks:et,yAxis3DDateTimeTicks:st,yAxis3DTimeTicks:rt,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:P,zAxis3DNumericTicks:et,zAxis3DDateTimeTicks:st,zAxis3DTimeTicks:rt,lineSeries3DStrokeStyle:A,pointLineSeries3DStrokeStyle:A,pointLineSeries3DPointStyle:lt,pointSeries3DPointStyle:lt,pointCloudSeries3DPointStyle:t=>new Cr.Pixelated({size:5,fillStyle:y[t%y.length]}),surfaceGridSeries3DFillStyle:m,surfaceGridSeries3DWireframeStyle:B,surfaceScrollingGridSeries3DFillStyle:m,surfaceScrollingGridSeries3DWireframeStyle:B,boxSeries3DFillStyle:m,meshModel3DFillStyle:m(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:nt,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:ot,polarSectorStrokeStyle:ht,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:P,polarAmplitudeAxisNumericTicks:et,polarAmplitudeAxisDateTimeTicks:st,polarAmplitudeAxisTimeTicks:rt,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:P,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:A,polarPointLineSeriesFillStyle:m,polarPointLineSeriesStrokeStyle:A,polarPointSeriesFillStyle:m,polarPolygonSeriesFillStyle:k,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:k,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:m,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:nt,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ut,mapChartStrokeStyle:new rs({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:z,mapChartOutlierRegionStrokeStyle:new rs({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:dt,mapChartSeparateRegionStrokeStyle:ft,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:nt,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:ut,dataGridCellBackgroundFillStyle:new U({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new rs({thickness:.4,fillStyle:new U({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:nt,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ft,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ft,dataGridScrollBarButtonArrowFillStyle:gt,dataGridScrollBarButtonArrowStrokeStyle:ft,sparkLineChartStrokeStyle:A(0),sparkPointChartFillStyle:m(0),sparkBarChartFillStyle:m(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:m,sparkPieChartStrokeStyle:ft,sparkChartBandFillStyle:ot,sparkChartBandStrokeStyle:ht,sparkChartConstantLineStrokeStyle:at,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:nt,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new rs({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new rs({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new rs({thickness:2,fillStyle:i}),spiderSeriesFillStyle:k,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:m,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:nt,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:m,pieChartSliceStrokeStyle:ft,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:pt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:nt,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:m,funnelChartSliceStrokeStyle:ft,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:pt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:nt,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:m,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:nt,gaugeChartUnitLabelFillStyle:t.uiTextFillStyle,gaugeChartValueLabelFillStyle:t.uiTextFillStyle,gaugeChartBarColor:C(255,255,255),gaugeChartGlowColor:C(255,255,64),gaugeChartNeedleFillStyle:new U({color:C(255,255,255)}),gaugeChartNeedleThickness:10,gaugeChartNeedleStrokeStyle:new rs({thickness:2,fillStyle:new U({color:C(0,0,0)})}),gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:nt,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:nt,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new rs({thickness:1,fillStyle:new U({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:nt,zoomBandChartDefocusOverlayFillStyle:St,zoomBandChartSplitterStrokeStyle:vt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:C(254,204,0,.7),uiButtonFillStyle:gt,uiButtonFillStyleHidden:yt,uiButtonStrokeStyle:ft,uiButtonSize:10,uiBackgroundFillStyle:dt,uiBackgroundStrokeStyle:ft,uiTextFillStyle:ct,uiTextFillStyleHidden:mt,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:J.tickStyle,cursor3DTickStrokeStyleY:J.tickStyle,cursor3DTickStrokeStyleZ:J.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}},Hf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{we(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},Wf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,C(255,255,255),.5);return new J({stops:[{color:ae(r,C(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ae(r,C(30,30,30),.5*i).setA(100),offset:1}]})},Kf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,C(255,255,255),.2);return new J({stops:[{color:ae(r,C(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ae(r,C(0,0,0),.2*i),offset:1}]})},Xf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,C(255,255,255),.2);return new it({angle:90,stops:[{color:ae(r,C(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ae(r,C(30,30,30),.5*i),offset:1}]})},jf=(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:ae(e[i%e.length].stroke,C(255,255,255),.3);return new it({angle:90,stops:[{color:ae(s,C(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ae(s,C(30,30,30),.5),offset:1}]})})(s);return i.set(s,n),n}})(),$f=Te((()=>{const t=C(255,255,255),i=new U({color:t}),s=!0,r=new go({spread:1,blur:9,offset:{x:0,y:0},color:C(0,0,0,150)}),n=new J({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 U({color:C(45,45,45)}),h=new J({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 J({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 U({color:C(255,255,220)}),u=new U({color:C(255,255,166)}),c=new U({color:C(255,255,220)}),d=new U({color:C(255,255,220,130)}),f=new U({color:C(255,255,200)}),g=f,y=g,m=new it({angle:45,stops:[{offset:0,color:C(230,230,230)},{offset:1,color:C(150,150,150)}]}),p=new U({color:C(220,220,220)}),A=new U({color:C(200,200,200,50)}),x=new U({color:C(200,200,200,150)}),S=new U({color:C(200,200,200,20)}),v=new U({color:C(220,220,220)}),b=new it({angle:0,stops:[{offset:0,color:C(10,10,10,220)},{offset:1,color:C(30,30,30,220)}]}),M=i,R=C(255,255,200),w=b,k=M,E=C(20,20,20),I=C(0,0,0),F=t,D=C(150,150,150),B=C(50,50,50),P=C(50,50,50),L=C(100,100,100),V=C(200,200,200),z=[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)}))),_=t.setA(20),N=C(176,255,157,255),O=C(255,112,76,255),Y={mapChartFillStyle:new it({angle:135,stops:[{color:C(255,255,91,255),offset:0},{color:C(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Wf(s,z,.5),pieChartSliceFillStylePalette:Kf(s,z,1),funnelChartSliceFillStylePalette:Xf(s,z,1),pyramidChartSliceFillStylePalette:Xf(s,z,1),rectangleSeriesFillStyle:jf(s,z),gaugeChartBarColor:C(255,255,91,255),gaugeChartGlowColor:C(255,255,91,64)},G=new U({color:C(176,255,157,255)}),H=new U({color:C(255,146,146,255)}),W=new U({color:C(176,255,157,255)}),K=new U({color:C(230,63,63,255)}),X=new U({color:C(176,255,157,120)}),j=new U({color:C(229,63,63,180)}),$=new U({color:C(27,37,36,255)}),Z=new U({color:C(62,27,27,255)}),Q=[C(255,0,0),C(255,255,0),C(0,255,0)],q=[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)],st=new J({stops:[{color:C(61,61,80,100),offset:0},{color:C(44,44,55,30),offset:1}]}),rt=new U({color:C(148,148,198,255)}),nt=X.getColor().setA(255),ot=C(100,100,100),ht=[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 Gf({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:y,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:A,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:R,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:E,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:B,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:V,dataColorPalette:z,dataColorPaletteInverted:[{area:C(190,50,50,100),border:C(210,80,80)}],dataHighlightOverlayColor:_,dataColorPositive:N,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new so({source:Hf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:Y,treeMapChartParentColor:T("#181E21"),treeMapChartNodeColors:ht,treeMapChartLabelFillStyle:new U({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:C(250,250,250)})},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:W,negativeFillStyle:K,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:Q,coldHotColorPalette:q,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:st,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),Zf=Te((()=>{const t=C(255,255,255),i=new U({color:t}),s=!0,r=new go({spread:0,blur:9,offset:{x:0,y:0},color:C(105,255,236,40)}),n=new U({color:C(2,21,30)}),o=new J({stops:[{color:C(19,40,66,150),offset:0},{color:C(0,0,0,150),offset:1}]}),h=new U({color:C(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:C(255,255,220,130)}),d=i,f=i,g=f,y=new U({color:C(20,224,250,255)}),m=i,p=new U({color:C(61,94,110,100)}),A=new U({color:C(61,94,110,255)}),x=new U({color:C(61,94,110,40)}),S=i,v=new U({color:C(0,18,23,255)}),b=i,M=t,R=new U({color:C(0,17,22,240)}),w=i,k=C(0,38,48,220),E=C(0,0,0),I=t,F=C(150,150,150),D=C(19,78,93),B=C(50,50,50),P=C(0,36,48),L=C(200,200,200),V=[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)}))),z=t.setA(50),_=C(3,217,194,255),N=C(230,63,63,255),O={mapChartFillStyle:new it({angle:135,stops:[{color:C(118,248,231,255),offset:0},{color:C(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Wf(s,V,1),pieChartSliceFillStylePalette:Kf(s,V,1),funnelChartSliceFillStylePalette:Xf(s,V,1),pyramidChartSliceFillStylePalette:Xf(s,V,1),rectangleSeriesFillStyle:jf(s,V),gaugeChartBarColor:C(3,217,194,255),gaugeChartGlowColor:C(3,217,194,120)},Y=new U({color:C(45,253,253,255)}),G=new U({color:C(255,146,146,255)}),H=new U({color:C(45,253,253,255)}),W=new U({color:C(230,63,63,255)}),K=new U({color:C(1,190,164,120)}),X=new U({color:C(229,63,63,180)}),j=new U({color:C(1,53,57,255)}),$=new U({color:C(62,27,27,255)}),Z=[C(1,104,119,255),C(0,165,144,255),C(0,246,214,255)],Q=[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)],q=[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 J({stops:[{color:C(122,103,254,70),offset:0},{color:C(178,168,255,10),offset:1}]}),st=new U({color:C(122,103,254,255)}),rt=K.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 Gf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new so({source:Hf(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:y,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:R,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:k,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:B,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:L,dataColorPalette:V,dataColorPaletteInverted:[{area:C(170,60,210,100),border:C(210,100,250)}],dataHighlightOverlayColor:z,dataColorPositive:_,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new so({source:Hf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:T("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:C(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:K,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Qf=Te((()=>{const t=!1,i=new go({spread:0,blur:6,offset:{x:2,y:-2},color:C(0,0,0,30)}),s=new J({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 U({color:C(219,227,233,255)}),n=new J({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 J({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 U({color:C(33,43,49)}),a=new U({color:C(33,43,49)}),l=new U({color:C(33,43,49)}),u=new U({color:C(33,43,49,150)}),c=new U({color:C(33,43,49)}),d=c,f=d,g=new it({angle:45,stops:[{offset:0,color:C(225,225,225)},{offset:1,color:C(225,225,225)}]}),y=new U({color:C(150,150,150,255)}),m=new U({color:C(150,150,150,170)}),p=new U({color:C(150,150,150,150)}),A=new U({color:C(150,150,150,100)}),x=new U({color:C(60,70,80)}),S=new it({angle:0,stops:[{offset:0,color:C(255,255,255,240)},{offset:1,color:C(255,255,255,240)}]}),v=new U({color:C(168,186,199)}),b=C(255,255,200),M=new U({color:C(255,255,255,240)}),R=new U({color:C(128,146,159,255)}),w=C(255,255,255,255),k=C(168,168,199,255),E=C(168,186,199,255),I=C(168,186,199,255),F=C(168,186,199,255),D=C(168,186,199,255),B=C(100,100,100),P=C(200,200,200),L=[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)}))),V=C(150,150,150,80),z=C(46,182,120,255),_=C(255,66,66,255),N=new rs({thickness:2,fillStyle:new U({color:C(168,186,199,255)})}),O={mapChartFillStyle:new it({angle:-45,stops:[{color:C(2,181,213,255),offset:0},{color:C(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Wf(t,L,.8),pieChartSliceFillStylePalette:Kf(t,L,.8),funnelChartSliceFillStylePalette:Xf(t,L,.5),pyramidChartSliceFillStylePalette:Xf(t,L,.5),rectangleSeriesFillStyle:jf(t,L),gaugeChartBarColor:C(46,182,120,255),gaugeChartGlowColor:C(46,182,120,120),chartXYSeriesBackgroundStrokeStyle:N,chart3DSeriesBackgroundStrokeStyle:N,polarChartSeriesBackgroundStrokeStyle:N,spiderChartSeriesBackgroundStrokeStyle:N,dataGridTextFillStyle:new U({color:C(0,88,64,255)})},Y=new U({color:C(4,146,108,255)}),G=new U({color:C(240,39,39,255)}),H=new U({color:C(28,181,140,255)}),W=new U({color:C(230,88,88,255)}),K=new U({color:C(28,181,140,180)}),X=new U({color:C(230,88,88,180)}),j=new U({color:C(229,243,228)}),$=new U({color:C(232,225,216)}),Z=[C(193,48,48,255),C(240,234,60,255),C(45,191,55,255)],Q=[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)],q=[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 U({color:C(185,198,207,255)}),st=new J({stops:[{color:C(151,190,220,10),offset:0},{color:C(151,190,220,50),offset:1}]}),rt=K.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 Gf({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:y,axisGridMajorFillStyle:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:A,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:R,uiBackgroundColor:w,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:E,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:B,dataStrokeColorContrastLow:P,dataColorPalette:L,dataColorPaletteInverted:[{area:C(190,50,50,100),border:C(210,80,80)}],dataHighlightOverlayColor:V,dataColorPositive:z,dataColorNegative:_,zoomBandChartDefocusOverlayFillStyle:new U({color:C(255,255,255,180)}),zoomBandChartSplitterColor:T("#505D65"),zoomBandChartKnobFillStyle:t=>new so({source:Hf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:T("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:C(0,0,0)}),treeMapChartLabelHeaderFillStyle:new U({color:C(33,33,33)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:K,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:st,bollingerBorderFillStyle:et,highlightPointColor:C(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),qf=Te((()=>{const t=!1,i=new J({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 U({color:C(214,236,216,255)}),r=new J({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 J({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 U({color:C(1,61,53)}),h=new U({color:C(1,61,53)}),a=new U({color:C(1,61,53)}),l=new U({color:C(1,61,53,150)}),u=new U({color:C(1,61,53)}),c=u,d=c,f=new it({angle:45,stops:[{offset:0,color:C(225,225,225)},{offset:1,color:C(225,225,225)}]}),g=new U({color:C(188,211,186,255)}),y=new U({color:C(188,211,186,150)}),m=new U({color:C(188,211,186,50)}),p=new U({color:C(188,211,186,50)}),A=new U({color:C(104,148,111,255)}),x=new it({angle:0,stops:[{offset:0,color:C(255,255,255,240)},{offset:1,color:C(255,255,255,240)}]}),S=new U({color:C(104,148,111)}),v=C(255,255,200),b=new U({color:C(255,255,255,240)}),M=new U({color:C(104,148,111,255)}),R=C(255,255,255,255),w=C(179,201,183,255),k=C(188,211,186,255),E=C(188,211,186,255),I=C(188,211,186,255),F=C(188,211,186,255),D=C(100,100,100),B=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)}))),L=C(150,150,150,80),V=C(46,182,84,255),z=C(232,96,96,255),_=new rs({thickness:2,fillStyle:new U({color:C(188,211,186,255)})}),N={mapChartFillStyle:new it({angle:-45,stops:[{color:C(118,160,121,255),offset:0},{color:C(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Wf(t,P,.8),pieChartSliceFillStylePalette:Kf(t,P,.8),pyramidChartSliceFillStylePalette:Xf(t,P,.5),funnelChartSliceFillStylePalette:Xf(t,P,.5),rectangleSeriesFillStyle:jf(t,P),gaugeChartBarColor:C(46,182,84,255),gaugeChartGlowColor:C(46,182,84,120),chartXYSeriesBackgroundStrokeStyle:_,chart3DSeriesBackgroundStrokeStyle:_,polarChartSeriesBackgroundStrokeStyle:_,spiderChartSeriesBackgroundStrokeStyle:_,dataGridTextFillStyle:new U({color:C(77,66,21,255)})},O=new U({color:C(93,151,97,255)}),Y=new U({color:C(178,99,99,255)}),G=new U({color:C(138,195,142,255)}),H=new U({color:C(178,99,99,255)}),W=new U({color:C(138,195,142,180)}),K=new U({color:C(178,99,99,180)}),X=new U({color:C(224,240,237)}),j=new U({color:C(251,227,227)}),$=[C(178,99,99,255),C(215,224,111,255),C(80,186,88,255)],Z=[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)],Q=[C(64,86,138),C(123,192,205),C(255,252,149),C(220,155,92),C(184,78,74)],q=[C(64,86,138),C(123,192,205),C(255,252,149),C(220,155,92),C(132,60,57)],tt=new U({color:C(185,198,207,255)}),et=new J({stops:[{color:C(151,190,220,10),offset:0},{color:C(151,190,220,50),offset:1}]}),st=W.getColor().setA(255),rt=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 Gf({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:y,axisTickMinorFillStyle:m,axisGridMinorFillStyle:p,cursorGridFillStyle:A,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:R,uiBackgroundBorderColor:w,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:E,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:B,dataColorPalette:P,dataColorPaletteInverted:[{area:C(210,70,70,100),border:C(200,110,110)}],dataHighlightOverlayColor:L,dataColorPositive:V,dataColorNegative:z,zoomBandChartDefocusOverlayFillStyle:new U({color:C(255,255,255,180)}),zoomBandChartSplitterColor:T("#446A40"),zoomBandChartKnobFillStyle:t=>new so({source:Hf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N,treeMapChartParentColor:T("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new U({color:C(0,0,0)}),treeMapChartLabelHeaderFillStyle:new U({color:C(33,33,33)})},{positiveTextFillStyle:O,negativeTextFillStyle:Y,positiveFillStyle:G,negativeFillStyle:H,positiveAreaFillStyle:W,negativeAreaFillStyle:K,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:$,coldHotColorPalette:Z,intensityColorPalette:Q,spectrogramColorPalette:q,bollingerFillStyle:et,bollingerBorderFillStyle:tt,highlightPointColor:C(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),Jf=Te((()=>{const t=C(255,255,255),i=new U({color:t}),s=!0,r=new go({spread:1,blur:9,offset:{x:0,y:0},color:C(255,255,255,30)}),n=new U({color:C(6,15,36)}),o=new J({stops:[{color:C(46,13,87,50),offset:0},{color:C(0,0,0,150),offset:1}]}),h=new U({color:C(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:C(255,255,220,130)}),d=i,f=i,g=f,y=new it({angle:45,stops:[{offset:0,color:C(241,133,255,255)},{offset:1,color:C(115,207,238,255)}]}),m=i,p=new U({color:C(61,94,110,100)}),A=new U({color:C(61,94,110,255)}),x=new U({color:C(61,94,110,40)}),S=i,v=new U({color:C(0,18,23,255)}),b=i,M=C(115,207,238,255),R=new U({color:C(0,17,22,240)}),w=i,k=C(0,38,48,255),E=C(0,0,0),I=t,F=C(150,150,150),D=C(19,57,93),B=C(50,50,50),P=C(0,17,48),L=C(200,200,200),V=[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)}))),z=t.setA(50),_=C(3,217,194,255),N=C(243,21,110,255),O={mapChartFillStyle:new it({angle:135,stops:[{color:C(118,248,231,255),offset:0},{color:C(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Wf(s,V,.5),pieChartSliceFillStylePalette:Kf(s,V,2),funnelChartSliceFillStylePalette:Xf(s,V,1),pyramidChartSliceFillStylePalette:Xf(s,V,1),rectangleSeriesFillStyle:jf(s,V),gaugeChartBarColor:C(3,217,194,255),gaugeChartGlowColor:C(3,217,194,150)},Y=new U({color:C(20,211,237,255)}),G=new U({color:C(253,145,178,255)}),H=new U({color:C(20,211,237,255)}),W=new U({color:C(239,68,121,255)}),K=new U({color:C(20,211,237,120)}),X=new U({color:C(239,68,121,180)}),j=new U({color:C(1,53,57,255)}),$=new U({color:C(94,19,42,255)}),Z=[C(174,51,132,255),C(204,107,218,255),C(189,215,253,255)],Q=[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)],q=[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 J({stops:[{color:C(219,42,235,60),offset:0},{color:C(237,73,252,10),offset:1}]}),st=new U({color:C(237,73,252,255)}),rt=K.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 Gf({isDark:s,highlightColorOffset:C(60,60,60,60),highlightColorOffsetAxisOverlay:C(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new so({source:Hf(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:y,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:R,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:k,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:B,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:L,dataColorPalette:V,dataColorPaletteInverted:[{area:C(41,130,255,100),border:C(45,110,240)}],dataHighlightOverlayColor:z,dataColorPositive:_,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:C(0,0,0,180)}),zoomBandChartSplitterColor:T("#DB77FF"),zoomBandChartKnobFillStyle:t=>new so({source:Hf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:T("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:C(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:C(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:K,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),tg={};Object.defineProperty(tg,"darkGold",{get:$f,enumerable:!0}),Object.defineProperty(tg,"turquoiseHexagon",{get:Zf,enumerable:!0}),Object.defineProperty(tg,"light",{get:Qf,enumerable:!0}),Object.defineProperty(tg,"lightNature",{get:qf,enumerable:!0}),Object.defineProperty(tg,"cyberSpace",{get:Jf,enumerable:!0});const eg=tg,ig=eg.darkGold,sg=(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")=>{let s,r=0,n=0;const o=[],h=t=>{const i=new Ct.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new so({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Ud)||void 0===s||s.Be(o),r=i.width,n=i.height,u(t)}))}};h(i);const a=t.Qn((t=>h(t)));let l;if(new Ct.Image instanceof Ct.HTMLImageElement){const t=new Ct.Image;t.src=i,l=new so({source:t,fitMode:e.ImageFitMode.Stretch})}else if(Ct.lcjs_setup){const t=new Ct.Image;t.src=i;const s=Ct.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),l=new so({source:s,fitMode:e.ImageFitMode.Stretch})}else l=new U({color:T("#f00")});const u=t=>{if(t.Ud){const e=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-(3+r),y:3}),i=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.Ud.Ee(e).it(s)}s&&s.Ms()};return s=t.UF("logo",Number.MAX_SAFE_INTEGER),i=>{const r={At:i};return(i=>{i.Ud&&i.Ud.dispose(),s&&(i.Ud=s.Le(i.At).Be(l).setMouseInteractions(!0).De(nt).setMouseEnterEventHandler((()=>{t.Kr(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Kr(e.MouseStyles.None)})).setMouseClickEventHandler(rg).setTouchEndEventHandler(rg),u(i))})(r),o.push(r),{zs:()=>u(r),Y:()=>(e=>{e.Ud&&(e.Ud.dispose(),e.Ud=void 0);const i=o.indexOf(e);i>=0&&o.splice(i,1),o.length<=0&&t.Jn(a)})(r)}}},rg=()=>Ct.open("https://lightningchart.com/lightningchart-js/");class ng{constructor(){this.BR=this.BI.bind(this),Ct.addEventListener("scroll",this.BR,{passive:!0})}Y(){this.BR&&Ct.removeEventListener("scroll",this.BR),this.BR=void 0}}class og{constructor(t,e){this.Ca=t,this.Z=e,this.LR=!0,this.RR=null,this.ER=null}}class hg{constructor(t){this.zR=!1,this.VR=1,this.OR=t,this.NR={Ca:u(0,0),Z:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),LR:!0,RR:null,ER:null},this.GR=u(64,64),this.WR=new Uint8ClampedArray(this.GR.x*this.GR.y*this.VR)}UR(t,e){if(!t.LR)return null;if(t.RR&&t.ER){const i=this.UR(t.RR,e);return null!==i?i:this.UR(t.ER,e)}const i=c(t.Z.x,t.Z.y);if(t.Ca.x+t.Z.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.GR.x-t.Ca.x-1),t.Ca.y+t.Z.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.GR.y-t.Ca.y-1),t.Z.x===e.x&&t.Z.y===e.y)return t.LR=!1,t;if(i.xt.Z.y)),h?(s=new og(ui(t.Ca,{x:0,y:1}),u(t.Z.x,e.y)),r=new og(ui(t.Ca,{x:0,y:e.y+1}),u(t.Z.x,t.Z.y-1-e.y))):(s=new og(ui(t.Ca,{x:1,y:0}),u(e.x,t.Z.y)),r=new og(ui(t.Ca,{x:e.x+1,y:0}),u(t.Z.x-1-e.x,t.Z.y))),t.RR=s,t.ER=r,this.UR(t.RR,e)}YR(t,e){const i={HR:!1,Ca:null};let s=this.UR(this.NR,e);if(null===s)for(;null===s&&this.GR.xthis.OR||t.y>this.OR)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.VR);for(let i=0;i{this.KR.sE(t)})),this.JR.clear(),this}eE(t,e){const i=this.QR.get(e);if(i)return i.get(t)}hE(t,e,i){let s=this.QR.get(e);if(s||(s=new Map,this.QR.set(e,s)),s.has(t.glyph))return lg.Success;const r=this.qR.YR(i,t.size);if(!r||!r.Ca)return lg.Fail;r.HR&&this.rE();const n=this.qR.jR(r.ZR);if(!n)return lg.Fail;let o=this.JR.get(r.ZR);if(!o){const t=this.KR.gl.createTexture();if(!t)throw new At("Failed to create texture for font!");o=t,this.JR.set(r.ZR,t)}const h=r.Ca,a=n.GR.x,l=n.GR.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,y=(h.y+t.size.y)/l,m=(h.x+t.size.x)/a,p=h.y/l,A=[g,y,m,y,g,p,g,p,m,y,m,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.ZR,texture:o};s.set(t.glyph,S);const v=this.KR.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.GR.x,n.GR.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.KR.nE?n.WR:new Uint8Array(n.WR)),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.HR?lg.Resize:lg.Success}rE(){this.QR.forEach((t=>{t.forEach(((e,i)=>{const s=this.qR.jR(e.packerId);if(!s)return;const r=e.origin,n=s.GR.x,o=s.GR.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 dg=t=>{if(t instanceof zi||t instanceof _c)return t._i()?"linear-highPrecision":"linear";if(t instanceof _i){const e={};return t.x instanceof Ti&&(e.x={base:t.x.gi()}),t.y instanceof Ti&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},fg=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},gg=(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.xv(),max:e.Sv()}:void 0,yg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),mg=t=>(e,i)=>i%2?e:e+t;class pg{constructor(t){this.oE=new Map,this.aE=fe("font"),this.lE=new Map,this.uE=new Set,this.KR=t}iE(t=!1){return(t||0===this.uE.size)&&(this.oE.forEach(((t,e)=>{t.iE(),this.oE.delete(e)})),this.uE.clear()),this}cE(t){this.uE.add(t)}dE(t){this.uE.delete(t)}fE(t,e,i,s){const r=Ct.devicePixelRatio,n=`${s?"dark":"light"} - ${wr(e,r).id}`,o=this.lE.get(n),h=this.oE.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 y=!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:m.x,y:m.y,isEstimate:y}}AE(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.lE.get(s);r||(r=this.aE(),this.oE.set(r,new cg(this.KR)),this.lE.set(s,r));const n=this.oE.get(r);if(!n)throw new At("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.va.u=!0})),t=-1,d=0,h=0,o=0,c.clear(),this.KR.cs.Ms(!0);continue}if(l===lg.Fail)throw new At("Failed to create glyph");if(a=n.eE(s,f),!a)throw new At("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(mg(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=y(u(0,o),u(a,h)),m=[];return c.forEach(((t,e)=>{m.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[m,g]}}class Ag{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>xg(t)));for(const i of e)t=i(t);return`${Se(this.modifiers.filter((t=>Sg(t)))).map((t=>t.pE)).join("\n")}\n${t}`}}const xg=t=>"function"==typeof t,Sg=t=>t&&"object"==typeof t&&"yE"in t,vg=(...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},bg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Mg=(...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},Tg=(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},Rg=(...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},wg=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=vg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=vg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Rg(`\t${r} = ${s};`)(i)},kg=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Eg={roundUnsigned:{yE:"roundUnsigned",pE:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{yE:"linearStep",pE:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{yE:"decodeUbyteRGBAEncodedFloat",pE:"\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:{yE:"texelFetchWithFallback",pE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{yE:"texelFetchWithFallback",pE:"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:{yE:"texelFetchUnsignedWithFallback",pE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{yE:"texelFetchUnsignedWithFallback",pE:"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:{yE:"modulus",pE:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{yE:"computeScreenSpaceWireframe",pE:"#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}"}},Ig=(t,e)=>{const i=e.steps,s=i.length-1,r=[vg("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(Tg("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},Fg=[vg("uniform sampler2D uMaskTexture"),vg("varying vec2 vMaskTextureCoord"),Tg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Dg=[vg("uniform sampler2D uMaskTexture"),vg("varying vec2 vMaskTextureCoord"),Tg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],Bg=[vg("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;"),Tg("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)")];class Pg 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 Lg=(...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},Vg=t=>void 0!==t.find((t=>{var e;return null===(e=t.mE)||void 0===e?void 0:e.vE})),zg=t=>void 0!==t.find((t=>{var e;return null===(e=t.mE)||void 0===e?void 0:e.SE})),_g=(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(vg("attribute vec3 aNormal"),Mg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(Mg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(Mg(`${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(Mg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),Mg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(Mg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),Mg(`${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(vg("attribute float aRotDeg"),vg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(Mg(`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(vg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(Mg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(vg(`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(vg(`${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(vg(`${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(vg(`${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(vg(`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(vg(`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(vg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(vg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(vg(`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(${wi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(vg(...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(vg("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(vg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(vg(`${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(vg("uniform vec2 uRatioPxClip")),s.push(vg("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(vg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(vg(`${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(vg(`${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(vg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(vg(`${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(vg("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(Cg("gl_Position =",...f)),s},Ng=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(Tg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(Tg(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(Tg(i,...t))}}return r},Og=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.mE)||void 0===e?void 0:e.xE})))(t)?[bg("attribute vec4 aColor"),bg("vColor = aColor"),vg("attribute vec4 aColorA"),vg("attribute vec4 aColorB"),Rg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],Ug=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.mE)||void 0===e?void 0:e.bE})))(t)?[bg("attribute float aLookupValue"),bg("vLookupValue = aLookupValue"),vg("attribute float aLookupValueA"),vg("attribute float aLookupValueB"),Rg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],Yg={"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",mE:{vE:!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:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[vg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Rg(`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",mE:{SE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,bE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,xE:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${Lg(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(vg("uniform vec4 uColor"),Tg("colorFragment =","colorFragment = uColor"),...s?Fg:[],...r?Dg:[]);else if("attribute"===i)a="colorAttribute",u.push(wg("attribute vec4 aColor","varying vec4 vColor")),d.push(vg("varying vec4 vColor"),Tg("colorFragment =","colorFragment = vColor"),...s?Fg:[],...r?Dg:[]);else if("texture"===i)a="colorTexCoord",u.push(wg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(vg("varying vec2 vTextureCoord"),vg("uniform sampler2D uColorTexture"),vg("uniform vec4 uColor"),Tg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Fg:[],...r?Dg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(vg("attribute vec2 aTextureCoord"),vg("varying vec2 vTextureCoord"),Rg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(vg("varying vec2 vTextureCoord"),vg("uniform sampler2D uColorTexture"),Mg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(wg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(vg("uniform sampler2D uColorTexture"),vg("varying vec2 vTextureCoord"),Tg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(vg("uniform sampler2D uColorTexture"),vg("varying vec2 vTextureCoord"),vg("uniform vec4 uColor"),Tg("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(wg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(wg(e,"varying float vLookupValue"))}d.push(vg("varying float vLookupValue"),...Ig("vLookupValue",i[2]),...s?Fg:[],...r?Dg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();tt(t)?(l=`rgradient${e.length},${r},${s}`,d.push(vg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),vg(...Dt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Eg.linearStep,Tg("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?Fg:[],...r?Dg:[])):st(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(vg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),vg(...Dt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Eg.linearStep,Tg("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?Fg:[],...r?Dg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(wg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(vg("uniform float uOpacity"),Tg("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:${Lg(t)}`;return{idFeature:"ColorShaded3D",mE:{SE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,bE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&wg("normal","varying vec3 vNormal"),wg("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(vg("uniform vec4 uColorDiffuse"),Tg("colorFragment =","colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(wg("attribute vec4 aColor","varying vec4 vColor")),a.push(vg("varying vec4 vColor"),Tg("colorFragment =","colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(wg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(wg(e,"varying float vLookupValue"))}a.push(vg("varying float vLookupValue"),...Ig("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(wg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(vg("varying vec3 vTriangleBary"),vg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Eg.computeScreenSpaceWireframe,Tg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Bg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Vg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(vg(`attribute ${r} aPos`)):i.push(vg("attribute float aPosX"),vg("attribute float aPosY"),s&&vg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(vg("attribute float aPos_highpartX"),vg("attribute float aPos_lowpartX"),vg("attribute float aPos_highpartY"),vg("attribute float aPos_lowpartY")):i.push(vg(`attribute ${r} aPos_highpart`),vg(`attribute ${r} aPos_lowpart`)),i.push(..._g(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(vg("attribute vec3 aGeoPos"),vg("uniform mat4 uModelRotation"),vg("uniform mat4 uModelRotationNormals"),vg("uniform vec3 uLocationAxis"),vg("uniform vec3 uModelAlignment"),vg("uniform vec3 uModelScale"),vg("uniform vec3 uModelSize"),..._g({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Cg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&Tg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...zg(e)?Ng({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${Lg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[vg("uniform float uThicknessPixels"),vg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[vg("attribute vec2 aLocationA"),vg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[vg("attribute vec2 aLocationA_highpart"),vg("attribute vec2 aLocationB_highpart"),vg("attribute vec2 aLocationA_lowpart"),vg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[vg("attribute float aLocationAX"),vg("attribute float aLocationAY"),vg("attribute float aLocationBX"),vg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[vg("attribute float aLocationA_highpartX"),vg("attribute float aLocationA_highpartY"),vg("attribute float aLocationB_highpartX"),vg("attribute float aLocationB_highpartY"),vg("attribute float aLocationA_lowpartX"),vg("attribute float aLocationA_lowpartY"),vg("attribute float aLocationB_lowpartX"),vg("attribute float aLocationB_lowpartY")]:[],vg("attribute vec2 aSegmentPosition"),vg("attribute float aSegmentSide"),..._g(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&vg("uniform vec2 uMinSegmentPixelVector"),Tg("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"),...Ug(e),...Og(e),...zg(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[vg("attribute vec2 aLocationA"),vg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[vg("attribute vec2 aLocationA_highpart"),vg("attribute vec2 aLocationB_highpart"),vg("attribute vec2 aLocationA_lowpart"),vg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[vg("attribute float aLocationAX"),vg("attribute float aLocationAY"),vg("attribute float aLocationBX"),vg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[vg("attribute float aLocationA_highpartX"),vg("attribute float aLocationA_highpartY"),vg("attribute float aLocationB_highpartX"),vg("attribute float aLocationB_highpartY"),vg("attribute float aLocationA_lowpartX"),vg("attribute float aLocationA_lowpartY"),vg("attribute float aLocationB_lowpartX"),vg("attribute float aLocationB_lowpartY")]:[],vg("attribute float aCurveOrBaseline"),vg("attribute float aSegmentSide"),..._g(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Tg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...Ug(e),...Og(e),...zg(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${Lg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[vg("uniform float uOffsetWU"),vg("attribute vec3 aLocationA"),vg("attribute vec3 aLocationB"),vg("attribute float aSegmentPosition"),vg("attribute float aPerpendHorizontal"),vg("attribute float aPerpendVertical"),..._g({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Vg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Tg("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"),...zg(e)?Ng({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[vg("attribute vec3 aEdge"),vg("uniform float uEdgeRoundness"),Tg("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:${Lg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[vg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Eg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?Mg("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"})`):Mg("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})`)),...Ig("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(vg("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&&Eg.roundUnsigned,Eg.modulus,Eg.texelFetchWithFallback[h],"ubyte"===r&&Eg.decodeUbyteRGBAEncodedFloat,Mg(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(vg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),Mg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${Lg(t)}`,idFragment:`DrawToNormalTexture:${Lg(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",mE:{ME:!0},apply:(u,c)=>{const d=[],f=[];return d.push(vg("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture"),Eg.modulus,Eg.texelFetchWithFallback[c],"ubyte"===h&&Eg.decodeUbyteRGBAEncodedFloat,Mg("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(..._g({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(wg("posWorld","varying vec3 vPosWorld"),..."uint"===o?[Eg.texelFetchUnsignedWithFallback[c],Rg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Rg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Rg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),vg("varying vec3 vNormal",..."uint"===o?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(vg("varying vec3 vTriangleBary")),"uniform"===e?f.push(vg("uniform vec4 uColorDiffuse"),Tg("colorFragment =","colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]&&("value"===e[1]?(d.push(wg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(vg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===a&&Eg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?Mg("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"})`):Mg("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"),...Ig("intensityP",e[2]))):(d.push(wg(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(vg("varying float vLookupValue"),...Ig("vLookupValue",e[2])))),"phong"===r&&f.push(...Bg),n&&(d.push(vg("attribute vec3 aTriangleBary"),wg("aTriangleBary","varying vec3 vTriangleBary")),f.push(vg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Eg.computeScreenSpaceWireframe,Tg("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:${Lg(t)}`,idFragment:`SurfaceGrid:${Lg(t)}`,vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${Lg(t)}`,idFragment:`DebugSurfaceGridNormals:${Lg(t)}`,vertexShaderModifiers:[vg("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"]),Eg.roundUnsigned,Eg.modulus,Eg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Eg.decodeUbyteRGBAEncodedFloat,Mg(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?[Eg.texelFetchUnsignedWithFallback[i]]:[],..._g({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),Tg("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:[Rg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[vg("uniform vec3 uCameraLoc"),Tg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[vg("attribute float aSegmentInside"),vg("varying float vSegmentInside"),vg("varying float vSegmentSide"),Tg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[kg("#extension GL_OES_standard_derivatives : enable"),vg("uniform float uAALimit"),vg("varying float vSegmentInside"),vg("varying float vSegmentSide"),Tg("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:${Lg(t)}`,idFragment:`Glow1D:${Lg(t)}`,vertexShaderModifiers:[wg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[vg("uniform sampler2D uTexture"),vg("varying vec2 vTextureCoord"),vg("uniform vec2 uTextureSize"),r&&vg("uniform vec2 uOffsetPx"),!r&&vg("uniform sampler2D uTextureFirstGlowPass"),!r&&vg("uniform vec4 uGlowColor"),Tg("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",mE:{ME:r,_E:i},apply:(n,o)=>{const h="webgl2"===o?"flat":"",a="webgl2"===o?"int":"float";return{idVertex:`MousePicking:${Lg(t)}`,idFragment:`MousePicking:${Lg(t)}`,vertexShaderModifiers:[...r?[vg(`${h} varying ${a} vPickingIdOffset`),Rg(`vPickingIdOffset = ${a}(iInstance)`)]:[],...i?[vg(`${h} varying ${a} vPickingIdOffset`),Rg(`vPickingIdOffset = ${a}(iVertex)`)]:[],...s?[vg("attribute float aPickingIdOffset",`${h} varying ${a} vPickingIdOffset`),Rg(`vPickingIdOffset = ${a}(aPickingIdOffset)`)]:[]],fragmentShaderModifiers:[vg("uniform int uFirstId"),...e?[]:[vg(`${h} varying ${a} vPickingIdOffset`),Mg("int mousePickingIdOffset = "+("int"===a?"vPickingIdOffset":"int(floor(vPickingIdOffset + 0.5))"))],Tg("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:[wg("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:[vg("attribute vec2 aLengthSoFar"),vg("varying float vLengthSoFar"),vg("uniform vec2 uStippleCount"),Rg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[vg("uniform sampler2D uStippleTexture"),vg("uniform float uStippleScale"),vg("varying float vLengthSoFar"),"webgl1"===e&&vg("uniform float uStippleTextureWidthLimiter"),Tg("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:[vg("attribute vec2 aLengthSoFarA"),vg("attribute vec2 aLengthSoFarB"),vg("varying float vLengthSoFar"),vg("uniform vec2 uStippleCount"),Rg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[vg("uniform sampler2D uStippleTexture"),vg("uniform float uStippleScale"),vg("varying float vLengthSoFar"),"webgl1"===e&&vg("uniform float uStippleTextureWidthLimiter"),Tg("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:${Lg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[vg("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"),Eg.texelFetchWithFallback[i],"ubyte"===h&&Eg.decodeUbyteRGBAEncodedFloat,Mg("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&&Tg("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&&Tg("colorFragment =","colorFragment = uColor"),r&&Tg("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?Ig("intensityP",r.lut):[]]}}})},Gg={"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"},Hg={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 Wg{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new xt(`Could not find ${this.wE()} ${this.CE()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}wE(){return this.id.toString()}CE(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Kg extends Wg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class Xg extends Wg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class jg{constructor(t,e,i,s){this.kE=new Map,this.TE=new Map,this.FE=i,this.IE=i.createProgram(),this.PE=`${t.wE()} vertex`,this.DE=`${e.wE()} fragment`,i.attachShader(this.IE,t.shader),i.attachShader(this.IE,e.shader),i.bindAttribLocation(this.IE,0,"aPos"),i.linkProgram(this.IE),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""}BE(t){return pe(0,(()=>Ae()))}LE(t){const e=this.RE(t);if(void 0===e)throw this.BE(`Could not get ${t} uniform from ${this.PE} and ${this.DE} shaders.`);return e}RE(t){const e=this.kE.get(t);if(e)return e;const i=this.FE.getUniformLocation(this.IE,t);return i?(this.kE.set(t,i),i):void 0}EE(t){const e=this.zE(t);if(void 0===e)throw this.BE(`Could not get ${t} attribute from ${this.PE} and ${this.DE} shaders.`);return e}zE(t){const e=this.TE.get(t);if(e||0===e)return e;const i=this.FE.getAttribLocation(this.IE,t);return i>=0?(this.TE.set(t,i),i):void 0}Y(){this.FE.deleteProgram(this.IE)}}const $g=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,Zg=t=>{let e;try{e=Ct.getComputedStyle(t)}catch(t){return null}return e};function Qg(t){const e=Zg(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=Zg(ey(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||!!$g.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function qg(t){let e=t.length;for(;e--;)if(Qg(t[e]))return t[e];return null}function Jg(t){var e;return t&&Number((null===(e=Zg(t))||void 0===e?void 0:e.zIndex)||0)||0}function ty(t){const e=[];for(;t;)e.push(t),t=ey(t);return e}function ey(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}const iy=t=>t&&"resize"in t;class sy extends ng{constructor(t){if(super(),this.VE=new Map,this.OE=new Map,this.NE=new Map,this.GE=!0,this.WE=null,this.UE=null,this.YE=null,this.HE=null,this.$E=0,this.XE=0,this.jE=0,this.ZE=!1,this.QE=!0,this.ji=!1,this.JE=fe(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.Z={x:100,y:100},this.KE=()=>{this.qE&&clearTimeout(this.qE),this.qE=setTimeout((()=>this.rn()),12)},this.tz=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.VE.get(i);if(t){const s=t.iz();t.sz(e),e?this.OE.set(i,t):this.OE.delete(i),s!==e&&t.Ms()}}},this.ez=(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.UE.IE),o.clear(o.COLOR_BUFFER_BIT),n.Jr.getBoundingClientRect()){const t=n.hz();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.rz),o.uniform1i(this.$E,0),o.uniformMatrix4fv(this.XE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.YE),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.jE,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.nz&&(n.nz.clearRect(0,0,n.nz.canvas.width,n.nz.canvas.height),n.nz.drawImage(this.oz,0,this.oz.height-t.y,t.x,t.y,0,0,n.nz.canvas.width,n.nz.canvas.height))}},this.az=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.UE.IE),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Jr.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.lz-t*this.lz,a*this.lz+e*this.lz,i*this.lz,o*this.lz)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.rz),n.uniform1i(this.$E,0),n.uniformMatrix4fv(this.XE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.YE),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.jE,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.uz=(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.hz();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.cz[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.oz.height-h.y,h.x,this.oz.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.nz&&(n.nz.clearRect(0,0,n.nz.canvas.width,n.nz.canvas.height),n.nz.drawImage(this.oz,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.dz=(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.Jr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.hz();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.cz[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.lz-t*this.lz,l*this.lz+e*this.lz,(a-t+o)*this.lz,(l+e+h)*this.lz,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.qE=void 0,this.Kn=t,!Ct.requestAnimationFrame||!Ct.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.fz)e=!0===t.fz?Ct.devicePixelRatio||1:t.fz||1;else{const t=Ct.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=Ct.devicePixelRatio||1)}this.lz=e,t.io=!0===t.io,this.QE=!1!==t.Az,this.gz=!1!==t.pz,this.yz=t.yz||!1;let i=!1;if(t.oz)if("string"==typeof t.oz){const e=Ct.document.getElementById(t.oz);if(!e)throw new Error(`Canvas "${t.oz}" doesn't exist.`);this.oz=e,i=!0}else this.oz=t.oz,i=!0;else this.oz=Ct.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.mz&&t.mz){const e=this.oz.getContext("webgl",{...s,antialias:!!t.Az})||this.oz.getContext("experimental-webgl",{...s,antialias:!!t.Az});this.gl=e,this.vz=!1}else{const t=this.oz.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.vz=!0}if(!this.gl)throw new At("No WebGL context available."+((null==t?void 0:t.mz)?`\nSelected explicit target: WebGL ${t.mz}`:""));const r=[];if(this.Sz={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.Sz).forEach((t=>{null===this.Sz[t]&&r.push(t)})),this.vz)this.xz=!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.GE=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.xz=!!e.OES_texture_float,this.gl1={ctx:this.gl,Sz:t,optional:e}}const n=r;if(n.length>0&&!1!==t.io){const t=Ct.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=Ct.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),Ct.document.body.appendChild(t),t.appendChild(e),Ct.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.bz=this.yz?this.Mz(this.vz?this.uz.bind(this):this.ez.bind(this)).bind(this):this._z(this.vz?this.dz.bind(this):this.az.bind(this)).bind(this),Ct.ResizeObserver){const t=t=>{for(const e of t)e.target===this.oz&&this.wz()};this.ro=new Ct.ResizeObserver(t.bind(this)),this.ro.observe(this.oz)}if(this.Cz=((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,y,m,p;try{const e=Ct.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 Pg(`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 Pg(`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.mE)||void 0===e?void 0:e.ME}))&&("webgl1"===e?l.push(vg("attribute float aInstanceID"),Mg("int iInstance = int(aInstanceID)")):l.push(Mg("int iInstance = gl_InstanceID"))),!!t.find((t=>{var e;return null===(e=t.mE)||void 0===e?void 0:e._E}))&&("webgl1"===e?l.push(vg("attribute float aVertexID"),Mg("int iVertex = int(aVertexID)")):l.push(Mg("int iVertex = gl_VertexID"))),!o)throw new Pg("No vertex shader template defined",n);if(!u)throw new Pg("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,y=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 Ag(u.vertexShader.modifiers).build(Gg[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,m=r,S=new Kg(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)y=b.src,f="existing";else{f="new";const t=Hg[v.template],e=new Ag([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);y=s,p=n,b=new Xg(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const C=new jg(S,b,i,u);return n.set(u.id,C),o.programs+=1,o.totalMs+=Ct.performance.now()-e,C}catch(t){throw pe(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 Ct.alert(t),new Error(t)}))}}})(this.gl,!this.vz),this.gE=(()=>{const t=Ct.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new At("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,y=0;const m=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),Ct.addEventListener("resize",this.KE,{passive:!0}),!this.vz){if(this.UE=this.Cz(Yg["2DCompose"],Yg.Color({dataType:"texture-coord-calc-gpu"}),Yg.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.UE.IE)throw new At("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.UE.IE,"uColorTexture");if(!e)throw new At("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.UE.IE,"uMatrix");if(!i)throw new At("Unable to setup composition shader! Failed to find uMatrix");this.$E=e,this.XE=i,this.jE=t.getAttribLocation(this.UE.IE,"aPos"),this.YE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.YE),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.HE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.HE),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)}}Mz(t){return e=>{this.WE=null;const i=this.gl.canvas,s=Array.from(this.OE.values());this.ZE=!1,s.forEach((s=>{const r=s.hz();(this.Z.x{this.WE=null,"style"in this.gl.canvas&&!this.Kn.Pz&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.oz.clientHeight,r=this.oz.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.lz&&i.height===s*this.lz||(i.width=r*this.lz,i.height=s*this.lz);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.OE.values());this.ZE=!1,h.sort(((t,e)=>t.Dz()-e.Dz())).forEach((t=>{t.An&&t.Iz(e)})),t(n,o,r,s,h),this.ZE&&this.wz()}}wz(t){return iy(this.gl)||(!this.ZE&&t&&(this.ZE=!0),this.WE||this.ji||(this.WE=Ct.requestAnimationFrame(this.bz))),this}Bz(t){const e=this.JE();return t.Jr.setAttribute("data-lcjs-engine-id",e),this.VE.set(e,t),t.Lz(this.VE.size-1),t.sz(!0),this.OE.set(e,t),this.Fz&&this.Fz.observe(t.Jr),this.qE&&clearTimeout(this.qE),this.qE=setTimeout((()=>this.rn()),0),this}Rz(t){const e=t.Jr.getAttribute("data-lcjs-engine-id");return e?(this.VE.delete(e),this.OE.delete(e),this.Fz&&this.Fz.unobserve(t.Jr),t.Jr.removeAttribute("data-lcjs-engine-id"),this):this}rn(){if(this.Fz){const t=this.Fz.takeRecords();for(let e=0;efunction(t,e){if(t===e)return 0;const i={a:ty(t),b:ty(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=Jg(qg(i.a)),n=Jg(qg(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.Jr,e.Jr))).forEach(((t,e)=>t.Lz(e))),this.wz(!0),this}BI(){return this.wz(),this}Ez(){this.ji||this.VE.forEach((t=>t.fp.layout()))}Y(){var t;if(this.ji)return;this.ji=!0,super.Y(),this.WE&&(Ct.cancelAnimationFrame(this.WE),this.WE=null),this.ZE=!1,this.ro&&(this.ro.disconnect(),this.ro=void 0),this.Fz&&(this.Fz.disconnect(),this.Fz=void 0),Ct.removeEventListener("resize",this.KE),this.KE=void 0,this.VE.forEach((t=>{t.Y()})),this.VE.clear(),Array.from(this.NE.values()).forEach((t=>{t.iE(!0)})),this.NE.clear();const e=this.gl;e.deleteBuffer(this.YE),e.deleteBuffer(this.HE),this.oz&&!this.Kn.oz?(this.oz.width=1,this.oz.height=1,null===(t=this.oz.parentElement)||void 0===t||t.removeChild(this.oz),this.oz=void 0):this.oz=void 0,this.Cz=void 0,this.gE=void 0,this.bz=()=>{},this.Sz.WEBGL_lose_context&&this.Sz.WEBGL_lose_context.loseContext()}}const ry=(t,e,i,s)=>r=>{const n={theme:ig,...i,...r},o=t(n),h=e||s?sg(o,s):void 0,a=new bf(o.Kn,r,o,o.Y.bind(o),h);return o.So((t=>a.qL(t))).vo((()=>a.J())).Ms(),a},ny=(t,e)=>{t.So((t=>{e.Re(t)})).vo((()=>e.J())).Ms()},oy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new ra(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h);return ny(o,a),a},hy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Tc(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,r);return ny(o,a),a},ay=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Rd(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,r);return ny(o,a),a},ly=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Nc(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,r);return ny(o,a),a},uy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new(r&&r.type?r.type:Ga)(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0,r);return ny(o,a),a},cy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new yf(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0,r);return ny(o,a),a},dy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new(r&&r.type?r.type:Qc)(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0,r);return ny(o,a),a},fy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new(r&&r.type?r.type:ud)(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0,r);return ny(o,a),a},gy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Vl(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,r,void 0);return ny(o,a),a},yy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Tl(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0,r);return ny(o,a),a},my=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new qd(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0);return ny(o,a),a},py=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new uf(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,void 0,r);return ny(o,a),a},Ay=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Fc(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,r);return ny(o,a),a},xy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||ig},o=t(n),h=e||s?sg(o,s):void 0,a=new Uf(o.Kn,kd(o,1).HF(0),lt,o.Y.bind(o),h,r);return ny(o,a),a},Sy={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)=>Sy.multiply(t,Sy.translation(e,i,s)),xRotate:(t,e)=>Sy.multiply(t,Sy.xRotation(e)),yRotate:(t,e)=>Sy.multiply(t,Sy.yRotation(e)),zRotate:(t,e)=>Sy.multiply(t,Sy.zRotation(e)),rotateXYZ(t,e){let i=Sy.xRotate(t,e.x);return i=Sy.yRotate(i,e.y),i=Sy.zRotate(i,e.z),i},scale:(t,e,i,s)=>Sy.multiply(t,Sy.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],y=e[13],m=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],R=t[8],w=t[9],k=t[10],E=t[11],I=t[12],F=t[13],D=t[14],B=t[15],P=[];return P[0]=i*A+s*b+r*R+n*I,P[1]=i*x+s*M+r*w+n*F,P[2]=i*S+s*C+r*k+n*D,P[3]=i*v+s*T+r*E+n*B,P[4]=o*A+h*b+a*R+l*I,P[5]=o*x+h*M+a*w+l*F,P[6]=o*S+h*C+a*k+l*D,P[7]=o*v+h*T+a*E+l*B,P[8]=u*A+c*b+d*R+f*I,P[9]=u*x+c*M+d*w+f*F,P[10]=u*S+c*C+d*k+f*D,P[11]=u*v+c*T+d*E+f*B,P[12]=g*A+y*b+m*R+p*I,P[13]=g*x+y*M+m*w+p*F,P[14]=g*S+y*C+m*k+p*D,P[15]=g*v+y*T+m*E+p*B,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],y=t[13],m=t[14],p=t[15],A=d*p,x=m*f,S=a*p,v=m*l,b=a*f,M=d*l,C=r*p,T=m*n,R=r*f,w=d*n,k=r*l,E=a*n,I=u*y,F=g*c,D=o*y,B=g*h,P=o*c,L=u*h,V=i*y,z=g*s,_=i*c,N=u*s,O=i*h,U=o*s,Y=A*h+v*c+b*y-(x*h+S*c+M*y),G=x*s+C*c+w*y-(A*s+T*c+R*y),H=S*s+T*h+k*y-(v*s+C*h+E*y),W=M*s+R*h+E*c-(b*s+w*h+k*c),K=1/(i*Y+o*G+u*H+g*W);return e[0]=K*Y,e[1]=K*G,e[2]=K*H,e[3]=K*W,e[4]=K*(x*o+S*u+M*g-(A*o+v*u+b*g)),e[5]=K*(A*i+T*u+R*g-(x*i+C*u+w*g)),e[6]=K*(v*i+C*o+E*g-(S*i+T*o+k*g)),e[7]=K*(b*i+w*o+k*u-(M*i+R*o+E*u)),e[8]=K*(I*l+B*f+P*p-(F*l+D*f+L*p)),e[9]=K*(F*n+V*f+N*p-(I*n+z*f+_*p)),e[10]=K*(D*n+z*l+O*p-(B*n+V*l+U*p)),e[11]=K*(L*n+_*l+U*f-(P*n+N*l+O*f)),e[12]=K*(D*d+L*m+F*a-(P*m+I*a+B*d)),e[13]=K*(_*m+I*r+z*d-(V*d+N*m+F*r)),e[14]=K*(V*a+U*m+B*r-(O*m+D*r+z*a)),e[15]=K*(O*d+P*r+N*a-(_*a+U*d+L*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,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(n-r),-(n+r)/(n-r),0,0,0,1]};function vy(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,y=d*s.y,m=c-g,p=d-y,A=g>m?[m,g]:[g,m],x=y>p?[p,y]:[y,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 by(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 My{constructor(t){this.KR=t}}class Cy{constructor(){this.zz=new Array,this.Vz=t=>(this.zz.push(t),t),this.Oz=this.Vz(new Map),this.Nz=this.Vz(new Map),this.Gz=this.Vz(new Map),this.Wz=this.Vz(new Map),this.Uz=this.Vz(new Map),this.Yz=this.Vz(new Map),this.$z=this.Vz(new Map),this.Xz=this.Vz(new Map)}jz(){this.zz.forEach((t=>{t.forEach((t=>t.jz())),t.clear()}))}}const Ty=(t,e,i)=>()=>{t.Zz=e,i&&i()},Ry=(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,y=0,m=1;switch(n){case e.ImageFitMode.Fill:u{this.tV=!0,this.rV()})),this.dc.addEventListener("error",(()=>{this.iV=!0})),this.dc.complete&&(this.tV=!0,this.rV());else if(this.dc instanceof Ct.HTMLVideoElement){const t=this;this.dc.addEventListener("canplay",(function(){t.Jz=this.videoHeight,t.Qz=this.videoWidth,t.tV=!0,t.rV()}),!0),this.dc.addEventListener("play",Ty(this,!0,(()=>this.rV()))),this.dc.addEventListener("playing",Ty(this,!0,(()=>this.rV()))),this.dc.addEventListener("pause",Ty(this,!1)),this.dc.addEventListener("ended",Ty(this,!1)),this.dc.readyState>=1&&(this.Qz=this.dc.videoWidth,this.Jz=this.dc.videoHeight,this.Zz=!this.dc.paused,this.tV=!0,this.rV())}else this.tV=!0,this.rV()}cE(t){0===this.eV.size&&this.tV&&this.rV(),this.eV.add(t)}dE(t){this.eV.delete(t),0===this.eV.size&&this.unbindResources()}nV(t){this.sV.add(t),this.qz&&(t(),this.oV(t))}oV(t){this.sV.delete(t)}rV(){if(this.iV||this.qz||!this.tV)return;const t=this.FE.gl;if(!this.hV&&this.dc&&t){this.hV=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.hV),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.dc,o=this.Qz>0?this.Qz:n.width,h=this.Jz>0?this.Jz: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.Qz=o,this.Jz=h,t.bindTexture(t.TEXTURE_2D,null)}this.qz=!0,this.sV&&this.sV.forEach((t=>{t(),this.oV(t)}))}zs(){const t=this.FE.gl;if(!this.iV&&this.qz&&this.hV){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.dc;n&&(t.bindTexture(t.TEXTURE_2D,this.hV),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}aV(){return this.hV}unbindResources(){return this.qz&&(this.hV&&(this.FE.sE(this.hV),this.hV=null),this.qz=!1),this}}class ky extends Qr{constructor(t,e,i){super(t.cs,e,i),this.cv=!0,this.ev={},this.av=p(Qn),this.Bs=t,this.At=t.At}lV(){var t;return this.av.u&&this.av.C().type!==(null===(t=this.uV)||void 0===t?void 0:t.type)}mv(t){return this.cv=t,this}cV(t){return this.ev=t,this}}class Ey{constructor(t){this.VV=[],this.KR=t}OV(t,e){((t,e,i,s)=>{const r=t.dV(),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.fV(),l=t.AV(),u=t.gV(),c=t.pV(),d=t.yV();t.mV("disabled"),t.mv(!1),t.vV(!1);const f=e.SV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.dV(),o=t.xV();t.bV(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.MV(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof Jr?s=e.Yi||e.Bs.Bp():e instanceof ky&&(s=e.Bs.Ax()),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._V(e*n,r*n,o*n,h*n)}else t.vV(!1);e.qL(2,0)})),t.bV(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.vV(!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 y=f;const m=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iYe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=ei(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Jr||t instanceof ky?t.Bs.wV(t):Ne;if(xe(e))return Ne;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?Ne:r})).filter((t=>!xe(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=fi(t.min,s),i=fi(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.CV(o),vertexCount:n}})(t,s,{left:m+(h.x<0?-h.x:0),top:m+(h.y>0?h.y:0),right:m+(h.x>0?h.x:0),bottom:m+(h.y<0?-h.y:0)},e.kV()),A=e.SV(f,y),x=t.Cz(Yg["2D"],Yg.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),Yg.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.xV();t.bV(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.MV(0,0,i.sizeDpr.x,i.sizeDpr.y),t.TV(s,((h,a,l,u)=>(t.cE(s),n&&n(h),t.DV(h("uIsHighlighted"),0).PR(h("uHighlightColorOffset"),k).DV(h("uRenderEffectMask"),0).PV(h("uTexture"),e.texture,0).IV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).IV(h("uScale"),i.uniforms.BV()).IV(h("uDisp"),i.uniforms.LV()).IV(h("uScaling"),[i.size.x,i.size.y]).IV(h("uTranslationAxis"),[0,0]).FV(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).qy(o.TRIANGLES,r.vertexCount,0),!0))),t.bV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,y,A,x,p,((e,i,s,r)=>(t.IV(e("uOffsetPx"),[h.x,h.y]),!0))),y=A,t.vV(l),t.RV(d);const S=t.Cz(Yg["2D"],Yg.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),Yg.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.MV(0,0,o.x*t.dV(),o.y*t.dV());const h=lt.d2({scaleXYConstructor:zi}).it(o).Vi(0,o.x).Oi(0,o.y),a=new Dy;a.EV(h),t.TV(i,((h,l,u,c)=>(t.cE(i),r&&r(h),t.DV(h("uIsHighlighted"),0).PR(h("uHighlightColorOffset"),k).DV(h("uRenderEffectMask"),0).PV(h("uTexture"),e.texture,0).IV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).IV(h("uScale"),a.BV()).IV(h("uDisp"),a.LV()).IV(h("uScaling"),[o.x,o.y]).IV(h("uTranslationAxis"),[0,0]).FV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).qy(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.PV(e("uTextureFirstGlowPass"),A.texture,1).PR(e("uGlowColor"),i.color),!0))),t.MV(a.x,a.y,a.width,a.height),t.mV(u),t.mv(c),t.zV(p.vertexBuffer)})(this.KR,this,e,t)}kV(){const t=this.KR.cs.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}SV(...t){const e=this.VV,i=this.kV(),s={x:Math.ceil(i.x*this.KR.dV()),y:Math.ceil(i.y*this.KR.dV())},r=this.KR.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.EV(n.scale)),n;const o=r.createTexture(),h=this.KR.NV(),a=this.KR.GV();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.KR.xV();this.KR.bV(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.KR.bV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=lt.d2({scaleXYConstructor:zi}).it(i).Vi(0,i.x).Oi(0,i.y),c=new Dy;c.EV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}Y(){[this.VV].forEach((t=>{t.forEach((t=>{this.KR.WV(t.depthBuffer),this.KR.UV(t.frameBuffer),this.KR.sE(t.texture)})),t.length=0}))}}class Iy{constructor(t,i,s,r,n=!0){this.YV=new Cy,this.HV=new Map,this.$V=new Map,this.XV=[],this.fz=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(Ct.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.cv=!1,this.IV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.jV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.ZV=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.QV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.JV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.KV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.PR=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.DV=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.qV=(t,e)=>(this.gl.uniform1i(t,e),this),this.PV=(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 At("Could not bind a texture.")},this.tO=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.CV=(t,e=!1,i,s=Float32Array)=>{const r=t.length,n=this.iO(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 At("Could not create vertex buffer")},this.sO=(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 At("Could not create vertex buffer")},this.eO=(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.hO=(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.rO=(t,e)=>{const i=t.length,s=this.iO(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 At("Could not create index buffer")},this.nO=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 At("Could not create float buffer")},this.oO=(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.aO=(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.FV=(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.lO(s,e)}return this},this.uO=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.cO=(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.dO=(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.lO(t,i)),this),this.fO=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.AO=null,this.qy=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.gO=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.pO=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.Sz.ANGLE_instanced_arrays)return Ct.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.Sz.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.yO=(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.Sz.ANGLE_instanced_arrays)return Ct.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.Sz.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.lO=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.Sz.ANGLE_instanced_arrays)return Ct.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.Sz.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.mO=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=this.xV();this.bV(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.AV();o&&this.vV(!1),t(),o&&this.vV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.bV(this.gl.FRAMEBUFFER,n)},this.Ot=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.vO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.cE=t=>(this.gl.useProgram(t.IE),this),this.SO=!1,this.xO=[],this.cs=t,this.SA=i,this.cs=t,this.gl=s.ctx,this.bO=s.antialias,this.MO=!!this.cs.nn.GE&&s.lineAntialias,this.xz=this.cs.nn.xz,this._O=new Map,this.gl1=this.cs.nn.gl1,this.gl2=this.cs.nn.gl2,n&&(this.RV(!0),this.wO()),this.Sz=this.cs.nn.Sz,this.tE=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.nE=this.CO(),this.Cz=this.cs.nn.Cz,this.kO=new Py(this),this.gE=this.cs.nn.gE,this.TO=new Ey(this),this.NE=this.cs.nn.NE,this.FO=this.CV([0,0,1,0,1,1,0,1]),this.IO=this.CV([0,0,1,0,0,1,0,1,1,0,1,1])}mV(t){return t!==this.PO&&(this.PO=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}gV(){return this.PO||"disabled"}mv(t){return t!==this.cv&&(this.cv=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}pV(){return this.cv}DO(t){return this.fz=t,this}dV(){return this.fz}iO(t,e){let i;if(e){const s=this._O.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.zV(e)}return i||(i=this.gl.createBuffer(),this._O.set(i,{size:t})),i}BO(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 At("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}sE(t){this.gl.deleteTexture(t)}NV(){const t=this.gl.createFramebuffer();if(!t)throw new At("Couldn't reserve Framebuffer.");return t}bV(t,e){this.AO=e,this.gl.bindFramebuffer(t,e)}xV(){return this.AO}UV(t){this.gl.deleteFramebuffer(t)}GV(){const t=this.gl.createRenderbuffer();if(!t)throw new At("Couldn't reserve Render buffer.");return t}WV(t){this.gl.deleteRenderbuffer(t)}MV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.LO&&t===this.LO.x&&e===this.LO.y&&i===this.LO.width&&s===this.LO.height||(this.LO={x:t,y:e,width:i,height:s}),this}fV(){return this.LO||{x:0,y:0,width:0,height:0}}_V(t,e,i,s){return this.vV(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}vV(t){return t===this.RO||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.RO=t),this}RV(t){return t!==this.SO&&(this.SO=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}yV(){return this.SO}wO(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)}AV(){return void 0!==this.RO&&this.RO}TV(t,e){const i=new Ly(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}zV(t){t&&(this.gl.deleteBuffer(t),this._O.delete(t))}EO(t,e,i){this.IV(t.uniform("uCenter"),e.center).IV(t.uniform("uDistance"),e.distance).ZV(t.uniform("uBounds"),e.bounds).DV(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.UO.buffer;this.UO&&(this.zV(this.UO.buffer),this.UO=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.xO.splice(this.xO.indexOf(l),1)}))}ZO(t,e,i,s,r,n,o,h){const a=this.gl,l=this.xV();this.bV(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.bV(this.gl.FRAMEBUFFER,l)}QO(t){const e=this.$V.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new At("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.DV(s("uMinValue"),i.min),this.DV(s("uMaxValue"),i.max)}return this}iN(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.dc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.CV(o(t.texture.Qz,t.texture.Jz,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.dE(t),this.zV(i.texCoordsBuffer));const r=this.VO(h);r.cE(t);const n=s?s.getSourceMissingColor():Ps.color;e={texture:r,source:h,texCoordsBuffer:this.CV([]),sourceMissingTexture:this.BO(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.nV(e.textureReadyCallback),l(e)}return e&&e.texture.qz&&e.texture.Kz&&e.texture.Zz&&(e.texture.zs(),this.cs.Ms()),n&&e&&e.texture.qz&&l(e),e}i&&this.sN(t,i)}sN(t,e){e&&(e.texture.dE(t),e.texture.oV(e.textureReadyCallback),this.sE(e.sourceMissingTexture),this.zV(e.texCoordsBuffer))}eN(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.At,a=this.dV();this.DV(r("uIsHighlighted"),1===e||2===e?0:i.$o).PR(r("uHighlightColorOffset"),1===e||2===e?E:i.Qo).DV(r("uRenderEffectMask"),2===e?1:0).IV(n("uRatioPxClip"),[2/this.cs.oi().x,2/this.cs.oi().y]).DV(n("uDevicePixelRatio"),a),h instanceof zi||h instanceof _c?this.IV(r("uScale"),s.uniforms.BV()).IV(r("uDisp"),s.uniforms.LV()).IV(n("uScaleStart_highpart"),s.uniforms.hN()).IV(n("uScaleStart_lowpart"),s.uniforms.rN()):h instanceof _i&&this.IV(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).IV(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).IV(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).IV(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).IV(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).IV(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.dO(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.dO(o("aPosY"),s.coordsY);if(1===e)this.qV(r("uFirstId"),s.idFirst);else{if(s.fillStyleSolid&&this.PR(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.dO(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.lO(t,s.lookupValueAttribDivisor)}this.tN(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.zO(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.EO(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.lO(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.aV();this.PR(n("uColor"),s.fillStyleImage.getSurroundingColor()).PV(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).FV(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).tO(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.aV();this.PV(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).FV(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return void 0!==s.useInstanceID&&this.XO(t,s.useInstanceID),void 0!==s.useVertexID&&this.HO(t,s.useVertexID),!0}nN(t,e,i){if(t)return by(i||e.ia(),e.At,t.getAngle(!0),this.dV())}oN(t,e,i){if(t)return vy(i||e.ia(),e.At,t.getPosition(),t.getExtent(),t.getShape(),this.dV())}}const Fy=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 Ct.setTimeout(o,r)};Ct.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 Dy{EV(t){if(t instanceof zi||t instanceof _c){const e=t.mi();this.aN=e.x.scaling,this.lN=-e.x.displacement,this.uN=e.y.scaling,this.cN=-e.y.displacement,this.dN=e.x.highPrecisionOffset,this.fN=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.AN=e.y.highPrecisionOffset,this.gN=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof _i&&(this.MixedScaleXY=t.mi());return this}LV(){return[this.lN,this.cN]}BV(){return[this.aN,this.uN]}hN(){return[this.dN,this.AN]}rN(){return[this.fN,this.gN]}}class By{constructor(){this.aN=0,this.uN=0,this.pN=0,this.lN=0,this.cN=0,this.yN=0}mN(t){return this.aN=t.rt(),this.lN=t.getInnerStart()+.5*this.aN*t.nt(),this}vN(t){return this.uN=t.rt(),this.cN=t.getInnerStart()+.5*this.uN*t.nt(),this}SN(t){return this.pN=t.rt(),this.yN=t.getInnerStart()+.5*this.pN*t.nt(),this}BV(){return[this.aN,this.uN,this.pN]}LV(){return[this.lN,this.cN,this.yN]}xN(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=Sy.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Py{constructor(t){this.KR=t}qL(t,e,i,s,r,n=0){const o=this.KR,h=void 0===s;if(!(s=s||o.NV()))throw new At("Could not bind a framebuffer.");const a=o.fV(),l=o.yV();o.RV(!1),o.mO((()=>{o.MV(0,0,i.x,i.y),t()}),s,e,n),h&&o.UV(s),this.KR.vO(r),this.KR.MV(a.x,a.y,a.width,a.height),o.RV(l)}}class Ly{constructor(t,e){this.bN=[],this.MN=[],this.uniform=t=>{const e=this.shader.LE(t);return this.MN.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.RE(t);return this.MN.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.EE(t);return this.bN.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.bN)this.glUtils.uO(t.location),this.glUtils.lO(t.location,0)}}class Vy extends Jr{constructor(t,e,i,s,r){super(t,e,i,s),this._N=new Map,this.wN=t,this.CN=e,this.KR=t.kN(),this.TN=r,this.CN=e}iE(){return this}qL(t,e){if(!this.TN||0!==t||0===this._N.size)return{};const i=Array.from(this._N.values()).map((t=>t.FN.filter((t=>t.IN)).map((t=>t.ss)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===i.length)return{};const s=this.TN;return this.KR.TO.OV(i,s),{}}PN(t,e,i,s,r){return{}}zs(){return this}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Tl(){return 0}Fl(){return 0}rs(t,e){const i={FN:[]},s=(t,e)=>{const s={ss:t||[],IN:void 0===e||e};i.FN.push(s);const r={gs:t=>(s.ss=t,r),bs:t=>(s.IN=t,r),_s:()=>s.IN};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={kg:s,...r};this._N.set(t,i);const o=t.onDispose((()=>{this._N.delete(t),t.offDispose(o)}));return n}}function zy(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 _y=(t,e,i)=>((t,e,i)=>{const s=[];let r=0;const n=li(e,i/2);let o,h,a,l,c=t[t.length-1],d=0;for(let i=0;i0&&(c=t[i-1]),Tt(o,c)&&(c=ui(o,oi(li(ci(h,o),-1)))),Tt(o,h)&&(h=ui(o,oi(li(ci(c,o),-1))));const f=fi(c,e),g=fi(o,e),y=fi(h,e),m=oi(ci(g,f)),p=oi(ci(y,g)),A=ui(m,p),x=u(-A.y,A.x),S=u(-m.y,m.x),v=1/yi(x,S),b=ai(x),M=oi(ci(m,p)),C=Math.sign(yi(x,M))||1,T=di(x,li(n,v)),R=di(x,li(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(yi(m,x))||C,g=di(S,li(n,f)),y=di(l,li(n,f));1===C?(t=g,e=R,i=y,a=R):(t=T,e=g,i=T,a=y);const A=4*$e(c,o),b=4*$e(o,h);(v>A||v>b)&&(1===C?(t=g,e=y,i=y,a=g):(t=y,e=g,i=g,a=y));const M=ui(o,t),w=ui(o,e),k=ui(o,i),E=ui(o,a);s[r]=M,r+=1,s[r]=w,r+=1,s[r]=k,r+=1,s[r]=E,r+=1,d=4}else{const t=ui(o,T),e=ui(o,R);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 Ny extends yn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kE=new Dy,this.DN=Ne,this.LN=Ne,this.RN=fg({arcStyleSolid:()=>Y(this.Te)&&this.Te,arcStyleRadialGradient:()=>tt(this.Te)&&this.Te,arcStyleLinearGradient:()=>st(this.Te)&&this.Te}),this.wN=t,this.CN=e,this.KR=t.kN()}EN(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?zy(this.Sa.C(),this.Zl.C(),this.Fi.C(),this.Ql.C()*l/100,this.Jl.C()*l/100,a)[0]:[this.Sa.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.tu=u(t,e)}else{const t=Math.floor(d/2);this.tu=u(h[t].x,h[t].y)}this.iu=h[1];const f=h.length-1;this.su=h[f],this.Kl.C()&&(h.shift(),c.shift());let g=!1;(this.Sa.u||this.Zl.u||this.Fi.u||this.Ql.u||this.Jl.u||this.Kl.u||this.ql.u||s)&&(this.LN=y(u(this.Oa().x-n,this.Oa().y-o),u(this.Oa().x+n,this.Oa().y+o)),g=!0,this.Sa.u=!1,this.Zl.u=!1,this.Fi.u=!1,this.Ql.u=!1,this.Jl.u=!1,this.Kl.u=!1,this.ql.u=!1);const m=this.ua();(g||m)&&this.Te!==z&&(this.Kl.C()?(this.VN&&this.KR.zV(this.VN),[this.ON,this.VN,this.NN,this.GN]=this.EN(h,c)):(this.VN&&this.KR.zV(this.VN),[this.ON,this.VN,this.NN,this.GN]=this.EN(h,void 0)),tt(this.Te)?this.WN=vy(this.LN,this.At,this.Te.getPosition(),this.Te.getExtent(),this.Te.getShape(),this.KR.dV()):st(this.Te)?this.UN=by(this.LN,this.At,this.Te.getAngle(!0),this.KR.dV()):(this.WN=void 0,this.UN=void 0));const p=this.RN.arcStyleSolid(m),A=this.RN.arcStyleLinearGradient(m),x=this.RN.arcStyleRadialGradient(m),S=p||A||x;m&&(this.YN=S?this.KR.Cz(Yg["2D"],Yg.Color({dataType:tt(this.Te)||st(this.Te)?["gradient",this.Te]:"uniform"}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0,this.Aa(this.Te));const v=this.Fe;if(ns(v)&&(g||this.ya(v.getThickness())||s)){this.Kl.C()?360===i?(h.pop(),c.pop(),[this.HN,this.$N]=this.zN(h,void 0,v.getThickness(),r),this.XN&&this.HN?this.KR.hO(this.XN,this.HN,!0):!this.XN&&this.HN?this.XN=this.KR.CV(this.HN,!0):this.XN&&!this.HN&&(this.KR.zV(this.XN),this.XN=void 0),[this.jN,this.ZN]=this.zN(c,void 0,v.getThickness(),r),this.QN&&this.jN?this.KR.hO(this.QN,this.jN,!0):!this.QN&&this.jN?this.QN=this.KR.CV(this.jN,!0):this.QN&&!this.jN&&(this.KR.zV(this.QN),this.QN=void 0)):([this.HN,this.$N]=this.zN(h,c,v.getThickness(),r),this.XN&&this.HN?this.KR.hO(this.XN,this.HN,!0):!this.XN&&this.HN?this.XN=this.KR.CV(this.HN,!0):this.XN&&!this.HN&&(this.KR.zV(this.XN),this.XN=void 0),this.jN&&(this.QN&&this.KR.zV(this.QN),this.QN=void 0,this.ZN=0)):(360===i&&(h.shift(),h.pop()),[this.HN,this.$N]=this.zN(h,void 0,v.getThickness(),r),this.XN&&this.HN?this.KR.hO(this.XN,this.HN,!0):!this.XN&&this.HN?this.XN=this.KR.CV(this.HN,!0):this.XN&&!this.HN&&(this.KR.zV(this.XN),this.XN=void 0));const t=v.getFillStyle();tt(t)?this.JN=vy(this.LN,this.At,t.getPosition(),t.getExtent(),t.getShape(),this.KR.dV()):st(t)?this.KN=by(this.LN,this.At,t.getAngle(!0),this.KR.dV()):(this.JN=void 0,this.KN=void 0),this.qN=t===z?void 0:this.KR.Cz(Yg["2D"],Yg.Color({dataType:tt(t)||st(t)?["gradient",t]:"uniform"}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})),this.ma(v)}if(g){let t=1,e=1;ns(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.DN=y(u(this.LN.min.x-t,this.LN.min.y-e),u(this.LN.max.x+t,this.LN.max.y+e))}this.tG=e&&S?this.tG||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0,this.iG=e&&this.Fe!==nt?this.iG||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0}return this}qL(t,e){if(this.fa()){const i=1===t?this.tG:this.YN,s=this.Te,r=this.VN;i&&r&&this.KR.cE(i).TV(i,((i,n,o,h)=>{if(this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(h("uScaleStart_highpart"),this.kE.hN()).IV(h("uScaleStart_lowpart"),this.kE.rN()).NO(o,r,this.At._i(),void 0).DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),1===t)this.KR.qV(i("uFirstId"),e).XO(o,1);else if(Y(s))this.KR.PR(i("uColor"),s.getColor());else if(tt(s)){if(!this.WN)return!1;this.KR.EO(o,this.WN,s)}else if(st(s)){if(!this.UN)return!1;this.KR.zO(o,this.UN,s)}return this.KR.qy(this.GN,this.NN),!0}));const n=this.Fe;ns(n)&&(void 0!==this.XN&&this.sG(t,this.XN,this.$N,n,e),void 0!==this.QN&&this.sG(t,this.QN,this.ZN,n,e))}return{idCount:1}}PN(t,e,i,s,r){return{}}sG(t,e,i,s,r){const n=1===t?this.iG:this.qN,o=s.getFillStyle();n&&this.KR.cE(n).TV(n,((n,h,a,l)=>{if(this.KR.IV(n("uScale"),this.kE.BV()).IV(n("uDisp"),this.kE.LV()).NO(a,e,this.At._i(),void 0).DV(n("uIsHighlighted"),1===t||2===t?0:this.$o).PR(n("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(n("uRenderEffectMask"),2===t?1:0),1===t)this.KR.qV(n("uFirstId"),r).XO(a,1);else if(Y(o))this.KR.PR(n("uColor"),o.getColor());else if(tt(o)){if(!this.JN)return!1;this.KR.EO(a,this.JN,o)}else if(st(o)){if(!this.KN)return!1;this.KR.zO(a,this.KN,o)}const u=s.getThickness(),c=-1===u||1===u;return this.KR.qy(c?this.KR.gl.LINE_LOOP:this.KR.gl.TRIANGLE_STRIP,i),!0}))}iE(){return this.eG&&(this.KR.zV(this.eG),this.eG=void 0),this.hG&&(this.KR.zV(this.hG),this.hG=void 0),this.VN&&(this.KR.zV(this.VN),this.VN=void 0),this.XN&&(this.KR.zV(this.XN),this.XN=void 0),this.QN&&(this.KR.zV(this.QN),this.QN=void 0),this.YN=void 0,this.qN=void 0,this.tG=void 0,this.iG=void 0,this}St(){return this.LN.max.x}vt(){return this.LN.min.x}bt(){return this.LN.max.y}xt(){return this.LN.min.y}Tl(){return Re(this.Fe)}Fl(){return Re(this.Fe)}}class Oy{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}rG(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}nG(){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}oG(){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}aG(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.nG(),this}lG(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.oG(),this}uG(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Oy).rG(t))(),Yy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Uy.nG(),n.push(t,e),r.push(Uy.first,Uy.second,Uy.third),h=void 0,o=void 0,r.push(Uy.third,Uy.fourth,Uy.second),a=Uy.third,Uy.oG(),l&&n.push(i,s),[o,h,a]),Gy=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Uy.nG(),o.push(t,e),r.push(Uy.first,Uy.second,Uy.third);const c=vi(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Uy.third,Uy.fourth,Uy.fifth),l=Uy.fourth),Uy.oG(),u&&o.push(i,s),[h,a,l]},Hy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Uy.nG(),r.push(t,e),s.push(Uy.first,Uy.second,Uy.third),n=i,o=void 0,h=Uy.third,l?r.push(i):a=!0,[n,o,h,a]),Wy=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Uy.nG(),Uy.nG()):a>0&&(Uy.nG(),u>0&&(u-=1)),n.push(t),r.push(Uy.first,Uy.second,Uy.third),a=Uy.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Ky=(t,e=0)=>{Uy.rG(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],y=s[c],m=!1,p=u>0?g.y!==y.y?2:1:0;if(r>1)for(;cy.y?d.y>f.y?[a,l,u]=Yy(g,y,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Gy(g,y,d,f,o,n,h,a,l,u,t):[a,l,u,m]=Hy(g,y,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,Uy.nG()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=Wy(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=Wy(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class Xy extends gn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kE=new Dy,this.dG=0,this.Za=Array(),this.fG=0,this.AG=new Uint16Array(0),this.gG=new Uint16Array(0),this.RN=fg({hightFillSolid:()=>Y(this.Te)&&this.Te,hightFillRadialGradient:()=>tt(this.Te)&&this.Te,hightFillLinearGradient:()=>st(this.Te)&&this.Te,hightFillPaletted:()=>K(this.Te)&&this.Te,lowFillSolid:()=>Y(this.El)&&this.El,lowFillRadialGradient:()=>tt(this.El)&&this.El,lowFillLinearGradient:()=>st(this.El)&&this.El,lowFillPaletted:()=>K(this.El)&&this.El}),this.wN=t,this.CN=e,this.KR=t.kN()}zs(){const t=this.da(),e=this.Wo.C(),i=this.rl;if(this.fa()){this.kE.EV(this.At);const s=this.At instanceof _i==0,r=s?this.At.Wi():void 0,n=this.Nl(),o=this.At.Ni()||t,h=i||this.Dl.u||o&&"disabled"!==n.type;if(h){if(this.dG=0,this.AG=new Uint16Array(0),this.gG=new Uint16Array(0),this.Za.length=0,this.fG=0,this.Bl>1){const[t,e,i,o]=Ky([s?n.packager(this.Il,r,.5):this.Il,s?n.packager(this.Pl,r,.5):this.Pl]);this.dG=o,this.AG=e,this.gG=i,this.Za=t,this.fG=t.length}this.Dl.u=!1}if(this.Rl&&this.sl[0].length>1){const[t,e]=this.sl,i=t.length,[o,h,a,l,u]=Ky([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.dG);this.dG=l;const c=o.length;for(let t=u;t0||this.Bl>0?1:u;s{if(this.KR.NO(h,i,this.At._i(),void 0).fO(n).DV(r("uIsHighlighted"),1===t||2===t?0:this.$o).PR(r("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(r("uRenderEffectMask"),2===t?1:0),this.At instanceof zi||this.At instanceof _c?this.KR.IV(r("uScale"),this.kE.BV()).IV(r("uDisp"),this.kE.LV()).IV(a("uScaleStart_highpart"),this.kE.hN()).IV(a("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(a("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(a("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(a("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(a("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(r("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(r("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),1===t)this.KR.qV(r("uFirstId"),e).XO(h,1);else if(Y(s))this.KR.PR(r("uColor"),s.getColor());else if(tt(s)){if(!this.mG)return!1;this.KR.EO(h,this.mG,s)}else if(st(s)){if(!this.vG)return!1;this.KR.zO(h,this.vG,s)}else if(K(s)){const t=gg(s,this,void 0);if(!t&&s.lut.percentageValues)return!1;this.KR.tN(h,s.lut,t)}return this.KR.gO(this._G),!0}))}const n=1===t?this.tG:this.pG;if(n&&this.SG&&this.xG){const s=this.SG,r=this.xG;this.KR.cE(n).TV(n,((n,o,h,a)=>{if(this.KR.NO(h,s,this.At._i(),void 0).fO(r).DV(n("uIsHighlighted"),1===t||2===t?0:this.$o).PR(n("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(n("uRenderEffectMask"),2===t?1:0),this.At instanceof zi||this.At instanceof _c?this.KR.IV(n("uScale"),this.kE.BV()).IV(n("uDisp"),this.kE.LV()).IV(a("uScaleStart_highpart"),this.kE.hN()).IV(a("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(a("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(a("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(a("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(a("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(n("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(n("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),1===t)this.KR.qV(n("uFirstId"),e).XO(h,1);else if(Y(i))this.KR.PR(n("uColor"),i.getColor());else if(tt(i)){if(!this.WN)return!1;this.KR.EO(h,this.WN,i)}else if(st(i)){if(!this.UN)return!1;this.KR.zO(h,this.UN,i)}else if(K(i)){const t=gg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.KR.tN(h,i.lut,t)}return this.KR.gO(this.bG),!0}))}return{idCount:1}}PN(t,e,i,s,r){return{}}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return 0}Fl(){return 0}Kb(t){this.yl()>0&&this.zs();const[e,i]=this.al(),s=e.length>2&&e[1].x0&&this.zs();const[e,i]=this.al(),s=e.length;if(0===s)return;const r=this.zl?1:0,n=s-(this.Vl?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.wG;s+=1){const r=i-s*Math.PI/this.wG;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.YV.Wz.get(e);return i||(i=new jy(t,e),t.YV.Wz.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),Zy={PG:(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.lO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.lO(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.lO(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.lO(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.lO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.lO(i,1),h.enableVertexAttribArray(i)}},DG:(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.lO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.lO(r,1),h.enableVertexAttribArray(r)},BG:(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.lO(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.lO(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.lO(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.lO(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.lO(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.lO(i,1),h.enableVertexAttribArray(i)}},LG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.lO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.lO(r,1),h.enableVertexAttribArray(r)},qL:(t,e,i,s,r,n,o)=>{const h=t.kN(),{uniform:a,uniformOptional:l}=i,u=1/t.Kn.so,c=(r?Math.max(n,u):Math.max(n,0))+1;h.DV(a("uThicknessPixels"),c).DV(l("uAALimit"),1-(c-1)/c).IV(a("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.cE(i,s).qy(o)}},Qy={PG:(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)}},DG:(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)},BG:(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)}},EG:(t,e)=>{const i=t.kN();i.qy(i.gl.LINE_STRIP,e,0)},zG:(t,e)=>{const i=t.kN();i.qy(i.gl.LINES,2*e,0)}};class qy extends An{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kE=new Dy,this.tl=Ne,this.RN=fg({lineStyleSolid:()=>ns(this.yu)&&this.yu,lineStyleDashed:()=>ao(this.yu)&&this.yu,strokeFillSolid:()=>{const t=this.yu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.yu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.yu.getFillStyle();return tt(t)&&t},strokeFillPaletted:()=>{const t=this.yu.getFillStyle();return K(t)&&t}}),this.wN=t,this.CN=e,this.KR=t.kN(),this.VG=this.KR.MO}zs(){const t=this.ga(),e=this.yu,i=this.RN.lineStyleSolid(t),s=this.RN.lineStyleDashed(t),r=i||s,n=this.RN.strokeFillSolid(t),o=this.RN.strokeFillLinearGradient(t),h=this.RN.strokeFillRadialGradient(t),a=this.RN.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Ii(),d=this.Ti(),f=this.Wo.C(),g=this.Wo.u,m=e.N();if(s&&this.At instanceof _i)return Ct.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.kE.EV(this.At),this.bu&&(this.OG=this.KR.CV(Jt([c,d],this.At._i()),!1,this.OG),this.tl=y(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.fa()&&r&&l&&m>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.NG=t?{type:"triangulated",shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0}),this.VG?Yg.AliasedEdge:void 0,s&&Yg.StippleTextureInstanced),mousePickingShader:f?this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0}),s&&Yg.StippleTextureInstanced):void 0,geometry:$y(this.KR,m),thickness:m,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.JN=vy(en(this.tl,{x:this.Tl(),y:this.Fl()},this.At),this.At,h.getPosition(),h.getExtent(),h.getShape(),this.KR.dV()):o?this.KN=by(en(this.tl,{x:this.Tl(),y:this.Fl()},this.At),this.At,o.getAngle(!0),this.KR.dV()):(this.JN=void 0,this.KN=void 0),s){if(t||this.bu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.GG=this.KR.CV(t,!1,this.GG)}this.WG=this.KR.QO(s.getPattern())}else this.GG&&(this.KR.zV(this.GG),this.GG=void 0),this.WG=void 0;return this.xu(e),this.bu=!1,this.Wo.u=!1,this}qL(t,e){var i,s;const r=this.OG;if(!r)return{};const n=this.NG;if(!n)return{};const{fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l,lineStyleDashed:u,thickness:c}=n,d=1===t?null===(i=this.NG)||void 0===i?void 0:i.mousePickingShader:null===(s=this.NG)||void 0===s?void 0:s.shader;return d?(this.KR.cE(d).TV(d,((i,s,d,f)=>{if(this.KR.DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),this.At instanceof zi||this.At instanceof _c?this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(f("uScaleStart_highpart"),this.kE.hN()).IV(f("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(f("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(f("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(f("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(f("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(i("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(i("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),1===t)this.KR.qV(i("uFirstId"),e).XO(d,1);else if(o)this.KR.PR(i("uColor"),o.getColor());else if(a){if(!this.JN)return!1;this.KR.EO(d,this.JN,a)}else if(h){if(!this.KN)return!1;this.KR.zO(d,this.KN,h)}else if(l){const t=gg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.KR.tN(d,l.lut,t)}if(u){if(!this.GG||!this.WG)return!1;Zy.DG(this.KR,d,this.GG,s("aLengthSoFarA"),s("aLengthSoFarB"),2,0),this.KR.IV(i("uStippleCount"),[this.cs.oi().x/this.WG.qO,this.cs.oi().y/this.WG.qO]).DV(f("uStippleTextureWidthLimiter"),this.WG.KO/this.WG.qO).DV(i("uStippleScale"),u.getPatternScale()).PV(i("uStippleTexture"),this.WG.JO,1)}return Zy.PG(this.At._i(),this.KR,r,d,this.At._i()?4:2,0),Zy.qL(this.wN,n.geometry,d,this.VG&&1!==t,1===t,c,1),!0})),{idCount:1}):{}}PN(t,e,i,s,r){return{}}dispose(){return super.dispose(),this.NG=void 0,this.OG&&(this.KR.zV(this.OG),this.OG=void 0),this.GG&&(this.KR.zV(this.GG),this.GG=void 0),this.WG=void 0,this}iE(){return this}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return Re(this.yu)}Fl(){return Re(this.yu)}}class Jy extends xn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UG=[],this.YG=!1,this.HG=!1,this.$G=!1,this.XG=!1,this.kE=new Dy,this.tl=Ne,this.RN=fg({lineStyleSolid:()=>ns(this.yu)&&this.yu,lineStyleDashed:()=>ao(this.yu)&&this.yu,lineFillSolid:()=>{const t=this.yu.getFillStyle();return Y(t)&&t},lineFillRadialGradient:()=>{const t=this.yu.getFillStyle();return tt(t)&&t},lineFillLinearGradient:()=>{const t=this.yu.getFillStyle();return st(t)&&t},lineIndividualPointFill:()=>{const t=this.yu.getFillStyle();return H(t)&&t}}),this.wN=t,this.CN=e,this.KR=t.kN(),this.VG=this.KR.MO,this.jG=t.Kn.ho}Xr(){const t={vs:e=>this.ZG(t,e),ds:e=>this.QG(t,e),$g:(e,i)=>this.JG(t,e,i),PR:e=>this.KG(t,e),Pi:{x:0,y:0},Fi:{x:0,y:0},$o:0,qG:void 0,tW:this.UG.length};return this.UG.push(t),t}Ot(){var t;return this.UG.length=0,this.YG=!0,this.Is&&this.Vn&&(null===(t=this.cs.zn)||void 0===t?void 0:t.entity)===this&&this.Vn(this,void 0,this.cs.zn.collectionMember),this}iW(){return this.UG.length}C(t){const e=this.UG[t];return[e.Pi,e.Fi]}Cm(){return this.UG}Fd(t){var e;const i=this.UG.indexOf(t);i>=0&&(this.UG.splice(i,1),this.YG=!0,this.Is&&this.Vn&&(null===(e=this.cs.zn)||void 0===e?void 0:e.entity)===this&&this.Vn(this,void 0,this.cs.zn.collectionMember))}ZG(t,e){if(e&&!this.UG.includes(t))t.tW=this.UG.length,this.UG.push(t);else if(!e){const e=this.UG.indexOf(t);this.UG.splice(e,1)}return this.$G=!0,t}QG(t,e){return t.$o=e,this.HG=!0,t}JG(t,e,i){return t.Pi=e,t.Fi=i,this.YG=!0,t}KG(t,e){return t.qG=e,this.XG=!0,t}zs(){const t=this.Wo.C(),e=this.Wo.u,i=this.ga(),s=this.yu,r=this.UG,n=this.HG,o=this.YG,h=this.$G,a=this.XG,l=this.RN.lineStyleSolid(i),u=this.RN.lineStyleDashed(i),c=l||u,d=this.RN.lineFillSolid(i),f=this.RN.lineIndividualPointFill(i),g=this.RN.lineFillRadialGradient(i),y=this.RN.lineFillLinearGradient(i),m=d||f||y||g,p=s.N(),A=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.At instanceof _i)return Ct.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.kE.EV(this.At);const x=o||h;if(x){const t=[];for(let e=0;e0&&e;this.NG=i?"triangulated"===A?{type:"triangulated",shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0,snapToNearestPixel:this.jG,ensureMinimumSegmentLength:void 0!==this.Mu}),this.VG?Yg.AliasedEdge:void 0,u&&Yg.StippleTextureInstanced,Yg.AttributeHighlight),mousePicking:t?{shader:this.KR.Cz(Yg["2D"],Yg.MousePicking({useAttribute:!0}),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0,snapToNearestPixel:this.jG,ensureMinimumSegmentLength:void 0!==this.Mu}),u&&Yg.StippleTextureInstanced,Yg.AttributeHighlight)}:void 0,geometry:$y(this.KR,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:{type:"primitive",shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0,snapToNearestPixel:this.jG}),Yg.AttributeHighlight),mousePicking:t?{shader:this.KR.Cz(Yg["2D"],Yg.MousePicking({useAttribute:!0}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0,snapToNearestPixel:this.jG}),Yg.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:void 0}if(u){if(i||x){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.$o,e+=1})),this.sW=this.KR.CV(t,!0,this.sW)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.qG||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.eW=this.KR.CV(t,!1,this.eW)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.qG||f.color;for(let i=e;i{t[e+0]=i.tW||0,e+=1})),this.hW=this.KR.CV(t,!0,this.hW)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{if(this.At instanceof zi||this.At instanceof _c?this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(y("uScaleStart_highpart"),this.kE.hN()).IV(y("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(y("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(y("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(y("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(y("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(i("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(i("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),this.jG&&this.KR.IV(y("uViewportSizePx"),[this.cs.oi().x*this.KR.dV(),this.cs.oi().y*this.KR.dV()]),void 0!==this.Mu&&this.KR.IV(i("uMinSegmentPixelVector"),[this.Mu.x,this.Mu.y]),this.KR.PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.KR.qV(i("uFirstId"),e),!n)return!1;"triangulated"===h?this.KR.FV(n,1,{location:f("aPickingIdOffset"),size:1}):this.KR.dO(f("aPickingIdOffset"),n)}else if(a)this.KR.PR(i("uColor"),a.getColor());else if(l){if(!this.eW)return!1;this.KR.FV(this.eW,"triangulated"===h?1:void 0,{location:f("aColor"),size:4})}else if(c){if(!this.WN)return!1;this.KR.EO(g,this.WN,c)}else if(u){if(!this.UN)return!1;this.KR.zO(g,this.UN,u)}if(d){if(!this.GG||!this.WG)return!1;Zy.LG(this.KR,g,this.GG,f("aLengthSoFarA"),f("aLengthSoFarB"),2,0),this.KR.IV(i("uStippleCount"),[this.cs.oi().x/this.WG.qO,this.cs.oi().y/this.WG.qO]).DV(y("uStippleTextureWidthLimiter"),this.WG.KO/this.WG.qO).DV(i("uStippleScale"),d.getPatternScale()).PV(i("uStippleTexture"),this.WG.JO,0)}if("triangulated"===h){const{geometry:e,thickness:i}=o;Zy.BG(this.At._i(),this.KR,s,g,this.At._i()?4:2,0),this.KR.FV(r,1,{location:f("aIsHighlighted"),size:1}),Zy.qL(this.wN,e,g,this.VG&&1!==t,1===t,i,this.UG.length)}else Qy.BG(this.At._i(),this.KR,s,g,this.At._i()?4:2,0),this.KR.dO(f("aIsHighlighted"),r),Qy.zG(this.wN,this.UG.length);return!0})),{idCount:this.UG.length}):{}}dispose(){return super.dispose(),this.NG=void 0,this.OG&&(this.KR.zV(this.OG),this.OG=void 0),this.GG&&(this.KR.zV(this.GG),this.GG=void 0),this.sW&&(this.KR.zV(this.sW),this.sW=void 0),this.hW&&(this.KR.zV(this.hW),this.hW=void 0),this.eW&&(this.KR.zV(this.eW),this.eW=void 0),this.WG=void 0,this}PN(t,e,i,s,r){return{collectionMember:this.UG.find((i=>e+i.tW===t))}}iE(){return this}ds(t){super.ds(t);for(const e of this.UG)e.ds(t);return this}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return Re(this.yu)}Fl(){return Re(this.yu)}}class tm{constructor(t,e){this.rW=!1,this.nW=!1,this.oW=!1,this.At=t,this.aW=e,this.aW.Ko("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.rW="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.rW="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.nW=!0),!0===t.regularProgressiveStep&&(this.oW=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.rW?t[0].x:t[0].y,end:"x"===this.rW?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.rW?"x"===this.rW?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.lW=!0)}))}fW(t,e=!1){if(this.lW||!this.rW||"linear"!==this.dW.type)return!1;!1===e&&this.AW&&(clearTimeout(this.AW),this.AW=void 0);const i="x"===this.rW?this.dW.scale.x.ug:this.dW.scale.y.ug;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.rW?r.x:r.y,"x"===this.rW?n.x:n.y,s),h=this.dW.scale,a=Math.abs("x"===this.rW?h.Wi().x:h.Wi().y),l=a/o,u=Math.floor(l*em),c=u*o,d=Ct.performance.now(),f=!(d-i.Sh<500)&&(i.fh?d-i.mh<1e3:d-i.Ah<2e3||i.ph),g=s>2*this.uW.totalDataPointsAtTime;if(f&&!g)return this.AW=setTimeout((()=>this.gW(t)),1e3),!1;const y=u>=10,m=this.uW.enabled?this.uW.columnWidthAxis/a<1.5:void 0,p=this.uW.enabled&&u>this.uW.dataPointsPerColumn?u/this.uW.dataPointsPerColumn>=2:void 0;let A;!0===this.uW.enabled?m?p&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):A=y?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:y&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return A?(x&&(this.uW=A),!0):(x&&(this.uW={...this.uW,totalDataPointsAtTime:s}),!1)}pW(){this.yW=void 0,this.cW.length=0,this.AW&&(clearTimeout(this.AW),this.AW=void 0)}mW(t){if(0===t.length)return t;if(this.lW||!this.rW||"linear"!==this.dW.type||!this.uW.enabled)return t;let e;e=this.cW.length>0?he(this.cW,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.yW,h=-1,a=-1,l=0,u=0;if("x"!==this.rW||this.nW)if("x"===this.rW&&this.nW){const t=this.uW.columnWidthAxis;let c=this.yW?this.yW.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.yW=s[c-1]),s}vW(t){if(this.rW&&"linear"===this.dW.type){const e="x"===this.rW?this.dW.scale.x.ug:this.dW.scale.y.ug;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.ah===Ws.progressive||e.ah===Ws.regressive){const e=Math.abs("x"===this.rW?this.dW.scale.x.getInnerInterval():this.dW.scale.y.getInnerInterval());if(this.uW.enabled)return 2*e/this.uW.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.rW?s.x:s.y,"x"===this.rW?r.x:r.y,i)}}}SW(t,e,i){if(!this.rW)return e;const s=i.length;let r=jr(i,t.min,this.rW,this.nW,0,s-1);void 0===r&&(r=this.nW?s-1:0);let n=jr(i,t.max,this.rW,this.nW,0,s-1);return void 0===n&&(n=this.nW?0:s-1),1+Math.abs(n-r)}xW(){this.AW&&(clearTimeout(this.AW),this.AW=void 0)}gW(t){this.fW(t,!0)&&this.Ms()}}class sm extends tm{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 rm{constructor(t,e,i){this.bW=e,this.MW=i,this._W=t,this.wW=[]}kW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this._W[this._W.length-1];do{const t=this._W.length;let r;h||(h=this.TW(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.MW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this._W[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._W.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.FW()}IW(t){const e=t,i=this._W.indexOf(e);i>=0&&this._W.splice(i,1),e.droppedTimestamp=Ct.performance.now(),this.wW.push(e)}PW(){this._W.slice().forEach((t=>this.IW(t)))}DW(){this._W.forEach((t=>this.bW(t))),this.wW.forEach((t=>this.bW(t))),this._W.length=0,this.wW.length=0}TW(t,e){const i=2*t/3,s=4*t/3,r=this.wW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.wW[r];return this.wW.splice(r,1),this._W.push(t),t}}FW(){if(this.wW.length>5){const t=Ct.performance.now();for(let e=0;e=1e4)&&(this.bW(i),this.wW.splice(e,1),e-=1)}}}}class nm extends tm{BW(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.LW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.RW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.EW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}LW(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}EW(t,e,i,s,r,n){if(void 0===e||!this.rW)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.rW?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.rW?a.boundaries.max.x2))break;o+=1}return o}RW(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.rW){if(this.nW?"x"===this.rW?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.rW?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}zW(t,e){const i=t.reduce(((t,e)=>ei(t,e.boundaries)),Ne);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.rW||this.nW?"x"===this.rW&&this.nW?i.max.x=Math.min(i.max.x,t):"y"!==this.rW||this.nW?"y"===this.rW&&this.nW&&(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 om extends Sn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.kE=new Dy,this.LM=[],this.VW=new sm(this.At,this),this.OW=new im(this.At,this,(()=>this.cs.Ms())),this.NW=new rm(this.LM,(t=>{t.coordsBuffer&&this.KR.zV(t.coordsBuffer),t.GG&&this.KR.zV(t.GG)}),!0),this.GW=new nm(this.At,this),this.WW=0,this.UW=0,this.YW=!1,this.RN=fg({lineStyleSolid:()=>ns(this.yu)&&this.yu,lineStyleDashed:()=>ao(this.yu)&&this.yu,strokeFillSolid:()=>{const t=this.yu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.yu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.yu.getFillStyle();return tt(t)&&t},strokeFillPaletted:()=>{const t=this.yu.getFillStyle();return K(t)&&t}}),this.CN=e,this.Kn=n,this.NG={type:"none"},this.KR=t.kN(),this.wN=t,this.VG=this.KR.MO;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;sJt(e,t,Float32Array))(o,h);this.HW={individualLookupValuesEnabled:h,attributesPerVertex:c,attributeOffsetCoordinateLowPrecision:a,attributeOffsetCoordinateHighPrecision:l,attributeOffsetLookUpValue:u,prepareRenderData:(t,e)=>d(t,this.yu.getFillStyle())}}$W(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.Wo.C(),h=this.Wo.u,a=this.RN.lineStyleSolid(i),l=this.RN.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.RN.strokeFillSolid(i),f=this.RN.strokeFillLinearGradient(i),g=this.RN.strokeFillRadialGradient(i),y=this.RN.strokeFillPaletted(i),m=d||f||g||y,p=this.HW.individualLookupValuesEnabled;if(l&&this.At instanceof _i)return Ct.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this._u=he(this._u,s,{canReturnB:!0}),this.il+=r);let A=this.wu.u;const x=this.GW.BW(this.LM,this.wu.C());if(x>0){let t=0;for(let e=0;e{t.GG&&(this.KR.zV(t.GG),t.GG=void 0)})),this.YW=!1),v&&(this.OW.pW(),this.LM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Ne,t.lastDataPoint=void 0})),this.NW.PW(),S=this._u,this.WW=0,this.UW=0);const b=this.OW.mW(S),M=b.length;if(M>0){let t=this.OW.vW(this._u)||(this.Ko("ApplicationType",(t=>"InternalUI"===t.type))?this.il:1e5);M/t>10&&(t=M/10),this.NW.kW(b,t,((t,e,i,s)=>{const r=this.VW.calculateUserDataPointsBoundaries(e),n=this.OW.SW(r,i,this._u)-s;return this.XW=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.KR.sO(t*this.HW.attributesPerVertex,this.HW.prepareRenderData(e,i)),lastDataPoint:e[i-1],GG:this.YW?this.KR.sO(2*t,this.$W(e,i,this.XW)):void 0}}),((t,e,i,s)=>{const r=ei(t.boundaries,this.VW.calculateUserDataPointsBoundaries(e)),n=this.OW.SW(r,t.existingCoordinatesCount+i,this._u)-(t.jointPointsCount+s);this.KR.eO(t.coordsBuffer,t.existingCoordinatesCount*this.HW.attributesPerVertex,this.HW.prepareRenderData(e,i)),this.YW&&t.GG&&this.KR.eO(t.GG,2*t.existingCoordinatesCount,this.$W(e,i,this.XW)),this.XW=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(A&&(this.tl=this.GW.zW(this.LM,this.wu.C())),this.kE.EV(this.At),g?this.JN=vy(this.Ho||this.tl,this.At,g.getPosition(),g.getExtent(),g.getShape(),this.KR.dV()):f?this.KN=by(this.Ho||this.tl,this.At,f.getAngle(!0),this.KR.dV()):(this.JN=void 0,this.KN=void 0),i||h){if(y&&"value"===y.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw Ct.alert(t),new Error(t)}if(m&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:y?["lookup",y.getLookUpProperty(),y.lut]:"uniform";this.NG="primitive"===t?{type:t,shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0}),l&&Yg.StippleTexture),mousePickingShader:o?this.KR.Cz(Yg["2D"],Yg.MousePicking({useVertexId:!0}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0}),l&&Yg.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:"triangulated"===t?{type:t,shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0}),this.VG?Yg.AliasedEdge:void 0,l&&Yg.StippleTextureInstanced),mousePickingShader:o?this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0}),l&&Yg.StippleTextureInstanced):void 0,geometry:$y(this.KR,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:{type:"none"}}else this.NG={type:"none"}}return this.WG=l?this.KR.QO(l.getPattern()):void 0,this.xu(e),this.rl=!1,this.sl=[],this.Wo.u=!1,this.wu.u=!1,this}qL(t,e){const i=this.KR.gl,s=this.NG;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.KR.cE(r).TV(r,((r,u,c,d)=>{let f=!1;if(this.KR.DV(r("uIsHighlighted"),1===t||2===t?0:this.$o).PR(r("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(r("uRenderEffectMask"),2===t?1:0),this.At instanceof zi||this.At instanceof _c?this.KR.IV(r("uScale"),this.kE.BV()).IV(r("uDisp"),this.kE.LV()).IV(d("uScaleStart_highpart"),this.kE.hN()).IV(d("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(d("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(d("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(d("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(d("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(r("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(r("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),1===t);else if(o)this.KR.PR(r("uColor"),o.getColor());else if(a){if(!this.JN)return!1;this.KR.EO(c,this.JN,a)}else if(h){if(!this.KN)return!1;this.KR.zO(c,this.KN,h)}else if(l){const t=gg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.KR.tN(c,l.lut,t)}const g=Le(e);return this.VW.renderVisibleOnly(this.LM,(e=>{const{coordsBuffer:o}=e;if(!o)return;if(1===t){const[t,i]=g.Ut(e.existingDataPointsCount);this.KR.qV(r("uFirstId"),t),"triangulated"===s.type?this.KR.XO(c,i):this.KR.HO(c,i)}i.bindBuffer(i.ARRAY_BUFFER,o);const h="triangulated"===s.type?Zy.PG:Qy.PG;if(this.At._i()||void 0===this.HW.attributeOffsetCoordinateLowPrecision?this.At._i()&&void 0!==this.HW.attributeOffsetCoordinateHighPrecision&&h(!0,this.KR,o,c,this.HW.attributesPerVertex,this.HW.attributeOffsetCoordinateHighPrecision):h(!1,this.KR,o,c,this.HW.attributesPerVertex,this.HW.attributeOffsetCoordinateLowPrecision),n){if(!e.GG||!this.WG)return;"triangulated"===s.type?Zy.DG(this.KR,c,e.GG,u("aLengthSoFarA"),u("aLengthSoFarB"),2,0):Qy.DG(this.KR,c,e.GG,u("aLengthSoFar"),2,0),this.KR.IV(r("uStippleCount"),[this.cs.oi().x/this.WG.qO,this.cs.oi().y/this.WG.qO]).DV(d("uStippleTextureWidthLimiter"),this.WG.KO/this.WG.qO).DV(r("uStippleScale"),n.getPatternScale()).PV(r("uStippleTexture"),this.WG.JO,1)}if(l&&"value"===l.lookUpProperty&&void 0!==this.HW.attributeOffsetLookUpValue&&1!==t)if("triangulated"===s.type){const t=u("aLookupValueA");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.KR.lO(t,1),i.enableVertexAttribArray(t);const e=u("aLookupValueB");i.vertexAttribPointer(e,1,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.HW.attributeOffsetLookUpValue+this.HW.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.KR.lO(e,1),i.enableVertexAttribArray(e)}else{const t=u("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),i.enableVertexAttribArray(t)}if("triangulated"===s.type){const{thickness:i}=s;Zy.qL(this.wN,s.geometry,c,this.VG&&1!==t,1===t,i,e.existingCoordinatesCount-1)}else Qy.EG(this.wN,e.existingCoordinatesCount);f=!0}),void 0===this.Yi),i.bindBuffer(i.ARRAY_BUFFER,null),f})),{idCount:this.il}}PN(t,e,i,s,r){return{}}Al(t,e){return Array.isArray(t)||(t=[t]),this.sl=he(this.sl,t,{canReturnB:!0}),this.tl=ei(this.tl,e||e||this.VW.calculateUserDataPointsBoundaries(t)),this}Ot(){return super.Ot(),this.WW=0,this.UW=0,this.XW=void 0,this}dispose(){return super.dispose(),this.NW.DW(),this.OW.xW(),this.NG={type:"none"},this.WG=void 0,this}iE(){return this}Kb(t){this.yl()>0&&this.zs();const e=this.al(),i=Hr(e,t,this.Jo(),this.zl,this.Vl,this.At,this.engine.At,this.tl,this.VW.rW,this.VW.nW);return void 0!==i?e[i]:void 0}x_(t){this.yl()>0&&this.zs();const e=this.al(),i=e.length;if(0===i)return;const s=this.zl?1:0,r=i-(this.Vl?2:1),n=this.Jo();if(n===Gr.Nearest){let s,r,n=ze;for(let o=0;o1}qy(t,e,i,s,r){return"object"==typeof s?e?this.KR.dO(t.attribute("aOffsetScale"),e,1).IV(t.uniform("uSizePixels"),[s.width,s.height]):this.KR.DV(t.uniform("uOffsetScale"),s.scale).IV(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.KR.dO(t.attribute("aOffsetPixels"),e,1):this.KR.DV(t.uniform("uOffsetPixels"),s):this.KR.DV(t.uniform("uPointSize"),s),r?this.KR.FV(this.WR,0,{location:t.attribute("aInstanceGeo"),size:2}).pO(this.IG,0,this.QW,i):this.KR.qy(this.KR.gl.POINTS,i),this}jz(){this.KR.zV(this.WR)}}const am=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new hm(t,i,t.gl.TRIANGLE_FAN,e)},lm=(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 hm(t,s,t.gl.TRIANGLES,e)},um=(t,i,s)=>{if(co(t))return um(e.PointShape.Square,i,s);let r=i.YV.Oz.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.YV.Nz.get(n)||((t,e,i=0)=>{const s=function(t=25){return zy(u(0,0),0,360,.5,.5,t)[0]}(e);return new hm(t,s,t.gl.TRIANGLE_FAN,i)})(i,n),i.YV.Nz.set(n,r),r):(r=i.YV.Gz.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 hm(t,s,t.gl.TRIANGLE_STRIP,i)})(i,n),i.YV.Gz.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 hm(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=am(i);break;case e.PointShape.Plus:r=lm(i);break;case e.PointShape.Cross:r=lm(i,45);break;case e.PointShape.Diamond:r=am(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 hm(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new hm(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 hm(t,s,t.gl.TRIANGLES,e)})(i);break;default:return Ce(0,"LightningChart JS unidentified point shape")}i.YV.Oz.set(t,r)}return r};class cm extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kE=new Dy,this.DN=y(c(_e,_e),c(ze,ze)),this.RN=fg({pointStyleSolid:()=>Y(this.Te)&&this.Te,pointStyleRadialGradient:()=>tt(this.Te)&&this.Te,pointStyleLinearGradient:()=>st(this.Te)&&this.Te,pointStylePaletted:()=>K(this.Te)&&this.Te,pointStyleIndividual:()=>H(this.Te)&&this.Te}),this.wN=t,this.CN=e,this.KR=t.kN()}zs(){var t;const e=this.Wo.C(),i=this.Wo.u,s=this.sl,r=s.length,n=r>0,o=this.Qa.C(),h=this.Te,a=this.size.C(),l=this.Qa.u||this._a.u,u=this.At.Ni(),c=this.size.u||this.Qa.u,d=this.rl||s&&s.length>0,f=u||c,g=this.ua(),y=this.RN.pointStyleSolid(g),m=this.RN.pointStyleRadialGradient(g),p=this.RN.pointStyleLinearGradient(g),A=this.RN.pointStylePaletted(g),x=this.RN.pointStyleIndividual(g),S=y||m||p||A||x;if(n&&(this.Za=he(this.Za,s,{canReturnB:!0}),this.il+=r),n||this.rl){this.tl=this.hl?ei(this.tl,this.hl):ei(this.tl,Je(this.Za));const t=Jt(this.Za,this.At._i());this.qW=this.il,this.tU=this.KR.CV(t,!1,this.tU)}this.kE.EV(this.At),h!==z?f&&(this.iU&&(this.iU=void 0),a>1||this.Ja.C()?a<=1&&!this.Ja.C()?this.IG=this.KR.gl.POINTS:(this.iU=um(o,this.KR,this.Ja.C()?25:a),this.IG=this.iU.IG):this.IG=this.KR.gl.POINTS):this.iU&&(this.iU=void 0);const v=(null===(t=this.iU)||void 0===t?void 0:t.JW)||0,b=this._a.C()+v;if(c||g||i||l){const t=this.Ja.C()?"attribute":"uniform",i=a<=1&&Yg.PointSize(t),s=Yg.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.Ka.C()||b%360!=0)&&{dataType:this.Ka.C()?"attribute":"uniform"}}:void 0,axisWorldTranslation:dg(this.At),normalSource:void 0});this.IE=S?this.KR.Cz(Yg["2D"],i,s,y?Yg.Color({dataType:"uniform"}):x?Yg.Color({dataType:"attribute"}):A?Yg.Color({dataType:["lookup",A.getLookUpProperty(),A.lut]}):m?Yg.Color({dataType:["gradient",m]}):p?Yg.Color({dataType:["gradient",p]}):void 0):void 0,this.tG=e&&S?this.KR.Cz(Yg["2D"],i,s,Yg.MousePicking()):void 0}if(d||g){const t=this.Za.length;if(H(h)&&this.qW&&this.qW>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=Ai(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.nl={min:e,max:t}}return this.ca=h,this.Qa.u=!1,this.size.u=!1,this._a.u=!1,this.Wo.u=!1,this.rl=!1,this}qL(t,e){const i=1===t?this.tG:this.IE,s=this.tU,r=this.qW,n=this.il;return i&&s&&r&&(this.KR.cE(i),this.KR.TV(i,((i,o,h,a)=>{var l;if(this.At instanceof zi||this.At instanceof _c?this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(a("uScaleStart_highpart"),this.kE.hN()).IV(a("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(a("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(a("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(a("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(a("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(i("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(i("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),this.KR.NO(h,s,this.At._i(),this.iU?1:void 0).DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).DV(a("uDevicePixelRatio"),this.KR.dV()),this.iU){const t=o("aInstanceGeo");this.KR.oO(t,this.iU.WR).lO(t,0)}if(1===t)this.KR.qV(i("uFirstId"),e).XO(h,n);else if(Y(this.Te))this.KR.PR(i("uColor"),this.Te.getColor());else if(H(this.Te)&&this.sU){const t=o("aColor");this.KR.cO(t,this.sU),this.IG!==this.KR.gl.POINTS&&this.KR.lO(t,1)}else if(K(this.Te)){if("value"===this.Te.getLookUpProperty()&&this.rU){const t=o("aLookupValue");this.KR.dO(t,this.rU),this.IG!==this.KR.gl.POINTS&&this.KR.lO(t,1)}const t=gg(this.Te,this,this.nl);if(!t&&this.Te.lut.percentageValues)return!1;this.KR.tN(h,this.Te.lut,t)}else if(tt(this.Te)){if(!this.WN)return!1;this.KR.EO(h,this.WN,this.Te)}else if(st(this.Te)){if(!this.UN)return!1;this.KR.zO(h,this.UN,this.Te)}if(this.eU&&this.IG!==this.KR.gl.POINTS){const t=o("aOffsetPixels");this.KR.dO(t,this.eU),this.IG!==this.KR.gl.POINTS&&this.KR.lO(t,1)}else if(this.IG!==this.KR.gl.POINTS){const t=i("uOffsetPixels");this.KR.DV(t,this.size.C())}const u=((null===(l=this.iU)||void 0===l?void 0:l.JW)||0)+this._a.C();if(this.hU&&this.IG!==this.KR.gl.POINTS){const t=o("aRot");this.KR.oO(t,this.hU),this.IG!==this.KR.gl.POINTS&&this.KR.lO(t,1)}else if(this.IG!==this.KR.gl.POINTS&&u%360!=0){const t=Ai(u),e=Math.sin(t),s=Math.cos(t);this.KR.IV(i("uRot"),[e,s])}if(this.IG===this.KR.gl.POINTS)this.KR.DV(i("uPointSize"),this.size.C());else{const t={x:2/this.cs.oi().x,y:2/this.cs.oi().y};this.KR.IV(i("uRatioPxClip"),[t.x,t.y])}let c=!1;return this.IG===this.KR.gl.POINTS?(this.KR.qy(this.IG,r),c=!0):this.iU&&(this.KR.pO(this.IG,0,this.iU.QW,r),c=!0),c}))),{idCount:n}}PN(t,e,i,s,r){return{}}qc(t){this.yl()>0&&this.zs();const e=this.al(),i=Hr(e,t,this.Jo(),!1,!1,this.At,this.cs.At,this.tl,void 0,void 0);return void 0!==i?e[i]:void 0}Be(t){return super.Be(t)}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return this.Ja.C()?25:this.size.C()}Fl(){return this.Ja.C()?25:this.size.C()}iE(){return this.tU&&(this.KR.zV(this.tU),this.tU=void 0),this.iU&&(this.iU=void 0),this.sU&&(this.KR.zV(this.sU),this.sU=void 0),this.hU&&(this.KR.zV(this.hU),this.hU=void 0),this.rU&&(this.KR.zV(this.rU),this.rU=void 0),this}}class dm extends hn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.NG={fill:void 0,border:void 0},this.kE=new Dy,this.tl=Ne,this.nU=!1,this.oU=!1,this.aU=!1,this.lU=!1,this.uU=!1,this.kd=[],this.RN=fg({polygonStyleSolid:()=>Y(this.Te)&&this.Te,polygonStyleImage:()=>ro(this.Te)&&this.Te,polygonStyleRadialGradient:()=>tt(this.Te)&&this.Te,polygonStyleLinearGradient:()=>st(this.Te)&&this.Te,polygonStylePaletted:()=>K(this.Te)&&this.Te,polygonStyleIndividual:()=>H(this.Te)&&this.Te,lineStyleSolid:()=>ns(this.Fe)&&this.Fe,lineStyleFilled:()=>{const t=this.Fe&&this.Fe.getFillStyle();return Y(t)&&t}}),this.wN=t,this.CN=e,this.KR=t.kN(),this.VG=this.KR.MO}Xr(){const t={vs:e=>this.ZG(t,e),ds:e=>this.QG(t,e),Cl:e=>this.cU(t,e),ob:e=>this.dU(t,e),PR:e=>this.KG(t,e),Za:[],M:void 0,fU:void 0,$o:0,AU:!0,gU:this.kd.length};return this.kd.push(t),t}Ot(){var t;return this.kd.length=0,this.nU=!0,this.Is&&this.Vn&&(null===(t=this.cs.zn)||void 0===t?void 0:t.entity)===this&&this.Vn(this,void 0,this.cs.zn.collectionMember),this}Cm(){return this.kd}Fd(t){var e;const i=this.kd.indexOf(t);i>=0&&(this.kd.splice(i,1),this.uU=!0,this.Is&&this.Vn&&(null===(e=this.cs.zn)||void 0===e?void 0:e.entity)===this&&this.cs.zn.collectionMember===t&&this.Vn(this,void 0,this.cs.zn.collectionMember))}ZG(t,e){var i;return t.AU=e,this.uU=!0,this.Is&&this.Vn&&(null===(i=this.cs.zn)||void 0===i?void 0:i.entity)===this&&this.cs.zn.collectionMember===t&&!t.AU&&this.Vn(this,void 0,this.cs.zn.collectionMember),t}QG(t,e){return t.$o=e,this.lU=!0,t}cU(t,e){return t.Za=e,this.nU=!0,t}dU(t,e){return t.M=e,this.oU=!0,t}KG(t,e){return t.fU=null==e?void 0:e.toUint32(),this.aU=!0,t}zs(){const t=this.Wo.C(),e=this.Wo.u,i=this.ua(),s=this.lU,r=this.nU,n=this.oU,o=this.aU,a=this.uU,l=this.Fe,u=this.ga(),c=this.kd.filter((t=>t.AU&&t.Za.length>0));if(this.kE.EV(this.At),(r||a)&&(this.tl=ei(...c.map((t=>Je(t.Za))))),r||a){const t=c.map((t=>[...t.Za,t.Za[0],{x:Number.NaN,y:Number.NaN}])).flat(),e=Jt(t,!1,Float64Array),i=this.At._i()?Jt(t,!0):e;this.OG=this.KR.CV(i,!1,this.OG);let s=[];c.reduce(((t,i)=>{const r=t,n=2*(i.Za.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.Za.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Za.length+2;for(let r=i;rt+e.Za.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Za.length+2;for(let r=i;rt+e.Za.length+2),0),e=new Float32Array(t);let i=0;const s={min:ze,max:_e};c.forEach((t=>{const r=void 0!==t.M?t.M:-34028234663852886e22,n=t.Za.length+2;for(let t=i;tt+e.Za.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.fU?t.fU:s,n=t.Za.length+2;for(let t=i;tthis.wU(t,e,i,c))),this.lU=!1,this.uU=!1,this.nU=!1,this.oU=!1,this.aU=!1,this.Wo.u=!1,this.Aa(this.Te),this.ma(l),this}qL(t,e){var i,s;const{fill:r,border:n}=this.NG,o=this.OG,h=this.vU,a=this.SU;if(!o||!h)return{};if(r){const{fillStyleSolid:s,fillStyleLinearGradient:n,fillStyleRadialGradient:l,fillStylePaletted:u,fillStyleImage:c,fillStyleIndividual:d}=r,f=this.pU,g=this.yU,y=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;y&&o&&f&&void 0!==g&&this.KR.cE(y).TV(y,((i,r,y,m)=>{if(this.At instanceof zi||this.At instanceof _c?this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(m("uScaleStart_highpart"),this.kE.hN()).IV(m("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(m("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(m("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(m("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(m("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(i("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(i("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),this.KR.NO(y,o,this.At._i(),void 0).fO(f).dO(r("aIsHighlighted"),h).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.KR.qV(i("uFirstId"),e),!a)return!1;this.KR.dO(r("aPickingIdOffset"),a)}else if(s)this.KR.PR(i("uColor"),s.getColor());else if(l){if(!this.WN)return!1;this.KR.EO(y,this.WN,l)}else if(n){if(!this.UN)return!1;this.KR.zO(y,this.UN,n)}else if(u){const t=gg(u,this,this.xU);if(!t&&u.lut.percentageValues)return!1;if(this.KR.tN(y,u.lut,t),"value"===u.getLookUpProperty()){if(!this.bU)return!1;this.KR.dO(r("aLookupValue"),this.bU)}}else if(c){if(!this._U)return!1;this.KR.PR(m("uColor"),c.getSurroundingColor()).PV(i("uColorTexture"),this._U.texture.aV()||this._U.sourceMissingTexture,0).FV(this._U.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).tO(c.fitMode)}else if(d){if(!this.MU)return!1;const t=r("aColor");this.KR.gl.bindBuffer(this.KR.gl.ARRAY_BUFFER,this.MU),this.KR.gl.vertexAttribPointer(t,4,this.KR.gl.UNSIGNED_BYTE,!0,0,0),this.KR.gl.enableVertexAttribArray(t)}return this.KR.gO(g,void 0,void 0,this.KR.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:i,fillStyleSolid:r,thickness:l}=n,u=this.mU,c=1===t?null===(s=n.mousePicking)||void 0===s?void 0:s.shader:n.shader;c&&o&&u&&this.KR.cE(c).TV(c,((s,n,c,d)=>{if(this.At instanceof zi||this.At instanceof _c?this.KR.IV(s("uScale"),this.kE.BV()).IV(s("uDisp"),this.kE.LV()).IV(d("uScaleStart_highpart"),this.kE.hN()).IV(d("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(d("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(d("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(d("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(d("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(s("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(s("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),this.KR.FV(h,1,{location:n("aIsHighlighted"),size:1}).PR(s("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(s("uRenderEffectMask"),2===t?1:0),1===t){if(this.KR.qV(s("uFirstId"),e),!a)return!1;this.KR.dO(n("aPickingIdOffset"),a,1)}else r&&this.KR.PR(s("uColor"),r.getColor());return Zy.PG(this.At._i(),this.KR,o,c,this.At._i()?4:2,0),Zy.qL(this.wN,i,c,this.VG&&1!==t,1===t,l,u),!0}))}return{idCount:this.kd.length}}wU(t,e,i,s){const r=ct({x:this.tl.min.x,y:this.tl.min.y},this.At,this.cs.At),n=ct({x:this.tl.max.x,y:this.tl.max.y},this.At,this.cs.At),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Ry(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.Za.length+2),0),f=new Float32Array(2*d),g=this.tl.max.x-this.tl.min.x,y=this.tl.max.y-this.tl.min.y,m=l-u,p=c-a;let A=0;for(const t of s){for(const e of t.Za){const t=u+m*((e.x-this.tl.min.x)/g),i=a+p*((e.y-this.tl.min.y)/y);f[A]=t,f[A+1]=i,A+=2}const e=u+m*((t.Za[0].x-this.tl.min.x)/g),i=a+p*((t.Za[0].y-this.tl.min.y)/y);f[A]=e,f[A+1]=i,A+=2,f[A]=Number.NaN,f[A+1]=Number.NaN,A+=2}return f}PN(t,e,i,s,r){return{collectionMember:this.kd.find((i=>e+i.gU===t))}}iE(){return this.pU&&(this.KR.zV(this.pU),this.pU=void 0),this.OG&&(this.KR.zV(this.OG),this.OG=void 0),this.vU&&(this.KR.zV(this.vU),this.vU=void 0),this.SU&&(this.KR.zV(this.SU),this.SU=void 0),this.bU&&(this.KR.zV(this.bU),this.bU=void 0),this.MU&&(this.KR.zV(this.MU),this.MU=void 0),this.NG={fill:void 0,border:void 0},this._U=this.KR.sN(this,this._U),this}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return Re(this.Fe)}Fl(){return Re(this.Fe)}}class fm extends cn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kE=new Dy,this.CU=Ne,this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStyleRadialGradient:()=>tt(this.Te)&&this.Te,fillStyleLinearGradient:()=>st(this.Te)&&this.Te,fillStyleImage:()=>ro(this.Te)&&this.Te,strokeStyleSolid:()=>ns(this.Fe)&&this.Fe,strokeFillSolid:()=>{const t=this.Fe.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.Fe.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.Fe.getFillStyle();return tt(t)&&t}}),this.wU=(t,e,i)=>{const s=ct(this.Oa(),this.At,this.cs.At),r=ci(ct(ui(this.Oa(),this.oi()),this.At,this.cs.At),s);return Ry(t,e,r.x,r.y,i)},this.wN=t,this.CN=e,this.KR=t.kN(),this.CN=e}zs(){super.zs();const t=this.Wo.C(),e=this.ua(),i=this.Sa.u||this.Z.u||this._a.u||this.Ca.u,s=this.Fe,r=this.ga(),n=s.getThickness(),o=this._a.C();this.kE.EV(this.At);const h=this.At.Ni();if(i){const t=this.Z.C();this.Za=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]=ri(n[0],r,t),n[1]=ri(n[1],r,t),n[2]=ri(n[2],r,t),n[3]=ri(n[3],r,t)}return n}(this.Sa.C(),t.x,t.y,o,this.Ca.C());const e=Jt(this.Za,this.At._i());this.VN=this.KR.CV(e,!1,this.VN),this.NN=this.Za.length,this.CU=Je(this.Za)}const a=this.RN.fillStyleSolid(e),l=this.RN.fillStyleRadialGradient(e),c=this.RN.fillStyleLinearGradient(e),d=this.RN.fillStyleImage(e),f=a||l||c||d;e&&(this.YN=f?this.KR.Cz(Yg["2D"],a&&Yg.Color({dataType:"uniform"}),c&&Yg.Color({dataType:["gradient",c]}),l&&Yg.Color({dataType:["gradient",l]}),d&&Yg.Color({dataType:["image",d]}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0),l?this.WN=vy(this.Ho||this.CU,this.At,l.getPosition(),l.getExtent(),l.getShape(),this.KR.dV()):c?this.UN=by(this.Ho||this.CU,this.At,c.getAngle(!0),this.KR.dV()):(this.WN=void 0,this.UN=void 0),this._U=this.KR.iN(this,this._U,d,void 0,h||i,this.wU);const g=this.RN.strokeStyleSolid(r),y=this.RN.strokeFillSolid(r),m=this.RN.strokeFillLinearGradient(r),p=this.RN.strokeFillRadialGradient(r),A=g,x=y||m||p;if(A&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.HN,this.kU]=[this.Za,void 0];else{const t=this.At;[this.HN,this.kU]=t instanceof _i?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Ui(s,r,h,-h),i.Ui(r,s,-h,-h),i.Ui(o,n,-h,-h),i.Ui(n,o,h,-h),i.Ui(s,r,-h,h),i.Ui(r,s,h,h),i.Ui(o,n,h,h),i.Ui(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.Za,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=oi(ni(r,s)),l=oi(ni(o,s)),c=gi(a),d=gi(l);return[[ui(s,ui(li(c,h.x),li(d,h.y))),ui(r,ui(li(a,h.x),li(d,h.y))),ui(o,ui(li(c,h.x),li(l,h.y))),ui(n,ui(li(a,h.x),li(l,h.y))),ui(s,ui(li(a,h.x),li(l,h.y))),ui(r,ui(li(c,h.x),li(l,h.y))),ui(o,ui(li(a,h.x),li(d,h.y))),ui(n,ui(li(c,h.x),li(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.Za,t.Wi(),n)}this.XN=this.KR.CV(Jt(this.HN,this.At._i()),!1,this.XN),this.kU?(this.TG=this.KR.rO(new Uint16Array(this.kU),this.TG),this.$N=this.kU.length):(this.TG&&this.KR.zV(this.TG),this.TG=void 0,this.$N=this.HN.length)}return r&&(this.qN=A&&x?this.KR.Cz(Yg["2D"],Yg.Color({dataType:p?["gradient",p]:m?["gradient",m]:"uniform"}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0),p?this.JN=vy(this.CU,this.At,p.getPosition(),p.getExtent(),p.getShape(),this.KR.dV()):m?this.KN=by(this.CU,this.At,m.getAngle(!0),this.KR.dV()):(this.JN=void 0,this.KN=void 0),this.tG=t&&f?this.tG||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0,this.iG=t&&this.Fe!==nt?this.iG||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0,this.Aa(this.Te),this.ma(s),this.Sa.u=!1,this._a.u=!1,this.Z.u=!1,this.Ca.u=!1,this}qL(t,e){const i=1===t?this.tG:this.YN,s=this.VN,r=this.NN,n=this.RN.fillStyleSolid(!1),o=this.RN.fillStyleRadialGradient(!1),h=this.RN.fillStyleLinearGradient(!1),a=this.RN.fillStyleImage(!1);i&&s&&r&&this.Te!==z&&(this.KR.cE(i),this.KR.TV(i,((i,l,u,c)=>{if(this.At instanceof zi||this.At instanceof _c?this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(c("uScaleStart_highpart"),this.kE.hN()).IV(c("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(c("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(c("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(c("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(c("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(i("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(i("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),1===t)this.KR.qV(i("uFirstId"),e).XO(u,1);else if(n)this.KR.PR(i("uColor"),n.getColor());else if(o){if(!this.WN)return!1;this.KR.EO(u,this.WN,o)}else if(h){if(!this.UN)return!1;this.KR.zO(u,this.UN,h)}else if(a){if(!this._U)return!1;const t=this._U&&this._U.texture.aV();this.KR.PR(c("uColor"),a.getSurroundingColor()).PV(i("uColorTexture"),t||this._U.sourceMissingTexture,0).FV(this._U.texCoordsBuffer,void 0,{location:l("aTextureCoord"),size:2}).tO(a.fitMode)}return this.KR.DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).NO(u,s,this.At._i(),void 0).qy(this.KR.gl.TRIANGLE_FAN,r),!0})));const l=1===t?this.iG:this.qN,u=this.RN.strokeStyleSolid(!1),c=this.RN.strokeFillSolid(!1),d=this.RN.strokeFillLinearGradient(!1),f=this.RN.strokeFillRadialGradient(!1),g=this.XN;return l&&g&&u&&(this.KR.cE(l),this.KR.TV(l,((i,s,r,n)=>{if(this.At instanceof zi||this.At instanceof _c?this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(n("uScaleStart_highpart"),this.kE.hN()).IV(n("uScaleStart_lowpart"),this.kE.rN()):this.At instanceof _i&&this.KR.IV(n("uScaleStart"),this.kE.MixedScaleXY.uScaleStart).IV(n("uScaleStartLog"),this.kE.MixedScaleXY.uScaleStartLog).IV(n("uScaleInterval"),this.kE.MixedScaleXY.uScaleInterval).IV(n("uScaleIntervalLog"),this.kE.MixedScaleXY.uScaleIntervalLog).IV(i("uViewportStart"),this.kE.MixedScaleXY.uViewportStart).IV(i("uViewportSize"),this.kE.MixedScaleXY.uViewportSize),1===t)this.KR.qV(i("uFirstId"),e).XO(r,1);else if(c)this.KR.PR(i("uColor"),c.getColor());else if(f){if(!this.JN)return!1;this.KR.EO(r,this.JN,f)}else if(d){if(!this.KN)return!1;this.KR.zO(r,this.KN,d)}return this.KR.DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).NO(r,g,this.At._i(),void 0),this.TG?this.KR.fO(this.TG).gO(this.$N):this.KR.qy(this.KR.gl.LINE_LOOP,this.$N),!0}))),{idCount:1}}PN(t,e,i,s,r){return{}}iE(){return this.TG&&(this.KR.zV(this.TG),this.TG=void 0),this.VN&&(this.KR.zV(this.VN),this.VN=void 0),this.XN&&(this.KR.zV(this.XN),this.XN=void 0),this._U=this.KR.sN(this,this._U),this.YN=void 0,this.qN=void 0,this.tG=void 0,this.iG=void 0,this}St(){return Math.max(this.Sa.C().x,this.Sa.C().x+this.Z.C().x)}vt(){return Math.min(this.Sa.C().x,this.Sa.C().x+this.Z.C().x)}bt(){return Math.max(this.Sa.C().y,this.Sa.C().y+this.Z.C().y)}xt(){return Math.min(this.Sa.C().y,this.Sa.C().y+this.Z.C().y)}Tl(){return Re(this.Fe)}Fl(){return Re(this.Fe)}}class gm extends fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kE=new Dy,this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStylePaletted:()=>K(this.Te)&&this.Te,fillStyleRadialGradient:()=>tt(this.Te)&&this.Te,fillStyleLinearGradient:()=>st(this.Te)&&this.Te,fillStyleImage:()=>ro(this.Te)&&this.Te,strokeLineStyleSolid:()=>ns(this.Fe)&&this.Fe,strokeLineSolidFill:()=>{const t=this.Fe.getFillStyle();return Y(t)&&t},strokeLinearGradientFill:()=>{const t=this.Fe.getFillStyle();return st(t)&&t},strokeRadialGradientFill:()=>{const t=this.Fe.getFillStyle();return tt(t)&&t}}),this.wU=(t,e,i)=>{const s=ct({x:this.tl.min.x,y:this.tl.min.y},this.At,this.cs.At),r=ct({x:this.tl.max.x,y:this.tl.max.y},this.At,this.cs.At),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Ry(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Za.length),d=this.tl.max.x-this.tl.min.x,f=this.tl.max.y-this.tl.min.y,g=a-l,y=u-h;let m=0;for(const t of this.Za){const e=l+g*((t.x-this.tl.min.x)/d),i=h+y*((t.y-this.tl.min.y)/f);c[m]=e,c[m+1]=i,m+=2}return c},this.wN=t,this.CN=e,this.KR=t.kN(),this.CN=e}qc(t){let e,i=Number.MAX_VALUE;for(const s of this.Za){const r=$e(ct(s,this.At,this.cs.At),t);r=3,r=this.Fe,n=this.ga(),o=r.getThickness(),a=this.ya(o);this.kE.EV(this.At),this.bT=this.At.Wi();const l=this.At.Ni();if(i&&(this.tl=Je(this.Za)),i&&s){const t=Jt(this.Za,this.At._i());this.VN=this.KR.CV(t,!1,this.VN),this.TU=new Uint16Array(h.default(t)),this.FU=this.KR.rO(this.TU,this.FU),this.NN=this.TU.length}const u=this.RN.fillStyleSolid(e),c=this.RN.fillStylePaletted(e),d=this.RN.fillStyleRadialGradient(e),f=this.RN.fillStyleLinearGradient(e),g=this.RN.fillStyleImage(e),y=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.YN=y?this.KR.Cz(Yg["2D"],u&&Yg.Color({dataType:"uniform"}),f&&Yg.Color({dataType:["gradient",f]}),d&&Yg.Color({dataType:["gradient",d]}),c&&Yg.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&Yg.Color({dataType:["image",g]}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0),d?this.WN=vy(this.Ho||this.tl,this.At,d.getPosition(),d.getExtent(),d.getShape(),this.KR.dV()):f?this.UN=by(this.Ho||this.tl,this.At,f.getAngle(!0),this.KR.dV()):(this.WN=void 0,this.UN=void 0),this._U=this.KR.iN(this,this._U,g,void 0,l||i,this.wU),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Za:_y(this.Za,this.bT,o);this.HN=Jt(t,this.At._i()),this.XN=this.KR.CV(this.HN,!0,this.XN),this.$N=t.length}const m=this.RN.strokeLineStyleSolid(n),p=this.RN.strokeLineSolidFill(n),A=this.RN.strokeLinearGradientFill(n),x=this.RN.strokeRadialGradientFill(n),S=m,v=p||A||x;return n&&(this.qN=S&&v?this.KR.Cz(Yg["2D"],Yg.Color({dataType:x?["gradient",x]:A?["gradient",A]:"uniform"}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0),x?this.JN=vy(this.Ho||this.tl,this.At,x.getPosition(),x.getExtent(),x.getShape(),this.KR.dV()):A?this.KN=by(this.Ho||this.tl,this.At,A.getAngle(!0),this.KR.dV()):(this.JN=void 0,this.KN=void 0),this.tG=t&&y?this.tG||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0,this.iG=t&&this.Fe!==nt?this.tG||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})):void 0,this.wl=!1,this.Aa(this.Te),this.ma(r),this}qL(t,e){const i=1===t?this.tG:this.YN,s=this.VN,r=this.NN,n=this.RN.fillStyleSolid(!1),o=this.RN.fillStyleRadialGradient(!1),h=this.RN.fillStyleLinearGradient(!1),a=this.RN.fillStylePaletted(!1),l=this.RN.fillStyleImage(!1);i&&s&&r&&this.KR.cE(i).TV(i,((i,r,u,c)=>{if(this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).IV(c("uScaleStart_highpart"),this.kE.hN()).IV(c("uScaleStart_lowpart"),this.kE.rN()).NO(u,s,this.At._i(),void 0).fO(this.FU).DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),1===t)this.KR.qV(i("uFirstId"),e).XO(u,1);else if(n)this.KR.PR(i("uColor"),n.getColor());else if(o){if(!this.WN)return!1;this.KR.EO(u,this.WN,o)}else if(h){if(!this.UN)return!1;this.KR.zO(u,this.UN,h)}else if(a){const t=gg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.KR.tN(u,a.lut,t)}else if(l){if(!this._U)return!1;this.KR.PR(c("uColor"),l.getSurroundingColor()).PV(i("uColorTexture"),this._U.texture.aV()||this._U.sourceMissingTexture,0).FV(this._U.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).tO(l.fitMode)}return this.KR.gO(this.NN),!0}));const u=1===t?this.iG:this.qN,c=this.Fe,d=this.XN,f=this.$N;return u&&d&&f&&this.KR.cE(u).TV(u,((i,s,r,n)=>{this.KR.DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).NO(r,d,this.At._i(),void 0);const o=c.getFillStyle();if(1===t)this.KR.qV(i("uFirstId"),e).XO(r,1);else if(Y(o))this.KR.PR(i("uColor"),o.getColor());else if(tt(o)){if(!this.JN)return!1;this.KR.EO(r,this.JN,o)}else if(st(o)){if(!this.KN)return!1;this.KR.zO(r,this.KN,o)}const h=c.getThickness(),a=-1===h||1===h;return this.KR.qy(a?this.KR.gl.LINE_LOOP:this.KR.gl.TRIANGLE_STRIP,this.$N),!0})),{idCount:1}}PN(t,e,i,s,r){return{}}iE(){return this.FU&&(this.KR.zV(this.FU),this.FU=void 0),this.VN&&(this.KR.zV(this.VN),this.VN=void 0),this.XN&&(this.KR.zV(this.XN),this.XN=void 0),this.YN=void 0,this.qN=void 0,this.tG=void 0,this.iG=void 0,this._U=this.KR.sN(this,this._U),this}}const ym=(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},pm=(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(!Ge(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const c=(d=a,f=h,y(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},m={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+m.primary,y:g.secondary},{x:g.primary+m.primary,y:g.secondary+m.secondary},{x:g.primary,y:g.secondary+m.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.BO(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.BO(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.BO(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Sm=(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 vm extends on{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.IU=p("bilinear"),this.Pi={x:0,y:0},this.mw={x:1,y:1},this.bS=Lr.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Kn={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}FS(t){return this.IU._(t),this}IS(){return this.IU.C()}CS(t,e){return this.Pi=t,this.mw=e,this}kS(){return{start:this.Pi,step:this.mw,end:{x:this.Pi.x+this.mw.x*this.Kn.columns,y:this.Pi.y+this.mw.y*this.Kn.rows}}}MS(t){return this.bS="function"==typeof t?t(this.bS):t,this}TS(){return this.bS}}class bm extends vm{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.kE=new Dy,this.NG={},this.PU=[],this.DU=!1,this.rl=!1,this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStylePaletted:()=>K(this.Te)&&this.Te,wireframeStyleLine:()=>ns(this.bS)&&this.bS,wireframeStyleFill:()=>{const t=this.bS&&this.bS.getFillStyle();return Y(t)&&t}}),this.BU=ym,this.wN=t,this.CN=e,this.KR=t.kN(),this.CN=e;const o=Math.min(this.KR.tE,void 0!==n.LU?n.LU:2048),h={x:Math.min(o,this.Kn.primaryDimensionVectorsCount),y:Math.min(o,this.Kn.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.Kn,h,this.BU),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.RU={gridTiles:l,gridTileSizes:u},this.CS(this.Pi,this.mw)}zs(){const t=this.PU,e=this.Te,i=this.ua(),s=this.bS,r=s!==this.EU,n=this.RN.fillStylePaletted(i),o=this.RN.fillStyleSolid(i),h=this.IU.u,a=this.IU.C(),l=this.rl,u=this.Wo.C();this.zU=this.zU||this.VU();const c=this.zU,d=pm(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Sm(this.KR,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.DU=!0),this.kE.EV(this.At);const f=this.NG;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.KR.Cz(Yg["2D"],Yg.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.Kn.dataOrder,intensityTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),Yg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:dg(this.At),flipXY:"rows"===this.Kn.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:"uniform"}),Yg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:dg(this.At),flipXY:"rows"===this.Kn.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.RN.wireframeStyleLine(r),e=this.RN.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:"uniform"}),Yg.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Kn.dataOrder,axisWorldTranslation:dg(this.At),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:"uniform"}),Yg.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Kn.dataOrder,axisWorldTranslation:dg(this.At),normalSource:void 0})),geometry:$y(this.KR,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.OU=this.OU||this.NU():this.OU&&(this.KR.zV(this.OU.wireframeCoordinatesBuffer),this.OU=void 0)}if(f.mousePicking=u?this.NG.mousePicking||{shader:this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:dg(this.At),flipXY:"rows"===this.Kn.dataOrder,normalSource:void 0}))}:void 0,this.NG=f,void 0===this.nl&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=ze,e=_e;this.zU.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.nl={min:t,max:e}}return this.rl=!1,this.PU.length=0,this.Aa(e),this.EU=s,this.IU.u=!1,this}VU(){const t=this.RU.gridTiles.map((t=>{const e=xm(this.KR,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.RU.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.KR.CV([0,0,1,0,0,1,1,1]),s=this.KR.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}NU(){const t=this.Kn.primaryDimensionVectorsCount+1+this.Kn.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.Kn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstVector.primary,y:this.Pi.y+this.mw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstVector.secondary,y:this.Pi.y+this.mw.y*t.iFirstVector.primary},i="columns"===this.Kn.dataOrder?{x:this.mw.x*t.sizeHeatmapDataVectors.primary,y:this.mw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.mw.x*t.sizeHeatmapDataVectors.secondary,y:this.mw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Kn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.mw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.mw.y*t.iFirstUniqueVector.primary},n="columns"===this.Kn.dataOrder?{x:this.mw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.mw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.mw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.mw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.GU={boundaries:s,tilesInfo:r},this}qL(t,e){var i,s;const r=this.zU,n=this.GU,o=1===t?null===(i=this.NG.mousePicking)||void 0===i?void 0:i.shader:null===(s=this.NG.tile)||void 0===s?void 0:s.shader;if(this.NG.tile&&o&&r&&n){const i=o,s=this.NG.tile,h={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.mw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.mw.y)},a={x:h.x/this.Kn.columns,y:h.y/this.Kn.rows},l=this.At.Wi(),u={x:a.x/l.x,y:a.y/l.y};if("solid"===s.renderMode||1===t)this.KR.cE(i).TV(i,((i,n,o)=>{if(1===t)this.KR.qV(i("uFirstId"),e).XO(o,1);else if("solid"===s.renderMode){const{fillStyleSolid:t}=s;this.KR.PR(i("uColor"),t.getColor())}return this.KR.DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).FV(r.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).IV(i("uScaling"),[this.mw.x*this.Kn.columns,this.mw.y*this.Kn.rows]).IV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).qy(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),!0}));else if("paletted"===s.renderMode){const{fillStylePaletted:e}=s,o=this.nl;this.KR.TV(i,((s,h,a)=>{let l=!1;var c,d;return this.KR.cE(i).IV(s("uScale"),this.kE.BV()).IV(s("uDisp"),this.kE.LV()).tN(a,e.lut,o).FV(r.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).DV(s("uIsHighlighted"),this.$o).PR(s("uHighlightColorOffset"),2===t?E:this.Qo).DV(s("uRenderEffectMask"),2===t?1:0),c=t=>{this.KR.IV(s("uTileDimensions"),["columns"===this.Kn.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Kn.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.KR.dV();if("bilinear"===this.IU.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.KR.ZV(s("uTileBounds"),o).IV(s("uScaling"),[i.renderSizeAxis.x,i.renderSizeAxis.y]).IV(s("uTranslationAxis"),[i.startRenderLocationAxis.x,i.startRenderLocationAxis.y]).PV(s("uTileIntensityValues"),t.intensityDataTexture,1).qy(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),l=!0},r.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),l}))}}const h=this.OU,a=this.NG.wireframe,l=1===t||null==a?void 0:a.shader;if(h&&a&&l&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.KR.cE(l).TV(l,((i,s,r)=>((this.At instanceof zi||this.At instanceof _c)&&this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()),this.KR.DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).PR(i("uColor"),e.getColor()).FV(h.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).IV(i("uScaling"),[this.mw.x,this.mw.y]).IV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).qy(this.KR.gl.LINES,2*h.wireframeSegmentsLength),!0)))}else if(h&&a&&l&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.KR.cE(l).TV(l,((r,n,o)=>((this.At instanceof zi||this.At instanceof _c)&&this.KR.IV(r("uScale"),this.kE.BV()).IV(r("uDisp"),this.kE.LV()),this.KR.DV(r("uIsHighlighted"),1===t||2===t?0:this.$o).PR(r("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(r("uRenderEffectMask"),2===t?1:0).PR(r("uColor"),s.getColor()).DV(r("uThicknessPixels"),i.getThickness()).IV(r("uRatioPxClip"),[2/this.cs.oi().x,2/this.cs.oi().y]).FV(h.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).IV(r("uScaling"),[this.mw.x,this.mw.y]).IV(r("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.cE(o,!1).qy(h.wireframeSegmentsLength),!0)))}return{idCount:1}}PN(t,e,i,s,r){return{}}PS(t){return this.PU.push(t),Am(this.RU.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.nl=void 0,this}Ot(){return this.DU&&(this.RU.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.rl=!0,this.DU=!1,this.nl=void 0),this}dispose(){super.dispose();const t=this.zU;t&&(t.gridTiles.forEach((t=>{this.KR.sE(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.KR.zV(t.rectangleLocationsBuffer)),this.zU=void 0;const e=this.OU;return e&&this.KR.zV(e.wireframeCoordinatesBuffer),this.OU=void 0,this.NG={},this}iE(){return this.dispose(),this}qc(t){const e=t,i="columns"===this.Kn.dataOrder?e.x:e.y,s="columns"===this.Kn.dataOrder?e.y:e.x,r="columns"===this.Kn.dataOrder?this.Pi.x:this.Pi.y,n="columns"===this.Kn.dataOrder?this.Pi.y:this.Pi.x;let o=(i-r)/("columns"===this.Kn.dataOrder?this.mw.x:this.mw.y),h=(s-n)/("columns"===this.Kn.dataOrder?this.mw.y:this.mw.x);o=Math.floor(Ft(o,0,this.Kn.primaryDimensionVectorsCount-1)),h=Math.floor(Ft(h,0,this.Kn.secondaryDimensionVectorsCount-1));const a=this.WU(o,h),l="columns"===this.Kn.dataOrder?{x:this.Pi.x+(o+.5)*this.mw.x,y:this.Pi.y+(h+.5)*this.mw.y}:{x:this.Pi.x+(h+.5)*this.mw.x,y:this.Pi.y+(o+.5)*this.mw.y},u="columns"===this.Kn.dataOrder?o:h,c="columns"===this.Kn.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}Xb(t){const e=this.GU;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.Kn.dataOrder?i.x:i.y,r="columns"===this.Kn.dataOrder?i.y:i.x,n="columns"===this.Kn.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.Kn.dataOrder?this.Pi.y:this.Pi.x,h="columns"===this.Kn.dataOrder?this.mw.x:this.mw.y,a="columns"===this.Kn.dataOrder?this.mw.y:this.mw.x,l=Ft((s-n)/h-.5,0,this.Kn.primaryDimensionVectorsCount-1),u=Ft((r-o)/a-.5,0,this.Kn.secondaryDimensionVectorsCount-1),c=Ft(Math.ceil(l)-1,0,this.Kn.primaryDimensionVectorsCount-1),d=Ft(Math.ceil(u)-1,0,this.Kn.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.WU(c,d)},g={point:{x:c,y:d+1},value:this.WU(c,d+1)},y={point:{x:c+1,y:d},value:this.WU(c+1,d)},m={point:{x:c+1,y:d+1},value:this.WU(c+1,d+1)},p=Hn({x:l,y:u},f,g,y,m);if(void 0===p)return;const A=Ft(Math.floor(l+.5),0,this.Kn.primaryDimensionVectorsCount-1),x=Ft(Math.floor(u+.5),0,this.Kn.secondaryDimensionVectorsCount-1),S="columns"===this.Kn.dataOrder?A:x,v="columns"===this.Kn.dataOrder?x:A,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}WU(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.GU)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.GU)||void 0===t?void 0:t.boundaries.min.x)||0}bt(){var t;return(null===(t=this.GU)||void 0===t?void 0:t.boundaries.max.y)||0}xt(){var t;return(null===(t=this.GU)||void 0===t?void 0:t.boundaries.min.y)||0}Tl(){return 0}Fl(){return 0}n_(){const t=[];return this.RU.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.mw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.GW=new nm(this.At,this));const t=this.GW.BW(this.LM,this.wu.C());if(t>0){for(let e=0;e0?this.LM[0].boundaries.min.x:ze:this.tl.min.y=this.LM.length>0?this.LM[0].boundaries.min.y:ze}this.LM.forEach((t=>t.shape.zs()));const e=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Bt(null===(i=e.shape.nl)||void 0===i?void 0:i.min,ze)),t.max=Math.max(t.max,Bt(null===(s=e.shape.nl)||void 0===s?void 0:s.max,_e)),t}),{min:ze,max:_e});return this.LM.forEach((t=>{t.shape.nl=e})),this.wu.u=!1,this}qL(t,e){let i=0;return this.LM.forEach((s=>{const{idCount:r}=s.shape.qL(t,e+i);void 0!==r&&(i+=r)})),{idCount:i}}PN(t,e,i,s,r){return{}}ES(t){if(0===t.length)return this;let e=0;const i=this.YU.dataPerSegment,s=t.length;do{let r=this.LM[this.LM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Kn.scrollDimension?i:this.Kn.resolution,rows:"rows"===this.Kn.scrollDimension?i:this.Kn.resolution,heatmapDataType:this.Kn.heatmapDataType,dataOrder:this.Kn.scrollDimension};let e="columns"===this.Kn.scrollDimension?{x:this.Pi.x+this.mw.x*this.UU,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.mw.y*this.UU};this.LM.length>0&&(e="columns"===this.Kn.scrollDimension?{x:e.x-1*this.mw.x,y:e.y}:{x:e.x,y:e.y-1*this.mw.y},o=!0);const s=new bm(this.wN,this.CN,this.At,Et,[],t).FS(this.IU.C()).Be(this.Te).MS(this.bS).CS(e,this.mw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.UU,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.xt()},max:{x:s.St(),y:s.bt()}}},this.LM.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.Kn.resolution};o&&(u.values.unshift(this.HU),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.PS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.HU=l[l.length-1],this.UU+=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.PS(c)}));const n=this.UU-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().iE()})),this.LM.length=0,this.tl="columns"===this.Kn.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.Kn.resolution*this.mw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.Kn.resolution*this.mw.x,y:this.Pi.y}),this.UU=0,this.HU=void 0,this}CS(t,e){return super.CS(t,e),this.LM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.CS(r,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.xt()},max:{x:i.shape.St(),y:i.shape.bt()}}})),this.LM.length>0?this.tl=ei(...this.LM.map((t=>t.boundaries))):this.tl="columns"===this.Kn.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.Kn.resolution*this.mw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.Kn.resolution*this.mw.x,y:this.Pi.y}),this}Be(t){return super.Be(t),this.LM.forEach((t=>t.shape.Be(this.Te))),this}MS(t){return super.MS(t),this.LM.forEach((t=>t.shape.MS(this.bS))),this}FS(t){return super.FS(t),this.LM.forEach((e=>e.shape.FS(t))),this}dispose(){return super.dispose(),this.LM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.LM.forEach((e=>e.shape.setVisible(t))),this}iE(){return this.LM.forEach((t=>t.shape.iE())),this}qc(t){const e=ct(t,this.At,this.engine.At),i=this.LM.reduce(((i,s)=>{const r=s.shape.qc(t);if(r){const t=Ze(ct(r,this.At,this.engine.At),e);if(void 0===i||t=this.UU||"rows"===this.Kn.scrollDimension&&e>=this.UU)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}Xb(t){const e=ct(t,this.At,this.engine.At),i=this.LM.reduce(((i,s)=>{const r=s.shape.Xb(t);if(r){const t=Ze(ct(r,this.At,this.engine.At),e);if(void 0===i||t=this.UU||"rows"===this.Kn.scrollDimension&&e>=this.UU)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Tl(){return 0}Fl(){return 0}ds(t){return super.ds(t),this.LM.forEach((e=>e.shape.ds(t))),this}}class Tm extends on{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.IU=p("bilinear"),this.bS=Lr.lineStyle,this.Kn=n}FS(t){return this.IU._(t),this}IS(){return this.IU.C()}MS(t){return this.bS="function"==typeof t?t(this.bS):t,this}TS(){return this.bS}}class Rm extends Tm{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.kE=new Dy,this.NG={},this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStylePaletted:()=>K(this.Te)&&this.Te}),this.wN=t,this.CN=e,this.KR=t.kN(),this.CN=e,this.h_=new bm(this.wN,t.$U,t.At,Et,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",LU:this.KR.tE}).MS(nt);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.XU={vertexBuffer:this.KR.CV(h),drawMode:this.KR.gl.TRIANGLE_FAN,drawLength:362}}zs(){const t=this.ua(),e=this.Te,i=this.RN.fillStyleSolid(t),s=this.RN.fillStylePaletted(t),r=i||s,n=this.IU.C(),o=this.IU.u,h=this.Wo.C(),a=this.Wo.u;return this.kE.EV(this.At),this.h_.zs(),this.h_.zU?((t||o)&&(this.NG.fill=r?{shader:this.KR.Cz(Yg["2D"],Yg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:dg(this.At),normalSource:void 0}),s&&Yg.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.Kn.dataOrder,lut:s.lut}),i&&Yg.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.NG.mousePicking=h?{shader:this.KR.Cz(Yg["2D"],Yg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:dg(this.At),normalSource:void 0}),Yg.MousePicking())}:void 0),this.Aa(e),this.IU.u=!1,this.Wo.u=!1,this):this}qL(t,e){var i;const{vertexBuffer:s,drawLength:r,drawMode:n}=this.XU,o=this.h_.zU;if(!this.NG.fill||!o)return{};const{fillStylePaletted:h,fillStyleSolid:a}=this.NG.fill,l=1===t?null===(i=this.NG.mousePicking)||void 0===i?void 0:i.shader:this.NG.fill.shader;if(!l)return{};const u=this.At.Tb(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this.Kn.amplitudeStart,this.Kn.amplitudeStart+(this.Kn.annuli-1)*this.Kn.amplitudeStep),g=Math.max(this.Kn.amplitudeStart,this.Kn.amplitudeStart+(this.Kn.annuli-1)*this.Kn.amplitudeStep);let y;return y=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.KR.cE(l).TV(l,((i,l,u,c)=>{if(this.KR.IV(i("uScale"),this.kE.BV()).IV(i("uDisp"),this.kE.LV()).DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0).IV(c("uViewportSize"),[this.wN.oi().x*this.KR.dV()/(1===t?this.cs.Kn.so:1),this.wN.oi().y*this.KR.dV()/(1===t?this.cs.Kn.so:1)]).IV(i("uScaling"),[y,y]).IV(i("uTranslationAxis"),[0,0]).FV(s,void 0,{location:l("aPos"),size:2}).DV(c("uAngleOffset"),this.At.Bb()%(2*Math.PI)).DV(c("uAngleDirection"),this.At.Vb()?1:-1).DV(c("uSectors"),this.Kn.sectors).DV(c("uAnnuli"),this.Kn.annuli),1===t)this.KR.qV(i("uFirstId"),e).XO(u,1);else{if(h){const t=this.h_.nl;this.KR.DV(i("uAmplitudeStart"),this.Kn.amplitudeStart).DV(i("uAmplitudeStep"),this.Kn.amplitudeStep).DV(i("uAmplitudeAxisStart"),this.At.Tb().start).DV(i("uAmplitudeAxisEnd"),this.At.Tb().end).tN(u,h.lut,t).PV(i("uTileIntensityValues"),o.gridTiles[0].intensityDataTexture,0)}a&&this.KR.PR(i("uColor"),a.getColor())}return this.KR.qy(n,r),!0})),{idCount:1}}PN(t,e,i,s,r){return{}}PS(t){return this.h_.PS(t),this}Ot(){return this.h_.Ot(),this}dispose(){return super.dispose(),this.h_.dispose(),this.NG={},this.KR.zV(this.XU.vertexBuffer),this}iE(){return this.dispose(),this}Be(t){return super.Be(t),this.h_.Be(this.Te),this}qc(t){const e=this.Kn.amplitudeStart,i=this.Kn.amplitudeStart+(this.Kn.annuli-1)*this.Kn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;let n=Math.round((t.angle-0)/360*this.Kn.sectors);n>=this.Kn.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.Kn.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.WU(o,n),angle:n*(360/this.Kn.sectors),amplitude:e+o*(i-e)/(this.Kn.annuli-1)}}Xb(t){const e=this.Kn.amplitudeStart,i=this.Kn.amplitudeStart+(this.Kn.annuli-1)*this.Kn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;const n=(t.angle-0)/360*this.Kn.sectors,o=(t.amplitude-e)/(i-e)*(this.Kn.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.WU(a,h)},u={point:{x:a,y:h+1},value:this.WU(a,h+1)},c={point:{x:a+1,y:h},value:this.WU(a+1,h)},d={point:{x:a+1,y:h+1},value:this.WU(a+1,h+1)},f=Hn({x:o,y:n},l,u,c,d);return void 0!==f?{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}WU(t,e){const i="annuli"===this.Kn.dataOrder?t:e,s="annuli"===this.Kn.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}Tl(){return 0}Fl(){return 0}}class wm extends My{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.CG();this.kG=t.CV(e),this.FG=s,this.IG=i}cE(t){return this.KR.FV(this.kG,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}qy(t,e,i){return this.KR.pO(void 0!==e?e:this.IG,i||0,this.FG,t),this}CG(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.KR.gl.TRIANGLES,drawSize:6}}jz(){this.KR.zV(this.kG)}}const km=t=>{let e=t.YV.Uz.get(void 0);return e||(e=new wm(t),t.YV.Uz.set(void 0,e),e)};class Em extends pn{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.jU=Lr.fillStyle,this.ZU=Lr.fillStyle,this.QU=p(e.PointShape.Circle),this.JU=p(5),this.KU=p(0),this.qU=p(void 0),this.VC=!0,this.tY={x:0,y:0}}vd(t){return this.jU=sn(this.jU,t),this}NC(){return this.jU}iY(){return rn(this.sY,this.jU)}eY(){return rn(this.hY,this.ZU)}md(t){return this.ZU=sn(this.ZU,t),ro(this.ZU)&&(this.xd(e.PointShape.Square),this.Cd(1)),this}wd(){return this.ZU}xd(t){return this.QU._(t),co(this.QU.C())&&this.Cd(1),this}bd(){return this.QU.C()}Cd(t){return this.JU._(t),this}GC(){return this.JU.C()}Md(t){return this.KU._(t),this}_d(){return this.KU.C()}WC(t){return this.tY=t,this}UC(){return this.tY}zC(t){return this.qU._(t),this}YC(){return this.qU.C()}}class Im extends tm{constructor(t,e){super(t,e),this.lW=!1,this.uW={enabled:!1,totalDataPointsAtTime:0},this.dW=t instanceof zi?{type:"linear",scale:t}:{type:"unknown"},this.aW.Ko("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.lW=!0)}))}rY(t,e){var i,s;const r=null==t?void 0:t.Bc,n=null==t?void 0:t.Lc,o=null==t?void 0:t.yc,h=null==t?void 0:t.gc;if(!t||this.lW||!this.rW||"linear"!==this.dW.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.Dc())||void 0===i?void 0:i.x,l=null===(s=t.Jc())||void 0===s?void 0:s.x;if(o<2||void 0===a||void 0===l||l===a)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,a,o),c=this.dW.scale,d=Math.abs("x"===this.rW?c.Wi().x:c.Wi().y),f=d/u,g=Math.floor(.8*f),y=g*u,m=g>=4,p=this.uW.enabled?this.uW.columnWidthAxis/d<1.5:void 0,A=this.uW.enabled&&g>this.uW.dataPointsPerColumn?g/this.uW.dataPointsPerColumn>=2:void 0;let x;return!0===this.uW.enabled?p?A&&(x={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}):x=m?{enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:m&&(x={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.uW=x||{...this.uW,totalDataPointsAtTime:o},!!x&&this.pW(),{cpStateChanged:!!x,cpActive:this.uW.enabled}}nY(t,e){var i,s,r;const n=t.Bc,o=t.Lc,h=t.mc,a=t.yc,l=t.gc;if(this.lW||!this.uW.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.uW.columnWidthAxis,d=this.At.x.getInnerStart(),f=this.At.x.getInnerEnd(),g=po(d,f,n,h,a,l,e,1);if(!g)return;const y=n[g.iFirstSampleDataArray];if(this.oY){if(this.oY.iFirstPackedSample0)if(this.oY.packedColumnsCount-=t,this.oY.packedColumnsCount>0){this.oY.packedDataX.splice(0,2*t),this.oY.packedDataY.splice(0,2*t),this.oY.packedDataColors&&this.oY.packedDataColors.splice(0,2*t),this.oY.packedDataLookupValues&&this.oY.packedDataLookupValues.splice(0,2*t),this.oY.origin+=t*c;const e=Ao(this.oY.origin,Math.max(h-1-u+1,0),h-1,(t=>n[mo(t,h,u)])),i=mo(e,h,u);this.oY.iFirstPackedSample=n[i]>=this.oY.origin?e:e+1}else this.oY=void 0}if(void 0!==(null===(i=this.oY)||void 0===i?void 0:i.iLastPackedSample)&&this.oY.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.oY.origin+this.oY.packedColumnsCount*c-t)/c),this.oY.packedColumnsCount);if(e>0)if(this.oY.packedColumnsCount-=e,this.oY.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.oY.packedDataX.pop(),this.oY.packedDataY.pop(),this.oY.packedDataColors&&this.oY.packedDataColors.pop(),this.oY.packedDataLookupValues&&this.oY.packedDataLookupValues.pop();const t=Ao(this.oY.origin+this.oY.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[mo(t,h,u)])),i=mo(t,h,u);this.oY.iLastPackedSample=n[i]<=this.oY.origin+this.oY.packedColumnsCount*c?t:t-1}else this.oY=void 0}}const m=this.oY||{origin:y,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.Wc?[]:void 0,packedDataLookupValues:t.Gc?[]:void 0,packedDataSize:t.Uc?[]:void 0,packedDataRotation:t.Yc?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},p=(t,e,i)=>{let s=Math.min(t,t+e*c),r=Math.max(t,t+e*c),a=i;const l=[];let y=_e,p=_e,A=-1,x=ze,S=ze,v=-1,b=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const i=a%u,g=n[i],M=o[i];if(s<=g&&g<=r)b+=1,Number.isNaN(M)||(M>p&&(y=g,p=M,A=a),M0)y=y===_e?Number.NaN:y,p=p===_e?Number.NaN:p,x=x===ze?Number.NaN:x,S=S===ze?Number.NaN:S,A0?(m.packedDataX.push(y),m.packedDataY.push(p),m.packedDataX.push(x),m.packedDataY.push(S)):(m.packedDataX.unshift(x),m.packedDataY.unshift(S),m.packedDataX.unshift(y),m.packedDataY.unshift(p))):(l.push({iFirst:v,iSecond:A}),e>0?(m.packedDataX.push(x),m.packedDataY.push(S),m.packedDataX.push(y),m.packedDataY.push(p)):(m.packedDataX.unshift(y),m.packedDataY.unshift(p),m.packedDataX.unshift(x),m.packedDataY.unshift(S)));else{const t=e>0?m.iLastPackedSample:m.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(m.packedDataX.push(Number.NaN),m.packedDataY.push(Number.NaN),m.packedDataX.push(Number.NaN),m.packedDataY.push(Number.NaN)):(m.packedDataX.unshift(Number.NaN),m.packedDataY.unshift(Number.NaN),m.packedDataX.unshift(Number.NaN),m.packedDataY.unshift(Number.NaN));else{const i=mo(t,h,u),a=n[i],d=o[i],f=(s+r)/2,y=f-e*c/6,p=d+(y-a)/(g-a)*(M-d),A=f+e*c/6,x=d+(A-a)/(g-a)*(M-d);l.push({iFirst:t,iSecond:t}),e>0?(m.packedDataX.push(y),m.packedDataY.push(p),m.packedDataX.push(A),m.packedDataY.push(x)):(m.packedDataX.unshift(y),m.packedDataY.unshift(p),m.packedDataX.unshift(A),m.packedDataY.unshift(x))}}if(m.packedColumnsCount+=1,e>0?m.iLastPackedSample=a-1:(m.iFirstPackedSample=a+1,m.origin=s),s=Math.min(t+l.length*e*c,t+(l.length+1)*e*c),r=Math.max(t+l.length*e*c,t+(l.length+1)*e*c),b=0,y=_e,p=_e,A=-1,x=ze,S=ze,v=-1,sf)break}}return l},A=p(m.origin+m.packedColumnsCount*c,1,void 0!==(null===(s=this.oY)||void 0===s?void 0:s.iLastPackedSample)?this.oY.iLastPackedSample+1:g.iFirstSample),x=p(m.origin,-1,void 0!==(null===(r=this.oY)||void 0===r?void 0:r.iFirstPackedSample)?this.oY.iFirstPackedSample-1:g.iFirstSample),S=t.Wc&&m.packedDataColors?[t.Wc,m.packedDataColors]:void 0,v=t.Gc&&m.packedDataLookupValues?[t.Gc,m.packedDataLookupValues]:void 0,b=t.Uc&&m.packedDataSize?[t.Uc,m.packedDataSize]:void 0,M=t.Yc&&m.packedDataRotation?[t.Yc,m.packedDataRotation]:void 0;if(S||v||b||M){for(const t of A){const e=mo(t.iFirst,h,u),i=mo(t.iSecond,h,u);S&&S[1].push(S[0][e],S[0][i]),v&&v[1].push(v[0][e],v[0][i]),b&&b[1].push(b[0][e],b[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of x){const e=mo(t.iFirst,h,u),i=mo(t.iSecond,h,u);S&&S[1].unshift(S[0][i],S[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.oY=m.packedColumnsCount>0?m:void 0,{x:m.packedDataX,y:m.packedDataY,color:m.packedDataColors,lookup:m.packedDataLookupValues,size:m.packedDataSize,rotation:m.packedDataRotation}}pW(){this.oY=void 0}vW(t){if(this.rW&&"linear"===this.dW.type){const e="x"===this.rW?this.dW.scale.x.ug:this.dW.scale.y.ug;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.ah===Ws.progressive||e.ah===Ws.regressive){const e=Math.abs("x"===this.rW?this.dW.scale.x.getInnerInterval():this.dW.scale.y.getInnerInterval());if(this.uW.enabled)return 2*e/this.uW.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.rW?s.x:s.y,"x"===this.rW?r.x:r.y,i)}}}SW(t,e,i){if(!this.rW)return e;const s=i.length;let r=jr(i,t.min,this.rW,this.nW,0,s-1);void 0===r&&(r=this.nW?s-1:0);let n=jr(i,t.max,this.rW,this.nW,0,s-1);return void 0===n&&(n=this.nW?0:s-1),1+Math.abs(n-r)}xW(){}}class Fm extends Em{constructor(t,e,i,s){super(t,e,i,s),this.kE=new Dy,this.OW=new Im(this.At,this),this.RN=fg({lineStyleSolid:()=>ns(this.yu)&&this.yu,lineStyleDashed:()=>ao(this.yu)&&this.yu,strokeFillSolid:()=>{const t=this.yu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.yu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.yu.getFillStyle();return tt(t)&&t},strokeFillIndividual:()=>{const t=this.yu.getFillStyle();return H(t)&&t},strokeFillPaletted:()=>{const t=this.yu.getFillStyle();return K(t)&&t},areaFillSolid:()=>Y(this.jU)&&this.jU,areaFillLinearGradient:()=>st(this.jU)&&this.jU,areaFillRadialGradient:()=>tt(this.jU)&&this.jU,areaFillIndividual:()=>H(this.jU)&&this.jU,areaFillPaletted:()=>K(this.jU)&&this.jU,markerFillSolid:()=>Y(this.ZU)&&this.ZU,markerFillLinearGradient:()=>st(this.ZU)&&this.ZU,markerFillRadialGradient:()=>tt(this.ZU)&&this.ZU,markerFillPaletted:()=>K(this.ZU)&&this.ZU,markerFillIndividual:()=>H(this.ZU)&&this.ZU,markerFillImage:()=>ro(this.ZU)&&this.ZU,markerShapeIcon:()=>{const t=this.QU.C();return co(t)&&t}}),this.pd=p(void 0),this.aY=[],this.rl=!1,this.lY=[],this.uY=void 0,this.bM={Vk:"x",Ok:()=>this.cY()},this.wU=(t,e,i)=>{var s;const r=null===(s=this.dY)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.oi().x,o=r.oi().y),Ry(t,e,n*this.JU.C(),o*this.JU.C(),i)},this.CN=e,this.NG={type:"none"},this.KR=t.kN(),this.wN=t,this.VG=this.KR.MO}yd(t){return this.pd._(De(t,this.pd.C(),(()=>[t.td(((e,i)=>{this.aY.push({min:e,max:i}),void 0===t.jc()&&this.fY&&this.lY.push({min:e,max:i})})),t.sd((()=>{this.rl=!0,this.fY=void 0,this.uY=void 0,this.OW.pW()}))]))),this.uY=void 0,this}cY(){var t,i,s,r,n,o,h,a,l,c,d,f,g;const y=null===(t=this.pd.C())||void 0===t?void 0:t.Gt,m=this.pd.u,p=null==y?void 0:y.Bc,A=null==y?void 0:y.Lc;if(!y||!p||!A)return;const x=y.Gc,S=y.Wc,v=y.Uc,b=y.Yc,M=y.mc,C=y.yc,T=y.gc,R=m||this.ga()||this.iY()||this.eY(),w=this.RN.lineStyleSolid(R),k=this.RN.lineStyleDashed(R),E=w||k,I=E&&E.getThickness(),F=this.RN.strokeFillSolid(R),D=this.RN.strokeFillLinearGradient(R),B=this.RN.strokeFillRadialGradient(R),P=this.RN.strokeFillIndividual(R),L=this.RN.strokeFillPaletted(R),V=F||D||B||P||L,z=this.RN.areaFillSolid(R),_=this.RN.areaFillLinearGradient(R),N=this.RN.areaFillRadialGradient(R),O=this.RN.areaFillIndividual(R),U=this.RN.areaFillPaletted(R),Y=z||_||N||O||U,G=this.RN.markerFillSolid(R),H=this.RN.markerFillLinearGradient(R),W=this.RN.markerFillRadialGradient(R),K=this.RN.markerFillPaletted(R),X=this.RN.markerFillIndividual(R),j=this.RN.markerFillImage(R),$=G||H||W||K||X||j,Z=this.QU.C(),Q=this.QU.u,q=this.RN.markerShapeIcon(Q),J=this.JU.C(),tt=this.JU.u,et=this.qU.u,it=this.aY.length>0||et,st=this.rl,rt=st?[y.Zc()]:(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.aY),nt=this.At.x.Yt,ot=this.At.x.getInnerStart(),ht=this.At.x.getInnerEnd(),at=y.jc(),lt=!!k,ut=this.Wo.C(),ct=this.Wo.u,{cpStateChanged:dt,cpActive:ft}=this.OW.rY(y,this.VC);if(at&&ft&&(dt||st||it||nt||R)){const t=this.OW.nY(y,at);if(t){const e=!dt&&!st&&!R;this.AY=Dm(this.KR,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,lt,this.AY,e,at,1e3,this.At._i(),(t=>qt(t,this.At._i()))),this.gY={min:ze,max:_e};const i=t.y.length;for(let e=0;ethis.mY.iLastSample||R){let i,s,r,n,h,a;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=p.subarray(e.offset,e.offset+e.count),s=A.subarray(e.offset,e.offset+e.count),r=S?S.subarray(e.offset,e.offset+e.count):void 0,n=x?x.subarray(e.offset,e.offset+e.count):void 0,h=v?v.subarray(e.offset,e.offset+e.count):void 0,a=b?b.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],o=t.dataRanges[1],l=e.count+o.count;i=new Float32Array(l),i.set(p.subarray(e.offset),0),i.set(p.subarray(o.offset,o.offset+o.count),e.count),s=new Float32Array(l),s.set(A.subarray(e.offset),0),s.set(A.subarray(o.offset,o.offset+o.count),e.count),S&&(r=new Uint32Array(l),r.set(S.subarray(e.offset),0),r.set(S.subarray(o.offset,o.offset+o.count),e.count)),x&&(n=new Float32Array(l),n.set(x.subarray(e.offset),0),n.set(x.subarray(o.offset,o.offset+o.count),e.count)),v&&(h=new Float32Array(l),h.set(v.subarray(e.offset),0),h.set(v.subarray(o.offset,o.offset+o.count),e.count)),b&&(a=new Float32Array(l),a.set(b.subarray(e.offset),0),a.set(b.subarray(o.offset,o.offset+o.count),e.count))}const l=!dt&&!st&&!R;this.yY=Dm(this.KR,[i,s],r,n,h,a,lt,this.yY,l,at,1e3,this.At._i(),(t=>qt(t,this.At._i())));let c=i,d=s,f=r,g=n;const y=this.qU.C();if(y){const t="spline"===y.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:r,colors:n}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:r?Array.from(r):void 0,colors:n?Array.from(n):void 0};const o=((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=oi(ci({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]=ui(li(n,c),g[1]),g[2]=ci(g[2],li(o,d)),r[f]=g}}return r.length>0?r:[]})(i,s),h=o.length,a=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:r,lookupValues:n,colors:o}=t,h=[],a=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=r[0];h[t]=e,a[t]=i,t+=1;for(let n=1;nqt(t,this.At._i()))),this.mY=t}}else this.pY=void 0;if(!at&&(st||it||R)){if(!this.AY||this.AY.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.KR.eO(t,i.min*(this.At._i()?2:1),qt(h,this.At._i())),this.KR.eO(e,i.min*(this.At._i()?2:1),qt(a,this.At._i())),S&&(null===(s=this.AY)||void 0===s?void 0:s.bufferColors)){const t=S.subarray(i.min,i.max+1);this.KR.eO(this.AY.bufferColors,i.min,t,Uint32Array)}if(x&&(null===(r=this.AY)||void 0===r?void 0:r.bufferLookupValues)){const t=x.subarray(i.min,i.max+1);this.KR.eO(this.AY.bufferLookupValues,i.min,t,Float32Array)}if(b&&(null===(n=this.AY)||void 0===n?void 0:n.bufferRotations)){const t=b.subarray(i.min,i.max+1);this.KR.eO(this.AY.bufferRotations,i.min,t,Float32Array)}if(v&&(null===(o=this.AY)||void 0===o?void 0:o.bufferSizes)){const t=v.subarray(i.min,i.max+1);this.KR.eO(this.AY.bufferSizes,i.min,t,Float32Array)}})),this.AY.valueCount=y.yc}this.yY=this.AY}if(R||tt||Q||ct){if(V&&E&&!1!==I){const t=-1===I?"primitive":"triangulated",e=L?["lookup",L.lookUpProperty,L.lut]:P?"attribute":D?["gradient",D]:B?["gradient",B]:"uniform";this.NG="primitive"===t?{type:t,shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0}),k&&Yg.StippleTexture),lineStyleSolid:w,lineStyleDashed:k,fillStyleSolid:F,fillStyleLinearGradient:D,fillStyleRadialGradient:B,fillStyleIndividual:P,fillStylePaletted:L,mousePickingShader:ut&&this.KR.Cz(Yg["2D"],Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0}),k&&Yg.StippleTexture,Yg.MousePicking({useVertexId:!0}))}:"triangulated"===t?{type:t,shader:this.KR.Cz(Yg["2D"],Yg.Color({dataType:e}),Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0}),this.VG?Yg.AliasedEdge:void 0,k&&Yg.StippleTextureInstanced),geometry:$y(this.KR,I),thickness:I,lineStyleSolid:w,lineStyleDashed:k,fillStyleSolid:F,fillStyleLinearGradient:D,fillStyleRadialGradient:B,fillStyleIndividual:P,fillStylePaletted:L,mousePickingShader:ut&&this.KR.Cz(Yg["2D"],Yg.LineInstanced2D({axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0}),k&&Yg.StippleTextureInstanced,Yg.MousePicking())}:{type:"none"}}else this.NG={type:"none"};if(this.vY=Y?{shader:this.KR.Cz(Yg["2D"],U&&Yg.Color({dataType:["lookup",U.lookUpProperty,U.lut]}),O&&Yg.Color({dataType:"attribute"}),z&&Yg.Color({dataType:"uniform"}),_&&Yg.Color({dataType:["gradient",_]}),N&&Yg.Color({dataType:["gradient",N]}),Yg.Area2D({axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0})),geometry:km(this.KR),fillStyleSolid:z,fillStyleLinearGradient:_,fillStyleRadialGradient:N,fillStyleIndividual:O,fillStylePaletted:U,mousePickingShader:ut&&this.KR.Cz(Yg["2D"],Yg.Area2D({axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0}),Yg.MousePicking())}:void 0,$){const t=!(!j&&!q),e=J>1||t,i=v?"attribute":"uniform",s=!e&&Yg.PointSize("uniform"),r=Yg.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:b?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:b?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:dg(this.At),normalSource:void 0,splitPosAttribute:!0});this.dY={shader:this.KR.Cz(Yg["2D"],s,r,G&&Yg.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!q}),H&&Yg.Color({dataType:["gradient",H],overrideOpacity:!0,maskTexture:!!q}),W&&Yg.Color({dataType:["gradient",W],overrideOpacity:!0,maskTexture:!!q}),K&&Yg.Color({dataType:["lookup",K.getLookUpProperty(),K.getPalette()],overrideOpacity:!0,maskTexture:!!q}),X&&Yg.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!q}),j&&Yg.Color({dataType:["image",j],overrideOpacity:!0,maskTexture:!!q})),geometry:um(Z,this.KR,"uniform"===i?J:25),fillStyleSolid:G,fillStyleLinearGradient:H,fillStyleRadialGradient:W,fillStylePaletted:K,fillStyleIndividual:X,fillStyleImage:j,mousePickingShader:ut&&this.KR.Cz(Yg["2D"],s,r,Yg.MousePicking({useVertexId:!e})),shapeIcon:q,pointSizeAsScale:t,instancedRendering:e}}else this.dY=void 0}if((void 0===this.uY||it)&&x&&(yg(L)||yg(U)||yg(K))){const t=this.uY?rt:[y.Zc()];let e=this.uY?this.uY.max:_e,i=this.uY?this.uY.min:ze;const s=x;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.uY={min:i,max:e}}this._U=this.KR.iN(this,this._U,j,q,tt,this.wU),this.WG=k?this.KR.QO(k.getPattern()):void 0,this.xu(this.yu),this.sY=this.jU,this.hY=this.ZU,this.QU.u=!1,this.JU.u=!1,this.aY.length=0,this.rl=!1,this.qU.u=!1,this.pd.u=!1,this.Wo.u=!1}zs(){this.cY();const t=this.RN.strokeFillLinearGradient(!1),e=this.RN.strokeFillRadialGradient(!1),i=this.RN.areaFillLinearGradient(!1),s=this.RN.areaFillRadialGradient(!1),r=this.RN.markerFillLinearGradient(!1),n=this.RN.markerFillRadialGradient(!1);this.kE.EV(this.At);const o=en({min:{x:this.vt(),y:this.At.y.getInnerStart()},max:{x:this.St(),y:this.bt()}},{x:this.Tl(),y:this.Fl()},this.At),h=en({min:{x:this.vt(),y:this.xt()},max:{x:this.St(),y:this.bt()}},{x:this.Tl(),y:this.Fl()},this.At);return this.SY=this.KR.nN(t,this,h),this.xY=this.KR.oN(e,this,h),this.bY=this.KR.nN(i,this,o),this.MY=this.KR.oN(s,this,o),this._Y=this.KR.nN(r,this,h),this.wY=this.KR.oN(n,this,h),this}qL(t,e){var i,s,r,n,o,h,a,l,u,c,d,f,g,y,m,p,A,x,S;const v=this.KR.gl,b=null===(i=this.AY)||void 0===i?void 0:i.bufferX,M=null===(s=this.AY)||void 0===s?void 0:s.bufferY,C=null===(r=this.AY)||void 0===r?void 0:r.bufferColors,T=null===(n=this.AY)||void 0===n?void 0:n.bufferLookupValues,R=null===(o=this.AY)||void 0===o?void 0:o.valueCount,w=null===(h=this.yY)||void 0===h?void 0:h.valueCount,k=null===(a=this.pd.C())||void 0===a?void 0:a.Gt,E=null==k?void 0:k.jc(),I=Math.max((null===(l=this.AY)||void 0===l?void 0:l.valueCount)||0,(null===(u=this.yY)||void 0===u?void 0:u.valueCount)||0);if(!b||!M||!k)return{};const F=(e,i,s)=>{if(Pm(this.KR,e,this.At._i(),b,"aLocation","X",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),Pm(this.KR,e,this.At._i(),M,"aLocation","Y",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!C)return!1;Pm(this.KR,e,!1,C,"aColor","",4,!0,v.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!T)return!1;Pm(this.KR,e,!1,T,"aLookupValue","",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},D=1===t?null===(c=this.vY)||void 0===c?void 0:c.mousePickingShader:null===(d=this.vY)||void 0===d?void 0:d.shader;if(this.vY&&D&&void 0!==R&&R>0&&E&&2!==t){const i=this.vY;this.KR.cE(D).TV(D,((s,r,n,o)=>!!this.KR.eN(n,t,this,{uniforms:this.kE,idFirst:e,useInstanceID:1===t?I:void 0,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStylePaletted:i.fillStylePaletted,linearGradientInfo:this.bY,radialGradientInfo:this.MY,lookupValueRange:i.fillStylePaletted?gg(i.fillStylePaletted,this,this.uY):void 0,lookupValueBuffer:null})&&!!F(n,i.fillStyleIndividual,i.fillStylePaletted)&&(null==i||i.geometry.cE(n).qy(R-1),!0)))}const B="none"===this.NG.type?void 0:1===t?this.NG.mousePickingShader:this.NG.shader;if("none"!==this.NG.type&&B&&void 0!==R&&R>0){const i=this.NG;this.KR.cE(B).TV(B,((s,r,n,o)=>{var h,a;if(!this.KR.eN(n,t,this,{uniforms:this.kE,idFirst:e,useInstanceID:1===t&&"triangulated"===i.type?I:void 0,useVertexID:1===t&&"primitive"===i.type?I:void 0,fillStyleSolid:i.fillStyleSolid,fillStylePaletted:i.fillStylePaletted,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStyleIndividual:i.fillStyleIndividual,linearGradientInfo:this.SY,radialGradientInfo:this.xY,lookupValueRange:i.fillStylePaletted?gg(i.fillStylePaletted,this,this.uY):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.WG)return!1;this.KR.IV(s("uStippleCount"),[this.cs.oi().x/this.WG.qO,this.cs.oi().y/this.WG.qO]).DV(o("uStippleTextureWidthLimiter"),this.WG.KO/this.WG.qO).DV(s("uStippleScale"),i.lineStyleDashed.getPatternScale()).PV(s("uStippleTexture"),this.WG.JO,1)}if("primitive"===i.type){if(i.lineStyleDashed){if(!(null===(h=this.AY)||void 0===h?void 0:h.bufferLengthSoFar))return!1;this.KR.oO(r("aLengthSoFar"),this.AY.bufferLengthSoFar)}Qy.EG(this.wN,R)}else{if(!F(n,i.fillStyleIndividual,i.fillStylePaletted))return!1;if(i.lineStyleDashed){if(!(null===(a=this.AY)||void 0===a?void 0:a.bufferLengthSoFar))return!1;Pm(this.KR,n,!1,this.AY.bufferLengthSoFar,"aLengthSoFar","",2,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}Zy.qL(this.wN,i.geometry,n,this.VG&&1!==t,1===t,i.thickness,R-1)}return!0}))}const P=null===(f=this.yY)||void 0===f?void 0:f.bufferX,L=null===(g=this.yY)||void 0===g?void 0:g.bufferY,V=null===(y=this.yY)||void 0===y?void 0:y.bufferColors,z=null===(m=this.yY)||void 0===m?void 0:m.bufferLookupValues,_=null===(p=this.yY)||void 0===p?void 0:p.bufferSizes,N=null===(A=this.yY)||void 0===A?void 0:A.bufferRotations,O=1===t?null===(x=this.dY)||void 0===x?void 0:x.mousePickingShader:null===(S=this.dY)||void 0===S?void 0:S.shader,U=this.dY;let Y=1;if(E&&(D||B)){const t=this.pd?Math.abs((this.St()-this.vt())/k.getSampleCount()):0,e=this.At.x.getInnerInterval()/t,i=this.JU.C(),s=this.At.x.ri()/i/1,r=2*s;Y=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(O&&U&&P&&L&&Y>0&&void 0!==w&&w>0){const i=U,s=i.instancedRendering?1:0;this.KR.cE(O).TV(O,((r,n,o,h)=>{if(!this.KR.eN(o,t,this,{uniforms:this.kE,idFirst:e,useInstanceID:i.instancedRendering&&1===t?I:void 0,useVertexID:i.instancedRendering||1!==t?void 0:I,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,linearGradientInfo:this._Y,radialGradientInfo:this.wY,fillStylePaletted:i.fillStylePaletted,fillStyleIndividual:i.fillStyleIndividual,lookupValueRange:i.fillStylePaletted?gg(i.fillStylePaletted,this,this.uY):void 0,lookupValueBuffer:z,lookupValueAttribDivisor:s,colorBuffer:V,colorAttribDivisor:s,fillStyleImage:i.fillStyleImage,texturedFillGLInfo:this._U,texCoordAttribDivisor:0,maskTexture:i.shapeIcon&&this._U,maskTextureCoordsAttribDivisor:0}))return!1;if(this.At._i()?this.KR.FV(P,s,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).FV(L,s,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.KR.dO(n("aPosX"),P,s).dO(n("aPosY"),L,s),1!==t&&this.KR.DV(r("uOpacity"),Y),i.instancedRendering)if(N)this.KR.dO(n("aRotDeg"),N,s).DV(r("uBaseRotDeg"),i.geometry.JW);else{const t=Ai(this.KU.C()+i.geometry.JW),e=Math.sin(t),s=Math.cos(t);this.KR.IV(r("uRot"),[e,s])}return this.KR.IV(h("uOffsetAlignment"),[-this.tY.x/2,-this.tY.y/2]),i.geometry.qy(o,_,w,i.pointSizeAsScale&&this._U?{scale:this.JU.C(),width:i.shapeIcon?i.shapeIcon.oi().x:this._U.texture.Qz,height:i.shapeIcon?i.shapeIcon.oi().y:this._U.texture.Jz}:this.JU.C(),i.instancedRendering),!0}))}return{idCount:I}}PN(t,e,i,s,r){var n;const o=null===(n=this.pd.C())||void 0===n?void 0:n.Gt;if(null==o?void 0:o.jc())return{};const h=t-e;return{info:{dataPoint:null==o?void 0:o.Kc(h)}}}dispose(){var t,e,i,s,r,n,o,h,a,l,u,c,d;return super.dispose(),this.KR.zV(null===(t=this.AY)||void 0===t?void 0:t.bufferX),this.KR.zV(null===(e=this.AY)||void 0===e?void 0:e.bufferY),this.KR.zV(null===(i=this.AY)||void 0===i?void 0:i.bufferColors),this.KR.zV(null===(s=this.AY)||void 0===s?void 0:s.bufferLookupValues),this.KR.zV(null===(r=this.AY)||void 0===r?void 0:r.bufferRotations),this.KR.zV(null===(n=this.AY)||void 0===n?void 0:n.bufferSizes),this.KR.zV(null===(o=this.yY)||void 0===o?void 0:o.bufferX),this.KR.zV(null===(h=this.yY)||void 0===h?void 0:h.bufferY),this.KR.zV(null===(a=this.yY)||void 0===a?void 0:a.bufferColors),this.KR.zV(null===(l=this.yY)||void 0===l?void 0:l.bufferLookupValues),this.KR.zV(null===(u=this.yY)||void 0===u?void 0:u.bufferRotations),this.KR.zV(null===(c=this.yY)||void 0===c?void 0:c.bufferSizes),this.NG={type:"none"},this.vY=void 0,this.dY=void 0,this.OW.pW(),null===(d=this.pd.C())||void 0===d||d.Nt(),this.AY=void 0,this.yY=void 0,this.SY=void 0,this.xY=void 0,this.bY=void 0,this.MY=void 0,this._Y=void 0,this.wY=void 0,this.KR.sN(this,this._U),this}iE(){return this.dispose(),this}CY(t){if(!this.fY){const{xValues:e,yValues:i}=t.readBack();this.fY={min:{x:ze,y:ze},max:{x:_e,y:_e}};const s=e.length;for(let t=0;tthis.fY.max.x?s:this.fY.max.x,this.fY.max.y=r>this.fY.max.y?r:this.fY.max.y}return this.lY.length=0,this.fY}const e=t.Bc,i=t.Lc;if(this.lY.length>0&&e&&i){for(const t of this.lY){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.fY.min.x=tthis.fY.max.x?t:this.fY.max.x,this.fY.max.y=r>this.fY.max.y?r:this.fY.max.y}this.lY.length=0}return this.fY}return this.fY}St(){var t,e,i,s,r;const n=null===(t=this.pd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.jc();return"ProgressiveX"===o?(null===(e=n.Dc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Jc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.gY)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.gY)||void 0===r?void 0:r.max)||0:this.CY(n).max.x}vt(){var t,e,i,s,r;const n=null===(t=this.pd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.jc();return"ProgressiveX"===o?(null===(e=n.Jc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Dc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.gY)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.gY)||void 0===r?void 0:r.min)||0:this.CY(n).min.x}bt(){var t,e,i,s,r;const n=null===(t=this.pd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.jc();return"ProgressiveX"===o?Bt(null===(e=this.gY)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Bt(null===(i=this.gY)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Bt(null===(s=n.Dc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Bt(null===(r=n.Jc())||void 0===r?void 0:r.y,0):this.CY(n).max.y}xt(){var t,e,i,s,r;const n=null===(t=this.pd.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.jc();return"ProgressiveX"===o?Bt(null===(e=this.gY)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Bt(null===(i=this.gY)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Bt(null===(s=n.Jc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Bt(null===(r=n.Dc())||void 0===r?void 0:r.y,0):this.CY(n).min.y}Tl(){var t,e;let i=this.JU.C();this._U&&(i=Math.max(this._U.texture.Qz,this._U.texture.Jz)*this.JU.C());const s=Math.max(Re(this.yu),(null===(t=this.pd.C())||void 0===t?void 0:t.Gt.kc)?25:i),r=null===(e=this.pd.C())||void 0===e?void 0:e.Gt.jc();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}Fl(){var t,e;let i=this.JU.C();this._U&&(i=Math.max(this._U.texture.Qz,this._U.texture.Jz)*this.JU.C());const s=Math.max(Re(this.yu),(null===(t=this.pd.C())||void 0===t?void 0:t.Gt.kc)?25:i),r=null===(e=this.pd.C())||void 0===e?void 0:e.Gt.jc();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const Dm=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],y=f.length,m=f[0],p=f[y-1],A=g[0],x=g[y-1],S=c?2:1;if(h&&a&&h.firstX&&h.lastX&&m>=h.firstX){const e=Ao(h.lastX,0,y-1,(t=>f[t]));if(f[e]===h.lastX){const a=h.bufferSize-h.valueCount,l=e+1,u=y-l;if(0===u)return h;if(a>=u){const e=vo(f,l,void 0),a=vo(g,l,void 0);if(t.eO(h.bufferX,h.valueCount*S,d(e)),t.eO(h.bufferY,h.valueCount*S,d(a)),i&&h.bufferColors){const e=i.slice(l);t.eO(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.eO(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.eO(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.eO(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Bm(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.eO(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=x,h}}}const v=y+u,b=t.sO(v*S,d(f),null==h?void 0:h.bufferX),M=t.sO(v*S,d(g),null==h?void 0:h.bufferY),C=i?t.sO(v,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,T=s?t.sO(v,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,R=r?t.sO(v,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,w=n?t.sO(v,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let k,E=0,I=0;if(o){const e=Bm(f,g,f[0],g[0],0,0);k=t.sO(2*v,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),E=e[1],I=e[2]}return{bufferX:b,bufferY:M,bufferColors:C,bufferLookupValues:T,bufferSizes:R,bufferRotations:w,bufferSize:v,bufferLengthSoFar:k,valueCount:y,firstX:m,lastX:p,firstY:A,lastY:x,lengthSoFarX:E,lengthSoFarY:I}},Bm=(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.lO(i,1),t.lO(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.lO(d,1),t.lO(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.lO(i,1),t.lO(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Lm={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)=>Lm.multiply(t,Lm.translation(e,i)),rotate:(t,e)=>Lm.multiply(t,Lm.rotation(e)),scale:(t,e,i)=>Lm.multiply(t,Lm.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],y=e[4],m=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+y*n+m*a,g*s+y*o+m*l,g*r+y*h+m*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 Vm extends ln{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kY=[],this.kE=new Dy,this.TY=[u(0,0),u(0,0),u(0,0),u(0,0)],this.FY=y(u(0,0),u(0,0)),this.IY=y(u(0,0),u(0,0)),this.PY=u(0,0),this.DY=u(0,0),this.bT=u(0,0),this.BY=u(0,0),this.LY=0,this.RY=0,this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStyleRadialGradient:()=>tt(this.Te)&&this.Te,fillStyleLinearGradient:()=>st(this.Te)&&this.Te}),this.wN=t,this.CN=e,this.KR=t.kN(),this.CN=e,this.jG=t.Kn.ho}zs(){const t=this.fa(),e=this.da(),i=this.Wo.C();if(t){const t=this.ua(),s=this.RN.fillStyleSolid(t),r=this.RN.fillStyleRadialGradient(t),n=this.RN.fillStyleLinearGradient(t),o=s||r||n,h=this.KR,a=this.KR.dV(),l=a!==this.RY;if(this.RY=a,this.kE.EV(this.At),this.wa.u||l){this.EY&&this.EY.dE(this),this.font._(wr(this.wa.C(),a));const t=this.font.C();this.EY=this.KR.Zh(t.properties.family),this.EY.cE(this)}const c=this.font.u,d=c||this.va.u;if(d&&this.EY){const t=this.font.C();[this.zY,this.IY]=this.EY.AE(this.va.C(),t,this.wN.ts.isDark),this.kY.forEach((t=>{t.texCoordBuff&&h.zV(t.texCoordBuff),t.vertexBuff&&h.zV(t.vertexBuff)})),this.kY=this.zY.map((t=>({texCoordBuff:h.CV(t.texCoords,!1),texture:t.texture,info:t}))),this.wa.u=!1,this.font.u=!1,this.va.u=!1}const f=this.At.Ni()||e,g=this.Sa.u||this.ba.u||this.xa.u||this.Ma.u||this.ka.u||this.Xt.u||d||f,y=this.ka.C(),m=li(u(this.ba.C()+1,this.xa.C()+1),.5);if(g&&this.zY&&(this.PY=u(-(y.left*a+this.IY.max.x-this.IY.min.x+y.right*a)*m.x-this.IY.min.x+y.right*a,-(y.bottom*a+this.IY.max.y-this.IY.min.y+y.top*a)*m.y-this.IY.min.y+y.top*a)),(g||f||this._a.u||this.ua())&&this.Te!==z){if(this.zY){const t=ui(this.Sa.C(),this.Ma.C()),e=ct(t,this.At,this.cs.At),i=li(e,a);this.BY=i;const s=Ai(this._a.C());this.LY=s,d&&this.kY.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.CV(e.vertices,!0,t.vertexBuff))}));const r=this.Xt.C(),n=[ui(ri(u((this.IY.min.x+(-r.left-y.left)*a+this.PY.x)/a,(this.IY.max.y+(r.top+y.top)*a+this.PY.y)/a),this.Ca,s),e),ui(ri(u((this.IY.max.x+(r.right+y.right)*a+this.PY.x)/a,(this.IY.max.y+(r.top+y.top)*a+this.PY.y)/a),this.Ca,s),e),ui(ri(u((this.IY.max.x+(r.right+y.right)*a+this.PY.x)/a,(this.IY.min.y+(-r.bottom-y.bottom)*a+this.PY.y)/a),this.Ca,s),e),ui(ri(u((this.IY.min.x+(-r.left-y.left)*a+this.PY.x)/a,(this.IY.min.y+(-r.bottom-y.bottom)*a+this.PY.y)/a),this.Ca,s),e)];this.TY=[ct(n[0],this.cs.At,this.At),ct(n[1],this.cs.At,this.At),ct(n[2],this.cs.At,this.At),ct(n[3],this.cs.At,this.At)];const o=Je(n);this.DY=u(-(o.max.x-o.min.x)*a*m.x-o.min.x*a+this.BY.x,-(o.max.y-o.min.y)*a*m.y-o.min.y*a+this.BY.y),this.Og=ci(o.max,o.min);const l=Je(this.TY),c=this.At.pi(l.min,this.DY),f=this.At.pi(l.max,this.DY);this.FY=Je([c,f])}r?this.WN=vy(this.FY,this.At,r.getPosition(),r.getExtent(),r.getShape(),this.KR.dV()):n?this.UN=by(this.FY,this.At,n.getAngle(!0),this.KR.dV()):(this.WN=void 0,this.UN=void 0)}(this.ua()||c)&&(this.IE=o?this.KR.Cz(Yg["2D"],Yg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.jG}),Yg.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.VY=i&&o?this.VY||this.KR.Cz(Yg["2D"],Yg.MousePicking(),Yg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.jG})):void 0,this.Sa.u=!1,this.ba.u=!1,this.xa.u=!1,this.Ma.u=!1,this._a.u=!1,this.Aa(this.Te)}return this.Ta=t,this}qL(t,e){if(this.fa()){const i=1===t?this.VY:this.IE;if(!i||0===this.kY.length)return{};const s=this.RN.fillStyleSolid(!1),r=this.RN.fillStyleRadialGradient(!1),n=this.RN.fillStyleLinearGradient(!1),o=this.cs.hz(),h=o.x,a=o.y;let l=Lm.projection(h,a,-1);const u=Lm.translation(this.PY.x,this.PY.y),c=Lm.translation(this.DY.x,this.DY.y);l=Lm.translate(l,this.BY.x,this.BY.y),l=Lm.multiply(l,c),l=Lm.rotate(l,this.LY),l=Lm.multiply(l,u),1===t&&(l=Lm.scale(l,this.IY.max.x,this.IY.max.y)),this.KR.cE(i).TV(i,((i,h,a,u)=>{if(this.KR.JV(i("uMatrix"),l).DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),this.jG&&this.KR.IV(u("uViewportSizePx"),[o.x*this.KR.dV(),o.y*this.KR.dV()]),1===t)this.KR.qV(i("uFirstId"),e).XO(a,1);else if(s)this.KR.PR(i("uColor"),s.getColor());else if(r&&this.WN){this.KR.IV(i("uCenter"),this.WN.center).IV(i("uDistance"),this.WN.distance).ZV(i("uBounds"),this.WN.bounds).DV(i("uAspect"),this.WN.aspectRatio);const t=r.getColorStops();for(let e=0;e{this.KR.oO(h("aPos"),t.vertexBuff).oO(h("aMaskTextureCoord"),t.texCoordBuff).PV(i("uMaskTexture"),t.texture,0).qy(this.KR.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return{idCount:1}}PN(t,e,i,s,r){return{}}th(){return this.fa()?this.TY:[]}ed(){return this.fa()&&this.Og?this.Og:u(0,0)}oi(){if(this.fa()&&this.FY){const t=this.FY;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}iE(){return this.kY.forEach((t=>{t.texCoordBuff&&this.KR.zV(t.texCoordBuff),t.vertexBuff&&this.KR.zV(t.vertexBuff)})),this.kY=[],this.EY&&this.EY.dE(this),this}St(){return this.FY.max.x}vt(){return this.FY.min.x}bt(){return this.FY.max.y}xt(){return this.FY.min.y}Tl(){return 0}Fl(){return 0}}class zm{constructor(t,e,i){this.OY=new Set,this.NY=t=>(this.OY.add(t),t),this.GY=t=>(this.OY.delete(t),t.iE(),this),this.cs=t,this.ra=e,this.WY=i}KL(t){this.OY.delete(t)&&this.OY.add(t)}Y(){for(const t of this.OY)t.iE().dispose();this.cs.Ln(this.ra)}Ms(){return this.cs.Ms(),this}Bn(){return this.ra}}class _m extends zm{constructor(){super(...arguments),this.UY=p(void 0),this.na=!1}gx(t){return this.UY._(t),this}Bp(){return this.UY.C()}}class Nm extends _m{constructor(t,e,i){super(t,e,i),this.wN=t,this.gl=t.kN(),this.YY=this.OY}wV(t){const e=t instanceof tn&&t;if(!e)return Ne;const i=e.vt(),s=e.St(),r=e.xt(),n=e.bt();if(i===ze||s===_e||r===ze||n===_e)return Ne;const o=e.Tl(),h=e.Fl(),a=en({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.At),l={min:ct(a.min,e.At,t.cs.At),max:ct(a.max,e.At,t.cs.At)},u=this.UY.C();let c;if(u){if(c={min:{x:Math.max(l.min.x,u.x),y:Math.max(l.min.y,u.y)},max:{x:Math.min(l.max.x,u.x+u.width),y:Math.min(l.max.y,u.y+u.height)}},c.max.xt.aa()-e.aa()));this.OY.clear();for(const e of t)this.OY.add(e)}for(const t of this.OY)t.zs();return this}qL(t,e,i){var s;const r=this.UY.C();let n;if(r){const t=r.x*this.gl.dV()*e,i=r.y*this.gl.dV()*e,s=Math.ceil(t),o=Math.ceil(i);n=[s,o,Math.floor(t+r.width*this.gl.dV()*e)-s,Math.floor(i+r.height*this.gl.dV()*e)-o],this.gl._V(n[0],n[1],n[2],n[3])}if(1!==t){for(const i of this.OY)if(i.getVisible()){if(i.Yi){const t=i.Yi.x*this.gl.dV()*e,s=i.Yi.y*this.gl.dV()*e,r=Math.ceil(t),n=Math.ceil(s),o=Math.floor(t+i.Yi.width*this.gl.dV()*e)-r,h=Math.floor(s+i.Yi.height*this.gl.dV()*e)-n;this.gl._V(r,n,o,h)}i.qL(t,0),i.Yi&&n&&this.gl._V(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.YY.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 Gm extends Om{constructor(t,e){super(t),this.$Y="attribute",this.jY=e;const{vertices:i,indices:s}=Hm();this.WR=t.CV(i),this.TG=t.rO(s),this.FG=s.length,this.IG=t.gl.TRIANGLES}qy(t,e,i,s){return this.KR.FV(this.WR,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).fO(this.TG).DV(t.uniform("uEdgeRoundness"),this.jY/2).yO(this.IG,this.FG,0,e),this}jz(){this.KR.zV(this.WR),this.KR.zV(this.TG)}ZY(t){return this.jY=t,this}QY(){return this.jY}}const Hm=()=>{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=Ve.multiply(o,-1),l=Ve.multiply(h,-1),u=i;e[i]={thicknessDirection:Ve.addVec(t,o,h),edge:Ve.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ve.addVec(t,a,h),edge:Ve.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ve.addVec(t,a,l),edge:Ve.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ve.addVec(t,o,l),edge:Ve.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=Ve.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=Ve.normalize(Ve.lerp(t,n.direction,o)),a=Math.PI/2-Ve.angle(h,t),l=Ve.addVec(Ve.multiply(Ve.multiply(n.direction,-1),1-Math.cos(a)),Ve.multiply(Ve.multiply(t,-1),1-Math.sin(a)),Ve.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.YV.Xz.get(e);return i||(i=void 0!==e&&e>0?new Gm(t,Ft(e,0,1)):new Um(t),t.YV.Xz.set(e,i),i)};class Km extends ky{yv(t){return this.uV=this.av.C(),this.av._(t),this}BS(t){return this.JY=t,this}LS(){return this.JY}}class Xm extends Km{constructor(t,e,i){super(t,e,i),this.KY=t,this.wN=t.wN,this.KR=this.wN.kN()}}class jm extends Xm{constructor(t,e,i){super(t,e,i),this.JY="cull-back",this.tl=Oe,this.qY={},this.tH=[],this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStyleIndividual:()=>H(this.Te)&&this.Te,fillStylePaletted:()=>K(this.Te)&&this.Te}),this.Te=Lr.fillStyle,this.av._(Jn)}zs(t){const e=this.tH,i=this.Te,s=i!==z,r=this.iH,n=this.ua()||this.sH!==r,o=this.lV(),h=this.Wo.C(),a=this.Wo.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.eH||0;let s=t;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.qY[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.ZW&&i.set(this.ZW),this.ZW=i,this.hH=e,this.rH=11*t}const c=H(i)?i.getFallbackColor():void 0;for(const t of e){const e=t.id,i=void 0!==e&&this.qY[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.rH,i=new Float32Array(this.ZW.buffer,t*Float32Array.BYTES_PER_ELEMENT,11);i.set(s),void 0!==e&&(this.qY[e]={location:t,buffer:i}),this.rH+=11}}if(u&&(this.kG=this.KR.CV(this.ZW,!0)),"all"===r)this.KR.eO(this.kG,0,this.ZW);else if("chunks"===r)for(const t of e){const e=t.id;if(void 0!==e){const t=this.qY[e];this.KR.eO(this.kG,t.location,t.buffer)}}if(n||o||a){const t=this.RN.fillStyleSolid(n),e=this.RN.fillStyleIndividual(n),i=this.RN.fillStylePaletted(n);t||e||i?(this.nH=Wm(this.KR,this.oH()),this.IE=this.KR.Cz(Yg["3D"],Yg.ColorShaded3D({dataType:e?"attribute":i?["lookup",i.getLookUpProperty(),i.lut]:"uniform",shadingStyle:this.av.C().type}),Yg.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:dg(this.At),normalSource:this.nH.$Y}),void 0!==this.iH&&Yg.RoundedEdges3D),this.VY=h?this.KR.Cz(Yg["3D"],Yg.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:dg(this.At),normalSource:void 0}),Yg.MousePicking(),void 0!==this.iH&&Yg.RoundedEdges3D):void 0):(this.nH=void 0,this.IE=void 0,this.VY=void 0)}if(e.length>0){const t=y({x:ze,y:ze,z:ze},{x:_e,y:_e,z:_e});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.tl=t}this.eH=s,this.tH.length=0}return this.Aa(i),this.sH=r,this.av.u=!1,this.Wo.u=!1,this}qL(t,e){const i=1===t?this.VY:this.IE,s=this.nH,r=this.kG,n=this.Te,o=this.eH,h=this.av.C(),a=o||0;return i&&r&&void 0!==o&&this.KR.TV(i,((l,u,c)=>{let d=!1;const f=u("aPos"),g=u("aOffsetAxis");this.KR.cE(i).QV(l("uScale"),this.KY.kE.BV()).QV(l("uDisp"),this.KY.kE.LV()).KV(l("uViewProjectionMatrix"),this.aH).DV(l("uIsHighlighted"),1===t||2===t?0:this.$o).PR(l("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(l("uRenderEffectMask"),2===t?1:0);const y={location:f,size:3},m={location:g,size:3},p={location:void 0,size:4};if(1!==t&&"phong"===h.type&&this.KR.QV(l("uCameraLoc"),this.lH).QV(l("uLightLoc"),this.uH).DV(l("uAmbientReflection"),h.ambientReflection).DV(l("uSpecularReflection"),h.specularReflection).DV(l("uDiffuseReflection"),h.diffuseReflection).DV(l("uShininess"),h.shininess).PR(l("uLightColor"),h.specularColor).PR(l("uAmbientColor"),h.ambientColor),1===t)this.KR.qV(l("uFirstId"),e).XO(c,a);else if(Y(n))this.KR.PR(l("uColorDiffuse"),n.getColor());else if(H(n)){const t=u("aColor");p.location=t}else if(K(n)){const t=gg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.KR.tN(c,n.lut,t)}return r&&(this.KR.FV(r,1,y,m,p,{location:void 0,size:1}),s.qy(c,o,"phong"===h.type&&1!==t,!1),d=!0),d})),{idCount:a}}PN(t,e,i,s,r){const n=11*(t-e);if(!this.ZW)return{};const o=this.ZW[n+0],h=this.ZW[n+1],a=this.ZW[n+2],l=this.ZW[n+3],u=this.ZW[n+4],c=this.ZW[n+5],d=Bt(this.ZW[n+6],void 0),f=Bt(this.ZW[n+7],void 0),g=Bt(this.ZW[n+8],void 0),y=Bt(this.ZW[n+9],void 0),m=Bt(this.ZW[n+10],void 0);let p;for(const t of Object.keys(this.qY))if(this.qY[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:y,intensity:m,id:p}}}}dispose(){return super.dispose(),this.kG&&(this.KR.zV(this.kG),this.kG=void 0),this.IE=void 0,this}iE(){return this.dispose(),this}kv(t){this.tH=he(this.tH,t,{canReturnB:!0})}Be(t){return this.Te=sn(this.Te,t),this}Xh(){return this.Te}wv(t){return this.iH=void 0!==t&&t>0?Ft(t,0,1):void 0,this}oH(){return this.iH}St(){return this.tl.max.x}vt(){return this.tl.min.x}bt(){return this.tl.max.y}xt(){return this.tl.min.y}Sv(){return this.tl.max.z}xv(){return this.tl.min.z}Tl(){return 0}Fl(){return 0}bv(){return 0}ua(){return rn(this.ca,this.Te)}Aa(t){this.ca=t}}class $m extends My{constructor(t,e){super(t),this.$Y="custom",this.wG=e;const{vertices:i,drawSize:s}=this.CG();this.kG=t.CV(i),this.FG=s}cE(t){return this.KR.FV(this.kG,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}qy(t){return this.KR.pO(this.KR.gl.TRIANGLE_STRIP,0,this.FG,t),this}CG(){const t=this.wG,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}}jz(){this.KR.zV(this.kG)}}const Zm=(t,e=16)=>{let i=t.YV.Yz.get(e);return i||(i=new $m(t,e),t.YV.Yz.set(e,i),i)};class Qm extends Xm{constructor(t,e,i){super(t,e,i),this.JY="cull-back",this.cH=Oe,this.dH=[],this.fH=!1,this.yu=Lr.lineStyle,this.av._(Qn)}zs(t){const e=this.fH,i=this.yu,s=this.vu!==i,r=this.lV(),n=e;if(e){const t=te(this.dH);this.AH=this.KR.CV(t,!1,this.AH)}if(n&&(this.cH=ti(this.dH)),s||r){const t=8,e=ns(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.NG=void 0,Y(e)&&("primitive"===s?this.NG={type:s,shader:this.KR.Cz(Yg["3D"],Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0}),Yg.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.NG={type:s,shader:this.KR.Cz(Yg["3D"],Yg.ColorShaded3D({dataType:"uniform",shadingStyle:this.av.C().type}),Yg.LineInstanced3D({axisWorldTranslation:dg(this.At)})),geometry:Zm(this.KR,t),fillStyle:e}))}return this.fH=!1,this.vu=i,this.av.u=!1,this}qL(t,e){if(1===t)return{};const i=this.KR.gl,s=this.NG,r=this.AH,n=this.yu,o=this.av.C();if(s&&r&&ns(n))switch(s.type){case"instanced":{const e=.5*this.Bs.jm(n.thickness),h=s.fillStyle.getColor(),a=s.shader,l=s.geometry;this.KR.TV(a,((s,n,u)=>{this.KR.cE(a).QV(s("uScale"),this.KY.kE.BV()).QV(s("uDisp"),this.KY.kE.LV()).KV(s("uViewProjectionMatrix"),this.aH).PR(s("uColorDiffuse"),h).DV(s("uOffsetWU"),e).DV(s("uIsHighlighted"),this.$o).PR(s("uHighlightColorOffset"),2===t?E:this.Qo).DV(s("uRenderEffectMask"),2===t?1:0),"phong"===o.type&&this.KR.QV(s("uCameraLoc"),this.lH).QV(s("uLightLoc"),this.uH).DV(s("uAmbientReflection"),o.ambientReflection).DV(s("uSpecularReflection"),o.specularReflection).DV(s("uDiffuseReflection"),o.diffuseReflection).DV(s("uShininess"),o.shininess).PR(s("uLightColor"),o.specularColor).PR(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.KR.lO(c,1),i.enableVertexAttribArray(c),i.vertexAttribPointer(d,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.KR.lO(d,1),i.enableVertexAttribArray(d),l.cE(u).qy(this.dH.length/2),!0}));break}case"primitive":{const e=ns(n)?n.getFillStyle():void 0,o=e&&Y(e)?e.getColor():void 0;if(o){const e=s.shader;this.KR.TV(e,((s,n)=>(this.KR.cE(e).QV(s("uScale"),this.KY.kE.BV()).QV(s("uDisp"),this.KY.kE.LV()).KV(s("uViewProjectionMatrix"),this.aH).PR(s("uColor"),o).DV(s("uIsHighlighted"),this.$o).PR(s("uHighlightColorOffset"),2===t?E:this.Qo).DV(s("uRenderEffectMask"),2===t?1:0).FV(r,void 0,{location:n("aPos"),size:3}).qy(i.LINES,this.dH.length),!0)))}break}}return{idCount:this.dH.length}}PN(t,e,i,s,r){return{}}Al(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.KR.SA.io&&s>i.length&&Ct.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}}jz(){this.KR.zV(this.kG)}}const Jm=(t,e)=>{const i=Math.round(e);i<3&&pe(0,Et);const s=i;let r=t.YV.$z.get(Array.from(t.YV.$z.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new qm(t,i,s),t.YV.$z.set({sectors:i,stacks:s},r),r)};class tp extends Xm{constructor(t,e,i){super(t,e,i),this.JY="cull-back",this.LM=[],this.NG={},this.NW=new rm(this.LM,(t=>t.vertexBuffer&&this.KR.zV(t.vertexBuffer)),!0),this._u=[],this.il=0,this.sl=[],this.el=0,this.tl=Oe,this.hl=Oe,this.RN=fg({lineStyleSolid:()=>{const t=this.yu;return ns(t)&&t},lineFillSolid:()=>{const t=this.yu.getFillStyle();return Y(t)&&t},lineFillPaletted:()=>{const t=this.yu.getFillStyle();return K(t)&&t},jointStyleTriangulatedPoints:()=>Sr(this.Tv)&&this.Tv,jointSizeTriangulated:()=>{const t=this.Tv;return Sr(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Tv.getFillStyle();return Y(t)&&t},jointFillPaletted:()=>{const t=this.Tv.getFillStyle();return K(t)&&t},wireframeLineStyleSolid:()=>{const t=Sr(this.Tv)&&this.Tv.getWireframeStyle();return ns(t)&&t},wireframeFillSolid:()=>{const t=Sr(this.Tv)&&this.Tv.getWireframeStyle(),e=t&&t.getFillStyle();return Y(e)&&e}}),this.rl=!1,this.yu=Lr.lineStyle,this.Tv=Lr.pointStyle3D,this.av._(Jn),this.HW={attributesPerVertex:3,prepareRenderData:(t,e)=>te(t)}}PN(t,e,i,s,r){return{info:{dataPoint:this._u[t-e]}}}zs(t){const e=this.rl,i=this.sl,s=this.el,r=s>0,n=this.yu,o=n!==this.vu,h=this.Tv,a=h!==this.yH,l=this.lV(),u=this.Wo.u,c=this.Wo.C();this.hl&&(this.tl=ii(this.tl,this.hl),this.hl=void 0),r&&(this._u=he(this._u,i,{canReturnB:!0}),this.il+=s);let d=i,f=s;if(e&&(this.LM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Oe})),this.NW.PW(),d=this._u,f=this.il),f>0){const t=1e5,e=Math.floor(this.wN.mH/(this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Ko("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Ft(i,t,e);this.NW.kW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Oe,vertexBuffer:this.KR.sO(t*this.HW.attributesPerVertex,this.HW.prepareRenderData(e,i))})),((t,e,i,s)=>{this.KR.eO(t.vertexBuffer,t.existingCoordinatesCount*this.HW.attributesPerVertex,this.HW.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.RN.lineStyleSolid(o),i=this.RN.lineFillSolid(o),s=this.RN.lineFillPaletted(o),r=i||s,h=this.RN.jointStyleTriangulatedPoints(a),l=this.RN.jointSizeTriangulated(a),u=this.RN.jointFillSolid(a),d=this.RN.jointFillPaletted(a),f=u||d,g=this.RN.wireframeLineStyleSolid(a),y=this.RN.wireframeFillSolid(a),m=n.getThickness()<0||1===n.getThickness()&&this.Ko("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===m&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.KR.Cz(Yg["3D"],Yg.Color({dataType:p}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})),mousePicking:c?{shader:this.KR.Cz(Yg["3D"],Yg.MousePicking({useVertexId:!0}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0}))}:void 0}:"instanced"===m&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.KR.Cz(Yg["3D"],Yg.ColorShaded3D({dataType:p,shadingStyle:this.av.C().type}),Yg.LineInstanced3D({axisWorldTranslation:dg(this.At)})),geometry:ep(this.KR,e.getThickness()),mousePicking:c?{shader:this.KR.Cz(Yg["3D"],Yg.MousePicking(),Yg.LineInstanced3D({axisWorldTranslation:dg(this.At)}))}:void 0}),t.markers=void 0,f&&h){const e=ne(h.getShape(),{cube:()=>Wm(this.KR),sphere:()=>ip(this.KR,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.KR.Cz(Yg["3D"],Yg.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.av.C().type,wireframe:!1!==y}),Yg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:dg(this.At),normalSource:e.$Y})),mousePicking:c?{shader:this.KR.Cz(Yg["3D"],Yg.MousePicking(),Yg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:dg(this.At),normalSource:void 0}))}:void 0,wireframe:g&&y&&{thickness:g.getThickness(),fillStyleSolid:y}}}this.NG=t}return this.rl=!1,this.sl=[],this.el=0,this.vu=n,this.yH=h,this.av.u=!1,this.Wo.u=!1,this}qL(t,e){var i,s;const r=this.KR.gl,{lines:n,markers:o}=this.NG,h=this.av.C(),a=this.il,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.KR.TV(i,((n,l,c)=>{let d=!1;if(this.KR.cE(i).QV(n("uScale"),this.KY.kE.BV()).QV(n("uDisp"),this.KY.kE.LV()).KV(n("uViewProjectionMatrix"),this.aH).DV(n("uOffsetWU"),this.Bs.jm(o.getThickness())).DV(n("uIsHighlighted"),1===t||2===t?0:this.$o).PR(n("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.KR.QV(n("uCameraLoc"),this.lH).QV(n("uLightLoc"),this.uH).DV(n("uAmbientReflection"),h.ambientReflection).DV(n("uSpecularReflection"),h.specularReflection).DV(n("uDiffuseReflection"),h.diffuseReflection).DV(n("uShininess"),h.shininess).PR(n("uLightColor"),h.specularColor).PR(n("uAmbientColor"),h.ambientColor),1===t);else if(a)this.KR.PR(n("uColorDiffuse"),a.getColor());else if(u){const t=gg(u,this,void 0);if(!t&&u.lut.percentageValues)return!1;this.KR.tN(c,u.lut,t)}const f=Le(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=f.Ut(e.existingDataPointsCount);this.KR.qV(n("uFirstId"),t).XO(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.KR.lO(i,1),r.enableVertexAttribArray(i),r.vertexAttribPointer(o,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.KR.lO(o,1),r.enableVertexAttribArray(o),s.cE(c).qy(e.existingCoordinatesCount-1),d=!0})),d}))}if(n&&l&&"primitive"===n.type){const i=l,{fillStyleSolid:s,fillStylePaletted:o}=n;this.KR.TV(i,((n,h,a)=>{let l=!1;if(this.KR.cE(i).QV(n("uScale"),this.KY.kE.BV()).QV(n("uDisp"),this.KY.kE.LV()).KV(n("uViewProjectionMatrix"),this.aH).DV(n("uIsHighlighted"),1===t||2===t?0:this.$o).PR(n("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(n("uRenderEffectMask"),2===t?1:0),1===t);else if(s)this.KR.PR(n("uColor"),s.getColor());else if(o){const t=gg(o,this,void 0);if(!t&&o.lut.percentageValues)return!1;this.KR.tN(a,o.lut,t)}const u=Le(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=u.Ut(e.existingDataPointsCount);this.KR.qV(n("uFirstId"),t).HO(a,i)}this.KR.FV(e.vertexBuffer,void 0,{location:h("aPos"),size:3}).qy(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.KR.TV(i,((o,u,d,f)=>{let g=!1;if(this.KR.cE(i).QV(o("uScale"),this.KY.kE.BV()).QV(o("uDisp"),this.KY.kE.LV()).KV(o("uViewProjectionMatrix"),this.aH).DV(f("uRatioNwuWu"),this.KY.vH()).DV(o("uIsHighlighted"),1===t||2===t?0:this.$o).PR(o("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(o("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.KR.QV(o("uCameraLoc"),this.lH).QV(o("uLightLoc"),this.uH).DV(o("uAmbientReflection"),h.ambientReflection).DV(o("uSpecularReflection"),h.specularReflection).DV(o("uDiffuseReflection"),h.diffuseReflection).DV(o("uShininess"),h.shininess).PR(o("uLightColor"),h.specularColor).PR(o("uAmbientColor"),h.ambientColor),1===t);else if(r)this.KR.PR(o("uColorDiffuse"),r.getColor());else if(n){const t=gg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.KR.tN(d,n.lut,t)}c&&1!==t&&this.KR.DV(o("uWireframeThickness"),c.thickness).PR(o("uWireframeColor"),c.fillStyleSolid.getColor()),!1!==a&&this.KR.QV(o("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.KR.DV(o("uOffsetNWU"),l);const y=Le(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=y.Ut(e.existingDataPointsCount);this.KR.qV(o("uFirstId"),t).XO(d,i)}this.KR.FV(e.vertexBuffer,1,{location:u("aPos"),size:3}),s.qy(d,e.existingCoordinatesCount,"phong"===h.type&&1!==t,Boolean(c)&&1!==t),g=!0})),g}))}return{idCount:a}}Al(t,e){Array.isArray(t)||(t=[t]),this.sl=he(this.sl,t,{canReturnB:!0}),this.el+=t.length;const i=e||ti(t);return this.hl=this.hl?ii(this.hl,i):i,this}We(t){return this.yu="function"==typeof t?t(this.yu):t,this}mu(){return this.yu}Wm(t){return this.Tv="function"==typeof t?t(this.Tv):t,this}SH(){return this.Tv}St(){return this.hl?Math.max(this.hl.max.x,this.tl.max.x):this.tl.max.x}vt(){return this.hl?Math.min(this.hl.min.x,this.tl.min.x):this.tl.min.x}bt(){return this.hl?Math.max(this.hl.max.y,this.tl.max.y):this.tl.max.y}xt(){return this.hl?Math.min(this.hl.min.y,this.tl.min.y):this.tl.min.y}Sv(){return this.hl?Math.max(this.hl.max.z,this.tl.max.z):this.tl.max.z}xv(){return this.hl?Math.min(this.hl.min.z,this.tl.min.z):this.tl.min.z}Tl(){return Re(this.yu)}Fl(){return Re(this.yu)}bv(){return Re(this.yu)}al(){return this._u}ol(){return this.sl}pl(){return this.il}yl(){return this.el}Ot(){return this.rl=!0,this._u.length=0,this.il=0,this.sl=[],this.el=0,this.tl=Oe,this.hl=void 0,this}dispose(){return super.dispose(),this.NW.DW(),this.NG={},this}iE(){return this.dispose(),this}}const ep=(t,e)=>Zm(t,e>50?20:e>20?16:e>10?12:e>5?8:6),ip=(t,e)=>{const i=e.getSize();return Jm(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class sp extends Xm{constructor(t,e,i){super(t,e,i),this.JY="disabled",this.xH=!1,this.bH=!1,this.MH={x:1,y:1,z:1},this.OS={x:0,y:0,z:0},this.VS={x:0,y:0,z:0},this.NS={x:0,y:0,z:0},this.GS={x:1,y:1,z:1},this._H=Sy.projectionOrthographic(-1,1,-1,1,1,-1),this.wH=Sy.projectionOrthographic(-1,1,-1,1,1,-1),this.CH=!1,this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStyleValuePalette:()=>K(this.Te)&&"value"===this.Te.lookUpProperty&&this.Te}),this.Te=Lr.fillStyle,this.av._(Jn)}zs(t){var e;const i=this.lV(),s=this.Wo.C(),r=this.Wo.u,n=this.ua();this.RN.fillStyleSolid(n);const o=this.RN.fillStyleValuePalette(n),h=this.NS,a=this.GS;if(this.xH&&this.kH&&(this.kG=this.KR.CV(this.kH.vertices,void 0,this.kG),this.TG=this.KR.rO(this.kH.indices,this.TG),this.TH=this.kH.indices.length),"phong"===this.av.C().type&&(i||this.xH)&&(null===(e=this.kH)||void 0===e?void 0:e.normals)&&(this.FH=this.KR.CV(this.kH.normals,void 0,this.FH)),!this.IH&&o&&"value"===o.lookUpProperty&&this.kH&&(this.IH=new Float32Array(this.kH.vertices.length/3),this.bH=!0),this.IH&&this.bH&&(this.PH=this.KR.CV(this.IH,void 0,this.PH)),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.IE=this.KR.Cz(Yg["3D"],Yg.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.av.C().type,wireframe:!1}),Yg.Model3D({normalSource:"phong"===this.av.C().type?"attribute":void 0})),this.VY=s?this.KR.Cz(Yg["3D"],Yg.MousePicking({useVertexId:!0}),Yg.Model3D({normalSource:void 0})):void 0}if(this.CH){const t=Sy.projectionOrthographic(-1,1,-1,1,1,-1);this.wH=Sy.rotateXYZ(t,h),this._H=Sy.translate(t,a.x/2,a.y/2,a.z/2),this._H=Sy.rotateXYZ(this._H,h),this._H=Sy.translate(this._H,-a.x/2,-a.y/2,-a.z/2),this.CH=!1}return this.av.u=!1,this.Aa(this.Te),this.Wo.u=!1,this.xH=!1,this.bH=!1,this}qL(t,e){const i=1===t?this.VY:this.IE,s=1===t,r=this.TG,n=this.TH,o=this.kG,h=this.FH,a=this.PH,l=this.OS,u=this.VS,c=this.MH,d=this.GS,f=this._H,g=this.wH,y=this.RN.fillStyleValuePalette(!1),m=this.RN.fillStyleSolid(!1),p=this.av.C(),A={location:void 0,size:1};if(!(i&&o&&r&&n&&this.kH))return{};const x=this.kH.vertices.length;return this.KR.TV(i,((S,v,b,M)=>{if(this.KR.cE(i).QV(S("uScale"),this.KY.kE.BV()).QV(S("uDisp"),this.KY.kE.LV()).KV(S("uViewProjectionMatrix"),this.aH).DV(S("uIsHighlighted"),1===t||2===t?0:this.$o).PR(S("uHighlightColorOffset"),this.Qo).DV(S("uRenderEffectMask"),2===t?1:0),s)this.KR.qV(S("uFirstId"),e).HO(b,x);else{if(this.Te===z)return!1;if(m)this.KR.PR(S("uColorDiffuse"),m.getColor());else if(y){if(!a)return!1;const t=y.getPalette();A.location=v("aLookupValue"),this.KR.tN(b,t,void 0).FV(a,void 0,A)}}return"phong"!==p.type||s||(this.KR.QV(S("uCameraLoc"),this.lH).QV(S("uLightLoc"),this.uH).DV(S("uAmbientReflection"),p.ambientReflection).DV(S("uSpecularReflection"),p.specularReflection).DV(S("uDiffuseReflection"),p.diffuseReflection).DV(S("uShininess"),p.shininess).PR(S("uLightColor"),p.specularColor).PR(S("uAmbientColor"),p.ambientColor).KV(S("uModelRotationNormals"),g),h&&this.KR.FV(h,void 0,{location:b.attribute("aNormal"),size:3})),this.KR.KV(S("uModelRotation"),f).QV(S("uModelScale"),[c.x,c.y,c.z]).QV(S("uLocationAxis"),[l.x,l.y,l.z]).QV(S("uModelAlignment"),[u.x,u.y,u.z]).QV(S("uModelSize"),[d.x,d.y,d.z]),this.KR.FV(o,0,{location:b.attribute("aGeoPos"),size:3}).fO(r).gO(n,this.KR.gl.TRIANGLES),!0})),{idCount:x}}DH(t){if(this.BH)return this.BH;const e=this.OS,i=this.VS,s=this.MH,r=this.GS,n=this.NS,o=this.KY.Lx(e),h=[],a=Sy.projectionOrthographic(-1,1,-1,1,1,-1);let l=Sy.translate(a,r.x/2,r.y/2,r.z/2);l=Sy.rotateXYZ(l,n),l=Sy.translate(l,-r.x/2,-r.y/2,-r.z/2);const u=(i.x+1)*(r.x/2),c=(i.y+1)*(r.y/2),d=(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.KY.Rx(s),h=this.KY.Qm(o);return{index:t,vertex:e,world:s,axis:o,dist:h?Ze(h,n):ze}})))).flat();o.sort(((t,e)=>t.dist-e.dist));const h=o[0];if(!h)return;const a=this.IH?this.IH[h.index]:void 0;return{coordModel:h.vertex,coordAxis:h.axis,index:h.index,value:a}}dispose(){return super.dispose(),this.kG&&(this.KR.zV(this.kG),this.kG=void 0),this.TG&&(this.KR.zV(this.TG),this.TG=void 0),this.FH&&(this.KR.zV(this.FH),this.FH=void 0),this.PH&&(this.KR.zV(this.PH),this.PH=void 0),this.IE=void 0,this.VY=void 0,this.kH=void 0,this.IH=void 0,this}iE(){return this.dispose(),this}YS(t){return this.kH=t,this.xH=!0,this.GS=t.modelSize,this}Be(t){return this.Te=sn(this.Te,t),this}Xh(){return this.Te}$S(t){return this.MH=t,this.BH=void 0,this}BV(){return this.MH}XS(t){return this.OS=t,this.BH=void 0,this}jS(t){return this.VS=t,this.BH=void 0,this}ZS(t){return this.NS=t,this.CH=!0,this.BH=void 0,this}QS(t){return this.JY=t,this}JS(){return this.JY}St(){return _e}vt(){return ze}bt(){return _e}xt(){return ze}Sv(){return _e}xv(){return ze}Tl(){return 0}Fl(){return 0}bv(){return 0}ua(){return rn(this.ca,this.Te)}Aa(t){this.ca=t}}class rp extends Xm{constructor(t,e,i,s){super(t,e,i),this.JY="cull-back",this.LM=[],this.NW=new rm(this.LM,(t=>t.vertexBuffer&&this.KR.zV(t.vertexBuffer)),!1),this._u=[],this.il=0,this.sl=[],this.el=0,this.tl=Oe,this.hl=Oe,this.rl=!1,this.RN=fg({fillStyleSolid:()=>{const t=this.Pv.getFillStyle();return Y(t)&&t},fillStyleIndividual:()=>{const t=this.Pv.getFillStyle();return H(t)&&t},fillStylePalette:()=>{const t=this.Pv.getFillStyle();return K(t)&&t},triangulatedPointStyle:()=>{const t=this.Pv;return Sr(t)&&t},wireframeLineStyleSolid:()=>{const t=Sr(this.Pv)&&this.Pv,e=t&&t.getWireframeStyle();return ns(e)&&e},wireframeFillStyleSolid:()=>{const t=Sr(this.Pv)&&this.Pv,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return Y(i)&&i}}),this.nl=void 0,this.Kn=s,this.Pv=Lr.pointStyle3D,this.av._(Jn);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;ete(t))(r,n,o,h);this.HW={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.Pv,this.Pv.fillStyle)}}PN(t,e,i,s,r){return{info:{dataPoint:this._u[t-e]}}}zs(t){const e=this.rl,i=this.sl,s=this.el,r=s>0,n=this.Pv,o=this.Pv!==this.LH,h=this.Wo.C(),a=this.Wo.u,l=this.lV();this.hl&&(this.tl=ii(this.tl,this.hl),this.hl=void 0),r&&(this._u=he(this._u,i,{canReturnB:!0}),this.il+=s);let u=i,c=s;if(e&&(this.LM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Oe})),this.NW.PW(),u=this._u,c=this.il),c>0){const t=Math.floor(this.wN.mH/(this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Ft(c,1e5,t);this.NW.kW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Oe,vertexBuffer:this.KR.sO(t*this.HW.attributesPerVertex,this.HW.prepareRenderData(e,i))})),((t,e,i)=>{this.KR.eO(t.vertexBuffer,t.existingCoordinatesCount*this.HW.attributesPerVertex,this.HW.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.RN.fillStyleSolid(o),g=this.RN.fillStyleIndividual(o),y=this.RN.fillStylePalette(o),m=d===z&&z;if(o||l||a){let t;const e=n.getSize(),i=this.HW.individualPointColorEnabled,s=this.HW.individualPointSizeEnabled,r=this.HW.individualPointSizeAxisEnabled,a=this.HW.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw Ct.alert(t),new Error(t)}if(y&&"value"===y.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw Ct.alert(t),new Error(t)}const l=this.RN.wireframeLineStyleSolid(o),u=this.RN.wireframeFillStyleSolid(o);if(f||g||y||u){const i=g?"attribute":y?["lookup",y.getLookUpProperty(),y.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(Sr(n)){const r=ne(n.getShape(),{cube:()=>Wm(this.KR),sphere:()=>np(this.KR,n,s)});t={type:"instanced",shader:this.KR.Cz(Yg["3D"],Yg.ColorShaded3D({dataType:i,shadingStyle:this.av.C().type,wireframe:!1!==u}),Yg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:dg(this.At),normalSource:r.$Y})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,fillStyleEmpty:m,mousePickingShader:h&&this.KR.Cz(Yg["3D"],Yg.MousePicking(),Yg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:dg(this.At),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else Mr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.KR.Cz(Yg["3D"],Yg.PointSize(c),Yg.Color({dataType:i}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,mousePickingShader:h&&this.KR.Cz(Yg["3D"],Yg.PointSize(c),Yg.MousePicking({useVertexId:!0}),Yg.VertexLocation({axisWorldTranslation:dg(this.At),normalSource:void 0}))})}this.NG=t}if(void 0===this.nl&&y&&"value"===y.lookUpProperty&&y.lut.percentageValues){let t=_e,e=ze;for(let i=0;it&&(t=s.value)}this.nl={min:e,max:t}}return this.rl=!1,this.sl=[],this.el=0,this.LH=n,this.av.u=!1,this}qL(t,e){const i=this.KR.gl,s=this.NG,r=this.il;if(!s)return{};const n=1===t?s.mousePickingShader:s.shader;if(!n)return{};const o=this.av.C(),{fillStyleSolid:h,fillStylePaletted:a,useIndividualPointSize:l}=s,u="instanced"===s.type&&s.useIndividualPointSize3D,c="instanced"===s.type&&s.wireframe;return this.KR.TV(n,((r,d,f,g)=>{let y=!1;if(this.KR.cE(n).QV(r("uScale"),this.KY.kE.BV()).QV(r("uDisp"),this.KY.kE.LV()).KV(r("uViewProjectionMatrix"),this.aH).DV(r("uIsHighlighted"),1===t||2===t?0:this.$o).PR(r("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(r("uRenderEffectMask"),2===t?1:0),"instanced"===s.type){const{pointSizeAxis:t,pointSizeNWU:e}=s;!1!==t&&!1===u&&this.KR.QV(r("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===l&&this.KR.DV(r("uOffsetNWU"),e).DV(g("uRatioNwuWu"),this.KY.vH())}else if("primitive"===s.type){const{pointSizePixels:t}=s;l||this.KR.DV(r("uPointSize"),t).DV(r("uDevicePixelRatio"),this.KR.dV())}if(1===t);else if("instanced"===s.type?("phong"===o.type&&this.KR.QV(r("uCameraLoc"),this.lH).QV(r("uLightLoc"),this.uH).DV(r("uAmbientReflection"),o.ambientReflection).DV(r("uSpecularReflection"),o.specularReflection).DV(r("uDiffuseReflection"),o.diffuseReflection).DV(r("uShininess"),o.shininess).PR(r("uLightColor"),o.specularColor).PR(r("uAmbientColor"),o.ambientColor),c&&this.KR.DV(r("uWireframeThickness"),c.thickness).PR(r("uWireframeColor"),c.fillStyleSolid.getColor()),h&&this.KR.PR(r("uColorDiffuse"),h.getColor()),s.fillStyleEmpty&&this.KR.PR(r("uColorDiffuse"),E)):"primitive"===s.type&&h&&this.KR.PR(r("uColor"),h.getColor()),a){const t=gg(a,this,this.nl);if(!t&&a.lut.percentageValues)return!1;this.KR.tN(f,a.lut,t)}const m=Le(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=m.Ut(e.existingDataPointsCount);this.KR.qV(r("uFirstId"),t),"instanced"===s.type?this.KR.XO(f,i):this.KR.HO(f,i)}i.bindBuffer(i.ARRAY_BUFFER,e.vertexBuffer);const n=d("aPos");if(i.vertexAttribPointer(n,3,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.KR.lO(n,1),i.enableVertexAttribArray(n),s.fillStyleIndividual&&void 0!==this.HW.attributeOffsetColor&&1!==t){const t=d("aColor");i.vertexAttribPointer(t,4,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.KR.lO(t,1),i.enableVertexAttribArray(t)}if(l&&void 0!==this.HW.attributeOffsetSize){"instanced"===s.type?this.KR.DV(g("uRatioNwuWu"),this.KY.vH()):"primitive"===s.type&&this.KR.DV(r("uDevicePixelRatio"),this.KR.dV());const t=d("instanced"===s.type?"aOffsetNWU":"aPointSize");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.KR.lO(t,1),i.enableVertexAttribArray(t)}if(u&&void 0!==this.HW.attributeOffsetPointSize3D&&"instanced"===s.type){const t=d("aOffsetAxis");i.vertexAttribPointer(t,3,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.KR.lO(t,1),i.enableVertexAttribArray(t)}if(s.fillStylePaletted&&"value"===s.fillStylePaletted.getLookUpProperty()&&void 0!==this.HW.attributeOffsetLookUpValue&&1!==t){const t=d("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.HW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.HW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.KR.lO(t,1),i.enableVertexAttribArray(t)}"instanced"===s.type?(s.geometry.qy(f,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(c)&&1!==t),y=!0):"primitive"===s.type&&(this.KR.qy(i.POINTS,e.existingCoordinatesCount),y=!0)})),y})),{idCount:r}}Al(t,e){Array.isArray(t)||(t=[t]),this.sl=he(this.sl,t,{canReturnB:!0}),this.el+=t.length;const i=e||ti(t);return this.hl=this.hl?ii(this.hl,i):i,this.nl=void 0,this}Dv(t){return this.Pv="function"==typeof t?t(this.Pv):t,this}RH(){return this.Pv}St(){return this.hl?Math.max(this.hl.max.x,this.tl.max.x):this.tl.max.x}vt(){return this.hl?Math.min(this.hl.min.x,this.tl.min.x):this.tl.min.x}bt(){return this.hl?Math.max(this.hl.max.y,this.tl.max.y):this.tl.max.y}xt(){return this.hl?Math.min(this.hl.min.y,this.tl.min.y):this.tl.min.y}Sv(){return this.hl?Math.max(this.hl.max.z,this.tl.max.z):this.tl.max.z}xv(){return this.hl?Math.min(this.hl.min.z,this.tl.min.z):this.tl.min.z}Tl(){const t=this.Pv,e=t.getSize();return"number"==typeof e?Sr(t)?e/2:Mr(t)?5:0:0}Fl(){return this.Tl()}bv(){return this.Tl()}al(){return this._u}ol(){return this.sl}pl(){return this.il}yl(){return this.el}Ot(){return this.rl=!0,this._u.length=0,this.il=0,this.sl=[],this.el=0,this.tl=Oe,this.hl=void 0,this.nl=void 0,this}dispose(){return super.dispose(),this.NW.DW(),this.NG=void 0,this}iE(){return this.dispose(),this}}const np=(t,e,i)=>{const s=e.getSize();return Jm(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class op extends Xm{constructor(t,e,i,s){super(t,e,i),this.JY="disabled",this.Te=Lr.fillStyle,this.bS=Lr.lineStyle,this.IU=p("bilinear"),this.EH=[],this.zH=void 0,this.NG={},this.VH=!1,this.RN=fg({fillStyleSolid:()=>Y(this.Te)&&this.Te,fillStylePaletted:()=>K(this.Te)&&this.Te,wireframeStyleLine:()=>ns(this.bS)&&this.bS,wireframeStyleFill:()=>{const t=this.bS&&this.bS.getFillStyle();return Y(t)&&t}}),this.Pi={x:0,z:0},this.mw={x:1,z:1},this.av._(Qn);const r="columns"===s.dataOrder?s.columns:s.rows,n="columns"===s.dataOrder?s.rows:s.columns;this.Kn={...s,primaryDimensionVectorsCount:r,secondaryDimensionVectorsCount:n},this.OH=new Array(this.Kn.primaryDimensionVectorsCount).fill(void 0),this.h_=new bm(this.wN,t.wN.$U,t.cs.At,Et,[],this.Kn).MS(nt),this.h_.BU=mm;const o=this.h_.RU.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.h_.RU.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.NH={gridTiles:o,gridTileSizes:h,largestGridTileSize:a},this.CS(this.Pi,this.mw)}PN(t,e,i,s,r){const n=t-e,o=n%(this.Kn.secondaryDimensionVectorsCount-1),h=Math.floor(n/(this.Kn.secondaryDimensionVectorsCount-1)),a="columns"===this.Kn.dataOrder?h:o,l="rows"===this.Kn.dataOrder?h:o,u=[{x:this.Pi.x+a*this.mw.x,z:this.Pi.z+l*this.mw.z,y:this.GH(h,o),intensity:this.WH(h,o),column:"columns"===this.Kn.dataOrder?h:o,row:"columns"===this.Kn.dataOrder?o:h},{x:this.Pi.x+(a+("columns"===this.Kn.dataOrder?1:0))*this.mw.x,z:this.Pi.z+(l+("rows"===this.Kn.dataOrder?1:0))*this.mw.z,y:this.GH(h+1,o),intensity:this.WH(h+1,o),column:"columns"===this.Kn.dataOrder?h+1:o,row:"columns"===this.Kn.dataOrder?o:h+1},{x:this.Pi.x+(a+1)*this.mw.x,z:this.Pi.z+(l+1)*this.mw.z,y:this.GH(h+1,o+1),intensity:this.WH(h+1,o+1),column:"columns"===this.Kn.dataOrder?h+1:o+1,row:"columns"===this.Kn.dataOrder?o+1:h+1},{x:this.Pi.x+(a+("columns"===this.Kn.dataOrder?0:1))*this.mw.x,z:this.Pi.z+(l+("rows"===this.Kn.dataOrder?0:1))*this.mw.z,y:this.GH(h,o+1),intensity:this.WH(h,o+1),column:"columns"===this.Kn.dataOrder?h:o+1,row:"columns"===this.Kn.dataOrder?o+1:h}],c=u.map((t=>this.KY.Qm(t))).map((t=>void 0===t?ze:Ze(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]}}}}GH(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}WH(t,e){if(this.h_.DU)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]}}}UH(t){this.YH=t,this.zH=void 0}CS(t,e){this.Pi=t,this.mw=e;const i=this.Kn,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.mw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.mw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.mw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.mw.z)}},r=new Map;return this.NH.gridTiles.forEach((t=>{const e="columns"===this.Kn.dataOrder?{x:this.mw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.mw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.mw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.mw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.Kn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstVector.primary,z:this.Pi.z+this.mw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstVector.secondary,z:this.Pi.z+this.mw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.GU={HH:s,tilesInfo:r},this}kS(){return{start:this.Pi,step:this.mw,end:{x:this.Pi.x+this.mw.x*this.Kn.columns,z:this.Pi.z+this.mw.z*this.Kn.rows}}}zs(t){const e=this.EH,i=rn(this.ca,this.Te),s=this.RN.fillStyleSolid(i),r=this.RN.fillStylePaletted(i),n=this.bS,o=this.bS!==this.EU,h=this.RN.wireframeStyleLine(o),a=this.RN.wireframeStyleFill(o),l=!1!==a,u=this.IU.u,c=this.IU.C(),d=this.av.C(),f=this.lV(),g=this.Wo.C();this.h_.zs();const y=this.h_.zU;if(!y)return this;this.$H=this.$H||this.XH(y);const m=this.$H;this.jH(m);const p=pm(e,m,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Sm(this.KR,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.VH=!0),"phong"===d.type&&(p.size>0||f)){const t=this.KR.gl,e=this.KR.Cz(Yg["2D"],Yg.DrawToNormalTexture({flipXZ:"rows"===this.Kn.dataOrder,vertexIdSource:this.KR.YO(),normalTextureType:this.KR.gl2?"uint":"ubyte",heightmapTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN}));m.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.GU)||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.KR.kO.qL((()=>{this.KR.TV(e,((r,n,h,l)=>(this.KR.cE(e).HO(h,a).IV(r("uTileDimensionsXZ"),["columns"===this.Kn.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Kn.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).jV(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).IV(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).IV(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).PV(r("uHeightmapTexture"),s.heightmapDataTexture,1).qy(t.POINTS,a),!0)))}),n,h,void 0,this.cs.Tn(),0)}))}))}const A=this.NG;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?A.surface={shader:this.KR.Cz(Yg["3D"],Yg.SurfaceGrid({axisWorldTranslation:dg(this.At),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Kn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.KR.gl2?"uint":"ubyte",intensityTextureType:this.KR.xz?"float":"ubyte",heightmapTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?A.surface={shader:this.KR.Cz(Yg["3D"],Yg.SurfaceGrid({axisWorldTranslation:dg(this.At),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Kn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.KR.gl2?"uint":"ubyte",intensityTextureType:this.KR.xz?"float":"ubyte",heightmapTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?A.surface={shader:this.KR.Cz(Yg["3D"],Yg.SurfaceGrid({axisWorldTranslation:dg(this.At),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Kn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.KR.gl2?"uint":"ubyte",intensityTextureType:this.KR.xz?"float":"ubyte",heightmapTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(A.surface={shader:this.KR.Cz(Yg["3D"],Yg.SurfaceGrid({axisWorldTranslation:dg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Kn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.KR.gl2?"uint":"ubyte",intensityTextureType:this.KR.xz?"float":"ubyte",heightmapTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return A.mousePicking=g?this.NG.mousePicking||{shader:this.KR.Cz(Yg["3D"],Yg.MousePicking(),Yg.SurfaceGrid({axisWorldTranslation:dg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Kn.dataOrder,shadingStyle:"simple",wireframe:!1,normalTextureType:this.KR.gl2?"uint":"ubyte",intensityTextureType:this.KR.xz?"float":"ubyte",heightmapTextureType:this.KR.xz?"float":"ubyte",littleEndian:this.KR.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.NG=A,this.EH.length=0,this.ca=this.Te,this.EU=n,this.av.u=!1,this}XH(t){const e=this.NH.gridTiles.map((e=>{const i=xm(this.KR,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.NH.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.KR.CV([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.KR.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}jH(t){var e;if("phong"===this.av.C().type)for(let i=0;i{t.normalmapTexture&&(this.KR.sE(t.normalmapTexture),t.normalmapTexture=void 0)}))}qL(t,e){var i,s,r,n;const o=this.KR.gl,h=this.$H;if(!h)return{};const a=this.av.C(),l=this.NG,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.KR.TV(u,((i,s,r,n)=>{let l=!1;if(this.KR.cE(u).XO(r,this.NH.largestGridTileSize.cells).QV(i("uScale"),this.KY.kE.BV()).QV(i("uDisp"),this.KY.kE.LV()).KV(i("uViewProjectionMatrix"),this.aH).DV(i("uIsHighlighted"),1===t||2===t?0:this.$o).PR(i("uHighlightColorOffset"),1===t||2===t?E:this.Qo).DV(i("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.KR.QV(i("uCameraLoc"),this.lH).QV(i("uLightLoc"),this.uH).DV(i("uAmbientReflection"),a.ambientReflection).DV(i("uSpecularReflection"),a.specularReflection).DV(i("uDiffuseReflection"),a.diffuseReflection).DV(i("uShininess"),a.shininess).PR(i("uLightColor"),a.specularColor).PR(i("uAmbientColor"),a.ambientColor),c)){const{wireframeFillSolid:t,wireframeSolid:e}=c,s=e.getThickness()<0?1:e.getThickness();this.KR.PR(i("uWireframeColor"),t.getColor()).DV(i("uWireframeThickness"),s)}return 1===t||"solid"===(null==d?void 0:d.fillMode)&&this.KR.PR(i("uColorDiffuse"),d.fillStyleSolid.getColor()),h.gridTileSizes.forEach((n=>{this.KR.IV(i("uTileDimensionsXZ"),["columns"===this.Kn.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.Kn.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).jV(i("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var u;const f=null===(u=this.GU)||void 0===u?void 0:u.tilesInfo.get(a.tileData);if(!f)return;let g=0,m=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.YH){const t=this.YH.fill.iFirstPrimary,e=this.YH.fill.iFirstPrimary+this.YH.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sy(Math.max(t,i),Math.min(e,s)))(t,e,i,s);g=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),m=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(g<0||m<=0)){if("intensity"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e=this.h_.nl;this.KR.tN(r,t.lut,e).PV(i("uTileIntensityValues"),a.intensityDataTexture,2).ZV(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.xv(),max:this.Sv()}:void 0;if(!e&&t.lut.percentageValues)return;this.KR.tN(r,t.lut,e)}1!==t&&"phong"===this.av.C().type&&a.normalmapTexture&&this.KR.PV(i("uNormalmapTexture"),a.normalmapTexture,3),1===t&&this.KR.qV(i("uFirstId"),e+g),this.KR.FV(h.rectangleLocationsBuffer,0,{location:s("aGeoCellOffset"),size:2},{location:c?s("aTriangleBary"):void 0,size:3}).qV(i("uBaseInstance"),g).IV(i("uTileStartLocationAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z]).IV(i("uTileSizeAxisXZ"),[f.sizeAxis.x,f.sizeAxis.z]).PV(i("uHeightmapTexture"),a.heightmapDataTexture,0).pO(h.rectangleLocationsDrawMode,0,h.rectangleLocationsDrawLength,m),l=!0,o.bindBuffer(o.ARRAY_BUFFER,null)}}))})),l})),{idCount:this.Kn.columns*this.Kn.rows}}dispose(){return super.dispose(),this.h_.dispose(),this.$H&&(this.$H.gridTileSizes.forEach((t=>{})),this.$H.gridTiles.forEach((t=>{this.KR.sE(t.heightmapDataTexture),t.normalmapTexture&&this.KR.sE(t.normalmapTexture)})),this.KR.zV(this.$H.rectangleLocationsBuffer),this.$H=void 0),this.NG={},this}iE(){return this.dispose(),this.h_.iE(),this}PS(t){return this.h_.PS(t),this}DS(t){this.EH.push(t),Am(this.NH.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.OH[n];if(e)i=ie.max?s:e.max;else{e={min:ze,max:_e},this.OH[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.zH={min:i,max:s},this.zH}}class hp extends Xm{constructor(t,e,i,s){super(t,e,i),this.JY="disabled",this.UU=0,this.HU={},this.QH=new Map,this.Pi={x:0,z:0},this.mw={x:1,z:1},this.Kn={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.HH={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.mw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.mw.z:this.Pi.z}};const r=()=>({shape:new op(this.KY,Et,this.jo,{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.LM=[r(),r()]}zs(t){this.LM.forEach((e=>{e.shape.zs(t)}));const e=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Bt(null===(i=e.shape.h_.nl)||void 0===i?void 0:i.min,ze)),t.max=Math.max(t.max,Bt(null===(s=e.shape.h_.nl)||void 0===s?void 0:s.max,_e)),t}),{min:ze,max:_e}),i=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Bt(null===(i=e.shape.zH)||void 0===i?void 0:i.min,ze)),t.max=Math.max(t.max,Bt(null===(s=e.shape.zH)||void 0===s?void 0:s.max,_e)),t}),{min:ze,max:_e});return this.LM.forEach((t=>{t.shape.h_.nl=e,t.shape.zH=i})),this}qL(t,e){let i=0;return this.LM.forEach((s=>{if(!s.hasData)return;s.shape.aH=this.aH,s.shape.lH=this.lH,s.shape.uH=this.uH;const{idCount:r}=s.shape.qL(t,e+i);void 0!==r&&(this.QH.set(s,{idFirst:e+i,idCount:r}),i+=r)})),{idCount:i}}PN(t,e,i,s,r){const n=Array.from(this.QH).find((e=>je(t,e[1].idFirst,e[1].idFirst+e[1].idCount-1)));return n?n[0].shape.PN(t,n[1].idFirst,n[1].idCount,s,r):{}}CS(t,e){return this.Pi=t,this.mw=e,this.LM.forEach((t=>{t.shape.CS("columns"===this.Kn.scrollDimension?{x:t.shape.kS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.kS().start.z},this.mw)})),"columns"===this.Kn.scrollDimension?(this.HH.min.z=t.z,this.HH.max.z=this.Pi.z+(this.Kn.rows-1)*this.mw.z):(this.HH.min.x=t.x,this.HH.max.x=this.Pi.x+(this.Kn.columns-1)*this.mw.x),this}kS(){return{start:this.Pi,step:this.mw}}Ot(){return this.UU=0,this.HU={},this.HH={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.Kn.scrollDimension?this.Pi.x+(this.Kn.columns-1)*this.mw.x:this.Pi.x,z:"columns"===this.Kn.scrollDimension?this.Pi.z+(this.Kn.rows-1)*this.mw.z:this.Pi.z}},this.LM.forEach((t=>{t.shape.setVisible(!1),t.shape.VH=!1,t.hasData=!1})),this}ES(t){var e;const i=this.LM[0],s=this.LM[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.UU/this.Kn.scrollDimensionSize)%this.LM.length,o=this.LM[e],h=this.UU%this.Kn.scrollDimensionSize,a=this.Kn.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,y=n+u,m=this.UU>=this.Kn.scrollDimensionSize&&c<=this.Kn.scrollDimensionSize-1,p=l;l&&(o.shape.CS("columns"===this.Kn.scrollDimension?{x:this.Pi.x+(this.UU-1)*this.mw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.UU-1)*this.mw.z},this.mw),o.shape.setVisible(!0));const A=m?0:1,x=c+(m?1:0);o.shape.UH({fill:{iFirstPrimary:A,amountPrimary:x},wireframe:{iFirstPrimary:A,amountPrimary:x,connectNext:!1}});const S=o===i?s:i,v=c+1,b=1+this.Kn.scrollDimensionSize-v;S.shape.UH({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,y);let i=!1;p&&this.HU.yValues&&(i=!0,e.splice(0,0,this.HU.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Kn.staticDimensionSize,values:e,type:"y"};o.shape.DS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,y);let i=!1;p&&this.HU.intensityValues&&(i=!0,e.splice(0,0,this.HU.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Kn.staticDimensionSize,values:e,type:"intensity"};o.shape.PS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.UU+=u,n+=u,this.HU=M}while(ne.shape.FS(t))),this}IS(){return this.LM[0].shape.IS()}Be(t){return this.LM.forEach((e=>e.shape.Be(t))),this}Xh(){return this.LM[0].shape.Xh()}MS(t){return this.LM.forEach((e=>e.shape.MS(t))),this}TS(){return this.LM[0].shape.TS()}iE(){return this.dispose(),this.LM.forEach((t=>t.shape.iE())),this}dispose(){return super.dispose(),this.LM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.LM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}yv(t){return super.yv(t),this.LM.forEach((e=>e.shape.yv(t))),this}St(){return this.HH.max.x}vt(){return this.HH.min.x}bt(){return Math.max(this.LM[0].shape.bt(),this.LM[1].shape.bt())}xt(){return Math.min(this.LM[0].shape.xt(),this.LM[1].shape.xt())}Sv(){return this.HH.max.z}xv(){return this.HH.min.z}Tl(){return 0}Fl(){return 0}bv(){return 0}ds(t){return super.ds(t),this.LM.forEach((e=>e.shape.ds(t))),this}}class ap extends zm{constructor(t,e,i,s){super(t,e,i),this.JH=45,this.KH=.1,this.qH=100,this.lH=f(0,0,1),this.t$=f(0,0,-1),this.i$=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.av=new Zn,this.At=s}Ax(){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.lH=t,this}getCameraLocation(){return this.lH}setCameraDirection(t){return this.t$=Ve.normalize(t),this}getCameraDirection(){return this.t$}setLightLocation(t){return this.uH=t,this}getLightLocation(){return this.uH}s$(){return f(this.i$[0],this.i$[1],this.i$[2])}e$(){return f(this.i$[4],this.i$[5],this.i$[6])}}class lp extends ap{constructor(t,e,i,s){super(t,e,i,s),this.kE=new By,this.h$=!0,this.r$="perspective",this.wN=t,this.gl=t.kN(),this.YY=this.OY,this.n$=this.cs.Lo((()=>{this.h$=!0})),this.o$=s.H((()=>{this.h$=!0}))}wV(t){const e=t.vt(),i=t.xt(),s=t.xv(),r=t.St(),n=t.bt(),o=t.Sv();if(e===ze||r===_e||i===ze||n===_e||s===ze||o===_e)return Ne;const h=t.Tl(),a=t.Fl(),l=t.bv(),u=Math.abs(t.Bs.jm(h)*t.At.x.rt()),c=Math.abs(t.Bs.jm(a)*t.At.y.rt()),d=Math.abs(t.Bs.jm(l)*t.At.z.rt()),f=e-u,g=r+u,y=i-c,m=n+c,p=s-d,A=o+d;let x;return[{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:A},{x:g,y,z:A},{x:f,y:m,z:A},{x:g,y:m,z:A}].map((e=>t.Bs.Qm(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?ei(x,{min:t,max:t}):e})),x||Ne}Qm(t){if(this.a$(),this.l$(),!this.aH)return;const e=this.kE.LV(),i=f(e[0],e[1],e[2]),s=this.kE.BV(),r=f(s[0],s[1],s[2]),n=Ve.divideVec(Ve.subtractVec(t,i),r),o=this.aH,h=Sy.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}}Lx(t){const e=this.kE.LV(),i=this.kE.BV(),s=Ve.divideVec(Ve.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}}Rx(t){const e=this.kE.LV(),i=this.kE.BV(),s=Ve.addVec(Ve.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}}jm(t){return t/1e3}vH(){return.001}zs(){const t=this.lH,e=this.uH,i=this.At.x.u||this.At.y.u||this.At.z.u;if(!e)throw pe(0,(()=>Ae()));const{viewProjectionMatrix:s}=this.a$();this.l$();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.OY.forEach((t=>{t.aH=s,t.lH=r,t.uH=n,t.zs(i)})),this}Dx(t){this.r$!==t&&(this.r$=t,this.h$=!0)}Bx(){return this.r$}a$(){if(!this.h$&&this.aH)return{viewProjectionMatrix:this.aH};const t=this.Ax(),e=t.width/t.height;if("perspective"===this.r$)this.u$=Sy.projectionPerspective(this.JH,e,this.KH,this.qH);else{let t,i;e>1?(t=.5,i=t/e):(i=.5,t=i*e),this.u$=Sy.projectionOrthographic(-t,t,-i,i,this.KH,this.qH)}const i=this.lH;this.i$[12]=i.x,this.i$[13]=i.y,this.i$[14]=i.z;const s=this.t$,r=f(0,1,0),n=Ve.multiply(s,-1),o=Ve.normalize(Ve.cross(r,n)),h=Ve.normalize(Ve.cross(n,o));this.i$[0]=o.x,this.i$[1]=o.y,this.i$[2]=o.z,this.i$[4]=h.x,this.i$[5]=h.y,this.i$[6]=h.z,this.i$[8]=n.x,this.i$[9]=n.y,this.i$[10]=n.z,this.c$=Sy.inverse(this.i$);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,y=(a.y+l.y/2)/u.y,m=Sy.multiply(Sy.translation(Gn(-1,1,g),Gn(-1,1,y),0),Sy.scaling(c,d,1));return this.aH=Sy.multiply(m,Sy.multiply(this.u$,this.c$)),this.d$=Sy.inverse(this.aH),this.h$=!1,{viewProjectionMatrix:this.aH}}l$(){this.kE.mN(this.At.x),this.kE.vN(this.At.y),this.kE.SN(this.At.z)}qL(t,e,i){var s;const r=this.gl.dV(),n=this.Ax(),o={x:n.x*r*e,y:n.y*r*e,width:n.width*r*e,height:n.height*r*e};this.gl._V(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.YY.values());for(let e=0;e(this.ji||this.xn||iy(this.KR.gl)||(t&&(this.f$=!0),this.An=!0,this.x$||this.nn.wz(t)),this),this.x$=!1,this.Iz=t=>{if(this.ji||this.xn)return;const e=t-this.A$;if(e>=this.no||-1===this.no){this.x$=!0,this.A$=t,this.f$=!1;const i=e>50?1e3/60:e;this.gn&&this.gn(i),this.An=!1,-1!==this.no&&this.f$&&(this.nn.wz(this.f$),this.An=!0),this.us.zs(e),this.In(),this.Pn(),this.pn&&this.pn(),this.x$=!1,this.R.emit("render"),this.An&&this.Ms(this.f$)}else this.An=!0,this.nn.wz()},this.b$=new Map,this.kN=()=>this.KR,this.M$=()=>{var t,e,i;const s=this.Xn(),r=this.g$,n=Ct.performance.now(),o=null===(t=this._$)||void 0===t?void 0:t.w$.reduce(((t,e)=>t?e.C$&&t.C$&&e.C$>t.C$?e:t:e),void 0),h=null==o?void 0:o.C$,a=null===(e=this.Wn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.jn)||void 0===i?void 0:i.timeStamp,u=this.k$;return r?(this.Ms(!0),!1):void 0===o||(void 0===o||!o.T$)&&(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.F$=()=>{var t,e;this.I$=void 0;const i=null===(e=null===(t=this._$)||void 0===t?void 0:t.P$)||void 0===e?void 0:e.D$;void 0===i||i>=this.p$||this.B$()},this.Pn=()=>{if(this.ji||this.xn)return this;const t=this.KR.gl,e=Ct.performance.now();this.KR.bV(t.FRAMEBUFFER,this.nn.vz?this.cz[0]:null);const i=this.Z,s=i.x>0&&i.y>0;if(this.kn.u&&this.KR.vO(this.kn.C()),t.resize&&s&&t.resize(i.x*this.KR.dV(),i.y*this.KR.dV()),this.KR.MV(0,0,i.x*this.KR.dV(),i.y*this.KR.dV()),this.KR._V(0,0,i.x*this.KR.dV(),i.y*this.KR.dV()),this.KR.Ot(),s)for(const t of this.cn.values())t.qL(0,1,[]);if(this.Kn.eo&&s&&(this.I$&&(Ct.clearTimeout(this.I$),this.I$=void 0),this.M$()?(this.B$(),this.KR.bV(t.FRAMEBUFFER,this.nn.vz?this.cz[0]:null)):this.I$=Ct.setTimeout(this.F$,500)),this.J(),this.hn(),this.En&&this.Rn(this.En),this.nn.vz){const e=this.KR.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.cz[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.cz[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.Z.x*this.KR.dV(),this.Z.y*this.KR.dV(),0,0,this.Z.x*this.KR.dV(),this.Z.y*this.KR.dV(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.rz),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.Z.x*this.KR.dV(),this.Z.y*this.KR.dV(),0),t.bindTexture(t.TEXTURE_2D,null);return this.KR.bV(t.FRAMEBUFFER,null),iy(this.KR.gl)?this.nn.ez(0,0,this.Z.x*this.KR.dV(),this.Z.y*this.KR.dV(),[this]):this.nn.wz(),this.g$=!1,this.p$=e,this},this.In=()=>{if("use-window"===this.L$.mode){const t=Ct.devicePixelRatio||1;this.KR.DO(t)}const t=this.Z;if(0===t.x||0===t.y)return this;this.yo.it(t);for(const t of this.cn.values())t.zs();return this.J(),this},this.nn=t,this.nn.yz){this.R$=Ct.document.createElement("canvas"),this.R$.style.width="100%",this.R$.style.height="100%",this.R$.style.display="block",this.R$.style.boxSizing="content-box",this.R$.style.position="absolute";const t=this.R$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new At("No Canvas context available.");this.nz=t,this.Jr.appendChild(this.R$)}this.nn.Bz(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.nn.vz&&t.gl2&&(n=new s(this,this.Kn,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),n||this.nn.vz||(n=new s(this,this.Kn,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),!n)throw new At("No WebGL context available");if(this.KR=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.L$={mode:"fixed",value:e.devicePixelRatio},this.KR.DO(e.devicePixelRatio);else{const t=Ct.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=Ct.devicePixelRatio||1;this.L$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.KR.DO(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.fo=this.E$(o),this.po=this.E$(h),this.z$(this.fo,this.po),this.$U=this.UF("engine offscreen",1e6),this.V$=this.UF("engine bg",0);const a="function"==typeof this.ts.lcjsBackgroundFillStyle?this.ts.lcjsBackgroundFillStyle(this.Kn.Ks):this.ts.lcjsBackgroundFillStyle;this.yo=this.V$.Le(this.At).Be(a).De(this.ts.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ee({x:0,y:0});const l=this.UF("engine effects",200001).HY(this.ts.effect);this.hs=l;const u=this.nn.vz,d=this.oi();u&&(this.cz=[n.NV(),n.NV()]);const f=this.KR.gl;u&&(this.y$=f.createRenderbuffer(),this.m$=f.createRenderbuffer()),this.rz=f.createTexture();const g=d.x*this.KR.dV(),y=d.y*this.KR.dV();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.y$);const t=this.KR.gl2.ctx;this.v$=this.nn.QE&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.v$,t.RGBA8,g,y),f.bindRenderbuffer(f.RENDERBUFFER,this.m$),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,y),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.v$,t.DEPTH_COMPONENT16,g,y)}u&&(this.KR.bV(f.FRAMEBUFFER,this.cz[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.y$),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.m$)),f.bindTexture(f.TEXTURE_2D,this.rz),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,y,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.KR.bV(f.FRAMEBUFFER,this.cz[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.rz,0)),this.KR.bV(f.FRAMEBUFFER,null),this.wn(),this.hn(),this.fp=Ir(this),this.Ap={ts:this.ts,us:this.us,At:this.At,Ms:t=>this.Ms(t),Xn:()=>this.Xn(),xs:t=>(this.k$=Ct.performance.now(),this.xs({x:t.clientX,y:t.clientY})),DD:t=>this.DD(t),Kn:this.Kn,Zn:t=>this.Zn(t),hs:this.hs,No:t=>this.No(t),Go:t=>this.Go(t),Ng:{Og:(t,e,i)=>this.KR.Zh(e.family).fE(t,e,i,this.ts.isDark)}};const m=()=>{this.Y()};Ct.addEventListener("unload",m),this.yn.push((()=>{Ct.removeEventListener("unload",m)}))}get O$(){return this.cn}an(t,e){let i=this.b$.get(t);if(!i){const e=this.KR.VO(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.b$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{BD:()=>e.qz,LD:t=>{e.qz?t():o.push(t)}}},this.b$.set(t,i),e.cE(this),e.nV((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new uo(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}DD(t){const e=Array.from(this.b$.values()).find((e=>e.instances.has(t)));if(!e)throw pe(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._$)||void 0===e?void 0:e.P$;if(!i)return;const s=this.Ve(t.x,t.y),r=Math.round(s.x*this.KR.dV()),n=Math.round(s.y*this.KR.dV());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.N$(i,r+t[0]/i.G$,n+t[1]/i.G$))).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)}N$(t,e,i){const s=Math.round(e*t.G$),r=Math.round(i*t.G$);if(s<0||s>=t.Z.x||r<0||r>=t.Z.y)return;const n=4*(s+r*t.Z.x),o=t.W$[n+0],h=t.W$[n+1],a=t.W$[n+2],l=t.W$[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.U$.find((t=>u>=t.idFirst&&u<=t.idLast));if(!c)return;const{collectionMember:d,info:f}=c.entity.PN(u,c.idFirst,c.idCount,e,i);return{entity:c.entity,collectionMember:d,entityIndex:c.entityIndex,layerIndex:c.layer.Bn(),info:f}}tn(t,e,i){const s=this.KR.gl;this.nn.vz?(this.KR.bV(s.FRAMEBUFFER,this.cz[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.rz,0)):this.KR.bV(s.FRAMEBUFFER,null);const r=this.hz(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.nn.vz||this.Pn(),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.nn.vz&&(this.KR.bV(s.FRAMEBUFFER,this.cz[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.y$),this.KR.bV(s.FRAMEBUFFER,this.cz[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.rz,0)),this.KR.bV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=Ct.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Nm))throw new Error("Unexpected Engine Layer error");return i}return this.Dn(new Nm(this,e,t))}$F(t,e,i){const s=this.xo(e);if(s){if(pe(0,(()=>{})),!(s instanceof lp))throw new Error("Unexpected Engine Layer error");return s}return this.Dn(new lp(this,e,t,i))}oi(){return this.Z}hz(){const t=this.KR.dV();return{x:Math.round(this.Z.x*t),y:Math.round(this.Z.y*t)}}E$(t){return t instanceof Array||(t=[t,t]),t}Y$(){return this.nn.oz}H$(){return iy(this.KR.gl)}B$(){var t;const e=this.KR.gl,i=Ct.performance.now(),s=this.Kn.so,r={x:Math.ceil(this.Z.x*this.KR.dV()*s),y:Math.ceil(this.Z.y*this.KR.dV()*s)};this._$||(this._$={G$:s,$$:r,w$:[],P$:void 0});let n=this._$.w$.find((t=>!t.T$)),o=!1;n||(o=!0,n={T$:!1,Z:r,JO:e.createTexture(),X$:this.KR.NV(),m$:this.KR.GV(),j$:new Uint8Array,C$:void 0},this._$.w$.push(n));const h=n;(o||h.Z.x!==r.x||h.Z.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.JO),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.KR.bV(e.FRAMEBUFFER,h.X$),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.JO,0),e.bindRenderbuffer(e.RENDERBUFFER,h.m$),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.m$),h.j$=new Uint8Array(r.x*r.y*4),h.Z=r),h.T$=!0,h.C$=i,this.KR.bV(e.FRAMEBUFFER,h.X$),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.KR.MV(0,0,r.x,r.y);const a=[];for(const t of this.cn.values())t.qL(1,s,a);this.KR.bV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.KR.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this._$){const t=this._$.P$;if(t&&t.D$>i)return;this._$.P$={D$:i,G$:s,Z:r,W$:h.j$,U$:a}}};l?this.KR.jO(l,h.X$,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.j$).then((()=>{this.ji||(h.T$=!1,u())})).catch((t=>{this.ji||(h.T$=!1,Ct.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.KR.ZO(h.X$,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.j$),h.T$=!1,u())}wn(t){const e=this.KR.dV();if("use-window"===this.L$.mode){const t=Ct.devicePixelRatio||1;this.KR.DO(t)}const i=this.Z.x,s=this.Z.y,r=t||{x:this.Jr.offsetWidth,y:this.Jr.offsetHeight},n=this.KR.dV();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.KR.gl;this.nn.yz&&this.nz&&(this.nz.canvas.width=t,this.nz.canvas.height=e);const s=this.nn.vz;if(this.rz&&(i.bindTexture(i.TEXTURE_2D,this.rz),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),s){const s=this.KR.gl2.ctx;this.y$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.y$),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.v$,s.RGBA8,t,e)),this.m$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.m$),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.v$,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.I$&&(Ct.clearTimeout(this.I$),this.I$=void 0),Array.from(this.KR.NE.entries()).forEach((([t,e])=>{e.iE(!1),this.KR.NE.delete(t)})),Array.from(this.KR.HV.values()).forEach((t=>{t.unbindResources()})),this.KR.HV.clear(),this.KR.YV.jz(),this.KR.TO.Y(),this.KR.zV(this.KR.FO),this.KR.zV(this.KR.IO),this.KR._O.forEach(((t,e)=>{this.KR.gl.deleteBuffer(e)})),this.KR._O.clear(),this.KR.UO&&(this.KR.zV(this.KR.UO.buffer),this.KR.UO=void 0),this.KR.UV(this.cz[0]),this.KR.UV(this.cz[1]),this.KR.WV(this.y$),this.KR.sE(this.rz),this.KR.WV(this.m$),this._$&&(this._$.w$.forEach((t=>{this.KR.WV(t.m$),this.KR.UV(t.X$),this.KR.sE(t.JO)})),this._$=void 0),this.KR.xO.forEach((t=>this.KR.zV(t))),this.b$.clear(),this.nn.Rz(this),this.R$&&(null===(t=this.R$.parentElement)||void 0===t||t.removeChild(this.R$),this.R$=void 0),this.nz&&(this.nz=void 0),this.KR.gl=void 0)}}var cp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},dp={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.rV(t||0,e||10,i||"be"))}var n;"object"==typeof dp?dp.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.rV=function(t,e,s){if("number"==typeof t)return this.Z$(t,e,s);if("object"==typeof t)return this.Q$(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.J$(t,r):this.K$(t,e,r),"-"===t[0]&&(this.negative=1),this.q$(),"le"===s&&this.Q$(this.toArray(),e,s)},r.prototype.Z$=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.Q$(this.toArray(),e,s)},r.prototype.Q$=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.q$()},r.prototype.J$=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.q$()},r.prototype.K$=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.eX()},r.prototype.eX=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.q$()}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 y=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?y+s:u[l-y.length]+y+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.q$();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.hX=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.nX=function(t){return 32-Math.clz32(t)}:r.prototype.nX=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.oX=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.nX(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.sX(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.q$()},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.sX(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.eX()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.eX();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,y=f>>>13,m=0|o[2],p=8191&m,A=m>>>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],R=8191&T,w=T>>>13,k=0|o[6],E=8191&k,I=k>>>13,F=0|o[7],D=8191&F,B=F>>>13,P=0|o[8],L=8191&P,V=P>>>13,z=0|o[9],_=8191&z,N=z>>>13,O=0|h[0],U=8191&O,Y=O>>>13,G=0|h[1],H=8191&G,W=G>>>13,K=0|h[2],X=8191&K,j=K>>>13,$=0|h[3],Z=8191&$,Q=$>>>13,q=0|h[4],J=8191&q,tt=q>>>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,yt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var mt=(l+(s=Math.imul(c,U))|0)+((8191&(r=(r=Math.imul(c,Y))+Math.imul(d,U)|0))<<13)|0;l=((n=Math.imul(d,Y))+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(g,U),r=(r=Math.imul(g,Y))+Math.imul(y,U)|0,n=Math.imul(y,Y);var pt=(l+(s=s+Math.imul(c,H)|0)|0)+((8191&(r=(r=r+Math.imul(c,W)|0)+Math.imul(d,H)|0))<<13)|0;l=((n=n+Math.imul(d,W)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,U),r=(r=Math.imul(p,Y))+Math.imul(A,U)|0,n=Math.imul(A,Y),s=s+Math.imul(g,H)|0,r=(r=r+Math.imul(g,W)|0)+Math.imul(y,H)|0,n=n+Math.imul(y,W)|0;var At=(l+(s=s+Math.imul(c,X)|0)|0)+((8191&(r=(r=r+Math.imul(c,j)|0)+Math.imul(d,X)|0))<<13)|0;l=((n=n+Math.imul(d,j)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(S,U),r=(r=Math.imul(S,Y))+Math.imul(v,U)|0,n=Math.imul(v,Y),s=s+Math.imul(p,H)|0,r=(r=r+Math.imul(p,W)|0)+Math.imul(A,H)|0,n=n+Math.imul(A,W)|0,s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,j)|0)+Math.imul(y,X)|0,n=n+Math.imul(y,j)|0;var xt=(l+(s=s+Math.imul(c,Z)|0)|0)+((8191&(r=(r=r+Math.imul(c,Q)|0)+Math.imul(d,Z)|0))<<13)|0;l=((n=n+Math.imul(d,Q)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(M,U),r=(r=Math.imul(M,Y))+Math.imul(C,U)|0,n=Math.imul(C,Y),s=s+Math.imul(S,H)|0,r=(r=r+Math.imul(S,W)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,W)|0,s=s+Math.imul(p,X)|0,r=(r=r+Math.imul(p,j)|0)+Math.imul(A,X)|0,n=n+Math.imul(A,j)|0,s=s+Math.imul(g,Z)|0,r=(r=r+Math.imul(g,Q)|0)+Math.imul(y,Z)|0,n=n+Math.imul(y,Q)|0;var St=(l+(s=s+Math.imul(c,J)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,J)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(R,U),r=(r=Math.imul(R,Y))+Math.imul(w,U)|0,n=Math.imul(w,Y),s=s+Math.imul(M,H)|0,r=(r=r+Math.imul(M,W)|0)+Math.imul(C,H)|0,n=n+Math.imul(C,W)|0,s=s+Math.imul(S,X)|0,r=(r=r+Math.imul(S,j)|0)+Math.imul(v,X)|0,n=n+Math.imul(v,j)|0,s=s+Math.imul(p,Z)|0,r=(r=r+Math.imul(p,Q)|0)+Math.imul(A,Z)|0,n=n+Math.imul(A,Q)|0,s=s+Math.imul(g,J)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(y,J)|0,n=n+Math.imul(y,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(E,U),r=(r=Math.imul(E,Y))+Math.imul(I,U)|0,n=Math.imul(I,Y),s=s+Math.imul(R,H)|0,r=(r=r+Math.imul(R,W)|0)+Math.imul(w,H)|0,n=n+Math.imul(w,W)|0,s=s+Math.imul(M,X)|0,r=(r=r+Math.imul(M,j)|0)+Math.imul(C,X)|0,n=n+Math.imul(C,j)|0,s=s+Math.imul(S,Z)|0,r=(r=r+Math.imul(S,Q)|0)+Math.imul(v,Z)|0,n=n+Math.imul(v,Q)|0,s=s+Math.imul(p,J)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(A,J)|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(y,it)|0,n=n+Math.imul(y,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(D,U),r=(r=Math.imul(D,Y))+Math.imul(B,U)|0,n=Math.imul(B,Y),s=s+Math.imul(E,H)|0,r=(r=r+Math.imul(E,W)|0)+Math.imul(I,H)|0,n=n+Math.imul(I,W)|0,s=s+Math.imul(R,X)|0,r=(r=r+Math.imul(R,j)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,j)|0,s=s+Math.imul(M,Z)|0,r=(r=r+Math.imul(M,Q)|0)+Math.imul(C,Z)|0,n=n+Math.imul(C,Q)|0,s=s+Math.imul(S,J)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(v,J)|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(y,nt)|0,n=n+Math.imul(y,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(L,U),r=(r=Math.imul(L,Y))+Math.imul(V,U)|0,n=Math.imul(V,Y),s=s+Math.imul(D,H)|0,r=(r=r+Math.imul(D,W)|0)+Math.imul(B,H)|0,n=n+Math.imul(B,W)|0,s=s+Math.imul(E,X)|0,r=(r=r+Math.imul(E,j)|0)+Math.imul(I,X)|0,n=n+Math.imul(I,j)|0,s=s+Math.imul(R,Z)|0,r=(r=r+Math.imul(R,Q)|0)+Math.imul(w,Z)|0,n=n+Math.imul(w,Q)|0,s=s+Math.imul(M,J)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(C,J)|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(y,at)|0,n=n+Math.imul(y,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(_,U),r=(r=Math.imul(_,Y))+Math.imul(N,U)|0,n=Math.imul(N,Y),s=s+Math.imul(L,H)|0,r=(r=r+Math.imul(L,W)|0)+Math.imul(V,H)|0,n=n+Math.imul(V,W)|0,s=s+Math.imul(D,X)|0,r=(r=r+Math.imul(D,j)|0)+Math.imul(B,X)|0,n=n+Math.imul(B,j)|0,s=s+Math.imul(E,Z)|0,r=(r=r+Math.imul(E,Q)|0)+Math.imul(I,Z)|0,n=n+Math.imul(I,Q)|0,s=s+Math.imul(R,J)|0,r=(r=r+Math.imul(R,tt)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,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(y,ct)|0,n=n+Math.imul(y,dt)|0;var Tt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,yt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,yt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(_,H),r=(r=Math.imul(_,W))+Math.imul(N,H)|0,n=Math.imul(N,W),s=s+Math.imul(L,X)|0,r=(r=r+Math.imul(L,j)|0)+Math.imul(V,X)|0,n=n+Math.imul(V,j)|0,s=s+Math.imul(D,Z)|0,r=(r=r+Math.imul(D,Q)|0)+Math.imul(B,Z)|0,n=n+Math.imul(B,Q)|0,s=s+Math.imul(E,J)|0,r=(r=r+Math.imul(E,tt)|0)+Math.imul(I,J)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(R,it)|0,r=(r=r+Math.imul(R,st)|0)+Math.imul(w,it)|0,n=n+Math.imul(w,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 Rt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,yt)|0)+Math.imul(y,gt)|0))<<13)|0;l=((n=n+Math.imul(y,yt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(_,X),r=(r=Math.imul(_,j))+Math.imul(N,X)|0,n=Math.imul(N,j),s=s+Math.imul(L,Z)|0,r=(r=r+Math.imul(L,Q)|0)+Math.imul(V,Z)|0,n=n+Math.imul(V,Q)|0,s=s+Math.imul(D,J)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(B,J)|0,n=n+Math.imul(B,tt)|0,s=s+Math.imul(E,it)|0,r=(r=r+Math.imul(E,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(R,nt)|0,r=(r=r+Math.imul(R,ot)|0)+Math.imul(w,nt)|0,n=n+Math.imul(w,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 wt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,yt)|0)+Math.imul(A,gt)|0))<<13)|0;l=((n=n+Math.imul(A,yt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(_,Z),r=(r=Math.imul(_,Q))+Math.imul(N,Z)|0,n=Math.imul(N,Q),s=s+Math.imul(L,J)|0,r=(r=r+Math.imul(L,tt)|0)+Math.imul(V,J)|0,n=n+Math.imul(V,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(B,it)|0,n=n+Math.imul(B,st)|0,s=s+Math.imul(E,nt)|0,r=(r=r+Math.imul(E,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(R,at)|0,r=(r=r+Math.imul(R,lt)|0)+Math.imul(w,at)|0,n=n+Math.imul(w,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,yt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,yt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(_,J),r=(r=Math.imul(_,tt))+Math.imul(N,J)|0,n=Math.imul(N,tt),s=s+Math.imul(L,it)|0,r=(r=r+Math.imul(L,st)|0)+Math.imul(V,it)|0,n=n+Math.imul(V,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(B,nt)|0,n=n+Math.imul(B,ot)|0,s=s+Math.imul(E,at)|0,r=(r=r+Math.imul(E,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(R,ct)|0,r=(r=r+Math.imul(R,dt)|0)+Math.imul(w,ct)|0,n=n+Math.imul(w,dt)|0;var Et=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,yt)|0)+Math.imul(C,gt)|0))<<13)|0;l=((n=n+Math.imul(C,yt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(_,it),r=(r=Math.imul(_,st))+Math.imul(N,it)|0,n=Math.imul(N,st),s=s+Math.imul(L,nt)|0,r=(r=r+Math.imul(L,ot)|0)+Math.imul(V,nt)|0,n=n+Math.imul(V,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(B,at)|0,n=n+Math.imul(B,lt)|0,s=s+Math.imul(E,ct)|0,r=(r=r+Math.imul(E,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(R,gt)|0)|0)+((8191&(r=(r=r+Math.imul(R,yt)|0)+Math.imul(w,gt)|0))<<13)|0;l=((n=n+Math.imul(w,yt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(_,nt),r=(r=Math.imul(_,ot))+Math.imul(N,nt)|0,n=Math.imul(N,ot),s=s+Math.imul(L,at)|0,r=(r=r+Math.imul(L,lt)|0)+Math.imul(V,at)|0,n=n+Math.imul(V,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(B,ct)|0,n=n+Math.imul(B,dt)|0;var Ft=(l+(s=s+Math.imul(E,gt)|0)|0)+((8191&(r=(r=r+Math.imul(E,yt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,yt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(_,at),r=(r=Math.imul(_,lt))+Math.imul(N,at)|0,n=Math.imul(N,lt),s=s+Math.imul(L,ct)|0,r=(r=r+Math.imul(L,dt)|0)+Math.imul(V,ct)|0,n=n+Math.imul(V,dt)|0;var Dt=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,yt)|0)+Math.imul(B,gt)|0))<<13)|0;l=((n=n+Math.imul(B,yt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(_,ct),r=(r=Math.imul(_,dt))+Math.imul(N,ct)|0,n=Math.imul(N,dt);var Bt=(l+(s=s+Math.imul(L,gt)|0)|0)+((8191&(r=(r=r+Math.imul(L,yt)|0)+Math.imul(V,gt)|0))<<13)|0;l=((n=n+Math.imul(V,yt)|0)+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Pt=(l+(s=Math.imul(_,gt))|0)+((8191&(r=(r=Math.imul(_,yt))+Math.imul(N,gt)|0))<<13)|0;return l=((n=Math.imul(N,yt))+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=mt,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]=Rt,a[11]=wt,a[12]=kt,a[13]=Et,a[14]=It,a[15]=Ft,a[16]=Dt,a[17]=Bt,a[18]=Pt,0!==l&&(a[19]=l,i.length++),i};function y(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.q$()}function m(t,e,i){return y(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?y(this,t,e):m(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),m(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.q$()},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.q$();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.q$()},r.prototype.lX=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.nX(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.aX(n,d,c);0!==s.negative;)d--,s.negative=0,s.aX(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.q$(),s.q$(),"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.lX(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.q$(),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,y=1;!(s.words[0]&y)&&g<26;++g,y<<=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.uX=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.q$(),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).cX(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.cX=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.cX(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.dX(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.dX(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.fX(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.fX(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.fX(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.fX(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.fX(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.fX(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.AX()}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.gX(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.uX(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.AX=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.q$(),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.gX=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.fX=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.dX=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).cX(this):(a(t,t.umod(this.m).cX(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).cX(this)},M.prototype.add=function(t,e){this.dX(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.cX(this)},M.prototype.iadd=function(t,e){this.dX(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.dX(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.cX(this)},M.prototype.isub=function(t,e){this.dX(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.fX(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.dX(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.dX(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 y=f,m=0;0!==y.cmp(h);m++)y=y.redSqr();i(m=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.cX(this)},C.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).cX(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.cX(this)},C.prototype.invm=function(t){return this.imod(t.uX(this.m).mul(this.r2)).cX(this)}}(0,cp);var fp=dp.exports;function gp(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 yp=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},mp=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 pp{constructor(t,e){this.type=t,this.p=new fp(e.p,16),this.red=e.prime?fp.red(e.prime):fp.mont(this.p),this.zero=new fp(0).toRed(this.red),this.one=new fp(1).toRed(this.red),this.two=new fp(2).toRed(this.red),this.n=e.n&&new fp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.pX=new Array(4),this.yX=new Array(4),this.mX=new Array(4),this.vX=new Array(4),this.SX=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.xX=!0,this.redN=this.n.toRed(this.red))}bX(t,e){const i=t.MX(),s=yp(e,1,this.SX);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}CX(t,e,i,s,r){const n=this.pX,o=this.yX,h=this.mX;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]=yp(i[s],n[s],this.SX),h[r]=yp(i[r],n[r],this.SX),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=mp(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)}MX(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 fp(t.a,16),b:new fp(t.b,16)}))):this.LX(i),{beta:e,lambda:i,basis:s}}BX(t){const e=t===this.p?this.red:fp.mont(t),i=new fp(2).toRed(e).redInvm(),s=i.redNeg(),r=new fp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}LX(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 fp(1),g=new fp(0),y=new fp(0),m=new fp(1),p=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=y.sub(t.mul(f));const o=m.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,y=f,f=u,m=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}]}RX(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 Sp(this,t,e,i)}pointFromX(t,e){(t=new fp(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)}EX(t,e,i){const s=this.PX,r=this.DX;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 fp(t,16),this.isInfinity()?this:this.FX(t)?this.curve.bX(this,t):this.curve.endo?this.curve.EX([this],[t]):this.curve._X(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.EX(s,r):this.curve.CX(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.EX(s,r,!0):this.curve.CX(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 vp extends Ap{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 fp(0)):(this.x=new fp(e,16),this.y=new fp(i,16),this.z=new fp(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 vp(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 xp(t),this.g=this.curve.g,this.n=this.curve.n}}const Mp={};var Cp;Mp.PresetCurve=bp,Cp={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(Mp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new bp(Cp);return Object.defineProperty(Mp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class Tp{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.NX(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof Tp?e:new Tp(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}NX(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 Rp(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 wp{constructor(){this.place=0}}class kp{constructor(t,e){if(t instanceof kp)return t;this.GX(t,e)||(this.r=new fp(t.r,16),this.s=new fp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}GX(t,e){t=gp(t,e);const i=new wp;if(48!==t[i.place++])return!1;const s=Rp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Rp(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=Rp(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 fp(n),this.s=new fp(h),this.recoveryParam=null,!0}}class Ep{constructor(t){if(!(this instanceof Ep))return new Ep(t);"string"==typeof t&&(t=Mp[t]),t instanceof Mp.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 Tp.fromPublic(this,t,e)}WX(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.WX(new fp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new kp(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.xX){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 Ip,Fp={exports:{}};Fp.exports=(Ip=Ip||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!==cp&&cp.crypto&&(i=cp.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._w=new a.init,this.UX=0},YX:function(t){"string"==typeof t&&(t=d.parse(t)),this._w.concat(t),this.UX+=t.sigBytes},HX:function(e){var i,s=this._w,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.$X,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,m=l[f-2],p=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;l[f]=y+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},ZX:function(){var t=this._w,i=t.words,s=8*this.UX,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.HX(),this.KX},clone:function(){var t=n.clone.call(this);return t.KX=this.KX.clone(),t}});i.SHA256=n.QX(u),i.HmacSHA256=n.JX(u)}(Math),t.SHA256}(Fp.exports),Vp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({jX:function(){this.KX=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},ZX:function(){var t=r.ZX.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.QX(n),e.HmacSHA224=r.JX(n),t.SHA224;var e,i,s,r,n}(Fp.exports),zp={exports:{}}.exports=Fp.exports.enc.Hex,_p={exports:{}}.exports=Fp.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.qX;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.qX,r=this.tj;if(!r){r=this.tj=[];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)},qX:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Fp.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({jX:function(){this.KX=new r.init([1732584193,4023233417,2562383102,271733878])},XX: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.KX.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],y=t[e+4],m=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],R=t[e+15],w=n[0],k=n[1],E=n[2],I=n[3];w=l(w,k,E,I,o,7,h[0]),I=l(I,w,k,E,a,12,h[1]),E=l(E,I,w,k,f,17,h[2]),k=l(k,E,I,w,g,22,h[3]),w=l(w,k,E,I,y,7,h[4]),I=l(I,w,k,E,m,12,h[5]),E=l(E,I,w,k,p,17,h[6]),k=l(k,E,I,w,A,22,h[7]),w=l(w,k,E,I,x,7,h[8]),I=l(I,w,k,E,S,12,h[9]),E=l(E,I,w,k,v,17,h[10]),k=l(k,E,I,w,b,22,h[11]),w=l(w,k,E,I,M,7,h[12]),I=l(I,w,k,E,C,12,h[13]),E=l(E,I,w,k,T,17,h[14]),w=u(w,k=l(k,E,I,w,R,22,h[15]),E,I,a,5,h[16]),I=u(I,w,k,E,p,9,h[17]),E=u(E,I,w,k,b,14,h[18]),k=u(k,E,I,w,o,20,h[19]),w=u(w,k,E,I,m,5,h[20]),I=u(I,w,k,E,v,9,h[21]),E=u(E,I,w,k,R,14,h[22]),k=u(k,E,I,w,y,20,h[23]),w=u(w,k,E,I,S,5,h[24]),I=u(I,w,k,E,T,9,h[25]),E=u(E,I,w,k,g,14,h[26]),k=u(k,E,I,w,x,20,h[27]),w=u(w,k,E,I,C,5,h[28]),I=u(I,w,k,E,f,9,h[29]),E=u(E,I,w,k,A,14,h[30]),w=c(w,k=u(k,E,I,w,M,20,h[31]),E,I,m,4,h[32]),I=c(I,w,k,E,x,11,h[33]),E=c(E,I,w,k,b,16,h[34]),k=c(k,E,I,w,T,23,h[35]),w=c(w,k,E,I,a,4,h[36]),I=c(I,w,k,E,y,11,h[37]),E=c(E,I,w,k,A,16,h[38]),k=c(k,E,I,w,v,23,h[39]),w=c(w,k,E,I,C,4,h[40]),I=c(I,w,k,E,o,11,h[41]),E=c(E,I,w,k,g,16,h[42]),k=c(k,E,I,w,p,23,h[43]),w=c(w,k,E,I,S,4,h[44]),I=c(I,w,k,E,M,11,h[45]),E=c(E,I,w,k,R,16,h[46]),w=d(w,k=c(k,E,I,w,f,23,h[47]),E,I,o,6,h[48]),I=d(I,w,k,E,A,10,h[49]),E=d(E,I,w,k,T,15,h[50]),k=d(k,E,I,w,m,21,h[51]),w=d(w,k,E,I,M,6,h[52]),I=d(I,w,k,E,g,10,h[53]),E=d(E,I,w,k,v,15,h[54]),k=d(k,E,I,w,a,21,h[55]),w=d(w,k,E,I,x,6,h[56]),I=d(I,w,k,E,R,10,h[57]),E=d(E,I,w,k,p,15,h[58]),k=d(k,E,I,w,C,21,h[59]),w=d(w,k,E,I,y,6,h[60]),I=d(I,w,k,E,b,10,h[61]),E=d(E,I,w,k,f,15,h[62]),k=d(k,E,I,w,S,21,h[63]),n[0]=n[0]+w|0,n[1]=n[1]+k|0,n[2]=n[2]+E|0,n[3]=n[3]+I|0},ZX:function(){var t=this._w,i=t.words,s=8*this.UX,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.HX();for(var h=this.KX,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.KX=this.KX.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.QX(a),i.HmacMD5=n.JX(a)})(Math),t.MD5}(Fp.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({jX:function(){this.KX=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},XX:function(t,e){for(var i=this.KX.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},ZX:function(){var t=this._w,e=t.words,i=8*this.UX,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.HX(),this.KX},clone:function(){var t=r.clone.call(this);return t.KX=this.KX.clone(),t}}),e.SHA1=r.QX(h),e.HmacSHA1=r.JX(h),t.SHA1;var e,i,s,r,n,o,h}(Fp.exports),Bp=(Dp=Fp.exports).lib.Base,Pp=Dp.enc.Utf8,Dp.algo.HMAC=Bp.extend({init:function(t,e){t=this.ij=new t.init,"string"==typeof e&&(e=Pp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.sj=e.clone(),n=this.ej=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.nj==this.hj?t=s.createEncryptor:(t=s.createDecryptor,this.$X=1),this.cj&&this.cj.dj==t?this.cj.init(this,i&&i.words):(this.cj=t.call(s,this,i&&i.words),this.cj.dj=t)},XX:function(t,e){this.cj.processBlock(t,e)},ZX:function(){var t,e=this.cfg.padding;return this.nj==this.hj?(e.pad(this._w,this.blockSize),t=this.HX(!0)):(t=this.HX(!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)}}),y=(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})}},m=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),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.fj(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},fj: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=m.extend({cfg:m.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=m.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.fj(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,m.decrypt.call(this,t,e,r.key,s)}})}()}(Fp.exports);var Np={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 y=t[i],m=t[y],p=t[m],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*m^257*y^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=y^t[t[t[p^y]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],y=s.AES=i.extend({jX:function(){if(!this.Aj||this.gj!==this.oj){for(var t=this.gj=this.oj,e=t.words,i=t.sigBytes/4,s=4*((this.Aj=i+6)+1),n=this.pj=[],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.yj=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.mj(t,e,this.pj,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.mj(t,e,this.yj,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},mj:function(t,e,i,s,r,n,o,h){for(var a=this.Aj,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++],m=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=y,u=m,c=p,d=A}y=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],m=(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]=y,t[e+1]=m,t[e+2]=p,t[e+3]=A},keySize:8});e.AES=i.QX(y)}(),t.AES}(Fp.exports),Op={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.aj,s=i.blockSize,r=this.lj,n=this.vj;r&&(n=this.vj=r.slice(0),this.lj=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}(Fp.exports),Yp={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Fp.exports);const Gp="aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvYXBwLWRlcGxveW1lbnQv",Hp={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw=="],"-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=="]},Wp=Ct,Kp=(...t)=>t.slice(1).reduce(((e,i)=>e+Wp.atob(Hp[t[0]][i].toString())),"");let Xp,jp,$p,Zp=new Uint8Array([]);class Qp{set e(t){Xp=t}get e(){jp={af:!1,lf:!1,uf:!1,cf:!1,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};const t=Zp.length,e=t>=1?Zp[0]:void 0,i=t>=2?Zp[1]:void 0,s=t>=3?Zp[2]:void 0;return void 0!==e&&(jp.af=!!(1&e),jp.lf=!!(2&e),jp.uf=!!(4&e),jp.cf=!!(8&e),jp.df=!!(16&e),jp.ff=!!(32&e),jp.Af=!!(64&e),jp.gf=!!(128&e)),void 0!==i&&(jp.pf=!!(1&i),jp.yf=!!(2&i),jp.mf=!!(4&i),jp.vf=!!(8&i),jp.Sf=!!(16&i),jp.xf=!!(32&i),jp.bf=!!(64&i),jp.Mf=!!(128&i)),void 0!==s&&(jp._f=!!(1&s),jp.wf=!!(2&s),jp.Cf=!!(4&s),jp.kf=!!(8&s),jp.Tf=!!(16&s),jp.Ff=!!(32&s),jp.If=!!(64&s),jp.Pf=!!(128&s)),jp.ff}set l(t){$p=t}get l(){return $p}}let qp=!1;const Jp=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},tA=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")}`},eA=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),iA=t=>{const e={},i=t.split("-");if(3!==i.length)return{Sj:Kp(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 nA(d,f)?e:{Sj:Kp(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(Jp(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(eA(h)s[e]===t)))return{};break}case"0002":return iA(t);default:return{Sj:Kp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{Sj:Kp(0,0,1,2,1,7,1,12,5)}},rA=t=>{if(!t)return{Sj:Kp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[Kp(-1,9)]||t[Kp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Wp[Kp(-1,6)][Kp(-1,7)])>-1)return{_j:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(uA(Wp[Kp(-1,6)][Kp(-1,7)],i))return{_j:!0};const s=t[Kp(-1,8)]||t[Kp(-1,38)];if(""!==s&&null!=s){if(uA(Wp[Kp(-1,6)][Kp(-1,7)],[s]))return{_j:!1};if(s===Wp[Kp(-1,6)][Kp(-1,7)])return{_j:!1}}return{Sj:Kp(0,14,1,20,5),bj:"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvd2ViLWRlcGxveW1lbnQv"}},nA=(t,e)=>{const i=new Ep("secp256k1").keyFromPublic(Kp(-4,0),"hex"),s=Vp(t).toString();return i.verify(s,e)},oA=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(!nA(r,n))return{Sj:Kp(0,21,1,2,1,7,1,12,5)};const o=zp.parse(r);i=Np.decrypt({ciphertext:zp.parse(s)},o,{mode:Op,padding:Yp,iv:zp.parse("00000000000000000000000000000001")}).toString(_p)}catch(t){return{Sj:Kp(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{Sj:Kp(0,21,1,2,1,7,1,12,5)}}if(void 0===e[Kp(-1,5)]||null===e[Kp(-1,4)]||!e[Kp(-1,9)])return{Sj:Kp(0,21,1,2,1,7,1,12,5)};const s=parseInt(Kp(-3,0),10)||Number(parseInt(Kp(-3,0),10));return e[Kp(-1,5)]{const e=iA(t),i=e.xj,s=e.Mj;if(e.Sj||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.Mj,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{Sj:Kp(0,39,1,40,1,41,5),bj:Gp};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!nA(`${s}-${r}`,n))return{Sj:Kp(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(Jp(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Kp(-3,0),10)||Number(parseInt(Kp(-3,0),10))))return{Sj:Kp(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(Jp(s,8)),l=Lp(e[Kp(-1,31)]).toString(zp),u=Int32Array.from(Jp(l,8)),c=Lp(e[Kp(-1,32)]).toString(zp),d=Int32Array.from(Jp(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{Sj:Kp(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{Sj:Kp(0,39,1,40,1,41,5),bj:Gp};const i=iA(t),s=i.xj,r=i.Mj;if(i.Sj||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))?{}:{Sj:Kp(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{Sj:Kp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},aA=(t,e,i=!0,s)=>{qp=!1,e.co();const r=e.Jr,n=!!r&&(r===Ct.document.body||Ct.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=Ct.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?Kp(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1),s){const t=Ct.document.createElement("a");t.href=s,n=t}else n=Ct.document.createElement("p1");r.append(n),n.innerHTML=h,n.style.color="red",e.H$()&&Wp.console.error(h)}},lA=(t,e,i)=>{e?(t[Kp(-1,17)](Kp(-1,19),i),t[Kp(-1,17)](Kp(-1,20),i),t[Kp(-1,17)](Kp(-1,21),i),t[Kp(-1,17)](Kp(-1,22),i)):(t[Kp(-1,18)](Kp(-1,19),i),t[Kp(-1,18)](Kp(-1,20),i),t[Kp(-1,18)](Kp(-1,21),i),t[Kp(-1,18)](Kp(-1,22),i))},uA=(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)}))},cA=new Map;e.AbstractCursor=Aa,e.Animation=j,e.AnimationEasings=X,e.Animator=$,e.AreaRangeSeries=Pu,e.AreaSeries=ku,e.AreaSeriesBipolar=Eu,e.AreaSeriesMonopolar=Iu,e.AreaSeriesNegative=Fu,e.AreaSeriesPositive=Du,e.AreaSeriesTypes=Bu,e.AutoFitStrategies=ya,e.AutoFitStrategy=da,e.Axis=yh,e.Axis3D=Qa,e.AxisScrollStrategies=Ws,e.AxisTickStrategies=Ks,e.Band=Gs,e.BarChart=uf,e.BarChartBar=hf,e.BarChartCategoryAxis=nf,e.BarChartSorting=cf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=of,e.BasicSeries=cu,e.BorderedPicture=Un,e.BoxFigure=nu,e.BoxSeries=fu,e.BoxSeries3D=rl,e.Button=Xo,e.Chart=oa,e.Chart3D=Tl,e.ChartComponent=Zi,e.ChartWithSeries=dl,e.ChartXY=Tc,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=w[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=R,e.ColorPalettes=Wn,e.ColorRGBA=C,e.ColorShadingStyles=to,e.ColorUint32=t=>C(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=Hs,e.Cursor2D=Sa,e.Cursor3D=bl,e.CursorBuilder2D=va,e.CursorBuilder3D=Ml,e.CursorBuilderXY=ac,e.CursorBuilders=Cf,e.CursorXY=hc,e.CustomTick=En,e.Dashboard=bf,e.DashedLine=ho,e.DataGrid=qd,e.DataPatternsNew=Yr,e.DataSetXY=yo,e.DateTimeTickStrategy=Gh,e.EllipseFigure=gu,e.EllipseSeries=yu,e.EmptyFill=V,e.EmptyTickStrategy=ir,e.EmptyUIElement=_n,e.Figure=ru,e.FigureSeries=lu,e.FontSettings=gr,e.FormattingFunctions=Di,e.FunnelChart=Xc,e.FunnelChartTypes=Jc,e.FunnelChartWithLabelsInsideSlices=qc,e.FunnelChartWithLabelsOnSides=Qc,e.FunnelSlice=Yc,e.GaugeChart=yf,e.GenericAxis=hr,e.GlowEffect=go,e.HeatmapGridSeries=bu,e.HeatmapGridSeriesIntensityValues=Mu,e.HeatmapScrollingGridSeries=Cu,e.HeatmapScrollingGridSeriesIntensityValues=Tu,e.Highlighter=Qi,e.Icon=uo,e.ImageFill=so,e.IndividualPointFill=G,e.LUT=P,e.LegendBoxBuilders=dh,e.LineAndPointSeries3D=nl,e.LineSeries=cc,e.LineSeries3D=ol,e.LinearGradientFill=it,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new it({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Vl,e.MapRegions=Pf,e.MapRegionsAfrica=Tf,e.MapRegionsAsia=Rf,e.MapRegionsAustralia=wf,e.MapRegionsCanada=kf,e.MapRegionsEurope=Ef,e.MapRegionsNorthAmerica=Df,e.MapRegionsSouthAmerica=Bf,e.MapRegionsUSA=Ff,e.MapRegionsWorld=If,e.MapTypes=El,e.MeshModel3D=vl,e.NumericTickStrategy=Qh,e.OHLCSeries=ec,e.OHLCSeriesBars=sc,e.OHLCSeriesCandlesticks=ic,e.OHLCSeriesTypes=rc,e.OnScreenMenu=fc,e.OnScreenMenuAnimationsButton=ks,e.OnScreenMenuButton=Ss,e.OnScreenMenuControlBase=os,e.OnScreenMenuCustomButton=Is,e.OnScreenMenuOsmToggleButton=Fs,e.OnScreenMenuToggleButton=vs,e.OnScreenMenuZoomInButton=bs,e.OnScreenMenuZoomInXButton=Ms,e.OnScreenMenuZoomInYButton=Cs,e.OnScreenMenuZoomOutButton=Ts,e.OnScreenMenuZoomOutXButton=Rs,e.OnScreenMenuZoomOutYButton=ws,e.OnScreenMenuZoomToFitButton=Es,e.PalettedFill=class extends W{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")}},e.Panel=ia,e.PhongShadingStyle=qn,e.Picture=On,e.PieChart=Na,e.PieChartTypes=Wa,e.PieChartWithLabelsInsideSlices=Ha,e.PieChartWithLabelsOnSides=Ga,e.PieSlice=Pa,e.PixelatedPoints3D=br,e.PointCloudSeries3D=ul,e.PointLineAreaSeries=gc,e.PointLineSeries=Nu,e.PointLineSeries3D=hl,e.PointSeries=dc,e.PointSeries3D=ll,e.PointSeriesTypes3D=cl,e.PointStyle3D=Cr,e.PolarAreaSeries=Vc,e.PolarAreaSeriesInterior=zc,e.PolarAxis=Nl,e.PolarAxisAmplitude=Ul,e.PolarAxisTick=Ol,e.PolarChart=Nc,e.PolarHeatmapSeries=eu,e.PolarLineSeries=iu,e.PolarPointLineSeries=su,e.PolarPointSeries=Bc,e.PolarPolygon=Pc,e.PolarPolygonSeries=Lc,e.PolarSector=jl,e.PolarSeries=Zl,e.PolygonFigure=mu,e.PolygonSeries=pu,e.PyramidChart=od,e.PyramidChartTypes=dd,e.PyramidChartWithLabelsInsideSlices=cd,e.PyramidChartWithLabelsOnSides=ud,e.PyramidSlice=id,e.RadialGradientFill=J,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new J({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=wu,e.RectangleFigure=Au,e.RectangleSeries=xu,e.SegmentFigure=Su,e.SegmentSeries=vu,e.Series2D=$l,e.Series3D=sl,e.SeriesXY=ou,e.SimpleShadingStyle=Zn,e.Slice=Da,e.SliceLabelFormatters=Fa,e.SliceSorters=Ia,e.SolidFill=U,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new U({color:s(t)})},e.SolidLine=rs,e.SpiderAxis=pd,e.SpiderChart=Rd,e.SpiderSeries=Ad,e.SplineSeries=Yu,e.StepSeries=tc,e.StipplePatterns=no,e.SurfaceGridSeries3D=pl,e.SurfaceScrollingGridSeries3D=Al,e.Themes=eg,e.Tick=gh,e.TickStyle=vh,e.TimeFormattingFunctions=wh,e.TimeTickStrategy=Eh,e.TreeMapChart=Uf,e.TriangulatedPoints3D=xr,e.UIBackgrounds=ma,e.UICircle=To,e.UIColumnGrid=class extends Do{constructor(){super(...arguments),this.kd=[]}addColumn(){return this.addElement(zo,void 0)}getColumn(t,e=!1){return e&&this.kd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.kd[t]}},e.UIDiamond=Ro,e.UIElementBuilders=ch,e.UIElementColumn=Bo,e.UIElementLine=Fo,e.UIElementRow=Do,e.UIElementWithBackground=wn,e.UIEmptyBackground=Nn,e.UILabel=bo,e.UILayoutBuilders=wl,e.UILayoutGap=Io,e.UILegendBoxPanel=kl,e.UIObject=bn,e.UIOrigins=Bs,e.UIPanel=ra,e.UIPoint=ko,e.UIPointer=wo,e.UIPolygon=Yn,e.UIRectangle=Co,e.UIRowGrid=Lo,e.VisibleFill=O,e.ZoomBandChart=Fc,e._translatePoint=ct,e.defaultOsmBackgroundColor=Us,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=z,e.emptyLine=nt,e.emptyPoints3D=pr,e.emptyTick=Mh,e.formatLongitudeLatitude=zl,e.formatNumberAsUnicodeSuperscript=Bi,e.isColor=M,e.isCoordinate3D=Sl,e.isCoordinateBarChart=af,e.isCoordinateClient=Ui,e.isCoordinatePolar=Xl,e.isCoordinateXY=Gi,e.isDashedLine=ao,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=_,e.isEmptyTick=Ch,e.isEmptyTickStrategy=sr,e.isFontSettings=yr,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=ft,e.isHitMeshModel=mt,e.isHitOHLC=t=>t&&"object"==typeof t&&"position"in t&&"open"in t&&"high"in t&&"isPacked"in t,e.isHitPolarHeatmap=yt,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=gt,e.isIcon=co,e.isIndividualPointFill=H,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=st,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=K,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=Mr,e.isRadialGradientFill=tt,e.isSeriesSupportedByZoomBandChart=t=>t instanceof cu||t instanceof ku||t instanceof Pu||t instanceof Mu||t instanceof ec||t instanceof tc||t instanceof gc,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=Y,e.isSolidLine=ns,e.isTickStyle=bh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=Sr,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 Qp;o.e=i;let h=cA.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(Xp){const s=(()=>{if(!Xp)return;const t=Xp.split("-");if(t.length>0)switch(t[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){Zp=new Uint8Array([2]);const e=(()=>{if(!Xp)return;const t=Xp.split("-");return 4===t.length?t[1].startsWith("m")?2:1:0})();if(1===e){const t=oA(Xp);h=!t._j,i=t,n=!0}else 2===e?(i=hA(Xp,t),o=!0):(qp=!0,i=sA(Xp),a=!0)}else if("0002"===s){const e=(()=>{if(!Xp)return;const t=Xp.split("-");return t.length>=2?Uint8Array.from(atob(t[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)qp=!0,i=sA(Xp),a=!0;else if(189===e){const t=oA(Xp);h=!t._j,i=t,n=!0}else 159===e?(i=hA(Xp,t),o=!0):i={Sj:Kp(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=Xp.split("-");if(3!==i.length)return{Sj:Kp(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(!nA(s,r))return{Sj:Kp(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;tm)return{Sj:Kp(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),A=l.subarray(n+=2,n+p);if(Zp=new Uint8Array(A),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{wj:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&nA(t[0],t[2])?{wj:t[0]}:{Sj:Kp(0,0,1,7,1,12,5)}}return{Sj:Kp(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.wj;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={Sj:Kp(0,0,1,7,1,12,5)}}else i={Sj:Kp(0,0,1,7,1,12,5)}}else{const t=/^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\./;["localhost","127.0.0.1","::1"].includes(window.location.hostname)||t.test(window.location.hostname)?i={Sj:Kp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),bj:Kp(-2,2)}:window.location.host===Wp.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,Zp=new Uint8Array([38]),i={}):(c=!0,u=!0,Zp=new Uint8Array([38]),i={})}}catch(t){i={Sj:Kp(0,0,1,7,1,12,5)}}try{a&&(s=Wp[Kp(-1,34)][Kp(-1,35)](Kp(-1,39))||void 0)}catch(t){Wp.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&nA(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(d=!0)}}const f=!(c||u||i.Sj||n||o||d),g=(()=>{const t=new(Wp[Kp(-1,0)]);return t.open(Kp(0,26),Kp(-2,0)),t.setRequestHeader(Kp(-1,24),Kp(-1,25)),t.withCredentials=!0,t})(),y=new r.Eventer;if(f){let t;try{t=parseInt(Xp?Xp.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="";Xp=Xp||"";const o=Kp(-4,0);for(let t=0;t{const n=[],o={Zn:t=>{n.indexOf(t)>=0||(n.push(t),a())},Qn:t=>y.on("logoChange",t),Jn:t=>y.off(t)},a=()=>{n.forEach((t=>{const e=d(t);if(!e)return;const{Cj:i,kj:s}=e,r=s?Kp(-2,1):void 0,n=`${Kp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?Kp(0,1,63,1,64,1,59,1,65,1,41):""}`;aA(n,m,!1,r)}))},c=t=>t.toLowerCase().split("_").join(" "),d=t=>{var e;const i=null===(e=Object.entries(fh).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case fh.uf:return jp.af||jp.uf?void 0:{Cj:c(i),kj:!0};case fh.Af:return jp.af||jp.Af?void 0:{Cj:c(i),kj:!0};case fh.gf:return jp.af||jp.lf||jp.gf?void 0:{Cj:c(i)};case fh.lf:return jp.af||jp.lf?void 0:{Cj:c(i)};case fh.Sf:return jp.af||jp.lf||jp.Sf?void 0:{Cj:c(i)};case fh.Mf:return jp.af||jp.lf||jp.Mf?void 0:{Cj:c(i)};case fh.kf:return jp.af||jp.lf||jp.kf?void 0:{Cj:c(i)};case fh.Ff:return jp.af||jp.lf||jp.Ff?void 0:{Cj:c(i)};case fh.If:return jp.af||jp.lf||jp.If?void 0:{Cj:c(i)};case fh.Tf:return jp.af||jp.lf||jp.Tf?void 0:{Cj:c(i)};case fh.yf:return jp.af||jp.lf||jp.yf?void 0:{Cj:c(i)};case fh.bf:return jp.af||jp.lf||jp.bf?void 0:{Cj:c(i)};case fh.vf:return jp.af||jp.lf||jp.vf?void 0:{Cj:c(i)};case fh._f:return jp.af||jp.lf||jp._f?void 0:{Cj:c(i)};case fh.Cf:return jp.af||jp.lf||jp.Cf?void 0:{Cj:c(i)};case fh.wf:return jp.af||jp.lf||jp.wf?void 0:{Cj:c(i)};case fh.pf:return jp.af||jp.lf||jp.pf?void 0:{Cj:c(i)};case fh.mf:return jp.af||jp.lf||jp.mf?void 0:{Cj:c(i)};case fh.xf:return jp.af||jp.lf||jp.xf?void 0:{Cj:c(i)};case fh.Pf:return jp.af||jp.lf||jp.Pf?void 0:{Cj:c(i)};case fh.af:case fh.cf:case fh.ff:case fh.df:return}return Ce(0,"")}},m=new up(r,t,o);(null==i?void 0:i.Sj)&&aA(i.Sj,m,void 0,i.bj);const p=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&nA(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return qp=!1,void lA(g,!1,A)}}if(g.readyState===Wp[Kp(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[Kp(-1,23)]);if(!nA(l+Kp(-3,0),t.h)){const t=Kp(0,0,1,27,1,28,1,29,1,30,1,31,5);aA(t,m)}Wp[Kp(-1,34)][Kp(-1,36)](Kp(-1,39),t.t),Wp[Kp(-1,34)][Kp(-1,36)](Kp(-1,33),t.s),qp=!1}else{let e=Kp(0,0,1,2,1,7,1,12,5);try{e=t&&"loadend"!==t.type?Kp(0,0,1,23,1,32,1,24,5):JSON.parse(g[Kp(-1,23)]).message,lA(g,!1,A)}catch(t){console.error(t)}aA(e,m,void 0,"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvZGV2ZWxvcGVyLWxpY2Vuc2Vz")}},A=t=>{p(t)};if(lA(g,!0,A),f?setTimeout((()=>{if(qp){let t=!0;if(s){const e=s.split("-");if(2===e.length&&nA(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&aA(Kp(0,25,1,23,1,32,1,24,5),m)}}),1e4):lA(g,!1,A),u){const t=(()=>{const t=new(Wp[Kp(-1,0)]);return t.open(Kp(0,26),Kp(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),i=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),s=s=>{if("error"===(null==s?void 0:s.type)){const t=Kp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);aA(t,m,!1,Kp(-2,2)),lA(g,!1,r)}if(t.readyState===Wp.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=Kp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);aA(t,m,!1,Kp(-2,2)),lA(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!nA(i,s.s)){const t=Kp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);aA(t,m,!1,Kp(-2,2)),lA(g,!1,r)}void 0!==e&&(e.l=s.l),y.emit("logoChange",s.l)}}else{const t=Kp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);aA(t,m,!1,Kp(-2,2)),lA(g,!1,r)}},r=t=>{s(t)};lA(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=Kp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);aA(t,m,!1,Kp(-2,2)),lA(g,!1,r)}}),1e4)}return h?(t=>{let e;qp=!1;const i=()=>{e&&(t.Ln(e.Bn()),e=void 0);const i=t.oi();e=t.UF("deployment test"),e.Gr(t.At).yr(Kp(0,34,1,33)).Ee({x:i.x/2,y:i.y/2}).Pa(50).Jh(13).Be(new U({color:C(128,128,128,100)})).Fa("Arial").Ba(500).setMouseInteractions(!1),t.In().Pn()};t.Lo((()=>{i()})),setTimeout(i,0),setInterval((()=>{e&&e.Bn(){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={oz:null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.canvas,io:null==i?void 0:i.warnings,mz:"webgl1"===f?1:"webgl2"===f?2:void 0,Az:!1!==(null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.antialias),fz:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,kz:(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.noCanvasStyles)||void 0,Pz:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasTransform)||void 0,pz:!1!==(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.useStackingOrder),yz:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useIndividualCanvas),Tz:d||void 0},y=new sy(g),m=e=>t(e,y);return{Dashboard:ry(m,e,i,s),ChartXY:hy(m,e,i,s),Spider:ay(m,e,i,s),Polar:ly(m,e,i,s),Pie:uy(m,e,i,s),UIPanel:oy(m,e,i,s),Gauge:cy(m,e,i,s),Funnel:dy(m,e,i,s),Pyramid:fy(m,e,i,s),Chart3D:yy(m,e,i,s),Map:gy(m,e,i,s),DataGrid:my(m,e,i,s),BarChart:py(m,e,i,s),ZoomBandChart:Ay(m,e,i,s),TreeMapChart:xy(m,e,i,s),dispose:y.Y.bind(y),layout:y.Ez.bind(y)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Vs,e.onScreenMenuControlBaseWidth=zs,e.onScreenMenuControlOpacity=_s,e.onScreenMenuDefaultButtonShape=Os,e.onScreenMenuSpriteURL=Ns,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=qh,e.synchronizeAxisIntervals=dt,e.transparentFill=Ps,e.transparentLine=Ls,e.uint32ColorFromObject=t=>I(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=I,e.useCursorFormatterSeriesOverride=la,e.vec3Utils=Ve,e.xDimensionStrategy=ph,e.yDimensionStrategy=Ah}}]); \ No newline at end of file diff --git a/js/vendor.a2fc4f246becc51c9c1c.bundle.js.LICENSE.txt b/js/vendor.7a933c81db5cb7e8cce1.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.a2fc4f246becc51c9c1c.bundle.js.LICENSE.txt rename to js/vendor.7a933c81db5cb7e8cce1.bundle.js.LICENSE.txt diff --git a/js/vendor.a2fc4f246becc51c9c1c.bundle.js b/js/vendor.a2fc4f246becc51c9c1c.bundle.js deleted file mode 100644 index 0cdcd77..0000000 --- a/js/vendor.a2fc4f246becc51c9c1c.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.a2fc4f246becc51c9c1c.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,y=e&&e.length,m=y?e[0]*s:t.length,p=i(t,0,m,s,!0),x=[];if(!p||p.next===p.prev)return x;if(y&&(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 A=s;Ah&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===T(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)&&(w(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!==m(s.prev,s,s.next))s=s.next;else{if(w(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,y,m=t;t.prev!==t.next;)if(g=t.prev,y=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(y.i/i|0),w(t),t=y.next,m=y.next;else if((t=y)===m){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,y=s.next;y!==e;){if(y.x>=u&&y.x<=d&&y.y>=c&&y.y<=f&&g(r,h,n,a,o,l,y.x,y.y)&&m(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(m(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,y=ha?h>l?h:l:a>l?a:l,A=u>c?u>f?u:f:c>f?c:f,S=d(y,p,e,i,s),v=d(x,A,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=S&&M&&M.z<=v;){if(b.x>=y&&b.x<=x&&b.y>=p&&b.y<=A&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=y&&M.x<=x&&M.y>=p&&M.y<=A&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=S;){if(b.x>=y&&b.x<=x&&b.y>=p&&b.y<=A&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=y&&M.x<=x&&M.y>=p&&M.y<=A&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&x(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),w(r),w(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&&y(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 m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(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)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||p(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=S(m(t,e,i)),n=S(m(t,e,s)),o=S(m(i,s,t)),h=S(m(i,s,e));return r!==n&&o!==h||!(0!==r||!A(t,i,e))||!(0!==n||!A(t,s,e))||!(0!==o||!A(i,t,s))||!(0!==h||!A(i,e,s))}function A(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 m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new C(t.i,t.x,t.y),s=new C(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 C(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 w(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 C(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 T(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:()=>Rs,List:()=>ai,Map:()=>ze,OrderedMap:()=>bi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Hi,Record:()=>ys,Repeat:()=>bs,Seq:()=>Q,Set:()=>Ni,Stack:()=>Ei,default:()=>Es,fromJS:()=>Ms,get:()=>ae,getIn:()=>Wi,has:()=>he,hasIn:()=>Ki,hash:()=>pt,is:()=>ft,isAssociative:()=>w,isCollection:()=>A,isImmutable:()=>P,isIndexed:()=>M,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>V,isOrderedMap:()=>ct,isOrderedSet:()=>Vi,isPlainObject:()=>re,isRecord:()=>D,isSeq:()=>I,isSet:()=>Li,isStack:()=>Ri,isValueObject:()=>dt,merge:()=>we,mergeDeep:()=>Te,mergeDeepWith:()=>Re,mergeWith:()=>Ce,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ts});var s="delete",r=5,n=1<>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?u(t)+e:e}function d(){return!0}function f(t,e,i){return(0===t&&!p(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return m(t,e,0)}function y(t,e){return m(t,e,e)}function m(t,e,i){return void 0===t?i:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function A(t){return Boolean(t&&t[x])}var S="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[S])}var b="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[b])}function w(t){return v(t)||M(t)}var C=function(t){return A(t)?t:Q(t)},T=function(t){function e(t){return v(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),R=function(t){function e(t){return M(t)?t:J(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)&&!w(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C);C.Keyed=T,C.Indexed=R,C.Set=E;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var F="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[F])}function P(t){return A(t)||D(t)}var L="@@__IMMUTABLE_ORDERED__@@";function V(t){return Boolean(t&&t[L])}var _=0,B=1,z=2,N="function"==typeof Symbol&&Symbol.iterator,O="@@iterator",U=N||O,Y=function(t){this.next=t};function G(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 X(){return{value:void 0,done:!0}}function Z(t){return!!Array.isArray(t)||!!j(t)}function H(t){return t&&"function"==typeof t.next}function W(t){var e=j(t);return e&&e.call(t)}function j(t){var e=t&&(N&&t[N]||t[O]);if("function"==typeof e)return e}Y.prototype.toString=function(){return"[Iterator]"},Y.KEYS=_,Y.VALUES=B,Y.ENTRIES=z,Y.prototype.inspect=Y.prototype.toSource=function(){return this.toString()},Y.prototype[U]=function(){return this};var K=Object.prototype.hasOwnProperty;function $(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 Q=function(t){function e(t){return null==t?nt():P(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=j(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=j(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new Y((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return G(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(C),q=function(t){function e(t){return null==t?nt().toKeyedSeq():A(t)?v(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(Q),J=function(t){function e(t){return null==t?nt():A(t)?v(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ht(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(Q),tt=function(t){function e(t){return(A(t)&&!w(t)?t:J(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}(Q);Q.isSeq=I,Q.Keyed=q,Q.Set=tt,Q.Indexed=J,Q.prototype[k]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new Y((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return G(t,n,i[n])}))},e}(J),it=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return K.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 Y((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return G(t,o,i[o])}))},e}(q);it.prototype[L]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=W(this._collection),s=0;if(H(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=W(this._collection);if(!H(i))return new Y(X);var s=0;return new Y((function(){var e=i.next();return e.done?e:G(t,s++,e.value)}))},e}(J);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return $(t)?new et(t):Z(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&V(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function yt(t){return t>>>1&1073741824|3221225471&t}var mt=Object.prototype.valueOf;function pt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return yt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==mt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return yt(e)}(r);case"string":return r.length>Et?(void 0===(s=Ft[i=r])&&(s=At(i),It===kt&&(It=0,Ft={}),It++,Ft[i]=s),s):At(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[Rt]))return e;if(!vt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Rt]))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=bt(),wt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)Object.defineProperty(t,Rt,{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[Rt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Rt]=e}}return e}(r);case"symbol":return function(t){var e=Ct[t];return void 0!==e||(e=bt(),Ct[t]=e),e}(r);default:if("function"==typeof r.toString)return At(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function At(t){for(var e=0,i=0;i=0&&(a.get=function(e,i){return(e=c(this,e))>=0&&en)return{value:void 0,done:!0};var t=r.next();return s||e===B||t.done?t:G(e,a-1,e===_?void 0:t.value[1],t)}))},a}function Ut(t,e,i,s){var r=$t(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(z,n),a=!0,l=0;return new Y((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:G(r,l++,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 r===z?t:G(r,n,u,t)}))},r}function Yt(t,e,i){var s=$t(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 Ht(t,e,i,s){var r=$t(t),n=new et(i).map((function(t){return t.size}));return r.size=s?n.max():n.min(),r.__iterate=function(t,e){for(var i,s=this.__iterator(B,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),W(r?t.reverse():t)})),o=0,h=!1;return new Y((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}:G(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Wt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Kt(t){return v(t)?T:M(t)?R:E}function $t(t){return Object.create((v(t)?q:M(t)?J:tt).prototype)}function Qt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Q.prototype.cacheResult.call(this)}function qt(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 Me(this,e,t)}function Me(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return ke(t,e)}function Ce(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return ke(e,i,t)}function Te(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ee(t,e)}function Re(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ee(e,i,t)}function Ee(t,e,i){return ke(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=Q(i),h=Q(n),M(o)===M(h)&&v(o)===v(h))?ke(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function ke(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(P(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?R:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=K.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=le(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ee(this,e,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,$e(),(function(t){return ke(t,e)}))}function Pe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,$e(),(function(t){return Ee(t,e)}))}function Le(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Ve(){return this.__ownerID?this:this.__ensureOwner(new l)}function _e(){return this.__ensureOwner()}function Be(){return this.__altered}var ze=function(t){function e(e){return null==e?$e():ut(e)&&!V(e)?e:$e().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t,e){return i.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return $e().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 Qe(this,t,e)},e.prototype.remove=function(t){return Qe(this,t,h)},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):$e()},e.prototype.sort=function(t){return bi(Gt(this,t))},e.prototype.sortBy=function(t,e){return bi(Gt(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 He(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?Ke(this.size,this._root,t,this.__hash):0===this.size?$e():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ne=ze.prototype;Ne[lt]=!0,Ne[s]=Ne.remove,Ne.removeAll=Ne.deleteAll,Ne.setIn=ye,Ne.removeIn=Ne.deleteIn=pe,Ne.update=Ae,Ne.updateIn=Se,Ne.merge=Ne.concat=ve,Ne.mergeWith=be,Ne.mergeDeep=Ie,Ne.mergeDeepWith=Fe,Ne.mergeIn=De,Ne.mergeDeepIn=Pe,Ne.withMutations=Le,Ne.wasAltered=Be,Ne.asImmutable=_e,Ne["@@transducer/init"]=Ne.asMutable=Ve,Ne["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ne["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new Xe(t,pt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return h&n?this.nodes[ei(h&n-1)].get(t+r,e,i,s):s},Ue.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=pt(s));var c=(0===e?i:i>>>e)&o,d=1<=ri)return function(t,e,i,s,r){for(var o=0,h=new Array(n),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=r,new Ye(t,o+1,h)}(t,m,f,c,x);if(g&&!x&&2===m.length&&Je(m[1^y]))return m[1^y];if(g&&x&&1===m.length&&Je(x))return x;var A=t&&t===this.ownerID,S=g?x?f:f^d:f|d,v=g?x?ii(m,y,x,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)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ye.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=pt(s));var u=(0===e?i:i>>>e)&o,c=n===h,d=this.nodes,f=d[u];if(c&&!f)return this;var g=qe(f,t,e+r,i,s,n,a,l);if(g===f)return this;var y=this.count;if(f){if(!g&&--y>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new Xe(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Jt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=yi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Ai(t,e).set(0,i):Ai(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=Si(t._capacity)?s=mi(s,t.__ownerID,0,e,i,n):r=mi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):yi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Ai(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=pi(this,t);if(!h)for(var u=0;u>>e&o;if(n>=this.array.length)return this;if(e>0){var h=this.array[n];if((s=h&&h.removeAfter(t,e-r,i))===h&&n===this.array.length-1)return this}var a=pi(this,t);return a.array.splice(n+1),s&&(a.array[n]=s),a};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Si(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=mi(d,e,i-r,s,n,h);return f===d?t:((l=pi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=pi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function pi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=Si(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Ai(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=Si(h),y=Si(u);y>=1<g?new ui([],s):m;if(m&&y>g&&ar;A-=r){var S=g>>>A&o;x=x.array[S]=pi(x.array[S],s)}x.array[g>>>r&o]=m}if(u=y)a-=y,u-=y,c=r,d=null,p=p&&p.removeBefore(s,0,a);else if(a>n||y>>c&o;if(v!==y>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&y>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Mi(s,r)}bi.isOrderedMap=ct,bi.prototype[L]=!0,bi.prototype[s]=bi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function Ri(t){return Boolean(t&&t[Ti])}var Ei=function(t){function e(t){return null==t?Di():Ri(t)?t:Di().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var i=this._head;for(t=c(this,t);i&&t--;)i=i.next;return i?i.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:t[s],next:i};return this.__ownerID?(this.size=e,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Ri(e))return e;ee(e.size);var i=this.size,s=this._head;return e.__iterate((function(t){i++,s={value:t,next:s}}),!0),this.__ownerID?(this.size=i,this._head=s,this.__hash=void 0,this.__altered=!0,this):Fi(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):Di()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(y(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):Fi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fi(this.size,this._head,t,this.__hash):0===this.size?Di():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new et(this.toArray()).__iterate((function(e,s){return t(e,s,i)}),e);for(var s=0,r=this._head;r&&!1!==t(r.value,s++,this);)r=r.next;return s},e.prototype.__iterator=function(t,e){if(e)return new et(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new Y((function(){if(s){var e=s.value;return s=s.next,G(t,i++,e)}return{value:void 0,done:!0}}))},e}(R);Ei.isStack=Ri;var ki,Ii=Ei.prototype;function Fi(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Di(){return ki||(ki=Fi(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Le,Ii.wasAltered=Be,Ii.asImmutable=_e,Ii["@@transducer/init"]=Ii.asMutable=Ve,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Pi="@@__IMMUTABLE_SET__@@";function Li(t){return Boolean(t&&t[Pi])}function Vi(t){return Li(t)&&V(t)}function _i(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||v(t)!==v(e)||M(t)!==M(e)||V(t)!==V(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!w(t);if(V(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&&ft(r[1],t)&&(i||ft(r[0],e))}))&&s.next().done}var r=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{r=!0;var n=t;t=e,e=n}var o=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!ft(e,t.get(s,h)):!ft(t.get(s,h),e))return o=!1,!1}));return o&&t.size===a}function Bi(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 zi(t){if(!t||"object"!=typeof t)return t;if(!A(t)){if(!ne(t))return t;t=Q(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Ni=function(t){function e(e){return null==e?Xi():Li(e)&&!V(e)?e:Xi().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.intersect=function(t){return(t=C(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Xi()},e.union=function(t){return(t=C(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Xi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Yi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Yi(this,this._map.remove(t))},e.prototype.clear=function(){return Yi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Yi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=e+3864292196^t)^e>>>16,2246822507),e=yt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(pt(t),pt(e))|0}:function(t,e){s=s+as(pt(t),pt(e))|0}:e?function(t){s=31*s+pt(t)|0}:function(t){s=s+pt(t)|0}),s)}(this))}});var Qi=C.prototype;Qi[x]=!0,Qi[U]=Qi.values,Qi.toJSON=Qi.toArray,Qi.__toStringMapper=oe,Qi.inspect=Qi.toSource=function(){return this.toString()},Qi.chain=Qi.flatMap,Qi.contains=Qi.includes,Bi(T,{flip:function(){return Wt(this,_t(this))},mapEntries:function(t,e){var i=this,s=0;return Wt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Wt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var qi=T.prototype;qi[S]=!0,qi[U]=Qi.entries,qi.toJSON=$i,qi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(R,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return Wt(this,Nt(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 Wt(this,zt(this,!1))},slice:function(t,e){return Wt(this,Ot(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return Wt(this,1===i?s:s.concat(Jt(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 Wt(this,Yt(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,i){return i===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function as(t,e){return t^e+2654435769+(t<<6)+(t>>2)}ts.has=Qi.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(q,qi),Bi(J,Ji),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Vi(t)?t:fs().withMutations((function(e){var i=E(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ni);ls.isOrderedSet=Vi;var us,cs=ls.prototype;function ds(t,e){var i=Object.create(cs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function fs(){return us||(us=ds(wi()))}cs[L]=!0,cs.zip=Ji.zip,cs.zipWith=Ji.zipWith,cs.zipAll=Ji.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ys=function(t,e){var i;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(P(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 ws(t,e,i,s,r,n){if("string"!=typeof i&&!P(i)&&($(i)||Z(i)||re(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==s&&r.push(s);var o=e.call(n,s,Q(i).map((function(s,n){return ws(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function Cs(t,e){return M(e)?e.toList():v(e)?e.toMap():e.toSet()}var Ts="4.3.7",Rs=C;const Es={version:Ts,Collection:C,Iterable:C,Seq:Q,Map:ze,OrderedMap:bi,List:ai,Stack:Ei,Set:Ni,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Hi,Repeat:bs,is:ft,fromJS:Ms,hash:pt,isImmutable:P,isCollection:A,isKeyed:v,isIndexed:M,isAssociative:w,isOrdered:V,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ri,isSet:Li,isOrderedSet:Vi,isRecord:D,get:ae,getIn:Wi,has:he,hasIn:Ki,merge:we,mergeDeep:Te,mergeWith:Ce,mergeDeepWith:Re,remove:ue,removeIn:me,set:ce,setIn:ge,update:xe,updateIn:de}},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]},y=(t,e)=>({min:t,max:e}),m=(t,e,i,s)=>({x:t,y:e,width:i,height:s}),p=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),A=x,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=I(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),w=(t,e,i,s=255)=>new b({r:t/255,g:e/255,b:i/255,a:s/255}),C=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}`)}},T=(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})},R={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},E=new b({}),k=w(0,0,0,0),I=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,F=(t,e)=>t.value-e.value,D=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:w(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),P=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 L extends D{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,P(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(P({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}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 V=s.Record({type:"fillstyle",fillType:"empty"});class _ extends V{toString(){return"emptyFill"}}const B=new _,z=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),N=s.Record({type:"fillstyle",fillType:"solid",color:w(255,255,255)});class O extends N{}class U extends O{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 Y=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class G extends O{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 X=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),Z=s.Record({type:"fillstyle",fillType:"palette",lut:new L({steps:[]}),lookUpProperty:"value"}),H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),W={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=se(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 j(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(Rt):this.values.map(Rt)}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=wt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=W.linear)=>(r,n,h=t)=>{const a=new j(r,n,h,e,i).start();return s||(s=wt.requestAnimationFrame(o)),a}};var $,Q;e.GradientShape=void 0,($=e.GradientShape||(e.GradientShape={})).circle="circle",$.ellipse="ellipse",e.GradientExtent=void 0,(Q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",Q.closestCorner="closest-corner",Q.farthestSide="farthest-side",Q.farthestCorner="farthest-corner";const q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:C("#f00"),offset:0},{color:C("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class J extends q{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 tt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),et=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:C("#f00"),offset:0},{color:C("#0f0"),offset:1}],angle:0});class it extends et{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?xi(this.get("angle")):this.get("angle")}}const st=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),rt=s.Record({type:"linestyle",lineType:"empty"}),nt=new class extends rt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}N(){return 0}setFillStyle(t){return this}getFillStyle(){return B}},ot=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ht{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new at,this.y=new at,this.z=new at,this.R=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(He,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(He,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.U(e),s.y.U(r)}}}Y(){return this.W&&(this.W(),this.W=void 0),this}H(t){return this.R.on("cell-resize",t)}$(t){return this.R.off(t,"cell-resize")}}class at 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!==It(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 ht({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ut=(t,e,i)=>e===i?t:i.dt(e.ft(t)),ct=(t,e,i)=>{if(e===i)return t;const s=e instanceof _i?e.x:e.x instanceof _i?e.x.x:e.x.At,r=e instanceof _i?e.y:e.y instanceof _i?e.y.y:e.y.At,n=i instanceof _i?i.x:i.x instanceof _i?i.x.x:i.x.At,o=i instanceof _i?i.y:i.y instanceof _i?i.y.y:i.y.At;return{...t,x:ut(t.x,s,n),y:ut(t.y,r,o)}},dt=(...t)=>{if(0===t.length)return{remove:kt};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])}))}}},ft=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,gt=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,yt=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,mt=t=>t&&"object"==typeof t&&"index"in t;class pt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,pt.prototype)}}class xt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&wt.alert(s),Object.setPrototypeOf(this,xt.prototype)}}class At extends xt{constructor(t){super(t),Object.setPrototypeOf(this,At.prototype)}}var St,vt,bt,Mt;e.UISpace=void 0,(St=e.UISpace||(e.UISpace={}))[St.Content=0]="Content",St[St.PaddedContent=1]="PaddedContent",St[St.PaddedBackground=2]="PaddedBackground",St[St.Everything=3]="Everything",e.UIVisibilityModes=void 0,(vt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[vt.never=0]="never",vt[vt.always=1]="always",vt[vt.whenHovered=2]="whenHovered",vt[vt.whenDragged=3]="whenDragged",vt[vt.whenNotDragged=4]="whenNotDragged",vt[vt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(bt=e.UIDraggingModes||(e.UIDraggingModes={}))[bt.notDraggable=0]="notDraggable",bt[bt.draggable=1]="draggable",bt[bt.onlyHorizontal=2]="onlyHorizontal",bt[bt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(Mt=e.UIDirections||(e.UIDirections={}))[Mt.Up=0]="Up",Mt[Mt.Right=1]="Right",Mt[Mt.Down=2]="Down",Mt[Mt.Left=3]="Left";const wt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Ct=(t,e)=>t.x===e.x&&t.y===e.y,Tt=t=>t!==Be&&t!==ze&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Rt=t=>t[1],Et=t=>t.dispose(),kt=()=>{},It=(t,e)=>t===e,Ft=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Dt=t=>Array.prototype.concat.apply([],t),Pt=(t,e)=>void 0===t||Number.isNaN(t)?e:t,Lt=t=>t.vt(),Vt=t=>t.St(),_t=t=>t.xt(),Bt=t=>t.bt(),zt=t=>t.min.x,Nt=t=>t.max.x,Ot=t=>t.min.y,Ut=t=>t.max.y,Yt=(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,Xt=u(0,1),Zt=u(1,0),Ht=u(0,-1),Wt=u(-1,0),jt=u(0,0),Kt=t=>{switch(t){case e.UIDirections.Up:return Xt;case e.UIDirections.Right:return Zt;case e.UIDirections.Down:return Ht;case e.UIDirections.Left:return Wt;default:return jt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Qt=t=>{t.stopPropagation(),t.preventDefault()},qt=(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)},ie=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},re=se(Math.E),ne=(t,e)=>{const i=e[t];return i?i():void 0},oe=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iAi(ci(t,i))-Ai(ci(e,i))))},he=(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:w(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())),le=t=>255===t.getA()?t:t.setA(255),ue=(()=>{const t=w(0,0,0);return i=>(i=le(i),new J({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ae(i,t,.5)}]}))})(),ce=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(tt(t)||st(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}H(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!==B&&("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()?ue(a):(a=le(a),l=le(l),new it({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 U({color:e}):ue(e):i.uiButtonFillStyle}var a,l;e.setButtonOnFillStyle(h)}})(),de=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},fe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ge=(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,me=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),pe=(t,e)=>e(),xe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:w(255,255,255,1)});const Ae=t=>t===Ne||t.min.x===Ne.min.x&&t.max.x===Ne.max.x&&t.min.y===Ne.min.y&&t.max.y===Ne.max.y,Se=t=>Array.from(new Set(t)),ve=t=>t.filter((t=>void 0!==t)),be=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Me=(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))))))},we=(t,e)=>{throw new Error(e)},Ce=t=>{let e;return()=>e||(e=t(),e)},Te=t=>{if(t===nt)return 0;const e=t.getThickness();return e<0?1:1*e},Re=(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 wt.alert(r),new Error(r);wt.console.warn(r)},Ee=(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()}}},Ie={left:0,right:0,top:0,bottom:0},Fe=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Nt();const s=i();return{Gt:t,Nt:()=>{s.forEach((e=>t.Wt(e)))}}},Pe=(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},Le=t=>{if(t)return"resolve"in t?t.resolve():t},Ve=t=>{let e=t;return{Ut:t=>{const i=e;return e=i+t,[i,t]}}},_e={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=>_e.divide(t,_e.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(_e.dot(t,e)/(_e.length(t)*_e.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=_e.dot(e,t),o=_e.cross(e,t);return _e.addVec(_e.multiply(t,s),_e.addVec(_e.multiply(e,(1-s)*n),_e.multiply(o,r)))},lerp:(t,e,i)=>(i=Ft(i,0,1),_e.addVec(_e.multiply(t,1-i),_e.multiply(e,i))),equals:(t,e)=>It(t.x,e.x)&&It(t.y,e.y)&&It(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)})},Be=Number.MAX_SAFE_INTEGER,ze=-Number.MAX_SAFE_INTEGER,Ne=y(u(Be,Be),u(ze,ze)),Oe=y(f(Be,Be,Be),f(ze,ze,ze)),Ue=(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))},Ye=(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),Xe=(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)}}),Ze=t=>{const e=t.length;for(let i=0;ie+t,We=(t,e,i)=>{const s=ci(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ci(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)},je=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Ke=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},$e=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},Qe=(t,e,i)=>ui(t,li(ci(e,t),i)),qe=(t,e,i)=>_e.addVec(t,_e.multiply(_e.subtractVec(e,t),i));function Je(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:Be,y:Be},max:{x:ze,y:ze}};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},ii=(t,e)=>y(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 si(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 ri(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 ni(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t){const e=ai(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function hi(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=oi(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 ai(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function li(t,e){return u(t.x*e,t.y*e)}function ui(t,e){return u(t.x+e.x,t.y+e.y)}function ci(t,e){return u(t.x-e.x,t.y-e.y)}function di(t,e){return u(t.x*e.x,t.y*e.y)}function fi(t,e){return u(t.x/e.x,t.y/e.y)}function gi(t){return li(t,-1)}function yi(t,e){return t.x*e.x+t.y*e.y}const mi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},pi=(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 xi(t){return t*Math.PI/180}function Ai(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function Si(t){return u(Math.cos(t),Math.sin(t))}const vi=(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)},bi=(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 Mi{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 wi extends Mi{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.U(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(He,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&&iki;return!n&&!o||!!r&&(e>t?{start:n?Ei:t,end:o?ki:e}:{start:o?ki:t,end:n?Ei:e})}ft(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ei);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:Ti(t),number:Ri(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 Ti=t=>"e"===t?re:se(t),Ri=t=>"e"===t?Math.E:t,Ei=.9*10**-4,ki=1.1*10**25,Ii=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Fi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Ue(s,10),0);return t.toFixed(r)},Di={Numeric:(t,e)=>Fi(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 Ii){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=Ue(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-Ue(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ti(s)(t);return`${s}${Pi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ti(s),n=Math.floor(r(t)),o=t/Ri(s)**n;return`${Math.round(o)}×${s}${Pi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ti(s),n=Math.floor(r(t));return`${(t/Ri(s)**n).toFixed(2)}×${s}${Pi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ti(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)}},Pi=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 Li extends wi{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(eze&&tze){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=Vi(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=Di.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 Vi(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=Vi(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 Vi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class _i{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 Bi extends _i{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ct(t,e,i,s){return this.x=new Li(t.x,e.x,i.x,s?s.x:void 0),this.y=new Li(t.y,e.y,i.y,s?s.y:void 0),this}_i(){return this.x._i()||this.y._i()}Wi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}mi(){return{x:this.x.mi(),y:this.y.mi()}}pi(t,e){const i=this.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(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 zi extends _i{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)}}Ui(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=oi(ci(n,r)),h=hi(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 Ni=(t,e)=>t instanceof Ci||e instanceof Ci?(new zi).Ri(t,e):(new Bi).Ri(t,e),Oi=t=>"client"===t,Ui=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Yi=t=>"relative"===t,Gi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Xi;e.HighlightModes=void 0,(Xi=e.HighlightModes||(e.HighlightModes={}))[Xi.noHighlighting=0]="noHighlighting",Xi[Xi.onHover=1]="onHover";class Zi{constructor(t,i,s,n){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.R=new r.Eventer,this.ji=[],this.Zi=[],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.Qi(r,i);this.R.emit("mouseEnter",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.wt=(t,i,s)=>{this.R.emit("mouseLeave",this,i,void 0),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.It=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseMove",this,e,r)},this.Ct=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseClick",this,e,r)},this.kt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseDoubleClick",this,e,r)},this.Tt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseDown",this,e,r)},this.Ft=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseUp",this,e,r)},this.Dt=(t,e,i,s,r)=>{const n=this.Qi(r,e);this.R.emit("mouseDragStart",this,e,i,n)},this.Pt=(t,e,i,s,r,n,o)=>{const h=this.Qi(o,e);this.R.emit("mouseDrag",this,e,i,s,r,h)},this.Bt=(t,e,i,s,r,n)=>{const o=this.Qi(n,e);this.R.emit("mouseDragStop",this,e,i,s,o)},this.Lt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseWheel",this,e,r)},this.Rt=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("touchStart",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Et=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("touchMove",this,e,r)},this.zt=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("touchEnd",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.chart=t,this.Ji=i,this.Ki=s,this.qi=new Map,this.ts=n,this.ss=this.ts.es(this,{hs:{themeEffectEnabled:this.Ki.effectsText},rs:{}}),this.chart.ls.os.ns(this,(t=>{this.qi.forEach(((e,i)=>i.us(t))),this.Zi.forEach((e=>e.setHighlight(t))),this.ji.forEach((e=>e.us(t)))}),{animationEnabled:this.chart.getAnimationsEnabled()})}cs(){}ds(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.qi.set(t,{isText:s});const r=Array.from(this.qi);this.ss.hs.fs(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.ss.rs.fs(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).us(this.chart.ls.os.As(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.qi.delete(t)}))}gs(t){this.ji=t;const e=this.chart.ls.os.As(this,!0);t.forEach((t=>{t.us(e).ps(this.Xi)}))}Qi(t,e){}ys(t){const e=this.chart.ls.vs(t);if(e&&Array.from(this.qi.keys()).includes(e.entity))return this.Qi(e.info,t)}setEffect(t){return this.ss.hs.Ss(t&&this.Ki.effectsText),this.ss.rs.Ss(t),this.chart.ls.xs(),this}getEffect(){return this.ss.hs.bs()||this.ss.rs.bs()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setIcon(t){return this.Ms=t,this.chart.ls.xs(),this}getIcon(){return this.Ms}setName(t){return this._s=t,this.Zi.forEach((e=>e.setText(t))),this}getName(){return this._s||"Component"}dispose(){return this.$i||(this.$i=!0,this.qi.forEach(((t,e)=>e.dispose())),this.Ji(this),this.Zi.forEach((t=>{t.dispose()})),this.Zi.length=0,this.R.emit("dispose",this),this.chart.ls.xs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.qi.forEach(((e,i)=>i.setVisible(t))),this.ji.forEach((e=>e.ps(t))),this.Zi.forEach((e=>e.setOn(t))),this.R.emit("visibleStateChanged",this,this.Xi),this.chart.ls.xs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setHighlight(t){return this.chart.ls.os.ws(this,t),this.R.emit("highlight",this,t),this}getHighlight(){return this.chart.ls.os.As(this)}setAnimationHighlight(t){return this.chart.ls.os.Cs(this,t),this}getAnimationHighlight(){return this.chart.ls.os.ks(this)}setMouseInteractions(t){return this.Yi=t,this.qi.forEach(((e,i)=>i.setMouseInteractions(t))),this.chart.ls.xs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){for(const t of this.qi)if(t[0].Ts)return!0;return!1}setHighlightOnHover(t){return this.Hi=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Hi!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return this.styleLegendEntry(t,i),Me(t,[this],{toggleVisibilityOnClick:e,label:this.getName(),style:void 0}),this.Zi.push(t),t.onDispose((()=>{const e=this.Zi.indexOf(t);e>=0&&this.Zi.splice(e,1)})),this}Fs(){return this.Ms}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.$i}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 Hi extends Zi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Is=t,this.axis=s,this.At=r,this.Ps=n,this.Ds()}}const Wi=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.zs?(this.Es.splice(t,1),t-=1):this.Es[t].state&&(s=!0);return this.Rs?0===e.interactions.length&&(this.Es.push({state:!1,time:i}),this.Rs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Es.push({state:!0,time:i}),s=!0,this.Rs=!0),s}Ls(t,e,i){if(i){const i=this.Es.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Vs(t,e),this.Es.length=0)}}},$i=class{constructor(t,e,i,s=1,r=100){this.Os=t,this.Ns=e,this.Gs=i,this.Ws=s,this.Us=r}Bs(t,e){const i=e.interactions.length;if(i===this.Ws){if(void 0!==this.Ys)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Wi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class es{constructor(t,e){this.Zs=t,this.Qs=e,this.Js=e.rows*Fs,this.Ks=e.columns*Ds}}var is,ss;e.OnScreenMenuButtonType=void 0,(is=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[is.ZoomIn=0]="ZoomIn",is[is.ZoomInX=1]="ZoomInX",is[is.ZoomInY=2]="ZoomInY",is[is.ZoomOut=3]="ZoomOut",is[is.ZoomOutX=4]="ZoomOutX",is[is.ZoomOutY=5]="ZoomOutY",is[is.ZoomToFit=6]="ZoomToFit",is[is.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(ss=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[ss.Circle=0]="Circle",ss[ss.Rectangle=1]="Rectangle",ss[ss.RoundedRectangle=2]="RoundedRectangle";const rs={x:-43,y:0},ns={x:-65,y:0},os={x:-86,y:0},hs={x:-107,y:-1},as={x:-128,y:-3},ls={x:-150,y:0},us={x:-171,y:0},cs={x:-276,y:0},ds={x:-298,y:0},fs={x:0,y:0},gs={x:-21,y:0};class ys extends es{constructor(t,e,i,s){super(t,i),this.qs=wt.document.createElement("button"),this.te=wt.document.createElement("div"),this.ie=wt.document.createElement("label"),this.Qs=i,this.se=e,this.ee=s}he(t,e,i,s){this.re(t,s),this.ne(),this.oe(e),this.ae(),this.ie.textContent=i||"";const r=wt.document.createElement("div");this.le(r),this.qs.onclick=this.onClick.bind(this),r.appendChild(this.te),r.appendChild(this.ie),this.qs.appendChild(r)}ae(){this.qs.style.cursor="pointer"}le(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}oe(t){"string"==typeof t?(this.te.style.backgroundImage=`url(${t})`,this.te.style.backgroundSize="100%",this.te.style.backgroundRepeat="no-repeat",this.te.style.backgroundPosition="center",this.te.style.width="20px",this.te.style.height="20px"):this.applyStyleForSprite(t),this.te.style.margin="auto"}ne(){switch(this.se){case e.OnScreenMenuButtonShape.RoundedRectangle:this.qs.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.qs.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.qs.style.borderRadius="31px"}}re(t,e){this.qs.style.width=`${this.Ks.toString()}px`,this.qs.style.height=`${this.Js.toString()}px`,this.qs.style.backgroundColor=t,this.qs.style.opacity=e||Ps,this.qs.style.alignItems="center",this.qs.style.border="2px solid #707070",this.qs.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.te.style.backgroundImage=`url(${this.Zs}/${Ls})`,this.te.style.backgroundPositionX=`${t.x}px`,this.te.style.backgroundPositionY=`${t.y}px`,this.te.style.backgroundSize="1600%",this.te.style.backgroundRepeat="no-repeat",this.te.style.width="20px",this.te.style.height="20px"}ue(t){return t.appendChild(this.qs),t}ce(){return this.qs}}class ms extends ys{constructor(t,e,i,s){super(t,e,i,s),this.de="",this.fe="",this.Ae=!1,this.ee=s}ge(){this.pe(),this.onToggledStateAction()}ye(){this.me(),this.onInitialStateAction()}me(){this.ve(this.de)}pe(){this.ve(this.fe)}ve(t){"string"==typeof t?this.te.style.background=t:(this.te.style.backgroundImage=`url(${this.Zs}/${Ls})`,this.te.style.backgroundPositionX=`${t.x}px`,this.te.style.backgroundPositionY=`${t.y}px`)}onClick(){this.Ae?this.ye():this.ge(),this.Ae=!this.Ae}}class ps extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:-1,y:-1})}}class xs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),hs)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:-1,y:0})}}class As extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),ls)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:0,y:-1})}}class Ss extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:1,y:1})}}class vs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),as)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:1,y:0})}}class bs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),us)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:0,y:1})}}class Ms extends ms{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.de=cs,this.fe=ds,this.he(s.onScreenMenuBackgroundColor.toRGBAString(),this.de)}onToggledStateAction(){this.ee.setAnimationsEnabled(!1)}onInitialStateAction(){this.ee.setAnimationsEnabled(!0)}}class ws extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){this.ee.forEachAxis((t=>{t.fit(!0)}))}}class Cs extends ys{constructor(t,e,i){super(t,e.shape||Vs,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.he(r,n,o,h),this.xe=e.action}onClick(){this.xe(this.ee)}}class Ts extends ms{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.ee=i,this.be=s,this.de=gs,this.fe=fs,this.he(_s,this.de)}me(){this.ve(this.de),this.qs.style.backgroundColor=_s,this.qs.style.border="2px solid #707070",this.qs.style.margin="0px"}pe(){this.ve(this.fe),this.qs.style.background="#FECC00 0% 0% no-repeat padding-box",this.qs.style.border="10px solid #BCBCBC12",this.qs.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.be)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.be)||void 0===t||t.style.setProperty("display","none")}}var Rs;e.MouseStyles=void 0,(Rs=e.MouseStyles||(e.MouseStyles={})).Move="move",Rs.ResizeColumn="col-resize",Rs.ResizeRow="row-resize",Rs.Horizontal="ew-resize",Rs.Vertical="ns-resize",Rs.NorthWest="nw-resize",Rs.NorthEast="ne-resize",Rs.Copy="copy",Rs.CrossHair="crosshair",Rs.Default="default",Rs.Help="help",Rs.Restricted="not-allowed",Rs.None="none",Rs.Point="pointer",Rs.Text="text",Rs.Wait="wait",Rs.ZoomIn="zoom-in",Rs.ZoomOut="zoom-out";const Es={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)},ks=new U({color:w(255,255,255,0)}),Is=new Ji({thickness:1,fillStyle:ks}),Fs=60,Ds=60,Ps="1.0",Ls="osm/osm-sprite-transparent.png",Vs=e.OnScreenMenuButtonShape.Circle,_s="#363636";var Bs;e.OSMPosition=void 0,(Bs=e.OSMPosition||(e.OSMPosition={}))[Bs.TopRight=0]="TopRight",Bs[Bs.TopLeft=1]="TopLeft",Bs[Bs.BottomLeft=2]="BottomLeft",Bs[Bs.BottomRight=3]="BottomRight";class zs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Band",this.Me=0,this._e=0,this.we=this.Ki.bandFillStyle,this.Ce=this.Ki.bandStrokeStyle,this.ke=!0,this.Te=this.Is.Pe(this.At).Ie(this.we).Fe(this.Ce).us(this.getHighlight()),this.ds(this.Te)}setValueStart(t){return this.Me=t,this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs(),this}getValueStart(){return this.Me}setValueEnd(t){return this._e=t,this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs(),this}getValueEnd(){return this._e}setFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.Te.Ie(e),this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;return this.Te.Fe(e),this.Is.xs(),this}getStrokeStyle(){return this.Ce}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}De(){return this.Te.Be(this.Ps.toVec2(this.Me,this.Ps.getHeight(this.At).getInnerStart())).it(this.Ps.toVec2(this._e-this.Me,this.Ps.getHeight(this.At).getInnerInterval())),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}Le(t,e){t.us(e),this.Is.xs()}setDefaultMouseInteractions(t){return this.ke=t,this}Ds(){let t,i;const s=(e,s)=>{if(!this.ke)return;const r=ct(this.Is.ls.Re(s.x,s.y),this.Is.ls.At,this.At),n=this.Ps.getWidth(r),o=this.axis.At.ft(this.Me),h=this.axis.At.ft(this._e),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.ke)return;const h=this.Ps.getWidth(n);t?(this.Me=this.axis.At.pi(this.Me,h),this._e=this.axis.At.pi(this._e,h)):i?this.Me=this.axis.At.pi(this.Me,h):this._e=this.axis.At.pi(this._e,h),Qt(o),this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs()};this.onMouseMove(((i,r)=>{if(!this.ke)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Ps.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ee=this.chart.engine.setMouseStyle(n,this.Ee)})),this.onMouseLeave((()=>{this.ke&&(this.chart.engine.restoreMouseStyle(this.Ee),this.Ee=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this.ke&&0===i&&r(0,0,0,n,e)}));const n=ji(new $i(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Ns extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Constant Line",this.M=0,this.Ce=this.Ki.constantLineStrokeStyle,this.ze=!0,this.ke=!0,this.Ve=this.Is.Ne(this.At).Oe(this.Ce).us(this.getHighlight()),this.ds(this.Ve)}setValue(t){return this.M=t,this.R.emit("valueChange",this,this.M),this.Is.xs(),this}getValue(){return this.M}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;return this.Ve.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.Ce}setInteractionMoveByDragging(t){return this.ze=t,this}getInteractionMoveByDragging(){return this.ze}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}De(){return this.Ve.We(this.Ps.toVec2(this.M,this.Ps.getHeight(this.At).getInnerStart())).Ge(this.Ps.toVec2(this.M,this.Ps.getHeight(this.At).getInnerEnd())),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.Ce})}Le(t,e){t.us(e),this.Is.xs()}setDefaultMouseInteractions(t){return this.ke=t,this}Ds(){const t=(t,e)=>{this.ke&&this.ze&&(this.M=this.axis.At.pi(this.M,this.Ps.getWidth(e)),this.R.emit("valueChange",this,this.M),this.Is.xs(),Qt(t))};this.onMouseMove((()=>{if(this.ke&&this.ze){const t=this.Ps.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ee=this.chart.engine.setMouseStyle(t,this.Ee)}})),this.onMouseLeave((()=>{this.ke&&this.ze&&(this.chart.engine.restoreMouseStyle(this.Ee),this.Ee=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.ke&&this.ze&&0===s&&t(i,n)}));const i=ji(new $i(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Os={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?Os.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Os.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Os.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ue,Gs=t=>void 0!==t.Ye,Xs=(t,e)=>[t,e],Zs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{It(t,0)&&(t=0),It(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},js=(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)}},Ks=(...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))}},$s=s.Record({type:"empty-ticks",cursorFormatter:void 0});class Qs extends $s{He(t){return{$e:[],Xe:[],je:this.cursorFormatter?this.cursorFormatter:Di.Numeric,Ze:void 0,Qe:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}}const qs=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),Js=(t,e)=>{if(e.has(t))return e.get(t);const i=Je(t.Ke.Je());if(Ae(i))return i;const s=t.qe.pi(i.min,{x:-5,y:-5}),r=t.qe.pi(i.min,{x:5,y:5}),n=t.qe.pi(i.max,{x:-5,y:-5}),o=t.qe.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},tr=t=>{const e=new Map;if(!qs(t)){for(const i of t.$e)e.set(i,new Map);for(const i of t.Xe)e.set(i,new Map)}return e},er=(new Qs).He({type:"linear"});class ir{constructor(t,e,i,s,n,o,h){this.R=new r.Eventer,this.th=er,this.ih=Us.Empty,this.sh=new Map,this.eh=new Map,this.hh=Os.fitting,this.rh=!0,this.oh=K((()=>this.chart.ls.xs()))(300,W.linear),this.ah=!0,this.Xi=!0,this.lh=!1,this.uh=ze,this.dh=!1,this.fh=!1,this.Ah=ze,this.gh=ze,this.ph=ze,this.yh=!1,this.mh="",this.Sh={},this.xh=()=>{this.bh.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.xh=void 0},this.Mh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.sh.get(e),l=(t?t.get(a):void 0)||this._h(a,e);l.wh=!1;const u=this.Ch(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.kh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Fh!==i||!!t.find((t=>t===e)))).map((t=>Ye(e,Js(t,a))?t:void 0)),y=p.some((t=>void 0!==t))}else y=!1;if(y){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Ys(t.Fh)))&&(t=!1),t&&i.Ih&&i.Ih.Ph&&!1===i.Ih.Ph(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.th.je(t,this.At),this.Dh=!0,this.Bh=!0,this.chart=t,this.Lh=e,this.Ki=s,this.Rh=o,this.At=i,this.Eh=h,"logarithmic"===h.type&&this.setAnimationZoom(W.logarithmic(Ri(h.base))),this.zh=o.numeric,this.Vh("Numeric"),this.Oh=i.getInnerStart(),this.Nh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setUnits(t,e={}){return this.Gh=t,this.Wh=e,this.Uh(),this}getUnits(){return this.Gh}setDefaultInterval(t,e){return this.Yh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.yh=!0,this.chart.ls.xs()),this}getDefaultInterval(){return this.Yh}getTitle(){return this.mh}setTitle(t){return this.mh=t,this.Uh(),this}getTitleFillStyle(){return this.bh.Hh()}setIntervalRestrictions(t){return this.$h=t,this.chart.ls.xs(),this}getIntervalRestrictions(){return this.$h}setTitleFillStyle(t){return this.bh.Ie(t),this.chart.ls.xs(),this}getTitleFont(){return this.bh.Xh()}setTitleFont(t){return this.bh.jh(t),this.chart.ls.xs(),this}setTitleRotation(t){return this.bh.Zh(t),this.chart.ls.xs(),this}getTitleRotation(){return this.bh.Qh()}setTitleEffect(t){return this.Jh.Ss(t),this.chart.ls.xs(),this}getTitleEffect(){return this.Jh.bs()}Vh(t,e){if(this.sh.size>0&&this.Kh(),"Empty"===t){const i=e||(t=>t);this.zh=i(new Qs),this.th=this.zh.He(this.Eh),this.ih=t}else if("Numeric"===t){"Numeric"!==this.ih&&(this.zh=this.Rh.numeric);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}else if("DateTime"===t){"DateTime"!==this.ih&&(this.zh=this.Rh.datetime);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}else if("Time"===t){"Time"!==this.ih&&(this.zh=this.Rh.time);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}return this.eh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.eh=tr(this.th),this.chart.ls.xs(),this}qh(){return this.th}tr(t){this.th=t,this.eh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.eh=tr(this.th),this.chart.ls.xs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.yt(void 0!==e?e:this.Oh,void 0!==i?i:this.Nh,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.Nh-this.Oh),void 0!==this.th.Ze&&this.th.Ze>h){const i=(e+t)/2,s=this.th.Ze/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.th.Qe&&this.th.Qee?-1:1);n={start:i-s,end:i+s}}const a=this.At.ut(n.start,n.end,this.Oh,this.Nh,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 we(0,""),this}if(this.ir&&this.ir.finishAll(!1),this.oh&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.ir||this.ir.isOver()?this.oh:this.ir.NextAnimation.bind(this);this.ir=e([[this.Oh,n.start],[this.Nh,n.end]],(([t,e])=>{this.sr(t,e,o)}),t),this.ir.onAnimationEnd((()=>{this.ir=void 0,l&&(this.ph=wt.performance.now())})),this.ir.onAnimationEnd((()=>this.setStopped(s)))}else this.sr(n.start,n.end,o),this.setStopped(s),l&&(this.ph=wt.performance.now());return this}getInterval(){return{start:this.Oh,end:this.Nh}}setStopped(t){return t===this.lh||(t&&(this.ir&&this.ir.finishAll(!1),this.ir=void 0),this.lh=t,this.R.emit("stoppedStateChanged",this,this.lh),this.uh=wt.performance.now(),this.chart.ls.xs()),this}getStopped(){return this.lh}onStoppedStateChanged(t){return this.R.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.R.off(t,"stoppedStateChanged")}fit(t,e){const i=this.er(),s=this.Yh||hr,r="function"==typeof s?s({curStart:this.Oh,curEnd:this.Nh,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.Oh,void 0!==r.end?r.end:this.Nh,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.hh=t,this.chart.ls.xs(),this}getScrollStrategy(){return this.hh}setAnimationScroll(t){return this.rh=Boolean(t),this.chart.ls.xs(),this}setAnimationZoom(t,e=300){return this.ir&&(this.ir.finishAll(!1),this.ir=void 0),this.oh=t?K((()=>this.chart.ls.xs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ah=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(W.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ah}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.bh.setVisible(t),this.hr((e=>{e.Ke.setVisible(t)})),e&&this.R.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}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")}rr(t,e){this.xh&&this.xh();const i=new Map;if(qs(this.th)||!this.Xi)return this.Kh(),i;e=e||new Map;const s=this.nr(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Sh.physicalAxisSize=h;const a=rr(this.th,r,n,this.Oh,this.Nh,h),l=[];if(this.ar(),l.push(...this.lr(this.th,r,n,a,e,t,i)),this.ur(this.th,r,n,a,e,t,l,i),this.cr(),a)for(const[t,e]of this.eh){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.Sh.min=r,this.Sh.max=n,this.Sh.scaleInterval=o,this.Sh.physicalAxisSize=h,i}dr(t){const e=t.Fh.Ar;t.Ke.gr(e(t.M,this.At)).Ls()}pr(t,e){const i=e.yr;t.Ke.Ie(i.getLabelFillStyle()).jh(i.getLabelFont()).Zh(i.getLabelRotation())}_h(t,e){const i=this.eh.get(e);let s=i.get(t);s?(i.delete(t),s.Fh=e,s.ps(!0)):s=this.mr(t,e);const r=this.sh.get(e)||new Map;return r.set(t,s),this.sh.set(e,r),this.pr(s,e),s}Ch(t,e){const i=this.vr(t,e);return this.dr(t),i}lr(t,e,i,s,r,n,o){const h=[];for(const a of t.$e){const t=s.get(a);for(const s of t){if(si)continue;const t=this.sh.get(a),l=(t?t.get(s):void 0)||this._h(s,a),u=this.Ch(l,n),c=Js(l,r);h.find((t=>Ye(c,Js(t,r))))&&l.Ke.setVisible(!1),l.wh=!1,o.set(l,u),h.push(l)}}return h}ur(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Xe){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.Ih){p=!1;break}const t=u.Ih.Sr;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.kh(y.filter((t=>a.some((e=>It(t.M,e))))),g,u,d,n,h,e,i,r,o,l);!0!==m?t=t.concat(m):(d+=1,f=-1,t=[])}m=t,y.forEach((e=>{t.find((t=>t===e))||this.br(e)}))}if(l=m,!p)break}}br(t){const e=this.sh.get(t.Fh);null==e||e.delete(t.M);const i=this.eh.get(t.Fh);i&&i.has(t.M)?t.dispose():i&&(t.ps(!1),i.set(t.M,t))}hr(t){for(const e of this.sh.values())for(const i of e.values())t(i)}Mr(t,e){for(const i of this.sh.values())for(const s of i.values())e=t(e,s);return e}Kh(){this.sh.forEach(((t,e)=>{t.forEach((t=>this.br(t)))})),this.sh.clear()}ar(){for(const t of this.sh.values())for(const e of t.values())e.wh=!0}cr(){for(const t of this.sh.values())for(const[e,i]of t.entries())i.wh&&(i.dispose(),t.delete(e))}nr(){const t=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart();return y(t,e)}Th(t,e){return!(t.wh||0===t.Ke._r().length||Ys(e)&&!0!==e.wr)}Cr(t,e){return qs(this.th)||(this.th.$e.forEach((i=>{e=t(e,i.yr)})),this.th.Xe.forEach((i=>{(t=>void 0!==t.Ar)(i)&&(e=t(e,i.yr))}))),e}er(){let t=this.Lh.kr();const e=this.Lh.Tr();let i;if(void 0!==t&&Tt(t)&&void 0!==e&&Tt(e)&&("logarithmic"===this.Eh.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=y(t,e)),i&&Tt(i.min)&&Tt(i.max))return It(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}Fr(){if(!this.Dh)return 0;let t=0;const e=this.Lh.Ir();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this.Dh=t,this.chart.ls.xs(),this}Pr(){var t;const e=this.dh;let i=!1;if(this.yh&&this.Yh){const t=this.er(),e="function"==typeof this.Yh?this.Yh({curStart:this.Oh,curEnd:this.Nh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Yh;this.setInterval(e),this.yh=!1}if(this.hh&&!this.lh){const e=this.er();if(e){const s=this.Oh,r=this.Nh;let n=this.hh.start(s,r,e.min,e.max),o=this.hh.end(s,r,e.min,e.max);const h=null===(t=this.hh.allowIntervalLengthChange)||void 0===t||t,a=or(this.$h,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===It(s,n),u=!1===It(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.rh&&!this.Bh)if(this.rh){t=!0;const e=l?this.Dr(s,n):s,a=u?this.Dr(r,o):r;if(!0===this.sr(e,a,h)&&(l&&!1===It(e,n)||u&&!1===It(a,o))){this.chart.ls.xs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.fh=t>=1.4}}else t=!1;t||this.sr(n,o,h),this.Bh=!1}}}return i?(this.dh!==i&&(this.dh=i,this.Ah=wt.performance.now()),this.Br&&(clearTimeout(this.Br),this.Br=void 0)):!0===e&&void 0===this.Br&&(this.fh=!1,this.Br=setTimeout((()=>{!1!==this.dh&&(this.dh=!1,this.Ah=wt.performance.now()),this.Br=void 0,this.chart.ls.xs()}),200)),this}sr(t,e,i){let s={start:t,end:e},r=!0;if(this.$h){const t=this.er();s=or(this.$h,t,s,{start:this.Oh,end:this.Nh},i)}const n=Math.abs(e-t),o=Math.abs(this.Nh-this.Oh);if(void 0!==this.th.Ze&&this.th.Ze>n){const n=(e+t)/2,h=(i?this.th.Ze/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.th.Qe&&this.th.Qee?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.At.ut(s.start,s.end,this.Oh,this.Nh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.Fr(),l=this.Lr(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.Oh,this.Nh,!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.Oh=s.start,this.Nh=s.end,this.R.emit("scaleChange",this,s.start,s.end),this.gh=wt.performance.now(),this.chart.ls.xs(),r)}Rr(){return this.dh}Er(){return void 0!==this.ir}Uh(){var t;const e=!1!==(null===(t=this.Wh)||void 0===t?void 0:t.displayOnAxis);this.bh.gr(this.Gh&&e&&this.mh?`${this.mh} (${this.Gh})`:this.mh),this.chart.ls.xs()}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 sr{constructor(t,e,i,s,r=i.Or(s).Vr(Ie).zr(Ie).setMouseInteractions(!1)){this.wh=!1,this.$i=!1,this.qi=[],this.Fh=t,this.M=e,this.Nr=i,this.qe=s,this.Ke=r,this.qi.push(r)}ps(t){this.qi.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.qi.forEach((t=>t.dispose()))),this}}const rr=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.$e){let t=n.Gr(e,i,s,r);t=nr(t),o.set(n,t)}let h;for(const s of t.Xe){let t;if(void 0===h)t=s.Gr(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.Wr&&s.Wr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),or=(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||It(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||It(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||It(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||It(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},hr=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}},ar=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class lr extends ar{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 ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),cr=new lr,dr=new class{getFillStyle(){return B}},fr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:nt});class gr extends fr{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 yr=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),mr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class pr extends mr{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 xr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),Ar={Triangulated:gr,Pixelated:pr};class Sr{constructor(t){this.Ur=new Map,this.ls=t}ns(t,e,i){const s=i.animationEnabled;this.Ur.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Ur.delete(t),t.offDispose(r)}))}Yr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Ur.delete(t)})),t.offDispose(r)}));return{Hr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Ur.set(t,r)},$r:()=>{s.forEach((t=>{this.Ur.delete(t)})),s.length=0},Xr:t=>{i=t,s.forEach((t=>{this.Cs(t,i)}))},jr:()=>i}}ws(t,e){const i=this.Ur.get(t);i&&(i.curUnanimatedHighlightValue=be(e),this.ls.xs())}As(t,e=!1){const i=this.Ur.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Ur.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Ur.get(t);return!!e&&e.animationEnabled}Ls(t){let e=!1;this.Ur.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.ls.xs(!0)}}const vr=new Map,br=(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=vr.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),vr.set(a,l)),l};var Mr,wr;!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"}(Mr||(Mr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(wr||(wr={}));const Cr=t=>({container:t.Zr,setMouseStyle:(e,i)=>t.Qr(e,i),restoreMouseStyle:e=>t.Jr(e),captureFrame:(e,i,s)=>t.Kr(e,i,s),renderFrame:(e,i,s=!1)=>t.qr(e,i,s),layout:()=>{t.tn(),t.sn(),t.hn.en(),t.xs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.rn(e,i),onRenderFrame:e=>t.nn(e),offRenderFrame:e=>t.an(e)}),Tr=[];let Rr;const Er=()=>{if(void 0!==Rr){const t=wt.getComputedStyle(wt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Rr.style.height=wt.innerHeight-e+"px",(()=>{for(let t=0;tthis.xs()),60),this.cn=u(0,0),this.dn=!1,this.fn=kt,this.An=()=>{},this.gn=[],this.pn=-1,this.yn=[],this.mn=!0,this.$i=!1,this.vn=!1,this.sn=()=>{const{bottom:t,left:e}=this.Zr.getBoundingClientRect();return this.cn=u(Math.floor(e),Math.floor(t)),this},this.Sn=t=>{if(this.xn){const e=this.xn.entity.bn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),this.xn=void 0}},this.tn=()=>{this.Mn&&this.Mn()},this.Qr=(t,e)=>{if(!e){this.Zr.style.cursor=t;const e=this.pn;return this.pn+=1,this.yn.push([e,t]),e}return this.Jr(e),this.Qr(t)},this.Jr=t=>{const e=t?this.yn.findIndex((e=>e[0]===t)):-1;e>=0?(this.yn.splice(e,1),this.yn.length>0?this.Zr.style.cursor=this.yn[this.yn.length-1][1]:this.Zr.style.cursor="default"):(this.yn.push([0,"default"]),this.Zr.style.cursor="default")},this._n=t=>(this.wn._(t),this),this.Cn=()=>this.wn.C(),this.kn=()=>{this.fn&&this.fn(1e3/60),this.Tn(),this.Fn(),this.An&&this.An()},this.In=t=>(this.ln.set(t.Pn(),t),this.ln=new Map([...this.ln.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Dn=t=>(this.ln.delete(t),this),this.J=()=>(this.wn.u=!1,this),this.K=()=>(this.wn.u=!0,this),this.Bn=t=>{if(!this.mn)return;const e=this.Ln,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.vs({x:t.clientX,y:t.clientY});if(this.Rn&&((null==s?void 0:s.entity)!==this.Rn.entity||s.collectionMember!==this.Rn.collectionMember)&&!this.xn){this.Rn.entity.Ts=!1;const e=this.Rn.entity.En;e&&e(this.Rn.entity,t,this.Rn.collectionMember)}if(s&&s.entity.getMouseInteractions()&&!this.xn)if(s.entity.Ts){if(!i){const e=s.entity.zn;e&&e(s.entity,t,s.collectionMember,s.info)}}else{s.entity.Ts=!0;const e=s.entity.Vn;e&&e(s.entity,t,s.collectionMember,s.info)}if(this.xn){const i=this.xn.entity.On,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.xn.entity,t,this.xn.button,this.xn.startLocation,s,this.xn.collectionMember,this.xn.info)}this.Nn=t,this.Ln=t,this.Rn=s?{...s,event:t}:void 0},this.Gn=t=>{if(this.mn=!1,this.Nn=t,this.Rn&&!this.Wn&&!this.xn){this.Rn.entity.Ts=!1;const e=this.Rn.entity.En;e&&e(this.Rn.entity,t,this.Rn.collectionMember),this.Rn=void 0}},this.Un=t=>{if(this.mn=!0,this.Nn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.bn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),this.xn=void 0}if(this.Wn&&t.buttons<=0){const e=this.Wn.entity.Yn;e&&e(this.Wn.entity,t,this.Wn.collectionMember,this.Wn.info),this.Wn=void 0}},this.Hn=()=>this.Nn&&this.$n?this.Nn.timeStamp>this.$n.timeStamp?this.Nn:this.$n:this.Nn||this.$n,this.hn=t,this.Ki=e.theme,this.Xn=i.Xn,this.jn=i.jn,this.Zn=i.Zn,this.Qn={Jn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Zs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${wt.location.origin}/resources`,Kn:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,qn:(()=>{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})(),io:void 0===(null==e?void 0:e.interactable)||e.interactable,so:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=wt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Zr=t}else this.Zr=s;wt.addEventListener("resize",this.tn),this.gn.push((()=>{wt.removeEventListener("resize",this.tn)}))}else{if(void 0===Rr){const t=wt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",wt.document.body.appendChild(t),Rr=t,wt.addEventListener("resize",Er)}let t=1;for(;null!==wt.document.getElementById(`chart-${t}`);)t+=1;this.Zr=wt.document.createElement("div"),this.Zr.id=`chart-${t}`,this.Zr.style.flex="1",this.Zr.style.height="100%",Rr.appendChild(this.Zr),Er(),Tr.push(this.tn),this.gn.push((()=>{Rr&&Rr.removeChild(this.Zr),Tr.includes(this.tn)&&Tr.splice(Tr.indexOf(this.tn),1),0===Tr.length&&Rr&&(wt.document.body.removeChild(Rr),Rr=void 0,wt.removeEventListener("resize",Er))}))}if(wt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Zr&&this.tn()};this.eo=new wt.ResizeObserver(t.bind(this)),this.eo.observe(this.Zr)}""===this.Zr.style.position&&(this.Zr.style.position="relative"),this.Zr.style.boxSizing="content-box",this.Zr.addEventListener("fullscreenchange",this.tn),this.Zr.addEventListener("webkitfullscreenchange",this.tn);const n=e?e.maxFps:void 0;this.ho=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.Zr.onwheel=this.ro(Mr.wheel),this.Zr.oncontextmenu=this.ro(Mr.contextmenu),this.Zr.onclick=this.ro(Mr.click),this.Zr.ondblclick=this.ro(Mr.dbclick),this.Zr.onlostpointercapture=()=>{h=!1},this.Zr.ontouchmove=t=>{h&&t.preventDefault()},this.Zr.onpointerover=a(),this.Zr.onpointerenter=a(this.Un),this.Zr.onpointerdown=a(this.ro(Mr.mouseDown),this.no(wr.touchStart)),this.Zr.onpointermove=a(this.Bn,this.no(wr.touchMove)),this.Zr.onpointerup=a(this.ro(Mr.mouseUp),this.no(wr.touchEnd)),this.Zr.onpointercancel=a(),this.Zr.onpointerout=a(),this.Zr.onpointerleave=a(this.Gn,this.no(wr.touchEnd)),wt.addEventListener("dragstart",this.Sn),wt.addEventListener("scroll",this.sn,{passive:!0}),this.wn=p(new b({r:0,g:0,b:0,a:0})),this.os=new Sr(this)}oo(t,e){var i,s,r,n;(null===(i=this.Rn)||void 0===i?void 0:i.entity)===t.entity&&this.Rn.collectionMember===t.collectionMember&&(this.Rn={...e,info:this.Rn.info,event:this.Rn.event}),(null===(s=this.ao)||void 0===s?void 0:s.entity)===t.entity&&this.ao.collectionMember===t.collectionMember&&(this.ao={...e,info:this.ao.info}),(null===(r=this.Wn)||void 0===r?void 0:r.entity)===t.entity&&this.Wn.collectionMember===t.collectionMember&&(this.Wn={...e,info:this.Wn.info,event:this.Wn.event}),(null===(n=this.xn)||void 0===n?void 0:n.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,info:this.xn.info,button:this.xn.button,startLocation:this.xn.startLocation})}lo(){this.vn=!0,this.fn=void 0,this.An=void 0}nn(t){return this.R.on("render",t)}an(t){return this.R.off(t)}uo(){return this.co}do(){return this.fo}setBackgroundFillStyle(t){return this.Ao.Ie(t),this}getBackgroundFillStyle(){return this.Ao.Hh()}setBackgroundStrokeStyle(t){return this.Ao.Fe(t),this}getBackgroundStrokeStyle(){return this.Ao.po()}yo(t){return this.An=t,this}mo(t){return this.fn=t,this}vo(t){return this.ln.get(t)}So(){return Array.from(this.ln.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}ro(t){return e=>this.xo(t,e)}xo(t,e){if(!this.mn)return;t===Mr.contextmenu&&Qt(e);const i=this.vs({x:e.clientX,y:e.clientY});if(t===Mr.mouseUp){if(this.xn){const t=this.xn.entity.bn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),(null==i?void 0:i.entity)!==this.xn.entity||i.collectionMember!==this.xn.collectionMember){this.xn.entity.Ts=!1;const t=this.xn.entity.En;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Wn){const t=this.Wn.entity.getMouseInteractions()&&this.Wn.entity.Yn;t&&t(this.Wn.entity,e,this.Wn.collectionMember,this.Wn.info),this.Wn=void 0}}else if(i&&i.entity.getMouseInteractions()){const s=t===Mr.click?i.entity.bo:t===Mr.dbclick?i.entity.Mo:t===Mr.mouseDown?i.entity._o:t===Mr.wheel?i.entity.wo:t===Mr.contextmenu?i.entity.Co:void 0;if(s&&s(i.entity,e,i.collectionMember,i.info),t===Mr.mouseDown){this.Wn={entity:i.entity,collectionMember:i.collectionMember,event:e,info:i.info};const t=this.Wn.event.button,s=i.entity.ko;s&&s(i.entity,e,t,i.collectionMember,i.info),this.xn={entity:i.entity,collectionMember:i.collectionMember,button:t,startLocation:u(e.clientX,e.clientY),info:i.info}}}this.Nn=e,this.Rn=i?{...i,event:e}:void 0}no(t){return e=>this.To(t,e)}To(t,e){const i=e.interactions.length;if(this.$n=e,this.ao){const s=t===wr.touchMove?this.ao.entity.Fo:t===wr.touchEnd?this.ao.entity.Io:t===wr.touchStart?this.ao.entity.Po:void 0;s&&s(this.ao.entity,e,this.ao.collectionMember,this.ao.info),t===wr.touchEnd&&0===i&&(this.ao.entity.Ts=!1,this.ao=void 0)}else if(t===wr.touchStart){for(let t=0;t{t()})),this.gn.length=0}}Re(t,e){return u(t-this.cn.x,this.cn.y-e)}zo(t,e){return u(t+this.cn.x,this.cn.y-e)}Vo(t){const e=this.Re(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Oo(t){const e=this.zo(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Dr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=li(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=li(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=li(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=li(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===zr.Nearest)return Or(t,e,n,o,c,d);if(i===zr.NearestX||i===zr.NearestY){if("boolean"==typeof l&&("x"===a&&i===zr.NearestX||"y"===a&&i===zr.NearestY))return Gr(t,ct(e,o,n),a,l,c,d);if(i===zr.NearestX)return Ur(t,ct(e,o,n),h,c,d);if(i===zr.NearestY)return Yr(t,ct(e,o,n),h,c,d)}},Or=(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=ct(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,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const e=h-(o?t[y].x:t[y].y);if(e*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(e))return y;m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){const i=y>r?Math.abs(h-(o?t[y-1].x:t[y-1].y)):Be,s=y{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,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const i=h-(o?t[y].x:t[y].y);if(i*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(i))return{a:y,b:y,lerpAmount:0};m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){if(i*(s?-1:1)<0&&y>r){const i=t[y-1],s=t[y];return{a:y-1,b:y,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(ythis.R.on("dispose",t),this.offDispose=t=>this.R.off(t,"dispose"),this.ls=t,this.Ho=e,this.$o=i,this.Xo=Zr,Zr+=1,this.jo=t.Ki.highlightColorOffset}Zo(){let t;return this.Qo("DataPattern",(e=>(t=e.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?zr.NearestX:"ProgressiveY"===t||"RegressiveY"===t?zr.NearestY:zr.Nearest}Jo(t){return void 0!==this.$o.find((e=>e.type===t))}Qo(t,e){var i;return!!this.Jo(t)&&!0===e(null===(i=this.$o.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.Ts&&this.En&&this.En(this,void 0,void 0),this.$i=!0,this.Ho(this),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.Ts&&this.En&&this.En(this,void 0,void 0),this.Ts=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.No.C();return this.No._(t),t||(e&&this.Ts&&this.En&&this.En(this,void 0,void 0),this.Ts=!1),this}getMouseInteractions(){return this.No.C()}getIsUnderMouse(){return this.Ts}getIsGrabbed(){return this.Wo}setMouseMoveEventHandler(t){return this.zn=t,this}setMouseEnterEventHandler(t){return this.Vn=t,this}setMouseLeaveEventHandler(t){return this.En=t,this}setMouseClickEventHandler(t){return this.bo=t,this}setMouseDoubleClickEventHandler(t){return this.Mo=t,this}setMouseDownEventHandler(t){return this._o=t,this}setMouseUpEventHandler(t){return this.Yn=t,this}setMouseWheelEventHandler(t){return this.wo=t,this}setMouseContextMenuEventHandler(t){return this.Co=t,this}setMouseDragEventHandler(t){return this.On=t,this}setMouseDragStartEventHandler(t){return this.ko=t,this}setMouseDragStopEventHandler(t){return this.bn=t,this}setTouchStartEventHandler(t){return this.Po=t,this}setTouchMoveEventHandler(t){return this.Fo=t,this}setTouchEndEventHandler(t){return this.Io=t,this}Ko(t){return this.Uo=t,this}qo(){return this.Uo?this.Uo:Wr}us(t){return this.Yo=t,this}ta(){return this.Yo}ia(t){return this.jo=t,this}sa(){return this.jo}}const Wr=y(u(0,0),u(0,0));class jr extends Hr{constructor(t,e,i,s){super(t,i,s),this.ea=0,this.Is=e,this.Is.ha=!0}ra(t){return this.ea===t||(this.ea=t,this.Is.ha=!0),this}na(){return this.ea}}class Kr extends jr{constructor(t,e,i,s,r){super(t,e,s,r),this.oa=!0,this.At=i}}const $r=(t,e,i)=>{if(i instanceof Bi){const s=i.Wi(),r=di(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return y(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return y(i.pi(u(t.min.x,t.min.y),li(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Qr=(t,e)=>"function"==typeof e?e(t):e,qr=(t,e)=>!t||t!==e,Jr=t=>t!==B;class tn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.we=Ir.fillStyle,this.ls=t}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}aa(){return qr(this.la,this.we)}ua(){return((t,e)=>t===B&&e!==B)(this.la,this.we)}ca(){return Jr(this.we)}da(t){this.la=t}}class en extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ce=Ir.lineStyle,this.ls=t}Fe(t){return this.Ce="function"==typeof t?t(this.Ce):t,this}po(){return this.Ce}fa(){return!this.Aa||this.Aa!==this.Ce}ga(t){return!this.Aa||this.Aa.getThickness()!==t}ca(){return this.Ce!==nt||super.ca()}ua(){return(this.Ce!==nt||this.we!==B)&&this.Aa===nt&&this.la===B}pa(t){this.Aa=t}}class sn extends tn{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 rn extends tn{constructor(t,e,i,s,r,n=p(Ir.font)){super(t,e,i,s,r),this.ya=p(""),this.ma=p(u(0,0)),this.va=p(0),this.Sa=p(0),this.xa=p(u(0,0)),this.ba=p(0),this.Ma=p(cr),this._a=u(0,0),this.Xt=p(x(1,1,1,1)),this.wa=p(A(4,4,4,4)),this.font=p(Ir.font),this.Ca=!1,this.font=n}ca(){return Jr(this.we)&&this.ya.C().length>0}ua(){return!1===this.Ca&&this.ca()}gr(t){return this.ya._(t),this}_r(){return this.ya.C()}jh(t){return ur(t)?this.Ma._(t):this.Ma._(t(this.Ma.C())),this}Xh(){return this.Ma.C()}ka(t){return this.Ma._(this.Ma.C().setFamily(t)),this}Ta(){return this.Ma.C().getFamily()}Fa(t){return this.Ma._(this.Ma.C().setSize(t)),this}Ia(){return this.Ma.C().getSize()}Pa(t){return this.Ma._(this.Ma.C().setWeight(t)),this}Da(){return this.Ma.C().getWeight()}Ba(t){return this.Ma._(this.Ma.C().setStyle(t)),this}La(){return this.Ma.C().getStyle()}Ra(t){return this.Ma._(this.Ma.C().setVariant(t)),this}Ea(){return this.Ma.C().getVariant()}Be(t){return this.ma._(t),this}za(){return this.ma.C()}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}Va(t,e){return this.xa._(u(t,e)),this}Oa(){return this.xa.C()}Na(t){return this.Sa._(t),this}Ga(){return this.Sa.C()}Wa(t){return this.va._(t),this}Ua(){return this.va.C()}Ya(t){return this.Sa._(t.x),this.va._(t.y),this}zr(t){return this.Xt._(t),this}Ha(){return this.Xt.C()}Vr(t){return this.wa._(t),this}$a(){return this.wa.C()}}class nn extends sn{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Xa=[],this.ja=p(e.PointShape.Square),this.ba=p(0),this.Za=p(!1),this.Qa=p(!1),this.Ja=p(!1),this.Ka=Ne,this.qa=0,this.tl=[],this.il=0,this.sl=Ne,this.el=!1,this.hl=void 0}rl(){return this.tl}nl(){return this.Xa}ol(t){return this.ja._(t),this}al(){return this.ja.C()}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}ll(t){return this.Za._(t),this}ul(t){return this.Qa._(t),this}cl(t){return this.Ja._(t),this}dl(t,e){return Array.isArray(t)||(t=[t]),this.il+=t.length,this.tl=he(this.tl,t,{canReturnB:!0}),this.sl&&(this.sl=e?ei(this.sl,e):void 0),this.hl=void 0,this}Ot(){return this.el=!0,this.Xa.length=0,this.qa=0,this.Ka=Ne,this.tl=[],this.il=0,this.hl=void 0,this}fl(){return this.qa}Al(){return this.il}}class on extends en{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.ba=p(0),this._a=p(u(0,0)),this.pl=!1}Ls(){return this.yl(),this}Be(t){const e=this.ma.C();return t.x===e.x&&t.y===e.y||(this.ma._(t),this.yl()),this}za(){return this.ma.C()}ml(t){const e=this.ma.C();return t!==e.x&&(this.ma._(u(t,e.y)),this.yl()),this}vl(t){const e=this.ma.C();return t!==e.y&&(this.ma._(u(e.x,t)),this.yl()),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.yl()),this}oi(){return this.Z.C()}Sl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(t,e.y)),this.yl()),this}xl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(e.x,t)),this.yl()),this}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}bl(t){const e=this._a.C();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.pl=!1,this.yl()):(this.pl=!0,this._a._(t))),this}yl(){if(!this.pl){const t=this.ma.C(),e=this.Z.C(),i=u(t.x+e.x/2,t.y+e.y/2),s=this._a.C();i.x===s.x&&i.y===s.y||this._a._(i)}}}class hn extends en{constructor(){super(...arguments),this.Xa=[],this.ma=p(u(0,0)),this.Ka=Ne,this.Ml=!1}_l(t){return t=ie(t),this.Xa=t,this.Ml=!0,this}wl(){return this.Xa}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}}class an extends hn{}class ln extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tl=new Array,this.Fl=new Array,this.Il=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ka=Ne,this.Pl=0,this.Dl=!1,this.tl=[Array(),Array()],this.Bl=!1,this.Ll=(new U).setColor(w(42,171,240)),this.el=!1,this.Rl=!1,this.El=!1}dl(t,e){const i=this.Pl-1,s=i>0&&!this.Bl;let[r,n]=s?[[this.Tl[i]],[this.Fl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=he(r,e,{canReturnB:!0}),n=he(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Bl?(this.tl[0]=he(this.tl[0],r,{canReturnB:!0}),this.tl[1]=he(this.tl[1],n,{canReturnB:!0})):(this.tl=[r,n],this.Bl=!0),this.Ka=ei(this.Ka,e||ei(Je(r),Je(n))),this}Ot(){return this.el=!0,this.Tl.length=0,this.Fl.length=0,this.Pl=0,this.Ka=Ne,this}nl(){return[this.Tl,this.Fl]}rl(){return[this.tl[0],this.tl[1]]}zl(t){return this.Il._(t),this}Vl(){return this.Il.C()}Ol(t){return this.Ll="function"==typeof t?t(this.Ll):t,this}Nl(){return this.Ll}fl(){return this.Pl-(Number(this.Rl)+Number(this.El))}Al(){return this.tl.length}Gl(t){return this.Rl=t,this}Wl(){return this.Rl}Ul(t){return this.El=t,this}Yl(){return this.El}ua(){return this.la===B&&this.Hl===B&&(this.we!==B||this.Ll!==B)}$l(t){this.Hl=t}ca(){return this.Ll!==B||super.ca()}aa(){return super.aa()||!this.Hl||this.Hl!==this.Ll}}class un extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ma=p(u(0,0)),this.Xl=p(0),this.Fi=p(360),this.jl=p(100),this.Zl=p(100),this.Ql=p(0),this.Jl=p(void 0),this.Kl=u(0,0),this.ql=u(0,0),this.tu=u(0,0)}iu(){return this.jl.C()}su(){return this.Zl.C()}za(){return this.ma.C()}eu(){return this.Xl.C()}Ti(){return this.Fi.C()}hu(){return this.Ql.C()}ru(){return this.Jl.C()}nu(){return this.Kl}ou(){return this.ql}au(){return this.tu}Be(t){return this.ma._(t),this}lu(t){return this.Xl._(t),this}Ge(t){return this.Fi._(t),this}uu(t){return this.Zl._(t),this.jl._(t),this}cu(t){return this.jl._(t),this}du(t){return this.Zl._(t),this}fu(t){return this.Ql._(t<0?0:t),this}Au(t){return this.Jl._(void 0!==t&&t<=0?void 0:t),this}}var cn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(cn||(cn={}));class dn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.gu=Ir.lineStyle,this.engine=t}Oe(t){return this.gu=((t,e)=>"function"==typeof e?e(t):e)(this.gu,t),this}pu(){return this.gu}fa(){return((t,e)=>!t||t!==e)(this.yu,this.gu)}mu(t){return((t,e)=>!t||t.getThickness()!==e)(this.yu,t)}ua(){return((t,e)=>t===nt&&e!==nt)(this.yu,this.gu)}ca(){return(t=>t!==nt&&t.getFillStyle()!==B)(this.gu)}vu(t){this.yu=t}}class fn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.Su=!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.Su=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}We(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Su=!0,this.Pi=t),this}Ge(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Su=!0,this.Fi=t),this}}class gn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xu=void 0}}class yn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.bu=[],this.Ka=Ne,this.tl=new Array,this.qa=0,this.el=!1,this.Mu=p(void 0),this.Rl=!1,this.El=!1}_u(t){return this.Mu._(t),this}wu(){return this.Mu.C()}rl(){return this.tl}nl(){return this.bu}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.Ka=Ne,this}fl(){return this.qa-(Number(this.Rl)+Number(this.El))}Al(){return this.tl.length}Gl(t){return this.Rl=t,this}Wl(){return this.Rl}Ul(t){return this.El=t,this}Yl(){return this.El}}const mn=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 pn{constructor(){this.Xi=!0,this.R=new r.Eventer,this.Cu=0,this._t=(t,e,i)=>{0===this.Cu&&this.R.emit("mouseEnter",this,e),this.Cu+=1},this.wt=(t,e,i)=>{this.Cu-=1,this.Cu<1&&(this.R.emit("mouseLeave",this,e),this.Cu=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.Cu+=1,this.R.emit("touchStart",this,e)},this.Et=(t,e)=>{this.R.emit("touchMove",this,e)},this.zt=(t,e)=>{this.Cu-=1,this.R.emit("touchEnd",this,e)},this.ku=t=>(t instanceof Kr?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.Cu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.R.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}const xn=(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()},di({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},di({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),Qt(s)}},An=(t,e,i,s,r)=>{xn(t,r,e)},Sn=(t,e,i,s,r)=>{xn(t,s,r)};class vn extends pn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.$i=!1,this.Tu=void 0,this.Fu=void 0,this.Iu=mn,this.Pu=void 0,this.No=!0,this.Du=()=>{const t="function"==typeof this.Iu?this.Iu(this):this.Iu;t&&(this.Fu=this.Is.ls.Qr(t))},this.Bu=()=>{this.Is.ls.Jr(this.Fu)},this.Xt=x(0,0,0,0),this.Is=t,this.renderingScale=e,this.scale=i,this.Ho=s,this.Ki=r,this.Is.xs(),this.onMouseEnter(this.Du),this.onMouseLeave(this.Bu),this.onMouseDrag(An);const n=ji(new $i(kt,Sn,kt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.Ki=r}setMouseInteractions(t){return this.Lu().forEach((e=>e.setMouseInteractions(t))),this.No=t,this}getMouseInteractions(){return this.No}setEffect(t){return this.ss=this.ss||this.Is.ls.ss.es(this,{Ru:{shapes:this.Lu()}}),this.ss.Ru.Ss(t),this}getEffect(){return!!this.ss&&this.ss.Ru.bs()}setAutoDispose(t){return this.Pu=t,this.Is.xs(),this}getAutoDispose(){return this.Pu}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.Is.xs(),this}getMargin(){return this.Xt}De(){if(this.Pu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Pu.type&&i.x>=this.Pu.maxWidth||"max-height"===this.Pu.type&&i.y>=this.Pu.maxHeight)&&this.dispose()}return this}Ls(){return this}dispose(){return this.$i||(this.Is.xs(),this.$i=!0,this.Ho(this),this.R.emit("dispose",this),this.Lu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Lu().forEach((e=>e.setVisible(t))),this.Is.xs(),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setPosition(t){return this.position=t,this.Is.xs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,di({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,di({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,di({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Is.xs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Tu=t,this.Is.xs(),this}getDraggingMode(){return void 0!==this.Tu?this.Tu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Iu=t,this}getMouseStyle(){return this.Iu}}class bn extends vn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.wa=x(),this.Eu=0,this.Is=t,this.zu=s,this.backgroundElement=new this.zu(this.Is,this.renderingScale,this.scale,kt,n),this.ku(this.backgroundElement)}Lu(){return this.backgroundElement.Lu()}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}De(){return super.De(),this.$i||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).De(),this}Ls(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Vu(t).Ls(),super.Ls()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.wa="object"==typeof t?S(this.wa,t):{left:t,top:t,right:t,bottom:t},this.Is.xs(),this}getPadding(){return this.wa}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.wa.left+this.wa.right,i.y+this.wa.bottom+this.wa.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ou()+this.backgroundElement.Nu(),i.y+this.backgroundElement.Gu()+this.backgroundElement.Wu())),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,di({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Ou(),y:this.backgroundElement.Gu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,di({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,di({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.Eu}setHighlight(t){return this.Eu=be(t),this.backgroundElement.setHighlight(t),this.R.emit("highlight",this,t),this}}const Mn=t=>"setBackground"in t;class wn extends pn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.M=0,this.Uu=1,this.Yu=!0,this.Hu=new lr,this.$u=!0,this.$i=!1,this.axisScale=s,this.renderingScale=r,this.Xu=o,this.ju=h,this.Zu=a,this.Ho=l,this.Qu=e,this.Ju=i,this.Ku=this.ku(this.Qu.Ne(this.renderingScale)),this.Ki=u,this.qu=this.ku(this.Zu.setDirection(this.ju).tc(this.Ju,this.renderingScale,n,kt,this.Ki,!1).setOrigin(Kt(this.ju))),this.axis=t,this.setMouseInteractions(!1),"major"===this.qu.ic?this.Ku.Oe(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.qu.ic?this.Ku.Oe(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.qu.ic&&this.Ku.Oe(u.cursorGridStrokeStyleX)}setValue(t){return this.M=t,this.Ju.xs(),this.R.emit("valueChange",this,this.M),this}getValue(){return this.M}setTextFormatter(t){return this.sc=t,this.Ju.xs(),this}setTickLength(t){return this.qu.setPointerLength(t),this.Qu.xs(),this}getTickLength(){return this.qu.getPointerLength()}setTickLabelPadding(t){return this.qu.setTickLabelPadding(t),this.Qu.xs(),this}setTickLabelRotation(t){return this.qu.setTextRotation(t),this.Qu.xs(),this}getTickLabelRotation(){return this.qu.getTextRotation()}getTickLabelPadding(){return this.qu.getTickLabelPadding()}setGridStrokeLength(t){return this.Uu=t,this.Qu.xs(),this}getGridStrokeLength(){return this.Uu}setGridStrokeStyle(t){return this.Ku.Oe(t),this.Qu.xs(),this}getGridStrokeStyle(){return this.Ku.pu()}dispose(){return this.$i||(this.$i=!0,this.Ku.dispose(),this.qu.dispose(),this.Ho(this),this.Qu.ls.xs(),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.Yu=t,this.Ju.xs(),this}getMarkerVisible(){return this.Yu}setMarker(t){return t(this.qu),this.Ju.xs(),this}getMarker(){return this.qu}setMouseInteractions(t){return this.qu.setMouseInteractions(t),this.Ku.setMouseInteractions(t),this}getMouseInteractions(){return this.Ku.getMouseInteractions()}setAllocatesAxisSpace(t){return this.$u=t,this.Ju.xs(),this}getAllocatesAxisSpace(){return this.$u}isInScale(){return je(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 Cn extends wn{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.hc=!1,this.Ho=a,this.Qu=e,this.Ju=i}dispose(){return this.hc=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.hc=!1;const t=ut(this.M,this.axisScale,this.Xu.getWidth(this.renderingScale));this.Ku.setVisible(!0).We(this.Xu.toPoint(t,e)).Ge(this.Xu.toPoint(t,e-(s+i*this.Uu))),this.Yu?(this.sc&&this.qu.setText(this.sc(this.M,this)),this.qu.setVisible(!0).setPosition(this.Xu.toPoint(t,r))):this.qu.setVisible(!1)}else this.Ku.setVisible(!1),this.qu.setVisible(!1);return this.qu.Ls().De(),this}rc(){const t=this.qu.Ls().getSize();return this.Xu.getHeight(t)}}const Tn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Rn=(t,e)=>(ce(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),En=(t,e,i)=>{i&&Mn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},kn={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}},In={background:void 0,setBackground(t){return{...this,background:t}}},Fn={tc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return En(o,r,n),o}},Dn={tc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return En(o,r,n),o}};class Pn extends vn{constructor(){super(...arguments),this.nc=!0}De(){return super.De(),this}setMouseInteractions(t){return this.nc=t,this}getMouseInteractions(){return this.nc}Lu(){return[]}}class Ln extends Pn{onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}Vu(t){return this.size=t,this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return B}setStrokeStyle(){return this}getStrokeStyle(){return nt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Vn extends vn{constructor(){super(...arguments),this.R=new r.Eventer,this.Eu=0}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.Eu}setHighlight(t){return this.Eu=t,this.Lu().forEach((e=>e.us(t))),this.R.emit("highlight",this,t),this.Is.xs(),this}}class _n extends Vn{}class Bn extends _n{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Is=t,this.ja=this.Is.oc(this.renderingScale,cn.Simple).setVisible(!1).Ie(B).Fe(nt),this.ku(this.ja)}ac(){const t=this.lc();if(t.length>2){const e=Je(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=ui(t,li(e.min,-1));return this.scale.pi(this.position,ui(s,di(li(ui(this.origin,u(1,1)),-.5),i)))})).map((t=>ct(t,this.scale,this.renderingScale)));this.ja._l(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.ja&&this.ja.setVisible(!1),this.setContentSize(u(0,0))}De(){return super.De(),this.$i||this.ac(),this}Ls(){return this.ac(),super.Ls()}setVisible(t){return super.setVisible(t),this.ja.setVisible(t),this}}const zn=(t,e,i)=>t*(1-i)+e*i,Nn=(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=zn(i.value,r.value,n),c=zn(e.value,s.value,h);return zn(c,u,l)},On={warm:t=>e=>T(60/(t-1)*e,.8,.8),cold:t=>e=>T(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>T(360/t*e,.8,.8),reverseSpectrum:t=>e=>T(360/t*(t-e),.8,.8),flatUI:t=>e=>T(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return T(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return T(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return T(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return T(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return T(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>T(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return T(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return T(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),T(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return T(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=>T(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Un([{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=>Un([{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=>Un([{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=>Un([{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=>Un([{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=>Un([{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)},Un=(t,e,i)=>{const s=Gn(e,i),[r,n]=Xn(s,t),o=Yn(t[r]),h=Yn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:zn(o.h,h.h,a),s:zn(o.s,h.s,a),v:zn(o.v,h.v,a)};return T(l.h,l.s,l.v)},Yn=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},Xn=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType),to={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},eo=s.Record({type:"linestyle",lineType:"dashed",pattern:to.DashedEqual,fillStyle:new U({color:w(255,255,255)}),thickness:1,patternScale:3});class io extends eo{constructor(t){super({...t,lineType:"dashed"})}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setThickness(t){return"function"==typeof t?this.set("thickness",t(this.getThickness())):this.set("thickness",t)}getThickness(){return this.get("thickness")}N(){const t=this.getThickness();return t<0?1:t}setPattern(t){return"function"==typeof t?this.set("pattern",t(this.getPattern())):this.set("pattern",t)}getPattern(){return this.get("pattern")}setPatternScale(t){return"function"==typeof t?this.set("patternScale",t(this.getPatternScale())):this.set("patternScale",t)}getPatternScale(){return this.get("patternScale")}}const so=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),ro=s.Record({type:"icon",width:void 0,height:void 0,uc:void 0,cc:kt,dc:kt});class no extends ro{constructor(t,e,i,s){super({...s,uc:t,cc:e,dc:i})}dispose(){return this.dc(this),this}setWidth(t){const e=this.set("width",t);return this.cc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.cc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.cc(i),i}oi(){if(!this.uc)return{x:0,y:0};const t=this.uc.width,e=this.uc.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 oo=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),ho=s.Record({type:"glow",color:w(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class ao extends ho{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 lo{constructor(t){this.fc=0,this.Ac=0,this.gc=0,this.yc=!1,this.mc=!0,this.vc=!1,this.Sc={warningDisplayed:!1,expandEvents:[]},this.R=new r.Eventer,this.mc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.xc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.bc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Mc=void 0!==(null==t?void 0:t.colors)&&t.colors,this._c=void 0!==(null==t?void 0:t.ids)&&t.ids,this.wc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.Cc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.kc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.Tc=!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,y,m;if(s){u=new this.kc(i);const e=t[0]&&t[0][s]instanceof Date;if(t[0]&&"string"==typeof t[0][s])for(let e=0;ea-1&&(this.fc=0,this.yc=!0),this.Ac=Math.min(this.Ac+1,a),this.gc+=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,y=void 0!==t.offsetSizes?t.offsetSizes:a,m=void 0!==t.offsetRotations?t.offsetRotations:a,p=this.zc(!0),[x,A]=this.Vc(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),[S,v]=this.Vc(l,t.yValues,"y","ProgressiveY"===p||"RegressiveY"===p?o:void 0,"ProgressiveY"===p||"RegressiveY"===p?h:void 0,a),b=this.Rc(i),{samplesCacheX:M,samplesCacheY:w,samplesCacheLookup:C,samplesCacheColors:T,samplesCacheIDs:R,samplesCacheSize:E,samplesCacheRotation:k,maxSampleCount:I,dataPattern:F,incomingDataReplacedCache:D}=this.Fc({appendCount:l,...0===A&&0===v&&0===a&&0===d&&0===f&&0===g&&0===y&&0===m?{incomingDataX:x,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!D&&F&&this.mc&&this.Pc&&this.Dc){const t=x[A],i=S[v];if(!this.Bc(F,t,i)&&!this.vc)return this.Lc(this.Pc,this.Dc,mo(x,A,A+l),mo(S,v,v+l),mo(e,d,d+l),mo(b,f,f+l),mo(s,g,g+l),mo(r,y,y+l),mo(n,m,m+l),F),this}const P=I-this.fc,L=Math.min(l,P);if(L>0&&(D||(go(M,x,A,L,this.fc),go(w,S,v,L,this.fc),e&&C&&go(C,e,d,L,this.fc),s&&R&&go(R,s,g,L,this.fc),b&&T&&go(T,b,f,L,this.fc),r&&E&&go(E,r,y,L,this.fc),n&&k&&go(k,n,m,L,this.fc)),this.Ec(this.fc,this.fc+L-1),this.fc+=L,this.fc>I-1&&(this.fc=0,this.yc=!0)),this.Ac=Math.min(this.Ac+L,I),this.gc+=L,this.zc(),l-L>0){const t={xValues:x?mo(x,A+L,void 0):void 0,yValues:S?mo(S,v+L,void 0):void 0,lookupValues:e?mo(e,d+L,void 0):void 0,ids:s?mo(s,g+L,void 0):void 0,colors:b?mo(b,f+L,void 0):void 0,sizes:r?mo(r,y+L,void 0):void 0,rotations:n?mo(n,m+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.Pc||this.Dc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.Pc=this.Pc||new this.kc(i),this.Pc.fill(t.x)),void 0!==t.y&&(this.Dc=this.Dc||new this.kc(i),this.Dc.fill(t.y)),void 0!==t.lookupValue&&(this.Oc=this.Oc||new Float32Array(i),this.Oc.fill(t.lookupValue)),void 0!==t.color){const e=this.Rc([t.color]);e&&(this.Nc=this.Nc||new Uint32Array(i),this.Nc.fill(e[0]))}return void 0!==t.size&&(this.Gc=this.Gc||new Float32Array(i),this.Gc.fill(t.size)),void 0!==t.rotation&&(this.Wc=this.Wc||new Float32Array(i),this.Wc.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,y=void 0!==e.offsetIds?e.offsetIds:l,m=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,x=this.Rc(n),A=this.gc-1,S=void 0!==this.Uc?Math.max(this.gc-this.Uc,0):0,v=t+u-1,b=Math.max(t,S),M=Math.min(v,A),w=M-b+1;if(this.gc>0&&w>0){const{samplesCacheX:n,samplesCacheY:u,samplesCacheColors:c,samplesCacheIDs:d,samplesCacheLookup:A,samplesCacheSize:v,samplesCacheRotation:C}=this.Fc({appendCount:0}),T=n.length;if(void 0!==this.Uc&&this.yc&&this.gc%this.Uc!=0){const S=this.gc-this.gc%this.Uc,w=this.gc-1,R=this.gc-this.Ac,E=S-1,k=Math.max(b,R),I=Math.min(M,E)-k+1;if(I>0){const S=k-t,b=uo(k,this.gc,T,this.fc);if(void 0!==e.x)for(let t=b;t0){const S=F-t,b=uo(F,this.gc,T,this.fc);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:y+e,offsetSizes:m+e,offsetRotations:p+e,count:C})}return this}alterSamplesByID(t,e){if(!this._c)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Yc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Rc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.kc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.kc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Rc(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.Ac,f=this.gc-1,g=Math.max(f-d+1,0);for(let d=0;ds[uo(t,this.gc,c,this.fc)])),m=uo(y,this.gc,c,this.fc);s[m]===i&&(void 0!==e.x&&this.Pc&&(this.Pc[m]=e.x),void 0!==e.y&&this.Dc&&(this.Dc[m]=e.y),void 0!==e.lookupValue&&this.Oc&&(this.Oc[m]=e.lookupValue),void 0!==e.size&&this.Gc&&(this.Gc[m]=e.size),void 0!==e.rotation&&this.Wc&&(this.Wc[m]=e.rotation),void 0!==r&&this.Nc&&(this.Nc[m]=r),n&&this.Pc&&(this.Pc[m]=n[d]),o&&this.Dc&&(this.Dc[m]=o[d]),h&&this.Oc&&(this.Oc[m]=h[d]),a&&this.Nc&&(this.Nc[m]=a[d]),l&&this.Gc&&(this.Gc[m]=l[d]),u&&this.Wc&&(this.Wc[m]=u[d]))}return this.R.emit("cleared"),this}clear(){return this.fc=0,this.Ac=0,this.gc=0,this.yc=!1,this.R.emit("cleared"),this}getSampleCount(){return this.Ac}getNextSampleIndex(){return this.gc}setMaxSampleCount(t){if("object"==typeof t){this.Hc&&this.offMaxSampleCountExceeded(this.Hc);const e=t.max,i=t.initial,s=()=>{const t=this.Uc||0;if(void 0!==e&&t>=e)return;let i=2*t;void 0!==e&&(i=Math.min(i,e)),this.setMaxSampleCount(i)};this.Hc=this.onMaxSampleCountExceeded(((t,e,i,r)=>{s()})),void 0===this.Uc&&(void 0!==i?this.setMaxSampleCount(i):this.setMaxSampleCount(Math.min(2*this.Ac,void 0!==e?e:Number.MAX_SAFE_INTEGER)))}else if("number"==typeof t){const e=t;if(void 0!==this.Uc&&this.Uc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.Pc||!this.Dc)return this.Uc=e,this;if(e===this.Uc)return this;if(this.yc&&0!==this.fc)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.Uc=e,this.Act+e.count),0),n=new this.kc(r),o=new this.kc(r),h=this.Mc?new Uint32Array(r):void 0,a=this.bc?new Float32Array(r):void 0,l=this._c?new Uint32Array(r):void 0,u=this.wc?new Float32Array(r):void 0,c=this.Cc?new Float32Array(r):void 0;let d=0;for(const t of s)n.set(this.Pc.subarray(t.offset,t.offset+t.count),d),o.set(this.Dc.subarray(t.offset,t.offset+t.count),d),this.Mc&&h&&this.Nc&&h.set(this.Nc.subarray(t.offset,t.offset+t.count),d),this.bc&&a&&this.Oc&&a.set(this.Oc.subarray(t.offset,t.offset+t.count),d),this._c&&l&&this.Yc&&l.set(this.Yc.subarray(t.offset,t.offset+t.count),d),this.wc&&u&&this.Gc&&u.set(this.Gc.subarray(t.offset,t.offset+t.count),d),this.Cc&&c&&this.Wc&&c.set(this.Wc.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)}Vc(t,e,i,s,r,n){if(void 0===e){const e=this.Ic();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.kc(t);for(let e=0;et){e=s;break}const l={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:e};this.vc=!0,this.appendSamples(l),this.vc=!1}else{const l=t.length,u=this.Ac,f=this.gc-1,g=Math.max(f-u+1,0),y=fo(d,g,f,(e=>t[uo(e,this.gc,l,this.fc)])),m=y-1,p=y+1,x=t[uo(y,this.gc,l,this.fc)],A=p<=this.gc-1?t[uo(p,this.gc,l,this.fc)]:void 0,S=void 0!==A&&A0&&!t){const t=void 0!==this.Uc&&this.yc?this.fc:0,i=this.Ac-1,s=void 0!==this.Uc&&this.yc?0:void 0,r=void 0!==this.Uc&&this.yc?this.fc-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.Pc[n],r=this.Dc[n];for(let e=n+1;e<=o;e+=1){if(!1!==t){const i=this.Pc[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.Dc[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?Br.ProgressiveX:t&&t.direction<0?Br.RegressiveX:i&&i.direction>0?Br.ProgressiveY:i&&i.direction<0?Br.RegressiveY:void 0,this.xc={autoDetectResult:e},e&&wt.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 get clear this warning.`)}}if(e&&"ProgressiveX"!==e)throw new Error("LightningChart JS New XY rework beta features do not yet support other data patterns than ProgressiveX. This will be introduced in near future.");return e}Bc(t,e,i){const s=this.Ic();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.Sc.expandEvents.push({timestamp:i}),this.Sc.expandEvents.length>5)return wt.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.Sc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.Fc(t)}const i=new this.kc(e);i.set(this.Pc),this.Pc=i;const s=new this.kc(e);if(s.set(this.Dc),this.Dc=s,this.bc){const t=new Float32Array(e);this.Oc&&t.set(this.Oc),this.Oc=t}if(this._c){const t=new Uint32Array(e);this.Yc&&t.set(this.Yc),this.Yc=t}if(this.Mc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc),this.Nc=t}if(this.wc){const t=new Float32Array(e);this.Gc&&t.set(this.Gc),this.Gc=t}if(this.Cc){const t=new Float32Array(e);this.Wc&&t.set(this.Wc),this.Wc=t}return this.fc=this.Ac,{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:e}}if(i>4*e){const t=new this.kc(e);t.set(this.Pc.subarray(0,this.Ac)),this.Pc=t;const i=new this.kc(e);if(i.set(this.Dc.subarray(0,this.Ac)),this.Dc=i,this.bc){const t=new Float32Array(e);this.Oc&&t.set(this.Oc.subarray(0,this.Ac)),this.Oc=t}if(this._c){const t=new Uint32Array(e);this.Yc&&t.set(this.Yc.subarray(0,this.Ac)),this.Yc=t}if(this.Mc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc.subarray(0,this.Ac)),this.Nc=t}if(this.wc){const t=new Float32Array(e);this.Gc&&t.set(this.Gc.subarray(0,this.Ac)),this.Gc=t}if(this.Cc){const t=new Float32Array(e);this.Wc&&t.set(this.Wc.subarray(0,this.Ac)),this.Wc=t}return{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:e}}return{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:i}}return t.appendCount+this.Ac>this.Uc&&this.R.emit("maxSampleCountExceeded",this,this.Ac,this.Uc,this.Ac+t.appendCount),this.Pc=this.Pc||new this.kc(this.Uc),this.Dc=this.Dc||new this.kc(this.Uc),this.Oc=this.Oc||(this.bc?new Float32Array(this.Uc):void 0),this.Yc=this.Yc||(this._c?new Uint32Array(this.Uc):void 0),this.Nc=this.Nc||(this.Mc?new Uint32Array(this.Uc):void 0),this.Gc=this.Gc||(this.wc?new Float32Array(this.Uc):void 0),this.Wc=this.Wc||(this.Cc?new Float32Array(this.Uc):void 0),{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:this.Uc}}Zc(){if(!this.Pc||!this.Dc||0===this.Ac)return;if(void 0===this.Uc)return this.gc>0?{x:this.Pc[0],y:this.Dc[0]}:void 0;if(!this.yc)return{x:this.Pc[0],y:this.Dc[0]};let t=this.fc-this.Ac;return t<0&&(t+=this.Uc),{x:this.Pc[t],y:this.Dc[t]}}Ic(){if(!this.Pc||!this.Dc||0===this.Ac)return;if(void 0===this.Uc){const t=this.Ac-1;return t>=0?{x:this.Pc[t],y:this.Dc[t]}:void 0}let t=this.fc-1;return t<0&&(t+=this.Uc),{x:this.Pc[t],y:this.Dc[t]}}Qc(t){if(!this.Pc||!this.Dc)return;const e=this.Pc.length,i=this.Ac,s=this.gc-1,r=Math.max(s-i+1,0)+t,n=uo(r,this.gc,e,this.fc);return{x:this.Pc[n],y:this.Dc[n],lookupValue:this.bc&&this.Oc?this.Oc[n]:void 0,id:this._c&&this.Yc?this.Yc[n]:void 0,color:this.Mc&&this.Nc?this.Nc[n]:void 0,size:this.wc&&this.Gc?this.Gc[n]:void 0,rotation:this.Cc&&this.Wc?this.Wc[n]:void 0,iSample:r}}Jc(t,e,i,s){const r=this.zc(),n=this.Pc,o=this.Dc;if(!n||!o)return;const h=(t,e)=>({x:n[t],y:o[t],lookupValue:this.bc&&this.Oc?this.Oc[t]:void 0,id:this._c&&this.Yc?this.Yc[t]:void 0,color:this.Mc&&this.Nc?this.Nc[t]:void 0,size:this.wc&&this.Gc?this.Gc[t]:void 0,rotation:this.Cc&&this.Wc?this.Wc[t]:void 0,iSample:e}),a=n.length,l=this.Ac,u=this.gc-1,c=Math.max(u-l+1,0);if(r){const i=this.Zc(),s=this.Ic();if(!(i&&s&&this.Pc&&this.Dc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.Pc:this.Dc,d="x"===o?this.Pc:this.Dc,f=t[n],g=Math.min(i[n],s[n]),y=Math.max(i[n],s[n]);if(fy)return;const m=fo(f,c,u,(t=>l[uo(t,this.gc,a,this.fc)])),p=uo(m,this.gc,a,this.fc);if(!e)return h(p,m);const x=m-1,A=m+1,S=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?A<=u?A:void 0:x>=c?x:void 0;if(void 0===S)return;const v=uo(S,this.gc,a,this.fc),b=l[p],M=d[p],w=l[v],C=d[v],T=Math.min(b,w),R=T===b?M:C,E=Math.max(b,w),k=T===b?m:S,I=(f-T)/(E-T),F=zn(R,E===b?M:C,I);return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:F,iSample:k+I}:{x:F,y:f,iSample:k+I}}let d,f=Number.MAX_VALUE;const g=ct(t,i,s),y=this.Ac-1;for(let t=0;t<=y;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ut(e,i.x,s.x),o=ut(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,co=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=i.length,l=s-1,u=Math.max(l-r+1,0),c=fo(t,u,l,(t=>i[uo(t,s,a)])),d=fo(e,u,l,(t=>i[uo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),y=uo(f,s,a),m=uo(g,s,a);return y>m?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:a-y},{offset:0,count:m+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:m-y+1}]}},fo=(t,e,i,s)=>{const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t{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),mo=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class po extends Vn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ya="label",this.ja=this.Is.Or(this.renderingScale).gr(this.ya).Ie(B).zr(Ie).Vr(Ie),this.setMargin(5),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}De(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ct(t,this.scale,this.renderingScale);return this.ja.Be(i),this}Ls(){this.ja.Ls();const t=0===this.ya.length?u(0,0):this.ja.td();return this.setContentSize(t),super.Ls()}setText(t){return this.ya=t,this.ja.gr(this.ya),this.Is.xs(),this}getText(){return this.ya}setFont(t){return this.ja.jh(t),this.Is.xs(),this}getFont(){return this.ja.Xh()}setTextRotation(t){return this.ja.Zh(t),this.Is.xs(),this}getTextRotation(){return this.ja.Qh()}}const xo={...kn,...Fn,uiElement:po};class Ao extends _n{constructor(t,e,i,s,r){super(t,e,i,s,r),this.sd=!1,this.fitTo=this.Vu.bind(this),this.setSize=this.fitTo,this.ja=this.Is.oc(e).Ie(B).Fe(nt),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}De(){const t=Je([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ct(t,this.scale,this.renderingScale))));return this.sd?this.ja._l([{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.ja._l([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Vu(t){return this.setContentSize(t),this.Is.xs(),this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}}class So extends _n{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ed=u(0,0),this.ja=t.hd(e).lu(0).Ge(360).Ie(B).Fe(nt),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}De(){const t=this.getSize(e.UISpace.Content).x/2;return this.ja.cu(t*this.renderingScale.Wi().x).du(t*this.renderingScale.Wi().y).Be(ct(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).Au(255).Ls(),this}Vu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.ed=t,this.Is.xs(),this}Ou(){return(this.getSize(e.UISpace.Content).x-this.ed.x)/2}Nu(){return(this.getSize(e.UISpace.Content).x-this.ed.x)/2}Wu(){return(this.getSize(e.UISpace.Content).y-this.ed.y)/2}Gu(){return(this.getSize(e.UISpace.Content).y-this.ed.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.ed=t,this}}class vo extends Bn{constructor(t,e,i,s,r){super(t,e,i,cn.Simple,s,r),this.rd=p(u(0,0)),this.nd=!1,this.Is=t,this.ac()}lc(){const t=this.rd.C();if(this.nd){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.rd.C().x*this.rd.C().x/4+this.rd.C().y*this.rd.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=ui(r,ui(i,s)),o=ui(n,ui(s,li(i,-1)));return[r,n,o,ci(o,ui(i,s))]}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}Vu(t){return this.rd._(t),this.nd=!1,this.Is.xs(),this}Ou(){return this.nd?0:(this.getSize(e.UISpace.Content).x-this.rd.C().x)/2}Nu(){return this.nd?0:(this.getSize(e.UISpace.Content).x-this.rd.C().x)/2}Wu(){return this.nd?0:(this.getSize(e.UISpace.Content).y-this.rd.C().y)/2}Gu(){return this.nd?0:(this.getSize(e.UISpace.Content).y-this.rd.C().y)/2}fitTo(t){return this.rd._(t),this.nd=!0,this.Is.xs(),this}}class bo extends Bn{constructor(t,i,s,r,n){super(t,i,s,cn.Simple,r,n),this.od=p(u(0,0)),this.ad=p(10),this.ld=p(void 0),this.ju=p(e.UIDirections.Right),this.ac()}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}setDirection(t){return this.ju._(t),this.Is.xs(),this}getDirection(){return this.ju.C()}setPointerLength(t){return this.ad._(t),this.Is.xs(),this}getPointerLength(){return this.ad.C()}setPointerAngle(t){return this.ld._(t),this.Is.xs(),this}getPointerAngle(){let t=this.ld.C();if(void 0===t){const e=this.ud();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)}Vu(t){return this.od._(t),this.Is.xs(),this}dd(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}fd(){return $t(this.ju.C())?this.od.C().x:this.od.C().y}ud(){return $t(this.ju.C())?this.od.C().y:this.od.C().x}Ou(){switch(this.ju.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.dd()-this.ud());default:return 0}}Nu(){switch(this.ju.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.dd()-this.ud());default:return 0}}Wu(){switch(this.ju.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.dd()-this.ud());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}Gu(){switch(this.ju.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.dd()-this.ud());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}lc(){const t=Kt(this.ju.C()),e=hi(u(0,0),t),i=this.getPointerLength(),s=this.dd(),r=this.fd(),n=this.ud();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ui(ui(o,li(t,-i)),li(e,s/2)),a=ui(h,li(e,(n-s)/2)),l=ui(a,li(t,-r)),c=ui(ui(o,li(t,-i)),li(e,-s/2)),d=ui(c,li(e,-(n-s)/2)),f=ui(d,li(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:It(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Mo extends Vn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Vu.bind(this),this.setSize=this.fitTo,this.Ad=new lo,this.ja=this.Is.md(e).Oe(nt).yd(B).pd(B).gd(this.Ad),this.ku(this.ja)}Lu(){return[this.ja]}setShape(t){return this.ja.vd(t),this}getShape(){return this.ja.Sd()}setRotation(t){return this.ja.xd(t),this}getRotation(){return this.ja.bd()}setFillStyle(t){return this.ja.pd(t),this.Is.xs(),this}getFillStyle(){return this.ja.Md()}De(){const t=ct(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.Ad.clear(),i>0){const e=this.ja.Sd(),s=this.ja.Md(),r=oo(e)&&e,n=Jn(s)&&s;if(r){const t=i/r.oi().y;this.ja._d(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.ja._d(e)}}else this.ja._d(i);this.Ad.appendSample(t)}return this}Vu(t){return this.setContentSize(t),this.Is.xs(),this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}}const wo={...kn,...Fn,uiElement:Mo};class Co extends Pn{setSize(t){return this.setContentSize(t),this.Is.xs(),this}}class To extends bn{constructor(){super(...arguments),this.wd=[],this.Cd=0,this.kd=t=>{const e=this.wd.indexOf(t);e>=0&&this.wd.splice(e,1)}}getMembers(){return this.wd}getMemberCount(){return this.wd.length}setMinimumSize(t){return this.Td=t,this.Is.xs(),this}getMinimumSize(){return this.Td}addElement(t,e=-1){const i=t.tc(this.Is,this.renderingScale,this.scale,this.kd,this.Ki,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.wd.splice(e,0,i):this.wd.push(i),i.setVisible(this.getVisible()),this.ku(i),this.$i&&(pe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.wd.slice().forEach(Et),this}setVisible(t){return super.setVisible(t),this.wd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Co)),0),s=i>0?(this.size.x-this.Cd)/i:0;return this.wd.reduce(((e,i)=>i instanceof Co?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)).De().getPosition(u(1,0)).x),t.x),this}Ls(){for(let t=0;tt+ +(e instanceof Co)),0),s=i>0?(this.size.y-this.Cd)/i:0;return this.wd.reduce(((e,i)=>i instanceof Co?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)).De().getPosition(u(0,-1)).y),t.y),this}Ls(){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=Vo("Text",[]),Bo={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()}},zo={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},No={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()}},Oo={...kn,...In,background:Ao,tc(t,e,i,s,r,n){const o=new Ro(t,e,i,this.background,s,r),h=o.addElement(xo,void 0),a=Object.assign(o,Lo,{setTextLabel:h},_o,{stylableTexts:[h]});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(Tn),Uo={...kn,...In,background:bo,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},tc(t,i,s,r,n,o){const h=this.direction,a=new Ro(t,i,s,this.background,r,n),l=a.addElement(xo,void 0),u=a.getBackground().setDirection(h),c=Object.assign(a,Lo,{setTextLabel:l},_o,{stylableTexts:[l]},No,{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.ic="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))),En(c,n,o),this.applyStylers(c,n)}};class Yo extends vn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Rs=!1,this.R=new r.Eventer,this.Id=B,this.Pd=B,this.getOn=()=>this.Rs,this.Pd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle,this.Dd=this.ku(new Mo(this.Is,this.renderingScale,this.scale,kt,o).setShape(s)).setFillStyle(this.Pd)}Lu(){return[...this.Dd.Lu()]}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setOn(t){return this.Rs=t,this.Dd.setFillStyle(t?this.Id:this.Pd),this.Is.xs(),this}setOffFillStyle(t){return this.Pd="function"==typeof t?t(this.Pd):t,this.Rs||this.Dd.setFillStyle(this.Pd),this}getOffFillStyle(){return this.Pd}setSize(t){return this.Dd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Dd.getSize()}setOnFillStyle(t){return this.Id="function"==typeof t?t(this.Id):t,this.Rs&&this.Dd.setFillStyle(this.Id),this}getOnFillStyle(){return this.Id}setButtonShape(t){return this.Dd.setShape(t),this.Is.xs(),this}getButtonShape(){return this.Dd.getShape()}De(){return super.De(),this.Dd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).De(),this}Ls(){const t=this.Dd.Ls().getSize();return this.setContentSize(t),super.Ls()}dispose(){return super.dispose(),this.Dd.dispose(),this}setMouseInteractions(t){return this.Dd.setMouseInteractions(t),this}getMouseInteractions(){return this.Dd.getMouseInteractions()}setHighlight(t){const e=be(t);return this.Dd.setHighlight(e),this.R.emit("highlight",this,t),this.Is.xs(),this}getHighlight(){return this.Dd.getHighlight()}}const Go={...kn,uiElement:Yo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},tc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return En(o,r,n),o}},Xo={...kn,...In,background:Ao,buttonBuilder:Go,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},tc(t,i,s,r,n,o){const h=new Ro(t,i,s,this.background,r,n),a=h.addElement(Do);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Do);u.addGap();const c=u.addElement(xo);u.addGap(),h.addGap();const d=Object.assign(h,Lo,{setTextLabel:c},_o,{stylableTexts:[c]},Bo,{button:l},zo);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}),En(d,n,o),this.applyStylers(d,n)}}.addStyler(Tn).addStyler(Rn);class Zo extends vn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Bd=[],this.Ld=2,this.Rd="",this.Ed=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Fi(t.value,e.min,e.max),this.zd=0,this.Vd=0,this.Od=!1,this.Is=t,this.Nd=n,this.Gd=this.ku(t.Pe(e).Fe(nt)),this.Wd=this.ku(t.Or(e).Ie(r.uiTextFillStyle).jh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Ud=140,this.Yd=25):(this.Ud=160,this.Yd=15)}Lu(){return[this.Gd,this.Wd]}Hd(t){this.$d=t;const e=jo(t,"vertical"===this.Nd?0:90,this.Od);return this.Gd.Ie(e),this.Is.xs(),this}Xd(){return this.$d}jd(t){return this.Ud=t,this.Is.xs(),this}Zd(){return this.Ud}Qd(t){return this.Yd=t,this.Is.xs(),this}Jd(){return this.Yd}Kd(t){return this.Rd=t,this.Is.xs(),this}qd(){return this.Rd}tf(t){return this.Ed=t,this.Is.xs(),this}setLUTDisplayProportionalSteps(t){if(this.Od=t,this.$d){const t=jo(this.$d,"vertical"===this.Nd?0:90,this.Od);this.Gd.Ie(t)}return this.Is.xs(),this}getLUTDisplayProportionalSteps(){return this.Od}setFillStyle(t){return this.Wd.Ie(t),this.Is.xs(),this}getFillStyle(){return this.Wd.Hh()}setFont(t){return this.Wd.jh(t),this.Is.xs(),this}getFont(){return this.Wd.Xh()}setTextRotation(t){return this.Vd=t,this.Wd.Zh(t),this.Is.xs(),this}getTextRotation(){return this.Wd.Qh()}De(){var t,i,s,r;if(super.De(),this.$i||!this.getVisible())return this;const n=this.$d;if(n){const o=this.renderingScale.Wi(),h=n.min,a=n.max;if("vertical"===this.Nd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ui(s,{x:this.Gd.oi().x+this.Ld*o.x,y:0}),l={x:r.x,y:r.y+(this.Rd.length>0?this.zd*o.y+this.Wd.oi().y:0)+.5*((null===(t=this.Bd[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.Bd[this.Bd.length-1])||void 0===i?void 0:i.oi().y)||0)};this.Gd.Be({x:s.x,y:l.y}),this.Wd.Ya({x:-1,y:-1}).Be(r),n.getSteps().forEach(((t,e)=>{const i=Qe(l,u,this.Od?!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.Bd[e].Ya({x:-1,y:0}).Be(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.Bd.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ui(t,{x:.5*((null===(s=this.Bd[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.Bd[this.Bd.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Rd.length>0?this.zd*o.x+this.Wd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Ld*o.y};this.Gd.Be(f),this.Wd.Ya({x:1,y:1}).Be(c),n.getSteps().forEach(((t,e)=>{const i=Qe(u,d,this.Od?!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.Bd[e].Ya({x:0,y:1}).Be(i)}))}}return this}Ls(){if(this.$d&&this.getVisible()){const t=this.$d.getSteps();for(let e=this.Bd.length;eMath.max(t,e.Ls().td().x)),0),this.Wd.Ls().td().x),s=(this.Rd.length>0?this.zd+this.Wd.Ls().td().y:0)+e+.5*this.Bd[0].Ls().td().y+.5*this.Bd[this.Bd.length-1].Ls().td().y;this.setContentSize({x:i,y:s})}else{const t=this.Ud,e=this.Yd;this.Gd.it({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Rd.length>0?this.zd+this.Wd.Ls().td().x:0,.5*this.Bd[this.Bd.length-1].Ls().td().x),s=t+.5*this.Bd[0].Ls().td().x+i,r=e+this.Ld+this.Bd.reduce(((t,e)=>Math.max(t,e.Ls().td().y)),0);this.setContentSize({x:s,y:r})}}else this.Bd.forEach((t=>t.dispose())),this.Bd.length=0,this.Wd.setVisible(!1),this.Gd.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ls()}dispose(){return super.dispose(),this.Gd.dispose(),this.Bd.forEach(Et),this.Wd.dispose(),this}setMouseInteractions(t){return this.Gd.setMouseInteractions(t),this}getMouseInteractions(){return this.Gd.getMouseInteractions()}}const Ho={lutElement:{},setLUT(t){return this.lutElement.Hd(t),this},getLUT(){return this.lutElement.Xd()},setLUTLength(t){return this.lutElement.jd(t),this},getLUTLength(){return this.lutElement.Zd()},setLUTThickness(t){return this.lutElement.Qd(t),this},getLUTThickness(){return this.lutElement.Jd()},setLookUpUnit(t){return this.lutElement.Kd(t),this},getLookUpUnit(){return this.lutElement.qd()},setLUTStepValueFormatter(t){return this.lutElement.tf(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Wo={...kn,...In,background:Ao,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},tc(t,e,i,s,r,n){const o=new Eo(t,e,i,this.background,s,r),h=o.addElement({tc:()=>new Zo(t,e,i,kt,r,this.alignment)}),a=Object.assign(o,_o,{stylableTexts:[h]},Ho,{lutElement:h});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(Tn),jo=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new it({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 Zo(t,i,s,kt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Lo,{setTextLabel:c},_o,{stylableTexts:[c,d]},Vo("LUTText",[d]),Bo,{button:l},Ho,{lutElement:d},zo);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(Tn).addStyler(Rn),$o={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 na?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.Xd&&t.Xd(),n=t.Fs&&t.Fs(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Ko.setAlignment(this.alignment):Xo;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.if().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof na)).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}},Qo={alignment:"vertical",layoutBuilder:Do,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Po:Do}},getAlignment(){return this.alignment},titleBuilder:Oo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},qo={...kn,...In,...Qo,background:Ao,tc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).tc(t,e,i,s,r,!1);let h=Object.assign(o,$o,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Do:Po),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}),En(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Jo extends vn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.sf=10,this.ef=e.UIDirections.Up,this.hf=0,this.ic="major",this.ya=this.ku(t.Or(this.renderingScale).zr(Ie).Vr(Ie)),this.Ve=this.ku(t.Ne(this.renderingScale))}Lu(){return[this.ya]}De(){if(super.De(),this.$i)return this;const t=ct(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.ef===e.UIDirections.Right?-this.sf:this.ef===e.UIDirections.Left?this.sf:0,y:this.ef===e.UIDirections.Up?-this.sf:this.ef===e.UIDirections.Down?this.sf:0}),s=this.renderingScale.pi(i,{x:this.ef===e.UIDirections.Right?-this.hf:this.ef===e.UIDirections.Left?this.hf:0,y:this.ef===e.UIDirections.Up?-this.hf:this.ef===e.UIDirections.Down?this.hf:0});return this.Ve.We(t).Ge(i),this.ya.Be(s).Ya(this.ef===e.UIDirections.Up?{x:0,y:1}:this.ef===e.UIDirections.Down?{x:0,y:-1}:this.ef===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ls(){const t=this.Ve.pu().getThickness();return this.size=this.ef===e.UIDirections.Left||this.ef===e.UIDirections.Right?{x:this.sf+this.hf+this.ya.Ls().td().x,y:t}:{y:this.sf+this.hf+this.ya.Ls().td().y,x:t},super.Ls()}dispose(){return super.dispose(),this.ya.dispose(),this.Ve.dispose(),this}setVisible(t){return super.setVisible(t),this.ya.setVisible(t),this.Ve.setVisible(t),this}setMouseInteractions(t){return this.ya.setMouseInteractions(t),this.Ve.setMouseInteractions(t),this}getMouseInteractions(){return this.ya.getMouseInteractions()}getText(){return this.ya._r()}setTextFillStyle(t){return this.ya.Ie(t),this.Is.xs(),this}getTextFillStyle(){return this.ya.Hh()}setTextFont(t){return this.ya.jh(t),this}setTextRotation(t){return this.ya.Zh(t),this}getTextRotation(){return this.ya.Qh()}getTextFont(){return this.ya.Xh()}setText(t){return this.ya.gr(t),this.Is.xs(),this}setDirection(t){return this.ef=t,this.Is.xs(),this}getDirection(){return this.ef}setPointerLength(t){return this.sf=t,this.Is.xs(),this}getPointerLength(){return this.sf}setTickLabelPadding(t){return this.hf=t,this.Is.xs(),this}getTickLabelPadding(){return this.hf}setTickStyle(t){return this.Ve.Oe(t),this.Is.xs(),this}getTickStyle(){return this.Ve.pu()}}const th={...kn,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},tc(t,e,i,s,r,n){const o=this.direction,h=new Jo(t,e,i,s,r);return En(h,r,n),h.setDirection(o),this.applyStylers(h,r)}}.addStyler(Tn),eh=th.addStyler(((t,e)=>(t.ic="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)))),ih=th.addStyler(((t,e)=>(t.ic="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)))),sh=Xo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),rh=qo.setAlignment("horizontal"),nh=qo.setAlignment("vertical"),oh={TextBox:Oo,CheckBox:Xo,ButtonBox:sh,PointableTextBox:Uo,AxisTickMajor:eh,AxisTickMinor:ih,LUTRange:Wo},hh={HorizontalLegendBox:rh,VerticalLegendBox:nh},ah=(t,e)=>{var i;return e?"string"==typeof e?`${t} ${e}`:!1!==(null===(i=e.Wh)||void 0===i?void 0:i.displayInCursor)&&e.getUnits()?`${t} ${e.getUnits()}`:t:t},lh=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}},uh=(t,e,i,s=1)=>Ft(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),ch=(t,e,i,s=1)=>{const r=i.ft(t),n=i.ft(e);return Ft(i.dt(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)},dh={rf:0,nf:1,af:2,lf:3,uf:4,cf:5,df:6,ff:7,Af:8,gf:9,pf:10,yf:11,mf:12,vf:13,Sf:14,xf:15,bf:16,Mf:17,_f:18,wf:19,Cf:20,kf:21,Tf:22,Ff:23};class fh extends sr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.If=r}}class gh extends ir{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,m,p,x){var A,S,v;super(d,c,a,m,p,{numeric:c.getWidth({x:m.xAxisNumericTicks,y:m.yAxisNumericTicks}),datetime:c.getWidth({x:m.xAxisDateTimeTicks,y:m.yAxisDateTimeTicks}),time:c.getWidth({x:m.xAxisTimeTicks,y:m.yAxisTimeTicks})},x),this.Pf=new Map,this.Df=void 0,this.Bf=0,this.Lf=[],this.Rf=[],this.hh=Os.fitting,this.Ef=!0,this.zf=8,this.Vf=void 0,this.Of=void 0,this.Nf=20,this.Gf=1,this.Wf=!0,this.Uf=!0,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=!0,this.jf=!0,this.Zf=!0,this.Qf=!0,this.Jf=!0,this.Kf=this.Lh.defaultDragMouseStyle,this.qf=this.Lh.defaultDragMouseStyle,this.tA=this.Lh.defaultDragMouseStyle,this.iA=this.Lh.defaultDragMouseStyle,this.sA=this.Lh.defaultDragMouseStyle,this.R=new r.Eventer,this.eA=[],this.hA=t=>{const e=this.Rf.indexOf(t);e>=0&&this.Rf.splice(e,1)},this.rA=t=>(this.Rf.indexOf(t)<0&&this.Rf.push(t),this.hA),this.nA="center",this.Rt=(t,e)=>this.R.emit("axisAreaTouch",this,e),this.oA=ee(this.eA),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.Ud={relative:1},this.aA=0,this.lA=0,this.uA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().rc()):t,this.cA=t=>{const e=this.Lf.indexOf(t);-1!==e&&this.Lf.splice(e,1)},this.dA=(t,e)=>{this.R.emit("axisAreaDoubleClick",this,e),this.Hf&&(this.setStopped(!1),Qt(e))},this.fA=t=>{this.R.emit("axisAreaMouseEnter",this),(this.Uf||this.Wf||this.Yf||this.Hf)&&this.AA(t)},this.gA=t=>{this.pA(t),this.R.emit("axisAreaMouseLeave",this)},this.yA=(t,e,i)=>{var s,r;this.R.emit("axisAreaMouseDragStart",this,e,i);const n=Pt(null===(s=this.chart.mA.Jn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Pt(null===(r=this.chart.mA.Jn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Uf?(this.vA(t),Qt(e)):i===n&&this.Wf&&(this.SA(t,h),Qt(e))},this.xA=(t,e,i,s,r)=>{var n,o;this.R.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Pt(null===(n=this.chart.mA.Jn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Pt(null===(o=this.chart.mA.Jn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Uf?(this.bA(t,r),Qt(e)):i===h&&this.Wf&&(this.MA(t,s,l,r),Qt(e))},this._A=(t,e,i,s)=>{var r,n;this.R.emit("axisAreaMouseDragStop",this,e,i,s);const o=Pt(null===(r=this.chart.mA.Jn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Pt(null===(n=this.chart.mA.Jn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Uf?(this.wA(t),Qt(e)):i===o&&this.Wf&&(this.CA(t,s,a),Qt(e)),t.getIsUnderMouse()&&(this.Uf||this.Wf||this.Yf||this.Hf)&&this.AA(t)},this.kA=(t,e)=>{if(this.R.emit("axisAreaMouseWheel",this,e),this.Yf){this.setStopped(!0);const t=this.Lh.getWidth(this.TA.ls.Re(e.clientX,e.clientY)),i=this.At.dt(t);this.zoom(i,me(e)),Qt(e)}},this.FA=(t,e)=>this.R.emit("axisAreaMouseClick",this,e),this.IA=(t,e)=>this.R.emit("axisAreaMouseDown",this,e),this.PA=(t,e)=>this.R.emit("axisAreaMouseUp",this,e),this.DA=(t,e)=>this.R.emit("axisAreaMouseMove",this,e),this.BA=(t,e,i)=>{this.R.emit("axisAreaTouchStart",this,i),this.Wf&&(this.AA(t),this.SA(t,e),Qt(i))},this.LA=(t,e,i,s,r)=>{this.R.emit("axisAreaTouch",this,r),this.Wf&&(this.MA(t,e,i,s),Qt(r))},this.RA=(t,e,i,s)=>{this.R.emit("axisAreaTouchEnd",this,s),this.Wf&&(this.CA(t,e,i),this.pA(t),Qt(s))},this.EA=(t,e,i,s)=>{(this.Uf||this.Yf)&&(this.AA(t),this.vA(t),Qt(s))},this.zA=(t,e,i,s,r,n)=>{if(this.Uf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.bA(t,e),Qt(n)}if(this.Yf){const t=this.TA.ls.Re(e.x,e.y),o=this.TA.ls.Re(i.x,i.y),h=Math.abs(this.Lh.getWidth(ci(t,s))-this.Lh.getWidth(ci(o,r)))-Math.abs(this.Lh.getWidth(t)-this.Lh.getWidth(o)),a=this.At.pi(this.Oh,-h),l=this.At.pi(this.Nh,h);this.sr(a,l,!0),Qt(n)}},this.VA=(t,e,i,s)=>{(this.Uf||this.Yf)&&(this.wA(t),this.pA(t),Qt(s))},this.OA=(t,e)=>{(this.$f||this.Xf)&&this.NA(t)},this.GA=(t,e)=>{this.WA(t)},this.UA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.$f&&this.YA(t,s)},this.HA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.$f&&this.$A(t,n,s,r)},this.XA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.$f&&this.jA(t,n,s,r)},this.ZA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.$f||this.Xf)&&this.QA(t,r,s),(this.$f||this.Xf)&&this.NA(t)},this.JA=(t,e)=>{this.Xf&&(this.setStopped(!0),this.zoom(this.Oh,me(e)),Qt(e))},this.KA=(t,e)=>{this.Xf&&(this.setStopped(!0),this.zoom(this.Nh,me(e)),Qt(e))},this.qA=(t,e,i)=>{this.$f&&(this.NA(t),this.YA(t,e),Qt(i))},this.tg=(t,e,i,s,r)=>{this.$f&&(this.$A(t,e,i,s),Qt(r))},this.ig=(t,e,i,s,r)=>{this.$f&&(this.jA(t,e,i,s),Qt(r))},this.sg=(t,e,i,s)=>{this.$f&&(this.QA(t,e,i),this.WA(t),Qt(s))},this.eg=t,this.TA=i,this.hg=n,this.rg=o,this.chart=d,this.ng=g,this.og=s,this.ts=h,"logarithmic"===x.type&&this.chart.ls.Xn(dh.wf),y(this,this.rA),a.ag=this,this.lg=f,this.ug=this.lg>50?1:-1,this.cg=(v=this.Lh.toPoint(0,-this.ug),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.dg=l,this.Ag=this.At instanceof Li?(new Bi).Ri(this.Lh.toVec2(this.At,this.dg)):(new zi).Ri(this.Lh.toVec2(this.At,this.dg)),this.gg=this.chart.pg,this.yg=(new Bi).Ri(this.Lh.toVec2(this.Lh.getWidth(this.gg),this.dg)),this.mg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.vg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.Sg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.xg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.bg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisZoomingBandFillStyle,y:m.yAxisZoomingBandFillStyle})).Fe(c.getWidth({x:m.xAxisZoomingBandStrokeStyle,y:m.yAxisZoomingBandStrokeStyle})),this.Mg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this._g=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.bh=this.og.Or(this.Ag).setMouseInteractions(!1).Zh(this.Lh.getTitleTextRotation(this.ug)).Vr(Ie).zr(Ie),this.chart.ls.os.ns(this.xg,(t=>this.xg.us(t)),{animationEnabled:this.ah}),this.chart.ls.os.ns(this.Mg,(t=>this.Mg.us(t)),{animationEnabled:this.ah}),this.chart.ls.os.ns(this._g,(t=>this._g.us(t)),{animationEnabled:this.ah});const b=ji(new $i(this.BA,this.LA,this.RA,1),new Qi(this.EA,this.zA,this.VA),new Ki(this.dA)),M=ji(new $i(this.qA,this.tg,this.sg)),w=ji(new $i(this.qA,this.ig,this.sg));this.xg.setMouseEnterEventHandler(this.fA).setMouseLeaveEventHandler(this.gA).setMouseDragStartEventHandler(this.yA).setMouseDragEventHandler(this.xA).setMouseDragStopEventHandler(this._A).setMouseWheelEventHandler(this.kA).setMouseDoubleClickEventHandler(this.dA).setMouseClickEventHandler(this.FA).setMouseDownEventHandler(this.IA).setMouseUpEventHandler(this.PA).setMouseMoveEventHandler(this.DA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.Mg.setMouseEnterEventHandler(this.OA).setMouseLeaveEventHandler(this.GA).setMouseDragStartEventHandler(this.UA).setMouseDragEventHandler(this.HA).setMouseDragStopEventHandler(this.ZA).setMouseWheelEventHandler(this.JA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this._g.setMouseEnterEventHandler(this.OA).setMouseLeaveEventHandler(this.GA).setMouseDragStartEventHandler(this.UA).setMouseDragEventHandler(this.XA).setMouseDragStopEventHandler(this.ZA).setMouseWheelEventHandler(this.KA).setTouchStartEventHandler(w.onTouchStart).setTouchMoveEventHandler(w.onTouchMove).setTouchEndEventHandler(w.onTouchEnd),this.mg.Oe(c.getWidth({x:m.xAxisStrokeStyle,y:m.yAxisStrokeStyle})),this.vg.Oe(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.Sg.Oe(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.bh.Ie(c.getWidth({x:m.xAxisTitleFillStyle,y:m.yAxisTitleFillStyle})).jh(c.getWidth({x:m.xAxisTitleFont,y:m.yAxisTitleFont})),this.ss=h.es(this,{}),this.Jh=this.ss.wg([this.bh]).Ss(m.effectsText),this.Cg=null!==(A=c.getWidth({x:m.xAxisMarginAfterTicks,y:m.yAxisMarginAfterTicks}))&&void 0!==A?A:7,this.kg=null!==(S=c.getWidth({x:m.xAxisMarginAfterTitle,y:m.yAxisMarginAfterTitle}))&&void 0!==S?S:7}Rr(){return this.dh}Er(){return void 0!==this.ir}setTickStrategy(t,e){return super.Vh(t,e)}getTickStrategy(){return this.ih}addBand(t=!0){const e=t?this.rg:this.hg,i=new zs(e,this.chart,this.oA,this,this.Ag,this.Lh,this.Ki,this.ts);return this.eA.push(i),i}addConstantLine(t=!0){const e=t?this.rg:this.hg,i=new Ns(e,this.chart,this.oA,this,this.Ag,this.Lh,this.Ki,this.ts);return this.eA.push(i),i}Tg(t){this.eA.forEach(t)}Fg(t){return this.eA.map(t)}getHighlighters(){return this.eA}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Dg(){return this.Rf}mr(t,e){return new fh(e,t,this.TA,this.Ag,this.Ag)}Kh(){if(this.Pf){for(const t of this.Pf)t[1].grid.dispose(),t[1].tick.dispose();this.Pf.clear()}super.Kh()}vr(t,e){const{tickStart:i}=e,s=t.Fh.yr,r=i+s.getTickLength()*this.ug+s.getTickPadding()*this.ug;t.Ke.Be(this.Lh.toPoint(t.M,r)).Ya(this.Lh.toPoint(s.getLabelAlignment(),-this.ug)).Zh(s.labelRotation).setVisible(this.getVisible())}Bg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Fh.yr,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.ug;return{gridStroke:{start:this.Lh.toPoint(t.M,r),end:this.Lh.toPoint(t.M,h)},tickStroke:{start:this.Lh.toPoint(t.M,n),end:this.Lh.toPoint(t.M,a)}}}Dr(t,e){return"linear"===this.Eh.type?uh(t,e,this.At):ch(t,e,this.At)}Lg(t,e){return e instanceof Li?uh:ch}Lr(t,e,i){if("logarithmic"!==this.Eh.type){const s=this.At.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.At;return{min:s.pi(t,-i),max:s.pi(e,i)}}Ls(){if(!this.Xi)return{Rg:0,Eg:0,Yd:0};const t=!(this.sh.size>0),e=this.bh&&this.bh._r().length>0&&this.getTitleFillStyle()!==B,i=this.Lh.getHeight(e?this.chart.ls.Vg.zg(this.bh._r(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.kg:0),s=qs(this.th)?new Map:rr(this.th,Math.min(this.Oh,this.Nh),Math.max(this.Oh,this.Nh),this.Oh,this.Nh,0),r=this.At;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.yr&&void 0!==t.Ar)(i)){const s=Math.max(...e.map((e=>{if(!je(e,this.Oh,this.Nh))return 0;const s=this.chart.ls.Vg.zg(i.Ar(e,r),i.yr.labelFont,i.yr.labelRotation);return t||!s.isEstimate?this.Lh.getHeight(s):0})))+i.yr.tickLength+i.yr.tickPadding;n=Math.max(n,s)}}));const o=this.Lf.reduce(this.uA,0);n=Math.max(n,o),n+=this.Cg;const h=Ft(i+n,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be);return this.Bf=h,{Rg:n,Eg:i,Yd:h}}De(t){const e=this.getVisible()&&t.Og>0;this.Ng=t;const i=this.mg.pu(),s=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart(),n=i.getThickness()*this.ug/2,o=this.dg.getInnerInterval(),h=this.lg/100*o,a=h+t.Gg,l=o*this.ug,u=a+n;if(e||this.Kh(),!qs(this.th)&&e){const t=this.At.ri();this.rr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.sh){let s=this.Pf.get(e);if(!s)if(e.Ue)s={grid:this.eg[0].Wg(this.Ag).setMouseInteractions(!1),tick:this.eg[0].Wg(this.Ag).setMouseInteractions(!1)};else if("Ug"in e){const t=Array.from(this.sh.keys()).filter((t=>"Ug"in t)).reverse().indexOf(e),i=this.eg[t];if(!i)throw new Error("Not enough tick layers. This is an internal LCJS error - if you see this, please contact Arction support.");s={grid:i.Wg(this.Ag).setMouseInteractions(!1),tick:i.Wg(this.Ag).setMouseInteractions(!1)}}if(s){s.grid.Ot(),s.tick.Ot();for(const[e,r]of i){const e=this.Bg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Hr().Yg(e.gridStroke.start,e.gridStroke.end),s.tick.Hr().Yg(e.tickStroke.start,e.tickStroke.end)}s.grid.Oe(e.yr.getGridStrokeStyle()),s.tick.Oe(e.yr.getTickStyle()),this.Pf.set(e,s)}}}const c=u,d=c+this.ug*t.Hg,f=this.$f||this.Xf?Math.min(this.Nf,.25*t.Og):0,g={start:this.Lh.toVec2(this.At.pi(this.At.getInnerStart(),f),c),end:this.Lh.toVec2(this.At.pi(this.At.getInnerEnd(),-f),d)},y=ct(this.Lh.toVec2(this.At.getInnerStart(),d),this.Ag,this.gg),m=ct(g.start,this.Ag,this.gg),p=ct(g.end,this.Ag,this.gg),x=ct(this.Lh.toVec2(this.At.getInnerEnd(),c),this.Ag,this.gg);this.mg.We(this.Lh.toPoint(s,a)).Ge(this.Lh.toPoint(r,a)).setVisible(e),this.vg.We(this.Lh.toPoint(this.At.pi(this.At.getInnerStart(),this.zf),a)).Ge(this.Lh.toPoint(this.At.getInnerStart(),a)).setVisible(e),this.Sg.We(this.Lh.toPoint(this.At.pi(this.At.getInnerEnd(),-this.zf),a)).Ge(this.Lh.toPoint(this.At.getInnerEnd(),a)).setVisible(e);const A=a+t.Rg*this.ug;if(this.bh.Be(this.Lh.toPoint(this.Lh.getWidth(ct("center"===this.nA?li(ui(y,x),.5):"start"===this.nA?y:x,this.gg,this.Ag)),A)).Ya(this.Lh.toPoint("center"===this.nA?0:"start"===this.nA?-1:1,-1*this.ug)).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.Df){const e=this.lg/100*o+t.Gg,i=-this.ug*o-t.Gg,s={start:this.Lh.toVec2(this.Df.min,u+this.ug*this.Bf),end:this.Lh.toVec2(this.Df.max,e+i)},r=ct(s.start,this.Ag,this.gg),n=ct(s.end,this.Ag,this.gg);this.bg.Be(r).it(ci(n,r)).setVisible(!0)}else this.bg.setVisible(!1);this.xg.Be(m).it(ci(p,m)).setVisible(e),this.Mg.Be(y).it(ci(m,y)).setVisible(e),this._g.Be(p).it(ci(x,p)).setVisible(e);for(const i of this.Lf)i.update().plot(e,a,l,t.Gg,u);for(const t of this.eA)t.De()}setLength(t){return this.Ud=t,this.chart.ls.xs(),this}getLength(){return this.Ud}setMargins(t,e){return this.aA=t,this.lA=e,this.chart.ls.xs(),this}getMargins(){return{start:this.aA,end:this.lA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.$g,...this.chart.Xg,...this.chart.jg,...this.chart.Zg].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.$g,...this.chart.Xg,...this.chart.jg,...this.chart.Zg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Qg(){const t=this.Ng;if(!t)return;const e=this.getVisible()&&t.Og>0,i=this.mg.pu().getThickness()*this.ug/2,s=this.dg.getInnerInterval(),r=this.lg/100*s+t.Gg,n=s*this.ug,o=r+i;for(const i of this.Lf)i.update().plot(e,r,n,t.Gg,o);for(const t of this.eA)t.De()}Jg(){return this.Bf}Kg(t,e){e=e||oh.AxisTickMajor;const i=new Cn(this,t?this.eg[0]:this.og,this.og,this.At,this.yg,this.yg,this.Lh,this.cg,this.cA,this.Ki,e).setTextFormatter(this.formatValue);return this.Lf.push(i),i}AA(t){this.chart.ls.os.ws(t,1),this.Vf=t.ls.Qr(this.Kf,this.Vf)}pA(t){this.chart.ls.os.ws(t,0),t.ls.Jr(this.Vf)}vA(t){this.setStopped(!0),t.ls.Jr(this.Vf)}bA(t,e){const i=-this.Lh.getWidth(e);this.pan(i),this.Vf=t.ls.Qr(this.qf,this.Vf)}pan(t){const e=this.Oh,i=this.Nh,s=this.At.pi(e,t),r=this.At.pi(i,t);this.sr(s,r,!1)}zoom(t,e){const i=this.At.ft(this.Oh),s=this.At.ft(this.Nh),r=this.At.ft(t),n=Ft((r-i)/(s-i),0,1),o=.2*this.At.ri(),h=n*this.Gf*o*-e,a=(1-n)*this.Gf*o*e,l=this.At.pi(this.Oh,h),u=this.At.pi(this.Nh,a);this.sr(l,u,!0)}wA(t){this.Df=void 0,t.ls.Jr(this.Vf)}SA(t,e){this.setStopped(!0),t.ls.Jr(this.Vf),this.chart.ls.os.ws(this.xg,0)}MA(t,e,i,s){const r=ct(this.TA.ls.Re(i.x,i.y),this.TA.ls.At,this.Ag),n=Ft(this.Lh.getWidth(r),this.Oh,this.Nh),o=this.Lh.getWidth(ct(this.TA.ls.Re(e.x,e.y),this.TA.ls.At,this.Ag));Math.abs(this.At.ft(n)-this.At.ft(o))>10?(this.Df=y(Math.min(n,o),Math.max(n,o)),this.Vf=t.ls.Qr(this.tA,this.Vf)):(this.Df=void 0,this.Vf=t.ls.Qr(this.Kf,this.Vf)),this.TA.xs()}CA(t,e,i){if(this.Df){const t=this.Df.min,e=this.Df.max,i=this.Nh{e.ps(t)}));for(const e of this.Pf.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.ls.xs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ah),this}}var yh;e.AxisXYTitlePositionOptions=void 0,(yh=e.AxisXYTitlePositionOptions||(e.AxisXYTitlePositionOptions={})).Start="start",yh.Center="center",yh.End="end";const mh={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},ph={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},xh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof gh&&"y"in t&&t.y instanceof gh),Ah=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new Ji,tickLength:7,tickStyle:new Ji,tickPadding:0,labelFont:new lr,labelFillStyle:new U,labelAlignment:0,labelRotation:0});class Sh extends Ah{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 vh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),bh=new Sh({labelFillStyle:B,gridStrokeStyle:nt,tickStyle:nt}),Mh=t=>vh(t)&&z(t.labelFillStyle)&&ot(t.gridStrokeStyle)&&ot(t.tickStyle),wh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new Sh,minorTickStyle:new Sh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ch=(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"},Th={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}${ge(s,2)}:${ge(r,2)}:${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`}},Rh={MajorHours12:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,36e5,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Th.hhmmss},MajorHours:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,6,12)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,3e5,1e6),fitKeyValues:js({},2,4,6)},defaultValueFormatter:Th.hhmmss},MajorMinutes15:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Hs(t,e,9e5,void 0,1e6)),fitKeyValues:js({ignore:"first"},2)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,6e4,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Th.hhmmss},MajorMinutes:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Hs(t,e,6e4,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,5e3,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Th.hhmmss},MajorSeconds15:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Hs(t,e,15e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,1e3,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Th.hhmmss},MajorSeconds:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Hs(t,e,1e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,100,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds100:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Hs(t,e,100,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,10,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds10:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Hs(t,e,10,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,1,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Hs(t,e,1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.1,1e6),fitKeyValues:js({},2)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Hs(t,e,.1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.01,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Hs(t,e,.01,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.001,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Hs(t,e,.001,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,100*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,10*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.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 Eh extends wh{He(t){const e=this.timeOrigin||0,i=[{Ke:"Major ticks",Ug:0,yr:this.majorTickStyle,Ar:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Rh[r].major.format)(t+e,i,s)},Gr:(t,e,i,s)=>{const r=Ch(i,s);return(0,Rh[r].major.getKeyValues)(t,e,i,s)},Ih:{Sr:(t,e,i,s,r,n)=>{const o=Ch(r,n),h=Rh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Wr:void 0}];return vh(this.minorTickStyle)&&i.push({Ke:"Minor ticks",Ug:1,yr:this.minorTickStyle,Ar:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Rh[r].minor.format)(t+e,i,s)},Gr:(t,e,i,s)=>{const r=Ch(i,s);return(0,Rh[r].minor.getKeyValues)(t,e,i,s)},Ih:{Sr:(t,e,i,s,r,n)=>{const o=Ch(r,n),h=Rh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Wr:void 0}),{$e:[],Xe:i,je:this.cursorFormatter||((t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Rh[r].defaultValueFormatter(t+e,i,s)}),Ze:1e-4,Qe: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 kh=(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},Ih=(t,e,i,...s)=>kh(-1,t,e,i,s),Fh=(t,e,i,...s)=>kh(-1,t,e,i,s),Dh=(t,e,i,...s)=>kh(0,t,e,i,s),Ph=(t,e,...i)=>kh(1,t,e,void 0,i),Lh=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},Vh=[{label:"MilliSecond1",unit:1,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"MilliSecond10",unit:10,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("millis",10,(t=>t.millis%10==0),"millis")},majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("millis",100,(t=>t.millis%100==0),"millis")},majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Ks(5,10,15,30)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Ks(5,10,15,30)},minorTicks:{amount:12,fitFunction:js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Ks(3,6,12)},minorTicks:{amount:8,fitFunction:js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:js({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:js({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Lh(-1),getNextKeyValueIncludingRef:Lh(0),getNextKeyValue:Lh(1),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Fh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,3)},minorTicks:{fitFunction:js(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Fh("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:Dh("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:Ph("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Fh("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:Dh("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:Ph("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,4)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Fh("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:Dh("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:Ph("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:Fh("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:Dh("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:Ph("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],_h=(t,e,i,s,r)=>{const n=e-t;let o;for(let t=r?0:Vh.length-1;r?t=0;r?t+=1:t-=1){const e=n/Vh[t].unit;if((void 0===i||e>=i)&&(void 0===s||e<=s)){o=Vh[t];break}}return o},Bh=(t,e,i)=>{let s=_h(e,i,void 0,1,!0);if(void 0!==s&&0===Vh.indexOf(s)&&(s=Vh[1]),void 0===s)return;if("great"===t)return s;const r="major"===t?1:2,n=Vh[Vh.indexOf(s)-r];return void 0===n?Vh[0]:n},zh=(t,e,i)=>(s,r,n,o)=>{const h=Bh("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(Vh.indexOf(h)<=Vh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ws(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Hs(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||je(d,l,u)?[a]:[d]:void 0!==d&&je(d,l,u)?[d]:[u]},Nh=(t,e,i)=>(s,r,n,o)=>{const h=Bh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ws(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Hs(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 Vh[Vh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Zs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Oh=t=>(e,i,s,r,n,o)=>{const h=Bh(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},Uh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new Sh,majorTickStyle:new Sh,minorTickStyle:new Sh,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),Th.hhmmssmmm(t-e.getTime())},formatMillisecondRange:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Th.hhmmssmmm(t-e.getTime())},formatOptionsGreatSecond:{},formatOptionsMajorMilliSecond:{}});class Yh extends Uh{He(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Vh.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]},`;wt.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=Bh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=It(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[Vh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ke:"Great ticks (directive)",Ug:0,Ye:!0,Gr:Nh("great",e,this.utc),Wr:void 0},{Ke:"Major ticks",Ug:1,yr:this.majorTickStyle,Ar:n("major"),Gr:Nh("major",e,this.utc),Ih:{Sr:Oh("major")},Wr:void 0}];Mh(this.greatTickStyle)||(o.push({Ke:"Great ticks (left)",yr:this.greatTickStyle.setLabelAlignment(-1),Ar:n("great","left"),Gr:zh(e,this.utc,"left"),Ue:!0,wr:!1}),o.push({Ke:"Great ticks (right)",yr:this.greatTickStyle.setLabelAlignment(1),Ar:n("great","right"),Gr:zh(e,this.utc,"right"),Ue:!0,wr:!1})),Mh(this.minorTickStyle)||h.push({Ke:"Minor ticks",Ug:2,yr:this.minorTickStyle,Ar:n("minor"),Gr:Nh("minor",e,this.utc),Ih:{Sr:Oh("minor"),Ph:(t,e,i,s,r,n)=>{const o=Bh("minor",r,n);return!o||"Week"!==o.label}},Wr:void 0});const a=this.cursorFormatter;return{$e:o,Xe:h,je:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=_h(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?Th.hhmmssmmm:Th.hhmmss;return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric"}).format(o)} ${a(o.getTime()-h.getTime())}`},Ze:1,Qe: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 Gh=(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 Hs(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,Zs(i,s,o,h)},Xh=(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,Zh=(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,Hh=js(void 0,2,5),Wh=(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,jh=(t,e)=>{const i=Ti(t),s=Ri(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&&sDi.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),n=[],o=[];Mh(this.extremeTickStyle)||n.push({Ke:"Extreme ticks",yr:this.extremeTickStyle,Ar:void 0===e?i:(t,s,r)=>i(e+t,s,r),Gr:Xs,Ue:!0,wr:!0}),o.push({Ke:"Major ticks",Ug:0,yr:this.majorTickStyle,Ar:void 0===e?s:(t,i,r)=>s(e+t,i,r),Gr:"logarithmic"===t.type?jh(t.base,!0):Gh(0,!0),Ih:"logarithmic"===t.type?{Sr:Zh}:{Sr:Xh},Wr:void 0}),Mh(this.minorTickStyle)||o.push({Ke:"Minor ticks",Ug:1,yr:this.minorTickStyle,Ar:void 0===e?r:(t,i,s)=>r(e+t,i,s),Gr:"logarithmic"===t.type?jh(t.base,!1):Gh(1,!1),Ih:"logarithmic"===t.type?{Sr:Wh}:{Sr:Hh},Wr:50});const h=this.cursorFormatter?this.cursorFormatter:Di.Numeric;return{$e:n,Xe:o,je:void 0===e?h:(t,i,s)=>h(e+t,i,s),Ze:1e-9,Qe: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!==bh?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 Qh=(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(wt.navigator.msSaveBlob)wt.navigator.msSaveBlob(r,e);else{const t=wt.document.createElement("a");wt.document.body.appendChild(t);const i=wt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{wt.URL.revokeObjectURL(i),wt.document.body.removeChild(t)}),0)}},qh=(t,i,s,r,n,o)=>{const h=t.tc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},Jh=(t,e)=>{if("relative"===t)return e;if(t instanceof _i)return t;const i=t.x instanceof ir?t.x.At:t.x.x,s=t.y instanceof ir?t.y.At:t.y.y;return Ni(i,s)},ta=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=xh(o)?o:Yi(o)?s:void 0;if(h&&Oi(i)){const t=ct(n,h,r.At);return r.Oo({engineX:t.x,engineY:t.y})}if(h&&Yi(i))return ct(n,h,s);if(h&&xh(i))return ct(n,h,i)}else{const i=t;if(Yi(e)){const t=r.Vo(i);return ct({x:t.engineX,y:t.engineY},r.At,s)}if(xh(e)){const t=e,s=r.Vo(i);return ct({x:s.engineX,y:s.engineY},r.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class ea{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.qg=[],this.tp=[],this.R=new r.Eventer,this.ip=void 0,this.sp=void 0,this.ep=void 0,this.Xt=x(0,0,0,0),this.hp=!1,this.$i=!1,this.rp=()=>{this.np=!0,this.op.xs()},this.ap=t=>e=>{const i=this.qg.indexOf(e);-1!==i&&this.qg.splice(i,1),this.ls.xs(),t.Y()},this.lp=t=>{const e=this.tp.indexOf(t);-1!==e&&this.tp.splice(e,1),this.ls.xs()},this.np=!0,this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.mA=t,this.up=i,this.op=s,this.removePanel=n,this.Ki=e.ls.Ki;const l=e.ls.oi();if(this.uiScale=i.d2({scaleXYConstructor:Bi}).Vi(0,100).Oi(0,100).it(l),this.pg=i.d2({scaleXYConstructor:Bi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(l),this.engine=e.ls.cp,this.ls=e.ls.dp,this.ss=this.ls.ss.es(this,{}),this.fp=()=>e.Ap("unidentified ui"),this.gp=e.pp(),this.yp=this.op.Pe(this.uiScale).Be(u(0,0)).it(u(100,100)).Ie(o).Fe(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.rp);this.mp=()=>a.off(t)}else{const t=e.ls.Do(this.rp);this.vp=e.ls.Bo.bind(e.ls,t)}const c=e.ls.Ro((t=>{this.hp=t,this.R.emit("inViewChange",this,t)}));this.Sp=e.ls.Eo.bind(e.ls,c),this.ip=n}getTheme(){return this.Ki}getSizePixels(){return this.pg.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.yp.Ie(t),this.op.xs(),this}getBackgroundFillStyle(){return this.yp.Hh()}setBackgroundStrokeStyle(t){return this.yp.Fe(t),this.op.xs(),this}getBackgroundStrokeStyle(){return this.yp.po()}translateCoordinate(t,e,i){return ta(t,e,i,this.pg,this.ls)}xp(t){return this.qg.push(t),this.ls.xs(),t}bp(t){return this.tp.push(t),this.ls.xs(),t}addUIElement(t=Oo,e=this.uiScale){e=Jh(e,this.pg);const i=this.fp();return this.xp(qh(t,i,this.uiScale,e,this.ap(i),this.Ki))}addLegendBox(t=qo,i=this.uiScale){i=Jh(i,this.pg);const s=this.bp(qh(t,this.gp,this.uiScale,i,this.lp,this.Ki));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Es.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Es.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.tp}dispose(){return this.$i||(this.$i=!0,this.vp&&this.vp(),this.mp&&this.mp(),ia(this.uiScale),ia(this.pg),this.Sp&&this.Sp(),this.sp&&this.sp(),this.op.Y(),this.gp.Y(),this.qg.slice().forEach((t=>{t.dispose()})),this.tp.slice().forEach((t=>{t.dispose()})),this.ls.xs(),this.ip&&this.ip(this),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}saveToFile(t,e,i){return Qh(this.engine,t,e,i),this}zr(t){this.Xt=t,this.rp()}J(){return this.pg.J(),this.uiScale.J(),this}K(){return this.pg.K(),this.uiScale.K(),this}De(t){if(this.np){const t=this.op.ls.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.pg.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.pg.Vi(0,n.x).Ei(s).Oi(0,n.y).zi(r),this.R.emit("resize",this,n.x,n.y,e,i)}this.np=!1}Mp(){for(let t=0;t{t.ii&&t.ii()};class sa extends ea{constructor(t,e,i,s,r,n){super(t,e,i,e.wp("uipanel bg",0),s,e.ls.Ki.uiPanelBackgroundFillStyle,e.ls.Ki.uiPanelBackgroundStrokeStyle,n),this._p(r,this.pg)}setMinimumSize(t){return this.Td=t,this.ls.xs(),this}getMinimumSize(){return this.Td}De(t){super.De(t),super.Mp()}}const ra=x(10,10,10,10);class na extends ea{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Cp={},this.wa=ra,this.ah=!0,this.kp=e.Tp("chart internal ui",0),this.mh=this.kp.Or(this.uiScale).gr("Chart").Be(u(50,100)).Ya(u(0,1)).jh(h).Ie(a).setMouseInteractions(!1),this.Fp=this.ss.wg([this.mh]).Ss(this.Ki.effectsText)}setAnimationsEnabled(t){return this.ah=t,this}getAnimationsEnabled(){return this.ah}setTitle(t){return this.mh.gr(t),this.ls.xs(),this}getTitle(){return this.mh._r()}getTitleSize(){return this.mh.Ls().td()}setTitleFillStyle(t){return this.mh.Ie(t),this.rp(),this}getTitleFillStyle(){return this.mh.Hh()}setTitleFont(t){return this.mh.jh(t),this.rp(),this}getTitleFont(){return this.mh.Xh()}setTitleRotation(t){return this.mh.Zh(t),this.ls.xs(),this}getTitleRotation(){return this.mh.Qh()}setTitleEffect(t){return this.Fp.Ss(t),this.ls.xs(),this}getTitleEffect(){return this.Fp.bs()}setTitleMargin(t){var e,i;return this.Cp="object"==typeof t?this.Cp?(e=this.Cp,{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.rp(),this}getTitleMargin(){return this.Cp}setPadding(t){return this.wa="object"==typeof t?S(this.wa,t):{left:t,top:t,right:t,bottom:t},this.rp(),this}getPadding(){return this.wa}Ip(t){const e=t.Pp(),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.kp.Y(),this}}const oa={Dp:(t,e)=>t.Hh()!==B&&0!==t._r().length&&t.getVisible()?t.Ls().td().y:0,Bp(t,e){t.Be(u(50,100)).zr({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}},ha=t=>"show-all-interpolated"===t||"show-nearest-interpolated"===t||"show-pointed-interpolated"===t,aa=(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},la=(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&&y?m.De(...y):t.ls.xs())},i=()=>{t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},r=()=>{f=!1,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},n=()=>{f=!0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},o=()=>{t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},h=()=>{f=!1,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())};s.onSeriesBackgroundMouseEnter(e),s.onSeriesBackgroundMouseMove(i),s.onSeriesBackgroundMouseLeave(r),s.onSeriesBackgroundTouchStart(n),s.onSeriesBackgroundTouchMove(o),s.onSeriesBackgroundTouchEnd(h),s.Lp(((e,i)=>{i.onMouseEnter(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()})),i.onMouseMove(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()})),i.onMouseLeave((()=>{i.getCursorEnabled()?(a=void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()}))}))}let y;const m={setCursor:e=>(e(i),t),getCursor:()=>i,setCursorMode:e=>(u=e,t.ls.xs(),t),getCursorMode:()=>u,setCustomCursor:t=>{l=t},onCursorTargetChanged:t=>g.on("cursorTargetChanged",t),offCursorTargetChanged:t=>{g.off(t)},setCursorFormatting:e=>(c=e,t.ls.xs(),t),getCursorFormatting:()=>c,Y:()=>{i.dispose(),e.Y()},De:(e,s,r,n)=>{y=[e,s,r,n];const o=t.ls.Hn();let m=[];if((null==n?void 0:n.explicitTarget)&&u)m=[n.explicitTarget];else if(!e&&u){const t=s.find((t=>t.getIsUnderMouse())),e=o&&t&&t.getCursorEnabled&&t.getCursorEnabled()&&t.ys?t.ys(o):void 0;if(a=e||a,a&&"show-all"!==u&&"show-all-interpolated"!==u)m=[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.getCursorEnabled&&!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,o,u);e&&m.push(e)}"show-nearest"!==u&&"show-nearest-interpolated"!==u||(m.sort(((t,e)=>h(t,o)-h(e,o))),m.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&&(m=[e])}}m=ve(m.map((t=>Le(t))));const p=(null==n?void 0:n.overrideCursorPositions)||((t,e)=>e),x=m[0],A=m.length>0?m:void 0;if(x!==d&&o&&(l&&l(x,A,o),g.emit("cursorTargetChanged",x,A,o),d=x),l)i.getVisible()&&(i.setVisible(!1),i.Ls().De());else{if(m&&m.length>0){const e=c(t,m[0],m);i.setVisible(!0).setPosition(...p(m,m.map((t=>t.cursorPosition)))).setResultTable((t=>t.setContent(e)))}else i.setVisible(!1);(null==n?void 0:n.afterCursorPointedAt)&&n.afterCursorPointedAt(m),i.Ls().De()}},solveNearest:(e,i,s,r)=>{const n=e||t.ls.Hn();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=ve(o.map((t=>Le(t)))),o},Rp:i};return m};class ua{constructor(t,e){this.Ep=t,this.zp=e}alter(t){this.Vp=void 0!==this.Vp?this.Vp:this.zp(),this.Op=t,this.Ep(t)}resetValue(){void 0!==this.Op&&(void 0!==this.Vp&&this.isAltered()&&this.Ep(this.Vp),this.Vp=void 0,this.Op=void 0)}getNormalValue(){return void 0!==this.Vp?this.Vp:this.zp()}isAltered(){return void 0!==this.Op&&this.zp()===this.Op}}class ca{constructor(t,e){this.Np=[],this.Gp=t,this.At=e}update(){return this.Gp.getVisible()?!(this.Wp()&&(!this.Yp()||(this.resetTable(),this.Gp.Ls(),this.Wp()))&&(this.Hp(),this.Gp.Ls(),this.Wp()&&(this.resetTable(),this.Gp.Ls(),1))):(this.Yp()&&this.resetTable(),!0)}Yp(){for(let t=0;t{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Gp,this.At)}$p(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Gp,this.At)}Xp(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Gp,this.At)}jp(t){return this.Np.push(t),t}}class da extends ca{constructor(){super(...arguments),this._a=this.jp(new ua((t=>this.Gp.setOrigin(t)),(()=>this.Gp.getOrigin())))}Hp(){const t=this._a.getNormalValue(),e=u(this.$p()?-t.x:t.x,this.Xp()?-t.y:t.y);this._a.alter(e)}}class fa extends ca{constructor(t,e,i,s){super(t,e),this.Zp=this.jp(new ua((t=>this.Gp.setTextFont((e=>e.setSize(t)))),(()=>this.Gp.getTextFont().getSize()))),this.Qp=i,this.Jp=s}Hp(){const t=this.Zp.getNormalValue(),e=this.Qp;if(enew da(t,e),FontSize:(t=5,e=5)=>(i,s)=>new fa(i,s,t,e)},ya={None:Ln,Rectangle:Ao,Circle:So,Diamond:vo,Pointer:bo};class ma extends Io{constructor(){super(...arguments),this.Hu=this.Ki.cursorResultTableTextFont,this.Vd=0,this.Kp=this.Ki.cursorResultTableTextFillStyle}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.Hu.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];void 0!==i&&t.set(e,i)}return t})):this.Hu,e=l||this.Kp,i=f[o];if(u){let s;i&&i instanceof po?s=i:(i&&i.dispose(),s=n.addElement(xo,o)),s.setFont(t).setFillStyle(e).setText(u).setTextRotation(this.Vd)}else if(c){let s;i&&i instanceof Mo?s=i:(i&&i.dispose(),s=n.addElement(wo,o)),s.setFillStyle(e).setShape(c).setSize({y:t.size,x:t.size}),s.setMargin(5)}else if(d){let t;i&&"setTextFillStyleHidden"in(r=i)&&"setText"in r?t=i:(i&&i.dispose(),t=n.addElement(Xo.setBackground(ya.None),o).setOn(!0));const e=d.Fs();void 0!==e&&t.setButtonShape(e),t.setText(d.getName()),d.styleLegendEntry(t)}}else{const t=f[o];t&&t instanceof Co||(t&&t.dispose(),n.addGap(void 0,o))}}}}var r;return this.Is.xs(),this}setTextFillStyle(t){this.Kp="function"==typeof t?t(this.Kp):t;for(let t=0;tt.setFillStyle(o.cursorResultTableFillStyle).setStrokeStyle(o.cursorResultTableStrokeStyle))).setTextFillStyle(o.cursorResultTableTextFillStyle).setTextFont(o.cursorResultTableTextFont),this.oy=ga.Flip(this.Gp,this.scale)}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setPointMarkerVisible(t){return this.iy=t,this.ty.forEach((e=>e.pointMarker.setVisible(e.targetVisible&&t))),this.Is.xs(),this}getPointMarkerVisible(){return this.iy}setPointMarker(t){return this.ty.forEach((e=>t(e.pointMarker))),this.ey.push(t),this.Is.xs(),this}setResultTableVisible(t){return this.sy=t,this.Is.xs(),this}getResultTableVisible(){return this.sy}setResultTable(t){return t(this.Gp),this.Is.xs(),this}setAutoFitStrategy(t){return this.oy&&this.oy.resetTable(),this.oy=t?t(this.Gp,this.Is.ls.At):void 0,this.Is.xs(),this}getAutoFitStrategy(){return void 0!==this.oy}setVisible(t){return this.Xi=t,this.Is.xs(),this}getVisible(){return this.Xi}dispose(){return this.ty.forEach((t=>t.pointMarker.dispose())),this.Gp.dispose(),this.ey.length=0,this.hy(this),this.R.emit("dispose"),this}De(){return this.oy&&this.oy.update(),this.Gp.setVisible(this.hp&&this.Xi&&this.sy),this.ty.forEach((t=>t.pointMarker.setVisible(t.targetVisible&&this.hp&&this.Xi&&this.iy))),this.ty.forEach((t=>t.pointMarker.De())),this.Gp.De(),this}Ls(){return this.ty.forEach((t=>t.pointMarker.Ls())),this.Gp.Ls(),this}ly(t,e){const i=e===this.scale?t:ct(t,e,this.scale);this.Gp.setPosition(i)}}const xa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5)));class Aa extends pa{constructor(){super(...arguments),this.ma={x:0,y:0}}setPosition(t){const e=this.renderingScale,i=Jh(t.resultTableScale,e),s=i===this.scale?t.resultTable:ct(t.resultTable,i,this.scale),r=Jh(t.pointMarkerScale,e),n=r===this.scale?t.pointMarker:ct(t.pointMarker,r,this.scale);this.ma=n;let o=this.ty[0];if(!o){const t=new Mo(this.Is,this.renderingScale,this.scale,kt,this.Ki).setMouseInteractions(!1).setFillStyle(this.Ki.cursorPointMarkerFillStyle).setSize(this.Ki.cursorPointMarkerSize).setShape(this.Ki.cursorPointMarkerShape);o={pointMarker:t,targetVisible:!0},this.ty.push(o),this.ey.forEach((e=>e(t)))}return o.pointMarker.setPosition(n),this.Gp.setPosition(s),this.Is.xs(),this}Ls(){return super.Ls(),this.hp=((t,e,i=e)=>{const s=e!==i?ct(t,e,i):t;return s.x>=i.x.getInnerStart()&&s.x<=i.x.getInnerEnd()&&s.y>=i.y.getInnerStart()&&s.y<=i.y.getInnerEnd()})(this.ma,this.scale),this}}class Sa{constructor(t,e=[]){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new Sa(this.ny,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new Sa(t,this.uy.map((t=>t))),this.gy=(t,e,i,s,r)=>this.Ay(new Aa(t,e,i,s,this.ny,r),r),this.ny=t,this.uy=e}}const va=new Sa(Ao,[xa]),ba=new Sa(bo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof bo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Ma=va,wa=va,Ca=va,Ta=ba,Ra=new Sa(Ao,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Es.LeftBottom)))]);var Ea;e.SliceLabelIndices=void 0,(Ea=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Ea.LabelsInsideSlices=0]="LabelsInsideSlices",Ea[Ea.LabelsOnSides=1]="LabelsOnSides";const ka={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},Ia={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Fa extends Zi{constructor(){super(...arguments),this._s="Slice",this.M=0}}const Da=(t,e)=>{Qt(e),t.setExploded(!t.getExploded())};class Pa extends Fa{}class La extends Pa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.py=!1,this.yy=B,this.my=B,this.vy=this.M,this.Sy=this.py?1:0,this.xy=this.getVisible(),this.by=K((()=>this.chart.ls.xs())),this.My=K((()=>this.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.Cy=()=>{this.ky=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.Ty=e.hd(r).us(this.getHighlight()),this.ds(this.Ty),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0}),this.onMouseClick(Da),this.onTouchEnd(Da)}setValue(t){return this.chart.getAnimationsEnabled()?this.xy&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setExploded(t){if(t&&!1===this.chart.getMultipleSliceExplosion()){const t=this.chart.getSlices();for(let e=0;e{this.Sy=t,this.chart.ls.xs()})),this.ky.onEveryAnimationEnd(this.Cy),this.py=!this.py):!1!==this.chart.getMultipleSliceExplosion()||t?(this.Sy=this.py?0:1,this.py=!this.py):(this.Sy=0,this.py=!this.py),this.chart.ls.xs(),this}getExploded(){return this.py}setVisible(t){return this.xy=t,!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.yy=t,this.my=i,this.Ty.Ie(this.yy).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;tui(e,li(Si(.5*(t.eu()+t.Ti())*Math.PI/180),i)),_a=(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.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Yy=e.Hy("pieChart bottom",0),this.$y=e.Hy("pieChart top",1),this.mh.gr("Pie Chart"),this._p(r,this.pg),this.onBackgroundMouseDoubleClick(Ba);const h=ji(new Ki(Ba));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd);const a=e.Xy(),l=Pt(o?o.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Na,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new La(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);this.zy+=1,i.setName(t);const s=this.ah;return this.ah=!1,i.setValue(e),this.ah=s,i.setEffect(this.Ny),this.Zy(i),this.Iy.push(i),this.Uy(),i.setHighlightOnHover(this.Ly),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){this.Ey="function"==typeof t?t(this.Ey):t;for(let t=0;te.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);if(this.$d){const t=this.$d;this.Iy.forEach((e=>{this.Zy(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Iy[t].Ty.setVisible(e),this.Iy[t].Ke.setVisible(e)}this.Iy=this.Iy.sort(this.Py);const r=this.Iy.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.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e=this.Dy(t.index,t)){t.setStyle(e,this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return super.dispose(),this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.$y.Y(),this.Yy.Y(),this}}const Na=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],Oa={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ua=(...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 Ya extends za{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Qy=Ia.NamePlusValue,this.Ky=[],this.qy=40,this.tm=5,this.im=10,this.sm=this.Ki.pieChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),this.Ky.forEach((t=>t.setVisible(!1)))}else{_a(t,e,i,u,this.Ql,a);let s=90;const r=t.map(((t,r)=>{const h=360*e[r],a=s-h,l=Si(xi(.5*(s+a))),c=l.x>=0?-1:1,d=ui(ui(i,li(l,u+n)),{x:c*-o,y:0});s=a;const f={x:c,y:0};t.Ke.Be(d).Ya(f),t.Ke.Ls();const g=Je(t.Ke.Je());return{position:d,alignment:f,shape:t.Ke,boundaries:g,sliceAngleVec:l,slice:t}})),l=[];for(let t=0;t{const s=t.slice.Ty,r=Va(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=pi(t.position.y,r,i),o=t.position;this.hm([r,n,o])}))}}getMinimumSize(){return u(500,300)}hm(t){let e;for(let t=0;t{if(ts(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?dr:new gr({size:e,fillStyle:i,shape:"sphere"})}return dr};class Ha{constructor(t,e,i,s,n,o,h,a,l,u){this.R=new r.Eventer,this.M=0,this.Xi=!0,this.$i=!1,this.xs=t,this.om=e,this.am=i,this.lm=s,this.um=n,this.dm=o,this.Vd=h,this.Kp=a,this.fm=l,this.sc=u}setValue(t){return t===this.M||(this.M=t,this.xs(),this.R.emit("valueChange",this,this.M)),this}getValue(){return this.M}setTickStyle(t){return this.am="function"==typeof t?t(this.am):t,this.xs(),this}getTickStyle(){return this.am}setTickLength(t){return this.lm=t,this.xs(),this}getTickLength(){return this.lm}setGridStrokeStyle(t){return this.um="function"==typeof t?t(this.um):t,this.xs(),this}getGridStrokeStyle(){return this.um}setTextPadding(t){return this.dm=t,this.xs(),this}getTextPadding(){return this.dm}setTextRotation(t){return this.Vd=t,this.xs(),this}getTextRotation(){return this.Vd}setTextFillStyle(t){return this.Kp="function"==typeof t?t(this.Kp):t,this.xs(),this}getTextFillStyle(){return this.Kp}setTextFont(t){return this.fm="function"==typeof t?t(this.fm):t,this.xs(),this}getTextFont(){return this.fm}setTextFormatter(t){return this.sc=t,this.xs(),this}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.om(),this.xs(),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.R.emit("visibleStateChanged",this,this.Xi),this.xs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Wa extends Ha{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.Am=u,this.gm=c,this.wa=d}setBackgroundFillStyle(t){return this.Am="function"==typeof t?t(this.Am):t,this.xs(),this}getBackgroundFillStyle(){return this.Am}setBackgroundStrokeStyle(t){return this.gm="function"==typeof t?t(this.gm):t,this.xs(),this}getBackgroundStrokeStyle(){return this.gm}setPadding(t){return this.wa="number"==typeof t?{left:t,top:t,right:t,bottom:t}:{...this.wa,...t},this.xs(),this}getPadding(){return this.wa}}class ja{constructor(t,e,i,s){this.pm=[],this.ym=new Map,this.vm=t,this.Sm=e,this.xm=i,this.bm=s}Mm(){this.xm&&this.xm();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.pm.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.vm(),this.pm.push(e));const n=[],o=e._m().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Sm(e,n,t.sharedProperties);i=he(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.kd(t)}))})),s.forEach((t=>{t.dispose();const e=this.pm.indexOf(t);e<0?pe(0,(()=>{})):this.pm.splice(e,1)})),r.forEach((t=>{const e=this.ym.get(t.Xo);e&&t.collection.ls.oo({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.ym.clear(),r.forEach((t=>{this.ym.set(t.Xo,t)})),this.bm&&this.bm(this.pm,i)}}}wm(){this.pm.forEach((t=>{t.dispose()})),this.pm.length=0}}class Ka{constructor(t){this.Cm=[],this.km=t}Mm(){return this.Tm(),{add:()=>this.al(),finishPlot:()=>{this.Fm()}}}al(){let t=this.Cm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.km()},this.Cm.push(t)),t.isFree=!1,t.shape}Tm(){this.Cm.forEach((t=>{t.isFree=!0}))}Fm(){this.Cm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Cm.splice(this.Cm.indexOf(t),1)}))}wm(){this.Cm.forEach((t=>t.shape.dispose())),this.Cm.length=0}}class $a extends ir{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Im({x:t.ls.Ki.xAxis3DNumericTicks,y:t.ls.Ki.yAxis3DNumericTicks,z:t.ls.Ki.zAxis3DNumericTicks}),datetime:e.Im({x:t.ls.Ki.xAxis3DDateTimeTicks,y:t.ls.Ki.yAxis3DDateTimeTicks,z:t.ls.Ki.zAxis3DDateTimeTicks}),time:e.Im({x:t.ls.Ki.xAxis3DTimeTicks,y:t.ls.Ki.yAxis3DTimeTicks,z:t.ls.Ki.zAxis3DTimeTicks})},{type:"linear"}),this.Lf=[],this.Pm=()=>{},this.Dm=()=>{},this.Bm=()=>{},this.Lm=()=>{},this.chart=t,this.Rm=r,this.Em=n,this.zm=o,this.Vm=this.Rm.At;const l=this.Lh.Im({x:this.Ki.xAxis3DStrokeStyle,y:this.Ki.yAxis3DStrokeStyle,z:this.Ki.zAxis3DStrokeStyle});this.Om=this.Rm.rm([Oa.InternalUI]).Oe(l).Nm(Za(l)).setMouseInteractions(!1),this.bh=this.Em.Or(this.zm).setMouseInteractions(!1).Ie(e.Im({x:t.ls.Ki.xAxis3DTitleFillStyle,y:t.ls.Ki.yAxis3DTitleFillStyle,z:t.ls.Ki.zAxis3DTitleFillStyle})).jh(e.Im({x:t.ls.Ki.xAxis3DTitleFont,y:t.ls.Ki.yAxis3DTitleFont,z:t.ls.Ki.zAxis3DTitleFont})).ra(3),this.Gm=new Ka((()=>this.Em.Or(this.zm).ra(2).Vr(Ie).zr(Ie))),this.Wm=new ja((()=>this.Em.Um(this.zm).setMouseInteractions(!1).ra(1)),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((({positions:e,existingMember:i})=>{const s=i||t.Hr();return s._l(e),s}))))),this.Ym=new ja((()=>this.Rm.Wg().setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Oe(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.dl(e)))))),this.ss=a,this.Jh=this.ss.wg([this.bh]).Ss(s.effectsText),this.Om.setMouseEnterEventHandler(this.Pm).setMouseLeaveEventHandler(this.Dm).setMouseDragEventHandler(this.Bm).setMouseDragStopEventHandler(this.Lm),i.ag=this}setTickStrategy(t,e){return super.Vh(t,e)}getTickStrategy(){return this.ih}addCustomTick(){const t=new Wa((()=>this.chart.ls.xs()),(()=>{const e=this.Lf.indexOf(t);e>=0&&this.Lf.splice(e,1)}),this.Ki.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.tickLength,this.Ki.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)),B,nt,{left:4,right:4,top:4,bottom:4});return this.Lf.push(t),this.chart.ls.xs(),t}setStrokeStyle(t){return this.Om.Oe(t).Nm(Za(this.Om.pu())),this.chart.ls.xs(),this}getStrokeStyle(){return this.Om.pu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Om.setVisible(t),!1===t&&(this.Ym.wm(),this.Gm.wm(),this.Wm.wm()),this.Rm.xs(),this}Dg(){return this.chart.getSeries()}Hm(t){return Math.abs(this.At.st(t)*this.Rm.$m(1))}Lr(t,e,i){const s=Math.abs(this.At.st(e-t)*this.Rm.$m(1));return{min:t-i*s,max:e+i*s}}mr(t,e){const i=new Qa(e,t,this.Em,this.zm,this.Rm);return i.Ke.ra(0),i}vr(t,e){const i=this.Xm(e,t.M,t.Fh.yr.tickLength,t.Fh.yr.tickPadding);return t.Ke.Be(i.labelPosition).Ya(i.labelAlignment),i}Xm(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=_e.addVec(qe(n,o,l),_e.multiplyVec(_e.multiply(h,this.Rm.$m(.5*this.Om.pu().getThickness())),r)),d=_e.addVec(c,_e.multiplyVec(_e.multiply(h,this.Rm.$m(i)),r)),f=this.Rm.jm(d)||u(0,0);return{labelPosition:ui(ct(f,this.chart.ls.At,this.zm),li(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Zm(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=_e.addVec(qe(r,n,h),_e.multiplyVec(_e.multiply(o,this.Rm.$m(.5*this.Om.pu().getThickness())),s)),l=_e.addVec(a,_e.multiplyVec(_e.multiply(o,this.Rm.$m(10)),s)),c=this.Rm.jm(a)||u(0,0),d=this.Rm.jm(l)||u(0,0);return this.Em.Ne(this.zm).We(c).Ge(d).Oe(new Ji({fillStyle:new U({color:T(120*i)}),thickness:1}))}Dr(t,e){return qa(t,e,this.At)}De(t){if(!this.Xi)return;const e=Math.min(this.Oh,this.Nh),i=Math.max(this.Oh,this.Nh),s=this.Vm,r=f(s.x.rt(),s.y.rt(),s.z.rt());let n,o;this.Qm()?(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.Lh.Jm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Lh.ef,a=this.Rm.jm(n)||u(0,0),l=this.Rm.jm(o)||u(0,0),c=qe(n,o,.5),d=_e.addVec(c,_e.multiplyVec(_e.multiply(h,-1),r)),g=this.Rm.jm(c)||u(0,0),y=this.Rm.jm(d)||u(0,0),m=oi(ci(ct(g,this.chart.ls.At,this.zm),ct(y,this.chart.ls.At,this.zm)));this.Om.Ot().dl([n,o]);const{gridlinePositionA:p,gridlinePositionB:x,gridlinePositionC:A}=this.Lh.Km(t),S=t=>({x:-1===t.x?this.Vm.x.getInnerStart():1===t.x?this.Vm.x.getInnerEnd():0,y:-1===t.y?this.Vm.y.getInnerStart():1===t.y?this.Vm.y.getInnerEnd():0,z:-1===t.z?this.Vm.z.getInnerStart():1===t.z?this.Vm.z.getInnerEnd():0}),v=S(p),b=S(x),M=S(A),w={physicalAxisSize:ai(ci(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},C=this.rr(w),T=this.Ym.Mm();for(const[t,e]of this.sh)for(const[,i]of e){const e=C.get(i);if(!e)continue;const s=this.qm(w,e);T.add({Xo:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.yr.tickStyle}),s.gridStroke&&T.add({Xo:0,positions:s.gridStroke},{lineStyle:t.yr.gridStrokeStyle})}const R=this.Gm.Mm(),E=this.Wm.Mm(),k={x:0,y:0};this.Lf.forEach((t=>{if(!t.Xi||t.Mi)return;const s=this.Xm(w,t.M,t.lm,t.dm),r=this.qm(w,s);if(t.Kp!==B){const e=R.add().Be(s.labelPosition).Ya(s.labelAlignment).Ie(t.Kp).jh(t.fm).gr(t.sc(t.M)).Zh(t.Vd),i=e.Ls().oi();if(k.x=Math.max(k.x,i.x),k.y=Math.max(k.y,i.y),t.Am!==B){const i=e.Je(),s=[{x:i[0].x-t.wa.left,y:i[0].y+t.wa.top},{x:i[1].x+t.wa.right,y:i[1].y+t.wa.top},{x:i[2].x+t.wa.right,y:i[2].y-t.wa.bottom},{x:i[3].x-t.wa.left,y:i[3].y-t.wa.bottom}];E.add({Xo:0,positions:s},{fillStyle:t.Am,strokeStyle:t.gm})}}T.add({Xo:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.am}),r.gridStroke&&T.add({Xo:0,positions:r.gridStroke},{lineStyle:t.um})})),R.finishPlot(),E.finishPlot(),T.finishPlot();const I=this.Mr(((t,e)=>{const i=e.Ke.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:k.x,y:k.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.bh.Ya({x:0,y:0}).Zh(180*-F/Math.PI);const D=_e.addVec(c,_e.multiplyVec(_e.multiply(h,this.Rm.$m(.5*this.Om.pu().getThickness()+this.Cr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),P=this.Rm.jm(D)||u(0,0),L=ui(ct(P,this.chart.ls.At,this.zm),ui(ui(di(I,m),li(m,this.Cr(((t,e)=>Math.max(t)),0))),di(li(this.bh.Ls().oi(),.5),m)));this.bh.Be(L),this.Om.tv={overrideFollowing:!1,skipMousePicking:!1}}qm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return It(h,0)||It(h,1)||(a=[this.sv()?{...i,x:n.x}:this.ev()?{...i,y:n.y}:this.Qm()?{...i,z:n.z}:{x:0,y:0,z:0},this.sv()?{...s,x:n.x}:this.ev()?{...s,y:n.y}:this.Qm()?{...s,z:n.z}:{x:0,y:0,z:0},this.sv()?{...r,x:n.x}:this.ev()?{...r,y:n.y}:this.Qm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Kh(){super.Kh(),this.Ym.wm(),this.Gm.wm(),this.Wm.wm()}sv(){return this.Lh.sv()}ev(){return this.Lh.ev()}Qm(){return this.Lh.Qm()}}class Qa extends sr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.hv=r}}const qa=(t,e,i)=>Ft(t+.1*(e-t)+Math.abs(i.rt())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Ja=(t,e,i,s)=>({kr:()=>{const i=t();let s;for(const t of i){if(!t.rv())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},Tr:()=>{const e=t();let s;for(const t of e){if(!t.rv())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Ir:()=>{const e=t();let i;for(const t of e){if(!t.rv())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),tl=t=>({...Ja(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Ir().y)),Im:t=>t.y,Jm:(t,e)=>({x:e.x,y:t.y,z:e.z}),ef:f(-1,0,0),Km: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)}},sv:()=>!1,ev:()=>!0,Qm:()=>!1}),el=t=>({...Ja(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Ir().z)),Im:t=>t.z,Jm:(t,e)=>({x:e.x,y:e.y,z:t.z}),ef:f(1,0,0),Km: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)}},sv:()=>!1,ev:()=>!1,Qm:()=>!0});class il extends Zi{constructor(t,e,i,s,r){super(t,e,s,r),this.nv=jn,this.ov=!0,this.av=!0,this.lv=!0,this.chart=t,this.Rm=i,this.qi=new Map,this.onMouseWheel(this.chart.uv),this.onMouseDrag(this.chart.cv),this.onMouseDragStop(this.chart.dv),this.onTouchStart(this.chart.fv.onTouchStart),this.onTouchMove(this.chart.fv.onTouchMove),this.onTouchEnd(this.chart.fv.onTouchEnd)}Qi(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.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ()}}setCursorEnabled(t){return this.ov=t,this}getCursorEnabled(){return this.ov}setCursorFormattingOverride(t){return this.Av=t,this}getCursorFormattingOverride(){return this.Av}setAutoScrollingEnabled(t){return this.av=t,this.chart.ls.xs(),this}getAutoScrollingEnabled(){return this.av}setColorShadingStyle(t){return this.nv=t,this.qi.forEach(((e,i)=>i.gv(t))),this.Rm.xs(),this}getColorShadingStyle(){return this.nv}setDepthTestEnabled(t){return this.lv=t,this.qi.forEach(((e,i)=>i.pv(t))),this.Rm.xs(),this}getDepthTestEnabled(){return this.lv}yv(){}De(){}bm(){}getXMax(){const t=this.ja;return t?t.St():void 0}getXMin(){const t=this.ja;return t?t.vt():void 0}getYMax(){const t=this.ja;return t?t.bt():void 0}getYMin(){const t=this.ja;return t?t.xt():void 0}getZMax(){const t=this.ja;return t?t.mv():void 0}getZMin(){const t=this.ja;return t?t.vv():void 0}Ir(){const t=this.ja;return t?f(t.Cl(),t.kl(),t.Sv()):f(0,0,0)}}class sl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Box Series 3D",this.xv=.25,this.bv=!1,this.Xd=()=>de(this.we),this.we=ye(this.Ki.boxSeries3DFillStyle,r),this.ja=this.Rm._v().pv(this.lv).Ie(this.we).Mv(this.xv).us(this.getHighlight()),this.ds(this.ja)}invalidateData(t){const e=t.length;if(0===e)return this;this.bv&&this.chart.ls.Xn(dh.Cf);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;ide(this.gu.getFillStyle())}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.ja.Oe(e),this.Rm.xs(),this}getStrokeStyle(){return this.gu}add(t){return this.bv&&this.chart.ls.Xn(dh.Cf),this.bv=!0,(t=Array.isArray(t)?t:[t])?(this.ja.dl(t.slice()),this.Rm.xs(),this):this}clear(){return this.ja.Ot(),this}getPointAmount(){const t=this.ja;return t.fl()+t.Al()}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}}class nl extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Line Series 3D",this.gu=ye(s.lineSeries3DStrokeStyle,r),this.Cv=Ir.pointStyle3D,this.kv(this.gu),this.ja=this.Rm.rm([Oa.UserSeries]).pv(this.lv).Oe(this.gu).Nm(this.Cv).us(this.getHighlight()),this.ds(this.ja)}setStrokeStyle(t){super.setStrokeStyle(t),this.kv(this.gu);const e=this.Cv;return this.ja.Nm(e),this}kv(t){const e=new Ar.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Cv=e}}class ol extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Point Line Series 3D",this.Xd=()=>de(this.gu.getFillStyle())||de(this.Cv.getFillStyle()),this.Cv=ye(s.pointLineSeries3DPointStyle,r),this.gu=ye(s.lineSeries3DStrokeStyle,r),this.Tv(),this.ja=this.Rm.rm([Oa.UserSeries]).pv(this.lv).Oe(this.gu).Nm(this.Cv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){return this.Cv="function"==typeof t?t(this.Cv):t,this.Tv(),this.ja.Nm(this.Cv),this.Rm.xs(),this}getPointStyle(){return this.Cv}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.gu,i=Math.abs(e.getThickness()),s=this.Cv,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.Cv=s.setSize(i)),this.Tv();const n=this.Cv;return this.ja.Nm(n),this.Rm.xs(),this}Tv(){const t=this.Cv,e=t.getSize();this.Cv=t.setSize(e)}Le(t,e){t.us(e),this.Rm.xs()}}class hl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.bv=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.chart.ls.Xn(dh.kf)}add(t){return this.bv&&this.chart.ls.Xn(dh.Cf),this.bv=!0,(t=Array.isArray(t)?t:[t])?(this.ja.dl(t.slice()),this.Rm.xs(),this):this}clear(){return this.ja.Ot(),this}getPointAmount(){const t=this.ja;return t.fl()+t.Al()}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{point3D:this.Fv})}}class al extends hl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Series 3D",this.Xd=()=>de(this.Fv.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.chart.getSeries().length;this.Fv=ye(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.ja=this.Rm.Pv(h).pv(this.lv).Iv(this.Fv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){this.Fv="function"==typeof t?t(this.Fv):t;const e=this.Fv;return this.ja.Iv(e),this.Rm.xs(),this}getPointStyle(){return this.Fv}}class ll extends hl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Cloud Series 3D",this.Xd=()=>de(this.Fv.getFillStyle());const o=this.chart.getSeries().length;this.Fv=ye(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.ja=this.Rm.Pv(h).Iv(this.Fv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){this.Fv="function"==typeof t?t(this.Fv):t;const e=this.Fv;return this.ja.Iv(e),this.Rm.xs(),this}getPointStyle(){return this.Fv}}const ul={Triangulated:al,Pixelated:ll};class cl extends na{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Dv=[],this.Bv=0,this.Lv=t=>{const e=this.Dv.indexOf(t);e>=0&&(this.Dv.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.Rv=this.ss.wg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Dv.forEach((e=>e.setAnimationHighlight(t))),this}Ev(t,e){this.Rv.fs([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.zv.Ie(t),this.ls.xs(),this}getSeriesBackgroundFillStyle(){return this.zv.Hh()}setSeriesBackgroundStrokeStyle(t){return this.Vv.Fe(t),this.ls.xs(),this}getSeriesBackgroundStrokeStyle(){return this.Vv.po()}setSeriesBackgroundEffect(t){return this.Rv.Ss(t),this.ls.xs(),this}getSeriesBackgroundEffect(){return this.Rv.bs()}Ov(t){this.Dv.push(t),void 0!==this.Nv&&t.setHighlightOnHover(this.Nv),this.R.emit("seriesAdded",this,t)}if(){return this.Dv}setSeriesHighlightOnHover(t){return this.Nv=t,this.Dv.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Dv.slice().forEach(Et),super.dispose()}Lp(t){return this.R.on("seriesAdded",t)}Gv(t){return this.R.off(t)}Wv(t){return this.R.on("seriesDispose",t)}Uv(t){return this.R.off(t)}}const dl=_e.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class fl{constructor(t,e,i,s){this.Yv=!0,this.Hv=!0,this.$v=2*-Math.PI/2160,this.Xv=2*Math.PI/2160,this.jv=.1,this.Zv=1*Math.PI/180,this.Qv=t,this.Jv=e,this.Kv=i,this.jm=s}getDefaultCameraConfiguration(t){const e={direction:dl,location:_e.multiply(dl,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:e.direction,cameraLocation:e.location})||e}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.qv(i,t):"wheel-zoom"===t.type?i=this.tS(i,t):"rotate+zoom"===t.type?i=this.iS(i,t):"fixed-rotate"===t.type?i=this.sS(i,t):"move"===t.type&&(i=this.eS(i,t))})),this.Yv?i=this.hS(t.boundingBox,i):this.Hv&&(i=this.rS(t.boundingBox,i)),i}qv(t,e){const{rotation:i}=e,s=t.location,r=_e.multiply(_e.normalize(t.location),-1),{Right:n,Up:o}=this.nS(r);let h=s;const a=this.oS(r),l=i.x*this.$v*a;h=_e.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Xv,a-this.Zv);return 0!==u&&(h=_e.rotateAroundAxis(h,n,u)),{location:h,direction:_e.multiply(_e.normalize(h),-1)}}tS(t,e){const{deltaY:i}=e;this.Yv&&this.aS(!1);const s=t.location,r=_e.multiply(_e.normalize(s),-1),n=i*this.jv,o=_e.length(s)*-n;return{direction:r,location:_e.addVec(s,_e.multiply(r,o))}}iS(t,e){const{rotation:i,cameraDistance:s}=e;this.Yv&&this.aS(!1);let r=this.qv(t,{type:"rotate",rotation:i});const n=r.location,o=_e.multiply(_e.normalize(n),-1),h=_e.multiply(o,-s);return r={direction:_e.multiply(_e.normalize(h),-1),location:h},r}sS(t,e){this.Yv&&this.aS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.nS(r),h=i.x*this.$v;let a=_e.normalize(_e.rotateAroundAxis(r,o,h));const l=i.y*this.Xv;return a=_e.normalize(_e.rotateAroundAxis(a,n,l)),{location:s,direction:a}}eS(t,e){this.Yv&&this.aS(!1),this.Hv=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.nS(n);return{location:_e.addVec(r,_e.multiply(n,.01*s),_e.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};return this.Yv?this.hS(t.boundingBox,e):this.rS(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};return this.Yv?this.hS(t.boundingBox,e):this.rS(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};if(this.Yv)return this.hS(t.boundingBox,e)}hS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.lS(t,s,100,20,1,i,5);const r=this.oS(s.direction);return s=this.uS(s,this.cS(t,s,100,1),r),s}lS(t,e,i,s,r,n,o){return gl(n,o,(t=>({direction:e.direction,location:_e.multiply(e.direction,-t)})),(e=>this.dS(t,e)),i,r,"linear",s)}cS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.nS(e.direction),a=this.fS(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:_e.normalize(_e.lerp(l.direction,h,t))})),(e=>this.AS(t,e)),0,u,!0,i):yl(0,c,(t=>({location:l.location,direction:_e.normalize(_e.lerp(l.direction,o,t))})),(e=>this.AS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:_e.normalize(_e.lerp(l.direction,n,t))})),(e=>this.gS(t,e)),0,u,!0,i):yl(0,c,(t=>({location:l.location,direction:_e.normalize(_e.lerp(l.direction,r,t))})),(e=>this.gS(t,e)),0,u,!0,i)),l}dS(t,e){const i=this.fS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}gS(t,e){const i=this.fS(t,!1,e);return Math.abs(i.left-i.right)}AS(t,e){const i=this.fS(t,!1,e);return Math.abs(i.top-i.bottom)}fS(t,e,i){const s=Je(this.pS(t,e,i).map((t=>ct(t,this.Qv,this.Jv))));return{left:s.min.x,right:this.Jv.x.getInnerEnd()-s.max.x,top:this.Jv.y.getInnerEnd()-s.max.y,bottom:s.min.y}}pS(t,e,i){const s=this.Kv,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.jm(t,i))).filter((t=>void 0!==t))}rS(t,e){const i=_e.length(e.location),s=this.yS(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)de(this.we),this.nv=Hn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.we=ye(this.Ki.surfaceGridSeries3DFillStyle,o),this.SS=ye(this.Ki.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Qn=h,this.ja=this.Rm.bS(h).Ie(this.we).xS(this.SS).gv(this.nv).us(this.getHighlight()),this.ds(this.ja),this.setHighlightOnHover(!1)}Qi(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.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(this.we)?this.we.lut:void 0}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}MS(){const t=this.vS.start||{x:0,z:0};let e;e=this.vS.end?{x:(this.vS.end.x-t.x)/this.Qn.columns,z:(this.vS.end.z-t.z)/this.Qn.rows}:this.vS.step?this.vS.step:{x:1,z:1},this.ja._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.ja.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.ja.wS().step}setEnd(t){return this.vS.end=t,this.MS(),this}getEnd(){return this.ja.wS().end}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.ja.Ie(this.we),this.Rm.xs(),this}getFillStyle(){return this.we}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.ja.xS(this.SS),this.Rm.xs(),this}getWireframeStyle(){return this.ja.CS()}setIntensityInterpolation(t){return t=t||"disabled",this.ja.kS(t),this.Rm.xs(),this}getIntensityInterpolation(){return this.ja.TS()}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),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.Qn.dataOrder?t.length:t[0].length,rows:"rows"===this.Qn.dataOrder?t.length:t[0].length},i="columns"===this.Qn.dataOrder?this.Qn.columns:this.Qn.rows,s="columns"===this.Qn.dataOrder?this.Qn.rows:this.Qn.columns;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.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.`;wt.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.mA.Kn){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.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.`;wt.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;ede(this.we),this.chart.ls.Xn(dh.Cf),this.nv=Hn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.we=ye(this.Ki.surfaceScrollingGridSeries3DFillStyle,o),this.SS=ye(this.Ki.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Qn=h,this.ja=this.Rm.BS(h).Ie(this.we).xS(this.SS).gv(this.nv).us(this.getHighlight()),this.ds(this.ja),this.setHighlightOnHover(!1)}Qi(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.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(this.we)?this.we.lut:void 0}}MS(){const t=this.vS.start||{x:0,z:0};let e;e=this.vS.step?this.vS.step:{x:1,z:1},this.ja._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.ja.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.ja.wS().step}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.ja.Ie(this.we),this.Rm.xs(),this}getFillStyle(){return this.we}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.ja.xS(this.SS),this.Rm.xs(),this}getWireframeStyle(){return this.ja.CS()}setIntensityInterpolation(t){return t=t||"disabled",this.ja.kS(t),this.Rm.xs(),this}getIntensityInterpolation(){return this.ja.TS()}clear(){return this.ja.Ot(),this.Rm.xs(),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.Qn.scrollDimension?this.Qn.rows:this.Qn.columns;if(i>s-1){if(!0===this.chart.mA.Kn){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Qn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.chart.mA.Kn){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Qn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.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.ja.LS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Rm.xs(),this}setCullMode(t){return this.ja.PS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.ja.DS()}yv(){}De(){}bm(){}rv(){return this.av&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}const xl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof wl),Al=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 Sl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Mesh Model 3D",this.RS=new Float32Array,this.At={x:1,y:1,z:1},this.ES={x:0,y:0,z:0},this.zS={x:0,y:0,z:0},this.VS={x:0,y:0,z:0},this.OS={x:0,y:0,z:0},this.Ka=Oe,this.Xd=()=>de(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.chart.getSeries().length;this.ja=this.Rm.NS().pv(this.lv).Ie(ye(this.Ki.meshModel3DFillStyle||this.Ki.pointSeriesFillStyle,o)).us(this.getHighlight()),this.ds(this.ja)}Qi(t,e){const i=this.getFillStyle();return Pe({series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(i)?i.lut:void 0},{cursorPosition:0,index:0,x:0,y:0,z:0,value:0},(()=>{const s=this.ja.GS(t,e);if(s)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,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:H(i)?i.lut:void 0}}))}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=ze,n=Be,o=ze,h=Be,a=ze,l=Be;for(let t=0;te(t)))}return r.pointMarker.setPosition(s),this.chart.ls.xs(),this}}class bl{constructor(t,e){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new bl(this.ny,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new bl(t,this.uy.map((t=>t))),this.gy=(t,e,i,s,r,n)=>this.Ay(new vl(t,e,i,s,this.ny,r,n),r),this.ny=t,this.uy=e}}const Ml=new bl(Ao,[(t,e)=>{xa(t)}]);class wl extends cl{constructor(t,e,i,s,r,n,o){var h;super(t,e,i,e.wp("chart3D bg",0),s,e.ls.Ki.chart3DBackgroundFillStyle,e.ls.Ki.chart3DBackgroundStrokeStyle,e.ls.Ki.chart3DTitleFont,e.ls.Ki.chart3DTitleFillStyle,n),this.qS=1,this.tx=[],this.ix=2,this.sx=!0,this.hx=!0,this.nx=!0,this.ox=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.gn=[],this.Mn=()=>{const t=this.Rm.lx();this.Ax.ux(t),this.gx.ux(t);const e=this.yx.viewportChanged(this.mx());e&&this.vx(e),this.ls.xs()},this.Sx=!1,this.cv=(t,e,i,s,r)=>{if(this.Sx=!0,this.nx){const t=r;this.tx.push({type:"rotate",rotation:t}),this.ls.xs(),Qt(e)}},this.dv=(t,e,i,s,r)=>{this.Sx=!1},this.uv=(t,e)=>{if(this.hx){if(this.sx)Math.sign(this.ox)!==Math.sign(e.deltaY)?this.ox=me(e):this.ox+=me(e);else{const t=me(e);this.tx.push({type:"wheel-zoom",deltaY:t})}this.ls.xs(),Qt(e)}},this.ls.Xn(dh.mf),this.mh.gr("Chart3D"),this.xx=i.d3(),this.xx.x.q(-1,1),this.xx.y.q(-1,1),this.xx.z.q(-1,1),this.Rm=e.bx("chart3D layer3D",0,this.xx),this.Ax=e.Mx("chart3D series bg",0),this.gx=e.Hy("chart3D axis ui",1),this._x={x:new $a(this,(h=()=>this.Dv,{...Ja(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Ir().x)),Im:t=>t.x,Jm:(t,e)=>({x:t.x,y:e.y,z:e.z}),ef:f(0,-1,0),Km: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)}},sv:()=>!0,ev:()=>!1,Qm:()=>!1}),this.xx.x,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss),y:new $a(this,tl((()=>this.Dv)),this.xx.y,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss),z:new $a(this,el((()=>this.Dv)),this.xx.z,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss)},this.wx=this.Rm.rm([Oa.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.Ki.chart3DBoundingBoxStrokeStyle),this.zv=this.Ax.oc(this.ls.At,cn.Simple).Ie(this.Ki.chart3DSeriesBackgroundFillStyle).Fe(nt).setMouseInteractions(!0),this.Vv=this.Ax.oc(this.ls.At,cn.Simple).Ie(B).Fe(this.Ki.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.Cx({x:1,y:1,z:1},!0),this.yx=new fl(this.ls.At,this.pg,this.xx,((t,e)=>(e&&this.vx(e),this.Rm.jm(t)))),this.kx=this.yx.getDefaultCameraConfiguration(this.Tx(this.Fx)),this.vx(this.kx);const a=Pt(o?o.cursorBuilder:void 0,Ml),l=e.Xy();let c;this.jy=la(this,l,a.gy(l,this.pg,this.pg,kt,this.Ki,this),this,"show-pointed",Cl,(()=>0)),this.fv=ji(new Qi(((t,e,i)=>{c={locationOne:e,locationTwo:i,cameraLocation:this.Rm.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.nx&&!this.hx)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=_e.length(c.cameraLocation),l=o/h*a,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.tx.push({type:"rotate+zoom",rotation:this.nx?d:{x:0,y:0},cameraDistance:this.hx?l:a}),this.ls.xs(),Qt(n)}),(t=>{})),new $i((t=>{}),((t,e,i,s,r)=>{if(this.nx){const t=s;this.tx.push({type:"rotate",rotation:t}),this.ls.xs(),Qt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.fv.onTouchStart),this.onBackgroundTouchMove(this.fv.onTouchMove),this.onBackgroundTouchEnd(this.fv.onTouchEnd),this.onSeriesBackgroundTouchStart(this.fv.onTouchStart),this.onSeriesBackgroundTouchMove(this.fv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.fv.onTouchEnd),this.onBackgroundMouseDrag(this.cv),this.onBackgroundMouseDragStop(this.dv),this.onBackgroundMouseWheel(this.uv),this.onBackgroundMouseDown(((t,e)=>{Qt(e)})),this.onSeriesBackgroundMouseDrag(this.cv),this.onSeriesBackgroundMouseDragStop(this.dv),this.onSeriesBackgroundMouseWheel(this.uv),this.onSeriesBackgroundMouseDown(((t,e)=>{Qt(e)})),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.Mn),this.Mn(),this._p(r,this.pg)}setProjection(t){this.Rm.Ix(t);const e=this.yx.viewportChanged(this.mx());return e&&this.vx(e),this.ls.xs(),this}getProjection(){return this.Rm.Px()}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ml){const e=this.fp(),i=t.gy(e,this.pg,this.pg,this.ap(e),this.Ki,this);return this.xp(i),i}addPointSeries(t){const e=new(t&&t.type||al)(this,this.Lv,this.Rm,this.Ki,this.ls.ss,t);return this.Ov(e),e}addLineSeries(t){const e=new nl(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointLineSeries(t){const e=new ol(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addSurfaceGridSeries(t){const e=new ml(this,this.Lv,this.Rm,t,this.Ki,this.ls.ss);return this.Ov(e),e}addSurfaceScrollingGridSeries(t){const e=new pl(this,this.Lv,this.Rm,t,this.Ki,this.ls.ss);return this.Ov(e),e}addBoxSeries(t){const e=new sl(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addMeshModel(t){const e=new Sl(this,this.Lv,this.Rm,this.Ki,t,this.ls.ss);return this.Ov(e),e}translateCoordinate(t,e,i){if(xl(e)||xl(i)||Al(t)){if(xl(e)&&xl(i)&&Al(t)){if("axes"===e.id&&"world"===i.id)return this.Rm.Dx(t);if("world"===e.id&&"axes"===i.id)return this.Rm.Bx(t);if(e.id===i.id)return t}if(xl(e)&&Oi(i)&&Al(t)){const e=this.Rm.jm(t);return e?this.ls.Oo({engineX:e.x,engineY:e.y}):{clientX:-1,clientY:-1}}if(xl(e)&&Yi(i)&&Al(t)){const e=this.Rm.jm(t);return e?ct(e,this.ls.At,this.pg):{clientX:-1,clientY:-1}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return ta(t,e,i,this.pg,this.ls)}getDefaultAxisX(){return this._x.x}getDefaultAxisY(){return this._x.y}getDefaultAxisZ(){return this._x.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._x.x,this._x.y,this._x.z]}setCameraLocation(t){let e={location:t,direction:_e.normalize(_e.multiply(t,-1))};const i=this.yx.cameraLocationChanged(this.mx(e));return i&&(e=i),this.vx(e),this.ls.xs(),this}getCameraLocation(){return this.Rm.getCameraLocation()}getCameraDirection(){return this.Rm.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.yx.aS(t);const e=this.yx.cameraLocationChanged(this.mx());return e&&this.vx(e),this}getCameraAutomaticFittingEnabled(){return this.yx.mS()}onCameraChange(t){return this.R.on("cameraChange",t)}offCameraChange(t){return this.R.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.wx.Oe(t).Nm(Za(this.wx.pu())),this.Rm.xs(),this}getBoundingBoxStrokeStyle(){return this.wx.pu()}setBoundingBox(t){return this.Cx(t,!1),this}Cx(t,e){this.Fx=t;const i=this.Tx(t);if(this.xx.x.it(i.x),this.xx.y.it(i.y),this.xx.z.it(-i.z),!e){const t=this.yx.boundingBoxChanged(this.mx());t&&this.vx(t)}this.ls.xs()}getBoundingBox(){return this.Fx}De(t){if(oa.Bp(this.mh,this.Cp),0!==this.ox){const e=this.ox*t*.006;this.tx.push({type:"wheel-zoom",deltaY:e}),this.ox=Math.sign(this.ox)*Math.max(Math.abs(this.ox)-.01*t,0),0!==this.ox&&this.ls.xs(!0)}const e=this.getCameraDirection();if(this.tx.length>0){const t=this.yx.applyCameraInteractions(this.mx(),this.tx);t&&this.vx(t),this.tx.length=0}this.Lx&&_e.equals(this.Lx.location,this.kx.location)&&_e.equals(this.Lx.direction,this.kx.direction)||this.R.emit("cameraChange",this,this.getCameraLocation()),this.Lx=this.kx,super.De(t);for(let t=0;tthis.Rm.jm(t))),o=this.Rm.jm(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=oe(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.gn.length=0,this.xx.Y(),this.Rm.Y(),this.gx.Y(),this.Ax.Y(),this.jy.Y(),super.dispose()}J(){return this.xx.x.J(),this.xx.y.J(),this.xx.z.J(),super.J()}K(){return super.K()}vx(t){this.Rm.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(_e.addVec(t.location,_e.multiply(t.direction,-this.ix))),this.kx=t,this.ls.xs()}Tx(t){return _e.divide(t,_e.length(t)/this.qS)}mx(t=this.kx){return{boundingBox:this.Tx(this.Fx),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.hx=t,this}getMouseInteractionZoom(){return this.hx}setMouseInteractionRotate(t){return this.nx=t,this}getMouseInteractionRotate(){return this.nx}forEachAxis(t){return t(this._x.x),t(this._x.y),t(this._x.z),this}getSeries(){return this.Dv}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 Cl=(t,e,i)=>{var s,r;return gt(e)?aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:ah(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:ah(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):mt(e)?aa(e,[[e.series],void 0!==e.value?["Value","",{text:ah(e.value.toFixed(2),null===(r=e.lut)||void 0===r?void 0:r.units),font:{weight:"bold"}}]:[]]):aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:ah(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}]])},Tl={Column:Do,Row:Po};class Rl extends sa{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Rx=new Map,this.Ex=this.addUIElement(Tl.Row).setPosition({x:0,y:100}).setOrigin(Es.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(nt)))}add(t,e){return(t instanceof na?[t]:t instanceof vf?t.getCells().filter((t=>t.panel instanceof na)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Ex.addElement(hh.VerticalLegendBox).setBackground((t=>t.setFillStyle(B).setStrokeStyle(nt))).add(t,e).setTitle(t.getTitle());this.Rx.set(t,i)})),this.ls.xs(),this}setLegendBoxes(t){return this.Rx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Ex.getSize()}}const El={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},kl=(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(),Il=(t,e)=>{let i=e.geometry;return i=Fl(t,e,i),i=Dl(t,e,i),i},Fl=(t,e,i)=>{if(t===El.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===El.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=Je(Dt(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.Ux&&wt.setTimeout((()=>t())),e},this.onViewChange=t=>this.R.on("viewChange",t),this.Yx=(t,e,i,s,r)=>{this.At.x.it(s).si([this.Xt.left+this.wa.left,this.Xt.right+this.wa.right]),this.At.y.it(r).si([this.Xt.bottom+this.wa.bottom,this.Xt.top+this.wa.top+oa.Dp(this.mh,this.Cp)]),this.Hx&&this.$x(this.Xx,this.At,this.Hx)},this._t=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Zx(s),Qt(t)),this.Gx&&this.ls.os.ws(r,!0),this.Qx=r,this.R.emit("mouseEnter",this,t,s))},this.wt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;this.Jx(),r&&(this.Gx&&this.ls.os.ws(r,!1),this.Qx=void 0,this.R.emit("mouseLeave",this,t,s),t&&Qt(t))},this.It=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Zx(s),Qt(t)),this.Qx=r,this.R.emit("mouseMove",this,t,s))},this.Ct=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseClick",this,t,s)},this.kt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseDoubleClick",this,t,s)},this.Tt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseDown",this,t,s)},this.Ft=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseUp",this,t,s)},this.Dt=(t,e,i)=>{const s=i;if(!s||!this.Ux)return;const r=this.jx(this.Ux,s);this.R.emit("mouseDragStart",this,t,e,r)},this.Pt=(t,e,i,s,r)=>{const n=r;if(!n||!this.Ux)return;const o=this.jx(this.Ux,n);this.R.emit("mouseDrag",this,t,e,i,s,o)},this.Bt=(t,e,i,s)=>{const r=s;if(!r||!this.Ux)return;const n=this.jx(this.Ux,r);this.R.emit("mouseDragStop",this,t,e,i,n)},this.Lt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseWheel",this,t,s)},this.Rt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.Zx(s),this.Gx&&this.ls.os.ws(r,!0),this.Qx=r,this.R.emit("touchStart",this,t,s),Qt(t))},this.Et=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.Zx(s),this.Qx=r,this.R.emit("touchMove",this,t,s),Qt(t))},this.zt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;this.Jx(),r&&(this.Gx&&this.ls.os.ws(r,!1),this.Qx=void 0,this.R.emit("touchEnd",this,t,s),Qt(t))},this.ls.Xn(dh.Sf),this.ah=!1!==(null==n?void 0:n.animationsEnabled),this.Kx=e.Hy("mapChart plotting",0),this.onResize(this.Yx),this.mh.gr("Map Chart");const h=e.Xy(),a=Pt(n?n.cursorBuilder:void 0,Ra);this.jy=la(this,h,a.gy(h,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Bl,(()=>0)),this.qx=this.ss.wg(),this._p(r,this.uiScale),this.tb=this.Kx.Um(this.At).setMouseInteractions(this.Yi).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))).Ie(this.Ki.mapChartFillStyle).Fe(this.Ki.mapChartStrokeStyle),this.ib=this.Kx.Um(this.At).setMouseInteractions(this.Yi).Ie(this.Ki.mapChartOutlierRegionFillStyle).Fe(this.Ki.mapChartOutlierRegionStrokeStyle);const l=Pt(n&&n.type,El.World);this.Xx=l,this.sb(l).then((()=>{this.R.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Qx}setFillStyle(t){return this.tb.Ie(t),this.ls.xs(),this}getFillStyle(){return this.tb.Hh()}setStrokeStyle(t){return this.tb.Fe(t),this.ls.xs(),this}getStrokeStyle(){return this.tb.po()}setEffect(t){return this.qx.Ss(t),this.ls.xs(),this}getEffect(){return this.qx.bs()}setOutlierRegionFillStyle(t){return this.ib.Ie(t),this.ls.xs(),this}getOutlierRegionFillStyle(){return this.ib.Hh()}setOutlierRegionStrokeStyle(t){return this.ib.Fe(t),this.ls.xs(),this}getOutlierRegionStrokeStyle(){return this.ib.po()}setSeparateRegionFillStyle(t){return this.Vx="function"==typeof t?t(this.Vx):t,this.zx.forEach((t=>t.Ie(this.Vx))),this.ls.xs(),this}getSeparateRegionFillStyle(){return this.Vx}setSeparateRegionStrokeStyle(t){return this.Ox="function"==typeof t?t(this.Ox):t,this.zx.forEach((t=>t.Fe(this.Ox))),this.ls.xs(),this}getSeparateRegionStrokeStyle(){return this.Ox}invalidateRegionValues(t){if(!this.Ux||!this.eb)return this.hb=this.hb||[],this.hb.push(t),this;if("function"==typeof t)for(let e=0;e{t.rb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.rb(e.value)}))}}return this.ls.xs(),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.Yi=t,this.tb.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=be(t),this.Nx=t,null===(e=this.Ux)||void 0===e||e.regions.forEach((e=>{this.ls.os.ws(e,t)})),this.R.emit("highlight",this,t),this}getHighlight(){return this.Nx}setAnimationHighlight(t){var e;return null===(e=this.Ux)||void 0===e||e.regions.forEach((e=>{this.ls.os.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.ls.os.ks(null===(t=this.Ux)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Gx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Gx}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 sb(t){const e=await((t,e)=>{let i;if(t===El.World)i="countries_world.json";else if(t===El.NorthAmerica)i="countries_northAmerica.json";else if(t===El.SouthAmerica)i="countries_southAmerica.json";else if(t===El.Africa)i="countries_africa.json";else if(t===El.Europe)i="countries_europe.json";else if(t===El.Asia)i="countries_asia.json";else if(t===El.USA)i="states_usa.json";else if(t===El.Canada)i="territoriesProvinces_canada.json";else{if(t!==El.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw wt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return wt.fetch(s).then((t=>t.json())).catch((t=>{Re(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.mA.Zs);this.eb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Pl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.ib.Hr()._l(e);if(t===El.USA){const t=25.8,e=29.7;this.zx.push(this.Kx.Pe(this.At).setMouseInteractions(!1).Ie(this.Vx).Fe(this.Ox).Be({x:-126,y:t}).it({x:10,y:e-t}),this.Kx.Pe(this.At).setMouseInteractions(!1).Ie(this.Vx).Fe(this.Ox).Be({x:-113,y:t}).it({x:7,y:e-t}))}const s=this.ls.os.Yr(this.tb,{animationEnabled:this.ah});for(let i=0;i{o.forEach((e=>e.us(t)))}))}if(this.qx.fs([this.tb]),this.Hx=i,this.$x(t,this.At,i),this.Ux=e,this.hb){for(const t of this.hb)this.invalidateRegionValues(t);this.hb=void 0}this.ls.xs()}$x(t,e,i){const s=Ll[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]}})}Zx(t){this.nb=t,this.ls.xs()}Jx(){this.nb=void 0,this.ls.xs()}jx(t,e){const i=Array.from(this.Wx.entries()).findIndex((([t,i])=>i.includes(e))),s=null==t?void 0:t.regions[i],r=this.ls.Hn();if(!r)return;const n=this.ls.Vo(r),o=this.eb&&this.eb[i];let h=ct({x:n.engineX,y:n.engineY},this.ls.At,this.At);h={x:Ft(h.x,this.At.x.getInnerStart(),this.At.x.getInnerEnd()),y:Ft(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.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},region:s,value:o,longitude:l,latitude:a,lut:H(c)?c.lut:void 0}}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ra){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}setAnimationsEnabled(t){return this.ah=!t,this}getAnimationsEnabled(){return this.ah}getMinimumSize(){}if(){return[this]}De(t){super.De(t),super.Mp(),oa.Bp(this.mh,this.Cp);const e=m(this.At.x.ei(),this.At.y.ei(),this.At.x.ri(),this.At.y.ri());return this.Kx.ux(e),this.jy.De(!1,[],void 0,{explicitTarget:this.nb}),this}dispose(){return this.Kx.Y(),this.jy.Y(),ia(this.At),super.dispose()}J(){return super.J(),this.At.J(),this}K(){return super.K(),this.At.K(),this}Xd(){return de(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){ce(t,this.Ki,e,{fill:this.getFillStyle()})}}const _l=(t,e)=>{const i=t>0,s=e>0;return`${[ge(Math.abs(0|t),2),"° ",ge(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ge(Math.abs(0|e),2),"° ",ge(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`},Bl=(t,e,i)=>{var s;const r=[[e.region.name],[_l(e.longitude,e.latitude)]];return void 0!==e.value&&r.push({text:ah(e.value.toFixed(1),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}),r};class zl extends ir{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.ob(i),s,r,{numeric:e.ab({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.ab({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.ab({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.lb=n,this.ub=o,this.cb=h,this.ss=a,this.fb=i,this.Ab=e.ab({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.bh=h.Or(i).setMouseInteractions(!1).jh(e.ab({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Ie(e.ab({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Jh=this.ss.wg([this.bh]).Ss(s.effectsText)}setTickStrategy(t,e){return super.Vh(t,e)}setStrokeStyle(t){return this.Ab="function"==typeof t?t(this.Ab):t,this.ub.xs(),this}getStrokeStyle(){return this.Ab}mr(t,e){return new Nl(e,t,this.fb,this.cb,this.gb(this.lb,this.fb),this.cb.Ne(this.fb).setMouseInteractions(!1))}vr(t,e){const i=this.pb(this.fb,t);this.yb&&!1===this.yb(t)?t.Ke.setVisible(!1):t.Ke.setVisible(!0).Be(ui(this.mb(this.fb,t.M),i.padding)).Ya(i.alignment).Zh(i.rotation).Va(i.offset.x,i.offset.y),this.vb(this.fb,t.Sb,t.xb,t)}setMouseInteractions(t){return this}De(){this.rr({physicalAxisSize:0});const t=this.Mr(((t,e)=>{const i=e.Fh.yr,s=.5*this.Ab.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ke.Ls().td().y);return Math.max(t,s)}),0);return this.bb(this.fb,this.Ab,t),this.Mb(this.fb,this.bh,t),t}}class Nl extends sr{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.Sb=r,this.xb=n,r.setMouseInteractions(!1),this.qi.push(r,n)}}class Ol extends zl{constructor(t,e,i,s,r,n,o,h,a){super(t,Ul((()=>this.Dg())),e,i,s,r,n,o,h),this.Om=this.ub.Ne(this.fb).setMouseInteractions(!1),this._b=a,this.setScrollStrategy(Os.expansion),this.setTickStrategy(Us.Numeric),this.setTitle("Amplitude")}Dg(){return this._b()}Dr(t,e){return uh(t,e,this.fb.y)}Lr(t,e,i){const s=2*(e-t),r=this.fb.x.Li(s);return{min:t-i*r,max:e+i*r}}mb(t,e){return{x:t.wb()?e-t.Cb().start:t.Cb().start-e,y:0}}gb(t,e){return t.hd(e)}vb(t,e,i,s){const r=s.Fh.yr,n=t.wb()?s.M-t.Cb().start:t.Cb().start-s.M;It(s.M,t.Cb().start)||It(s.M,t.Cb().end)?e.setVisible(!1):e.setVisible(!0).lu(0).Ge(360).Au(void 0).fu(0).uu(n).Au(60).Ie(B).Fe(r.gridStrokeStyle);const o=.5*this.Ab.getThickness();i.We({x:n,y:-o*t.Wi().y}).Ge({x:n,y:-(o+r.tickLength)*t.Wi().y}).Oe(r.tickStyle)}pb(t,e){const i=e.Fh.yr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Ab.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}bb(t,e,i){const s=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;this.Om.We({x:0,y:0}).Ge({x:s,y:0}).Oe(e)}Mb(t,e,i){const s=t.wb()?(t.Cb().start+t.Cb().end)/2-t.Cb().start:t.Cb().start-(t.Cb().start+t.Cb().end)/2;e.Ya({x:0,y:1}).Be({x:s,y:-i*t.Wi().y})}}const Ul=t=>({...Ja(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),ob:t=>({getInnerStart:()=>t.Cb().start,getInnerEnd:()=>t.Cb().end,q:(e,i)=>t.kb(e,i),ut:(e,i,s,r,n)=>t.y.ut(e,i,s,r,n)}),ab:t=>t.amplitude});class Yl extends zl{constructor(t,e,i,s,r,n,o,h){super(t,Xl,e,i,s,r,n,o,h),this.Tb=90,this.Fb=12,this.Ib=Gl,this.Om=this.ub.hd(this.fb).setMouseInteractions(!1),this.yb=t=>{let e=180*(t.M-this.fb.Pb())/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.hh=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Tb)}setTickStyle(t){return this.Db="function"==typeof t?t(this.Db):t,this.Bb(),this.ub.xs(),this}getTickStyle(){return this.Db}setTickFormattingFunction(t){return this.Ib=t,this.Bb(),this.ub.xs(),this}getTickFormattingFunction(){return this.Ib}setClockwise(t){this.fb.Lb(t);const e=this.Tb*Math.PI/180;return t?this.fb.Rb(e+Math.PI/2):this.fb.Rb(e-Math.PI/2),this.ub.xs(),this}getClockwise(){return!this.fb.Eb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Tb=t;const e=t*Math.PI/180;return this.getClockwise()?this.fb.Rb(e+Math.PI/2):this.fb.Rb(e-Math.PI/2),this.ub.xs(),this}getNorth(){return 180*this.fb.Pb()/Math.PI}setDivision(t){return this.Fb=t,this.Bb(),this.ub.xs(),this}getDivision(){return this.Fb}Dg(){return[]}Dr(t,e){return e}Lr(t,e,i){return{min:t,max:e}}mb(t,e){const i=t.Eb()?1:-1,s=t.Pb(),r=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}gb(t,e){return t.Ne(e)}vb(t,e,i,s){const r=this.Db,n=t.Eb()?1:-1,o=t.Pb(),h=(s.M-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end,c={x:a*u,y:l*u};e.We({x:0,y:0}).Ge(c);const d={x:c.x+a*r.tickLength*t.Wi().x,y:c.y+l*r.tickLength*t.Wi().y};i.We(c).Ge(d),e.Oe(r.gridStrokeStyle),i.Oe(r.tickStyle)}pb(t,e){const i=this.Db,s=t.Eb()?1:-1,r=t.Pb();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.Wi().x,l=Math.sin(o)*h*t.Wi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}bb(t,e,i){const s=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;this.Om.lu(0).Ge(360).fu(0).uu(s+.5*e.getThickness()*t.Wi().x).Au(360).Ie(B).Fe(e)}Mb(t,e,i){const s=t.Pb(),r=this.pb(t,{M:0+s}),n=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;e.Ya(r.alignment).Zh(r.rotation).Va(r.offset.x,r.offset.y).Be(ui({x:n,y:0},r.padding))}Bb(){this.tr({$e:[],Xe:[{Ke:"Radial ticks",Ug:0,yr:this.Db,Ar:this.Ib,Gr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Fb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},Ih:{Sr:()=>{},Ph:()=>!1},Wr:void 0}],je:Gl,Ze:void 0,Qe:void 0})}}const Gl=(t,e,i)=>(180*t/Math.PI).toFixed(0),Xl={kr:()=>{},Tr:()=>{},Ir:()=>{},ob:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,q:(t,e)=>{},ut:(e,i,s,r,n)=>t.x.ut(e,i,s,r,n)}),ab:t=>t.radial},Zl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Hl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Wl extends Zi{constructor(t,e,i,s,r,n){super(e,i,r,n),this._s="Sector",this.zb=0,this.Vb=1*Math.PI/2,this.Ob=void 0,this.Nb=void 0,this.Is=t,this.fb=s,this.Ty=this.Is.hd(this.fb).us(this.getHighlight()),this.ds(this.Ty),this.we=r.polarSectorFillStyle,this.Ce=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.zb=Ft(t,0,360),this.Is.xs(),this}getAngleStart(){return this.zb}setAngleEnd(t){return this.Vb=Ft(t,0,360),this.Is.xs(),this}getAngleEnd(){return this.Vb}setAmplitudeStart(t){return this.Ob=t,this.Is.xs(),this}getAmplitudeStart(){return this.Ob}setAmplitudeEnd(t){return this.Nb=t,this.Is.xs(),this}getAmplitudeEnd(){return this.Nb}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.Is.xs(),this}getStrokeStyle(){return this.Ce}De(){const t=this.fb.Cb(),e=180*this.fb.Pb()/Math.PI,i=void 0!==this.Ob?Ft(this.Ob,t.start,t.end):t.start,s=void 0!==this.Nb?Ft(this.Nb,t.start,t.end):t.end,r=this.fb.wb()?i-t.start:t.start-i,n=this.fb.wb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.fb.Eb()?1:-1,l=Math.abs(this.Vb-this.zb);this.Ty.lu((this.zb-e)*a).Ge((this.Vb-e)*a).fu(100*o/h).uu(h).Ie(this.we).Fe(this.Ce).Au(Math.ceil(l/2))}Le(t,e){t.us(e),this.Is.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}}class jl extends Zi{constructor(){super(...arguments),this.av=!0,this.ov=!0}setAutoScrollingEnabled(t){return this.av=t,this.chart.ls.xs(),this}getAutoScrollingEnabled(){return this.av}yv(){}De(){}bm(){}setCursorEnabled(t){return this.ov=t,this}getCursorEnabled(){return this.ov}setCursorFormattingOverride(t){return this.Av=t,this}getCursorFormattingOverride(){return this.Av}}class Kl extends jl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Is=t,this.chart=e,this.scale=s}getAmplitudeMin(){return this.Gb?this.Gb.min:void 0}getAmplitudeMax(){return this.Gb?this.Gb.max:void 0}}const $l=(t,e)=>{const i=[],s=e.Cb().start,r=e.Cb().end,n=e.wb(),o=e.Eb()?1:-1,h=e.Pb(),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=Ft(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},Ql=t=>{const e={min:Be,max:ze};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ql=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Jl=(t,e)=>{let i=Ai(t);for(e.Eb()||(i*=-1),i+=180*e.Pb()/Math.PI;i<0;)i+=360;i%=360;const s=ai(t),r=e.Cb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:zn(r.start,r.end,s/n)}};class tu extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this._s="Heatmap Series",this.Wb=!0,this.bv=!1,this.Xd=()=>de(this.we);const h=this.chart.getSeries().length;this.we=ye(this.Ki.polarHeatmapSeriesFillStyle||this.Ki.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.Qn=u,this.Ub=t.Yb(s,[],u).Ie(this.we).us(this.getHighlight()),this.ds(this.Ub);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.Gb={min:c,max:d},this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.chart.ls.At,this.scale),n=Jl(r,this.scale),o=ha(e)?this.Ub.Hb(n):this.Ub.Jc(n);if(!o)return;const h=$l([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:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0,intensity:0,sector:0,annulus:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),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.Qn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Qn.dataOrder?t.length:t[0].length},i="annuli"===this.Qn.dataOrder?this.Qn.annuli:this.Qn.sectors,s="annuli"===this.Qn.dataOrder?this.Qn.sectors:this.Qn.annuli;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){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.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){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.`;wt.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.Ub.FS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Is.xs(),this.bv=!0,this}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.Ub.Ie(this.we),this.Is.xs(),this}getFillStyle(){return this.we}clear(){return this.Ub.Ot(),this.Is.xs(),this}setIntensityInterpolation(t){return t=t||"disabled",this.Ub.kS(t),this.Is.xs(),this}getIntensityInterpolation(){return this.Ub.TS()}rv(){return this.av&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}class eu extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Line Series",this.$b=[],this.Xb=!1,this.jb=!1,this.gu=ye(this.Ki.polarLineSeriesStrokeStyle,n),this.Zb=t.rm(s,void 0,[Oa.UserSeries]).Oe(this.gu).us(this.getHighlight()),this.ds(this.Zb)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.Zb.Qb(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,"show-nearest")))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.Zb.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.gu}setConnectDataAutomaticallyEnabled(t){return this.jb=t,this.Is.xs(),this}getConnectDataAutomaticallyEnabled(){return this.jb}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.jb?(t.push({...t[0]}),this.Zb.Ul(!0)):this.Zb.Ul(!1),this.Zb.Ot().dl(t).Ko(e),this.Xb=!1,this.Zb.Ls()}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}}class iu extends Kl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Line Series",this.$b=[],this.Xb=!1,this.jb=!1,this.Kb=3,this.ba=0,this.qb=e.PointShape.Circle,this.we=ye(this.Ki.polarPointLineSeriesFillStyle,o),this.gu=ye(this.Ki.polarPointLineSeriesStrokeStyle,o),this.Zb=t.rm(r,void 0,[Oa.UserSeries]).Oe(this.gu).us(this.getHighlight()),this.ds(this.Zb),this.tM=t.Pv(r).Ie(this.we).ol(this.qb).it(this.Kb).us(this.getHighlight()),this.ds(this.tM)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.Zb.Qb(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.Zb.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.gu}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.tM.Ie(e),this.Is.xs(),this}getPointFillStyle(){return this.we}setPointSize(t){return this.Kb=t,this.tM.it(t),this.Is.xs(),this}getPointSize(){return this.Kb}setPointShape(t){return this.qb=t,this.tM.ol(this.qb),this}getPointShape(){return this.qb}setPointRotation(t){return this.ba=t,this.tM.Zh(t),this.Is.xs(),this}getPointRotation(){return this.ba}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.gu})}setConnectDataAutomaticallyEnabled(t){return this.jb=t,this.Is.xs(),this}getConnectDataAutomaticallyEnabled(){return this.jb}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.jb?(t.push({...t[0]}),this.Zb.Ul(!0)):this.Zb.Ul(!1),this.Zb.Ot().dl(t).Ko(e),this.tM.Ot().dl(t).Ko(e),this.Xb=!1,this.Zb.Ls(),this.tM.Ls()}}Fs(){return this.Ms||this.qb}}class su extends pn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Xo=Fe(),this.R=new r.Eventer,this.$i=!1,this.iM=s,this.sM=n,this.eM=o,this.hM=h,this.rM=a,this.Is=t,this.scale=e,this.nM=i,this.Ki=l}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}dispose(){return this.nM&&this.nM(this),this.Is.ls.xs(),this.R.emit("dispose",this),this.$i=!0,this}setVisible(t){return super.setVisible(t),this.eM(),this.Is.ls.xs(),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMouseInteractions(t){return this.hM(this,t),this}getMouseInteractions(){return this.rM(this)}}class ru extends su{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,p){super(t,e,i,s,r,n,o,h,p),this.oM=1,this.aM=1,this.Is=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=m,this.boundaries=y(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,m)),this.lM=this.Ki.boxSeriesBodyFillStyle,this.uM=this.Ki.boxSeriesBodyStrokeStyle,this.gu=this.Ki.boxSeriesStrokeStyle,this.cM=this.Ki.boxSeriesMedianStrokeStyle,this.Ls()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.oM=t,this.Ls(),this}getBodyWidth(){return this.oM}setBodyFillStyle(t){return this.lM="function"==typeof t?t(this.lM):t,this.sM(),this}getBodyFillStyle(){return this.lM}setBodyStrokeStyle(t){return this.uM="function"==typeof t?t(this.uM):t,this.sM(),this}getBodyStrokeStyle(){return this.uM}setTailWidth(t){return this.aM=t,this.Ls(),this}getTailWidth(){return this.aM}setStrokeStyle(t){return this.gu="function"==typeof t?t(this.gu):t,this.sM(),this}getStrokeStyle(){return this.gu}setMedianStrokeStyle(t){return this.cM="function"==typeof t?t(this.cM):t,this.sM(),this}getMedianStrokeStyle(){return this.cM}Ls(){this.iM()}getDominantStyle(){return this.getBodyFillStyle()}}class nu extends jl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.dM=!0,this.qi=new Map,this.chart=t,this.Is=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.fM=h,this.scale=Ni(s.At,r.At),this.AM=t.gM,t.gM+=1,this.pM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yM),this.onMouseLeave(this.chart.mM),this.onMouseWheel(this.chart.uv),this.onMouseDragStart(this.chart.vM),this.onMouseDrag(this.chart.cv),this.onMouseDragStop(this.chart.dv),this.onTouchStart(this.chart.fv.onTouchStart),this.onTouchMove(this.chart.fv.onTouchMove),this.onTouchEnd(this.chart.fv.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}SM(){const t=Array.from(this.qi.keys());for(const e of t)if(e.xM)return e.xM}setClipping(t){return this.dM=t,this.Is.xs(),this}getClipping(){return this.dM}attacheAxis(){this.bM=this.axisXAttachHandler(this),this.MM=this.axisYAttachHandler(this)}ds(t,e){super.ds(t,e),t.ra(this.AM)}getName(){const t=this.cs(),e="ProgressiveY"===t||"RegressiveY"===t?this.axisX.getTitle():this.axisY.getTitle();return this._s||e.length>0&&e||"Series"}setDrawOrder(t){return this.AM=t.seriesDrawOrderIndex,this.qi.forEach(((t,e)=>{e.ra(this.AM)})),this.chart.ls.xs(),this}dispose(){return super.dispose(),this.bM(this),this.MM(this),this}bm(){if(super.bm(),this.dM){const t={x:this.scale.x.ei(),y:this.scale.y.ei(),width:this.scale.x.ri(),height:this.scale.y.ri()};this.qi.forEach(((e,i)=>{i._M=t}))}else this.qi.forEach(((t,e)=>{e._M=void 0}))}getBoundaries(){return y(u(this.getXMin()||0,this.getYMin()||0),u(this.getXMax()||0,this.getYMax()||0))}setCursorEnabled(t){return super.setCursorEnabled(t)}}const ou=(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.wM.findIndex((e=>e===t));e>=0&&this.wM.splice(e,1),this.kM=!0,this.CM=void 0,this.Is.xs()},this.iM=()=>{this.CM=void 0,this.kM=!0,this.chart.ls.xs()},this.sM=()=>{this.kM=!0,this.chart.ls.xs()},this.eM=()=>{this.CM=void 0,this.kM=!0,this.chart.ls.xs()},this.hM=(t,e)=>{this.setMouseInteractions(e)},this.TM=t=>this.getMouseInteractions()}De(){super.De(),this.kM&&(this.FM(this.wM),this.kM=!1)}clear(){return this.wM.slice().forEach(Et),this.wM.length=0,this.kM=!0,this.CM=void 0,this.Is.xs(),this}IM(t,e){void 0!==e?this.wM.splice(e,0,t):this.wM.push(t),this.kM=!0,this.PM&&this.PM(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.Is.xs()}rv(){return this.av&&this.wM.length>0&&this.getVisible()}setDefaultStyle(t){this.PM=t,this.wM.forEach(t),t(this.DM);for(let t=0;t0?this.wM[0].getDominantStyle():this.DM.getDominantStyle()})}}const lu=(t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i0?e:0,this.Is.xs(),this}add(t){if(0!==this.LM.length&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)?this.zM(t):this.zM([t]),this.bu.length>0){const t=this.bu[this.bu.length-1];this.VM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.VM?this.VM.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.fl()+e.Al()),this.bu.length)}clear(){this.OM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.EM.getXMax(this.LM,this.OM)||0}getXMin(){return this.EM.getXMin(this.LM,this.OM)||0}getYMax(){return this.EM.getYMax(this.LM,this.OM)||0}getYMin(){return this.EM.getYMin(this.LM,this.OM)||0}Ir(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Cl()),t.y=Math.max(t.y,e.kl());return t}NM(t,e,i,s){this.EM.NM(t,e,i,s,this.scale,(t=>{}))}yv(){super.yv(),this.GM&&this.NM(this.LM,this.getPointAmount(),this.GM,this.RM)}De(){super.De();const t=this.getBoundaries();this.bu.length>0&&(this.WM(this.bu),this.bu=[]);for(const e of this.LM)e.Ko(t);return super.De()}bm(){super.bm(),this.OM=void 0,this.bu.length=0}zM(t){0!==t.length&&(this.OM?this.OM=ei(this.OM,Je(t)):this.OM=Je(t),this.R.emit("dataAdd",this,t,this.OM),this.bu=he(this.bu,t,{canReturnB:!1}),this.Is.xs())}UM(){return hu(this.LM)}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;hct(this.Ps.toPoint((t.start+t.end)/2,t.median),this.scale,this.Is.ls.At),this.chart.ls.Xn(dh._f),this.Ps=a,this.DM=new ru(this.Is,this.scale,this.nM,kt,kt,kt,kt,(t=>!1),this.Ps,0,0,0,0,0,0,0,this.Ki).dispose(),this.QM=new ja((()=>{const t=this.Is.Wg(this.scale);return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Oe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i.Yg(e.start,e.end),i}))))),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.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}}Qi(t,e){return Pe({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())))}pM(t){if(!(t instanceof Bi||t instanceof zi))throw new Error("BoxSeries only supports Linear Axes")}FM(t){const e=this.JM.Mm(),i=this.QM.Mm();t.forEach((t=>{if(!t.getVisible())return;const s=this.Ps.toPoint((t.start+t.end-t.oM*(t.end-t.start))/2,t.lowerQuartile),r=this.Ps.toPoint((t.end-t.start)*t.oM,t.upperQuartile-t.lowerQuartile),n=this.Ps.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Ps.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Ps.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Ps.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Ps.toPoint((t.start+t.end-t.aM*(t.end-t.start))/2,t.lowerExtreme),u=this.Ps.toPoint((t.start+t.end+t.aM*(t.end-t.start))/2,t.lowerExtreme),c=this.Ps.toPoint((t.start+t.end-t.aM*(t.end-t.start))/2,t.upperExtreme),d=this.Ps.toPoint((t.start+t.end+t.aM*(t.end-t.start))/2,t.upperExtreme),f=this.Ps.toPoint((t.start+t.end-t.oM*(t.end-t.start))/2,t.median),g=this.Ps.toPoint((t.start+t.end+t.oM*(t.end-t.start))/2,t.median);e.add({Xo:t.Xo,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.lM,strokeStyle:t.uM}),i.add({Xo:0,start:n,end:o,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:h,end:a,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:l,end:u,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:c,end:d,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:f,end:g,figure:t},{strokeStyle:t.cM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new ru(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ps,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.Ki);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class fu extends su{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.Ka=y(u(0,0),u(0,0)),this.Is=t,this.scale=e,this.we=ye(a.ellipseSeriesFillStyle,l),this.Ce=ye(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.dimensions=t,this.Ka=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.iM(),this.Is.xs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class gu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Ellipse Series",this.jM=ke(),this.ZM=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new fu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.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}}Qi(t,e){return Pe({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())))}pM(t){if(!(t instanceof Bi||t instanceof zi))throw new Error("EllipseSeries only supports Linear Axes")}FM(t){const e=this.JM.Mm();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({Xo:t.Xo,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new fu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class yu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.qM=[],this.Ka=Ne,this.Is=t,this.scale=e,this.we=ye(a.polygonSeriesFillStyle,l),this.Ce=ye(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.qM=t,this.Ka=Je(this.qM),this.iM(),this.Is.xs(),this}getDimensions(){return this.qM}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class mu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Polygon Series",this.jM=ke(),this.ZM=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new yu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.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}}Qi(t,e){return Pe({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())))}pM(t){}FM(t){const e=this.JM.Mm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Xo:t.Xo,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new yu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class pu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.t_={x:0,y:0,width:0,height:0},this.i_={x1:0,y1:0,x2:0,y2:0},this.Ka=y(u(0,0),u(0,0)),this.we=ye(a.rectangleSeriesFillStyle,l),this.Is=t,this.scale=e,this.Ce=ye(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return"x"in t?(this.t_=t,this.i_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.i_=t,this.t_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Ka=Je([this.t_,u(this.t_.x+this.t_.width,this.t_.y+this.t_.height)]),this.iM(),this.Is.xs(),this}getDimensionsPositionAndSize(){return this.t_}getDimensionsTwoPoints(){return this.i_}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class xu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Rectangle Series",this.jM=ke(),this.ZM=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new pu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.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}}Qi(t,e){return Pe({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())))}pM(t){}FM(t){const e=this.JM.Mm();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({Xo:t.Xo,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new pu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class Au extends su{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.Ka=y(u(0,0),u(0,0)),this.Ki=a,this.Is=t,this.scale=e,this.Ce=ye(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.dimensions=t,this.Ka=y(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.iM(),this.Is.xs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){const t=this.Ce;return t!==nt?t.getFillStyle():B}}class Su extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Segment Series",this.s_=ke(),this.ZM=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new Au(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.QM=new ja((()=>{const t=this.s_.Mt(this.Is.Wg(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Oe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i.Yg(e.start,e.end),this.s_.Vt(i,e.figure),i})))),(()=>{this.s_.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.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}}Qi(t,e){return Pe({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())))}pM(t){}FM(t){const e=this.QM.Mm();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({Xo:t.Xo,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Au(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class vu extends nu{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._s="Heatmap Grid Series",this.vS={},this.chart.ls.Xn(dh.Mf),this.e_=a,this.Ki=l;const d=c;this.we=ye(l.heatmapGridSeriesFillStyle,d),this.SS=ye(this.Ki.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Qn=f,this.h_=this.Is.r_(this.scale,[],f).Ie(this.we).xS(this.SS).us(this.getHighlight()),this.ds(this.h_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Is.ls.At,this.scale),n=ha(e)?this.h_.Hb(r):this.h_.Jc(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:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,intensity:0,column:0,row:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}MS(){const t=this.vS.start||{x:0,y:0};let e;e=this.vS.end?{x:(this.vS.end.x-t.x)/this.Qn.columns,y:(this.vS.end.y-t.y)/this.Qn.rows}:this.vS.step?this.vS.step:{x:1,y:1},this.h_._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.h_.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.h_.wS().step}setEnd(t){return this.vS.end=t,this.MS(),this}getEnd(){return this.h_.wS().end}clear(){return this.h_.Ot(),this.Is.xs(),this.R.emit("dataClear",this),this}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.h_.xS(this.SS),this.Is.xs(),this.R.emit("styleChange",this),this}getWireframeStyle(){return this.SS}setIntensityInterpolation(t){return t=t||"disabled",this.h_.kS(t),this.Is.xs(),this.R.emit("styleChange",this),this}getIntensityInterpolation(){return this.h_.TS()}rv(){return this.av&&this.getVisible()}Xd(){return de(this.we)}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}n_(t){this.h_.n_().forEach((e=>{t.h_.FS(e)}))}XM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}o_(t){return this.R.on("styleChange",t)}a_(t){return this.R.off(t)}getXMax(){const t=this.h_;return t?t.St():void 0}getXMin(){const t=this.h_;return t?t.vt():void 0}getYMax(){const t=this.h_;return t?t.bt():void 0}getYMin(){const t=this.h_;return t?t.xt():void 0}Ir(){const t=u(0,0);return t.x=Math.max(t.x,this.h_.Cl()),t.y=Math.max(t.y,this.h_.kl()),t}pM(t){if(!(t instanceof Bi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Bi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Le(t,e){t.us(e),this.Is.xs()}De(){return super.De(),this.h_.Ko(this.getBoundaries()),this}}class bu extends vu{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.bv=!1}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Qn.dataOrder?t.length:t[0].length,rows:"rows"===this.Qn.dataOrder?t.length:t[0].length},i="columns"===this.Qn.dataOrder?this.Qn.columns:this.Qn.rows,s="columns"===this.Qn.dataOrder?this.Qn.rows:this.Qn.columns;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Qn.columns}x${this.Qn.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.`;wt.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.h_.FS({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.Is.xs(),this.bv=!0,this}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.h_.Ie(this.we),this.R.emit("styleChange",this),this.Is.xs(),this}getFillStyle(){return this.we}l_(t){return this.R.on("invalidateIntensity",t)}u_(t){return this.R.off(t)}}class Mu extends nu{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._s="Scrolling Heatmap Grid Series",this.vS={},this.chart.ls.Xn(dh.Mf),this.chart.ls.Xn(dh.Cf);const d=c;this.we=ye(l.heatmapScrollingGridSeriesFillStyle,d),this.SS=ye(this.Ki.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Qn=f,this.c_=this.Is.d_(this.scale,[],f).Ie(this.we).xS(this.SS).us(this.getHighlight()),this.ds(this.c_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Is.ls.At,this.scale),n=ha(e)?this.c_.Hb(r):this.c_.Jc(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:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,intensity:0,multiHit:0,column:0,row:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}MS(){const t=this.vS.start||{x:0,y:0};let e;e=this.vS.step?this.vS.step:{x:1,y:1},this.c_._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.c_.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.c_.wS().step}clear(){return this.c_.Ot(),this.Is.xs(),this}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.c_.xS(this.SS),this.Is.xs(),this}getWireframeStyle(){return this.SS}setPixelInterpolationMode(t){return t=t||"disabled",this.c_.kS(t),this.Is.xs(),this}getPixelInterpolationMode(){return this.c_.TS()}setDataCleaning(t){return this.c_._u(t),this.Is.xs(),this}rv(){return this.av&&this.getVisible()}Xd(){return de(this.we)}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Ie(t){return this.we="function"==typeof t?t(this.we):t,this.c_.Ie(this.we),this.Is.xs(),this}pM(t){if(!(t instanceof Bi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Bi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.c_.St()||0}getXMin(){return this.c_.vt()||0}getYMax(){return this.c_.bt()||0}getYMin(){return this.c_.xt()||0}Ir(){const t=u(0,0);return t.x=Math.max(t.x,this.c_.Cl()),t.y=Math.max(t.y,this.c_.kl()),t}Le(t,e){t.us(e),this.Is.xs()}}class wu extends Mu{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.Qn.scrollDimension?t.length:t[0].length,"rows"===this.Qn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Qn.resolution-1;if(s>r){if(!0===this.chart.mA.Kn){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Qn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const s=[];for(let i=0;i{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.slice()},this.p_=[],this.y_=[],this.m_=!1,this.v_=(t,e)=>{const i=t.Qb(e);if(i)return[ct(i[0],this.scale,this.Is.ls.At),ct(i[1],this.scale,this.Is.ls.At)]},this.S_=(t,e)=>{const i=t.x_(e);if(i)return[ct(i[0],this.scale,this.Is.ls.At),ct(i[1],this.scale,this.Is.ls.At)]},this.Xd=()=>de(this.b_)||de(this.M_),this.__=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM.length-1,s=this.LM[i];if(e>0){const[e,i]=s.nl(),[r,n]=s.rl();if((r?e.length+r.length:e.length)>=this.GM){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=mi(a,o,u(t[0].position,t[0].high)).y,c=mi(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.dl(f,y(u(a,c),u(a,l))).Ul(!0),this.w_([f].concat(t)).Gl(!0)}else s.dl(t)}}else e>0&&this.w_(t)},this.C_=t=>{const e=this.p_,i=t.length;if(this.p_.length>0){if(i>0){const i=e[e.length-1],s=i.nl(),r=i.rl();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.dl(a,y(u(o,h),u(o,h))).Ul(!0),e.push(this.k_([a].concat(t),this.OM).Gl(!0))}else i.dl(t)}}else i>0&&e.push(this.k_(t))},this.T_=t=>{const e=this.y_,i=t.length;if(this.y_.length>0){if(i>0){const i=e[e.length-1],s=i.nl(),r=i.rl();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.dl(a,y(u(o,h),u(o,h))).Ul(!0),e.push(this.F_([a].concat(t)).Gl(!0))}else i.dl(t)}}else i>0&&e.push(this.F_(t))}}cs(){return"ProgressiveX"}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.RM=void 0!==e&&e>0?e:0,this.Is.xs(),this}clear(){for(let t=0;tt+e.fl()+e.Al()),this.bu.length)}getXMax(){return Yt(this.LM,Vt,Math.max,Nt,this.OM)||0}getXMin(){return Yt(this.LM,Lt,Math.min,zt,this.OM)||0}getYMax(){return Yt(this.LM,Bt,Math.max,Ut,this.OM)||0}getYMin(){return Yt(this.LM,_t,Math.min,Ot,this.OM)||0}Ir(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Cl()),t.y=Math.max(t.y,e.kl());return t}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}pM(t){}zM(t,e,i){this.bu=he(this.bu,t,{canReturnB:!1}),this.A_=he(this.A_,e,{canReturnB:!1}),this.g_=he(this.g_,i,{canReturnB:!1}),this.Is.xs()}I_(t,e,i,s){this.P_(e,i,s),this.zM(Array.isArray(t)?t:[t],e,i)}P_(t,e,i){const s=ei(Je(t),Je(e));this.OM?this.OM=ei(this.OM,s):this.OM=s,i&&(this.OM=ei(this.OM,i))}D_(){const t=this.LM.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.LM[this.LM.length-1]:void 0,i=e?e.nl()[0].length+(e.rl()[0]?e.rl()[0].length:0):void 0;ou(t,i,this.GM,this.__)}L_(t){const e=this.p_.length>0?this.p_[this.p_.length-1].nl().length+this.p_[this.p_.length-1].rl().length:void 0;ou(t,e,this.GM,this.C_)}R_(t,e){const i=this.p_.length>0?this.p_[this.p_.length-1].nl().length+this.p_[this.p_.length-1].rl().length:void 0;ou(t,i,this.GM,this.C_),ou(e,i,this.GM,this.T_)}w_(t,e){const i=this.Is.E_(this.scale).dl(t,e).Ie(this.b_).Ol(this.M_).zl(this.Il).us(this.getHighlight());return this.LM.push(i),this.ds(i),i}z_(t,e,i){const s=this.Is.rm(this.scale,void 0,[Oa.UserSeries]).dl(t,i).setMouseInteractions(!1).Oe(e).us(this.getHighlight());return this.ds(s),s}k_(t,e){return this.z_(t,this.V_,e)}F_(t,e){return this.z_(t,this.O_,e)}N_(t){this.b_="function"==typeof t?t(this.b_):t;const e=this.b_;for(let t=0;t0){const t=this.D_();this.NM(this.LM,this.GM,this.RM,t),this.p_.length>0&&this.NM(this.p_,this.GM,this.RM,t),this.y_.length>0&&this.NM(this.y_,this.GM,this.RM,t),this.m_=!0}}De(){if(super.De(),this.bu.length>0&&(this.B_(this.bu),this.Z_(this.A_,this.g_),this.m_=!0),this.m_){const t=this.getBoundaries();for(const e of this.LM)e.Ko(t);for(const e of this.p_)e.Ko(t);for(const e of this.y_)e.Ko(t)}}bm(){this.OM=void 0,this.bu.length=0,this.A_.length=0,this.g_.length=0}}class Ru extends Tu{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.ls.Xn(dh.bf),this.Q_=a}add(t){0!==this.LM.length&&this.chart.ls.Xn(dh.Cf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.J_(e),[i,s]=this.K_(t);this.I_(t,i,s,y(u(Be,this.Q_),u(ze,this.Q_)));const r=this.bu[this.bu.length-1];this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.VM?this.VM.position+e:0),this.add(lu(t,e,s)),this}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}class Eu extends Ru{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.b_=ye(this.Ki.areaSeriesBipolarHighFillStyle,c),this.V_=ye(this.Ki.areaSeriesBipolarHighStrokeStyle,c),this.M_=ye(this.Ki.areaSeriesBipolarLowFillStyle,c),this.O_=ye(this.Ki.areaSeriesBipolarLowStrokeStyle,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.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]}}}J_(t){return this.q_(t)}Z_(t,e){return this.R_(t,e)}q_(t){let e=0;const i=[],s=t.length,r=this.Q_;return s>0&&(this.tw&&(this.tw.y<=r&&r<=t[0].y||this.tw.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.tw.x+t[0].x),r,r),e+=1),this.tw=t[s-1],1===s?this.iw(t[0],i,e):this.sw(t,i)),i}iw(t,e,i=0){return e[i]=d(t.x,t.y,this.Q_),i+1}sw(t,e){let i=0,s=0;const r=t.length-1,n=this.Q_;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:zn(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}K_(t){const e=t.length,i=Array(e),s=Array(e),r=this.Q_;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.N_(t),this}setNegativeFillStyle(t){return this.G_(t),this}setPositiveStrokeStyle(t){return this.U_(t),this}setNegativeStrokeStyle(t){return this.Y_(t),this}getPositiveFillStyle(){return this.W_()}getNegativeFillStyle(){return this.Nl()}getPositiveStrokeStyle(){return this.H_()}getNegativeStrokeStyle(){return this.X_()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.b_,fill2:this.M_,behavior:{colorStep:!0}})}}class ku extends Ru{constructor(){super(...arguments),this.O_=nt}Z_(t){return this.L_(t)}K_(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}sw(t,e,i=0){let s=0;const r=t.length-1,n=this.Q_;for(;sn){const t=vi(u(ze,n),u(Be,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&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=vi(u(ze,n),u(Be,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}UM(){return hu(this.LM,(t=>t[1]))}setFillStyle(t){return this.G_(t),this}getFillStyle(){return this.Nl()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.M_,stroke:this.V_})}}class Fu extends ku{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.b_=ye(this.Ki.areaSeriesPositiveFillStyle,d),this.M_=B,this.V_=ye(this.Ki.areaSeriesPositiveStrokeStyle,d)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale),i=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=vi(u(ze,n),u(Be,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}UM(){return hu(this.LM,(t=>t[0]||[]))}setFillStyle(t){return this.N_(t),this}getFillStyle(){return this.W_()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.b_,stroke:this.V_})}}const Du={Positive:Fu,Negative:Iu,Bipolar:Eu};class Pu extends Tu{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.ls.Xn(dh.bf);const c=u;this.b_=ye(this.Ki.areaRangeSeriesFillStyle,c),this.V_=ye(this.Ki.areaRangeSeriesStrokeStyle,c),this.M_=ye(this.Ki.areaRangeSeriesFillStyleInverted,c),this.O_=ye(this.Ki.areaRangeSeriesStrokeStyleInverted,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.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.I_(t,i,s);const r=this.bu[this.bu.length-1];return this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM),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.VM?this.VM.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)},Bu=(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=oi(ci(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]=ui(li(r,l),f[1]),f[2]=ci(f[2],li(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.Jc(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.lw=t=>{if(this.LM.length>0){const e=this.LM[this.LM.length-1];if(t.length>0){const i=e.nl(),s=e.rl(),r=i.length+s.length-+e.Wl();if(r>=this.GM){const n=s.length>0?s[s.length-1]:i[e.Wl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.dl(o,y(u(o.x,o.y),u(o.x,o.y))).Ul(!0),this.uw([o].concat(t)).Gl(!0)}else e.dl(t,this.OM)}}else t.length>0&&this.uw(t)},this.cw=t=>{if(this.nw.length>0){const e=this.nw[this.nw.length-1];t.length>0&&((e.nl().length+e.rl().length)*this.rw>=this.GM?this.dw(t):e.dl(t))}else t.length>0&&this.dw(t)},this.Qn=m,this.qb=l,this.fw=f,this.Aw=ye(c.pointLineSeriesFillStyle,g),this.gu=ye(this.Ki.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}UM(){return hu(this.nw)}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;for(let t=0;te.setVisible(t))),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Zo()||zr.NearestX,n=ha(e)?cu(s,this.LM,this.aw,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(s,this.nw,this.ow,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.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=ct(n[0],this.Is.ls.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}}}Xd(){return de(this.Aw)||de(this.gu.getFillStyle())}Fs(){return this.Ms||this.qb}pM(t){}Le(t,e){t.us(e),this.Is.xs()}WM(t){const e=this.LM.length>0?this.LM[this.LM.length-1].nl().length+this.LM[this.LM.length-1].rl().length-+this.LM[this.LM.length-1].Wl():void 0;ou(t,e,this.GM,this.lw),ou(t,e,this.GM,this.cw)}dw(t,e){const i=this.Is.Pv(this.scale).dl(t,e).setMouseInteractions(this.Yi).Ie(this.Aw).ol(this.qb).it(this.Kb).Zh(this.ba).ll(this.Za).ul(this.Qa).cl(this.Ja).us(this.getHighlight());return this.ds(i),this.nw.push(i),i}uw(t,e){const i=this.Is.rm(this.scale,void 0,[Oa.UserSeries,...this.fw]).dl(t,e).setMouseInteractions(this.Yi).Oe(this.gu).us(this.getHighlight());return this.ds(i),this.LM.push(i),i}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu,fill:this.Aw})}getPointAmount(){return this.nw.reduce(((t,e)=>t+e.fl()+e.Al()),this.bu.length)}clear(){super.clear();for(let t=0;t{}))}}const Nu=(t,e)=>t.rl().length>=e?t.rl().slice(-e):Array.prototype.concat(t.nl(),t.rl()).slice(-e),Ou=(t,e,i)=>{const s=Array.prototype.concat(t.nl(),t.rl()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ot().dl(s).Ls()};class Uu extends zu{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.rw=32,this.GM=8e3,this.gw=t=>{if(0===t.length)return;const e=this.nw.length;if(e>0){const i=e>1,s=this.nw[e-1];if(i){const i=Array.prototype.concat(s.nl(),s.rl()),r=i.length;if(32*r>=this.GM){const i=Nu(s,3),r=Array.prototype.concat(i,t),n=Bu(r,32);Ou(this.LM[e-1],n,32),this.uw(n.slice(66))}else if(r<5){const s=this.nw[e-2],r=Nu(s,3),n=Array.prototype.concat(r,i,t),o=Bu(n,32),h=this.LM[e-1],a=o.slice(66);h.Ot().dl(a).Ls()}else{const i=this.LM[e-1],r=Array.prototype.concat(i.nl(),i.rl()),n=Nu(s,4),o=Array.prototype.concat(n,t),h=Bu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ot().dl(a).Ls()}}else{const i=Array.prototype.concat(s.nl(),s.rl()),r=i.length,n=this.LM[e-1];if(32*r>=this.GM){const e=Nu(s,3),i=Array.prototype.concat(e,t),r=Bu(i,32);Ou(this.LM[0],r,32),this.uw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=Bu(e,32);n.Ot().dl(s).Ls()}else n.dl(t)}}else{const e=t.length>0?Bu(t,32):t,i=Je(e);this.uw(e,i)}this.cw(t)}}WM(t){const e=this.nw.length,i=this.nw.length>0?this.nw[e-1].nl().length+this.nw[e-1].rl().length:void 0;ou(t,i,Math.ceil(this.GM/this.rw),this.gw)}}class Yu{constructor(){this.Gi="FreeformPattern",this.Il={type:"disabled",packager:(t,e,i)=>t.slice()}}NM(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}},Xu=s.Record({Il:{type:"disabled",packager:(t,e,i)=>t.slice()}});class Zu extends Xu{NM(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.D_(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},Wu=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class ju extends Zu{pw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Wu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Hu,e?e.min.y:void 0)}}const Ku=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},$u=(t,e)=>{const i=e.St();return t?Math.max(i,t):i};class Qu extends Zu{pw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce($u,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ku,e?e.min.x:void 0)}}const qu={horizontalProgressive:new class extends ju{constructor(){super({Il:Dr()}),this.Gi="HorizontalProgressivePattern"}D_(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].fl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Dr(Gu(t)))}},horizontalRegressive:new class extends ju{constructor(){super({Il:Pr()}),this.Gi="HorizontalRegressivePattern"}D_(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].fl()>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",Pr(Gu(t)))}},verticalProgressive:new class extends Qu{constructor(){super({Il:Lr()}),this.Gi="VerticalProgressivePattern"}D_(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].fl()>0?t[0].xt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Lr(Gu(t)))}},verticalRegressive:new class extends Qu{constructor(){super({Il:Vr()}),this.Gi="VerticalRegressivePattern"}D_(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].fl()>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",Vr(Gu(t)))}},freeform:new Yu};class Ju extends zu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,m){super(t,e,i,s,r,n,o,h,qu.horizontalProgressive,a,c,d,f,g,m),this.lw=t=>{const e=this.LM.length>0?this.LM[this.LM.length-1].nl().length+this.LM[this.LM.length-1].rl().length:void 0;ou(t,e,this.GM,this.yw)},this.yw=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM[this.LM.length-1];if(e>0){const e=i.nl(),s=i.rl(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Vu([r].concat(t),this.mw);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.GM?(i.dl(o,y(u(o.x,o.y),u(o.x,o.y))).Ul(!0),this.uw(h).Gl(!0),this.dw(t)):i.dl(h)}}else e>0&&this.uw(Vu(t,this.mw));this.cw(t)},this.mw=l,void 0===this.fw.find((t=>"DataPattern"===t.type))&&this.fw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class tc extends nu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Sw=t=>t[4]>=t[1],this.CM=y(c(Be,Be),c(ze,ze)),this.xw=[],this.bw=!1,this.Mw=-1,this._w=[],this.ww=!0,this.Cw=!1,this.kw=4,this.Tw=[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.ls.Xn(dh.df)}UM(){return this._w}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}rv(){return this.av&&this._w.length>0&&this.getVisible()}Fw(t){if(!(this._w.length<1))return[this._w[t][0],this._w[t][1],this._w[t][2],this._w[t][3],this._w[t][4]]}solveNearest(t,e){if(0===this._w.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.Iw;if(!t)return;const e=Ee(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=Ee(i,this._w.length-1,(t=>this._w[t][0])),e=void 0!==t&&this._w[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}}Qi(t,e){return Pe({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())))}pM(t){if(!(t.x instanceof Li))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Pw=t.x}Ir(){return u(5,5)}m_(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.ls.Xn(dh.Cf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.bw=!0;const t=this._w.length,i=this.xw.length,s=e.length;this._w.length=t+s,this.xw.length=i+s;for(let r=0;rthis.Tw[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Mw||this.bw||this.Cw)){this.Cw=!1,this.Mw=t,this.bw=!1,this.Bw(),this.Iw=[];const e=this._w.length;let i=this._w[0][0]-this._w[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Ja(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Ir().x))}),nc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Ja(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Ir().y))});class oc extends pa{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.iC=!1,this.sC=!1,this.eC=!1,this.hC=!1,this.rC=new Map,this.nC=new Map,this.oC=[],this.aC=[],this.lC=!0,this.uC=!0,this.cC=new Set,this.dC=!1,this.ny=r,this.fC=n,this.AC=o,this.gC=h.cursorGridStrokeStyleX,this.pC=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.rC.forEach((t=>t.forEach((t=>t.dispose())))),this.nC.forEach((t=>t.forEach((t=>t.dispose())))),this.oC.length=0,this.aC.length=0,this.ey.length=0,this}De(){return this.oC.forEach((t=>t.setVisible(this.Xi&&this.hp).setMarkerVisible(this.Xi&&this.hp&&this.lC))),this.aC.forEach((t=>t.setVisible(this.Xi&&this.hp).setMarkerVisible(this.Xi&&this.hp&&this.uC))),super.De()}setPosition(...t){if(this.oC.forEach((t=>t.setVisible(!1))),this.aC.forEach((t=>t.setVisible(!1))),this.oC.length=0,this.aC.length=0,0===t.length)return this;const e=this.renderingScale,i=t[0].resultTable,s=Jh(t[0].resultTableScale,e),r=s===this.scale?i:ct(i,s,this.scale);this.Gp.setPosition(r),this.hp=!1,this.ty.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=lc(u(c.x,c.y),s,r);if(a){const t=this._h(s,!0);t.setValue(c.x),t.setGridStrokeLength(this.iC?d.x:1).setAllocatesAxisSpace(this.dC),this.oC.push(t)}if(l){const t=this._h(r,!1);t.setValue(c.y),t.setGridStrokeLength(this.sC?d.y:1).setAllocatesAxisSpace(this.dC),this.aC.push(t)}let f=this.ty[i];if(!f){const t=new Mo(this.Is,this.renderingScale,this.scale,kt,this.Ki).setMouseInteractions(!1).setFillStyle(this.Ki.cursorPointMarkerFillStyle).setSize(this.Ki.cursorPointMarkerSize).setShape(this.Ki.cursorPointMarkerShape);f={pointMarker:t,targetVisible:!0},this.ty.push(f),this.ey.forEach((e=>e(t)))}const g=Jh(t.pointMarkerScale,e),y=g===this.scale?t.pointMarker:ct(t.pointMarker,g,this.scale);f.pointMarker.setPosition(y),f.targetVisible=!0;const m=s.getInterval(),p=r.getInterval(),x=Math.min(m.start,m.end),A=Math.max(m.start,m.end),S=Math.min(p.start,p.end),v=Math.max(p.start,p.end);c.x>=x&&c.x<=A&&c.y>=S&&c.y<=v&&(this.hp=!0)})),this}setTickMarkersAllocateAxisSpace(t){return this.dC=t,this.Is.xs(),this}getTickMarkersAllocateAxisSpace(){return this.dC}_h(t,e){this.cC.has(t)||(t.onDispose((()=>{var e;null===(e=i.get(t))||void 0===e||e.forEach((t=>t.dispose())),i.delete(t)})),this.cC.add(t));const i=e?this.rC:this.nC,s=e?this.oC:this.aC,r=i.get(t)||[];i.set(t,r);let n=r.find((t=>!s.includes(t)));return n||(n=e?t.Kg(!1,this.fC):t.Kg(!1,this.AC),r.push(n),this.pr(n,e),n.setMouseInteractions(!1)),n}pr(t,e){const i=e?this.gC:this.pC;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.lC:this.uC)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.iC=t,this.Is.xs(),this}getGridStrokeXCut(){return this.iC}setGridStrokeYCut(t){return this.sC=t,this.Is.xs(),this}getGridStrokeYCut(){return this.sC}setGridStrokeXStyle(t){return this.gC=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.rC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.gC))))),this}getGridStrokeXStyle(){return this.gC}setGridStrokeYStyle(t){return this.pC=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.nC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.pC))))),this}getGridStrokeYStyle(){return this.pC}setTickMarkerXVisible(t){return this.lC=t,this.Is.xs(),this}getTickMarkerXVisible(){return this.lC}setTickMarkerYVisible(t){return this.uC=t,this.Is.xs(),this}getTickMarkerYVisible(){return this.uC}setTickMarkerX(t){return this.rC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.fC=this.fC.addStyler(t),this.Is.xs(),this}setTickMarkerY(t){return this.nC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.AC=this.AC.addStyler(t),this.Is.xs(),this}}class hc{constructor(t,e,i,s){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new hc(this.ny,this.fC,this.AC,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new hc(t,this.fC,this.AC,this.uy.map((t=>t))),this.gy=(t,e,i,s,r)=>this.Ay(new oc(t,e,i,s,this.ny,this.fC,this.AC,r),r),this.ny=t,this.uy=s,this.fC=e,this.AC=i}}const ac=new hc(Ao,oh.PointableTextBox,oh.PointableTextBox,[(t,e)=>{xa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),lc=(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.ug&&(n=1-n),1===e.ug&&(o=1-o),u(o,n)};class uc extends uu{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.LM=[],this.Wb=!0,this.GM=void 0,this.Mu=void 0,this.yC=(t,e)=>{const i=t.Qb(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.Xd=()=>de(this.gu.getFillStyle()),this.fw=c,this.Qn=f,this.gu=ye(this.Ki.lineSeriesStrokeStyle,d),this.mC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}cs(){var t,e;return null===(e=null===(t=this.Qn)||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.gu="function"==typeof t?t(this.gu):t;const e=this.gu;for(let t=0;tt._u(this.Mu))),this.Is.xs(),this}setCursorInterpolationEnabled(t){return this.Wb=t,this.Is.ls.xs(),this}getCursorInterpolationEnabled(){return this.Wb}pM(t){}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Zo()||zr.NearestX,n=cu(s,this.LM,ha(e)?this.aw:this.yC,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.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=ct(n[0],this.Is.ls.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}}}WM(t){let e=this.LM[0];e||(e=this.uw(),this.LM.push(e),this.ds(e)),e.dl(t,this.OM)}uw(){return this.Is.rm(this.scale,this.mC,[Oa.UserSeries,...this.fw]).Oe(this.gu)._u(this.Mu).us(this.getHighlight())}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}Le(t,e){t.us(e),this.Is.xs()}NM(t,e,i,s){}}class cc extends uu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new Yu,l,u),this.LM=[],this.Kb=5,this.ba=0,this.Za=!1,this.Qa=!1,this.Ja=!1,this.GM=void 0,this.ow=(t,e)=>{const i=t.Jc(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.Qn=d,this.qb=a,this.we=ye(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=cu(s,this.LM,this.ow,Ke);if(void 0!==r){const t=ct(r[0],this.Is.ls.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}}}Xd(){return de(this.we)}Fs(){return this.Ms||this.qb}pM(t){}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Le(t,e){t.us(e),this.Is.xs()}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;for(let t=0;t{const t=i.engine.container.getBoundingClientRect();this.xC.style.left=`${t.left}px`,this.xC.style.top=`${t.top}px`,this.xC.style.width=`${t.width}px`,this.xC.style.height=`${t.height}px`};n(),i.onResize(n),this.bC(this.xC),this.MC(),this._C(),this.wC(),this.CC(e),this.chart.kC().push(this)}bC(t){this.TC=wt.document.createElement("div"),this.TC.style.pointerEvents="all",t.append(this.TC),this.FC=wt.document.createElement("div"),this.IC=new Ts(this.Zs,this.se,this.chart,this.FC),this.PC=wt.document.createElement("table"),this.PC.style.borderSpacing="0",this.TC.appendChild(this.IC.ce()),this.TC.appendChild(this.FC),this.FC.appendChild(this.PC)}_C(){let t=0,e=0,i=0,s=0,r=!1;this.vC=!1,this.TC.onmousedown=n=>{n=n||wt.event,i=n.clientX,s=n.clientY,r=!0,wt.document.onmouseup=t=>{this.vC?this.TC.addEventListener("click",Qt,!0):this.TC.removeEventListener("click",Qt,!0),r=!1,this.vC=!1,wt.document.onmouseup=null,wt.document.onmousemove=null},wt.document.onmousemove=n=>{n=n||wt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.vC=!0,this.TC.style.top=this.TC.offsetTop-e+"px",this.TC.style.left=this.TC.offsetLeft-t+"px",this.TC.style.removeProperty("right"),this.TC.style.removeProperty("bottom"))}}}wC(){let t=0,e=0,i=0,s=0,r=!1;this.TC.ontouchstart=n=>{n=n||wt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.TC.ontouchend=()=>{r=!1,wt.document.ontouchend=null,wt.document.ontouchmove=null},this.TC.ontouchmove=n=>{r&&(Qt(n),n=n||wt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.TC.style.top=this.TC.offsetTop-e+"px",this.TC.style.left=this.TC.offsetLeft-t+"px",this.TC.style.removeProperty("right"),this.TC.style.removeProperty("bottom"))}}}MC(){this.TC.style.setProperty("top","10px"),this.TC.style.setProperty("left","10px"),this.TC.style.position="absolute",this.TC.style.display="flex",this.TC.style.alignItems="flex-start",this.FC.style.setProperty("display","none")}removePositionProperty(){this.TC.style.removeProperty("top"),this.TC.style.removeProperty("left"),this.TC.style.removeProperty("bottom"),this.TC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.TC.style.setProperty("bottom","10px"),this.TC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.TC.style.setProperty("top","10px"),this.TC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.TC.style.setProperty("bottom","10px"),this.TC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.TC.style.setProperty("top","10px"),this.TC.style.setProperty("right","10px")}}CC(t){for(let e=0;e[t.Kc((()=>{this.LC+=1,this.LC>1&&this.chart.ls.Xn(dh.Cf),this.chart.ls.xs()})),t.qc((()=>this.chart.ls.xs()))])),this.ja.gd(t),this.chart.ls.xs()),this}getDataSet(){return this.zC()}setStrokeStyle(t){return this.ja.Oe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.pu()}setAreaFillStyle(t){return this.ja.yd(t),this.Is.xs(),this}getAreaFillStyle(){return this.ja.VC()}setPointFillStyle(t){return this.ja.pd(t),this.Is.xs(),this}getPointFillStyle(){return this.ja.Md()}setPointSize(t){return this.ja._d(t),this.Is.xs(),this}getPointSize(){return this.ja.OC()}setPointShape(t){return this.ja.vd(t),this.Is.xs(),this}getPointShape(){return this.ja.Sd()}setPointRotation(t){return this.ja.xd(t),this.Is.xs(),this}getPointRotation(){return this.ja.bd()}setPointAlignment(t){return this.ja.NC(t),this.chart.ls.xs(),this}getPointAlignment(){return this.ja.GC()}setCurvePreprocessing(t){return this.ja.RC(t),this.Is.xs(),this}getCurvePreprocessing(){return this.ja.WC()}add(t){return this.zC().add(t),this.Is.xs(),this}addArraysXY(t,e){return this.zC().addArraysXY(t,e),this.Is.xs(),this}appendJSON(t,e){return this.zC().appendJSON(t,e),this.Is.xs(),this}appendSample(t){return this.zC().appendSample(t),this.Is.xs(),this}appendSamples(t){return this.zC().appendSamples(t),this.Is.xs(),this}fill(t){return this.zC().fill(t),this.Is.xs(),this}setSamples(t){return this.zC().setSamples(t),this.Is.xs(),this}alterSamples(t,e){return this.zC().alterSamples(t,e),this.Is.xs(),this}alterSamplesByID(t,e){return this.zC().alterSamplesByID(t,e),this.Is.xs(),this}getSampleCount(){return this.zC().getSampleCount()}getNextSampleIndex(){return this.zC().getNextSampleIndex()}clear(){return this.zC().clear(),this.Is.xs(),this}setMaxSampleCount(t){return this.zC().setMaxSampleCount(t),this.Is.xs(),this}getMaxSampleCount(){return this.zC().getMaxSampleCount()}readBack(t){return this.zC().readBack(t)}onMaxSampleCountExceeded(t){return this.zC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.zC().offMaxSampleCountExceeded(t)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){let i=ha(e);void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.UC(),r=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}),n=s.Jc(r,i,this.scale,this.chart.pg);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}}Qi(t,e){const i=this.getDataSet(),s=null==t?void 0:t.dataPoint;return void 0===i.$c()||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:Pe({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())))}UC(){return this.zC()}Xd(){return de(this.getPointFillStyle())||de(this.getStrokeStyle().getFillStyle())||de(this.getAreaFillStyle())}rv(){var t;const e=null===(t=this.Ad)||void 0===t?void 0:t.Gt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.gc>0}pM(t){}getXMax(){return this.ja.St()}getXMin(){return this.ja.vt()}getYMax(){return this.ja.bt()}getYMin(){return this.ja.xt()}Ir(){return{x:this.ja.Cl(),y:this.ja.kl()}}zC(){if(!this.Ad){const t=new lo(this.Qn);t.Mc&&this.chart.ls.Xn(dh.Tf),t.wc&&this.chart.ls.Xn(dh.kf),this.Ad=De(t,this.Ad,(()=>[t.Kc((()=>{this.LC+=1,this.LC>1&&this.chart.ls.Xn(dh.Cf),this.chart.ls.xs()})),t.qc((()=>{this.chart.ls.xs()}))])),this.ja.gd(t)}return this.Ad.Gt}styleLegendEntry(t,e=!1){const i=this.getPointFillStyle(),s=this.getAreaFillStyle();ce(t,this.Ki,e,{stroke:this.getStrokeStyle(),fill:i!==B?i:s,behavior:{priority:"stroke"}})}Fs(){return this.Ms||this.getPointShape()}Le(t,e){t.us(e),this.Is.xs()}}const gc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.At.it(e),t.axis.dg.it(i)})))),yc=u(10,10);var mc;e.AxisPosition=void 0,(mc=e.AxisPosition||(e.AxisPosition={}))[mc.Top=0]="Top",mc[mc.Bottom=1]="Bottom",mc[mc.Left=2]="Left",mc[mc.Right=3]="Right";const pc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),xc=t=>t.setStopped(!0),Ac=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Sc=(t,e)=>{const i="linear-highPrecision"===t.Eh.type||"linear-highPrecision"===e.Eh.type,s="logarithmic"===t.Eh.type||"logarithmic"===e.Eh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Eh.type}, y: ${e.Eh.type})`;throw new Error(i)}};var vc,bc,Mc;!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"}(vc||(vc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(bc||(bc={}));class wc extends cl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("chartXY bg",0),r,i.ls.Ki.chartXYBackgroundFillStyle,i.ls.Ki.chartXYBackgroundStrokeStyle,i.ls.Ki.chartXYTitleFont,i.ls.Ki.chartXYTitleFillStyle,h),this.YC=this.up.d2({scaleXYConstructor:Bi}),this.$g=[],this.Xg=[],this.Zg=[],this.jg=[],this.HC=new Map,this.$C=!0,this.XC=!0,this.jC=!0,this.Gf=2,this.ZC=!0,this.QC=!0,this.JC=[],this.KC=this.kp.Pe(this.YC).Ie(B).Fe(nt).setMouseInteractions(!1),this.qC=this.kp.Ne(this.YC).Oe(nt).setMouseInteractions(!1),this.tk=this.kp.Ne(this.YC).Oe(nt).setMouseInteractions(!1),this.ik=this.Ki.chartXYZoomingRectangleFillStyle,this.sk=this.Ki.chartXYZoomingRectangleStrokeStyle,this.ek=this.Ki.chartXYFittingRectangleFillStyle,this.hk=this.Ki.chartXYFittingRectangleStrokeStyle,this.rk=e.MouseStyles.Default,this.nk=e.MouseStyles.Move,this.ak=e.MouseStyles.ZoomIn,this.lk=e.MouseStyles.Default,this.uk=void 0,this.nA=Cc,this.gM=0,this.ck=(t,e,i)=>{const s=t.solveNearest(e,i);return s&&je(s.cursorPosition.pointMarker.x,s.axisX.getInterval().start,s.axisX.getInterval().end)&&je(s.cursorPosition.pointMarker.y,s.axisY.getInterval().start,s.axisY.getInterval().end)?s:void 0},this.dk=gc(this.Xg,this.$g),this.fk=gc(this.Zg,this.jg),this.Ak=(t,e,i,s,r)=>{this.dk(s,r),this.fk(r,s),this.YC.it(s,r),this.ls.xs()},this.gk=(t,e)=>{this.HC.set(t,e)},this.ng=t=>{const e=this.Xg.findIndex((e=>e.axis===t)),i=this.$g.findIndex((e=>e.axis===t)),s=this.Zg.findIndex((e=>e.axis===t)),r=this.jg.findIndex((e=>e.axis===t));e>=0&&this.Xg.splice(e,1),i>=0&&this.$g.splice(i,1),s>=0&&this.Zg.splice(s,1),r>=0&&this.jg.splice(r,1),this.HC.delete(t),this.ls.xs()},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();Sc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Du.Positive)(this,this.Lv,this.Kx,e,i,this.pk(e),this.pk(i),this.fp,s,this.Ki,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length);return this.Ov(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();Sc(e,i);const s=new Pu(this,this.Lv,this.Kx,e,i,this.pk(e),this.pk(i),this.fp,this.Ki,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length);return this.Ov(s),s},this.yk=!1,this.mk=!1,this.yM=()=>{(this.$C||this.XC)&&(this.uk=this.engine.setMouseStyle(this.rk))},this.mM=()=>{this.yk=!1,this.engine.restoreMouseStyle(this.uk)},this.vM=(t,e,i)=>{var s,r;const n=Pt(null===(s=this.mA.Jn)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Pt(null===(r=this.mA.Jn)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.uk);const h=this.kp.ls.Re(e.clientX,e.clientY);i===n&&(this.$C||this.XC)?(this.vk(t,h),Qt(e)):i===o&&this.ZC&&(this.uk=this.engine.setMouseStyle(this.nk),this.mk=!0,Qt(e))},this.cv=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Pt(null===(n=this.mA.Jn)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Pt(null===(o=this.mA.Jn)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.$C||this.XC)?(this.Sk(t,s,h),Qt(e)):i===l&&this.ZC&&(this.xk(li(r,-1)),Qt(e)),this.ls.xs()},this.dv=(t,e,i,s)=>{var r,n;const o=Pt(null===(r=this.mA.Jn)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Pt(null===(n=this.mA.Jn)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.$C||this.XC)){const i=u(e.clientX,e.clientY);this.bk(t,s,i),Qt(e)}else i===h&&this.ZC&&Qt(e);this.engine.restoreMouseStyle(this.uk),this.zv.getIsUnderMouse()&&(this.uk=this.engine.setMouseStyle(this.rk)),this.yk=!1,this.mk=!1},this.uv=(t,e)=>{if(this.jC){const t=this.kp.ls.Re(e.clientX,e.clientY);this.Mk(t,u(me(e),me(e))),Qt(e)}},this._k=(t,e,i,s)=>{},this.wk=(t,e,i,s,r,n)=>{if(this.ZC){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.xk(t),Qt(n),this.mk=!0}if(this.jC){const t=this.ls.Vo({clientX:e.x,clientY:e.y}),o=this.ls.Vo({clientX:i.x,clientY:i.y}),h=ci(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")})),Qt(n),this.yk=!0}},this.Ck=(t,e,i,s)=>{this.mk=!1,this.yk=!1},this.kk=(t,e,i)=>{(this.XC||this.$C)&&(this.vk(t,e),Qt(i))},this.Tk=(t,e,i,s,r)=>{(this.XC||this.$C)&&(this.Sk(t,e,i),Qt(r))},this.Fk=(t,e,i,s)=>{(this.XC||this.$C)&&(this.bk(t,e,i),Qt(s))},this.ls.Xn(dh.xf),this.setPadding({right:24}),this.Ik=i.Mx("chartXY series bg",vc.seriesBackground),this.Pk=[vc.gridLine0,vc.gridLine1,vc.gridLine2].map((t=>i.Dk(`chartXY gridline #${t}`,t))),this.hg=i.Dk("chartXY highlighters below",vc.highlightersBelow),this.Kx=i.Hy("chartXY plotting",bc.plotting),this.rg=i.Hy("chartXY highlighters above",bc.highlightersAbove),this.TA=i.Hy("chartXY fg",bc.fg),this.YC.x.q(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.wa.left+this.wa.right)),this.YC.y.q(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.wa.bottom+this.wa.top)),this.YC.it(this.uiScale.oi().x,this.uiScale.oi().y),this.zv=this.Ik.Pe(this.YC).Ie(this.Ki.chartXYSeriesBackgroundFillStyle).Fe(nt),this.Vv=this.TA.Pe(this.YC).Ie(B).Fe(this.Ki.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.setSeriesBackgroundEffect(!1);const a=Pt(o?o.cursorBuilder:void 0,ac),l=i.Xy();this.jy=la(this,l,a.gy(l,this.YC,this.YC,kt,this.Ki),this,"show-all",kc,((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.Ak),this.mh.gr("ChartXY"),this.fv=ji(new $i(this.kk,this.Tk,this.Fk,1),new Qi(this._k,this.wk,this.Ck)),this.onSeriesBackgroundMouseEnter(this.yM),this.onSeriesBackgroundMouseLeave(this.mM),this.onSeriesBackgroundMouseWheel(this.uv),this.onSeriesBackgroundMouseDragStart(this.vM),this.onSeriesBackgroundMouseDrag(this.cv),this.onSeriesBackgroundMouseDragStop(this.dv),this.onSeriesBackgroundTouchStart(this.fv.onTouchStart),this.onSeriesBackgroundTouchMove(this.fv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.fv.onTouchEnd),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this._p(n,this.YC)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.jy.solveNearest(t,e,this.Dv,this.ck)}addCursor(t=ac){const e=this.fp(),i=t.gy(e,this.YC,this.YC,this.ap(e),this.Ki);return this.xp(i),i}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.wa.left+this.wa.right,t.y+=this.Xt.top+this.Xt.bottom+this.wa.top+this.wa.bottom;const e=this.mh.Ls().td(),i=S(Tc(this.nA||Cc),this.Cp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Bk&&(t.x+=this.Bk.left,t.x+=this.Bk.right,t.y+=this.Bk.top,t.y+=this.Bk.bottom),t.x+=yc.x,t.y+=yc.y,t}addAxisX(t){var e,i;const{opposite:s,type:r}=lh(t);let n;n="linear"===r.type?this.up.d1({dimension:"x",scale1DConstructor:Li}):"linear-highPrecision"===r.type?this.up.d1({dimension:"x",scale1DConstructor:Li}).Mi():this.up.d1({dimension:"x",scale1DConstructor:Ci}).Ai(r.base),n.it(this.YC.x.oi());const o=s?this.$g:this.Xg,h=new gh(this.Pk,this.TA,this.kp,this.hg,this.rg,this.ls.ss,n,this.YC.y,(a=()=>h.Dg(),{...mh,...rc(a)}),this,s?100:0,this.ng,this.gk,this.Ki,this.ah,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.ls.xs(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=lh(t);let n;n="linear"===r.type?this.up.d1({dimension:"y",scale1DConstructor:Li}):"linear-highPrecision"===r.type?this.up.d1({dimension:"y",scale1DConstructor:Li}).Mi():this.up.d1({dimension:"y",scale1DConstructor:Ci}).Ai(r.base),n.it(this.YC.y.oi());const o=s?this.jg:this.Zg,h=new gh(this.Pk,this.TA,this.kp,this.hg,this.rg,this.ls.ss,n,this.YC.x,(a=()=>h.Dg(),{...ph,...nc(a)}),this,s?100:0,this.ng,this.gk,this.Ki,this.ah,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.ls.xs(),h}swapAxes(t,e){const i=[this.Xg,this.Zg,this.jg,this.$g],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.ls.xs(),this}dispose(){return this.jy.Y(),this.Ik.Y(),this.Kx.Y(),this.TA.Y(),this.Pk.forEach((t=>t.Y())),this.rg.Y(),this.hg.Y(),this.kC().forEach((t=>t.dispose())),ia(this.YC),this.Xg.slice().forEach((t=>t.axis.dispose())),this.Zg.slice().forEach((t=>t.axis.dispose())),this.jg.slice().forEach((t=>t.axis.dispose())),this.$g.slice().forEach((t=>t.axis.dispose())),this.Dv.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.Xg,...this.$g].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.Zg,...this.jg].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):pc;return Dt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.$g.map((t=>t.axis));case e.AxisPosition.Bottom:return this.Xg.map((t=>t.axis));case e.AxisPosition.Left:return this.Zg.map((t=>t.axis));case e.AxisPosition.Right:return this.jg.map((t=>t.axis))}})))}Lk(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.Xg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.$g.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.Zg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.jg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.nA=t,this.ls.xs(),this}getTitlePosition(){return this.nA}Rk(t,e,i,s){const r=this.nA||Cc;let n,o=S(Tc(r),this.Cp);this.getTitleFillStyle()===B||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.mh.Ls().td();const h=Math.abs(s)+this.wa.bottom+this.Xt.bottom,a=Math.abs(i)+this.wa.top+this.Xt.top,l={left:Math.abs(t)+this.wa.left+this.Xt.left,right:Math.abs(e)+this.wa.right+this.Xt.right,top:a,bottom:h},u=this.uiScale.Wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Rc(r,u,l,n,o,this.wa);return this.mh.Be(f).Na(c).Wa(d),g}De(t){super.De(t);for(const t of this.Dv)t.yv();for(const t of this.Dv)t.De();const e=ve(this.Dv.map((t=>t.SM()))),i=new Set(e.map((t=>t.Ek)));if(1===i.size){const t=Array.from(i)[0],s="x"===t?[this.Xg,this.$g]:[this.Zg,this.jg],r="y"===t?[this.Xg,this.$g]:[this.Zg,this.jg];s.forEach((t=>t.forEach((t=>t.axis.Pr())))),e.forEach((t=>t.zk())),r.forEach((t=>t.forEach((t=>t.axis.Pr()))))}else this.Zg.forEach((t=>t.axis.Pr())),this.Xg.forEach((t=>t.axis.Pr())),this.$g.forEach((t=>t.axis.Pr())),this.jg.forEach((t=>t.axis.Pr()));const s=this.Zg.map((t=>t.axis.Ls())),r=this.Xg.map((t=>t.axis.Ls())),n=this.$g.map((t=>t.axis.Ls())),o=this.jg.map((t=>t.axis.Ls()));let h=!1;this.forEachAxis((t=>{(t.Rr()||t.Er())&&(h=!0)}));const a=this.yk||this.mk||!this.QC&&h,l=new Set(this.getAxes().map((t=>t.getStackIndex()))).size>1;this.jy.De(a,l?this.Dv.sort(((t,e)=>e.axisY.getStackIndex()-t.axisY.getStackIndex())):this.Dv,this.ck,{afterCursorPointedAt:t=>{const e=this.ls.Hn();if(t.length>1&&e){const t=this.ls.Vo(e);this.jy.Rp.ly({x:t.engineX,y:t.engineY},this.ls.At)}},overrideCursorPositions:(t,e)=>t.map((t=>t.multiHit?t.multiHit.map((e=>({...t.cursorPosition,pointMarker:e}))):[t.cursorPosition])).flat()});const c=Ec(this.Zg,s),d=Ec(this.Xg,r),f=Ec(this.$g,n),g=Ec(this.jg,o),y=this.Rk(c.thicknessTotal,g.thicknessTotal,f.thicknessTotal,d.thicknessTotal),p=this.YC.x.getCellSize()-(y.left+y.right),x=this.YC.y.getCellSize()-(y.bottom+y.top),A=[y.left,y.right],S=[y.bottom,y.top];this.YC.x.q(0,p),this.YC.y.q(0,x),this.YC.x.si(A),this.YC.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.Rg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.aA+e.axis.lA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Ud?e.axis.Ud.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.Ud?h.Ud.pixels:h.Ud.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.aA:0,f=a?i[1]+(e-n)-c-h.aA:0;h.At.si([d,f]),h.De({Rg:o,Eg:s.Eg,Og:c,Vk:n,Hg:o+s.Eg,Gg:r}),a&&(n+=c+h.aA+h.lA)})),r+=s*t.thicknessMax}))};v(c,x,S,-1),v(g,x,S,1),v(d,p,A,-1),v(f,p,A,1),this.Bk={left:c.thicknessTotal,top:f.thicknessTotal,right:g.thicknessTotal,bottom:d.thicknessTotal},this.zv.Be(u(0,0)).it(u(p,x)),this.Vv.Be(u(0,0)).it(u(p,x));const b=m(this.YC.x.ei(),this.YC.y.ei(),this.YC.x.ri(),this.YC.y.ri());this.Kx.ux(b),this.hg.ux(b),this.rg.ux(b),this.ep&&this.ep(),super.Mp(),this.Xg.forEach((t=>t.axis.Qg())),this.$g.forEach((t=>t.axis.Qg())),this.Zg.forEach((t=>t.axis.Qg())),this.jg.forEach((t=>t.axis.Qg()));for(const t of this.Dv)t.bm()}J(){for(let t=0;t=10;h&&c&&l.x===r.x&&this.XC?(this.yk=!0,this.KC.Ie(this.ek).Fe(this.hk),this.qC.Oe(this.hk).We(r).Ge(o),this.tk.Oe(this.hk).We(u(r.x,o.y)).Ge(u(o.x,r.y)),this.uk=this.engine.setMouseStyle(this.lk,this.uk)):h&&c&&(this.$C||this.XC)?(this.yk=!0,this.KC.Ie(this.ik).Fe(this.sk),this.qC.Oe(nt),this.tk.Oe(nt),this.uk=this.engine.setMouseStyle(this.ak,this.uk)):(this.yk=!1,this.KC.Fe(nt).Ie(B),this.qC.Oe(nt),this.tk.Oe(nt),this.engine.restoreMouseStyle(this.uk)),this.ls.xs()}bk(t,e,i){if(this.yk){const t=this.ls.Vo({clientX:i.x,clientY:i.y}),s=ct({x:t.engineX,y:t.engineY},this.kp.ls.At,this.YC),r=je(s.x,this.YC.x.getInnerStart(),this.YC.x.getInnerEnd())&&je(s.y,this.YC.y.getInnerStart(),this.YC.y.getInnerEnd()),n=i.x>=e.x||!this.XC?"zoom":"fit",o=this.KC.za(),h=ui(o,this.KC.oi()),a=Math.min(this.KC.oi().x,this.KC.oi().y)>=10;r&&a&&"zoom"===n&&this.$C?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=ct(o,this.YC,t.Ag).x,i=ct(h,this.YC,t.Ag).x;t.yt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=ct(o,this.YC,t.Ag).y,i=ct(h,this.YC,t.Ag).y;t.yt(e,i,!0,!0,"interactionSetInterval")}}))):r&&a&&"fit"===n&&this.XC&&this.forEachAxis(Ac)}this.KC.Fe(nt).Ie(B),this.qC.Oe(nt),this.tk.Oe(nt),this.ls.xs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}xk(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(xc),this.forEachAxisX((i=>{i.zoom(i.At.dt(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.At.dt(t.y),e.y)}))}Mk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(xc(i),i.zoom(i.At.dt(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(xc(i),i.zoom(i.At.dt(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}if(){const t=[];return this.forEachAxis((e=>e.Tg((e=>t.push(e))))),super.if().concat(t)}kC(){return this.JC}Se(){return this.Ip(this.Kx)}setCursorEnabledDuringAxisAnimation(t){return this.QC=t,this}getCursorEnabledDuringAxisAnimation(){return this.QC}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=xh(r)?r:Yi(r)?this.pg:void 0;if(n&&Oi(i)){const t=ct(s,n,this.ls.At);return this.ls.Oo({engineX:t.x,engineY:t.y})}if(n&&Yi(i))return ct(s,n,this.pg);if(n&&xh(i))return ct(s,n,i)}else{const i=t;if(Yi(e)){const t=this.ls.Vo(i);return ct({x:t.engineX,y:t.engineY},this.ls.At,this.pg)}if(xh(e)){const t=e,s=this.ls.Vo(i);return ct({x:s.engineX,y:s.engineY},this.ls.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(Mc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Mc.RightTop="right-top",Mc.LeftTop="left-top",Mc.CenterBottom="center-bottom",Mc.RightBottom="right-bottom",Mc.LeftBottom="left-bottom",Mc.SeriesCenterTop="series-center-top",Mc.SeriesRightTop="series-right-top",Mc.SeriesLeftTop="series-left-top",Mc.SeriesCenterBottom="series-center-bottom",Mc.SeriesRightBottom="series-right-bottom",Mc.SeriesLeftBottom="series-left-bottom";const Cc=e.ChartXYTitlePositionOptions.CenterTop,Tc=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 we(0,`Unexpected ChartXY title position selection ${t}`)},Rc=(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 we(0,`Unexpected ChartXY title position selection ${t}`)},Ec=(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.Rg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Eg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Yd)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Ud?e.axis.Ud.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)}},kc=(t,e,i)=>{var s;const r=Array.from(new Set(i.map((t=>t.series.cs())))),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 ft(e)?aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:ah(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?[[ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...aa(e,[[e.series,""],[`${o.valueDimension}1`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:[[ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...aa(e,[[e.series,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:e.multiHit?aa(e,[[e.series],[o.progressiveDimension,"",{text:ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[`${o.valueDimension}1`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]]):aa(e,[[e.series],[o.progressiveDimension,"",{text:ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]]):n?[ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),...i.map((t=>t.multiHit?aa(t,[[t.series,""],[`${o.valueDimension}1`,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t.multiHit[0])),o.hitValueAxis(t)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t.multiHit[1])),o.hitValueAxis(t)),font:{weight:"bold"}}]]):aa(t,[[t.series,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()]:i.map((t=>aa(t,[[t.series],[o.progressiveDimension,"",{text:ah(o.progressiveAxis.formatValue(o.position(t)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()};class Ic{constructor(t,e,i,s,n,o,h){this.coordsRelative="relative",this.coordsClient="client",this.R=new r.Eventer,this.Ok=[],this.Nk=new Map,this.Dv=new Map,this.Gk=(t,e,i)=>{0!==this.Dv.size&&void 0!==[...this.Dv.values()].find((({series:t})=>!0===t.getVisible()))||this.Wk.yt(e,i,!1,!1,"zoomBandChart"),this.Uk.ls.xs()},e.ls.Xn(dh.vf),this.mA=t,this.Yk=(null==o?void 0:o.orientation)||"x",this.Hk=void 0!==(null==o?void 0:o.useSharedValueAxis)&&o.useSharedValueAxis,this.$k=s,this.Xu="x"===this.Yk?mh:ph;const a={...o,defaultAxisX:this.Xu.getWidth({x:null==o?void 0:o.defaultAxis,y:void 0}),defaultAxisY:this.Xu.getHeight({x:null==o?void 0:o.defaultAxis,y:void 0})};this.Uk=new wc(t,e,i,kt,n,a,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setCursorMode(void 0),this.engine=this.Uk.engine;const l=this.Uk.getDefaultAxisX().setMouseInteractions(!1),u=this.Uk.getDefaultAxisY().setMouseInteractions(!1);this.Wk=this.Xu.getWidth({x:l,y:u}).setScrollStrategy(Os.fitting).setAnimationScroll(!1).setStrokeStyle(nt).setTickStrategy(Us.Empty),(null==o?void 0:o.useSharedValueAxis)?this.Xk=this.Xu.getHeight({x:l,y:u}):this.Xu.getHeight({x:l,y:u}).dispose();const c=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new U({color:this.getTheme().isDark?w(0,0,0,180):w(255,255,255,180)});this.jk=[this.Uk.TA.Pe(this.Wk.Ag).Ie(c).Fe(nt),this.Uk.TA.Pe(this.Wk.Ag).Ie(c).Fe(nt)];const d=this.Uk.TA.Wg(this.Wk.Ag).Oe(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.Zk={collection:d,members:new Array(5).fill(0).map((t=>d.Hr()))};const f=this.getTheme(),g="function"==typeof f.zoomBandChartKnobFillStyle?f.zoomBandChartKnobFillStyle(this.mA.Zs):f.zoomBandChartKnobFillStyle||B;this.Qk=[this.Uk.TA.Pe(this.Uk.pg).Ie(g).Fe(nt),this.Uk.TA.Pe(this.Uk.pg).Ie(g).Fe(nt)],this.Jk=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.Kk()}add(t){var e,i,s,r,n;const o=this.Ok.map((t=>t.axis)),h="x"===this.Yk?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Gk);this.Ok.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Wk.tr(h.qh()),this.qk&&this.qk.remove(),this.qk=dt(...this.Ok.map((t=>t.axis)))}const a=this.Xu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.Hk)l=this.Xk;else{const t=this.Nk.get(a);t?l=t:(l=this.Xu.getHeight({x:this.Uk.addAxisX.bind(this.Uk),y:this.Uk.addAxisY.bind(this.Uk)})(),this.tT(l)),this.Nk.set(a,l)}const u=this.Xu.getWidth({x:this.Wk,y:l}),c=this.Xu.getHeight({x:this.Wk,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.HM(r)));const n=t.$M((()=>e.clear()));f.push((()=>{t.XM(n)}))};if(t instanceof fc)d=this.Uk.addPointLineAreaSeries({...t.Qn,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.UC());else if(t instanceof uc||t instanceof tc){const i=this.Uk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof uc?null===(e=t.Qn)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof uc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Fc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof ku){const e=this.Uk.addAreaSeries({xAxis:u,yAxis:c,baseline:t.Q_}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof cc){const e=this.Uk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.Qn)||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 Ju){const e=this.Uk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.Qn)||void 0===s?void 0:s.pointShape,mode:t.mw}).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.Uk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.Qn)||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 zu){const e=this.Uk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.Qn)||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 Pu){const e=this.Uk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.UM()),i=t.YM(((t,i)=>e.add(i)));f.push((()=>t.HM(i))),d=e;const s=t.$M((()=>e.clear()));f.push((()=>{t.XM(s)}))}else{if(!(t instanceof vu))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.Uk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.e_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.n_(d);const s=t.l_(((t,i)=>e.invalidateIntensityValues(i))),r=t.o_(i);f.push((()=>{t.u_(s),t.a_(r)}));const n=t.$M((()=>e.clear()));f.push((()=>{t.XM(n)}))}}d.setMouseInteractions(!1);const y=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(y)}));const m=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(m)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.Dv.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.Dv.get(t);if(e){const{clearReferences:i}=e;i(),this.Dv.delete(t),e.series.dispose();const s=this.Xu.getHeight({x:t.axisX,y:t.axisY}),r=this.Nk.get(s);r&&0===r.Dg().length&&(this.Nk.delete(s),r.dispose())}const i="x"===this.Yk?t.axisX:t.axisY;if(!Array.from(this.Dv.keys()).find((t=>i===("x"===this.Yk?t.axisX:t.axisY)))){const t=this.Ok.findIndex((t=>t.axis===i));this.Ok[t].deattach(),this.Ok.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.jk.forEach((e=>e.Ie(t))),this.Uk.ls.xs(),this}getDefocusOverlayFillStyle(){return this.jk[0].Hh()}setSplitterStrokeStyle(t){return this.Zk.collection.Oe(t),this.Uk.ls.xs(),this}getSplitterStrokeStyle(){return this.Zk.collection.pu()}setKnobFillStyle(t){return this.Qk.forEach((e=>e.Ie(t))),this.Uk.ls.xs(),this}getKnobFillStyle(){return this.Qk[0].Hh()}setKnobStrokeStyle(t){return this.Qk.forEach((e=>e.Fe(t))),this.Uk.ls.xs(),this}getKnobStrokeStyle(){return this.Qk[0].po()}setKnobSize(t){return this.Jk=t,this.Uk.ls.xs(),this}getKnobSize(){return this.Jk}getDefaultAxisX(){return this.Uk.getDefaultAxisX()}getDefaultAxisY(){return this.Uk.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}tT(t){t.setTickStrategy(Us.Empty).setMouseInteractions(!1).setNibStyle(nt).setStrokeStyle(nt)}Kk(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.Yk?null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Dv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Wk.getInterval();Math.abs(this.Wk.At.ft(t)-this.Wk.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.Xu.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.Yk?null===(e=Array.from(this.Dv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.Xu.getWidth(this.Uk.translateCoordinate(t,this.Uk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),Qt(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=ji(new $i(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.Uk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.Uk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.Yk?null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Dv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Wk.At.pi(o.start,this.Xu.getWidth(t)),a=this.Wk.At.pi(o.end,this.Xu.getWidth(t));i(h,a,!1),Qt(e)};this.Uk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=ji(new $i(void 0,((t,e,i,r,n)=>s(r,n))));this.Uk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.Yk?null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Dv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Wk.getInterval(),a=this.Xu.getWidth(this.Uk.translateCoordinate(e,this.Uk.coordsAxis)),l=this.Wk.At.ft(o.start),u=this.Wk.At.ft(o.end),c=this.Wk.At.ft(a),d=Ft((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Gf,g=d*f*-Math.sign(e.deltaY),y=(1-d)*f*Math.sign(e.deltaY),m=Ft(this.Wk.At.pi(o.start,g),h.start,h.end),p=Ft(this.Wk.At.pi(o.end,y),h.start,h.end);i(m,p,!1),Qt(e)})),this.Uk.onSeriesBackgroundTouchStart(r.onTouchStart),this.Uk.onSeriesBackgroundTouchMove(r.onTouchMove),this.Uk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.jk.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.Yk?null===(e=Array.from(this.Dv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.Xu.getWidth(this.Uk.translateCoordinate(t,this.Uk.coordsAxis)),o=r.getInterval(),h=this.Wk.getInterval(),a=Ft(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),Qt(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=ji(new class{constructor(t,e=300){this.Rs=!1,this.Es=[],this.zs=300,this.Vs=t,this.zs=e}Bs(t,e){const i=wt.performance.now();let s=!1;for(let t=0;t=this.zs?(this.Es.splice(t,1),t-=1):this.Es[t].state&&(s=!0);return this.Rs?0===e.interactions.length&&(this.Es.push({state:!1,time:i}),this.Rs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Es.push({state:!0,time:i}),s=!0,this.Rs=!0),s}Ls(t,e,i){if(i&&!this.Rs){const i=this.Es.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Vs(t,e),this.Es.length=0)}}}(((t,e)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.Uk.getSizePixels()}onResize(t){return this.Uk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.Uk.offResize(t)}zr(t){this.Uk.zr(t)}getMinimumSize(){return this.Uk.getMinimumSize()}J(){return this.Uk.J()}K(){return this.Uk.K()}De(t){var e,i,s,r;const n=Se(Array.from(this.Dv.keys()).map((t=>t.chart))),o="x"===this.Yk?null===(e=Array.from(this.Dv.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.Dv.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.Yk){const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(0!==t.lg)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.Jg())}));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.lg)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.Jg())}));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.Uk.forEachAxisY((t=>t.setThickness(0))),null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.Uk.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.lg)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.Jg())}));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.lg)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.Jg())}));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.Uk.forEachAxisX((t=>t.setThickness(0))),null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.Uk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.Uk.De(t);const h=this.Wk.getInterval().start,a=this.Wk.getInterval().end,l=Ft(o?o.getInterval().start:h,h,a),u=Ft(o?o.getInterval().end:a,h,a),c=this.Xu.getHeight(this.Uk.YC.getInnerIntervalPixels());this.jk[0].Be(this.Xu.toPoint(h,0)).it(this.Xu.toPoint(l-h,c)),this.jk[1].Be(this.Xu.toPoint(u,0)).it(this.Xu.toPoint(a-u,c)),this.Zk.members[0].Yg(this.Xu.toPoint(h,c),this.Xu.toPoint(l,c)),this.Zk.members[1].Yg(this.Xu.toPoint(l,c),this.Xu.toPoint(l,0)),this.Zk.members[2].Yg(this.Xu.toPoint(l,0),this.Xu.toPoint(u,0)),this.Zk.members[3].Yg(this.Xu.toPoint(u,0),this.Xu.toPoint(u,c)),this.Zk.members[4].Yg(this.Xu.toPoint(u,c),this.Xu.toPoint(a,c));const d=ct(this.Xu.toPoint(l,c/2),this.Wk.Ag,this.Uk.pg),f=ct(this.Xu.toPoint(u,c/2),this.Wk.Ag,this.Uk.pg),g=this.Jk;this.Qk[0].Be({x:d.x-g.x/2,y:d.y-g.y/2}).it({x:g.x,y:g.y}).Zh(this.Xu.getWidth({x:0,y:90})),this.Qk[1].Be({x:f.x-g.x/2,y:f.y-g.y/2}).it({x:g.x,y:g.y}).Zh(this.Xu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.Uk.setSeriesBackgroundFillStyle(t),this.Uk.ls.xs(),this}getSeriesBackgroundFillStyle(){return this.Uk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.Uk.setSeriesBackgroundStrokeStyle(t),this.Uk.ls.xs(),this}getSeriesBackgroundStrokeStyle(){return this.Uk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.Uk.setSeriesBackgroundEffect(t),this.Uk.ls.xs(),this}getSeriesBackgroundEffect(){return this.Uk.getSeriesBackgroundEffect()}getTheme(){return this.Uk.getTheme()}setTitle(t){return this.Uk.setTitle(t),this}getTitle(){return this.Uk.getTitle()}setTitleFillStyle(t){return this.Uk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.Uk.getTitleFillStyle()}setTitleFont(t){return this.Uk.setTitleFont(t),this}getTitleFont(){return this.Uk.getTitleFont()}setTitleMargin(t){return this.Uk.setTitleMargin(t),this}getTitleMargin(){return this.Uk.getTitleMargin()}setPadding(t){return this.Uk.setPadding(t),this}getPadding(){return this.Uk.getPadding()}setBackgroundFillStyle(t){return this.Uk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.Uk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.Uk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.Uk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return ta(t,e,i,this.Uk.pg,this.Uk.ls)}addUIElement(t,e){return this.Uk.addUIElement(t,e)}addLegendBox(t,e){return this.Uk.addLegendBox(t,e)}getLegendBoxes(){return this.Uk.getLegendBoxes()}saveToFile(t,e,i){return this.Uk.saveToFile(t,e,i),this}dispose(){return this.Uk.dispose(),this.Nk.clear(),this.Dv.clear(),this.$k(this),this}isDisposed(){return this.Uk.isDisposed()}onDispose(t){return this.Uk.onDispose((()=>t(this)))}offDispose(t){return this.Uk.offDispose(t)}}const Fc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof uc||t instanceof ku?t.getStrokeStyle().getFillStyle():t instanceof cc||t instanceof zu?t.getPointFillStyle():void 0)(t);return e?new Ji({thickness:2,fillStyle:e}):void 0};class Dc extends Kl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Series",this.$b=[],this.Xb=!1,this.Kb=3,this.ba=0,this.we=ye(this.Ki.polarPointSeriesFillStyle,o),this.Ad=new lo({dataPattern:null}),this.ja=t.md(r).Oe(nt).yd(B).pd(this.we).vd(e.PointShape.Circle)._d(this.Kb).us(this.getHighlight()).gd(this.Ad),this.ds(this.ja)}solveNearest(t,e="show-nearest"){const i=this.chart.translateCoordinate(t,this.chart.coordsAxis),s=$l([i],this.scale)[0],r=this.Ad.Jc(s,ha(e),this.scale,this.chart.pg);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setPointAlignment(t){return this.ja.NC(t),this.chart.ls.xs(),this}getPointAlignment(){return this.ja.GC()}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.ja.pd(e),this.Is.xs(),this}getPointFillStyle(){return this.we}setPointSize(t){return this.Kb=t,this.ja._d(t),this.Is.xs(),this}getPointSize(){return this.Kb}setPointShape(t){return this.ja.vd(t),this.chart.ls.xs(),this}getPointShape(){return this.ja.Sd()}setPointRotation(t){return this.ba=t,this.ja.xd(t),this.Is.xs(),this}getPointRotation(){return this.ba}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.Ad.clear().add(t),this.ja.Ko(e),this.Xb=!1,this.ja.Ls()}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Fs(){return this.Ms||this.getPointShape()}}class Pc{constructor(t,e,i,s){this.R=new r.Eventer,this.iT=!1,this.ee=t,this.sT=e,this.Dv=i,this.ja=s}setGeometry(t){return this.eT=t,this.iT=!0,this.ee.ls.xs(),this}getGeometry(){return this.eT}setMouseInteractions(t){return this.ja.setMouseInteractions(t),this}dispose(){return this.ja.dispose(),this.sT(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.ja.getVisible()!==t;return this.ja.setVisible(t),e&&this.R.emit("visibleStateChanged",this,t),this.ee.ls.xs(),this}getVisible(){return this.ja.getVisible()}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Lc extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Polygon Series",this.hT=[],this.rT=[],this.nT=t=>{const e=this.rT.indexOf(t);e>=0&&this.rT.splice(e,1);const i=this.hT.findIndex((e=>e===t.ja));i>=0&&this.hT.splice(i,1),this.Is.xs()},this.we=ye(this.Ki.polarPolygonSeriesFillStyle,n),this.Ce=ye(this.Ki.polarPolygonSeriesStrokeStyle,n)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=cu(s,this.hT,((t,e)=>{const i=t.Jc(e);if(i)return ct(i,this.scale,t.ls.At)}),Ke);if(!r)return;const n=ct(r[0],r[1].ls.At,this.scale);if(!this.oT(r[1]))return;const o=Jl(n,this.scale);return{cursorPosition:{pointMarker:n,pointMarkerScale:this.scale,resultTable:n,resultTableScale:this.scale},series:this,...o}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}addPolygon(){const t=new Pc(this.chart,this.nT,this,this.aT());return this.rT.push(t),t}setFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;for(const t of this.hT)t.Ie(e);return this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;for(const t of this.hT)t.Fe(e);return this.Is.xs(),this}getStrokeStyle(){return this.Ce}rv(){return this.av&&void 0!==this.rT.find((t=>void 0!==t.lT))&&this.getVisible()}De(){this.rT.forEach((t=>{(t.iT||this.scale.Jb())&&t.uT&&(t.ja._l($l(t.uT,this.scale)),t.iT=!1,t.ja.Ls())}))}yv(){super.yv();const t=y(Be,ze);this.rT.forEach((e=>{if(!e.eT)return;const i=!e.iT&&e.uT?e.uT:ql(e.eT);e.uT=i;const s=!e.iT&&e.lT?e.lT:Ql(i);e.lT=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Gb=t}Le(t,e){t.us(e),this.Is.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}aT(){const t=this.Is.oc(this.scale,cn.Simple).Ie(this.we).Fe(this.Ce).us(this.getHighlight());return this.hT.push(t),this.ds(t),t}oT(t){return this.rT.find((e=>e.ja===t))}}class Vc extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Area Series",this.$b=[],this.Xb=!1,this.jb=!1,this.cT=!1,this.we=ye(this.Ki.polarAreaSeriesFillStyle,n),this.Ce=ye(this.Ki.polarAreaSeriesStrokeStyle,n)}setData(t){0!==this.$b.length&&this.chart.ls.Xn(dh.Cf);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}}class _c extends Vc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.dT=this.Is.oc(this.scale,cn.Simple).us(this.getHighlight()),this.ds(this.dT)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.dT.Jc(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}De(){if(this.Xb||this.scale.Jb()){const t=this.$b,e=!0===this.jb?$l(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(It(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;!It(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.fT.start}Lb(t){this.AT=t,this.vT=!0}Eb(){return!1===this.AT}Rb(t){this.gT=t,this.vT=!0}Pb(){return this.gT}yi(){return this.Si}_i(){return!1}ct(t,e,i,s){return this.x=new Li(t.x,e.x,i.x,s?s.x:void 0),this.y=new Li(t.y,e.y,i.y,s?s.y:void 0),this}mi(){return this.di}Jb(){return this.mT}bT(){return this.vT}Wi(){return this.ST}J(){return this.u=!1,this.Si=!1,this.mT=!1,this.vT=!1,this}K(){return this.u=!0,this.Si=!0,this.mT=!0,this.vT=!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.xT(),this}Ei(t){return this.pT=t,this.xT(),this}zi(t){return this.yT=t,this.xT(),this}ni(){return u(this.pT[0]+this.pT[1],this.yT[0]+this.yT[1])}oi(){return this.Z}xT(){const t=this.fT,e=u(this.x.ai(this.Z.x),this.y.ai(this.Z.y)),i=this.pT[0]+this.pT[1],s=this.yT[0]+this.yT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.pT[0]+Math.max((r-2*o)/2,0),this.pT[1]+Math.max((r-2*o)/2,0)],a=[this.yT[0]+Math.max((n-2*o)/2,0),this.yT[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.ST={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.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(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 zc extends cl{constructor(t,e,i,s,r,n,o){super(t,e,i,e.wp("polarChart bg",0),s,e.ls.Ki.polarChartBackgroundFillStyle,e.ls.Ki.polarChartBackgroundStrokeStyle,e.ls.Ki.polarChartTitleFont,e.ls.Ki.polarChartTitleFillStyle,o),this.coordsClient="client",this.eA=[],this.No=!0,this.MT=(t,e,i,s,r)=>{this.fb.it(s,r)},this.oA=ee(this.eA),this._T=t=>{this.eA.push(t)},this.wT=()=>this.Dv,this.ls.Xn(dh.yf),this.Ik=e.Mx("polarChart series bg",0),this.CT=e.Hy("polarChart axis gridlines",0),this.kT=e.Hy("polarChart series",1),this.TT=e.Hy("polarChart axis lines",2),this.FT=e.Hy("polarChart axis ticks",3),this.fb=i.d2({scaleXYConstructor:Bc}),this.onResize(this.MT),this.mh.gr("Polar Chart"),this.zv=this.Ik.hd(this.fb).Ie(this.Ki.polarChartSeriesBackgroundFillStyle).Fe(nt).lu(0).Ge(360).fu(0),this.Vv=this.Ik.hd(this.fb).Ie(B).Fe(this.Ki.polarChartSeriesBackgroundStrokeStyle).lu(0).Ge(360).fu(0),super.Ev(this.zv,this.Vv),this._p(r,this.pg),this.IT=new Ol(this,this.fb,this.Ki,!1!==(null==n?void 0:n.animationsEnabled),this.CT,this.TT,this.FT,this.ss,this.wT),this.PT=new Yl(this,this.fb,this.Ki,!1!==(null==n?void 0:n.animationsEnabled),this.CT,this.TT,this.FT,this.ss),this.coordsAxis={axisAmplitude:this.IT,axisRadial:this.PT};const h=e.Xy(),a=Pt(n?n.cursorBuilder:void 0,Ta);this.jy=la(this,h,a.gy(h,this.uiScale,this.uiScale,kt,this.Ki),this,"show-nearest",Oc,((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.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.jy.solveNearest(t,e,this.Dv,((t,e,i)=>t.solveNearest(e,i)))}addCursor(t=Ta){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}translateCoordinate(t,e,i){if(i){const e=t,s=this.pg,r=i;if(Oi(r)){const t=ct(e,s,this.ls.At);return this.ls.Oo({engineX:t.x,engineY:t.y})}if(Yi(r))return e;if(Zl(r)){const t=ct(e,s,this.fb);return Jl(t,this.fb)}}else{const i=t,s=e;if(Ui(i)){if(Zl(s)){const t=this.ls.Vo(i),e=ct({x:t.engineX,y:t.engineY},this.ls.At,this.fb);return Jl(e,this.fb)}if(Oi(s))return i;if(Yi(s)){const t=this.ls.Vo(i);return ct({x:t.engineX,y:t.engineY},this.ls.At,this.pg)}}else if(Hl(i)){if(Zl(s))return i;const t=$l([i],this.fb)[0];if(Oi(s)){const e=ct(t,this.fb,this.ls.At),i={engineX:e.x,engineY:e.y};return this.ls.Oo(i)}if(Yi(s))return ct(t,this.fb,this.pg)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new eu(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointSeries(t){const e=new Dc(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointLineSeries(t){const e=new iu(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addAreaSeries(t){const e=new _c(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPolygonSeries(t){const e=new Lc(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addHeatmapSeries(t){const e=new tu(this.kT,this,this.Lv,this.fb,this.Ki,this.ls.ss,t);return this.Ov(e),e}addSector(){const t=new Wl(this.kT,this,this.oA,this.fb,this.Ki,this.ls.ss);return this._T(t),t}getAmplitudeAxis(){return this.IT}get amplitudeAxis(){return this.IT}get axisAmplitude(){return this.IT}getRadialAxis(){return this.PT}get radialAxis(){return this.radialAxis}get axisRadial(){return this.radialAxis}De(t){var e,i;super.De(t),oa.Bp(this.mh,this.Cp);for(const t of this.Dv)t.yv();this.IT.Pr(),this.PT.Pr();for(const t of this.Dv)t.De();for(let t=1;t<=2;t+=1){const e=this.IT.De(),i=this.PT.De(),s=oa.Dp(this.mh,this.Cp),r=[this.wa.left+i,this.wa.right+i],n=[this.wa.bottom+i,this.wa.top+i+s];this.fb.Ei(r).zi(n);const o=4;if(!(!this.DT||Math.abs(this.DT.amplitude-e)>=o||Math.abs(this.DT.radial-i)>=o)||1!==t){this.DT={amplitude:e,radial:i};break}}const s=this.fb.Cb().start,r=this.fb.Cb().end,n=this.fb.wb()?((null===(e=this.DT)||void 0===e?void 0:e.radial)||0)*this.fb.x.getPixelSize()+r-s:((null===(i=this.DT)||void 0===i?void 0:i.radial)||0)*this.fb.x.getPixelSize()+s-r;this.zv.uu(n).Au(360),this.Vv.uu(n).Au(360);for(const t of this.eA)t.De();this.jy.De(!1,this.Dv,((t,e,i)=>t.solveNearest(e,i)));for(const t of this.Dv)t.bm();return super.Mp(),this.BT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.IT.setAnimationsEnabled(t),this.PT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.No=t,this}getMouseInteractions(){return this.No}getMinimumSize(){return u(Nc,Nc)}BT(){}forEachAxis(t){return t(this.IT),t(this.PT),this}dispose(){return this.eA.slice().forEach((t=>t.dispose())),this.jy.Y(),this.Ik.Y(),this.CT.Y(),this.kT.Y(),this.TT.Y(),this.FT.Y(),super.dispose()}if(){return[...this.Dv,...this.eA]}}const Nc=300,Oc=(t,e,i)=>{var s;return yt(e)?aa(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:ah(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}],["Intensity","",{text:ah(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]]):aa(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:ah(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}]])};class Uc extends Fa{}class Yc extends Uc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this._s="Slice",this.M=0,this.py=!1,this.LT=B,this.my=B,this.vy=this.M,this.by=K((()=>this.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.dT=e.oc(r,cn.Simple).us(this.getHighlight()),this.ds(this.dT),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.LT=t,this.my=i,this.dT.Ie(this.LT).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Zc=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Xc(i,r.x),s=Xc(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},y={x:0,y:n.bottom},m=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:y.x-x*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-A:A}`,10)},y={x:a+S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-A:A}`,10)},f.x>=d.x&&y.x>g.x&&p.dT._l([g,d,f,y])}};class Hc extends na{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("funnelChart bg",0),r,i.ls.Ki.funnelChartBackgroundFillStyle,i.ls.Ki.funnelChartBackgroundStrokeStyle,i.ls.Ki.funnelChartTitleFont,i.ls.Ki.funnelChartTitleFillStyle,o),this.Iy=[],this.Py=ka.None,this.Ly=!0,this.zy=0,this.RT=80,this.ET=20,this.zT=0,this.VT=e.FunnelSliceModes.VariableHeight,this.Ny=!0,this.Wy=t=>{const e=this.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Gy=this.Ki.effectsText,this.Yy=i.Hy("funnelChart bottom",0),this.$y=i.Hy("funnelChart top",1),this.mh.gr("Funnel Chart"),this.Dy=this.Ki.funnelChartSliceFillStylePalette,this.By=this.Ki.funnelChartSliceStrokeStyle,this.Ry=this.Ki.funnelChartSliceLabelFont,this.Ey=this.Ki.funnelChartSliceLabelFillStyle;const a=i.Xy(),l=Pt(h?h.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Wc,(()=>0)),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled)),this._p(n,this.pg)}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new Yc(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);return this.zy+=1,i.setName(t),i.setValue(e),i.ss.hs.Ss(this.Gy),i.ss.rs.Ss(this.Ny),this.Iy.push(i),this.ls.xs(),i.setHighlightOnHover(this.Ly),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){return this.Ey="function"==typeof t?t(this.Ey):t,this.ls.xs(),this}getLabelFillStyle(){return this.Ey}setLabelFont(t){return this.Ry="function"==typeof t?t(this.Ry):t,this.ls.xs(),this}getLabelFont(){return this.Ry}setLabelEffect(t){return this.Gy=t,this.Iy.forEach((e=>e.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);this.Iy=this.Iy.sort(this.Py);for(let t=0,{length:e}=this.Iy;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.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e){t.setStyle(this.$d?new U({color:this.$d.getColors(t.getAnimatedValue())}):this.Dy(e,t),this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.Yy.Y(),this.$y.Y(),super.dispose()}}const Wc=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],jc=(t,i,s)=>{const r=t.wl();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}}},Kc=t=>{const e=t.wl();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 $c extends Hc{constructor(){super(...arguments),this.Qy=Ia.NamePlusValue,this.OT=10,this.NT=e.FunnelLabelSide.Left,this.GT=e.SliceLabelIndices.LabelsOnSides,this.Ky=[],this.sm=this.Ki.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),void this.Ky.forEach((t=>t.setVisible(!1)));this.WT(t,this.NT===e.FunnelLabelSide.Left?-1:1,-1,s,r);for(let t=0;tthis.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.dT=e.oc(r,cn.Simple).us(this.getHighlight()),this.ds(this.dT),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.LT=t,this.my=i,this.dT.Ie(this.LT).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},rd=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=sd(i,r.x),s=sd(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},y={x:0,y:n.bottom},m=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:y.x-x*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-A:A}`,10)},y={x:a+S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-A:A}`,10)},f.x>=d.x&&y.x>=g.x&&p.dT._l([g,d,f,y])}};class nd extends na{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("pyramidChart bg",0),r,i.ls.Ki.pyramidChartBackgroundFillStyle,i.ls.Ki.pyramidChartBackgroundStrokeStyle,i.ls.Ki.pyramidChartTitleFont,i.ls.Ki.pyramidChartTitleFillStyle,o),this.Iy=[],this.Py=ka.None,this.Dy=this.Ki.pyramidChartSliceFillStylePalette,this.By=this.Ki.pyramidChartSliceStrokeStyle,this.Ly=!0,this.Ry=this.Ki.pyramidChartSliceLabelFont,this.Ey=this.Ki.pyramidChartSliceLabelFillStyle,this.zy=0,this.RT=0,this.ET=80,this.zT=0,this.VT=e.PyramidSliceModes.VariableHeight,this.Ny=!0,this.Wy=t=>{const e=this.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Gy=this.Ki.effectsText,this.Yy=i.Hy("pyramidChart bottom",0),this.$y=i.Hy("pyramidChart top",1),this.mh.gr("Pyramid Chart");const a=i.Xy(),l=Pt(h?h.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",od,(()=>0)),this._p(n,this.pg),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled))}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new id(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);return this.zy+=1,i.setName(t),i.setValue(e),i.ss.hs.Ss(this.Gy),i.ss.rs.Ss(this.Ny),this.Iy.push(i),this.ls.xs(),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){return this.Ey="function"==typeof t?t(this.Ey):t,this.ls.xs(),this}getLabelFillStyle(){return this.Ey}setLabelFont(t){return this.Ry="function"==typeof t?t(this.Ry):t,this.ls.xs(),this}getLabelFont(){return this.Ry}setLabelEffect(t){return this.Gy=t,this.Iy.forEach((e=>e.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);this.Iy=this.Iy.sort(this.Py);for(let t=0,{length:e}=this.Iy;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.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e){t.setStyle(this.$d?new U({color:this.$d.getColors(t.getAnimatedValue())}):this.Dy(e,t),this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.Yy.Y(),this.$y.Y(),super.dispose()}}const od=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],hd=(t,i,s)=>{const r=t.wl();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}}},ad=t=>{const e=t.wl();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 ld extends nd{constructor(){super(...arguments),this.Qy=Ia.NamePlusValue,this.OT=10,this.NT=e.PyramidLabelSide.Left,this.GT=e.SliceLabelIndices.LabelsOnSides,this.Ky=[],this.sm=this.Ki.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),void this.Ky.forEach((t=>t.setVisible(!1)));this.WT(t,this.NT===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),gd=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var yd;e.SpiderWebMode=void 0,(yd=e.SpiderWebMode||(e.SpiderWebMode={}))[yd.Normal=0]="Normal",yd[yd.Circle=1]="Circle";class md{constructor(t,e,i,s,n,o,h,a){this.R=new r.Eventer,this.YT=t,this.Nr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.HT=h,this.$T=a,this.XT=this.YT.Ne(this.scale).setMouseInteractions(!1),this.jT=this.Nr.Or(this.scale).gr(this.tag).setMouseInteractions(!1),this.ZT=this.HT(this,this.YT.rm(this.scale,void 0,[Oa.InternalUI])).Oe(this.chart.getNibStyle()),this.$T.fs([this.jT])}Jy(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.jT.setVisible(!0).Be(ui(c,u(h.paddingX,h.paddingY))).Na(h.alignmentX).Wa(h.alignmentY):this.jT.setVisible(!1)}getLabelSize(){return this.jT.jh(this.chart.getAxisLabelFont()).Ie(this.chart.getAxisLabelStyle()).Ls().oi()}dispose(){this.XT&&this.XT.dispose(),this.jT&&this.jT.dispose(),this.ZT&&this.ZT.dispose()}}class pd extends jl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this._s="Spider Series",this.bu=new Map,this.Hi=e.HighlightModes.onHover,this.Kb=8,this.ba=0,this.QT=(()=>{const t=K((()=>{}));let e;return(i,s,r,n)=>{const o=null==n?void 0:n.onStart,h=null==n?void 0:n.onCompleted,a=(null==n?void 0:n.easing)||W.ease,l=(null==n?void 0:n.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else u=t(l,a)([[i,s]],(([t])=>{r(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),h&&u.onAnimationEnd(h)}})(),this.JT={},this.KT={},this.xy=this.getVisible(),this.qT=1,this.tF=((t,e)=>{const i=K((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||W.ease,u=(null==a?void 0:a.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?h&&n?(s=i(u,l)([[n,0]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(n=0,e(!1)):h?(e(!0),s=i(u,l)([[n,1]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0}))):(n=1,e(!0))}})((t=>{this.qT=t,this.Is.ls.xs()}),(t=>{super.setVisible(t)})),this.chart=t,this.Is=i,this.qb=r,this.iF=n,this._x=o,this.sF=h,this.eF=a,this.scale=s,this.hF=ye(u.spiderSeriesFillStyle,c),this.rF=ye(u.spiderSeriesStrokeStyle,c),this.nF=ye(u.spiderSeriesPointFillStyle,c)}Qi(t,e){const i=this.eF(e);if(void 0!==i&&this.bu.has(i.tag)){const t=this.bu.get(i.tag),e=this.sF(i.tag,t);return{cursorPosition:{pointMarker:e,pointMarkerScale:this.scale,resultTable:e,resultTableScale:this.scale},series:this,axis:i.tag,value:t}}}rv(){return this.av&&this.bu.size>0&&this.getVisible()}addPoints(...t){this.bu.size>0&&this.chart.ls.Xn(dh.Cf),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.QT(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.bu.set(s,r+t*(e-r)),this.Is.ls.xs()}))}),{easing:this.JT.easing,durationMs:this.JT.durationMs,onStart:()=>{i=new Map(this.bu)}})}else for(let e=0;e=3&&(this.dT||(this.dT=this.Is.oc(this.scale,cn.Simple).Fe(this.rF).Ie(this.hF).us(this.getHighlight()),this.ds(this.dT)),this.dT._l(t),this.tM||(this.tM=this.Is.Pv(this.scale).it(this.Kb).ol(this.qb).Zh(this.ba).Ie(this.nF).us(this.getHighlight()),this.ds(this.tM)),this.tM.Ot().dl(t))}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.hF,stroke:this.rF})}Fs(){return this.Ms||this.qb}oF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Ad=t=>Je(t.jT.Je()),Sd=t=>Je(t.Je()),vd=(t,i,s,r)=>t.fu(0).Be(s).lu(90).Ge(-270).Au(i===e.SpiderWebMode.Circle?void 0:r.length),bd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Md={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},wd=()=>{Md.alignmentX=0,Md.alignmentY=0,Md.paddingX=0,Md.paddingY=0};class Cd extends cl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("spiderChart bg",0),r,i.ls.Ki.spiderChartBackgroundFillStyle,i.ls.Ki.spiderChartBackgroundStrokeStyle,i.ls.Ki.spiderChartTitleFont,i.ls.Ki.spiderChartTitleFillStyle,h),this.wa=x(20,20,20,20),this.axisScale=lt.d1({scale1DConstructor:Li,dimension:"x"}).q(0,1),this._x=[],this.aF=[],this.lF=[],this.uF=Os.expansion,this.cF=!0,this.dF=gd,this.fF=fd,this.No=!0,this.AF=e.SpiderWebMode.Normal,this.gF=4,this.pF=this.Ki.spiderChartWebStyle,this.yF=this.Ki.spiderChartScaleLabelFillStyle,this.mF=this.Ki.spiderChartScaleLabelFont,this.vF=5,this.SF=this.Ki.spiderChartAxisLabelFillStyle,this.xF=this.Ki.spiderChartAxisLabelFont,this.bF=5,this.MF=this.Ki.spiderChartAxisStrokeStyle,this._F=this.Ki.spiderChartAxisNibStrokeStyle,this.zf=10,this.wF=x(),this.hasAxis=t=>this._x.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Di.Numeric),this.CF=()=>{const t=this._x.map(Ad).concat(this.lF.map(Sd));return Ze(t)},this.kF=()=>this.TF.hd(this.pg).setMouseInteractions(!1),this.FF=t=>t.dispose(),this.IF=()=>this.TA.Or(this.pg).setMouseInteractions(!1),this.PF=t=>t.dispose(),this.DF=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.BF=(t,e)=>{let i,s;const r=()=>{void 0!==this.LF&&this.LF.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.uF,this.uF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this._x.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=xd(a,this._x.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ai(ci(t.XT.Ii(),t.XT.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.q(i.min,l),Qt(o),this.ls.xs()}},o=()=>{if(i=void 0,void 0!==s)if(this.ah){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.RF(),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.LF=this.op.ls.un(300,W.ease)([[0,1]],(([e])=>{this.axisScale.q(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.LF.onAnimationEnd((()=>{this.LF=void 0,this.uF=i}))}else this.uF=s}else this.uF=s;s=void 0};e.setMouseEnterEventHandler(this.EF).setMouseLeaveEventHandler(this.zF).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=ji(new $i(((t,e,i)=>{this.EF(t),r(),Qt(i)}),n,((t,e,i,s)=>{this.zF(t),o(),Qt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.VF=t=>{this.cF&&!this.hasAxis(t)&&this.addAxis(t)},this.sF=(t,e)=>{for(const i of this._x)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Qe(i.XT.Ii(),i.XT.Ti(),t)}},this.eF=t=>{if(0===this._x.length)return;const e=ci(this.translateCoordinate(t,this.coordsRelative),this._x[0].XT.Ii()),i=Math.atan2(e.y,e.x);let s,r=Be;for(const t of this._x){const e=ci(t.XT.Ti(),t.XT.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.No&&(t.Oe(this._F),this.ls.xs())},this.zF=t=>{t.Oe(this._F),this.ls.xs()},this.ls.Xn(dh.pf),this.Ik=i.Mx("spiderChart series bg",0),this.TF=i.Hy("spiderChart web shapes",0),this.OF=i.Hy("spiderChart axis bg",1),this.Kx=i.Hy("spiderChart plotting",2),this.TA=i.Hy("spiderChart fg",3),this.$T=this.ss.wg().Ss(this.Ki.effectsText),this.mh.gr("Spider Chart"),this.zv=this.Ik.hd(this.pg).Ie(this.Ki.spiderChartSeriesBackgroundFillStyle).Fe(nt).lu(90).Ge(-270).fu(0),this.Vv=this.Ik.hd(this.pg).Ie(B).Fe(this.Ki.spiderChartSeriesBackgroundStrokeStyle).lu(90).Ge(-270).fu(0),super.Ev(this.zv,this.Vv);const a=i.Xy(),l=Pt(o?o.cursorBuilder:void 0,ba);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),this,"show-pointed",Td,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this._p(n,this.pg)}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=ba){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new md(this.OF,this.TA,this.pg,this,t,this.axisScale,this.BF,this.$T);this._x.push(e)}}else t&&this._x.push(t);return this.$T.fs(this._x.map((t=>t.jT))),this.ls.xs(),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.Dv.length,r=new pd(this,this.Kx,this.pg,i,this.VF,this._x,this.sF,this.eF,this.Lv,this.Ki,s,this.ls.ss);return this.Ov(r),r}getSeriesCount(){return this.Dv.length}setWebMode(t){return this.AF=t,this.ls.xs(),this}getWebMode(){return this.AF}setWebCount(t){return this.gF=t,this.ls.xs(),this}getWebCount(){return this.gF}setWebStyle(t){return this.pF="function"==typeof t?t(this.pF):t,this.ls.xs(),this}getWebStyle(){return this.pF}setScaleLabelStyle(t){return this.yF="function"==typeof t?t(this.yF):t,this.ls.xs(),this}getScaleLabelStyle(){return this.yF}setScaleLabelFont(t){return this.mF="function"==typeof t?t(this.mF):t,this.ls.xs(),this}getScaleLabelFont(){return this.mF}setScaleLabelPadding(t){return this.vF=t,this.ls.xs(),this}getScaleLabelPadding(){return this.vF}setScaleLabelStrategy(t){return this.dF=t,this.ls.xs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.ls.xs(),this}setAxisLabelStyle(t){return this.SF="function"==typeof t?t(this.SF):t,this.ls.xs(),this}getAxisLabelStyle(){return this.SF}setAxisLabelFont(t){return this.xF="function"==typeof t?t(this.xF):t,this.ls.xs(),this}getAxisLabelFont(){return this.xF}setAxisLabelEffect(t){return this.$T.Ss(t),this.ls.xs(),this}getAxisLabelEffect(){return this.$T.bs()}setAxisLabelPadding(t){return this.bF=t,this.ls.xs(),this}getAxisLabelPadding(){return this.bF}setAxisLabelStrategy(t){return this.fF=t,this.ls.xs(),this}setAxisStyle(t){return this.MF="function"==typeof t?t(this.MF):t,this.ls.xs(),this}getAxisStyle(){return this.MF}setNibStyle(t){return this._F="function"==typeof t?t(this._F):t,this.ls.xs(),this}getNibStyle(){return this._F}setNibLength(t){return this.zf=t,this.ls.xs(),this}getNibLength(){return this.zf}setAutoAxis(t){return this.cF=t,this}getAutoAxis(){return this.cF}setMouseInteractions(t){return this.No=t,this}getMouseInteractions(){return this.No}setAxisScrollStrategy(t){return this.uF=t,this.ls.xs(),this}getAxisScrollStrategy(){return this.uF}setAxisInterval(t,e=0){return this.axisScale.q(e,t),this.ls.xs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}De(t){super.De(t),oa.Bp(this.mh,this.Cp);const e=this._x.length,i=oa.Dp(this.mh,this.Cp),s=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.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.fF){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.uF){const t=this.RF();if(void 0!==t){const e=this.uF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.uF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.q(e,i)}}const n=u(this.pg.x.getInnerStart()+(r.left+this.pg.x.getInnerInterval()-r.right)/2,this.pg.y.getInnerStart()+(r.bottom+this.pg.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.wF=x(this.Xt.left+this.wa.left+r.left,this.Xt.top+this.wa.top+i+r.top,this.Xt.right+this.wa.right+r.right,this.Xt.bottom+this.wa.bottom+r.bottom),this.Jy(n,o);for(const t of this.Dv)t.yv();for(const t of this.Dv)t.De();super.Mp(),this.jy.De(!1,this.Dv,void 0);for(const t of this.Dv)t.bm()}dispose(){return this.Ik.Y(),this.TF.Y(),this.OF.Y(),this.Kx.Y(),this.TA.Y(),this.jy.Y(),super.dispose()}getMinimumSize(){return u(this.wF.left+this.wF.right+100,this.wF.bottom+this.wF.top+100)}Jy(t,e){const i=this._x.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];vd(h,i,s,n);const u=r*((l+1)/e);h.uu(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=Qe(n,o[a],s);e.Be(ui(c,u(m.paddingX,m.paddingY))).Na(m.alignmentX).Wa(m.alignmentY).gr(l(s))}}}for(let e=f;e1;for(const s of this._x)for(const r of this.Dv){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 y(t,e)}}const Td=(t,e,i)=>aa(e,[[e.series],[e.axis],[{text:t.formatValue(e.value),font:{weight:"bold"}}]]),Rd=(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{NF:()=>{const e=t.GF("dashboard ui",a+l);return l+=1,e},WF:()=>t.GF("dashboard legend",51e4),UF: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{ls:t,wp:(e,i)=>{const s=a+i;return t.GF(e,s)},Mx:(e,i)=>{const s=l+i;return t.GF(e,s)},Dk:(e,i)=>{const s=u+i;return t.GF(e,s)},Hy:(e,i)=>{const s=c+i;return t.GF(e,s)},bx:(e,i,s)=>{const r=c+i;return t.YF(e,r,s)},Tp:(e,i)=>{const s=d+i;return t.GF(e,s)},Ap:e=>{const i=f+g,s=t.GF(e,i);return g+=1,s},pp:()=>t.GF("panel legend",500002+e),Xy:()=>t.GF("panel cursor",600001+e)}}}};class Ed{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)}U(t){return this.R.off(t,"set")}}const kd={lh:!1,uh:0,dh:!1,Ah:0,fh:!1,gh:0,ph:0,hh:Os.fitting},Id=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))},Fd=(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&&Od(t,e,u,n,o,h),"spark-bar"===a&&Ud({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Ud({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Yd(t,e,u,n,o,h),"spark-pie"===a&&Gd(t,e,u,n,o,h)},Dd=(t,e,i,s)=>({x:Ld(t.x,e.x,i.x,s),y:Vd(t.y,e.y,i.y,s)}),Pd=(t,e,i,s)=>({position:Ld(t.position,e.x,i.x,s),high:Vd(t.high,e.y,i.y,s),low:Vd(t.low,e.y,i.y,s)}),Ld=(t,e,i,s)=>{const r=Ft(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Vd=(t,e,i,s)=>{const r=Ft(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},_d=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Bd(a,e,i,r,n,o,h),"axis-band"===a.type&&zd(a,i,r,n,o,h),"constant-line"===a.type&&Nd(a,i,s,r,n,o,h)},Bd=(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=Dd(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().ol(void 0!==u?u:e.PointShape.Circle).Zh(d||0).it(c||5).Ie(l||h.sparkPointChartFillStyle).dl(f)},zd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(ze,Be),f=u(ze,Be);"x"===o&&(d=Dd({x:h,y:ze},e,i,s),f=Dd({x:a,y:Be},e,i,s)),"y"===o&&(d=Dd({x:ze,y:h},e,i,s),f=Dd({x:Be,y:a},e,i,s));const g=s[0],y=s[1],m=Ft(d.x,g.x,g.x+y.x),p=Ft(d.y,g.y,g.y+y.y),x=Ft(f.x,g.x,g.x+y.x),A=Ft(f.y,g.y,g.y+y.y);r.rect.add().ml(m).vl(p).it(u(x-m,A-p)).Ie(l||n.sparkChartBandFillStyle).Fe(c||n.sparkChartBandStrokeStyle).Fe(nt)},Nd=(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,y=i.x,m=[];if("y"===h&&d<=c&&c<=f){const t=Dd(u(g,c),{x:g,y:d},s,r),e=Dd(u(y,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=y){const t=Dd(u(c,d),{x:g,y:d},s,r),e=Dd(u(c,f),{x:g,y:d},s,r);m.push([t,e])}m.length>0&&n.line.add().Oe(l||o.sparkChartConstantLineStrokeStyle).We(m[0][0]).Ge(m[0][1])},Od=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Kn&&wt.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=Be,c=ze,d=Be,f=ze;for(let t=0;tDd(t,{x:u,y:d},g,i)));e.lineSet.add().us(n).Oe(o||s.sparkLineChartStrokeStyle).Ot().dl(y),a&&_d(a,y,{x:u,y:d},{x:c,y:f},g,i,e,s)},Ud=(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,y=l||0,m=f/d*1;let p=Be,x=ze;if(g)p=-1,x=1;else for(const t of o)p=Math.min(p,t),x=Math.max(x,t);const A={x:0,y:g?-1:Math.min(0,p)},S={x:1*o.length+(o.length-1)*m,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*m,y:g?t>=y?1:0:t},r=Dd({x:1*e+e*m,y:g?t>=y?0:-1:0},A,S,i),n=Dd(s,A,S,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().us(n).Be(t.position).xl(t.height).Sl(t.width).Ie((i=t.value,g?(i>=y?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Fe(a||s.sparkBarChartStrokeStyle)}))},Yd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Kn&&wt.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=Be,f=ze,g=Be,y=ze;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=Dd(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 y=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().us(n).Be(d).uu(g).fu(0).lu(y).Ge(y+r).Ie(l[i]||ye(s.sparkPieChartFillStyle,i)).Fe(h||s.sparkPieChartStrokeStyle),y+=r}))};var Xd,Zd,Hd;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(Xd||(Xd={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(Zd||(Zd={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(Hd||(Hd={}));class Wd extends pn{constructor(t,e,i,s,r){super(),this.Rs=!1,this.t_={x:0,y:0,height:20,width:20},this.HF={x:10,y:10},this.Is=t,this.$F=r,this.XF=new Ao(t,e,i,kt,s).setMouseInteractions(!0),this.jF=t.oc(e,cn.Simple).Ie(s.dataGridScrollBarButtonArrowFillStyle).Fe(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.ku(this),this.XF.onMouseEnter((t=>t.setHighlight(1))),this.XF.onMouseLeave((t=>t.setHighlight(0)))}ZF(){switch(this.$F){case Hd.Up:this.jF._l([{x:this.t_.x,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y-this.HF.y/2},{x:this.t_.x-this.HF.x/2,y:this.t_.y-this.HF.y/2}]);break;case Hd.Down:this.jF._l([{x:this.t_.x-this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x,y:this.t_.y-this.HF.y/2}]);break;case Hd.Left:this.jF._l([{x:this.t_.x-this.HF.x/2,y:this.t_.y},{x:this.t_.x+this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y-this.HF.y/2}]);break;case Hd.Right:this.jF._l([{x:this.t_.x-this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y},{x:this.t_.x-this.HF.x/2,y:this.t_.y-this.HF.y/2}])}}Be(t){return this.t_.x=t.x,this.t_.y=t.y,this}za(){return u(this.t_.x,this.t_.y)}it(t){return this.t_.height=t.x,this.t_.width=t.y,this}oi(){return{x:this.t_.height,y:this.t_.width}}onMouseDown(t){return this.XF.onMouseDown(t)}onMouseUp(t){return this.XF.onMouseUp(t)}setFillStyle(t){return this.XF.setFillStyle(t),this}getFillStyle(){return this.XF.getFillStyle()}setStrokeStyle(t){return this.XF.setStrokeStyle(t),this}getStrokeStyle(){return this.XF.getStrokeStyle()}De(){return this.XF.De(),this.ZF(),this}Ls(){return this.XF.setSize(u(this.t_.height,this.t_.width)).setPosition(u(this.t_.x,this.t_.y)),this}setVisible(t){return this.XF.setVisible(t),this.jF.setVisible(t),this}dispose(){return this.XF.dispose(),this.jF.dispose(),this}setMouseInteractions(t){return this.XF.setMouseInteractions(t),this}getMouseInteractions(){return this.XF.getMouseInteractions()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.XF.getHighlight()}setHighlight(t){return this.XF.setHighlight(be(t)),this.R.emit("highlight",this,Boolean(t)),this.Is.xs(),this}}const jd=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Kd{constructor(t,i,s,n,o,h,a){this.rd={x:0,y:0},this.t_={x:0,y:0,height:0,width:0},this.R=new r.Eventer,this.QF={min:u(0,0),max:u(0,0)},this.JF=!1,this.KF=!1,this.qF={x:0,y:0},this.Fu=void 0,this.tI=u(0,0),this.iI={x:0,y:0},this.sI=0,this.eI=15,this.hI=(t,i)=>{this.JF=!0,this.TA.xs();const s=this.rI.getDraggingMode();this.Fu=this.TA.ls.Qr(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.nI&&clearInterval(this.nI)},this.oI=()=>{this.JF=!1,this.TA.xs(),this.TA.ls.Jr(this.Fu)},this.aI=t=>(this.KF=!0,this.qF=ct(this.TA.ls.Re(t.x,t.y),this.TA.ls.At,this.scale),!0),this.lI=(t,e)=>(this.uI(e),this.nI=setInterval((()=>this.uI(e)),300),!0),this.cI=()=>(clearInterval(this.nI),!0),this.dI=(t,i)=>{const s=this.rI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=ct(this.TA.ls.Re(t.x,t.y),this.TA.ls.At,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?jd(n.x,this.scale.x):this.t_.x,r!==e.UIDraggingModes.onlyHorizontal?jd(n.y,this.scale.y):this.t_.y),h=u(o.x-this.qF.x,o.y-this.qF.y),a=u(this.rI.getPosition().x+h.x,this.rI.getPosition().y+h.y),l=this.fI(a),c={x:Math.abs(this.tI.x-l.x),y:Math.abs(this.tI.y-l.y)};return this.AI(c),this.iI.y>h.y&&(this.qF=n),this.De(),!0}return!1},this.gI=(t,e)=>{this.KF=!1,Qt(e),this.TA.xs()},this.TA=t,this.op=i,this.scale=n,this.contentScale=o,this.pI=a,this.yI=new Wd(t,s,n,h,a===Xd.UpToDown?Hd.Up:Hd.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.mI=new Wd(t,s,n,h,a===Xd.UpToDown?Hd.Down:Hd.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.rI=new Ao(t,s,n,kt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===Xd.UpToDown?e.UIDraggingModes.onlyVertical:a===Xd.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.vI=new Ao(i,s,n,kt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.rI.onMouseEnter(this.hI),this.rI.onMouseLeave(this.oI),this.rI.onMouseDragStart(((t,e)=>this.aI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onMouseDrag(((t,e)=>this.dI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onMouseDragStop(this.gI),this.rI.onTouchStart(((t,e)=>this.aI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onTouchMove(((t,e)=>this.dI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onTouchEnd(this.gI),this.yI.onMouseDown(((t,e)=>this.lI(t,e)&&Qt(e))),this.mI.onMouseDown(((t,e)=>this.lI(t,e)&&Qt(e))),this.yI.onMouseUp(((t,e)=>this.cI()&&Qt(e))),this.mI.onMouseUp(((t,e)=>this.cI()&&Qt(e))),this.vI.onMouseWheel(((t,e)=>this.SI(e))),this.rI.onMouseWheel(((t,e)=>this.SI(e))),this.vI.onMouseDown(((t,e)=>this.lI(t,e)&&Qt(e))),this.vI.onMouseUp(((t,e)=>this.cI()&&Qt(e)))}xI(t){return this.t_=t,this}Sl(t){return this.t_.width=t,this}bI(){return this.t_.width}MI(t){return this.tI=t,this}_I(t){return this.rd=t,this}wI(){return this.rd}CI(t){return this.eI=t,this}kI(){return this.pI}TI(t){let e;switch(this.pI){case Xd.UpToDown:return e=t>0?Math.min(this.tI.y-this.QF.max.y,this.iI.y+t):Math.max(0,this.iI.y+t),e!==this.iI.y&&(this.AI({x:0,y:e}),this.De(),!0);case Xd.LeftToRight:return e=Math.min(this.QF.max.x-this.tI.x,this.iI.x+t),e!==this.iI.x&&(this.AI({y:0,x:e}),this.De(),!0);default:return!1}}FI(t){let e;switch(this.pI){case Xd.UpToDown:return e=Math.max(0,this.iI.y-t),e!==this.iI.y&&(this.AI({x:0,y:e}),this.De(),!0);case Xd.LeftToRight:return e=t>0?Math.max(0,this.iI.x-t):Math.min(this.QF.max.x-this.tI.x,this.iI.x-t),e!==this.iI.x&&(this.AI({x:e,y:0}),this.De(),!0);default:return!0}}II(t){switch(this.pI){case Xd.UpToDown:return this.R.on("scrollY",t);case Xd.LeftToRight:return this.R.on("scrollX",t)}return this.R.on("scrollY",t)}fI(t){switch(this.pI){case Xd.UpToDown:if(t.y>this.QF.min.y)return u(t.x,this.QF.min.y);if(t.ythis.QF.max.x)return u(this.QF.max.x,t.y)}return t}SI(t){t.deltaY>0&&this.DI()&&Qt(t),t.deltaY<0&&this.BI()&&Qt(t)}uI(t){const e=ct(this.TA.ls.Re(t.clientX,t.clientY),this.TA.ls.At,this.scale);let i;const s=this.rI.getPosition(),r=this.rI.getSize();this.LI(e,s,r)?clearInterval(this.nI):(i=this.pI===Xd.UpToDown?u(0,e.y-s.y>0?this.eI:-this.eI):u(s.x-e.x>0?this.eI:-this.eI,0),(i.x>0||i.y>0)&&this.RI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.EI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}LI(t,e,i){return this.pI===Xd.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.t_.height?Math.min(this.tI.y-this.QF.max.y,this.iI.y+t):0,e!==this.iI.y&&(this.AI({x:0,y:e}),this.De(),!0)}case Xd.LeftToRight:{const e=Math.min(this.QF.max.x-this.tI.x,this.iI.x+t);return e!==this.iI.x&&(this.AI({y:0,x:e}),this.De(),!0)}default:return!1}}BI(){return this.RI(this.eI)}DI(){return this.EI(this.eI)}AI(t){if(t.x===this.iI.x&&t.y===this.iI.y)return;let e;switch(this.iI=t,this.pI){case Xd.UpToDown:e=this.iI.y*this.sI*this.contentScale.Wi().y,this.R.emit("scrollY",Zd.Vertical,e),this.TA.ls.xs();break;case Xd.LeftToRight:e=this.iI.x*this.sI*this.contentScale.Wi().x,this.R.emit("scrollX",Zd.Horizontal,e)}}setVisible(t){return this.yI.setVisible(t),this.mI.setVisible(t),this.vI.setVisible(t),this.rI.setVisible(t),this}dispose(){return this.yI.dispose(),this.mI.dispose(),this.vI.dispose(),this.rI.dispose(),this.nI&&clearInterval(this.nI),this}Ls(){switch(this.VI(),this.OI(),this.pI){case Xd.UpToDown:this.yI.Be({x:this.t_.x,y:this.t_.y+this.t_.height-this.yI.oi().x/2}).it(u(this.t_.width,this.t_.width)).Ls(),this.mI.Be({x:this.t_.x,y:this.t_.y+10}).it(u(this.t_.width,this.t_.width)).Ls(),this.vI.setSize({x:this.t_.width,y:this.t_.height-2*this.yI.oi().x}).setPosition({x:this.t_.x,y:this.t_.y+this.mI.oi().y+this.vI.getSize().y/2}),this.rI.setSize(u(this.t_.width,this.NI())),this.tI={x:this.t_.x,y:this.yI.za().y-this.yI.oi().y/2-this.rI.getSize().y/2},this.zI({min:{x:this.t_.x,y:this.yI.za().y-this.yI.oi().y/2-this.rI.getSize().y/2},max:{x:this.t_.x,y:this.mI.za().y+this.mI.oi().x/2+this.rI.getSize().y/2}});break;case Xd.LeftToRight:this.yI.Be({x:this.t_.x,y:this.t_.y}).it(u(this.t_.height,this.t_.height)).Ls(),this.mI.Be({x:this.t_.x+this.t_.width-this.mI.oi().x,y:this.t_.y}).it(u(this.t_.height,this.t_.height)).Ls(),this.vI.setSize({y:this.t_.height,x:this.t_.width-2*this.yI.oi().y}).setPosition({x:this.t_.x+this.yI.oi().x/2+this.vI.getSize().x/2,y:this.t_.y}),this.rI.setSize(u(this.NI(),this.t_.height)),this.tI={x:this.yI.za().x+this.yI.oi().x/2+this.rI.getSize().x/2,y:this.t_.y},this.zI({min:{x:this.yI.za().x+this.yI.oi().x/2+this.rI.getSize().x/2,y:this.t_.y},max:{x:this.mI.za().x-this.mI.oi().x/2-this.rI.getSize().x/2,y:this.t_.y}})}return this.GI(),this}VI(){switch(this.pI){case Xd.UpToDown:this.WI()||this.setVisible(!1),this.WI()&&this.setVisible(!0);break;case Xd.LeftToRight:this.UI()||this.setVisible(!1),this.UI()&&this.setVisible(!0)}}OI(){switch(this.pI){case Xd.UpToDown:this.WI()||this.AI({x:0,y:0});break;case Xd.LeftToRight:this.UI()||this.AI({x:0,y:0})}}WI(){return this.rd.x>this.t_.height}UI(){return this.rd.y>this.t_.width}NI(){switch(this.pI){case Xd.UpToDown:return this.t_.height*(this.t_.height-2*this.yI.oi().x)/this.rd.x;case Xd.LeftToRight:return this.t_.width*(this.t_.width-2*this.yI.oi().y)/this.rd.y;default:return 0}}GI(){switch(this.pI){case Xd.UpToDown:this.sI=(this.rd.x-this.t_.height)/(this.QF.min.y-this.QF.max.y);break;case Xd.LeftToRight:this.sI=(this.rd.y-this.t_.width)/(this.QF.max.x-this.QF.min.x)}}De(){switch(this.yI.De(),this.mI.De(),this.vI.De(),this.pI){case Xd.UpToDown:this.rI.setPosition({x:this.t_.x,y:this.yI.za().y-this.yI.oi().y/2-this.rI.getSize().y/2-this.iI.y}).De();break;case Xd.LeftToRight:this.rI.setPosition({y:this.t_.y,x:this.yI.za().x+this.yI.oi().x/2+this.rI.getSize().x/2+this.iI.x}).De()}return this}}class $d{constructor(t,e,i,s,r,n,o){switch(this.TA=t,this.op=e,this.scale=s,this.contentScale=r,o){case Zd.Vertical:this.YI=this.HI(i,n,Xd.UpToDown);break;case Zd.Horizontal:this.$I=this.HI(i,n,Xd.LeftToRight);break;case Zd.Both:this.YI=this.HI(i,n,Xd.UpToDown),this.$I=this.HI(i,n,Xd.LeftToRight)}this.XI=ji(new $i(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.$I)||void 0===n?void 0:n.FI(s.x))&&Qt(r),0!==s.y&&(null===(o=this.YI)||void 0===o?void 0:o.TI(s.y))&&Qt(r)})))}HI(t,e,i){return new Kd(this.TA,this.op,t,this.scale,this.contentScale,e,i)}bI(){return 20}_I(t){var e,i;return null===(e=this.YI)||void 0===e||e._I(t),null===(i=this.$I)||void 0===i||i._I(t),this}jI(t){var e;return null===(e=this.$I)||void 0===e||e.CI(t),this}ZI(t){var e;return null===(e=this.YI)||void 0===e||e.CI(t),this}QI(t){const e=this.YI;return e&&e.SI(t),this}JI(t){return this.XI.onTouchStart(this,t),this}KI(t){return this.XI.onTouchMove(this,t),this}qI(t){return this.XI.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.$I)||void 0===e||e.II(t),null===(i=this.YI)||void 0===i||i.II(t),this}dispose(){var t,e;return null===(t=this.YI)||void 0===t||t.dispose(),null===(e=this.$I)||void 0===e||e.dispose(),this}De(){var t,e;return null===(t=this.YI)||void 0===t||t.De(),null===(e=this.$I)||void 0===e||e.De(),this}Ls(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.YI)||void 0===t||t.xI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.$I)||void 0===e||e.xI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.YI)||void 0===i||i.Ls(),null===(s=this.$I)||void 0===s||s.Ls(),this}}class Qd extends na{constructor(t,e,i,s,r,n){super(t,e,i,e.wp("dataGrid bg",0),s,e.ls.Ki.dataGridBackgroundFillStyle,e.ls.Ki.dataGridBackgroundStrokeStyle,e.ls.Ki.dataGridTitleFont,e.ls.Ki.dataGridTitleFillStyle,n),this.tP=[],this.iP=[],this.sP=[],this.eP=new Map,this.hP=!0,this.rP=!0,this.nP=!0,this.oP=!0,this.aP=!0,this.lP=!0,this.uP=!0,this.cP=!0,this.dP=!0,this.fP=!0,this.AP=!0,this.gP=!0,this.pP=!0,this.yP=!0,this.mP=!0,this.vP=!0,this.SP=new Set,this.xP=new Set,this.bP=!0,this.MP=!0,this._P=(t,e)=>{t.borders=void 0===e?sf:{...t.borders,...e},this.wP(t),this.gP=!0,this.ls.xs()},this.wP=t=>{t.borders&&(!1===t.borders.top&&this.CP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.kP,bottom:!1}})),!1===t.borders.bottom&&this.CP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.kP,top:!1}})),!1===t.borders.left&&this.CP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.kP,right:!1}})),!1===t.borders.right&&this.CP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.kP,left:!1}})),!0===t.borders.top&&this.CP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.kP,bottom:!0}})),!0===t.borders.bottom&&this.CP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.kP,top:!0}})),!0===t.borders.left&&this.CP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.kP,right:!0}})),!0===t.borders.right&&this.CP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.kP,left:!0}})))},this.TP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseEnter,i,e)},this.FP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseLeave,i,e)},this.IP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseClick,i,e)},this.PP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDoubleClick,i,e)},this.DP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDown,i,e)},this.BP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseUp,i,e)},this.LP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseMove,i,e)},this.RP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDrag,i,e)},this.EP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDragStart,i,e)},this.zP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDragStop,i,e)},this.VP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellMouseWheel,i,e),!e.defaultPrevented&&this.bP&&this.OP.QI(e))},this.NP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellTouchStart,i,e),!e.defaultPrevented&&this.MP&&this.OP.JI(e))},this.GP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellTouchMove,i,e),!e.defaultPrevented&&this.MP&&this.OP.KI(e))},this.WP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellTouchEnd,i,e),!e.defaultPrevented&&this.MP&&this.OP.qI(e))},this.ls.Xn(dh.af),this.mh.gr("Data Grid"),this.UP=i.d2({scaleXYConstructor:Bi}),this.UP.x.ag=kd,this.YP=i.d2({scaleXYConstructor:Bi}),this.HP={x:0,y:0},this.$P=this.Ki.dataGridTextFont,this.XP=this.Ki.dataGridTextFillStyle,this.kP={top:!0,bottom:!0,left:!0,right:!0},this.jP=this.Ki.dataGridCellBackgroundFillStyle,this.ZP=this.Ki.dataGridBorderStrokeStyle,this.QP="left-center",this.JP={left:5,right:5,bottom:5,top:5},this.KP=e.Mx("dataGrid grid bg",0),this.qP=e.Mx("dataGrid cell bg",1),this.tD=e.Hy("dataGrid cell content",0),this.iD=e.Hy("dataGrid scrollbar bg",1),this.sD=e.Hy("dataGrid scrollbar fg",2),this.OP=this.eD(),this.onBackgroundMouseWheel(((t,e)=>{this.bP&&this.OP.QI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.MP&&this.OP.JI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.MP&&this.OP.KI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.MP&&this.OP.qI(e)})),this.hD=this.KP.Pe(this.UP).Ie(this.Ki.dataGridBackgroundFillStyle).Fe(nt).setMouseInteractions(!1),this.rD=this.tD.Wg(this.UP).setMouseInteractions(!1),this.nD=new Ka((()=>this.qP.Pe(this.UP).setMouseInteractions(!0).setMouseEnterEventHandler(this.TP).setMouseLeaveEventHandler(this.FP).setMouseClickEventHandler(this.IP).setMouseDoubleClickEventHandler(this.PP).setMouseDownEventHandler(this.DP).setMouseUpEventHandler(this.BP).setMouseMoveEventHandler(this.LP).setMouseDragEventHandler(this.RP).setMouseDragStartEventHandler(this.EP).setMouseDragStopEventHandler(this.zP).setMouseWheelEventHandler(this.VP).setTouchStartEventHandler(this.NP).setTouchMoveEventHandler(this.GP).setTouchEndEventHandler(this.WP))),this.oD=new Ka((()=>this.tD.Pe(this.UP).setMouseInteractions(!1))),this.aD=new Ka((()=>this.tD.Or(this.UP).setMouseInteractions(!1))),this.lD=new Ka((()=>this.tD.rm(this.UP,{},[Oa.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.uD=new Ka((()=>this.tD.Ne(this.UP).setMouseInteractions(!1))),this.cD=new Ka((()=>this.tD.Pv(this.UP).setMouseInteractions(!1))),this.dD=new Ka((()=>this.tD.Pe(this.UP).setMouseInteractions(!1))),this.fD=new Ka((()=>this.tD.E_(this.UP).setMouseInteractions(!1))),this.AD=new Ka((()=>this.tD.hd(this.UP).setMouseInteractions(!1))),this._p(r,this.uiScale),this.onResize((()=>{this.hP=!0,this.ls.xs(),this.UP.it(this.pg.oi()),this.YP.it(this.pg.oi())})),this.gD=this.ss.wg([this.hD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}if(){return[]}dispose(){return super.dispose(),this.KP.Y(),this.qP.Y(),this.tD.Y(),this.iD.Y(),this.sD.Y(),ia(this.UP),ia(this.YP),this.OP.dispose(),this.aD.wm(),this.nD.wm(),this.oD.wm(),this.lD.wm(),this.uD.wm(),this.cD.wm(),this.dD.wm(),this.fD.wm(),this.AD.wm(),this}J(){return super.J(),this.UP.J(),this.YP.J(),this}K(){return super.K(),this.UP.K(),this.YP.K(),this}setBackgroundEffect(t){return this.gD.Ss(t),this.ls.xs(),this}getBackgroundEffect(){return this.gD.bs()}setInteractionScrollOnWheel(t){return this.bP=t,this}getInteractionScrollOnWheel(){return this.bP}setInteractionPanOnTouch(t){return this.MP=t,this}getInteractionPanOnTouch(){return this.MP}onCellMouseEnter(t){return this.R.on(qd.cellMouseEnter,t)}offCellMouseEnter(t){return this.R.off(t)}onCellMouseLeave(t){return this.R.on(qd.cellMouseLeave,t)}offCellMouseLeave(t){return this.R.off(t)}onCellMouseClick(t){return this.R.on(qd.cellMouseClick,t)}offCellMouseClick(t){return this.R.off(t)}onCellMouseDoubleClick(t){return this.R.on(qd.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.R.off(t)}onCellMouseDown(t){return this.R.on(qd.cellMouseDown,t)}offCellMouseDown(t){return this.R.off(t)}onCellMouseUp(t){return this.R.on(qd.cellMouseUp,t)}offCellMouseUp(t){return this.R.off(t)}onCellMouseMove(t){return this.R.on(qd.cellMouseMove,t)}offCellMouseMove(t){return this.R.off(t)}onCellMouseDrag(t){return this.R.on(qd.cellMouseDrag,t)}offCellMouseDrag(t){return this.R.off(t)}onCellMouseDragStart(t){return this.R.on(qd.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.R.off(t)}onCellMouseDragStop(t){return this.R.on(qd.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.R.off(t)}onCellMouseWheel(t){return this.R.on(qd.cellMouseWheel,t)}offCellMouseWheel(t){return this.R.off(t)}onCellTouchStart(t){return this.R.on(qd.cellTouchStart,t)}offCellTouchStart(t){return this.R.off(t)}onCellTouchMove(t){return this.R.on(qd.cellTouchMove,t)}offCellTouchMove(t){return this.R.off(t)}onCellTouchEnd(t){return this.R.on(qd.cellTouchEnd,t)}offCellTouchEnd(t){return this.R.off(t)}setGridBackgroundFillStyle(t){return this.hD.Ie(t),this.ls.xs(),this}getGridBackgroundFillStyle(){return this.hD.Hh()}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.iP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.iP.splice(this.iP.indexOf(i),1):(i.min=e,i.max=e),this.lP=!0,this.ls.xs(),this}setRowHeight(t,e){let i=this.sP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.sP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.sP.splice(this.sP.indexOf(i),1):(i.min=e,i.max=e),this.lP=!0,this.ls.xs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=A(e,e,e,e)),this.yD(t,(t=>this.mD(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=A(e,e,e,e)),this.vD(t,(t=>this.mD(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=A(i,i,i,i)),this.CP(t,e,(t=>this.mD(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=A(t,t,t,t)),this.JP={...this.JP,...t},this.SD((t=>this.mD(t,this.JP))),this}setCellBorders(t,e,i){return this.CP(t,e,(t=>this._P(t,i))),this}setRowBorders(t,e){return this.vD(t,(t=>this._P(t,e))),this}setColumnBorders(t,e){return this.yD(t,(t=>this._P(t,e))),this}setCellsBorders(t){return this.kP=void 0===t?sf:t,this.SD((t=>this._P(t,this.kP))),this}setCellsBorderStrokeStyle(t){return this.ZP="function"==typeof t?t(this.ZP):t,this.yP=!0,this.ls.xs(),this}setColumnTextFillStyle(t,e){return this.yD(t,(t=>this.xD(t,e))),this}setRowTextFillStyle(t,e){return this.vD(t,(t=>this.xD(t,e))),this}setCellTextFillStyle(t,e,i){return this.CP(t,e,(t=>this.xD(t,i))),this}setCellsTextFillStyle(t){return this.XP="function"==typeof t?t(this.XP):t,this.SD((t=>this.xD(t,this.XP))),this}setColumnTextFont(t,e){return this.yD(t,(t=>this.bD(t,e))),this}setRowTextFont(t,e){return this.vD(t,(t=>this.bD(t,e))),this}setCellTextFont(t,e,i){return this.CP(t,e,(t=>this.bD(t,i))),this}setCellsTextFont(t){return this.$P="function"==typeof t?t(this.$P):t,this.SD((t=>this.bD(t,this.$P))),this}setColumnContentAlignment(t,e){return this.yD(t,(t=>this.MD(t,e))),this}setRowContentAlignment(t,e){return this.vD(t,(t=>this.MD(t,e))),this}setCellContentAlignment(t,e,i){return this.CP(t,e,(t=>this.MD(t,i))),this}setCellsContentAlignment(t){return this.QP=t,this.SD((t=>this.MD(t,this.QP))),this}setCellBackgroundFillStyle(t,e,i){return this.CP(t,e,(t=>this._D(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.yD(t,(t=>this._D(t,e))),this}setRowBackgroundFillStyle(t,e){return this.vD(t,(t=>this._D(t,e))),this}setCellsBackgroundFillStyle(t){return this.jP="function"==typeof t?t(this.jP):t,this.SD((t=>this._D(t,this.jP))),this}setCellHighlight(t,e,i){return this.CP(t,e,(t=>{t.highlight=be(i)})),this.pP=!0,this.ls.xs(),this}setColumnHighlight(t,e){const i=be(e);return this.yD(t,(t=>{t.highlight=i})),this.pP=!0,this.ls.xs(),this}setRowHighlight(t,e){const i=be(e);return this.vD(t,(t=>{t.highlight=i})),this.pP=!0,this.ls.xs(),this}removeCell(t,e){return this.CP(t,e,(t=>this.tP.splice(this.tP.indexOf(t),1))),this.aP=!0,this.ls.xs(),this}removeRow(t){return this.vD(t,(t=>this.tP.splice(this.tP.indexOf(t),1))),this.tP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.aP=!0,this.ls.xs(),this}removeColumn(t){return this.yD(t,(t=>this.tP.splice(this.tP.indexOf(t),1))),this.tP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.aP=!0,this.ls.xs(),this}removeCells(){return this.tP.splice(0),this.aP=!0,this.ls.xs(),this}getColumnMax(){return 0===this.tP.length?0:this.tP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.tP.length?0:this.tP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=Math.round(this.ZP.N()),i=e/2;let s=this.rP||this.nP||this.oP||this.aP||this.lP||this.uP||this.AP||this.gP||this.yP||this.vP;if(s){this.tP.forEach((t=>{this.xP.add(t.column)})),this.tP.forEach((t=>{this.SP.add(t.row)}));const t=this.aD.Mm(),r=this.wD(i,t);t.finishPlot();const n=this.CD(this.xP.size,r),o=this.kD(this.SP.size,r),h=n.reduce(He,0)+e,a=o.reduce(He,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.TD.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.TD={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.nP||this.oP||this.aP||this.cP||this.dP||this.fP||this.gP||this.pP||this.yP||this.hP||this.vP;if((r||this.mP)&&this.TD){const t=this.pg.getInnerIntervalPixels(),s=oa.Dp(this.mh,this.Cp),n=[this.wa.left+i,this.wa.right+i],o=[this.wa.bottom+i,this.wa.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.wa.left,this.wa.right],l=[this.wa.bottom,this.wa.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.YP.Ei(n).zi(o).Vi(0,h.x).Oi(0,h.y),this.OP._I({x:this.TD.dataGridHeight,y:this.TD.dataGridWidth}).Ls().De();const d={x:Math.round(this.HP.x),y:Math.round(Math.min(0,this.HP.y))};this.UP.Ei(a).zi(l).Vi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.hD.Be({x:c.x,y:c.y});const f={x:this.UP.x.ei(),y:this.UP.y.ei()+this.OP.bI(),width:this.UP.x.ri()+e-this.OP.bI(),height:this.UP.y.ri()+e};this.tD.ux(f),this.qP.ux(f),this.KP.ux(f);const g=this.TD,y=[{x:this.UP.x.getInnerStart(),y:this.UP.y.getInnerStart()},{x:this.UP.x.getInnerEnd(),y:this.UP.y.getInnerStart()},{x:this.UP.x.getInnerEnd(),y:this.UP.y.getInnerEnd()},{x:this.UP.x.getInnerStart(),y:this.UP.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=Ge([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],y);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.FD(c,this.TD,e)}this.hP=!1,this.rP=!1,this.nP=!1,this.oP=!1,this.aP=!1,this.lP=!1,this.uP=!1,this.cP=!1,this.dP=!1,this.fP=!1,this.AP=!1,this.gP=!1,this.pP=!1,this.yP=!1,this.mP=!1,this.vP=!1}wD(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.tP){const{content:r}=t,n={...this.JP,...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.gr(i).jh(t.textFont||this.$P).Ls().td()}if(Id(r)&&(h=r,l={x:200,y:50}),oo(r)){const t=this.ls.ID(r);t.PD()?(a=r,l=a.oi()):t.DD((()=>{this.vP=!0,this.ls.xs()}))}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}FD(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.hD.it(c),this.rD.Oe(this.ZP),this.eP.clear();const d={cellBackground:this.nD.Mm(),cellIconRect:this.oD.Mm(),lineSet:this.lD.Mm(),line:this.uD.Mm(),pointSet:this.cD.Mm(),rect:this.dD.Mm(),junction:this.fD.Mm(),arc:this.AD.Mm()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:y}=i,m={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},x={x:p.x+y.left,y:p.y+y.bottom},A={x:x.x+g.left,y:x.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-y.left-y.right,y:S.y-y.top-y.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=ef(A,b,r.contentAlignment||this.QP);n.Be(t[0]).Ya({x:t[1],y:t[2]}).Ie(this.BD(r.textFillStyle||this.XP,r.content,this.XP)).us(r.highlight)}const M=this.BD(r.backgroundFillStyle||this.jP,r.content);if(M!==B){const t=d.cellBackground.add();t.Be(p).it(S).Ie(M).Fe(nt).us(r.highlight),this.eP.set(t,m)}const w=r.borders||this.kP;if(w&&tf(p,S,w,s,f),o){const t=A,e=b;Fd(o,d,this.UP,t,e,this.Ki,this.mA,r.highlight)}if(c){const t=c.oi(),i=ef(A,b,r.contentAlignment||this.QP);d.cellIconRect.add().Be({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).it(t).Ie(new qn({source:c.uc,fitMode:e.ImageFitMode.Stretch})).Fe(nt).us(r.highlight)}}this.rD.Ot();for(const t of f)this.rD.Hr().Yg(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()}CD(t,e){const i=new Array(t).fill(0);for(const t of this.xP.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.iP.find((e=>e.column===t)),n=r?Ft(s,void 0!==r.min?r.min:ze,void 0!==r.max?r.max:Be):s;i[t]=n}return i}kD(t,e){const i=new Array(t).fill(0);for(const t of this.SP.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.sP.find((e=>e.row===t)),n=r?Ft(s,void 0!==r.min?r.min:ze,void 0!==r.max?r.max:Be):s;i[t]=n}return i}BD(t,e,i){if(H(t)){try{const i=Number(e);return new U({color:t.getPalette().getColors(i)})}catch(t){}return i||B}return t}xD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.XP):e,this.fP=!0,this.ls.xs()}bD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.$P):e,this.AP=!0,this.ls.xs()}_D(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.jP):e,this.dP=!0,this.ls.xs()}MD(t,e){t.contentAlignment=e,this.cP=!0,this.ls.xs()}mD(t,e){t.padding={...t.padding,...e},this.uP=!0,this.ls.xs()}pD(t,e,i){let s=this.CP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.tP.push(s),this.oP=!0),"string"==typeof s.content||"number"==typeof s.content?this.rP=!0:this.nP=!0,this.ls.xs()}SD(t){this.tP.forEach((e=>t(e)))}CP(t,e,i){const s=this.tP.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}yD(t,e){const i=this.tP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}vD(t,e){const i=this.tP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}eD(){return new $d(this.sD,this.iD,this.YP,this.YP,this.UP,this.Ki,Zd.Both).onScroll(((t,e)=>{this.TD&&(t===Zd.Vertical&&(this.HP.y=-e),t===Zd.Horizontal&&(this.HP.x=e),this.mP=!0,this.ls.xs())})).jI(50).ZI(12)}}const qd={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 Jd;e.DataGridCellContentAlignmentOptions=void 0,(Jd=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",Jd.RightCenter="right-center",Jd.LeftCenter="left-center",Jd.RightTop="right-top",Jd.LeftTop="left-top",Jd.RightBottom="right-bottom",Jd.LeftBottom="left-bottom",Jd.CenterTop="center-top",Jd.CenterBottom="center-bottom";const tf=(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])},ef=(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 we(0,`Unidentified DataGrid cell content alignment option: ${i}`)},sf={top:!1,bottom:!1,left:!1,right:!1};class rf extends ir{constructor(t,e,i,s,r,n){super(t,{Tr(){},kr(){},Ir(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.ss=n,this.Is=r,this.bh=r.Or(t.LD).jh(this.Ki.barChartCategoryAxisTitleFont||this.Ki.xAxisTitleFont).Ie(this.Ki.barChartCategoryAxisTitleFillStyle||this.Ki.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Ps.getWidth({x:0,y:-90})),this.Jh=this.ss.wg([this.bh]).Ss(e.effectsText),this.RD=r.Ne(t.LD).Oe(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setStrokeStyle(t){return this.RD.Oe(t),this.chart.ls.xs(),this}getStrokeStyle(){return this.RD.pu()}Ls(){if(!this.Xi)return{Rg:0,Eg:0,Yd:Ft(0,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be)};const t=this.RD.pu().N()/2,e=this.chart.Ps.getHeight(this.bh.Ls().td());return{Rg:t,Eg:e,Yd:t+e}}De(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.RD.We(this.chart.Ps.toPoint(r.start,n.start)).Ge(this.chart.Ps.toPoint(r.end,n.start)).setVisible(this.Xi),this.bh.Be(this.chart.Ps.toPoint(.5*(r.start+r.end),this.chart.valueAxis.At.pi(n.start,-(t.Rg+s.labelMarginBeforeCategoryAxisPixels)))).Ya(this.chart.Ps.toPoint(0,1)).setVisible(this.Xi)}setMouseInteractions(t){return this}mr(t,e){return new sr(e,t,this.Is,this.chart.LD)}vr(t,e){return{}}Dr(t,e){return e}Lr(t,e,i){return{min:t,max:e}}}class nf extends ir{constructor(t,e,i,s,r,n,o){super(t,{Tr:()=>{var e;if(t.ED){if("positive"===t.zD||"bipolar"===t.zD){if("after-bar"===(null===(e=t.VD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.ED.max,Math.min(this.chart.Ps.getHeight(this.chart.OD())+t.VD.labelMargin,.3*e))}return t.ED.max}return t.ND?Ft(-1,-1e-6,t.ED.max):0}},kr:()=>{var e;if(t.ED){if("negative"===t.zD||"bipolar"===t.zD){if("after-bar"===(null===(e=t.VD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.ED.min,-Math.min(this.chart.Ps.getHeight(this.chart.OD())+t.VD.labelMargin,.3*e))}return t.ED.min}return t.ND?Ft(1,1e-6,t.ED.min):0}},Ir:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.ss=n,this.Is=r,this.bh=r.Or(t.LD).jh(this.Ki.barChartValueAxisTitleFont||this.Ki.yAxisTitleFont).Ie(this.Ki.barChartValueAxisTitleFillStyle||this.Ki.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Ps.getHeight({x:0,y:-90})),this.Jh=this.ss.wg([this.bh]).Ss(e.effectsText),this.RD=r.Ne(t.LD).Oe(e.barChartValueAxisStrokeStyle||this.Ki.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setStrokeStyle(t){return this.RD.Oe(t),this.chart.ls.xs(),this}getStrokeStyle(){return this.RD.pu()}setTickStrategy(t,e){return super.Vh(t,e)}Ls(t){if(!this.Xi)return this.Kh(),{Rg:0,Eg:0,Yd:Ft(0,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be)};const e=this.chart.Ps.getWidth(this.chart.LD).ri(),i=this.At.ri();this.rr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.sh.values())for(const e of t.values()){const t=e.Fh.yr,i=this.chart.Ps.getWidth(e.Ke.td()),r=t.getTickLength()+t.getTickPadding()+i;s=Math.max(s,r)}const r=s+this.RD.pu().N()/2,n=this.chart.Ps.getWidth(this.bh.Ls().td());return{Rg:r,Eg:n,Yd:Ft(r+n,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be)}}De(t){const e=this.getInterval();this.RD.We(this.chart.Ps.toPoint(-.5,this.Oh)).Ge(this.chart.Ps.toPoint(-.5,this.Nh)).setVisible(this.Xi);const i="logarithmic"===this.Eh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Ps.toPoint(this.chart.categoryAxis.At.pi(-.5,t.Rg*this.chart.Ps.GD),i),r=this.chart.Ps.toPoint(this.chart.Ps.WD,0);this.bh.Be(s).Ya(r).setVisible(this.Xi)}setMouseInteractions(t){return this}mr(t,e){return new sr(e,t,this.Is,this.chart.LD)}vr(t,e){const i=t.Fh.yr,s=this.chart.Ps.toPoint(-.5,t.M),r=this.chart.LD.pi(s,this.chart.Ps.toPoint(i.getTickLength()*this.chart.Ps.GD,0)),n=this.chart.LD.pi(s,this.chart.Ps.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Ps.GD,0)),o=this.chart.LD.pi(r,this.chart.Ps.toPoint(i.getTickPadding()*this.chart.Ps.GD,0));t.Ke.Be(o).Ya(this.chart.Ps.toPoint(this.chart.Ps.WD,i.getLabelAlignment())).Zh(i.getLabelRotation()),i.tickStyle!==nt&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==nt&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}Dr(t,e){return"linear"===this.Eh.type?uh(t,e,this.At):ch(t,e,this.At)}Lr(t,e,i){return{min:t,max:e}}}class of extends jl{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Xo=Fe(),this.M=0,this.UD=!1,this.chart=t,this.chart=t,this.category=r,this.subCategory=n,this._s=r,this.we=ye(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Ce=ye(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.chart.YD()})),this.onDispose((()=>{this.chart.YD(),this.chart.HD.delete(this.category),this.chart.$D.delete(this)}))}Qi(t,e){const i=this.chart.ls.Vo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.chart.ls.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.chart.ls.At},category:this.category,subCategory:this.subCategory,bar:this,value:this.getValue()}}setValue(t){return this.UD=!0,this.M=t,this.chart.YD(),this.chart.ls.xs(),this.chart.HD.delete(this.category),this.chart.$D.delete(this),this}getValue(){return this.M}get value(){return this.M}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.chart.YD(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.chart.YD(),this}getStrokeStyle(){return this.Ce}rv(){return this.av}setEffect(t){return this.chart.setBarsEffect(t),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}const hf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),af=(t,e,i)=>{const s=t.Bd.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 lf extends cl{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.wp("barChart bg",0),s,e.ls.Ki.barChartBackgroundFillStyle||e.ls.Ki.chartXYBackgroundFillStyle,e.ls.Ki.barChartBackgroundStrokeStyle||e.ls.Ki.chartXYBackgroundStrokeStyle,e.ls.Ki.barChartTitleFont||e.ls.Ki.chartXYTitleFont,e.ls.Ki.barChartTitleFillStyle||e.ls.Ki.chartXYTitleFillStyle,n),this.coordsBars="barChart",this.XD=uf.Descending,this.jD=this.Ki.barChartCategoryLabels,this.VD=this.Ki.barChartValueLabelsAfterBars,this.ZD=!1,this.jM=ke(),this.HD=new Map,this.$D=new Map,this.zD="positive",this.QD="columns",this.JD=!0,this.KD=new Map,this.qD={speed:1},this.wy={speed:1},this.tB=.08,this.Mn=(t,e,i,s,r)=>{this.LD.it(s,r)},this.ls.Xn(dh.ff),this.Ps="horizontal"===(null==o?void 0:o.type)?df:cf,this.mh.gr("Bar Chart"),this.iB=e.Hy("barChart plotting 1",0),this.sB=e.Hy("barChart plotting 2",1),this.ND="logarithmic"===(null===(h=null==o?void 0:o.valueAxis)||void 0===h?void 0:h.type),this.ND?"horizontal"===this.Ps.eB?(a=i.d1({scale1DConstructor:Li,dimension:"y"}),this.LD=(new zi).Ri(i.d1({scale1DConstructor:Ci,dimension:"x"}),a)):(a=i.d1({scale1DConstructor:Li,dimension:"x"}),this.LD=(new zi).Ri(a,i.d1({scale1DConstructor:Ci,dimension:"y"}))):(this.LD=i.d2({scaleXYConstructor:Bi}),a=this.Ps.getWidth(this.LD)),this.hB=this.ss.wg(),this.JM=new ja((()=>this.jM.Mt(this.iB.Um(this.LD).ra(0))),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.bar),e.bar.gs([i]),i})))),(()=>{this.jM.Ot()}),(t=>{this.hB.fs(t)})),this.zv=this.op.Pe(this.LD).Ie(this.Ki.barChartSeriesBackgroundFillStyle||B).Fe(nt),this.Vv=this.op.Pe(this.LD).Ie(B).Fe(this.Ki.barChartSeriesBackgroundStrokeStyle||nt).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.categoryAxis=new rf(this,this.Ki,!1!==(null==o?void 0:o.animationsEnabled),a,this.sB,this.ss);const l=lh(null==o?void 0:o.valueAxis);this.valueAxis=new nf(this,this.Ki,!1!==(null==o?void 0:o.animationsEnabled),this.Ps.getHeight(this.LD),this.sB,this.ss,l.type),this.rB=new Ka((()=>this.sB.Or(this.LD).Vr(Ie).zr(Ie).ra(1))),this.nB=new ja((()=>this.op.Wg(this.LD).setMouseInteractions(!1)),((t,e,i)=>(t.Oe(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Hr()).Yg(e[0],e[1]))))));const u=e.Xy(),c=Pt(o?o.cursorBuilder:void 0,Ma);this.jy=la(this,u,c.gy(u,this.uiScale,this.uiScale,kt,this.Ki),this,"show-pointed",ff,(()=>0)),this.onResize(this.Mn),this._p(r,this.LD),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ma){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}setBarsMargin(t){return this.tB=Ft(t,0,.49),this.ZD=!0,this.ls.xs(),this}getBarsMargin(){return this.tB}setBarsEffect(t){return this.hB.Ss(t),this.ls.xs(),this}getBarsEffect(){return this.hB.bs()}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.oB("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.oB("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.oB("groups",i),this}oB(t,e){this.Dv.length>0&&this.ls.Xn(dh.Cf),this.QD=t,this.aB(e);const i=Se(e.map((t=>t.category))),s=i.length,r=Se(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.Dv.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 of(this,this.Lv,this.Ki,this.ls.ss,t.category,t.subCategory,Pt(n,s)),this.Ov(e),this.KD.set(e,{category:s,valueStart:this.ND?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.Dv.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.KD.delete(t))})),this.categoryAxis.setInterval(this.Ps.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.ED=0===this.Dv.length?void 0:"stacks"!==t?this.Dv.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Be,max:ze}):{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.ED&&(this.zD=this.ED.min>=0?"positive":this.ED.max<=0?"negative":"bipolar",("bipolar"===this.zD||"negative"===this.zD)&&this.ND))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.aB(this.Dv),this.HD.clear(),this.$D.clear(),this.ZD=!0,this.ls.xs()}setCategoryLabels(t){const e="function"==typeof t?this.jD?t(this.jD):this.jD:t;return this.jD=e?{...this.Ki.barChartCategoryLabels,...e}:void 0,this.HD.clear(),this.ls.xs(),this}getCategoryLabels(){return this.jD}setValueLabels(t){var e;const i="function"==typeof t?this.VD?t(this.VD):this.VD:t,s=(null==i?void 0:i.position)||(null===(e=this.VD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.VD={...this.Ki.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.VD={...this.Ki.barChartValueLabelsInsideBars,...i}):this.VD=void 0,this.$D.clear(),this.ls.xs(),this}getValueLabels(){return this.VD}setLabelFittingEnabled(t){return this.JD=t,this.ls.xs(),this}getLabelFittingEnabled(){return this.JD}getBar(t,e){if(("groups"===this.QD||"stacks"===this.QD)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.Dv.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.Dv}setSorting(t){return this.XD=t,this.aB(this.Dv),this.ls.xs(),this}getSorting(){return this.XD}setAnimationCategoryPosition(t,e=1){return this.qD=t?{speed:e}:void 0,this.ls.xs(),this}setAnimationValues(t,e=1){return this.wy=t?{speed:e}:void 0,this.ls.xs(),this}translateCoordinate(t,e,i){if(i&&Gi(t)&&Yi(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Ui(t))r=this.ls.Vo(t);else if(Gi(t)){const e=ct(t,this.pg,this.ls.At);r={engineX:e.x,engineY:e.y}}else{if(!hf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=ct(this.Ps.toPoint(t.iCategory,t.value),this.LD,this.ls.At);r={engineX:e.x,engineY:e.y}}}if(Oi(s))return this.ls.Oo(r);if("barChart"===s){const t=ct({x:r.engineX,y:r.engineY},this.ls.At,this.LD);return{iCategory:this.Ps.getWidth(t),value:this.Ps.getHeight(t)}}if(Yi(s))return ct({x:r.engineX,y:r.engineY},this.ls.At,this.pg);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}if(){if("columns"===this.QD)return this.Dv;const t=Se(ve(this.Dv.map((t=>t.subCategory))));return ve(t.map((t=>{const e=this.Dv.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 Me(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}De(t){var e,i;super.De(t);const s=this.rB.Mm(),r=this.nB.Mm(),n=this.Dv.filter((t=>t.getVisible()&&t.UD)),o=Se(n.map((t=>t.category))),h=Se(ve(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.qD)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.qD)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.At,c=u instanceof Li?(t,e)=>{var i;return uh(t,e,u,(null===(i=this.wy)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return ch(t,e,u,(null===(i=this.wy)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.QD?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.ND?1e-6:0,valueEnd:t.value}}))):"groups"===this.QD?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.tB),r=this.tB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.ND?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.ND?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.KD.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.qD&&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.wy&&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.KD.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.ls.xs(!0),s===n.category&&r===n.valueEnd||(this.ZD=!0)})),oa.Bp(this.mh,this.Cp);const f=n.length>0;this.categoryAxis.Pr(),this.valueAxis.Pr();const g=this.categoryAxis.setVisible(f).Ls(),y=this.valueAxis.setVisible(f).Ls(r),{labelMarginBeforeCategoryAxisPixels:m}=f?this.lB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.De(g,s,r,{labelMarginBeforeCategoryAxisPixels:m}),this.valueAxis.De(y);const p=this.categoryAxis.getThickness(),x=Ft(g.Yd+m,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Be),A={x:Math.min(this.LD.x.getInnerStart(),this.LD.x.getInnerEnd()),y:Math.min(this.LD.y.getInnerStart(),this.LD.y.getInnerEnd())},S=Math.max(this.LD.x.getInnerStart(),this.LD.x.getInnerEnd()),v=Math.max(this.LD.y.getInnerStart(),this.LD.y.getInnerEnd()),b={x:S-A.x,y:v-A.y};this.zv.Be(A),this.zv.it(b),this.Vv.Be(A),this.Vv.it(b),super.Mp(),this.jy.De(!1,this.Dv,void 0);const M=oa.Dp(this.mh,this.Cp);if(this.LD.zi([this.Xt.bottom+this.wa.bottom+("vertical"===this.Ps.eB?x:0),this.Xt.top+this.wa.top+M+("horizontal"===this.Ps.eB?y.Yd:0)]),this.LD.Ei([this.Xt.left+this.wa.left+this.Ps.getHeight({x,y:y.Yd}),this.Xt.right+this.wa.right]),this.iB.ux({x:this.LD.x.ei(),y:this.LD.y.ei(),width:this.LD.x.ri(),height:this.LD.y.ri()}),this.ep&&this.ep(),this.ZD){const t=this.JM.Mm(),e="groups"===this.QD?1/(h.length+2*(h.length+1)*this.tB):1-2*this.tB;n.forEach((i=>{const s=this.KD.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Ps.toPoint(r,s.valueStart),this.Ps.toPoint(r,s.valueEnd),this.Ps.toPoint(n,s.valueEnd),this.Ps.toPoint(n,s.valueStart)];t.add({Xo:i.Xo,vertices:o,bar:i},{fillStyle:i.we,strokeStyle:i.Ce})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.ZD=!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.sB.Y(),this.iB.Y(),this.jy.Y(),super.dispose()}aB(t){const e=this.XD;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)})))}lB(t,e,i,s){let r=0;const n=this.jD,o=this.VD,h=this.valueAxis.getInterval(),a=this.Ps.getWidth({x:this.LD.x.ri(),y:this.LD.y.ri()});if(n&&n.labelFillStyle!==B){const o=n.tickLength+n.labelMargin,l=this.Ps.toPoint(0,1),u={Bd: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.Ps.toPoint(a,this.valueAxis.At.pi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.uB(t,s)}:void 0})),Hu:n.labelFont,At:this.LD},c=u?this.JD?af(u,a,this.Ps.getWidth):u.Bd:[];c.forEach((t=>{t&&i.add().gr(t.text).Be(t.position).Ya(t.alignment).Zh(t.rotation).Ie(n.labelFillStyle).jh(n.labelFont)})),n.tickStyle!==nt&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Ps.getWidth(t.position);s.add({positions:[this.Ps.toPoint(e,this.valueAxis.At.getInnerStart()),this.Ps.toPoint(e,this.valueAxis.At.pi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Ps.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==B){let t;"after-bar"===o.position?t={Bd:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.KD.get(t);return void 0!==s?{text:i,position:this.Ps.toPoint(s.category,this.valueAxis.At.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Ps.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.cB(t)}:void 0})),Hu:o.labelFont,At:this.LD}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Bd:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.KD.get(t);if(void 0===s)return;const r="bipolar"===this.zD?Math.sign(s.valueEnd):"negative"===this.zD?-1:1,n=this.Ps.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.Ps.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.cB(t)}})),Hu:o.labelFont,At:this.LD}),t&&(t?this.JD?af(t,a,this.Ps.getWidth):t.Bd:[]).forEach((t=>{t&&i.add().gr(t.text).Be(t.position).Ya(t.alignment).Zh(t.rotation).Ie(o.labelFillStyle).jh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}uB(t,e){if(!this.jD||this.jD.labelFillStyle===B)return{x:0,y:0};const i=this.HD.get(t);if(i)return i;const s=this.jD.formatter(t,e),r=this.ls.Vg.zg(s,this.jD.labelFont,this.jD.labelRotation);return r.isEstimate?this.ls.xs(!0):this.HD.set(t,r),r}cB(t){if(!this.VD||this.VD.labelFillStyle===B)return{x:0,y:0};const e=this.$D.get(t);if(e)return e;const i=this.ls.Vg.zg(this.VD.formatter(t,t.category,t.value),this.VD.labelFont,this.VD.labelRotation);return i.isEstimate?this.ls.xs(!0):this.$D.set(t,i),i}OD(){return this.Dv.reduce(((t,e)=>{const i=this.cB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}YD(){this.ZD=!0,this.ls.xs()}getMinimumSize(){return{x:200,y:200}}}const uf={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)},cf={...mh,eB:"vertical",GD:-1,WD:1},df={...ph,eB:"horizontal",GD:1,WD:-1},ff=(t,e,i)=>{const s=[[e.bar]],r=t.valueAxis.getTitle();return r&&s.push([r]),e.subCategory?s.push([e.subCategory,"",{text:ah(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}]):s.push({text:ah(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}),s};class gf extends na{constructor(t,e,i,s,r,n,o){super(t,e,i,e.wp("gaugeChart bg",0),s,e.ls.Ki.gaugeChartBackgroundFillStyle,e.ls.Ki.gaugeChartBackgroundStrokeStyle,e.ls.Ki.gaugeChartTitleFont,e.ls.Ki.gaugeChartTitleFillStyle,n),this.ql=this.Ki.gaugeChartStartAngle,this.tu=this.Ki.gaugeChartEndAngle,this.dB={start:0,end:100},this.M=0,this.fB=[],this.AB=this.Ki.gaugeChartBarThickness,this.gB=this.Ki.gaugeChartValueIndicatorThickness,this.pB=this.Ki.gaugeChartNeedleLength,this.yB=this.Ki.gaugeChartNeedleThickness,this.mB=this.Ki.gaugeChartNeedleFillStyle,this.vB=this.Ki.gaugeChartNeedleStrokeStyle,this.SB=this.Ki.gaugeChartRoundedEdges,this.xB=!0,this.bB=!0,this.MB=!0,this._B=[],this.wB=[],this.CB=!0,this.kB=!0,this.vy=this.M,this.TB=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.FB=this.Ki.gaugeChartBarGradient,this.IB=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.PB=this.Ki.gaugeChartTickFont,this.DB=this.Ki.gaugeChartValueLabelFont,this.BB=this.Ki.gaugeChartValueLabelFillStyle,this.LB=this.Ki.gaugeChartUnitLabelFont,this.RB=this.Ki.gaugeChartUnitLabelFillStyle,this.EB=this.Ki.gaugeChartTickFillStyle,this.zB=this.Ki.gaugeChartBarColor,this.VB=this.Ki.gaugeChartGlowColor,this.OB=this.Ki.gaugeChartGlowColor.getA(),this.NB=1,this.GB=1,this.WB=this.Ki.gaugeChartNeedleAlignment,this.UB=!1,this.YB=this.Ki.gaugeChartGapBetweenBarAndValueIndicators,this.HB=this.Ki.gaugeChartBarStrokeStyle,this.$B=!1,this.ls.Xn(dh.gf),this.mh.gr("Gauge Chart"),this._p(r,this.pg),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.XB=this.zB,this.jB=this.VB,this.ZB=w(0,0,0,0),this.QB=this.ss.wg(),this.JB=this.ss.wg().Ss(this.Ki.effectsText),this.KB=this.op.oc(this.pg).Fe(this.HB).setMouseInteractions(!1),this.qB=this.op.hd(this.pg).lu(0).Ge(360).fu(0).Fe(nt).setMouseInteractions(!1),this.tL=this.kp.Ne(this.pg).Oe(this.Ki.gaugeChartNeedleStrokeStyle).setMouseInteractions(!1),this.iL=this.kp.Ne(this.pg).Oe(new Ji({thickness:this.yB,fillStyle:this.mB})).setMouseInteractions(!1),this.sL=this.kp.Or(this.pg).jh(this.DB).Ie(this.BB).setMouseInteractions(!1),this.Wd=this.kp.Or(this.pg).jh(this.LB).Ie(this.RB).gr("").setMouseInteractions(!1),this.eL=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1),this.hL=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1),this.QB.fs([this.KB]),this.JB.fs([this.sL,this.Wd,this.eL,this.hL]),this.rL(),this.onResize((()=>{this.UB=!0}))}rL(){this.iL.Oe((t=>t.setThickness(this.yB))),this.tL.Oe((t=>t.setThickness(2*this.vB.getThickness()+this.yB)))}setAnimationsEnabled(t){return this.ah=t,this.kB=t,this.CB=t,this}setInterval(t,e){return this.dB={start:t,end:e},this.UB=!0,this.ls.xs(),this}getInterval(){return this.dB}setTickFillStyle(t){return this.EB="function"==typeof t?t(this.EB):t,this.wB.forEach((e=>{e.start.Ie(t),e.end.Ie(t)})),this.eL.Ie(t),this.hL.Ie(t),this.UB=!0,this.ls.xs(),this}getTickFillStyle(){return this.EB}setTickFont(t){return this.PB="function"==typeof t?t(this.PB):t,this.wB.forEach((e=>{e.start.jh(t),e.end.jh(t)})),this.eL.jh(t),this.hL.jh(t),this.UB=!0,this.ls.xs(),this}getTickFont(){return this.PB}setTickFormatter(t){return this.TB=t,this.UB=!0,this.ls.xs(),this}getTickFormatter(){return this.TB}setValueLabelFillStyle(t){return this.BB="function"==typeof t?t(this.BB):t,this.sL.Ie(t),this.UB=!0,this.ls.xs(),this}getValueLabelFillStyle(){return this.sL.Hh()}setValueLabelFont(t){return this.DB="function"==typeof t?t(this.DB):t,this.sL.jh(t),this.UB=!0,this.ls.xs(),this}getValueLabelFont(){return this.sL.Xh()}setValueFormatter(t){return this.IB="string"==typeof t?e=>t:t,this.UB=!0,this.ls.xs(),this}getValueLabel(){return this.sL._r()||this.IB}setUnitLabelFillStyle(t){return this.RB="function"==typeof t?t(this.RB):t,this.Wd.Ie(t),this.UB=!0,this.ls.xs(),this}getUnitLabelFillStyle(){return this.Wd.Hh()}setUnitLabelFont(t){return this.LB="function"==typeof t?t(this.LB):t,this.Wd.jh(t),this.UB=!0,this.ls.xs(),this}getUnitLabelFont(){return this.Wd.Xh()}setUnitLabel(t){return this.Wd.gr(t),this.UB=!0,this.ls.xs(),this}getUnitLabel(){return this.Wd._r()}setNeedleFillStyle(t){return this.mB="function"==typeof t?t(this.mB):t,this.iL.Oe((e=>e.setFillStyle(t))),this.UB=!0,this.ls.xs(),this}getNeedleFillStyle(){return this.iL.pu().getFillStyle()}setNeedleThickness(t){return this.yB=t,this.rL(),this.UB=!0,this.ls.xs(),this}getNeedleThickness(){return this.yB}setNeedleStrokeStyle(t){return this.vB="function"==typeof t?t(this.vB):t,this.tL.Oe(t),this.rL(),this.UB=!0,this.ls.xs(),this}getNeedleStrokeStyle(){return this.tL.pu()}setNeedleLength(t){return this.pB=t,this.UB=!0,this.ls.xs(),this}getNeedleLength(){return this.pB}setBarColor(t){return this.zB=t,this.UB=!0,this.ls.xs(),this}getBarColor(){return this.XB}setBarGradient(t){return this.FB=t,this.UB=!0,this.ls.xs(),this}getBarGradient(){return this.FB}setBarStrokeStyle(t){return this.HB="function"==typeof t?t(this.HB):t,this.KB.Fe(t),this.UB=!0,this.ls.xs(),this}getBarStrokeStyle(){return this.KB.po()}setBarThickness(t){return this.AB=t,this.UB=!0,this.ls.xs(),this}getBarThickness(){return this.AB}setAngleInterval(t,e){return Math.abs(t-e)>360&&(e=t{t.dispose()})),this._B.length=0,this.wB.forEach((t=>{t.start.dispose(),t.end.dispose()})),this.wB.length=0,this.fB.forEach((t=>{const e=this.op.oc(this.pg).Fe(nt).Ie(new U({color:t.color})).setMouseInteractions(!1);this._B.push(e);const i=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1),s=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1);this.wB.push({start:i,end:s})})),this.QB.fs([this.KB,...this._B]),this.JB.fs([this.sL,this.Wd,this.eL,this.hL,...this.wB.map((t=>[t.start,t.end])).flat()]),this.UB=!0,this.ls.xs(),this}getValueIndicators(){return this.fB}setValueIndicatorThickness(t){return this.gB=t,this.UB=!0,this.ls.xs(),this}getValueIndicatorThickness(){return this.gB}setAutomaticBarColoring(t){return this.MB=!!t,this.UB=!0,this.ls.xs(),this}getAutomaticBarColoring(){return this.MB}setGlowColor(t){return void 0===t?(this.xB=!1,this.jB=void 0):"object"==typeof t&&"auto"in t?(this.bB=t.auto,t.auto&&(this.jB=void 0),void 0!==t.alpha&&(this.OB=t.alpha),this.xB=!0):(this.jB=t,this.OB=t.getA(),this.bB=!1,this.xB=!0),this.UB=!0,this.ls.xs(),this}getAutomaticGlowColoring(){return this.bB}setNeedleAlignment(t){return this.WB=t,this.UB=!0,this.ls.xs(),this}getNeedleAlignment(){return this.WB}setGapBetweenBarAndValueIndicators(t){return this.YB=t,this.UB=!0,this.ls.xs(),this}getGapBetweenBarAndValueIndicators(){return this.YB}setBarEffect(t){return this.QB.Ss(t),this.ls.xs(),this}getBarEffect(){return this.QB.bs()}setLabelEffect(t){return this.JB.Ss(t),this.ls.xs(),this}getLabelEffect(){return this.JB.bs()}De(t){var i;if(super.De(t),oa.Bp(this.mh,this.Cp),super.Mp(),this.vy!==this.M){if(this.CB){const e=5e-4*t,i=.003*t,s=Math.sign(this.M-this.vy);this.vy=this.vy+e*s+i*this.NB*(this.M-this.vy),s!==Math.sign(this.M-this.vy)?this.vy=this.M:this.ls.xs(!0)}else this.vy=this.M;this.UB=!0}const s=this.fB.find((t=>this.vy>=t.start&&this.vy<=t.end));if(this.XB=this.MB&&s?s.color:this.zB,this.kB){if(this.ZB!==this.XB){const e=this.ZB.getR(),i=this.ZB.getG(),s=this.ZB.getB(),r=this.XB.getR(),n=this.XB.getG(),o=this.XB.getB(),h=Math.sign(r-e),a=Math.sign(n-i),l=Math.sign(o-s),u=.005*t,c=.003*t;this.ZB=w(e+u*h+c*this.GB*(r-e),i+u*a+c*this.GB*(n-i),s+u*l+c*this.GB*(o-s));const d=Math.abs(r-this.ZB.getR()),f=Math.abs(n-this.ZB.getG()),g=Math.abs(o-this.ZB.getB());d<1&&f<1&&g<1?this.ZB=this.XB:this.ls.xs(!0),this.UB=!0}}else this.ZB=this.XB;if(this.UB){let t=Be,r=ze,n=Be,o=ze;if(new Array(100).fill(0).forEach(((e,i,s)=>{const h=this.ql+i/s.length*(this.tu-this.ql),a=Math.sin(h*Math.PI/180),l=Math.cos(h*Math.PI/180);ar&&(r=a),lo&&(o=l)})),this.FB?this.KB.Ie(new J({stops:[{offset:0,color:C("#000000")},{offset:1,color:this.ZB}],position:{x:.5,y:.5}})):this.KB.Ie(new U({color:this.ZB})),this.xB){const t=this.bB&&s?this.ZB:null!==(i=this.jB)&&void 0!==i?i:this.VB;this.qB.Ie(new J({stops:[{offset:0,color:t.setA(this.OB)},{offset:1,color:t.setA(0)}],position:{x:.5,y:.5},extent:e.GradientExtent.farthestSide}))}else this.qB.Ie(B);const h=this.TB(this.dB.start),a=this.TB(this.dB.end);let l=0,u=0;const c=this.ls.Vg.zg(h,this.eL.Xh(),this.eL.Qh()),d=this.ls.Vg.zg(a,this.hL.Xh(),this.hL.Qh());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.wB.forEach(((t,e)=>{if(e>=this.fB.length)return;const i=this.fB[e],s=this.TB(i.start),r=this.TB(i.end),n=this.ls.Vg.zg(s,t.start.Xh(),t.start.Qh()),o=this.ls.Vg.zg(r,t.end.Xh(),t.end.Qh());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.fB.length>0?this.gB:0,g=this.pg.getInnerIntervalPixels(),y=oa.Dp(this.mh,this.Cp),m={x:g.x,y:g.y-y},p={x:.5*m.x,y:.5*m.y},x=f+2*this.YB+this.AB/2,A=l+x,S=u+x,v=S+y,b=g.y-(v+S),M=g.x-(A+A),w=.5*Math.max(this.AB/2,b{var i,s;const r=t.start>=G&&t.end<=X;this._B[e].setVisible(r),this.wB[e].start.setVisible(r),this.wB[e].end.setVisible(r);const n=pf(this.dB,this.ql,this.tu,t.start,k,H),o=pf(this.dB,this.ql,this.tu,t.end,k,H),h=yf(k,Z,n.angle,o.angle,this.gB,this.SB);this._B[e]._l(h);const a=this.dB.start===t.start||this.dB.end===t.start,l=this.dB.start===t.end||this.dB.end===t.end||this.fB.some((e=>e.start===t.end&&e!==t));this.wB[e].start.Be({x:n.x,y:n.y}).Ya({x:Math.min(1,Math.max(-1,2*(n.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(n.y-z)/(N-z)-1))}).gr(null!==(i=t.startLabel)&&void 0!==i?i:a?"":this.TB(t.start)),this.wB[e].end.Be({x:o.x,y:o.y}).Ya({x:Math.min(1,Math.max(-1,2*(o.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(o.y-z)/(N-z)-1))}).gr(null!==(s=t.endLabel)&&void 0!==s?s:l?"":this.TB(t.end))}));const W=this.fB.some((t=>t.start=t.start&&this.dB.start<=t.end:this.dB.start<=t.start&&this.dB.start>=t.end)),j=pf(this.dB,this.ql,this.tu,this.dB.start,k,W?H:Z-this.YB);this.eL.Be({x:j.x,y:j.y}).Ya({x:Math.min(1,Math.max(-1,2*(j.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(j.y-z)/(N-z)-1))}).gr(h);const K=this.fB.some((t=>t.start=t.start&&this.dB.end<=t.end:this.dB.end<=t.start&&this.dB.end>=t.end)),$=pf(this.dB,this.ql,this.tu,this.dB.end,k,K?H:Z-this.YB);this.hL.Be({x:$.x,y:$.y}).Ya({x:Math.min(1,Math.max(-1,2*($.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*($.y-z)/(N-z)-1))}).gr(a),this.UB=!1}}getMinimumSize(){return{x:150,y:150}}if(){return[this]}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.setMouseInteractions(!1),ce(t,this.Ki,i,{fill:new U({color:this.getBarColor()})}),this}}const yf=(t,e,i,s,r,n=!0)=>{const o=[],h=.5*r,a=i>s,l=Math.sign(i-s),u=-1*l;if(n){const t=h/(2*Math.PI*e)*360+.1;i+=t*u,s+=t*l}else i+=.1*u,s+=.1*l;const c=mf(t,e+h,i,s,a);if(o.push(...c),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?mf(r,h,s+180,s+360,a):mf(r,h,s-180,s-360,a),o.push(...n)}const d=mf(t,e-h,s,i,!a);if(o.push(...d),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?mf(r,h,i-180,i-360,a):mf(r,h,i+180,i+360,a),o.push(...n)}return o},mf=(t,e,i,s,r)=>{it>s:t=>t{const[o,h]=t.starte?t.x:t.y,Af=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),Sf=(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(xf(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&&eAf(t,h,n,e))).reduce(((t,e)=>Math.max(t,xf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>xf(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))/xf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class vf{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.$i=!1,this.tP=new Array,this.R=new r.Eventer,this.nL=[],this.tp=[],this.oL=void 0,this.aL=!0,this.lL=!0,this.uL=!0,this.hp=!1,this.cL=!0,this.dL=()=>{this.cL=!0,this.ls.xs()},this.fL=[],this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.AL=t=>{for(let e=0;e{const e=this.nL.indexOf(t);e>=0&&this.nL.splice(e,1)},this.lp=t=>{const e=this.tp.indexOf(t);e>=0&&this.tp.splice(e,1)},this.pL=(t,e,i,s,r)=>{if(this.yL(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.tP.push(n),this.mL(n),this.aL=!0,t}throw new pt("Out of dashboard range.")},this.vL=e.numberOfRows,this.SL=e.numberOfColumns,this.mA=t,this.xL=e,this.bL=s;const o=this.SL*this.vL;this.ML={x:new Ed(new Array(this.SL).fill(1)),y:new Ed(new Array(this.vL).fill(1))},this.Ki=i.Ki,this._L=this.Ki.dashboardSplitterStyle,this.ah=!1!==(null==e?void 0:e.animationsEnabled),this.wL=Rd(i,o),this.CL=i.GF("dashboard splitters",500001),this.fM=()=>this.wL.NF(),this.gp=this.wL.WF(),this.ss=i.ss.es(this,{kL:{}}),this.ss.kL.Ss(this.Ki.effectsDashboardSplitters);const h=i.oi();this.uiScale=lt.d2({scaleXYConstructor:Bi}).Vi(0,100).Oi(0,100).it(h),this.pg=lt.d2({scaleXYConstructor:Bi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(h),this.TL=i.FL.bind(i),this.IL=i.PL.bind(i),this.DL=i.BL.bind(i),this.LL=i.RL.bind(i),this.uo=i.uo.bind(i),this.do=i.do.bind(i),this.engine=i.cp,this.ls=i.dp,i.Do((()=>this.dL())),i.xs();const a=i.Ro((t=>{this.hp=t,this.R.emit("inViewChange",this,t)}));this.Sp=i.Eo.bind(i,a),this.EL(),this.setAnimationsEnabled(this.ah);const l=(t=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.R);this.createChartXY=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new wc(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Cd(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new zc(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=bf(t,this.xL,this.ah),i=e&&e.type?e.type:Ya;return this.pL(new i(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new gf(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=bf(t,this.xL,this.ah),i=e&&e.type?e.type:$c;return this.pL(new i(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=bf(t,this.xL,this.ah),i=t&&t.type?t.type:ld;return this.pL(new i(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new sa(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Rl(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Ic(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Vl(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=bf(t,this.xL,this.ah),i=new wl(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e);return this.pL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=bf(t,this.xL,this.ah),i=new Qd(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l);return this.pL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=bf(t,this.xL,this.ah),i=new lf(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e);return this.pL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}zL(t,e){return t+e*this.SL}VL(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.SL:this.vL,"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.SL,y:this.vL},e),d3:()=>new ht({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.SL,y:this.vL},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.TL(t[0]),this.IL(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.DL(t[0]),this.LL(t[1]),this}getWidth(){return this.uo()}getHeight(){return this.do()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.CL.xs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.CL.xs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.Ki}setSplitterStyle(t){const e=this._L;return this._L="function"==typeof t?t(this._L):t,this.OL(e),this}getSplitterStyle(){return this._L}setSplitterEffect(t){return this.ss.kL.Ss(t),this.ls.xs(),this}getSplitterEffect(){return this.ss.kL.bs()}setAnimationHighlight(t){return this.uL=t,this.fL.forEach((e=>this.ls.os.Cs(e.line,t))),this}getAnimationHighlight(){return this.uL}OL(t){for(const t of this.fL)t.line.Oe(this._L);this.EL()}setColumnWidth(t,e){const i=this.ML.x.C();return t>=0&&t=e.length)throw new pt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.ML.y.C();return t>=0&&t=e.length)throw new pt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pg.getInnerIntervalPixels()}onResize(t){return this.R.on("resize",t)}offResize(t){return this.R.off(t,"resize")}NL(t,e,i){if(i&&Math.abs(t.x)>0)this.GL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.WL(e,t.y)}for(const t of this.tP)t.panel.K();this.dL()}WL(t,e){const i=Sf(this.tP,this.ML.y.C(),t,e,this.pg.oi(),!1);this.ML.y._(i),this.dL()}GL(t,e){const i=Sf(this.tP,this.ML.x.C(),t,e,this.pg.oi(),!0);this.ML.x._(i),this.dL()}UL(){this.fL.forEach((t=>t.line.dispose())),this.fL.length=0;for(let t=1;t<=this.SL-1;t+=1)for(let e=0;e<=this.vL-1;e+=1)if(void 0!==this.tP.find((i=>je(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=ji(new $i((()=>{this.YL(t)}),((e,i,s,r,n)=>{this.NL(r,t,!0),Qt(n)}),(()=>{this.HL(t)}))),s=this.CL.Ne(this.pg).Oe(this._L).setMouseEnterEventHandler((()=>{this.YL(t)})).setMouseLeaveEventHandler((()=>{this.HL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.NL(n,t,!0),Qt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.uL}),this.fL.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.vL-1;t+=1)for(let e=0;e<=this.SL-1;e+=1)if(void 0!==this.tP.find((i=>je(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=ji(new $i((()=>{this.$L(t)}),((e,i,s,r,n)=>{this.NL(r,t,!1),Qt(n)}),(()=>{this.XL(t)}))),s=this.CL.Ne(this.pg).Oe(this._L).setMouseEnterEventHandler((()=>{this.$L(t)})).setMouseLeaveEventHandler((()=>{this.XL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.NL(n,t,!1),Qt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.uL}),this.fL.push({row:t,column:e,line:s,alignment:"horizontal"})}this.ss.kL.fs(this.fL.map((t=>t.line)))}jL(){const t=this.pg.oi(),e=this.ML.x.C(),i=e.reduce(((t,e)=>t+e)),s=this.ML.y.C(),r=s.reduce(((t,e)=>t+e));this.fL.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.We(o).Ge(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.We(o).Ge(h)}}))}YL(t){this.fL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.ls.os.ws(e.line,1),this.CL.ZL(e.line))})),this.oL=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.ls.xs()}$L(t){this.fL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.ls.os.ws(e.line,1),this.CL.ZL(e.line))})),this.oL=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.ls.xs()}HL(t){this.fL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.ls.os.ws(e.line,0)})),this.engine.restoreMouseStyle(this.oL),this.ls.xs()}XL(t){this.fL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.ls.os.ws(e.line,0)})),this.engine.restoreMouseStyle(this.oL),this.ls.xs()}setAnimationsEnabled(t){return this.ah=t,this.getCells().filter((t=>t.panel instanceof na)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ah),this}getAnimationsEnabled(){return this.ah}getCells(){return this.tP.slice()}dispose(){return this.$i||(this.Sp&&this.Sp(),this.tP.slice().forEach((t=>t.panel.dispose())),this.nL.slice().forEach((t=>t.dispose())),this.tp.slice().forEach((t=>t.dispose())),this.$i=!0,this.bL(),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}getIsInView(){return this.hp}saveToFile(t,e,i){return Qh(this.engine,t,e,i),this}QL(t){if(this.cL){const t=this.ls.At.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.pg.it(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pg.Vi(0,s.x).Oi(0,s.y),this.R.emit("resize",this,s.x,s.y,e,i),this.lL=!0}this.aL&&(this.UL(),this.aL=!1,this.lL=!0),this.lL&&(this.jL(),this.lL=!1);for(const e of this.tP)e.panel.De(t);return this.nL.forEach((t=>t.Ls())),this.nL.forEach((t=>t.De())),this.tp.forEach((t=>t.Ls())),this.tp.forEach((t=>t.De())),this.cL=!1,this}J(){for(const t of this.tP)t.panel.J();return this.pg.x.J(),this.pg.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}K(){for(const t of this.tP)t.panel.K();return this.pg.x.K(),this.pg.y.K(),this.uiScale.x.K(),this.uiScale.y.K(),this}translateCoordinate(t,e,i){return ta(t,e,i,this.pg,this.ls)}addUIElement(t=Oo,e=this.uiScale){e=Jh(e,this.pg);const i=qh(t,this.fM(),this.uiScale,e,this.gL,this.Ki);return this.nL.push(i),i}addLegendBox(t=qo,i=this.uiScale){i=Jh(i,this.pg);const s=qh(t,this.gp,this.uiScale,i,this.lp,this.Ki);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.tp.push(s),s}getLegendBoxes(){return this.tp}yL(t,e,i,s){return e>=0&&t>=0&&e+s<=this.vL&&t+i<=this.SL}mL(t){const e=this._L,i=e===nt?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.zr(s)}EL(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this.pg.x.si([0,0]),this.pg.y.si([0,0]);for(const t of this.tP)this.mL(t);this.ls.xs()}}const bf=(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},Mf={XY:ac,Spider:ba,BarChart:Ma,Map:Ra,Polar:Ta,D3:Ml},wf={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"}},Cf={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"}},Tf={"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"}},Rf={"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"}},Ef={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"}},kf={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"}},If={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"}},Df={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"}},Pf={World:kf,USA:If,NorthAmerica:Ff,SouthAmerica:Df,Canada:Rf,Europe:Ef,Asia:Cf,Africa:wf,Australia:Tf},Lf=(t,e)=>Math.abs(t)+Math.abs(e);function Vf(t,e){const i=t.reduce(Lf,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 _f=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},Bf=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(Lf,0),h=t.map((t=>t.animatedValue)).reduce(Lf,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 Nf(c,_f(d).value,t,d);return d.children},zf=(t,e,i,s,r)=>{const n=t.reduce(Lf,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)},Nf=(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)){zf(a,n,_f(s).vertical,i,s),r.push({children:e.slice(h),width:_f(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&zf(a,n,_f(s).vertical,i,s)}};class Of extends na{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.wp("treeMapChart bg",0),r,i.ls.Ki.treeMapChartBackgroundFillStyle||i.ls.Ki.chartXYSeriesBackgroundFillStyle,i.ls.Ki.treeMapChartBackgroundStrokeStyle||i.ls.Ki.chartXYBackgroundStrokeStyle,i.ls.Ki.treeMapChartTitleFont||i.ls.Ki.chartXYTitleFont,i.ls.Ki.treeMapChartTitleFillStyle||i.ls.Ki.chartXYTitleFillStyle,h),this.JL=new Map,this.KL=[],this.qL={},this.tR=p([]),this.wy={speed:1},this.iR=Be,this.sR=!0,this.eR="Go Back",this.hR=[],this.rR=this.Ki.treeMapChartPathLabelFillStyle||this.Ki.uiTextFillStyle,this.nR=this.Ki.treeMapChartPathLabelFont||this.Ki.uiTextFont,this.oR=this.Ki.treeMapChartLabelHeaderFillStyle||this.Ki.uiTextFillStyle,this.aR=this.Ki.treeMapChartLabelHeaderFont||this.Ki.uiTextFont,this.lR=this.Ki.treeMapChartLabelFillStyle||this.Ki.uiTextFillStyle,this.uR=this.Ki.treeMapChartLabelFont||this.Ki.uiTextFont,this.Yi=!0,this.Gx=!0,this.cR=!1,this.dR=this.Ki.treeMapChartParentColor||k,this.fR=this.Ki.treeMapChartNodeStrokeStyle||this.Ki.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.Yx=(t,e,i,s,r)=>{this.ls.xs(),this.cR=!0},this._t=(t,i)=>{const s=this.AR(i);s&&(this.nb=this.gR(s,t),this.Gx&&this.ls.os.ws(i,!0),this.sR&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.nb),this.ls.xs())},this.wt=(t,i)=>{this.AR(i)&&(this.nb=void 0,this.Gx&&this.ls.os.ws(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.R.emit("mouseLeave",this,t,this.nb),this.ls.xs())},this.It=(t,i)=>{const s=this.AR(i);s&&(this.nb=this.gR(s,t),this.Gx&&this.ls.os.ws(i,!0),this.sR&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.nb),this.ls.xs())},this.Ct=(t,e)=>{const i=this.AR(e);if(i){if(this.sR){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.qL[i.parentID]:void 0;e&&(this.tR._([e]),this.nb=void 0,this.R.emit("viewChange",this.tR.C()),this.cR=!0),t&&Qt(t)}this.R.emit("mouseClick",this,t,this.gR(i,t)),this.ls.xs()}},this.kt=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseDoubleClick",this,t,this.gR(i,t))},this.Tt=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseDown",this,t,this.gR(i,t))},this.Ft=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseUp",this,t,this.gR(i,t))},this.Dt=(t,e,i)=>{const s=this.AR(i);s&&this.R.emit("mouseDragStart",this,t,e,this.gR(s,t))},this.Pt=(t,e,i,s,r)=>{const n=this.AR(r);n&&this.R.emit("mouseDrag",this,t,e,i,s,this.gR(n,t))},this.Bt=(t,e,i,s)=>{const r=this.AR(s);r&&this.R.emit("mouseDragStop",this,t,e,i,this.gR(r,t))},this.Lt=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseWheel",this,t,this.gR(i,t))},this.Rt=(t,e)=>{const i=this.AR(e);i&&(this.nb=this.gR(i,t),this.Gx&&this.ls.os.ws(e,!0),this.R.emit("touchStart",this,t,this.nb),this.ls.xs(),Qt(t))},this.Et=(t,e)=>{const i=this.AR(e);i&&(this.nb=this.gR(i,t),this.Gx&&this.ls.os.ws(e,!0),this.R.emit("touchMove",this,t,this.nb),this.ls.xs(),Qt(t))},this.zt=(t,e)=>{const i=this.AR(e);if(i){if(this.nb=void 0,this.sR){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.qL[i.parentID]:void 0;e&&(this.tR._([e]),this.R.emit("viewChange",this.tR.C()),this.cR=!0),t&&Qt(t)}this.Gx&&this.ls.os.ws(e,!1),this.R.emit("touchEnd",this,t,this.nb),this.ls.xs(),Qt(t)}},this.pR=t=>{const e=this.qL[this.hR[t].id]?[this.qL[this.hR[t].id]]:this.KL;this.tR._(e),this.R.emit("viewChange",e),this.cR=!0,this.ls.xs()},this.Ki.treeMapChartNodeColors)this.yR=this.Ki.treeMapChartNodeColors;else{const t=this.Ki.pointSeriesFillStyle,e=t=>Y(t)?t.getColor():k;this.yR="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.ls.Xn(dh.Ff),this.Yy=i.Mx("TreeMapChart plotting",0),this.$y=i.Mx("TreeMap UI plotting",1),this.onResize(this.Yx),this.mh.gr("TreeMap Chart");const a=i.Xy(),l=Pt(o?o.cursorBuilder:void 0,Ca);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Uf,(()=>0)),this.mR=this.ss.wg(),this._p(n,this.uiScale),this.tb=this.Yy.Um(this.pg).Ie(new G).Fe(this.fR),this.vR=this.ls.os.Yr(this,{animationEnabled:!1!==(null==o?void 0:o.animationsEnabled)}),this.SR=new Ka((()=>this.$y.Or(this.pg).setMouseInteractions(!1))),this.xR=new Ka((()=>this.$y.Or(this.uiScale))),this.tb.setMouseInteractions(this.Yi).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{bR:e}=(()=>{let t=0;return{bR: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.qL[t.id];e&&this.MR(t,e)})),this.nb=void 0,this.tR._(i),this.KL=i,this.qL=this._R(i),this.cR=!0,this.ls.xs(),this}setAnimationValues(t,e=1){return this.wy=t?{speed:e}:void 0,this.ls.xs(),this}setInitPathButtonText(t){return this.eR=t,this.cR=!0,this.ls.xs(),this}setDisplayedLevelsCount(t){return this.iR=t,this.cR=!0,this.ls.xs(),this}setDrillDownEnabled(t){return this.sR=t,this.cR=!0,this.ls.xs(),this}setDrillDownNode(t){var e,i;if(this.nb=void 0,void 0===t)this.tR._(this.KL);else{const s=[...this.KL];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.qL[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.qL[r.parentID]:this.KL[0];this.tR._([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.tR.C()),this.cR=!0,this.ls.xs(),this}setNodeColoring(t){return t instanceof Array?(this.tb.Ie(new G),this.yR=t):this.tb.Ie(t),this.cR=!0,this.ls.xs(),this}setParentNodeColor(t){return this.dR=t,this.cR=!0,this.ls.xs(),this}setPathLabelFillStyle(t){return this.rR="function"==typeof t?t(this.rR):t,this.cR=!0,this.ls.xs(),this}getPathLabelFillStyle(){return this.rR}setPathLabelFont(t){return ur(t)?this.nR=t:this.nR=t(this.nR),this.cR=!0,this.ls.xs(),this}getPathLabelFont(){return this.nR}setHeaderFont(t){return ur(t)?this.aR=t:this.aR=t(this.aR),this.cR=!0,this.ls.xs(),this}getHeaderFont(){return this.aR}setHeaderFillStyle(t){return this.oR="function"==typeof t?t(this.oR):t,this.cR=!0,this.ls.xs(),this}getHeaderFillStyle(){return this.oR}setLabelFont(t){return ur(t)?this.uR=t:this.uR=t(this.uR),this.cR=!0,this.ls.xs(),this}getLabelFont(){return this.uR}setLabelFillStyle(t){return this.lR="function"==typeof t?t(this.lR):t,this.cR=!0,this.ls.xs(),this}getLabelFillStyle(){return this.lR}setNodeBorderStyle(t){return this.tb.Fe(t),this.cR=!0,this.ls.xs(),this}getNodeBorderStyle(){return this.tb.po()}setNodeEffect(t){return this.mR.Ss(t),this.ls.xs(),this}getNodeEffect(){return this.mR.bs()}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ca){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(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.Yi=t,this.tb.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setAnimationHighlight(t){return this.vR.Xr(t),this}getAnimationHighlight(){return this.vR.jr()}setHighlightOnHover(t){return this.Gx=t,this}getHighlightOnHover(){return this.Gx}gR(t,e){const i=this.ls.Vo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.ls.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.ls.At},name:t.name,value:t.value,node:t.userNode}}getMinimumSize(){}if(){return[this]}De(t){super.De(t),super.Mp(),oa.Bp(this.mh,this.Cp);const i=oa.Dp(this.mh,this.Cp);if(this.cR&&this.tR.C().length){this.tb.Ot(),this.JL.clear(),this.vR.$r(),this.ah&&this.wR(t);const s=Bf({data:this.tR.C(),dimensions:{x:0+this.wa.left,y:this.pg.y.getInnerEnd()-i-this.wa.top,width:this.pg.x.getInnerEnd()-this.wa.right-this.wa.left,height:this.pg.y.getInnerEnd()-i-this.wa.top-this.wa.bottom}}),r=this.SR.Mm();this.CR(s,r),r.finishPlot(),this.kR(),this.KL!==this.tR.C()&&this.KL.length>1&&this.hR.unshift({name:this.eR,id:0});let n=0;const o=this.xR.Mm(),h=this.nR;this.hR.forEach(((t,i)=>{const s=o.add(),r=this.ls.Vg.zg(t.name,h,0);s.gr(`← ${t.name}`).jh(h).Be({x:0,y:100}).Ya({x:-1,y:1}).zr({left:this.wa.left+n,top:this.wa.top,right:0,bottom:0}).Ie(this.rR).setMouseClickEventHandler((t=>this.pR(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.tR.C().every((t=>t.value===t.animatedValue))?this.cR=!1:this.ls.xs(!0)}return this.jy.De(!1,[],void 0,{explicitTarget:this.nb}),this}dispose(){return this.$y.Y(),this.Yy.Y(),this.jy.Y(),this.tb.dispose(),this.JL.clear(),this.SR.wm(),this.xR.wm(),super.dispose()}J(){return super.J(),this}K(){return super.K(),this}Xd(){return de(this.tb.Hh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),ce(t,this.Ki,i,{}),this}CR(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.yR,y=0===s&&1===this.tR.C().length?this.dR:g[f%g.length],m=[{x:o,y:h},{x:o,y:h-a},{x:l+o,y:h-a},{x:l+o,y:h}],p=this.tb.Hr()._l(m).TR(y.setA(n||250)).rb(c);this.JL.set(p,i),this.vR.Hr(p,(t=>p.us(t)));const x=o+5,A=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=Bf({data:u,dimensions:{x:v>0?x:o,y:S>0?h-25:A,width:v,height:S}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.KL.length||this.KL===this.tR.C()?250:n?n/(s+1):250-e*o;r.push({node:t[e],isChild:!0,visibleDepth:s+1,opacity:h})}}const b=0===s&&1===this.tR.C().length?this.oR:this.lR,M=0===s?this.aR:this.uR,w=this.FR(d,l-25,M),C=this.ls.Vg.zg(w,M,0),T=e.add();l-25>C.x&&a>25?T.gr(w).Be({x:o+5,y:h-2.5}).Ya({x:-1,y:1}).Ie(b).jh(M):T.gr("")}}_R(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}AR(t){if(!this.cR&&t)return this.JL.get(t)}kR(){this.hR=[];const t=this.tR.C()[0].id;let e=this.qL[t].parentID;for(;e;)this.hR.push({name:this.qL[e].name,id:e}),e=this.qL[e].parentID;return this.hR.reverse()}FR(t,e,i){let s=this.ls.Vg.zg(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.ls.Vg.zg(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.ls.Vg.zg(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.ls.Vg.zg(n,i,0).x;return n.length<=3&&s>e?"":n}wR(t){var e;const i=[...this.KL];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.wy)s.animatedValue=s.value;else{const i=r/250*((null===(e=this.wy)||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)}}MR(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.ah?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 Uf=(t,e,i)=>[[e.name],[{text:e.value.toString(),font:{weight:"bold"}}]],Yf=(t,i)=>{const s=(t=>{const i=new U({color:t.uiStrokeColorContrastHigh}),s=new U({color:t.uiStrokeColorContrastMedium}),r=new U({color:t.uiStrokeColorContrastLow}),n=new lr({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 Ji({thickness:2,fillStyle:r}),f=new U({color:t.dataHighlightOverlayColor}),g=new Ji({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),y=t.dataColorPalette.map((t=>new U({color:t.stroke}))),m=t=>y[t%y.length],p=y.map((t=>new Ji({thickness:2,fillStyle:t}))),x=t=>p[t%p.length],A=t.dataColorPalette.map((t=>new U({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),S=t=>A[t%A.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new it({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 it({angle:180,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),T=t=>M[t%M.length],R=t.dataColorPalette.map((t=>{const e=t.area;return new it({angle:180,stops:[{color:ae(e,w(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,w(0,0,0,e.getA()),.3),offset:1}]})})),E=t=>R[t%R.length],k=t.dataColorPaletteInverted.map((t=>new U({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),I=t=>k[t%k.length],F=new U({color:t.dataColorPositive}),D=new U({color:t.dataColorNegative}),P=new Ji({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastHigh.setA(50)})}),L=new Ji({thickness:2,fillStyle:t.axisLineFillStyle}),V=nt,_=new U({color:w(0,0,0,1)}),z=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=nt,O=a,Y=t.axisLabelMajorFillStyle,G=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),X=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),Z=a,H=t.axisLabelMajorFillStyle,W=new Ji({thickness:1,fillStyle:t.axisGridMinorFillStyle}),j=new Ji({thickness:1,fillStyle:t.axisTickMinorFillStyle}),K=l,$=t.axisLabelMinorFillStyle,Q=bh,q=new Sh({gridStrokeStyle:z,tickStyle:N,tickLength:50,tickPadding:-14,labelFont:O,labelFillStyle:Y}),J=new Sh({gridStrokeStyle:G,tickStyle:X,tickLength:7,tickPadding:5,labelFont:Z,labelFillStyle:H}),tt=new Sh({gridStrokeStyle:W,tickStyle:j,tickLength:4,tickPadding:10,labelFont:K,labelFillStyle:$}),et=new $h({extremeTickStyle:Q,majorTickStyle:J,minorTickStyle:tt}),st=new Yh({greatTickStyle:q,majorTickStyle:J,minorTickStyle:tt}),rt=new Eh({majorTickStyle:J,minorTickStyle:tt}),ot=new U({color:t.dataHighlightOverlayColor}),ht=new Ji({thickness:1,fillStyle:s}),at=new Ji({thickness:2,fillStyle:s}),lt=t=>new Ar.Triangulated({shape:"sphere",size:10,fillStyle:y[t%y.length]}),ut=y[0],ct=t.uiTextFillStyle,dt=t.legendBackgroundFillStyle,ft=new Ji({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),gt=ue(t.legendButtonDefaultColor),yt=ue(t.isDark?w(70,70,70,255):w(170,170,170,255)),mt=new U({color:t.isDark?w(70,70,70,255):w(170,170,170,255)}),pt=new Ji({thickness:1,fillStyle:i}),xt=new io({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:to.DashedEqual,patternScale:3}),At=new Ji({thickness:1,fillStyle:t.cursorGridFillStyle}),St=t.zoomBandChartDefocusOverlayFillStyle,vt=new Ji({thickness:2,fillStyle:new U({color:t.zoomBandChartSplitterColor})}),bt=new U({color:t.uiBackgroundColor});let Mt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:nt,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new Ji({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:nt,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:x,pointLineSeriesStrokeStyle:x,pointLineSeriesFillStyle:m,pointSeriesFillStyle:m,ellipseSeriesFillStyle:m,ellipseSeriesStrokeStyle:x,polygonSeriesFillStyle:m,polygonSeriesStrokeStyle:x,rectangleSeriesFillStyle:m,rectangleSeriesStrokeStyle:nt,segmentSeriesStrokeStyle:x,boxSeriesBodyFillStyle:m(0),boxSeriesBodyStrokeStyle:nt,boxSeriesStrokeStyle:new Ji({thickness:1,fillStyle:y[0]}),boxSeriesMedianStrokeStyle:new Ji({thickness:1,fillStyle:new U({color:w(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:F,ohlcCandleBodyFillStyleNegative:D,ohlcCandleTailStrokeStylePositive:new Ji({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new Ji({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new Ji({thickness:2,fillStyle:F}),ohlcBarStrokeStyleNegative:new Ji({thickness:2,fillStyle:D}),heatmapGridSeriesFillStyle:m,heatmapGridSeriesWireframeStyle:P,heatmapScrollingGridSeriesFillStyle:m,heatmapScrollingGridSeriesWireframeStyle:P,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:T,areaRangeSeriesStrokeStyleInverted:I,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:T,areaSeriesBipolarLowStrokeStyle:I,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:T,areaSeriesNegativeStrokeStyle:I,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:L,xAxisNibStyle:V,xAxisOverlayStyle:_,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:nt,xAxisNumericTicks:et,xAxisDateTimeTicks:st,xAxisTimeTicks:rt,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:L,yAxisNibStyle:V,yAxisOverlayStyle:_,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:nt,yAxisNumericTicks:et,yAxisDateTimeTicks:st,yAxisTimeTicks:rt,bandFillStyle:ot,bandStrokeStyle:ht,constantLineStrokeStyle:at,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:nt,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:B,barChartSeriesBackgroundStrokeStyle:nt,barChartBarFillStyle:m,barChartBarStrokeStyle:new Ji({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:L,barChartValueAxisTicks:et.setMajorTickStyle((t=>t.setGridStrokeStyle(nt))).setMinorTickStyle((t=>t.setGridStrokeStyle(nt))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:L,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:nt,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:nt,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:L,xAxis3DNumericTicks:et,xAxis3DDateTimeTicks:st,xAxis3DTimeTicks:rt,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:L,yAxis3DNumericTicks:et,yAxis3DDateTimeTicks:st,yAxis3DTimeTicks:rt,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:L,zAxis3DNumericTicks:et,zAxis3DDateTimeTicks:st,zAxis3DTimeTicks:rt,lineSeries3DStrokeStyle:x,pointLineSeries3DStrokeStyle:x,pointLineSeries3DPointStyle:lt,pointSeries3DPointStyle:lt,pointCloudSeries3DPointStyle:t=>new Ar.Pixelated({size:5,fillStyle:y[t%y.length]}),surfaceGridSeries3DFillStyle:m,surfaceGridSeries3DWireframeStyle:P,surfaceScrollingGridSeries3DFillStyle:m,surfaceScrollingGridSeries3DWireframeStyle:P,boxSeries3DFillStyle:m,meshModel3DFillStyle:m(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:nt,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:ot,polarSectorStrokeStyle:ht,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:L,polarAmplitudeAxisNumericTicks:et,polarAmplitudeAxisDateTimeTicks:st,polarAmplitudeAxisTimeTicks:rt,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:L,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:x,polarPointLineSeriesFillStyle:m,polarPointLineSeriesStrokeStyle:x,polarPointSeriesFillStyle:m,polarPolygonSeriesFillStyle:E,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:E,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:m,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:nt,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ut,mapChartStrokeStyle:new Ji({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:B,mapChartOutlierRegionStrokeStyle:new Ji({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:dt,mapChartSeparateRegionStrokeStyle:ft,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:nt,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:ut,dataGridCellBackgroundFillStyle:new U({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new Ji({thickness:.4,fillStyle:new U({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:nt,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ft,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ft,dataGridScrollBarButtonArrowFillStyle:gt,dataGridScrollBarButtonArrowStrokeStyle:ft,sparkLineChartStrokeStyle:x(0),sparkPointChartFillStyle:m(0),sparkBarChartFillStyle:m(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:m,sparkPieChartStrokeStyle:ft,sparkChartBandFillStyle:ot,sparkChartBandStrokeStyle:ht,sparkChartConstantLineStrokeStyle:at,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:nt,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new Ji({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new Ji({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new Ji({thickness:2,fillStyle:i}),spiderSeriesFillStyle:E,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:m,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:nt,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:m,pieChartSliceStrokeStyle:ft,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:pt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:nt,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:m,funnelChartSliceStrokeStyle:ft,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:pt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:nt,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:m,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:nt,gaugeChartUnitLabelFillStyle:t.uiTextFillStyle,gaugeChartValueLabelFillStyle:t.uiTextFillStyle,gaugeChartBarColor:w(255,255,255),gaugeChartGlowColor:w(255,255,64),gaugeChartNeedleFillStyle:new U({color:w(255,255,255)}),gaugeChartNeedleThickness:10,gaugeChartNeedleStrokeStyle:new Ji({thickness:2,fillStyle:new U({color:w(0,0,0)})}),gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:nt,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:nt,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new Ji({thickness:1,fillStyle:new U({color:C("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:ct,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:nt,zoomBandChartDefocusOverlayFillStyle:St,zoomBandChartSplitterStrokeStyle:vt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:w(254,204,0,.7),uiButtonFillStyle:gt,uiButtonFillStyleHidden:yt,uiButtonStrokeStyle:ft,uiButtonSize:10,uiBackgroundFillStyle:dt,uiBackgroundStrokeStyle:ft,uiTextFillStyle:ct,uiTextFillStyleHidden:mt,uiTextFont:c,legendTitleFillStyle:ct,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:dt,cursorTickMarkerXBackgroundStrokeStyle:ft,cursorTickMarkerXTextFillStyle:ct,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:dt,cursorTickMarkerYBackgroundStrokeStyle:ft,cursorTickMarkerYTextFillStyle:ct,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:xt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:dt,cursorResultTableStrokeStyle:ft,cursorResultTableTextFillStyle:ct,cursorResultTableTextFont:c,cursorGridStrokeStyleX:xt,cursorGridStrokeStyleY:xt,cursor3DGridStrokeStyleX:At,cursor3DGridStrokeStyleY:At,cursor3DGridStrokeStyleZ:At,cursor3DTickStrokeStyleX:J.tickStyle,cursor3DTickStrokeStyleY:J.tickStyle,cursor3DTickStrokeStyleZ:J.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}},Gf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{Re(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},Xf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.5);return new J({stops:[{color:ae(r,w(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ae(r,w(30,30,30),.5*i).setA(100),offset:1}]})},Zf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.2);return new J({stops:[{color:ae(r,w(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ae(r,w(0,0,0),.2*i),offset:1}]})},Hf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.2);return new it({angle:90,stops:[{color:ae(r,w(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ae(r,w(30,30,30),.5*i),offset:1}]})},Wf=(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:ae(e[i%e.length].stroke,w(255,255,255),.3);return new it({angle:90,stops:[{color:ae(s,w(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ae(s,w(30,30,30),.5),offset:1}]})})(s);return i.set(s,n),n}})(),jf=Ce((()=>{const t=w(255,255,255),i=new U({color:t}),s=!0,r=new ao({spread:1,blur:9,offset:{x:0,y:0},color:w(0,0,0,150)}),n=new J({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(50,51,52)},{offset:.5,color:w(14,15,16)},{offset:1,color:w(0,0,0)}]}),o=new U({color:w(45,45,45)}),h=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(120,120,120,100)},{offset:1,color:w(0,0,0,50)}]}),a=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(30,30,30,200)},{offset:1,color:w(0,0,0,255)}]}),l=new U({color:w(255,255,220)}),u=new U({color:w(255,255,166)}),c=new U({color:w(255,255,220)}),d=new U({color:w(255,255,220,130)}),f=new U({color:w(255,255,200)}),g=f,y=g,m=new it({angle:45,stops:[{offset:0,color:w(230,230,230)},{offset:1,color:w(150,150,150)}]}),p=new U({color:w(220,220,220)}),x=new U({color:w(200,200,200,50)}),A=new U({color:w(200,200,200,150)}),S=new U({color:w(200,200,200,20)}),v=new U({color:w(220,220,220)}),b=new it({angle:0,stops:[{offset:0,color:w(10,10,10,220)},{offset:1,color:w(30,30,30,220)}]}),M=i,T=w(255,255,200),R=b,E=M,k=w(20,20,20),I=w(0,0,0),F=t,D=w(150,150,150),P=w(50,50,50),L=w(50,50,50),V=w(100,100,100),_=w(200,200,200),B=[w(255,255,91,255),w(255,205,91,255),w(255,155,91,255),w(255,196,188,255),w(255,148,184,255),w(219,148,198,255),w(235,196,224,255),w(169,148,198,255),w(148,226,198,255),w(148,255,176,255),w(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),z=t.setA(20),N=w(176,255,157,255),O=w(255,112,76,255),Y={mapChartFillStyle:new it({angle:135,stops:[{color:w(255,255,91,255),offset:0},{color:w(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,B,.5),pieChartSliceFillStylePalette:Zf(s,B,1),funnelChartSliceFillStylePalette:Hf(s,B,1),pyramidChartSliceFillStylePalette:Hf(s,B,1),rectangleSeriesFillStyle:Wf(s,B),gaugeChartBarColor:w(255,255,91,255),gaugeChartGlowColor:w(255,255,91,64)},G=new U({color:w(176,255,157,255)}),X=new U({color:w(255,146,146,255)}),Z=new U({color:w(176,255,157,255)}),H=new U({color:w(230,63,63,255)}),W=new U({color:w(176,255,157,120)}),j=new U({color:w(229,63,63,180)}),K=new U({color:w(27,37,36,255)}),$=new U({color:w(62,27,27,255)}),Q=[w(255,0,0),w(255,255,0),w(0,255,0)],q=[w(10,10,255),w(10,190,255),w(251,255,0),w(255,38,0)],tt=[w(255,255,0),w(255,204,0),w(255,128,0),w(255,0,0)],et=[w(0,0,0),w(167,4,69,255),w(255,0,0),w(252,252,168,255)],st=new J({stops:[{color:w(61,61,80,100),offset:0},{color:w(44,44,55,30),offset:1}]}),rt=new U({color:w(148,148,198,255)}),nt=W.getColor().setA(255),ot=w(100,100,100),ht=[w(255,241,149,200),w(255,230,65,200),w(238,211,32,200),w(238,176,32,200),w(255,159,13,200),w(254,120,37,200),w(253,91,56,200),w(253,75,84,200),w(254,95,124,200),w(227,56,160,200),w(226,53,134,200),w(216,90,166,200),w(254,151,206,200),w(237,151,254,200),w(243,177,255,200),w(233,133,252,200),w(210,101,230,200),w(178,61,200,200),w(193,81,156,200),w(217,95,145,200)];return Yf({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(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:y,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:x,axisTickMinorFillStyle:A,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:T,resultTableBackgroundFillStyle:R,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:V,dataStrokeColorContrastLow:_,dataColorPalette:B,dataColorPaletteInverted:[{area:w(190,50,50,100),border:w(210,80,80)}],dataHighlightOverlayColor:z,dataColorPositive:N,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:w(0,0,0,180)}),zoomBandChartSplitterColor:C("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:Y,treeMapChartParentColor:C("#181E21"),treeMapChartNodeColors:ht,treeMapChartLabelFillStyle:new U({color:w(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:w(250,250,250)})},{positiveTextFillStyle:G,negativeTextFillStyle:X,positiveFillStyle:Z,negativeFillStyle:H,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:K,negativeBackgroundFillStyle:$,badGoodColorPalette:Q,coldHotColorPalette:q,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:st,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),Kf=Ce((()=>{const t=w(255,255,255),i=new U({color:t}),s=!0,r=new ao({spread:0,blur:9,offset:{x:0,y:0},color:w(105,255,236,40)}),n=new U({color:w(2,21,30)}),o=new J({stops:[{color:w(19,40,66,150),offset:0},{color:w(0,0,0,150),offset:1}]}),h=new U({color:w(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:w(255,255,220,130)}),d=i,f=i,g=f,y=new U({color:w(20,224,250,255)}),m=i,p=new U({color:w(61,94,110,100)}),x=new U({color:w(61,94,110,255)}),A=new U({color:w(61,94,110,40)}),S=i,v=new U({color:w(0,18,23,255)}),b=i,M=t,T=new U({color:w(0,17,22,240)}),R=i,E=w(0,38,48,220),k=w(0,0,0),I=t,F=w(150,150,150),D=w(19,78,93),P=w(50,50,50),L=w(0,36,48),V=w(200,200,200),_=[w(45,253,253,255),w(44,172,247,255),w(46,100,248,255),w(96,84,199,255),w(184,104,245,255),w(98,160,218,255),w(43,238,245,255),w(38,140,206,255),w(112,96,224,255),w(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),B=t.setA(50),z=w(3,217,194,255),N=w(230,63,63,255),O={mapChartFillStyle:new it({angle:135,stops:[{color:w(118,248,231,255),offset:0},{color:w(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,_,1),pieChartSliceFillStylePalette:Zf(s,_,1),funnelChartSliceFillStylePalette:Hf(s,_,1),pyramidChartSliceFillStylePalette:Hf(s,_,1),rectangleSeriesFillStyle:Wf(s,_),gaugeChartBarColor:w(3,217,194,255),gaugeChartGlowColor:w(3,217,194,120)},Y=new U({color:w(45,253,253,255)}),G=new U({color:w(255,146,146,255)}),X=new U({color:w(45,253,253,255)}),Z=new U({color:w(230,63,63,255)}),H=new U({color:w(1,190,164,120)}),W=new U({color:w(229,63,63,180)}),j=new U({color:w(1,53,57,255)}),K=new U({color:w(62,27,27,255)}),$=[w(1,104,119,255),w(0,165,144,255),w(0,246,214,255)],Q=[w(0,87,95,255),w(0,125,124,255),w(1,209,182,255),w(0,255,221,255),w(218,112,112,255),w(172,47,47,255)],q=[w(126,255,253,255),w(50,233,230,255),w(0,196,193,255),w(62,138,178,255),w(139,88,191,255),w(162,55,143,255)],tt=[w(13,31,52,255),w(101,50,118,255),w(1,142,172,255),w(2,196,170,255),w(0,255,221,255)],et=new J({stops:[{color:w(122,103,254,70),offset:0},{color:w(178,168,255,10),offset:1}]}),st=new U({color:w(122,103,254,255)}),rt=H.getColor().setA(255),nt=w(15,83,83),ot=[w(139,252,252,150),w(60,239,239,150),w(2,201,201,150),w(26,159,159,150),w(15,146,187,150),w(65,168,200,150),w(67,146,207,150),w(64,108,209,150),w(189,64,233,150),w(219,84,238,150),w(192,55,212,150),w(212,98,229,150),w(248,110,211,150),w(251,154,225,150),w(251,154,184,150),w(233,105,144,150),w(255,133,170,150),w(249,110,135,150),w(245,72,101,150),w(210,57,84,150)];return Yf({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new qn({source:Gf(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:y,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:A,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:R,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:V,dataColorPalette:_,dataColorPaletteInverted:[{area:w(170,60,210,100),border:w(210,100,250)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:w(0,0,0,180)}),zoomBandChartSplitterColor:C("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:C("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:w(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:w(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:X,negativeFillStyle:Z,positiveAreaFillStyle:H,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:$,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),$f=Ce((()=>{const t=!1,i=new ao({spread:0,blur:6,offset:{x:2,y:-2},color:w(0,0,0,30)}),s=new J({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(255,255,255)},{offset:1,color:w(255,255,255)}]}),r=new U({color:w(219,227,233,255)}),n=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,200)},{offset:1,color:w(240,244,246,200)}]}),o=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,255)},{offset:1,color:w(255,255,255,255)}]}),h=new U({color:w(33,43,49)}),a=new U({color:w(33,43,49)}),l=new U({color:w(33,43,49)}),u=new U({color:w(33,43,49,150)}),c=new U({color:w(33,43,49)}),d=c,f=d,g=new it({angle:45,stops:[{offset:0,color:w(225,225,225)},{offset:1,color:w(225,225,225)}]}),y=new U({color:w(150,150,150,255)}),m=new U({color:w(150,150,150,170)}),p=new U({color:w(150,150,150,150)}),x=new U({color:w(150,150,150,100)}),A=new U({color:w(60,70,80)}),S=new it({angle:0,stops:[{offset:0,color:w(255,255,255,240)},{offset:1,color:w(255,255,255,240)}]}),v=new U({color:w(168,186,199)}),b=w(255,255,200),M=new U({color:w(255,255,255,240)}),T=new U({color:w(128,146,159,255)}),R=w(255,255,255,255),E=w(168,168,199,255),k=w(168,186,199,255),I=w(168,186,199,255),F=w(168,186,199,255),D=w(168,186,199,255),P=w(100,100,100),L=w(200,200,200),V=[w(28,181,140,255),w(255,132,0,255),w(240,39,39,255),w(86,121,251,255),w(2,181,213,255),w(13,212,158,255),w(22,167,3,255),w(234,103,232,255),w(62,183,179,255),w(140,93,3,255),w(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),_=w(150,150,150,80),B=w(46,182,120,255),z=w(255,66,66,255),N=new Ji({thickness:2,fillStyle:new U({color:w(168,186,199,255)})}),O={mapChartFillStyle:new it({angle:-45,stops:[{color:w(2,181,213,255),offset:0},{color:w(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,V,.8),pieChartSliceFillStylePalette:Zf(t,V,.8),funnelChartSliceFillStylePalette:Hf(t,V,.5),pyramidChartSliceFillStylePalette:Hf(t,V,.5),rectangleSeriesFillStyle:Wf(t,V),gaugeChartBarColor:w(46,182,120,255),gaugeChartGlowColor:w(46,182,120,120),chartXYSeriesBackgroundStrokeStyle:N,chart3DSeriesBackgroundStrokeStyle:N,polarChartSeriesBackgroundStrokeStyle:N,spiderChartSeriesBackgroundStrokeStyle:N,dataGridTextFillStyle:new U({color:w(0,88,64,255)})},Y=new U({color:w(4,146,108,255)}),G=new U({color:w(240,39,39,255)}),X=new U({color:w(28,181,140,255)}),Z=new U({color:w(230,88,88,255)}),H=new U({color:w(28,181,140,180)}),W=new U({color:w(230,88,88,180)}),j=new U({color:w(229,243,228)}),K=new U({color:w(232,225,216)}),$=[w(193,48,48,255),w(240,234,60,255),w(45,191,55,255)],Q=[w(10,19,255,255),w(15,191,250,255),w(249,255,2,255),w(253,133,0,255),w(255,24,0,255)],q=[w(50,99,213),w(8,179,77),w(255,246,0),w(255,126,0),w(189,36,30)],tt=[w(16,64,176),w(8,179,77),w(255,246,0),w(255,126,0),w(168,6,0)],et=new U({color:w(185,198,207,255)}),st=new J({stops:[{color:w(151,190,220,10),offset:0},{color:w(151,190,220,50),offset:1}]}),rt=H.getColor().setA(255),nt=w(150,150,150),ot=[w(255,243,136,125),w(254,237,99,125),w(255,216,109,125),w(255,172,100,125),w(255,133,101,125),w(255,113,142,125),w(230,103,129,125),w(242,126,219,125),w(255,155,235,125),w(255,181,240,125),w(203,143,255,125),w(208,154,255,125),w(171,188,255,125),w(197,209,255,125),w(171,187,255,125),w(84,167,239,125),w(38,196,214,125),w(38,214,196,125),w(69,225,141,125),w(36,191,88,125)];return Yf({isDark:t,highlightColorOffset:w(-60,-60,-60,60),highlightColorOffsetAxisOverlay:w(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:y,axisGridMajorFillStyle:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:x,cursorGridFillStyle:A,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:R,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:L,dataColorPalette:V,dataColorPaletteInverted:[{area:w(190,50,50,100),border:w(210,80,80)}],dataHighlightOverlayColor:_,dataColorPositive:B,dataColorNegative:z,zoomBandChartDefocusOverlayFillStyle:new U({color:w(255,255,255,180)}),zoomBandChartSplitterColor:C("#505D65"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:C("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:w(0,0,0)}),treeMapChartLabelHeaderFillStyle:new U({color:w(33,33,33)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:X,negativeFillStyle:Z,positiveAreaFillStyle:H,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:$,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:st,bollingerBorderFillStyle:et,highlightPointColor:w(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),Qf=Ce((()=>{const t=!1,i=new J({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(255,255,255)},{offset:1,color:w(255,255,255)}]}),s=new U({color:w(214,236,216,255)}),r=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(233,244,231,70)},{offset:1,color:w(233,244,231,200)}]}),n=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,255)},{offset:1,color:w(255,255,255,255)}]}),o=new U({color:w(1,61,53)}),h=new U({color:w(1,61,53)}),a=new U({color:w(1,61,53)}),l=new U({color:w(1,61,53,150)}),u=new U({color:w(1,61,53)}),c=u,d=c,f=new it({angle:45,stops:[{offset:0,color:w(225,225,225)},{offset:1,color:w(225,225,225)}]}),g=new U({color:w(188,211,186,255)}),y=new U({color:w(188,211,186,150)}),m=new U({color:w(188,211,186,50)}),p=new U({color:w(188,211,186,50)}),x=new U({color:w(104,148,111,255)}),A=new it({angle:0,stops:[{offset:0,color:w(255,255,255,240)},{offset:1,color:w(255,255,255,240)}]}),S=new U({color:w(104,148,111)}),v=w(255,255,200),b=new U({color:w(255,255,255,240)}),M=new U({color:w(104,148,111,255)}),T=w(255,255,255,255),R=w(179,201,183,255),E=w(188,211,186,255),k=w(188,211,186,255),I=w(188,211,186,255),F=w(188,211,186,255),D=w(100,100,100),P=w(200,200,200),L=[w(138,195,142,255),w(193,161,114,255),w(178,99,99,255),w(142,156,210,255),w(154,209,219,255),w(164,212,199,255),w(104,156,97,255),w(196,147,195,255),w(92,190,187,255),w(126,100,51,255),w(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),V=w(150,150,150,80),_=w(46,182,84,255),B=w(232,96,96,255),z=new Ji({thickness:2,fillStyle:new U({color:w(188,211,186,255)})}),N={mapChartFillStyle:new it({angle:-45,stops:[{color:w(118,160,121,255),offset:0},{color:w(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,L,.8),pieChartSliceFillStylePalette:Zf(t,L,.8),pyramidChartSliceFillStylePalette:Hf(t,L,.5),funnelChartSliceFillStylePalette:Hf(t,L,.5),rectangleSeriesFillStyle:Wf(t,L),gaugeChartBarColor:w(46,182,84,255),gaugeChartGlowColor:w(46,182,84,120),chartXYSeriesBackgroundStrokeStyle:z,chart3DSeriesBackgroundStrokeStyle:z,polarChartSeriesBackgroundStrokeStyle:z,spiderChartSeriesBackgroundStrokeStyle:z,dataGridTextFillStyle:new U({color:w(77,66,21,255)})},O=new U({color:w(93,151,97,255)}),Y=new U({color:w(178,99,99,255)}),G=new U({color:w(138,195,142,255)}),X=new U({color:w(178,99,99,255)}),Z=new U({color:w(138,195,142,180)}),H=new U({color:w(178,99,99,180)}),W=new U({color:w(224,240,237)}),j=new U({color:w(251,227,227)}),K=[w(178,99,99,255),w(215,224,111,255),w(80,186,88,255)],$=[w(62,64,142,255),w(66,131,77,255),w(250,250,135,255),w(202,161,78,255),w(179,53,53,255)],Q=[w(64,86,138),w(123,192,205),w(255,252,149),w(220,155,92),w(184,78,74)],q=[w(64,86,138),w(123,192,205),w(255,252,149),w(220,155,92),w(132,60,57)],tt=new U({color:w(185,198,207,255)}),et=new J({stops:[{color:w(151,190,220,10),offset:0},{color:w(151,190,220,50),offset:1}]}),st=Z.getColor().setA(255),rt=w(150,150,150),nt=[w(242,239,210,150),w(243,238,183,150),w(210,222,136,150),w(204,217,148,150),w(157,190,124,150),w(143,178,72,150),w(198,147,88,150),w(216,148,71,150),w(229,142,103,150),w(225,174,152,150),w(219,149,203,150),w(216,188,209,150),w(109,198,189,150),w(172,206,202,150),w(164,223,217,150),w(174,215,233,150),w(203,225,235,150),w(220,227,243,150),w(207,213,227,150),w(171,182,209,150)];return Yf({isDark:t,highlightColorOffset:w(-60,-60,-60,60),highlightColorOffsetAxisOverlay:w(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:y,axisTickMinorFillStyle:m,axisGridMinorFillStyle:p,cursorGridFillStyle:x,legendBackgroundFillStyle:A,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:T,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:E,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:P,dataColorPalette:L,dataColorPaletteInverted:[{area:w(210,70,70,100),border:w(200,110,110)}],dataHighlightOverlayColor:V,dataColorPositive:_,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new U({color:w(255,255,255,180)}),zoomBandChartSplitterColor:C("#446A40"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N,treeMapChartParentColor:C("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new U({color:w(0,0,0)}),treeMapChartLabelHeaderFillStyle:new U({color:w(33,33,33)})},{positiveTextFillStyle:O,negativeTextFillStyle:Y,positiveFillStyle:G,negativeFillStyle:X,positiveAreaFillStyle:Z,negativeAreaFillStyle:H,positiveBackgroundFillStyle:W,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:$,intensityColorPalette:Q,spectrogramColorPalette:q,bollingerFillStyle:et,bollingerBorderFillStyle:tt,highlightPointColor:w(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),qf=Ce((()=>{const t=w(255,255,255),i=new U({color:t}),s=!0,r=new ao({spread:1,blur:9,offset:{x:0,y:0},color:w(255,255,255,30)}),n=new U({color:w(6,15,36)}),o=new J({stops:[{color:w(46,13,87,50),offset:0},{color:w(0,0,0,150),offset:1}]}),h=new U({color:w(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:w(255,255,220,130)}),d=i,f=i,g=f,y=new it({angle:45,stops:[{offset:0,color:w(241,133,255,255)},{offset:1,color:w(115,207,238,255)}]}),m=i,p=new U({color:w(61,94,110,100)}),x=new U({color:w(61,94,110,255)}),A=new U({color:w(61,94,110,40)}),S=i,v=new U({color:w(0,18,23,255)}),b=i,M=w(115,207,238,255),T=new U({color:w(0,17,22,240)}),R=i,E=w(0,38,48,255),k=w(0,0,0),I=t,F=w(150,150,150),D=w(19,57,93),P=w(50,50,50),L=w(0,17,48),V=w(200,200,200),_=[w(20,211,237,255),w(98,147,252,255),w(164,73,250,255),w(129,117,253,255),w(95,134,252,255),w(22,133,212,255),w(35,200,242,255),w(104,121,233,255),w(137,69,232,255),w(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),B=t.setA(50),z=w(3,217,194,255),N=w(243,21,110,255),O={mapChartFillStyle:new it({angle:135,stops:[{color:w(118,248,231,255),offset:0},{color:w(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,_,.5),pieChartSliceFillStylePalette:Zf(s,_,2),funnelChartSliceFillStylePalette:Hf(s,_,1),pyramidChartSliceFillStylePalette:Hf(s,_,1),rectangleSeriesFillStyle:Wf(s,_),gaugeChartBarColor:w(3,217,194,255),gaugeChartGlowColor:w(3,217,194,150)},Y=new U({color:w(20,211,237,255)}),G=new U({color:w(253,145,178,255)}),X=new U({color:w(20,211,237,255)}),Z=new U({color:w(239,68,121,255)}),H=new U({color:w(20,211,237,120)}),W=new U({color:w(239,68,121,180)}),j=new U({color:w(1,53,57,255)}),K=new U({color:w(94,19,42,255)}),$=[w(174,51,132,255),w(204,107,218,255),w(189,215,253,255)],Q=[w(0,63,95,255),w(0,149,255,255),w(0,225,255,255),w(255,154,254,255),w(204,98,170,255),w(139,39,84,255)],q=[w(197,241,255,255),w(70,210,255,255),w(0,164,217,255),w(90,99,222,255),w(138,75,192,255),w(151,27,162,255)],tt=[w(13,31,52,255),w(129,54,130,255),w(131,108,176,255),w(7,162,213,255),w(26,247,255,255)],et=new J({stops:[{color:w(219,42,235,60),offset:0},{color:w(237,73,252,10),offset:1}]}),st=new U({color:w(237,73,252,255)}),rt=H.getColor().setA(255),nt=w(8,70,100),ot=[w(149,230,255,150),w(93,213,243,150),w(20,189,223,150),w(5,151,181,150),w(2,138,198,150),w(2,113,198,150),w(97,148,236,150),w(93,111,230,150),w(151,120,223,150),w(128,87,227,150),w(153,52,230,150),w(179,92,245,150),w(248,110,211,150),w(255,155,228,150),w(251,88,207,150),w(255,0,162,150),w(214,73,177,150),w(209,71,159,150),w(238,101,169,150),w(210,57,134,150)];return Yf({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new qn({source:Gf(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:y,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:A,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:R,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:V,dataColorPalette:_,dataColorPaletteInverted:[{area:w(41,130,255,100),border:w(45,110,240)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:w(0,0,0,180)}),zoomBandChartSplitterColor:C("#DB77FF"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:C("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:w(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:w(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:X,negativeFillStyle:Z,positiveAreaFillStyle:H,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:$,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Jf={};Object.defineProperty(Jf,"darkGold",{get:jf,enumerable:!0}),Object.defineProperty(Jf,"turquoiseHexagon",{get:Kf,enumerable:!0}),Object.defineProperty(Jf,"light",{get:$f,enumerable:!0}),Object.defineProperty(Jf,"lightNature",{get:Qf,enumerable:!0}),Object.defineProperty(Jf,"cyberSpace",{get:qf,enumerable:!0});const tg=Jf,eg=tg.darkGold,ig=(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")=>{let s,r=0,n=0;const o=[],h=t=>{const i=new wt.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new qn({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Gd)||void 0===s||s.Ie(o),r=i.width,n=i.height,u(t)}))}};h(i);const a=t.jn((t=>h(t)));let l;if(new wt.Image instanceof wt.HTMLImageElement){const t=new wt.Image;t.src=i,l=new qn({source:t,fitMode:e.ImageFitMode.Stretch})}else if(wt.lcjs_setup){const t=new wt.Image;t.src=i;const s=wt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),l=new qn({source:s,fitMode:e.ImageFitMode.Stretch})}else l=new U({color:C("#f00")});const u=t=>{if(t.Gd){const e=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-(3+r),y:3}),i=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.Gd.Be(e).it(s)}s&&s.xs()};return s=t.GF("logo",Number.MAX_SAFE_INTEGER),i=>{const r={At:i};return(i=>{i.Gd&&i.Gd.dispose(),s&&(i.Gd=s.Pe(i.At).Ie(l).setMouseInteractions(!0).Fe(nt).setMouseEnterEventHandler((()=>{t.Qr(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Qr(e.MouseStyles.None)})).setMouseClickEventHandler(sg).setTouchEndEventHandler(sg),u(i))})(r),o.push(r),{Ls:()=>u(r),Y:()=>(e=>{e.Gd&&(e.Gd.dispose(),e.Gd=void 0);const i=o.indexOf(e);i>=0&&o.splice(i,1),o.length<=0&&t.Zn(a)})(r)}}},sg=()=>wt.open("https://lightningchart.com/lightningchart-js/");class rg{constructor(){this.IR=this.II.bind(this),wt.addEventListener("scroll",this.IR,{passive:!0})}Y(){this.IR&&wt.removeEventListener("scroll",this.IR),this.IR=void 0}}class ng{constructor(t,e){this._a=t,this.Z=e,this.PR=!0,this.DR=null,this.BR=null}}class og{constructor(t){this.LR=!1,this.RR=1,this.ER=t,this.zR={_a:u(0,0),Z:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),PR:!0,DR:null,BR:null},this.VR=u(64,64),this.OR=new Uint8ClampedArray(this.VR.x*this.VR.y*this.RR)}NR(t,e){if(!t.PR)return null;if(t.DR&&t.BR){const i=this.NR(t.DR,e);return null!==i?i:this.NR(t.BR,e)}const i=c(t.Z.x,t.Z.y);if(t._a.x+t.Z.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.VR.x-t._a.x-1),t._a.y+t.Z.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.VR.y-t._a.y-1),t.Z.x===e.x&&t.Z.y===e.y)return t.PR=!1,t;if(i.xt.Z.y)),h?(s=new ng(ui(t._a,{x:0,y:1}),u(t.Z.x,e.y)),r=new ng(ui(t._a,{x:0,y:e.y+1}),u(t.Z.x,t.Z.y-1-e.y))):(s=new ng(ui(t._a,{x:1,y:0}),u(e.x,t.Z.y)),r=new ng(ui(t._a,{x:e.x+1,y:0}),u(t.Z.x-1-e.x,t.Z.y))),t.DR=s,t.BR=r,this.NR(t.DR,e)}GR(t,e){const i={WR:!1,_a:null};let s=this.NR(this.zR,e);if(null===s)for(;null===s&&this.VR.xthis.ER||t.y>this.ER)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.RR);for(let i=0;i{this.ZR.qR(t)})),this.jR.clear(),this}tE(t,e){const i=this.XR.get(e);if(i)return i.get(t)}iE(t,e,i){let s=this.XR.get(e);if(s||(s=new Map,this.XR.set(e,s)),s.has(t.glyph))return ag.Success;const r=this.QR.GR(i,t.size);if(!r||!r._a)return ag.Fail;r.WR&&this.sE();const n=this.QR.HR(r.$R);if(!n)return ag.Fail;let o=this.jR.get(r.$R);if(!o){const t=this.ZR.gl.createTexture();if(!t)throw new xt("Failed to create texture for font!");o=t,this.jR.set(r.$R,t)}const h=r._a,a=n.VR.x,l=n.VR.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,y=(h.y+t.size.y)/l,m=(h.x+t.size.x)/a,p=h.y/l,x=[g,y,m,y,g,p,g,p,m,y,m,p],A=[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:A,texCoords:x,packerId:r.$R,texture:o};s.set(t.glyph,S);const v=this.ZR.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.VR.x,n.VR.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.ZR.eE?n.OR:new Uint8Array(n.OR)),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.WR?ag.Resize:ag.Success}sE(){this.XR.forEach((t=>{t.forEach(((e,i)=>{const s=this.QR.HR(e.packerId);if(!s)return;const r=e.origin,n=s.VR.x,o=s.VR.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 cg=t=>{if(t instanceof Bi||t instanceof Bc)return t._i()?"linear-highPrecision":"linear";if(t instanceof zi){const e={};return t.x instanceof Ci&&(e.x={base:t.x.gi()}),t.y instanceof Ci&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},dg=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},fg=(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.vv(),max:e.mv()}:void 0,gg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),yg=t=>(e,i)=>i%2?e:e+t;class mg{constructor(t){this.hE=new Map,this.rE=fe("font"),this.nE=new Map,this.oE=new Set,this.ZR=t}KR(t=!1){return(t||0===this.oE.size)&&(this.hE.forEach(((t,e)=>{t.KR(),this.hE.delete(e)})),this.oE.clear()),this}aE(t){this.oE.add(t)}lE(t){this.oE.delete(t)}uE(t,e,i,s){const r=wt.devicePixelRatio,n=`${s?"dark":"light"} - ${br(e,r).id}`,o=this.nE.get(n),h=this.hE.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 y=!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:m.x,y:m.y,isEstimate:y}}cE(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.nE.get(s);r||(r=this.rE(),this.hE.set(r,new ug(this.ZR)),this.nE.set(s,r));const n=this.hE.get(r);if(!n)throw new xt("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.ya.u=!0})),t=-1,d=0,h=0,o=0,c.clear(),this.ZR.ls.xs(!0);continue}if(l===ag.Fail)throw new xt("Failed to create glyph");if(a=n.tE(s,f),!a)throw new xt("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(yg(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=y(u(0,o),u(a,h)),m=[];return c.forEach(((t,e)=>{m.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[m,g]}}class pg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>xg(t)));for(const i of e)t=i(t);return`${Se(this.modifiers.filter((t=>Ag(t)))).map((t=>t.fE)).join("\n")}\n${t}`}}const xg=t=>"function"==typeof t,Ag=t=>t&&"object"==typeof t&&"AE"in t,Sg=(...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},vg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),bg=(...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},wg=(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},Cg=(...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},Tg=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Sg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Sg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Cg(`\t${r} = ${s};`)(i)},Rg=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Eg={roundUnsigned:{AE:"roundUnsigned",fE:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{AE:"linearStep",fE:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{AE:"decodeUbyteRGBAEncodedFloat",fE:"\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:{AE:"texelFetchWithFallback",fE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{AE:"texelFetchWithFallback",fE:"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:{AE:"texelFetchUnsignedWithFallback",fE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{AE:"texelFetchUnsignedWithFallback",fE:"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:{AE:"modulus",fE:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{AE:"computeScreenSpaceWireframe",fE:"#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}"}},kg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Sg("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(wg("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},Ig=[Sg("uniform sampler2D uMaskTexture"),Sg("varying vec2 vMaskTextureCoord"),wg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Fg=[Sg("uniform sampler2D uMaskTexture"),Sg("varying vec2 vMaskTextureCoord"),wg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],Dg=[Sg("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;"),wg("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)")];class Pg 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 Lg=(...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},Vg=t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.pE})),_g=t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.yE})),Bg=(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(Sg("attribute vec3 aNormal"),bg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(bg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(bg(`${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(bg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),bg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(bg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),bg(`${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(Sg("attribute float aRotDeg"),Sg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(bg(`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(Sg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(bg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Sg(`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(Sg(`${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(Sg(`${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(Sg(`${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(Sg(`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(Sg(`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(Sg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Sg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Sg(`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(${Ri(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Sg(...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(Sg("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Sg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Sg(`${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(Sg("uniform vec2 uRatioPxClip")),s.push(Sg("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Sg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Sg(`${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(Sg(`${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(Sg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Sg(`${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(Sg("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(Mg("gl_Position =",...f)),s},zg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(wg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(wg(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(wg(i,...t))}}return r},Ng=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.mE})))(t)?[vg("attribute vec4 aColor"),vg("vColor = aColor"),Sg("attribute vec4 aColorA"),Sg("attribute vec4 aColorB"),Cg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],Og=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.vE})))(t)?[vg("attribute float aLookupValue"),vg("vLookupValue = aLookupValue"),Sg("attribute float aLookupValueA"),Sg("attribute float aLookupValueB"),Cg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],Ug={"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",gE:{pE:!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:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[Sg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Cg(`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",gE:{yE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,vE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,mE:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${Lg(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Sg("uniform vec4 uColor"),wg("colorFragment =","colorFragment = uColor"),...s?Ig:[],...r?Fg:[]);else if("attribute"===i)a="colorAttribute",u.push(Tg("attribute vec4 aColor","varying vec4 vColor")),d.push(Sg("varying vec4 vColor"),wg("colorFragment =","colorFragment = vColor"),...s?Ig:[],...r?Fg:[]);else if("texture"===i)a="colorTexCoord",u.push(Tg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Sg("varying vec2 vTextureCoord"),Sg("uniform sampler2D uColorTexture"),Sg("uniform vec4 uColor"),wg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Ig:[],...r?Fg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Sg("attribute vec2 aTextureCoord"),Sg("varying vec2 vTextureCoord"),Cg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Sg("varying vec2 vTextureCoord"),Sg("uniform sampler2D uColorTexture"),bg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Tg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Sg("uniform sampler2D uColorTexture"),Sg("varying vec2 vTextureCoord"),wg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Sg("uniform sampler2D uColorTexture"),Sg("varying vec2 vTextureCoord"),Sg("uniform vec4 uColor"),wg("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(Tg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Tg(e,"varying float vLookupValue"))}d.push(Sg("varying float vLookupValue"),...kg("vLookupValue",i[2]),...s?Ig:[],...r?Fg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();tt(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Sg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Sg(...Dt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Eg.linearStep,wg("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?Ig:[],...r?Fg:[])):st(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Sg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Sg(...Dt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Eg.linearStep,wg("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?Ig:[],...r?Fg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Tg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Sg("uniform float uOpacity"),wg("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:${Lg(t)}`;return{idFeature:"ColorShaded3D",gE:{yE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,vE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Tg("normal","varying vec3 vNormal"),Tg("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Sg("uniform vec4 uColorDiffuse"),wg("colorFragment =","colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Tg("attribute vec4 aColor","varying vec4 vColor")),a.push(Sg("varying vec4 vColor"),wg("colorFragment =","colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Tg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Tg(e,"varying float vLookupValue"))}a.push(Sg("varying float vLookupValue"),...kg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Tg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Sg("varying vec3 vTriangleBary"),Sg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Eg.computeScreenSpaceWireframe,wg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Dg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Vg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Sg(`attribute ${r} aPos`)):i.push(Sg("attribute float aPosX"),Sg("attribute float aPosY"),s&&Sg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Sg("attribute float aPos_highpartX"),Sg("attribute float aPos_lowpartX"),Sg("attribute float aPos_highpartY"),Sg("attribute float aPos_lowpartY")):i.push(Sg(`attribute ${r} aPos_highpart`),Sg(`attribute ${r} aPos_lowpart`)),i.push(...Bg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Sg("attribute vec3 aGeoPos"),Sg("uniform mat4 uModelRotation"),Sg("uniform mat4 uModelRotationNormals"),Sg("uniform vec3 uLocationAxis"),Sg("uniform vec3 uModelAlignment"),Sg("uniform vec3 uModelScale"),Sg("uniform vec3 uModelSize"),...Bg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Mg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&wg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),..._g(e)?zg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${Lg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[Sg("uniform float uThicknessPixels"),Sg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA"),Sg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA_highpart"),Sg("attribute vec2 aLocationB_highpart"),Sg("attribute vec2 aLocationA_lowpart"),Sg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationAX"),Sg("attribute float aLocationAY"),Sg("attribute float aLocationBX"),Sg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationA_highpartX"),Sg("attribute float aLocationA_highpartY"),Sg("attribute float aLocationB_highpartX"),Sg("attribute float aLocationB_highpartY"),Sg("attribute float aLocationA_lowpartX"),Sg("attribute float aLocationA_lowpartY"),Sg("attribute float aLocationB_lowpartX"),Sg("attribute float aLocationB_lowpartY")]:[],Sg("attribute vec2 aSegmentPosition"),Sg("attribute float aSegmentSide"),...Bg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Sg("uniform vec2 uMinSegmentPixelVector"),wg("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"),...Og(e),...Ng(e),..._g(e)?zg(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA"),Sg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA_highpart"),Sg("attribute vec2 aLocationB_highpart"),Sg("attribute vec2 aLocationA_lowpart"),Sg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationAX"),Sg("attribute float aLocationAY"),Sg("attribute float aLocationBX"),Sg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationA_highpartX"),Sg("attribute float aLocationA_highpartY"),Sg("attribute float aLocationB_highpartX"),Sg("attribute float aLocationB_highpartY"),Sg("attribute float aLocationA_lowpartX"),Sg("attribute float aLocationA_lowpartY"),Sg("attribute float aLocationB_lowpartX"),Sg("attribute float aLocationB_lowpartY")]:[],Sg("attribute float aCurveOrBaseline"),Sg("attribute float aSegmentSide"),...Bg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),wg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...Og(e),...Ng(e),..._g(e)?zg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${Lg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Sg("uniform float uOffsetWU"),Sg("attribute vec3 aLocationA"),Sg("attribute vec3 aLocationB"),Sg("attribute float aSegmentPosition"),Sg("attribute float aPerpendHorizontal"),Sg("attribute float aPerpendVertical"),...Bg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Vg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),wg("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"),..._g(e)?zg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Sg("attribute vec3 aEdge"),Sg("uniform float uEdgeRoundness"),wg("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:${Lg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Sg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Eg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?bg("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"})`):bg("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})`)),...kg("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(Sg("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&&Eg.roundUnsigned,Eg.modulus,Eg.texelFetchWithFallback[h],"ubyte"===r&&Eg.decodeUbyteRGBAEncodedFloat,bg(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(Sg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),bg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${Lg(t)}`,idFragment:`DrawToNormalTexture:${Lg(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",gE:{SE:!0},apply:(u,c)=>{const d=[],f=[];return d.push(Sg("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture"),Eg.modulus,Eg.texelFetchWithFallback[c],"ubyte"===h&&Eg.decodeUbyteRGBAEncodedFloat,bg("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(...Bg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(Tg("posWorld","varying vec3 vPosWorld"),..."uint"===o?[Eg.texelFetchUnsignedWithFallback[c],Cg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Cg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Cg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Sg("varying vec3 vNormal",..."uint"===o?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Sg("varying vec3 vTriangleBary")),"uniform"===e?f.push(Sg("uniform vec4 uColorDiffuse"),wg("colorFragment =","colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]&&("value"===e[1]?(d.push(Tg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Sg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===a&&Eg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?bg("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"})`):bg("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"),...kg("intensityP",e[2]))):(d.push(Tg(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Sg("varying float vLookupValue"),...kg("vLookupValue",e[2])))),"phong"===r&&f.push(...Dg),n&&(d.push(Sg("attribute vec3 aTriangleBary"),Tg("aTriangleBary","varying vec3 vTriangleBary")),f.push(Sg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Eg.computeScreenSpaceWireframe,wg("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:${Lg(t)}`,idFragment:`SurfaceGrid:${Lg(t)}`,vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${Lg(t)}`,idFragment:`DebugSurfaceGridNormals:${Lg(t)}`,vertexShaderModifiers:[Sg("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"]),Eg.roundUnsigned,Eg.modulus,Eg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Eg.decodeUbyteRGBAEncodedFloat,bg(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?[Eg.texelFetchUnsignedWithFallback[i]]:[],...Bg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),wg("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:[Cg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Sg("uniform vec3 uCameraLoc"),wg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Sg("attribute float aSegmentInside"),Sg("varying float vSegmentInside"),Sg("varying float vSegmentSide"),wg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Rg("#extension GL_OES_standard_derivatives : enable"),Sg("uniform float uAALimit"),Sg("varying float vSegmentInside"),Sg("varying float vSegmentSide"),wg("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:${Lg(t)}`,idFragment:`Glow1D:${Lg(t)}`,vertexShaderModifiers:[Tg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Sg("uniform sampler2D uTexture"),Sg("varying vec2 vTextureCoord"),Sg("uniform vec2 uTextureSize"),r&&Sg("uniform vec2 uOffsetPx"),!r&&Sg("uniform sampler2D uTextureFirstGlowPass"),!r&&Sg("uniform vec4 uGlowColor"),wg("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",gE:{SE:r,xE:i},apply:(n,o)=>{const h="webgl2"===o?"flat":"",a="webgl2"===o?"int":"float";return{idVertex:`MousePicking:${Lg(t)}`,idFragment:`MousePicking:${Lg(t)}`,vertexShaderModifiers:[...r?[Sg(`${h} varying ${a} vPickingIdOffset`),Cg(`vPickingIdOffset = ${a}(iInstance)`)]:[],...i?[Sg(`${h} varying ${a} vPickingIdOffset`),Cg(`vPickingIdOffset = ${a}(iVertex)`)]:[],...s?[Sg("attribute float aPickingIdOffset",`${h} varying ${a} vPickingIdOffset`),Cg(`vPickingIdOffset = ${a}(aPickingIdOffset)`)]:[]],fragmentShaderModifiers:[Sg("uniform int uFirstId"),...e?[]:[Sg(`${h} varying ${a} vPickingIdOffset`),bg("int mousePickingIdOffset = "+("int"===a?"vPickingIdOffset":"int(floor(vPickingIdOffset + 0.5))"))],wg("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:[Tg("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:[Sg("attribute vec2 aLengthSoFar"),Sg("varying float vLengthSoFar"),Sg("uniform vec2 uStippleCount"),Cg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Sg("uniform sampler2D uStippleTexture"),Sg("uniform float uStippleScale"),Sg("varying float vLengthSoFar"),"webgl1"===e&&Sg("uniform float uStippleTextureWidthLimiter"),wg("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:[Sg("attribute vec2 aLengthSoFarA"),Sg("attribute vec2 aLengthSoFarB"),Sg("varying float vLengthSoFar"),Sg("uniform vec2 uStippleCount"),Cg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Sg("uniform sampler2D uStippleTexture"),Sg("uniform float uStippleScale"),Sg("varying float vLengthSoFar"),"webgl1"===e&&Sg("uniform float uStippleTextureWidthLimiter"),wg("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:${Lg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Sg("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"),Eg.texelFetchWithFallback[i],"ubyte"===h&&Eg.decodeUbyteRGBAEncodedFloat,bg("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&&wg("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&&wg("colorFragment =","colorFragment = uColor"),r&&wg("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?kg("intensityP",r.lut):[]]}}})},Yg={"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"},Gg={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 Xg{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new At(`Could not find ${this.bE()} ${this.ME()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}bE(){return this.id.toString()}ME(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Zg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class Hg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class Wg{constructor(t,e,i,s){this._E=new Map,this.wE=new Map,this.CE=i,this.kE=i.createProgram(),this.TE=`${t.bE()} vertex`,this.FE=`${e.bE()} fragment`,i.attachShader(this.kE,t.shader),i.attachShader(this.kE,e.shader),i.bindAttribLocation(this.kE,0,"aPos"),i.linkProgram(this.kE),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""}IE(t){return pe(0,(()=>xe()))}PE(t){const e=this.DE(t);if(void 0===e)throw this.IE(`Could not get ${t} uniform from ${this.TE} and ${this.FE} shaders.`);return e}DE(t){const e=this._E.get(t);if(e)return e;const i=this.CE.getUniformLocation(this.kE,t);return i?(this._E.set(t,i),i):void 0}BE(t){const e=this.LE(t);if(void 0===e)throw this.IE(`Could not get ${t} attribute from ${this.TE} and ${this.FE} shaders.`);return e}LE(t){const e=this.wE.get(t);if(e||0===e)return e;const i=this.CE.getAttribLocation(this.kE,t);return i>=0?(this.wE.set(t,i),i):void 0}Y(){this.CE.deleteProgram(this.kE)}}const jg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,Kg=t=>{let e;try{e=wt.getComputedStyle(t)}catch(t){return null}return e};function $g(t){const e=Kg(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=Kg(ty(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||!!jg.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function Qg(t){let e=t.length;for(;e--;)if($g(t[e]))return t[e];return null}function qg(t){var e;return t&&Number((null===(e=Kg(t))||void 0===e?void 0:e.zIndex)||0)||0}function Jg(t){const e=[];for(;t;)e.push(t),t=ty(t);return e}function ty(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}const ey=t=>t&&"resize"in t;class iy extends rg{constructor(t){if(super(),this.RE=new Map,this.EE=new Map,this.zE=new Map,this.VE=!0,this.OE=null,this.NE=null,this.GE=null,this.WE=null,this.UE=0,this.YE=0,this.HE=0,this.$E=!1,this.XE=!0,this.$i=!1,this.jE=fe(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.Z={x:100,y:100},this.ZE=()=>{this.QE&&clearTimeout(this.QE),this.QE=setTimeout((()=>this.en()),12)},this.JE=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.RE.get(i);if(t){const s=t.KE();t.qE(e),e?this.EE.set(i,t):this.EE.delete(i),s!==e&&t.xs()}}},this.tz=(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.NE.kE),o.clear(o.COLOR_BUFFER_BIT),n.Zr.getBoundingClientRect()){const t=n.iz();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.sz),o.uniform1i(this.UE,0),o.uniformMatrix4fv(this.YE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.GE),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.HE,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.ez&&(n.ez.clearRect(0,0,n.ez.canvas.width,n.ez.canvas.height),n.ez.drawImage(this.hz,0,this.hz.height-t.y,t.x,t.y,0,0,n.ez.canvas.width,n.ez.canvas.height))}},this.rz=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.NE.kE),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Zr.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.nz-t*this.nz,a*this.nz+e*this.nz,i*this.nz,o*this.nz)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.sz),n.uniform1i(this.UE,0),n.uniformMatrix4fv(this.YE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.GE),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.HE,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.oz=(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.iz();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.az[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.hz.height-h.y,h.x,this.hz.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.ez&&(n.ez.clearRect(0,0,n.ez.canvas.width,n.ez.canvas.height),n.ez.drawImage(this.hz,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.lz=(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.Zr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.iz();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.az[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.nz-t*this.nz,l*this.nz+e*this.nz,(a-t+o)*this.nz,(l+e+h)*this.nz,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.QE=void 0,this.Qn=t,!wt.requestAnimationFrame||!wt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.uz)e=!0===t.uz?wt.devicePixelRatio||1:t.uz||1;else{const t=wt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=wt.devicePixelRatio||1)}this.nz=e,t.Kn=!0===t.Kn,this.XE=!1!==t.cz,this.dz=!1!==t.fz,this.Az=t.Az||!1;let i=!1;if(t.hz)if("string"==typeof t.hz){const e=wt.document.getElementById(t.hz);if(!e)throw new Error(`Canvas "${t.hz}" doesn't exist.`);this.hz=e,i=!0}else this.hz=t.hz,i=!0;else this.hz=wt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.gz&&t.gz){const e=this.hz.getContext("webgl",{...s,antialias:!!t.cz})||this.hz.getContext("experimental-webgl",{...s,antialias:!!t.cz});this.gl=e,this.pz=!1}else{const t=this.hz.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.pz=!0}if(!this.gl)throw new xt("No WebGL context available."+((null==t?void 0:t.gz)?`\nSelected explicit target: WebGL ${t.gz}`:""));const r=[];if(this.yz={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.yz).forEach((t=>{null===this.yz[t]&&r.push(t)})),this.pz)this.mz=!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.VE=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.mz=!!e.OES_texture_float,this.gl1={ctx:this.gl,yz:t,optional:e}}const n=r;if(n.length>0&&!1!==t.Kn){const t=wt.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=wt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),wt.document.body.appendChild(t),t.appendChild(e),wt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.vz=this.Az?this.Sz(this.pz?this.oz.bind(this):this.tz.bind(this)).bind(this):this.xz(this.pz?this.lz.bind(this):this.rz.bind(this)).bind(this),wt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.hz&&this.bz()};this.eo=new wt.ResizeObserver(t.bind(this)),this.eo.observe(this.hz)}if(this.Mz=((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,y,m,p;try{const e=wt.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 Pg(`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 Pg(`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.gE)||void 0===e?void 0:e.SE}))&&("webgl1"===e?l.push(Sg("attribute float aInstanceID"),bg("int iInstance = int(aInstanceID)")):l.push(bg("int iInstance = gl_InstanceID"))),!!t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.xE}))&&("webgl1"===e?l.push(Sg("attribute float aVertexID"),bg("int iVertex = int(aVertexID)")):l.push(bg("int iVertex = gl_VertexID"))),!o)throw new Pg("No vertex shader template defined",n);if(!u)throw new Pg("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 x=n.get(u.id);if(c="new",x)return c="existing",g=x.vertexShaderSrc,y=x.fragmentShaderSrc,x;const A=u.vertexShader.id;let S=s.get(A);if(S)g=S.src,d="existing";else{d="new";const t=new pg(u.vertexShader.modifiers).build(Yg[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,m=r,S=new Zg(A,e,i,r),s.set(A,S),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)y=b.src,f="existing";else{f="new";const t=Gg[v.template],e=new pg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);y=s,p=n,b=new Hg(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const w=new Wg(S,b,i,u);return n.set(u.id,w),o.programs+=1,o.totalMs+=wt.performance.now()-e,w}catch(t){throw pe(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 wt.alert(t),new Error(t)}))}}})(this.gl,!this.pz),this.dE=(()=>{const t=wt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new xt("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,y=0;const m=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),wt.addEventListener("resize",this.ZE,{passive:!0}),!this.pz){if(this.NE=this.Mz(Ug["2DCompose"],Ug.Color({dataType:"texture-coord-calc-gpu"}),Ug.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.NE.kE)throw new xt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.NE.kE,"uColorTexture");if(!e)throw new xt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.NE.kE,"uMatrix");if(!i)throw new xt("Unable to setup composition shader! Failed to find uMatrix");this.UE=e,this.YE=i,this.HE=t.getAttribLocation(this.NE.kE,"aPos"),this.GE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.GE),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.WE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.WE),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)}}Sz(t){return e=>{this.OE=null;const i=this.gl.canvas,s=Array.from(this.EE.values());this.$E=!1,s.forEach((s=>{const r=s.iz();(this.Z.x{this.OE=null,"style"in this.gl.canvas&&!this.Qn.Tz&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.hz.clientHeight,r=this.hz.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.nz&&i.height===s*this.nz||(i.width=r*this.nz,i.height=s*this.nz);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.EE.values());this.$E=!1,h.sort(((t,e)=>t.Fz()-e.Fz())).forEach((t=>{t.dn&&t.kz(e)})),t(n,o,r,s,h),this.$E&&this.bz()}}bz(t){return ey(this.gl)||(!this.$E&&t&&(this.$E=!0),this.OE||this.$i||(this.OE=wt.requestAnimationFrame(this.vz))),this}Iz(t){const e=this.jE();return t.Zr.setAttribute("data-lcjs-engine-id",e),this.RE.set(e,t),t.Pz(this.RE.size-1),t.qE(!0),this.EE.set(e,t),this.Cz&&this.Cz.observe(t.Zr),this.QE&&clearTimeout(this.QE),this.QE=setTimeout((()=>this.en()),0),this}Dz(t){const e=t.Zr.getAttribute("data-lcjs-engine-id");return e?(this.RE.delete(e),this.EE.delete(e),this.Cz&&this.Cz.unobserve(t.Zr),t.Zr.removeAttribute("data-lcjs-engine-id"),this):this}en(){if(this.Cz){const t=this.Cz.takeRecords();for(let e=0;efunction(t,e){if(t===e)return 0;const i={a:Jg(t),b:Jg(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=qg(Qg(i.a)),n=qg(Qg(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.Zr,e.Zr))).forEach(((t,e)=>t.Pz(e))),this.bz(!0),this}II(){return this.bz(),this}Bz(){this.$i||this.RE.forEach((t=>t.cp.layout()))}Y(){var t;if(this.$i)return;this.$i=!0,super.Y(),this.OE&&(wt.cancelAnimationFrame(this.OE),this.OE=null),this.$E=!1,this.eo&&(this.eo.disconnect(),this.eo=void 0),this.Cz&&(this.Cz.disconnect(),this.Cz=void 0),wt.removeEventListener("resize",this.ZE),this.ZE=void 0,this.RE.forEach((t=>{t.Y()})),this.RE.clear(),Array.from(this.zE.values()).forEach((t=>{t.KR(!0)})),this.zE.clear();const e=this.gl;e.deleteBuffer(this.GE),e.deleteBuffer(this.WE),this.hz&&!this.Qn.hz?(this.hz.width=1,this.hz.height=1,null===(t=this.hz.parentElement)||void 0===t||t.removeChild(this.hz),this.hz=void 0):this.hz=void 0,this.Mz=void 0,this.dE=void 0,this.vz=()=>{},this.yz.WEBGL_lose_context&&this.yz.WEBGL_lose_context.loseContext()}}const sy=(t,e,i,s)=>r=>{const n={theme:eg,...i,...r},o=t(n),h=e||s?ig(o,s):void 0,a=new vf(o.Qn,r,o,o.Y.bind(o),h);return o.mo((t=>a.QL(t))).yo((()=>a.J())).xs(),a},ry=(t,e)=>{t.mo((t=>{e.De(t)})).yo((()=>e.J())).xs()},ny=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new sa(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h);return ry(o,a),a},oy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new wc(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},hy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Cd(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},ay=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new zc(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},ly=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new(r&&r.type?r.type:Ya)(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},uy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new gf(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},cy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new(r&&r.type?r.type:$c)(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},dy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new(r&&r.type?r.type:ld)(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},fy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Vl(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r,void 0);return ry(o,a),a},gy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new wl(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},yy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Qd(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0);return ry(o,a),a},my=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new lf(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},py=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Ic(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},xy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Of(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},Ay={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)=>Ay.multiply(t,Ay.translation(e,i,s)),xRotate:(t,e)=>Ay.multiply(t,Ay.xRotation(e)),yRotate:(t,e)=>Ay.multiply(t,Ay.yRotation(e)),zRotate:(t,e)=>Ay.multiply(t,Ay.zRotation(e)),rotateXYZ(t,e){let i=Ay.xRotate(t,e.x);return i=Ay.yRotate(i,e.y),i=Ay.zRotate(i,e.z),i},scale:(t,e,i,s)=>Ay.multiply(t,Ay.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],y=e[13],m=e[14],p=e[15],x=t[0],A=t[1],S=t[2],v=t[3],b=t[4],M=t[5],w=t[6],C=t[7],T=t[8],R=t[9],E=t[10],k=t[11],I=t[12],F=t[13],D=t[14],P=t[15],L=[];return L[0]=i*x+s*b+r*T+n*I,L[1]=i*A+s*M+r*R+n*F,L[2]=i*S+s*w+r*E+n*D,L[3]=i*v+s*C+r*k+n*P,L[4]=o*x+h*b+a*T+l*I,L[5]=o*A+h*M+a*R+l*F,L[6]=o*S+h*w+a*E+l*D,L[7]=o*v+h*C+a*k+l*P,L[8]=u*x+c*b+d*T+f*I,L[9]=u*A+c*M+d*R+f*F,L[10]=u*S+c*w+d*E+f*D,L[11]=u*v+c*C+d*k+f*P,L[12]=g*x+y*b+m*T+p*I,L[13]=g*A+y*M+m*R+p*F,L[14]=g*S+y*w+m*E+p*D,L[15]=g*v+y*C+m*k+p*P,L},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],y=t[13],m=t[14],p=t[15],x=d*p,A=m*f,S=a*p,v=m*l,b=a*f,M=d*l,w=r*p,C=m*n,T=r*f,R=d*n,E=r*l,k=a*n,I=u*y,F=g*c,D=o*y,P=g*h,L=o*c,V=u*h,_=i*y,B=g*s,z=i*c,N=u*s,O=i*h,U=o*s,Y=x*h+v*c+b*y-(A*h+S*c+M*y),G=A*s+w*c+R*y-(x*s+C*c+T*y),X=S*s+C*h+E*y-(v*s+w*h+k*y),Z=M*s+T*h+k*c-(b*s+R*h+E*c),H=1/(i*Y+o*G+u*X+g*Z);return e[0]=H*Y,e[1]=H*G,e[2]=H*X,e[3]=H*Z,e[4]=H*(A*o+S*u+M*g-(x*o+v*u+b*g)),e[5]=H*(x*i+C*u+T*g-(A*i+w*u+R*g)),e[6]=H*(v*i+w*o+k*g-(S*i+C*o+E*g)),e[7]=H*(b*i+R*o+E*u-(M*i+T*o+k*u)),e[8]=H*(I*l+P*f+L*p-(F*l+D*f+V*p)),e[9]=H*(F*n+_*f+N*p-(I*n+B*f+z*p)),e[10]=H*(D*n+B*l+O*p-(P*n+_*l+U*p)),e[11]=H*(V*n+z*l+U*f-(L*n+N*l+O*f)),e[12]=H*(D*d+V*m+F*a-(L*m+I*a+P*d)),e[13]=H*(z*m+I*r+B*d-(_*d+N*m+F*r)),e[14]=H*(_*a+U*m+P*r-(O*m+D*r+B*a)),e[15]=H*(O*d+L*r+N*a-(z*a+U*d+V*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,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(n-r),-(n+r)/(n-r),0,0,0,1]};function Sy(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,y=d*s.y,m=c-g,p=d-y,x=g>m?[m,g]:[g,m],A=y>p?[p,y]:[y,p];let S,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(S=x[0]/c,v=A[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=x[1]/c,v=A[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=A[0]/d,n===e.GradientShape.circle){S=x[0]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=x[0]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=A[1]/d,n===e.GradientShape.circle){S=x[1]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=x[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 vy(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 by{constructor(t){this.ZR=t}}class My{constructor(){this.Lz=new Array,this.Rz=t=>(this.Lz.push(t),t),this.Ez=this.Rz(new Map),this.zz=this.Rz(new Map),this.Vz=this.Rz(new Map),this.Oz=this.Rz(new Map),this.Nz=this.Rz(new Map),this.Gz=this.Rz(new Map),this.Wz=this.Rz(new Map),this.Uz=this.Rz(new Map)}Yz(){this.Lz.forEach((t=>{t.forEach((t=>t.Yz())),t.clear()}))}}const wy=(t,e,i)=>()=>{t.$z=e,i&&i()},Cy=(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,y=0,m=1;switch(n){case e.ImageFitMode.Fill:u{this.Jz=!0,this.sV()})),this.uc.addEventListener("error",(()=>{this.Kz=!0})),this.uc.complete&&(this.Jz=!0,this.sV());else if(this.uc instanceof wt.HTMLVideoElement){const t=this;this.uc.addEventListener("canplay",(function(){t.jz=this.videoHeight,t.Xz=this.videoWidth,t.Jz=!0,t.sV()}),!0),this.uc.addEventListener("play",wy(this,!0,(()=>this.sV()))),this.uc.addEventListener("playing",wy(this,!0,(()=>this.sV()))),this.uc.addEventListener("pause",wy(this,!1)),this.uc.addEventListener("ended",wy(this,!1)),this.uc.readyState>=1&&(this.Xz=this.uc.videoWidth,this.jz=this.uc.videoHeight,this.$z=!this.uc.paused,this.Jz=!0,this.sV())}else this.Jz=!0,this.sV()}aE(t){0===this.tV.size&&this.Jz&&this.sV(),this.tV.add(t)}lE(t){this.tV.delete(t),0===this.tV.size&&this.unbindResources()}eV(t){this.qz.add(t),this.Qz&&(t(),this.hV(t))}hV(t){this.qz.delete(t)}sV(){if(this.Kz||this.Qz||!this.Jz)return;const t=this.CE.gl;if(!this.iV&&this.uc&&t){this.iV=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.iV),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.uc,o=this.Xz>0?this.Xz:n.width,h=this.jz>0?this.jz: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.Xz=o,this.jz=h,t.bindTexture(t.TEXTURE_2D,null)}this.Qz=!0,this.qz&&this.qz.forEach((t=>{t(),this.hV(t)}))}Ls(){const t=this.CE.gl;if(!this.Kz&&this.Qz&&this.iV){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.uc;n&&(t.bindTexture(t.TEXTURE_2D,this.iV),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}rV(){return this.iV}unbindResources(){return this.Qz&&(this.iV&&(this.CE.qR(this.iV),this.iV=null),this.Qz=!1),this}}class Ry extends Hr{constructor(t,e,i){super(t.ls,e,i),this.lv=!0,this.tv={},this.nv=p(Hn),this.Is=t,this.At=t.At}nV(){var t;return this.nv.u&&this.nv.C().type!==(null===(t=this.oV)||void 0===t?void 0:t.type)}pv(t){return this.lv=t,this}aV(t){return this.tv=t,this}}class Ey{constructor(t){this.RV=[],this.ZR=t}EV(t,e){((t,e,i,s)=>{const r=t.lV(),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.uV(),l=t.cV(),u=t.dV(),c=t.fV(),d=t.AV();t.gV("disabled"),t.pv(!1),t.pV(!1);const f=e.yV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.lV(),o=t.mV();t.vV(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.SV(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof jr?s=e._M||e.Is.Pp():e instanceof Ry&&(s=e.Is.lx()),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.xV(e*n,r*n,o*n,h*n)}else t.pV(!1);e.QL(2,0)})),t.vV(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.pV(!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 y=f;const m=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iYe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=ei(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof jr||t instanceof Ry?t.Is.bV(t):Ne;if(Ae(e))return Ne;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?Ne:r})).filter((t=>!Ae(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=fi(t.min,s),i=fi(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.MV(o),vertexCount:n}})(t,s,{left:m+(h.x<0?-h.x:0),top:m+(h.y>0?h.y:0),right:m+(h.x>0?h.x:0),bottom:m+(h.y<0?-h.y:0)},e._V()),x=e.yV(f,y),A=t.Mz(Ug["2D"],Ug.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),Ug.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.mV();t.vV(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.SV(0,0,i.sizeDpr.x,i.sizeDpr.y),t.wV(s,((h,a,l,u)=>(t.aE(s),n&&n(h),t.FV(h("uIsHighlighted"),0).TR(h("uHighlightColorOffset"),E).FV(h("uRenderEffectMask"),0).TV(h("uTexture"),e.texture,0).kV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).kV(h("uScale"),i.uniforms.IV()).kV(h("uDisp"),i.uniforms.PV()).kV(h("uScaling"),[i.size.x,i.size.y]).kV(h("uTranslationAxis"),[0,0]).CV(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Jy(o.TRIANGLES,r.vertexCount,0),!0))),t.vV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,y,x,A,p,((e,i,s,r)=>(t.kV(e("uOffsetPx"),[h.x,h.y]),!0))),y=x,t.pV(l),t.DV(d);const S=t.Mz(Ug["2D"],Ug.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),Ug.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.ls.oi().x,y:t.ls.oi().y};t.SV(0,0,o.x*t.lV(),o.y*t.lV());const h=lt.d2({scaleXYConstructor:Bi}).it(o).Vi(0,o.x).Oi(0,o.y),a=new Fy;a.BV(h),t.wV(i,((h,l,u,c)=>(t.aE(i),r&&r(h),t.FV(h("uIsHighlighted"),0).TR(h("uHighlightColorOffset"),E).FV(h("uRenderEffectMask"),0).TV(h("uTexture"),e.texture,0).kV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).kV(h("uScale"),a.IV()).kV(h("uDisp"),a.PV()).kV(h("uScaling"),[o.x,o.y]).kV(h("uTranslationAxis"),[0,0]).CV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Jy(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.TV(e("uTextureFirstGlowPass"),x.texture,1).TR(e("uGlowColor"),i.color),!0))),t.SV(a.x,a.y,a.width,a.height),t.gV(u),t.pv(c),t.LV(p.vertexBuffer)})(this.ZR,this,e,t)}_V(){const t=this.ZR.ls.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}yV(...t){const e=this.RV,i=this._V(),s={x:Math.ceil(i.x*this.ZR.lV()),y:Math.ceil(i.y*this.ZR.lV())},r=this.ZR.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.BV(n.scale)),n;const o=r.createTexture(),h=this.ZR.zV(),a=this.ZR.VV();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.ZR.mV();this.ZR.vV(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.ZR.vV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=lt.d2({scaleXYConstructor:Bi}).it(i).Vi(0,i.x).Oi(0,i.y),c=new Fy;c.BV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}Y(){[this.RV].forEach((t=>{t.forEach((t=>{this.ZR.OV(t.depthBuffer),this.ZR.NV(t.frameBuffer),this.ZR.qR(t.texture)})),t.length=0}))}}class ky{constructor(t,i,s,r,n=!0){this.GV=new My,this.WV=new Map,this.UV=new Map,this.YV=[],this.uz=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(wt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.lv=!1,this.kV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.HV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.$V=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.XV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.jV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.ZV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.TR=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.FV=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.QV=(t,e)=>(this.gl.uniform1i(t,e),this),this.TV=(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 xt("Could not bind a texture.")},this.JV=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.MV=(t,e=!1,i,s=Float32Array)=>{const r=t.length,n=this.KV(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 xt("Could not create vertex buffer")},this.qV=(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 xt("Could not create vertex buffer")},this.tO=(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.iO=(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.sO=(t,e)=>{const i=t.length,s=this.KV(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 xt("Could not create index buffer")},this.eO=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 xt("Could not create float buffer")},this.hO=(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.rO=(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.CV=(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.nO(s,e)}return this},this.oO=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.aO=(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.lO=(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.nO(t,i)),this),this.uO=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.cO=null,this.Jy=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.dO=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.fO=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.yz.ANGLE_instanced_arrays)return wt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.yz.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.AO=(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.yz.ANGLE_instanced_arrays)return wt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.yz.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.nO=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.yz.ANGLE_instanced_arrays)return wt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.yz.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.gO=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=this.mV();this.vV(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.cV();o&&this.pV(!1),t(),o&&this.pV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.vV(this.gl.FRAMEBUFFER,n)},this.Ot=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.pO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.aE=t=>(this.gl.useProgram(t.kE),this),this.yO=!1,this.mO=[],this.ls=t,this.mA=i,this.ls=t,this.gl=s.ctx,this.vO=s.antialias,this.SO=!!this.ls.hn.VE&&s.lineAntialias,this.mz=this.ls.hn.mz,this.xO=new Map,this.gl1=this.ls.hn.gl1,this.gl2=this.ls.hn.gl2,n&&(this.DV(!0),this.bO()),this.yz=this.ls.hn.yz,this.JR=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.eE=this.MO(),this.Mz=this.ls.hn.Mz,this._O=new Py(this),this.dE=this.ls.hn.dE,this.wO=new Ey(this),this.zE=this.ls.hn.zE,this.CO=this.MV([0,0,1,0,1,1,0,1]),this.kO=this.MV([0,0,1,0,0,1,0,1,1,0,1,1])}gV(t){return t!==this.TO&&(this.TO=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}dV(){return this.TO||"disabled"}pv(t){return t!==this.lv&&(this.lv=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}fV(){return this.lv}FO(t){return this.uz=t,this}lV(){return this.uz}KV(t,e){let i;if(e){const s=this.xO.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.LV(e)}return i||(i=this.gl.createBuffer(),this.xO.set(i,{size:t})),i}IO(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 xt("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}qR(t){this.gl.deleteTexture(t)}zV(){const t=this.gl.createFramebuffer();if(!t)throw new xt("Couldn't reserve Framebuffer.");return t}vV(t,e){this.cO=e,this.gl.bindFramebuffer(t,e)}mV(){return this.cO}NV(t){this.gl.deleteFramebuffer(t)}VV(){const t=this.gl.createRenderbuffer();if(!t)throw new xt("Couldn't reserve Render buffer.");return t}OV(t){this.gl.deleteRenderbuffer(t)}SV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.PO&&t===this.PO.x&&e===this.PO.y&&i===this.PO.width&&s===this.PO.height||(this.PO={x:t,y:e,width:i,height:s}),this}uV(){return this.PO||{x:0,y:0,width:0,height:0}}xV(t,e,i,s){return this.pV(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}pV(t){return t===this.DO||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.DO=t),this}DV(t){return t!==this.yO&&(this.yO=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}AV(){return this.yO}bO(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)}cV(){return void 0!==this.DO&&this.DO}wV(t,e){const i=new Ly(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}LV(t){t&&(this.gl.deleteBuffer(t),this.xO.delete(t))}BO(t,e,i){this.kV(t.uniform("uCenter"),e.center).kV(t.uniform("uDistance"),e.distance).$V(t.uniform("uBounds"),e.bounds).FV(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.NO.buffer;this.NO&&(this.LV(this.NO.buffer),this.NO=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.mO.splice(this.mO.indexOf(l),1)}))}$O(t,e,i,s,r,n,o,h){const a=this.gl,l=this.mV();this.vV(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.vV(this.gl.FRAMEBUFFER,l)}XO(t){const e=this.UV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new xt("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.FV(s("uMinValue"),i.min),this.FV(s("uMaxValue"),i.max)}return this}KO(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.uc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.MV(o(t.texture.Xz,t.texture.jz,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.lE(t),this.LV(i.texCoordsBuffer));const r=this.RO(h);r.aE(t);const n=s?s.getSourceMissingColor():ks.color;e={texture:r,source:h,texCoordsBuffer:this.MV([]),sourceMissingTexture:this.IO(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.ls.xs())}},r.eV(e.textureReadyCallback),l(e)}return e&&e.texture.Qz&&e.texture.Zz&&e.texture.$z&&(e.texture.Ls(),this.ls.xs()),n&&e&&e.texture.Qz&&l(e),e}i&&this.qO(t,i)}qO(t,e){e&&(e.texture.lE(t),e.texture.hV(e.textureReadyCallback),this.qR(e.sourceMissingTexture),this.LV(e.texCoordsBuffer))}tN(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.At,a=this.lV();this.FV(r("uIsHighlighted"),1===e||2===e?0:i.Yo).TR(r("uHighlightColorOffset"),1===e||2===e?k:i.jo).FV(r("uRenderEffectMask"),2===e?1:0).kV(n("uRatioPxClip"),[2/this.ls.oi().x,2/this.ls.oi().y]).FV(n("uDevicePixelRatio"),a),h instanceof Bi||h instanceof Bc?this.kV(r("uScale"),s.uniforms.IV()).kV(r("uDisp"),s.uniforms.PV()).kV(n("uScaleStart_highpart"),s.uniforms.iN()).kV(n("uScaleStart_lowpart"),s.uniforms.sN()):h instanceof zi&&this.kV(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).kV(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).kV(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).kV(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).kV(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).kV(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.lO(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.lO(o("aPosY"),s.coordsY);if(1===e)this.QV(r("uFirstId"),s.idFirst);else{if(s.fillStyleSolid&&this.TR(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.lO(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.nO(t,s.lookupValueAttribDivisor)}this.JO(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.LO(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.BO(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.nO(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.rV();this.TR(n("uColor"),s.fillStyleImage.getSurroundingColor()).TV(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).CV(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).JV(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.rV();this.TV(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).CV(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return void 0!==s.useInstanceID&&this.YO(t,s.useInstanceID),void 0!==s.useVertexID&&this.WO(t,s.useVertexID),!0}eN(t,e,i){if(t)return vy(i||e.qo(),e.At,t.getAngle(!0),this.lV())}hN(t,e,i){if(t)return Sy(i||e.qo(),e.At,t.getPosition(),t.getExtent(),t.getShape(),this.lV())}}const Iy=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 wt.setTimeout(o,r)};wt.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 Fy{BV(t){if(t instanceof Bi||t instanceof Bc){const e=t.mi();this.rN=e.x.scaling,this.nN=-e.x.displacement,this.oN=e.y.scaling,this.aN=-e.y.displacement,this.lN=e.x.highPrecisionOffset,this.uN=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.cN=e.y.highPrecisionOffset,this.dN=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof zi&&(this.MixedScaleXY=t.mi());return this}PV(){return[this.nN,this.aN]}IV(){return[this.rN,this.oN]}iN(){return[this.lN,this.cN]}sN(){return[this.uN,this.dN]}}class Dy{constructor(){this.rN=0,this.oN=0,this.fN=0,this.nN=0,this.aN=0,this.AN=0}gN(t){return this.rN=t.rt(),this.nN=t.getInnerStart()+.5*this.rN*t.nt(),this}pN(t){return this.oN=t.rt(),this.aN=t.getInnerStart()+.5*this.oN*t.nt(),this}yN(t){return this.fN=t.rt(),this.AN=t.getInnerStart()+.5*this.fN*t.nt(),this}IV(){return[this.rN,this.oN,this.fN]}PV(){return[this.nN,this.aN,this.AN]}mN(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=Ay.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Py{constructor(t){this.ZR=t}QL(t,e,i,s,r,n=0){const o=this.ZR,h=void 0===s;if(!(s=s||o.zV()))throw new xt("Could not bind a framebuffer.");const a=o.uV(),l=o.AV();o.DV(!1),o.gO((()=>{o.SV(0,0,i.x,i.y),t()}),s,e,n),h&&o.NV(s),this.ZR.pO(r),this.ZR.SV(a.x,a.y,a.width,a.height),o.DV(l)}}class Ly{constructor(t,e){this.vN=[],this.SN=[],this.uniform=t=>{const e=this.shader.PE(t);return this.SN.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.DE(t);return this.SN.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.BE(t);return this.vN.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.vN)this.glUtils.oO(t.location),this.glUtils.nO(t.location,0)}}class Vy extends jr{constructor(t,e,i,s,r){super(t,e,i,s),this.xN=new Map,this.bN=t,this.MN=e,this.ZR=t._N(),this.wN=r,this.MN=e}KR(){return this}QL(t,e){if(!this.wN||0!==t||0===this.xN.size)return{};const i=Array.from(this.xN.values()).map((t=>t.CN.filter((t=>t.kN)).map((t=>t.qi)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===i.length)return{};const s=this.wN;return this.ZR.wO.EV(i,s),{}}TN(t,e,i,s,r){return{}}Ls(){return this}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Cl(){return 0}kl(){return 0}es(t,e){const i={CN:[]},s=(t,e)=>{const s={qi:t||[],kN:void 0===e||e};i.CN.push(s);const r={fs:t=>(s.qi=t,r),Ss:t=>(s.kN=t,r),bs:()=>s.kN};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={wg:s,...r};this.xN.set(t,i);const o=t.onDispose((()=>{this.xN.delete(t),t.offDispose(o)}));return n}}function _y(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 By=(t,e,i)=>((t,e,i)=>{const s=[];let r=0;const n=li(e,i/2);let o,h,a,l,c=t[t.length-1],d=0;for(let i=0;i0&&(c=t[i-1]),Ct(o,c)&&(c=ui(o,oi(li(ci(h,o),-1)))),Ct(o,h)&&(h=ui(o,oi(li(ci(c,o),-1))));const f=fi(c,e),g=fi(o,e),y=fi(h,e),m=oi(ci(g,f)),p=oi(ci(y,g)),x=ui(m,p),A=u(-x.y,x.x),S=u(-m.y,m.x),v=1/yi(A,S),b=ai(A),M=oi(ci(m,p)),w=Math.sign(yi(A,M))||1,C=di(A,li(n,v)),T=di(A,li(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(yi(m,A))||w,g=di(S,li(n,f)),y=di(l,li(n,f));1===w?(t=g,e=T,i=y,a=T):(t=C,e=g,i=C,a=y);const x=4*Ke(c,o),b=4*Ke(o,h);(v>x||v>b)&&(1===w?(t=g,e=y,i=y,a=g):(t=y,e=g,i=g,a=y));const M=ui(o,t),R=ui(o,e),E=ui(o,i),k=ui(o,a);s[r]=M,r+=1,s[r]=R,r+=1,s[r]=E,r+=1,s[r]=k,r+=1,d=4}else{const t=ui(o,C),e=ui(o,T);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 zy extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.FN=Ne,this.IN=Ne,this.PN=dg({arcStyleSolid:()=>Y(this.we)&&this.we,arcStyleRadialGradient:()=>tt(this.we)&&this.we,arcStyleLinearGradient:()=>st(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N()}DN(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?_y(this.ma.C(),this.Xl.C(),this.Fi.C(),this.jl.C()*l/100,this.Zl.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.Kl=u(t,e)}else{const t=Math.floor(d/2);this.Kl=u(h[t].x,h[t].y)}this.ql=h[1];const f=h.length-1;this.tu=h[f],this.Ql.C()&&(h.shift(),c.shift());let g=!1;(this.ma.u||this.Xl.u||this.Fi.u||this.jl.u||this.Zl.u||this.Ql.u||this.Jl.u||s)&&(this.IN=y(u(this.za().x-n,this.za().y-o),u(this.za().x+n,this.za().y+o)),g=!0,this.ma.u=!1,this.Xl.u=!1,this.Fi.u=!1,this.jl.u=!1,this.Zl.u=!1,this.Ql.u=!1,this.Jl.u=!1);const m=this.aa();(g||m)&&this.we!==B&&(this.Ql.C()?(this.RN&&this.ZR.LV(this.RN),[this.EN,this.RN,this.zN,this.VN]=this.DN(h,c)):(this.RN&&this.ZR.LV(this.RN),[this.EN,this.RN,this.zN,this.VN]=this.DN(h,void 0)),tt(this.we)?this.ON=Sy(this.IN,this.At,this.we.getPosition(),this.we.getExtent(),this.we.getShape(),this.ZR.lV()):st(this.we)?this.NN=vy(this.IN,this.At,this.we.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0));const p=this.PN.arcStyleSolid(m),x=this.PN.arcStyleLinearGradient(m),A=this.PN.arcStyleRadialGradient(m),S=p||x||A;m&&(this.GN=S?this.ZR.Mz(Ug["2D"],Ug.Color({dataType:tt(this.we)||st(this.we)?["gradient",this.we]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.da(this.we));const v=this.Ce;if(ts(v)&&(g||this.ga(v.getThickness())||s)){this.Ql.C()?360===i?(h.pop(),c.pop(),[this.WN,this.UN]=this.LN(h,void 0,v.getThickness(),r),this.YN&&this.WN?this.ZR.iO(this.YN,this.WN,!0):!this.YN&&this.WN?this.YN=this.ZR.MV(this.WN,!0):this.YN&&!this.WN&&(this.ZR.LV(this.YN),this.YN=void 0),[this.HN,this.$N]=this.LN(c,void 0,v.getThickness(),r),this.XN&&this.HN?this.ZR.iO(this.XN,this.HN,!0):!this.XN&&this.HN?this.XN=this.ZR.MV(this.HN,!0):this.XN&&!this.HN&&(this.ZR.LV(this.XN),this.XN=void 0)):([this.WN,this.UN]=this.LN(h,c,v.getThickness(),r),this.YN&&this.WN?this.ZR.iO(this.YN,this.WN,!0):!this.YN&&this.WN?this.YN=this.ZR.MV(this.WN,!0):this.YN&&!this.WN&&(this.ZR.LV(this.YN),this.YN=void 0),this.HN&&(this.XN&&this.ZR.LV(this.XN),this.XN=void 0,this.$N=0)):(360===i&&(h.shift(),h.pop()),[this.WN,this.UN]=this.LN(h,void 0,v.getThickness(),r),this.YN&&this.WN?this.ZR.iO(this.YN,this.WN,!0):!this.YN&&this.WN?this.YN=this.ZR.MV(this.WN,!0):this.YN&&!this.WN&&(this.ZR.LV(this.YN),this.YN=void 0));const t=v.getFillStyle();tt(t)?this.jN=Sy(this.IN,this.At,t.getPosition(),t.getExtent(),t.getShape(),this.ZR.lV()):st(t)?this.ZN=vy(this.IN,this.At,t.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),this.QN=t===B?void 0:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:tt(t)||st(t)?["gradient",t]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})),this.pa(v)}if(g){let t=1,e=1;ts(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.FN=y(u(this.IN.min.x-t,this.IN.min.y-e),u(this.IN.max.x+t,this.IN.max.y+e))}this.JN=e&&S?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.KN=e&&this.Ce!==nt?this.KN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0}return this}QL(t,e){if(this.ca()){const i=1===t?this.JN:this.GN,s=this.we,r=this.RN;i&&r&&this.ZR.aE(i).wV(i,((i,n,o,h)=>{if(this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(h("uScaleStart_highpart"),this._E.iN()).kV(h("uScaleStart_lowpart"),this._E.sN()).zO(o,r,this.At._i(),void 0).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t)this.ZR.QV(i("uFirstId"),e).YO(o,1);else if(Y(s))this.ZR.TR(i("uColor"),s.getColor());else if(tt(s)){if(!this.ON)return!1;this.ZR.BO(o,this.ON,s)}else if(st(s)){if(!this.NN)return!1;this.ZR.LO(o,this.NN,s)}return this.ZR.Jy(this.VN,this.zN),!0}));const n=this.Ce;ts(n)&&(void 0!==this.YN&&this.qN(t,this.YN,this.UN,n,e),void 0!==this.XN&&this.qN(t,this.XN,this.$N,n,e))}return{idCount:1}}TN(t,e,i,s,r){return{}}qN(t,e,i,s,r){const n=1===t?this.KN:this.QN,o=s.getFillStyle();n&&this.ZR.aE(n).wV(n,((n,h,a,l)=>{if(this.ZR.kV(n("uScale"),this._E.IV()).kV(n("uDisp"),this._E.PV()).zO(a,e,this.At._i(),void 0).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),1===t)this.ZR.QV(n("uFirstId"),r).YO(a,1);else if(Y(o))this.ZR.TR(n("uColor"),o.getColor());else if(tt(o)){if(!this.jN)return!1;this.ZR.BO(a,this.jN,o)}else if(st(o)){if(!this.ZN)return!1;this.ZR.LO(a,this.ZN,o)}const u=s.getThickness(),c=-1===u||1===u;return this.ZR.Jy(c?this.ZR.gl.LINE_LOOP:this.ZR.gl.TRIANGLE_STRIP,i),!0}))}KR(){return this.tG&&(this.ZR.LV(this.tG),this.tG=void 0),this.iG&&(this.ZR.LV(this.iG),this.iG=void 0),this.RN&&(this.ZR.LV(this.RN),this.RN=void 0),this.YN&&(this.ZR.LV(this.YN),this.YN=void 0),this.XN&&(this.ZR.LV(this.XN),this.XN=void 0),this.GN=void 0,this.QN=void 0,this.JN=void 0,this.KN=void 0,this}St(){return this.IN.max.x}vt(){return this.IN.min.x}bt(){return this.IN.max.y}xt(){return this.IN.min.y}Cl(){return Te(this.Ce)}kl(){return Te(this.Ce)}}class Ny{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}sG(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}eG(){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}hG(){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}rG(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.eG(),this}nG(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.hG(),this}oG(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Ny).sG(t))(),Uy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Oy.eG(),n.push(t,e),r.push(Oy.first,Oy.second,Oy.third),h=void 0,o=void 0,r.push(Oy.third,Oy.fourth,Oy.second),a=Oy.third,Oy.hG(),l&&n.push(i,s),[o,h,a]),Yy=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Oy.eG(),o.push(t,e),r.push(Oy.first,Oy.second,Oy.third);const c=vi(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Oy.third,Oy.fourth,Oy.fifth),l=Oy.fourth),Oy.hG(),u&&o.push(i,s),[h,a,l]},Gy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Oy.eG(),r.push(t,e),s.push(Oy.first,Oy.second,Oy.third),n=i,o=void 0,h=Oy.third,l?r.push(i):a=!0,[n,o,h,a]),Xy=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Oy.eG(),Oy.eG()):a>0&&(Oy.eG(),u>0&&(u-=1)),n.push(t),r.push(Oy.first,Oy.second,Oy.third),a=Oy.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Zy=(t,e=0)=>{Oy.sG(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],y=s[c],m=!1,p=u>0?g.y!==y.y?2:1:0;if(r>1)for(;cy.y?d.y>f.y?[a,l,u]=Uy(g,y,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Yy(g,y,d,f,o,n,h,a,l,u,t):[a,l,u,m]=Gy(g,y,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,Oy.eG()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=Xy(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=Xy(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class Hy extends ln{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.lG=0,this.Xa=Array(),this.uG=0,this.cG=new Uint16Array(0),this.dG=new Uint16Array(0),this.PN=dg({hightFillSolid:()=>Y(this.we)&&this.we,hightFillRadialGradient:()=>tt(this.we)&&this.we,hightFillLinearGradient:()=>st(this.we)&&this.we,hightFillPaletted:()=>H(this.we)&&this.we,lowFillSolid:()=>Y(this.Ll)&&this.Ll,lowFillRadialGradient:()=>tt(this.Ll)&&this.Ll,lowFillLinearGradient:()=>st(this.Ll)&&this.Ll,lowFillPaletted:()=>H(this.Ll)&&this.Ll}),this.bN=t,this.MN=e,this.ZR=t._N()}Ls(){const t=this.ua(),e=this.No.C(),i=this.el;if(this.ca()){this._E.BV(this.At);const s=this.At instanceof zi==0,r=s?this.At.Wi():void 0,n=this.Vl(),o=this.At.Ni()||t,h=i||this.Il.u||o&&"disabled"!==n.type;if(h){if(this.lG=0,this.cG=new Uint16Array(0),this.dG=new Uint16Array(0),this.Xa.length=0,this.uG=0,this.Pl>1){const[t,e,i,o]=Zy([s?n.packager(this.Tl,r,.5):this.Tl,s?n.packager(this.Fl,r,.5):this.Fl]);this.lG=o,this.cG=e,this.dG=i,this.Xa=t,this.uG=t.length}this.Il.u=!1}if(this.Bl&&this.tl[0].length>1){const[t,e]=this.tl,i=t.length,[o,h,a,l,u]=Zy([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.lG);this.lG=l;const c=o.length;for(let t=u;t0||this.Pl>0?1:u;s{if(this.ZR.zO(h,i,this.At._i(),void 0).uO(n).FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(r("uScale"),this._E.IV()).kV(r("uDisp"),this._E.PV()).kV(a("uScaleStart_highpart"),this._E.iN()).kV(a("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(a("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(a("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(a("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(a("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(r("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(r("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(r("uFirstId"),e).YO(h,1);else if(Y(s))this.ZR.TR(r("uColor"),s.getColor());else if(tt(s)){if(!this.gG)return!1;this.ZR.BO(h,this.gG,s)}else if(st(s)){if(!this.pG)return!1;this.ZR.LO(h,this.pG,s)}else if(H(s)){const t=fg(s,this,void 0);if(!t&&s.lut.percentageValues)return!1;this.ZR.JO(h,s.lut,t)}return this.ZR.dO(this.xG),!0}))}const n=1===t?this.JN:this.fG;if(n&&this.yG&&this.mG){const s=this.yG,r=this.mG;this.ZR.aE(n).wV(n,((n,o,h,a)=>{if(this.ZR.zO(h,s,this.At._i(),void 0).uO(r).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(n("uScale"),this._E.IV()).kV(n("uDisp"),this._E.PV()).kV(a("uScaleStart_highpart"),this._E.iN()).kV(a("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(a("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(a("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(a("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(a("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(n("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(n("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(n("uFirstId"),e).YO(h,1);else if(Y(i))this.ZR.TR(n("uColor"),i.getColor());else if(tt(i)){if(!this.ON)return!1;this.ZR.BO(h,this.ON,i)}else if(st(i)){if(!this.NN)return!1;this.ZR.LO(h,this.NN,i)}else if(H(i)){const t=fg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.ZR.JO(h,i.lut,t)}return this.ZR.dO(this.vG),!0}))}return{idCount:1}}TN(t,e,i,s,r){return{}}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}Qb(t){this.Al()>0&&this.Ls();const[e,i]=this.nl(),s=e.length>2&&e[1].x0&&this.Ls();const[e,i]=this.nl(),s=e.length;if(0===s)return;const r=this.Rl?1:0,n=s-(this.El?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.bG;s+=1){const r=i-s*Math.PI/this.bG;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.GV.Oz.get(e);return i||(i=new Wy(t,e),t.GV.Oz.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),Ky={TG:(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.nO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.nO(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.nO(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.nO(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.nO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.nO(i,1),h.enableVertexAttribArray(i)}},FG:(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.nO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.nO(r,1),h.enableVertexAttribArray(r)},IG:(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.nO(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.nO(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.nO(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.nO(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.nO(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.nO(i,1),h.enableVertexAttribArray(i)}},PG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.nO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.nO(r,1),h.enableVertexAttribArray(r)},QL:(t,e,i,s,r,n,o)=>{const h=t._N(),{uniform:a,uniformOptional:l}=i,u=1/t.Qn.qn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.FV(a("uThicknessPixels"),c).FV(l("uAALimit"),1-(c-1)/c).kV(a("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.aE(i,s).Jy(o)}},$y={TG:(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)}},FG:(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)},IG:(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)}},DG:(t,e)=>{const i=t._N();i.Jy(i.gl.LINE_STRIP,e,0)},BG:(t,e)=>{const i=t._N();i.Jy(i.gl.LINES,2*e,0)}};class Qy extends fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.Ka=Ne,this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,strokeFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},strokeFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t}}),this.bN=t,this.MN=e,this.ZR=t._N(),this.LG=this.ZR.SO}Ls(){const t=this.fa(),e=this.gu,i=this.PN.lineStyleSolid(t),s=this.PN.lineStyleDashed(t),r=i||s,n=this.PN.strokeFillSolid(t),o=this.PN.strokeFillLinearGradient(t),h=this.PN.strokeFillRadialGradient(t),a=this.PN.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Ii(),d=this.Ti(),f=this.No.C(),g=this.No.u,m=e.N();if(s&&this.At instanceof zi)return wt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this._E.BV(this.At),this.Su&&(this.EG=this.ZR.MV(Jt([c,d],this.At._i()),!1,this.EG),this.Ka=y(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ca()&&r&&l&&m>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.zG=t?{type:"triangulated",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),this.LG?Ug.AliasedEdge:void 0,s&&Ug.StippleTextureInstanced),mousePickingShader:f?this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),s&&Ug.StippleTextureInstanced):void 0,geometry:jy(this.ZR,m),thickness:m,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.jN=Sy($r(this.Ka,{x:this.Cl(),y:this.kl()},this.At),this.At,h.getPosition(),h.getExtent(),h.getShape(),this.ZR.lV()):o?this.ZN=vy($r(this.Ka,{x:this.Cl(),y:this.kl()},this.At),this.At,o.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),s){if(t||this.Su){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.VG=this.ZR.MV(t,!1,this.VG)}this.OG=this.ZR.XO(s.getPattern())}else this.VG&&(this.ZR.LV(this.VG),this.VG=void 0),this.OG=void 0;return this.vu(e),this.Su=!1,this.No.u=!1,this}QL(t,e){var i,s;const r=this.EG;if(!r)return{};const n=this.zG;if(!n)return{};const{fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l,lineStyleDashed:u,thickness:c}=n,d=1===t?null===(i=this.zG)||void 0===i?void 0:i.mousePickingShader:null===(s=this.zG)||void 0===s?void 0:s.shader;return d?(this.ZR.aE(d).wV(d,((i,s,d,f)=>{if(this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(f("uScaleStart_highpart"),this._E.iN()).kV(f("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(f("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(f("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(f("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(f("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(i("uFirstId"),e).YO(d,1);else if(o)this.ZR.TR(i("uColor"),o.getColor());else if(a){if(!this.jN)return!1;this.ZR.BO(d,this.jN,a)}else if(h){if(!this.ZN)return!1;this.ZR.LO(d,this.ZN,h)}else if(l){const t=fg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ZR.JO(d,l.lut,t)}if(u){if(!this.VG||!this.OG)return!1;Ky.FG(this.ZR,d,this.VG,s("aLengthSoFarA"),s("aLengthSoFarB"),2,0),this.ZR.kV(i("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(f("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(i("uStippleScale"),u.getPatternScale()).TV(i("uStippleTexture"),this.OG.jO,1)}return Ky.TG(this.At._i(),this.ZR,r,d,this.At._i()?4:2,0),Ky.QL(this.bN,n.geometry,d,this.LG&&1!==t,1===t,c,1),!0})),{idCount:1}):{}}TN(t,e,i,s,r){return{}}dispose(){return super.dispose(),this.zG=void 0,this.EG&&(this.ZR.LV(this.EG),this.EG=void 0),this.VG&&(this.ZR.LV(this.VG),this.VG=void 0),this.OG=void 0,this}KR(){return this}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return Te(this.gu)}kl(){return Te(this.gu)}}class qy extends gn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.NG=[],this.GG=!1,this.WG=!1,this.UG=!1,this.YG=!1,this._E=new Fy,this.Ka=Ne,this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,lineFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},lineFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},lineFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},lineIndividualPointFill:()=>{const t=this.gu.getFillStyle();return X(t)&&t}}),this.bN=t,this.MN=e,this.ZR=t._N(),this.LG=this.ZR.SO,this.HG=t.Qn.so}Hr(){const t={ps:e=>this.$G(t,e),us:e=>this.XG(t,e),Yg:(e,i)=>this.jG(t,e,i),TR:e=>this.ZG(t,e),Pi:{x:0,y:0},Fi:{x:0,y:0},Yo:0,QG:void 0,JG:this.NG.length};return this.NG.push(t),t}Ot(){var t;return this.NG.length=0,this.GG=!0,this.Ts&&this.En&&(null===(t=this.ls.Rn)||void 0===t?void 0:t.entity)===this&&this.En(this,void 0,this.ls.Rn.collectionMember),this}KG(){return this.NG.length}C(t){const e=this.NG[t];return[e.Pi,e.Fi]}_m(){return this.NG}kd(t){var e;const i=this.NG.indexOf(t);i>=0&&(this.NG.splice(i,1),this.GG=!0,this.Ts&&this.En&&(null===(e=this.ls.Rn)||void 0===e?void 0:e.entity)===this&&this.En(this,void 0,this.ls.Rn.collectionMember))}$G(t,e){if(e&&!this.NG.includes(t))t.JG=this.NG.length,this.NG.push(t);else if(!e){const e=this.NG.indexOf(t);this.NG.splice(e,1)}return this.UG=!0,t}XG(t,e){return t.Yo=e,this.WG=!0,t}jG(t,e,i){return t.Pi=e,t.Fi=i,this.GG=!0,t}ZG(t,e){return t.QG=e,this.YG=!0,t}Ls(){const t=this.No.C(),e=this.No.u,i=this.fa(),s=this.gu,r=this.NG,n=this.WG,o=this.GG,h=this.UG,a=this.YG,l=this.PN.lineStyleSolid(i),u=this.PN.lineStyleDashed(i),c=l||u,d=this.PN.lineFillSolid(i),f=this.PN.lineIndividualPointFill(i),g=this.PN.lineFillRadialGradient(i),y=this.PN.lineFillLinearGradient(i),m=d||f||y||g,p=s.N(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.At instanceof zi)return wt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this._E.BV(this.At);const A=o||h;if(A){const t=[];for(let e=0;e0&&e;this.zG=i?"triangulated"===x?{type:"triangulated",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG,ensureMinimumSegmentLength:void 0!==this.xu}),this.LG?Ug.AliasedEdge:void 0,u&&Ug.StippleTextureInstanced,Ug.AttributeHighlight),mousePicking:t?{shader:this.ZR.Mz(Ug["2D"],Ug.MousePicking({useAttribute:!0}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG,ensureMinimumSegmentLength:void 0!==this.xu}),u&&Ug.StippleTextureInstanced,Ug.AttributeHighlight)}:void 0,geometry:jy(this.ZR,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:{type:"primitive",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG}),Ug.AttributeHighlight),mousePicking:t?{shader:this.ZR.Mz(Ug["2D"],Ug.MousePicking({useAttribute:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG}),Ug.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:void 0}if(u){if(i||A){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.Yo,e+=1})),this.qG=this.ZR.MV(t,!0,this.qG)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.QG||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.tW=this.ZR.MV(t,!1,this.tW)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.QG||f.color;for(let i=e;i{t[e+0]=i.JG||0,e+=1})),this.iW=this.ZR.MV(t,!0,this.iW)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(y("uScaleStart_highpart"),this._E.iN()).kV(y("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(y("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(y("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(y("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(y("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.HG&&this.ZR.kV(y("uViewportSizePx"),[this.ls.oi().x*this.ZR.lV(),this.ls.oi().y*this.ZR.lV()]),void 0!==this.xu&&this.ZR.kV(i("uMinSegmentPixelVector"),[this.xu.x,this.xu.y]),this.ZR.TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.ZR.QV(i("uFirstId"),e),!n)return!1;"triangulated"===h?this.ZR.CV(n,1,{location:f("aPickingIdOffset"),size:1}):this.ZR.lO(f("aPickingIdOffset"),n)}else if(a)this.ZR.TR(i("uColor"),a.getColor());else if(l){if(!this.tW)return!1;this.ZR.CV(this.tW,"triangulated"===h?1:void 0,{location:f("aColor"),size:4})}else if(c){if(!this.ON)return!1;this.ZR.BO(g,this.ON,c)}else if(u){if(!this.NN)return!1;this.ZR.LO(g,this.NN,u)}if(d){if(!this.VG||!this.OG)return!1;Ky.PG(this.ZR,g,this.VG,f("aLengthSoFarA"),f("aLengthSoFarB"),2,0),this.ZR.kV(i("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(y("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(i("uStippleScale"),d.getPatternScale()).TV(i("uStippleTexture"),this.OG.jO,0)}if("triangulated"===h){const{geometry:e,thickness:i}=o;Ky.IG(this.At._i(),this.ZR,s,g,this.At._i()?4:2,0),this.ZR.CV(r,1,{location:f("aIsHighlighted"),size:1}),Ky.QL(this.bN,e,g,this.LG&&1!==t,1===t,i,this.NG.length)}else $y.IG(this.At._i(),this.ZR,s,g,this.At._i()?4:2,0),this.ZR.lO(f("aIsHighlighted"),r),$y.BG(this.bN,this.NG.length);return!0})),{idCount:this.NG.length}):{}}dispose(){return super.dispose(),this.zG=void 0,this.EG&&(this.ZR.LV(this.EG),this.EG=void 0),this.VG&&(this.ZR.LV(this.VG),this.VG=void 0),this.qG&&(this.ZR.LV(this.qG),this.qG=void 0),this.iW&&(this.ZR.LV(this.iW),this.iW=void 0),this.tW&&(this.ZR.LV(this.tW),this.tW=void 0),this.OG=void 0,this}TN(t,e,i,s,r){return{collectionMember:this.NG.find((i=>e+i.JG===t))}}KR(){return this}us(t){super.us(t);for(const e of this.NG)e.us(t);return this}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return Te(this.gu)}kl(){return Te(this.gu)}}class Jy{constructor(t,e){this.sW=!1,this.eW=!1,this.hW=!1,this.At=t,this.rW=e,this.rW.Qo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.sW="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.sW="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.eW=!0),!0===t.regularProgressiveStep&&(this.hW=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.sW?t[0].x:t[0].y,end:"x"===this.sW?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.sW?"x"===this.sW?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.nW=!0)}))}uW(t,e=!1){if(this.nW||!this.sW||"linear"!==this.lW.type)return!1;!1===e&&this.cW&&(clearTimeout(this.cW),this.cW=void 0);const i="x"===this.sW?this.lW.scale.x.ag:this.lW.scale.y.ag;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.sW?r.x:r.y,"x"===this.sW?n.x:n.y,s),h=this.lW.scale,a=Math.abs("x"===this.sW?h.Wi().x:h.Wi().y),l=a/o,u=Math.floor(l*tm),c=u*o,d=wt.performance.now(),f=!(d-i.ph<500)&&(i.lh?d-i.gh<1e3:d-i.uh<2e3||i.fh),g=s>2*this.oW.totalDataPointsAtTime;if(f&&!g)return this.cW=setTimeout((()=>this.dW(t)),1e3),!1;const y=u>=10,m=this.oW.enabled?this.oW.columnWidthAxis/a<1.5:void 0,p=this.oW.enabled&&u>this.oW.dataPointsPerColumn?u/this.oW.dataPointsPerColumn>=2:void 0;let x;!0===this.oW.enabled?m?p&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=y?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:y&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const A=!1===e;return x?(A&&(this.oW=x),!0):(A&&(this.oW={...this.oW,totalDataPointsAtTime:s}),!1)}fW(){this.AW=void 0,this.aW.length=0,this.cW&&(clearTimeout(this.cW),this.cW=void 0)}gW(t){if(0===t.length)return t;if(this.nW||!this.sW||"linear"!==this.lW.type||!this.oW.enabled)return t;let e;e=this.aW.length>0?he(this.aW,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.AW,h=-1,a=-1,l=0,u=0;if("x"!==this.sW||this.eW)if("x"===this.sW&&this.eW){const t=this.oW.columnWidthAxis;let c=this.AW?this.AW.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.AW=s[c-1]),s}pW(t){if(this.sW&&"linear"===this.lW.type){const e="x"===this.sW?this.lW.scale.x.ag:this.lW.scale.y.ag;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.hh===Os.progressive||e.hh===Os.regressive){const e=Math.abs("x"===this.sW?this.lW.scale.x.getInnerInterval():this.lW.scale.y.getInnerInterval());if(this.oW.enabled)return 2*e/this.oW.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.sW?s.x:s.y,"x"===this.sW?r.x:r.y,i)}}}yW(t,e,i){if(!this.sW)return e;const s=i.length;let r=Gr(i,t.min,this.sW,this.eW,0,s-1);void 0===r&&(r=this.eW?s-1:0);let n=Gr(i,t.max,this.sW,this.eW,0,s-1);return void 0===n&&(n=this.eW?0:s-1),1+Math.abs(n-r)}mW(){this.cW&&(clearTimeout(this.cW),this.cW=void 0)}dW(t){this.uW(t,!0)&&this.xs()}}class im extends Jy{renderVisibleOnly(t,e){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);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xn||t.boundaries.max.yl||e(t)}))}}class sm{constructor(t,e,i){this.vW=e,this.SW=i,this.xW=t,this.bW=[]}MW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.xW[this.xW.length-1];do{const t=this.xW.length;let r;h||(h=this._W(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.SW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.xW[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.xW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.wW()}kW(t){const e=t,i=this.xW.indexOf(e);i>=0&&this.xW.splice(i,1),e.droppedTimestamp=wt.performance.now(),this.bW.push(e)}TW(){this.xW.slice().forEach((t=>this.kW(t)))}FW(){this.xW.forEach((t=>this.vW(t))),this.bW.forEach((t=>this.vW(t))),this.xW.length=0,this.bW.length=0}_W(t,e){const i=2*t/3,s=4*t/3,r=this.bW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.bW[r];return this.bW.splice(r,1),this.xW.push(t),t}}wW(){if(this.bW.length>5){const t=wt.performance.now();for(let e=0;e=1e4)&&(this.vW(i),this.bW.splice(e,1),e-=1)}}}}class rm extends Jy{IW(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.PW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.DW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.BW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}PW(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}BW(t,e,i,s,r,n){if(void 0===e||!this.sW)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.sW?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.sW?a.boundaries.max.x2))break;o+=1}return o}DW(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.sW){if(this.eW?"x"===this.sW?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.sW?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}LW(t,e){const i=t.reduce(((t,e)=>ei(t,e.boundaries)),Ne);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.sW||this.eW?"x"===this.sW&&this.eW?i.max.x=Math.min(i.max.x,t):"y"!==this.sW||this.eW?"y"===this.sW&&this.eW&&(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 nm extends yn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this._E=new Fy,this.LM=[],this.RW=new im(this.At,this),this.EW=new em(this.At,this,(()=>this.ls.xs())),this.zW=new sm(this.LM,(t=>{t.coordsBuffer&&this.ZR.LV(t.coordsBuffer),t.VG&&this.ZR.LV(t.VG)}),!0),this.VW=new rm(this.At,this),this.OW=0,this.NW=0,this.GW=!1,this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,strokeFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},strokeFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t}}),this.MN=e,this.Qn=n,this.zG={type:"none"},this.ZR=t._N(),this.bN=t,this.LG=this.ZR.SO;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;sJt(e,t,Float32Array))(o,h);this.WW={individualLookupValuesEnabled:h,attributesPerVertex:c,attributeOffsetCoordinateLowPrecision:a,attributeOffsetCoordinateHighPrecision:l,attributeOffsetLookUpValue:u,prepareRenderData:(t,e)=>d(t,this.gu.getFillStyle())}}UW(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.No.C(),h=this.No.u,a=this.PN.lineStyleSolid(i),l=this.PN.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.PN.strokeFillSolid(i),f=this.PN.strokeFillLinearGradient(i),g=this.PN.strokeFillRadialGradient(i),y=this.PN.strokeFillPaletted(i),m=d||f||g||y,p=this.WW.individualLookupValuesEnabled;if(l&&this.At instanceof zi)return wt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.bu=he(this.bu,s,{canReturnB:!0}),this.qa+=r);let x=this.Mu.u;const A=this.VW.IW(this.LM,this.Mu.C());if(A>0){let t=0;for(let e=0;e{t.VG&&(this.ZR.LV(t.VG),t.VG=void 0)})),this.GW=!1),v&&(this.EW.fW(),this.LM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Ne,t.lastDataPoint=void 0})),this.zW.TW(),S=this.bu,this.OW=0,this.NW=0);const b=this.EW.gW(S),M=b.length;if(M>0){let t=this.EW.pW(this.bu)||(this.Qo("ApplicationType",(t=>"InternalUI"===t.type))?this.qa:1e5);M/t>10&&(t=M/10),this.zW.MW(b,t,((t,e,i,s)=>{const r=this.RW.calculateUserDataPointsBoundaries(e),n=this.EW.yW(r,i,this.bu)-s;return this.YW=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.ZR.qV(t*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),lastDataPoint:e[i-1],VG:this.GW?this.ZR.qV(2*t,this.UW(e,i,this.YW)):void 0}}),((t,e,i,s)=>{const r=ei(t.boundaries,this.RW.calculateUserDataPointsBoundaries(e)),n=this.EW.yW(r,t.existingCoordinatesCount+i,this.bu)-(t.jointPointsCount+s);this.ZR.tO(t.coordsBuffer,t.existingCoordinatesCount*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),this.GW&&t.VG&&this.ZR.tO(t.VG,2*t.existingCoordinatesCount,this.UW(e,i,this.YW)),this.YW=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ka=this.VW.LW(this.LM,this.Mu.C())),this._E.BV(this.At),g?this.jN=Sy(this.Uo||this.Ka,this.At,g.getPosition(),g.getExtent(),g.getShape(),this.ZR.lV()):f?this.ZN=vy(this.Uo||this.Ka,this.At,f.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),i||h){if(y&&"value"===y.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw wt.alert(t),new Error(t)}if(m&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:y?["lookup",y.getLookUpProperty(),y.lut]:"uniform";this.zG="primitive"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}),l&&Ug.StippleTexture),mousePickingShader:o?this.ZR.Mz(Ug["2D"],Ug.MousePicking({useVertexId:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}),l&&Ug.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:"triangulated"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),this.LG?Ug.AliasedEdge:void 0,l&&Ug.StippleTextureInstanced),mousePickingShader:o?this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),l&&Ug.StippleTextureInstanced):void 0,geometry:jy(this.ZR,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:{type:"none"}}else this.zG={type:"none"}}return this.OG=l?this.ZR.XO(l.getPattern()):void 0,this.vu(e),this.el=!1,this.tl=[],this.No.u=!1,this.Mu.u=!1,this}QL(t,e){const i=this.ZR.gl,s=this.zG;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.ZR.aE(r).wV(r,((r,u,c,d)=>{let f=!1;if(this.ZR.FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(r("uScale"),this._E.IV()).kV(r("uDisp"),this._E.PV()).kV(d("uScaleStart_highpart"),this._E.iN()).kV(d("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(d("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(d("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(d("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(d("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(r("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(r("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t);else if(o)this.ZR.TR(r("uColor"),o.getColor());else if(a){if(!this.jN)return!1;this.ZR.BO(c,this.jN,a)}else if(h){if(!this.ZN)return!1;this.ZR.LO(c,this.ZN,h)}else if(l){const t=fg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ZR.JO(c,l.lut,t)}const g=Ve(e);return this.RW.renderVisibleOnly(this.LM,(e=>{const{coordsBuffer:o}=e;if(!o)return;if(1===t){const[t,i]=g.Ut(e.existingDataPointsCount);this.ZR.QV(r("uFirstId"),t),"triangulated"===s.type?this.ZR.YO(c,i):this.ZR.WO(c,i)}i.bindBuffer(i.ARRAY_BUFFER,o);const h="triangulated"===s.type?Ky.TG:$y.TG;if(this.At._i()||void 0===this.WW.attributeOffsetCoordinateLowPrecision?this.At._i()&&void 0!==this.WW.attributeOffsetCoordinateHighPrecision&&h(!0,this.ZR,o,c,this.WW.attributesPerVertex,this.WW.attributeOffsetCoordinateHighPrecision):h(!1,this.ZR,o,c,this.WW.attributesPerVertex,this.WW.attributeOffsetCoordinateLowPrecision),n){if(!e.VG||!this.OG)return;"triangulated"===s.type?Ky.FG(this.ZR,c,e.VG,u("aLengthSoFarA"),u("aLengthSoFarB"),2,0):$y.FG(this.ZR,c,e.VG,u("aLengthSoFar"),2,0),this.ZR.kV(r("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(d("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(r("uStippleScale"),n.getPatternScale()).TV(r("uStippleTexture"),this.OG.jO,1)}if(l&&"value"===l.lookUpProperty&&void 0!==this.WW.attributeOffsetLookUpValue&&1!==t)if("triangulated"===s.type){const t=u("aLookupValueA");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(t,1),i.enableVertexAttribArray(t);const e=u("aLookupValueB");i.vertexAttribPointer(e,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.WW.attributeOffsetLookUpValue+this.WW.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(e,1),i.enableVertexAttribArray(e)}else{const t=u("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),i.enableVertexAttribArray(t)}if("triangulated"===s.type){const{thickness:i}=s;Ky.QL(this.bN,s.geometry,c,this.LG&&1!==t,1===t,i,e.existingCoordinatesCount-1)}else $y.DG(this.bN,e.existingCoordinatesCount);f=!0})),i.bindBuffer(i.ARRAY_BUFFER,null),f})),{idCount:this.qa}}TN(t,e,i,s,r){return{}}dl(t,e){return Array.isArray(t)||(t=[t]),this.tl=he(this.tl,t,{canReturnB:!0}),this.Ka=ei(this.Ka,e||e||this.RW.calculateUserDataPointsBoundaries(t)),this}Ot(){return super.Ot(),this.OW=0,this.NW=0,this.YW=void 0,this}dispose(){return super.dispose(),this.zW.FW(),this.EW.mW(),this.zG={type:"none"},this.OG=void 0,this}KR(){return this}Qb(t){this.Al()>0&&this.Ls();const e=this.nl(),i=Nr(e,t,this.Zo(),this.Rl,this.El,this.At,this.engine.At,this.Ka,this.RW.sW,this.RW.eW);return void 0!==i?e[i]:void 0}x_(t){this.Al()>0&&this.Ls();const e=this.nl(),i=e.length;if(0===i)return;const s=this.Rl?1:0,r=i-(this.El?2:1),n=this.Zo();if(n===zr.Nearest){let s,r,n=Be;for(let o=0;o1}Jy(t,e,i,s,r){return"object"==typeof s?e?this.ZR.lO(t.attribute("aOffsetScale"),e,1).kV(t.uniform("uSizePixels"),[s.width,s.height]):this.ZR.FV(t.uniform("uOffsetScale"),s.scale).kV(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.ZR.lO(t.attribute("aOffsetPixels"),e,1):this.ZR.FV(t.uniform("uOffsetPixels"),s):this.ZR.FV(t.uniform("uPointSize"),s),r?this.ZR.CV(this.OR,0,{location:t.attribute("aInstanceGeo"),size:2}).fO(this.kG,0,this.XW,i):this.ZR.Jy(this.ZR.gl.POINTS,i),this}Yz(){this.ZR.LV(this.OR)}}const hm=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new om(t,i,t.gl.TRIANGLE_FAN,e)},am=(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 om(t,s,t.gl.TRIANGLES,e)},lm=(t,i,s)=>{if(oo(t))return lm(e.PointShape.Square,i,s);let r=i.GV.Ez.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.GV.zz.get(n)||((t,e,i=0)=>{const s=function(t=25){return _y(u(0,0),0,360,.5,.5,t)[0]}(e);return new om(t,s,t.gl.TRIANGLE_FAN,i)})(i,n),i.GV.zz.set(n,r),r):(r=i.GV.Vz.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 om(t,s,t.gl.TRIANGLE_STRIP,i)})(i,n),i.GV.Vz.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 om(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=hm(i);break;case e.PointShape.Plus:r=am(i);break;case e.PointShape.Cross:r=am(i,45);break;case e.PointShape.Diamond:r=hm(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 om(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new om(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 om(t,s,t.gl.TRIANGLES,e)})(i);break;default:return we(0,"LightningChart JS unidentified point shape")}i.GV.Ez.set(t,r)}return r};class um extends nn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.FN=y(c(ze,ze),c(Be,Be)),this.PN=dg({pointStyleSolid:()=>Y(this.we)&&this.we,pointStyleRadialGradient:()=>tt(this.we)&&this.we,pointStyleLinearGradient:()=>st(this.we)&&this.we,pointStylePaletted:()=>H(this.we)&&this.we,pointStyleIndividual:()=>X(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N()}Ls(){var t;const e=this.No.C(),i=this.No.u,s=this.tl,r=s.length,n=r>0,o=this.ja.C(),h=this.we,a=this.size.C(),l=this.ja.u||this.ba.u,u=this.At.Ni(),c=this.size.u||this.ja.u,d=this.el||s&&s.length>0,f=u||c,g=this.aa(),y=this.PN.pointStyleSolid(g),m=this.PN.pointStyleRadialGradient(g),p=this.PN.pointStyleLinearGradient(g),x=this.PN.pointStylePaletted(g),A=this.PN.pointStyleIndividual(g),S=y||m||p||x||A;if(n&&(this.Xa=he(this.Xa,s,{canReturnB:!0}),this.qa+=r),n||this.el){this.Ka=this.sl?ei(this.Ka,this.sl):ei(this.Ka,Je(this.Xa));const t=Jt(this.Xa,this.At._i());this.QW=this.qa,this.JW=this.ZR.MV(t,!1,this.JW)}this._E.BV(this.At),h!==B?f&&(this.KW&&(this.KW=void 0),a>1||this.Za.C()?a<=1&&!this.Za.C()?this.kG=this.ZR.gl.POINTS:(this.KW=lm(o,this.ZR,this.Za.C()?25:a),this.kG=this.KW.kG):this.kG=this.ZR.gl.POINTS):this.KW&&(this.KW=void 0);const v=(null===(t=this.KW)||void 0===t?void 0:t.jW)||0,b=this.ba.C()+v;if(c||g||i||l){const t=this.Za.C()?"attribute":"uniform",i=a<=1&&Ug.PointSize(t),s=Ug.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.Qa.C()||b%360!=0)&&{dataType:this.Qa.C()?"attribute":"uniform"}}:void 0,axisWorldTranslation:cg(this.At),normalSource:void 0});this.kE=S?this.ZR.Mz(Ug["2D"],i,s,y?Ug.Color({dataType:"uniform"}):A?Ug.Color({dataType:"attribute"}):x?Ug.Color({dataType:["lookup",x.getLookUpProperty(),x.lut]}):m?Ug.Color({dataType:["gradient",m]}):p?Ug.Color({dataType:["gradient",p]}):void 0):void 0,this.JN=e&&S?this.ZR.Mz(Ug["2D"],i,s,Ug.MousePicking()):void 0}if(d||g){const t=this.Xa.length;if(X(h)&&this.QW&&this.QW>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=xi(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.hl={min:e,max:t}}return this.la=h,this.ja.u=!1,this.size.u=!1,this.ba.u=!1,this.No.u=!1,this.el=!1,this}QL(t,e){const i=1===t?this.JN:this.kE,s=this.JW,r=this.QW,n=this.qa;return i&&s&&r&&(this.ZR.aE(i),this.ZR.wV(i,((i,o,h,a)=>{var l;if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(a("uScaleStart_highpart"),this._E.iN()).kV(a("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(a("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(a("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(a("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(a("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.ZR.zO(h,s,this.At._i(),this.KW?1:void 0).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).FV(a("uDevicePixelRatio"),this.ZR.lV()),this.KW){const t=o("aInstanceGeo");this.ZR.hO(t,this.KW.OR).nO(t,0)}if(1===t)this.ZR.QV(i("uFirstId"),e).YO(h,n);else if(Y(this.we))this.ZR.TR(i("uColor"),this.we.getColor());else if(X(this.we)&&this.qW){const t=o("aColor");this.ZR.aO(t,this.qW),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}else if(H(this.we)){if("value"===this.we.getLookUpProperty()&&this.sU){const t=o("aLookupValue");this.ZR.lO(t,this.sU),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}const t=fg(this.we,this,this.hl);if(!t&&this.we.lut.percentageValues)return!1;this.ZR.JO(h,this.we.lut,t)}else if(tt(this.we)){if(!this.ON)return!1;this.ZR.BO(h,this.ON,this.we)}else if(st(this.we)){if(!this.NN)return!1;this.ZR.LO(h,this.NN,this.we)}if(this.tU&&this.kG!==this.ZR.gl.POINTS){const t=o("aOffsetPixels");this.ZR.lO(t,this.tU),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}else if(this.kG!==this.ZR.gl.POINTS){const t=i("uOffsetPixels");this.ZR.FV(t,this.size.C())}const u=((null===(l=this.KW)||void 0===l?void 0:l.jW)||0)+this.ba.C();if(this.iU&&this.kG!==this.ZR.gl.POINTS){const t=o("aRot");this.ZR.hO(t,this.iU),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}else if(this.kG!==this.ZR.gl.POINTS&&u%360!=0){const t=xi(u),e=Math.sin(t),s=Math.cos(t);this.ZR.kV(i("uRot"),[e,s])}if(this.kG===this.ZR.gl.POINTS)this.ZR.FV(i("uPointSize"),this.size.C());else{const t={x:2/this.ls.oi().x,y:2/this.ls.oi().y};this.ZR.kV(i("uRatioPxClip"),[t.x,t.y])}let c=!1;return this.kG===this.ZR.gl.POINTS?(this.ZR.Jy(this.kG,r),c=!0):this.KW&&(this.ZR.fO(this.kG,0,this.KW.XW,r),c=!0),c}))),{idCount:n}}TN(t,e,i,s,r){return{}}Jc(t){this.Al()>0&&this.Ls();const e=this.nl(),i=Nr(e,t,this.Zo(),!1,!1,this.At,this.ls.At,this.Ka,void 0,void 0);return void 0!==i?e[i]:void 0}Ie(t){return super.Ie(t)}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return this.Za.C()?25:this.size.C()}kl(){return this.Za.C()?25:this.size.C()}KR(){return this.JW&&(this.ZR.LV(this.JW),this.JW=void 0),this.KW&&(this.KW=void 0),this.qW&&(this.ZR.LV(this.qW),this.qW=void 0),this.iU&&(this.ZR.LV(this.iU),this.iU=void 0),this.sU&&(this.ZR.LV(this.sU),this.sU=void 0),this}}class cm extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.zG={fill:void 0,border:void 0},this._E=new Fy,this.Ka=Ne,this.eU=!1,this.hU=!1,this.rU=!1,this.nU=!1,this.oU=!1,this.wd=[],this.PN=dg({polygonStyleSolid:()=>Y(this.we)&&this.we,polygonStyleImage:()=>Jn(this.we)&&this.we,polygonStyleRadialGradient:()=>tt(this.we)&&this.we,polygonStyleLinearGradient:()=>st(this.we)&&this.we,polygonStylePaletted:()=>H(this.we)&&this.we,polygonStyleIndividual:()=>X(this.we)&&this.we,lineStyleSolid:()=>ts(this.Ce)&&this.Ce,lineStyleFilled:()=>{const t=this.Ce&&this.Ce.getFillStyle();return Y(t)&&t}}),this.bN=t,this.MN=e,this.ZR=t._N(),this.LG=this.ZR.SO}Hr(){const t={ps:e=>this.$G(t,e),us:e=>this.XG(t,e),_l:e=>this.aU(t,e),rb:e=>this.lU(t,e),TR:e=>this.ZG(t,e),Xa:[],M:void 0,uU:void 0,Yo:0,cU:!0,dU:this.wd.length};return this.wd.push(t),t}Ot(){var t;return this.wd.length=0,this.eU=!0,this.Ts&&this.En&&(null===(t=this.ls.Rn)||void 0===t?void 0:t.entity)===this&&this.En(this,void 0,this.ls.Rn.collectionMember),this}_m(){return this.wd}kd(t){var e;const i=this.wd.indexOf(t);i>=0&&(this.wd.splice(i,1),this.oU=!0,this.Ts&&this.En&&(null===(e=this.ls.Rn)||void 0===e?void 0:e.entity)===this&&this.ls.Rn.collectionMember===t&&this.En(this,void 0,this.ls.Rn.collectionMember))}$G(t,e){var i;return t.cU=e,this.oU=!0,this.Ts&&this.En&&(null===(i=this.ls.Rn)||void 0===i?void 0:i.entity)===this&&this.ls.Rn.collectionMember===t&&!t.cU&&this.En(this,void 0,this.ls.Rn.collectionMember),t}XG(t,e){return t.Yo=e,this.nU=!0,t}aU(t,e){return t.Xa=e,this.eU=!0,t}lU(t,e){return t.M=e,this.hU=!0,t}ZG(t,e){return t.uU=null==e?void 0:e.toUint32(),this.rU=!0,t}Ls(){const t=this.No.C(),e=this.No.u,i=this.aa(),s=this.nU,r=this.eU,n=this.hU,o=this.rU,a=this.oU,l=this.Ce,u=this.fa(),c=this.wd.filter((t=>t.cU&&t.Xa.length>0));if(this._E.BV(this.At),(r||a)&&(this.Ka=ei(...c.map((t=>Je(t.Xa))))),r||a){const t=c.map((t=>[...t.Xa,t.Xa[0],{x:Number.NaN,y:Number.NaN}])).flat(),e=Jt(t,!1,Float64Array),i=this.At._i()?Jt(t,!0):e;this.EG=this.ZR.MV(i,!1,this.EG);let s=[];c.reduce(((t,i)=>{const r=t,n=2*(i.Xa.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.Xa.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Xa.length+2;for(let r=i;rt+e.Xa.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Xa.length+2;for(let r=i;rt+e.Xa.length+2),0),e=new Float32Array(t);let i=0;const s={min:Be,max:ze};c.forEach((t=>{const r=void 0!==t.M?t.M:-34028234663852886e22,n=t.Xa.length+2;for(let t=i;tt+e.Xa.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():E.toUint32();c.forEach((t=>{const r=void 0!==t.uU?t.uU:s,n=t.Xa.length+2;for(let t=i;tthis.bU(t,e,i,c))),this.nU=!1,this.oU=!1,this.eU=!1,this.hU=!1,this.rU=!1,this.No.u=!1,this.da(this.we),this.pa(l),this}QL(t,e){var i,s;const{fill:r,border:n}=this.zG,o=this.EG,h=this.pU,a=this.yU;if(!o||!h)return{};if(r){const{fillStyleSolid:s,fillStyleLinearGradient:n,fillStyleRadialGradient:l,fillStylePaletted:u,fillStyleImage:c,fillStyleIndividual:d}=r,f=this.fU,g=this.AU,y=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;y&&o&&f&&void 0!==g&&this.ZR.aE(y).wV(y,((i,r,y,m)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(m("uScaleStart_highpart"),this._E.iN()).kV(m("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(m("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(m("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(m("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(m("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.ZR.zO(y,o,this.At._i(),void 0).uO(f).lO(r("aIsHighlighted"),h).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.ZR.QV(i("uFirstId"),e),!a)return!1;this.ZR.lO(r("aPickingIdOffset"),a)}else if(s)this.ZR.TR(i("uColor"),s.getColor());else if(l){if(!this.ON)return!1;this.ZR.BO(y,this.ON,l)}else if(n){if(!this.NN)return!1;this.ZR.LO(y,this.NN,n)}else if(u){const t=fg(u,this,this.mU);if(!t&&u.lut.percentageValues)return!1;if(this.ZR.JO(y,u.lut,t),"value"===u.getLookUpProperty()){if(!this.vU)return!1;this.ZR.lO(r("aLookupValue"),this.vU)}}else if(c){if(!this.xU)return!1;this.ZR.TR(m("uColor"),c.getSurroundingColor()).TV(i("uColorTexture"),this.xU.texture.rV()||this.xU.sourceMissingTexture,0).CV(this.xU.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).JV(c.fitMode)}else if(d){if(!this.SU)return!1;const t=r("aColor");this.ZR.gl.bindBuffer(this.ZR.gl.ARRAY_BUFFER,this.SU),this.ZR.gl.vertexAttribPointer(t,4,this.ZR.gl.UNSIGNED_BYTE,!0,0,0),this.ZR.gl.enableVertexAttribArray(t)}return this.ZR.dO(g,void 0,void 0,this.ZR.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:i,fillStyleSolid:r,thickness:l}=n,u=this.gU,c=1===t?null===(s=n.mousePicking)||void 0===s?void 0:s.shader:n.shader;c&&o&&u&&this.ZR.aE(c).wV(c,((s,n,c,d)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(s("uScale"),this._E.IV()).kV(s("uDisp"),this._E.PV()).kV(d("uScaleStart_highpart"),this._E.iN()).kV(d("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(d("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(d("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(d("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(d("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(s("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(s("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.ZR.CV(h,1,{location:n("aIsHighlighted"),size:1}).TR(s("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0),1===t){if(this.ZR.QV(s("uFirstId"),e),!a)return!1;this.ZR.lO(n("aPickingIdOffset"),a,1)}else r&&this.ZR.TR(s("uColor"),r.getColor());return Ky.TG(this.At._i(),this.ZR,o,c,this.At._i()?4:2,0),Ky.QL(this.bN,i,c,this.LG&&1!==t,1===t,l,u),!0}))}return{idCount:this.wd.length}}bU(t,e,i,s){const r=ct({x:this.Ka.min.x,y:this.Ka.min.y},this.At,this.ls.At),n=ct({x:this.Ka.max.x,y:this.Ka.max.y},this.At,this.ls.At),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Cy(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.Xa.length+2),0),f=new Float32Array(2*d),g=this.Ka.max.x-this.Ka.min.x,y=this.Ka.max.y-this.Ka.min.y,m=l-u,p=c-a;let x=0;for(const t of s){for(const e of t.Xa){const t=u+m*((e.x-this.Ka.min.x)/g),i=a+p*((e.y-this.Ka.min.y)/y);f[x]=t,f[x+1]=i,x+=2}const e=u+m*((t.Xa[0].x-this.Ka.min.x)/g),i=a+p*((t.Xa[0].y-this.Ka.min.y)/y);f[x]=e,f[x+1]=i,x+=2,f[x]=Number.NaN,f[x+1]=Number.NaN,x+=2}return f}TN(t,e,i,s,r){return{collectionMember:this.wd.find((i=>e+i.dU===t))}}KR(){return this.fU&&(this.ZR.LV(this.fU),this.fU=void 0),this.EG&&(this.ZR.LV(this.EG),this.EG=void 0),this.pU&&(this.ZR.LV(this.pU),this.pU=void 0),this.yU&&(this.ZR.LV(this.yU),this.yU=void 0),this.vU&&(this.ZR.LV(this.vU),this.vU=void 0),this.SU&&(this.ZR.LV(this.SU),this.SU=void 0),this.zG={fill:void 0,border:void 0},this.xU=this.ZR.qO(this,this.xU),this}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return Te(this.Ce)}kl(){return Te(this.Ce)}}class dm extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.MU=Ne,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleRadialGradient:()=>tt(this.we)&&this.we,fillStyleLinearGradient:()=>st(this.we)&&this.we,fillStyleImage:()=>Jn(this.we)&&this.we,strokeStyleSolid:()=>ts(this.Ce)&&this.Ce,strokeFillSolid:()=>{const t=this.Ce.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.Ce.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.Ce.getFillStyle();return tt(t)&&t}}),this.bU=(t,e,i)=>{const s=ct(this.za(),this.At,this.ls.At),r=ci(ct(ui(this.za(),this.oi()),this.At,this.ls.At),s);return Cy(t,e,r.x,r.y,i)},this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e}Ls(){super.Ls();const t=this.No.C(),e=this.aa(),i=this.ma.u||this.Z.u||this.ba.u||this._a.u,s=this.Ce,r=this.fa(),n=s.getThickness(),o=this.ba.C();this._E.BV(this.At);const h=this.At.Ni();if(i){const t=this.Z.C();this.Xa=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]=ri(n[0],r,t),n[1]=ri(n[1],r,t),n[2]=ri(n[2],r,t),n[3]=ri(n[3],r,t)}return n}(this.ma.C(),t.x,t.y,o,this._a.C());const e=Jt(this.Xa,this.At._i());this.RN=this.ZR.MV(e,!1,this.RN),this.zN=this.Xa.length,this.MU=Je(this.Xa)}const a=this.PN.fillStyleSolid(e),l=this.PN.fillStyleRadialGradient(e),c=this.PN.fillStyleLinearGradient(e),d=this.PN.fillStyleImage(e),f=a||l||c||d;e&&(this.GN=f?this.ZR.Mz(Ug["2D"],a&&Ug.Color({dataType:"uniform"}),c&&Ug.Color({dataType:["gradient",c]}),l&&Ug.Color({dataType:["gradient",l]}),d&&Ug.Color({dataType:["image",d]}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),l?this.ON=Sy(this.Uo||this.MU,this.At,l.getPosition(),l.getExtent(),l.getShape(),this.ZR.lV()):c?this.NN=vy(this.Uo||this.MU,this.At,c.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0),this.xU=this.ZR.KO(this,this.xU,d,void 0,h||i,this.bU);const g=this.PN.strokeStyleSolid(r),y=this.PN.strokeFillSolid(r),m=this.PN.strokeFillLinearGradient(r),p=this.PN.strokeFillRadialGradient(r),x=g,A=y||m||p;if(x&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.WN,this._U]=[this.Xa,void 0];else{const t=this.At;[this.WN,this._U]=t instanceof zi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Ui(s,r,h,-h),i.Ui(r,s,-h,-h),i.Ui(o,n,-h,-h),i.Ui(n,o,h,-h),i.Ui(s,r,-h,h),i.Ui(r,s,h,h),i.Ui(o,n,h,h),i.Ui(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.Xa,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=oi(ni(r,s)),l=oi(ni(o,s)),c=gi(a),d=gi(l);return[[ui(s,ui(li(c,h.x),li(d,h.y))),ui(r,ui(li(a,h.x),li(d,h.y))),ui(o,ui(li(c,h.x),li(l,h.y))),ui(n,ui(li(a,h.x),li(l,h.y))),ui(s,ui(li(a,h.x),li(l,h.y))),ui(r,ui(li(c,h.x),li(l,h.y))),ui(o,ui(li(a,h.x),li(d,h.y))),ui(n,ui(li(c,h.x),li(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.Xa,t.Wi(),n)}this.YN=this.ZR.MV(Jt(this.WN,this.At._i()),!1,this.YN),this._U?(this.wG=this.ZR.sO(new Uint16Array(this._U),this.wG),this.UN=this._U.length):(this.wG&&this.ZR.LV(this.wG),this.wG=void 0,this.UN=this.WN.length)}return r&&(this.QN=x&&A?this.ZR.Mz(Ug["2D"],Ug.Color({dataType:p?["gradient",p]:m?["gradient",m]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),p?this.jN=Sy(this.MU,this.At,p.getPosition(),p.getExtent(),p.getShape(),this.ZR.lV()):m?this.ZN=vy(this.MU,this.At,m.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),this.JN=t&&f?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.KN=t&&this.Ce!==nt?this.KN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.da(this.we),this.pa(s),this.ma.u=!1,this.ba.u=!1,this.Z.u=!1,this._a.u=!1,this}QL(t,e){const i=1===t?this.JN:this.GN,s=this.RN,r=this.zN,n=this.PN.fillStyleSolid(!1),o=this.PN.fillStyleRadialGradient(!1),h=this.PN.fillStyleLinearGradient(!1),a=this.PN.fillStyleImage(!1);i&&s&&r&&this.we!==B&&(this.ZR.aE(i),this.ZR.wV(i,((i,l,u,c)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(c("uScaleStart_highpart"),this._E.iN()).kV(c("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(c("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(c("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(c("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(c("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(i("uFirstId"),e).YO(u,1);else if(n)this.ZR.TR(i("uColor"),n.getColor());else if(o){if(!this.ON)return!1;this.ZR.BO(u,this.ON,o)}else if(h){if(!this.NN)return!1;this.ZR.LO(u,this.NN,h)}else if(a){if(!this.xU)return!1;const t=this.xU&&this.xU.texture.rV();this.ZR.TR(c("uColor"),a.getSurroundingColor()).TV(i("uColorTexture"),t||this.xU.sourceMissingTexture,0).CV(this.xU.texCoordsBuffer,void 0,{location:l("aTextureCoord"),size:2}).JV(a.fitMode)}return this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).zO(u,s,this.At._i(),void 0).Jy(this.ZR.gl.TRIANGLE_FAN,r),!0})));const l=1===t?this.KN:this.QN,u=this.PN.strokeStyleSolid(!1),c=this.PN.strokeFillSolid(!1),d=this.PN.strokeFillLinearGradient(!1),f=this.PN.strokeFillRadialGradient(!1),g=this.YN;return l&&g&&u&&(this.ZR.aE(l),this.ZR.wV(l,((i,s,r,n)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(n("uScaleStart_highpart"),this._E.iN()).kV(n("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(n("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(n("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(n("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(n("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(i("uFirstId"),e).YO(r,1);else if(c)this.ZR.TR(i("uColor"),c.getColor());else if(f){if(!this.jN)return!1;this.ZR.BO(r,this.jN,f)}else if(d){if(!this.ZN)return!1;this.ZR.LO(r,this.ZN,d)}return this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).zO(r,g,this.At._i(),void 0),this.wG?this.ZR.uO(this.wG).dO(this.UN):this.ZR.Jy(this.ZR.gl.LINE_LOOP,this.UN),!0}))),{idCount:1}}TN(t,e,i,s,r){return{}}KR(){return this.wG&&(this.ZR.LV(this.wG),this.wG=void 0),this.RN&&(this.ZR.LV(this.RN),this.RN=void 0),this.YN&&(this.ZR.LV(this.YN),this.YN=void 0),this.xU=this.ZR.qO(this,this.xU),this.GN=void 0,this.QN=void 0,this.JN=void 0,this.KN=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)}Cl(){return Te(this.Ce)}kl(){return Te(this.Ce)}}class fm extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we,fillStyleRadialGradient:()=>tt(this.we)&&this.we,fillStyleLinearGradient:()=>st(this.we)&&this.we,fillStyleImage:()=>Jn(this.we)&&this.we,strokeLineStyleSolid:()=>ts(this.Ce)&&this.Ce,strokeLineSolidFill:()=>{const t=this.Ce.getFillStyle();return Y(t)&&t},strokeLinearGradientFill:()=>{const t=this.Ce.getFillStyle();return st(t)&&t},strokeRadialGradientFill:()=>{const t=this.Ce.getFillStyle();return tt(t)&&t}}),this.bU=(t,e,i)=>{const s=ct({x:this.Ka.min.x,y:this.Ka.min.y},this.At,this.ls.At),r=ct({x:this.Ka.max.x,y:this.Ka.max.y},this.At,this.ls.At),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Cy(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Xa.length),d=this.Ka.max.x-this.Ka.min.x,f=this.Ka.max.y-this.Ka.min.y,g=a-l,y=u-h;let m=0;for(const t of this.Xa){const e=l+g*((t.x-this.Ka.min.x)/d),i=h+y*((t.y-this.Ka.min.y)/f);c[m]=e,c[m+1]=i,m+=2}return c},this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e}Jc(t){let e,i=Number.MAX_VALUE;for(const s of this.Xa){const r=Ke(ct(s,this.At,this.ls.At),t);r=3,r=this.Ce,n=this.fa(),o=r.getThickness(),a=this.ga(o);this._E.BV(this.At),this.ST=this.At.Wi();const l=this.At.Ni();if(i&&(this.Ka=Je(this.Xa)),i&&s){const t=Jt(this.Xa,this.At._i());this.RN=this.ZR.MV(t,!1,this.RN),this.wU=new Uint16Array(h.default(t)),this.CU=this.ZR.sO(this.wU,this.CU),this.zN=this.wU.length}const u=this.PN.fillStyleSolid(e),c=this.PN.fillStylePaletted(e),d=this.PN.fillStyleRadialGradient(e),f=this.PN.fillStyleLinearGradient(e),g=this.PN.fillStyleImage(e),y=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.GN=y?this.ZR.Mz(Ug["2D"],u&&Ug.Color({dataType:"uniform"}),f&&Ug.Color({dataType:["gradient",f]}),d&&Ug.Color({dataType:["gradient",d]}),c&&Ug.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&Ug.Color({dataType:["image",g]}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),d?this.ON=Sy(this.Uo||this.Ka,this.At,d.getPosition(),d.getExtent(),d.getShape(),this.ZR.lV()):f?this.NN=vy(this.Uo||this.Ka,this.At,f.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0),this.xU=this.ZR.KO(this,this.xU,g,void 0,l||i,this.bU),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Xa:By(this.Xa,this.ST,o);this.WN=Jt(t,this.At._i()),this.YN=this.ZR.MV(this.WN,!0,this.YN),this.UN=t.length}const m=this.PN.strokeLineStyleSolid(n),p=this.PN.strokeLineSolidFill(n),x=this.PN.strokeLinearGradientFill(n),A=this.PN.strokeRadialGradientFill(n),S=m,v=p||x||A;return n&&(this.QN=S&&v?this.ZR.Mz(Ug["2D"],Ug.Color({dataType:A?["gradient",A]:x?["gradient",x]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),A?this.jN=Sy(this.Uo||this.Ka,this.At,A.getPosition(),A.getExtent(),A.getShape(),this.ZR.lV()):x?this.ZN=vy(this.Uo||this.Ka,this.At,x.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),this.JN=t&&y?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.KN=t&&this.Ce!==nt?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.Ml=!1,this.da(this.we),this.pa(r),this}QL(t,e){const i=1===t?this.JN:this.GN,s=this.RN,r=this.zN,n=this.PN.fillStyleSolid(!1),o=this.PN.fillStyleRadialGradient(!1),h=this.PN.fillStyleLinearGradient(!1),a=this.PN.fillStylePaletted(!1),l=this.PN.fillStyleImage(!1);i&&s&&r&&this.ZR.aE(i).wV(i,((i,r,u,c)=>{if(this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(c("uScaleStart_highpart"),this._E.iN()).kV(c("uScaleStart_lowpart"),this._E.sN()).zO(u,s,this.At._i(),void 0).uO(this.CU).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t)this.ZR.QV(i("uFirstId"),e).YO(u,1);else if(n)this.ZR.TR(i("uColor"),n.getColor());else if(o){if(!this.ON)return!1;this.ZR.BO(u,this.ON,o)}else if(h){if(!this.NN)return!1;this.ZR.LO(u,this.NN,h)}else if(a){const t=fg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ZR.JO(u,a.lut,t)}else if(l){if(!this.xU)return!1;this.ZR.TR(c("uColor"),l.getSurroundingColor()).TV(i("uColorTexture"),this.xU.texture.rV()||this.xU.sourceMissingTexture,0).CV(this.xU.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).JV(l.fitMode)}return this.ZR.dO(this.zN),!0}));const u=1===t?this.KN:this.QN,c=this.Ce,d=this.YN,f=this.UN;return u&&d&&f&&this.ZR.aE(u).wV(u,((i,s,r,n)=>{this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).zO(r,d,this.At._i(),void 0);const o=c.getFillStyle();if(1===t)this.ZR.QV(i("uFirstId"),e).YO(r,1);else if(Y(o))this.ZR.TR(i("uColor"),o.getColor());else if(tt(o)){if(!this.jN)return!1;this.ZR.BO(r,this.jN,o)}else if(st(o)){if(!this.ZN)return!1;this.ZR.LO(r,this.ZN,o)}const h=c.getThickness(),a=-1===h||1===h;return this.ZR.Jy(a?this.ZR.gl.LINE_LOOP:this.ZR.gl.TRIANGLE_STRIP,this.UN),!0})),{idCount:1}}TN(t,e,i,s,r){return{}}KR(){return this.CU&&(this.ZR.LV(this.CU),this.CU=void 0),this.RN&&(this.ZR.LV(this.RN),this.RN=void 0),this.YN&&(this.ZR.LV(this.YN),this.YN=void 0),this.GN=void 0,this.QN=void 0,this.JN=void 0,this.KN=void 0,this.xU=this.ZR.qO(this,this.xU),this}}const gm=(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},mm=(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(!Ge(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const c=(d=a,f=h,y(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},m={primary:1+c.max.x-c.min.x,secondary:1+c.max.y-c.min.y};let p=!1;const x=[{x:g.primary,y:g.secondary},{x:g.primary+m.primary,y:g.secondary},{x:g.primary+m.primary,y:g.secondary+m.secondary},{x:g.primary,y:g.secondary+m.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.IO(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.IO(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.IO(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Am=(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 Sm extends tn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.kU=p("bilinear"),this.Pi={x:0,y:0},this.mw={x:1,y:1},this.SS=Ir.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Qn={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}kS(t){return this.kU._(t),this}TS(){return this.kU.C()}_S(t,e){return this.Pi=t,this.mw=e,this}wS(){return{start:this.Pi,step:this.mw,end:{x:this.Pi.x+this.mw.x*this.Qn.columns,y:this.Pi.y+this.mw.y*this.Qn.rows}}}xS(t){return this.SS="function"==typeof t?t(this.SS):t,this}CS(){return this.SS}}class vm extends Sm{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._E=new Fy,this.zG={},this.TU=[],this.FU=!1,this.el=!1,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we,wireframeStyleLine:()=>ts(this.SS)&&this.SS,wireframeStyleFill:()=>{const t=this.SS&&this.SS.getFillStyle();return Y(t)&&t}}),this.IU=gm,this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e;const o=Math.min(this.ZR.JR,void 0!==n.PU?n.PU:2048),h={x:Math.min(o,this.Qn.primaryDimensionVectorsCount),y:Math.min(o,this.Qn.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.Qn,h,this.IU),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.DU={gridTiles:l,gridTileSizes:u},this._S(this.Pi,this.mw)}Ls(){const t=this.TU,e=this.we,i=this.aa(),s=this.SS,r=s!==this.BU,n=this.PN.fillStylePaletted(i),o=this.PN.fillStyleSolid(i),h=this.kU.u,a=this.kU.C(),l=this.el,u=this.No.C();this.LU=this.LU||this.RU();const c=this.LU,d=mm(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Am(this.ZR,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.FU=!0),this._E.BV(this.At);const f=this.zG;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.ZR.Mz(Ug["2D"],Ug.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.Qn.dataOrder,intensityTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),flipXY:"rows"===this.Qn.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:"uniform"}),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),flipXY:"rows"===this.Qn.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.PN.wireframeStyleLine(r),e=this.PN.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:"uniform"}),Ug.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Qn.dataOrder,axisWorldTranslation:cg(this.At),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:"uniform"}),Ug.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Qn.dataOrder,axisWorldTranslation:cg(this.At),normalSource:void 0})),geometry:jy(this.ZR,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.EU=this.EU||this.zU():this.EU&&(this.ZR.LV(this.EU.wireframeCoordinatesBuffer),this.EU=void 0)}if(f.mousePicking=u?this.zG.mousePicking||{shader:this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),flipXY:"rows"===this.Qn.dataOrder,normalSource:void 0}))}:void 0,this.zG=f,void 0===this.hl&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Be,e=ze;this.LU.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.hl={min:t,max:e}}return this.el=!1,this.TU.length=0,this.da(e),this.BU=s,this.kU.u=!1,this}RU(){const t=this.DU.gridTiles.map((t=>{const e=xm(this.ZR,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.DU.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.ZR.MV([0,0,1,0,0,1,1,1]),s=this.ZR.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}zU(){const t=this.Qn.primaryDimensionVectorsCount+1+this.Qn.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.Qn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstVector.primary,y:this.Pi.y+this.mw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstVector.secondary,y:this.Pi.y+this.mw.y*t.iFirstVector.primary},i="columns"===this.Qn.dataOrder?{x:this.mw.x*t.sizeHeatmapDataVectors.primary,y:this.mw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.mw.x*t.sizeHeatmapDataVectors.secondary,y:this.mw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Qn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.mw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.mw.y*t.iFirstUniqueVector.primary},n="columns"===this.Qn.dataOrder?{x:this.mw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.mw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.mw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.mw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.VU={boundaries:s,tilesInfo:r},this}QL(t,e){var i,s;const r=this.LU,n=this.VU,o=1===t?null===(i=this.zG.mousePicking)||void 0===i?void 0:i.shader:null===(s=this.zG.tile)||void 0===s?void 0:s.shader;if(this.zG.tile&&o&&r&&n){const i=o,s=this.zG.tile,h={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.mw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.mw.y)},a={x:h.x/this.Qn.columns,y:h.y/this.Qn.rows},l=this.At.Wi(),u={x:a.x/l.x,y:a.y/l.y};if("solid"===s.renderMode||1===t)this.ZR.aE(i).wV(i,((i,n,o)=>{if(1===t)this.ZR.QV(i("uFirstId"),e).YO(o,1);else if("solid"===s.renderMode){const{fillStyleSolid:t}=s;this.ZR.TR(i("uColor"),t.getColor())}return this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).CV(r.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).kV(i("uScaling"),[this.mw.x*this.Qn.columns,this.mw.y*this.Qn.rows]).kV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Jy(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),!0}));else if("paletted"===s.renderMode){const{fillStylePaletted:e}=s,o=this.hl;this.ZR.wV(i,((s,h,a)=>{let l=!1;var c,d;return this.ZR.aE(i).kV(s("uScale"),this._E.IV()).kV(s("uDisp"),this._E.PV()).JO(a,e.lut,o).CV(r.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).FV(s("uIsHighlighted"),this.Yo).TR(s("uHighlightColorOffset"),2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0),c=t=>{this.ZR.kV(s("uTileDimensions"),["columns"===this.Qn.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Qn.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.ZR.lV();if("bilinear"===this.kU.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.ZR.$V(s("uTileBounds"),o).kV(s("uScaling"),[i.renderSizeAxis.x,i.renderSizeAxis.y]).kV(s("uTranslationAxis"),[i.startRenderLocationAxis.x,i.startRenderLocationAxis.y]).TV(s("uTileIntensityValues"),t.intensityDataTexture,1).Jy(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),l=!0},r.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),l}))}}const h=this.EU,a=this.zG.wireframe,l=1===t||null==a?void 0:a.shader;if(h&&a&&l&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.ZR.aE(l).wV(l,((i,s,r)=>((this.At instanceof Bi||this.At instanceof Bc)&&this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()),this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).TR(i("uColor"),e.getColor()).CV(h.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).kV(i("uScaling"),[this.mw.x,this.mw.y]).kV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Jy(this.ZR.gl.LINES,2*h.wireframeSegmentsLength),!0)))}else if(h&&a&&l&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.ZR.aE(l).wV(l,((r,n,o)=>((this.At instanceof Bi||this.At instanceof Bc)&&this.ZR.kV(r("uScale"),this._E.IV()).kV(r("uDisp"),this._E.PV()),this.ZR.FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0).TR(r("uColor"),s.getColor()).FV(r("uThicknessPixels"),i.getThickness()).kV(r("uRatioPxClip"),[2/this.ls.oi().x,2/this.ls.oi().y]).CV(h.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).kV(r("uScaling"),[this.mw.x,this.mw.y]).kV(r("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.aE(o,!1).Jy(h.wireframeSegmentsLength),!0)))}return{idCount:1}}TN(t,e,i,s,r){return{}}FS(t){return this.TU.push(t),pm(this.DU.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.hl=void 0,this}Ot(){return this.FU&&(this.DU.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.el=!0,this.FU=!1,this.hl=void 0),this}dispose(){super.dispose();const t=this.LU;t&&(t.gridTiles.forEach((t=>{this.ZR.qR(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.ZR.LV(t.rectangleLocationsBuffer)),this.LU=void 0;const e=this.EU;return e&&this.ZR.LV(e.wireframeCoordinatesBuffer),this.EU=void 0,this.zG={},this}KR(){return this.dispose(),this}Jc(t){const e=t,i="columns"===this.Qn.dataOrder?e.x:e.y,s="columns"===this.Qn.dataOrder?e.y:e.x,r="columns"===this.Qn.dataOrder?this.Pi.x:this.Pi.y,n="columns"===this.Qn.dataOrder?this.Pi.y:this.Pi.x;let o=(i-r)/("columns"===this.Qn.dataOrder?this.mw.x:this.mw.y),h=(s-n)/("columns"===this.Qn.dataOrder?this.mw.y:this.mw.x);o=Math.floor(Ft(o,0,this.Qn.primaryDimensionVectorsCount-1)),h=Math.floor(Ft(h,0,this.Qn.secondaryDimensionVectorsCount-1));const a=this.OU(o,h),l="columns"===this.Qn.dataOrder?{x:this.Pi.x+(o+.5)*this.mw.x,y:this.Pi.y+(h+.5)*this.mw.y}:{x:this.Pi.x+(h+.5)*this.mw.x,y:this.Pi.y+(o+.5)*this.mw.y},u="columns"===this.Qn.dataOrder?o:h,c="columns"===this.Qn.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}Hb(t){const e=this.VU;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.Qn.dataOrder?i.x:i.y,r="columns"===this.Qn.dataOrder?i.y:i.x,n="columns"===this.Qn.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.Qn.dataOrder?this.Pi.y:this.Pi.x,h="columns"===this.Qn.dataOrder?this.mw.x:this.mw.y,a="columns"===this.Qn.dataOrder?this.mw.y:this.mw.x,l=Ft((s-n)/h-.5,0,this.Qn.primaryDimensionVectorsCount-1),u=Ft((r-o)/a-.5,0,this.Qn.secondaryDimensionVectorsCount-1),c=Ft(Math.ceil(l)-1,0,this.Qn.primaryDimensionVectorsCount-1),d=Ft(Math.ceil(u)-1,0,this.Qn.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.OU(c,d)},g={point:{x:c,y:d+1},value:this.OU(c,d+1)},y={point:{x:c+1,y:d},value:this.OU(c+1,d)},m={point:{x:c+1,y:d+1},value:this.OU(c+1,d+1)},p=Nn({x:l,y:u},f,g,y,m);if(void 0===p)return;const x=Ft(Math.floor(l+.5),0,this.Qn.primaryDimensionVectorsCount-1),A=Ft(Math.floor(u+.5),0,this.Qn.secondaryDimensionVectorsCount-1),S="columns"===this.Qn.dataOrder?x:A,v="columns"===this.Qn.dataOrder?A:x,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}OU(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.VU)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.min.x)||0}bt(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.max.y)||0}xt(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.min.y)||0}Cl(){return 0}kl(){return 0}n_(){const t=[];return this.DU.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.mw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.VW=new rm(this.At,this));const t=this.VW.IW(this.LM,this.Mu.C());if(t>0){for(let e=0;e0?this.LM[0].boundaries.min.x:Be:this.Ka.min.y=this.LM.length>0?this.LM[0].boundaries.min.y:Be}this.LM.forEach((t=>t.shape.Ls()));const e=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Pt(null===(i=e.shape.hl)||void 0===i?void 0:i.min,Be)),t.max=Math.max(t.max,Pt(null===(s=e.shape.hl)||void 0===s?void 0:s.max,ze)),t}),{min:Be,max:ze});return this.LM.forEach((t=>{t.shape.hl=e})),this.Mu.u=!1,this}QL(t,e){let i=0;return this.LM.forEach((s=>{const{idCount:r}=s.shape.QL(t,e+i);void 0!==r&&(i+=r)})),{idCount:i}}TN(t,e,i,s,r){return{}}LS(t){if(0===t.length)return this;let e=0;const i=this.GU.dataPerSegment,s=t.length;do{let r=this.LM[this.LM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Qn.scrollDimension?i:this.Qn.resolution,rows:"rows"===this.Qn.scrollDimension?i:this.Qn.resolution,heatmapDataType:this.Qn.heatmapDataType,dataOrder:this.Qn.scrollDimension};let e="columns"===this.Qn.scrollDimension?{x:this.Pi.x+this.mw.x*this.NU,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.mw.y*this.NU};this.LM.length>0&&(e="columns"===this.Qn.scrollDimension?{x:e.x-1*this.mw.x,y:e.y}:{x:e.x,y:e.y-1*this.mw.y},o=!0);const s=new vm(this.bN,this.MN,this.At,kt,[],t).kS(this.kU.C()).Ie(this.we).xS(this.SS)._S(e,this.mw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.NU,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.xt()},max:{x:s.St(),y:s.bt()}}},this.LM.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.Qn.resolution};o&&(u.values.unshift(this.WU),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.FS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.WU=l[l.length-1],this.NU+=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.FS(c)}));const n=this.NU-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().KR()})),this.LM.length=0,this.Ka="columns"===this.Qn.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.Qn.resolution*this.mw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.Qn.resolution*this.mw.x,y:this.Pi.y}),this.NU=0,this.WU=void 0,this}_S(t,e){return super._S(t,e),this.LM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape._S(r,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.xt()},max:{x:i.shape.St(),y:i.shape.bt()}}})),this.LM.length>0?this.Ka=ei(...this.LM.map((t=>t.boundaries))):this.Ka="columns"===this.Qn.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.Qn.resolution*this.mw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.Qn.resolution*this.mw.x,y:this.Pi.y}),this}Ie(t){return super.Ie(t),this.LM.forEach((t=>t.shape.Ie(this.we))),this}xS(t){return super.xS(t),this.LM.forEach((t=>t.shape.xS(this.SS))),this}kS(t){return super.kS(t),this.LM.forEach((e=>e.shape.kS(t))),this}dispose(){return super.dispose(),this.LM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.LM.forEach((e=>e.shape.setVisible(t))),this}KR(){return this.LM.forEach((t=>t.shape.KR())),this}Jc(t){const e=ct(t,this.At,this.engine.At),i=this.LM.reduce(((i,s)=>{const r=s.shape.Jc(t);if(r){const t=$e(ct(r,this.At,this.engine.At),e);if(void 0===i||t=this.NU||"rows"===this.Qn.scrollDimension&&e>=this.NU)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}Hb(t){const e=ct(t,this.At,this.engine.At),i=this.LM.reduce(((i,s)=>{const r=s.shape.Hb(t);if(r){const t=$e(ct(r,this.At,this.engine.At),e);if(void 0===i||t=this.NU||"rows"===this.Qn.scrollDimension&&e>=this.NU)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}us(t){return super.us(t),this.LM.forEach((e=>e.shape.us(t))),this}}class wm extends tn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.kU=p("bilinear"),this.SS=Ir.lineStyle,this.Qn=n}kS(t){return this.kU._(t),this}TS(){return this.kU.C()}xS(t){return this.SS="function"==typeof t?t(this.SS):t,this}CS(){return this.SS}}class Cm extends wm{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._E=new Fy,this.zG={},this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e,this.h_=new vm(this.bN,t.UU,t.At,kt,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",PU:this.ZR.JR}).xS(nt);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.YU={vertexBuffer:this.ZR.MV(h),drawMode:this.ZR.gl.TRIANGLE_FAN,drawLength:362}}Ls(){const t=this.aa(),e=this.we,i=this.PN.fillStyleSolid(t),s=this.PN.fillStylePaletted(t),r=i||s,n=this.kU.C(),o=this.kU.u,h=this.No.C(),a=this.No.u;return this._E.BV(this.At),this.h_.Ls(),this.h_.LU?((t||o)&&(this.zG.fill=r?{shader:this.ZR.Mz(Ug["2D"],Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),normalSource:void 0}),s&&Ug.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.Qn.dataOrder,lut:s.lut}),i&&Ug.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.zG.mousePicking=h?{shader:this.ZR.Mz(Ug["2D"],Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),normalSource:void 0}),Ug.MousePicking())}:void 0),this.da(e),this.kU.u=!1,this.No.u=!1,this):this}QL(t,e){var i;const{vertexBuffer:s,drawLength:r,drawMode:n}=this.YU,o=this.h_.LU;if(!this.zG.fill||!o)return{};const{fillStylePaletted:h,fillStyleSolid:a}=this.zG.fill,l=1===t?null===(i=this.zG.mousePicking)||void 0===i?void 0:i.shader:this.zG.fill.shader;if(!l)return{};const u=this.At.Cb(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this.Qn.amplitudeStart,this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep),g=Math.max(this.Qn.amplitudeStart,this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep);let y;return y=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.ZR.aE(l).wV(l,((i,l,u,c)=>{if(this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).kV(c("uViewportSize"),[this.bN.oi().x*this.ZR.lV()/(1===t?this.ls.Qn.qn:1),this.bN.oi().y*this.ZR.lV()/(1===t?this.ls.Qn.qn:1)]).kV(i("uScaling"),[y,y]).kV(i("uTranslationAxis"),[0,0]).CV(s,void 0,{location:l("aPos"),size:2}).FV(c("uAngleOffset"),this.At.Pb()%(2*Math.PI)).FV(c("uAngleDirection"),this.At.Eb()?1:-1).FV(c("uSectors"),this.Qn.sectors).FV(c("uAnnuli"),this.Qn.annuli),1===t)this.ZR.QV(i("uFirstId"),e).YO(u,1);else{if(this.ZR.FV(i("uAmplitudeStart"),this.Qn.amplitudeStart).FV(i("uAmplitudeStep"),this.Qn.amplitudeStep).FV(i("uAmplitudeAxisStart"),this.At.Cb().start).FV(i("uAmplitudeAxisEnd"),this.At.Cb().end),h){const t=this.h_.hl;this.ZR.JO(u,h.lut,t).TV(i("uTileIntensityValues"),o.gridTiles[0].intensityDataTexture,0)}a&&this.ZR.TR(i("uColor"),a.getColor())}return this.ZR.Jy(n,r),!0})),{idCount:1}}TN(t,e,i,s,r){return{}}FS(t){return this.h_.FS(t),this}Ot(){return this.h_.Ot(),this}dispose(){return super.dispose(),this.h_.dispose(),this.zG={},this.ZR.LV(this.YU.vertexBuffer),this}KR(){return this.dispose(),this}Ie(t){return super.Ie(t),this.h_.Ie(this.we),this}Jc(t){const e=this.Qn.amplitudeStart,i=this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;let n=Math.round((t.angle-0)/360*this.Qn.sectors);n>=this.Qn.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.Qn.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.OU(o,n),angle:n*(360/this.Qn.sectors),amplitude:e+o*(i-e)/(this.Qn.annuli-1)}}Hb(t){const e=this.Qn.amplitudeStart,i=this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;const n=(t.angle-0)/360*this.Qn.sectors,o=(t.amplitude-e)/(i-e)*(this.Qn.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.OU(a,h)},u={point:{x:a,y:h+1},value:this.OU(a,h+1)},c={point:{x:a+1,y:h},value:this.OU(a+1,h)},d={point:{x:a+1,y:h+1},value:this.OU(a+1,h+1)},f=Nn({x:o,y:n},l,u,c,d);return void 0!==f?{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}OU(t,e){const i="annuli"===this.Qn.dataOrder?t:e,s="annuli"===this.Qn.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}Cl(){return 0}kl(){return 0}}class Tm extends by{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.MG();this._G=t.MV(e),this.CG=s,this.kG=i}aE(t){return this.ZR.CV(this._G,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Jy(t,e,i){return this.ZR.fO(void 0!==e?e:this.kG,i||0,this.CG,t),this}MG(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.ZR.gl.TRIANGLES,drawSize:6}}Yz(){this.ZR.LV(this._G)}}const Rm=t=>{let e=t.GV.Nz.get(void 0);return e||(e=new Tm(t),t.GV.Nz.set(void 0,e),e)};class Em extends dn{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.HU=Ir.fillStyle,this.$U=Ir.fillStyle,this.XU=p(e.PointShape.Circle),this.jU=p(5),this.ZU=p(0),this.QU=p(void 0),this.EC=!0,this.JU={x:0,y:0}}yd(t){return this.HU=Qr(this.HU,t),this}VC(){return this.HU}KU(){return qr(this.qU,this.HU)}tY(){return qr(this.iY,this.$U)}pd(t){return this.$U=Qr(this.$U,t),Jn(this.$U)&&(this.vd(e.PointShape.Square),this._d(1)),this}Md(){return this.$U}vd(t){return this.XU._(t),oo(this.XU.C())&&this._d(1),this}Sd(){return this.XU.C()}_d(t){return this.jU._(t),this}OC(){return this.jU.C()}xd(t){return this.ZU._(t),this}bd(){return this.ZU.C()}NC(t){return this.JU=t,this}GC(){return this.JU}RC(t){return this.QU._(t),this}WC(){return this.QU.C()}}class km extends Jy{constructor(t,e){super(t,e),this.nW=!1,this.oW={enabled:!1,totalDataPointsAtTime:0},this.lW=t instanceof Bi?{type:"linear",scale:t}:{type:"unknown"},this.rW.Qo("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.nW=!0)}))}sY(t,e){var i,s;const r=null==t?void 0:t.Pc,n=null==t?void 0:t.Dc,o=null==t?void 0:t.Ac,h=null==t?void 0:t.fc;if(!t||this.nW||!this.sW||"linear"!==this.lW.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.Ic())||void 0===i?void 0:i.x,l=null===(s=t.Zc())||void 0===s?void 0:s.x;if(o<2||void 0===a||void 0===l||l===a)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,a,o),c=this.lW.scale,d=Math.abs("x"===this.sW?c.Wi().x:c.Wi().y),f=d/u,g=Math.floor(.8*f),y=g*u,m=g>=4,p=this.oW.enabled?this.oW.columnWidthAxis/d<1.5:void 0,x=this.oW.enabled&&g>this.oW.dataPointsPerColumn?g/this.oW.dataPointsPerColumn>=2:void 0;let A;return!0===this.oW.enabled?p?x&&(A={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}):A=m?{enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:m&&(A={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.oW=A||{...this.oW,totalDataPointsAtTime:o},!!A&&this.fW(),{cpStateChanged:!!A,cpActive:this.oW.enabled}}eY(t,e){var i,s,r;const n=t.Pc,o=t.Dc,h=t.gc,a=t.Ac,l=t.fc;if(this.nW||!this.oW.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.oW.columnWidthAxis,d=this.At.x.getInnerStart(),f=this.At.x.getInnerEnd(),g=co(d,f,n,h,a,l,e,1);if(!g)return;const y=n[g.iFirstSampleDataArray];if(this.hY){if(this.hY.iFirstPackedSample0)if(this.hY.packedColumnsCount-=t,this.hY.packedColumnsCount>0){this.hY.packedDataX.splice(0,2*t),this.hY.packedDataY.splice(0,2*t),this.hY.packedDataColors&&this.hY.packedDataColors.splice(0,2*t),this.hY.packedDataLookupValues&&this.hY.packedDataLookupValues.splice(0,2*t),this.hY.origin+=t*c;const e=fo(this.hY.origin,Math.max(h-1-u+1,0),h-1,(t=>n[uo(t,h,u)])),i=uo(e,h,u);this.hY.iFirstPackedSample=n[i]>=this.hY.origin?e:e+1}else this.hY=void 0}if(void 0!==(null===(i=this.hY)||void 0===i?void 0:i.iLastPackedSample)&&this.hY.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.hY.origin+this.hY.packedColumnsCount*c-t)/c),this.hY.packedColumnsCount);if(e>0)if(this.hY.packedColumnsCount-=e,this.hY.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.hY.packedDataX.pop(),this.hY.packedDataY.pop(),this.hY.packedDataColors&&this.hY.packedDataColors.pop(),this.hY.packedDataLookupValues&&this.hY.packedDataLookupValues.pop();const t=fo(this.hY.origin+this.hY.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[uo(t,h,u)])),i=uo(t,h,u);this.hY.iLastPackedSample=n[i]<=this.hY.origin+this.hY.packedColumnsCount*c?t:t-1}else this.hY=void 0}}const m=this.hY||{origin:y,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.Nc?[]:void 0,packedDataLookupValues:t.Oc?[]:void 0,packedDataSize:t.Gc?[]:void 0,packedDataRotation:t.Wc?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},p=(t,e,i)=>{let s=Math.min(t,t+e*c),r=Math.max(t,t+e*c),a=i;const l=[];let y=ze,p=ze,x=-1,A=Be,S=Be,v=-1,b=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const i=a%u,g=n[i],M=o[i];if(s<=g&&g<=r)b+=1,Number.isNaN(M)||(M>p&&(y=g,p=M,x=a),M0)y=y===ze?Number.NaN:y,p=p===ze?Number.NaN:p,A=A===Be?Number.NaN:A,S=S===Be?Number.NaN:S,x0?(m.packedDataX.push(y),m.packedDataY.push(p),m.packedDataX.push(A),m.packedDataY.push(S)):(m.packedDataX.unshift(A),m.packedDataY.unshift(S),m.packedDataX.unshift(y),m.packedDataY.unshift(p))):(l.push({iFirst:v,iSecond:x}),e>0?(m.packedDataX.push(A),m.packedDataY.push(S),m.packedDataX.push(y),m.packedDataY.push(p)):(m.packedDataX.unshift(y),m.packedDataY.unshift(p),m.packedDataX.unshift(A),m.packedDataY.unshift(S)));else{const t=e>0?m.iLastPackedSample:m.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(m.packedDataX.push(Number.NaN),m.packedDataY.push(Number.NaN),m.packedDataX.push(Number.NaN),m.packedDataY.push(Number.NaN)):(m.packedDataX.unshift(Number.NaN),m.packedDataY.unshift(Number.NaN),m.packedDataX.unshift(Number.NaN),m.packedDataY.unshift(Number.NaN));else{const i=uo(t,h,u),a=n[i],d=o[i],f=(s+r)/2,y=f-e*c/6,p=d+(y-a)/(g-a)*(M-d),x=f+e*c/6,A=d+(x-a)/(g-a)*(M-d);l.push({iFirst:t,iSecond:t}),e>0?(m.packedDataX.push(y),m.packedDataY.push(p),m.packedDataX.push(x),m.packedDataY.push(A)):(m.packedDataX.unshift(y),m.packedDataY.unshift(p),m.packedDataX.unshift(x),m.packedDataY.unshift(A))}}if(m.packedColumnsCount+=1,e>0?m.iLastPackedSample=a-1:(m.iFirstPackedSample=a+1,m.origin=s),s=Math.min(t+l.length*e*c,t+(l.length+1)*e*c),r=Math.max(t+l.length*e*c,t+(l.length+1)*e*c),b=0,y=ze,p=ze,x=-1,A=Be,S=Be,v=-1,sf)break}}return l},x=p(m.origin+m.packedColumnsCount*c,1,void 0!==(null===(s=this.hY)||void 0===s?void 0:s.iLastPackedSample)?this.hY.iLastPackedSample+1:g.iFirstSample),A=p(m.origin,-1,void 0!==(null===(r=this.hY)||void 0===r?void 0:r.iFirstPackedSample)?this.hY.iFirstPackedSample-1:g.iFirstSample),S=t.Nc&&m.packedDataColors?[t.Nc,m.packedDataColors]:void 0,v=t.Oc&&m.packedDataLookupValues?[t.Oc,m.packedDataLookupValues]:void 0,b=t.Gc&&m.packedDataSize?[t.Gc,m.packedDataSize]:void 0,M=t.Wc&&m.packedDataRotation?[t.Wc,m.packedDataRotation]:void 0;if(S||v||b||M){for(const t of x){const e=uo(t.iFirst,h,u),i=uo(t.iSecond,h,u);S&&S[1].push(S[0][e],S[0][i]),v&&v[1].push(v[0][e],v[0][i]),b&&b[1].push(b[0][e],b[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of A){const e=uo(t.iFirst,h,u),i=uo(t.iSecond,h,u);S&&S[1].unshift(S[0][i],S[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.hY=m.packedColumnsCount>0?m:void 0,{x:m.packedDataX,y:m.packedDataY,color:m.packedDataColors,lookup:m.packedDataLookupValues,size:m.packedDataSize,rotation:m.packedDataRotation}}fW(){this.hY=void 0}pW(t){if(this.sW&&"linear"===this.lW.type){const e="x"===this.sW?this.lW.scale.x.ag:this.lW.scale.y.ag;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.hh===Os.progressive||e.hh===Os.regressive){const e=Math.abs("x"===this.sW?this.lW.scale.x.getInnerInterval():this.lW.scale.y.getInnerInterval());if(this.oW.enabled)return 2*e/this.oW.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.sW?s.x:s.y,"x"===this.sW?r.x:r.y,i)}}}yW(t,e,i){if(!this.sW)return e;const s=i.length;let r=Gr(i,t.min,this.sW,this.eW,0,s-1);void 0===r&&(r=this.eW?s-1:0);let n=Gr(i,t.max,this.sW,this.eW,0,s-1);return void 0===n&&(n=this.eW?0:s-1),1+Math.abs(n-r)}mW(){}}class Im extends Em{constructor(t,e,i,s){super(t,e,i,s),this._E=new Fy,this.EW=new km(this.At,this),this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,strokeFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},strokeFillIndividual:()=>{const t=this.gu.getFillStyle();return X(t)&&t},strokeFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t},areaFillSolid:()=>Y(this.HU)&&this.HU,areaFillLinearGradient:()=>st(this.HU)&&this.HU,areaFillRadialGradient:()=>tt(this.HU)&&this.HU,areaFillIndividual:()=>X(this.HU)&&this.HU,areaFillPaletted:()=>H(this.HU)&&this.HU,markerFillSolid:()=>Y(this.$U)&&this.$U,markerFillLinearGradient:()=>st(this.$U)&&this.$U,markerFillRadialGradient:()=>tt(this.$U)&&this.$U,markerFillPaletted:()=>H(this.$U)&&this.$U,markerFillIndividual:()=>X(this.$U)&&this.$U,markerFillImage:()=>Jn(this.$U)&&this.$U,markerShapeIcon:()=>{const t=this.XU.C();return oo(t)&&t}}),this.Ad=p(void 0),this.rY=[],this.el=!1,this.nY=[],this.oY=void 0,this.xM={Ek:"x",zk:()=>this.aY()},this.bU=(t,e,i)=>{var s;const r=null===(s=this.lY)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.oi().x,o=r.oi().y),Cy(t,e,n*this.jU.C(),o*this.jU.C(),i)},this.MN=e,this.zG={type:"none"},this.ZR=t._N(),this.bN=t,this.LG=this.ZR.SO}gd(t){return this.Ad._(De(t,this.Ad.C(),(()=>[t.Kc(((e,i)=>{this.rY.push({min:e,max:i}),void 0===t.$c()&&this.uY&&this.nY.push({min:e,max:i})})),t.qc((()=>{this.el=!0,this.uY=void 0,this.oY=void 0,this.EW.fW()}))]))),this.oY=void 0,this}aY(){var t,i,s,r,n,o,h,a,l,c,d,f,g;const y=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt,m=this.Ad.u,p=null==y?void 0:y.Pc,x=null==y?void 0:y.Dc;if(!y||!p||!x)return;const A=y.Oc,S=y.Nc,v=y.Gc,b=y.Wc,M=y.gc,w=y.Ac,C=y.fc,T=m||this.fa()||this.KU()||this.tY(),R=this.PN.lineStyleSolid(T),E=this.PN.lineStyleDashed(T),k=R||E,I=k&&k.getThickness(),F=this.PN.strokeFillSolid(T),D=this.PN.strokeFillLinearGradient(T),P=this.PN.strokeFillRadialGradient(T),L=this.PN.strokeFillIndividual(T),V=this.PN.strokeFillPaletted(T),_=F||D||P||L||V,B=this.PN.areaFillSolid(T),z=this.PN.areaFillLinearGradient(T),N=this.PN.areaFillRadialGradient(T),O=this.PN.areaFillIndividual(T),U=this.PN.areaFillPaletted(T),Y=B||z||N||O||U,G=this.PN.markerFillSolid(T),X=this.PN.markerFillLinearGradient(T),Z=this.PN.markerFillRadialGradient(T),H=this.PN.markerFillPaletted(T),W=this.PN.markerFillIndividual(T),j=this.PN.markerFillImage(T),K=G||X||Z||H||W||j,$=this.XU.C(),Q=this.XU.u,q=this.PN.markerShapeIcon(Q),J=this.jU.C(),tt=this.jU.u,et=this.QU.u,it=this.rY.length>0||et,st=this.el,rt=st?[y.Xc()]:(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.rY),nt=this.At.x.Yt,ot=this.At.x.getInnerStart(),ht=this.At.x.getInnerEnd(),at=y.$c(),lt=!!E,ut=this.No.C(),ct=this.No.u,{cpStateChanged:dt,cpActive:ft}=this.EW.sY(y,this.EC);if(at&&ft&&(dt||st||it||nt||T)){const t=this.EW.eY(y,at);if(t){const e=!dt&&!st&&!T;this.cY=Fm(this.ZR,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,lt,this.cY,e,at,1e3,this.At._i(),(t=>qt(t,this.At._i()))),this.dY={min:Be,max:ze};const i=t.y.length;for(let e=0;ethis.gY.iLastSample||T){let i,s,r,n,h,a;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=p.subarray(e.offset,e.offset+e.count),s=x.subarray(e.offset,e.offset+e.count),r=S?S.subarray(e.offset,e.offset+e.count):void 0,n=A?A.subarray(e.offset,e.offset+e.count):void 0,h=v?v.subarray(e.offset,e.offset+e.count):void 0,a=b?b.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],o=t.dataRanges[1],l=e.count+o.count;i=new Float32Array(l),i.set(p.subarray(e.offset),0),i.set(p.subarray(o.offset,o.offset+o.count),e.count),s=new Float32Array(l),s.set(x.subarray(e.offset),0),s.set(x.subarray(o.offset,o.offset+o.count),e.count),S&&(r=new Uint32Array(l),r.set(S.subarray(e.offset),0),r.set(S.subarray(o.offset,o.offset+o.count),e.count)),A&&(n=new Float32Array(l),n.set(A.subarray(e.offset),0),n.set(A.subarray(o.offset,o.offset+o.count),e.count)),v&&(h=new Float32Array(l),h.set(v.subarray(e.offset),0),h.set(v.subarray(o.offset,o.offset+o.count),e.count)),b&&(a=new Float32Array(l),a.set(b.subarray(e.offset),0),a.set(b.subarray(o.offset,o.offset+o.count),e.count))}const l=!dt&&!st&&!T;this.AY=Fm(this.ZR,[i,s],r,n,h,a,lt,this.AY,l,at,1e3,this.At._i(),(t=>qt(t,this.At._i())));let c=i,d=s,f=r,g=n;const y=this.QU.C();if(y){const t="spline"===y.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:r,colors:n}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:r?Array.from(r):void 0,colors:n?Array.from(n):void 0};const o=((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=oi(ci({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]=ui(li(n,c),g[1]),g[2]=ci(g[2],li(o,d)),r[f]=g}}return r.length>0?r:[]})(i,s),h=o.length,a=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:r,lookupValues:n,colors:o}=t,h=[],a=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=r[0];h[t]=e,a[t]=i,t+=1;for(let n=1;nqt(t,this.At._i()))),this.gY=t}}else this.fY=void 0;if(!at&&(st||it||T)){if(!this.cY||this.cY.bufferSize{var s,r,n,o;const h=p.subarray(i.min,i.max+1),a=x.subarray(i.min,i.max+1);if(this.ZR.tO(t,i.min*(this.At._i()?2:1),qt(h,this.At._i())),this.ZR.tO(e,i.min*(this.At._i()?2:1),qt(a,this.At._i())),S&&(null===(s=this.cY)||void 0===s?void 0:s.bufferColors)){const t=S.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferColors,i.min,t,Uint32Array)}if(A&&(null===(r=this.cY)||void 0===r?void 0:r.bufferLookupValues)){const t=A.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferLookupValues,i.min,t,Float32Array)}if(b&&(null===(n=this.cY)||void 0===n?void 0:n.bufferRotations)){const t=b.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferRotations,i.min,t,Float32Array)}if(v&&(null===(o=this.cY)||void 0===o?void 0:o.bufferSizes)){const t=v.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferSizes,i.min,t,Float32Array)}})),this.cY.valueCount=y.Ac}this.AY=this.cY}if(T||tt||Q||ct){if(_&&k&&!1!==I){const t=-1===I?"primitive":"triangulated",e=V?["lookup",V.lookUpProperty,V.lut]:L?"attribute":D?["gradient",D]:P?["gradient",P]:"uniform";this.zG="primitive"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),E&&Ug.StippleTexture),lineStyleSolid:R,lineStyleDashed:E,fillStyleSolid:F,fillStyleLinearGradient:D,fillStyleRadialGradient:P,fillStyleIndividual:L,fillStylePaletted:V,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),E&&Ug.StippleTexture,Ug.MousePicking({useVertexId:!0}))}:"triangulated"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),this.LG?Ug.AliasedEdge:void 0,E&&Ug.StippleTextureInstanced),geometry:jy(this.ZR,I),thickness:I,lineStyleSolid:R,lineStyleDashed:E,fillStyleSolid:F,fillStyleLinearGradient:D,fillStyleRadialGradient:P,fillStyleIndividual:L,fillStylePaletted:V,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),E&&Ug.StippleTextureInstanced,Ug.MousePicking())}:{type:"none"}}else this.zG={type:"none"};if(this.pY=Y?{shader:this.ZR.Mz(Ug["2D"],U&&Ug.Color({dataType:["lookup",U.lookUpProperty,U.lut]}),O&&Ug.Color({dataType:"attribute"}),B&&Ug.Color({dataType:"uniform"}),z&&Ug.Color({dataType:["gradient",z]}),N&&Ug.Color({dataType:["gradient",N]}),Ug.Area2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0})),geometry:Rm(this.ZR),fillStyleSolid:B,fillStyleLinearGradient:z,fillStyleRadialGradient:N,fillStyleIndividual:O,fillStylePaletted:U,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],Ug.Area2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),Ug.MousePicking())}:void 0,K){const t=!(!j&&!q),e=J>1||t,i=v?"attribute":"uniform",s=!e&&Ug.PointSize("uniform"),r=Ug.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:b?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:b?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0});this.lY={shader:this.ZR.Mz(Ug["2D"],s,r,G&&Ug.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!q}),X&&Ug.Color({dataType:["gradient",X],overrideOpacity:!0,maskTexture:!!q}),Z&&Ug.Color({dataType:["gradient",Z],overrideOpacity:!0,maskTexture:!!q}),H&&Ug.Color({dataType:["lookup",H.getLookUpProperty(),H.getPalette()],overrideOpacity:!0,maskTexture:!!q}),W&&Ug.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!q}),j&&Ug.Color({dataType:["image",j],overrideOpacity:!0,maskTexture:!!q})),geometry:lm($,this.ZR,"uniform"===i?J:25),fillStyleSolid:G,fillStyleLinearGradient:X,fillStyleRadialGradient:Z,fillStylePaletted:H,fillStyleIndividual:W,fillStyleImage:j,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],s,r,Ug.MousePicking({useVertexId:!e})),shapeIcon:q,pointSizeAsScale:t,instancedRendering:e}}else this.lY=void 0}if((void 0===this.oY||it)&&A&&(gg(V)||gg(U)||gg(H))){const t=this.oY?rt:[y.Xc()];let e=this.oY?this.oY.max:ze,i=this.oY?this.oY.min:Be;const s=A;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.oY={min:i,max:e}}this.xU=this.ZR.KO(this,this.xU,j,q,tt,this.bU),this.OG=E?this.ZR.XO(E.getPattern()):void 0,this.vu(this.gu),this.qU=this.HU,this.iY=this.$U,this.XU.u=!1,this.jU.u=!1,this.rY.length=0,this.el=!1,this.QU.u=!1,this.Ad.u=!1,this.No.u=!1}Ls(){this.aY();const t=this.PN.strokeFillLinearGradient(!1),e=this.PN.strokeFillRadialGradient(!1),i=this.PN.areaFillLinearGradient(!1),s=this.PN.areaFillRadialGradient(!1),r=this.PN.markerFillLinearGradient(!1),n=this.PN.markerFillRadialGradient(!1);this._E.BV(this.At);const o=$r({min:{x:this.vt(),y:this.At.y.getInnerStart()},max:{x:this.St(),y:this.bt()}},{x:this.Cl(),y:this.kl()},this.At),h=$r({min:{x:this.vt(),y:this.xt()},max:{x:this.St(),y:this.bt()}},{x:this.Cl(),y:this.kl()},this.At);return this.yY=this.ZR.eN(t,this,h),this.mY=this.ZR.hN(e,this,h),this.vY=this.ZR.eN(i,this,o),this.SY=this.ZR.hN(s,this,o),this.xY=this.ZR.eN(r,this,h),this.bY=this.ZR.hN(n,this,h),this}QL(t,e){var i,s,r,n,o,h,a,l,u,c,d,f,g,y,m,p,x,A,S;const v=this.ZR.gl,b=null===(i=this.cY)||void 0===i?void 0:i.bufferX,M=null===(s=this.cY)||void 0===s?void 0:s.bufferY,w=null===(r=this.cY)||void 0===r?void 0:r.bufferColors,C=null===(n=this.cY)||void 0===n?void 0:n.bufferLookupValues,T=null===(o=this.cY)||void 0===o?void 0:o.valueCount,R=null===(h=this.AY)||void 0===h?void 0:h.valueCount,E=null===(a=this.Ad.C())||void 0===a?void 0:a.Gt,k=null==E?void 0:E.$c(),I=Math.max((null===(l=this.cY)||void 0===l?void 0:l.valueCount)||0,(null===(u=this.AY)||void 0===u?void 0:u.valueCount)||0);if(!b||!M||!E)return{};const F=(e,i,s)=>{if(Pm(this.ZR,e,this.At._i(),b,"aLocation","X",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),Pm(this.ZR,e,this.At._i(),M,"aLocation","Y",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!w)return!1;Pm(this.ZR,e,!1,w,"aColor","",4,!0,v.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!C)return!1;Pm(this.ZR,e,!1,C,"aLookupValue","",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},D=1===t?null===(c=this.pY)||void 0===c?void 0:c.mousePickingShader:null===(d=this.pY)||void 0===d?void 0:d.shader;if(this.pY&&D&&void 0!==T&&T>0&&k&&2!==t){const i=this.pY;this.ZR.aE(D).wV(D,((s,r,n,o)=>!!this.ZR.tN(n,t,this,{uniforms:this._E,idFirst:e,useInstanceID:1===t?I:void 0,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStylePaletted:i.fillStylePaletted,linearGradientInfo:this.vY,radialGradientInfo:this.SY,lookupValueRange:i.fillStylePaletted?fg(i.fillStylePaletted,this,this.oY):void 0,lookupValueBuffer:null})&&!!F(n,i.fillStyleIndividual,i.fillStylePaletted)&&(null==i||i.geometry.aE(n).Jy(T-1),!0)))}const P="none"===this.zG.type?void 0:1===t?this.zG.mousePickingShader:this.zG.shader;if("none"!==this.zG.type&&P&&void 0!==T&&T>0){const i=this.zG;this.ZR.aE(P).wV(P,((s,r,n,o)=>{var h,a;if(!this.ZR.tN(n,t,this,{uniforms:this._E,idFirst:e,useInstanceID:1===t&&"triangulated"===i.type?I:void 0,useVertexID:1===t&&"primitive"===i.type?I:void 0,fillStyleSolid:i.fillStyleSolid,fillStylePaletted:i.fillStylePaletted,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStyleIndividual:i.fillStyleIndividual,linearGradientInfo:this.yY,radialGradientInfo:this.mY,lookupValueRange:i.fillStylePaletted?fg(i.fillStylePaletted,this,this.oY):void 0,lookupValueBuffer:"primitive"===i.type?C:null,colorBuffer:"primitive"===i.type?w: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.OG)return!1;this.ZR.kV(s("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(o("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(s("uStippleScale"),i.lineStyleDashed.getPatternScale()).TV(s("uStippleTexture"),this.OG.jO,1)}if("primitive"===i.type){if(i.lineStyleDashed){if(!(null===(h=this.cY)||void 0===h?void 0:h.bufferLengthSoFar))return!1;this.ZR.hO(r("aLengthSoFar"),this.cY.bufferLengthSoFar)}$y.DG(this.bN,T)}else{if(!F(n,i.fillStyleIndividual,i.fillStylePaletted))return!1;if(i.lineStyleDashed){if(!(null===(a=this.cY)||void 0===a?void 0:a.bufferLengthSoFar))return!1;Pm(this.ZR,n,!1,this.cY.bufferLengthSoFar,"aLengthSoFar","",2,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}Ky.QL(this.bN,i.geometry,n,this.LG&&1!==t,1===t,i.thickness,T-1)}return!0}))}const L=null===(f=this.AY)||void 0===f?void 0:f.bufferX,V=null===(g=this.AY)||void 0===g?void 0:g.bufferY,_=null===(y=this.AY)||void 0===y?void 0:y.bufferColors,B=null===(m=this.AY)||void 0===m?void 0:m.bufferLookupValues,z=null===(p=this.AY)||void 0===p?void 0:p.bufferSizes,N=null===(x=this.AY)||void 0===x?void 0:x.bufferRotations,O=1===t?null===(A=this.lY)||void 0===A?void 0:A.mousePickingShader:null===(S=this.lY)||void 0===S?void 0:S.shader,U=this.lY;let Y=1;if(k&&(D||P)){const t=this.Ad?Math.abs((this.St()-this.vt())/E.getSampleCount()):0,e=this.At.x.getInnerInterval()/t,i=this.jU.C(),s=this.At.x.ri()/i/1,r=2*s;Y=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(O&&U&&L&&V&&Y>0&&void 0!==R&&R>0){const i=U,s=i.instancedRendering?1:0;this.ZR.aE(O).wV(O,((r,n,o,h)=>{if(!this.ZR.tN(o,t,this,{uniforms:this._E,idFirst:e,useInstanceID:i.instancedRendering&&1===t?I:void 0,useVertexID:i.instancedRendering||1!==t?void 0:I,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,linearGradientInfo:this.xY,radialGradientInfo:this.bY,fillStylePaletted:i.fillStylePaletted,fillStyleIndividual:i.fillStyleIndividual,lookupValueRange:i.fillStylePaletted?fg(i.fillStylePaletted,this,this.oY):void 0,lookupValueBuffer:B,lookupValueAttribDivisor:s,colorBuffer:_,colorAttribDivisor:s,fillStyleImage:i.fillStyleImage,texturedFillGLInfo:this.xU,texCoordAttribDivisor:0,maskTexture:i.shapeIcon&&this.xU,maskTextureCoordsAttribDivisor:0}))return!1;if(this.At._i()?this.ZR.CV(L,s,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).CV(V,s,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.ZR.lO(n("aPosX"),L,s).lO(n("aPosY"),V,s),1!==t&&this.ZR.FV(r("uOpacity"),Y),i.instancedRendering)if(N)this.ZR.lO(n("aRotDeg"),N,s).FV(r("uBaseRotDeg"),i.geometry.jW);else{const t=xi(this.ZU.C()+i.geometry.jW),e=Math.sin(t),s=Math.cos(t);this.ZR.kV(r("uRot"),[e,s])}return this.ZR.kV(h("uOffsetAlignment"),[-this.JU.x/2,-this.JU.y/2]),i.geometry.Jy(o,z,R,i.pointSizeAsScale&&this.xU?{scale:this.jU.C(),width:i.shapeIcon?i.shapeIcon.oi().x:this.xU.texture.Xz,height:i.shapeIcon?i.shapeIcon.oi().y:this.xU.texture.jz}:this.jU.C(),i.instancedRendering),!0}))}return{idCount:I}}TN(t,e,i,s,r){var n;const o=null===(n=this.Ad.C())||void 0===n?void 0:n.Gt;if(null==o?void 0:o.$c())return{};const h=t-e;return{info:{dataPoint:null==o?void 0:o.Qc(h)}}}dispose(){var t,e,i,s,r,n,o,h,a,l,u,c,d;return super.dispose(),this.ZR.LV(null===(t=this.cY)||void 0===t?void 0:t.bufferX),this.ZR.LV(null===(e=this.cY)||void 0===e?void 0:e.bufferY),this.ZR.LV(null===(i=this.cY)||void 0===i?void 0:i.bufferColors),this.ZR.LV(null===(s=this.cY)||void 0===s?void 0:s.bufferLookupValues),this.ZR.LV(null===(r=this.cY)||void 0===r?void 0:r.bufferRotations),this.ZR.LV(null===(n=this.cY)||void 0===n?void 0:n.bufferSizes),this.ZR.LV(null===(o=this.AY)||void 0===o?void 0:o.bufferX),this.ZR.LV(null===(h=this.AY)||void 0===h?void 0:h.bufferY),this.ZR.LV(null===(a=this.AY)||void 0===a?void 0:a.bufferColors),this.ZR.LV(null===(l=this.AY)||void 0===l?void 0:l.bufferLookupValues),this.ZR.LV(null===(u=this.AY)||void 0===u?void 0:u.bufferRotations),this.ZR.LV(null===(c=this.AY)||void 0===c?void 0:c.bufferSizes),this.zG={type:"none"},this.pY=void 0,this.lY=void 0,this.EW.fW(),null===(d=this.Ad.C())||void 0===d||d.Nt(),this.cY=void 0,this.AY=void 0,this.yY=void 0,this.mY=void 0,this.vY=void 0,this.SY=void 0,this.xY=void 0,this.bY=void 0,this.ZR.qO(this,this.xU),this}KR(){return this.dispose(),this}MY(t){if(!this.uY){const{xValues:e,yValues:i}=t.readBack();this.uY={min:{x:Be,y:Be},max:{x:ze,y:ze}};const s=e.length;for(let t=0;tthis.uY.max.x?s:this.uY.max.x,this.uY.max.y=r>this.uY.max.y?r:this.uY.max.y}return this.nY.length=0,this.uY}const e=t.Pc,i=t.Dc;if(this.nY.length>0&&e&&i){for(const t of this.nY){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.uY.min.x=tthis.uY.max.x?t:this.uY.max.x,this.uY.max.y=r>this.uY.max.y?r:this.uY.max.y}this.nY.length=0}return this.uY}return this.uY}St(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?(null===(e=n.Ic())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Zc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.dY)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.dY)||void 0===r?void 0:r.max)||0:this.MY(n).max.x}vt(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?(null===(e=n.Zc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Ic())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.dY)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.dY)||void 0===r?void 0:r.min)||0:this.MY(n).min.x}bt(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?Pt(null===(e=this.dY)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Pt(null===(i=this.dY)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Pt(null===(s=n.Ic())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Pt(null===(r=n.Zc())||void 0===r?void 0:r.y,0):this.MY(n).max.y}xt(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?Pt(null===(e=this.dY)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Pt(null===(i=this.dY)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Pt(null===(s=n.Zc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Pt(null===(r=n.Ic())||void 0===r?void 0:r.y,0):this.MY(n).min.y}Cl(){var t,e;let i=this.jU.C();this.xU&&(i=Math.max(this.xU.texture.Xz,this.xU.texture.jz)*this.jU.C());const s=Math.max(Te(this.gu),(null===(t=this.Ad.C())||void 0===t?void 0:t.Gt.wc)?25:i),r=null===(e=this.Ad.C())||void 0===e?void 0:e.Gt.$c();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}kl(){var t,e;let i=this.jU.C();this.xU&&(i=Math.max(this.xU.texture.Xz,this.xU.texture.jz)*this.jU.C());const s=Math.max(Te(this.gu),(null===(t=this.Ad.C())||void 0===t?void 0:t.Gt.wc)?25:i),r=null===(e=this.Ad.C())||void 0===e?void 0:e.Gt.$c();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const Fm=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],y=f.length,m=f[0],p=f[y-1],x=g[0],A=g[y-1],S=c?2:1;if(h&&a&&h.firstX&&h.lastX&&m>=h.firstX){const e=fo(h.lastX,0,y-1,(t=>f[t]));if(f[e]===h.lastX){const a=h.bufferSize-h.valueCount,l=e+1,u=y-l;if(0===u)return h;if(a>=u){const e=mo(f,l,void 0),a=mo(g,l,void 0);if(t.tO(h.bufferX,h.valueCount*S,d(e)),t.tO(h.bufferY,h.valueCount*S,d(a)),i&&h.bufferColors){const e=i.slice(l);t.tO(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.tO(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.tO(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.tO(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Dm(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.tO(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=A,h}}}const v=y+u,b=t.qV(v*S,d(f),null==h?void 0:h.bufferX),M=t.qV(v*S,d(g),null==h?void 0:h.bufferY),w=i?t.qV(v,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,C=s?t.qV(v,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,T=r?t.qV(v,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,R=n?t.qV(v,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let E,k=0,I=0;if(o){const e=Dm(f,g,f[0],g[0],0,0);E=t.qV(2*v,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),k=e[1],I=e[2]}return{bufferX:b,bufferY:M,bufferColors:w,bufferLookupValues:C,bufferSizes:T,bufferRotations:R,bufferSize:v,bufferLengthSoFar:E,valueCount:y,firstX:m,lastX:p,firstY:x,lastY:A,lengthSoFarX:k,lengthSoFarY:I}},Dm=(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.nO(i,1),t.nO(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.nO(d,1),t.nO(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.nO(i,1),t.nO(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Lm={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)=>Lm.multiply(t,Lm.translation(e,i)),rotate:(t,e)=>Lm.multiply(t,Lm.rotation(e)),scale:(t,e,i)=>Lm.multiply(t,Lm.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],y=e[4],m=e[5],p=e[6],x=e[7],A=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+y*n+m*a,g*s+y*o+m*l,g*r+y*h+m*u,p*i+x*n+A*a,p*s+x*o+A*l,p*r+x*h+A*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Vm extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._Y=[],this._E=new Fy,this.wY=[u(0,0),u(0,0),u(0,0),u(0,0)],this.CY=y(u(0,0),u(0,0)),this.kY=y(u(0,0),u(0,0)),this.TY=u(0,0),this.FY=u(0,0),this.ST=u(0,0),this.IY=u(0,0),this.PY=0,this.DY=0,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleRadialGradient:()=>tt(this.we)&&this.we,fillStyleLinearGradient:()=>st(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e,this.HG=t.Qn.so}Ls(){const t=this.ca(),e=this.ua(),i=this.No.C();if(t){const t=this.aa(),s=this.PN.fillStyleSolid(t),r=this.PN.fillStyleRadialGradient(t),n=this.PN.fillStyleLinearGradient(t),o=s||r||n,h=this.ZR,a=this.ZR.lV(),l=a!==this.DY;if(this.DY=a,this._E.BV(this.At),this.Ma.u||l){this.BY&&this.BY.lE(this),this.font._(br(this.Ma.C(),a));const t=this.font.C();this.BY=this.ZR.Xh(t.properties.family),this.BY.aE(this)}const c=this.font.u,d=c||this.ya.u;if(d&&this.BY){const t=this.font.C();[this.LY,this.kY]=this.BY.cE(this.ya.C(),t,this.bN.Ki.isDark),this._Y.forEach((t=>{t.texCoordBuff&&h.LV(t.texCoordBuff),t.vertexBuff&&h.LV(t.vertexBuff)})),this._Y=this.LY.map((t=>({texCoordBuff:h.MV(t.texCoords,!1),texture:t.texture,info:t}))),this.Ma.u=!1,this.font.u=!1,this.ya.u=!1}const f=this.At.Ni()||e,g=this.ma.u||this.Sa.u||this.va.u||this.xa.u||this.wa.u||this.Xt.u||d||f,y=this.wa.C(),m=li(u(this.Sa.C()+1,this.va.C()+1),.5);if(g&&this.LY&&(this.TY=u(-(y.left*a+this.kY.max.x-this.kY.min.x+y.right*a)*m.x-this.kY.min.x+y.right*a,-(y.bottom*a+this.kY.max.y-this.kY.min.y+y.top*a)*m.y-this.kY.min.y+y.top*a)),(g||f||this.ba.u||this.aa())&&this.we!==B){if(this.LY){const t=ui(this.ma.C(),this.xa.C()),e=ct(t,this.At,this.ls.At),i=li(e,a);this.IY=i;const s=xi(this.ba.C());this.PY=s,d&&this._Y.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.MV(e.vertices,!0,t.vertexBuff))}));const r=this.Xt.C(),n=[ui(ri(u((this.kY.min.x+(-r.left-y.left)*a+this.TY.x)/a,(this.kY.max.y+(r.top+y.top)*a+this.TY.y)/a),this._a,s),e),ui(ri(u((this.kY.max.x+(r.right+y.right)*a+this.TY.x)/a,(this.kY.max.y+(r.top+y.top)*a+this.TY.y)/a),this._a,s),e),ui(ri(u((this.kY.max.x+(r.right+y.right)*a+this.TY.x)/a,(this.kY.min.y+(-r.bottom-y.bottom)*a+this.TY.y)/a),this._a,s),e),ui(ri(u((this.kY.min.x+(-r.left-y.left)*a+this.TY.x)/a,(this.kY.min.y+(-r.bottom-y.bottom)*a+this.TY.y)/a),this._a,s),e)];this.wY=[ct(n[0],this.ls.At,this.At),ct(n[1],this.ls.At,this.At),ct(n[2],this.ls.At,this.At),ct(n[3],this.ls.At,this.At)];const o=Je(n);this.FY=u(-(o.max.x-o.min.x)*a*m.x-o.min.x*a+this.IY.x,-(o.max.y-o.min.y)*a*m.y-o.min.y*a+this.IY.y),this.zg=ci(o.max,o.min);const l=Je(this.wY),c=this.At.pi(l.min,this.FY),f=this.At.pi(l.max,this.FY);this.CY=Je([c,f])}r?this.ON=Sy(this.CY,this.At,r.getPosition(),r.getExtent(),r.getShape(),this.ZR.lV()):n?this.NN=vy(this.CY,this.At,n.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0)}(this.aa()||c)&&(this.kE=o?this.ZR.Mz(Ug["2D"],Ug.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.HG}),Ug.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.RY=i&&o?this.RY||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.HG})):void 0,this.ma.u=!1,this.Sa.u=!1,this.va.u=!1,this.xa.u=!1,this.ba.u=!1,this.da(this.we)}return this.Ca=t,this}QL(t,e){if(this.ca()){const i=1===t?this.RY:this.kE;if(!i||0===this._Y.length)return{};const s=this.PN.fillStyleSolid(!1),r=this.PN.fillStyleRadialGradient(!1),n=this.PN.fillStyleLinearGradient(!1),o=this.ls.iz(),h=o.x,a=o.y;let l=Lm.projection(h,a,-1);const u=Lm.translation(this.TY.x,this.TY.y),c=Lm.translation(this.FY.x,this.FY.y);l=Lm.translate(l,this.IY.x,this.IY.y),l=Lm.multiply(l,c),l=Lm.rotate(l,this.PY),l=Lm.multiply(l,u),1===t&&(l=Lm.scale(l,this.kY.max.x,this.kY.max.y)),this.ZR.aE(i).wV(i,((i,h,a,u)=>{if(this.ZR.jV(i("uMatrix"),l).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),this.HG&&this.ZR.kV(u("uViewportSizePx"),[o.x*this.ZR.lV(),o.y*this.ZR.lV()]),1===t)this.ZR.QV(i("uFirstId"),e).YO(a,1);else if(s)this.ZR.TR(i("uColor"),s.getColor());else if(r&&this.ON){this.ZR.kV(i("uCenter"),this.ON.center).kV(i("uDistance"),this.ON.distance).$V(i("uBounds"),this.ON.bounds).FV(i("uAspect"),this.ON.aspectRatio);const t=r.getColorStops();for(let e=0;e{this.ZR.hO(h("aPos"),t.vertexBuff).hO(h("aMaskTextureCoord"),t.texCoordBuff).TV(i("uMaskTexture"),t.texture,0).Jy(this.ZR.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return{idCount:1}}TN(t,e,i,s,r){return{}}Je(){return this.ca()?this.wY:[]}td(){return this.ca()&&this.zg?this.zg:u(0,0)}oi(){if(this.ca()&&this.CY){const t=this.CY;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}KR(){return this._Y.forEach((t=>{t.texCoordBuff&&this.ZR.LV(t.texCoordBuff),t.vertexBuff&&this.ZR.LV(t.vertexBuff)})),this._Y=[],this.BY&&this.BY.lE(this),this}St(){return this.CY.max.x}vt(){return this.CY.min.x}bt(){return this.CY.max.y}xt(){return this.CY.min.y}Cl(){return 0}kl(){return 0}}class _m{constructor(t,e,i){this.EY=new Set,this.zY=t=>(this.EY.add(t),t),this.VY=t=>(this.EY.delete(t),t.KR(),this),this.ls=t,this.ea=e,this.OY=i}ZL(t){this.EY.delete(t)&&this.EY.add(t)}Y(){for(const t of this.EY)t.KR().dispose();this.ls.Dn(this.ea)}xs(){return this.ls.xs(),this}Pn(){return this.ea}}class Bm extends _m{constructor(){super(...arguments),this.NY=p(void 0),this.ha=!1}ux(t){return this.NY._(t),this}Pp(){return this.NY.C()}}class zm extends Bm{constructor(t,e,i){super(t,e,i),this.bN=t,this.gl=t._N(),this.GY=this.EY}bV(t){const e=t instanceof Kr&&t;if(!e)return Ne;const i=e.vt(),s=e.St(),r=e.xt(),n=e.bt();if(i===Be||s===ze||r===Be||n===ze)return Ne;const o=e.Cl(),h=e.kl(),a=$r({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.At),l={min:ct(a.min,e.At,t.ls.At),max:ct(a.max,e.At,t.ls.At)},u=this.NY.C();let c;if(u){if(c={min:{x:Math.max(l.min.x,u.x),y:Math.max(l.min.y,u.y)},max:{x:Math.min(l.max.x,u.x+u.width),y:Math.min(l.max.y,u.y+u.height)}},c.max.xt.na()-e.na()));this.EY.clear();for(const e of t)this.EY.add(e)}for(const t of this.EY)t.Ls();return this}QL(t,e,i){var s;const r=this.NY.C();let n;if(r){const t=r.x*this.gl.lV()*e,i=r.y*this.gl.lV()*e,s=Math.ceil(t),o=Math.ceil(i);n=[s,o,Math.floor(t+r.width*this.gl.lV()*e)-s,Math.floor(i+r.height*this.gl.lV()*e)-o],this.gl.xV(n[0],n[1],n[2],n[3])}if(1!==t){for(const i of this.EY)if(i.getVisible()){if(i._M){const t=i._M.x*this.gl.lV()*e,s=i._M.y*this.gl.lV()*e,r=Math.ceil(t),n=Math.ceil(s),o=Math.floor(t+i._M.width*this.gl.lV()*e)-r,h=Math.floor(s+i._M.height*this.gl.lV()*e)-n;this.gl.xV(r,n,o,h)}i.QL(t,0),i._M&&n&&this.gl.xV(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.GY.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 Ym extends Nm{constructor(t,e){super(t),this.UY="attribute",this.YY=e;const{vertices:i,indices:s}=Gm();this.OR=t.MV(i),this.wG=t.sO(s),this.CG=s.length,this.kG=t.gl.TRIANGLES}Jy(t,e,i,s){return this.ZR.CV(this.OR,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).uO(this.wG).FV(t.uniform("uEdgeRoundness"),this.YY/2).AO(this.kG,this.CG,0,e),this}Yz(){this.ZR.LV(this.OR),this.ZR.LV(this.wG)}HY(t){return this.YY=t,this}$Y(){return this.YY}}const Gm=()=>{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=_e.multiply(o,-1),l=_e.multiply(h,-1),u=i;e[i]={thicknessDirection:_e.addVec(t,o,h),edge:_e.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:_e.addVec(t,a,h),edge:_e.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:_e.addVec(t,a,l),edge:_e.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:_e.addVec(t,o,l),edge:_e.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=_e.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=_e.normalize(_e.lerp(t,n.direction,o)),a=Math.PI/2-_e.angle(h,t),l=_e.addVec(_e.multiply(_e.multiply(n.direction,-1),1-Math.cos(a)),_e.multiply(_e.multiply(t,-1),1-Math.sin(a)),_e.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.GV.Uz.get(e);return i||(i=void 0!==e&&e>0?new Ym(t,Ft(e,0,1)):new Om(t),t.GV.Uz.set(e,i),i)};class Zm extends Ry{gv(t){return this.oV=this.nv.C(),this.nv._(t),this}PS(t){return this.jY=t,this}DS(){return this.jY}}class Hm extends Zm{constructor(t,e,i){super(t,e,i),this.ZY=t,this.bN=t.bN,this.ZR=this.bN._N()}}class Wm extends Hm{constructor(t,e,i){super(t,e,i),this.jY="cull-back",this.Ka=Oe,this.QY={},this.JY=[],this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleIndividual:()=>X(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we}),this.we=Ir.fillStyle,this.nv._(jn)}Ls(t){const e=this.JY,i=this.we,s=i!==B,r=this.KY,n=this.aa()||this.qY!==r,o=this.nV(),h=this.No.C(),a=this.No.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.tH||0;let s=t;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.QY[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.$W&&i.set(this.$W),this.$W=i,this.iH=e,this.sH=11*t}const c=X(i)?i.getFallbackColor():void 0;for(const t of e){const e=t.id,i=void 0!==e&&this.QY[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.sH,i=new Float32Array(this.$W.buffer,t*Float32Array.BYTES_PER_ELEMENT,11);i.set(s),void 0!==e&&(this.QY[e]={location:t,buffer:i}),this.sH+=11}}if(u&&(this._G=this.ZR.MV(this.$W,!0)),"all"===r)this.ZR.tO(this._G,0,this.$W);else if("chunks"===r)for(const t of e){const e=t.id;if(void 0!==e){const t=this.QY[e];this.ZR.tO(this._G,t.location,t.buffer)}}if(n||o||a){const t=this.PN.fillStyleSolid(n),e=this.PN.fillStyleIndividual(n),i=this.PN.fillStylePaletted(n);t||e||i?(this.eH=Xm(this.ZR,this.hH()),this.kE=this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:e?"attribute":i?["lookup",i.getLookUpProperty(),i.lut]:"uniform",shadingStyle:this.nv.C().type}),Ug.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:cg(this.At),normalSource:this.eH.UY}),void 0!==this.KY&&Ug.RoundedEdges3D),this.RY=h?this.ZR.Mz(Ug["3D"],Ug.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:cg(this.At),normalSource:void 0}),Ug.MousePicking(),void 0!==this.KY&&Ug.RoundedEdges3D):void 0):(this.eH=void 0,this.kE=void 0,this.RY=void 0)}if(e.length>0){const t=y({x:Be,y:Be,z:Be},{x:ze,y:ze,z:ze});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.Ka=t}this.tH=s,this.JY.length=0}return this.da(i),this.qY=r,this.nv.u=!1,this.No.u=!1,this}QL(t,e){const i=1===t?this.RY:this.kE,s=this.eH,r=this._G,n=this.we,o=this.tH,h=this.nv.C(),a=o||0;return i&&r&&void 0!==o&&this.ZR.wV(i,((l,u,c)=>{let d=!1;const f=u("aPos"),g=u("aOffsetAxis");this.ZR.aE(i).XV(l("uScale"),this.ZY._E.IV()).XV(l("uDisp"),this.ZY._E.PV()).ZV(l("uViewProjectionMatrix"),this.rH).FV(l("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(l("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(l("uRenderEffectMask"),2===t?1:0);const y={location:f,size:3},m={location:g,size:3},p={location:void 0,size:4};if(1!==t&&"phong"===h.type&&this.ZR.XV(l("uCameraLoc"),this.nH).XV(l("uLightLoc"),this.oH).FV(l("uAmbientReflection"),h.ambientReflection).FV(l("uSpecularReflection"),h.specularReflection).FV(l("uDiffuseReflection"),h.diffuseReflection).FV(l("uShininess"),h.shininess).TR(l("uLightColor"),h.specularColor).TR(l("uAmbientColor"),h.ambientColor),1===t)this.ZR.QV(l("uFirstId"),e).YO(c,a);else if(Y(n))this.ZR.TR(l("uColorDiffuse"),n.getColor());else if(X(n)){const t=u("aColor");p.location=t}else if(H(n)){const t=fg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ZR.JO(c,n.lut,t)}return r&&(this.ZR.CV(r,1,y,m,p,{location:void 0,size:1}),s.Jy(c,o,"phong"===h.type&&1!==t,!1),d=!0),d})),{idCount:a}}TN(t,e,i,s,r){const n=11*(t-e);if(!this.$W)return{};const o=this.$W[n+0],h=this.$W[n+1],a=this.$W[n+2],l=this.$W[n+3],u=this.$W[n+4],c=this.$W[n+5],d=Pt(this.$W[n+6],void 0),f=Pt(this.$W[n+7],void 0),g=Pt(this.$W[n+8],void 0),y=Pt(this.$W[n+9],void 0),m=Pt(this.$W[n+10],void 0);let p;for(const t of Object.keys(this.QY))if(this.QY[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:y,intensity:m,id:p}}}}dispose(){return super.dispose(),this._G&&(this.ZR.LV(this._G),this._G=void 0),this.kE=void 0,this}KR(){return this.dispose(),this}wv(t){this.JY=he(this.JY,t,{canReturnB:!0})}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}Mv(t){return this.KY=void 0!==t&&t>0?Ft(t,0,1):void 0,this}hH(){return this.KY}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}mv(){return this.Ka.max.z}vv(){return this.Ka.min.z}Cl(){return 0}kl(){return 0}Sv(){return 0}aa(){return qr(this.la,this.we)}da(t){this.la=t}}class jm extends by{constructor(t,e){super(t),this.UY="custom",this.bG=e;const{vertices:i,drawSize:s}=this.MG();this._G=t.MV(i),this.CG=s}aE(t){return this.ZR.CV(this._G,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Jy(t){return this.ZR.fO(this.ZR.gl.TRIANGLE_STRIP,0,this.CG,t),this}MG(){const t=this.bG,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}}Yz(){this.ZR.LV(this._G)}}const Km=(t,e=16)=>{let i=t.GV.Gz.get(e);return i||(i=new jm(t,e),t.GV.Gz.set(e,i),i)};class $m extends Hm{constructor(t,e,i){super(t,e,i),this.jY="cull-back",this.aH=Oe,this.lH=[],this.uH=!1,this.gu=Ir.lineStyle,this.nv._(Hn)}Ls(t){const e=this.uH,i=this.gu,s=this.yu!==i,r=this.nV(),n=e;if(e){const t=te(this.lH);this.cH=this.ZR.MV(t,!1,this.cH)}if(n&&(this.aH=ti(this.lH)),s||r){const t=8,e=ts(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.zG=void 0,Y(e)&&("primitive"===s?this.zG={type:s,shader:this.ZR.Mz(Ug["3D"],Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}),Ug.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.zG={type:s,shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:"uniform",shadingStyle:this.nv.C().type}),Ug.LineInstanced3D({axisWorldTranslation:cg(this.At)})),geometry:Km(this.ZR,t),fillStyle:e}))}return this.uH=!1,this.yu=i,this.nv.u=!1,this}QL(t,e){if(1===t)return{};const i=this.ZR.gl,s=this.zG,r=this.cH,n=this.gu,o=this.nv.C();if(s&&r&&ts(n))switch(s.type){case"instanced":{const e=.5*this.Is.$m(n.thickness),h=s.fillStyle.getColor(),a=s.shader,l=s.geometry;this.ZR.wV(a,((s,n,u)=>{this.ZR.aE(a).XV(s("uScale"),this.ZY._E.IV()).XV(s("uDisp"),this.ZY._E.PV()).ZV(s("uViewProjectionMatrix"),this.rH).TR(s("uColorDiffuse"),h).FV(s("uOffsetWU"),e).FV(s("uIsHighlighted"),this.Yo).TR(s("uHighlightColorOffset"),2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0),"phong"===o.type&&this.ZR.XV(s("uCameraLoc"),this.nH).XV(s("uLightLoc"),this.oH).FV(s("uAmbientReflection"),o.ambientReflection).FV(s("uSpecularReflection"),o.specularReflection).FV(s("uDiffuseReflection"),o.diffuseReflection).FV(s("uShininess"),o.shininess).TR(s("uLightColor"),o.specularColor).TR(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.ZR.nO(c,1),i.enableVertexAttribArray(c),i.vertexAttribPointer(d,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(d,1),i.enableVertexAttribArray(d),l.aE(u).Jy(this.lH.length/2),!0}));break}case"primitive":{const e=ts(n)?n.getFillStyle():void 0,o=e&&Y(e)?e.getColor():void 0;if(o){const e=s.shader;this.ZR.wV(e,((s,n)=>(this.ZR.aE(e).XV(s("uScale"),this.ZY._E.IV()).XV(s("uDisp"),this.ZY._E.PV()).ZV(s("uViewProjectionMatrix"),this.rH).TR(s("uColor"),o).FV(s("uIsHighlighted"),this.Yo).TR(s("uHighlightColorOffset"),2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0).CV(r,void 0,{location:n("aPos"),size:3}).Jy(i.LINES,this.lH.length),!0)))}break}}return{idCount:this.lH.length}}TN(t,e,i,s,r){return{}}dl(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.ZR.mA.Kn&&s>i.length&&wt.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}}Yz(){this.ZR.LV(this._G)}}const qm=(t,e)=>{const i=Math.round(e);i<3&&pe(0,kt);const s=i;let r=t.GV.Wz.get(Array.from(t.GV.Wz.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new Qm(t,i,s),t.GV.Wz.set({sectors:i,stacks:s},r),r)};class Jm extends Hm{constructor(t,e,i){super(t,e,i),this.jY="cull-back",this.LM=[],this.zG={},this.zW=new sm(this.LM,(t=>t.vertexBuffer&&this.ZR.LV(t.vertexBuffer)),!0),this.bu=[],this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=Oe,this.PN=dg({lineStyleSolid:()=>{const t=this.gu;return ts(t)&&t},lineFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},lineFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t},jointStyleTriangulatedPoints:()=>yr(this.Cv)&&this.Cv,jointSizeTriangulated:()=>{const t=this.Cv;return yr(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Cv.getFillStyle();return Y(t)&&t},jointFillPaletted:()=>{const t=this.Cv.getFillStyle();return H(t)&&t},wireframeLineStyleSolid:()=>{const t=yr(this.Cv)&&this.Cv.getWireframeStyle();return ts(t)&&t},wireframeFillSolid:()=>{const t=yr(this.Cv)&&this.Cv.getWireframeStyle(),e=t&&t.getFillStyle();return Y(e)&&e}}),this.el=!1,this.gu=Ir.lineStyle,this.Cv=Ir.pointStyle3D,this.nv._(jn),this.WW={attributesPerVertex:3,prepareRenderData:(t,e)=>te(t)}}TN(t,e,i,s,r){return{info:{dataPoint:this.bu[t-e]}}}Ls(t){const e=this.el,i=this.tl,s=this.il,r=s>0,n=this.gu,o=n!==this.yu,h=this.Cv,a=h!==this.AH,l=this.nV(),u=this.No.u,c=this.No.C();this.sl&&(this.Ka=ii(this.Ka,this.sl),this.sl=void 0),r&&(this.bu=he(this.bu,i,{canReturnB:!0}),this.qa+=s);let d=i,f=s;if(e&&(this.LM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Oe})),this.zW.TW(),d=this.bu,f=this.qa),f>0){const t=1e5,e=Math.floor(this.bN.gH/(this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Qo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Ft(i,t,e);this.zW.MW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Oe,vertexBuffer:this.ZR.qV(t*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i))})),((t,e,i,s)=>{this.ZR.tO(t.vertexBuffer,t.existingCoordinatesCount*this.WW.attributesPerVertex,this.WW.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.PN.lineStyleSolid(o),i=this.PN.lineFillSolid(o),s=this.PN.lineFillPaletted(o),r=i||s,h=this.PN.jointStyleTriangulatedPoints(a),l=this.PN.jointSizeTriangulated(a),u=this.PN.jointFillSolid(a),d=this.PN.jointFillPaletted(a),f=u||d,g=this.PN.wireframeLineStyleSolid(a),y=this.PN.wireframeFillSolid(a),m=n.getThickness()<0||1===n.getThickness()&&this.Qo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===m&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.ZR.Mz(Ug["3D"],Ug.Color({dataType:p}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})),mousePicking:c?{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking({useVertexId:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}))}:void 0}:"instanced"===m&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:p,shadingStyle:this.nv.C().type}),Ug.LineInstanced3D({axisWorldTranslation:cg(this.At)})),geometry:tp(this.ZR,e.getThickness()),mousePicking:c?{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.LineInstanced3D({axisWorldTranslation:cg(this.At)}))}:void 0}),t.markers=void 0,f&&h){const e=ne(h.getShape(),{cube:()=>Xm(this.ZR),sphere:()=>ep(this.ZR,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.nv.C().type,wireframe:!1!==y}),Ug.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:cg(this.At),normalSource:e.UY})),mousePicking:c?{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:cg(this.At),normalSource:void 0}))}:void 0,wireframe:g&&y&&{thickness:g.getThickness(),fillStyleSolid:y}}}this.zG=t}return this.el=!1,this.tl=[],this.il=0,this.yu=n,this.AH=h,this.nv.u=!1,this.No.u=!1,this}QL(t,e){var i,s;const r=this.ZR.gl,{lines:n,markers:o}=this.zG,h=this.nv.C(),a=this.qa,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.ZR.wV(i,((n,l,c)=>{let d=!1;if(this.ZR.aE(i).XV(n("uScale"),this.ZY._E.IV()).XV(n("uDisp"),this.ZY._E.PV()).ZV(n("uViewProjectionMatrix"),this.rH).FV(n("uOffsetWU"),this.Is.$m(o.getThickness())).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.ZR.XV(n("uCameraLoc"),this.nH).XV(n("uLightLoc"),this.oH).FV(n("uAmbientReflection"),h.ambientReflection).FV(n("uSpecularReflection"),h.specularReflection).FV(n("uDiffuseReflection"),h.diffuseReflection).FV(n("uShininess"),h.shininess).TR(n("uLightColor"),h.specularColor).TR(n("uAmbientColor"),h.ambientColor),1===t);else if(a)this.ZR.TR(n("uColorDiffuse"),a.getColor());else if(u){const t=fg(u,this,void 0);if(!t&&u.lut.percentageValues)return!1;this.ZR.JO(c,u.lut,t)}const f=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=f.Ut(e.existingDataPointsCount);this.ZR.QV(n("uFirstId"),t).YO(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.ZR.nO(i,1),r.enableVertexAttribArray(i),r.vertexAttribPointer(o,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(o,1),r.enableVertexAttribArray(o),s.aE(c).Jy(e.existingCoordinatesCount-1),d=!0})),d}))}if(n&&l&&"primitive"===n.type){const i=l,{fillStyleSolid:s,fillStylePaletted:o}=n;this.ZR.wV(i,((n,h,a)=>{let l=!1;if(this.ZR.aE(i).XV(n("uScale"),this.ZY._E.IV()).XV(n("uDisp"),this.ZY._E.PV()).ZV(n("uViewProjectionMatrix"),this.rH).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),1===t);else if(s)this.ZR.TR(n("uColor"),s.getColor());else if(o){const t=fg(o,this,void 0);if(!t&&o.lut.percentageValues)return!1;this.ZR.JO(a,o.lut,t)}const u=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=u.Ut(e.existingDataPointsCount);this.ZR.QV(n("uFirstId"),t).WO(a,i)}this.ZR.CV(e.vertexBuffer,void 0,{location:h("aPos"),size:3}).Jy(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.ZR.wV(i,((o,u,d,f)=>{let g=!1;if(this.ZR.aE(i).XV(o("uScale"),this.ZY._E.IV()).XV(o("uDisp"),this.ZY._E.PV()).ZV(o("uViewProjectionMatrix"),this.rH).FV(f("uRatioNwuWu"),this.ZY.pH()).FV(o("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(o("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(o("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.ZR.XV(o("uCameraLoc"),this.nH).XV(o("uLightLoc"),this.oH).FV(o("uAmbientReflection"),h.ambientReflection).FV(o("uSpecularReflection"),h.specularReflection).FV(o("uDiffuseReflection"),h.diffuseReflection).FV(o("uShininess"),h.shininess).TR(o("uLightColor"),h.specularColor).TR(o("uAmbientColor"),h.ambientColor),1===t);else if(r)this.ZR.TR(o("uColorDiffuse"),r.getColor());else if(n){const t=fg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ZR.JO(d,n.lut,t)}c&&1!==t&&this.ZR.FV(o("uWireframeThickness"),c.thickness).TR(o("uWireframeColor"),c.fillStyleSolid.getColor()),!1!==a&&this.ZR.XV(o("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.ZR.FV(o("uOffsetNWU"),l);const y=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=y.Ut(e.existingDataPointsCount);this.ZR.QV(o("uFirstId"),t).YO(d,i)}this.ZR.CV(e.vertexBuffer,1,{location:u("aPos"),size:3}),s.Jy(d,e.existingCoordinatesCount,"phong"===h.type&&1!==t,Boolean(c)&&1!==t),g=!0})),g}))}return{idCount:a}}dl(t,e){Array.isArray(t)||(t=[t]),this.tl=he(this.tl,t,{canReturnB:!0}),this.il+=t.length;const i=e||ti(t);return this.sl=this.sl?ii(this.sl,i):i,this}Oe(t){return this.gu="function"==typeof t?t(this.gu):t,this}pu(){return this.gu}Nm(t){return this.Cv="function"==typeof t?t(this.Cv):t,this}yH(){return this.Cv}St(){return this.sl?Math.max(this.sl.max.x,this.Ka.max.x):this.Ka.max.x}vt(){return this.sl?Math.min(this.sl.min.x,this.Ka.min.x):this.Ka.min.x}bt(){return this.sl?Math.max(this.sl.max.y,this.Ka.max.y):this.Ka.max.y}xt(){return this.sl?Math.min(this.sl.min.y,this.Ka.min.y):this.Ka.min.y}mv(){return this.sl?Math.max(this.sl.max.z,this.Ka.max.z):this.Ka.max.z}vv(){return this.sl?Math.min(this.sl.min.z,this.Ka.min.z):this.Ka.min.z}Cl(){return Te(this.gu)}kl(){return Te(this.gu)}Sv(){return Te(this.gu)}nl(){return this.bu}rl(){return this.tl}fl(){return this.qa}Al(){return this.il}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=void 0,this}dispose(){return super.dispose(),this.zW.FW(),this.zG={},this}KR(){return this.dispose(),this}}const tp=(t,e)=>Km(t,e>50?20:e>20?16:e>10?12:e>5?8:6),ep=(t,e)=>{const i=e.getSize();return qm(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class ip extends Hm{constructor(t,e,i){super(t,e,i),this.jY="disabled",this.mH=!1,this.vH=!1,this.SH={x:1,y:1,z:1},this.zS={x:0,y:0,z:0},this.ES={x:0,y:0,z:0},this.VS={x:0,y:0,z:0},this.OS={x:1,y:1,z:1},this.xH=Ay.projectionOrthographic(-1,1,-1,1,1,-1),this.bH=Ay.projectionOrthographic(-1,1,-1,1,1,-1),this.MH=!1,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleValuePalette:()=>H(this.we)&&"value"===this.we.lookUpProperty&&this.we}),this.we=Ir.fillStyle,this.nv._(jn)}Ls(t){var e;const i=this.nV(),s=this.No.C(),r=this.No.u,n=this.aa();this.PN.fillStyleSolid(n);const o=this.PN.fillStyleValuePalette(n),h=this.VS,a=this.OS;if(this.mH&&this._H&&(this._G=this.ZR.MV(this._H.vertices,void 0,this._G),this.wG=this.ZR.sO(this._H.indices,this.wG),this.wH=this._H.indices.length),"phong"===this.nv.C().type&&(i||this.mH)&&(null===(e=this._H)||void 0===e?void 0:e.normals)&&(this.CH=this.ZR.MV(this._H.normals,void 0,this.CH)),!this.kH&&o&&"value"===o.lookUpProperty&&this._H&&(this.kH=new Float32Array(this._H.vertices.length/3),this.vH=!0),this.kH&&this.vH&&(this.TH=this.ZR.MV(this.kH,void 0,this.TH)),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.kE=this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.nv.C().type,wireframe:!1}),Ug.Model3D({normalSource:"phong"===this.nv.C().type?"attribute":void 0})),this.RY=s?this.ZR.Mz(Ug["3D"],Ug.MousePicking({useVertexId:!0}),Ug.Model3D({normalSource:void 0})):void 0}if(this.MH){const t=Ay.projectionOrthographic(-1,1,-1,1,1,-1);this.bH=Ay.rotateXYZ(t,h),this.xH=Ay.translate(t,a.x/2,a.y/2,a.z/2),this.xH=Ay.rotateXYZ(this.xH,h),this.xH=Ay.translate(this.xH,-a.x/2,-a.y/2,-a.z/2),this.MH=!1}return this.nv.u=!1,this.da(this.we),this.No.u=!1,this.mH=!1,this.vH=!1,this}QL(t,e){const i=1===t?this.RY:this.kE,s=1===t,r=this.wG,n=this.wH,o=this._G,h=this.CH,a=this.TH,l=this.zS,u=this.ES,c=this.SH,d=this.OS,f=this.xH,g=this.bH,y=this.PN.fillStyleValuePalette(!1),m=this.PN.fillStyleSolid(!1),p=this.nv.C(),x={location:void 0,size:1};if(!(i&&o&&r&&n&&this._H))return{};const A=this._H.vertices.length;return this.ZR.wV(i,((S,v,b,M)=>{if(this.ZR.aE(i).XV(S("uScale"),this.ZY._E.IV()).XV(S("uDisp"),this.ZY._E.PV()).ZV(S("uViewProjectionMatrix"),this.rH).FV(S("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(S("uHighlightColorOffset"),this.jo).FV(S("uRenderEffectMask"),2===t?1:0),s)this.ZR.QV(S("uFirstId"),e).WO(b,A);else{if(this.we===B)return!1;if(m)this.ZR.TR(S("uColorDiffuse"),m.getColor());else if(y){if(!a)return!1;const t=y.getPalette();x.location=v("aLookupValue"),this.ZR.JO(b,t,void 0).CV(a,void 0,x)}}return"phong"!==p.type||s||(this.ZR.XV(S("uCameraLoc"),this.nH).XV(S("uLightLoc"),this.oH).FV(S("uAmbientReflection"),p.ambientReflection).FV(S("uSpecularReflection"),p.specularReflection).FV(S("uDiffuseReflection"),p.diffuseReflection).FV(S("uShininess"),p.shininess).TR(S("uLightColor"),p.specularColor).TR(S("uAmbientColor"),p.ambientColor).ZV(S("uModelRotationNormals"),g),h&&this.ZR.CV(h,void 0,{location:b.attribute("aNormal"),size:3})),this.ZR.ZV(S("uModelRotation"),f).XV(S("uModelScale"),[c.x,c.y,c.z]).XV(S("uLocationAxis"),[l.x,l.y,l.z]).XV(S("uModelAlignment"),[u.x,u.y,u.z]).XV(S("uModelSize"),[d.x,d.y,d.z]),this.ZR.CV(o,0,{location:b.attribute("aGeoPos"),size:3}).uO(r).dO(n,this.ZR.gl.TRIANGLES),!0})),{idCount:A}}FH(t){if(this.IH)return this.IH;const e=this.zS,i=this.ES,s=this.SH,r=this.OS,n=this.VS,o=this.ZY.Dx(e),h=[],a=Ay.projectionOrthographic(-1,1,-1,1,1,-1);let l=Ay.translate(a,r.x/2,r.y/2,r.z/2);l=Ay.rotateXYZ(l,n),l=Ay.translate(l,-r.x/2,-r.y/2,-r.z/2);const u=(i.x+1)*(r.x/2),c=(i.y+1)*(r.y/2),d=(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.ZY.Bx(s),h=this.ZY.jm(o);return{index:t,vertex:e,world:s,axis:o,dist:h?$e(h,n):Be}})))).flat();o.sort(((t,e)=>t.dist-e.dist));const h=o[0];if(!h)return;const a=this.kH?this.kH[h.index]:void 0;return{coordModel:h.vertex,coordAxis:h.axis,index:h.index,value:a}}dispose(){return super.dispose(),this._G&&(this.ZR.LV(this._G),this._G=void 0),this.wG&&(this.ZR.LV(this.wG),this.wG=void 0),this.CH&&(this.ZR.LV(this.CH),this.CH=void 0),this.TH&&(this.ZR.LV(this.TH),this.TH=void 0),this.kE=void 0,this.RY=void 0,this._H=void 0,this.kH=void 0,this}KR(){return this.dispose(),this}WS(t){return this._H=t,this.mH=!0,this.OS=t.modelSize,this}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}YS(t){return this.SH=t,this.IH=void 0,this}IV(){return this.SH}HS(t){return this.zS=t,this.IH=void 0,this}$S(t){return this.ES=t,this.IH=void 0,this}XS(t){return this.VS=t,this.MH=!0,this.IH=void 0,this}jS(t){return this.jY=t,this}ZS(){return this.jY}St(){return ze}vt(){return Be}bt(){return ze}xt(){return Be}mv(){return ze}vv(){return Be}Cl(){return 0}kl(){return 0}Sv(){return 0}aa(){return qr(this.la,this.we)}da(t){this.la=t}}class sp extends Hm{constructor(t,e,i,s){super(t,e,i),this.jY="cull-back",this.LM=[],this.zW=new sm(this.LM,(t=>t.vertexBuffer&&this.ZR.LV(t.vertexBuffer)),!1),this.bu=[],this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=Oe,this.el=!1,this.PN=dg({fillStyleSolid:()=>{const t=this.Fv.getFillStyle();return Y(t)&&t},fillStyleIndividual:()=>{const t=this.Fv.getFillStyle();return X(t)&&t},fillStylePalette:()=>{const t=this.Fv.getFillStyle();return H(t)&&t},triangulatedPointStyle:()=>{const t=this.Fv;return yr(t)&&t},wireframeLineStyleSolid:()=>{const t=yr(this.Fv)&&this.Fv,e=t&&t.getWireframeStyle();return ts(e)&&e},wireframeFillStyleSolid:()=>{const t=yr(this.Fv)&&this.Fv,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return Y(i)&&i}}),this.hl=void 0,this.Qn=s,this.Fv=Ir.pointStyle3D,this.nv._(jn);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&&X(e)&&e.getFallbackColor()||E,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;ete(t))(r,n,o,h);this.WW={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.Fv,this.Fv.fillStyle)}}TN(t,e,i,s,r){return{info:{dataPoint:this.bu[t-e]}}}Ls(t){const e=this.el,i=this.tl,s=this.il,r=s>0,n=this.Fv,o=this.Fv!==this.PH,h=this.No.C(),a=this.No.u,l=this.nV();this.sl&&(this.Ka=ii(this.Ka,this.sl),this.sl=void 0),r&&(this.bu=he(this.bu,i,{canReturnB:!0}),this.qa+=s);let u=i,c=s;if(e&&(this.LM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Oe})),this.zW.TW(),u=this.bu,c=this.qa),c>0){const t=Math.floor(this.bN.gH/(this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Ft(c,1e5,t);this.zW.MW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Oe,vertexBuffer:this.ZR.qV(t*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i))})),((t,e,i)=>{this.ZR.tO(t.vertexBuffer,t.existingCoordinatesCount*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.PN.fillStyleSolid(o),g=this.PN.fillStyleIndividual(o),y=this.PN.fillStylePalette(o),m=d===B&&B;if(o||l||a){let t;const e=n.getSize(),i=this.WW.individualPointColorEnabled,s=this.WW.individualPointSizeEnabled,r=this.WW.individualPointSizeAxisEnabled,a=this.WW.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw wt.alert(t),new Error(t)}if(y&&"value"===y.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw wt.alert(t),new Error(t)}const l=this.PN.wireframeLineStyleSolid(o),u=this.PN.wireframeFillStyleSolid(o);if(f||g||y||u){const i=g?"attribute":y?["lookup",y.getLookUpProperty(),y.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(yr(n)){const r=ne(n.getShape(),{cube:()=>Xm(this.ZR),sphere:()=>rp(this.ZR,n,s)});t={type:"instanced",shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:i,shadingStyle:this.nv.C().type,wireframe:!1!==u}),Ug.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:cg(this.At),normalSource:r.UY})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,fillStyleEmpty:m,mousePickingShader:h&&this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:cg(this.At),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else xr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.ZR.Mz(Ug["3D"],Ug.PointSize(c),Ug.Color({dataType:i}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,mousePickingShader:h&&this.ZR.Mz(Ug["3D"],Ug.PointSize(c),Ug.MousePicking({useVertexId:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}))})}this.zG=t}if(void 0===this.hl&&y&&"value"===y.lookUpProperty&&y.lut.percentageValues){let t=ze,e=Be;for(let i=0;it&&(t=s.value)}this.hl={min:e,max:t}}return this.el=!1,this.tl=[],this.il=0,this.PH=n,this.nv.u=!1,this}QL(t,e){const i=this.ZR.gl,s=this.zG,r=this.qa;if(!s)return{};const n=1===t?s.mousePickingShader:s.shader;if(!n)return{};const o=this.nv.C(),{fillStyleSolid:h,fillStylePaletted:a,useIndividualPointSize:l}=s,u="instanced"===s.type&&s.useIndividualPointSize3D,c="instanced"===s.type&&s.wireframe;return this.ZR.wV(n,((r,d,f,g)=>{let y=!1;if(this.ZR.aE(n).XV(r("uScale"),this.ZY._E.IV()).XV(r("uDisp"),this.ZY._E.PV()).ZV(r("uViewProjectionMatrix"),this.rH).FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0),"instanced"===s.type){const{pointSizeAxis:t,pointSizeNWU:e}=s;!1!==t&&!1===u&&this.ZR.XV(r("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===l&&this.ZR.FV(r("uOffsetNWU"),e).FV(g("uRatioNwuWu"),this.ZY.pH())}else if("primitive"===s.type){const{pointSizePixels:t}=s;l||this.ZR.FV(r("uPointSize"),t).FV(r("uDevicePixelRatio"),this.ZR.lV())}if(1===t);else if("instanced"===s.type?("phong"===o.type&&this.ZR.XV(r("uCameraLoc"),this.nH).XV(r("uLightLoc"),this.oH).FV(r("uAmbientReflection"),o.ambientReflection).FV(r("uSpecularReflection"),o.specularReflection).FV(r("uDiffuseReflection"),o.diffuseReflection).FV(r("uShininess"),o.shininess).TR(r("uLightColor"),o.specularColor).TR(r("uAmbientColor"),o.ambientColor),c&&this.ZR.FV(r("uWireframeThickness"),c.thickness).TR(r("uWireframeColor"),c.fillStyleSolid.getColor()),h&&this.ZR.TR(r("uColorDiffuse"),h.getColor()),s.fillStyleEmpty&&this.ZR.TR(r("uColorDiffuse"),k)):"primitive"===s.type&&h&&this.ZR.TR(r("uColor"),h.getColor()),a){const t=fg(a,this,this.hl);if(!t&&a.lut.percentageValues)return!1;this.ZR.JO(f,a.lut,t)}const m=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=m.Ut(e.existingDataPointsCount);this.ZR.QV(r("uFirstId"),t),"instanced"===s.type?this.ZR.YO(f,i):this.ZR.WO(f,i)}i.bindBuffer(i.ARRAY_BUFFER,e.vertexBuffer);const n=d("aPos");if(i.vertexAttribPointer(n,3,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(n,1),i.enableVertexAttribArray(n),s.fillStyleIndividual&&void 0!==this.WW.attributeOffsetColor&&1!==t){const t=d("aColor");i.vertexAttribPointer(t,4,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}if(l&&void 0!==this.WW.attributeOffsetSize){"instanced"===s.type?this.ZR.FV(g("uRatioNwuWu"),this.ZY.pH()):"primitive"===s.type&&this.ZR.FV(r("uDevicePixelRatio"),this.ZR.lV());const t=d("instanced"===s.type?"aOffsetNWU":"aPointSize");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}if(u&&void 0!==this.WW.attributeOffsetPointSize3D&&"instanced"===s.type){const t=d("aOffsetAxis");i.vertexAttribPointer(t,3,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}if(s.fillStylePaletted&&"value"===s.fillStylePaletted.getLookUpProperty()&&void 0!==this.WW.attributeOffsetLookUpValue&&1!==t){const t=d("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}"instanced"===s.type?(s.geometry.Jy(f,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(c)&&1!==t),y=!0):"primitive"===s.type&&(this.ZR.Jy(i.POINTS,e.existingCoordinatesCount),y=!0)})),y})),{idCount:r}}dl(t,e){Array.isArray(t)||(t=[t]),this.tl=he(this.tl,t,{canReturnB:!0}),this.il+=t.length;const i=e||ti(t);return this.sl=this.sl?ii(this.sl,i):i,this.hl=void 0,this}Iv(t){return this.Fv="function"==typeof t?t(this.Fv):t,this}DH(){return this.Fv}St(){return this.sl?Math.max(this.sl.max.x,this.Ka.max.x):this.Ka.max.x}vt(){return this.sl?Math.min(this.sl.min.x,this.Ka.min.x):this.Ka.min.x}bt(){return this.sl?Math.max(this.sl.max.y,this.Ka.max.y):this.Ka.max.y}xt(){return this.sl?Math.min(this.sl.min.y,this.Ka.min.y):this.Ka.min.y}mv(){return this.sl?Math.max(this.sl.max.z,this.Ka.max.z):this.Ka.max.z}vv(){return this.sl?Math.min(this.sl.min.z,this.Ka.min.z):this.Ka.min.z}Cl(){const t=this.Fv,e=t.getSize();return"number"==typeof e?yr(t)?e/2:xr(t)?5:0:0}kl(){return this.Cl()}Sv(){return this.Cl()}nl(){return this.bu}rl(){return this.tl}fl(){return this.qa}Al(){return this.il}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=void 0,this.hl=void 0,this}dispose(){return super.dispose(),this.zW.FW(),this.zG=void 0,this}KR(){return this.dispose(),this}}const rp=(t,e,i)=>{const s=e.getSize();return qm(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class np extends Hm{constructor(t,e,i,s){super(t,e,i),this.jY="disabled",this.we=Ir.fillStyle,this.SS=Ir.lineStyle,this.kU=p("bilinear"),this.BH=[],this.LH=void 0,this.zG={},this.RH=!1,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we,wireframeStyleLine:()=>ts(this.SS)&&this.SS,wireframeStyleFill:()=>{const t=this.SS&&this.SS.getFillStyle();return Y(t)&&t}}),this.Pi={x:0,z:0},this.mw={x:1,z:1},this.nv._(Hn);const r="columns"===s.dataOrder?s.columns:s.rows,n="columns"===s.dataOrder?s.rows:s.columns;this.Qn={...s,primaryDimensionVectorsCount:r,secondaryDimensionVectorsCount:n},this.EH=new Array(this.Qn.primaryDimensionVectorsCount).fill(void 0),this.h_=new vm(this.bN,t.bN.UU,t.ls.At,kt,[],this.Qn).xS(nt),this.h_.IU=ym;const o=this.h_.DU.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.h_.DU.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.zH={gridTiles:o,gridTileSizes:h,largestGridTileSize:a},this._S(this.Pi,this.mw)}TN(t,e,i,s,r){const n=t-e,o=n%(this.Qn.secondaryDimensionVectorsCount-1),h=Math.floor(n/(this.Qn.secondaryDimensionVectorsCount-1)),a="columns"===this.Qn.dataOrder?h:o,l="rows"===this.Qn.dataOrder?h:o,u=[{x:this.Pi.x+a*this.mw.x,z:this.Pi.z+l*this.mw.z,y:this.VH(h,o),intensity:this.OH(h,o),column:"columns"===this.Qn.dataOrder?h:o,row:"columns"===this.Qn.dataOrder?o:h},{x:this.Pi.x+(a+("columns"===this.Qn.dataOrder?1:0))*this.mw.x,z:this.Pi.z+(l+("rows"===this.Qn.dataOrder?1:0))*this.mw.z,y:this.VH(h+1,o),intensity:this.OH(h+1,o),column:"columns"===this.Qn.dataOrder?h+1:o,row:"columns"===this.Qn.dataOrder?o:h+1},{x:this.Pi.x+(a+1)*this.mw.x,z:this.Pi.z+(l+1)*this.mw.z,y:this.VH(h+1,o+1),intensity:this.OH(h+1,o+1),column:"columns"===this.Qn.dataOrder?h+1:o+1,row:"columns"===this.Qn.dataOrder?o+1:h+1},{x:this.Pi.x+(a+("columns"===this.Qn.dataOrder?0:1))*this.mw.x,z:this.Pi.z+(l+("rows"===this.Qn.dataOrder?0:1))*this.mw.z,y:this.VH(h,o+1),intensity:this.OH(h,o+1),column:"columns"===this.Qn.dataOrder?h:o+1,row:"columns"===this.Qn.dataOrder?o+1:h}],c=u.map((t=>this.ZY.jm(t))).map((t=>void 0===t?Be:$e(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]}}}}VH(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}OH(t,e){if(this.h_.FU)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]}}}NH(t){this.GH=t,this.LH=void 0}_S(t,e){this.Pi=t,this.mw=e;const i=this.Qn,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.mw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.mw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.mw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.mw.z)}},r=new Map;return this.zH.gridTiles.forEach((t=>{const e="columns"===this.Qn.dataOrder?{x:this.mw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.mw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.mw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.mw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.Qn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstVector.primary,z:this.Pi.z+this.mw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstVector.secondary,z:this.Pi.z+this.mw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.VU={WH:s,tilesInfo:r},this}wS(){return{start:this.Pi,step:this.mw,end:{x:this.Pi.x+this.mw.x*this.Qn.columns,z:this.Pi.z+this.mw.z*this.Qn.rows}}}Ls(t){const e=this.BH,i=qr(this.la,this.we),s=this.PN.fillStyleSolid(i),r=this.PN.fillStylePaletted(i),n=this.SS,o=this.SS!==this.BU,h=this.PN.wireframeStyleLine(o),a=this.PN.wireframeStyleFill(o),l=!1!==a,u=this.kU.u,c=this.kU.C(),d=this.nv.C(),f=this.nV(),g=this.No.C();this.h_.Ls();const y=this.h_.LU;if(!y)return this;this.UH=this.UH||this.YH(y);const m=this.UH;this.HH(m);const p=mm(e,m,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Am(this.ZR,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.RH=!0),"phong"===d.type&&(p.size>0||f)){const t=this.ZR.gl,e=this.ZR.Mz(Ug["2D"],Ug.DrawToNormalTexture({flipXZ:"rows"===this.Qn.dataOrder,vertexIdSource:this.ZR.GO(),normalTextureType:this.ZR.gl2?"uint":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN}));m.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.VU)||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.ZR._O.QL((()=>{this.ZR.wV(e,((r,n,h,l)=>(this.ZR.aE(e).WO(h,a).kV(r("uTileDimensionsXZ"),["columns"===this.Qn.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Qn.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).HV(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).kV(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).kV(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).TV(r("uHeightmapTexture"),s.heightmapDataTexture,1).Jy(t.POINTS,a),!0)))}),n,h,void 0,this.ls.Cn(),0)}))}))}const x=this.zG;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return x.mousePicking=g?this.zG.mousePicking||{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:"simple",wireframe:!1,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.zG=x,this.BH.length=0,this.la=this.we,this.BU=n,this.nv.u=!1,this}YH(t){const e=this.zH.gridTiles.map((e=>{const i=xm(this.ZR,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.zH.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.ZR.MV([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.ZR.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}HH(t){var e;if("phong"===this.nv.C().type)for(let i=0;i{t.normalmapTexture&&(this.ZR.qR(t.normalmapTexture),t.normalmapTexture=void 0)}))}QL(t,e){var i,s,r,n;const o=this.ZR.gl,h=this.UH;if(!h)return{};const a=this.nv.C(),l=this.zG,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.ZR.wV(u,((i,s,r,n)=>{let l=!1;if(this.ZR.aE(u).YO(r,this.zH.largestGridTileSize.cells).XV(i("uScale"),this.ZY._E.IV()).XV(i("uDisp"),this.ZY._E.PV()).ZV(i("uViewProjectionMatrix"),this.rH).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.ZR.XV(i("uCameraLoc"),this.nH).XV(i("uLightLoc"),this.oH).FV(i("uAmbientReflection"),a.ambientReflection).FV(i("uSpecularReflection"),a.specularReflection).FV(i("uDiffuseReflection"),a.diffuseReflection).FV(i("uShininess"),a.shininess).TR(i("uLightColor"),a.specularColor).TR(i("uAmbientColor"),a.ambientColor),c)){const{wireframeFillSolid:t,wireframeSolid:e}=c,s=e.getThickness()<0?1:e.getThickness();this.ZR.TR(i("uWireframeColor"),t.getColor()).FV(i("uWireframeThickness"),s)}return 1===t||"solid"===(null==d?void 0:d.fillMode)&&this.ZR.TR(i("uColorDiffuse"),d.fillStyleSolid.getColor()),h.gridTileSizes.forEach((n=>{this.ZR.kV(i("uTileDimensionsXZ"),["columns"===this.Qn.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.Qn.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).HV(i("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var u;const f=null===(u=this.VU)||void 0===u?void 0:u.tilesInfo.get(a.tileData);if(!f)return;let g=0,m=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.GH){const t=this.GH.fill.iFirstPrimary,e=this.GH.fill.iFirstPrimary+this.GH.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sy(Math.max(t,i),Math.min(e,s)))(t,e,i,s);g=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),m=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(g<0||m<=0)){if("intensity"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e=this.h_.hl;this.ZR.JO(r,t.lut,e).TV(i("uTileIntensityValues"),a.intensityDataTexture,2).$V(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.vv(),max:this.mv()}:void 0;if(!e&&t.lut.percentageValues)return;this.ZR.JO(r,t.lut,e)}1!==t&&"phong"===this.nv.C().type&&a.normalmapTexture&&this.ZR.TV(i("uNormalmapTexture"),a.normalmapTexture,3),1===t&&this.ZR.QV(i("uFirstId"),e+g),this.ZR.CV(h.rectangleLocationsBuffer,0,{location:s("aGeoCellOffset"),size:2},{location:c?s("aTriangleBary"):void 0,size:3}).QV(i("uBaseInstance"),g).kV(i("uTileStartLocationAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z]).kV(i("uTileSizeAxisXZ"),[f.sizeAxis.x,f.sizeAxis.z]).TV(i("uHeightmapTexture"),a.heightmapDataTexture,0).fO(h.rectangleLocationsDrawMode,0,h.rectangleLocationsDrawLength,m),l=!0,o.bindBuffer(o.ARRAY_BUFFER,null)}}))})),l})),{idCount:this.Qn.columns*this.Qn.rows}}dispose(){return super.dispose(),this.h_.dispose(),this.UH&&(this.UH.gridTileSizes.forEach((t=>{})),this.UH.gridTiles.forEach((t=>{this.ZR.qR(t.heightmapDataTexture),t.normalmapTexture&&this.ZR.qR(t.normalmapTexture)})),this.ZR.LV(this.UH.rectangleLocationsBuffer),this.UH=void 0),this.zG={},this}KR(){return this.dispose(),this.h_.KR(),this}FS(t){return this.h_.FS(t),this}IS(t){this.BH.push(t),pm(this.zH.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.EH[n];if(e)i=ie.max?s:e.max;else{e={min:Be,max:ze},this.EH[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.LH={min:i,max:s},this.LH}}class op extends Hm{constructor(t,e,i,s){super(t,e,i),this.jY="disabled",this.NU=0,this.WU={},this.XH=new Map,this.Pi={x:0,z:0},this.mw={x:1,z:1},this.Qn={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.WH={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.mw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.mw.z:this.Pi.z}};const r=()=>({shape:new np(this.ZY,kt,this.$o,{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.LM=[r(),r()]}Ls(t){this.LM.forEach((e=>{e.shape.Ls(t)}));const e=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Pt(null===(i=e.shape.h_.hl)||void 0===i?void 0:i.min,Be)),t.max=Math.max(t.max,Pt(null===(s=e.shape.h_.hl)||void 0===s?void 0:s.max,ze)),t}),{min:Be,max:ze}),i=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Pt(null===(i=e.shape.LH)||void 0===i?void 0:i.min,Be)),t.max=Math.max(t.max,Pt(null===(s=e.shape.LH)||void 0===s?void 0:s.max,ze)),t}),{min:Be,max:ze});return this.LM.forEach((t=>{t.shape.h_.hl=e,t.shape.LH=i})),this}QL(t,e){let i=0;return this.LM.forEach((s=>{if(!s.hasData)return;s.shape.rH=this.rH,s.shape.nH=this.nH,s.shape.oH=this.oH;const{idCount:r}=s.shape.QL(t,e+i);void 0!==r&&(this.XH.set(s,{idFirst:e+i,idCount:r}),i+=r)})),{idCount:i}}TN(t,e,i,s,r){const n=Array.from(this.XH).find((e=>je(t,e[1].idFirst,e[1].idFirst+e[1].idCount-1)));return n?n[0].shape.TN(t,n[1].idFirst,n[1].idCount,s,r):{}}_S(t,e){return this.Pi=t,this.mw=e,this.LM.forEach((t=>{t.shape._S("columns"===this.Qn.scrollDimension?{x:t.shape.wS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.wS().start.z},this.mw)})),"columns"===this.Qn.scrollDimension?(this.WH.min.z=t.z,this.WH.max.z=this.Pi.z+(this.Qn.rows-1)*this.mw.z):(this.WH.min.x=t.x,this.WH.max.x=this.Pi.x+(this.Qn.columns-1)*this.mw.x),this}wS(){return{start:this.Pi,step:this.mw}}Ot(){return this.NU=0,this.WU={},this.WH={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.Qn.scrollDimension?this.Pi.x+(this.Qn.columns-1)*this.mw.x:this.Pi.x,z:"columns"===this.Qn.scrollDimension?this.Pi.z+(this.Qn.rows-1)*this.mw.z:this.Pi.z}},this.LM.forEach((t=>{t.shape.setVisible(!1),t.shape.RH=!1,t.hasData=!1})),this}LS(t){var e;const i=this.LM[0],s=this.LM[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.NU/this.Qn.scrollDimensionSize)%this.LM.length,o=this.LM[e],h=this.NU%this.Qn.scrollDimensionSize,a=this.Qn.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,y=n+u,m=this.NU>=this.Qn.scrollDimensionSize&&c<=this.Qn.scrollDimensionSize-1,p=l;l&&(o.shape._S("columns"===this.Qn.scrollDimension?{x:this.Pi.x+(this.NU-1)*this.mw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.NU-1)*this.mw.z},this.mw),o.shape.setVisible(!0));const x=m?0:1,A=c+(m?1:0);o.shape.NH({fill:{iFirstPrimary:x,amountPrimary:A},wireframe:{iFirstPrimary:x,amountPrimary:A,connectNext:!1}});const S=o===i?s:i,v=c+1,b=1+this.Qn.scrollDimensionSize-v;S.shape.NH({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,y);let i=!1;p&&this.WU.yValues&&(i=!0,e.splice(0,0,this.WU.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Qn.staticDimensionSize,values:e,type:"y"};o.shape.IS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,y);let i=!1;p&&this.WU.intensityValues&&(i=!0,e.splice(0,0,this.WU.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Qn.staticDimensionSize,values:e,type:"intensity"};o.shape.FS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.NU+=u,n+=u,this.WU=M}while(ne.shape.kS(t))),this}TS(){return this.LM[0].shape.TS()}Ie(t){return this.LM.forEach((e=>e.shape.Ie(t))),this}Hh(){return this.LM[0].shape.Hh()}xS(t){return this.LM.forEach((e=>e.shape.xS(t))),this}CS(){return this.LM[0].shape.CS()}KR(){return this.dispose(),this.LM.forEach((t=>t.shape.KR())),this}dispose(){return super.dispose(),this.LM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.LM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}gv(t){return super.gv(t),this.LM.forEach((e=>e.shape.gv(t))),this}St(){return this.WH.max.x}vt(){return this.WH.min.x}bt(){return Math.max(this.LM[0].shape.bt(),this.LM[1].shape.bt())}xt(){return Math.min(this.LM[0].shape.xt(),this.LM[1].shape.xt())}mv(){return this.WH.max.z}vv(){return this.WH.min.z}Cl(){return 0}kl(){return 0}Sv(){return 0}us(t){return super.us(t),this.LM.forEach((e=>e.shape.us(t))),this}}class hp extends _m{constructor(t,e,i,s){super(t,e,i),this.jH=45,this.ZH=.1,this.QH=100,this.nH=f(0,0,1),this.JH=f(0,0,-1),this.KH=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.nv=new Zn,this.At=s}lx(){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.ls.oi();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.nH=t,this}getCameraLocation(){return this.nH}setCameraDirection(t){return this.JH=_e.normalize(t),this}getCameraDirection(){return this.JH}setLightLocation(t){return this.oH=t,this}getLightLocation(){return this.oH}qH(){return f(this.KH[0],this.KH[1],this.KH[2])}t$(){return f(this.KH[4],this.KH[5],this.KH[6])}}class ap extends hp{constructor(t,e,i,s){super(t,e,i,s),this._E=new Dy,this.i$=!0,this.s$="perspective",this.bN=t,this.gl=t._N(),this.GY=this.EY,this.e$=this.ls.Do((()=>{this.i$=!0})),this.h$=s.H((()=>{this.i$=!0}))}bV(t){const e=t.vt(),i=t.xt(),s=t.vv(),r=t.St(),n=t.bt(),o=t.mv();if(e===Be||r===ze||i===Be||n===ze||s===Be||o===ze)return Ne;const h=t.Cl(),a=t.kl(),l=t.Sv(),u=Math.abs(t.Is.$m(h)*t.At.x.rt()),c=Math.abs(t.Is.$m(a)*t.At.y.rt()),d=Math.abs(t.Is.$m(l)*t.At.z.rt()),f=e-u,g=r+u,y=i-c,m=n+c,p=s-d,x=o+d;let A;return[{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:x},{x:g,y,z:x},{x:f,y:m,z:x},{x:g,y:m,z:x}].map((e=>t.Is.jm(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};A=A?ei(A,{min:t,max:t}):e})),A||Ne}jm(t){if(this.r$(),this.n$(),!this.rH)return;const e=this._E.PV(),i=f(e[0],e[1],e[2]),s=this._E.IV(),r=f(s[0],s[1],s[2]),n=_e.divideVec(_e.subtractVec(t,i),r),o=this.rH,h=Ay.multiply(o,[n.x,n.y,n.z,1]),a=u(h[0]/h[3],h[1]/h[3]),l=this.ls.oi();return{x:.5*(1+a.x)*l.x,y:.5*(1+a.y)*l.y}}Dx(t){const e=this._E.PV(),i=this._E.IV(),s=_e.divideVec(_e.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}}Bx(t){const e=this._E.PV(),i=this._E.IV(),s=_e.addVec(_e.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}}$m(t){return t/1e3}pH(){return.001}Ls(){const t=this.nH,e=this.oH,i=this.At.x.u||this.At.y.u||this.At.z.u;if(!e)throw pe(0,(()=>xe()));const{viewProjectionMatrix:s}=this.r$();this.n$();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.EY.forEach((t=>{t.rH=s,t.nH=r,t.oH=n,t.Ls(i)})),this}Ix(t){this.s$!==t&&(this.s$=t,this.i$=!0)}Px(){return this.s$}r$(){if(!this.i$&&this.rH)return{viewProjectionMatrix:this.rH};const t=this.lx(),e=t.width/t.height;if("perspective"===this.s$)this.o$=Ay.projectionPerspective(this.jH,e,this.ZH,this.QH);else{let t,i;e>1?(t=.5,i=t/e):(i=.5,t=i*e),this.o$=Ay.projectionOrthographic(-t,t,-i,i,this.ZH,this.QH)}const i=this.nH;this.KH[12]=i.x,this.KH[13]=i.y,this.KH[14]=i.z;const s=this.JH,r=f(0,1,0),n=_e.multiply(s,-1),o=_e.normalize(_e.cross(r,n)),h=_e.normalize(_e.cross(n,o));this.KH[0]=o.x,this.KH[1]=o.y,this.KH[2]=o.z,this.KH[4]=h.x,this.KH[5]=h.y,this.KH[6]=h.z,this.KH[8]=n.x,this.KH[9]=n.y,this.KH[10]=n.z,this.a$=Ay.inverse(this.KH);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,y=(a.y+l.y/2)/u.y,m=Ay.multiply(Ay.translation(zn(-1,1,g),zn(-1,1,y),0),Ay.scaling(c,d,1));return this.rH=Ay.multiply(m,Ay.multiply(this.o$,this.a$)),this.l$=Ay.inverse(this.rH),this.i$=!1,{viewProjectionMatrix:this.rH}}n$(){this._E.gN(this.At.x),this._E.pN(this.At.y),this._E.yN(this.At.z)}QL(t,e,i){var s;const r=this.gl.lV(),n=this.lx(),o={x:n.x*r*e,y:n.y*r*e,width:n.width*r*e,height:n.height*r*e};this.gl.xV(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.GY.values());for(let e=0;e(this.$i||this.vn||ey(this.ZR.gl)||(t&&(this.u$=!0),this.dn=!0,this.m$||this.hn.bz(t)),this),this.m$=!1,this.kz=t=>{if(this.$i||this.vn)return;const e=t-this.c$;if(e>=this.ho||-1===this.ho){this.m$=!0,this.c$=t,this.u$=!1;const i=e>50?1e3/60:e;this.fn&&this.fn(i),this.dn=!1,-1!==this.ho&&this.u$&&(this.hn.bz(this.u$),this.dn=!0),this.os.Ls(e),this.Tn(),this.Fn(),this.An&&this.An(),this.m$=!1,this.R.emit("render"),this.dn&&this.xs(this.u$)}else this.dn=!0,this.hn.bz()},this.v$=new Map,this._N=()=>this.ZR,this.S$=()=>{var t,e,i;const s=this.Hn(),r=this.d$,n=wt.performance.now(),o=null===(t=this.x$)||void 0===t?void 0:t.b$.reduce(((t,e)=>t?e.M$&&t.M$&&e.M$>t.M$?e:t:e),void 0),h=null==o?void 0:o.M$,a=null===(e=this.Nn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.$n)||void 0===i?void 0:i.timeStamp,u=this._$;return r?(this.xs(!0),!1):void 0===o||(void 0===o||!o.w$)&&(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.C$=()=>{var t,e;this.k$=void 0;const i=null===(e=null===(t=this.x$)||void 0===t?void 0:t.T$)||void 0===e?void 0:e.F$;void 0===i||i>=this.f$||this.I$()},this.Fn=()=>{if(this.$i||this.vn)return this;const t=this.ZR.gl,e=wt.performance.now();this.ZR.vV(t.FRAMEBUFFER,this.hn.pz?this.az[0]:null);const i=this.Z,s=i.x>0&&i.y>0;if(this.wn.u&&this.ZR.pO(this.wn.C()),t.resize&&s&&t.resize(i.x*this.ZR.lV(),i.y*this.ZR.lV()),this.ZR.SV(0,0,i.x*this.ZR.lV(),i.y*this.ZR.lV()),this.ZR.xV(0,0,i.x*this.ZR.lV(),i.y*this.ZR.lV()),this.ZR.Ot(),s)for(const t of this.ln.values())t.QL(0,1,[]);if(this.Qn.io&&s&&(this.k$&&(wt.clearTimeout(this.k$),this.k$=void 0),this.S$()?(this.I$(),this.ZR.vV(t.FRAMEBUFFER,this.hn.pz?this.az[0]:null)):this.k$=wt.setTimeout(this.C$,500)),this.J(),this.sn(),this.Ln&&this.Bn(this.Ln),this.hn.pz){const e=this.ZR.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.az[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.az[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.sz),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),0),t.bindTexture(t.TEXTURE_2D,null);return this.ZR.vV(t.FRAMEBUFFER,null),ey(this.ZR.gl)?this.hn.tz(0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),[this]):this.hn.bz(),this.d$=!1,this.f$=e,this},this.Tn=()=>{if("use-window"===this.P$.mode){const t=wt.devicePixelRatio||1;this.ZR.FO(t)}const t=this.Z;if(0===t.x||0===t.y)return this;this.Ao.it(t);for(const t of this.ln.values())t.Ls();return this.J(),this},this.hn=t,this.hn.Az){this.D$=wt.document.createElement("canvas"),this.D$.style.width="100%",this.D$.style.height="100%",this.D$.style.display="block",this.D$.style.boxSizing="content-box",this.D$.style.position="absolute";const t=this.D$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new xt("No Canvas context available.");this.ez=t,this.Zr.appendChild(this.D$)}this.hn.Iz(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.hn.pz&&t.gl2&&(n=new s(this,this.Qn,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.Ki.isDark)),n||this.hn.pz||(n=new s(this,this.Qn,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.Ki.isDark)),!n)throw new xt("No WebGL context available");if(this.ZR=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.P$={mode:"fixed",value:e.devicePixelRatio},this.ZR.FO(e.devicePixelRatio);else{const t=wt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=wt.devicePixelRatio||1;this.P$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.ZR.FO(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.co=this.B$(o),this.fo=this.B$(h),this.L$(this.co,this.fo),this.UU=this.GF("engine offscreen",1e6),this.R$=this.GF("engine bg",0);const a="function"==typeof this.Ki.lcjsBackgroundFillStyle?this.Ki.lcjsBackgroundFillStyle(this.Qn.Zs):this.Ki.lcjsBackgroundFillStyle;this.Ao=this.R$.Pe(this.At).Ie(a).Fe(this.Ki.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Be({x:0,y:0});const l=this.GF("engine effects",200001).WY(this.Ki.effect);this.ss=l;const u=this.hn.pz,d=this.oi();u&&(this.az=[n.zV(),n.zV()]);const f=this.ZR.gl;u&&(this.A$=f.createRenderbuffer(),this.g$=f.createRenderbuffer()),this.sz=f.createTexture();const g=d.x*this.ZR.lV(),y=d.y*this.ZR.lV();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.A$);const t=this.ZR.gl2.ctx;this.p$=this.hn.XE&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.p$,t.RGBA8,g,y),f.bindRenderbuffer(f.RENDERBUFFER,this.g$),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,y),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.p$,t.DEPTH_COMPONENT16,g,y)}u&&(this.ZR.vV(f.FRAMEBUFFER,this.az[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.A$),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.g$)),f.bindTexture(f.TEXTURE_2D,this.sz),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,y,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.ZR.vV(f.FRAMEBUFFER,this.az[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.sz,0)),this.ZR.vV(f.FRAMEBUFFER,null),this.Mn(),this.sn(),this.cp=Cr(this),this.dp={Ki:this.Ki,os:this.os,At:this.At,xs:t=>this.xs(t),Hn:()=>this.Hn(),vs:t=>(this._$=wt.performance.now(),this.vs({x:t.clientX,y:t.clientY})),ID:t=>this.ID(t),Qn:this.Qn,Xn:t=>this.Xn(t),ss:this.ss,Vo:t=>this.Vo(t),Oo:t=>this.Oo(t),Vg:{zg:(t,e,i)=>this.ZR.Xh(e.family).uE(t,e,i,this.Ki.isDark)}};const m=()=>{this.Y()};wt.addEventListener("unload",m),this.gn.push((()=>{wt.removeEventListener("unload",m)}))}get E$(){return this.ln}rn(t,e){let i=this.v$.get(t);if(!i){const e=this.ZR.RO(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.v$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{PD:()=>e.Qz,DD:t=>{e.Qz?t():o.push(t)}}},this.v$.set(t,i),e.aE(this),e.eV((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new no(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}ID(t){const e=Array.from(this.v$.values()).find((e=>e.instances.has(t)));if(!e)throw pe(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}vs(t){var e;const i=null===(e=this.x$)||void 0===e?void 0:e.T$;if(!i)return;const s=this.Re(t.x,t.y),r=Math.round(s.x*this.ZR.lV()),n=Math.round(s.y*this.ZR.lV());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.z$(i,r+t[0]/i.V$,n+t[1]/i.V$))).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)}z$(t,e,i){const s=Math.round(e*t.V$),r=Math.round(i*t.V$);if(s<0||s>=t.Z.x||r<0||r>=t.Z.y)return;const n=4*(s+r*t.Z.x),o=t.O$[n+0],h=t.O$[n+1],a=t.O$[n+2],l=t.O$[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.N$.find((t=>u>=t.idFirst&&u<=t.idLast));if(!c)return;const{collectionMember:d,info:f}=c.entity.TN(u,c.idFirst,c.idCount,e,i);return{entity:c.entity,collectionMember:d,entityIndex:c.entityIndex,layerIndex:c.layer.Pn(),info:f}}Kr(t,e,i){const s=this.ZR.gl;this.hn.pz?(this.ZR.vV(s.FRAMEBUFFER,this.az[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.sz,0)):this.ZR.vV(s.FRAMEBUFFER,null);const r=this.iz(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.hn.pz||this.Fn(),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.hn.pz&&(this.ZR.vV(s.FRAMEBUFFER,this.az[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.A$),this.ZR.vV(s.FRAMEBUFFER,this.az[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.sz,0)),this.ZR.vV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=wt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof zm))throw new Error("Unexpected Engine Layer error");return i}return this.In(new zm(this,e,t))}YF(t,e,i){const s=this.vo(e);if(s){if(pe(0,(()=>{})),!(s instanceof ap))throw new Error("Unexpected Engine Layer error");return s}return this.In(new ap(this,e,t,i))}oi(){return this.Z}iz(){const t=this.ZR.lV();return{x:Math.round(this.Z.x*t),y:Math.round(this.Z.y*t)}}B$(t){return t instanceof Array||(t=[t,t]),t}G$(){return this.hn.hz}W$(){return ey(this.ZR.gl)}I$(){var t;const e=this.ZR.gl,i=wt.performance.now(),s=this.Qn.qn,r={x:Math.ceil(this.Z.x*this.ZR.lV()*s),y:Math.ceil(this.Z.y*this.ZR.lV()*s)};this.x$||(this.x$={V$:s,U$:r,b$:[],T$:void 0});let n=this.x$.b$.find((t=>!t.w$)),o=!1;n||(o=!0,n={w$:!1,Z:r,jO:e.createTexture(),Y$:this.ZR.zV(),g$:this.ZR.VV(),H$:new Uint8Array,M$:void 0},this.x$.b$.push(n));const h=n;(o||h.Z.x!==r.x||h.Z.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.jO),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.ZR.vV(e.FRAMEBUFFER,h.Y$),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.jO,0),e.bindRenderbuffer(e.RENDERBUFFER,h.g$),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.g$),h.H$=new Uint8Array(r.x*r.y*4),h.Z=r),h.w$=!0,h.M$=i,this.ZR.vV(e.FRAMEBUFFER,h.Y$),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.ZR.SV(0,0,r.x,r.y);const a=[];for(const t of this.ln.values())t.QL(1,s,a);this.ZR.vV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.ZR.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.x$){const t=this.x$.T$;if(t&&t.F$>i)return;this.x$.T$={F$:i,V$:s,Z:r,O$:h.H$,N$:a}}};l?this.ZR.HO(l,h.Y$,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.H$).then((()=>{this.$i||(h.w$=!1,u())})).catch((t=>{this.$i||(h.w$=!1,wt.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.ZR.$O(h.Y$,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.H$),h.w$=!1,u())}Mn(t){const e=this.ZR.lV();if("use-window"===this.P$.mode){const t=wt.devicePixelRatio||1;this.ZR.FO(t)}const i=this.Z.x,s=this.Z.y,r=t||{x:this.Zr.offsetWidth,y:this.Zr.offsetHeight},n=this.ZR.lV();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.ZR.gl;this.hn.Az&&this.ez&&(this.ez.canvas.width=t,this.ez.canvas.height=e);const s=this.hn.pz;if(this.sz&&(i.bindTexture(i.TEXTURE_2D,this.sz),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),s){const s=this.ZR.gl2.ctx;this.A$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.A$),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.p$,s.RGBA8,t,e)),this.g$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.g$),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.$i||(super.Y(),this.k$&&(wt.clearTimeout(this.k$),this.k$=void 0),Array.from(this.ZR.zE.entries()).forEach((([t,e])=>{e.KR(!1),this.ZR.zE.delete(t)})),Array.from(this.ZR.WV.values()).forEach((t=>{t.unbindResources()})),this.ZR.WV.clear(),this.ZR.GV.Yz(),this.ZR.wO.Y(),this.ZR.LV(this.ZR.CO),this.ZR.LV(this.ZR.kO),this.ZR.xO.forEach(((t,e)=>{this.ZR.gl.deleteBuffer(e)})),this.ZR.xO.clear(),this.ZR.NO&&(this.ZR.LV(this.ZR.NO.buffer),this.ZR.NO=void 0),this.ZR.NV(this.az[0]),this.ZR.NV(this.az[1]),this.ZR.OV(this.A$),this.ZR.qR(this.sz),this.ZR.OV(this.g$),this.x$&&(this.x$.b$.forEach((t=>{this.ZR.OV(t.g$),this.ZR.NV(t.Y$),this.ZR.qR(t.jO)})),this.x$=void 0),this.ZR.mO.forEach((t=>this.ZR.LV(t))),this.v$.clear(),this.hn.Dz(this),this.D$&&(null===(t=this.D$.parentElement)||void 0===t||t.removeChild(this.D$),this.D$=void 0),this.ez&&(this.ez=void 0),this.ZR.gl=void 0)}}var up="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},cp={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.sV(t||0,e||10,i||"be"))}var n;"object"==typeof cp?cp.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.sV=function(t,e,s){if("number"==typeof t)return this.$$(t,e,s);if("object"==typeof t)return this.X$(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.j$(t,r):this.Z$(t,e,r),"-"===t[0]&&(this.negative=1),this.Q$(),"le"===s&&this.X$(this.toArray(),e,s)},r.prototype.$$=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.X$(this.toArray(),e,s)},r.prototype.X$=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.Q$()},r.prototype.j$=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.Q$()},r.prototype.Z$=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.tX()},r.prototype.tX=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.Q$()}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 y=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?y+s:u[l-y.length]+y+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.Q$();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.iX=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.eX=function(t){return 32-Math.clz32(t)}:r.prototype.eX=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.hX=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.eX(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.q$(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.Q$()},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.q$(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.tX()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.tX();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,y=f>>>13,m=0|o[2],p=8191&m,x=m>>>13,A=0|o[3],S=8191&A,v=A>>>13,b=0|o[4],M=8191&b,w=b>>>13,C=0|o[5],T=8191&C,R=C>>>13,E=0|o[6],k=8191&E,I=E>>>13,F=0|o[7],D=8191&F,P=F>>>13,L=0|o[8],V=8191&L,_=L>>>13,B=0|o[9],z=8191&B,N=B>>>13,O=0|h[0],U=8191&O,Y=O>>>13,G=0|h[1],X=8191&G,Z=G>>>13,H=0|h[2],W=8191&H,j=H>>>13,K=0|h[3],$=8191&K,Q=K>>>13,q=0|h[4],J=8191&q,tt=q>>>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,yt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var mt=(l+(s=Math.imul(c,U))|0)+((8191&(r=(r=Math.imul(c,Y))+Math.imul(d,U)|0))<<13)|0;l=((n=Math.imul(d,Y))+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(g,U),r=(r=Math.imul(g,Y))+Math.imul(y,U)|0,n=Math.imul(y,Y);var pt=(l+(s=s+Math.imul(c,X)|0)|0)+((8191&(r=(r=r+Math.imul(c,Z)|0)+Math.imul(d,X)|0))<<13)|0;l=((n=n+Math.imul(d,Z)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,U),r=(r=Math.imul(p,Y))+Math.imul(x,U)|0,n=Math.imul(x,Y),s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(y,X)|0,n=n+Math.imul(y,Z)|0;var xt=(l+(s=s+Math.imul(c,W)|0)|0)+((8191&(r=(r=r+Math.imul(c,j)|0)+Math.imul(d,W)|0))<<13)|0;l=((n=n+Math.imul(d,j)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(S,U),r=(r=Math.imul(S,Y))+Math.imul(v,U)|0,n=Math.imul(v,Y),s=s+Math.imul(p,X)|0,r=(r=r+Math.imul(p,Z)|0)+Math.imul(x,X)|0,n=n+Math.imul(x,Z)|0,s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,j)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,j)|0;var At=(l+(s=s+Math.imul(c,$)|0)|0)+((8191&(r=(r=r+Math.imul(c,Q)|0)+Math.imul(d,$)|0))<<13)|0;l=((n=n+Math.imul(d,Q)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(M,U),r=(r=Math.imul(M,Y))+Math.imul(w,U)|0,n=Math.imul(w,Y),s=s+Math.imul(S,X)|0,r=(r=r+Math.imul(S,Z)|0)+Math.imul(v,X)|0,n=n+Math.imul(v,Z)|0,s=s+Math.imul(p,W)|0,r=(r=r+Math.imul(p,j)|0)+Math.imul(x,W)|0,n=n+Math.imul(x,j)|0,s=s+Math.imul(g,$)|0,r=(r=r+Math.imul(g,Q)|0)+Math.imul(y,$)|0,n=n+Math.imul(y,Q)|0;var St=(l+(s=s+Math.imul(c,J)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,J)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(T,U),r=(r=Math.imul(T,Y))+Math.imul(R,U)|0,n=Math.imul(R,Y),s=s+Math.imul(M,X)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,Z)|0,s=s+Math.imul(S,W)|0,r=(r=r+Math.imul(S,j)|0)+Math.imul(v,W)|0,n=n+Math.imul(v,j)|0,s=s+Math.imul(p,$)|0,r=(r=r+Math.imul(p,Q)|0)+Math.imul(x,$)|0,n=n+Math.imul(x,Q)|0,s=s+Math.imul(g,J)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(y,J)|0,n=n+Math.imul(y,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(k,U),r=(r=Math.imul(k,Y))+Math.imul(I,U)|0,n=Math.imul(I,Y),s=s+Math.imul(T,X)|0,r=(r=r+Math.imul(T,Z)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Z)|0,s=s+Math.imul(M,W)|0,r=(r=r+Math.imul(M,j)|0)+Math.imul(w,W)|0,n=n+Math.imul(w,j)|0,s=s+Math.imul(S,$)|0,r=(r=r+Math.imul(S,Q)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,Q)|0,s=s+Math.imul(p,J)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(x,J)|0,n=n+Math.imul(x,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(y,it)|0,n=n+Math.imul(y,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(D,U),r=(r=Math.imul(D,Y))+Math.imul(P,U)|0,n=Math.imul(P,Y),s=s+Math.imul(k,X)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(I,X)|0,n=n+Math.imul(I,Z)|0,s=s+Math.imul(T,W)|0,r=(r=r+Math.imul(T,j)|0)+Math.imul(R,W)|0,n=n+Math.imul(R,j)|0,s=s+Math.imul(M,$)|0,r=(r=r+Math.imul(M,Q)|0)+Math.imul(w,$)|0,n=n+Math.imul(w,Q)|0,s=s+Math.imul(S,J)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(v,J)|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(x,it)|0,n=n+Math.imul(x,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(y,nt)|0,n=n+Math.imul(y,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(V,U),r=(r=Math.imul(V,Y))+Math.imul(_,U)|0,n=Math.imul(_,Y),s=s+Math.imul(D,X)|0,r=(r=r+Math.imul(D,Z)|0)+Math.imul(P,X)|0,n=n+Math.imul(P,Z)|0,s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,j)|0)+Math.imul(I,W)|0,n=n+Math.imul(I,j)|0,s=s+Math.imul(T,$)|0,r=(r=r+Math.imul(T,Q)|0)+Math.imul(R,$)|0,n=n+Math.imul(R,Q)|0,s=s+Math.imul(M,J)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,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(x,nt)|0,n=n+Math.imul(x,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(y,at)|0,n=n+Math.imul(y,lt)|0;var wt=(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)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,U),r=(r=Math.imul(z,Y))+Math.imul(N,U)|0,n=Math.imul(N,Y),s=s+Math.imul(V,X)|0,r=(r=r+Math.imul(V,Z)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,Z)|0,s=s+Math.imul(D,W)|0,r=(r=r+Math.imul(D,j)|0)+Math.imul(P,W)|0,n=n+Math.imul(P,j)|0,s=s+Math.imul(k,$)|0,r=(r=r+Math.imul(k,Q)|0)+Math.imul(I,$)|0,n=n+Math.imul(I,Q)|0,s=s+Math.imul(T,J)|0,r=(r=r+Math.imul(T,tt)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(w,it)|0,n=n+Math.imul(w,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(x,at)|0,n=n+Math.imul(x,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(y,ct)|0,n=n+Math.imul(y,dt)|0;var Ct=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,yt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,yt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,X),r=(r=Math.imul(z,Z))+Math.imul(N,X)|0,n=Math.imul(N,Z),s=s+Math.imul(V,W)|0,r=(r=r+Math.imul(V,j)|0)+Math.imul(_,W)|0,n=n+Math.imul(_,j)|0,s=s+Math.imul(D,$)|0,r=(r=r+Math.imul(D,Q)|0)+Math.imul(P,$)|0,n=n+Math.imul(P,Q)|0,s=s+Math.imul(k,J)|0,r=(r=r+Math.imul(k,tt)|0)+Math.imul(I,J)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(T,it)|0,r=(r=r+Math.imul(T,st)|0)+Math.imul(R,it)|0,n=n+Math.imul(R,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(w,nt)|0,n=n+Math.imul(w,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(x,ct)|0,n=n+Math.imul(x,dt)|0;var Tt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,yt)|0)+Math.imul(y,gt)|0))<<13)|0;l=((n=n+Math.imul(y,yt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,W),r=(r=Math.imul(z,j))+Math.imul(N,W)|0,n=Math.imul(N,j),s=s+Math.imul(V,$)|0,r=(r=r+Math.imul(V,Q)|0)+Math.imul(_,$)|0,n=n+Math.imul(_,Q)|0,s=s+Math.imul(D,J)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(P,J)|0,n=n+Math.imul(P,tt)|0,s=s+Math.imul(k,it)|0,r=(r=r+Math.imul(k,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(T,nt)|0,r=(r=r+Math.imul(T,ot)|0)+Math.imul(R,nt)|0,n=n+Math.imul(R,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(w,at)|0,n=n+Math.imul(w,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 Rt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,yt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,yt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(z,$),r=(r=Math.imul(z,Q))+Math.imul(N,$)|0,n=Math.imul(N,Q),s=s+Math.imul(V,J)|0,r=(r=r+Math.imul(V,tt)|0)+Math.imul(_,J)|0,n=n+Math.imul(_,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(P,it)|0,n=n+Math.imul(P,st)|0,s=s+Math.imul(k,nt)|0,r=(r=r+Math.imul(k,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(T,at)|0,r=(r=r+Math.imul(T,lt)|0)+Math.imul(R,at)|0,n=n+Math.imul(R,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(w,ct)|0,n=n+Math.imul(w,dt)|0;var Et=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(r=(r=r+Math.imul(S,yt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,yt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,J),r=(r=Math.imul(z,tt))+Math.imul(N,J)|0,n=Math.imul(N,tt),s=s+Math.imul(V,it)|0,r=(r=r+Math.imul(V,st)|0)+Math.imul(_,it)|0,n=n+Math.imul(_,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(P,nt)|0,n=n+Math.imul(P,ot)|0,s=s+Math.imul(k,at)|0,r=(r=r+Math.imul(k,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(T,ct)|0,r=(r=r+Math.imul(T,dt)|0)+Math.imul(R,ct)|0,n=n+Math.imul(R,dt)|0;var kt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,yt)|0)+Math.imul(w,gt)|0))<<13)|0;l=((n=n+Math.imul(w,yt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(N,it)|0,n=Math.imul(N,st),s=s+Math.imul(V,nt)|0,r=(r=r+Math.imul(V,ot)|0)+Math.imul(_,nt)|0,n=n+Math.imul(_,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(P,at)|0,n=n+Math.imul(P,lt)|0,s=s+Math.imul(k,ct)|0,r=(r=r+Math.imul(k,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(T,gt)|0)|0)+((8191&(r=(r=r+Math.imul(T,yt)|0)+Math.imul(R,gt)|0))<<13)|0;l=((n=n+Math.imul(R,yt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(N,nt)|0,n=Math.imul(N,ot),s=s+Math.imul(V,at)|0,r=(r=r+Math.imul(V,lt)|0)+Math.imul(_,at)|0,n=n+Math.imul(_,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(P,ct)|0,n=n+Math.imul(P,dt)|0;var Ft=(l+(s=s+Math.imul(k,gt)|0)|0)+((8191&(r=(r=r+Math.imul(k,yt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,yt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(N,at)|0,n=Math.imul(N,lt),s=s+Math.imul(V,ct)|0,r=(r=r+Math.imul(V,dt)|0)+Math.imul(_,ct)|0,n=n+Math.imul(_,dt)|0;var Dt=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,yt)|0)+Math.imul(P,gt)|0))<<13)|0;l=((n=n+Math.imul(P,yt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(N,ct)|0,n=Math.imul(N,dt);var Pt=(l+(s=s+Math.imul(V,gt)|0)|0)+((8191&(r=(r=r+Math.imul(V,yt)|0)+Math.imul(_,gt)|0))<<13)|0;l=((n=n+Math.imul(_,yt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,yt))+Math.imul(N,gt)|0))<<13)|0;return l=((n=Math.imul(N,yt))+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=mt,a[1]=pt,a[2]=xt,a[3]=At,a[4]=St,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=wt,a[9]=Ct,a[10]=Tt,a[11]=Rt,a[12]=Et,a[13]=kt,a[14]=It,a[15]=Ft,a[16]=Dt,a[17]=Pt,a[18]=Lt,0!==l&&(a[19]=l,i.length++),i};function y(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.Q$()}function m(t,e,i){return y(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?y(this,t,e):m(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),m(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.Q$()},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.Q$();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.Q$()},r.prototype.nX=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.eX(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.rX(n,d,c);0!==s.negative;)d--,s.negative=0,s.rX(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.Q$(),s.Q$(),"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.nX(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.Q$(),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,y=1;!(s.words[0]&y)&&g<26;++g,y<<=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.oX=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.Q$(),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).aX(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.aX=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.aX(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.lX(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.lX(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.uX(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.uX(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.uX(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.uX(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.uX(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.uX(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function x(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.cX()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.dX(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 w(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.oX(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)}x.prototype.cX=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},x.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.Q$(),i},x.prototype.split=function(t,e){t.iushrn(this.n,0,e)},x.prototype.imulK=function(t){return t.imul(this.k)},s(A,x),A.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},A.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.dX=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new A;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.uX=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.lX=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).aX(this):(a(t,t.umod(this.m).aX(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).aX(this)},M.prototype.add=function(t,e){this.lX(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.aX(this)},M.prototype.iadd=function(t,e){this.lX(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.lX(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.aX(this)},M.prototype.isub=function(t,e){this.lX(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.uX(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.lX(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.lX(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 y=f,m=0;0!==y.cmp(h);m++)y=y.redSqr();i(m=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 w(t)},s(w,M),w.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},w.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},w.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.aX(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).aX(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.aX(this)},w.prototype.invm=function(t){return this.imod(t.oX(this.m).mul(this.r2)).aX(this)}}(0,up);var dp=cp.exports;function fp(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 gp=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},yp=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 mp{constructor(t,e){this.type=t,this.p=new dp(e.p,16),this.red=e.prime?dp.red(e.prime):dp.mont(this.p),this.zero=new dp(0).toRed(this.red),this.one=new dp(1).toRed(this.red),this.two=new dp(2).toRed(this.red),this.n=e.n&&new dp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.fX=new Array(4),this.AX=new Array(4),this.gX=new Array(4),this.pX=new Array(4),this.yX=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.mX=!0,this.redN=this.n.toRed(this.red))}vX(t,e){const i=t.SX(),s=gp(e,1,this.yX);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}MX(t,e,i,s,r){const n=this.fX,o=this.AX,h=this.gX;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]=gp(i[s],n[s],this.yX),h[r]=gp(i[r],n[r],this.yX),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=yp(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)}SX(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 dp(t.a,16),b:new dp(t.b,16)}))):this.PX(i),{beta:e,lambda:i,basis:s}}IX(t){const e=t===this.p?this.red:dp.mont(t),i=new dp(2).toRed(e).redInvm(),s=i.redNeg(),r=new dp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}PX(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 dp(1),g=new dp(0),y=new dp(0),m=new dp(1),p=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=y.sub(t.mul(f));const o=m.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,y=f,f=u,m=g,g=o}o=l.neg(),h=u;const x=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(x)>=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}]}DX(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 Ap(this,t,e,i)}pointFromX(t,e){(t=new dp(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)}BX(t,e,i){const s=this.TX,r=this.FX;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 dp(t,16),this.isInfinity()?this:this.CX(t)?this.curve.vX(this,t):this.curve.endo?this.curve.BX([this],[t]):this.curve.xX(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.BX(s,r):this.curve.MX(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.BX(s,r,!0):this.curve.MX(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 Sp 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 dp(0)):(this.x=new dp(e,16),this.y=new dp(i,16),this.z=new dp(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 Sp(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 vp{constructor(t){this.curve=new xp(t),this.g=this.curve.g,this.n=this.curve.n}}const bp={};var Mp;bp.PresetCurve=vp,Mp={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(bp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new vp(Mp);return Object.defineProperty(bp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class wp{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.zX(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof wp?e:new wp(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}zX(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 Cp(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 Tp{constructor(){this.place=0}}class Rp{constructor(t,e){if(t instanceof Rp)return t;this.VX(t,e)||(this.r=new dp(t.r,16),this.s=new dp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}VX(t,e){t=fp(t,e);const i=new Tp;if(48!==t[i.place++])return!1;const s=Cp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Cp(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=Cp(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 dp(n),this.s=new dp(h),this.recoveryParam=null,!0}}class Ep{constructor(t){if(!(this instanceof Ep))return new Ep(t);"string"==typeof t&&(t=bp[t]),t instanceof bp.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 wp.fromPublic(this,t,e)}OX(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.OX(new dp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new Rp(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.mX){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 kp,Ip={exports:{}};Ip.exports=(kp=kp||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!==up&&up.crypto&&(i=up.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._w=new a.init,this.NX=0},GX:function(t){"string"==typeof t&&(t=d.parse(t)),this._w.concat(t),this.NX+=t.sigBytes},WX:function(e){var i,s=this._w,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.UX,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,m=l[f-2],p=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;l[f]=y+l[f-7]+p+l[f-16]}var x=s&r^s&n^r&n,A=(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+(A+x)|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},$X:function(){var t=this._w,i=t.words,s=8*this.NX,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.WX(),this.ZX},clone:function(){var t=n.clone.call(this);return t.ZX=this.ZX.clone(),t}});i.SHA256=n.XX(u),i.HmacSHA256=n.jX(u)}(Math),t.SHA256}(Ip.exports),Vp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({HX:function(){this.ZX=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},$X:function(){var t=r.$X.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.XX(n),e.HmacSHA224=r.jX(n),t.SHA224;var e,i,s,r,n}(Ip.exports),_p={exports:{}}.exports=Ip.exports.enc.Hex,Bp={exports:{}}.exports=Ip.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.QX;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.QX,r=this.JX;if(!r){r=this.JX=[];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)},QX:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Ip.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({HX:function(){this.ZX=new r.init([1732584193,4023233417,2562383102,271733878])},YX: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.ZX.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],y=t[e+4],m=t[e+5],p=t[e+6],x=t[e+7],A=t[e+8],S=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],w=t[e+13],C=t[e+14],T=t[e+15],R=n[0],E=n[1],k=n[2],I=n[3];R=l(R,E,k,I,o,7,h[0]),I=l(I,R,E,k,a,12,h[1]),k=l(k,I,R,E,f,17,h[2]),E=l(E,k,I,R,g,22,h[3]),R=l(R,E,k,I,y,7,h[4]),I=l(I,R,E,k,m,12,h[5]),k=l(k,I,R,E,p,17,h[6]),E=l(E,k,I,R,x,22,h[7]),R=l(R,E,k,I,A,7,h[8]),I=l(I,R,E,k,S,12,h[9]),k=l(k,I,R,E,v,17,h[10]),E=l(E,k,I,R,b,22,h[11]),R=l(R,E,k,I,M,7,h[12]),I=l(I,R,E,k,w,12,h[13]),k=l(k,I,R,E,C,17,h[14]),R=u(R,E=l(E,k,I,R,T,22,h[15]),k,I,a,5,h[16]),I=u(I,R,E,k,p,9,h[17]),k=u(k,I,R,E,b,14,h[18]),E=u(E,k,I,R,o,20,h[19]),R=u(R,E,k,I,m,5,h[20]),I=u(I,R,E,k,v,9,h[21]),k=u(k,I,R,E,T,14,h[22]),E=u(E,k,I,R,y,20,h[23]),R=u(R,E,k,I,S,5,h[24]),I=u(I,R,E,k,C,9,h[25]),k=u(k,I,R,E,g,14,h[26]),E=u(E,k,I,R,A,20,h[27]),R=u(R,E,k,I,w,5,h[28]),I=u(I,R,E,k,f,9,h[29]),k=u(k,I,R,E,x,14,h[30]),R=c(R,E=u(E,k,I,R,M,20,h[31]),k,I,m,4,h[32]),I=c(I,R,E,k,A,11,h[33]),k=c(k,I,R,E,b,16,h[34]),E=c(E,k,I,R,C,23,h[35]),R=c(R,E,k,I,a,4,h[36]),I=c(I,R,E,k,y,11,h[37]),k=c(k,I,R,E,x,16,h[38]),E=c(E,k,I,R,v,23,h[39]),R=c(R,E,k,I,w,4,h[40]),I=c(I,R,E,k,o,11,h[41]),k=c(k,I,R,E,g,16,h[42]),E=c(E,k,I,R,p,23,h[43]),R=c(R,E,k,I,S,4,h[44]),I=c(I,R,E,k,M,11,h[45]),k=c(k,I,R,E,T,16,h[46]),R=d(R,E=c(E,k,I,R,f,23,h[47]),k,I,o,6,h[48]),I=d(I,R,E,k,x,10,h[49]),k=d(k,I,R,E,C,15,h[50]),E=d(E,k,I,R,m,21,h[51]),R=d(R,E,k,I,M,6,h[52]),I=d(I,R,E,k,g,10,h[53]),k=d(k,I,R,E,v,15,h[54]),E=d(E,k,I,R,a,21,h[55]),R=d(R,E,k,I,A,6,h[56]),I=d(I,R,E,k,T,10,h[57]),k=d(k,I,R,E,p,15,h[58]),E=d(E,k,I,R,w,21,h[59]),R=d(R,E,k,I,y,6,h[60]),I=d(I,R,E,k,b,10,h[61]),k=d(k,I,R,E,f,15,h[62]),E=d(E,k,I,R,S,21,h[63]),n[0]=n[0]+R|0,n[1]=n[1]+E|0,n[2]=n[2]+k|0,n[3]=n[3]+I|0},$X:function(){var t=this._w,i=t.words,s=8*this.NX,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.WX();for(var h=this.ZX,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.ZX=this.ZX.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.XX(a),i.HmacMD5=n.jX(a)})(Math),t.MD5}(Ip.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({HX:function(){this.ZX=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},YX:function(t,e){for(var i=this.ZX.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},$X:function(){var t=this._w,e=t.words,i=8*this.NX,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.WX(),this.ZX},clone:function(){var t=r.clone.call(this);return t.ZX=this.ZX.clone(),t}}),e.SHA1=r.XX(h),e.HmacSHA1=r.jX(h),t.SHA1;var e,i,s,r,n,o,h}(Ip.exports),Dp=(Fp=Ip.exports).lib.Base,Pp=Fp.enc.Utf8,Fp.algo.HMAC=Dp.extend({init:function(t,e){t=this.KX=new t.init,"string"==typeof e&&(e=Pp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.qX=e.clone(),n=this.tj=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.ej==this.ij?t=s.createEncryptor:(t=s.createDecryptor,this.UX=1),this.aj&&this.aj.lj==t?this.aj.init(this,i&&i.words):(this.aj=t.call(s,this,i&&i.words),this.aj.lj=t)},YX:function(t,e){this.aj.processBlock(t,e)},$X:function(){var t,e=this.cfg.padding;return this.ej==this.ij?(e.pad(this._w,this.blockSize),t=this.WX(!0)):(t=this.WX(!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)}}),y=(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})}},m=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),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.uj(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},uj: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})}},x=i.PasswordBasedCipher=m.extend({cfg:m.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=m.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.uj(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,m.decrypt.call(this,t,e,r.key,s)}})}()}(Ip.exports);var zp={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 y=t[i],m=t[y],p=t[m],x=257*t[g]^16843008*g;o[i]=x<<24|x>>>8,h[i]=x<<16|x>>>16,a[i]=x<<8|x>>>24,l[i]=x,x=16843009*p^65537*m^257*y^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=y^t[t[t[p^y]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],y=s.AES=i.extend({HX:function(){if(!this.cj||this.dj!==this.hj){for(var t=this.dj=this.hj,e=t.words,i=t.sigBytes/4,s=4*((this.cj=i+6)+1),n=this.fj=[],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.Aj=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.gj(t,e,this.fj,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.gj(t,e,this.Aj,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},gj:function(t,e,i,s,r,n,o,h){for(var a=this.cj,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++],m=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++],x=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=y,u=m,c=p,d=x}y=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],m=(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++],x=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=y,t[e+1]=m,t[e+2]=p,t[e+3]=x},keySize:8});e.AES=i.XX(y)}(),t.AES}(Ip.exports),Np={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.rj,s=i.blockSize,r=this.nj,n=this.pj;r&&(n=this.pj=r.slice(0),this.nj=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}(Ip.exports),Up={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Ip.exports);const Yp="aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvYXBwLWRlcGxveW1lbnQv",Gp={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw=="],"-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=="]},Xp=wt,Zp=(...t)=>t.slice(1).reduce(((e,i)=>e+Xp.atob(Gp[t[0]][i].toString())),"");let Hp,Wp,jp,Kp=new Uint8Array([]);class $p{set e(t){Hp=t}get e(){Wp={rf:!1,nf:!1,af:!1,lf:!1,uf:!1,cf:!1,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};const t=Kp.length,e=t>=1?Kp[0]:void 0,i=t>=2?Kp[1]:void 0,s=t>=3?Kp[2]:void 0;return void 0!==e&&(Wp.rf=!!(1&e),Wp.nf=!!(2&e),Wp.af=!!(4&e),Wp.lf=!!(8&e),Wp.uf=!!(16&e),Wp.cf=!!(32&e),Wp.df=!!(64&e),Wp.ff=!!(128&e)),void 0!==i&&(Wp.Af=!!(1&i),Wp.gf=!!(2&i),Wp.pf=!!(4&i),Wp.yf=!!(8&i),Wp.mf=!!(16&i),Wp.vf=!!(32&i),Wp.Sf=!!(64&i),Wp.xf=!!(128&i)),void 0!==s&&(Wp.bf=!!(1&s),Wp.Mf=!!(2&s),Wp._f=!!(4&s),Wp.wf=!!(8&s),Wp.Cf=!!(16&s),Wp.kf=!!(32&s),Wp.Tf=!!(64&s),Wp.Ff=!!(128&s)),Wp.cf}set l(t){jp=t}get l(){return jp}}let Qp=!1;const qp=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Jp=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")}`},tx=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),ex=t=>{const e={},i=t.split("-");if(3!==i.length)return{yj:Zp(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 rx(d,f)?e:{yj:Zp(0,0,1,7,1,12,5)}},ix=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(qp(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(tx(h)s[e]===t)))return{};break}case"0002":return ex(t);default:return{yj:Zp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{yj:Zp(0,0,1,2,1,7,1,12,5)}},sx=t=>{if(!t)return{yj:Zp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[Zp(-1,9)]||t[Zp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Xp[Zp(-1,6)][Zp(-1,7)])>-1)return{xj:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(lx(Xp[Zp(-1,6)][Zp(-1,7)],i))return{xj:!0};const s=t[Zp(-1,8)]||t[Zp(-1,38)];if(""!==s&&null!=s){if(lx(Xp[Zp(-1,6)][Zp(-1,7)],[s]))return{xj:!1};if(s===Xp[Zp(-1,6)][Zp(-1,7)])return{xj:!1}}return{yj:Zp(0,14,1,20,5),vj:"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvd2ViLWRlcGxveW1lbnQv"}},rx=(t,e)=>{const i=new Ep("secp256k1").keyFromPublic(Zp(-4,0),"hex"),s=Vp(t).toString();return i.verify(s,e)},nx=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(!rx(r,n))return{yj:Zp(0,21,1,2,1,7,1,12,5)};const o=_p.parse(r);i=zp.decrypt({ciphertext:_p.parse(s)},o,{mode:Np,padding:Up,iv:_p.parse("00000000000000000000000000000001")}).toString(Bp)}catch(t){return{yj:Zp(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{yj:Zp(0,21,1,2,1,7,1,12,5)}}if(void 0===e[Zp(-1,5)]||null===e[Zp(-1,4)]||!e[Zp(-1,9)])return{yj:Zp(0,21,1,2,1,7,1,12,5)};const s=parseInt(Zp(-3,0),10)||Number(parseInt(Zp(-3,0),10));return e[Zp(-1,5)]{const e=ex(t),i=e.mj,s=e.Sj;if(e.yj||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.Sj,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{yj:Zp(0,39,1,40,1,41,5),vj:Yp};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!rx(`${s}-${r}`,n))return{yj:Zp(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(qp(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Zp(-3,0),10)||Number(parseInt(Zp(-3,0),10))))return{yj:Zp(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(qp(s,8)),l=Lp(e[Zp(-1,31)]).toString(_p),u=Int32Array.from(qp(l,8)),c=Lp(e[Zp(-1,32)]).toString(_p),d=Int32Array.from(qp(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{yj:Zp(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{yj:Zp(0,39,1,40,1,41,5),vj:Yp};const i=ex(t),s=i.mj,r=i.Sj;if(i.yj||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))?{}:{yj:Zp(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{yj:Zp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},hx=(t,e,i=!0,s)=>{Qp=!1,e.lo();const r=e.Zr,n=!!r&&(r===wt.document.body||wt.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=wt.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?Zp(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1),s){const t=wt.document.createElement("a");t.href=s,n=t}else n=wt.document.createElement("p1");r.append(n),n.innerHTML=h,n.style.color="red",e.W$()&&Xp.console.error(h)}},ax=(t,e,i)=>{e?(t[Zp(-1,17)](Zp(-1,19),i),t[Zp(-1,17)](Zp(-1,20),i),t[Zp(-1,17)](Zp(-1,21),i),t[Zp(-1,17)](Zp(-1,22),i)):(t[Zp(-1,18)](Zp(-1,19),i),t[Zp(-1,18)](Zp(-1,20),i),t[Zp(-1,18)](Zp(-1,21),i),t[Zp(-1,18)](Zp(-1,22),i))},lx=(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)}))},ux=new Map;e.AbstractCursor=pa,e.Animation=j,e.AnimationEasings=W,e.Animator=K,e.AreaRangeSeries=Pu,e.AreaSeries=Ru,e.AreaSeriesBipolar=Eu,e.AreaSeriesMonopolar=ku,e.AreaSeriesNegative=Iu,e.AreaSeriesPositive=Fu,e.AreaSeriesTypes=Du,e.AutoFitStrategies=ga,e.AutoFitStrategy=ca,e.Axis=gh,e.Axis3D=$a,e.AxisScrollStrategies=Os,e.AxisTickStrategies=Us,e.Band=zs,e.BarChart=lf,e.BarChartBar=of,e.BarChartCategoryAxis=rf,e.BarChartSorting=uf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=nf,e.BasicSeries=uu,e.BorderedPicture=_n,e.BoxFigure=ru,e.BoxSeries=du,e.BoxSeries3D=sl,e.Button=Yo,e.Chart=na,e.Chart3D=wl,e.ChartComponent=Zi,e.ChartWithSeries=cl,e.ChartXY=wc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return w(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 w(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 w(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?C(t):C((t=>{const e=R[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),C("#fff")},e.ColorHEX=C,e.ColorHSV=T,e.ColorPalettes=On,e.ColorRGBA=w,e.ColorShadingStyles=Kn,e.ColorUint32=t=>w(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=Ns,e.Cursor2D=Aa,e.Cursor3D=vl,e.CursorBuilder2D=Sa,e.CursorBuilder3D=bl,e.CursorBuilderXY=hc,e.CursorBuilders=Mf,e.CursorXY=oc,e.CustomTick=wn,e.Dashboard=vf,e.DashedLine=io,e.DataGrid=Qd,e.DataPatternsNew=Br,e.DataSetXY=lo,e.DateTimeTickStrategy=Yh,e.EllipseFigure=fu,e.EllipseSeries=gu,e.EmptyFill=_,e.EmptyTickStrategy=Qs,e.EmptyUIElement=Pn,e.Figure=su,e.FigureSeries=au,e.FontSettings=lr,e.FormattingFunctions=Di,e.FunnelChart=Hc,e.FunnelChartTypes=qc,e.FunnelChartWithLabelsInsideSlices=Qc,e.FunnelChartWithLabelsOnSides=$c,e.FunnelSlice=Uc,e.GaugeChart=gf,e.GenericAxis=ir,e.GlowEffect=ao,e.HeatmapGridSeries=vu,e.HeatmapGridSeriesIntensityValues=bu,e.HeatmapScrollingGridSeries=Mu,e.HeatmapScrollingGridSeriesIntensityValues=wu,e.Highlighter=Hi,e.Icon=no,e.ImageFill=qn,e.IndividualPointFill=G,e.LUT=L,e.LegendBoxBuilders=hh,e.LineAndPointSeries3D=rl,e.LineSeries=uc,e.LineSeries3D=nl,e.LinearGradientFill=it,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new it({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Vl,e.MapRegions=Pf,e.MapRegionsAfrica=wf,e.MapRegionsAsia=Cf,e.MapRegionsAustralia=Tf,e.MapRegionsCanada=Rf,e.MapRegionsEurope=Ef,e.MapRegionsNorthAmerica=Ff,e.MapRegionsSouthAmerica=Df,e.MapRegionsUSA=If,e.MapRegionsWorld=kf,e.MapTypes=El,e.MeshModel3D=Sl,e.NumericTickStrategy=$h,e.OHLCSeries=tc,e.OHLCSeriesBars=ic,e.OHLCSeriesCandlesticks=ec,e.OHLCSeriesTypes=sc,e.OnScreenMenu=dc,e.OnScreenMenuAnimationsButton=Ms,e.OnScreenMenuButton=ys,e.OnScreenMenuControlBase=es,e.OnScreenMenuCustomButton=Cs,e.OnScreenMenuOsmToggleButton=Ts,e.OnScreenMenuToggleButton=ms,e.OnScreenMenuZoomInButton=ps,e.OnScreenMenuZoomInXButton=xs,e.OnScreenMenuZoomInYButton=As,e.OnScreenMenuZoomOutButton=Ss,e.OnScreenMenuZoomOutXButton=vs,e.OnScreenMenuZoomOutYButton=bs,e.OnScreenMenuZoomToFitButton=ws,e.PalettedFill=class extends Z{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")}},e.Panel=ea,e.PhongShadingStyle=Wn,e.Picture=Vn,e.PieChart=za,e.PieChartTypes=Xa,e.PieChartWithLabelsInsideSlices=Ga,e.PieChartWithLabelsOnSides=Ya,e.PieSlice=Pa,e.PixelatedPoints3D=pr,e.PointCloudSeries3D=ll,e.PointLineAreaSeries=fc,e.PointLineSeries=zu,e.PointLineSeries3D=ol,e.PointSeries=cc,e.PointSeries3D=al,e.PointSeriesTypes3D=ul,e.PointStyle3D=Ar,e.PolarAreaSeries=Vc,e.PolarAreaSeriesInterior=_c,e.PolarAxis=zl,e.PolarAxisAmplitude=Ol,e.PolarAxisTick=Nl,e.PolarChart=zc,e.PolarHeatmapSeries=tu,e.PolarLineSeries=eu,e.PolarPointLineSeries=iu,e.PolarPointSeries=Dc,e.PolarPolygon=Pc,e.PolarPolygonSeries=Lc,e.PolarSector=Wl,e.PolarSeries=Kl,e.PolygonFigure=yu,e.PolygonSeries=mu,e.PyramidChart=nd,e.PyramidChartTypes=cd,e.PyramidChartWithLabelsInsideSlices=ud,e.PyramidChartWithLabelsOnSides=ld,e.PyramidSlice=ed,e.RadialGradientFill=J,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new J({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Tu,e.RectangleFigure=pu,e.RectangleSeries=xu,e.SegmentFigure=Au,e.SegmentSeries=Su,e.Series2D=jl,e.Series3D=il,e.SeriesXY=nu,e.SimpleShadingStyle=Zn,e.Slice=Fa,e.SliceLabelFormatters=Ia,e.SliceSorters=ka,e.SolidFill=U,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new U({color:s(t)})},e.SolidLine=Ji,e.SpiderAxis=md,e.SpiderChart=Cd,e.SpiderSeries=pd,e.SplineSeries=Uu,e.StepSeries=Ju,e.StipplePatterns=to,e.SurfaceGridSeries3D=ml,e.SurfaceScrollingGridSeries3D=pl,e.Themes=tg,e.Tick=fh,e.TickStyle=Sh,e.TimeFormattingFunctions=Th,e.TimeTickStrategy=Eh,e.TreeMapChart=Of,e.TriangulatedPoints3D=gr,e.UIBackgrounds=ya,e.UICircle=So,e.UIColumnGrid=class extends Ro{constructor(){super(...arguments),this.wd=[]}addColumn(){return this.addElement(Do,void 0)}getColumn(t,e=!1){return e&&this.wd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.wd[t]}},e.UIDiamond=vo,e.UIElementBuilders=oh,e.UIElementColumn=Eo,e.UIElementLine=To,e.UIElementRow=Ro,e.UIElementWithBackground=bn,e.UIEmptyBackground=Ln,e.UILabel=po,e.UILayoutBuilders=Tl,e.UILayoutGap=Co,e.UILegendBoxPanel=Rl,e.UIObject=pn,e.UIOrigins=Es,e.UIPanel=sa,e.UIPoint=Mo,e.UIPointer=bo,e.UIPolygon=Bn,e.UIRectangle=Ao,e.UIRowGrid=Io,e.VisibleFill=O,e.ZoomBandChart=Ic,e._translatePoint=ct,e.defaultOsmBackgroundColor=_s,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=B,e.emptyLine=nt,e.emptyPoints3D=dr,e.emptyTick=bh,e.formatLongitudeLatitude=_l,e.formatNumberAsUnicodeSuperscript=Pi,e.isColor=M,e.isCoordinate3D=Al,e.isCoordinateBarChart=hf,e.isCoordinateClient=Ui,e.isCoordinatePolar=Hl,e.isCoordinateXY=Gi,e.isDashedLine=so,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=z,e.isEmptyTick=Mh,e.isEmptyTickStrategy=qs,e.isFontSettings=ur,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=ft,e.isHitMeshModel=mt,e.isHitOHLC=t=>t&&"object"==typeof t&&"position"in t&&"open"in t&&"high"in t&&"isPacked"in t,e.isHitPolarHeatmap=yt,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=gt,e.isIcon=oo,e.isIndividualPointFill=X,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=st,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=H,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=xr,e.isRadialGradientFill=tt,e.isSeriesSupportedByZoomBandChart=t=>t instanceof uu||t instanceof Ru||t instanceof Pu||t instanceof bu||t instanceof tc||t instanceof Ju||t instanceof fc,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=Y,e.isSolidLine=ts,e.isTickStyle=vh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=yr,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 $p;o.e=i;let h=ux.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(Hp){const s=(()=>{if(!Hp)return;const t=Hp.split("-");if(t.length>0)switch(t[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){Kp=new Uint8Array([2]);const e=(()=>{if(!Hp)return;const t=Hp.split("-");return 4===t.length?t[1].startsWith("m")?2:1:0})();if(1===e){const t=nx(Hp);h=!t.xj,i=t,n=!0}else 2===e?(i=ox(Hp,t),o=!0):(Qp=!0,i=ix(Hp),a=!0)}else if("0002"===s){const e=(()=>{if(!Hp)return;const t=Hp.split("-");return t.length>=2?Uint8Array.from(atob(t[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)Qp=!0,i=ix(Hp),a=!0;else if(189===e){const t=nx(Hp);h=!t.xj,i=t,n=!0}else 159===e?(i=ox(Hp,t),o=!0):i={yj:Zp(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=Hp.split("-");if(3!==i.length)return{yj:Zp(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(!rx(s,r))return{yj:Zp(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;tm)return{yj:Zp(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),x=l.subarray(n+=2,n+p);if(Kp=new Uint8Array(x),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{bj:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&rx(t[0],t[2])?{bj:t[0]}:{yj:Zp(0,0,1,7,1,12,5)}}return{yj:Zp(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.bj;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={yj:Zp(0,0,1,7,1,12,5)}}else i={yj:Zp(0,0,1,7,1,12,5)}}else{const t=/^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\./;["localhost","127.0.0.1","::1"].includes(window.location.hostname)||t.test(window.location.hostname)?i={yj:Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),vj:Zp(-2,2)}:window.location.host===Xp.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,Kp=new Uint8Array([38]),i={}):(c=!0,u=!0,Kp=new Uint8Array([38]),i={})}}catch(t){i={yj:Zp(0,0,1,7,1,12,5)}}try{a&&(s=Xp[Zp(-1,34)][Zp(-1,35)](Zp(-1,39))||void 0)}catch(t){Xp.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&rx(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(d=!0)}}const f=!(c||u||i.yj||n||o||d),g=(()=>{const t=new(Xp[Zp(-1,0)]);return t.open(Zp(0,26),Zp(-2,0)),t.setRequestHeader(Zp(-1,24),Zp(-1,25)),t.withCredentials=!0,t})(),y=new r.Eventer;if(f){let t;try{t=parseInt(Hp?Hp.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="";Hp=Hp||"";const o=Zp(-4,0);for(let t=0;t{const n=[],o={Xn:t=>{n.indexOf(t)>=0||(n.push(t),a())},jn:t=>y.on("logoChange",t),Zn:t=>y.off(t)},a=()=>{n.forEach((t=>{const e=d(t);if(!e)return;const{Mj:i,_j:s}=e,r=s?Zp(-2,1):void 0,n=`${Zp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?Zp(0,1,63,1,64,1,59,1,65,1,41):""}`;hx(n,m,!1,r)}))},c=t=>t.toLowerCase().split("_").join(" "),d=t=>{var e;const i=null===(e=Object.entries(dh).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case dh.af:return Wp.rf||Wp.af?void 0:{Mj:c(i),_j:!0};case dh.df:return Wp.rf||Wp.df?void 0:{Mj:c(i),_j:!0};case dh.ff:return Wp.rf||Wp.nf||Wp.ff?void 0:{Mj:c(i)};case dh.nf:return Wp.rf||Wp.nf?void 0:{Mj:c(i)};case dh.mf:return Wp.rf||Wp.nf||Wp.mf?void 0:{Mj:c(i)};case dh.xf:return Wp.rf||Wp.nf||Wp.xf?void 0:{Mj:c(i)};case dh.wf:return Wp.rf||Wp.nf||Wp.wf?void 0:{Mj:c(i)};case dh.kf:return Wp.rf||Wp.nf||Wp.kf?void 0:{Mj:c(i)};case dh.Tf:return Wp.rf||Wp.nf||Wp.Tf?void 0:{Mj:c(i)};case dh.Cf:return Wp.rf||Wp.nf||Wp.Cf?void 0:{Mj:c(i)};case dh.gf:return Wp.rf||Wp.nf||Wp.gf?void 0:{Mj:c(i)};case dh.Sf:return Wp.rf||Wp.nf||Wp.Sf?void 0:{Mj:c(i)};case dh.yf:return Wp.rf||Wp.nf||Wp.yf?void 0:{Mj:c(i)};case dh.bf:return Wp.rf||Wp.nf||Wp.bf?void 0:{Mj:c(i)};case dh._f:return Wp.rf||Wp.nf||Wp._f?void 0:{Mj:c(i)};case dh.Mf:return Wp.rf||Wp.nf||Wp.Mf?void 0:{Mj:c(i)};case dh.Af:return Wp.rf||Wp.nf||Wp.Af?void 0:{Mj:c(i)};case dh.pf:return Wp.rf||Wp.nf||Wp.pf?void 0:{Mj:c(i)};case dh.vf:return Wp.rf||Wp.nf||Wp.vf?void 0:{Mj:c(i)};case dh.Ff:return Wp.rf||Wp.nf||Wp.Ff?void 0:{Mj:c(i)};case dh.rf:case dh.lf:case dh.cf:case dh.uf:return}return we(0,"")}},m=new lp(r,t,o);(null==i?void 0:i.yj)&&hx(i.yj,m,void 0,i.vj);const p=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&rx(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return Qp=!1,void ax(g,!1,x)}}if(g.readyState===Xp[Zp(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[Zp(-1,23)]);if(!rx(l+Zp(-3,0),t.h)){const t=Zp(0,0,1,27,1,28,1,29,1,30,1,31,5);hx(t,m)}Xp[Zp(-1,34)][Zp(-1,36)](Zp(-1,39),t.t),Xp[Zp(-1,34)][Zp(-1,36)](Zp(-1,33),t.s),Qp=!1}else{let e=Zp(0,0,1,2,1,7,1,12,5);try{e=t&&"loadend"!==t.type?Zp(0,0,1,23,1,32,1,24,5):JSON.parse(g[Zp(-1,23)]).message,ax(g,!1,x)}catch(t){console.error(t)}hx(e,m,void 0,"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvZGV2ZWxvcGVyLWxpY2Vuc2Vz")}},x=t=>{p(t)};if(ax(g,!0,x),f?setTimeout((()=>{if(Qp){let t=!0;if(s){const e=s.split("-");if(2===e.length&&rx(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&hx(Zp(0,25,1,23,1,32,1,24,5),m)}}),1e4):ax(g,!1,x),u){const t=(()=>{const t=new(Xp[Zp(-1,0)]);return t.open(Zp(0,26),Zp(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),i=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),s=s=>{if("error"===(null==s?void 0:s.type)){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}if(t.readyState===Xp.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!rx(i,s.s)){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}void 0!==e&&(e.l=s.l),y.emit("logoChange",s.l)}}else{const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}},r=t=>{s(t)};ax(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}}),1e4)}return h?(t=>{let e;Qp=!1;const i=()=>{e&&(t.Dn(e.Pn()),e=void 0);const i=t.oi();e=t.GF("deployment test"),e.Or(t.At).gr(Zp(0,34,1,33)).Be({x:i.x/2,y:i.y/2}).Fa(50).Zh(13).Ie(new U({color:w(128,128,128,100)})).ka("Arial").Pa(500).setMouseInteractions(!1),t.Tn().Fn()};t.Do((()=>{i()})),setTimeout(i,0),setInterval((()=>{e&&e.Pn(){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={hz:null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.canvas,Kn:null==i?void 0:i.warnings,gz:"webgl1"===f?1:"webgl2"===f?2:void 0,cz:!1!==(null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.antialias),uz:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,_z:(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.noCanvasStyles)||void 0,Tz:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasTransform)||void 0,fz:!1!==(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.useStackingOrder),Az:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useIndividualCanvas),wz:d||void 0},y=new iy(g),m=e=>t(e,y);return{Dashboard:sy(m,e,i,s),ChartXY:oy(m,e,i,s),Spider:hy(m,e,i,s),Polar:ay(m,e,i,s),Pie:ly(m,e,i,s),UIPanel:ny(m,e,i,s),Gauge:uy(m,e,i,s),Funnel:cy(m,e,i,s),Pyramid:dy(m,e,i,s),Chart3D:gy(m,e,i,s),Map:fy(m,e,i,s),DataGrid:yy(m,e,i,s),BarChart:my(m,e,i,s),ZoomBandChart:py(m,e,i,s),TreeMapChart:xy(m,e,i,s),dispose:y.Y.bind(y),layout:y.Bz.bind(y)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Fs,e.onScreenMenuControlBaseWidth=Ds,e.onScreenMenuControlOpacity=Ps,e.onScreenMenuDefaultButtonShape=Vs,e.onScreenMenuSpriteURL=Ls,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=Qh,e.synchronizeAxisIntervals=dt,e.transparentFill=ks,e.transparentLine=Is,e.uint32ColorFromObject=t=>I(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=I,e.useCursorFormatterSeriesOverride=aa,e.vec3Utils=_e,e.xDimensionStrategy=mh,e.yDimensionStrategy=ph}}]); \ No newline at end of file