Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

215 lines
107 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define(["exports","./tslib.es6"],function(h,da){function ea(a){return new t(a)}function fa(a){return Number(a)!==a}function ha(a){if(null!=a&&!n(a)){let b=Number(a);return fa(b)&&sa(a)&&""!=a?ha(a.replace(/[^0-9.\-]+/g,"")):b}return a}function ta(a){return"[object Date]"==={}.toString.call(a)}function sa(a){return"string"===typeof a}function n(a){return"number"===typeof a&&Number(a)==a}function ua(a){return"object"===typeof a&&null!==a}function V(a,b){const c=a.length;for(let d=0;d<c;++d)if(a[d]===
b)return d;return-1}function bb(a,b){const c=a.length;for(let d=0;d<c;++d)if(b(a[d]))return!0;return!1}function p(a,b){const c=a.length;for(let d=0;d<c;++d)b(a[d],d)}function W(a,b){let c=a.length;for(;0<c;)--c,b(a[c],c)}function va(a,b){let c=!1,d=0;for(;;){d=a.indexOf(b,d);if(-1===d)return c;c=!0;a.splice(d,1)}}function y(a,b){b=a.indexOf(b);return-1!==b?(a.splice(b,1),!0):!1}function wa(a,b){-1===a.indexOf(b)&&a.push(b)}function Ka(a,b){const c=a.length;for(let d=0;d<c;++d)if(b(a[d],d))return d;
return-1}function La(a,b){b=Ka(a,b);if(-1!==b)return a[b]}function cb(a,b){let c=0,d=a.length,e=!1;for(;c<d;){const f=c+d>>1,g=b(a[f]);0>g?c=f+1:0===g?(e=!0,c=f+1):d=f}return{found:e,index:e?c-1:c}}function db(a,b){let c=0,d=a.length,e=!1;for(;c<d;){const f=c+d>>1,g=b(a[f]);0>g?c=f+1:(0===g&&(e=!0),d=f)}return{found:e,index:c}}function A(a){return Object.keys(a)}function eb(a,b){return A(a).sort(b)}function u(a,b){A(a).forEach(c=>{b(c,a[c])})}function xa(a,b,c,d){a.addEventListener(b,c,d||!1);return new z(()=>
{a.removeEventListener(b,c,d||!1)})}function ia(a){switch(a){case "touchevents":return window.hasOwnProperty("TouchEvent");case "pointerevents":return window.hasOwnProperty("PointerEvent");case "mouseevents":return window.hasOwnProperty("MouseEvent");case "wheelevents":return window.hasOwnProperty("WheelEvent");case "keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function ya(a){if(!("undefined"!==typeof Touch&&a instanceof Touch))if("undefined"!==typeof PointerEvent&&a instanceof
PointerEvent&&null!=a.pointerType)switch(a.pointerType){case "touch":case "pen":case 2:break;case "mouse":case 4:return!1;default:return!(a instanceof MouseEvent)}else if(null!=a.type&&a.type.match(/^mouse/))return!1;return!0}function Ma(a,b){var c;if(c=a.target)a:for(a=a.target;;)if(b.root.dom===a){c=!0;break a}else if(null===a.parentNode)if(null==a.host){c=!1;break a}else a=a.host;else a=a.parentNode;return c}function F(a,b){return n(a)?a:null!=a&&n(a.value)&&n(b)?b*a.value:0}function ja(a,b=0,
c="0"){"string"!==typeof a&&(a=a.toString());return b>a.length?Array(b-a.length+1).join(c)+a:a}function ka(a){return a.replace(/[\s]*$/,"").replace(/^[\s]*/,"")}function fb(a,b,c=!1,d="..."){if(a.length>b){let e=b-1;for(;0<=e&&a.charAt(e).match(/\w/);)e--;return 0<=e&&0==c?a.substring(0,e+1)+"...":a.substring(0,b)+d}return a}function za(a,b){a=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()));b=a.getUTCDay()||7;a.setUTCDate(a.getUTCDate()+4-b);b=new Date(Date.UTC(a.getUTCFullYear(),0,1));
return Math.ceil(((a.getTime()-b.getTime())/864E5+1)/7)}function Na(a){var b=a.h;var c=a.s;var d=a.l;if(0==c)c=d=b=d;else{a=function(g,k,l){0>l&&(l+=1);1<l&&--l;return l<1/6?g+6*(k-g)*l:.5>l?k:l<2/3?g+(k-g)*(2/3-l)*6:g};let e=.5>d?d*(1+c):d+c-d*c,f=2*d-e;c=a(f,e,b+1/3);d=a(f,e,b);b=a(f,e,b-1/3)}return{r:Math.round(255*c),g:Math.round(255*d),b:Math.round(255*b)}}function Oa(a){let b=a.r/255,c=a.g/255;a=a.b/255;let d=Math.max(b,c,a),e=Math.min(b,c,a),f=0,g=0,k=(d+e)/2;if(d===e)f=g=0;else{let l=d-e;
g=.5<k?l/(2-d-e):l/(d+e);switch(d){case b:f=(c-a)/l+(c<a?6:0);break;case c:f=(a-b)/l+2;break;case a:f=(b-c)/l+4}f/=6}return{h:f,s:g,l:k}}function la(a,b){return Math.round((0<b?255-a:a)*b)}function gb(a,b={r:255,g:255,b:255},c={r:255,g:255,b:255}){let d=b,e=c;128<=(299*c.r+587*c.g+114*c.b)/1E3&&(d=c,e=b);return 128<=(299*a.r+587*a.g+114*a.b)/1E3?e:d}function Pa(a){"#"===a[0]&&(a=a.substr(1));3==a.length&&(a=a[0].repeat(2)+a[1].repeat(2)+a[2].repeat(2));return parseInt(a,16)}function Qa(a){return da.__awaiter(this,
void 0,void 0,function*(){if(void 0!==a){const b=[];u(a,(c,d)=>{b.push(d.waitForStop())});yield Promise.all(b)}})}function J(a,b,c){return b+a*(c-b)}function hb(a,b,c){return 1<=a?c:b}function Ra(a,b,c){return new t(J(a,b.percent,c.percent))}function ib(a,b,c){return v.interpolate(a,b,c)}function X(a,b){if(!(0<=a&&a<b))throw Error("Index out of bounds: "+a);}function Aa(a,b,c){return Math.min(Math.max(a,b),c)}function ma(a){return Math.sin(Ba*a)}function na(a){return Math.cos(Ba*a)}function Ca(a,
b){return{x:a*na(b),y:a*ma(b)}}function Sa(a){return a}function Ta(a){return a*a*a}function K(a,b){return a===b?0:a<b?-1:1}function Ua(a,b,c){const d=a.length,e=b.length,f=Math.min(d,e);for(let g=0;g<f;++g){const k=c(a[g],b[g]);if(0!==k)return k}return K(d,e)}function G(a,b){a.get("reverseChildren",!1)?a.children.eachReverse(b):a.children.each(b)}function Y(a,b){if(null!=b){b=oa.escape(""+b);let d=b.match(/\{([^}]+)\}/g),e;if(d)for(e=0;e<d.length;e++){var c=d[e].replace(/\{([^}]+)\}/,"$1");c=Da(a,
c);null==c&&(c="");b=b.split(d[e]).join(c)}b=oa.unescape(b)}else b="";return b}function Da(a,b,c){let d;c=a.dataItem;let e=[];var f=/(format[a-zA-Z]*)\((.*)\)|([^.]+)/g;let g;for(;;){g=f.exec(b);if(null===g)break;if(g[3]){e.push({prop:g[3]});var k=a.getDateFormatter().get("dateFields",[]),l=a.getNumberFormatter().get("numericFields",[]),q=a.getDurationFormatter().get("durationFields",[]);-1!==k.indexOf(g[3])?e.push({method:"formatDate",params:[]}):-1!==l.indexOf(g[3])?e.push({method:"formatNumber",
params:[]}):-1!==q.indexOf(g[3])&&e.push({method:"formatDuration",params:[]})}else{k=[];if(""!=ka(g[2]))for(l=/'([^']*)'|"([^"]*)"|([0-9\-]+)/g;;){q=l.exec(g[2]);if(null===q)break;k.push(q[1]||q[2]||q[3])}e.push({method:g[1],params:k})}}if(c){d=L(a,e,c._settings);if(null==d||ua(d))d=L(a,e,c);f=c.dataContext;null==d&&f&&(d=L(a,e,f),null==d&&(d=L(a,[{prop:b}],f)),null==d&&f.dataContext&&(d=L(a,e,f.dataContext)));null==d&&c.component&&c.component.dataItem!==c&&(d=Da(c.component,b))}null==d&&(d=L(a,e,
a));null==d&&a.parent&&(d=Da(a.parent,b));return d}function L(a,b,c,d){let e=c,f=!1;for(let l=0,q=b.length;l<q;l++){let m=b[l];if(m.prop){if(e instanceof B){var g=e.get(m.prop);null==g&&(g=e.getPrivate(m.prop));if(null==g){g=m.prop;var k=e.getPrivate("customData");g=ua(k)?k[g]:void 0}null==g&&(g=e[m.prop]);e=g}else e.get?(g=e.get(m.prop),null==g&&(g=e[m.prop]),e=g):e=e[m.prop];if(null==e)return}else switch(m.method){case "formatNumber":g=ha(e);null!=g&&(e=a.getNumberFormatter().format(g,m.params[0]||
void 0),f=!0);break;case "formatDate":g=e;ta(g)||n(g)?g=new Date(g):(k=Number(g),g=n(k)?new Date(k):new Date(g));if(!ta(g)||fa(g.getTime()))return;null!=g&&(e=a.getDateFormatter().format(g,m.params[0]||void 0),f=!0);break;case "formatDuration":g=ha(e);null!=g&&(e=a.getDurationFormatter().format(g,m.params[0]||void 0,m.params[1]||void 0),f=!0);break;case "urlEncode":case "encodeURIComponent":e=encodeURIComponent(e);break;default:e[m.method]&&e[m.method].apply(c,m.params)}}f||(b=[{method:"",params:d}],
n(e)?(b[0].method="formatNumber",b[0].params=""):ta(e)&&(b[0].method="formatDate",b[0].params=""),b[0].method&&(e=L(a,b,e)));return e}class t{constructor(a){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._value=a}get value(){return this._value/100}get percent(){return this._value}toString(){return""+this._value+"%"}interpolate(a,b){return a+this.value*(b-a)}static normalize(a,b,c){return a instanceof t?a:b===c?new t(0):new t(100*Math.min(Math.max(1/
(c-b)*(a-b),0),1))}}const jb=ea(0),Va=ea(100),Wa=ea(50);class Ea{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class z{constructor(a){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0});
this._disposed=!1;this._dispose=a}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class kb extends Ea{constructor(){super(...arguments);Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){p(this._disposers,a=>{a.dispose()})}}class C extends Ea{constructor(a){super();Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._disposers=a}_dispose(){p(this._disposers,
a=>{a.dispose()})}get disposers(){return this._disposers}}class Xa extends z{constructor(){super(...arguments);Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){++this._counter;return new z(()=>{--this._counter;0===this._counter&&this.dispose()})}}class v{constructor(a){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._hex=a|0}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>
8&255}get b(){return this._hex&255}toCSS(a=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+a+")"}toCSSHex(){return"#"+ja(this.r.toString(16),2)+ja(this.g.toString(16),2)+ja(this.b.toString(16),2)}toHSL(a=1){return Oa({r:this.r,g:this.g,b:this.b,a})}static fromHSL(a,b,c){a=Na({h:a,s:b,l:c});return this.fromRGB(a.r,a.g,a.b)}toString(){return this.toCSSHex()}static fromHex(a){return new v(a)}static fromRGB(a,b,c){return new v((c|0)+(b<<8)+(a<<16))}static fromString(a){return new v(Pa(a))}static fromCSS(a){a:{var b=
a.replace(/[ ]/g,"");if(a=b.match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i))a.push("1");else if(a=b.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!a){a=0;break a}b="";for(let c=1;3>=c;c++){let d=parseInt(a[c]).toString(16);1==d.length&&(d="0"+d);b+=d}a=Pa(b)}return new v(a)}static fromAny(a){if(sa(a)){if("#"==a[0])return v.fromString(a);if("rgb"==a.substr(0,3))return v.fromCSS(a)}else{if(n(a))return v.fromHex(a);if(a instanceof v)return v.fromHex(a.hex)}throw Error("Unknown color syntax: "+
a);}static alternative(a,b,c){a=gb({r:a.r,g:a.g,b:a.b},b?{r:b.r,g:b.g,b:b.b}:void 0,c?{r:c.r,g:c.g,b:c.b}:void 0);return this.fromRGB(a.r,a.g,a.b)}static interpolate(a,b,c,d="rgb"){return"hsl"==d?(b=b.toHSL(),c=c.toHSL(),v.fromHSL(J(a,b.h,c.h),J(a,b.s,c.s),J(a,b.l,c.l))):v.fromRGB(J(a,b.r,c.r),J(a,b.g,c.g),J(a,b.b,c.b))}static lighten(a,b){b=(a={r:a.r,g:a.g,b:a.b},{r:Math.max(0,Math.min(255,a.r+la(a.r,b))),g:Math.max(0,Math.min(255,a.g+la(a.g,b))),b:Math.max(0,Math.min(255,a.b+la(a.b,b))),a:a.a});
return v.fromRGB(b.r,b.g,b.b)}static brighten(a,b){var c=a.r;var d=a.g;a=a.b;b=la(Math.min(Math.max(c,d,a),230),b);c=Math.max(0,Math.min(255,Math.round(c+b)));d=Math.max(0,Math.min(255,Math.round(d+b)));a=Math.max(0,Math.min(255,Math.round(a+b)));return v.fromRGB(c,d,a)}static saturate(a,b){a={r:a.r,g:a.g,b:a.b};void 0===a||1==b?b=a:(a=Oa(a),a.s=b,b=Na(a));return v.fromRGB(b.r,b.g,b.b)}}class P{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0});
Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._listeners=[];
this._killed=[];this._disabled={};this._iterating=0;this._enabled=!0;this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const a=this._listeners;this._iterating=1;this._disabled=this._listeners=null;try{p(a,b=>{b.disposer.dispose()})}finally{this._iterating=this._killed=null}}}hasListeners(){return 0!==this._listeners.length}hasListenersByType(a){return bb(this._listeners,b=>(null===b.type||b.type===a)&&!b.killed)}enable(){this._enabled=!0}disable(){this._enabled=
!1}enableType(a){delete this._disabled[a]}disableType(a,b=Infinity){this._disabled[a]=b}_removeListener(a){if(0===this._iterating){a=this._listeners.indexOf(a);if(-1===a)throw Error("Invalid state: could not remove listener");this._listeners.splice(a,1)}else this._killed.push(a)}_removeExistingListener(a,b,c,d){if(this._disposed)throw Error("EventDispatcher is disposed");this._eachListener(e=>{e.once!==a||e.type!==b||void 0!==c&&e.callback!==c||e.context!==d||e.disposer.dispose()})}isEnabled(a){if(this._disposed)throw Error("EventDispatcher is disposed");
return this._enabled&&0<this._listeners.length&&this.hasListenersByType(a)&&void 0===this._disabled[a]}removeType(a){if(this._disposed)throw Error("EventDispatcher is disposed");this._eachListener(b=>{b.type===a&&b.disposer.dispose()})}has(a,b,c){return-1!==Ka(this._listeners,d=>!0!==d.once&&d.type===a&&(void 0===b||d.callback===b)&&d.context===c)}_shouldDispatch(a){if(this._disposed)throw Error("EventDispatcher is disposed");const b=this._disabled[a];return n(b)?(1>=b?delete this._disabled[a]:--this._disabled[a],
!1):this._enabled}_eachListener(a){++this._iterating;try{p(this._listeners,a)}finally{--this._iterating,0===this._iterating&&0!==this._killed.length&&(p(this._killed,b=>{this._removeListener(b)}),this._killed.length=0)}}dispatch(a,b){this._shouldDispatch(a)&&this._eachListener(c=>{c.killed||null!==c.type&&c.type!==a||c.dispatch(a,b)})}_on(a,b,c,d,e,f){if(this._disposed)throw Error("EventDispatcher is disposed");this._removeExistingListener(a,b,c,d);const g={type:b,callback:c,context:d,shouldClone:e,
dispatch:f,killed:!1,once:a,disposer:new z(()=>{g.killed=!0;this._removeListener(g)})};this._listeners.push(g);return g}onAll(a,b,c=!0){return this._on(!1,null,a,b,c,(d,e)=>a.call(b,e)).disposer}on(a,b,c,d=!0){return this._on(!1,a,b,c,d,(e,f)=>b.call(c,f)).disposer}once(a,b,c,d=!0){const e=this._on(!0,a,b,c,d,(f,g)=>{e.disposer.dispose();b.call(c,g)});return e.disposer}off(a,b,c){this._removeExistingListener(!1,a,b,c)}copyFrom(a){if(this._disposed)throw Error("EventDispatcher is disposed");if(a===
this)throw Error("Cannot copyFrom the same TargetedEventDispatcher");const b=[];p(a._listeners,c=>{!c.killed&&c.shouldClone&&(null===c.type?b.push(this.onAll(c.callback,c.context)):c.once?b.push(this.once(c.type,c.callback,c.context)):b.push(this.on(c.type,c.callback,c.context)))});return new C(b)}}h.AnimationState=void 0;(function(a){a[a.Stopped=0]="Stopped";a[a.Playing=1]="Playing";a[a.Paused=2]="Paused"})(h.AnimationState||(h.AnimationState={}));class Fa{constructor(a=[]){Object.defineProperty(this,
"_values",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new P});this._values=a}get values(){return this._values}contains(a){return-1!==this._values.indexOf(a)}removeValue(a){let b=0,c=this._values.length;for(;b<c;)this._values[b]===a?(this.removeIndex(b),--c):++b}indexOf(a){return V(this._values,a)}get length(){return this._values.length}hasIndex(a){return 0<=a&&a<this._values.length}getIndex(a){return this._values[a]}_onPush(a){this.events.isEnabled("push")&&
this.events.dispatch("push",{type:"push",target:this,newValue:a})}_onInsertIndex(a,b){this.events.isEnabled("insertIndex")&&this.events.dispatch("insertIndex",{type:"insertIndex",target:this,index:a,newValue:b})}_onSetIndex(a,b,c){this.events.isEnabled("setIndex")&&this.events.dispatch("setIndex",{type:"setIndex",target:this,index:a,oldValue:b,newValue:c})}_onRemoveIndex(a,b){this.events.isEnabled("removeIndex")&&this.events.dispatch("removeIndex",{type:"removeIndex",target:this,index:a,oldValue:b})}_onMoveIndex(a,
b,c){this.events.isEnabled("moveIndex")&&this.events.dispatch("moveIndex",{type:"moveIndex",target:this,oldIndex:a,newIndex:b,value:c})}_onClear(a){this.events.isEnabled("clear")&&this.events.dispatch("clear",{type:"clear",target:this,oldValues:a})}setIndex(a,b){X(a,this._values.length);const c=this._values[a];c!==b&&(this._values[a]=b,this._onSetIndex(a,c,b));return c}insertIndex(a,b){X(a,this._values.length+1);this._values.splice(a,0,b);this._onInsertIndex(a,b);return b}swap(a,b){var c=this._values.length;
X(a,c);X(b,c);if(a!==b){c=this._values[a];const d=this._values[b];this._values[a]=d;this._onSetIndex(a,c,d);this._values[b]=c;this._onSetIndex(b,d,c)}}removeIndex(a){X(a,this._values.length);const b=this._values[a];this._values.splice(a,1);this._onRemoveIndex(a,b);return b}moveValue(a,b){let c=this.indexOf(a);-1!==c?(this._values.splice(c,1),null==b?(b=this._values.length,this._values.push(a),this._onMoveIndex(c,b,a)):(this._values.splice(b,0,a),this._onMoveIndex(c,b,a))):null==b?(this._values.push(a),
this._onPush(a)):(this._values.splice(b,0,a),this._onInsertIndex(b,a));return a}push(a){this._values.push(a);this._onPush(a);return a}unshift(a){this.insertIndex(0,a);return a}pushAll(a){p(a,b=>{this.push(b)})}copyFrom(a){this.pushAll(a._values)}pop(){return 0>this._values.length-1?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(a){const b=this._values;this._values=[];this._onClear(b);p(a,c=>{this._values.push(c);this._onPush(c)})}clear(){this.setAll([])}*[Symbol.iterator](){const a=
this._values.length;for(let b=0;b<a;++b)yield this._values[b]}each(a){p(this._values,a)}eachReverse(a){W(this._values,a)}}class Ya extends Fa{constructor(){super(...arguments);Object.defineProperty(this,"autoDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0});Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_onSetIndex(a,b,c){this.autoDispose&&b.dispose();super._onSetIndex(a,b,c)}_onRemoveIndex(a,b){this.autoDispose&&b.dispose();super._onRemoveIndex(a,
b)}_onClear(a){this.autoDispose&&p(a,b=>{b.dispose()});super._onClear(a)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&p(this._values,a=>{a.dispose()}))}}class lb extends Ya{constructor(a,b){super();Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this.template=a;this.make=b}}class mb extends Fa{constructor(a){super();
Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._container=a;this._events=this.events.onAll(b=>{if("clear"===b.type)p(b.oldValues,c=>{this._onRemoved(c)});else if("push"===b.type)this._onInserted(b.newValue);else if("setIndex"===b.type)this._onRemoved(b.oldValue),
this._onInserted(b.newValue,b.index);else if("insertIndex"===b.type)this._onInserted(b.newValue,b.index);else if("removeIndex"===b.type)this._onRemoved(b.oldValue);else if("moveIndex"===b.type)this._onRemoved(b.value),this._onInserted(b.value,b.newIndex);else throw Error("Unknown IListEvent type");})}_onInserted(a,b){a._setParent(this._container,!0);const c=this._container._childrenDisplay;void 0===b?c.addChild(a._display):c.addChildAt(a._display,b)}_onRemoved(a){this._container._childrenDisplay.removeChild(a._display);
this._container.markDirtyBounds();this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),p(this.values,a=>{a.dispose()}))}}const Za=Math.PI,Ba=Za/180,nb=180/Za;class ob{constructor(a,b){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_userSettings",{enumerable:!0,
configurable:!0,writable:!0,value:{}});this._entity=a;this._settings=b;u(b,c=>{this._userSettings[c]=!0})}get(a,b){a=this._settings[a];return void 0!==a?a:b}setRaw(a,b){this._settings[a]=b}set(a,b){this._userSettings[a]=!0;this.setRaw(a,b)}remove(a){delete this._userSettings[a];delete this._settings[a]}setAll(a){A(a).forEach(b=>{this.set(b,a[b])})}_eachSetting(a){u(this._settings,a)}apply(){const a={stateAnimationEasing:!0,stateAnimationDuration:!0},b=this._entity.states.lookup("default");this._eachSetting((c,
d)=>{a[c]||(a[c]=!0,this!==b&&(c in b._settings||(b._settings[c]=this._entity.get(c))),this._entity.set(c,d))})}applyAnimate(a){null==a&&(a=this._settings.stateAnimationDuration);null==a&&(a=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let b=this._settings.stateAnimationEasing;null==b&&(b=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ta)));const c=this._entity.states.lookup("default"),d={stateAnimationEasing:!0,stateAnimationDuration:!0},
e={};this._eachSetting((f,g)=>{d[f]||(d[f]=!0,this!=c&&(f in c._settings||(c._settings[f]=this._entity.get(f))),(g=this._entity.animate({key:f,to:g,duration:a,easing:b}))&&(e[f]=g))});return e}}class pb{constructor(a){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._entity=a}lookup(a){return this._states[a]}create(a,b){const c=this._states[a];if(c)return c.setAll(b),
c;b=new ob(this._entity,b);return this._states[a]=b}remove(a){delete this._states[a]}apply(a){const b=this._states[a];b&&b.apply();this._entity._applyState(a)}applyAnimate(a,b){let c;const d=this._states[a];d&&(c=d.applyAnimate(b));this._entity._applyStateAnimated(a,b);return c}}class qb{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.9.10"});Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,
"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const M=new qb;class rb{constructor(a){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:{}});this._entity=a}add(a,
b){let c=this._callbacks[a];void 0===c&&(c=this._callbacks[a]=[]);c.push(b);this._entity._markDirtyKey(a);return new z(()=>{y(c,b)&&this._entity._markDirtyKey(a)})}remove(a){const b=this._callbacks[a];void 0!==b&&(delete this._callbacks[a],0!==b.length&&this._entity._markDirtyKey(a))}enable(a){this._disabled[a]&&(delete this._disabled[a],this._entity._markDirtyKey(a))}disable(a){this._disabled[a]||(this._disabled[a]=!0,this._entity._markDirtyKey(a))}fold(a,b){if(!this._disabled[a]){const c=this._callbacks[a];
if(void 0!==c)for(let d=0,e=c.length;d<e;++d)b=c[d](b,this._entity,a)}return b}}class pa{constructor(a,b,c,d,e,f,g){Object.defineProperty(this,"_animation",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_from",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_to",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_duration",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,
"_easing",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_loops",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_interpolate",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_oldTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_time",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_stopped",{enumerable:!0,configurable:!0,
writable:!0,value:!1});Object.defineProperty(this,"_playing",{enumerable:!0,configurable:!0,writable:!0,value:!0});Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new P});this._animation=a;this._from=b;this._to=c;this._duration=d;this._easing=e;this._loops=f;this._interpolate="number"===typeof b&&"number"===typeof c?J:b instanceof t&&c instanceof t?Ra:b instanceof v&&c instanceof v?ib:hb;this._oldTime=g}get to(){return this._to}get from(){return this._from}get playing(){return this._playing}get stopped(){return this._stopped}stop(){this._stopped||
(this._stopped=!0,this._playing=!1,this.events.isEnabled("stopped")&&this.events.dispatch("stopped",{type:"stopped",target:this}))}pause(){this._playing=!1;this._oldTime=null}play(){this._stopped||this._playing||(this._playing=!0,this._animation._startAnimation())}get percentage(){return this._time/this._duration}waitForStop(){return new Promise((a,b)=>{if(this._stopped)a();else{const c=this.events.on("stopped",()=>{c.dispose();a()})}})}_checkEnded(){return 1<this._loops?(--this._loops,!1):!0}_run(a){null!==
this._oldTime&&(this._time+=a-this._oldTime,this._time>this._duration&&(this._time=this._duration));this._oldTime=a}_reset(a){this._oldTime=a;this._time=0}_value(a){return this._interpolate(this._easing(a),this._from,this._to)}}let sb=0;class $a{constructor(a){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++sb});Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_privateSettings",{enumerable:!0,
configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_animatingSettings",{enumerable:!0,
configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}});this._settings=a}_checkDirty(){A(this._settings).forEach(a=>{this._userProperties[a]=!0;this._markDirtyKey(a)})}resetUserSettings(){this._userProperties={}}_runAnimation(a){let b=
h.AnimationState.Stopped;if(!this.isDisposed()){let c=!1,d=!1;u(this._animatingSettings,(e,f)=>{if(f.stopped)this._stopAnimation(e);else if(f.playing){f._run(a);const g=f.percentage;1<=g?f._checkEnded()?this.set(e,f._value(1)):(c=!0,f._reset(a),this._set(e,f._value(1))):(c=!0,this._set(e,f._value(g)))}else d=!0});u(this._animatingPrivateSettings,(e,f)=>{if(f.stopped)this._stopAnimationPrivate(e);else if(f.playing){f._run(a);const g=f.percentage;1<=g?f._checkEnded()?this.setPrivate(e,f._value(1)):
(c=!0,f._reset(a),this._setPrivate(e,f._value(1))):(c=!0,this._setPrivate(e,f._value(g)))}else d=!0});c?b=h.AnimationState.Playing:d&&(b=h.AnimationState.Paused)}return b}_markDirtyKey(a){this.markDirty()}_markDirtyPrivateKey(a){this.markDirty()}on(a,b){let c=this._settingEvents[a];void 0===c&&(c=this._settingEvents[a]=[]);c.push(b);return new z(()=>{y(c,b);0===c.length&&delete this._settingEvents[a]})}off(a,b){let c=this._settingEvents[a];void 0!==c&&void 0!==b?y(c,b):delete this._settingEvents[a]}onPrivate(a,
b){let c=this._privateSettingEvents[a];void 0===c&&(c=this._privateSettingEvents[a]=[]);c.push(b);return new z(()=>{y(c,b);0===c.length&&delete this._privateSettingEvents[a]})}offPrivate(a,b){let c=this._privateSettingEvents[a];void 0!==c&&void 0!==b?y(c,b):delete this._privateSettingEvents[a]}getRaw(a,b){a=this._settings[a];return void 0!==a?a:b}has(a){return a in this._settings}get(a,b){return this.getRaw(a,b)}_sendKeyEvent(a,b){const c=this._settingEvents[a];void 0!==c&&p(c,d=>{d(b,this,a)})}_sendPrivateKeyEvent(a,
b){const c=this._privateSettingEvents[a];void 0!==c&&p(c,d=>{d(b,this,a)})}_setRaw(a,b,c){this._prevSettings[a]=b;this._sendKeyEvent(a,c)}setRaw(a,b){const c=this._settings[a];this._settings[a]=b;c!==b&&this._setRaw(a,c,b)}_set(a,b){const c=this._settings[a];this._settings[a]=b;c!==b&&(this._setRaw(a,c,b),this._markDirtyKey(a))}_stopAnimation(a){const b=this._animatingSettings[a];b&&(delete this._animatingSettings[a],b.stop())}set(a,b){this._set(a,b);this._stopAnimation(a);return b}remove(a){a in
this._settings&&(this._prevSettings[a]=this._settings[a],delete this._settings[a],this._sendKeyEvent(a,void 0),this._markDirtyKey(a));this._stopAnimation(a)}removeAll(){p(A(this._settings),a=>{this.remove(a)})}getPrivate(a,b){a=this._privateSettings[a];return void 0!==a?a:b}_setPrivateRaw(a,b,c){this._prevPrivateSettings[a]=b;this._sendPrivateKeyEvent(a,c)}setPrivateRaw(a,b){const c=this._privateSettings[a];this._privateSettings[a]=b;c!==b&&this._setPrivateRaw(a,c,b)}_setPrivate(a,b){const c=this._privateSettings[a];
this._privateSettings[a]=b;c!==b&&(this._setPrivateRaw(a,c,b),this._markDirtyPrivateKey(a))}_stopAnimationPrivate(a){const b=this._animatingPrivateSettings[a];b&&(b.stop(),delete this._animatingPrivateSettings[a])}setPrivate(a,b){this._setPrivate(a,b);this._stopAnimationPrivate(a);return b}removePrivate(a){a in this._privateSettings&&(this._prevPrivateSettings[a]=this._privateSettings[a],delete this._privateSettings[a],this._markDirtyPrivateKey(a));this._stopAnimationPrivate(a)}setAll(a){u(a,(b,c)=>
{this.set(b,c)})}animate(a){var b=a.key;const c=a.to,d=a.duration||0,e=a.loops||1,f=void 0===a.from?this.get(b):a.from;a=void 0===a.easing?Sa:a.easing;if(0===d)this.set(b,c);else if(void 0===f||f===c)this.set(b,c);else return this.set(b,f),b=this._animatingSettings[b]=new pa(this,f,c,d,a,e,this._animationTime()),this._startAnimation(),b;b=new pa(this,f,c,d,a,e,null);b.stop();return b}animatePrivate(a){var b=a.key;const c=a.to,d=a.duration||0,e=a.loops||1,f=void 0===a.from?this.getPrivate(b):a.from;
a=void 0===a.easing?Sa:a.easing;if(0===d)this.setPrivate(b,c);else if(void 0===f||f===c)this.setPrivate(b,c);else return this.setPrivate(b,f),b=this._animatingPrivateSettings[b]=new pa(this,f,c,d,a,e,this._animationTime()),this._startAnimation(),b;b=new pa(this,f,c,d,a,e,null);b.stop();return b}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class H extends $a{constructor(a,b,c,d=[]){super(b);Object.defineProperty(this,"_root",{enumerable:!0,
configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new pb(this)});Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new rb(this)});Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()});Object.defineProperty(this,"_userPrivateProperties",
{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,
writable:!0,value:void 0});Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0});Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,
value:{}});if(!c)throw Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=a;this._internalTemplates=d;b.id&&this._registerId(b.id)}static new(a,b,c){a=new this(a,b,!0);a._template=c;a._afterNew();return a}static _new(a,b,c=[]){a=new this(a,b,!0,c);a._afterNew();return a}_afterNew(){this._checkDirty();let a=!1;const b=this._template;b&&(a=!0,b._setObjectTemplate(this));p(this._internalTemplates,c=>{a=!0;c._setObjectTemplate(this)});a&&this._applyTemplates(!1);this.states.create("default",
{});this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const a=this._template;a&&a._setObjectTemplate(this);p(this._internalTemplates,b=>{b._setObjectTemplate(this)});this.states.create("default",{});this._setDefaults();this._applyThemes()}_createEvents(){return new P}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(a,b){const c=this.get(a);if(c)return c;b=b();this.set(a,b);return b}_setDefault(a,b){this.has(a)||
super.set(a,b)}_setRawDefault(a,b){this.has(a)||super.setRaw(a,b)}_clearDirty(){A(this._dirty).forEach(a=>{this._dirty[a]=!1});A(this._dirtyPrivate).forEach(a=>{this._dirtyPrivate[a]=!1})}isDirty(a){return!!this._dirty[a]}isPrivateDirty(a){return!!this._dirtyPrivate[a]}_markDirtyKey(a){this._dirty[a]=!0;super._markDirtyKey(a)}_markDirtyPrivateKey(a){this._dirtyPrivate[a]=!0;super._markDirtyKey(a)}isType(a){return-1!==this.classNames.indexOf(a)}_pushPropertyDisposer(a,b){let c=this._disposerProperties[a];
void 0===c&&(c=this._disposerProperties[a]=[]);c.push(b);return b}_disposeProperty(a){const b=this._disposerProperties[a];void 0!==b&&(p(b,c=>{c.dispose()}),delete this._disposerProperties[a])}set template(a){const b=this._template;b!==a&&(this._template=a,b&&b._removeObjectTemplate(this),a&&a._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(a){}_applyStateAnimated(a,
b){}get(a,b){a=this.adapters.fold(a,this._settings[a]);return void 0!==a?a:b}isUserSetting(a){return this._userProperties[a]||!1}set(a,b){this._userProperties[a]=!0;return super.set(a,b)}setRaw(a,b){this._userProperties[a]=!0;super.setRaw(a,b)}_setSoft(a,b){return this._userProperties[a]?b:super.set(a,b)}remove(a){delete this._userProperties[a];this._removeTemplateProperty(a)}setPrivate(a,b){this._userPrivateProperties[a]=!0;return super.setPrivate(a,b)}setPrivateRaw(a,b){this._userPrivateProperties[a]=
!0;super.setPrivateRaw(a,b)}removePrivate(a){delete this._userPrivateProperties[a];this._removeTemplatePrivateProperty(a)}_setTemplateProperty(a,b,c){if(!this._userProperties[b]){const d=this._findTemplateByKey(b);a===d&&super.set(b,c)}}_setTemplatePrivateProperty(a,b,c){if(!this._userPrivateProperties[b]){const d=this._findTemplateByPrivateKey(b);a===d&&super.setPrivate(b,c)}}_removeTemplateProperty(a){if(!this._userProperties[a]){const b=this._findTemplateByKey(a);b?super.set(a,b._settings[a]):
super.remove(a)}}_removeTemplatePrivateProperty(a){if(!this._userPrivateProperties[a]){const b=this._findTemplateByPrivateKey(a);b?super.setPrivate(a,b._privateSettings[a]):super.removePrivate(a)}}_walkParents(a){a(this._root._rootContainer);a(this)}_applyStateByKey(a){const b=this.states.create(a,{}),c={};this._eachTemplate(d=>{(d=d.states.lookup(a))&&d._apply(b,c)});u(b._settings,d=>{c[d]||b._userSettings[d]||b.remove(d)})}_applyTemplate(a,b){this._templateDisposers.push(a._apply(this,b));u(a._settings,
(c,d)=>{b.settings[c]||this._userProperties[c]||(b.settings[c]=!0,super.set(c,d))});u(a._privateSettings,(c,d)=>{b.privateSettings[c]||this._userPrivateProperties[c]||(b.privateSettings[c]=!0,super.setPrivate(c,d))});this._runSetup&&a.setup&&(this._runSetup=!1,a.setup(this))}_findStaticTemplate(a){if(this._template&&a(this._template))return this._template}_eachTemplate(a){this._findStaticTemplate(b=>{a(b);return!1});W(this._internalTemplates,a);p(this._templates,a)}_applyTemplates(a=!0){a&&this._disposeTemplates();
const b={settings:{},privateSettings:{},states:{}};this._eachTemplate(c=>{this._applyTemplate(c,b)});a&&(u(this._settings,c=>{this._userProperties[c]||b.settings[c]||super.remove(c)}),u(this._privateSettings,c=>{this._userPrivateProperties[c]||b.privateSettings[c]||super.removePrivate(c)}))}_findTemplate(a){var b=this._findStaticTemplate(a);if(void 0===b){b=this._internalTemplates;var c;b:{for(c=b.length;0<c;)if(--c,a(b[c],c))break b;c=-1}b=-1!==c?b[c]:void 0;return void 0===b?La(this._templates,
a):b}return b}_findTemplateByKey(a){return this._findTemplate(b=>a in b._settings)}_findTemplateByPrivateKey(a){return this._findTemplate(b=>a in b._privateSettings)}_disposeTemplates(){p(this._templateDisposers,a=>{a.dispose()});this._templateDisposers.length=0}_removeTemplates(){p(this._templates,a=>{a._removeObjectTemplate(this)});this._templates.length=0}_applyThemes(a=!1){let b=!1;const c=[];let d=[];const e=new Set,f=this.get("themeTagsSelf");f&&p(f,g=>{e.add(g)});this._walkParents(g=>{g===
this._root._rootContainer&&(b=!0);0<g._defaultThemes.length&&c.push(g._defaultThemes);const k=g.get("themes");k&&d.push(k);(g=g.get("themeTags"))&&p(g,l=>{e.add(l)})});d=c.concat(d);this._removeTemplates();(b||a)&&W(this.classNames,g=>{const k=[];p(d,l=>{p(l,q=>{(q=q._lookupRules(g))&&W(q,m=>{if(m.tags.every(w=>e.has(w))){const w=db(k,r=>{const x=K(m.tags.length,r.tags.length);return 0===x?Ua(m.tags,r.tags,K):x});k.splice(w.index,0,m)}})})});p(k,l=>{this._templates.push(l.template);l.template._setObjectTemplate(this)})});
this._applyTemplates();if(b||a)this._runSetup=!1;return b||a}_changed(){}_beforeChanged(){if(this.isDirty("id")){var a=this.get("id");a&&this._registerId(a);(a=this._prevSettings.id)&&delete M.entitiesById[a]}}_registerId(a){if(M.entitiesById[a]&&M.entitiesById[a]!==this)throw Error('An entity with id "'+a+'" already exists.');M.entitiesById[a]=this}_afterChanged(){}addDisposer(a){this._disposers.push(a);return a}_dispose(){super._dispose();var a=this._template;a&&a._removeObjectTemplate(this);p(this._internalTemplates,
b=>{b._removeObjectTemplate(this)});this._removeTemplates();this._disposeTemplates();this.events.dispose();this._disposers.forEach(b=>{b.dispose()});u(this._disposerProperties,(b,c)=>{p(c,d=>{d.dispose()})});(a=this.get("id"))&&delete M.entitiesById[a]}setTimeout(a,b){const c=setTimeout(()=>{this.removeDispose(d);a()},b),d=new z(()=>{clearTimeout(c)});this._disposers.push(d);return d}removeDispose(a){if(!this.isDisposed()){let b=V(this._disposers,a);-1<b&&this._disposers.splice(b,1)}a.dispose()}hasTag(a){return-1!==
V(this.get("themeTags",[]),a)}addTag(a){if(!this.hasTag(a)){const b=this.get("themeTags",[]);b.push(a);this.set("themeTags",b)}}removeTag(a){if(this.hasTag(a)){const b=this.get("themeTags",[]);va(b,a);this.set("themeTags",b)}}_t(a,b,...c){return this._root.language.translate(a,b,...c)}get root(){return this._root}}Object.defineProperty(H,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"});Object.defineProperty(H,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});
class tb{constructor(a,b,c){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._name=a;this._template=b;this._settings=c}get(a,b){a=this._settings[a];return void 0!==a?a:b}set(a,b){this._settings[a]=b;this._template._stateChanged(this._name)}remove(a){delete this._settings[a];
this._template._stateChanged(this._name)}setAll(a){A(a).forEach(b=>{this._settings[b]=a[b]});this._template._stateChanged(this._name)}_apply(a,b){u(this._settings,(c,d)=>{b[c]||a._userSettings[c]||(b[c]=!0,a.setRaw(c,d))})}}class ub{constructor(a){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}});this._template=a}lookup(a){return this._states[a]}create(a,b){const c=
this._states[a];if(c)return c.setAll(b),c;b=new tb(a,this._template,b);this._states[a]=b;this._template._stateChanged(a);return b}remove(a){delete this._states[a];this._template._stateChanged(a)}_apply(a,b){u(this._states,(c,d)=>{let e=b.states[c];null==e&&(e=b.states[c]={});c=a.states.create(c,{});d._apply(c,e)})}}class vb{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(a,b){let c=this._callbacks[a];void 0===c&&(c=this._callbacks[a]=
[]);c.push(b);return new z(()=>{y(c,b);0===c.length&&delete this._callbacks[a]})}remove(a){void 0!==this._callbacks[a]&&delete this._callbacks[a]}_apply(a){const b=[];u(this._callbacks,(c,d)=>{p(d,e=>{b.push(a.adapters.add(c,e))})});return new C(b)}}class Z{constructor(a,b){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_settingEvents",
{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new ub(this)});Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new vb});Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,
writable:!0,value:new P});Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0});if(!b)throw Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=a}static new(a){return new Z(a,!0)}get entities(){return this._entities}get(a,b){a=this._settings[a];return void 0!==a?a:b}setRaw(a,b){this._settings[a]=b}set(a,b){this._settings[a]!==b&&(this.setRaw(a,b),this._entities.forEach(c=>{c._setTemplateProperty(this,a,b)}))}remove(a){a in this._settings&&
(delete this._settings[a],this._entities.forEach(b=>{b._removeTemplateProperty(a)}))}removeAll(){u(this._settings,(a,b)=>{this.remove(a)})}getPrivate(a,b){a=this._privateSettings[a];return void 0!==a?a:b}setPrivateRaw(a,b){return this._privateSettings[a]=b}setPrivate(a,b){this._privateSettings[a]!==b&&(this.setPrivateRaw(a,b),this._entities.forEach(c=>{c._setTemplatePrivateProperty(this,a,b)}));return b}removePrivate(a){a in this._privateSettings&&(delete this._privateSettings[a],this._entities.forEach(b=>
{b._removeTemplatePrivateProperty(a)}))}setAll(a){u(a,(b,c)=>{this.set(b,c)})}on(a,b){let c=this._settingEvents[a];void 0===c&&(c=this._settingEvents[a]=[]);c.push(b);return new z(()=>{y(c,b);0===c.length&&delete this._settingEvents[a]})}onPrivate(a,b){let c=this._privateSettingEvents[a];void 0===c&&(c=this._privateSettingEvents[a]=[]);c.push(b);return new z(()=>{y(c,b);0===c.length&&delete this._privateSettingEvents[a]})}_apply(a,b){const c=[];u(this._settingEvents,(d,e)=>{p(e,f=>{c.push(a.on(d,
f))})});u(this._privateSettingEvents,(d,e)=>{p(e,f=>{c.push(a.onPrivate(d,f))})});this.states._apply(a,b);c.push(this.adapters._apply(a));c.push(a.events.copyFrom(this.events));return new C(c)}_setObjectTemplate(a){this._entities.push(a)}_removeObjectTemplate(a){va(this._entities,a)}_stateChanged(a){this._entities.forEach(b=>{b._applyStateByKey(a)})}}class Ga extends P{constructor(a){super();Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,
"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0});this._sprite=a}_makePointerEvent(a,b){return{type:a,originalEvent:b.event,point:b.point,simulated:b.simulated,native:b.native,target:this._sprite}}_onRenderer(a,b){this._sprite.set("interactive",!0);this._sprite._display.interactive=!0;let c=this._rendererDisposers[a];if(void 0===c){const d=this._sprite._display.on(a,e=>{b.call(this,
e)});c=this._rendererDisposers[a]=new Xa(()=>{delete this._rendererDisposers[a];d.dispose()})}return c.increment()}_on(a,b,c,d,e,f){a=super._on(a,b,c,d,e,f);c=Ga.RENDERER_EVENTS[b];void 0!==c&&(a.disposer=new C([a.disposer,this._onRenderer(b,c)]));return a}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(a,b){const c=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(a,b),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(a,b)}finally{this._dispatchParents=
c}}}Object.defineProperty(Ga,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(a){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",a))&&this.dispatch("click",this._makePointerEvent("click",a))},rightclick:function(a){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",a))},middleclick:function(a){this.isEnabled("middleclick")&&this.dispatch("middleclick",
this._makePointerEvent("middleclick",a))},dblclick:function(a){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",a))},pointerover:function(a){const b=this._sprite;let c=!0;if(b.getPrivate("trustBounds")){b._getBounds();var d=b.globalBounds();if(b.isType("Graphics")){var e=b.get("strokeWidth",1)/2;1<=e&&(d.left-=e,d.right+=e,d.top-=e,d.bottom+=e)}e=a.point;d=e.x>=d.left&&e.y>=d.top&&e.x<=d.right&&e.y<=d.bottom?!0:!1;d||(c=!1,b._root._renderer.removeHovering(b._display))}c&&this.isEnabled("pointerover")&&
this.dispatch("pointerover",this._makePointerEvent("pointerover",a))},pointerout:function(a){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",a))},pointerdown:function(a){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",a))},pointerup:function(a){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",a))},globalpointerup:function(a){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",
this._makePointerEvent("globalpointerup",a))},globalpointermove:function(a){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",a))},wheel:function(a){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:a.event,point:a.point})}}});class B extends H{constructor(){super(...arguments);Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}});
Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}});Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,
value:!1});Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,
"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}});Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,
writable:!0,value:void 0});Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,
value:void 0});Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0);super._afterNew()}markDirtyKey(a){this._markDirtyKey(a)}_markDirtyKey(a){super._markDirtyKey(a);if("x"==a||"y"==a||"dx"==a||"dy"==a)this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition()}_markDirtyPrivateKey(a){super._markDirtyPrivateKey(a);"x"!=a&&"y"!=a||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&
this._templateField._removeObjectTemplate(this)}_createEvents(){return new Ga(this)}_processTemplateField(){let a;const b=this.get("templateField");if(b){var c=this.dataItem;c&&(c=c.dataContext)&&(a=c[b],a instanceof Z||!a||(a=Z.new(a)))}this._templateField!==a&&(this._removeTemplateField(),(this._templateField=a)&&a._setObjectTemplate(this),this._applyTemplates())}_setDataItem(a){const b=this._dataItem;this._dataItem=a;this._processTemplateField();a!=b&&this.events.isEnabled("dataitemchanged")&&
this.events.dispatch("dataitemchanged",{type:"dataitemchanged",target:this,oldDataItem:b,newDataItem:a})}set dataItem(a){this._setDataItem(a)}get dataItem(){if(this._dataItem)return this._dataItem;let a=this._parent;for(;a;){if(a._dataItem)return a._dataItem;a=a._parent}}_addPercentageSizeChildren(){let a=this.parent;a&&(this.get("width")instanceof t||this.get("height")instanceof t?wa(a._percentageSizeChildren,this):y(a._percentageSizeChildren,this))}_addPercentagePositionChildren(){let a=this.parent;
a&&(this.get("x")instanceof t||this.get("y")instanceof t?wa(a._percentagePositionChildren,this):y(a._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const a=this._localBounds;if(a){var b=this.get("centerX");null!=b&&(this._display.pivot.x=a.left+F(b,a.right-a.left));b=this.get("centerY");null!=b&&(this._display.pivot.y=a.top+F(b,a.bottom-a.top))}}_beforeChanged(){super._beforeChanged();this._handleStates();if(this.isDirty("tooltip")){var a=
this._prevSettings.tooltip;a&&a.dispose()}if(this.isDirty("layer")||this.isDirty("layerMargin"))this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer();if(this.isDirty("tooltipPosition")){if(a=this._tooltipMoveDp)a.dispose(),this._tooltipMoveDp=void 0;if(a=this._tooltipPointerDp)a.dispose(),this._tooltipPointerDp=void 0;"pointer"==this.get("tooltipPosition")&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",b=>{this.showTooltip(b.point)})),this._tooltipPointerDp=
new C([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",b=>{this.showTooltip(b.point)})}),this.events.on("pointerout",()=>{const b=this._tooltipMoveDp;b&&(b.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&
(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();var a=this._display;const b=this.events;if(this.isDirty("draggable")){var c=this.get("draggable");c?(this.set("interactive",!0),this._dragDp=new C([b.on("pointerdown",e=>{this.dragStart(e)}),b.on("globalpointermove",e=>{this.dragMove(e)}),b.on("globalpointerup",
e=>{this.dragStop(e)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0);a.cancelTouch=c?!0:!1}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){c=this.get("tooltipText");var d=this.get("tooltipHTML");const e=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0);if(c||d)"click"==e?(this._tooltipDp=new C([b.on("click",()=>{this.setTimeout(()=>this.showTooltip(),10)}),xa(document,"click",f=>{this.hideTooltip()})]),
this._disposers.push(this._tooltipDp)):"always"!=e&&(this._tooltipDp=new C([b.on("pointerover",()=>{this.showTooltip()}),b.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp))}if(this.isDirty("toggleKey")){let e=this.get("toggleKey");e&&"none"!=e?this._toggleDp=b.on("click",()=>{this._isDragging||this.set(e,!this.get(e))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}this.isDirty("opacity")&&(a.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&
this.markDirtyAccessibility());this.isDirty("rotation")&&(this.markDirtyBounds(),a.angle=this.get("rotation",0));this.isDirty("scale")&&(this.markDirtyBounds(),a.scale=this.get("scale",0));if(this.isDirty("centerX")||this.isDirty("centerY"))this.markDirtyBounds(),this.updatePivotPoint();if(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?a.visible=!0:(a.visible=!1,this.hideTooltip()),this.markDirtyBounds(),
this.get("focusable")&&this.markDirtyAccessibility();if(this.isDirty("width")||this.isDirty("height"))this.markDirtyBounds(),this._addPercentageSizeChildren(),(c=this.parent)&&(this.isDirty("width")&&this.get("width")instanceof t||this.isDirty("height")&&this.get("height")instanceof t)&&(c.markDirty(),c._prevWidth=0),this._sizeDirty=!0;if(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||
this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))this.markDirtyBounds(),this._sizeDirty=!0;this._sizeDirty&&this._updateSize();this.isDirty("wheelable")&&((c=this.get("wheelable"))&&this.set("interactive",!0),a.wheelable=c?!0:!1);if(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))this.get("focusable")?
this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this);this.isDirty("filter")&&(a.filter=this.get("filter"));c=this.get("filter","");this.isDirty("blur")&&(d=this.get("blur",0),0!=d&&(c+=" blur("+d+"px)"));this.isDirty("saturate")&&(d=this.get("saturate",1),1!=d&&(c+=" saturate("+d+")"));this.isDirty("brightness")&&(d=this.get("brightness",1),1!=d&&(c+=" brightness("+d+")"));this.isDirty("contrast")&&(d=this.get("contrast",1),1!=d&&(c+=" contrast("+d+")"));this.isDirty("sepia")&&
(d=this.get("sepia",0),0!=d&&(c+=" sepia("+d+")"));this.isDirty("hue")&&(d=this.get("hue",0),0!=d&&(c+=" hue-rotate("+d+"deg)"));this.isDirty("invert")&&(d=this.get("invert",0),0!=d&&(c+=" invert("+d+")"));c&&(a.filter=c);this.isDirty("cursorOverStyle")&&(a.cursorOverStyle=this.get("cursorOverStyle"));this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new C([b.on("focus",()=>{this.showTooltip()}),b.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=
void 0));this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility());this.isPrivateDirty("focusable")&&this.markDirtyAccessibility();(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||
this.isDirty("ariaControls"))&&this.markDirtyAccessibility();this.isDirty("exportable")&&(a.exportable=this.get("exportable"));this.isDirty("interactive")&&(a=this.events,this.get("interactive")&&!a.isDisposed()?this._hoverDp=new C([a.on("click",e=>{ya(e.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver();(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip();this.setPrivateRaw("touchHovering",!0);this.events.dispatch("pointerover",{type:"pointerover",
target:e.target,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})},10))}),a.on("globalpointerup",e=>{ya(e.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:e.target,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated}));this._isDown&&this._handleUp(e)}),a.on("pointerover",()=>{this._handleOver()}),
a.on("pointerout",()=>{this._handleOut()}),a.on("pointerdown",e=>{this._handleDown(e)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0)));this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null));"always"==this.get("showTooltipOn")&&this._display.visible&&this.showTooltip()}dragStart(a){this._dragEvent=a;this.events.stopParentDispatch()}dragStop(a){this._dragPoint=this._dragEvent=void 0;this.events.stopParentDispatch();this._isDragging&&
(this._isDragging=!1,this.events.isEnabled("dragstop")&&this.events.dispatch("dragstop",{type:"dragstop",target:this,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated}))}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&
this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(a){this.isHidden()||(this.get("active")&&this.states.lookup("active")?
this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0,delete this._downPoints[a.originalEvent.pointerId||0],0==A(this._downPoints).length&&(this._isDown=!1))}_hasMoved(a){const b=this._downPoints[a.originalEvent.pointerId||0];if(b){const c=Math.abs(b.y-a.point.y);return 5<Math.abs(b.x-a.point.x)||
5<c}return!1}_hasDown(){return 0<A(this._downPoints).length}_handleDown(a){const b=this.parent;b&&!this.get("draggable")&&b._handleDown(a);this.get("interactive")&&!this.isHidden()&&(this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:a.point.x,y:a.point.y},this._isDown=!0,this._downPoints[a.originalEvent.pointerId||0]={x:a.point.x,y:a.point.y})}dragMove(a){var b=this._dragEvent;if(b){if(b.simulated&&!a.simulated)return!0;let e=0;for(var c=this.parent,d=1;null!=c;)e+=c.get("rotation",
0),(c=c.parent)&&(d*=c.get("scale",1));c=(a.point.x-b.point.x)/d;d=(a.point.y-b.point.y)/d;const f=this.events;b.simulated&&!this._isDragging&&(this._isDragging=!0,this._dragEvent=a,this._dragPoint={x:this.x(),y:this.y()},f.isEnabled("dragstart")&&f.dispatch("dragstart",{type:"dragstart",target:this,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated}));this._isDragging?(b=this._dragPoint,this.set("x",b.x+c*na(e)+d*ma(e)),this.set("y",b.y+d*na(e)-c*ma(e)),f.isEnabled("dragged")&&f.dispatch("dragged",
{type:"dragged",target:this,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated})):5<Math.hypot(c,d)&&(this._isDragging=!0,this._dragEvent=a,this._dragPoint={x:this.x(),y:this.y()},f.isEnabled("dragstart")&&f.dispatch("dragstart",{type:"dragstart",target:this,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated}))}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let a=this.parent,b=0;for(;;)if(a)++b,a=a.parent;else return b}markDirtySize(){this._sizeDirty=
!0;this.markDirty()}markDirtyBounds(){var a=this._display;this.get("isMeasured")&&(this._root._addDirtyBounds(this),a.isMeasured=!0,a.invalidateBounds(),(a=this.parent)&&"absolute"!=this.get("position")&&(null==a.get("width")||null==a.get("height")||a.get("layout"))&&a.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility())}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty();
this.markDirtyLayer()}_updateBounds(){const a=this._adjustedLocalBounds;let b;this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),b=this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds)):this._adjustedLocalBounds=this._localBounds=b={left:0,right:0,top:0,bottom:0};a&&a.left===b.left&&a.top===b.top&&a.right===b.right&&a.bottom===b.bottom||(this.events.isEnabled("boundschanged")&&
this.events.dispatch("boundschanged",{type:"boundschanged",target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip())}_fixMinBounds(a){var b=this.get("minWidth",this.getPrivate("minWidth")),c=this.get("minHeight",this.getPrivate("minHeight"));n(b)&&a.right-a.left<b&&(a.right=a.left+b);n(c)&&a.bottom-a.top<c&&(a.bottom=a.top+c);b=this.getPrivate("width");c=this.getPrivate("height");n(b)&&(0<b?a.right=a.left+b:a.left=a.right+
b);n(c)&&(0<c?a.bottom=a.top+c:a.top=a.bottom+c)}_removeParent(a){a&&(a.children.removeValue(this),y(a._percentageSizeChildren,this),y(a._percentagePositionChildren,this))}_clearDirty(){super._clearDirty();this._statesHandled=this._sizeDirty=!1}hover(){this.showTooltip();this._handleOver()}unhover(){this.hideTooltip();this._handleOut()}showTooltip(a){const b=this.getTooltip();var c=this.get("tooltipText");const d=this.get("tooltipHTML");if((c||d)&&b){const e=this.get("tooltipPosition"),f=this.getPrivate("tooltipTarget",
this);"fixed"!=e&&a||(this._display._setMatrix(),a=this.toGlobal(f._getTooltipPoint()));b.set("pointTo",a);b.set("tooltipTarget",f);b.get("x")||b.set("x",a.x);b.get("y")||b.set("y",a.y);c&&b.label.set("text",c);d&&b.label.set("html",d);(c=this.dataItem)&&b.label._setDataItem(c);if("always"==this.get("showTooltipOn")&&(0>a.x||a.x>this._root.width()||0>a.y||a.y>this._root.height()))this.hideTooltip();else return b.label.text.markDirtyText(),a=b.show(),this.setPrivateRaw("showingTooltip",!0),a}}hideTooltip(){var a=
this.getTooltip();if(a&&(a.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==a)){let b=a.get("keepTargetHover")&&0==a.get("stateAnimationDuration",0)?400:void 0;a=a.hide(b);this.setPrivateRaw("showingTooltip",!1);return a}}_getTooltipPoint(){const a=this._localBounds;if(a){let b=0,c=0;this.get("isMeasured")?(b=a.left+F(this.get("tooltipX",0),a.right-a.left),c=a.top+F(this.get("tooltipY",0),a.bottom-a.top)):(b=F(this.get("tooltipX",0),this.width()),c=F(this.get("tooltipY",
0),this.height()));return{x:b,y:c}}return{x:0,y:0}}getTooltip(){var a=this.get("tooltip");if(a)return a;if(a=this.parent)return a.getTooltip()}_updatePosition(){var a=this.parent,b=this.get("dx",0);let c=this.get("dy",0);var d=this.get("x");let e=this.getPrivate("x"),f=0,g=0;const k=this.get("position");d instanceof t&&(d=a?a.innerWidth()*d.value+a.get("paddingLeft",0):0);n(d)?f=d+b:null!=e?f=e:a&&"relative"==k&&(f=a.get("paddingLeft",0)+b);b=this.get("y");d=this.getPrivate("y");b instanceof t&&(b=
a?a.innerHeight()*b.value+a.get("paddingTop",0):0);n(b)?g=b+c:null!=d?g=d:a&&"relative"==k&&(g=a.get("paddingTop",0)+c);a=this._display;if(a.x!=f||a.y!=g)a.invalidateBounds(),a.x=f,a.y=g,this.events.isEnabled("positionchanged")&&this.events.dispatch("positionchanged",{type:"positionchanged",target:this});this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let a=this.get("x"),b=this.getPrivate("x");const c=this.parent;return c?a instanceof t?F(a,c.innerWidth())+c.get("paddingLeft",0):n(a)?a:
null!=b?b:c.get("paddingLeft",this._display.x):this._display.x}y(){let a=this.getPrivate("y");if(null!=a)return a;let b=this.get("y");const c=this.parent;return c?b instanceof t?F(b,c.innerHeight())+c.get("paddingTop",0):n(b)?b:null!=a?a:c.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose();this._display.dispose();this._removeTemplateField();this._removeParent(this.parent);this._root._removeFocusElement(this);const a=this.get("tooltip");a&&a.dispose();this.markDirty()}adjustedLocalBounds(){this._fixMinBounds(this._adjustedLocalBounds);
return this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const a=this._adjustedLocalBounds,b=this.x(),c=this.y();return{left:a.left+b,right:a.right+b,top:a.top+c,bottom:a.bottom+c}}globalBounds(){var a=this.localBounds();const b=this.toGlobal({x:a.left,y:a.top}),c=this.toGlobal({x:a.right,y:a.top}),d=this.toGlobal({x:a.right,y:a.bottom});a=this.toGlobal({x:a.left,y:a.bottom});return{left:Math.min(b.x,c.x,d.x,a.x),top:Math.min(b.y,c.y,d.y,a.y),right:Math.max(b.x,c.x,d.x,a.x),
bottom:Math.max(b.y,c.y,d.y,a.y)}}_onShow(a){}_onHide(a){}appear(a,b){return da.__awaiter(this,void 0,void 0,function*(){yield this.hide(0);return b?new Promise((c,d)=>{this.setTimeout(()=>{c(this.show(a))},b)}):this.show(a)})}show(a){return da.__awaiter(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1;this._isShowing=!0;this._isHiding=!1;this.states.lookup("default").get("visible")&&this.set("visible",!0);this._onShow(a);const b=this.states.applyAnimate("default",a);yield Qa(b);
this._isShowing=!1}})}hide(a){return da.__awaiter(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0;this._isShowing=!1;var b=this.states.lookup("hidden");b||=this.states.create("hidden",{opacity:0,visible:!1});this._isHidden=!0;this._onHide(a);b=this.states.applyAnimate("hidden",a);yield Qa(b);this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return this.get("visible")&&
this.getPrivate("visible")&&!this.get("forceHidden")?!0:!1}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const a=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*a:a}compositeScale(){const a=this.get("scale",1);return this._parent?this._parent.compositeScale()*a:a}compositeRotation(){const a=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+a:a}width(){let a=this.get("width"),
b=this.get("maxWidth",this.getPrivate("maxWidth")),c=this.get("minWidth",this.getPrivate("minWidth"));var d=this.getPrivate("width");let e=0;n(d)?e=d:null==a?this._adjustedLocalBounds&&(e=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left):a instanceof t?e=(d=this.parent)?d.innerWidth()*a.value:this._root.width()*a.value:n(a)&&(e=a);n(c)&&(e=Math.max(c,e));n(b)&&(e=Math.min(b,e));return e}maxWidth(){var a=this.get("maxWidth",this.getPrivate("maxWidth"));if(n(a))return a;a=this.get("width");
return n(a)?a:(a=this.parent)?a.innerWidth():this._root.width()}maxHeight(){var a=this.get("maxHeight",this.getPrivate("maxHeight"));if(n(a))return a;a=this.get("height");return n(a)?a:(a=this.parent)?a.innerHeight():this._root.height()}height(){let a=this.get("height"),b=this.get("maxHeight",this.getPrivate("maxHeight")),c=this.get("minHeight",this.getPrivate("minHeight"));var d=this.getPrivate("height");let e=0;n(d)?e=d:null==a?this._adjustedLocalBounds&&(e=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top):
a instanceof t?e=(d=this.parent)?d.innerHeight()*a.value:this._root.height()*a.value:n(a)&&(e=a);n(c)&&(e=Math.max(c,e));n(b)&&(e=Math.min(b,e));return e}_findStaticTemplate(a){return this._templateField&&a(this._templateField)?this._templateField:super._findStaticTemplate(a)}_walkParents(a){this._parent&&this._walkParent(a)}_walkParent(a){this._parent&&this._parent._walkParent(a);a(this)}get parent(){return this._parent}_setParent(a,b=!1){const c=this._parent;a!==c&&(this.markDirtyBounds(),a.markDirty(),
this._parent=a,b&&(this._removeParent(c),a&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(a){return this._display.toGlobal(a)}toLocal(a){return this._display.toLocal(a)}_getDownPoint(){const a=
this._getDownPointId();if(a)return this._downPoints[a]}_getDownPointId(){if(this._downPoints)return eb(this._downPoints,(a,b)=>a>b?1:a<b?-1:0)[0]}toFront(){const a=this.parent;a&&a.children.moveValue(this,a.children.length-1)}toBack(){const a=this.parent;a&&a.children.moveValue(this,0)}}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Sprite"});Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([B.className])});
class aa extends H{constructor(){super(...arguments);Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()});Object.defineProperty(this,"_backgroundDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()});Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNewApplyThemes()}get pattern(){return this._pattern}_draw(){}_beforeChanged(){super._beforeChanged();
if(this.isDirty("repetition")||this.isDirty("width")||this.isDirty("height")||this.isDirty("rotation")||this.isDirty("strokeWidth")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("colorOpacity")||this.isDirty("fillOpacity"))this._clear=!0;this._checkDirtyFill()}_checkDirtyFill(){if(this.isDirty("color")||this.isDirty("fill"))this._clear=!0}_changed(){super._changed();if(this._clear){const a=this.get("repetition",""),b=this.get("width",100),c=this.get("height",100),
d=this.get("fill"),e=this.get("fillOpacity",1),f=this._backgroundDisplay,g=this._display;g.clear();f.clear();d&&0<e&&(f.beginFill(d,e),f.drawRect(0,0,b,c),f.endFill());g.angle=this.get("rotation",0);this._draw();this._pattern=this._root._renderer.createPattern(g,f,a,b,c)}this._clear=!1}}Object.defineProperty(aa,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"});Object.defineProperty(aa,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([aa.className])});
class ba extends aa{constructor(){super(...arguments);Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged();this._clear=!0;this.isDirty("src")&&this._load();const a=this.get("canvas");a&&(this.set("width",a.width),this.set("height",a.height))}_draw(){super._draw();var a=this._image;if(a){const c=this.get("width",100),d=this.get("height",100);var b=this.get("fit","image");let e=0,f=0;"pattern"==b?(e=c,f=d):(e=a.width,f=
a.height,"image"==b&&(this.set("width",e),this.set("height",f)));let g=b=0;this.get("centered",!0)&&(b=c/2-e/2,g=d/2-f/2);this._display.image(a,e,f,b,g)}(a=this.get("canvas"))&&this._display.image(a,a.width,a.height,0,0)}_load(){const a=this.get("src");if(a){const b=new Image;b.src=a;b.decode().then(()=>{this._image=b;this._draw();this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(c=>{})}}}Object.defineProperty(ba,"className",{enumerable:!0,configurable:!0,
writable:!0,value:"PicturePattern"});Object.defineProperty(ba,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:aa.classNames.concat([ba.className])});h.BlendMode=void 0;(function(a){a.ADD="lighter";a.COLOR="color";a.COLOR_BURN="color-burn";a.COLOR_DODGE="color-dodge";a.DARKEN="darken";a.DIFFERENCE="difference";a.DST_OVER="destination-over";a.EXCLUSION="exclusion";a.HARD_LIGHT="hard-light";a.HUE="hue";a.LIGHTEN="lighten";a.LUMINOSITY="luminosity";a.MULTIPLY="multiply";a.NORMAL="source-over";
a.OVERLAY="overlay";a.SATURATION="saturation";a.SCREEN="screen";a.SOFT_LIGHT="soft-light";a.SRC_ATOP="source-atop";a.XOR="xor"})(h.BlendMode||(h.BlendMode={}));class Q extends B{constructor(){super(...arguments);Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()});Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){super._beforeChanged();(this.isDirty("draw")||this.isDirty("svgPath"))&&
this.markDirtyBounds();if(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||
this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))this._clear=!0;this._display.crisp=this.get("crisp",!1);if(this.isDirty("fillGradient")){var a=this.get("fillGradient");a&&(this._display.isMeasured=!0,a=a.get("target"))&&(this._disposers.push(a.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(a.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}this.isDirty("strokeGradient")&&
(a=this.get("strokeGradient"))&&(this._display.isMeasured=!0,a=a.get("target"))&&(this._disposers.push(a.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(a.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}_changed(){super._changed();if(this._clear){this.markDirtyBounds();this.markDirtyLayer();this._display.clear();var a=this.get("strokeDasharray");n(a)&&(a=.5>a?[0]:[a]);this._display.setLineDash(a);(a=this.get("strokeDashoffset"))&&this._display.setLineDashOffset(a);
a=this.get("blendMode",h.BlendMode.NORMAL);this._display.blendMode=a;(a=this.get("draw"))&&"function"===typeof a&&a(this._display,this);a=this.get("svgPath");null!=a&&this._display.svgPath(a)}}_afterChanged(){super._afterChanged();if(this._clear){const e=this.get("fill");var a=this.get("fillGradient"),b=this.get("fillPattern");const f=this.get("fillOpacity"),g=this.get("stroke");var c=this.get("strokeGradient");const k=this.get("strokePattern");var d=this.get("shadowColor");const l=this.get("shadowBlur"),
q=this.get("shadowOffsetX"),m=this.get("shadowOffsetY"),w=this.get("shadowOpacity");d&&(l||q||m)&&this._display.shadow(d,l,q,m,w);e&&!a&&(this._display.beginFill(e,f),this._display.endFill());a&&(e&&(d=a.get("stops",[]),d.length&&p(d,r=>{r.color&&!r.colorInherited||!e||(r.color=e,r.colorInherited=!0);if(null==r.opacity||r.opacityInherited)r.opacity=f,r.opacityInherited=!0})),a=a.getFill(this))&&(this._display.beginFill(a,f),this._display.endFill());if(b&&(a=b.pattern)&&(this._display.beginFill(a,
f),this._display.endFill(),b instanceof ba))b.events.once("loaded",()=>{this._clear=!0;this.markDirty()});if(g||c||k){const r=this.get("strokeOpacity");b=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(b/=this.get("scale",1));this.get("crisp")&&(b/=this._root._renderer.resolution);a=this.get("lineJoin");g&&!c&&(this._display.lineStyle(b,g,r,a),this._display.endStroke());c&&(d=c.get("stops",[]),d.length&&p(d,x=>{x.color&&!x.colorInherited||!g||(x.color=g,x.colorInherited=!0);if(null==x.opacity||
x.opacityInherited)x.opacity=r,x.opacityInherited=!0}),c=c.getFill(this))&&(this._display.lineStyle(b,c,r,a),this._display.endStroke());if(k&&(c=k.pattern)&&(this._display.lineStyle(b,c,r,a),this._display.endStroke(),k instanceof ba))k.events.once("loaded",()=>{this._clear=!0;this.markDirty()})}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(Q,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"});Object.defineProperty(Q,"classNames",
{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([Q.className])});class R extends Q{_afterNew(){super._afterNew();this._display.isMeasured=!0;this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged();if(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))this._clear=!0}_changed(){super._changed();this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty();
this._clear=!0}}Object.defineProperty(R,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"});Object.defineProperty(R,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Q.classNames.concat([R.className])});class I extends H{}Object.defineProperty(I,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"});Object.defineProperty(I,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([I.className])});class S extends I{updateContainer(a){let b=
a.get("paddingLeft",0),c=a.innerWidth(),d=0;G(a,f=>{if(f.isVisible()&&"relative"==f.get("position")){let g=f.get("width");if(g instanceof t){d+=g.value;let k=c*g.value,l=f.get("minWidth",f.getPrivate("minWidth",-Infinity));l>k&&(c-=l,d-=g.value);f=f.get("maxWidth",f.getPrivate("maxWidth",Infinity));k>f&&(c-=f,d-=g.value)}else n(g)||(g=f.width()),c-=g+f.get("marginLeft",0)+f.get("marginRight",0)}});if(0>=c||Infinity==c)c=.1;G(a,f=>{if(f.isVisible()&&"relative"==f.get("position")){var g=f.get("width");
if(g instanceof t){g=c*g.value/d-f.get("marginLeft",0)-f.get("marginRight",0);let k=f.get("minWidth",f.getPrivate("minWidth",-Infinity)),l=f.get("maxWidth",f.getPrivate("maxWidth",Infinity));g=Math.min(Math.max(k,g),l);f.setPrivate("width",g)}else f._prevSettings.width instanceof t&&f.setPrivate("width",void 0)}});let e=b;G(a,f=>{if("relative"==f.get("position"))if(f.isVisible()){var g=f.adjustedLocalBounds(),k=f.get("marginLeft",0);let l=f.get("marginRight",0),q=f.get("maxWidth"),m=g.left;g=g.right;
q&&g-m>q&&(g=m+q);k=e+k-m;f.setPrivate("x",k);e=k+g+l}else f.setPrivate("x",void 0)})}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"});Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([S.className])});class T extends I{updateContainer(a){let b=a.get("paddingTop",0),c=a.innerHeight(),d=0;G(a,f=>{if(f.isVisible()&&"relative"==f.get("position")){let g=f.get("height");if(g instanceof t){d+=
g.value;let k=c*g.value,l=f.get("minHeight",f.getPrivate("minHeight",-Infinity));l>k&&(c-=l,d-=g.value);f=f.get("maxHeight",f.getPrivate("maxHeight",Infinity));k>f&&(c-=f,d-=g.value)}else n(g)||(g=f.height()),c-=g+f.get("marginTop",0)+f.get("marginBottom",0)}});if(0>=c||Infinity==c)c=.1;G(a,f=>{if(f.isVisible()&&"relative"==f.get("position")){var g=f.get("height");if(g instanceof t){g=c*g.value/d-f.get("marginTop",0)-f.get("marginBottom",0);let k=f.get("minHeight",f.getPrivate("minHeight",-Infinity)),
l=f.get("maxHeight",f.getPrivate("maxHeight",Infinity));g=Math.min(Math.max(k,g),l);f.setPrivate("height",g)}else f._prevSettings.height instanceof t&&f.setPrivate("height",void 0)}});let e=b;G(a,f=>{if("relative"==f.get("position"))if(f.isVisible()){var g=f.adjustedLocalBounds(),k=f.get("marginTop",0);let q=g.top;g=g.bottom;var l=f.get("maxHeight");l&&g-q>l&&(g=q+l);l=f.get("marginBottom",0);k=e+k-q;f.setPrivate("y",k);e=k+g+l}else f.setPrivate("y",void 0)})}}Object.defineProperty(T,"className",
{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"});Object.defineProperty(T,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([T.className])});class U extends I{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE);super._afterNew()}updateContainer(a){let b=a.get("paddingLeft",0);var c=a.get("paddingRight",0);let d=a.get("paddingTop",0),e=c=a.maxWidth()-b-c,f=1;G(a,r=>{r.get("visible")&&r.getPrivate("visible")&&!r.get("forceHidden")&&"absolute"!=
r.get("position")&&(r=r.width(),r<e&&(e=r),r>f&&(f=r))});e=Aa(e,1,c);f=Aa(f,1,c);let g=1;g=this.get("fixedWidthGrid")?c/f:c/e;g=Math.max(1,Math.floor(g));g=Math.min(this.get("maxColumns",Number.MAX_VALUE),g);let k=this.getColumnWidths(a,g,f,c),l=d,q=0,m=0;g=k.length;let w=b;G(a,r=>{if("relative"==r.get("position")&&r.isVisible()){const x=r.get("marginTop",0),Ha=r.get("marginBottom",0);let qa=r.adjustedLocalBounds(),D=r.get("marginLeft",0),E=r.get("marginRight",0),N=l+x-qa.top;r.setPrivate("x",w+D-
qa.left);r.setPrivate("y",N);w+=k[q]+E;m=Math.max(m,r.height()+x+Ha);q++;q>=g&&(q=0,w=b,l+=m)}})}getColumnWidths(a,b,c,d){let e=0,f=[],g=0;G(a,k=>{let l=k.adjustedLocalBounds();"absolute"!=k.get("position")&&k.isVisible()&&(this.get("fixedWidthGrid")?f[g]=c:f[g]=Math.max(f[g]|0,l.right-l.left+k.get("marginLeft",0)+k.get("marginRight",0)),g<a.children.length-1&&(g++,g==b&&(g=0)))});p(f,k=>{e+=k});return e>d?2<b?(--b,this.getColumnWidths(a,b,c,d)):[d]:f}}Object.defineProperty(U,"className",{enumerable:!0,
configurable:!0,writable:!0,value:"GridLayout"});Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([U.className])});class oa{static escape(a){return a.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/''/g,this.prefix+"5")}static unescape(a){return a.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+
"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(a){return a.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/''/g,"'")}static chunk(a,b=!1,c=!1){let d=[];a=this.escape(a);a=b?a.split("'"):[a];for(b=0;b<a.length;b++){var e=a[b];if(""!==e)if(0===b%2){e=e.replace(/\]\[/g,"]__\u00a7\u00a7\u00a7__[");e=e.replace(/\[\]/g,"[ ]");e=e.split(/[\[\]]+/);
for(var f=0;f<e.length;f++){var g=this.cleanUp(this.unescape(e[f]));"__\u00a7\u00a7\u00a7__"!==g&&""!==g&&(0===f%2?d.push({type:"value",text:g}):d.push({type:c?"value":"format",text:"["+g+"]"}))}}else for(e=e.split(/[\[\]]+/),f=0;f<e.length;f++)g=this.cleanUp(this.unescape(e[f])),""!==g&&(0===f%2?d.push({type:"text",text:g}):this.isImage(g)?d.push({type:"image",text:"["+g+"]"}):d.push({type:"format",text:"["+g+"]"}))}return d}static isImage(a){return a.match(/img[ ]?:/)?!0:!1}static getTextStyle(a){let b=
{};if(""==a||"[ ]"==a)return{};var c=a.match(/('[^']*')|("[^"]*")/gi);if(c)for(var d=0;d<c.length;d++)a=a.replace(c[d],c[d].replace(/['"]*/g,"").replace(/[ ]+/g,"+"));a=a.match(/([\w\-]*:[\s]?[^;\s\]]*)|(#[\w]{1,6})|([\w\-]+)|(\/)/gi);if(!a)return{};for(c=0;c<a.length;c++)a[c].match(/^(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)$/i)?b.fontWeight=a[c]:a[c].match(/^(underline|line-through)$/i)?b.textDecoration=a[c]:"/"!=a[c]&&(a[c].match(/:/)?(d=a[c].replace("+"," ").split(/:[ ]*/),
b[d[0]]=d[1]):b.fill=v.fromString(a[c]));return b}}Object.defineProperty(oa,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:"__amcharts__"});class O extends B{constructor(){super(...arguments);Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()});Object.defineProperty(this,"_childrenDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()});Object.defineProperty(this,"children",
{enumerable:!0,configurable:!0,writable:!0,value:new mb(this)});Object.defineProperty(this,"_percentageSizeChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_percentagePositionChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_prevWidth",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_prevHeight",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_contentWidth",
{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_contentHeight",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_contentMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_vsbd0",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_vsbd1",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNew();this._display.addChild(this._childrenDisplay)}_dispose(){W(this.allChildren(),
a=>{a.dispose()});this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this);super._dispose()}_changed(){super._changed();this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1));this.isDirty("layout")&&(this._prevHeight=this._prevWidth=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(a=>{a.removePrivate("x");a.removePrivate("y")}));(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||
this.isDirty("paddingRight"))&&this.children.each(a=>{a.markDirtyPosition()});if(this.isDirty("maskContent")){const a=this._childrenDisplay;let b=this._contentMask;this.get("maskContent")?b||(this._contentMask=b=R.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),a.addChildAt(b._display,0),a.mask=b._display):b&&(a.removeChild(b._display),a.mask=null,b.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize();p(this._percentageSizeChildren,a=>{a._updateSize()});
p(this._percentagePositionChildren,a=>{a.markDirtyPosition();a._updateSize()});this.updateBackground()}updateBackground(){var a=this.get("background"),b=this._localBounds;if(b&&!this.isHidden()){var c=b.left;let e=b.top,f=b.right-c,g=b.bottom-e;b=this.get("maxWidth");var d=this.get("maxHeight");d&&g>d&&(g=d);b&&f>b&&(f=b);d=this.width();b=this.height();a&&(a.setAll({width:f,height:g,x:c,y:e}),this._display.interactive&&(a._display.interactive=!0));(a=this._contentMask)&&a.setAll({width:d+1,height:b+
1});if(a=this.get("verticalScrollbar"))a.set("height",b),a.set("x",d-a.width()-a.get("marginRight",0)),a.set("end",a.get("start",0)+b/this._contentHeight),(c=a.get("background"))&&c.setAll({width:a.width(),height:b}),c=!0,this._contentHeight<=b&&(c=!1),a.setPrivate("visible",c)}}_applyThemes(a=!1){return super._applyThemes(a)?(this.eachChildren(b=>{b._applyThemes(a)}),!0):!1}_applyState(a){super._applyState(a);this.get("setStateOnChildren")&&this.eachChildren(b=>{b.states.apply(a)})}_applyStateAnimated(a,
b){super._applyStateAnimated(a,b);this.get("setStateOnChildren")&&this.eachChildren(c=>{c.states.applyAnimate(a,b)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let a=this.get("width"),b=this.get("height"),c=this.getPrivate("width"),d=this.getPrivate("height"),e={left:0,top:0,right:this.width(),bottom:this.height()};var f=this.get("layout");let g=!1,k=!1;if(f instanceof
S||f instanceof U)g=!0;f instanceof T&&(k=!0);if(null==a&&null==c||null==b&&null==d||this.get("verticalScrollbar")){let l=f=Number.MAX_VALUE,q=-f,m=f,w=-f;const r=this.get("paddingLeft",0),x=this.get("paddingTop",0),Ha=this.get("paddingRight",0),qa=this.get("paddingBottom",0);this.children.each(D=>{if("absolute"!=D.get("position")&&D.get("isMeasured")){var E=D.adjustedLocalBounds(),N=D.x();let ab=D.y(),Ia=N+E.left;N+=E.right;let Ja=ab+E.top;E=ab+E.bottom;g&&(Ia-=D.get("marginLeft",0),N+=D.get("marginRight",
0));k&&(Ja-=D.get("marginTop",0),E+=D.get("marginBottom",0));Ia<l&&(l=Ia);N>q&&(q=N);Ja<m&&(m=Ja);E>w&&(w=E)}});l==f&&(l=0);q==-f&&(q=0);m==f&&(m=0);w==-f&&(w=0);e.left=l-r;e.top=m-x;e.right=q+Ha;e.bottom=w+qa;f=this.get("minWidth");n(f)&&0<f&&e.right-e.left<f&&(e.right>=f?e.left=e.right-f:e.right=e.left+f);f=this.get("minHeight");n(f)&&0<f&&e.bottom-e.top<f&&(e.bottom>=f?e.top=e.bottom-f:e.bottom=e.top+f)}this._contentWidth=e.right-e.left;this._contentHeight=e.bottom-e.top;n(a)&&(e.left=0,e.right=
a);n(c)&&(e.left=0,e.right=c);n(b)&&(e.top=0,e.bottom=b);n(d)&&(e.top=0,e.bottom=d);this._localBounds=e}_updateBounds(){const a=this.get("layout");a&&a.updateContainer(this);super._updateBounds();this.updateBackground()}markDirty(){super.markDirty();this._root._addDirtyParent(this)}_prepareChildren(){const a=this.innerWidth(),b=this.innerHeight();if(a!=this._prevWidth||b!=this._prevHeight){let c=this.get("layout"),d=!1,e=!1;if(c){if(c instanceof S||c instanceof U)d=!0;c instanceof T&&(e=!0)}p(this._percentageSizeChildren,
f=>{if(!d){var g=f.get("width");g instanceof t&&f.setPrivate("width",g.value*a)}e||(g=f.get("height"),g instanceof t&&f.setPrivate("height",g.value*b))});p(this._percentagePositionChildren,f=>{f.markDirtyPosition();f.markDirtyBounds()});this._prevWidth=a;this._prevHeight=b;this._sizeDirty=!0;this.updateBackground()}this._handleStates()}_updateHTMLContent(){const a=this.get("html");a&&""!==a?this._root._setHTMLContent(this,Y(this,this.get("html",""))):this._root._removeHTMLContent(this);this._root._positionHTMLElement(this)}_updateChildren(){this.isDirty("html")&&
this._updateHTMLContent();if(this.isDirty("verticalScrollbar")){const c=this.get("verticalScrollbar");if(c){c._setParent(this);c.startGrip.setPrivate("visible",!1);c.endGrip.setPrivate("visible",!1);this.set("maskContent",!0);this.set("paddingRight",c.width()+c.get("marginRight",0)+c.get("marginLeft",0));var a=this.get("background");a||=this.set("background",R.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}));this._vsbd0=this.events.on("wheel",
d=>{d=d.originalEvent;if(Ma(d,this)){d.preventDefault();d=d.deltaY/5E3;var e=c.get("start",0),f=c.get("end",1);0>=e+d&&(d=-e);1<=f+d&&(d=1-f);0<=e+d&&1>=f+d&&(c.set("start",e+d),c.set("end",f+d))}});this._disposers.push(this._vsbd0);this._vsbd1=c.events.on("rangechanged",()=>{let d=this._contentHeight;const e=this._childrenDisplay,f=this._contentMask;e.y=-c.get("start",0)*d;e.markDirtyLayer();f&&(f._display.y=-e.y,e.mask=f._display)});this._disposers.push(this._vsbd1);this._display.addChild(c._display)}else if(a=
this._prevSettings.verticalScrollbar)this._display.removeChild(a._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0)}this.isDirty("background")&&((a=this._prevSettings.background)&&this._display.removeChild(a._display),a=this.get("background"),a instanceof B&&(a.set("isMeasured",!1),a._setParent(this),this._display.addChildAt(a._display,0)));if(this.isDirty("mask")){a=
this.get("mask");var b=this._prevSettings.mask;b&&(this._display.removeChild(b._display),b!=a&&b.dispose());a&&((b=a.parent)&&b.children.removeValue(a),a._setParent(this),this._display.addChildAt(a._display,0),this._childrenDisplay.mask=a._display)}}_processTemplateField(){super._processTemplateField();this.children.each(a=>{a._processTemplateField()})}walkChildren(a){this.children.each(b=>{b instanceof O&&b.walkChildren(a);a(b)})}eachChildren(a){var b=this.get("background");b&&a(b);(b=this.get("verticalScrollbar"))&&
a(b);(b=this.get("mask"))&&a(b);this.children.values.forEach(c=>{a(c)})}allChildren(){const a=[];this.eachChildren(b=>{a.push(b)});return a}_setDataItem(a){const b=a!==this._dataItem;super._setDataItem(a);(a=this.get("html",""))&&""!==a&&b&&this._root._setHTMLContent(this,Y(this,a))}}Object.defineProperty(O,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"});Object.defineProperty(O,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([O.className])});
class ca extends B{constructor(){super(...arguments);Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()});Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)});Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:"textAlign fontFamily fontSize fontStyle fontWeight fontStyle fontVariant textDecoration shadowColor shadowBlur shadowOffsetX shadowOffsetY shadowOpacity lineHeight baselineRatio direction textBaseline oversizedBehavior breakWords ellipsis minScale maxChars".split(" ")});
Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){this.get("text")?super._updateBounds():this._adjustedLocalBounds={left:0,right:0,top:0,bottom:0}}_changed(){super._changed();this._display.clear();let a=this.textStyle;if(this.isDirty("opacity")){var b=this.get("opacity",1);this._display.alpha=b}if(this.isDirty("text")||this.isDirty("populateText"))this._display.text=this._getText(),this.markDirtyBounds(),"tooltip"==this.get("role")&&
this._root.updateTooltip(this);this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new z(()=>{this._root._removeTooltipElement(this)}));this.isDirty("width")&&(a.wordWrapWidth=this.width(),this.markDirtyBounds());this.isDirty("oversizedBehavior")&&(a.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds());this.isDirty("breakWords")&&(a.breakWords=this.get("breakWords",!1),this.markDirtyBounds());this.isDirty("ellipsis")&&(a.ellipsis=
this.get("ellipsis"),this.markDirtyBounds());this.isDirty("ignoreFormatting")&&(a.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds());this.isDirty("minScale")&&(a.minScale=this.get("minScale",0),this.markDirtyBounds());this.isDirty("fill")&&(b=this.get("fill"))&&(a.fill=b);this.isDirty("fillOpacity")&&(b=this.get("fillOpacity",1))&&(a.fillOpacity=b);if(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))a.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds();
if(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))a.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds();p(this._textStyles,c=>{this._dirty[c]&&(a[c]=this.get(c),this.markDirtyBounds())});a.fontSize=this.get("fontSize");a.fontFamily=this.get("fontFamily");this._display.style=a;this.isDirty("role")&&"tooltip"==this.get("role")&&this._root.updateTooltip(this)}_getText(){let a=this.get("text","");this.get("maxChars")&&(a=fb(a,this.get("maxChars",1E8),this.get("breakWords"),
this.get("ellipsis")));return this.get("populateText")?Y(this,a):a}_getAccessibleText(){const a=this.get("ariaLabel");return void 0!==a?this.get("populateText")?Y(this,a):a:this._getText()}markDirtyText(){this._display.text=this._getText();"tooltip"==this.get("role")&&this._root.updateTooltip(this);this.markDirtyBounds();this.markDirty()}_setDataItem(a){super._setDataItem(a);this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?
this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(ca,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"});Object.defineProperty(ca,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([ca.className])});class ra extends O{constructor(){super(...arguments);Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,
writable:!0,value:void 0});Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:"text fill fillOpacity textAlign fontFamily fontSize fontStyle fontWeight fontStyle fontVariant textDecoration shadowColor shadowBlur shadowOffsetX shadowOffsetY shadowOpacity lineHeight baselineRatio direction textBaseline oversizedBehavior breakWords ellipsis minScale populateText role ignoreFormatting maxChars ariaLabel".split(" ")})}get text(){return this._text}_afterNew(){super._afterNew();
this._makeText();p(this._textKeys,a=>{const b=this.get(a);void 0!=b&&this._text.set(a,b)});""!==this.get("html","")&&this._text.set("text","");this.onPrivate("maxWidth",()=>{this._setMaxDimentions()});this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(ca.new(this._root,{}))}_updateChildren(){super._updateChildren();const a=this._text;p(this._textKeys,c=>{this._text.set(c,this.get(c))});(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&
this._setMaxDimentions();""!==this.get("html","")?a.set("text",""):(a.set("text",this.get("text")),this._maybeUpdateHTMLColor());this.isDirty("fill")&&this._maybeUpdateHTMLColor();if(this.isDirty("textAlign")||this.isDirty("width")){var b=this.get("textAlign");let c;if(null!=this.get("width"))c="right"==b?Va:"center"==b?Wa:0;else if("left"==b||"start"==b)c=this.get("paddingLeft",0);else if("right"==b||"end"==b)c=-this.get("paddingRight",0);a.set("x",c)}(b=this.get("background"))&&b.setPrivate("visible",
a._display.textVisible)}_maybeUpdateHTMLColor(){const a=this.getPrivate("htmlElement");a&&this.get("fill")&&(a.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){var a=this.get("rotation");a=90==a||270==a||-90==a;const b=this._text;var c=this.get("maxWidth",this.getPrivate("maxWidth",Infinity));n(c)?b.set(a?"maxHeight":"maxWidth",c-this.get("paddingLeft",0)-this.get("paddingRight",0)):b.set(a?"maxHeight":"maxWidth",void 0);c=this.get("maxHeight",this.getPrivate("maxHeight",Infinity));n(c)?
b.set(a?"maxWidth":"maxHeight",c-this.get("paddingTop",0)-this.get("paddingBottom",0)):b.set(a?"maxWidth":"maxHeight",void 0);this.root.events.once("frameended",()=>{b.markDirtyBounds()})}_setDataItem(a){super._setDataItem(a);this._markDirtyKey("text");a=this._text;a.get("populateText")&&a.markDirtyText();(a=this.get("html"))&&""!==a&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(ra,"className",{enumerable:!0,
configurable:!0,writable:!0,value:"Label"});Object.defineProperty(ra,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:O.classNames.concat([ra.className])});class wb{constructor(a,b){Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}});this._root=a;if(!b)throw Error("You cannot use `new Class()`, instead use `Class.new()`");}static new(a){a=new this(a,!0);a.setupDefaultRules();
return a}setupDefaultRules(){}_lookupRules(a){return this._rules[a]}ruleRaw(a,b=[]){let c=this._rules[a];c||=this._rules[a]=[];b.sort(K);const {index:d,found:e}=cb(c,f=>{const g=K(f.tags.length,b.length);return 0===g?Ua(f.tags,b,K):g});if(e)return c[d].template;a=Z.new({});c.splice(d,0,{tags:b,template:a});return a}rule(a,b=[]){return this.ruleRaw(a,b)}}h.ArrayDisposer=kb;h.Color=v;h.Container=O;h.CounterDisposer=Xa;h.DEGREES=nb;h.Disposer=z;h.DisposerClass=Ea;h.Entity=H;h.EventDispatcher=P;h.Graphics=
Q;h.GridLayout=U;h.HorizontalLayout=S;h.Label=ra;h.List=Fa;h.ListAutoDispose=Ya;h.ListTemplate=lb;h.MultiDisposer=C;h.PLACEHOLDER="__\u00a7\u00a7\u00a7__";h.PLACEHOLDER2="__\u00a7\u00a7\u00a7\u00a7__";h.Percent=t;h.RADIANS=Ba;h.Rectangle=R;h.Settings=$a;h.Template=Z;h.Text=ca;h.TextFormatter=oa;h.Theme=wb;h.VerticalLayout=T;h.addEventListener=xa;h.addLicense=function(a){M.licenses.push(a)};h.blur=function(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();
else{let a=document.createElement("button");a.style.position="fixed";a.style.top="0px";a.style.left="-10000px";document.body.appendChild(a);a.focus();a.blur();document.body.removeChild(a)}};h.capitalizeFirst=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};h.ceil=function(a,b){if(!n(b)||0>=b)return Math.ceil(a);b=Math.pow(10,b);return Math.ceil(a*b)/b};h.cleanFormat=function(a){return a.replace(/\/(date|number|duration)$/i,"")};h.color=function(a){return v.fromAny(a)};h.compare=K;h.compareNumber=
function(a,b){return a===b?0:a<b?-1:1};h.copy=function(a){return Object.assign({},a)};h.copy$1=function(a){const b=a.length,c=Array(b);for(let d=0;d<b;++d)c[d]=a[d];return c};h.cos=na;h.cubic=Ta;h.decimalPlaces=function(a){return(a=(""+a).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/))?Math.max(0,(a[1]?a[1].length:0)-(a[2]?+a[2]:0)):0};h.each=p;h.each$1=u;h.eachContinue=function(a,b){for(let c in a)if({}.hasOwnProperty.call(a,c)&&!b(c,a[c]))break};h.eachContinue$1=function(a,b){const c=a.length;for(let d=
0;d<c&&b(a[d],d);++d);};h.escapeForRgex=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$\x26")};h.find=La;h.fitToRange=Aa;h.focus=function(a){a&&a.focus()};h.get12Hours=function(a,b){12<a?a-=12:0===a&&(a=12);return null!=b?a+(b-1):a};h.getArcBounds=function(a,b,c,d,e){let f=Number.MAX_VALUE,g=Number.MAX_VALUE,k=-Number.MAX_VALUE,l=-Number.MAX_VALUE,q=[];q.push(Ca(e,c));q.push(Ca(e,d));var m=Math.min(90*Math.floor(c/90),90*Math.floor(d/90));let w=Math.max(90*Math.ceil(c/90),90*Math.ceil(d/
90));for(;m<=w;m+=90)m>=c&&m<=d&&q.push(Ca(e,m));for(c=0;c<q.length;c++)d=q[c],d.x<f&&(f=d.x),d.y<g&&(g=d.y),d.x>k&&(k=d.x),d.y>l&&(l=d.y);return{left:a+f,top:b+g,right:a+k,bottom:b+l}};h.getDayFromWeek=function(a,b,c=1,d=!1){let e=new Date(b,0,4,0,0,0,0);d&&e.setUTCFullYear(b);return 7*a+c-((e.getDay()||7)+3)};h.getEventKey=function(a){if(void 0!==a.key)return a.key;switch(a.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";
case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+a.keyCode};h.getEventTarget=function(a){return a.composedPath?(a=a.composedPath(),0===a.length?null:a[0]):a.target};h.getMonthWeek=function(a,b=!1){const c=za(new Date(a.getFullYear(),a.getMonth(),1),b);a=za(a,b);1==a&&(a=53);return a-c+1};h.getRendererEvent=function(a){if(!ia("pointerevents"))if(ia("touchevents"))switch(a){case "pointerover":return"touchstart";case "pointerout":return"touchend";
case "pointerleave":return"touchend";case "pointerdown":return"touchstart";case "pointermove":return"touchmove";case "pointerup":return"touchend";case "click":return"click";case "dblclick":return"dblclick"}else if(ia("mouseevents"))switch(a){case "pointerover":return"mouseover";case "pointerout":return"mouseout";case "pointerleave":return"mouseleave";case "pointerdown":return"mousedown";case "pointermove":return"mousemove";case "pointerup":return"mouseup";case "click":return"click";case "dblclick":return"dblclick"}return a};
h.getSafeResolution=function(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document?1:void 0};h.getStyle=function(a,b){return a.style[b]};h.getTimeZone=function(a,b=!1,c=!1,d=!1,e){if(d)return b?"Coordinated Universal Time":"UTC";if(e)return c=a.toLocaleString("en-US",{timeZone:e}),a=a.toLocaleString("en-US",{timeZone:e,timeZoneName:b?"long":"short"}),ka(a.substr(c.length));e=a.toLocaleString("UTC");a=a.toLocaleString("UTC",{timeZoneName:b?"long":"short"}).substr(e.length);!1===c&&(a=a.replace(/ (standard|daylight|summer|winter) /i,
" "));return ka(a)};h.getTimezoneOffset=function(a){const b=new Date(Date.UTC(2012,0,1,0,0,0,0)),c=new Date(b.toLocaleString("en-US",{timeZone:"UTC"}));return((new Date(b.toLocaleString("en-US",{timeZone:a}))).getTime()-c.getTime())/6E4*-1};h.getWeek=za;h.getWeekYear=function(a,b){a=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()));b=a.getUTCDay()||7;a.setUTCDate(a.getUTCDate()+4-b);return(new Date(Date.UTC(a.getUTCFullYear(),0,1))).getFullYear()};h.getYearDay=function(a,b){b=new Date(a.getFullYear(),
0,0);a=a.getTime()-b.getTime()+6E4*(b.getTimezoneOffset()-a.getTimezoneOffset());return Math.floor(a/864E5)};h.indexOf=V;h.isLocalEvent=Ma;h.isNaN=fa;h.isNumber=n;h.isObject=ua;h.isString=sa;h.isTouchEvent=ya;h.keepIf=function(a,b){let c=a.length;for(;0<c;)--c,b(a[c])||a.splice(c,1)};h.keys=A;h.map=function(a,b){const c=a.length,d=Array(c);for(let e=0;e<c;++e)d[e]=b(a[e],e);return d};h.mergeBounds=function(a){const b=a.length;if(0<b){let c=a[0],d=c.left,e=c.top,f=c.right,g=c.bottom;if(1<b)for(let k=
1;k<b;k++)c=a[k],d=Math.min(c.left,d),f=Math.max(c.right,f),e=Math.min(c.top,e),g=Math.max(c.bottom,g);return{left:d,right:f,top:e,bottom:g}}return{left:0,right:0,top:0,bottom:0}};h.mergeTags=function(a,b){a||=[];return[...a,...b].filter((c,d,e)=>e.indexOf(c)===d)};h.move=function(a,b,c){c=V(a,b);-1!==c&&a.splice(c,1);a.push(b)};h.normalizeAngle=function(a){a%=360;0>a&&(a+=360);return a};h.numberToString=function(a){if(fa(a))return"NaN";if(Infinity===a)return"Infinity";if(-Infinity===a)return"-Infinity";
if(0===a&&-Infinity===1/a)return"-0";let b=0>a;a=Math.abs(a);var c=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+a),d=c[1];let e=c[2]||"";void 0===c[3]?d=""===e?d:d+"."+e:(c=+c[3],1>a?d="0."+Array(c-1+1).join("0")+d+e:(a=c-e.length,d=0===a?d+e:0>a?d+e.slice(0,a)+"."+e.slice(a):d+e+Array(a+1).join("0")));return b?"-"+d:d};h.onZoom=function(a){return xa(window,"resize",b=>{a()})};h.out=function(a){return function(b){return 1-a(1-b)}};h.p0=jb;h.p100=Va;h.p50=Wa;h.padString=ja;h.percent=ea;
h.percentInterpolate=Ra;h.populateString=Y;h.pushOne=wa;h.registry=M;h.relativeToValue=F;h.remove=va;h.removeElement=function(a){a.parentNode&&a.parentNode.removeChild(a)};h.removeFirst=y;h.round=function(a,b,c){if(!n(b)||0>=b)return Math.round(a);b=Math.pow(10,b);return Math.round(a*b)/b};h.sameBounds=function(a,b){return b&&a.left==b.left&&a.right==b.right&&a.top==b.top&&a.bottom==b.bottom?!0:!1};h.setInteractive=function(a,b){a.style.pointerEvents=b?"auto":"none"};h.setStyle=function(a,b,c){a.style[b]=
c};h.sin=ma;h.splitString=function(a){const b=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,c=/([^\u0627\u0623\u062f\u0630\u0631\u0632\u0648]*[\u0627\u0623\u062f\u0630\u0631\u0632\u0648])/gi;let d=[];a.split(/(\s+)/).forEach(e=>{e.match(/^\s+$/)?(e=" ",d.push(" ")):b.test(e)?(e=e.split(c).filter(f=>""!==f),d=d.concat(e)):d=d.concat([...e])});return d};h.stripTags=function(a){return a?a.replace(/<[^>]*>/g,""):a};h.supports=ia;h.toNumber=ha;h.trim=ka;h.visualSettings=
"fill fillOpacity stroke strokeWidth strokeOpacity fillPattern strokePattern fillGradient strokeGradient strokeDasharray strokeDashoffset shadowBlur shadowColor shadowOpacity shadowOffsetX shadowOffsetY blur sepia invert brightness hue contrast saturate".split(" ")});