80*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(m,A,s,n,o,g,0),A}function i(t,e,i,s,r){var n,o;if(r===E(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&m(o,o.next)&&(T(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||!m(s,s.next)&&0!==p(s.prev,s,s.next))s=s.next;else{if(T(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,p=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),T(t),t=y.next,p=y.next;else if((t=y)===p){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(p(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)&&p(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(p(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,m,e,i,s),b=d(A,x,e,i,s),v=t.prevZ,M=t.nextZ;v&&v.z>=S&&M&&M.z<=b;){if(v.x>=y&&v.x<=A&&v.y>=m&&v.y<=x&&v!==r&&v!==o&&g(h,u,a,c,l,f,v.x,v.y)&&p(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,M.x>=y&&M.x<=A&&M.y>=m&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;v&&v.z>=S;){if(v.x>=y&&v.x<=A&&v.y>=m&&v.y<=x&&v!==r&&v!==o&&g(h,u,a,c,l,f,v.x,v.y)&&p(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;M&&M.z<=b;){if(M.x>=y&&M.x<=A&&M.y>=m&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&p(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;!m(n,o)&&A(n,r,r.next,o)&&b(n,o)&&b(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),T(r),T(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=v(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=v(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return p(t.prev,t,e.prev)<0&&p(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)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||m(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,s){var r=S(p(t,e,i)),n=S(p(t,e,s)),o=S(p(i,s,t)),h=S(p(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 b(t,e){return p(t.prev,t,t.next)<0?p(t,e,t.next)>=0&&p(t,t.prev,e)>=0:p(t,e,t.prev)<0||p(t,t.next,e)<0}function v(t,e){var i=new w(t.i,t.x,t.y),s=new w(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function M(t,e,i,s){var r=new w(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function T(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function w(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(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:()=>w,Iterable:()=>ks,List:()=>ai,Map:()=>Be,OrderedMap:()=>vi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Xi,Record:()=>ys,Repeat:()=>vs,Seq:()=>Z,Set:()=>_i,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>ae,getIn:()=>$i,has:()=>he,hasIn:()=>qi,hash:()=>mt,is:()=>ft,isAssociative:()=>T,isCollection:()=>x,isImmutable:()=>z,isIndexed:()=>M,isKeyed:()=>b,isList:()=>hi,isMap:()=>ut,isOrdered:()=>V,isOrderedMap:()=>ct,isOrderedSet:()=>Vi,isPlainObject:()=>re,isRecord:()=>L,isSeq:()=>F,isSet:()=>Pi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Te,mergeDeep:()=>Ee,mergeDeepWith:()=>ke,mergeWith:()=>we,remove:()=>ue,removeIn:()=>pe,set:()=>ce,setIn:()=>ge,update:()=>Ae,updateIn:()=>de,version:()=>Es});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&&!m(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return p(t,e,0)}function y(t,e){return p(t,e,e)}function p(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 A="@@__IMMUTABLE_ITERABLE__@@";function x(t){return Boolean(t&&t[A])}var S="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[S])}var v="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[v])}function T(t){return b(t)||M(t)}var w=function(t){return x(t)?t:Z(t)},E=function(t){function e(t){return b(t)?t:K(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),k=function(t){function e(t){return M(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),C=function(t){function e(t){return x(t)&&!T(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=E,w.Indexed=k,w.Set=C;var D="@@__IMMUTABLE_SEQ__@@";function F(t){return Boolean(t&&t[D])}var I="@@__IMMUTABLE_RECORD__@@";function L(t){return Boolean(t&&t[I])}function z(t){return x(t)||L(t)}var P="@@__IMMUTABLE_ORDERED__@@";function V(t){return Boolean(t&&t[P])}var R=0,O=1,B=2,_="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",U=_||N,G=function(t){this.next=t};function W(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 Y(){return{value:void 0,done:!0}}function H(t){return!!Array.isArray(t)||!!j(t)}function X(t){return t&&"function"==typeof t.next}function $(t){var e=j(t);return e&&e.call(t)}function j(t){var e=t&&(_&&t[_]||t[N]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=R,G.VALUES=O,G.ENTRIES=B,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[U]=function(){return this};var q=Object.prototype.hasOwnProperty;function J(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 Z=function(t){function e(t){return null==t?nt():z(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 G((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return W(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),K=function(t){function e(t){return null==t?nt().toKeyedSeq():x(t)?b(t)?t.toSeq():t.fromEntrySeq():L(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}(Z),Q=function(t){function e(t){return null==t?nt():x(t)?b(t)?t.entrySeq():t.toIndexedSeq():L(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}(Z),tt=function(t){function e(t){return(x(t)&&!T(t)?t:Q(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(Z);Z.isSeq=F,Z.Keyed=K,Z.Set=tt,Z.Indexed=Q,Z.prototype[D]=!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 G((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return W(t,n,i[n])}))},e}(Q),it=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return q.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 G((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return W(t,o,i[o])}))},e}(K);it.prototype[P]=!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=$(this._collection),s=0;if(X(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=$(this._collection);if(!X(i))return new G(Y);var s=0;return new G((function(){var e=i.next();return e.done?e:W(t,s++,e.value)}))},e}(Q);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return J(t)?new et(t):H(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 pt=Object.prototype.valueOf;function mt(t){if(null==t)return At(t);if("function"==typeof t.hashCode)return yt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==pt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return At(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>Ct?(void 0===(s=It[i=r])&&(s=xt(i),Ft===Dt&&(Ft=0,It={}),Ft++,It[i]=s),s):xt(r);case"object":case"function":return function(t){var e;if(Tt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!bt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[kt]))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=vt(),Tt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)Object.defineProperty(t,kt,{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[kt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[kt]=e}}return e}(r);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=vt(),wt[t]=e),e}(r);default:if("function"==typeof r.toString)return xt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function At(t){return null===t?1108378658:1108378659}function xt(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&eh)return{value:void 0,done:!0};var t=r.next();return s||e===O||t.done?t:W(e,a-1,e===R?void 0:t.value[1],t)}))},l}function Ut(t,e,i,s){var r=Jt(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(B,n),a=!0,l=0;return new G((function(){var t,n,u;do{if((t=h.next()).done)return s||r===O?t:W(r,l++,r===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===B?t:W(r,n,u,t)}))},r}function Gt(t,e,i){var s=Jt(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 Xt(t,e,i,s){var r=Jt(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(O,e),r=0;!(i=s.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var n=i.map((function(t){return t=w(t),$(r?t.reverse():t)})),o=0,h=!1;return new G((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}:W(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function $t(t,e){return t===e?t:F(t)?e:t.constructor(e)}function jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function qt(t){return b(t)?E:M(t)?k:C}function Jt(t){return Object.create((b(t)?K:M(t)?Q:tt).prototype)}function Zt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Z.prototype.cacheResult.call(this)}function Kt(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 De(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return De(e,i,t)}function Ee(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function ke(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 De(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=Z(i),h=Z(n),M(o)===M(h)&&b(o)===b(h))?De(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function De(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(z(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?k:E,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=q.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 Ce(this,e,t)}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return De(t,e)}))}function ze(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return Ce(t,e)}))}function Pe(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 Re(){return this.__ensureOwner()}function Oe(){return this.__altered}var Be=function(t){function e(e){return null==e?Je():ut(e)&&!V(e)?e:Je().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 Je().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 Ze(this,t,e)},e.prototype.remove=function(t){return Ze(this,t,h)},e.prototype.deleteAll=function(t){var e=w(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Je()},e.prototype.sort=function(t){return vi(Wt(this,t))},e.prototype.sortBy=function(t,e){return vi(Wt(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 Xe(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?qe(this.size,this._root,t,this.__hash):0===this.size?Je():(this.__ownerID=t,this.__altered=!1,this)},e}(E);Be.isMap=ut;var _e=Be.prototype;_e[lt]=!0,_e[s]=_e.remove,_e.removeAll=_e.deleteAll,_e.setIn=ye,_e.removeIn=_e.deleteIn=me,_e.update=xe,_e.updateIn=Se,_e.merge=_e.concat=be,_e.mergeWith=ve,_e.mergeDeep=Fe,_e.mergeDeepWith=Ie,_e.mergeIn=Le,_e.mergeDeepIn=ze,_e.withMutations=Pe,_e.wasAltered=Oe,_e.asImmutable=Re,_e["@@transducer/init"]=_e.asMutable=Ve,_e["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},_e["@@transducer/result"]=function(t){return t.asImmutable()};var Ne=function(t,e){this.ownerID=t,this.entries=e};Ne.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 Ye(t,mt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return 0==(h&n)?s:this.nodes[ei(h&n-1)].get(t+r,e,i,s)},Ue.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=mt(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 Ge(t,o+1,h)}(t,p,f,c,A);if(g&&!A&&2===p.length&&Qe(p[1^y]))return p[1^y];if(g&&A&&1===p.length&&Qe(A))return A;var x=t&&t===this.ownerID,S=g?A?f:f^d:f|d,b=g?A?ii(p,y,A,x):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},Ge.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=mt(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=Ke(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 Ye(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Qt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=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?xi(t,e).set(0,i):xi(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=pi(s,t.__ownerID,0,e,i,n):r=pi(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){xi(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=mi(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=mi(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=pi(d,e,i-r,s,n,h);return f===d?t:((l=mi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=mi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function mi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function Ai(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 xi(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):p;if(p&&y>g&&ar;x-=r){var S=g>>>x&o;A=A.array[S]=mi(A.array[S],s)}A.array[g>>>r&o]=p}if(u=y)a-=y,u-=y,c=r,d=null,m=m&&m.removeBefore(s,0,a);else if(a>n||y>>c&o;if(b!==y>>>c&o)break;b&&(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)}vi.isOrderedMap=ct,vi.prototype[P]=!0,vi.prototype[s]=vi.prototype.remove;var Ei="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[Ei])}var Ci=function(t){function e(t){return null==t?Li():ki(t)?t:Li().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):Ii(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&ki(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):Ii(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):Li()},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):Ii(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ii(this.size,this._head,t,this.__hash):0===this.size?Li():(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 G((function(){if(s){var e=s.value;return s=s.next,W(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Di,Fi=Ci.prototype;function Ii(t,e,i,s){var r=Object.create(Fi);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Li(){return Di||(Di=Ii(0))}Fi[Ei]=!0,Fi.shift=Fi.pop,Fi.unshift=Fi.push,Fi.unshiftAll=Fi.pushAll,Fi.withMutations=Pe,Fi.wasAltered=Oe,Fi.asImmutable=Re,Fi["@@transducer/init"]=Fi.asMutable=Ve,Fi["@@transducer/step"]=function(t,e){return t.unshift(e)},Fi["@@transducer/result"]=function(t){return t.asImmutable()};var zi="@@__IMMUTABLE_SET__@@";function Pi(t){return Boolean(t&&t[zi])}function Vi(t){return Pi(t)&&V(t)}function Ri(t,e){if(t===e)return!0;if(!x(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||b(t)!==b(e)||M(t)!==M(e)||V(t)!==V(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!T(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 Oi(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 Bi(t){if(!t||"object"!=typeof t)return t;if(!x(t)){if(!ne(t))return t;t=Z(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=Bi(t)})),e}var i=[];return t.__iterate((function(t){i.push(Bi(t))})),i}var _i=function(t){function e(e){return null==e?Yi():Pi(e)&&!V(e)?e:Yi().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(E(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Yi()},e.union=function(t){return(t=w(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Yi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Gi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Gi(this,this._map.remove(t))},e.prototype.clear=function(){return Gi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Gi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=yt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(mt(t),mt(e))|0}:function(t,e){s=s+as(mt(t),mt(e))|0}:e?function(t){s=31*s+mt(t)|0}:function(t){s=s+mt(t)|0}),s)}(this))}});var Zi=w.prototype;Zi[A]=!0,Zi[U]=Zi.values,Zi.toJSON=Zi.toArray,Zi.__toStringMapper=oe,Zi.inspect=Zi.toSource=function(){return this.toString()},Zi.chain=Zi.flatMap,Zi.contains=Zi.includes,Oi(E,{flip:function(){return $t(this,Rt(this))},mapEntries:function(t,e){var i=this,s=0;return $t(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return $t(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var Ki=E.prototype;Ki[S]=!0,Ki[U]=Zi.entries,Ki.toJSON=Ji,Ki.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Oi(k,{toKeyedSeq:function(){return new Lt(this,!1)},filter:function(t,e){return $t(this,_t(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 $t(this,Bt(this,!1))},slice:function(t,e){return $t(this,Nt(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 $t(this,1===i?s:s.concat(Qt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var i=this.findLastEntry(t,e);return i?i[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return $t(this,Gt(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,i){return i===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function as(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}ts.has=Zi.includes,ts.contains=ts.includes,ts.keys=ts.values,Oi(K,Ki),Oi(Q,Qi),Oi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Vi(t)?t:fs().withMutations((function(e){var i=C(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(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(_i);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(Ti()))}cs[P]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ys=function(t,e){var i;!function(t){if(L(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(z(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 Ts(t,e,i,s,r,n){if("string"!=typeof i&&!z(i)&&(J(i)||H(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,Z(i).map((function(s,n){return Ts(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return M(e)?e.toList():b(e)?e.toMap():e.toSet()}var Es="4.3.5",ks=w;const Cs={version:Es,Collection:w,Iterable:w,Seq:Z,Map:Be,OrderedMap:vi,List:ai,Stack:Ci,Set:_i,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Xi,Repeat:vs,is:ft,fromJS:Ms,hash:mt,isImmutable:z,isCollection:x,isKeyed:b,isIndexed:M,isAssociative:T,isOrdered:V,isValueObject:dt,isPlainObject:re,isSeq:F,isList:hi,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:Pi,isOrderedSet:Vi,isRecord:L,get:ae,getIn:$i,has:he,hasIn:qi,merge:Te,mergeDeep:Ee,mergeWith:we,mergeDeepWith:ke,remove:ue,removeIn:pe,set:ce,setIn:ge,update:Ae,updateIn:de}},89:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(568),r=i(613),n=i(570),o=function(t){if(t&&t.i)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}(s),h=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(n);class a{constructor(){this.o=!0}u(){return this.o}}class l extends a{constructor(t,e){super(),this.S=t,this.o=e}M(t){return t!==this.S&&(this.S=t,this.o=!0),this}_(){return this.S}u(){return super.u()}}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}),p=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),m=(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}),b=s.Record({type:"color",r:1,g:1,b:1,a:1});class v extends b{constructor(t){super(t)}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this.C||(this.C=new v({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.C}getLighter(){return this.T||(this.T=new v({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.T}getDarker(){return this.F||(this.F=new v({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.F}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),T=(t,e,i,s=255)=>new v({r:t/255,g:e/255,b:i/255,a:s/255}),w=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new v({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 v({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 v({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 v({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}`)}},E=(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 v({r:s,g:r,b:n})},k={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"},C=new v({}),D=T(0,0,0,0),F=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,I=(t,e)=>t.value-e.value,L=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:T(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),z=t=>{const{steps:e}=t,i=e.length;e.sort(I);const[s,r]=i>0?[e[0].value,e[i-1].value]:[0,0],n=i>0?i-1:0,o=Array(n);for(let t=0;t0&&s!==r}};class P extends L{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,z(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(z({...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 v({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 R extends V{toString(){return"emptyFill"}}const O=new R,B=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),_=s.Record({type:"fillstyle",fillType:"solid",color:T(255,255,255)});class N extends _{}class U extends N{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 G=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType),W=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),Y=s.Record({type:"fillstyle",fillType:"palette",lut:new P({steps:[]}),lookUpProperty:"value"}),H=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=Qt(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.P)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.L=n,this.eases=t.map((([t,e])=>s(t,e,i)))}R(){this.D.emit("start")}start(){return this.L.includes(this)||this.L.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 $(t,e,i,s,this.L);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.D.on("start",t,e)}onAnimationEnd(t,e){return this.D.on("end",t,e)}onEveryAnimationEnd(t,e){return this.D.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.D.on("allEnd",t,e)}allOffAnimationEnd(){return this.D.topicOff("end"),this}allOffEveryAnimationEnd(){return this.D.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.D.topicOff("allEnd"),this}offAnimationEnd(t){return this.D.off(t,"end")}offEveryAnimationEnd(t){return this.D.off(t,"everyEnd")}offAllAnimationEnd(t){return this.D.off(t,"allEnd")}finish(t=!0){if(this.P=!0,this.L.splice(this.L.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.D.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.D.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.D.emit("end",e),this.D.emit("everyEnd",e)),e}t&&(this.D.emit("end",void 0),this.D.emit("everyEnd",void 0),this.D.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(Mt):this.values.map(Mt)}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.R(),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=St.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=X.linear)=>(r,n,h=t)=>{const a=new $(r,n,h,e,i).start();return s||(s=St.requestAnimationFrame(o)),a}};var q,J;e.GradientShape=void 0,(q=e.GradientShape||(e.GradientShape={})).circle="circle",q.ellipse="ellipse",e.GradientExtent=void 0,(J=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",J.closestCorner="closest-corner",J.farthestSide="farthest-side",J.farthestCorner="farthest-corner";const Z=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class K extends Z{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 Q=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),tt=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class et extends tt{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?fi(t):t)}getAngle(t){return t?di(this.get("angle")):this.get("angle")}}const it=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),st=s.Record({type:"linestyle",lineType:"empty"}),rt=new class extends st{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}V(){return 0}setFillStyle(t){return this}getFillStyle(){return O}},nt=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ot{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new ht,this.y=new ht,this.z=new ht,this.D=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ne,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(Ne,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.G(e),s.y.G(r)}}}W(){return this.N&&(this.N(),this.N=void 0),this}U(t){return this.D.on("cell-resize",t)}Y(t){return this.D.off(t,"cell-resize")}}class ht extends a{constructor(){super(...arguments),this.H=0,this.$=10,this.X=1}j(){return this.o=!1,this}Z(){return this.o=!0,this}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}J(t,e){return this.H=t,this.$=e,this.K(),this}q(t){return this.X=t,this.K(),this}tt(t){return t/this.X}K(){const t=this.tt(this.$-this.H),e=this.X;void 0!==this.it&&!1!==Et(t,this.it)||(this.o=!0,this.st=e,this.it=t)}et(){return this.it}ht(){return this.st}rt(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},lt=(t,e,i)=>e===i?t:i.ut(e.ct(t)),ut=(t,e,i)=>{if(e===i)return t;const s=e instanceof Li?e.x:e.x instanceof Li?e.x.x:e.x.dt,r=e instanceof Li?e.y:e.y instanceof Li?e.y.y:e.y.dt,n=i instanceof Li?i.x:i.x instanceof Li?i.x.x:i.x.dt,o=i instanceof Li?i.y:i.y instanceof Li?i.y.y:i.y.dt;return{...t,x:lt(t.x,s,n),y:lt(t.y,r,o)}},ct=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.At.ft(t);if("world"===e.id&&"axes"===i.id)return e.chart.At.yt(t);if(e.id===i.id)return t;throw new Error("LC JS translatePoint3D misusage | originCoordinateSystem and targetCoordinateSystem arguments must be either Chart3D.coordsWorld or Chart3D.coordsAxis")},dt=(...t)=>{if(0===t.length)return{remove:wt};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.St(s,r,!1,!1,"synchronizedAxis"))),e=!1)})(i,r,n)))));let s=!1;const r=t.map((e=>e.onStoppedStateChanged(((i,r)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,r)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(r[e])}))}}};class ft extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,ft.prototype)}}class gt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&St.alert(s),Object.setPrototypeOf(this,gt.prototype)}}class yt extends gt{constructor(t){super(t),Object.setPrototypeOf(this,yt.prototype)}}var pt,mt,At,xt;e.UISpace=void 0,(pt=e.UISpace||(e.UISpace={}))[pt.Content=0]="Content",pt[pt.PaddedContent=1]="PaddedContent",pt[pt.PaddedBackground=2]="PaddedBackground",pt[pt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(mt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[mt.never=0]="never",mt[mt.always=1]="always",mt[mt.whenHovered=2]="whenHovered",mt[mt.whenDragged=3]="whenDragged",mt[mt.whenNotDragged=4]="whenNotDragged",mt[mt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(At=e.UIDraggingModes||(e.UIDraggingModes={}))[At.notDraggable=0]="notDraggable",At[At.draggable=1]="draggable",At[At.onlyHorizontal=2]="onlyHorizontal",At[At.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(xt=e.UIDirections||(e.UIDirections={}))[xt.Up=0]="Up",xt[xt.Right=1]="Right",xt[xt.Down=2]="Down",xt[xt.Left=3]="Left";const St="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},bt=(t,e)=>t.x===e.x&&t.y===e.y,vt=t=>t!==Ie&&t!==Le&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Mt=t=>t[1],Tt=t=>t.dispose(),wt=()=>{},Et=(t,e)=>t===e,kt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Ct=t=>Array.prototype.concat.apply([],t),Dt=(t,e)=>void 0!==t?t:e,Ft=t=>t.vt(),It=t=>t.xt(),Lt=t=>t.bt(),zt=t=>t.Mt(),Pt=t=>t.min.x,Vt=t=>t.max.x,Rt=t=>t.min.y,Ot=t=>t.max.y,Bt=(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,Nt=u(0,1),Ut=u(1,0),Gt=u(0,-1),Wt=u(-1,0),Yt=u(0,0),Ht=t=>{switch(t){case e.UIDirections.Up:return Nt;case e.UIDirections.Right:return Ut;case e.UIDirections.Down:return Gt;case e.UIDirections.Left:return Wt;default:return Yt}},Xt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,$t=t=>{t.stopPropagation(),t.preventDefault()},jt=(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,i=new Float32Array(2*e);let s=0;for(let r=0;r{const e=t.length,i=new Float32Array(3*e);let s=0;for(let r=0;re=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},Kt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},te=Qt(Math.E),ee=(t,e)=>{const i=e[t];return i?i():void 0},ie=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;igi(ni(t,i))-gi(ni(e,i))))},se=(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:T(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())),ne=t=>255===t.getA()?t:t.setA(255),oe=(()=>{const t=T(0,0,0);return i=>(i=ne(i),new K({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:re(i,t,.5)}]}))})(),he=(()=>{const t=t=>{var e;if(t){if(G(t)){if(0===t.getColor().getA())return;return t.getColor()}if(Q(t)||it(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)=>{const n=[];if(r.fill&&n.push(r.fill),r.fill2&&n.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==O&&n.push(t)}if(r.point3D){const t=r.point3D;n.push(t.getFillStyle())}let o;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=n.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]);o=e&&s?(h=e)===(a=s)||h.getR()===a.getR()&&h.getG()===a.getG()&&h.getB()===a.getB()?oe(h):(h=ne(h),a=ne(a),new et({angle:0,stops:[{offset:0,color:a},{offset:.5,color:a},{offset:.5,color:h},{offset:1,color:h}]})):i.uiButtonFillStyle}else{const e=n.reduce(((e,i)=>e||t(i)),void 0);o=e?s?new U({color:e}):oe(e):i.uiButtonFillStyle}var h,a;e.setButtonOnFillStyle(o)}})(),ae=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},le=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ue=(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,de=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),fe=(t,e)=>e(),ge=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:T(255,255,255,1)});const ye=t=>t===ze||t.min.x===ze.min.x&&t.max.x===ze.max.x&&t.min.y===ze.min.y&&t.max.y===ze.max.y,pe=t=>Array.from(new Set(t)),me=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,xe=(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))))))},Se=(t,e)=>{throw new Error(e)},be=()=>{const t=j((()=>{}));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)}},ve=t=>{let e;return()=>e||(e=t(),e)},Me=t=>{if(t===rt)return 0;const e=t.getThickness();return e<0?1:1*e},Te=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/js-charts/api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw St.alert(r),new Error(r);St.console.warn(r)},we=(t,e,i,s=0)=>{if(t{const t=new Map;return{_t:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.wt(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ct(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.kt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Tt(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ft(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.It(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Pt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Dt(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Bt(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.Lt(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Rt(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Et(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Vt(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.zt(e,i,s)})),e),Ot:(e,i)=>{t.set(e,i)},Nt:()=>{t.clear()}}},ke={left:0,right:0,top:0,bottom:0},Ce=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Gt();const s=i();return{Wt:t,Gt:()=>{s.forEach((e=>t.Ut(e)))}}},Fe={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=>Fe.divide(t,Fe.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(Fe.dot(t,e)/(Fe.length(t)*Fe.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Fe.dot(e,t),o=Fe.cross(e,t);return Fe.addVec(Fe.multiply(t,s),Fe.addVec(Fe.multiply(e,(1-s)*n),Fe.multiply(o,r)))},lerp:(t,e,i)=>(i=kt(i,0,1),Fe.addVec(Fe.multiply(t,1-i),Fe.multiply(e,i))),equals:(t,e)=>Et(t.x,e.x)&&Et(t.y,e.y)&&Et(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)})},Ie=Number.MAX_SAFE_INTEGER,Le=-Number.MAX_SAFE_INTEGER,ze=y(u(Ie,Ie),u(Le,Le)),Pe=y(f(Ie,Ie,Ie),f(Le,Le,Le)),Ve=(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))},Re=(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),Be=(t,e)=>y(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),_e=t=>{const e=t.length;for(let i=0;ie+t,Ue=(t,e,i)=>{const s=ni(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ni(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)},Ge=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ye=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},He=(t,e,i)=>ri(t,si(ni(e,t),i)),Xe=(t,e,i)=>Fe.addVec(t,Fe.multiply(Fe.subtractVec(e,t),i));function $e(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:Ie,y:Ie},max:{x:Le,y:Le}};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},Je=(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 Ze(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 Ke(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 Qe(t,e){return u(t.x-e.x,t.y-e.y)}function ti(t){const e=ii(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function ei(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ti(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 ii(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function si(t,e){return u(t.x*e,t.y*e)}function ri(t,e){return u(t.x+e.x,t.y+e.y)}function ni(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t,e){return u(t.x*e.x,t.y*e.y)}function hi(t,e){return u(t.x/e.x,t.y/e.y)}function ai(t){return si(t,-1)}function li(t,e){return t.x*e.x+t.y*e.y}const ui=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},ci=(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 di(t){return t*Math.PI/180}function fi(t){return 180*t/Math.PI}function gi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function yi(t){return u(Math.cos(t),Math.sin(t))}function pi(t){let e=-1;const i=Math.cos(t),s=Math.sin(t);return i>0&&i<1&&s>0&&s<1?e=1:i<0&&i>-1&&s>0&&s<1?e=2:i<0&&i>-1&&s<0&&s>-1?e=3:i>0&&i<1&&s<0&&s>-1&&(e=4),e}const mi=(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)},Ai=(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 xi{constructor(){this.Yt=!0}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.H)}J(t,e){return this.Yt=t!==this.H||e!==this.$,this.H=t,this.$=e,this}j(){return this.Yt=!1,this}Z(){return this.Yt=!0,this}}class Si extends xi{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.O(this.ti.bind(this));this.ti(s._()),this.ii=()=>s.G(t)}}q(t){return this.X=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.X+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.X-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.X}getCellSize(){return this.ai(this.X)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(Ne,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&&iwi;return!n&&!o||!!r&&(e>t?{start:n?Ti:t,end:o?wi:e}:{start:o?wi:t,end:n?Ti:e})}ct(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ti);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}ut(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()}J(t,e){return super.J(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}q(t){return super.q(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:vi(t),number:Mi(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ct(t)+e;return this.ut(i)}mi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.H),e=this.ci.function(this.$)-t,i=2*this.ei()/this.X-1,s=2*this.hi()/this.X-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}yi(){return this.di}}const vi=t=>"e"===t?te:Qt(t),Mi=t=>"e"===t?Math.E:t,Ti=.9*10**-4,wi=1.1*10**25,Ei=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],ki=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Ve(s,10),0);return t.toFixed(r)},Ci={Numeric:(t,e)=>ki(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 Ei){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=Ve(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-Ve(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=vi(s)(t);return`${s}${Di(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=vi(s),n=Math.floor(r(t)),o=t/Mi(s)**n;return`${Math.round(o)}×${s}${Di(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=vi(s),n=Math.floor(r(t));return`${(t/Mi(s)**n).toFixed(2)}×${s}${Di(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=vi(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))}},Di=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 Fi extends Si{constructor(t,e,i,s){super(t,e,i,s),this.Si=!1,this.vi=!1,this.xi=0,this.X=1e3,this.J(0,10),this.K()}mi(){return this.vi}nt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.Si){const i=((t,e,i)=>{const s=((t,e)=>{if(eLe&&tLe){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.K()}ct(t){return this.ei()+(t-this.H)/(this.$-this.H)*(this.hi()-this.ei())}ut(t){return this.H+(t-this.ei())/(this.hi()-this.ei())*(this.$-this.H)}J(t,e){return super.J(t,e),this.K(),this}si(t){return super.si(t),this.K(),this}q(t){return super.q(t),this.bi=Ii(this.$-this.H,this.Xt,this.X,this.Qt,this.Jt),this.K(),this}Mi(){return this.Si=!0,this}_i(){return this.Si}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}yi(){return this.di}Z(){return super.Z(),this.vi=!0,this}j(){return super.j(),this.vi=!1,this}Di(t,e=Ci.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 Ii(t,this.Xt,this.X,this.Qt,this.Jt)}K(){let t=this.H,e=this.$,i=0;this.Si&&(t=0,e=this.$-this.H,i=this.H);const s=e-t,r=Ii(s,this.Xt,this.X,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.vi=!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.X-1,f=2*this.hi()/this.X-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 Ii=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Li{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}Z(){return this.x.Z(),this.y.Z(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}Vi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}zi(t,e){return this.x.J(t,e),this}Oi(t,e){return this.y.J(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.mi()||this.y.mi()}}class zi extends Li{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ot(t,e,i,s){return this.x=new Fi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Fi(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())}yi(){return{x:this.x.yi(),y:this.y.yi()}}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=ei(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 Pi extends Li{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ct(t.x),s=this.y.ct(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ut(r.x),y:this.y.ut(r.y)}}Ui(t,e,i,s){const r={x:this.x.ct(t.x),y:this.y.ct(t.y)},n={x:this.x.ct(e.x),y:this.y.ct(e.y)},o=ti(ni(n,r)),h=ei(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.ut(a.x),y:this.y.ut(a.y)}}yi(){const t=this.x.yi(),e=this.y.yi();return{uScaleStart:[this.x.H,this.y.H],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 Vi=(t,e)=>t instanceof bi||e instanceof bi?(new Pi).Ri(t,e):(new zi).Ri(t,e),Ri=t=>"client"===t,Oi=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Bi=t=>"relative"===t,_i=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Ni;e.HighlightModes=void 0,(Ni=e.HighlightModes||(e.HighlightModes={}))[Ni.noHighlighting=0]="noHighlighting",Ni[Ni.onHover=1]="onHover";class Ui{constructor(t,i,s,n){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.ji=!1,this.D=new r.Eventer,this.Zi=[],this.Qi=[],this.onMouseEnter=t=>this.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.wt=(t,i,s)=>{this.D.emit("mouseEnter",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Ct=(t,i,s)=>{this.D.emit("mouseLeave",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.kt=(t,e,i)=>this.D.emit("mouseClick",this,e),this.Tt=(t,e,i)=>this.D.emit("mouseDoubleClick",this,e),this.Ft=(t,e,i)=>this.D.emit("mouseDown",this,e),this.It=(t,e,i)=>this.D.emit("mouseUp",this,e),this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,r,n)=>{this.D.emit("mouseDrag",this,e,i,s,r)},this.Lt=(t,e,i,s,r)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,i,s)=>{this.D.emit("touchStart",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.D.emit("touchMove",this,e)},this.zt=(t,i,s)=>{this.D.emit("touchEnd",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ji=t,this.Ki=i,this.qi=s,this.ts=new Map,this.ss=n,this.es=this.ss.hs(this,{rs:{themeEffectEnabled:this.qi.effectsText},ns:{}}),this.Ji.us.ls.os(this,(t=>{this.ts.forEach(((e,i)=>i.cs(t))),this.Qi.forEach((e=>e.setHighlight(t))),this.Zi.forEach((e=>e.cs(t)))}),{animationEnabled:this.Ji.getAnimationsEnabled()})}ds(t){const e=t(this.Ji.fs);e&&this.Ji.us.As(e)}gs(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.ts.set(t,{isText:s});const r=Array.from(this.ts);this.es.rs.ps(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.es.ns.ps(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).cs(this.Ji.us.ls.ys(this,!0)),i&&t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragStartEventHandler(this.Bt).setMouseDragEventHandler(this.Dt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt);const n=t.onDispose((()=>{t.offDispose(n),this.ts.delete(t)}))}Ss(t){this.Zi=t;const e=this.Ji.us.ls.ys(this,!0);t.forEach((t=>{t.cs(e).vs(this.Xi)}))}setEffect(t){return this.es.rs.xs(t&&this.qi.effectsText),this.es.ns.xs(t),this.Ji.us.bs(),this}getEffect(){return this.es.rs.Ms()||this.es.ns.Ms()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setName(t){return this._s=t,this.Qi.forEach((t=>t.setText(this._s))),this}getName(){return this._s}dispose(){return this.$i||(this.$i=!0,this.ts.forEach(((t,e)=>e.dispose())),this.Ki(this),this.Qi.forEach((t=>{t.dispose()})),this.Qi.length=0,this.D.emit("dispose",this),this.Ji.us.bs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.ts.forEach(((e,i)=>i.setVisible(t))),this.Zi.forEach((e=>e.vs(t))),this.Qi.forEach((e=>e.setOn(t))),this.D.emit("visibleStateChanged",this,this.Xi),this.Ji.us.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setHighlight(t){return this.Ji.us.ls.ws(this,t),this.D.emit("highlight",this,t),this}getHighlight(){return this.Ji.us.ls.ys(this)}setAnimationHighlight(t){return this.Ji.us.ls.Cs(this,t),this}getAnimationHighlight(){return this.Ji.us.ls.ks(this)}setMouseInteractions(t){return this.Yi=t,this.ts.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ji.us.bs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){return this.ji}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 xe(t,[this],{toggleVisibilityOnClick:e,label:this._s,style:void 0}),this.Qi.push(t),t.onDispose((()=>{const e=this.Qi.indexOf(t);e>=0&&this.Qi.splice(e,1)})),this}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}onDispose(t){return this.D.on("dispose",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}offDispose(t){return this.D.off(t,"dispose")}}class Gi extends Ui{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ts=t,this.axis=s,this.dt=r,this.Fs=n,this.Is()}}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.Rs?(this.Ls.splice(t,1),t-=1):this.Ls[t].state&&(s=!0);return this.Bs?0===e.interactions.length&&(this.Ls.push({state:!1,time:i}),this.Bs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Ls.push({state:!0,time:i}),s=!0,this.Bs=!0),s}Ds(t,e,i){if(i){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}},Xi=class{constructor(t,e,i,s=1,r=100){this.Vs=t,this.zs=e,this.Os=i,this.Ns=s,this.Gs=r}Ps(t,e){const i=e.interactions.length;if(i===this.Ns){if(void 0!==this.Ws)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 Zi{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*ks,this.Qs=e.columns*Cs}}var Ki,Qi;e.OnScreenMenuButtonType=void 0,(Ki=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Ki.ZoomIn=0]="ZoomIn",Ki[Ki.ZoomInX=1]="ZoomInX",Ki[Ki.ZoomInY=2]="ZoomInY",Ki[Ki.ZoomOut=3]="ZoomOut",Ki[Ki.ZoomOutX=4]="ZoomOutX",Ki[Ki.ZoomOutY=5]="ZoomOutY",Ki[Ki.ZoomToFit=6]="ZoomToFit",Ki[Ki.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qi=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qi.Circle=0]="Circle",Qi[Qi.Rectangle=1]="Rectangle",Qi[Qi.RoundedRectangle=2]="RoundedRectangle";const ts={x:-43,y:0},es={x:-65,y:0},is={x:-86,y:0},ss={x:-107,y:-1},rs={x:-128,y:-3},ns={x:-150,y:0},os={x:-171,y:0},hs={x:-276,y:0},as={x:-298,y:0},ls={x:0,y:0},us={x:-21,y:0};class cs extends Zi{constructor(t,e,i,s){super(t,i),this.Js=St.document.createElement("button"),this.Ks=St.document.createElement("div"),this.qs=St.document.createElement("label"),this.js=i,this.te=e,this.Ji=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const r=St.document.createElement("div");this.ne(r),this.Js.onclick=this.onClick.bind(this),r.appendChild(this.Ks),r.appendChild(this.qs),this.Js.appendChild(r)}re(){this.Js.style.cursor="pointer"}ne(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}he(t){"string"==typeof t?(this.Ks.style.backgroundImage=`url(${t})`,this.Ks.style.backgroundSize="100%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.backgroundPosition="center",this.Ks.style.width="20px",this.Ks.style.height="20px"):this.applyStyleForSprite(t),this.Ks.style.margin="auto"}ee(){switch(this.te){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Js.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Js.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Js.style.borderRadius="31px"}}se(t,e){this.Js.style.width=`${this.Qs.toString()}px`,this.Js.style.height=`${this.Zs.toString()}px`,this.Js.style.backgroundColor=t,this.Js.style.opacity=e||Ds,this.Js.style.alignItems="center",this.Js.style.border="2px solid #707070",this.Js.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.Ks.style.backgroundImage=`url(${this.Xs}/${Fs})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`,this.Ks.style.backgroundSize="1600%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.width="20px",this.Ks.style.height="20px"}oe(t){return t.appendChild(this.Js),t}ae(){return this.Js}}class ds extends cs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ji=s}de(){this.fe(),this.onToggledStateAction()}Ae(){this.ge(),this.onInitialStateAction()}ge(){this.pe(this.le)}fe(){this.pe(this.ue)}pe(t){"string"==typeof t?this.Ks.style.background=t:(this.Ks.style.backgroundImage=`url(${this.Xs}/${Fs})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ce?this.Ae():this.de(),this.ce=!this.ce}}class fs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ts)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:-1})}}class gs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:0})}}class ys extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:-1})}}class ps extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),es)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:1})}}class ms extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:0})}}class As extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:1})}}class xs extends ds{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.le=hs,this.ue=as,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ji.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ji.setAnimationsEnabled(!0)}}class Ss extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){this.Ji.forEachAxis((t=>{t.fit(!0)}))}}class bs extends cs{constructor(t,e,i){super(t,e.shape||Is,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.ie(r,n,o,h),this.ye=e.action}onClick(){this.ye(this.Ji)}}class vs extends ds{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ji=i,this.Se=s,this.le=us,this.ue=ls,this.ie(Ls,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Ls,this.Js.style.border="2px solid #707070",this.Js.style.margin="0px"}fe(){this.pe(this.ue),this.Js.style.background="#FECC00 0% 0% no-repeat padding-box",this.Js.style.border="10px solid #BCBCBC12",this.Js.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","none")}}var Ms;e.MouseStyles=void 0,(Ms=e.MouseStyles||(e.MouseStyles={})).Move="move",Ms.ResizeColumn="col-resize",Ms.ResizeRow="row-resize",Ms.Horizontal="ew-resize",Ms.Vertical="ns-resize",Ms.NorthWest="nw-resize",Ms.NorthEast="ne-resize",Ms.Copy="copy",Ms.CrossHair="crosshair",Ms.Default="default",Ms.Help="help",Ms.Restricted="not-allowed",Ms.None="none",Ms.Point="pointer",Ms.Text="text",Ms.Wait="wait",Ms.ZoomIn="zoom-in",Ms.ZoomOut="zoom-out";const Ts={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)},ws=new U({color:T(255,255,255,0)}),Es=new qi({thickness:1,fillStyle:ws}),ks=60,Cs=60,Ds="1.0",Fs="osm/osm-sprite-transparent.png",Is=e.OnScreenMenuButtonShape.Circle,Ls="#363636";var zs;e.OSMPosition=void 0,(zs=e.OSMPosition||(e.OSMPosition={}))[zs.TopRight=0]="TopRight",zs[zs.TopLeft=1]="TopLeft",zs[zs.BottomLeft=2]="BottomLeft",zs[zs.BottomRight=3]="BottomRight";class Ps extends Gi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Band",this.ve=0,this.xe=0,this.be=this.qi.bandFillStyle,this.Me=this.qi.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.dt).ke(this.be).Ce(this.Me).cs(this.getHighlight()),this.gs(this.we)}setValueStart(t){return this.ve=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueEnd(){return this.xe}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.we.ke(e),this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.we.Ce(e),this.Ts.bs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.dt).getInnerStart())).q(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.dt).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const r=ut(this.Ts.us.De(s.x,s.y),this.Ts.us.dt,this.dt),n=this.Fs.getWidth(r),o=this.axis.dt.ct(this.ve),h=this.axis.dt.ct(this.xe),a=(this.axis.dt.ct(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this._e)return;const h=this.Fs.getWidth(n);t?(this.ve=this.axis.dt.pi(this.ve,h),this.xe=this.axis.dt.pi(this.xe,h)):i?this.ve=this.axis.dt.pi(this.ve,h):this.xe=this.axis.dt.pi(this.xe,h),$t(o),this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs()};this.onMouseMove(((i,r)=>{if(!this._e)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(n,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ji.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this._e&&0===i&&r(0,0,0,n,e)}));const n=Yi(new Xi(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Vs extends Gi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Constant Line",this.S=0,this.Me=this.qi.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.Ve(this.dt).Ee(this.Me).cs(this.getHighlight()),this.gs(this.Re)}setValue(t){return this.S=t,this.D.emit("valueChange",this,this.S),this.Ts.bs(),this}getValue(){return this.S}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.Re.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerStart())).ze(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.dt.pi(this.S,this.Fs.getWidth(e)),this.D.emit("valueChange",this,this.S),this.Ts.bs(),$t(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ji.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this._e&&this.Le&&0===s&&t(i,n)}));const i=Yi(new Xi(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Rs={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?Rs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Rs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Rs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,_s=t=>void 0!==t.Ge,Ns={We:Ci.Numeric},Us=(t,e)=>[t,e],Gs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Et(t,0)&&(t=0),Et(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},Hs=(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)}},Xs=(...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=(t,e)=>{if(e.has(t))return e.get(t);const i=$e(t.Ye.Ue());return e.set(t,i),i},js=t=>{const e=new Map;if(t!==Ns){for(const i of t.He)e.set(i,new Map);for(const i of t.$e)e.set(i,new Map)}return e};class qs{constructor(t,e,i,s,n,o,h){this.D=new r.Eventer,this.Xe=Ns,this.je=Os.Empty,this.Ze=new Map,this.Qe=new Map,this.Je=Rs.fitting,this.Ke=!0,this.qe=j((()=>this.chart.us.bs()))(300,X.linear),this.th=!0,this.Xi=!0,this.ih=!1,this.sh=Le,this.eh=!1,this.hh=!1,this.rh=Le,this.oh=Le,this.ah=Le,this.lh=!1,this.uh=()=>{this.ih||void 0===this.Je||this.chart.us.bs(!0)},this.dh={},this.fh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ze.get(e),l=(t?t.get(a):void 0)||this.Ah(a,e);l.gh=!1;const u=this.ph(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.mh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Sh!==i||!!t.find((t=>t===e)))).map((t=>Re(e,$s(t,a))?t:void 0)),y=m.some((t=>void 0!==t))}else y=!1;if(y){let t=!0;const e=m.filter((t=>void 0!==t));if(t&&e.every((t=>Bs(t.Sh)))&&(t=!1),t&&i.xh&&i.xh.bh&&!1===i.xh.bh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.Xe.We(t,this.dt),this.chart=t,this.Mh=e,this.qi=s,this._h=o,this.dt=i,this.wh=h,"logarithmic"===h.type&&this.setAnimationZoom(X.logarithmic(Mi(h.base))),this.Ch=o.numeric,this.kh("Numeric"),this.Th=i.getInnerStart(),this.Fh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setDefaultInterval(t,e){return this.Ih=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.lh=!0,this.chart.us.bs()),this}getDefaultInterval(){return this.Ih}getTitle(){return this.Dh.Ph()}setTitle(t){return this.Dh.Bh(t),this.chart.us.bs(),this}getTitleFillStyle(){return this.Dh.Lh()}setIntervalRestrictions(t){return this.Rh=t,this.chart.us.bs(),this}getIntervalRestrictions(){return this.Rh}setTitleFillStyle(t){return this.Dh.ke(t),this.chart.us.bs(),this}getTitleFont(){return this.Dh.Eh()}setTitleFont(t){return this.Dh.Vh(t),this.chart.us.bs(),this}setTitleRotation(t){return this.Dh.zh(t),this.chart.us.bs(),this}getTitleRotation(){return this.Dh.Oh()}setTitleEffect(t){return this.Nh.xs(t),this.chart.us.bs(),this}getTitleEffect(){return this.Nh.Ms()}kh(t,e){if(this.Ze.size>0&&this.Gh(),"Empty"===t)this.Xe=Ns,this.je=t;else if("Numeric"===t){"Numeric"!==this.je&&(this.Ch=this._h.numeric);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("DateTime"===t){"DateTime"!==this.je&&(this.Ch=this._h.datetime);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("Time"===t){"Time"!==this.je&&(this.Ch=this._h.time);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}return this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=js(this.Xe),this.chart.us.bs(),this}Uh(){return this.Xe}Yh(t){this.Xe=t,this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=js(this.Xe),this.chart.us.bs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.St(void 0!==e?e:this.Th,void 0!==i?i:this.Fh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}St(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.Fh-this.Th),void 0!==this.Xe.Hh&&this.Xe.Hh>h){const i=(e+t)/2,s=this.Xe.Hh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);n={start:i-s,end:i+s}}const a=this.dt.nt(n.start,n.end,this.Th,this.Fh,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 Se(0,""),this}if(this.Xh&&this.Xh.finishAll(!1),this.qe&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Xh||this.Xh.isOver()?this.qe:this.Xh.NextAnimation.bind(this);this.Xh=e([[this.Th,n.start],[this.Fh,n.end]],(([t,e])=>{this.jh(t,e,o)}),t),this.Xh.onAnimationEnd((()=>{this.Xh=void 0,l&&(this.ah=St.performance.now())})),this.Xh.onAnimationEnd((()=>this.setStopped(s)))}else this.jh(n.start,n.end,o),this.setStopped(s),l&&(this.ah=St.performance.now());return this}getInterval(){return{start:this.Th,end:this.Fh}}setStopped(t){return t===this.ih||(t&&(this.Xh&&this.Xh.finishAll(!1),this.Xh=void 0),this.ih=t,this.D.emit("stoppedStateChanged",this,this.ih),this.sh=St.performance.now(),this.chart.us.bs()),this}getStopped(){return this.ih}onStoppedStateChanged(t){return this.D.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.D.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Zh(),s=this.Ih||tr,r="function"==typeof s?s({curStart:this.Th,curEnd:this.Fh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.St(void 0!==r.start?r.start:this.Th,void 0!==r.end?r.end:this.Fh,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.Je=t,this.chart.us.bs(),this}getScrollStrategy(){return this.Je}setAnimationScroll(t){return this.Ke=Boolean(t),this.chart.us.bs(),this}setAnimationZoom(t,e=300){return this.Xh&&(this.Xh.finishAll(!1),this.Xh=void 0),this.qe=t?j((()=>this.chart.us.bs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.th=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.th}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Dh.setVisible(t),this.Qh((e=>{e.Ye.setVisible(t)})),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onIntervalChange(t){return this.D.on("scaleChange",t)}offIntervalChange(t){return this.D.off(t,"scaleChange")}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}Jh(t,e){const i=new Map;if(this.Xe===Ns||!this.Xi)return this.Gh(),i;e=e||new Map;const s=this.Kh(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.dh.physicalAxisSize=h;const a=Zs(this.Xe,r,n,this.Th,this.Fh,h),l=[];if(this.qh(),l.push(...this.tr(this.Xe,r,n,a,e,t,i)),this.ir(this.Xe,r,n,a,e,t,l,i),this.sr(),a)for(const[t,e]of this.Qe){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.dh.min=r,this.dh.max=n,this.dh.scaleInterval=o,this.dh.physicalAxisSize=h,i}er(t){const e=t.Sh.hr;t.Ye.Bh(e(t.S,this.dt)).Ds()}rr(t,e){const i=e.nr;t.Ye.ke(i.getLabelFillStyle()).Vh(i.getLabelFont()).zh(i.getLabelRotation())}Ah(t,e){const i=this.Qe.get(e);let s=i.get(t);s?(i.delete(t),s.Sh=e,s.vs(!0)):s=this.ar(t,e);const r=this.Ze.get(e)||new Map;return r.set(t,s),this.Ze.set(e,r),this.rr(s,e),s}ph(t,e){const i=this.lr(t,e);return this.er(t),i}tr(t,e,i,s,r,n,o){const h=[];for(const a of t.He){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ze.get(a),l=(t?t.get(s):void 0)||this.Ah(s,a),u=this.ph(l,n),c=$s(l,r);h.find((t=>Re(c,$s(t,r))))&&l.Ye.setVisible(!1),l.gh=!1,o.set(l,u),h.push(l)}}return h}ir(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.$e){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.xh){m=!1;break}const t=u.xh.ur;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const p=this.mh(y.filter((t=>a.some((e=>Et(t.S,e))))),g,u,d,n,h,e,i,r,o,l);!0!==p?t=t.concat(p):(d+=1,f=-1,t=[])}p=t,y.forEach((e=>{t.find((t=>t===e))||this.cr(e)}))}if(l=p,!m)break}}cr(t){const e=this.Ze.get(t.Sh);null==e||e.delete(t.S);const i=this.Qe.get(t.Sh);i&&i.has(t.S)?t.dispose():i&&(t.vs(!1),i.set(t.S,t))}Qh(t){for(const e of this.Ze.values())for(const i of e.values())t(i)}dr(t,e){for(const i of this.Ze.values())for(const s of i.values())e=t(e,s);return e}Gh(){this.Ze.forEach(((t,e)=>{t.forEach((t=>this.cr(t)))})),this.Ze.clear()}qh(){for(const t of this.Ze.values())for(const e of t.values())e.gh=!0}sr(){for(const t of this.Ze.values())for(const[e,i]of t.entries())i.gh&&(i.dispose(),t.delete(e))}Kh(){const t=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart();return y(t,e)}yh(t,e){return!(t.gh||0===t.Ye.Ph().length||Bs(e)&&!0!==e.Ar)}gr(t,e){return this.Xe===Ns||(this.Xe.He.forEach((i=>{e=t(e,i.nr)})),this.Xe.$e.forEach((i=>{(t=>void 0!==t.hr)(i)&&(e=t(e,i.nr))}))),e}Zh(){let t=this.Mh.pr();const e=this.Mh.mr();let i;if(void 0!==t&&vt(t)&&void 0!==e&&vt(e)&&("logarithmic"===this.wh.type&&(0===t&&(t=Math.min(1,e)),Math.sign(t)!==Math.sign(e)&&(t=Math.min(1,e-.1))),i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,e)):i=y(t,e)),i&&vt(i.min)&&vt(i.max))return Et(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}yr(){let t=0;const e=this.Mh.Sr();return e&&(t=Math.max(t,e)),t}vr(){var t;const e=this.eh;let i=!1;if(this.lh&&this.Ih){const t=this.Zh(),e="function"==typeof this.Ih?this.Ih({curStart:this.Th,curEnd:this.Fh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Ih;this.setInterval(e),this.lh=!1}if(this.Je&&!this.ih){const e=this.Zh();if(e){const s=this.Th,r=this.Fh;let n=this.Je.start(s,r,e.min,e.max),o=this.Je.end(s,r,e.min,e.max);const h=null===(t=this.Je.allowIntervalLengthChange)||void 0===t||t,a=Qs(this.Rh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Et(s,n),u=!1===Et(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.Ke)if(this.Ke){t=!0;const e=l?this.br(s,n):s,a=u?this.br(r,o):r;if(!0===this.jh(e,a,h)&&(l&&!1===Et(e,n)||u&&!1===Et(a,o))){this.chart.us.bs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.hh=t>=1.4}}else t=!1;t||this.jh(n,o,h)}}}i?(this.eh!==i&&(this.eh=i,this.rh=St.performance.now()),this.Mr&&(clearTimeout(this.Mr),this.Mr=void 0)):!0===e&&void 0===this.Mr&&(this.hh=!1,this.Mr=setTimeout((()=>{!1!==this.eh&&(this.eh=!1,this.rh=St.performance.now()),this.Mr=void 0,this.chart.us.bs()}),200))}jh(t,e,i){let s={start:t,end:e},r=!0;if(this.Rh){const t=this.Zh();s=Qs(this.Rh,t,s,{start:this.Th,end:this.Fh},i)}const n=Math.abs(e-t),o=Math.abs(this.Fh-this.Th);if(void 0!==this.Xe.Hh&&this.Xe.Hh>n){const n=(e+t)/2,h=(i?this.Xe.Hh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.dt.nt(s.start,s.end,this.Th,this.Fh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.yr(),l=this._r(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.dt.nt(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Th,this.Fh,!1),!!h&&(!0===h?this.dt.J(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.dt.J(s.start,s.end),this.Th=s.start,this.Fh=s.end,this.D.emit("scaleChange",this,s.start,s.end),this.oh=St.performance.now(),this.chart.us.bs(),r)}wr(){return this.eh}Cr(){return void 0!==this.Xh}}class Js{constructor(t,e,i,s,r=i.kr(s).setMouseInteractions(!1)){this.gh=!1,this.$i=!1,this.ts=[],this.Sh=t,this.S=e,this.Tr=i,this.Fr=s,this.Ye=r,this.ts.push(r)}vs(t){this.ts.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.ts.forEach((t=>t.dispose()))),this}}const Zs=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.He){let t=n.Ir(e,i,s,r);t=Ks(t),o.set(n,t)}let h;for(const s of t.$e){let t;if(void 0===h)t=s.Ir(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.Pr&&s.Pr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Qs=(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||Et(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||Et(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||Et(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||Et(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},tr=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}},er=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class ir extends er{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 sr=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),rr=new ir,nr=new class{getFillStyle(){return O}},or=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:rt});class hr extends or{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 ar=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),lr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class ur extends lr{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 cr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),dr={Triangulated:hr,Pixelated:ur};class fr{constructor(t){this.Dr=new Map,this.us=t}os(t,e,i){const s=i.animationEnabled;this.Dr.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Dr.delete(t),t.offDispose(r)}))}Br(t,e){const i=e.animationEnabled,s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Dr.delete(t)})),t.offDispose(r)}));return{Lr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Dr.set(t,r)}}}ws(t,e){const i=this.Dr.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.us.bs())}ys(t,e=!1){const i=this.Dr.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Dr.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Dr.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Dr.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.us.bs(!0)}}const gr=new Map,yr=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),r=t.getStyle(),n=t.getVariant(),o=`${r} ${n?"small-caps":"normal"} ${s} ${e}px ${i}`;let h=gr.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{type:"font",size:e,family:i,style:r,variant:n,weight:s}),gr.set(o,h)),h};var pr,mr;!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"}(pr||(pr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(mr||(mr={}));const Ar=t=>({container:t.Rr,scale:t.dt,setMouseStyle:(e,i)=>t.Er(e,i),restoreMouseStyle:e=>t.Vr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.zr(e,i),captureFrame:(e,i,s)=>t.Or(e,i,s),renderFrame:(e,i,s=!1)=>t.Nr(e,i,s),layout:()=>{t.Gr(),t.Wr(),t.Yr.Ur(),t.bs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Hr(e,i),onRenderFrame:e=>t.$r(e),offRenderFrame:e=>t.Xr(e)}),xr=[];let Sr;const br=()=>{if(void 0!==Sr){const t=St.getComputedStyle(St.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Sr.style.height=St.innerHeight-e+"px",(()=>{for(let t=0;tthis.bs()),60),this.Qr=u(0,0),this.Jr=!1,this.Kr=wt,this.qr=()=>{},this.tn=[],this.sn=-1,this.en=[],this.hn=!0,this.$i=!1,this.rn=!1,this.Wr=()=>{const{bottom:t,left:e}=this.Rr.getBoundingClientRect();return this.Qr=u(Math.floor(e),Math.floor(t)),this},this.Gr=()=>{this.nn&&this.nn()},this.Er=(t,e)=>{if(!e){this.Rr.style.cursor=t;const e=this.sn;return this.sn+=1,this.en.push([e,t]),e}return this.Vr(e),this.Er(t)},this.Vr=t=>{const e=t?this.en.findIndex((e=>e[0]===t)):-1;e>=0?(this.en.splice(e,1),this.en.length>0?this.Rr.style.cursor=this.en[this.en.length-1][1]:this.Rr.style.cursor="default"):(this.en.push([0,"default"]),this.Rr.style.cursor="default")},this.an=t=>(this.ln.M(t),this),this.un=()=>this.ln._(),this.cn=()=>{this.Kr&&this.Kr(1e3/60),this.dn(),this.fn(),this.qr&&this.qr()},this.An=t=>(this.jr.set(t.gn(),t),this.jr=new Map([...this.jr.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.pn=t=>(this.jr.delete(t),this),this.j=()=>(this.ln.o=!1,this),this.Z=()=>(this.ln.o=!0,this),this.mn=t=>{if(!this.hn)return;const e=this.yn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),r=this.Sn(t,{x:t.clientX,y:t.clientY});if(this.vn&&((null==r?void 0:r.entity)!==this.vn.entity||r.collectionMember!==this.vn.collectionMember)&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.xn)if(r.entity.ji){if(!i){const e=r.entity.Mn;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.ji=!0;const e=r.entity._n;e&&e(r.entity,t,r.collectionMember)}if(this.xn){const i=this.xn.entity.wn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.xn.entity,t,this.xn.button,this.xn.startLocation,s,this.xn.collectionMember)}this.Cn=t,this.yn=t,this.kn=s,this.vn=r},this.Tn=t=>{if(this.hn=!1,this.kn=void 0,this.Cn=t,this.vn&&!this.Fn&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember),this.vn=void 0}},this.In=t=>{if(this.hn=!0,this.Cn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.Pn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember),this.xn=void 0}if(this.Fn&&t.buttons<=0){const e=this.Fn.entity.Dn;e&&e(this.Fn.entity,t,this.Fn.collectionMember),this.Fn=void 0}},this.Bn=()=>this.kn,this.Yr=t,this.qi=e.theme,this.As=i.As,this.Ln=i.Ln,this.Rn=i.Rn,this.En={Vn:i.Vn,zn:i.zn,On:i.On,Nn:i.Nn,Gn:i.Gn,Wn:i.Wn,Un:i.Un,Yn:i.Yn,Hn:i.Hn,$n:i.$n,Xn:i.Xn,jn:i.jn,Zn:i.Zn,Qn:i.Qn,Jn:i.Jn,Kn:i.Kn,qn:i.qn,io:i.io,so:i.so,eo:i.eo,ho:i.ho,ro:i.ro,no:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${St.location.origin}/resources`,oo:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,ao:(()=>{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})(),lo:void 0===(null==e?void 0:e.interactable)||e.interactable,uo:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=St.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Rr=t}else this.Rr=s;St.addEventListener("resize",this.Gr),this.tn.push((()=>{St.removeEventListener("resize",this.Gr)}))}else{if(void 0===Sr){const t=St.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",St.document.body.appendChild(t),Sr=t,St.addEventListener("resize",br)}let t=1;for(;null!==St.document.getElementById(`chart-${t}`);)t+=1;this.Rr=St.document.createElement("div"),this.Rr.id=`chart-${t}`,this.Rr.style.flex="1",this.Rr.style.height="100%",Sr.appendChild(this.Rr),br(),xr.push(this.Gr),this.tn.push((()=>{Sr&&Sr.removeChild(this.Rr),xr.includes(this.Gr)&&xr.splice(xr.indexOf(this.Gr),1),0===xr.length&&Sr&&(St.document.body.removeChild(Sr),Sr=void 0,St.removeEventListener("resize",br))}))}if(St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Rr&&this.Gr()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.Rr)}""===this.Rr.style.position&&(this.Rr.style.position="relative"),this.Rr.style.boxSizing="content-box",this.Rr.addEventListener("fullscreenchange",this.Gr),this.Rr.addEventListener("webkitfullscreenchange",this.Gr);const n=e?e.maxFps:void 0;this.do=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.Rr.onwheel=this.fo(pr.wheel),this.Rr.oncontextmenu=this.fo(pr.contextmenu),this.Rr.onclick=this.fo(pr.click),this.Rr.ondblclick=this.fo(pr.dbclick),this.Rr.onlostpointercapture=()=>{h=!1},this.Rr.ontouchmove=t=>{h&&t.preventDefault()},this.Rr.onpointerover=a(),this.Rr.onpointerenter=a(this.In),this.Rr.onpointerdown=a(this.fo(pr.mouseDown),this.Ao(mr.touchStart)),this.Rr.onpointermove=a(this.mn,this.Ao(mr.touchMove)),this.Rr.onpointerup=a(this.fo(pr.mouseUp),this.Ao(mr.touchEnd)),this.Rr.onpointercancel=a(),this.Rr.onpointerout=a(),this.Rr.onpointerleave=a(this.Tn,this.Ao(mr.touchEnd)),St.addEventListener("scroll",this.Wr,{passive:!0}),this.ln=m(new v({r:0,g:0,b:0,a:0})),this.ls=new fr(this)}po(t,e){var i,s,r,n;(null===(i=this.vn)||void 0===i?void 0:i.entity)===t.entity&&this.vn.collectionMember===t.collectionMember&&(this.vn=e),(null===(s=this.mo)||void 0===s?void 0:s.entity)===t.entity&&this.mo.collectionMember===t.collectionMember&&(this.mo=e),(null===(r=this.Fn)||void 0===r?void 0:r.entity)===t.entity&&this.Fn.collectionMember===t.collectionMember&&(this.Fn={...e,event:this.Fn.event}),(null===(n=this.xn)||void 0===n?void 0:n.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,button:this.xn.button,startLocation:this.xn.startLocation})}yo(){this.rn=!0,this.Kr=void 0,this.qr=void 0}$r(t){return this.D.on("render",t)}Xr(t){return this.D.off(t)}So(){return this.vo}xo(){return this.bo}setBackgroundFillStyle(t){return this.Mo.ke(t),this}getBackgroundFillStyle(){return this.Mo.Lh()}setBackgroundStrokeStyle(t){return this.Mo.Ce(t),this}getBackgroundStrokeStyle(){return this.Mo._o()}wo(t){return this.qr=t,this}Co(t){return this.Kr=t,this}ko(t){return this.jr.get(t)}To(){return Array.from(this.jr.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}fo(t){return e=>this.Fo(t,e)}Fo(t,e){if(!this.hn)return;t===pr.contextmenu&&$t(e);const i=this.De(e.clientX,e.clientY),s=this.Sn(e,{x:e.clientX,y:e.clientY});if(t===pr.mouseUp){if(this.xn){const t=this.xn.entity.Pn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember),(null==s?void 0:s.entity)!==this.xn.entity||s.collectionMember!==this.xn.collectionMember){this.xn.entity.ji=!1;const t=this.xn.entity.bn;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Fn){const t=this.Fn.entity.getMouseInteractions()&&this.Fn.entity.Dn;t&&t(this.Fn.entity,e,this.Fn.collectionMember),this.Fn=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===pr.click?s.entity.Io:t===pr.dbclick?s.entity.Po:t===pr.mouseDown?s.entity.Do:t===pr.wheel?s.entity.Bo:t===pr.contextmenu?s.entity.Lo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===pr.mouseDown){this.Fn={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Fn.event.button,i=s.entity.Ro;i&&i(s.entity,e,t,s.collectionMember),this.xn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Cn=e,this.kn=i,this.vn=s}Ao(t){return e=>this.Eo(t,e)}Eo(t,e){const i=e.interactions.length;if(this.Vo=e,this.mo){const s=t===mr.touchMove?this.mo.entity.zo:t===mr.touchEnd?this.mo.entity.Oo:t===mr.touchStart?this.mo.entity.No:void 0;s&&s(this.mo.entity,e,this.mo.collectionMember),t===mr.touchEnd&&0===i&&(this.mo.entity.ji=!1,this.mo=void 0)}else if(t===mr.touchStart){for(let t=0;t{t()})),this.tn.length=0}De(t,e){return u(t-this.Qr.x,this.Qr.y-e)}zr(t,e){return u(t+this.Qr.x,this.Qr.y-e)}$o(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Xo(t){const e=this.zr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const wr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=si(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=si(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=si(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=si(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?Ir.Nearest:"nearest-x"===t?Ir.NearestX:"nearest-y"===t?Ir.NearestY:void 0;return void 0!==e?e:Ir.NearestX},zr=(t,e,i,s,r,n,o,h,a,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===Ir.Nearest)return Pr(t,e,n,o,c,d);if(i===Ir.NearestX||i===Ir.NearestY){if("boolean"==typeof l&&("x"===a&&i===Ir.NearestX||"y"===a&&i===Ir.NearestY))return Or(t,ut(e,o,n),a,l,c,d);if(i===Ir.NearestX)return Vr(t,ut(e,o,n),h,c,d);if(i===Ir.NearestY)return Rr(t,ut(e,o,n),h,c,d)}},Pr=(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=ut(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),p=n,m=-1;for(;;){const e=h-(o?t[y].x:t[y].y);if(e*(s?-1:1)>0)g=Math.min(y+1,p),m=Math.floor((g+p)/2);else{if(0===Math.abs(e))return y;p=Math.max(y-1,g),m=Math.floor((g+p)/2)}if(m===y){const i=y>r?Math.abs(h-(o?t[y-1].x:t[y-1].y)):Ie,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),p=n,m=-1;for(;;){const i=h-(o?t[y].x:t[y].y);if(i*(s?-1:1)>0)g=Math.min(y+1,p),m=Math.floor((g+p)/2);else{if(0===Math.abs(i))return{a:y,b:y,lerpAmount:0};p=Math.max(y-1,g),m=Math.floor((g+p)/2)}if(m===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.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.us=t,this.qo=e,this.ta=i,this.ia=_r,_r+=1,this.sa=t.qi.highlightColorOffset}ea(t){return void 0!==this.ta.find((e=>e.type===t))}ha(t,e){var i;return!!this.ea(t)&&!0===e(null===(i=this.ta.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.$i=!0,this.qo(this),this.D.emit("dispose",this)),this}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.jo._();return this.jo.M(t),t||(e&&this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getMouseInteractions(){return this.jo._()}getIsUnderMouse(){return this.ji}getIsGrabbed(){return this.Qo}setMouseMoveEventHandler(t){return this.Mn=t,this}setMouseEnterEventHandler(t){return this._n=t,this}setMouseLeaveEventHandler(t){return this.bn=t,this}setMouseClickEventHandler(t){return this.Io=t,this}setMouseDoubleClickEventHandler(t){return this.Po=t,this}setMouseDownEventHandler(t){return this.Do=t,this}setMouseUpEventHandler(t){return this.Dn=t,this}setMouseWheelEventHandler(t){return this.Bo=t,this}setMouseContextMenuEventHandler(t){return this.Lo=t,this}setMouseDragEventHandler(t){return this.wn=t,this}setMouseDragStartEventHandler(t){return this.Ro=t,this}setMouseDragStopEventHandler(t){return this.Pn=t,this}setTouchStartEventHandler(t){return this.No=t,this}setTouchMoveEventHandler(t){return this.zo=t,this}setTouchEndEventHandler(t){return this.Oo=t,this}ra(t){return this.Jo=t,this}na(){return this.Jo?this.Jo:Ur}cs(t){return this.Ko=t,this}oa(){return this.Ko}aa(t){return this.sa=t,this}la(){return this.sa}}const Ur=y(u(0,0),u(0,0));class Gr extends Nr{constructor(t,e,i,s){super(t,i,s),this.ua=0,this.Ts=e,this.Ts.ca=!0}da(t){return this.ua===t||(this.ua=t,this.Ts.ca=!0),this}fa(){return this.ua}}class Wr extends Gr{constructor(t,e,i,s,r){super(t,e,s,r),this.Aa=!0,this.dt=i}}const Yr=(t,e,i)=>{if(i instanceof zi){const s=i.Wi(),r=oi(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),si(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Hr=(t,e)=>"function"==typeof e?e(t):e,Xr=(t,e)=>!t||t!==e,$r=t=>t!==O;class jr extends Wr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.be=Mr.fillStyle,this.us=t}ke(t){return this.be=Hr(this.be,t),this}Lh(){return this.be}ga(){return Xr(this.pa,this.be)}ma(){return((t,e)=>t===O&&e!==O)(this.pa,this.be)}ya(){return $r(this.be)}Sa(t){this.pa=t}}class qr extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Me=Mr.lineStyle,this.us=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}_o(){return this.Me}va(){return!this.xa||this.xa!==this.Me}ba(t){return!this.xa||this.xa.getThickness()!==t}ya(){return this.Me!==rt||super.ya()}ma(){return(this.Me!==rt||this.be!==O)&&this.xa===rt&&this.pa===O}Ma(t){this.xa=t}}class Jr extends jr{constructor(t,e,i,s,r,n=m(5)){super(t,e,i,s,r),this.size=m(5),this.size=n}q(t){return this.size.M(t),this}}class Zr extends jr{constructor(t,e,i,s,r,n=m(Mr.font)){super(t,e,i,s,r),this._a=m(""),this.wa=m(u(0,0)),this.Ca=m(0),this.ka=m(0),this.Ta=m(u(0,0)),this.Fa=m(0),this.Ia=m(rr),this.Pa=u(0,0),this.Xt=m(A(1,1,1,1)),this.Da=m(x(4,4,4,4)),this.font=m(Mr.font),this.Ba=!1,this.font=n}ya(){return $r(this.be)&&this._a._().length>0}ma(){return!1===this.Ba&&this.ya()}Bh(t){return this._a.M(t),this}Ph(){return this._a._()}Vh(t){return sr(t)?this.Ia.M(t):this.Ia.M(t(this.Ia._())),this}Eh(){return this.Ia._()}La(t){return this.Ia.M(this.Ia._().setFamily(t)),this}Ra(){return this.Ia._().getFamily()}Ea(t){return this.Ia.M(this.Ia._().setSize(t)),this}Va(){return this.Ia._().getSize()}za(t){return this.Ia.M(this.Ia._().setWeight(t)),this}Oa(){return this.Ia._().getWeight()}Na(t){return this.Ia.M(this.Ia._().setStyle(t)),this}Ga(){return this.Ia._().getStyle()}Wa(t){return this.Ia.M(this.Ia._().setVariant(t)),this}Ua(){return this.Ia._().getVariant()}Ie(t){return this.wa.M(t),this}Ya(){return this.wa._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Ha(t,e){return this.Ta.M(u(t,e)),this}$a(){return this.Ta._()}Xa(t){return this.ka.M(t),this}ja(){return this.ka._()}Za(t){return this.Ca.M(t),this}Qa(){return this.Ca._()}Ja(t){return this.ka.M(t.x),this.Ca.M(t.y),this}Ka(t){return this.Xt.M(t),this}qa(){return this.Xt._()}tl(t){return this.Da.M(t),this}il(){return this.Da._()}}class Kr extends Jr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,m(o)),this.sl=[],this.el=m(e.PointShape.Square),this.Fa=m(0),this.hl=m(!1),this.rl=m(!1),this.nl=m(!1),this.ol=ze,this.al=0,this.ll=[],this.ul=0,this.cl=ze,this.dl=Ir.Nearest,this.fl=!1,this.Al=void 0}pl(t){return this.dl=t,this}ml(){return this.ll}yl(){return this.sl}Sl(t){return this.el.M(t),this}vl(){return this.el._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}xl(t){return this.hl.M(t),this}bl(t){return this.rl.M(t),this}Ml(t){return this.nl.M(t),this}_l(t,e){return Array.isArray(t)||(t=[t]),this.ul+=t.length,this.ll=se(this.ll,t,{canReturnB:!0}),this.cl&&(this.cl=e?qe(this.cl,e):void 0),this.Al=void 0,this}Nt(){return this.fl=!0,this.sl.length=0,this.al=0,this.ol=ze,this.ll=[],this.ul=0,this.Al=void 0,this}wl(){return this.al}Cl(){return this.ul}}class Qr extends qr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wa=m(u(0,0)),this.X=m(u(100,100)),this.Fa=m(0),this.Pa=m(u(0,0)),this.kl=!1}Ds(){return this.Tl(),this}Ie(t){const e=this.wa._();return t.x===e.x&&t.y===e.y||(this.wa.M(t),this.Tl()),this}Ya(){return this.wa._()}Fl(t){const e=this.wa._();return t!==e.x&&(this.wa.M(u(t,e.y)),this.Tl()),this}Il(t){const e=this.wa._();return t!==e.y&&(this.wa.M(u(e.x,t)),this.Tl()),this}q(t){const e=this.X._();return t.x===e.x&&t.y===e.y||(this.X.M(u(t.x,t.y)),this.Tl()),this}oi(){return this.X._()}Pl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(t,e.y)),this.Tl()),this}Dl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(e.x,t)),this.Tl()),this}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Bl(t){const e=this.Pa._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.kl=!1,this.Tl()):(this.kl=!0,this.Pa.M(t))),this}Tl(){if(!this.kl){const t=this.wa._(),e=this.X._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Pa._();i.x===s.x&&i.y===s.y||this.Pa.M(i)}}}class tn extends qr{constructor(){super(...arguments),this.sl=[],this.wa=m(u(0,0)),this.ol=ze,this.Ll=!1}Rl(t){return t=Kt(t),this.sl=t,this.Ll=!0,this}El(){return this.sl}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}}class en extends tn{}class sn extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ol=new Array,this.Nl=new Array,this.Gl=m({type:"disabled",packager:(t,e,i)=>t.slice()}),this.ol=ze,this.Wl=0,this.Ul=!1,this.ll=[Array(),Array()],this.Yl=!1,this.Hl=(new U).setColor(T(42,171,240)),this.fl=!1,this.$l=!1,this.Xl=!1}_l(t,e){const i=this.Wl-1,s=i>0&&!this.Yl;let[r,n]=s?[[this.Ol[i]],[this.Nl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=se(r,e,{canReturnB:!0}),n=se(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Yl?(this.ll[0]=se(this.ll[0],r,{canReturnB:!0}),this.ll[1]=se(this.ll[1],n,{canReturnB:!0})):(this.ll=[r,n],this.Yl=!0),this.ol=qe(this.ol,e||qe($e(r),$e(n))),this}Nt(){return this.fl=!0,this.Ol.length=0,this.Nl.length=0,this.Wl=0,this.ol=ze,this}yl(){return[this.Ol,this.Nl]}ml(){return[this.ll[0],this.ll[1]]}jl(t){return this.Gl.M(t),this}Zl(){return this.Gl._()}Ql(t){return this.Hl="function"==typeof t?t(this.Hl):t,this}Jl(){return this.Hl}wl(){return this.Wl-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}ma(){return this.pa===O&&this.su===O&&(this.be!==O||this.Hl!==O)}eu(t){this.su=t}ya(){return this.Hl!==O||super.ya()}ga(){return super.ga()||!this.su||this.su!==this.Hl}}class rn extends qr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wa=m(u(0,0)),this.hu=m(0),this.Fi=m(360),this.ru=m(100),this.nu=m(100),this.ou=m(0),this.au=m(void 0),this.lu=u(0,0),this.uu=u(0,0),this.cu=u(0,0)}du(){return this.ru._()}fu(){return this.nu._()}Ya(){return this.wa._()}Au(){return this.hu._()}Ti(){return this.Fi._()}gu(){return this.ou._()}pu(){return this.au._()}mu(){return this.lu}yu(){return this.uu}Su(){return this.cu}Ie(t){return this.wa.M(t),this}vu(t){return this.hu.M(t),this}ze(t){return this.Fi.M(t),this}xu(t){return this.nu.M(t),this.ru.M(t),this}bu(t){return this.ru.M(t),this}Mu(t){return this.nu.M(t),this}_u(t){return this.ou.M(t<0?0:t),this}wu(t){return this.au.M(void 0!==t&&t<=0?void 0:t),this}}var nn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(nn||(nn={}));class on extends Wr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Cu=Mr.lineStyle,this.engine=t}Ee(t){return this.Cu=((t,e)=>"function"==typeof e?e(t):e)(this.Cu,t),this}ku(){return this.Cu}va(){return((t,e)=>!t||t!==e)(this.Tu,this.Cu)}Fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.Tu,t)}ma(){return((t,e)=>t===rt&&e!==rt)(this.Tu,this.Cu)}ya(){return(t=>t!==rt&&t.getFillStyle()!==O)(this.Cu)}Iu(t){this.Tu=t}}class hn extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.Pu=!1}M({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.Pu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}Oe(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Pu=!0,this.Pi=t),this}ze(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Pu=!0,this.Fi=t),this}}class an extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Du=void 0,this.Bu=!1}}class ln extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Lu=[],this.ol=ze,this.ll=new Array,this.al=0,this.dl=Ir.NearestX,this.fl=!1,this.Ru=m(void 0),this.$l=!1,this.Xl=!1}Eu(t){return this.Ru.M(t),this}Vu(){return this.Ru._()}ml(){return this.ll}yl(){return this.Lu}pl(t){return this.dl=t,this}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ol=ze,this}wl(){return this.al-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}}const un=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 cn{constructor(){this.Xi=!0,this.D=new r.Eventer,this.zu=0,this.wt=(t,e,i)=>{0===this.zu&&this.D.emit("mouseEnter",this,e),this.zu+=1},this.Ct=(t,e,i)=>{this.zu-=1,this.zu<1&&(this.D.emit("mouseLeave",this,e),this.zu=0)},this.kt=(t,e,i)=>{this.D.emit("mouseClick",this,e)},this.Tt=(t,e,i)=>{this.D.emit("mouseDoubleClick",this,e)},this.Ft=(t,e,i)=>{this.D.emit("mouseDown",this,e)},this.It=(t,e,i)=>{this.D.emit("mouseUp",this,e)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,r,n)=>{this.D.emit("mouseDrag",this,e,i,s,r)},this.Lt=(t,e,i,s,r)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,e)=>{this.zu+=1,this.D.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.D.emit("touchMove",this,e)},this.zt=(t,e)=>{this.zu-=1,this.D.emit("touchEnd",this,e)},this.Ou=t=>(t instanceof Wr?t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragEventHandler(this.Dt).setMouseDragStartEventHandler(this.Bt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt):(t.onMouseEnter(this.wt),t.onMouseLeave(this.Ct),t.onMouseClick(this.kt),t.onMouseDoubleClick(this.Tt),t.onMouseDown(this.Ft),t.onMouseUp(this.It),t.onMouseMove(this.Pt),t.onMouseDrag(this.Dt),t.onMouseDragStart(this.Bt),t.onMouseDragStop(this.Lt),t.onMouseWheel(this.Rt),t.onTouchStart(this.Et),t.onTouchMove(this.Vt),t.onTouchEnd(this.zt)),t)}onMouseEnter(t){return this.D.on("mouseEnter",t)}onMouseLeave(t){return this.D.on("mouseLeave",t)}onMouseClick(t){return this.D.on("mouseClick",t)}onMouseDoubleClick(t){return this.D.on("mouseDoubleClick",t)}onMouseDown(t){return this.D.on("mouseDown",t)}onMouseUp(t){return this.D.on("mouseUp",t)}onMouseMove(t){return this.D.on("mouseMove",t)}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offMouseEnter(t){return this.D.off(t,"mouseEnter")}offMouseLeave(t){return this.D.off(t,"mouseLeave")}offMouseClick(t){return this.D.off(t,"mouseClick")}offMouseDoubleClick(t){return this.D.off(t,"mouseDoubleClick")}offMouseDown(t){return this.D.off(t,"mouseDown")}offMouseUp(t){return this.D.off(t,"mouseUp")}offMouseMove(t){return this.D.off(t,"mouseMove")}offMouseDragStart(t){return this.D.off(t,"mouseDragStart")}offMouseDrag(t){return this.D.off(t,"mouseDrag")}offMouseDragStop(t){return this.D.off(t,"mouseDragStop")}offMouseWheel(t){return this.D.off(t,"mouseWheel")}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}getIsUnderMouse(){return this.zu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const dn=(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()},oi({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},oi({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),$t(s)}},fn=(t,e,i,s,r)=>{dn(t,r,e)},gn=(t,e,i,s,r)=>{dn(t,s,r)};class yn extends cn{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.Nu=void 0,this.Gu=void 0,this.Wu=un,this.Uu=void 0,this.jo=!0,this.Yu=()=>{const t="function"==typeof this.Wu?this.Wu(this):this.Wu;t&&(this.Gu=this.Ts.us.Er(t))},this.Hu=()=>{this.Ts.us.Vr(this.Gu)},this.Xt=A(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.qo=s,this.qi=r,this.Ts.bs(),this.onMouseEnter(this.Yu),this.onMouseLeave(this.Hu),this.onMouseDrag(fn);const n=Yi(new Xi(wt,gn,wt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.qi=r}setMouseInteractions(t){return this.$u().forEach((e=>e.setMouseInteractions(t))),this.jo=t,this}getMouseInteractions(){return this.jo}setEffect(t){return this.es=this.es||this.Ts.us.es.hs(this,{Xu:{shapes:this.$u()}}),this.es.Xu.xs(t),this}getEffect(){return!!this.es&&this.es.Xu.Ms()}setAutoDispose(t){return this.Uu=t,this.Ts.bs(),this}getAutoDispose(){return this.Uu}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.Ts.bs(),this}getMargin(){return this.Xt}Fe(){if(this.Uu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Uu.type&&i.x>=this.Uu.maxWidth||"max-height"===this.Uu.type&&i.y>=this.Uu.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.$i||(this.Ts.bs(),this.$i=!0,this.qo(this),this.D.emit("dispose",this),this.$u().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.$u().forEach((e=>e.setVisible(t))),this.Ts.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.bs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,oi({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,oi({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,oi({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.bs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return void 0!==this.Nu?this.Nu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Wu=t,this}getMouseStyle(){return this.Wu}}class pn extends yn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Da=A(),this.ju=0,this.Ts=t,this.Zu=s,this.backgroundElement=new this.Zu(this.Ts,this.renderingScale,this.scale,wt,n),this.Ou(this.backgroundElement)}$u(){return this.backgroundElement.$u()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.$i||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Fe(),this}Ds(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Qu(t).Ds(),super.Ds()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.Ts.bs(),this}getPadding(){return this.Da}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Da.left+this.Da.right,i.y+this.Da.bottom+this.Da.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ju()+this.backgroundElement.Ku(),i.y+this.backgroundElement.qu()+this.backgroundElement.tc())),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,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Ju(),y:this.backgroundElement.qu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,oi({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,oi({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.ju}setHighlight(t){return this.ju=Ae(t),this.backgroundElement.setHighlight(t),this.D.emit("highlight",this,t),this}}const mn=t=>"setBackground"in t;class An extends cn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.S=0,this.ic=1,this.sc=!0,this.hc=new ir,this.rc=!0,this.$i=!1,this.axisScale=s,this.renderingScale=r,this.nc=o,this.oc=h,this.ac=a,this.qo=l,this.lc=e,this.uc=i,this.cc=this.Ou(this.lc.Ve(this.renderingScale)),this.qi=u,this.dc=this.Ou(this.ac.fc(this.uc,this.renderingScale,n,wt,this.qi,!1).setOrigin(Ht(this.oc)).setDirection(this.oc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.dc.Ac&&this.cc.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.uc.bs(),this.D.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.gc=t,this.uc.bs(),this}setTickLength(t){return this.dc.setPointerLength(t),this.lc.bs(),this}getTickLength(){return this.dc.getPointerLength()}setTickLabelPadding(t){return this.dc.setTickLabelPadding(t),this.lc.bs(),this}setTickLabelRotation(t){return this.dc.setTextRotation(t),this.lc.bs(),this}getTickLabelRotation(){return this.dc.getTextRotation()}getTickLabelPadding(){return this.dc.getTickLabelPadding()}setGridStrokeLength(t){return this.ic=t,this.lc.bs(),this}getGridStrokeLength(){return this.ic}setGridStrokeStyle(t){return this.cc.Ee(t),this.lc.bs(),this}getGridStrokeStyle(){return this.cc.ku()}dispose(){return this.$i||(this.$i=!0,this.cc.dispose(),this.dc.dispose(),this.qo(this),this.lc.us.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMarkerVisible(t){return this.sc=t,this.uc.bs(),this}getMarkerVisible(){return this.sc}setMarker(t){return t(this.dc),this.uc.bs(),this}getMarker(){return this.dc}setMouseInteractions(t){return this.dc.setMouseInteractions(t),this.cc.setMouseInteractions(t),this}getMouseInteractions(){return this.cc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.rc=t,this.uc.bs(),this}getAllocatesAxisSpace(){return this.rc}isInScale(){return Ge(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}}class xn extends An{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.mc=!1,this.qo=a,this.lc=e,this.uc=i}dispose(){return this.mc=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.mc=!1;const r=lt(this.S,this.axisScale,this.nc.getWidth(this.renderingScale));this.cc.setVisible(!0).Oe(this.nc.toPoint(r,t)).ze(this.nc.toPoint(r,t-(i+e*this.ic))),this.sc?(this.gc&&this.dc.setText(this.gc(this.S,this)),this.dc.setVisible(!0).setPosition(this.nc.toPoint(r,s))):this.dc.setVisible(!1)}else this.cc.setVisible(!1),this.dc.setVisible(!1);return this.dc.Ds().Fe(),this}yc(){const t=this.dc.Ds().getSize();return this.nc.getHeight(t)}}const Sn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),bn=(t,e)=>(he(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),vn=(t,e,i)=>{i&&mn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Mn={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}},Tn={background:void 0,setBackground(t){return{...this,background:t}}},wn={fc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return vn(o,r,n),o}},En={fc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return vn(o,r,n),o}};class kn extends yn{constructor(){super(...arguments),this.Sc=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.Sc=t,this}getMouseInteractions(){return this.Sc}$u(){return[]}}class Cn extends kn{onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}Qu(t){return this.size=t,this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return O}setStrokeStyle(){return this}getStrokeStyle(){return rt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Dn extends yn{constructor(){super(...arguments),this.D=new r.Eventer,this.ju=0}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.ju}setHighlight(t){return this.ju=t,this.$u().forEach((e=>e.cs(t))),this.D.emit("highlight",this,t),this.Ts.bs(),this}}class Fn extends Dn{}class In extends Fn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ts=t,this.el=this.Ts.vc(this.renderingScale,nn.Simple).setVisible(!1).ke(O).Ce(rt),this.Ou(this.el)}xc(){const t=this.bc();if(t.length>2){const e=$e(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=ri(t,si(e.min,-1));return this.scale.pi(this.position,ri(s,oi(si(ri(this.origin,u(1,1)),-.5),i)))})).map((t=>ut(t,this.scale,this.renderingScale)));this.el.Rl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.el&&this.el.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.$i||this.xc(),this}Ds(){return this.xc(),super.Ds()}setVisible(t){return super.setVisible(t),this.el.setVisible(t),this}}const Ln=(t,e,i)=>t*(1-i)+e*i,zn=(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=Ln(i.value,r.value,n),c=Ln(e.value,s.value,h);return Ln(c,u,l)},Pn={warm:t=>e=>E(60/(t-1)*e,.8,.8),cold:t=>e=>E(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>E(360/t*e,.8,.8),reverseSpectrum:t=>e=>E(360/t*(t-e),.8,.8),flatUI:t=>e=>E(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return E(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return E(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return E(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return E(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return E(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>E(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return E(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return E(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),E(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return E(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=>E(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Vn([{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=>Vn([{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=>Vn([{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=>Vn([{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=>Vn([{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=>Vn([{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)},Vn=(t,e,i)=>{const s=On(e,i),[r,n]=Bn(s,t),o=Rn(t[r]),h=Rn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Ln(o.h,h.h,a),s:Ln(o.s,h.s,a),v:Ln(o.v,h.v,a)};return E(l.h,l.s,l.v)},Rn=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},Bn=(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),jn={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},qn=s.Record({type:"linestyle",lineType:"dashed",pattern:jn.DashedEqual,fillStyle:new U({color:T(255,255,255)}),thickness:1,patternScale:3});class Jn extends qn{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")}V(){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 Zn=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),Kn=s.Record({type:"icon",width:void 0,height:void 0,Mc:void 0,_c:wt,wc:wt});class Qn extends Kn{constructor(t,e,i,s){super({...s,Mc:t,_c:e,wc:i})}dispose(){return this.wc(this),this}setWidth(t){const e=this.set("width",t);return this._c(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this._c(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this._c(i),i}oi(){if(!this.Mc)return{x:0,y:0};const t=this.Mc.width,e=this.Mc.height,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 to=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),eo=s.Record({type:"glow",color:T(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class io extends eo{constructor(t){super(t)}setSpread(t){return this.set("spread","function"==typeof t?t(this.get("spread")):t)}getSpread(){return this.get("spread")}setBlur(t){return this.set("blur","function"==typeof t?t(this.get("blur")):t)}getBlur(){return this.get("blur")}setColor(t){return this.set("color","function"==typeof t?t(this.get("color")):t)}getColor(){return this.get("color")}setOffset(t){return this.set("offset","function"==typeof t?t(this.get("offset")):t)}getOffset(){return this.get("offset")}}class so extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._a="label",this.el=this.Ts.kr(this.renderingScale).Bh(this._a).ke(O),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ut(t,this.scale,this.renderingScale);return this.el.Ie(i),this}Ds(){this.el.Ds();const t=0===this._a.length?u(0,0):this.el.Cc();return this.setContentSize(t),super.Ds()}setText(t){return this._a=t,this.el.Bh(this._a),this.Ts.bs(),this}getText(){return this._a}setFont(t){return this.el.Vh(t),this.Ts.bs(),this}getFont(){return this.el.Eh()}setTextRotation(t){return this.el.zh(t),this.Ts.bs(),this}getTextRotation(){return this.el.Oh()}}const ro={...Mn,...wn,uiElement:so};class no extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kc=!1,this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.el=this.Ts.vc(e).ke(O).Ce(rt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=$e([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ut(t,this.scale,this.renderingScale))));return this.kc?this.el.Rl([{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.el.Rl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class oo extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tc=u(0,0),this.el=t.Fc(e).vu(0).ze(360).ke(O).Ce(rt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.el.bu(t*this.renderingScale.Wi().x).Mu(t*this.renderingScale.Wi().y).Ie(ut(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).wu(255).Ds(),this}Qu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Tc=t,this.Ts.bs(),this}Ju(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}Ku(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}tc(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}qu(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Tc=t,this}}class ho extends In{constructor(t,e,i,s,r){super(t,e,i,nn.Simple,s,r),this.Ic=m(u(0,0)),this.Pc=!1,this.Ts=t,this.xc()}bc(){const t=this.Ic._();if(this.Pc){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.Ic._().x*this.Ic._().x/4+this.Ic._().y*this.Ic._().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=ri(r,ri(i,s)),o=ri(n,ri(s,si(i,-1)));return[r,n,o,ni(o,ri(i,s))]}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Qu(t){return this.Ic.M(t),this.Pc=!1,this.Ts.bs(),this}Ju(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}Ku(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}tc(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}qu(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}fitTo(t){return this.Ic.M(t),this.Pc=!0,this.Ts.bs(),this}}class ao extends In{constructor(t,i,s,r,n){super(t,i,s,nn.Simple,r,n),this.Dc=m(u(0,0)),this.Bc=m(10),this.Lc=m(void 0),this.oc=m(e.UIDirections.Right),this.xc()}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}setDirection(t){return this.oc.M(t),this.Ts.bs(),this}getDirection(){return this.oc._()}setPointerLength(t){return this.Bc.M(t),this.Ts.bs(),this}getPointerLength(){return this.Bc._()}setPointerAngle(t){return this.Lc.M(t),this.Ts.bs(),this}getPointerAngle(){let t=this.Lc._();if(void 0===t){const e=this.Rc();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)}Qu(t){return this.Dc.M(t),this.Ts.bs(),this}Ec(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Vc(){return Xt(this.oc._())?this.Dc._().x:this.Dc._().y}Rc(){return Xt(this.oc._())?this.Dc._().y:this.Dc._().x}Ju(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}Ku(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}tc(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}qu(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}bc(){const t=Ht(this.oc._()),e=ei(u(0,0),t),i=this.getPointerLength(),s=this.Ec(),r=this.Vc(),n=this.Rc();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ri(ri(o,si(t,-i)),si(e,s/2)),a=ri(h,si(e,(n-s)/2)),l=ri(a,si(t,-r)),c=ri(ri(o,si(t,-i)),si(e,-s/2)),d=ri(c,si(e,-(n-s)/2)),f=ri(d,si(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Et(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class lo extends Dn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.zc=this.Ts.Oc(i).Sl(e.PointShape.Plus).ke(O),this.Ou(this.zc)}$u(){return[this.zc]}setShape(t){return this.zc.Sl(t),this}getShape(){return this.zc.vl()}setRotation(t){return this.zc.zh(t),this}getRotation(){return this.zc.Oh()}setFillStyle(t){return this.zc.ke(t),this.Ts.bs(),this}getFillStyle(){return this.zc.Lh()}Fe(){const t=ut(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);return this.zc.Nt(),i>0&&this.zc.q(i)._l(t),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class uo extends kn{setSize(t){return this.setContentSize(t),this.Ts.bs(),this}}class co extends pn{constructor(){super(...arguments),this.Nc=[],this.Gc=0,this.Wc=t=>{const e=this.Nc.indexOf(t);e>=0&&this.Nc.splice(e,1)}}getMembers(){return this.Nc}getMemberCount(){return this.Nc.length}setMinimumSize(t){return this.Uc=t,this.Ts.bs(),this}getMinimumSize(){return this.Uc}addElement(t,e=-1){const i=t.fc(this.Ts,this.renderingScale,this.scale,this.Wc,this.qi,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Nc.splice(e,0,i):this.Nc.push(i),i.setVisible(this.getVisible()),this.Ou(i),this.$i&&(fe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Nc.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.Nc.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof uo)),0),s=i>0?(this.size.x-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(1,0)).x),t.x),this}Ds(){for(let t=0;tt+ +(e instanceof uo)),0),s=i>0?(this.size.y-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(0,-1)).y),t.y),this}Ds(){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},vo=bo("Text",[]),Mo={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.D.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.D.on("switch",(e=>t(this,e)))},offSwitch(t){return this.D.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()}},To={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},wo={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()}},Eo={...Mn,...Tn,background:no,fc(t,e,i,s,r,n){const o=new fo(t,e,i,this.background,s,r),h=o.addElement(ro,void 0),a=Object.assign(o,So,{setTextLabel:h},vo,{stylableTexts:[h]});return vn(a,r,n),this.applyStylers(a,r)}}.addStyler(Sn),ko={...Mn,...Tn,background:ao,fc(t,i,s,r,n,o){const h=new fo(t,i,s,this.background,r,n),a=h.addElement(ro,void 0),l=h.getBackground(),u=Object.assign(h,So,{setTextLabel:a},vo,{stylableTexts:[a]},wo,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Ac="other",u.setPointerLength(n.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(n.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(n.uiTextFont).setTextFillStyle(n.uiTextFillStyle).setBackground((t=>t.setFillStyle(n.uiBackgroundFillStyle).setStrokeStyle(n.uiBackgroundStrokeStyle))),vn(u,n,o),this.applyStylers(u,n)}};class Co extends yn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Bs=!1,this.D=new r.Eventer,this.Hc=O,this.$c=O,this.getOn=()=>this.Bs,this.Xc=this.Ou(new lo(this.Ts,this.renderingScale,this.scale,wt,o).setShape(s)),this.$c=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}$u(){return[...this.Xc.$u()]}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setOn(t){return t===this.Bs||(this.Bs=t,this.Xc.setFillStyle(t?this.Hc:this.$c),this.Ts.bs()),this}setOffFillStyle(t){return this.$c="function"==typeof t?t(this.$c):t,this.Bs||this.Xc.setFillStyle(this.$c),this}getOffFillStyle(){return this.$c}setSize(t){return this.Xc.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Xc.getSize()}setOnFillStyle(t){return this.Hc="function"==typeof t?t(this.Hc):t,this.Bs&&this.Xc.setFillStyle(this.Hc),this}getOnFillStyle(){return this.Hc}setButtonShape(t){return this.Xc.setShape(t),this.Ts.bs(),this}getButtonShape(){return this.Xc.getShape()}Fe(){return super.Fe(),this.Xc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.Xc.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.Xc.dispose(),this}setMouseInteractions(t){return this.Xc.setMouseInteractions(t),this}getMouseInteractions(){return this.Xc.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.Xc.setHighlight(e),this.D.emit("highlight",this,t),this.Ts.bs(),this}getHighlight(){return this.Xc.getHighlight()}}const Do={...Mn,uiElement:Co,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},fc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return vn(o,r,n),o}},Fo={...Mn,...Tn,background:no,buttonBuilder:Do,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},fc(t,i,s,r,n,o){const h=new fo(t,i,s,this.background,r,n),a=h.addElement(Ao);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Ao);u.addGap();const c=u.addElement(ro);u.addGap(),h.addGap();const d=Object.assign(h,So,{setTextLabel:c},vo,{stylableTexts:[c]},Mo,{button:l},To);let f;return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:6}),vn(d,n,o),this.applyStylers(d,n)}}.addStyler(Sn).addStyler(bn);class Io extends yn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.jc=[],this.Zc=2,this.Qc="",this.Jc=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:ki(t.value,e.min,e.max),this.Kc=0,this.qc=0,this.td=!1,this.Ts=t,this.sd=n,this.ed=this.Ou(t.Te(e).Ce(rt)),this.hd=this.Ou(t.kr(e).ke(r.uiTextFillStyle).Vh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.rd=140,this.nd=25):(this.rd=160,this.nd=15)}$u(){return[this.ed,this.hd]}od(t){this.ad=t;const e=Po(t,"vertical"===this.sd?0:90,this.td);return this.ed.ke(e),this.Ts.bs(),this}ld(){return this.ad}ud(t){return this.rd=t,this.Ts.bs(),this}dd(){return this.rd}fd(t){return this.nd=t,this.Ts.bs(),this}Ad(){return this.nd}gd(t){return this.Qc=t,this.Ts.bs(),this}pd(){return this.Qc}md(t){return this.Jc=t,this.Ts.bs(),this}setLUTDisplayProportionalSteps(t){if(this.td=t,this.ad){const t=Po(this.ad,"vertical"===this.sd?0:90,this.td);this.ed.ke(t)}return this.Ts.bs(),this}getLUTDisplayProportionalSteps(){return this.td}setFillStyle(t){return this.hd.ke(t),this.Ts.bs(),this}getFillStyle(){return this.hd.Lh()}setFont(t){return this.hd.Vh(t),this.Ts.bs(),this}getFont(){return this.hd.Eh()}setTextRotation(t){return this.qc=t,this.hd.zh(t),this.Ts.bs(),this}getTextRotation(){return this.hd.Oh()}Fe(){var t,i,s,r;if(super.Fe(),this.$i||!this.getVisible())return this;const n=this.ad;if(n){const o=this.renderingScale.Wi(),h=n.min,a=n.max;if("vertical"===this.sd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ri(s,{x:this.ed.oi().x+this.Zc*o.x,y:0}),l={x:r.x,y:r.y+(this.Qc.length>0?this.Kc*o.y+this.hd.oi().y:0)+.5*((null===(t=this.jc[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.jc[this.jc.length-1])||void 0===i?void 0:i.oi().y)||0)};this.ed.Ie({x:s.x,y:l.y}),this.hd.Ja({x:-1,y:-1}).Ie(r),n.getSteps().forEach(((t,e)=>{const i=He(l,u,this.td?!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.jc[e].Ja({x:-1,y:0}).Ie(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.jc.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ri(t,{x:.5*((null===(s=this.jc[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.jc[this.jc.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Qc.length>0?this.Kc*o.x+this.hd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Zc*o.y};this.ed.Ie(f),this.hd.Ja({x:1,y:1}).Ie(c),n.getSteps().forEach(((t,e)=>{const i=He(u,d,this.td?!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.jc[e].Ja({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.ad&&this.getVisible()){const t=this.ad.getSteps();for(let e=this.jc.length;eMath.max(t,e.Ds().Cc().x)),0),this.hd.Ds().Cc().x),s=(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().y:0)+e+.5*this.jc[0].Ds().Cc().y+.5*this.jc[this.jc.length-1].Ds().Cc().y;this.setContentSize({x:i,y:s})}else{const t=this.rd,e=this.nd;this.ed.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().x:0,.5*this.jc[this.jc.length-1].Ds().Cc().x),s=t+.5*this.jc[0].Ds().Cc().x+i,r=e+this.Zc+this.jc.reduce(((t,e)=>Math.max(t,e.Ds().Cc().y)),0);this.setContentSize({x:s,y:r})}}else this.jc.forEach((t=>t.dispose())),this.jc.length=0,this.hd.setVisible(!1),this.ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.ed.dispose(),this.jc.forEach(Tt),this.hd.dispose(),this}setMouseInteractions(t){return this.ed.setMouseInteractions(t),this}getMouseInteractions(){return this.ed.getMouseInteractions()}}const Lo={lutElement:{},setLUT(t){return this.lutElement.od(t),this},getLUT(){return this.lutElement.ld()},setLUTLength(t){return this.lutElement.ud(t),this},getLUTLength(){return this.lutElement.dd()},setLUTThickness(t){return this.lutElement.fd(t),this},getLUTThickness(){return this.lutElement.Ad()},setLookUpUnit(t){return this.lutElement.gd(t),this},getLookUpUnit(){return this.lutElement.pd()},setLUTStepValueFormatter(t){return this.lutElement.md(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},zo={...Mn,...Tn,background:no,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},fc(t,e,i,s,r,n){const o=new go(t,e,i,this.background,s,r),h=o.addElement({fc:()=>new Io(t,e,i,wt,r,this.alignment)}),a=Object.assign(o,vo,{stylableTexts:[h]},Lo,{lutElement:h});return vn(a,r,n),this.applyStylers(a,r)}}.addStyler(Sn),Po=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new et({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 Io(t,i,s,wt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,So,{setTextLabel:c},vo,{stylableTexts:[c,d]},bo("LUTText",[d]),Mo,{button:l},Lo,{lutElement:d},To);let g;return f.onMouseClick((()=>{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:6}),this.applyStylers(f,n)}}.addStyler(Sn).addStyler(bn),Ro={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 Gh?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.ld&&t.ld(),n=t.yd&&t.yd(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Vo.setAlignment(this.alignment):Fo;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),this},addChart(t,e,i,s){return t.Sd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Gh)).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}},Oo={alignment:"vertical",layoutBuilder:Ao,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?xo:Ao}},getAlignment(){return this.alignment},titleBuilder:Eo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},Bo={...Mn,...Tn,...Oo,background:no,fc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).fc(t,e,i,s,r,!1);let h=Object.assign(o,Ro,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Ao:xo),l=a.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(r.legendTitleFillStyle).setTextFont(r.legendTitleFont);return a.addGap(),h=Object.assign(h,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),vn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class _o extends yn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.vd=10,this.xd=e.UIDirections.Up,this.bd=0,this.Ac="major",this._a=this.Ou(t.kr(this.renderingScale)),this.Re=this.Ou(t.Ve(this.renderingScale))}$u(){return[this._a]}Fe(){if(super.Fe(),this.$i)return this;const t=ut(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.xd===e.UIDirections.Right?-this.vd:this.xd===e.UIDirections.Left?this.vd:0,y:this.xd===e.UIDirections.Up?-this.vd:this.xd===e.UIDirections.Down?this.vd:0}),s=this.renderingScale.pi(i,{x:this.xd===e.UIDirections.Right?-this.bd:this.xd===e.UIDirections.Left?this.bd:0,y:this.xd===e.UIDirections.Up?-this.bd:this.xd===e.UIDirections.Down?this.bd:0});return this.Re.Oe(t).ze(i),this._a.Ie(s).Ja(this.xd===e.UIDirections.Up?{x:0,y:1}:this.xd===e.UIDirections.Down?{x:0,y:-1}:this.xd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.ku().getThickness();return this.size=this.xd===e.UIDirections.Left||this.xd===e.UIDirections.Right?{x:this.vd+this.bd+this._a.Ds().Cc().x,y:t}:{y:this.vd+this.bd+this._a.Ds().Cc().y,x:t},super.Ds()}dispose(){return super.dispose(),this._a.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this._a.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this._a.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this._a.getMouseInteractions()}getText(){return this._a.Ph()}setTextFillStyle(t){return this._a.ke(t),this.Ts.bs(),this}getTextFillStyle(){return this._a.Lh()}setTextFont(t){return this._a.Vh(t),this}setTextRotation(t){return this._a.zh(t),this}getTextRotation(){return this._a.Oh()}getTextFont(){return this._a.Eh()}setText(t){return this._a.Bh(t),this.Ts.bs(),this}setDirection(t){return this.xd=t,this.Ts.bs(),this}getDirection(){return this.xd}setPointerLength(t){return this.vd=t,this.Ts.bs(),this}getPointerLength(){return this.vd}setTickLabelPadding(t){return this.bd=t,this.Ts.bs(),this}getTickLabelPadding(){return this.bd}setTickStyle(t){return this.Re.Ee(t),this.Ts.bs(),this}getTickStyle(){return this.Re.ku()}}const No={...Mn,fc(t,e,i,s,r,n){const o=new _o(t,e,i,s,r);return vn(o,r,n),this.applyStylers(o,r)}}.addStyler(Sn),Uo=No.addStyler(((t,e)=>(t.Ac="major",t.setPointerLength(e.xAxisNumericTicks.majorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.majorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.majorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.majorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.majorTickStyle.labelFillStyle)))),Go=No.addStyler(((t,e)=>(t.Ac="minor",t.setPointerLength(e.xAxisNumericTicks.minorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.minorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.minorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.minorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.minorTickStyle.labelFillStyle)))),Wo=Fo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),Yo=Bo.setAlignment("horizontal"),Ho=Bo.setAlignment("vertical"),Xo={TextBox:Eo,CheckBox:Fo,ButtonBox:Wo,PointableTextBox:ko,AxisTickMajor:Uo,AxisTickMinor:Go,LUTRange:zo},$o={HorizontalLegendBox:Yo,VerticalLegendBox:Ho},jo=(t,e)=>{if(Oi(t)){const i=e.$o(t);return{x:i.engineX,y:i.engineY}}return t},qo=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}},Jo=(t,e,i,s=1)=>kt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),Zo=(t,e,i,s=1)=>{const r=i.ct(t),n=i.ct(e);return kt(i.ut(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};class Ko extends Js{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.Md=r,this._d=n}}class Qo extends qs{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,p,m,A,x){var S;super(f,d,l,m,A,{numeric:d.getWidth({x:m.xAxisNumericTicks,y:m.yAxisNumericTicks}),datetime:d.getWidth({x:m.xAxisDateTimeTicks,y:m.yAxisDateTimeTicks}),time:d.getWidth({x:m.xAxisTimeTicks,y:m.yAxisTimeTicks})},x),this.wd=new Map,this.Cd=void 0,this.kd=0,this.Td=[],this.Fd=[],this.Je=Rs.fitting,this.Id=!0,this.Pd=0,this.Dd=8,this.Bd=void 0,this.Ld=void 0,this.Rd=20,this.Ed=1,this.Vd=!0,this.zd=!0,this.Od=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Ud=!0,this.Yd=!0,this.Hd=!0,this.$d=!0,this.Xd=this.Mh.defaultDragMouseStyle,this.jd=this.Mh.defaultDragMouseStyle,this.Zd=this.Mh.defaultDragMouseStyle,this.Qd=this.Mh.defaultDragMouseStyle,this.Jd=this.Mh.defaultDragMouseStyle,this.D=new r.Eventer,this.Kd=[],this.qd=t=>{const e=this.Fd.indexOf(t);e>=0&&this.Fd.splice(e,1)},this.tf=t=>(this.Fd.indexOf(t)<0&&this.Fd.push(t),this.qd),this.Et=(t,e)=>this.D.emit("axisAreaTouch",this,e),this.if=Zt(this.Kd),this.onAxisInteractionAreaMouseClick=t=>this.D.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.D.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.D.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.D.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.D.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.D.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.D.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.D.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.D.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.D.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.D.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.D.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.D.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.D.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.D.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.D.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.D.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.D.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.D.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.D.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.D.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.D.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.D.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.D.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.D.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.D.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.D.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.D.off(t,"axisAreaTouchEnd"),this.sf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().yc()):t,this.ef=t=>{const e=this.Td.indexOf(t);-1!==e&&this.Td.splice(e,1)},this.hf=(t,e)=>{this.D.emit("axisAreaDoubleClick",this,e),this.Nd&&(this.setStopped(!1),$t(e))},this.rf=t=>{this.D.emit("axisAreaMouseEnter",this),(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.af=t=>{this.lf(t),this.D.emit("axisAreaMouseLeave",this)},this.uf=(t,e,i)=>{var s,r;this.D.emit("axisAreaMouseDragStart",this,e,i);const n=Dt(null===(s=this.chart.fs.no)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.zd?(this.cf(t),$t(e)):i===n&&this.Vd&&(this.df(t,h),$t(e))},this.ff=(t,e,i,s,r)=>{var n,o;this.D.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Dt(null===(o=this.chart.fs.no)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.zd?(this.Af(t,r),$t(e)):i===h&&this.Vd&&(this.gf(t,s,l,r),$t(e))},this.pf=(t,e,i,s)=>{var r,n;this.D.emit("axisAreaMouseDragStop",this,e,i,s);const o=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.zd?(this.mf(t),$t(e)):i===o&&this.Vd&&(this.yf(t,s,a),$t(e)),t.getIsUnderMouse()&&(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.Sf=(t,e)=>{if(this.D.emit("axisAreaMouseWheel",this,e),this.Od){this.setStopped(!0);const t=this.Mh.getWidth(this.vf.us.De(e.clientX,e.clientY)),i=this.dt.ut(t);this.zoom(i,de(e)),$t(e)}},this.xf=(t,e)=>this.D.emit("axisAreaMouseClick",this,e),this.bf=(t,e)=>this.D.emit("axisAreaMouseDown",this,e),this.Mf=(t,e)=>this.D.emit("axisAreaMouseUp",this,e),this._f=(t,e)=>this.D.emit("axisAreaMouseMove",this,e),this.wf=(t,e,i)=>{this.D.emit("axisAreaTouchStart",this,i),this.Vd&&(this.nf(t),this.df(t,e),$t(i))},this.Cf=(t,e,i,s,r)=>{this.D.emit("axisAreaTouch",this,r),this.Vd&&(this.gf(t,e,i,s),$t(r))},this.kf=(t,e,i,s)=>{this.D.emit("axisAreaTouchEnd",this,s),this.Vd&&(this.yf(t,e,i),this.lf(t),$t(s))},this.Tf=(t,e,i,s)=>{(this.zd||this.Od)&&(this.nf(t),this.cf(t),$t(s))},this.Ff=(t,e,i,s,r,n)=>{if(this.zd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.Af(t,e),$t(n)}if(this.Od){const t=this.vf.us.De(e.x,e.y),o=this.vf.us.De(i.x,i.y),h=Math.abs(this.Mh.getWidth(ni(t,s))-this.Mh.getWidth(ni(o,r)))-Math.abs(this.Mh.getWidth(t)-this.Mh.getWidth(o)),a=this.dt.pi(this.Th,-h),l=this.dt.pi(this.Fh,h);this.jh(a,l,!0),$t(n)}},this.If=(t,e,i,s)=>{(this.zd||this.Od)&&(this.mf(t),this.lf(t),$t(s))},this.Pf=(t,e)=>{(this.Gd||this.Wd)&&this.Df(t)},this.Bf=(t,e)=>{this.Lf(t)},this.Rf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gd&&this.Ef(t,s)},this.Vf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.zf(t,n,s,r)},this.Of=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.Nf(t,n,s,r)},this.Gf=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gd||this.Wd)&&this.Wf(t,r,s),(this.Gd||this.Wd)&&this.Df(t)},this.Uf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Th,de(e)),$t(e))},this.Yf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Fh,de(e)),$t(e))},this.Hf=(t,e,i)=>{this.Gd&&(this.Df(t),this.Ef(t,e),$t(i))},this.$f=(t,e,i,s,r)=>{this.Gd&&(this.zf(t,e,i,s),$t(r))},this.Xf=(t,e,i,s,r)=>{this.Gd&&(this.Nf(t,e,i,s),$t(r))},this.jf=(t,e,i,s)=>{this.Gd&&(this.Wf(t,e,i),this.Lf(t),$t(s))},this.Md=t,this.Zf=i,this.vf=s,this.Qf=o,this.Jf=h,this.chart=f,this.Kf=y,this.qf=n,this.ss=a,"logarithmic"!==x.type||this.chart.fs.Vn||this.chart.fs.zn||this.chart.fs.eo||this.chart.us.As(St.atob("bG9nIGF4aXM=")),p(this,this.tf),l.tA=this,this.iA=g,this.sA=this.iA>50?1:-1,this.eA=(S=this.Mh.toPoint(0,-this.sA),Math.abs(S.x)>=Math.abs(S.y)?S.x>=0?e.UIDirections.Right:e.UIDirections.Left:S.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.hA=c,this.rA=this.dt instanceof Fi?(new zi).Ri(this.Mh.toVec2(this.dt,this.hA)):(new Pi).Ri(this.Mh.toVec2(this.dt,this.hA)),this.nA=this.chart.pixelScale,this.oA=(new zi).Ri(this.Mh.toVec2(this.Mh.getWidth(this.nA),this.hA)),this.aA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.lA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.uA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.cA=this.qf.Te(this.nA).ke(d.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Ce(rt).aa(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.dA=this.qf.Te(this.nA).ke(d.getWidth({x:m.xAxisZoomingBandFillStyle,y:m.yAxisZoomingBandFillStyle})).Ce(d.getWidth({x:m.xAxisZoomingBandStrokeStyle,y:m.yAxisZoomingBandStrokeStyle})),this.fA=this.qf.Te(this.nA).ke(d.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Ce(rt).aa(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.AA=this.qf.Te(this.nA).ke(d.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Ce(rt).aa(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.Dh=this.qf.kr(this.rA).setMouseInteractions(!1).zh(this.Mh.getTitleTextRotation(this.sA)),this.chart.us.ls.os(this.cA,(t=>this.cA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.fA,(t=>this.fA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.AA,(t=>this.AA.cs(t)),{animationEnabled:this.th});const b=Yi(new Xi(this.wf,this.Cf,this.kf,1),new $i(this.Tf,this.Ff,this.If),new Hi(this.hf)),v=Yi(new Xi(this.Hf,this.$f,this.jf)),M=Yi(new Xi(this.Hf,this.Xf,this.jf));this.cA.setMouseEnterEventHandler(this.rf).setMouseLeaveEventHandler(this.af).setMouseDragStartEventHandler(this.uf).setMouseDragEventHandler(this.ff).setMouseDragStopEventHandler(this.pf).setMouseWheelEventHandler(this.Sf).setMouseDoubleClickEventHandler(this.hf).setMouseClickEventHandler(this.xf).setMouseDownEventHandler(this.bf).setMouseUpEventHandler(this.Mf).setMouseMoveEventHandler(this._f).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.fA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Vf).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Uf).setTouchStartEventHandler(v.onTouchStart).setTouchMoveEventHandler(v.onTouchMove).setTouchEndEventHandler(v.onTouchEnd),this.AA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Of).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Yf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.aA.Ee(d.getWidth({x:m.xAxisStrokeStyle,y:m.yAxisStrokeStyle})),this.lA.Ee(d.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.uA.Ee(d.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.Dh.ke(d.getWidth({x:m.xAxisTitleFillStyle,y:m.yAxisTitleFillStyle})).Vh(d.getWidth({x:m.xAxisTitleFont,y:m.yAxisTitleFont})),this.es=a.hs(this,{}),this.Nh=this.es.gA([this.Dh]).xs(m.effectsText)}wr(){return this.eh}Cr(){return void 0!==this.Xh}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addBand(t=!0){const e=t?this.Jf:this.Qf,i=new Ps(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}addConstantLine(t=!0){const e=t?this.Jf:this.Qf,i=new Vs(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}pA(t){this.Kd.forEach(t)}mA(t){return this.Kd.map(t)}getHighlighters(){return this.Kd}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.Md.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}vA(){return this.Fd}ar(t,e){return new Ko(e,t,this.vf,this.rA,this.Md,this.rA)}Gh(){if(this.wd){for(const t of this.wd)t[1].grid.dispose(),t[1].tick.dispose();this.wd.clear()}super.Gh()}lr(t,e){const{tickStart:i}=e,s=t.Sh.nr,r=i+s.getTickLength()*this.sA+s.getTickPadding()*this.sA;t.Ye.Ie(this.Mh.toPoint(t.S,r)).Ja(this.Mh.toPoint(s.getLabelAlignment(),-this.sA)).zh(s.labelRotation).setVisible(this.getVisible())}xA(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Sh.nr,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.sA;return{gridStroke:{start:this.Mh.toPoint(t.S,r),end:this.Mh.toPoint(t.S,h)},tickStroke:{start:this.Mh.toPoint(t.S,n),end:this.Mh.toPoint(t.S,a)}}}bA(t,e,i,s){return this.Md.Ve(this.rA).Ee(new qi({fillStyle:new U({color:E(360*(1-s))}),thickness:5})).Oe(this.Mh.toVec2(t,0)).ze(this.Mh.toVec2(t,this.sA*(50*s)))}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Zo(t,e,this.dt)}MA(t,e){return e instanceof Fi?Jo:Zo}_r(t,e,i){if("logarithmic"!==this.wh.type){const s=this.dt.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.dt;return{min:s.pi(t,-i),max:s.pi(e,i)}}Fe(t,e,i){const s=this.aA.ku(),r=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart(),o=this.dt.ri(),h=this.hA.getInnerInterval(),a=s.getThickness()*this.sA/2,l=this.iA/100*h,u=l+t,c=h*this.sA,d=u+a,f=this.Td.reduce(this.sf,0);let g,y=0;if(this.Xi||this.Gh(),this.Xe!==Ns&&this.Xi){const t=this.dt.ri();this.Jh({physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});for(const[e,i]of this.Ze){let s=this.wd.get(e);if(!s)if(e.Ne)s={grid:this.Md._A(this.rA).setMouseInteractions(!1),tick:this.Md._A(this.rA).setMouseInteractions(!1)};else if("wA"in e){const t=Array.from(this.Ze.keys()).filter((t=>"wA"in t)).reverse().indexOf(e),i=this.Zf[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._A(this.rA).setMouseInteractions(!1),tick:i._A(this.rA).setMouseInteractions(!1)}}if(s){s.grid.Nt(),s.tick.Nt();for(const[e,r]of i){const e=this.xA(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});s.grid.Lr().CA(e.gridStroke.start,e.gridStroke.end),s.tick.Lr().CA(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.nr.getGridStrokeStyle()),s.tick.Ee(e.nr.getTickStyle()),this.wd.set(e,s)}}for(const t of this.Ze.values()){let e=Le;for(const i of t.values()){const t=i.Sh.nr,s=this.Mh.getHeight(i.Ye.oi()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}y=Math.max(y,e)}g=d+Math.max(y,f)*this.sA}else y=0,g=d+f*this.sA;this.aA.Oe(this.Mh.toPoint(r,u)).ze(this.Mh.toPoint(n,u)),this.lA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerStart(),u)),this.uA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerEnd(),-this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerEnd(),u));const p=this.Dh&&this.Dh.Ph().length>0?this.Mh.getHeight(this.Dh.Ds().oi()):0,m=g+.5*p*this.sA;this.Dh.Ie(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),o/2),m));const A=d,x=A+this.sA*this.kd,S=this.Gd||this.Wd?Math.min(this.Rd,.25*o):0,b={start:this.Mh.toVec2(this.dt.pi(this.dt.getInnerStart(),S),A),end:this.Mh.toVec2(this.dt.pi(this.dt.getInnerEnd(),-S),x)};if(this.Cd){const e=this.iA/100*h+t,i=-this.sA*h-t,s={start:this.Mh.toVec2(this.Cd.min,d+this.sA*this.kd),end:this.Mh.toVec2(this.Cd.max,e+i)},r=ut(s.start,this.rA,this.nA),n=ut(s.end,this.rA,this.nA);this.dA.Ie(r).q(ni(n,r)).setVisible(!0)}else this.dA.setVisible(!1);const v=ut(this.Mh.toVec2(this.dt.getInnerStart(),x),this.rA,this.nA),M=ut(b.start,this.rA,this.nA),T=ut(b.end,this.rA,this.nA),w=ut(this.Mh.toVec2(this.dt.getInnerEnd(),A),this.rA,this.nA);this.cA.Ie(M).q(ni(T,M)),this.fA.Ie(v).q(ni(M,v)),this.AA.Ie(T).q(ni(w,T));for(const e of this.Td)e.update().plot(u,c,t,d);for(const t of this.Kd)t.Fe();const E=s.getThickness()+Math.max(y,f)+(this.Dh&&this.Dh.Ph().length>0?p+this.Pd:0);return this.kd=this.Xi?kt(E,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:Ie):0,this}kA(t){const e=this.aA.ku().getThickness()*this.sA/2,i=this.hA.getInnerInterval(),s=this.iA/100*i+t,r=s+e,n=i*this.sA,o=r+e;for(const e of this.Td)e.update().plot(s,n,t,o);for(const t of this.Kd)t.Fe()}TA(){return this.kd}FA(t,e){e=e||Xo.AxisTickMajor;const i=new xn(this,t?this.Md:this.qf,this.qf,this.dt,this.oA,this.oA,this.Mh,this.eA,this.ef,this.qi,e).setTextFormatter(this.formatValue);return this.Td.push(i),i}nf(t){this.chart.us.ls.ws(t,1),this.Bd=t.us.Er(this.Xd,this.Bd)}lf(t){this.chart.us.ls.ws(t,0),t.us.Vr(this.Bd)}cf(t){this.setStopped(!0),t.us.Vr(this.Bd)}Af(t,e){const i=-this.Mh.getWidth(e);this.pan(i),this.Bd=t.us.Er(this.jd,this.Bd)}pan(t){const e=this.Th,i=this.Fh,s=this.dt.pi(e,t),r=this.dt.pi(i,t);this.jh(s,r,!1)}zoom(t,e){const i=this.dt.ct(this.Th),s=this.dt.ct(this.Fh),r=this.dt.ct(t),n=kt((r-i)/(s-i),0,1),o=.2*this.dt.ri(),h=n*this.Ed*o*-e,a=(1-n)*this.Ed*o*e,l=this.dt.pi(this.Th,h),u=this.dt.pi(this.Fh,a);this.jh(l,u,!0)}mf(t){this.Cd=void 0,t.us.Vr(this.Bd)}df(t,e){this.setStopped(!0),t.us.Vr(this.Bd),this.chart.us.ls.ws(this.cA,0)}gf(t,e,i,s){const r=ut(this.vf.us.De(i.x,i.y),this.vf.us.dt,this.rA),n=kt(this.Mh.getWidth(r),this.Th,this.Fh),o=this.Mh.getWidth(ut(this.vf.us.De(e.x,e.y),this.vf.us.dt,this.rA));Math.abs(this.dt.ct(n)-this.dt.ct(o))>10?(this.Cd=y(Math.min(n,o),Math.max(n,o)),this.Bd=t.us.Er(this.Zd,this.Bd)):(this.Cd=void 0,this.Bd=t.us.Er(this.Xd,this.Bd)),this.vf.bs()}yf(t,e,i){if(this.Cd){const t=this.Cd.min,e=this.Cd.max,i=this.Fh{e.vs(t)}));for(const e of this.wd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.Md.bs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.th),this}}const th={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},eh={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},ih=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof Qo&&"y"in t&&t.y instanceof Qo),sh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new qi,tickLength:7,tickStyle:new qi,tickPadding:0,labelFont:new ir,labelFillStyle:new U,labelPadding:0,labelAlignment:0,labelRotation:0});class rh 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")}setLabelPadding(t){return this.set("labelPadding",t)}getLabelPadding(){return this.get("labelPadding")}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 nh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),oh=new rh({labelFillStyle:O,gridStrokeStyle:rt,tickStyle:rt}),hh=t=>nh(t)&&B(t.labelFillStyle)&&nt(t.gridStrokeStyle)&&nt(t.tickStyle),ah=(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},lh=(t,e,i,...s)=>ah(-1,t,e,i,s),uh=(t,e,i,...s)=>ah(-1,t,e,i,s),ch=(t,e,i,...s)=>ah(0,t,e,i,s),dh=(t,e,...i)=>ah(1,t,e,void 0,i),fh=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},gh=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:lh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:lh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:12,fitFunction:Hs(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:lh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Xs(3,6,12)},minorTicks:{amount:8,fitFunction:Hs(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:lh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Hs({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Hs({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:fh(-1),getNextKeyValueIncludingRef:fh(0),getNextKeyValue:fh(1),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:uh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:ch("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:dh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,3)},minorTicks:{fitFunction:Hs(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:uh("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:ch("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:dh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:uh("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:ch("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:dh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,4)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:uh("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:ch("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:dh("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:uh("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:ch("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:dh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],yh=(t,e,i)=>{let s=((t,e,i,s,r)=>{const n=e-t;let o;for(let t=0;t(s,r,n,o)=>{const h=yh("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(gh.indexOf(h)<=gh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ys(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Ws(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||Ge(d,l,u)?[a]:[d]:void 0!==d&&Ge(d,l,u)?[d]:[u]},mh=(t,e,i)=>(s,r,n,o)=>{const h=yh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ys(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Ws(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 gh[gh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Gs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Ah=t=>(e,i,s,r,n,o)=>{const h=yh(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},xh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new rh,majorTickStyle:new rh,minorTickStyle:new rh,formatOptionsMajorCentury:{year:"numeric"},formatOptionsMinorDecade:{year:"numeric"},formatOptionsMajorDecade:{year:"numeric"},formatOptionsMinorYear:{year:"numeric"},formatOptionsMajorYear:{year:"numeric"},formatOptionsMinorMonth:{month:"short"},formatOptionsGreatYear:{year:"numeric"},formatOptionsMajorMonth:{month:"long"},formatOptionsMinorWeek:{day:"numeric"},formatOptionsGreatMonth:{year:"numeric",month:"long"},formatOptionsMajorWeek:{day:"numeric",weekday:"short"},formatOptionsMinorDay:{day:"numeric",weekday:"short"},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"}).format(s)} Week ${r}`},formatOptionsMajorDay:{weekday:"long",day:"numeric"},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},formatOptionsMajorSecond:{second:"2-digit"},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(2)}`},formatOptionsGreatSecond:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsMajorMilliSecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(1)}`}});class Sh extends xh{Wh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>gh.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond100":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorMilliSecond:t.formatOptionsMinorMillisecond;case"Second":return"Great"===e?t.formatOptionsGreatSecond:"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]},`;St.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=yh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Et(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[gh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ye:"Great ticks (directive)",wA:0,Ge:!0,Ir:mh("great",e,this.utc),Pr:void 0},{Ye:"Major ticks",wA:1,nr:this.majorTickStyle,hr:n("major"),Ir:mh("major",e,this.utc),xh:{ur:Ah("major")},Pr:void 0}];hh(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",nr:this.greatTickStyle.setLabelAlignment(-1),hr:n("great","left"),Ir:ph(e,this.utc,"left"),Ne:!0,Ar:!1}),o.push({Ye:"Great ticks (right)",nr:this.greatTickStyle.setLabelAlignment(1),hr:n("great","right"),Ir:ph(e,this.utc,"right"),Ne:!0,Ar:!1})),hh(this.minorTickStyle)||h.push({Ye:"Minor ticks",wA:2,nr:this.minorTickStyle,hr:n("minor"),Ir:mh("minor",e,this.utc),xh:{ur:Ah("minor"),bh:(t,e,i,s,r,n)=>{const o=yh("minor",r,n);return!o||"Week"!==o.label}},Pr:void 0});const a=this.cursorFormatter;return{He:o,$e:h,We:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=new Date(e+t);return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(r)} `},Hh:1e3,$h:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}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("formatOptionsGreatSecond",t||this.formatOptionsGreatSecond).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("formatOptionsMajorMilliSecond",e||this.formatOptionsMajorMilliSecond).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 bh=(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 Ws(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,Gs(i,s,o,h)},vh=(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,Mh=(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,Th=Hs(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,Eh=(t,e)=>{const i=vi(t),s=Mi(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&&sCi.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),n=[],o=[];hh(this.extremeTickStyle)||n.push({Ye:"Extreme ticks",nr:this.extremeTickStyle,hr:void 0===e?i:(t,s,r)=>i(e+t,s,r),Ir:Us,Ne:!0,Ar:!0}),o.push({Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:void 0===e?s:(t,i,r)=>s(e+t,i,r),Ir:"logarithmic"===t.type?Eh(t.base,!0):bh(0,!0),xh:"logarithmic"===t.type?{ur:Mh}:{ur:vh},Pr:void 0}),hh(this.minorTickStyle)||o.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:void 0===e?r:(t,i,s)=>r(e+t,i,s),Ir:"logarithmic"===t.type?Eh(t.base,!1):bh(1,!1),xh:"logarithmic"===t.type?{ur:wh}:{ur:Th},Pr:50});const h=this.cursorFormatter?this.cursorFormatter:Ci.Numeric;return{He:n,$e:o,We:void 0===e?h:(t,i,s)=>h(e+t,i,s),Hh:1e-9,$h: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")}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 Dh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new rh,minorTickStyle:new rh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Fh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"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"},Ih={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}${ue(s,2)}:${ue(r,2)}:${ue(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}${ue(s,2)}:${ue(r,2)}:${ue(n,2)}.${ue(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}${ue(s,2)}:${ue(r,2)}:${ue(n,2)}.${ue(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}${ue(s,2)}:${ue(r,2)}:${ue(n,2)}.${ue(o,3)}${h}`}},Lh={MajorHours12:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Ws(t,e,r,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,36e5,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:Ih.hhmmss},MajorHours:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Ws(t,e,r,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,6,12)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,3e5,1e6),fitKeyValues:Hs({},2,4,6)},defaultValueFormatter:Ih.hhmmss},MajorMinutes15:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Ws(t,e,9e5,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,6e4,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:Ih.hhmmss},MajorMinutes:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Ws(t,e,6e4,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,5e3,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:Ih.hhmmss},MajorSeconds15:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Ws(t,e,15e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,1e3,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:Ih.hhmmss},MajorSeconds:{major:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Ws(t,e,1e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,100,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmm},MajorMilliseconds100:{major:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Ws(t,e,100,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,10,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmm},MajorMilliseconds10:{major:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Ws(t,e,10,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,1,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmm},MajorMilliseconds:{major:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Ws(t,e,1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.1,1e6),fitKeyValues:Hs({},2)},defaultValueFormatter:Ih.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Ws(t,e,.1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.01,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Ws(t,e,.01,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.001,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Ws(t,e,.001,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,100*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Ws(t,e,r,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,10*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.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 zh extends Dh{Wh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Fh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Lh[r].major.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const r=Fh(i,s);return(0,Lh[r].major.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,r,n)=>{const o=Fh(r,n),h=Lh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Pr:void 0}];return nh(this.minorTickStyle)&&i.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Fh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Lh[r].minor.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const r=Fh(i,s);return(0,Lh[r].minor.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,r,n)=>{const o=Fh(r,n),h=Lh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Pr:void 0}),{He:[],$e:i,We:this.cursorFormatter||((t,i,s)=>{const r=Fh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Lh[r].defaultValueFormatter(t+e,i,s)}),Hh:1e-4,$h:864e6}}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 Ph=(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(St.navigator.msSaveBlob)St.navigator.msSaveBlob(r,e);else{const t=St.document.createElement("a");St.document.body.appendChild(t);const i=St.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{St.URL.revokeObjectURL(i),St.document.body.removeChild(t)}),0)}},Vh=(t,i,s,r,n,o)=>{const h=t.fc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},Rh=(t,e)=>{if("relative"===t)return e;if(t instanceof Li)return t;const i=t.x instanceof qs?t.x.dt:t.x.x,s=t.y instanceof qs?t.y.dt:t.y.y;return Vi(i,s)},Oh=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=ih(o)?o:Bi(o)?s:void 0;if(h&&Ri(i)){const t=ut(n,h,r.dt);return r.Xo({engineX:t.x,engineY:t.y})}if(h&&Bi(i))return ut(n,h,s);if(h&&ih(i))return ut(n,h,i)}else{const i=t;if(Bi(e)){const t=r.$o(i);return ut({x:t.engineX,y:t.engineY},r.dt,s)}if(ih(e)){const t=e,s=r.$o(i);return ut({x:s.engineX,y:s.engineY},r.dt,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Bh{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.IA=[],this.PA=[],this.D=new r.Eventer,this.DA=void 0,this.BA=void 0,this.LA=void 0,this.Xt=A(0,0,0,0),this.RA=!1,this.$i=!1,this.EA=()=>{this.VA=!0,this.zA.bs()},this.OA=t=>e=>{const i=this.IA.indexOf(e);-1!==i&&this.IA.splice(i,1),this.us.bs(),t.W()},this.NA=t=>{const e=this.PA.indexOf(t);-1!==e&&this.PA.splice(e,1),this.us.bs()},this.VA=!0,this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.fs=t,this.GA=i,this.zA=s,this.removePanel=n,this.qi=e.us.qi;const l=e.us.oi();if(this.uiScale=i.d2({scaleXYConstructor:zi}).zi(0,100).Oi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:zi}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.us.WA,this.us=e.us.UA,this.es=this.us.es.hs(this,{}),this.YA=()=>e.HA("unidentified ui"),this.$A=e.XA(),this.jA=this.zA.Te(this.uiScale).Ie(u(0,0)).q(u(100,100)).ke(o).Ce(h).setMouseMoveEventHandler(((t,e)=>this.D.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.D.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.D.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.D.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.D.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.D.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.D.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.EA);this.ZA=()=>a.off(t)}else{const t=e.us.Go(this.EA);this.QA=e.us.Wo.bind(e.us,t)}const c=e.us.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=e.us.Ho.bind(e.us,c),this.DA=n}getTheme(){return this.qi}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.jA.ke(t),this.zA.bs(),this}getBackgroundFillStyle(){return this.jA.Lh()}setBackgroundStrokeStyle(t){return this.jA.Ce(t),this.zA.bs(),this}getBackgroundStrokeStyle(){return this.jA._o()}translateCoordinate(t,e,i){return Oh(t,e,i,this.pixelScale,this.us)}KA(t){return this.IA.push(t),this.us.bs(),t}qA(t){return this.PA.push(t),this.us.bs(),t}addUIElement(t=Eo,e=this.uiScale){e=Rh(e,this.pixelScale);const i=this.YA();return this.KA(Vh(t,i,this.uiScale,e,this.OA(i),this.qi))}addLegendBox(t=Bo,i=this.uiScale){i=Rh(i,this.pixelScale);const s=this.qA(Vh(t,this.$A,this.uiScale,i,this.NA,this.qi));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Ts.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Ts.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.PA}dispose(){return this.$i||(this.$i=!0,this.QA&&this.QA(),this.ZA&&this.ZA(),_h(this.uiScale),_h(this.pixelScale),this.JA&&this.JA(),this.BA&&this.BA(),this.zA.W(),this.$A.W(),this.IA.slice().forEach((t=>{t.dispose()})),this.PA.slice().forEach((t=>{t.dispose()})),this.us.bs(),this.DA&&this.DA(this),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}saveToFile(t,e,i){return Ph(this.engine,t,e,i),this}Ka(t){this.Xt=t,this.EA()}j(){return this.pixelScale.j(),this.uiScale.j(),this}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}Fe(t){if(this.VA){const t=this.zA.us.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Xt.left,this.Xt.right],r=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.Vi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,n.x).Ei(s).Oi(0,n.y).Vi(r),this.D.emit("resize",this,n.x,n.y,e,i)}this.VA=!1}tg(){for(let t=0;t{t.ii&&t.ii()};class Nh extends Bh{constructor(t,e,i,s,r,n){super(t,e,i,e.sg("uipanel bg",0),s,e.us.qi.uiPanelBackgroundFillStyle,e.us.qi.uiPanelBackgroundStrokeStyle,n),this.ig(r,this.pixelScale)}setMinimumSize(t){return this.Uc=t,this.us.bs(),this}getMinimumSize(){return this.Uc}Fe(t){super.Fe(t),super.tg()}}const Uh=A(10,10,10,10);class Gh extends Bh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.eg={},this.Da=Uh,this.th=!0,this.hg=e.rg("chart internal ui",0),this.ng=this.hg.kr(this.uiScale).Bh("Chart").Ie(u(50,100)).Ja(u(0,1)).Vh(h).ke(a).setMouseInteractions(!1),this.og=this.es.gA([this.ng]).xs(this.qi.effectsText)}setAnimationsEnabled(t){return this.th=t,this}getAnimationsEnabled(){return this.th}setTitle(t){return this.ng.Bh(t),this.us.bs(),this}getTitle(){return this.ng.Ph()}getTitleSize(){return this.ng.Ds().Cc()}setTitleFillStyle(t){return this.ng.ke(t),this.EA(),this}getTitleFillStyle(){return this.ng.Lh()}setTitleFont(t){return this.ng.Vh(t),this.EA(),this}getTitleFont(){return this.ng.Eh()}setTitleRotation(t){return this.ng.zh(t),this.us.bs(),this}getTitleRotation(){return this.ng.Oh()}setTitleEffect(t){return this.og.xs(t),this.us.bs(),this}getTitleEffect(){return this.og.Ms()}setTitleMargin(t){var e,i;return this.eg="object"==typeof t?this.eg?(e=this.eg,{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.EA(),this}getTitleMargin(){return this.eg}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.EA(),this}getPadding(){return this.Da}ag(t){const e=t.lg(),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.hg.W(),this}}const Wh={ug:(t,e)=>t.Lh()!==O&&0!==t.Ph().length&&t.getVisible()?t.Ds().Cc().y:0,cg(t,e){t.Ie(u(50,100)).Ka({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var Yh;e.AutoCursorModes=void 0,(Yh=e.AutoCursorModes||(e.AutoCursorModes={}))[Yh.disabled=0]="disabled",Yh[Yh.snapToClosest=1]="snapToClosest",Yh[Yh.onHover=2]="onHover";const Hh={dg(t,i,s,r,n,o){let h;const a=t.getAutoCursorMode();if(!s&&a!==e.AutoCursorModes.disabled){const s=t.us.Bn(),l=r.find((t=>t.getIsUnderMouse()));a===e.AutoCursorModes.snapToClosest&&n?(i||void 0!==l)&&(h=s&&n(s)):void 0===l||l.getCursorEnabled&&!l.getCursorEnabled()||(h=s&&o(l,s))}h?t.Ag.pointAt(h).setVisible(!0):t.Ag.setVisible(!1),t.Ag.Ds().Fe()},gg(t,e,i){if(e.xt.uiScale.x.hi()||e.yt.uiScale.y.hi())return;let s,r=Number.MAX_VALUE;for(const n of i)if(n.getCursorEnabled()&&n.getVisible()){const i=n.gg(e);if(i){const n=ut(i.location,i.scale,t.engine.scale),o=We(e,n);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))},mg(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))}};class Xh{constructor(t,e){this.yg=t,this.Sg=e}alter(t){this.vg=void 0!==this.vg?this.vg:this.Sg(),this.xg=t,this.yg(t)}resetValue(){void 0!==this.xg&&(void 0!==this.vg&&this.isAltered()&&this.yg(this.vg),this.vg=void 0,this.xg=void 0)}getNormalValue(){return void 0!==this.vg?this.vg:this.Sg()}isAltered(){return void 0!==this.xg&&this.Sg()===this.xg}}class $h{constructor(t,e){this.bg=[],this.Mg=t,this.dt=e}update(){return this.Mg.getVisible()?!(this._g()&&(!this.wg()||(this.resetTable(),this.Mg.Ds(),this._g()))&&(this.Cg(),this.Mg.Ds(),this._g()&&(this.resetTable(),this.Mg.Ds(),1))):(this.wg()&&this.resetTable(),!0)}wg(){for(let t=0;t{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Mg,this.dt)}kg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Mg,this.dt)}Tg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Mg,this.dt)}Fg(t){return this.bg.push(t),t}}class jh extends $h{constructor(){super(...arguments),this.Pa=this.Fg(new Xh((t=>this.Mg.setOrigin(t)),(()=>this.Mg.getOrigin())))}Cg(){const t=this.Pa.getNormalValue(),e=u(this.kg()?-t.x:t.x,this.Tg()?-t.y:t.y);this.Pa.alter(e)}}class qh extends $h{constructor(t,e,i,s){super(t,e),this.Ig=this.Fg(new Xh((t=>this.Mg.setTextFont((e=>e.setSize(t)))),(()=>this.Mg.getTextFont().getSize()))),this.Pg=i,this.Dg=s}Cg(){const t=this.Ig.getNormalValue(),e=this.Pg;if(enew jh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new qh(i,s,t,e)};class Zh{constructor(){this.Bg=[]}addRow(...t){return this.Bg.push(t),this}}class Kh extends Zh{fc(){const t=this.Bg;return this.Bg=[],t}Lg(){return this.Bg.length=0,this}}class Qh extends po{constructor(){super(...arguments),this.hc=this.qi.cursorResultTableTextFont,this.qc=0,this.Rg=this.qi.cursorResultTableTextFillStyle}setContent(t){for(let e=0;e=e)this.getMembers()[s].dispose(),s-=1,i-=1;else{const e=t[s].length;let i=r.getMembers().length;for(let n=0;n=e)r.getMembers()[n].dispose(),n-=1,i-=1;else if(void 0!==l&&l.length>0){for(let t=u.length;t=u.length)t=r.addElement(ro,void 0);else{const e=u[n];e instanceof uo?(r.getMembers()[n].dispose(),t=r.addElement(ro,n)):t=e}const e=h?this.hc.withMutations((t=>{for(const e of Object.keys(h)){const i=h[e];t.set(e,i)}return t})):this.hc,i=a||this.Rg;t.setFont(e).setFillStyle(i).setText(l).setTextRotation(this.qc)}else{for(let t=u.length;t=u.length?r.addGap(void 0,void 0):u[n]instanceof so&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.Ts.bs(),this}setTextFillStyle(t){this.Rg="function"==typeof t?t(this.Rg):t;for(let t=0;tt.setFillStyle(r.cursorResultTableFillStyle).setStrokeStyle(r.cursorResultTableStrokeStyle))).setTextFillStyle(r.cursorResultTableTextFillStyle).setTextFont(r.cursorResultTableTextFont),this.Gg=Jh.Flip(this.Mg,this.scale)}dispose(){return this.Ng.dispose(),this.Mg.dispose(),this}pointAt(t){return this.wa=t.scale===this.scale?t.location:ut(t.location,t.scale,this.scale),this.Ng.setPosition(this.wa),this.Mg.setPosition(this.wa).setContent(t.resultTableContent),this.Ts.bs(),this}getPosition(){return this.wa}setVisible(t){return this.Xi=t,this.Ts.bs(),this}getVisible(){return this.Xi}setPointMarkerVisible(t){return this.Vg=t,this.Ts.bs(),this}getPointMarkerVisible(){return this.Vg}setPointMarker(t){return t(this.Ng),this.Ts.bs(),this}getPointMarker(){return this.Ng}setResultTableVisible(t){return this.zg=t,this.Ts.bs(),this}getResultTableVisible(){return this.zg}setResultTable(t){return t(this.Mg),this.Ts.bs(),this}getResultTable(){return this.Mg}setAutoFitStrategy(t){return this.Gg&&this.Gg.resetTable(),this.Gg=t?t(this.Mg,this.Ts.us.dt):void 0,this.Ts.bs(),this}getAutoFitStrategy(){return void 0!==this.Gg}Fe(){return this.Gg&&this.Gg.update(),this.Mg.setVisible(this.RA&&this.Xi&&this.zg),this.Ng.setVisible(this.RA&&this.Xi&&this.Vg),this.Ng.Fe(),this.Mg.Fe(),this}Ds(){return this.Ng.Ds(),this.Mg.Ds(),this.RA=((t,e,i=e)=>{const s=e!==i?ut(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.wa,this.scale),this}}class ea extends ta{constructor(){super(...arguments),this.Wg=!1}pointAt(t){return this.Ug(t.fillStyle),super.pointAt(t)}Ug(t){t&&this.Wg&&this.Mg.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.Wg=t,this.Ts.bs(),this}getResultTableAutoTextStyle(){return this.Wg}}class ia extends ta{setPosition(t){return this.wa=t,this.Ng.setPosition(t),this.Mg.setPosition(t),this.Ts.bs(),this}}class sa{constructor(t,e=[]){this.Yg=[],this.Hg=(t,e)=>(this.Yg.forEach((i=>i(t,e))),t),this.Og=t,this.Yg=e}}class ra extends sa{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new ea(t,e,i,this.Og,s),s),this.addStyler=t=>new ra(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ra(t,this.Yg.map((t=>t)))}}class na extends sa{constructor(){super(...arguments),this.Xg=(t,e,i,s)=>this.Hg(new ia(t,e,i,this.Og,s),s),this.addStyler=t=>new na(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new na(t,this.Yg.map((t=>t)))}}const oa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),ha=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setSize(e.chartMarkerPointMarkerSize).setShape(e.chartMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10))),aa=new ra(no,[oa]),la=new ra(ao,[oa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof ao&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),ua=aa,ca=aa,da=la,fa=new na(no,[ha,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),ga=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:r});var ya;e.SliceLabelIndices=void 0,(ya=e.SliceLabelIndices||(e.SliceLabelIndices={}))[ya.LabelsInsideSlices=0]="LabelsInsideSlices",ya[ya.LabelsOnSides=1]="LabelsOnSides";const pa={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},ma={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Aa=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class xa extends Ui{constructor(){super(...arguments),this._s="Slice",this.S=0}}const Sa=(t,e)=>{$t(e),t.setExploded(!t.getExploded())};class ba extends xa{}class va extends ba{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.jg=!1,this.Zg=O,this.Qg=O,this.Jg=this.S,this.Kg=this.jg?1:0,this.qg=this.getVisible(),this.tp=j((()=>this.Ji.us.bs())),this.ip=j((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.hp=()=>{this.rp=void 0},this.index=t,this.Ji=s,this.scale=r,this.Ki=n,this.np=e.Fc(r).cs(this.getHighlight()),this.gs(this.np),this.Ye=i.kr(r).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.onMouseClick(Sa),this.onTouchEnd(Sa)}setValue(t){return this.Ji.getAnimationsEnabled()?this.qg&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ji.getMultipleSliceExplosion()){const t=this.Ji.getSlices();for(let e=0;e{this.Kg=t,this.Ji.us.bs()})),this.rp.onEveryAnimationEnd(this.hp),this.jg=!this.jg):!1!==this.Ji.getMultipleSliceExplosion()||t?(this.Kg=this.jg?0:1,this.jg=!this.jg):(this.Kg=0,this.jg=!this.jg),this.Ji.us.bs(),this}getExploded(){return this.jg}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.Zg=t,this.Qg=i,this.np.ke(this.Zg).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;tri(e,si(yi(.5*(t.Au()+t.Ti())*Math.PI/180),i)),Ta=(t,e,i,s,r,n)=>{const o=t.length;let h=90;for(let a=0;a{const e=t.getSlices();for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(7),this._p=i.wp("pieChart bottom",0),this.Cp=i.wp("pieChart top",1),this.ng.Bh("Pie Chart"),this.ig(n,this.pixelScale),this.onBackgroundMouseDoubleClick(wa);const a=Yi(new Hi(wa));this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.kp=i.Tp();const l=Dt(h?h.autoCursorBuilder:void 0,ca);this.Ag=l.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new va(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.gp+=1,i.setName(t);const s=this.th;return this.th=!1,i.setValue(e),this.th=s,i.setEffect(this.yp),this.Fp(i),this.ap.push(i),this.Mp(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){this.Ap="function"==typeof t?t(this.Ap):t;for(let t=0;te.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);if(this.ad){const t=this.ad;this.ap.forEach((e=>{this.Fp(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.ap[t].np.setVisible(e),this.ap[t].Ye.setVisible(e)}this.ap=this.ap.sort(this.lp);const r=this.ap.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tga(e,this.engine.scale,this.xp(new Kh,this,t,o[r.indexOf(t)]||0).fc(),t,void 0))),this.Pp(r,o,s,i)}Fp(t,e=this.up(t.index)){t.setStyle(e,this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return super.dispose(),this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.Cp.W(),this._p.W(),this.kp.W(),this}}const ka={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ca=(...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 Da extends Ea{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Ip=ma.NamePlusValue,this.Dp=[],this.Bp=40,this.Lp=5,this.Rp=10,this.Ep=this.qi.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const r=360*e[s],h=c-r,a=yi(di(.5*(c+h))),l=a.x>=0?-1:1,d=ri(ri(i,si(a,u+n)),{x:l*-o,y:0});c=h;const f={x:l,y:0};t.Ye.Ie(d).Ja(f),t.Ye.Ds();const g=$e(t.Ye.Ue());return{position:d,alignment:f,shape:t.Ye,boundaries:g,sliceAngleVec:a,slice:t}})),f=[];for(let t=0;t{const s=t.slice.np,r=Ma(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=ci(t.position.y,r,i),o=t.position;this.Vp([r,n,o])}))}getMinimumSize(){return u(500,300)}Vp(t){let e;for(let t=0;t{if(Ji(t)){const e=t.getThickness(),i=t.getFillStyle();if(G(i))return 1===e?nr:new hr({size:e,fillStyle:i,shape:"sphere"})}return nr};class za{constructor(t,e,i,s){this.Np=[],this.Gp=new Map,this.Wp=t,this.Yp=e,this.Hp=i,this.$p=s}Xp(){this.Hp&&this.Hp();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.Np.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.Wp(),this.Np.push(e));const n=[],o=e.jp().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Yp(e,n,t.sharedProperties);i=se(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.Wc(t)}))})),s.forEach((t=>{t.dispose();const e=this.Np.indexOf(t);e<0?fe(0,(()=>{})):this.Np.splice(e,1)})),r.forEach((t=>{const e=this.Gp.get(t.ia);e&&t.collection.us.po({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.Gp.clear(),r.forEach((t=>{this.Gp.set(t.ia,t)})),this.$p&&this.$p(this.Np,i)}}}Zp(){this.Np.forEach((t=>{t.dispose()})),this.Np.length=0}}class Pa{constructor(t){this.Qp=[],this.Jp=t}Xp(){return this.Kp(),{add:()=>this.vl(),finishPlot:()=>{this.qp()}}}vl(){let t=this.Qp.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Jp()},this.Qp.push(t)),t.isFree=!1,t.shape}Kp(){this.Qp.forEach((t=>{t.isFree=!0}))}qp(){this.Qp.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Qp.splice(this.Qp.indexOf(t),1)}))}Zp(){this.Qp.forEach((t=>t.shape.dispose())),this.Qp.length=0}}class Va{constructor(t,e,i,s,n,o,h,a,l,u){this.D=new r.Eventer,this.S=0,this.Xi=!0,this.$i=!1,this.bs=t,this.tm=e,this.im=i,this.sm=s,this.hm=n,this.rm=o,this.qc=h,this.Rg=a,this.nm=l,this.gc=u}setValue(t){return t===this.S||(this.S=t,this.bs(),this.D.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.im="function"==typeof t?t(this.im):t,this.bs(),this}getTickStyle(){return this.im}setTickLength(t){return this.sm=t,this.bs(),this}getTickLength(){return this.sm}setGridStrokeStyle(t){return this.hm="function"==typeof t?t(this.hm):t,this.bs(),this}getGridStrokeStyle(){return this.hm}setTextPadding(t){return this.rm=t,this.bs(),this}getTextPadding(){return this.rm}setTextRotation(t){return this.qc=t,this.bs(),this}getTextRotation(){return this.qc}setTextFillStyle(t){return this.Rg="function"==typeof t?t(this.Rg):t,this.bs(),this}getTextFillStyle(){return this.Rg}setTextFont(t){return this.nm="function"==typeof t?t(this.nm):t,this.bs(),this}getTextFont(){return this.nm}setTextFormatter(t){return this.gc=t,this.bs(),this}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.tm(),this.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.D.emit("visibleStateChanged",this,this.Xi),this.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}class Ra extends qs{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.om({x:t.us.qi.xAxis3DNumericTicks,y:t.us.qi.yAxis3DNumericTicks,z:t.us.qi.zAxis3DNumericTicks}),datetime:e.om({x:t.us.qi.xAxis3DDateTimeTicks,y:t.us.qi.yAxis3DDateTimeTicks,z:t.us.qi.zAxis3DDateTimeTicks}),time:e.om({x:t.us.qi.xAxis3DTimeTicks,y:t.us.qi.yAxis3DTimeTicks,z:t.us.qi.zAxis3DTimeTicks})},{type:"linear"}),this.Td=[],this.am=()=>{},this.lm=()=>{},this.um=()=>{},this.dm=()=>{},this.chart=t,this.At=r,this.fm=n,this.Am=o,this.gm=this.At.dt;const l=this.Mh.om({x:this.qi.xAxis3DStrokeStyle,y:this.qi.yAxis3DStrokeStyle,z:this.qi.zAxis3DStrokeStyle});this.pm=this.At.zp([ka.InternalUI]).Ee(l).ym(La(l)).setMouseInteractions(!1),this.Dh=this.fm.kr(this.Am).setMouseInteractions(!1).ke(e.om({x:t.us.qi.xAxis3DTitleFillStyle,y:t.us.qi.yAxis3DTitleFillStyle,z:t.us.qi.zAxis3DTitleFillStyle})).Vh(e.om({x:t.us.qi.xAxis3DTitleFont,y:t.us.qi.yAxis3DTitleFont,z:t.us.qi.zAxis3DTitleFont})),this.Sm=new Pa((()=>this.fm.kr(this.Am))),this.vm=new za((()=>this.At._A().setMouseInteractions(!1)),((t,e,i)=>(t.Nt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t._l(e)))))),this.es=a,this.Nh=this.es.gA([this.Dh]).xs(s.effectsText),this.pm.setMouseEnterEventHandler(this.am).setMouseLeaveEventHandler(this.lm).setMouseDragEventHandler(this.um).setMouseDragStopEventHandler(this.dm),i.tA=this}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addCustomTick(){const t=new Va((()=>this.chart.us.bs()),(()=>{const e=this.Td.indexOf(t);e>=0&&this.Td.splice(e,1)}),this.qi.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickLength,this.qi.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.qi.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Td.push(t),this.chart.us.bs(),t}setStrokeStyle(t){return this.pm.Ee(t).ym(La(this.pm.ku())),this.chart.us.bs(),this}getStrokeStyle(){return this.pm.ku()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.pm.setVisible(t),!1===t&&(this.vm.Zp(),this.Sm.Zp()),this.fm.bs(),this}vA(){return this.chart.getSeries()}xm(t){return Math.abs(this.dt.tt(t)*this.At.bm(1))}_r(t,e,i){const s=Math.abs(this.dt.tt(e-t)*this.At.bm(1));return{min:t-i*s,max:e+i*s}}ar(t,e){return new Oa(e,t,this.fm,this.Am,this.At)}lr(t,e){const i=this.Mm(e,t.S,t.Sh.nr.tickLength,t.Sh.nr.tickPadding);return t.Ye.Ie(i.labelPosition).Ja(i.labelAlignment),i}Mm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),c=Fe.addVec(Xe(n,o,l),Fe.multiplyVec(Fe.multiply(h,this.At.bm(.5*this.pm.ku().getThickness())),r)),d=Fe.addVec(c,Fe.multiplyVec(Fe.multiply(h,this.At.bm(i)),r)),f=this.At._m(d)||u(0,0);return{labelPosition:ri(ut(f,this.chart.engine.scale,this.Am),si(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}bA(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),a=Fe.addVec(Xe(r,n,h),Fe.multiplyVec(Fe.multiply(o,this.At.bm(.5*this.pm.ku().getThickness())),s)),l=Fe.addVec(a,Fe.multiplyVec(Fe.multiply(o,this.At.bm(10)),s)),c=this.At._m(a)||u(0,0),d=this.At._m(l)||u(0,0);return this.fm.Ve(this.Am).Oe(c).ze(d).Ee(new qi({fillStyle:new U({color:E(120*i)}),thickness:1}))}br(t,e){return Ba(t,e,this.dt)}Fe(t){if(!this.Xi)return;const e=Math.min(this.Th,this.Fh),i=Math.max(this.Th,this.Fh),s=this.gm,r=f(s.x.et(),s.y.et(),s.z.et());let n,o;this.wm()?(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.Mh.Cm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Mh.xd,a=this.At._m(n)||u(0,0),l=this.At._m(o)||u(0,0),c=Xe(n,o,.5),d=Fe.addVec(c,Fe.multiplyVec(Fe.multiply(h,-1),r)),g=this.At._m(c)||u(0,0),y=this.At._m(d)||u(0,0),p=ti(ni(ut(g,this.chart.engine.scale,this.Am),ut(y,this.chart.engine.scale,this.Am)));this.pm.Nt()._l([n,o]);const{gridlinePositionA:m,gridlinePositionB:A,gridlinePositionC:x}=this.Mh.km(t),S=t=>({x:-1===t.x?this.gm.x.getInnerStart():1===t.x?this.gm.x.getInnerEnd():0,y:-1===t.y?this.gm.y.getInnerStart():1===t.y?this.gm.y.getInnerEnd():0,z:-1===t.z?this.gm.z.getInnerStart():1===t.z?this.gm.z.getInnerEnd():0}),b=S(m),v=S(A),M=S(x),T={physicalAxisSize:ii(ni(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:p,gridlinePositionA:b,gridlinePositionB:v,gridlinePositionC:M},w=this.Jh(T),E=this.vm.Xp();for(const[t,e]of this.Ze)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.Tm(T,e);E.add({ia:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.nr.tickStyle}),s.gridStroke&&E.add({ia:0,positions:s.gridStroke},{lineStyle:t.nr.gridStrokeStyle})}const k=this.Sm.Xp(),C={x:0,y:0};this.Td.forEach((t=>{if(!t.Xi||t.Si)return;const s=this.Mm(T,t.S,t.sm,t.rm),r=this.Tm(T,s),n=k.add().Ie(s.labelPosition).Ja(s.labelAlignment).ke(t.Rg).Vh(t.nm).Bh(t.gc(t.S)).zh(t.qc).Ds().oi();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),E.add({ia:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.im}),r.gridStroke&&E.add({ia:0,positions:r.gridStroke},{lineStyle:t.hm})})),k.finishPlot(),E.finishPlot();const D=this.dr(((t,e)=>{const i=e.Ye.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.Dh.Ja({x:0,y:0}).zh(180*-F/Math.PI);const I=Fe.addVec(c,Fe.multiplyVec(Fe.multiply(h,this.At.bm(.5*this.pm.ku().getThickness()+this.gr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),L=this.At._m(I)||u(0,0),z=ri(ut(L,this.chart.engine.scale,this.Am),ri(ri(oi(D,p),si(p,this.gr(((t,e)=>Math.max(t,e.labelPadding)),0))),oi(si(this.Dh.Ds().oi(),.5),p)));this.Dh.Ie(z),this.pm.Fm={overrideFollowing:!1,skipMousePicking:!1}}Tm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Et(h,0)||Et(h,1)||(a=[this.Im()?{...i,x:n.x}:this.Pm()?{...i,y:n.y}:this.wm()?{...i,z:n.z}:{x:0,y:0,z:0},this.Im()?{...s,x:n.x}:this.Pm()?{...s,y:n.y}:this.wm()?{...s,z:n.z}:{x:0,y:0,z:0},this.Im()?{...r,x:n.x}:this.Pm()?{...r,y:n.y}:this.wm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Gh(){super.Gh(),this.vm.Zp(),this.Sm.Zp()}Im(){return this.Mh.Im()}Pm(){return this.Mh.Pm()}wm(){return this.Mh.wm()}}class Oa extends Js{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Md=r}}const Ba=(t,e,i)=>kt(t+.1*(e-t)+Math.abs(i.et())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),_a=(t,e,i,s)=>({pr:()=>{const i=t();let s;for(const t of i){if(!t.Dm())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},mr:()=>{const e=t();let s;for(const t of e){if(!t.Dm())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Sr:()=>{const e=t();let i;for(const t of e){if(!t.Dm())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Na=t=>({..._a(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y)),om:t=>t.y,Cm:(t,e)=>({x:e.x,y:t.y,z:e.z}),xd: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)}},Im:()=>!1,Pm:()=>!0,wm:()=>!1}),Ua=t=>({..._a(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Sr().z)),om:t=>t.z,Cm:(t,e)=>({x:e.x,y:e.y,z:t.z}),xd: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)}},Im:()=>!1,Pm:()=>!1,wm:()=>!0});class Ga extends Ui{constructor(t,e,i,s,r){super(t,e,s,r),this.Bm=Gn,this.Lm=!0,this.Rm=!0,this.Ji=t,this.At=i,this.ts=new Map,this.onMouseWheel(this.Ji.Em),this.onMouseDrag(this.Ji.Vm),this.onTouchStart(this.Ji.zm.onTouchStart),this.onTouchMove(this.Ji.zm.onTouchMove),this.onTouchEnd(this.Ji.zm.onTouchEnd)}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}setColorShadingStyle(t){return this.Bm=t,this.ts.forEach(((e,i)=>i.Om(t))),this.At.bs(),this}getColorShadingStyle(){return this.Bm}setDepthTestEnabled(t){return this.Rm=t,this.ts.forEach(((e,i)=>i.Nm(t))),this.At.bs(),this}getDepthTestEnabled(){return this.Rm}Gm(){}Fe(){}$p(){}getXMax(){const t=this.el;return t?t.xt():void 0}getXMin(){const t=this.el;return t?t.vt():void 0}getYMax(){const t=this.el;return t?t.Mt():void 0}getYMin(){const t=this.el;return t?t.bt():void 0}getZMax(){const t=this.el;return t?t.Wm():void 0}getZMin(){const t=this.el;return t?t.Um():void 0}Sr(){const t=this.el;return t?f(t.Vl(),t.zl(),t.Ym()):f(0,0,0)}}class Wa extends Ga{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Box Series 3D",this.Hm=.25,this.$m=!1,this.ld=()=>ae(this.be),this.be=ce(this.qi.boxSeries3DFillStyle,r),this.el=this.At.jm().Nm(this.Rm).ke(this.be).Xm(this.Hm).cs(this.getHighlight()),this.gs(this.el)}invalidateData(t){const e=t.length;if(0===e)return this;this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const i=t[0];if(!i)return this;let s;if("xMin"in i||"yMin"in i||"zMin"in i||"xMax"in i||"yMax"in i||"zMax"in i){s=[];for(let i=0;iae(this.Cu.getFillStyle())}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this.el.Ee(e),this.At.bs(),this}getStrokeStyle(){return this.Cu}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{stroke:this.Cu}),this}}class Ha extends Ya{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Line Series 3D",this.Cu=ce(s.lineSeries3DStrokeStyle,r),this.Qm=Mr.pointStyle3D,this.Jm(this.Cu),this.el=this.At.zp([ka.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setStrokeStyle(t){super.setStrokeStyle(t),this.Jm(this.Cu);const e=this.Qm;return this.el.ym(e),this}Jm(t){const e=new dr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Qm=e}}class Xa extends Ya{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Point Line Series 3D",this.ld=()=>ae(this.Cu.getFillStyle())||ae(this.Qm.getFillStyle()),this.Qm=ce(s.pointLineSeries3DPointStyle,r),this.Cu=ce(s.lineSeries3DStrokeStyle,r),this.Km(),this.el=this.At.zp([ka.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){return this.Qm="function"==typeof t?t(this.Qm):t,this.Km(),this.el.ym(this.Qm),this.At.bs(),this}getPointStyle(){return this.Qm}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.Cu,i=Math.abs(e.getThickness()),s=this.Qm;i>s.getSize()&&(this.Qm=s.setSize(i)),this.Km();const r=this.Qm;return this.el.ym(r),this.At.bs(),this}Km(){const t=this.Qm,e=t.getSize();this.Qm=t.setSize(e)}Pe(t,e){t.cs(e),this.At.bs()}}class $a extends Ga{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.$m=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.ds((t=>t.Vn||t.zn||t.ro?void 0:"bubble chart"))}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{point3D:this.qm}),this}}class ja extends $a{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Series 3D",this.ld=()=>ae(this.qm.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ji.getSeries().length;this.qm=ce(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.el=this.At.Oc(h).Nm(this.Rm).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}class qa extends $a{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Cloud Series 3D",this.ld=()=>ae(this.qm.getFillStyle());const o=this.Ji.getSeries().length;this.qm=ce(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.el=this.At.Oc(h).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}const Ja={Triangulated:ja,Pixelated:qa};class Za extends Gh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.iy=[],this.sy=0,this.ey=t=>{const e=this.iy.indexOf(t);e>=0&&(this.iy.splice(e,1),this.D.emit("seriesDispose",this,t))},this.hy=()=>{this.sy+=1},this.ny=()=>{this.sy-=1},this.onSeriesBackgroundMouseEnter=t=>this.D.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.D.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.D.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.D.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.D.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.D.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.D.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.D.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.D.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.D.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.D.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.D.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.D.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.D.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.D.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.D.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.D.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.D.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.D.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.D.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.D.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.D.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.D.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.D.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.D.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.D.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.D.off(t,"touchEndSeriesBackground"),this.oy=this.es.gA()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.iy.forEach((e=>e.setAnimationHighlight(t))),this}ly(t,e){this.oy.ps([e]),t.setMouseMoveEventHandler(((t,e)=>{this.D.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.D.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.D.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.D.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.D.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.D.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.D.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.uy.ke(t),this.us.bs(),this}getSeriesBackgroundFillStyle(){return this.uy.Lh()}setSeriesBackgroundStrokeStyle(t){return this.Ay.Ce(t),this.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Ay._o()}setSeriesBackgroundEffect(t){return this.oy.xs(t),this.us.bs(),this}getSeriesBackgroundEffect(){return this.oy.Ms()}gy(t){this.iy.push(t),t.onMouseEnter(this.hy),t.onMouseLeave(this.ny),void 0!==this.py&&t.setHighlightOnHover(this.py),this.D.emit("seriesAdded",this,t)}Sd(){return this.iy}my(){return this.sy}setSeriesHighlightOnHover(t){return this.py=t,this.iy.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.iy.slice().forEach(Tt),super.dispose()}yy(t){return this.D.on("seriesAdded",t)}Sy(t){return this.D.off(t)}vy(t){return this.D.on("seriesDispose",t)}xy(t){return this.D.off(t)}}const Ka=Fe.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class Qa{constructor(t,e,i,s){this.by=!0,this.My=!0,this._y=2*-Math.PI/2160,this.wy=2*Math.PI/2160,this.Cy=.1,this.ky=1*Math.PI/180,this.Ty=t,this.Fy=e,this.Iy=i,this._m=s}getDefaultCameraConfiguration(t){const e={direction:Ka,location:Fe.multiply(Ka,-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.Py(i,t):"wheel-zoom"===t.type?i=this.Dy(i,t):"rotate+zoom"===t.type?i=this.By(i,t):"fixed-rotate"===t.type?i=this.Ly(i,t):"move"===t.type&&(i=this.Ry(i,t))})),this.by?i=this.Ey(t.boundingBox,i):this.My&&(i=this.Vy(t.boundingBox,i)),i}Py(t,e){const{rotation:i}=e,s=t.location,r=Fe.multiply(Fe.normalize(t.location),-1),{Right:n,Up:o}=this.zy(r);let h=s;const a=this.Oy(r),l=i.x*this._y*a;h=Fe.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.wy,a-this.ky);return 0!==u&&(h=Fe.rotateAroundAxis(h,n,u)),{location:h,direction:Fe.multiply(Fe.normalize(h),-1)}}Dy(t,e){const{deltaY:i}=e;this.by&&this.Ny(!1);const s=t.location,r=Fe.multiply(Fe.normalize(s),-1),n=i*this.Cy,o=Fe.length(s)*-n;return{direction:r,location:Fe.addVec(s,Fe.multiply(r,o))}}By(t,e){const{rotation:i,cameraDistance:s}=e;this.by&&this.Ny(!1);let r=this.Py(t,{type:"rotate",rotation:i});const n=r.location,o=Fe.multiply(Fe.normalize(n),-1),h=Fe.multiply(o,-s);return r={direction:Fe.multiply(Fe.normalize(h),-1),location:h},r}Ly(t,e){this.by&&this.Ny(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.zy(r),h=i.x*this._y;let a=Fe.normalize(Fe.rotateAroundAxis(r,o,h));const l=i.y*this.wy;return a=Fe.normalize(Fe.rotateAroundAxis(a,n,l)),{location:s,direction:a}}Ry(t,e){this.by&&this.Ny(!1),this.My=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.zy(n);return{location:Fe.addVec(r,Fe.multiply(n,.01*s),Fe.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Fe.multiply(Fe.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Fe.multiply(Fe.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Fe.multiply(Fe.normalize(t.cameraLocation),-1)};if(this.by)return this.Ey(t.boundingBox,e)}Ey(t,e,i){let s=e;i=void 0!==i?i:0,s=this.Gy(t,s,100,20,1,i,5);const r=this.Oy(s.direction);return s=this.Wy(s,this.Uy(t,s,100,1),r),s}Gy(t,e,i,s,r,n,o){return tl(n,o,(t=>({direction:e.direction,location:Fe.multiply(e.direction,-t)})),(e=>this.Yy(t,e)),i,r,"linear",s)}Uy(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.zy(e.direction),a=this.Hy(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:Fe.normalize(Fe.lerp(l.direction,h,t))})),(e=>this.$y(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Fe.normalize(Fe.lerp(l.direction,o,t))})),(e=>this.$y(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Fe.normalize(Fe.lerp(l.direction,n,t))})),(e=>this.Xy(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Fe.normalize(Fe.lerp(l.direction,r,t))})),(e=>this.Xy(t,e)),0,u,!0,i)),l}Yy(t,e){const i=this.Hy(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}Xy(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.left-i.right)}$y(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.top-i.bottom)}Hy(t,e,i){const s=$e(this.jy(t,e,i).map((t=>ut(t,this.Ty,this.Fy))));return{left:s.min.x,right:this.Fy.x.getInnerEnd()-s.max.x,top:this.Fy.y.getInnerEnd()-s.max.y,bottom:s.min.y}}jy(t,e,i){const s=this.Iy,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._m(t,i))).filter((t=>void 0!==t))}Vy(t,e){const i=Fe.length(e.location),s=this.Zy(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)ae(this.be),this.Bm=Nn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.En=h,this.el=this.At.tS(h).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,z:(this.Jy.end.z-t.z)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.el.eS().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.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;et.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;eae(this.be),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.Bm=Nn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceScrollingGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.En=h,this.el=this.At.cS(h).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}clear(){return this.el.Nt(),this.At.bs(),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.En.scrollDimension?this.En.rows:this.En.columns;if(i>s-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.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.el.dS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.At.bs(),this}setCullMode(t){return this.el.lS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.el.uS()}Gm(){}Fe(){}$p(){}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}}const rl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof al),nl=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),ol={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)=>ol.multiply(t,ol.translation(e,i,s)),xRotate:(t,e)=>ol.multiply(t,ol.xRotation(e)),yRotate:(t,e)=>ol.multiply(t,ol.yRotation(e)),zRotate:(t,e)=>ol.multiply(t,ol.zRotation(e)),rotateXYZ(t,e){let i=ol.xRotate(t,e.x);return i=ol.yRotate(i,e.y),i=ol.zRotate(i,e.z),i},scale:(t,e,i,s)=>ol.multiply(t,ol.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],p=e[14],m=e[15],A=t[0],x=t[1],S=t[2],b=t[3],v=t[4],M=t[5],T=t[6],w=t[7],E=t[8],k=t[9],C=t[10],D=t[11],F=t[12],I=t[13],L=t[14],z=t[15],P=[];return P[0]=i*A+s*v+r*E+n*F,P[1]=i*x+s*M+r*k+n*I,P[2]=i*S+s*T+r*C+n*L,P[3]=i*b+s*w+r*D+n*z,P[4]=o*A+h*v+a*E+l*F,P[5]=o*x+h*M+a*k+l*I,P[6]=o*S+h*T+a*C+l*L,P[7]=o*b+h*w+a*D+l*z,P[8]=u*A+c*v+d*E+f*F,P[9]=u*x+c*M+d*k+f*I,P[10]=u*S+c*T+d*C+f*L,P[11]=u*b+c*w+d*D+f*z,P[12]=g*A+y*v+p*E+m*F,P[13]=g*x+y*M+p*k+m*I,P[14]=g*S+y*T+p*C+m*L,P[15]=g*b+y*w+p*D+m*z,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],p=t[14],m=t[15],A=d*m,x=p*f,S=a*m,b=p*l,v=a*f,M=d*l,T=r*m,w=p*n,E=r*f,k=d*n,C=r*l,D=a*n,F=u*y,I=g*c,L=o*y,z=g*h,P=o*c,V=u*h,R=i*y,O=g*s,B=i*c,_=u*s,N=i*h,U=o*s,G=A*h+b*c+v*y-(x*h+S*c+M*y),W=x*s+T*c+k*y-(A*s+w*c+E*y),Y=S*s+w*h+C*y-(b*s+T*h+D*y),H=M*s+E*h+D*c-(v*s+k*h+C*c),X=1/(i*G+o*W+u*Y+g*H);return e[0]=X*G,e[1]=X*W,e[2]=X*Y,e[3]=X*H,e[4]=X*(x*o+S*u+M*g-(A*o+b*u+v*g)),e[5]=X*(A*i+w*u+E*g-(x*i+T*u+k*g)),e[6]=X*(b*i+T*o+D*g-(S*i+w*o+C*g)),e[7]=X*(v*i+k*o+C*u-(M*i+E*o+D*u)),e[8]=X*(F*l+z*f+P*m-(I*l+L*f+V*m)),e[9]=X*(I*n+R*f+_*m-(F*n+O*f+B*m)),e[10]=X*(L*n+O*l+N*m-(z*n+R*l+U*m)),e[11]=X*(V*n+B*l+U*f-(P*n+_*l+N*f)),e[12]=X*(L*d+V*p+I*a-(P*p+F*a+z*d)),e[13]=X*(B*p+F*r+O*d-(R*d+_*p+I*r)),e[14]=X*(R*a+U*p+z*r-(N*p+L*r+O*a)),e[15]=X*(N*d+P*r+_*a-(B*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]};class hl extends Ga{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Mesh Model 3D",this.fS=new Float32Array,this.dt={x:1,y:1,z:1},this.AS={x:0,y:0,z:0},this.gS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:0,y:0,z:0},this.ol=Pe,this.ld=()=>ae(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ji.getSeries().length;this.el=this.At.yS().Nm(this.Rm).ke(ce(this.qi.meshModel3DFillStyle||this.qi.pointSeriesFillStyle,o)).cs(this.getHighlight()),this.gs(this.el)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=Le,n=Ie,o=Le,h=Ie,a=Le,l=Ie;for(let t=0;t{const t=this.At.RS();this.VS.ES(t),this.zS.ES(t);const e=this.OS.viewportChanged(this.NS());e&&this.GS(e),this.us.bs()},this.Vm=(t,e,i,s,r)=>{if(this.BS){const t=r;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),$t(e)}},this.Em=(t,e)=>{if(this.DS){if(this.PS)Math.sign(this.LS)!==Math.sign(e.deltaY)?this.LS=de(e):this.LS+=de(e);else{const t=de(e);this.FS.push({type:"wheel-zoom",deltaY:t})}this.us.bs(),$t(e)}},this.fs.zn||this.fs.Vn||this.fs.Zn||this.us.As(1),this.ng.Bh("Chart3D"),this.WS=i.d3(),this.WS.x.J(-1,1),this.WS.y.J(-1,1),this.WS.z.J(-1,1),this.At=e.US("chart3D layer3D",0,this.WS),this.VS=e.YS("chart3D series bg",0),this.zS=e.wp("chart3D axis ui",1),this.HS={x:new Ra(this,(h=()=>this.iy,{..._a(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x)),om:t=>t.x,Cm:(t,e)=>({x:t.x,y:e.y,z:e.z}),xd: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)}},Im:()=>!0,Pm:()=>!1,wm:()=>!1}),this.WS.x,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),y:new Ra(this,Na((()=>this.iy)),this.WS.y,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),z:new Ra(this,Ua((()=>this.iy)),this.WS.z,this.qi,this.At,this.zS,this.pixelScale,!1,this.es)},this.$S=this.At.zp([ka.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.qi.chart3DBoundingBoxStrokeStyle),this.uy=this.VS.vc(this.engine.scale,nn.Simple).ke(this.qi.chart3DSeriesBackgroundFillStyle).Ce(rt).setMouseInteractions(!0),this.Ay=this.VS.vc(this.engine.scale,nn.Simple).ke(O).Ce(this.qi.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.XS({x:1,y:1,z:1},!0),this.OS=new Qa(this.engine.scale,this.pixelScale,this.WS,((t,e)=>(e&&this.GS(e),this.At._m(t)))),this.jS=this.OS.getDefaultCameraConfiguration(this.ZS(this.QS)),this.GS(this.jS),this.zm=Yi(new $i(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.At.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.BS&&!this.DS)return;const o=(a.locationOne.x-a.locationTwo.x)**2+(a.locationOne.y-a.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,l=Fe.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.FS.push({type:"rotate+zoom",rotation:this.BS?d:{x:0,y:0},cameraDistance:this.DS?c:l}),this.us.bs(),$t(n)}),(t=>{})),new Xi((t=>{}),((t,e,i,s,r)=>{if(this.BS){const t=s;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),$t(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.zm.onTouchStart),this.onBackgroundTouchMove(this.zm.onTouchMove),this.onBackgroundTouchEnd(this.zm.onTouchEnd),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.onBackgroundMouseDrag(this.Vm),this.onBackgroundMouseWheel(this.Em),this.onBackgroundMouseDown(((t,e)=>{$t(e)})),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDown(((t,e)=>{$t(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.nn),this.nn(),this.ig(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||ja)(this,this.ey,this.At,this.qi,this.us.es,t);return this.gy(e),e}addLineSeries(t){const e=new Ha(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Xa(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addSurfaceGridSeries(t){const e=new il(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addSurfaceScrollingGridSeries(t){const e=new sl(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addBoxSeries(t){const e=new Wa(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addMeshModel(t){const e=new hl(this,this.ey,this.At,this.qi,t,this.us.es);return this.gy(e),e}translateCoordinate(t,e,i){if(rl(e)||rl(i)||nl(t)){if(rl(e)&&rl(i)&&nl(t)){if("axes"===e.id&&"world"===i.id)return this.At.ft(t);if("world"===e.id&&"axes"===i.id)return this.At.yt(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return Oh(t,e,i,this.pixelScale,this.us)}getDefaultAxisX(){return this.HS.x}getDefaultAxisY(){return this.HS.y}getDefaultAxisZ(){return this.HS.z}getDefaultAxes(){return[this.HS.x,this.HS.y,this.HS.z]}setCameraLocation(t){let e={location:t,direction:Fe.normalize(Fe.multiply(t,-1))};const i=this.OS.cameraLocationChanged(this.NS(e));return i&&(e=i),this.GS(e),this.us.bs(),this}getCameraLocation(){return this.At.getCameraLocation()}getCameraDirection(){return this.At.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.OS.Ny(t);const e=this.OS.cameraLocationChanged(this.NS());return e&&this.GS(e),this}getCameraAutomaticFittingEnabled(){return this.OS.Qy()}onCameraChange(t){return this.D.on("cameraChange",t)}offCameraChange(t){return this.D.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.$S.Ee(t).ym(La(this.$S.ku())),this.At.bs(),this}getBoundingBoxStrokeStyle(){return this.$S.ku()}setBoundingBox(t){return this.XS(t,!1),this}XS(t,e){this.QS=t;const i=this.ZS(t);if(this.WS.x.q(i.x),this.WS.y.q(i.y),this.WS.z.q(-i.z),!e){const t=this.OS.boundingBoxChanged(this.NS());t&&this.GS(t)}this.us.bs()}getBoundingBox(){return this.QS}Fe(t){if(Wh.cg(this.ng,this.eg),0!==this.LS){const e=this.LS*t*.006;this.FS.push({type:"wheel-zoom",deltaY:e}),this.LS=Math.sign(this.LS)*Math.max(Math.abs(this.LS)-.01*t,0),0!==this.LS&&this.us.bs(!0)}const e=this.getCameraDirection();if(this.FS.length>0){const t=this.OS.applyCameraInteractions(this.NS(),this.FS);t&&this.GS(t),this.FS.length=0}this.JS&&Fe.equals(this.JS.location,this.jS.location)&&Fe.equals(this.JS.direction,this.jS.direction)||this.D.emit("cameraChange",this,this.getCameraLocation()),this.JS=this.jS,super.Fe(t);for(let t=0;tthis.At._m(t))),o=this.At._m(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=ie(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.tn.length=0,this.WS.W(),this.At.W(),this.zS.W(),this.VS.W(),super.dispose()}j(){return this.WS.x.j(),this.WS.y.j(),this.WS.z.j(),super.j()}Z(){return super.Z()}GS(t){this.At.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Fe.addVec(t.location,Fe.multiply(t.direction,-this.IS))),this.jS=t,this.us.bs()}ZS(t){return Fe.divide(t,Fe.length(t)/this.TS)}NS(t=this.jS){return{boundingBox:this.ZS(this.QS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.DS=t,this}getMouseInteractionZoom(){return this.DS}setMouseInteractionRotate(t){return this.BS=t,this}getMouseInteractionRotate(){return this.BS}forEachAxis(t){return t(this.HS.x),t(this.HS.y),t(this.HS.z),this}getSeries(){return this.iy}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.PS=!!t,this}getAnimationZoom(){return this.PS}}const ll={Column:Ao,Row:xo};class ul extends Nh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.KS=new Map,this.qS=this.addUIElement(ll.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(O).setStrokeStyle(rt)))}add(t,e){return(t instanceof Gh?[t]:t instanceof Cf?t.getCells().filter((t=>t.panel instanceof Gh)).map((t=>t.panel)):[]).forEach((t=>{const i=this.qS.addElement($o.VerticalLegendBox).setBackground((t=>t.setFillStyle(O).setStrokeStyle(rt))).add(t,e).setTitle(t.getTitle());this.KS.set(t,i)})),this.us.bs(),this}setLegendBoxes(t){return this.KS.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.qS.getSize()}}const cl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},dl=(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=gl(t,e,i),i=yl(t,e,i),i},gl=(t,e,i)=>{if(t===cl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===cl.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=$e(Ct(i)),h=[];for(let e=0;ethis.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.D.on("mapDataReady",t);return this.av&&St.setTimeout((()=>t())),e},this.onViewChange=t=>this.D.on("viewChange",t),this.lv=(t,e,i,s,r)=>{this.dt.x.q(s).si([this.Xt.left+this.Da.left,this.Xt.right+this.Da.right]),this.dt.y.q(r).si([this.Xt.bottom+this.Da.bottom,this.Xt.top+this.Da.top+Wh.ug(this.ng,this.eg)]),this.uv&&this.cv(this.dv,this.dt,this.uv)},this.wt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:r,region:n}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(n,r),$t(t)),this.nv&&this.us.ls.ws(n,!0),this.gv=n,this.D.emit("mouseEnter",this,t)},this.Ct=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.pv(r,s),this.nv&&this.us.ls.ws(r,!1),this.gv=void 0,this.D.emit("mouseLeave",this,t),t&&$t(t)},this.Pt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:r,region:n}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(n,r),$t(t)),this.gv=n,this.D.emit("mouseMove",this,t)},this.kt=(t,e)=>this.D.emit("mouseClick",this,t),this.Tt=(t,e)=>this.D.emit("mouseDoubleClick",this,t),this.Ft=(t,e)=>this.D.emit("mouseDown",this,t),this.It=(t,e)=>this.D.emit("mouseUp",this,t),this.Bt=(t,e,i)=>{this.D.emit("mouseDragStart",this,t,e)},this.Dt=(t,e,i,s,r)=>{this.D.emit("mouseDrag",this,t,e,i,s)},this.Lt=(t,e,i,s)=>{this.D.emit("mouseDragStop",this,t,e,i)},this.Rt=(t,e)=>{this.D.emit("mouseWheel",this,t)},this.Et=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(r,s),this.nv&&this.us.ls.ws(r,!0),this.gv=r,this.D.emit("touchStart",this,t),$t(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(r,s),this.gv=r,this.D.emit("touchMove",this,t),$t(t)},this.zt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.mv=void 0,this.pv(r,s),this.nv&&this.us.ls.ws(r,!1),this.gv=void 0,this.D.emit("touchEnd",this,t),$t(t)},this.fs.zn||this.fs.Vn||this.fs.Jn||this.us.As(3),this.th=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.yv=i.wp("mapChart plotting",0),this.onResize(this.lv),this.ng.Bh("Map Chart");const a=Dt(o?o.autoCursorBuilder:void 0,fa);this.Sv=a.Xg(i.Tp(),this.dt,this.dt,this.qi).setVisible(!1),this.vv=this.es.gA(),this.ig(n,this.uiScale),this.xv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this.wt(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseUpEventHandler(((t,e,i)=>this.It(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Bt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Dt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Lt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Et(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).ke(this.qi.mapChartFillStyle).Ce(this.qi.mapChartStrokeStyle),this.Mv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).ke(this.qi.mapChartOutlierRegionFillStyle).Ce(this.qi.mapChartOutlierRegionStrokeStyle);const l=Dt(o&&o.type,cl.World);this.dv=l,this._v(l).then((()=>{this.D.emit("mapDataReady")}))}getRegionUnderMouse(){return this.gv}setFillStyle(t){return this.xv.ke(t),this.us.bs(),this}getFillStyle(){return this.xv.Lh()}setStrokeStyle(t){return this.xv.Ce(t),this.us.bs(),this}getStrokeStyle(){return this.xv._o()}setEffect(t){return this.vv.xs(t),this.us.bs(),this}getEffect(){return this.vv.Ms()}setOutlierRegionFillStyle(t){return this.Mv.ke(t),this.us.bs(),this}getOutlierRegionFillStyle(){return this.Mv.Lh()}setOutlierRegionStrokeStyle(t){return this.Mv.Ce(t),this.us.bs(),this}getOutlierRegionStrokeStyle(){return this.Mv._o()}setSeparateRegionFillStyle(t){return this.sv="function"==typeof t?t(this.sv):t,this.tv.forEach((t=>t.ke(this.sv))),this.us.bs(),this}getSeparateRegionFillStyle(){return this.sv}setSeparateRegionStrokeStyle(t){return this.ev="function"==typeof t?t(this.ev):t,this.tv.forEach((t=>t.Ce(this.ev))),this.us.bs(),this}getSeparateRegionStrokeStyle(){return this.ev}invalidateRegionValues(t){if(!this.av||!this.wv)return this.Cv=this.Cv||[],this.Cv.push(t),this;if("function"==typeof t)for(let e=0;e{t.kv(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.kv(e.value)}))}}return this.us.bs(),this}setAutoCursor(t){return this.Sv&&t(this.Sv),this.us.bs(),this}getAutoCursor(){return this.Sv}setAutoCursorMode(t){return this.hv=t,this.us.bs(),this}getAutoCursorMode(){return this.hv}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}getCursorResultTableFormatter(){return this.xp}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}setMouseInteractions(t){return this.Yi=t,this.xv.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=Ae(t),this.rv=t,null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.ws(e,t)})),this.D.emit("highlight",this,t),this}getHighlight(){return this.rv}setAnimationHighlight(t){var e;return null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.us.ls.ks(null===(t=this.av)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.nv=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.nv}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}offMapDataReady(t){return this.D.off(t,"mapDataReady")}offViewChange(t){return this.D.off(t,"viewChange")}async _v(t){const e=await((t,e)=>{let i;if(t===cl.World)i="countries_world.json";else if(t===cl.NorthAmerica)i="countries_northAmerica.json";else if(t===cl.SouthAmerica)i="countries_southAmerica.json";else if(t===cl.Africa)i="countries_africa.json";else if(t===cl.Europe)i="countries_europe.json";else if(t===cl.Asia)i="countries_asia.json";else if(t===cl.USA)i="states_usa.json";else if(t===cl.Canada)i="territoriesProvinces_canada.json";else{if(t!==cl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw St.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return St.fetch(s).then((t=>t.json())).catch((t=>{Te(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.fs.Xs);this.wv=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.Mv.Lr().Rl(e);if(t===cl.USA){const t=25.8,e=29.7;this.tv.push(this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-126,y:t}).q({x:10,y:e-t}),this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.us.ls.Br(this.xv,{animationEnabled:this.th});for(let i=0;i{o.forEach((e=>e.cs(t)))}))}if(this.vv.ps([this.xv]),this.uv=i,this.cv(t,this.dt,i),this.av=e,this.Cv){for(const t of this.Cv)this.invalidateRegionValues(t);this.Cv=void 0}this.us.bs()}cv(t,e,i){const s=ml[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.J(o.min.x,o.max.x),e.y.J(o.min.y,o.max.y);const h=this.dt.x.li(),a=this.dt.y.li();this.D.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]}})}Av(t,e){this.Tv={region:t,iRegion:e},this.us.bs()}pv(t,e){this.Tv&&t===this.Tv.region&&(this.Tv=void 0,this.us.bs())}fv(t,e){const i=Array.from(this.ov.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.th=!t,this}getAnimationsEnabled(){return this.th}getMinimumSize(){}Sd(){return[this]}Fe(t){super.Fe(t),super.tg(),Wh.cg(this.ng,this.eg);const e=p(this.dt.x.ei(),this.dt.y.ei(),this.dt.x.ri(),this.dt.y.ri());this.yv.ES(e);const i=this.us.Bn()||this.mv;if(this.Tv&&i){const t=this.wv&&this.wv[this.Tv.iRegion];let e=ut(i,this.engine.scale,this.dt);e={x:kt(e.x,this.dt.x.getInnerStart(),this.dt.x.getInnerEnd()),y:kt(e.y,this.dt.y.getInnerStart(),this.dt.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.Tv.region.transform;this.Tv.region.outlier&&n&&(s=(s-n.translate.x-n.vertexBoundaries.min.x)/n.scale.x+n.vertexBoundaries.min.x,r=(r-n.translate.y-n.vertexBoundaries.min.y)/n.scale.y+n.vertexBoundaries.min.y),this.Sv.setPosition(e).setVisible(!0).getResultTable().setContent(this.xp(new Kh,this.Tv.region,t,s,r,this).fc())}else this.Sv.setVisible(!1);return this.Sv.Ds().Fe(),this}dispose(){return this.yv.W(),this.Sv.dispose(),_h(this.dt),super.dispose()}j(){return super.j(),this.dt.j(),this}Z(){return super.Z(),this.dt.Z(),this}ld(){return ae(this.getFillStyle())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.onMouseEnter((()=>{this.setHighlight(!0)})),t.onMouseLeave((()=>{this.setHighlight(!1)})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),he(t,this.qi,i,{fill:this.getFillStyle()}),this}}const xl=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(Sl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Sl=(t,e)=>{const i=t>0,s=e>0;return`${[ue(Math.abs(0|t),2),"° ",ue(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ue(Math.abs(0|e),2),"° ",ue(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class bl extends qs{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.Fv(i),s,r,{numeric:e.Iv({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Iv({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Iv({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Pv=n,this.Dv=o,this.Bv=h,this.es=a,this.Lv=i,this.Rv=e.Iv({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Dh=h.kr(i).setMouseInteractions(!1).Vh(e.Iv({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.Iv({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Nh=this.es.gA([this.Dh]).xs(s.effectsText)}setTickStrategy(t,e){return super.kh(t,e)}setStrokeStyle(t){return this.Rv="function"==typeof t?t(this.Rv):t,this.Dv.bs(),this}getStrokeStyle(){return this.Rv}ar(t,e){return new vl(e,t,this.Lv,this.Bv,this.Bv,this.Ev(this.Pv,this.Lv),this.Bv.Ve(this.Lv).setMouseInteractions(!1))}lr(t,e){const i=this.Vv(this.Lv,t);this.zv&&!1===this.zv(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(ri(this.Ov(this.Lv,t.S),i.padding)).Ja(i.alignment).zh(i.rotation).Ha(i.offset.x,i.offset.y),this.Nv(this.Lv,t.Gv,t.Wv,t)}setMouseInteractions(t){return this}Fe(){this.Jh({physicalAxisSize:0});const t=this.dr(((t,e)=>{const i=e.Sh.nr,s=.5*this.Rv.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().oi().y/this.Lv.Wi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Uv(this.Lv,this.Rv,t),this.Yv(this.Lv,this.Dh,t),t}}class vl extends Ko{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.Gv=n,this.Wv=o,n.setMouseInteractions(!1),this.ts.push(n,o)}}class Ml extends bl{constructor(t,e,i,s,r,n,o,h,a){super(t,Tl((()=>this.vA())),e,i,s,r,n,o,h),this.pm=this.Dv.Ve(this.Lv).setMouseInteractions(!1),this.Hv=a,this.setScrollStrategy(Rs.expansion),this.setTickStrategy(Os.Numeric),this.setTitle("Amplitude")}vA(){return this.Hv()}br(t,e){return Jo(t,e,this.Lv.y)}_r(t,e,i){const s=2*(e-t),r=this.Lv.x.Li(s);return{min:t-i*r,max:e+i*r}}Ov(t,e){return{x:t.$v()?e-t.Xv().start:t.Xv().start-e,y:0}}Ev(t,e){return t.Fc(e)}Nv(t,e,i,s){const r=s.Sh.nr,n=t.$v()?s.S-t.Xv().start:t.Xv().start-s.S;Et(s.S,t.Xv().start)||Et(s.S,t.Xv().end)?e.setVisible(!1):e.setVisible(!0).vu(0).ze(360).wu(void 0)._u(0).xu(n).wu(60).ke(O).Ce(r.gridStrokeStyle);const o=.5*this.Rv.getThickness();i.Oe({x:n,y:-o*t.Wi().y}).ze({x:n,y:-(o+r.tickLength)*t.Wi().y}).Ee(r.tickStyle)}Vv(t,e){const i=e.Sh.nr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Rv.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.Oe({x:0,y:0}).ze({x:s,y:0}).Ee(e)}Yv(t,e,i){const s=t.$v()?(t.Xv().start+t.Xv().end)/2-t.Xv().start:t.Xv().start-(t.Xv().start+t.Xv().end)/2;e.Ja({x:0,y:1}).Ie({x:s,y:-i*t.Wi().y})}}const Tl=t=>({..._a(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),Fv:t=>({getInnerStart:()=>t.Xv().start,getInnerEnd:()=>t.Xv().end,J:(e,i)=>t.jv(e,i),nt:(e,i,s,r,n)=>t.y.nt(e,i,s,r,n)}),Iv:t=>t.amplitude});class wl extends bl{constructor(t,e,i,s,r,n,o,h){super(t,kl,e,i,s,r,n,o,h),this.Zv=90,this.Qv=12,this.Jv=El,this.pm=this.Dv.Fc(this.Lv).setMouseInteractions(!1),this.zv=t=>{let e=180*(t.S-this.Lv.Kv())/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.Je=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Zv)}setTickStyle(t){return this.qv="function"==typeof t?t(this.qv):t,this.tx(),this.Dv.bs(),this}getTickStyle(){return this.qv}setTickFormattingFunction(t){return this.Jv=t,this.tx(),this.Dv.bs(),this}getTickFormattingFunction(){return this.Jv}setClockwise(t){this.Lv.ix(t);const e=this.Zv*Math.PI/180;return t?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getClockwise(){return!this.Lv.hx()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Zv=t;const e=t*Math.PI/180;return this.getClockwise()?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getNorth(){return 180*this.Lv.Kv()/Math.PI}setDivision(t){return this.Qv=t,this.tx(),this.Dv.bs(),this}getDivision(){return this.Qv}vA(){return[]}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}Ov(t,e){const i=t.hx()?1:-1,s=t.Kv(),r=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}Ev(t,e){return t.Ve(e)}Nv(t,e,i,s){const r=this.qv,n=t.hx()?1:-1,o=t.Kv(),h=(s.S-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).ze(c);const d={x:c.x+a*r.tickLength*t.Wi().x,y:c.y+l*r.tickLength*t.Wi().y};i.Oe(c).ze(d),e.Ee(r.gridStrokeStyle),i.Ee(r.tickStyle)}Vv(t,e){const i=this.qv,s=t.hx()?1:-1,r=t.Kv();let n,o=(e.S-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}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.vu(0).ze(360)._u(0).xu(s+.5*e.getThickness()*t.Wi().x).wu(360).ke(O).Ce(e)}Yv(t,e,i){const s=t.Kv(),r=this.Vv(t,{S:0+s}),n=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;e.Ja(r.alignment).zh(r.rotation).Ha(r.offset.x,r.offset.y).Ie(ri({x:n,y:0},r.padding))}tx(){this.Yh({He:[],$e:[{Ye:"Radial ticks",wA:0,nr:this.qv,hr:this.Jv,Ir:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Qv;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},xh:{ur:()=>{},bh:()=>!1},Pr:void 0}],We:El,Hh:void 0,$h:void 0})}}const El=(t,e,i)=>(180*t/Math.PI).toFixed(0),kl={pr:()=>{},mr:()=>{},Sr:()=>{},Fv:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,J:(t,e)=>{},nt:(e,i,s,r,n)=>t.x.nt(e,i,s,r,n)}),Iv:t=>t.radial},Cl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Dl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Fl extends Ui{constructor(t,e,i,s,r,n){super(e,i,r,n),this._s="Sector",this.nx=0,this.ox=1*Math.PI/2,this.lx=void 0,this.ux=void 0,this.Ts=t,this.Lv=s,this.np=this.Ts.Fc(this.Lv).cs(this.getHighlight()),this.gs(this.np),this.be=r.polarSectorFillStyle,this.Me=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.nx=kt(t,0,360),this.Ts.bs(),this}getAngleStart(){return this.nx}setAngleEnd(t){return this.ox=kt(t,0,360),this.Ts.bs(),this}getAngleEnd(){return this.ox}setAmplitudeStart(t){return this.lx=t,this.Ts.bs(),this}getAmplitudeStart(){return this.lx}setAmplitudeEnd(t){return this.ux=t,this.Ts.bs(),this}getAmplitudeEnd(){return this.ux}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.bs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.Lv.Xv(),e=180*this.Lv.Kv()/Math.PI,i=void 0!==this.lx?kt(this.lx,t.start,t.end):t.start,s=void 0!==this.ux?kt(this.ux,t.start,t.end):t.end,r=this.Lv.$v()?i-t.start:t.start-i,n=this.Lv.$v()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.Lv.hx()?1:-1,l=Math.abs(this.ox-this.nx);this.np.vu((this.nx-e)*a).ze((this.ox-e)*a)._u(100*o/h).xu(h).ke(this.be).Ce(this.Me).wu(Math.ceil(l/2))}Pe(t,e){t.cs(e),this.Ts.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class Il extends Ui{constructor(){super(...arguments),this.Lm=!0,this.Ax=!0}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}Gm(){}Fe(){}$p(){}setCursorEnabled(t){return this.Ax=t,this}getCursorEnabled(){return this.Ax}}class Ll extends Il{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ts=t,this.Ji=e,this.scale=s}getAmplitudeMin(){return this.gx?this.gx.min:void 0}getAmplitudeMax(){return this.gx?this.gx.max:void 0}}const zl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),Pl=(t,e)=>{const i=[],s=e.Xv().start,r=e.Xv().end,n=e.$v(),o=e.hx()?1:-1,h=e.Kv(),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=kt(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},Vl=t=>{const e={min:Ie,max:Le};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Rl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Ol=(t,e)=>{let i=gi(t);for(e.hx()||(i*=-1),i+=180*e.Kv()/Math.PI;i<0;)i+=360;i%=360;const s=ii(t),r=e.Xv(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Ln(r.start,r.end,s/n)}};class Bl extends Ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this._s="Heatmap Series",this.mx=!0,this.$m=!1,this.xp=_l,this.ld=()=>ae(this.be);const h=this.Ji.getSeries().length;this.be=ce(this.qi.polarHeatmapSeriesFillStyle||this.qi.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.En=u,this.yx=t.Sx(s,[],u).ke(this.be).cs(this.getHighlight()),this.gs(this.yx);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.gx={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t[0].length:t.length,annuli:"annuli"===this.En.dataOrder?t.length:t[0].length},i="annuli"===this.En.dataOrder?this.En.annuli:this.En.sectors,s="annuli"===this.En.dataOrder?this.En.sectors:this.En.annuli;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){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.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ji.fs.oo){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.`;St.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.yx.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.yx.ke(this.be),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}clear(){return this.yx.Nt(),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.yx.rS(t),this.Ts.bs(),this}getIntensityInterpolation(){return this.yx.nS()}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=ut(t,this.Ji.engine.scale,this.scale),s=Ol(i,this.scale),r=this.mx?this.yx.vx(s):this.yx.gg(s);if(r)return ga(Pl([r],this.scale)[0],this.scale,this.xp(new Kh,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.be)}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),he(t,this.qi,i,{fill:this.be}),this}}const _l=(t,e,i,s)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1));class Nl extends Ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.xp=zl,this.Cu=ce(this.qi.polarLineSeriesStrokeStyle,n),this._x=t.zp(s,void 0,[ka.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this._x)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Vl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx(jo(t,this.Ji.us),this._x)}wx(t,e){const i=e.Cx(t);if(!i)return;const{angle:s,amplitude:r}=Ol(i,this.scale);return ga(i,this.scale,this.xp(new Kh,this,s,r,this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.Cu.getFillStyle())}Fe(){if(this.bx||this.scale.kx()){const t=Pl(this.xx,this.scale),e=$e(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{stroke:this.Cu}),this}}class Ul extends Ll{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=zl,this.be=ce(this.qi.polarPointLineSeriesFillStyle,o),this.Cu=ce(this.qi.polarPointLineSeriesStrokeStyle,o),this._x=t.zp(r,void 0,[ka.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this._x),this.zc=t.Oc(r).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Vl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx(jo(t,this.Ji.us),this._x)}wx(t,e){const i=e instanceof Kr?e.gg(t):e.Cx(t);if(!i)return;const{angle:s,amplitude:r}=Ol(i,this.scale);return ga(i,this.scale,this.xp(new Kh,this,s,r,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}Fe(){if(this.bx||this.scale.kx()){const t=Pl(this.xx,this.scale),e=$e(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.zc.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds(),this.zc.Ds()}}yd(){return this.Fx}}class Gl extends Ll{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Series",this.xx=[],this.bx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=zl,this.be=ce(this.qi.polarPointSeriesFillStyle,o),this.zc=t.Oc(r).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Vl(this.xx),this.Ts.bs(),this}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=this.zc.gg(t);if(!i)return;const{angle:s,amplitude:r}=Ol(i,this.scale);return ga(i,this.scale,this.xp(new Kh,this,s,r,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}Fe(){if(this.bx||this.scale.kx()){const t=Pl(this.xx,this.scale),e=$e(t);this.zc.Nt()._l(t).ra(e),this.bx=!1,this.zc.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be}),this}yd(){return this.Fx}}class Wl{constructor(t,e,i,s){this.D=new r.Eventer,this.Ix=!1,this.Ji=t,this.Px=e,this.iy=i,this.el=s}setGeometry(t){return this.Dx=t,this.Ix=!0,this.Ji.us.bs(),this}getGeometry(){return this.Dx}setMouseInteractions(t){return this.el.setMouseInteractions(t),this}dispose(){return this.el.dispose(),this.Px(this),this.D.emit("dispose",this),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.el.getVisible()!==t;return this.el.setVisible(t),e&&this.D.emit("visibleStateChanged",this,t),this.Ji.us.bs(),this}getVisible(){return this.el.getVisible()}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const Yl=(t,e,i)=>{const s=e.dt,r=i.dt;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.sA&&(n=1-n),1===e.sA&&(o=1-o),u(o,n)};class Hl extends ia{constructor(t,e,i,s,r,n,o,h){super(t,e,Vi(i.dt,s.dt),r,h),this.Bx=!1,this.Lx=!1,this.Rx=!0,this.Ex=!0,this.Vx=!1,this.zx=!1,this.setGridStrokeYStyle=t=>(this.Ox.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.Ox.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Nx=n,this.Gx=o,this.Wx=this.axisX.FA(!1,this.Nx).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.Ox=this.axisY.FA(!1,this.Gx).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Wx.dispose(),this.Ox.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(ut(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Wx.setValue(t.x),this.Ox.setValue(t.y);const e=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?e.x:1),this.Ox.setGridStrokeLength(this.zx?e.y:1),this}Fe(){this.Wx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Ox.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx);const t=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?t.x:1),this.Ox.setGridStrokeLength(this.zx?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Wx.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Wx.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Wx.setMarker(t),this}setTickMarkerY(t){return this.Ox.setMarker(t),this}getTickMarkerX(){return this.Wx.getMarker()}getTickMarkerY(){return this.Ox.getMarker()}}class Xl extends ea{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.Vx=!1,this.zx=!1,this.Ux=!1,this.Yx=!1,this.Hx=new Map,this.$x=new Map,this.Bx=!0,this.Lx=!0,this.Og=s,this.Nx=r,this.Gx=n,this.Xx=o.cursorGridStrokeStyleX,this.jx=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.Hx.forEach((t=>t.dispose())),this.$x.forEach((t=>t.dispose())),this.Zx=void 0,this.Qx=void 0,this}Fe(){return this.Zx&&this.Zx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Qx&&this.Qx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof nu&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:r}=i,n=this.Ah(s,!0),o=this.Ah(r,!1);n!==this.Zx&&this.Zx&&this.Zx.setVisible(!1),o!==this.Qx&&this.Qx&&this.Qx.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=Yl(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.Vx?h.x:1),o.setGridStrokeLength(this.zx?h.y:1),this.Zx=n,this.Qx=o,super.pointAt(t)}Ug(t){if(super.Ug(t),t){const e=e=>e.setTextFillStyle(t);this.Zx&&this.Ux&&this.Zx.setMarker(e),this.Qx&&this.Yx&&this.Qx.setMarker(e)}}Ah(t,e){let i=(e?this.Hx:this.$x).get(t);return i||(e?(i=t.FA(!1,this.Nx),this.Hx.set(t,i)):(i=t.FA(!1,this.Gx),this.$x.set(t,i)),this.rr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}rr(t,e){const i=e?this.Xx:this.jx;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.Bx:this.Lx)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Xx=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.Hx.forEach((t=>t.setGridStrokeStyle(this.Xx))),this}getGridStrokeXStyle(){return this.Xx}setGridStrokeYStyle(t){return this.jx=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.$x.forEach((t=>t.setGridStrokeStyle(this.jx))),this}getGridStrokeYStyle(){return this.jx}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Hx.forEach((e=>e.setMarker(t))),this.Nx=this.Nx.addStyler(t),this.Ts.bs(),this}setTickMarkerY(t){return this.$x.forEach((e=>e.setMarker(t))),this.Gx=this.Gx.addStyler(t),this.Ts.bs(),this}setTickMarkerXAutoTextStyle(t){return this.Ux=t,this.Ts.bs(),this}getTickMarkerXAutoTextStyle(){return this.Ux}setTickMarkerYAutoTextStyle(t){return this.Yx=t,this.Ts.bs(),this}getTickMarkerYAutoTextStyle(){return this.Yx}}class $l extends sa{constructor(t,e,i,s){super(t,s),this.Og=t,this.Nx=e,this.Gx=i,this.Yg=s}}class jl extends $l{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new Xl(t,e,i,this.Og,this.Nx,this.Gx,s),s),this.addStyler=t=>new jl(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new jl(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}class ql extends $l{constructor(){super(...arguments),this.Xg=(t,e,i,s,r)=>this.Hg(new Hl(t,e,i,s,this.Og,this.Nx,this.Gx,r),r),this.addStyler=t=>new ql(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ql(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}const Jl=new jl(no,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{oa(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)))}))}]),Zl=new ql(no,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{ha(t,e),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)))}))}]),Kl=new ql(no,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{((t,e)=>{t.setPointMarker((t=>t.setFillStyle(e.seriesMarkerPointMarkerFillStyle).setSize(e.seriesMarkerPointMarkerSize).setShape(e.seriesMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10)))})(t,e),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)))}))}]),Ql=(t,i,s)=>{switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return s;case e.UIVisibilityModes.whenHovered:return i&&!s;case e.UIVisibilityModes.whenHoveredOrDragged:return s||i;case e.UIVisibilityModes.whenNotDragged:return!s;default:return!1}},tu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class eu{constructor(t,i,s,n,o,h){this.Jx=e.UIVisibilityModes.always,this.Kx=e.UIVisibilityModes.always,this.jo=!0,this.$i=!1,this.qx=!1,this.tb=!1,this.wa=u(0,0),this.Nu=e.UIDraggingModes.draggable,this.Gu=void 0,this.D=new r.Eventer,this.Xi=!0,this.ib=(t,i,s)=>{this.qx=!0,this.Ts.bs();const r=this.Nu===e.UIDraggingModes.notDraggable?this.Nu:s||this.Nu;this.Gu=this.Ts.us.Er(r===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:r===e.UIDraggingModes.draggable?e.MouseStyles.Move:r===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.sb=()=>{this.qx=!1,this.Ts.bs(),this.Ts.us.Vr(this.Gu)},this.eb=(t,e)=>{this.tb=!0,$t(e),this.Ts.bs()},this.hb=(t,i)=>{if(this.Nu!==e.UIDraggingModes.notDraggable){const s=i||this.Nu,r=ut(this.Ts.us.De(t.x,t.y),this.Ts.us.dt,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?tu(r.x,this.scale.x):this.wa.x,s!==e.UIDraggingModes.onlyHorizontal?tu(r.y,this.scale.y):this.wa.y);return this.setPosition(n),!0}return!1},this.rb=(t,e)=>{this.tb=!1,$t(e),this.Ts.bs()},this.onDispose=t=>this.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Sv=n,this.nb=o,this.qi=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.ib(t,e))),a.onMouseLeave(this.sb),a.onMouseDragStart(this.eb),a.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&$t(e))),a.onMouseDragStop(this.rb),a.onTouchStart(this.eb),a.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&$t(e))),a.onTouchEnd(this.rb),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.wa)}setPosition(t){return this.wa=t,this.Sv.setPosition(t),this.D.emit("positionChange",this,this.wa),this}getPosition(){return this.wa}onPositionChange(t){return this.D.on("positionChange",t)}offPositionChange(t){return this.D.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Jx=t,this.Ts.bs(),this}getPointMarkerVisibility(){return this.Jx}setResultTableVisibility(t){return this.Kx=t,this.Ts.bs(),this}getResultTableVisibility(){return this.Kx}setMouseInteractions(t){return this.jo=t,this.Sv.getPointMarker().setMouseInteractions(t),this.Sv.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.jo}setAutoFitStrategy(t){return this.Sv.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Sv.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return Ql(this.Jx,this.qx,this.tb)?this.Sv.setPointMarkerVisible(!0):this.Sv.setPointMarkerVisible(!1),t&&Ql(this.Kx,this.qx,this.tb)?this.Sv.setResultTableVisible(!0):this.Sv.setResultTableVisible(!1),this.Sv.Fe(),this}Ds(){return this.Sv.Ds(),this}pointAt(t){return this.Sv.pointAt(t),this}dispose(){return this.$i||(this.$i=!0,this.nb(this),this.Sv.dispose(),this.D.emit("dispose")),this}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Sv.setVisible(t),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setPointMarker(t){return this.Sv.setPointMarker(t),this}getPointMarker(){return this.Sv.getPointMarker()}setResultTable(t){return this.Sv.setResultTable(t),this}getResultTable(){return this.Sv.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return this.Nu}}class iu extends eu{constructor(t,i,s,r,n,o,h){super(t,i,Vi(s.dt,r.dt),n.Xg(t,i,s,r,h),o,h),this.ob=e.UIVisibilityModes.always,this.ab=e.UIVisibilityModes.always,this.lb=e.UIVisibilityModes.always,this.ub=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Sv.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Sv.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=r,this.nb=o;const a=this.Sv.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.sb),a.onMouseDragStart(this.eb),a.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&$t(i))),a.onMouseDragStop(this.rb),a.onTouchStart(this.eb),a.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&$t(i)));const l=this.Sv.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.sb),l.onMouseDragStart(this.eb),l.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&$t(i))),l.onMouseDragStop(this.rb),l.onTouchStart(this.eb),l.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&$t(i)))}Fe(){const t=this.isAttached();return this.Xi&&t&&Ql(this.lb,this.qx,this.tb)?this.Sv.setTickMarkerXVisible(!0):this.Sv.setTickMarkerXVisible(!1),this.Xi&&t&&Ql(this.ub,this.qx,this.tb)?this.Sv.setTickMarkerYVisible(!0):this.Sv.setTickMarkerYVisible(!1),this.Sv.setGridStrokeXStyle(this.Xi&&t&&Ql(this.ob,this.qx,this.tb)?this.gridStrokeStyleX:rt),this.Sv.setGridStrokeYStyle(this.Xi&&t&&Ql(this.ab,this.qx,this.tb)?this.gridStrokeStyleY:rt),super.Fe()}setGridStrokeXVisibility(t){return this.ob=t,this.Ts.bs(),this}getGridStrokeXVisibility(){return this.ob}setGridStrokeYVisibility(t){return this.ab=t,this.Ts.bs(),this}getGridStrokeYVisibility(){return this.ab}setTickMarkerXVisibility(t){return this.lb=t,this.Ts.bs(),this}getTickMarkerXVisibility(){return this.lb}setTickMarkerYVisibility(t){return this.ub=t,this.Ts.bs(),this}getTickMarkerYVisibility(){return this.ub}setGridStrokeXCut(t){return this.Sv.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Sv.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Sv.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Sv.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Sv.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Sv.getGridStrokeYStyle()}setTickMarkerX(t){return this.Sv.setTickMarkerX(t),this}getTickMarkerX(){return this.Sv.getTickMarkerX()}setTickMarkerY(t){return this.Sv.setTickMarkerY(t),this}getTickMarkerY(){return this.Sv.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Sv.getTickMarkerX().setMouseInteractions(t),this.Sv.getTickMarkerY().setMouseInteractions(t),this}}class su extends iu{}class ru extends su{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.cb=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.cb=!1,this.Ts.bs(),this}Ds(){if(!this.cb){const t=this.owningSeries.solveNearestFromScreen(ut(this.wa,this.scale,this.Ts.us.dt));t?(this.wa=ut(t.location,this.owningSeries.scale,this.scale),this.Sv.pointAt(t),this.cb=!0):this.Sv.setPosition(this.wa)}return super.Ds()}isAttached(){return this.cb}}class nu extends Il{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.fb=[],this.addMarker=(t=Kl)=>{const e=new ru(this.Ab(),this.Ji.uiScale,this,t,this.removeMarker,this.qi);return this.fb.push(e),e},this.removeMarker=t=>{const e=this.fb.indexOf(t);-1!==e&&this.fb.splice(e,1)},this.ts=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.Ab=h,this.scale=Vi(s.dt,r.dt),this.gb=t.pb,t.pb+=1,this.mb(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yb),this.onMouseLeave(this.chart.Sb),this.onMouseWheel(this.chart.Em),this.onMouseDragStart(this.chart.vb),this.onMouseDrag(this.chart.Vm),this.onMouseDragStop(this.chart.xb),this.onTouchStart(this.chart.zm.onTouchStart),this.onTouchMove(this.chart.zm.onTouchMove),this.onTouchEnd(this.chart.zm.onTouchEnd)}attacheAxis(){this.bb=this.axisXAttachHandler(this),this.Mb=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.da(this.gb)})),this.Ji.us.bs(),this}dispose(){return super.dispose(),this.fb.slice().forEach((t=>t.dispose())),this.bb(this),this.Mb(this),this}_b(){for(let t=0;t{const r=t.length;let n=0;if(void 0!==e){const r=i-e;if(r>0){const e=t.slice(n,r);n+=r,s(e,!0)}}for(;nt))=>{const i=[];let s;for(let r=0;r{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class uu extends nu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.wb=[],this.Lu=[],this.Cb=0,this.ji=!1,this.Hi=e.HighlightModes.onHover,this.xp=lu,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"xy series")),this.kb=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}add(t){if(0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)?this.Tb(t):this.Tb([t]),this.Lu.length>0){const t=this.Lu[this.Lu.length-1];this.Fb={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.Fb?this.Fb.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.wl()+e.Cl()),this.Lu.length)}clear(){this.Ib=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.kb.getXMax(this.wb,this.Ib)||0}getXMin(){return this.kb.getXMin(this.wb,this.Ib)||0}getYMax(){return this.kb.getYMax(this.wb,this.Ib)||0}getYMin(){return this.kb.getYMin(this.wb,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Pb(t,e,i,s){this.kb.Pb(t,e,i,s,this.scale,(t=>{}))}Gm(){super.Gm();const t=this.wb.length;this.Db&&this.Pb(this.wb,this.getPointAmount(),this.Db,this.Cb),t!==this.wb.length&&this._b()}Fe(){super.Fe();const t=this.getBoundaries();this.Lu.length>0&&(this.Bb(this.Lu),this.Lu=[]);for(const e of this.wb)e.ra(t);return super.Fe()}$p(){super.$p(),this.Ib=void 0,this.Lu.length=0}Tb(t){0!==t.length&&(this.Ib?this.Ib=qe(this.Ib,$e(t)):this.Ib=$e(t),this.D.emit("dataAdd",this,t,this.Ib),this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Ts.bs())}Lb(){return hu(this.wb)}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.Nb.indexOf(t);e>=0&&this.Nb.splice(e,1);const i=this.Ob.findIndex((e=>e===t.el));i>=0&&this.Ob.splice(i,1),this.Ts.bs()},this.be=ce(this.qi.polarPolygonSeriesFillStyle,n),this.Me=ce(this.qi.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}addPolygon(){const t=new Wl(this.Ji,this.Gb,this,this.Wb());return this.Nb.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.Ob)t.ke(e);return this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;for(const t of this.Ob)t.Ce(e);return this.Ts.bs(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm&&void 0!==this.Nb.find((t=>void 0!==t.Ub))&&this.getVisible()}Fe(){this.Nb.forEach((t=>{(t.Ix||this.scale.kx())&&t.Yb&&(t.el.Rl(Pl(t.Yb,this.scale)),t.Ix=!1,t.el.Ds())}))}Gm(){super.Gm();const t=y(Ie,Le);this.Nb.forEach((e=>{if(!e.Dx)return;const i=!e.Ix&&e.Yb?e.Yb:Rl(e.Dx);e.Yb=i;const s=!e.Ix&&e.Ub?e.Ub:Vl(i);e.Ub=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.gx=t}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=cu(t,this.Ob,((t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,t.us.dt)}),We);if(!i)return;const s=ut(i[0],i[1].us.dt,this.scale),r=this.Hb(i[1]);if(!r)return;const{angle:n,amplitude:o}=Ol(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.xp(new Kh,this,n,o,this.Ji.getAmplitudeAxis().formatValue).fc(),owner:this,fillStyle:this.be,polarPolygon:r}}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Wb(){const t=this.Ts.vc(this.scale,nn.Simple).ke(this.be).Ce(this.Me).cs(this.getHighlight());return this.Ob.push(t),this.gs(t),t}Hb(t){return this.Nb.find((e=>e.el===t))}}class fu extends Ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Area Series",this.xx=[],this.bx=!1,this.Mx=!1,this.$b=!1,this.xp=zl,this.be=ce(this.qi.polarAreaSeriesFillStyle,n),this.Me=ce(this.qi.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class gu extends fu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Xb=this.Ts.vc(this.scale,nn.Simple).cs(this.getHighlight()),this.gs(this.Xb)}Fe(){if(this.bx||this.scale.kx()){const t=this.xx,e=!0===this.Mx?Pl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Et(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;!Et(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.jb.start}ix(t){this.Zb=t,this.tM=!0}hx(){return!1===this.Zb}sx(t){this.Qb=t,this.tM=!0}Kv(){return this.Qb}mi(){return this.vi}_i(){return!1}ot(t,e,i,s){return this.x=new Fi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Fi(t.y,e.y,i.y,s?s.y:void 0),this}yi(){return this.di}kx(){return this.qb}eM(){return this.tM}Wi(){return this.iM}j(){return this.o=!1,this.vi=!1,this.qb=!1,this.tM=!1,this}Z(){return this.o=!0,this.vi=!0,this.qb=!0,this.tM=!0,this}q(t,e){return"object"==typeof t?(this.X.x=t.x,this.X.y=t.y):(this.X.x=t,this.X.y=e),this.sM(),this}Ei(t){return this.Jb=t,this.sM(),this}Vi(t){return this.Kb=t,this.sM(),this}ni(){return u(this.Jb[0]+this.Jb[1],this.Kb[0]+this.Kb[1])}oi(){return this.X}sM(){const t=this.jb,e=u(this.x.ai(this.X.x),this.y.ai(this.X.y)),i=this.Jb[0]+this.Jb[1],s=this.Kb[0]+this.Kb[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.Jb[0]+Math.max((r-2*o)/2,0),this.Jb[1]+Math.max((r-2*o)/2,0)],a=[this.Kb[0]+Math.max((n-2*o)/2,0),this.Kb[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.X.x).si(h).J(-l,l),this.y.q(this.X.y).si(a).J(-l,l),this.iM={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.yi(),y:this.y.yi()},this.Z()}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=ei(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 pu extends Za{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("polarChart bg",0),r,i.us.qi.polarChartBackgroundFillStyle,i.us.qi.polarChartBackgroundStrokeStyle,i.us.qi.polarChartTitleFont,i.us.qi.polarChartTitleFillStyle,h),this.coordsClient="client",this.Kd=[],this.jo=!0,this.vp=e.AutoCursorModes.onHover,this.hM=(t,e,i,s,r)=>{this.Lv.q(s,r)},this.if=Zt(this.Kd),this.rM=t=>{this.Kd.push(t)},this.nM=()=>this.iy,this.fs.zn||this.fs.Vn||this.fs.jn||this.us.As(4),this.oM=i.YS("polarChart series bg",0),this.aM=i.wp("polarChart axis gridlines",0),this.lM=i.wp("polarChart series",1),this.uM=i.wp("polarChart axis lines",2),this.cM=i.wp("polarChart axis ticks",3),this.Lv=s.d2({scaleXYConstructor:yu}),this.onResize(this.hM),this.ng.Bh("Polar Chart"),this.uy=this.oM.Fc(this.Lv).ke(this.qi.polarChartSeriesBackgroundFillStyle).Ce(rt).vu(0).ze(360)._u(0),this.Ay=this.oM.Fc(this.Lv).ke(O).Ce(this.qi.polarChartSeriesBackgroundStrokeStyle).vu(0).ze(360)._u(0),super.ly(this.uy,this.Ay),this.ig(n,this.pixelScale),this.dM=new Ml(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es,this.nM),this.fM=new wl(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es),this.coordsAxis={axisAmplitude:this.dM,axisRadial:this.fM},this.kp=i.Tp();const a=Dt(o?o.autoCursorBuilder:void 0,da);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),Hh.pg(this),this.yy(((t,e)=>{Hh.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Hh.gg(this,jo(e,this.us),this.iy)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(Ri(r)){const t=ut(e,s,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(Bi(r))return e;if(Cl(r)){const t=ut(e,s,this.Lv);return Ol(t,this.Lv)}}else{const i=t,s=e;if(Oi(i)){if(Cl(s)){const t=this.us.$o(i),e=ut({x:t.engineX,y:t.engineY},this.engine.scale,this.Lv);return Ol(e,this.Lv)}if(Ri(s))return i;if(Bi(s)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.us.dt,this.pixelScale)}}else if(Dl(i)){if(Cl(s))return i;const t=Pl([i],this.Lv)[0];if(Ri(s)){const e=ut(t,this.Lv,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.us.Xo(i)}if(Bi(s))return ut(t,this.Lv,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Nl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointSeries(t){const e=new Gl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Ul(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addAreaSeries(t){const e=new gu(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPolygonSeries(t){const e=new du(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addHeatmapSeries(t){const e=new Bl(this.lM,this,this.ey,this.Lv,this.qi,this.us.es,t);return this.gy(e),e}addSector(){const t=new Fl(this.lM,this,this.if,this.Lv,this.qi,this.us.es);return this.rM(t),t}getAmplitudeAxis(){return this.dM}getRadialAxis(){return this.fM}Fe(t){var e,i;super.Fe(t),Wh.cg(this.ng,this.eg);for(const t of this.iy)t.Gm();this.dM.vr(),this.fM.vr();for(const t of this.iy)t.Fe();for(let t=1;t<=2;t+=1){const e=this.dM.Fe(),i=this.fM.Fe(),s=Wh.ug(this.ng,this.eg),r=[this.Da.left+i,this.Da.right+i],n=[this.Da.bottom+i,this.Da.top+i+s];this.Lv.Ei(r).Vi(n);const o=4;if(!(!this.AM||Math.abs(this.AM.amplitude-e)>=o||Math.abs(this.AM.radial-i)>=o)||1!==t){this.AM={amplitude:e,radial:i};break}}const s=this.Lv.Xv().start,r=this.Lv.Xv().end,n=this.Lv.$v()?((null===(e=this.AM)||void 0===e?void 0:e.radial)||0)*this.Lv.x.getPixelSize()+r-s:((null===(i=this.AM)||void 0===i?void 0:i.radial)||0)*this.Lv.x.getPixelSize()+s-r;this.uy.xu(n).wu(360),this.Ay.xu(n).wu(360);for(const t of this.Kd)t.Fe();Hh.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Hh.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p();return super.tg(),this.gM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.dM.setAnimationsEnabled(t),this.fM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}getMinimumSize(){return u(mu,mu)}gM(){}forEachAxis(t){return t(this.dM),t(this.fM),this}dispose(){return this.Kd.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.oM.W(),this.aM.W(),this.lM.W(),this.uM.W(),this.cM.W(),this.kp.W(),super.dispose()}Sd(){return[...this.iy,...this.Kd]}}const mu=300;class Au extends xa{}class xu extends Au{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this._s="Slice",this.S=0,this.jg=!1,this.pM=O,this.Qg=O,this.Jg=this.S,this.tp=j((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=r,this.Ki=n,this.Xb=e.vc(r,nn.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(r).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},vu=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=bu(i,r.x),s=bu(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},p=0,m=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&&m.Xb.Rl([g,d,f,y])}};class Mu extends Gh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("funnelChart bg",0),r,i.us.qi.funnelChartBackgroundFillStyle,i.us.qi.funnelChartBackgroundStrokeStyle,i.us.qi.funnelChartTitleFont,i.us.qi.funnelChartTitleFillStyle,o),this.ap=[],this.lp=pa.None,this.dp=!0,this.gp=0,this.mM=80,this.yM=20,this.SM=0,this.vM=e.FunnelSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Aa,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(5),this.Sp=this.qi.effectsText,this._p=i.wp("funnelChart bottom",0),this.Cp=i.wp("funnelChart top",1),this.ng.Bh("Funnel Chart"),this.up=this.qi.funnelChartSliceFillStylePalette,this.cp=this.qi.funnelChartSliceStrokeStyle,this.fp=this.qi.funnelChartSliceLabelFont,this.Ap=this.qi.funnelChartSliceLabelFillStyle,this.kp=i.Tp();const a=Dt(h?h.autoCursorBuilder:void 0,ca);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.ig(n,this.pixelScale)}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new xu(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tga(e,this.engine.scale,this.xp(new Kh,this,t,o[r.indexOf(t)]||0).fc(),t,void 0))),this.Pp(r,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Tu=(t,i,s)=>{const r=t.El();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}}},wu=t=>{const e=t.El();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 Eu extends Mu{constructor(){super(...arguments),this.Ip=ma.NamePlusValue,this.xM=10,this.bM=e.FunnelLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&this.ap.splice(e,1)},this.fs.zn||this.fs.Vn||this.fs.$n||this.us.As(6),this.Ts=e.wp("gaugeChart layer",0),this.Cp=e.wp("gaugeChart top layer",1),this.ng.Bh("Gauge Chart"),this.ig(r,this.pixelScale);const h=Yi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.W(),this.Cp.W(),this.ap.slice().forEach((t=>t.dispose())),super.dispose()}}class Lu extends Iu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.uu=90,this.cu=-270,this.CM={min:this.uu,max:this.cu},this.kM=j((()=>this.Ts.bs())),this.TM=()=>{this.FM=void 0},this.IM=e.wp("radialGaugeChart bg arc",2),this.PM=this.Ts.Fc(this.pixelScale).ke(this.qi.gaugeChartEmptyGaugeFillStyle).Ce(this.qi.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.uu,s=this.cu,r=this.CM;return this.getAnimationsEnabled()?this.DM(r,{min:t,max:e}):(r.min=t,r.max=e,this.uu=t,this.cu=e),this.D.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.us.bs(),this}getAngleInterval(){return{min:this.uu,max:this.cu}}setGaugeFillStyle(t){return this.PM.ke(t),this.us.bs(),this}setGaugeStrokeStyle(t){return this.PM.Ce(t),this.us.bs(),this}DM(t,e,i){this.FM=this.kM(1e3,X.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.CM={min:t,max:e},this.uu=t,this.cu=e,this.Ts.bs()})),this.FM.onEveryAnimationEnd(this.TM),i&&this.FM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.D.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.D.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.IM.W(),this}}class zu extends xa{BM(t){return this.D.on("valueChange",t)}LM(t){return this.D.on("valueIntervalChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}offIntervalChange(t){return this.D.off(t,"valueIntervalChange")}attach(t,e=!0,i=!1){return super.attach(t,e,i),this.styleAttachedEntry(t,e,i),this}styleAttachedEntry(t,e=!0,i=!1){he(t,this.qi,i,{fill:this.RM})}}class Pu extends zu{onValueChange(t){return this.BM(t)}onIntervalChange(t){return this.LM(t)}}class Vu extends Pu{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.uu=0,this.cu=0,this.EM=0,this.VM=0,this.zM=0,this.OM=100,this.NM=!0,this.Jg=this.S,this.qg=this.getVisible(),this.tp=be(),this.GM=t=>{this.Jg=t,this.Ji.us.bs()},this.WM=t,this.Tr=e,this.Ji=i,this.scale=s,this.RM=this.qi.gaugeChartGaugeFillStyle,this.np=t.Fc(s).ke(this.RM).Ce(rt).cs(this.getHighlight()),this.gs(this.np),this.UM=e.kr(s).cs(this.getHighlight()),this.gs(this.UM,{isText:!0}),this.YM=e.kr(s).cs(this.getHighlight()),this.gs(this.YM,{isText:!0}),this.Ye=e.kr(s).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.UM.ke(n.gaugeChartIntervalLabelsFillStyle).Vh(n.gaugeChartIntervalLabelsFont),this.YM.ke(n.gaugeChartIntervalLabelsFillStyle).Vh(n.gaugeChartIntervalLabelsFont),this.Ye.ke(n.gaugeChartValueLabelFillStyle).Vh(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ji.getDataLabelFormatter(),e=this.uu/90r&&(i=r);const n=this.cu-e*this.VM,o=this.uu+e*this.EM,h=this.OM-this.zM,a=(0!==h?(n-o)/h:1/0)*(i-this.zM);this.np.vu(o).ze(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ye.Bh(l)}HM(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.zM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.zM);return this.UM.Bh(e).Ds(),this.UM.oi()}$M(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.OM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.OM);return this.YM.Bh(e).Ds(),this.YM.oi()}setName(t){return super.setName(t),this.Ji.us.bs(),this}setValue(t){const e=this.S;return this.Ji.getAnimationsEnabled()?this.qg&&this.tp(e,t,this.GM):this.Jg=t,this.S=t,this.D.emit("valueChange",this,e,t),this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?this.tp(this.Jg,0,this.GM,{onCompleted:()=>super.setVisible(!1)}):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(super.setVisible(!0),this.tp(this.Jg,this.S,this.GM)):(this.Jg=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.zM,s=this.OM;return this.D.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.zM=t,this.OM=e,this.Ji.us.bs(),this}setIntervalLabelsFont(t){return this.UM.Vh(t),this.YM.Vh(t),this.Ji.us.bs(),this}getIntervalLabelsFont(){return this.UM.Eh()}setIntervalLabelsFillStyle(t){return this.UM.ke(t),this.YM.ke(t),this.Ji.us.bs(),this}getIntervalLabelsFillStyle(){return this.UM.Lh()}setIntervalLabelsVisible(t){return t?(this.UM.setVisible(!0),this.YM.setVisible(!0)):(this.UM.setVisible(!1),this.YM.setVisible(!1)),this.NM=t,this}getIntervalLabelsVisible(){return this.NM}setAngleInterval(t,e){return this.uu=t,this.cu=e,this.Ji.us.bs(),this}setMinAngle(t){return this.uu=t,this.Ji.us.bs(),this}setMaxAngle(t){return this.cu=t,this.Ji.us.bs(),this}setMarginInDegrees(t=this.EM,e=this.VM){return t!==this.EM&&(this.EM=t),e!==this.VM&&(this.VM=e),this.Ji.us.bs(),this}setFillStyle(t){this.RM="function"==typeof t?t(this.RM):t;const e=this.RM;this.np.ke(e);for(let t=0;tr?25*s:25*r))){const o=Array(n+2),h=Math.PI;let a=0,l=0;const c=e*h/180,d=(i*h/180-c)/n;for(o[a]=u(t.x,t.y),a+=1;a<=n+1;)o[a]=u(t.x+s*Math.cos(c+l*d),t.y+r*Math.sin(c+l*d)),a+=1,l+=1;return[o,n]}class Ou extends Lu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.nd=20,this.ZM=new Intl.NumberFormat,this.QM=new Intl.NumberFormat,this.JM=!1,this.KM=5;const h=new Vu(this.Ts,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.qM=h,this.ap.push(h),this.setPadding(10)}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=$e([this.qM.HM(),this.qM.$M()]),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.Da.left+i.max.x+.5*s.x,this.Da.bottom+i.max.y+.5*s.y),o=this.JM?this.t_(n,r):n,h=this.PM.Me.getThickness(),a=r-.5*h,l=r-this.nd;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.nd-h)/r);this.i_(o,l)&&(this.PM.xu(r)._u(c),this.qM.np.xu(a)._u(d));const f=.5*(g=r,(y=this.cu-this.uu)/(2*Math.PI*g*(y/360))*h);var g,y;this.PM.vu(this.uu).ze(this.cu).Ie(o),this.qM.np.Ie(o),this.qM.Ye.Ie(o),this.ad&&this.qM.setFillStyle(new U({color:this.ad.getColors(this.qM.getAnimatedValue())})),this.qM.setMinAngle(this.uu).setMaxAngle(this.cu).setMarginInDegrees(f,f).Fe();const p=this.PM.du();if(this.qM.getIntervalLabelsVisible()){this.s_(this.uu,this.cu,o,p+this.KM);const t=this.qM.UM.Ds().Ue(),e=this.qM.YM.Ds().Ue();Oe(t,e)&&this.e_(t,e,o,p+this.KM)}}i_(t,e){const i=si(this.qM.Ye.Ds().oi(),.5),s=t.x+e,r=t.x-e,n=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xn||t.y-i.y=0?i=-s:s=-i),[i,s]}t_(t,e){const[i]=Ru(t,this.uu,this.cu,e,e),s=$e(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return ri(ni(t,u(s.min.x+r,s.min.y+n)),t)}s_(t,e,i,s){const r=di(t),n=di(e);this.qM.UM.Ie(Ke(u(i.x+s,i.y),i,-r)),this.qM.YM.Ie(Ke(u(i.x+s,i.y),i,-n)),this.qM.UM.Ja(u(-Math.cos(r),-Math.sin(r))),this.qM.YM.Ja(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.qM}setAutoScaling(t){return this.JM=t,this.us.bs(),this}getAutoScaling(){return this.JM}setDataLabelFormatter(t){return this.QM=t,this.us.bs(),this}getDataLabelFormatter(){return this.QM}setIntervalLabelFormatter(t){return this.ZM=t,this.us.bs(),this}getIntervalLabelFormatter(){return this.ZM}setIntervalLabelPadding(t){return this.KM=t,this.us.bs(),this}getIntervalLabelPadding(){return this.KM}setThickness(t){return this.nd=t,this}setLUT(t){return this.ad=t,this.us.bs(),this}setDataLabelFont(t){return this.qM.Ye.Vh(t),this.us.bs(),this}getDataLabelFont(){return this.qM.Ye.Eh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.qM.XM(t),this.us.bs(),this}getDataLabelFillStyle(){return this.qM.jM()}Sd(){return this.ap}dispose(){return this.qM.dispose(),super.dispose()}}class Bu extends xa{}class _u extends Bu{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this._s="Slice",this.S=0,this.jg=!1,this.pM=O,this.Qg=O,this.Jg=this.S,this.tp=j((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=r,this.Ki=n,this.Xb=e.vc(r,nn.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(r).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Uu=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Nu(i,r.x),s=Nu(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},p=0,m=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&&m.Xb.Rl([g,d,f,y])}};class Gu extends Gh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("pyramidChart bg",0),r,i.us.qi.pyramidChartBackgroundFillStyle,i.us.qi.pyramidChartBackgroundStrokeStyle,i.us.qi.pyramidChartTitleFont,i.us.qi.pyramidChartTitleFillStyle,o),this.ap=[],this.lp=pa.None,this.up=this.qi.pyramidChartSliceFillStylePalette,this.cp=this.qi.pyramidChartSliceStrokeStyle,this.dp=!0,this.fp=this.qi.pyramidChartSliceLabelFont,this.Ap=this.qi.pyramidChartSliceLabelFillStyle,this.gp=0,this.mM=0,this.yM=80,this.SM=0,this.vM=e.PyramidSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Aa,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(8),this.Sp=this.qi.effectsText,this._p=i.wp("pyramidChart bottom",0),this.Cp=i.wp("pyramidChart top",1),this.ng.Bh("Pyramid Chart"),this.kp=i.Tp();const a=Dt(h?h.autoCursorBuilder:void 0,ca);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.ig(n,this.pixelScale),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new _u(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tga(e,this.engine.scale,this.xp(new Kh,this,t,o[r.indexOf(t)]||0).fc(),t,void 0))),this.Pp(r,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Wu=(t,i,s)=>{const r=t.El();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}}},Yu=t=>{const e=t.El();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 Hu extends Gu{constructor(){super(...arguments),this.Ip=ma.NamePlusValue,this.xM=10,this.bM=e.PyramidLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t(t.alignmentX=(r+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=r%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(r)*n,t.paddingY=Math.sin(r)*n,t),Ju=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Zu;e.SpiderWebMode=void 0,(Zu=e.SpiderWebMode||(e.SpiderWebMode={}))[Zu.Normal=0]="Normal",Zu[Zu.Circle=1]="Circle";class Ku{constructor(t,e,i,s,n,o,h,a){this.D=new r.Eventer,this.r_=t,this.Tr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.n_=h,this.o_=a,this.a_=this.r_.Ve(this.scale).setMouseInteractions(!1),this.l_=this.Tr.kr(this.scale).Bh(this.tag).setMouseInteractions(!1),this.u_=this.n_(this,this.r_.zp(this.scale,void 0,[ka.InternalUI])).Ee(this.chart.getNibStyle()),this.o_.ps([this.l_])}Pp(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.l_.setVisible(!0).Ie(ri(c,u(h.paddingX,h.paddingY))).Xa(h.alignmentX).Za(h.alignmentY):this.l_.setVisible(!1)}getLabelSize(){return this.l_.Vh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().oi()}dispose(){this.a_&&this.a_.dispose(),this.l_&&this.l_.dispose(),this.u_&&this.u_.dispose()}}const Qu=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class tc extends Il{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this._s="Spider Series",this.Lu=new Map,this.Hi=e.HighlightModes.onHover,this.xp=Qu,this.Tx=8,this.Fa=0,this.c_=be(),this.d_={},this.f_={},this.qg=this.getVisible(),this.A_=1,this.g_=((t,e)=>{const i=j((()=>{}));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.A_=t,this.Ts.us.bs()}),(t=>{super.setVisible(t)})),this.Ji=t,this.Ts=i,this.Fx=r,this.p_=n,this.HS=o,this.m_=h,this.y_=a,this.scale=s,this.S_=ce(u.spiderSeriesFillStyle,c),this.v_=ce(u.spiderSeriesStrokeStyle,c),this.x_=ce(u.spiderSeriesPointFillStyle,c)}Dm(){return this.Lm&&this.Lu.size>0&&this.getVisible()}addPoints(...t){this.Lu.size>0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.c_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.Lu.set(s,r+t*(e-r)),this.Ts.us.bs()}))}),{easing:this.d_.easing,durationMs:this.d_.durationMs,onStart:()=>{i=new Map(this.Lu)}})}else for(let e=0;e=3&&(this.Xb||(this.Xb=this.Ts.vc(this.scale,nn.Simple).Ce(this.v_).ke(this.S_).cs(this.getHighlight()),this.gs(this.Xb)),this.Xb.Rl(t),this.zc||(this.zc=this.Ts.Oc(this.scale).q(this.Tx).Sl(this.Fx).zh(this.Fa).ke(this.x_).cs(this.getHighlight()),this.gs(this.zc)),this.zc.Nt()._l(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.S_,stroke:this.v_}),this}yd(){return this.Fx}b_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},ic=t=>$e(t.l_.Ue()),sc=t=>$e(t.Ue()),rc=(t,i,s,r)=>t._u(0).Ie(s).vu(90).ze(-270).wu(i===e.SpiderWebMode.Circle?void 0:r.length),nc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},oc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},hc=()=>{oc.alignmentX=0,oc.alignmentY=0,oc.paddingX=0,oc.paddingY=0};class ac extends Za{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("spiderChart bg",0),r,i.us.qi.spiderChartBackgroundFillStyle,i.us.qi.spiderChartBackgroundStrokeStyle,i.us.qi.spiderChartTitleFont,i.us.qi.spiderChartTitleFillStyle,h),this.Da=A(20,20,20,20),this.axisScale=at.d1({scale1DConstructor:Fi,dimension:"x"}).J(0,1),this.HS=[],this.M_=[],this.__=[],this.w_=Rs.expansion,this.C_=!0,this.k_=Ju,this.T_=qu,this.jo=!0,this.F_=e.SpiderWebMode.Normal,this.I_=4,this.P_=this.qi.spiderChartWebStyle,this.D_=this.qi.spiderChartScaleLabelFillStyle,this.B_=this.qi.spiderChartScaleLabelFont,this.L_=5,this.R_=this.qi.spiderChartAxisLabelFillStyle,this.E_=this.qi.spiderChartAxisLabelFont,this.V_=5,this.z_=this.qi.spiderChartAxisStrokeStyle,this.O_=this.qi.spiderChartAxisNibStrokeStyle,this.Dd=10,this.N_=A(),this.vp=e.AutoCursorModes.onHover,this.hasAxis=t=>this.HS.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Ci.Numeric),this.G_=()=>{const t=this.HS.map(ic).concat(this.__.map(sc));return _e(t)},this.W_=()=>this.U_.Fc(this.pixelScale).setMouseInteractions(!1),this.Y_=t=>t.dispose(),this.H_=()=>this.vf.kr(this.pixelScale).setMouseInteractions(!1),this.X_=t=>t.dispose(),this.j_=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.Z_=(t,e)=>{let i,s;const r=()=>{void 0!==this.Q_&&this.Q_.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.w_,this.w_=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.HS.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=ec(a,this.HS.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ii(ni(t.a_.Ii(),t.a_.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.J(i.min,l),$t(o),this.us.bs()}},o=()=>{if(i=void 0,void 0!==s)if(this.th){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.J_(),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.Q_=this.zA.us.Zr(300,X.ease)([[0,1]],(([e])=>{this.axisScale.J(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.Q_.onAnimationEnd((()=>{this.Q_=void 0,this.w_=i}))}else this.w_=s}else this.w_=s;s=void 0};e.setMouseEnterEventHandler(this.K_).setMouseLeaveEventHandler(this.q_).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Yi(new Xi(((t,e,i)=>{this.K_(t),r(),$t(i)}),n,((t,e,i,s)=>{this.q_(t),o(),$t(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.tw=t=>{this.C_&&!this.hasAxis(t)&&this.addAxis(t)},this.m_=(t,e)=>{for(const i of this.HS)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return He(i.a_.Ii(),i.a_.Ti(),t)}},this.y_=t=>{if(0===this.HS.length)return;const e=ni(ut(t,this.engine.scale,this.pixelScale),this.HS[0].a_.Ii()),i=Math.atan2(e.y,e.x);let s,r=Ie;for(const t of this.HS){const e=ni(t.a_.Ti(),t.a_.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.jo&&(t.Ee(this.O_),this.us.bs())},this.q_=t=>{t.Ee(this.O_),this.us.bs()},this.fs.zn||this.fs.Vn||this.fs.Xn||this.us.As(9),this.oM=i.YS("spiderChart series bg",0),this.U_=i.wp("spiderChart web shapes",0),this.iw=i.wp("spiderChart axis bg",1),this.yv=i.wp("spiderChart plotting",2),this.vf=i.wp("spiderChart fg",3),this.o_=this.es.gA().xs(this.qi.effectsText),this.ng.Bh("Spider Chart"),this.uy=this.oM.Fc(this.pixelScale).ke(this.qi.spiderChartSeriesBackgroundFillStyle).Ce(rt).vu(90).ze(-270)._u(0),this.Ay=this.oM.Fc(this.pixelScale).ke(O).Ce(this.qi.spiderChartSeriesBackgroundStrokeStyle).vu(90).ze(-270)._u(0),super.ly(this.uy,this.Ay),this.kp=i.Tp();const a=Dt(o?o.autoCursorBuilder:void 0,la);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),Hh.pg(this),this.yy(((t,e)=>{Hh.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(n,this.pixelScale)}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Hh.gg(this,jo(e,this.us),this.iy)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Ku(this.iw,this.vf,this.pixelScale,this,t,this.axisScale,this.Z_,this.o_);this.HS.push(e)}}else t&&this.HS.push(t);return this.o_.ps(this.HS.map((t=>t.l_))),this.us.bs(),this}addSeries(t){const i="object"==typeof t?t.pointShape?t.pointShape:e.PointShape.Circle:t||e.PointShape.Circle,s="object"==typeof t&&t.automaticColorIndex?t.automaticColorIndex:this.iy.length,r=new tc(this,this.yv,this.pixelScale,i,this.tw,this.HS,this.m_,this.y_,this.ey,this.qi,s,this.us.es);return this.gy(r),r}getSeriesCount(){return this.iy.length}setWebMode(t){return this.F_=t,this.us.bs(),this}getWebMode(){return this.F_}setWebCount(t){return this.I_=t,this.us.bs(),this}getWebCount(){return this.I_}setWebStyle(t){return this.P_="function"==typeof t?t(this.P_):t,this.us.bs(),this}getWebStyle(){return this.P_}setScaleLabelStyle(t){return this.D_="function"==typeof t?t(this.D_):t,this.us.bs(),this}getScaleLabelStyle(){return this.D_}setScaleLabelFont(t){return this.B_="function"==typeof t?t(this.B_):t,this.us.bs(),this}getScaleLabelFont(){return this.B_}setScaleLabelPadding(t){return this.L_=t,this.us.bs(),this}getScaleLabelPadding(){return this.L_}setScaleLabelStrategy(t){return this.k_=t,this.us.bs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.us.bs(),this}setAxisLabelStyle(t){return this.R_="function"==typeof t?t(this.R_):t,this.us.bs(),this}getAxisLabelStyle(){return this.R_}setAxisLabelFont(t){return this.E_="function"==typeof t?t(this.E_):t,this.us.bs(),this}getAxisLabelFont(){return this.E_}setAxisLabelEffect(t){return this.o_.xs(t),this.us.bs(),this}getAxisLabelEffect(){return this.o_.Ms()}setAxisLabelPadding(t){return this.V_=t,this.us.bs(),this}getAxisLabelPadding(){return this.V_}setAxisLabelStrategy(t){return this.T_=t,this.us.bs(),this}setAxisStyle(t){return this.z_="function"==typeof t?t(this.z_):t,this.us.bs(),this}getAxisStyle(){return this.z_}setNibStyle(t){return this.O_="function"==typeof t?t(this.O_):t,this.us.bs(),this}getNibStyle(){return this.O_}setNibLength(t){return this.Dd=t,this.us.bs(),this}getNibLength(){return this.Dd}setAutoAxis(t){return this.C_=t,this}getAutoAxis(){return this.C_}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}setAxisScrollStrategy(t){return this.w_=t,this.us.bs(),this}getAxisScrollStrategy(){return this.w_}setAxisInterval(t,e=0){return this.axisScale.J(e,t),this.us.bs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg);const e=this.HS.length,i=Wh.ug(this.ng,this.eg),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.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.T_){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.w_){const t=this.J_();if(void 0!==t){const e=this.w_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.w_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.J(e,i)}}const n=u(this.pixelScale.x.getInnerStart()+(r.left+this.pixelScale.x.getInnerInterval()-r.right)/2,this.pixelScale.y.getInnerStart()+(r.bottom+this.pixelScale.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.N_=A(this.Xt.left+this.Da.left+r.left,this.Xt.top+this.Da.top+i+r.top,this.Xt.right+this.Da.right+r.right,this.Xt.bottom+this.Da.bottom+r.bottom),this.Pp(n,o);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();super.tg(),Hh.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Hh.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p()}dispose(){return this.oM.W(),this.U_.W(),this.iw.W(),this.yv.W(),this.vf.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}getMinimumSize(){return u(this.N_.left+this.N_.right+100,this.N_.bottom+this.N_.top+100)}Pp(t,e){const i=this.HS.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];rc(h,i,s,n);const u=r*((l+1)/e);h.xu(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=He(n,o[a],s);e.Ie(ri(c,u(p.paddingX,p.paddingY))).Xa(p.alignmentX).Za(p.alignmentY).Bh(l(s))}}}for(let e=f;e1;for(const s of this.HS)for(const r of this.iy){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 lc=t=>({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,..._a(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x))}),uc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,..._a(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y))});var cc;e.StepOptions=void 0,(cc=e.StepOptions||(e.StepOptions={}))[cc.before=0]="before",cc[cc.middle=.5]="middle",cc[cc.after=1]="after";const dc=(t,e)=>{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)},gc=(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=ti(ni(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]=ri(si(r,l),f[1]),f[2]=ni(f[2],si(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{if(this.wb.length>0){const e=this.wb[this.wb.length-1];if(t.length>0){const i=e.yl(),s=e.ml(),r=i.length+s.length-+e.ql();if(r>=this.Db){const n=s.length>0?s[s.length-1]:i[e.ql()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e._l(o,y(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw([o].concat(t)).Kl(!0)}else e._l(t,this.Ib)}}else t.length>0&&this.nw(t)},this.ow=t=>{if(this.hw.length>0){const e=this.hw[this.hw.length-1];t.length>0&&((e.yl().length+e.ml().length)*this.ew>=this.Db?this.aw(t):e._l(t))}else t.length>0&&this.aw(t)},this.lw=(t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=p,this.Fx=l,this.dw=f,this.fw=ce(c.pointLineSeriesFillStyle,g),this.Cu=ce(this.qi.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}Lb(){return hu(this.hw)}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;ee.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Lr(t)))),this.hw.forEach((e=>e.pl(Lr(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}ld(){return ae(this.fw)||ae(this.Cu.getFillStyle())}yd(){return this.Fx}mb(t){}Pe(t,e){t.cs(e),this.Ts.bs()}Bb(t){const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length-+this.wb[this.wb.length-1].ql():void 0;ou(t,e,this.Db,this.rw),ou(t,e,this.Db,this.ow)}aw(t,e){const i=this.Ts.Oc(this.scale)._l(t,e).setMouseInteractions(this.Yi).ke(this.fw).Sl(this.Fx).q(this.Tx).zh(this.Fa).xl(this.hl).bl(this.rl).Ml(this.nl).pl(Lr(this.sw)).cs(this.getHighlight());return this.gs(i),this.hw.push(i),i}nw(t,e){const i=this.Ts.zp(this.scale,void 0,[ka.UserSeries,...this.dw])._l(t,e).setMouseInteractions(this.Yi).Ee(this.Cu).pl(Lr(this.sw)).cs(this.getHighlight());return this.gs(i),this.wb.push(i),i}attach(t,e=!0,i=!1){return he(t,this.qi,i,{stroke:this.Cu,fill:this.fw}),super.attach(t,e,i)}getPointAmount(){return this.hw.reduce(((t,e)=>t+e.wl()+e.Cl()),this.Lu.length)}clear(){super.clear();for(let t=0;t{}))}gg(t,e,i=this.mx){const s=i?cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,this.uw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(t,e?this.hw.filter((t=>t.getIsUnderMouse())):this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==s){const t=ut(s[0],this.Ts.us.dt,this.scale),e=s[1]instanceof ln?s[1].ku():s[1].Lh(),i=s[1]instanceof Kr?s[1].Lh():void 0,r=s[1]instanceof ln?s[1].ku().getFillStyle():void 0,n=W(e)?s[0].color?new U({color:s[0].color}):new U({color:e.getFallbackColor()}):void 0;return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,t).fc(),this,r||n||i)}}solveNearestFromScreen(t,e=this.mx){return this.gg(jo(t,this.Ji.us),!1,e)}}const pc=(t,e)=>t.ml().length>=e?t.ml().slice(-e):Array.prototype.concat(t.yl(),t.ml()).slice(-e),mc=(t,e,i)=>{const s=Array.prototype.concat(t.yl(),t.ml()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Nt()._l(s).Ds()};class Ac extends yc{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._s="Spline Series",this.ew=32,this.Db=8e3,this.Aw=t=>{if(0===t.length)return;const e=this.hw.length;if(e>0){const i=e>1,s=this.hw[e-1];if(i){const i=Array.prototype.concat(s.yl(),s.ml()),r=i.length;if(32*r>=this.Db){const i=pc(s,3),r=Array.prototype.concat(i,t),n=gc(r,32);mc(this.wb[e-1],n,32),this.nw(n.slice(66))}else if(r<5){const s=this.hw[e-2],r=pc(s,3),n=Array.prototype.concat(r,i,t),o=gc(n,32),h=this.wb[e-1],a=o.slice(66);h.Nt()._l(a).Ds()}else{const i=this.wb[e-1],r=Array.prototype.concat(i.yl(),i.ml()),n=pc(s,4),o=Array.prototype.concat(n,t),h=gc(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Nt()._l(a).Ds()}}else{const i=Array.prototype.concat(s.yl(),s.ml()),r=i.length,n=this.wb[e-1];if(32*r>=this.Db){const e=pc(s,3),i=Array.prototype.concat(e,t),r=gc(i,32);mc(this.wb[0],r,32),this.nw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=gc(e,32);n.Nt()._l(s).Ds()}else n._l(t)}}else{const e=t.length>0?gc(t,32):t,i=$e(e);this.nw(e,i)}this.ow(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}Bb(t){const e=this.hw.length,i=this.hw.length>0?this.hw[e-1].yl().length+this.hw[e-1].ml().length:void 0;ou(t,i,Math.ceil(this.Db/this.ew),this.Aw)}solveNearestFromScreen(t,e=this.mx){if(e)return super.solveNearestFromScreen(jo(t,this.Ji.us),e);const i=cu(jo(t,this.Ji.us),this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==i){const t=ut(i[0],this.Ts.us.dt,this.scale);return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,t).fc(),this,i[1].Lh())}}}class xc{constructor(){this.Gi="FreeformPattern",this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()}}Pb(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}},bc=s.Record({Gl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class vc extends bc{Pb(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.pw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.bt();return t?Math.min(i,t):i},Tc=(t,e)=>{const i=e.Mt();return t?Math.max(i,t):i};class wc extends vc{gw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Tc,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Mc,e?e.min.y:void 0)}}const Ec=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},kc=(t,e)=>{const i=e.xt();return t?Math.max(i,t):i};class Cc extends vc{gw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(kc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ec,e?e.min.x:void 0)}}const Dc={horizontalProgressive:new class extends wc{constructor(){super({Gl:wr()}),this.Gi="HorizontalProgressivePattern"}pw(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].xt():void 0}getXMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",wr(Sc(t)))}},horizontalRegressive:new class extends wc{constructor(){super({Gl:Er()}),this.Gi="HorizontalRegressivePattern"}pw(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;n