var fn=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Fi=(e,t)=>{for(var n in t)fn(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,i)=>{for(var s=i>1?void 0:i?Ti(t,n):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(s=(i?o(t,n,s):o(s))||s);return i&&s&&fn(t,n,s),s},L={};Fi(L,{error:()=>gn,errorOnce:()=>Oi,log:()=>Ii,logGroup:()=>Bi,reset:()=>Ei,table:()=>Di,warn:()=>pn,warnOnce:()=>ki});var Lt=new Set;function Ii(...e){console.log(...e)}function pn(e,...t){console.warn(`AG Charts - ${e}`,...t)}function gn(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function Di(...e){console.table(...e)}function ki(e,...t){const n=`Logger.warn: ${e}`;Lt.has(n)||(pn(e,...t),Lt.add(n))}function Oi(e,...t){const n=`Logger.error: ${e}`;Lt.has(n)||(gn(e,...t),Lt.add(n))}function Ei(){Lt.clear()}function Bi(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}function Re(e){return typeof e>"u"?[]:Array.isArray(e)?e:[e]}function Li(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function _i(e,t=1/0){switch(typeof e){case"undefined":return"undefined";case"number":if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";default:return e=JSON.stringify(e),e.length>t?`${e.slice(0,t)}... (+${e.length-t} characters)`:e}}function _t(e){return Array.isArray(e)}function $i(e){return typeof e=="boolean"}function zi(e){return e instanceof Date}function mn(e){return zi(e)&&!isNaN(Number(e))}function yn(e){return typeof e=="function"}function Ut(e){return typeof e=="object"&&e!==null&&!_t(e)}function Ne(e){return typeof e=="string"}function lt(e){return typeof e=="number"}function Te(e){return Number.isFinite(e)}var ut={};typeof window<"u"?ut.window=window:typeof global<"u"&&(ut.window=global.window),typeof document<"u"?ut.document=document:typeof global<"u"&&(ut.document=global.document);function Fe(e){return e?ut.document?.[e]:ut.document}function Ie(e){return e?ut.window?.[e]:ut.window}function Mn(e,t,n){const i=Fe().createElement(e);if(typeof t=="object"&&(n=t,t=void 0),t)for(const s of t.split(" "))i.classList.add(s);return n&&Object.assign(i.style,n),i}function Rt(e){return Fe().createElementNS("http://www.w3.org/2000/svg",e)}function Gi(e,t){const n=Fe("body"),i=Mn("a",{display:"none"});i.href=e,i.download=t,n.appendChild(i),i.click(),setTimeout(()=>n.removeChild(i))}var bn=new Map;function De(e){const t=e.constructor,n=Object.hasOwn(t,"className")?t.className:t.name;if(!n)throw new Error(`The ${t} is missing the 'className' property.`);const i=(bn.get(n)??0)+1;return bn.set(n,i),`${n}-${i}`}var Wi={containsPoint:Hi,isEmpty:qi,normalize:ji};function Hi(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function qi(e){return e==null||e.height===0||e.width===0||isNaN(e.height)||isNaN(e.width)}function ji(e){let{x:t,y:n,width:i,height:s}=e;return(i==null||i>0)&&(s==null||s>0)?e:(t!=null&&i!=null&&i<0&&(i=-i,t=t-i),n!=null&&s!=null&&s<0&&(s=-s,n=n-s),{x:t,y:n,width:i,height:s})}var xn=Symbol("interpolate");function Yi(e,t,n,i=1/0){const s={nearest:void 0,distanceSquared:i};for(const r of n){const o=r.distanceSquared(e,t);if(o===0)return{nearest:r,distanceSquared:0};ot[1]&&(t[1]=n);return t}function nt(e,t,n=1e-10){return e===t||Math.abs(e-t)=1e21){let s;[t,s]=t.split("e"),s!=null&&(n=Number(s))}const i=t.split(".")[1]?.length??0;return Math.max(i-n,0)}var $t=class Bt{constructor(t,n,i,s){this.x=t,this.y=n,this.width=i,this.height=s}static fromDOMRect({x:t,y:n,width:i,height:s}){return new Bt(t,n,i,s)}static merge(t){let n=1/0,i=1/0,s=-1/0,r=-1/0;for(const o of t)o.xs&&(s=o.x+o.width),o.y+o.height>r&&(r=o.y+o.height);return new Bt(n,i,s-n,r-i)}static nearestBox(t,n,i){return Yi(t,n,i)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:t,y:n,width:i,height:s}=this;return new Bt(t,n,i,s)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}containsPoint(t,n){return Wi.containsPoint(this,t,n)}intersection(t){if(!this.collidesBBox(t))return;const n=O(t.x,this.x,t.x+t.width),i=O(t.y,this.y,t.y+t.height),s=O(t.x,this.x+this.width,t.x+t.width),r=O(t.y,this.y+this.height,t.y+t.height);return new Bt(n,i,s-n,r-i)}collidesBBox(t){return this.xt.x&&this.yt.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,n){if(this.containsPoint(t,n))return 0;const i=t-O(this.x,t,this.x+this.width),s=n-O(this.y,n,this.y+this.height);return i*i+s*s}shrink(t,n){if(typeof t=="number")this.applyMargin(t,n);else for(const[i,s]of Object.entries(t))this.applyMargin(s,i);return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,n){if(typeof t=="number")this.applyMargin(-t,n);else for(const[i,s]of Object.entries(t))this.applyMargin(-s,i);return this}applyMargin(t,n){switch(n){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,n){return this.x+=t,this.y+=n,this}[xn](t,n){return new Bt(this.x*(1-n)+t.x*n,this.y*(1-n)+t.y*n,this.width*(1-n)+t.width*n,this.height*(1-n)+t.height*n)}};$t.zero=Object.freeze(new $t(0,0,0,0)),$t.NaN=Object.freeze(new $t(NaN,NaN,NaN,NaN));var H=$t;function N(e){return function(t,n){const i=`__${n}`;t[n]||Ui(t,n,i,e)}}function Ui(e,t,n,i){const{type:s="normal",changeCb:r,convertor:o,checkDirtyOnAssignment:c=!1}=i??{},a={type:s,changeCb:r,checkDirtyOnAssignment:c,convertor:o};let h;switch(s){case"normal":h=Qi(n,a);break;case"transform":h=ts(n);break;case"path":h=es(n);break}h=Ki(Zi(Ji(h,a),a),a),Object.defineProperty(e,t,{set:h,get:function(){return this[n]},enumerable:!0,configurable:!0})}function Ji(e,t){const{convertor:n}=t;return n?function(i){e.call(this,n(i))}:e}var Jt=Symbol("no-change");function Zi(e,t){const{changeCb:n}=t;return n?function(i){const s=e.call(this,i);return s!==Jt&&n.call(this,this),s}:e}function Ki(e,t){const{checkDirtyOnAssignment:n}=t;return n?function(i){const s=e.call(this,i);return i?._dirty===!0&&this.markDirty(),s}:e}function Qi(e,t){const{changeCb:n}=t;return function(i){const s=this[e];return i!==s?(this[e]=i,this.markDirty(),n?.(this),i):Jt}}function ts(e){return function(t){const n=this[e];return t!==n?(this[e]=t,this.markDirtyTransform(),t):Jt}}function es(e){return function(t){const n=this[e];return t!==n?(this[e]=t,this._dirtyPath||(this._dirtyPath=!0,this.markDirty()),t):Jt}}var Zt=class Ci{constructor(t){this.serialNumber=Ci._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=De(this),this.pointerEvents=0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0}static toSVG(t,n,i){const s=t?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const r=Rt("svg");if(r.setAttribute("width",String(n)),r.setAttribute("height",String(i)),r.setAttribute("viewBox",`0 0 ${n} ${i}`),s.defs?.length){const o=Rt("defs");o.append(...s.defs),r.append(o)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(t,n){for(const i of t)if(!n||i.visible&&!i.transitionOut){const s=i.getBBox();s&&(yield s)}}get datum(){return this._datum??this.parentNode?.datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}preRender(t,n=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=n,this.childNodeCounts.thisComplexity=n;for(const i of this.children()){const s=i.preRender(t);this.childNodeCounts.groups+=s.groups,this.childNodeCounts.nonGroups+=s.nonGroups,this.childNodeCounts.complexity+=s.complexity}return this.childNodeCounts}render(t){const{stats:n}=t;if(this._dirty=!1,t.debugNodeSearch){const i=this.name??this.id;t.debugNodeSearch.some(s=>typeof s=="string"?s===i:s.test(i))&&(t.debugNodes[this.name??this.id]=this)}n&&(n.nodesRendered++,n.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(t){this._layerManager=t,this._debug=t?.debug;for(const n of this.children())n._setLayerManager(t)}sortChildren(t){if(this.dirtyZIndex=!1,!this.childNodes)return;const n=[...this.childNodes].sort(t);this.childNodes.clear();for(const i of n)this.childNodes.add(i)}*traverseUp(t){let n=this;for(t&&(yield n);n=n.parentNode;)yield n}*children(){if(this.childNodes)for(const t of this.childNodes)yield t}*descendants(){for(const t of this.children())yield t,yield*t.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(t){this.childNodes??(this.childNodes=new Set);for(const n of Li(t))n.parentNode?.removeChild(n),this.childNodes.add(n),n.parentNode=this,n._setLayerManager(this.layerManager);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){return this.childNodes?.delete(t)?(delete t.parentNode,t._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty(),!0):!1}remove(){return this.parentNode?.removeChild(this)??!1}clear(){for(const t of this.children())delete t.parentNode,t._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(t,n){if(n)for(const i of n)this[i]=t[i];else Object.assign(this,t);return this}containsPoint(t,n){return!1}pickNode(t,n,i=!1){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,n))return;const s=[...this.children()];if(s.length>1e3)for(let r=s.length-1;r>=0;r--){const o=s[r],a=o.containsPoint(t,n)?o.pickNode(t,n):void 0;if(a)return a}else if(s.length)for(let r=s.length-1;r>=0;r--){const o=s[r].pickNode(t,n);if(o)return o}else if(!this.isContainerNode)return this}invalidateCachedBBox(){this.cachedBBox!=null&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}markDirty(){const{_dirty:t}=this;this.cachedBBox==null&&t||(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1;for(const t of this.children())t.markClean()}}onZIndexChange(){const{parentNode:t}=this;t&&(t.dirtyZIndex=!0)}toSVG(){}};Zt._nextSerialNumber=0,m([N()],Zt.prototype,"visible",2),m([N({changeCb:e=>e.onZIndexChange()})],Zt.prototype,"zIndex",2);var Kt=Zt;function ns(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var vn=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const n=this.store.keys();let i=this.store.size-this.maxCacheSize;for(;i>0;){const s=n.next();s.done||this.store.delete(s.value),i--}}return t}clear(){this.store.clear()}},ke=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t=typeof e.font=="string"?e.font:$.toFontString(e.font),n=`${t}-${e.textAlign??"start"}-${e.textBaseline??"alphabetic"}`;return this.instanceMap.get(n)??this.createFontMeasurer(t,e,n)}static createFontMeasurer(e,t,n){const i=ns();i.font=e,i.textAlign=t.textAlign??"start",i.textBaseline=t.textBaseline??"alphabetic";const s=new is(i,t);return this.instanceMap.set(n,s),s}};ke.instanceMap=new vn(10);var is=class{constructor(e,t){this.ctx=e,this.measureMap=new vn(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=typeof t.font=="string"?t.font:$.toFontString(t.font),this.textMeasurer=new wn(n=>this.cachedCtxMeasureText(n),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},$=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:n,fontFamily:i,lineHeight:s}){let r="";return t&&(r+=`${t} `),n&&(r+=`${n} `),r+=`${e}px`,s&&(r+=`/${s}px`),r+=` ${i}`,r.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};$.EllipsisChar="\u2026",$.defaultLineHeight=1.15,$.lineSplitter=/\r?\n/g;var wn=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}}getMultilineMetrics(e){let t=0,n=0,i=0,s=0,r=0;const o=$.getVerticalModifier(this.textBaseline),c=[];let a=0;const h=e.length;for(const l of e){const u=this.measureTextFn(l);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t=typeof e=="string"?e.split($.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},Sn=[1,0,0,1,0,0],yt=class we{get e(){return[...this.elements]}constructor(t=Sn){this.elements=[...t]}setElements(t){const n=this.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],this}get identity(){const t=this.elements;return nt(t[0],1)&&nt(t[1],0)&&nt(t[2],0)&&nt(t[3],1)&&nt(t[4],0)&&nt(t[5],0)}AxB(t,n,i){const s=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],o=t[0]*n[2]+t[2]*n[3],c=t[1]*n[2]+t[3]*n[3],a=t[0]*n[4]+t[2]*n[5]+t[4],h=t[1]*n[4]+t[3]*n[5]+t[5];i=i??t,i[0]=s,i[1]=r,i[2]=o,i[3]=c,i[4]=a,i[5]=h}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const n=new Array(6);return t instanceof we?this.AxB(this.elements,t.elements,n):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],n),new we(n)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let n=t[0],i=t[1],s=t[2],r=t[3];const o=t[4],c=t[5],a=1/(n*r-i*s);return n*=a,i*=a,s*=a,r*=a,new we([r,-i,-s,n,s*c-r*o,i*o-n*c])}invertSelf(){const t=this.elements;let n=t[0],i=t[1],s=t[2],r=t[3];const o=t[4],c=t[5],a=1/(n*r-i*s);return n*=a,i*=a,s*=a,r*=a,t[0]=r,t[1]=-i,t[2]=-s,t[3]=n,t[4]=s*c-r*o,t[5]=i*o-n*c,this}transformPoint(t,n){const i=this.elements;return{x:t*i[0]+n*i[2]+i[4],y:t*i[1]+n*i[3]+i[5]}}transformBBox(t,n){const i=this.elements,s=i[0],r=i[1],o=i[2],c=i[3],a=t.width*.5,h=t.height*.5,l=t.x+a,u=t.y+h,d=Math.abs(a*s)+Math.abs(h*o),f=Math.abs(a*r)+Math.abs(h*c);return n??(n=new H(0,0,0,0)),n.x=l*s+u*o+i[4]-d,n.y=l*r+u*c+i[5]-f,n.width=d+d,n.height=f+f,n}toContext(t){if(this.identity)return;const n=this.elements;t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}static updateTransformMatrix(t,n,i,s,r,o,c){const a=n,h=i;let l,u;a===1&&h===1?(l=0,u=0):(l=c?.scalingCenterX??0,u=c?.scalingCenterY??0);const d=s,f=Math.cos(d),p=Math.sin(d);let y,g;d===0?(y=0,g=0):(y=c?.rotationCenterX??0,g=c?.rotationCenterY??0);const M=r,b=o,w=l*(1-a)-y,R=u*(1-h)-g;return t.setElements([f*a,p*a,-p*h,f*h,f*w-p*R+y+M,p*w+f*R+g+b]),t}};function dt(e){return Pn(e.constructor)}var Cn=Symbol("isMatrixTransform");function Pn(e){return e[Cn]===!0}function Oe(e){var t,n;const i=e;if(Pn(e))return e;const s=Symbol("matrix_combined_transform");class r extends i{constructor(){super(...arguments),this[n]=new yt,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(c){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(Sn),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(c){return this.computeTransformMatrix(),this[s].identity?c.clone():this[s].transformBBox(c)}toParentPoint(c,a){return this.computeTransformMatrix(),this[s].identity?{x:c,y:a}:this[s].transformPoint(c,a)}fromParent(c){return this.computeTransformMatrix(),this[s].identity?c.clone():this[s].inverse().transformBBox(c)}fromParentPoint(c,a){return this.computeTransformMatrix(),this[s].identity?{x:c,y:a}:this[s].inverse().transformPoint(c,a)}computeBBox(){const c=super.computeBBox();return c&&this.toParent(c)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(c,a,h=!1){return h||({x:c,y:a}=this.fromParentPoint(c,a)),super.pickNode(c,a)}render(c){this.computeTransformMatrix();const{ctx:a}=c,h=this[s];let l=!1;h.identity||(a.save(),l=!0,h.toContext(a)),super.render(c),l&&a.restore()}toSVG(){this.computeTransformMatrix();const c=super.toSVG(),a=this[s];if(a.identity||c==null)return c;const h=Rt("g");h.append(...c.elements);const[l,u,d,f,p,y]=a.e;return h.setAttribute("transform",`matrix(${l} ${u} ${d} ${f} ${p} ${y})`),{elements:[h],defs:c.defs}}}return t=Cn,n=s,r[t]=!0,r}function zt(e){var t;const n=e,i=Symbol("matrix_rotation");class s extends Oe(n){constructor(){super(...arguments),this[t]=new yt,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:c,rotationCenterX:a,rotationCenterY:h}=this;c!==0&&(yt.updateTransformMatrix(this[i],1,1,c,0,0,{rotationCenterX:a,rotationCenterY:h}),o.multiplySelf(this[i]))}}return t=i,m([N({type:"transform"})],s.prototype,"rotationCenterX",2),m([N({type:"transform"})],s.prototype,"rotationCenterY",2),m([N({type:"transform"})],s.prototype,"rotation",2),s}function An(e){var t;const n=e,i=Symbol("matrix_scale");class s extends Oe(n){constructor(){super(...arguments),this[t]=new yt,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(o){super.updateMatrix(o);const{scalingX:c,scalingY:a,scalingCenterX:h,scalingCenterY:l}=this;c===1&&a===1||(yt.updateTransformMatrix(this[i],c,a,0,0,0,{scalingCenterX:h,scalingCenterY:l}),o.multiplySelf(this[i]))}}return t=i,m([N({type:"transform"})],s.prototype,"scalingX",2),m([N({type:"transform"})],s.prototype,"scalingY",2),m([N({type:"transform"})],s.prototype,"scalingCenterX",2),m([N({type:"transform"})],s.prototype,"scalingCenterY",2),s}function Qt(e){var t;const n=e,i=Symbol("matrix_translation");class s extends Oe(n){constructor(){super(...arguments),this[t]=new yt,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:c,translationY:a}=this;c===0&&a===0||(yt.updateTransformMatrix(this[i],1,1,0,c,a),o.multiplySelf(this[i]))}}return t=i,m([N({type:"transform"})],s.prototype,"translationX",2),m([N({type:"transform"})],s.prototype,"translationY",2),s}var Nt=class{static fromCanvas(e,t){const n=[];for(const i of e.traverseUp())dt(i)&&n.unshift(i);for(const i of n)t=i.fromParent(t);return dt(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():dt(e)&&(t=e.toParent(t));for(const n of e.traverseUp())dt(n)&&(t=n.toParent(t));return t}static fromCanvasPoint(e,t,n){const i=[];for(const s of e.traverseUp())dt(s)&&i.unshift(s);for(const s of i)({x:t,y:n}=s.fromParentPoint(t,n));return dt(e)&&({x:t,y:n}=e.fromParentPoint(t,n)),{x:t,y:n}}static toCanvasPoint(e,t,n){dt(e)&&({x:t,y:n}=e.toParentPoint(t,n));for(const i of e.traverseUp())dt(i)&&({x:t,y:n}=i.toParentPoint(t,n));return{x:t,y:n}}},te=(e,t,n)=>e*(1-n)+t*n,Ee=e=>{const t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4},Be=e=>{const t=e<0?-1:1,n=Math.abs(e);return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e},Rn=class F{constructor(t,n,i,s=1){this.r=O(0,t||0,1),this.g=O(0,n||0,1),this.b=O(0,i||0,1),this.a=O(0,s||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!F.parseHex(t):t.indexOf("rgb")>=0?!!F.stringToRgba(t):F.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return F.fromHexString(t);const n=F.nameToHex.get(t.toLowerCase());if(n)return F.fromHexString(n);if(t.indexOf("rgb")>=0)return F.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let n;switch(t.length){case 6:case 8:n=[];for(let i=0;iparseInt(i,16)).map(i=>i+i*16);break}if(n?.length>=3&&n.every(i=>i>=0))return n.length===3&&n.push(255),n}static fromHexString(t){const n=F.parseHex(t);if(n){const[i,s,r,o]=n;return new F(i/255,s/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let n=-1,i=-1;for(let c=0;c=0?(h=O(0,h,100),h/=100):c===3?h=O(0,h,1):(h=O(0,h,255),h/=255),o.push(h)}return o}static fromRgbaString(t){const n=F.stringToRgba(t);if(n){if(n.length===3)return new F(n[0],n[1],n[2]);if(n.length===4)return new F(n[0],n[1],n[2],n[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new F(t[0],t[1],t[2],t[3]);if(t.length===3)return new F(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,n,i,s=1){const r=F.HSBtoRGB(t,n,i);return new F(r[0],r[1],r[2],s)}static fromHSL(t,n,i,s=1){const r=F.HSLtoRGB(t,n,i);return new F(r[0],r[1],r[2],s)}static fromOKLCH(t,n,i,s=1){const r=F.OKLCHtoRGB(t,n,i);return new F(r[0],r[1],r[2],s)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+F.padHex(Math.round(this.r*255).toString(16))+F.padHex(Math.round(this.g*255).toString(16))+F.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=F.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const n=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],i=Math.pow(10,t);return this.a!==1?(n.push(Math.round(this.a*i)/i),`rgba(${n.join(", ")})`):`rgb(${n.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return F.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,n,i){const s=Ee(t),r=Ee(n),o=Ee(i),c=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*o),a=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*o),h=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*o),l=.2104542553*c+.793617785*a-.0040720468*h,u=1.9779984951*c-2.428592205*a+.4505937099*h,d=.0259040371*c+.7827717662*a-.808675766*h,f=Math.atan2(d,u)*180/Math.PI,p=l,y=Math.hypot(u,d),g=f>=0?f:f+360;return[p,y,g]}static OKLCHtoRGB(t,n,i){const s=t,r=n*Math.cos(i*Math.PI/180),o=n*Math.sin(i*Math.PI/180),c=(s+.3963377774*r+.2158037573*o)**3,a=(s-.1055613458*r-.0638541728*o)**3,h=(s-.0894841775*r-1.291485548*o)**3,l=4.0767416621*c-3.3077115913*a+.2309699292*h,u=-1.2684380046*c+2.6097574011*a-.3413193965*h,d=-.0041960863*c-.7034186147*a+1.707614701*h,f=Be(l),p=Be(u),y=Be(d);return[f,p,y]}static RGBtoHSL(t,n,i){const s=Math.min(t,n,i),r=Math.max(t,n,i),o=(r+s)/2;let c,a;if(r===s)c=0,a=0;else{const h=r-s;a=o>.5?h/(2-r-s):h/(r+s),r===t?c=(n-i)/h+(n1&&(l-=1),l<1/6?r+(s-r)*6*l:l<1/2?s:l<2/3?r+(s-r)*(2/3-l)*6:r}const c=o(t/360+1/3),a=o(t/360),h=o(t/360-1/3);return[c,a,h]}static RGBtoHSB(t,n,i){const s=Math.min(t,n,i),r=Math.max(t,n,i),o=r===0?0:(r-s)/r;let c=0;if(s!==r){const a=r-s,h=(r-t)/a,l=(r-n)/a,u=(r-i)/a;t===r?c=u-l:n===r?c=2+h-u:c=4+l-h,c/=6,c<0&&(c=c+1)}return[c*360,o,r]}static HSBtoRGB(t,n,i){t=(t%360+360)%360/360;let s=0,r=0,o=0;if(n===0)s=r=o=i;else{const c=(t-Math.floor(t))*6,a=c-Math.floor(c),h=i*(1-n),l=i*(1-n*a),u=i*(1-n*(1-a));switch(c>>0){case 0:s=i,r=u,o=h;break;case 1:s=l,r=i,o=h;break;case 2:s=h,r=i,o=u;break;case 3:s=h,r=l,o=i;break;case 4:s=u,r=h,o=i;break;case 5:s=i,r=h,o=l;break}}return[s,r,o]}static mix(t,n,i){return new F(te(t.r,n.r,i),te(t.g,n.g,i),te(t.b,n.b,i),te(t.a,n.a,i))}};Rn.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var ee=Rn,Le=class{ticks(e,t,n){}niceDomain(e,t=this.domain){return t}tickFormatter(e){}datumFormatter(e){}get bandwidth(){}get step(){}get inset(){}},Gt=(e,t)=>{const n=Symbol(String(t));e[n]=void 0,Object.defineProperty(e,t,{get(){return this[n]},set(i){this[n]!==i&&(this[n]=i,this.invalid=!0)},enumerable:!0,configurable:!1})},Nn=e=>{const t=ee.fromString(e),[n,i,s]=ee.RGBtoOKLCH(t.r,t.g,t.b);return{l:n,c:i,h:s,a:t.a}},_e=1e-6,Tn=e=>e.c<_e||e.l<_e||e.l>1-_e,ss=(e,t,n)=>{n=O(0,n,1);let i;if(Tn(e))i=t.h;else if(Tn(t))i=e.h;else{const c=e.h;let a=t.h;const h=t.h-e.h;h>180?a-=360:h<-180&&(a+=360),i=c*(1-n)+a*n}const s=e.c*(1-n)+t.c*n,r=e.l*(1-n)+t.l*n,o=e.a*(1-n)+t.a*n;return ee.fromOKLCH(r,s,i,o)},ne=class extends Le{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Nn)}update(){const{domain:e,range:t}=this;e.length<2&&(L.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let n=1;n=s){L.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,o)=>r-o);break}}if(t.length0?t[0]:"black");this.parsedRange=this.range.map(Nn)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:n,parsedRange:i}=this,s=t[0],r=t.at(-1),o=n[0],c=n[n.length-1];if(e<=s)return o;if(e>=r)return c;let a,h;if(t.length===2){const d=(e-s)/(r-s),f=1/(n.length-1);a=n.length<=2?0:Math.min(Math.floor(d*(n.length-1)),n.length-2),h=(d-a*f)/f}else{for(a=0;a=Math.PI&&(e-=Mt),e}function Tt(e,t,n){const i=z(e),s=z(t),r=z(n);return sr?s<=i||i<=r:!0}function Ft(e){return e/180*Math.PI}function $e(e,t){return e=z(e),t=z(t),t-e+(e>t?Mt:0)}var Dn=class extends Fn{constructor(e,t,n=0,i){super(e,t,i),this.angle=n}createCanvasGradient(e,t){const{angle:i}=this,s=z(Ft(i+90)),r=Math.cos(s),o=Math.sin(s),c=t.width,a=t.height,h=t.x+c*.5,l=t.y+a*.5,u=Math.sqrt(a*a+c*c)/2,d=Math.atan2(a,c);let f;sp.length>2)&&(f=c?c.call(this):s.get(this));for(const p of u)if(l=p(this,t,l,f),l===ze)return;o?o.call(this,l):s.set(this,l);for(const p of d)p(this,l,f)},get:function(){let l=c?c.call(this):s.get(this);for(const u of n[i].getters)if(l=u(this,t,l),l===ze)return;return l},enumerable:!0,configurable:!1}),n[i]}function On(e,t,n){return(i,s)=>{const r=kn(i,s);r.setters.push(e),t&&r.getters.unshift(t),n&&Object.assign(r,n)}}function rs(e){return(t,n)=>{kn(t,n).observers.push(e)}}function En(e){return typeof e<"u"&&It in e}function Ge(e){const t=new Set;for(;En(e);)t.add(e?.[It]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(n=>Object.keys(n))}function os(e,t){const n=t.toString();for(;En(e);){const i=e[It];if(Object.hasOwn(i,n))return i[n];e=Object.getPrototypeOf(e)}}var We=class{set(e){const{className:t=this.constructor.name}=this.constructor;if(typeof e!="object")return L.warn(`unable to set ${t} - expecting a properties object`),this;const n=new Set(Object.keys(e));for(const i of Ge(this))if(n.has(i)){const s=e[i],r=this;if(Dt(r[i]))if(r[i]instanceof Bn){const o=r[i].reset(s);o!=null?r[i]=o:L.warn(`unable to set [${i}] - expecting a properties array`)}else r[i].set(s);else r[i]=s;n.delete(i)}for(const i of n)L.warn(`unable to set [${i}] in ${t} - property is unknown`);return this}isValid(e){return Ge(this).every(t=>{const{optional:n}=os(this,t),i=n===!0||typeof this[t]<"u";return i||L.warnOnce(`${e??""}[${t}] is required.`),i})}toJson(){return Ge(this).reduce((e,t)=>{const n=this[t];return e[t]=Dt(n)?n.toJson():n,e},{})}},Bn=class Pi extends Array{constructor(t,...n){super(n.length);const s=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(n)}set(t){if(_t(t)){this.length=t.length;for(let n=0;nt?.toJson?.()??t)}};function Dt(e){return e instanceof We||e instanceof Bn}function q(e,t={}){const{optional:n=!1,property:i}=t;return On((s,r,o)=>{const c={...t,target:s,property:r};if(n&&typeof o>"u"||e(o,c))return Dt(s[r])&&!Dt(o)?(s[r].set(o),s[r]):o;const a=i??String(r).replace(/^_*/,""),h=s.constructor.className??s.constructor.name.replace(/Properties$/,""),l=_i(o,50);return L.warn(`Property [${a}] of [${h}] cannot be set to [${l}]${e.message?`; expecting ${Wt(e,c)}`:""}, ignoring.`),ze},void 0,{optional:n})}var Ln=(...e)=>{const t=[];return k((n,i)=>(t.length=0,e.every(s=>{const r=s(n,i);return r||t.push(Wt(s,i)),r})),()=>t.filter(Boolean).join(" AND "))},kt=(...e)=>k((t,n)=>e.some(i=>i(t,n)),t=>e.map(ms(t)).filter(Boolean).join(" OR ")),as=je(k((e,t)=>Dt(e)||Ut(e)&&Dt(t.target[t.property]),"a properties object")),kr=je(k(e=>Ut(e),"an object")),_n=k($i,"a boolean"),Or=k(yn,"a function"),ie=k(Ne,"a string"),rt=Ms(k(Te,"a number")),Er=k(e=>lt(e)&&!isNaN(e),"a real number"),He=k(e=>lt(e)&&isNaN(e),"NaN"),bt=rt.restrict({min:0}),Br=rt.restrict({min:0,max:1}),Lr=kt(rt,He),cs=ys(k(_t,"an array")),xt=(e,t)=>k((n,i)=>_t(n)&&n.every(s=>e(s,i)),n=>{const i=Wt(cs,n)??"";return typeof t=="function"?`${i} of ${t(n)}`:t?`${i} of ${t}`:i}),se=e=>Te(e)||mn(e),hs=e=>k((t,n)=>!se(t)||!se(n.target[e])||tk((t,n)=>!se(t)||!se(n.target[e])||t>n.target[e],`to be greater than ${e}`),$n=k(mn,"Date object"),_r=kt($n,bt),zn="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",qe=k(e=>Ne(e)&&ee.validColorString(e),`color String. ${zn}`),$r=je(k(e=>Ut(e)&&e.type==="gradient","a color gradient object")),zr=k(xt(qe),`color strings. ${zn}`),Gr=xt(_n,"boolean values"),Wr=xt(rt,"numbers"),Hr=xt(ie,"strings"),qr=k(xt($n),"Date objects"),jr=k(xt(as),"objects"),Yr=X(["butt","round","square"],"a line cap"),Xr=X(["round","bevel","miter"],"a line join"),Vr=X(["solid","dashed","dotted"],"a line style"),Ur=k(xt(bt),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),Jr=X(["top","right","bottom","left"],"a position"),us=X(["normal","italic","oblique"],"a font style"),ds=kt(X(["normal","bold","bolder","lighter"],"a font weight"),rt.restrict({min:1,max:1e3})),fs=X(["never","always","hyphenate","on-space"],"a text wrap strategy"),ps=X(["left","center","right"],"a text align"),Zr=X(["top","middle","bottom"],"a vertical align"),Kr=X(["ellipsis","hide"],"an overflow strategy"),Qr=X(["horizontal","vertical"],"a direction"),to=X(["inside","outside"],"a placement"),eo=kt(X(["exact","nearest"],"interaction range"),rt),no=X(["top","bottom","left","right"]);function X(e,t="a"){return k((n,i)=>{const s=e.find(r=>{const o=typeof r=="string"?r:r.value;return n===o});if(s==null)return!1;if(typeof s!="string"&&(s.deprecated===!0||s.deprecatedTo!=null)){const r=[`Property [%s] with value '${s.value}' is deprecated.`];s.deprecatedTo&&r.push(`Use ${s.deprecatedTo} instead.`),L.warnOnce(r.join(" "),i.property)}return!0},`${t} keyword such as ${gs(e)}`)}var io=kt(Ln(rt.restrict({min:1}),hs("maxSpacing")),He),so=kt(Ln(rt.restrict({min:1}),ls("minSpacing")),He);function k(e,t){return e.message=t,e}function gs(e){const t=e.filter(i=>typeof i=="string"||i.undocumented!==!0).map(i=>`'${typeof i=="string"?i:i.value}'`);if(t.length===1)return t[0];const n=t.pop();return`${t.join(", ")} or ${n}`}function Wt(e,t){return yn(e.message)?e.message(t):e.message}function ms(e){return t=>Wt(t,e)}function ys(e){return Object.assign(e,{restrict({length:t,minLength:n}={}){let i="an array";return lt(n)&&n>0?i="a non-empty array":lt(t)&&(i=`an array of length ${t}`),k(s=>_t(s)&&(lt(t)?s.length===t:!0)&&(lt(n)?s.length>=n:!0),i)}})}function Ms(e){return Object.assign(e,{restrict({min:t,max:n}={}){const i=["a number"],s=lt(t),r=lt(n);return s&&r?i.push(`between ${t} and ${n} inclusive`):s?i.push(`greater than or equal to ${t}`):r&&i.push(`less than or equal to ${n}`),k(o=>Te(o)&&(s?o>=t:!0)&&(r?o<=n:!0),i.join(" "))}})}function je(e){return Object.assign(e,{restrict(t){return k(n=>n instanceof t,n=>Wt(e,n)??`an instance of ${t.name}`)}})}var Gn=class extends We{constructor(){super(...arguments),this.color="black"}};m([q(rt,{optional:!0})],Gn.prototype,"stop",2),m([q(qe,{optional:!0})],Gn.prototype,"color",2);function bs(e){let t;for(const{stop:n}of e)if(n!=null){if(t!=null&&n{const{offset:i}=t,s=e.at(n+1)?.color;return s!=null?[t,{offset:i,color:s}]:[t]})}function xs(e,t){const n=t==="discrete"?1:0,i=e.map((s,r,{length:o})=>({offset:(r+n)/(o-1+n),color:s}));return t==="discrete"?Wn(i):i}function vs(e,t,n,i="continuous"){if(e.length===0)return xs(t,i);if(!bs(e))return L.warnOnce("[fills] must have the stops defined in ascending order"),[];const s=Math.min(...n),r=Math.max(...n),o=i==="discrete",c=new Float64Array(e.length);let a=0,h=-1;for(let f=0;f=h){h=e.length-1;for(let g=f+1;gf.color!=null)?.color,u;const d=e.map(({color:f},p)=>{const y=c[p];return f!=null?l=f:l!=null?f=l:(u==null&&(u=new ne,u.domain=[0,1],u.range=t),f=u.convert(y)),{offset:y,color:f}});return i==="discrete"?Wn(d):d}function ws(e){return e!==null&&Ut(e)&&e.type=="gradient"}function ot(e,t,n){const i=Math.round(t*e)/e;return n==null?i:n===0?0:n<1?Math.ceil(n*e)/e:Math.round((n+t)*e)/e-i}function Hn(e,t){return Math.floor(t*e)/e}var Ss=/^linear-gradient\((-?[\d.]+)deg,(.*?)\)$/i,j=class et extends Kt{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=et.defaultStyles.fill,this.stroke=et.defaultStyles.stroke,this.strokeWidth=et.defaultStyles.strokeWidth,this.lineDash=et.defaultStyles.lineDash,this.lineDashOffset=et.defaultStyles.lineDashOffset,this.lineCap=et.defaultStyles.lineCap,this.lineJoin=et.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=et.defaultStyles.opacity,this.fillShadow=et.defaultStyles.fillShadow,this.gradientFillOptions={domain:[0,1],defaultColorRange:et.defaultStyles.defaultColorRange}}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}getGradient(t){let n;if(t instanceof Fn)return t;if(typeof t=="string"&&t?.startsWith("linear-gradient")&&(n=Ss.exec(t))){const i=parseFloat(n[1]),s=[],r=n[2],o=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let c;for(;c=o.exec(r);)s.push(c[0]);return new Dn("rgb",s.map((a,h)=>({color:a,offset:h/(s.length-1)})),i)}else if(ws(t))return this.createLinearGradient(t)}createLinearGradient(t){const{colorStops:n=[],direction:i}=t,s=i==="horizontal",{domain:r,defaultColorRange:o=[]}=this.gradientFillOptions,c=vs(n,o,r);return new Dn("oklch",c,s?0:90)}onFillChange(){this.fillGradient=this.getGradient(this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(t,n){return ot(this.layerManager?.canvas?.pixelRatio??1,t,n)}fillStroke(t,n){this.renderFill(t,n),this.renderStroke(t,n)}renderFill(t,n){if(this.fill){const{globalAlpha:i}=t;this.applyFill(t),this.applyFillAlpha(t),this.applyShadow(t),this.executeFill(t,n),t.globalAlpha=i}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,n){n?t.fill(n):t.fill()}applyFill(t){const n=this.gradientFillOptions.bbox??this.getBBox();t.fillStyle=this.fillGradient?.createGradient(t,n)??(typeof this.fill=="string"?this.fill:void 0)??"black"}applyStroke(t){t.strokeStyle=this.strokeGradient?.createGradient(t,this.getBBox())??(typeof this.stroke=="string"?this.stroke:void 0)??"black"}applyFillAlpha(t){t.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(t){const n=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(t.shadowColor=i.color,t.shadowOffsetX=i.xOffset*n,t.shadowOffsetY=i.yOffset*n,t.shadowBlur=i.blur*n)}renderStroke(t,n){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=t;this.applyStroke(t),t.globalAlpha*=this.opacity*this.strokeOpacity,t.lineWidth=this.strokeWidth,this.lineDash&&t.setLineDash(this.lineDash),this.lineDashOffset&&(t.lineDashOffset=this.lineDashOffset),this.lineCap&&(t.lineCap=this.lineCap),this.lineJoin&&(t.lineJoin=this.lineJoin),this.miterLimit!=null&&(t.miterLimit=this.miterLimit),this.executeStroke(t,n),t.globalAlpha=i}}executeStroke(t,n){n?t.stroke(n):t.stroke()}containsPoint(t,n){return this.isPointInPath(t,n)}applySvgFillAttributes(t){const{fill:n,fillOpacity:i}=this;t.setAttribute("fill",typeof n=="string"?n:"none"),t.setAttribute("fill-opacity",String(i))}applySvgStrokeAttributes(t){const{stroke:n,strokeOpacity:i,strokeWidth:s,lineDash:r,lineDashOffset:o}=this;if(n!=null&&(t.setAttribute("stroke",typeof n=="string"?n:"none"),t.setAttribute("stroke-opacity",String(i)),t.setAttribute("stroke-width",String(s))),r?.some(c=>c!==0)===!0){const c=r.length%2===1?[...r,...r]:r;t.setAttribute("stroke-dasharray",c.join(" ")),t.setAttribute("stroke-dashoffset",String(o))}}};j.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0,defaultColorRange:["#5090dc","#ef5452"]},m([N()],j.prototype,"fillOpacity",2),m([N()],j.prototype,"strokeOpacity",2),m([N({changeCb:e=>e.onFillChange()})],j.prototype,"fill",2),m([N({changeCb:e=>e.onStrokeChange()})],j.prototype,"stroke",2),m([N()],j.prototype,"strokeWidth",2),m([N()],j.prototype,"lineDash",2),m([N()],j.prototype,"lineDashOffset",2),m([N()],j.prototype,"lineCap",2),m([N()],j.prototype,"lineJoin",2),m([N()],j.prototype,"miterLimit",2),m([N({convertor:e=>O(0,e,1)})],j.prototype,"opacity",2),m([N({checkDirtyOnAssignment:!0})],j.prototype,"fillShadow",2),m([N({changeCb:e=>e.onFillChange()})],j.prototype,"gradientFillOptions",2);var at=j,U=class Se extends at{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=Se.defaultStyles.textAlign,this.textBaseline=Se.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(` `).map(t=>t.trim())??[]}static computeBBox(t,n,i,s){const{offsetTop:r,offsetLeft:o,width:c,height:a}=ke.measureLines(t,s);return new H(n-o,i-r,c,a)}computeBBox(){const{x:t,y:n,lines:i,textBaseline:s,textAlign:r}=this;return Se.computeBBox(i,t,n,{font:this,textBaseline:s,textAlign:r})}isPointInPath(t,n){const i=this.getBBox();return i?i.containsPoint(t,n):!1}render(t){const{ctx:n,stats:i}=t;if(!this.lines.length||!this.layerManager)return i&&(i.nodesSkipped+=1),super.render(t);const{fill:s,stroke:r,strokeWidth:o}=this,{pixelRatio:c}=this.layerManager.canvas;if(n.font=$.toFontString(this),n.textAlign=this.textAlign,n.textBaseline=this.textBaseline,s){this.applyFill(n),n.globalAlpha*=this.opacity*this.fillOpacity;const{fillShadow:a}=this;a?.enabled&&(n.shadowColor=a.color,n.shadowOffsetX=a.xOffset*c,n.shadowOffsetY=a.yOffset*c,n.shadowBlur=a.blur*c),this.renderLines((h,l,u)=>n.fillText(h,l,u))}if(r&&o){this.applyStroke(n),n.lineWidth=o,n.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:a,lineDashOffset:h,lineCap:l,lineJoin:u}=this;a&&n.setLineDash(a),h&&(n.lineDashOffset=h),l&&(n.lineCap=l),u&&(n.lineJoin=u),this.renderLines((d,f,p)=>n.strokeText(d,f,p))}super.render(t)}renderLines(t){const{lines:n,x:i,y:s}=this,r=this.lineHeight??$.getLineHeight(this.fontSize);let o=(r-r*n.length)*$.getVerticalModifier(this.textBaseline);for(const c of n)t(c,i,s+o),o+=r}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}toSVG(){if(!this.visible||!this.text)return;const t=Rt("text");return this.applySvgFillAttributes(t),t.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),t.setAttribute("font-size",String(this.fontSize)),t.setAttribute("font-style",this.fontStyle??""),t.setAttribute("font-weight",String(this.fontWeight??"")),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text??"",{elements:[t]}}};U.className="Text",U.defaultStyles={...at.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},m([N()],U.prototype,"x",2),m([N()],U.prototype,"y",2),m([N({changeCb:e=>e.onTextChange()})],U.prototype,"text",2),m([N()],U.prototype,"fontStyle",2),m([N()],U.prototype,"fontWeight",2),m([N()],U.prototype,"fontSize",2),m([N()],U.prototype,"fontFamily",2),m([N()],U.prototype,"textAlign",2),m([N()],U.prototype,"textBaseline",2),m([N()],U.prototype,"lineHeight",2);var qn=U,Cs=class extends zt(qn){},ro=class extends zt(Qt(qn)){};function ft(e,t){return On((n,i,s)=>n[e][t??i]=s)}function Ps(e){return rs(e)}var As=class{static wrapText(e,t){return this.wrapLines(e,t).join(` `)}static wrapLines(e,t){const n=this.textWrap(e,t);return t.overflow==="hide"&&n.some(i=>i.endsWith($.EllipsisChar))?[]:n}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+$.EllipsisChar}static truncateLine(e,t,n,i){const s=t.textWidth($.EllipsisChar);let r=0,o=0;for(;on)break;r+=c}if(e.length===o&&(!i||r+s<=n))return i?e+$.EllipsisChar:e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+s>n;)e=e.slice(0,-1).trimEnd();return e+$.EllipsisChar}static textWrap(e,t){const n=e.split($.lineSplitter),i=ke.getMeasurer(t);if(t.textWrap==="never")return n.map(c=>this.truncateLine(c.trimEnd(),i,t.maxWidth));const s=[],r=t.textWrap==="hyphenate",o=t.textWrap==null||t.textWrap==="on-space";for(const c of n){let a=c.trimEnd();if(a===""){s.push(a);continue}let h=0,l=0,u=0;for(;ht.maxWidth){if(h===0)break;const f=i.textWidth(a.slice(0,h+1));if(f<=t.maxWidth){l=f,h++;continue}if(u){const g=this.getWordAt(a,u+1),M=i.textWidth(g);if(M<=t.maxWidth){s.push(a.slice(0,u).trimEnd()),a=a.slice(u).trimStart(),h=0,l=0,u=0;continue}else o&&M>t.maxWidth&&s.push(a.slice(0,u).trimEnd(),this.truncateLine(a.slice(u).trimStart(),i,t.maxWidth,!0))}else o&&s.push(this.truncateLine(a,i,t.maxWidth,!0));if(o){a="";break}const p=r?"-":"";let y=a.slice(0,h).trim();for(;y.length&&i.textWidth(y+p)>t.maxWidth;)y=y.slice(0,-1).trimEnd();if(s.push(y+p),!y.length){a="";break}a=a.slice(y.length).trimStart(),h=-1,l=0,u=0}h++}a&&s.push(a)}return this.avoidOrphans(s,i,t),this.clipLines(s,i,t)}static getWordAt(e,t){const n=e.indexOf(" ",t);return n===-1?e.slice(t):e.slice(t,n)}static clipLines(e,t,n){if(!n.maxHeight)return e;const{height:i,lineMetrics:s}=t.measureLines(e);if(i<=n.maxHeight)return e;for(let r=0,o=0;rn.maxHeight){if(n.overflow==="hide")return[];const a=e.slice(0,r||1),h=a.pop();return a.concat(this.truncateLine(h,t,n.maxWidth,!0))}}return e}static avoidOrphans(e,t,n){if(n.avoidOrphans===!1||e.length<2)return;const{length:i}=e,s=e[i-1],r=e[i-2];if(r.lengththis.updateA11yText(e,t))}computeTextWrap(e,t){const{text:n,padding:i,wrapping:s}=this,r=Math.min(this.maxWidth??1/0,e)-i*2,o=this.maxHeight??t-i*2;if(!isFinite(r)&&!isFinite(o)){this.node.text=n;return}const c=As.wrapText(n??"",{maxWidth:r,maxHeight:o,font:this,textWrap:s});this.node.text=c,this.truncated=c.includes($.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:n}=e;if(this.enabled&&this.text){const i=Nt.toCanvas(this.node);if(i){const{id:s}=this;this.proxyText??(this.proxyText=n.createProxyElement({type:"text",domManagerId:s,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(i),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:n,y:i}=Nt.toCanvas(this.node),s=t.sourceEvent.offsetX+n,r=t.sourceEvent.offsetY+i,o={type:"pointermove",canvasX:s,canvasY:r};e.tooltipManager.updateTooltip(this.id,{canvasX:s,canvasY:r,lastPointerEvent:o,showArrow:!1},{type:"structured",title:this.text})}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};G.SMALL_PADDING=10,G.LARGE_PADDING=20,m([q(_n),ft("node","visible")],G.prototype,"enabled",2),m([q(ie,{optional:!0}),ft("node")],G.prototype,"text",2),m([q(ps,{optional:!0}),ft("node")],G.prototype,"textAlign",2),m([q(us,{optional:!0}),ft("node")],G.prototype,"fontStyle",2),m([q(ds,{optional:!0}),ft("node")],G.prototype,"fontWeight",2),m([q(bt),ft("node")],G.prototype,"fontSize",2),m([q(ie),ft("node")],G.prototype,"fontFamily",2),m([q(qe,{optional:!0}),ft("node","fill")],G.prototype,"color",2),m([q(bt,{optional:!0})],G.prototype,"spacing",2),m([q(bt,{optional:!0})],G.prototype,"maxWidth",2),m([q(bt,{optional:!0})],G.prototype,"maxHeight",2),m([q(fs)],G.prototype,"wrapping",2),m([q(bt)],G.prototype,"padding",2),m([q(ie)],G.prototype,"layoutStyle",2);function Ht(e,t,n,i){const s=e-n,r=t-i;return s*s+r*r}function re(e,t,n,i,s,r,o){if(n===s&&i===r)return Math.min(o,Ht(e,t,n,i));const c=s-n,a=r-i,h=Math.max(0,Math.min(1,((e-n)*c+(t-i)*a)/(c*c+a*a))),l=n+h*c,u=i+h*a;return Math.min(o,Ht(e,t,l,u))}function Rs(e,t,n,i,s,r,o,c,a){c&&([o,r]=[r,o]);const h=Math.atan2(t-i,e-n);if(!Tt(h,r,o)){const u=n+Math.cos(r)*s,d=i+Math.sin(r)*s,f=n+Math.cos(r)*s,p=i+Math.sin(r)*s;return Math.min(a,Ht(e,t,u,d),Ht(e,t,f,p))}const l=s-Math.sqrt(Ht(e,t,n,i));return Math.min(a,l*l)}function Ns(e,t){const n=-t/e;return e!==0&&n>=0&&n<=1?[n]:[]}function Ts(e,t,n){if(e===0)return Ns(t,n);const i=t*t-4*e*n,s=[];if(i===0){const r=-t/(2*e);r>=0&&r<=1&&s.push(r)}else if(i>0){const r=Math.sqrt(i),o=(-t-r)/(2*e),c=(-t+r)/(2*e);o>=0&&o<=1&&s.push(o),c>=0&&c<=1&&s.push(c)}return s}function Fs(e,t,n,i){if(e===0)return Ts(t,n,i);const s=t/e,r=n/e,o=i/e,c=(3*r-s*s)/9,a=(9*s*r-27*o-2*s*s*s)/54,h=c*c*c+a*a,l=1/3,u=[];if(h>=0){const d=Math.sqrt(h),f=Math.sign(a+d)*Math.pow(Math.abs(a+d),l),p=Math.sign(a-d)*Math.pow(Math.abs(a-d),l),y=Math.abs(Math.sqrt(3)*(f-p)/2),g=-l*s+(f+p);if(g>=0&&g<=1&&u.push(g),y===0){const M=-l*s-(f+p)/2;M>=0&&M<=1&&u.push(M)}}else{const d=Math.acos(a/Math.sqrt(-c*c*c)),f=l*s,p=2*Math.sqrt(-c),y=p*Math.cos(l*d)-f,g=p*Math.cos(l*(d+2*Math.PI))-f,M=p*Math.cos(l*(d+4*Math.PI))-f;y>=0&&y<=1&&u.push(y),g>=0&&g<=1&&u.push(g),M>=0&&M<=1&&u.push(M)}return u}function oe(e,t,n,i,s,r,o,c){const a=(n-e)*(c-r)-(i-t)*(o-s);if(a===0)return 0;const h=((o-s)*(t-r)-(e-s)*(c-r))/a,l=((n-e)*(t-r)-(i-t)*(e-s))/a;return h>=0&&h<=1&&l>=0&&l<=1?1:0}function Is(e,t,n,i,s,r,o,c,a,h,l,u){let d=0;const f=h-u,p=l-a,y=a*(u-h)-h*(l-a),g=jn(e,n,s,o),M=jn(t,i,r,c),b=f*g[0]+p*M[0],w=f*g[1]+p*M[1],R=f*g[2]+p*M[2],C=f*g[3]+p*M[3]+y,T=Fs(b,w,R,C);for(const x of T){const v=x*x,A=x*v,P=g[0]*A+g[1]*v+g[2]*x+g[3],I=M[0]*A+M[1]*v+M[2]*x+M[3];let _;a===l?_=(I-h)/(u-h):_=(P-a)/(l-a),_>=0&&_<=1&&d++}return d}function jn(e,t,n,i){return[-e+3*t-3*n+i,3*e-6*t+3*n,-3*e+3*t,e]}function Ds(e,t,n,i,s,r,o,c,a,h){if(isNaN(e)||isNaN(t))return 0;r&&([s,i]=[i,s]);const l=(h-c)/(a-o),u=c-l*o,d=Math.pow(l,2)+1,f=2*(l*(u-t)-e),p=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(n,2),y=Math.pow(f,2)-4*d*p;if(y<0)return 0;const g=(-f+Math.sqrt(y))/2/d,M=(-f-Math.sqrt(y))/2/d;let b=0;return[g,M].forEach(w=>{if(!(w>=Math.min(o,a)&&w<=Math.max(o,a)))return;const C=l*w+u,T=w-e,x=C-t,v=Math.atan2(x,T);Tt(v,i,s)&&b++}),b}function Yn(e,t,n,i,s){return(1-s)**3*e+3*(1-s)**2*s*t+3*(1-s)*s**2*n+s**3*i}function Xn(e,t,n,i){const s=-e+3*t-3*n+i,r=3*e-6*t+3*n,o=-3*e+3*t;if(s===0){if(r!==0){const a=-o/r;if(a>0&&a<1)return[a]}return[]}const c=r*r-4*s*o;if(c>=0){const a=Math.sqrt(c),h=(-r+a)/(2*s),l=(-r-a)/(2*s);return[h,l].filter(u=>u>0&&u<1)}return[]}function ks(e,t,n,i,s,r,o,c){const a=Xn(e,n,s,o),h=Xn(t,i,r,c);return[...a,...h]}var ae=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,n,i){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath()}roundRect(e,t,n,i,s){s=Math.min(s,n/2,i/2),this.moveTo(e,t+s),this.arc(e+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(e+s,t),this.lineTo(e+n-s,t),this.arc(e+n-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(e+n,t+s),this.lineTo(e+n,t+i-s),this.arc(e+n-s,t+i-s,s,0,Math.PI/2),this.lineTo(e+n-s,t+i),this.lineTo(e+s,t+i),this.arc(e+ +s,t+i-s,s,Math.PI/2,Math.PI),this.lineTo(e,t+i-s),this.closePath()}arc(e,t,n,i,s,r){this.openedPath=!0,this.path2d.arc(e,t,n,i,s,r),this.commands.push(2),this.params.push(e,t,n,i,s,r?1:0)}cubicCurveTo(e,t,n,i,s,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,n,i,s,r),this.commands.push(3),this.params.push(e,t,n,i,s,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const n=this.commands,i=this.params,s=n.length,r=-1e4,o=-1e4;let c=NaN,a=NaN,h=0,l=0,u=0;for(let d=0,f=0;d({x:t,y:n})){const t=[],{commands:n,params:i}=this,s=(o,...c)=>{t.push(o);for(let a=0;a{n=Math.min(f,n),i=Math.min(d,i),s=Math.max(d,s),r=Math.max(f,r),p&&([o,c]=[d,f])};let u=0;for(const d of e)switch(d){case 0:l(t[u++],t[u++],!0),[a,h]=[o,c];break;case 1:l(t[u++],t[u++],!0);break;case 3:{const f=t[u++],p=t[u++],y=t[u++],g=t[u++],M=t[u++],b=t[u++];l(M,b,!0),ks(o,c,f,p,y,g,M,b).forEach(R=>{const C=Yn(o,f,y,M,R),T=Yn(c,p,g,b,R);l(C,T)});break}case 2:{const f=t[u++],p=t[u++],y=t[u++];let g=z(t[u++]),M=z(t[u++]);t[u++]&&([g,M]=[M,g]);const w=(C,T)=>{const x=f+y*Math.cos(C),v=p+y*Math.sin(C);l(x,v,T)};w(g),w(M,!0);const R=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const C of R)(gM&&(g<=C||C<=M))&&w(C);break}case 4:[o,c]=[a,h];break}return new H(i,n,s-i,r-n)}};function S(e){const{changeCb:t,convertor:n}=e??{};return N({type:"path",convertor:n,changeCb:t})}var it=class extends at{constructor(){super(...arguments),this.path=new ae,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty())}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();const n=this.strokeWidth/2;this._clipPath??(this._clipPath=new ae),this._clipPath.clear(),this._clipPath.rect(-n,-n,this._clipX+n,this._clipY+n+n),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t),t.restore()}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=Rt("path");return e.setAttribute("d",this.svgPathData()),this.applySvgFillAttributes(e),this.applySvgStrokeAttributes(e),{elements:[e]}}};it.className="Path",m([S()],it.prototype,"clip",2),m([S()],it.prototype,"clipX",1),m([S()],it.prototype,"clipY",1);function ce(e,t){const{path:n,size:i}=e,{x:s,y:r}=e;n.clear();let o=!1;for(const[c,a]of t){const h=s+(c-.5)*i,l=r+(a-.5)*i;o?n.lineTo(h,l):n.moveTo(h,l),o=!0}n.closePath()}var Os={circle({path:e,x:t,y:n,size:i}){const s=i/2;e.clear(),e.arc(t,n,s,0,Math.PI*2),e.closePath()},cross(e){ce(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){ce(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:n,size:i}){const s=i/4;n=n+s/2,e.clear(),e.arc(t-s,n-s,s,Ft(130),Ft(330)),e.arc(t+s,n-s,s,Ft(220),Ft(50)),e.lineTo(t,n+s),e.closePath()},pin({path:e,x:t,y:n,size:i}){e.moveTo(t+(.15625-.5)*i,n+(.34375-.5)*i),e.cubicCurveTo(t+(.15625-.5)*i,n+(.151491-.5)*i,t+(.307741-.5)*i,n+(0-.5)*i,t+(.5-.5)*i,n+(0-.5)*i),e.cubicCurveTo(t+(.692259-.5)*i,n+(0-.5)*i,t+(.84375-.5)*i,n+(.151491-.5)*i,t+(.84375-.5)*i,n+(.34375-.5)*i),e.cubicCurveTo(t+(.84375-.5)*i,n+(.493824-.5)*i,t+(.784625-.5)*i,n+(.600181-.5)*i,t+(.716461-.5)*i,n+(.695393-.5)*i),e.cubicCurveTo(t+(.699009-.5)*i,n+(.719769-.5)*i,t+(.681271-.5)*i,n+(.743104-.5)*i,t+(.663785-.5)*i,n+(.766105-.5)*i),e.cubicCurveTo(t+(.611893-.5)*i,n+(.834367-.5)*i,t+(.562228-.5)*i,n+(.899699-.5)*i,t+(.528896-.5)*i,n+(.980648-.5)*i),e.cubicCurveTo(t+(.524075-.5)*i,n+(.992358-.5)*i,t+(.512663-.5)*i,n+(1-.5)*i,t+(.5-.5)*i,n+(1-.5)*i),e.cubicCurveTo(t+(.487337-.5)*i,n+(1-.5)*i,t+(.475925-.5)*i,n+(.992358-.5)*i,t+(.471104-.5)*i,n+(.980648-.5)*i),e.cubicCurveTo(t+(.487337-.5)*i,n+(1-.5)*i,t+(.475925-.5)*i,n+(.992358-.5)*i,t+(.471104-.5)*i,n+(.980648-.5)*i),e.cubicCurveTo(t+(.437772-.5)*i,n+(.899699-.5)*i,t+(.388107-.5)*i,n+(.834367-.5)*i,t+(.336215-.5)*i,n+(.766105-.5)*i),e.cubicCurveTo(t+(.318729-.5)*i,n+(.743104-.5)*i,t+(.300991-.5)*i,n+(.719769-.5)*i,t+(.283539-.5)*i,n+(.695393-.5)*i),e.cubicCurveTo(t+(.215375-.5)*i,n+(.600181-.5)*i,t+(.15625-.5)*i,n+(.493824-.5)*i,t+(.15625-.5)*i,n+(.34375-.5)*i),e.closePath()},plus(e){ce(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:n,size:i,pixelRatio:s}){const r=i/2;e.clear(),e.moveTo(ot(s,t-r),ot(s,n-r)),e.lineTo(ot(s,t+r),ot(s,n-r)),e.lineTo(ot(s,t+r),ot(s,n+r)),e.lineTo(ot(s,t-r),ot(s,n+r)),e.closePath()},star({path:e,x:t,y:n,size:i}){const r=i/2,o=r/2,c=Math.PI/2;for(let a=0;a<5*2;a++){const h=a%2===0?r:o,l=a*Math.PI/5-c,u=t+Math.cos(l)*h,d=n+Math.sin(l)*h;e.lineTo(u,d)}e.closePath()},triangle(e){ce(e,[[.5,0],[1,.87],[0,.87]])}},qt=class extends it{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:e,shape:t,x:n,y:i,size:s}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=Ye.anchor(t),c={path:e,x:n-(o.x-.5)*s,y:i-(o.y-.5)*s,size:s,pixelRatio:r};e.clear(),typeof t=="string"?Os[t](c):typeof t=="function"&&t(c)}computeBBox(){const{x:e,y:t,size:n}=this,i=Ye.anchor(this.shape);return new H(e-n*i.x,t-n*i.y,n,n)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};m([S()],qt.prototype,"shape",2),m([S()],qt.prototype,"x",2),m([S()],qt.prototype,"y",2),m([S({convertor:Math.abs})],qt.prototype,"size",2);var Ye=class extends zt(An(Qt(qt))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}},Vn=class{constructor(e,t,n){this._encode=e,this._decode=t,this._rangeCallback=n}floor(e){const t=new Date(e),n=this._encode(t);return this._decode(n)}ceil(e){const t=new Date(Number(e)-1),n=this._encode(t);return this._decode(n+1)}range(e,t,{extend:n=!1,visibleRange:i=[0,1]}={}){let s=!1;e.getTime()>t.getTime()&&([e,t]=[t,e],s=!0);const r=this._rangeCallback?.(e,t),o=this._encode(n?this.floor(e):this.ceil(e)),c=this._encode(n?this.ceil(t):this.floor(t));if(c{const u=r==="start"?h:l;return n=this.getOffset(u,e),()=>n=a}}else typeof r=="number"?n=this.getOffset(new Date(r),e):r instanceof Date&&(n=this.getOffset(r,e));const o=a=>Math.floor((this._encode(a)-n)/e),c=a=>this._decode(a*e+n);return new Vn(o,c,i)}},wt=1e3,J=wt*60,St=J*60,Ot=St*24,he=Ot*7,jt=Ot*30,Es=Ot*365,Un=new Date().getTimezoneOffset()*J;function Bs(e){return Math.floor((e.getTime()-Un)/wt)}function Ls(e){return new Date(Un+e*wt)}var le=new vt(Bs,Ls),Jn=new Date().getTimezoneOffset()*J;function _s(e){return Math.floor((e.getTime()-Jn)/J)}function $s(e){return new Date(Jn+e*J)}var ue=new vt(_s,$s),Zn=new Date().getTimezoneOffset()*J;function zs(e){return Math.floor((e.getTime()-Zn)/St)}function Gs(e){return new Date(Zn+e*St)}var de=new vt(zs,Gs);function Ws(e){const t=e.getTimezoneOffset()*J;return Math.floor((e.getTime()-t)/Ot)}function Hs(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}var Kn=new vt(Ws,Hs);function Ct(e){const n=(7+e-4)%7;function i(r){const o=r.getTimezoneOffset()*J;return Math.floor((r.getTime()-o)/he-n/7)}function s(r){const o=new Date(1970,0,1);return o.setDate(o.getDate()+r*7+n),o}return new vt(i,s)}var Xe=Ct(0),oo=Ct(1),ao=Ct(2),co=Ct(3),ho=Ct(4),lo=Ct(5),uo=Ct(6);function qs(e){return e.getFullYear()*12+e.getMonth()}function js(e){const t=Math.floor(e/12),n=e-t*12;return new Date(t,n,1)}var Yt=new vt(qs,js);function Ys(e){return e.getFullYear()}function Xs(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}var Vs=new vt(Ys,Xs);function Ve(e){return e instanceof Date?e.getTime():e}function Us(e,t,n){if(n==null||n[0]===0&&n[1]===1)return e;const i=O(0,Math.floor(n[0]*e.length),e.length),s=O(0,Math.ceil(n[1]*e.length),e.length),r=t?e.length-s:i,o=t?e.length-i:s;return e.slice(r,o)}var fe=class Ai extends Le{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this.interval=void 0,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof Ai}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(t){t=O(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=O(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=O(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&L.warnOnce("Expected update to not invalidate scale"))}ticks(t,n=this.domain,i){return Us(n,!1,i)}convert(t,n){this.refresh();const i=this.getIndex(t);return i==null||i<0||i>=this.domain.length?NaN:this.ordinalRange(i)}invertNearestIndex(t){this.refresh();const{domain:n}=this;if(n.length===0)return-1;let i=0,s=n.length-1,r=1/0,o=0;for(;i<=s;){const c=(s+i)/2|0,a=this.ordinalRange(c),h=Math.abs(a-t);if(h===0)return c;h{let b=y(M,g);return f&&(b=or(b)),a&&(b=ar(b,a)),b=hr(M,b,s),r&&r!=="#"&&(b=`${r}${b}`),r==="#"&&h==="x"&&(b=`0x${b}`),h==="s"&&(b=`${b}${cr(M)}`),(h==="%"||h==="p")&&(b=`${b}%`),c!=null&&!isNaN(c)&&(b=lr(b,c,n??o,i)),b=`${l}${b}${u}`,b}}var nr=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,ir=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/,Et={b:e=>pe(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>pe(e).toString(8),x:e=>pe(e).toString(16),X:e=>Et.x(e).toUpperCase(),n:e=>Et.d(e),"%":e=>`${pe(e*100).toFixed(0)}`},Z={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Z.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Z.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),i=Math.floor(Math.log10(n));return i>=-4&&iZ.g(e,t).toUpperCase(),n:(e,t)=>Z.g(e,t),p:(e,t)=>Z.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),s=Math.floor(Math.log10(n))-(t-1);if(s<=0)return n.toFixed(-s);const r=10**s;return(Math.round(n/r)*r).toFixed()},s:(e,t)=>{const n=si(e);return Z.r(e/10**n,t)},"%":(e,t)=>Z.f(e*100,t)},ni=-24,ii=24,sr={[ni]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[ii]:"Y"},rr="\u2212";function pe(e){return Math.floor(Math.abs(e))}function or(e){return e.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function ar(e,t){let n=e.indexOf(".");n<0&&(n=e.length);const i=e.substring(0,n).split(""),s=e.substring(n);for(let r=i.length-3;r>0;r-=3)i.splice(r,0,t);return`${i.join("")}${s}`}function cr(e){return sr[si(e)]}function si(e){return O(ni,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,ii)}function hr(e,t,n=""){if(n==="(")return e>=0?t:`(${t})`;const i=n==="+"?"+":"";return`${e>=0?i:rr}${t}`}function lr(e,t,n=" ",i=">"){let s=e;if(i===">"||!i)s=s.padStart(t,n);else if(i==="<")s=s.padEnd(t,n);else if(i==="^"){const r=Math.max(0,t-s.length),o=Math.ceil(r/2),c=Math.floor(r/2);s=s.padStart(o+s.length,n),s=s.padEnd(c+s.length,n)}return s}var E=(e,t,n)=>({duration:t*n,timeInterval:e,step:n}),po=[E(le,wt,1),E(le,wt,5),E(le,wt,15),E(le,wt,30),E(ue,J,1),E(ue,J,5),E(ue,J,15),E(ue,J,30),E(de,St,1),E(de,St,3),E(de,St,6),E(de,St,12),E(Kn,Ot,1),E(Kn,Ot,2),E(Xe,he,1),E(Xe,he,2),E(Xe,he,3),E(Yt,jt,1),E(Yt,jt,2),E(Yt,jt,3),E(Yt,jt,4),E(Yt,jt,6),E(Vs,Es,1)],ri=[1,2,5,10];function oi(e,t){return Math.abs(Math.round(e)-e)=i&&u<=s;if(h&&!d)continue;const f=Math.abs(u-n);(a>f||h!==d)&&(h||(h=d),a=f,c=l)}return c*o}function ci(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function hi(e,t){const n=ei(t??",f");(n.precision==null||isNaN(n.precision))&&(!n.type||"eEFgGnprs".includes(n.type)?n.precision=Math.max(...e.map(s=>{if(!Number.isFinite(s))return 0;const[r,o]=s.toExponential((n.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+ci(o)+1})):"f%".includes(n.type)&&(n.precision=Math.max(...e.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const r=Math.floor(Math.log10(Math.abs(s))),o=n.type?6:12,c=s.toExponential(o-1).split(/[.e]/g)[1],a=ci(c);return Math.max(0,a-r)}))));const i=er(n);return s=>i(Number(s))}function Ue(e,t,n){if(!Number.isFinite(n)||n<=0)return[];const i=10**Vi(n),s=Math.min(e,t),r=Math.max(e,t),o=[];for(let c=0;;c+=1){const a=Math.round((s+n*c)*i)/i;if(a>r)break;o.push(a)}return o}function dr(e,t){return e>=t?(L.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function fr(e,t){const n=Math.abs(t-e),i=10**Math.floor(Math.log10(n));let s=1/0,r=[e,t];for(const o of ri){const c=o*i,a=Math.floor(e/c)*c,h=Math.ceil(t/c)*c,l=1-n/Math.abs(h-a);s>l&&(s=l,r=[a,h])}return r}var li=class Ri extends Le{constructor(t=[],n=[]){super(),this.domain=t,this.range=n,this.defaultClamp=!1}static is(t){return t instanceof Ri}normalizeDomains(...t){let n,i=1/0,s,r=-1/0;for(const o of t)for(const c of o){const a=c.valueOf();ar&&(r=a,s=c)}return n!=null&&s!=null?{domain:[n,s],animatable:!0}:{domain:[],animatable:!1}}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1){const{domain:n}=this,i=this.getPixelRange();if(n.length===0)return i;const s=Math.abs(n[1].valueOf()-n[0].valueOf())/t+1,r=Math.floor(i),o=Math.min(s,r);return i/Math.max(1,o)}convert(t,n=this.defaultClamp){const{domain:i}=this;if(!i||i.length<2)return NaN;const s=Number(this.transform(i[0])),r=Number(this.transform(i[1])),o=Number(this.transform(t)),{range:c}=this,[a,h]=c;if(n){const[l,u]=Xi([s,r]);if(ou)return h}return s===r?(a+h)/2:o===s?a:o===r?h:a+(o-s)/(r-s)*(h-a)}invert(t,n){const i=this.domain.map(l=>this.transform(l)),[s,r]=i,{range:o}=this,[c,a]=o;let h;return c===a?h=this.toDomain((Number(s)+Number(r))/2):h=this.toDomain(Number(s)+(t-c)/(a-c)*(Number(r)-Number(s))),this.transformInvert(h)}getPixelRange(){const[t,n]=this.range;return Math.abs(n-t)}};li.defaultTickCount=5;var ge=li,pr=class Ni extends ge{constructor(){super([0,1],[0,1]),this.type="number"}static getTickStep(t,n,i){const{interval:s,tickCount:r=ge.defaultTickCount,minTickCount:o,maxTickCount:c}=i;return s??ai(t,n,r,o,c)}toDomain(t){return t}ticks({interval:t,tickCount:n=ge.defaultTickCount,minTickCount:i,maxTickCount:s},r=this.domain,o){if(!r||r.length<2||n<1||!r.every(isFinite))return[];const[c,a]=r;if(t){const h=Math.abs(t);if(!dr((a-c)/h,this.getPixelRange()))return Ue(c,a,h)}return ur(c,a,n,i,s,o)}niceDomain(t,n=this.domain){if(n.length<2)return[];const{tickCount:i=ge.defaultTickCount}=t;let[s,r]=n;if(i===1)[s,r]=fr(s,r);else if(i>1){const o=s>r?Math.ceil:Math.floor,c=s>r?Math.floor:Math.ceil,a=4;for(let h=0;hti(s,n)}datumFormatter({ticks:t,fractionDigits:n,specifier:i}){return i!=null?hi(t,i):s=>ti(s,n+1)}},gr=2e3,ui=Date.now(),mr=()=>{const e=Date.now()-ui;if(e>gr){const t=(Math.floor(e/100)/10).toFixed(1);L.log(`**** ${t}s since last log message ****`)}ui=Date.now()},K={create(...e){return Object.assign((...n)=>{K.check(...e)&&(typeof n[0]=="function"&&(n=Re(n[0]())),mr(),L.log(...n))},{check:()=>K.check(...e),group:(n,i)=>K.check(...e)?L.logGroup(n,i):i()})},check(...e){return e.length===0&&e.push(!0),Re(Ie("agChartsDebug")).some(n=>e.includes(n))}};function di({context:e,pixelRatio:t,width:n,height:i}){e.save(),e.resetTransform(),e.clearRect(0,0,Math.ceil(n*t),Math.ceil(i*t)),e.restore()}function fi(e){if(K.check("canvas")){const t=e.save.bind(e),n=e.restore.bind(e);let i=0;Object.assign(e,{save(){t(),i++},restore(){if(i===0)throw new Error("AG Charts - Unable to restore() past depth 0");n(),i--},verifyDepthZero(){if(i!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${i}`)}})}}function pi(e,t,n){return[Math.round(e*n),Math.round(t*n)]}var gi=class{constructor(e){const{width:t,height:n,pixelRatio:i,willReadFrequently:s=!1}=e;this.width=t,this.height=n,this.pixelRatio=i;const[r,o]=pi(t,n,i);this.canvas=new OffscreenCanvas(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(i,0,0,i,0,0),fi(this.context)}drawImage(e,t=0,n=0){return e.drawImage(this.canvas,t,n)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,n){if(!(e>0&&t>0))return;const{canvas:i,context:s}=this;if(e!==this.width||t!==this.height||n!==this.pixelRatio){const[r,o]=pi(e,t,n);i.width=r,i.height=o}s.setTransform(n,0,0,n,0,0),this.width=e,this.height=t,this.pixelRatio=n}clear(){di(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},Je=(e,t)=>Math.sign(e-t);function yr(e,t){if(typeof e=="number"&&typeof t=="number")return Je(e,t);const n=typeof e=="number"?[e]:e,i=typeof t=="number"?[t]:t,s=Math.min(n.length,i.length);for(let r=0;r0&&this.getVisibility()?this.layer??(this.layer=this._layerManager?.addLayer({name:this.name})):this.layer!=null&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),n}render(t){const{layer:n,renderToOffscreenCanvas:i}=this,s={...t};if(!i){this.renderInContext(s),super.render(s);return}const{ctx:r,stats:o,devicePixelRatio:c}=t;let{image:a}=this;if(this.isDirty(t)){a?.bitmap.close(),a=void 0;const l=n?void 0:this.computeSafeClippingBBox(c),u=(d,...f)=>{const p=d.context;s.ctx=p,d.clear(),p.save(),p.setTransform(...f),p.globalAlpha=1,this.renderInContext(s),p.restore(),p.verifyDepthZero?.()};if(n)u(n,r.getTransform());else if(l){const{x:d,y:f,width:p,height:y}=l,g=this.prepareSharedCanvas(p,y,c);u(g,c,0,0,c,-d*c,-f*c),a={bitmap:g.transferToImageBitmap(),x:d,y:f,width:p,height:y}}else this.dirtyZIndex&&this.sortChildren(Vt.compareChildren);this.image=a,o&&o.layersRendered++}else this.skipRender(s),o&&o.layersSkipped++;const{globalAlpha:h}=r;if(r.globalAlpha=h*this.opacity,n)r.save(),r.resetTransform(),n.drawImage(r),r.restore();else if(a){const{bitmap:l,x:u,y:d,width:f,height:p}=a;r.drawImage(l,0,0,f*c,p*c,u,d,f,p)}r.globalAlpha=h,super.render(s)}skipRender(t){const{stats:n}=t;for(const i of this.children())i.markClean(),n&&(n.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,n.opsSkipped+=this.childNodeCounts.complexity)}applyClip(t,n){const{x:i,y:s,width:r,height:o}=n;t.beginPath(),t.rect(i,s,r,o),t.clip()}renderInContext(t){const{ctx:n,stats:i}=t;this.dirtyZIndex&&this.sortChildren(Vt.compareChildren),n.save(),n.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(n,this.clipRect),t.clipBBox=Nt.toCanvas(this,this.clipRect));for(const s of this.children()){if(!s.visible){s.markClean(),i&&(i.nodesSkipped+=s.childNodeCounts.nonGroups+s.childNodeCounts.groups,i.opsSkipped+=s.childNodeCounts.complexity);continue}n.save(),s.render(t),n.restore()}n.restore()}setClipRect(t){this.clipRect=t?Nt.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}_setLayerManager(t){this.layer&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),super._setLayerManager(t)}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],n=[];for(const i of this.children()){const s=i.toSVG();s!=null&&(n.push(...s.elements),s.defs!=null&&t.push(...s.defs))}return{elements:n,defs:t}}};Ze.className="Group",m([N({convertor:e=>O(0,e,1)})],Ze.prototype,"opacity",2);var Pt=Ze,go=class extends An(Pt){},mo=class extends zt(Pt){},Mr=class extends Qt(Pt){},yo=class extends zt(Qt(Pt)){},mi=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:n,canvasElement:i,willReadFrequently:s=!1}=e;this.pixelRatio=e.pixelRatio??Ie("devicePixelRatio")??1,this.element=i??Mn("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(n??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((n??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:s}),this.onEnabledChange(),this.resize(t??0,n??0,this.pixelRatio),fi(this.context)}drawImage(e,t=0,n=0){return e.drawImage(this.context.canvas,t,n)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,n){if(!(e>0&&t>0))return;const{element:i,context:s}=this;i.width=Math.round(e*n),i.height=Math.round(t*n),s.setTransform(n,0,0,n,0,0),i.style.width=e+"px",i.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=n}clear(){di(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};m([Ps(e=>e.onEnabledChange())],mi.prototype,"enabled",2);var br=class{constructor(e){this.canvas=e,this.debug=K.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,n){this.canvas.resize(e,t,n),this.layersMap.forEach(({canvas:i})=>i.resize(e,t,n))}addLayer(e){const{width:t,height:n,pixelRatio:i}=this.canvas,{name:s}=e,r=new gi({width:t,height:n,pixelRatio:i});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}};function xr(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function vr(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:n}=performance.memory,i=[];for(const s of[t,e,n])typeof s=="number"&&i.push(xr(s));return`Heap ${i.join(" / ")}`}function yi(e,t,n,i,s={},r=H.zero){if(!K.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:c=0,nodesRendered:a=0,nodesSkipped:h=0,opsPerformed:l=0,opsSkipped:u=0}=i??{},d=performance.now(),{start:f,...p}=t,y=Object.entries(p).map(([P,I])=>bi(P,I)).filter(P=>P!=null).join(" + "),g=Object.entries(s).map(([P,I])=>`${P}: ${JSON.stringify(I)}`).join(" ; "),M=K.check("scene:stats:verbose"),b=vr(),w=[`${bi("\u23F1\uFE0F",f,d)} (${y})`,`${g}`,`Layers: ${M?Ke(o,c):e.size}`,M?`Nodes: ${Ke(a,h)}`:null,M?`Ops: ${Ke(l,u)}`:null,M&&b?b:null].filter(Ne),R=new wn(P=>n.measureText(P)),C=new Map(w.map(P=>[P,R.measureLines(P)])),T=Math.max(...Array.from(C.values(),P=>P.width)),x=Rr(C.values(),P=>P.height),v=2+r.x;n.save(),n.fillStyle="white",n.fillRect(v,0,T,x),n.fillStyle="black";let A=0;for(const[P,I]of C.entries())A+=I.height,n.fillText(P,v,A);n.restore()}function wr(e){const t=Re(Ie("agChartsSceneDebug")),n=[];for(const i of t)i==="layout"?n.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):n.push(i);e.debugNodeSearch=n}function Sr(e,t){e.save();for(const[n,i]of Object.entries(t)){const s=Nt.toCanvas(i);if(!s){L.log(`Scene.render() - no bbox for debugged node [${n}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(s.x,s.y,s.width,s.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(n,s.x,s.y,s.width),e.fillText(n,s.x,s.y,s.width)}e.restore()}var Cr=new Set,Pr=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function Ar(e){const{...t}=e;for(const n of Object.keys(t))Pr.has(n)||typeof t[n]!="number"&&typeof t[n]!="string"&&typeof t[n]!="boolean"&&(Cr.add(n),delete t[n]);return t}function me(e,t){if(!K.check(!0,"scene"))return{};let n=0;return{node:t==="json"?Ar(e):e,name:e.name??e.id,dirty:e.dirty,...Array.from(e.children(),i=>me(i,t)).reduce((i,s)=>{let{name:r}=s;const{node:{visible:o,opacity:c,zIndex:a,translationX:h,translationY:l,rotation:u,scalingX:d,scalingY:f},node:p}=s;(!o||c<=0)&&(r=`(${r})`),Pt.is(p)&&p.renderToOffscreenCanvas&&(r=`*${r}*`);const y=Array.isArray(a)?`(${a.join(", ")})`:a,g=[`${(n++).toString().padStart(3,"0")}|`,`${r??""}`,`z: ${y}`,h&&`x: ${h}`,l&&`y: ${l}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,f!=null&&f!==1&&`sy: ${f}`].filter(w=>!!w).join(" ");let M=g,b=1;for(;i[M]!=null&&b<100;)M=`${g} (${b++})`;return i[M]=s,i},{})}}function Mi(e){if(!e.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(e.children(),s=>Mi(s)).filter(s=>s.paths.length>0),n=Pt.is(e)?e.name??e.id:e.id,i=t.length?t.flatMap(s=>s.paths).map(s=>`${n}.${s}`):[n];return{dirtyTree:{name:n,node:e,dirty:e.dirty,...t.map(s=>s.dirtyTree).filter(s=>s.dirty!=null).reduce((s,r)=>(s[r.name??""]=r,s),{})},paths:i}}function Ke(e,t){const n=e+t;return`${e} / ${n} (${Math.round(100*e/n)}%)`}function bi(e,t,n){const i=n!=null?n-t:t;return`${e}: ${Math.round(i*100)/100}ms`}function Rr(e,t){let n=0;for(const i of e)n+=t(i);return n}var xi=class{constructor(e){this.debug=K.create(!0,"scene"),this.id=De(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.canvas=new mi(e),this.layersManager=new br(this.canvas)}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=e,e&&(e.visible=!0,e._setLayerManager(this.layersManager)),this)}clear(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){Gi(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,n){return e=Math.round(e),t=Math.round(t),n??(n=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||n!==this.pixelRatio)?(this.pendingSize=[e,t,n],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:n,seriesRect:i}=e??{},{canvas:s,canvas:{context:r}={},root:o,pendingSize:c,width:a,height:h,pixelRatio:l}=this;if(!r)return;const u=performance.now();if(c&&(this.layersManager.resize(...c),this.pendingSize=null),o&&!o.visible){this.isDirty=!1;return}if(o?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:me(o,"console")}),yi(this.layersManager,t,r,void 0,n,i);return}const d={ctx:r,width:a,height:h,devicePixelRatio:l,debugNodes:{}};K.check("scene:stats:verbose")&&(d.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),wr(d);let f=!1;if(o?.dirty!==!1&&(f=!0,s.clear()),o&&K.check("scene:dirtyTree")){const{dirtyTree:p,paths:y}=Mi(o);K.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:p,paths:y})}if(o&&f){if(o.visible&&o.preRender(d),this.debug.check()){const p=me(o,"console");this.debug("Scene.render() - before",{canvasCleared:f,tree:p})}o.visible&&(r.save(),o.render(d),r.restore())}t["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,yi(this.layersManager,t,r,d.stats,n,i),Sr(r,d.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:me(o,"console"),canvasCleared:f})}toSVG(){const{root:e,width:t,height:n}=this;if(e!=null)return Kt.toSVG(e,t,n)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};xi.className="Scene";var ct=class extends it{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return nt(z(this.startAngle),z(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new H(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const n=this.getBBox();return this.type!==0&&n.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};ct.className="Arc",m([S()],ct.prototype,"centerX",2),m([S()],ct.prototype,"centerY",2),m([S()],ct.prototype,"radius",2),m([S()],ct.prototype,"startAngle",2),m([S()],ct.prototype,"endAngle",2),m([S()],ct.prototype,"counterClockwise",2),m([S()],ct.prototype,"type",2);var At=class extends at{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new H(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:n,y1:i,x2:s,y2:r}=this;return re(e,t,n,i,s,r,1/0)}render(e){const{ctx:t,devicePixelRatio:n}=e;let{x1:i,y1:s,x2:r,y2:o}=this;if(i===r){const{strokeWidth:c}=this,a=Math.round(i*n)/n+Math.trunc(c*n)%2/(n*2);i=a,r=a}else if(s===o){const{strokeWidth:c}=this,a=Math.round(s*n)/n+Math.trunc(c*n)%2/(n*2);s=a,o=a}t.beginPath(),t.moveTo(i,s),t.lineTo(r,o),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=Rt("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};At.className="Line",At.defaultStyles={...at.defaultStyles,fill:void 0,strokeWidth:1},m([N()],At.prototype,"x1",2),m([N()],At.prototype,"y1",2),m([N()],At.prototype,"x2",2),m([N()],At.prototype,"y2",2);function Qe(e,t,n){const i=Math.sqrt(e**2+t**2),r=Math.atan2(t,e)+n;return{x:Math.cos(r)*i,y:Math.sin(r)*i}}var tt=class extends it{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:n}=this,i=this.getRotation(),s=-n/2,r=n/2,o=-t,c=-e;let a=1/0,h=1/0,l=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:f,y:p}=Qe(d%2===0?s:r,d<2?o:c,i);a=Math.min(f,a),h=Math.min(p,h),l=Math.max(f,l),u=Math.max(p,u)}return new H(a,h,l-a,u-h)}getRotation(){const{startAngle:e,endAngle:t}=this,n=$e(e,t);return z(e+n/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:n,path:i}=this,s=-e/2,r=e/2,o=-n,c=-t,a=this.getRotation(),h=[[s,c],[s,o],[r,o],[r,c]].map(([l,u])=>Qe(l,u,a));i.clear(!0),i.moveTo(h[0].x,h[0].y),i.lineTo(h[1].x,h[1].y),i.lineTo(h[2].x,h[2].y),i.lineTo(h[3].x,h[3].y),i.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:n,innerRadius:i,axisInnerRadius:s,axisOuterRadius:r,isRadiusAxisReversed:o}=this,c=nt(i,s),a=Math.asin(e/2/i),h=this.getRotation(),l=(v,A)=>Qe(v,A,h),u=(v,A)=>Math.sqrt(v**2+A**2),d=(v,A)=>A>v?0:Math.sqrt(v**2-A**2),f=(v,A,P)=>P?vA,p=c&&!isNaN(a)&&a=2*Math.PI){const f=e+r/2;e=f-Math.PI,t=f+Math.PI}const c=n*Math.cos(e),a=n*Math.sin(e),h=n*Math.cos(t),l=n*Math.sin(t),u=Math.floor(Math.sqrt((c-h)**2+(a-l)**2)),d=2*n*s;return Math.max(1,Math.min(d,u))}var ye=(e,{x0:t,y0:n,x1:i,y1:s,cx:r,cy:o},c,a)=>{if(a&&e.moveTo(t,n),t!==i||n!==s){const h=Math.atan2(n-o,t-r),l=Math.atan2(s-o,i-r);e.arc(r,o,c,h,l)}else e.lineTo(t,n)},vi=1e-6,Me=(e,t,n,i,s)=>{let r=!1,o=!1,c=i-Math.sqrt(Math.max(s**2-n**2,0)),a=0,h=0,l=n-Math.sqrt(Math.max(s**2-i**2,0));return c>e?(r=!0,c=e,a=n-Math.sqrt(Math.max(s**2-(i-e)**2))):ct?(o=!0,h=i-Math.sqrt(Math.max(s**2-(n-t)**2)),l=t):l{let{topLeft:c,topRight:a,bottomRight:h,bottomLeft:l}=r;const u=Math.max(c+l,a+h),d=Math.max(c+a,l+h);if(u<=0&&d<=0){o==null?e.rect(t,n,i,s):e.rect(o.x,o.y,o.width,o.height);return}else if(o==null&&c===a&&c===h&&c===l){e.roundRect(t,n,i,s,c);return}if(i<0&&(t+=i,i=Math.abs(i)),s<0&&(n+=s,s=Math.abs(s)),i<=0||s<=0)return;if(o==null)o=new H(t,n,i,s);else{const x=Math.max(t,o.x),v=Math.min(t+i,o.x+o.width),A=Math.max(n,o.y),P=Math.min(n+s,o.y+o.height);o=new H(x,A,v-x,P-A)}const f=Math.max(u/s,d/i,1);f>1&&(c/=f,a/=f,h/=f,l/=f);let p=!0,y=!0,g=!0,M=!0,b,w,R,C;if(p){const x=Me(o.height,o.width,Math.max(t+c-o.x,0),Math.max(n+c-o.y,0),c);x.leadingClipped&&(M=!1),x.trailingClipped&&(y=!1);const v=Math.max(o.x+x.leading1,o.x),A=Math.max(o.y+x.leading0,o.y),P=Math.max(o.x+x.trailing1,o.x),I=Math.max(o.y+x.trailing0,o.y),_=t+c,V=n+c;b={x0:v,y0:A,x1:P,y1:I,cx:_,cy:V}}if(y){const x=Me(o.width,o.height,Math.max(n+a-o.y,0),Math.max(o.x+o.width-(t+i-a),0),a);x.leadingClipped&&(p=!1),x.trailingClipped&&(g=!1);const v=Math.min(o.x+o.width-x.leading0,o.x+o.width),A=Math.max(o.y+x.leading1,o.y),P=Math.min(o.x+o.width-x.trailing0,o.x+o.width),I=Math.max(o.y+x.trailing1,o.y),_=t+i-a,V=n+a;w={x0:v,y0:A,x1:P,y1:I,cx:_,cy:V}}if(g){const x=Me(o.height,o.width,Math.max(o.x+o.width-(t+i-h),0),Math.max(o.y+o.height-(n+s-h),0),h);x.leadingClipped&&(y=!1),x.trailingClipped&&(M=!1);const v=Math.min(o.x+o.width-x.leading1,o.x+o.width),A=Math.min(o.y+o.height-x.leading0,o.y+o.height),P=Math.min(o.x+o.width-x.trailing1,o.x+o.width),I=Math.min(o.y+o.height-x.trailing0,o.y+o.height),_=t+i-h,V=n+s-h;R={x0:v,y0:A,x1:P,y1:I,cx:_,cy:V}}if(M){const x=Me(o.width,o.height,Math.max(o.y+o.height-(n+s-l),0),Math.max(t+l-o.x,0),l);x.leadingClipped&&(g=!1),x.trailingClipped&&(p=!1);const v=Math.max(o.x+x.leading0,o.x),A=Math.min(o.y+o.height-x.leading1,o.y+o.height),P=Math.max(o.x+x.trailing0,o.x),I=Math.min(o.y+o.height-x.trailing1,o.y+o.height),_=t+l,V=n+s-l;C={x0:v,y0:A,x1:P,y1:I,cx:_,cy:V}}let T=!1;p&&b!=null&&(ye(e,b,c,!T),T||(T=!0)),y&&w!=null&&(ye(e,w,a,!T),T||(T=!0)),g&&R!=null&&(ye(e,R,h,!T),T||(T=!0)),M&&C!=null&&ye(e,C,l,!T),e.closePath()},Q=class extends it{constructor(){super(...arguments),this.borderPath=new ae,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=at.defaultStyles.strokeWidth,this.effectiveStrokeWidth=at.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:n,topLeftCornerRadius:i,topRightCornerRadius:s,bottomRightCornerRadius:r,bottomLeftCornerRadius:o}=this;let{x:c,y:a,width:h,height:l,strokeWidth:u,clipBBox:d}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(e.clear(!0),t.clear(!0),n&&(h<=p&&(y*=h/p),l<=p&&(y*=l/p),h=this.align(c,h),l=this.align(a,l),c=this.align(c),a=this.align(a),d=d!=null?new H(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(h0?i-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,h>0&&l>0&&(M==null||M?.width>0&&M?.height>0)&&(tn(e,c,a,h,l,b,M),tn(t,c,a,h,l,b,M))}else this.borderClipPath=this.borderClipPath??new ae,this.borderClipPath.clear(!0),this.borderClipPath.rect(c,a,h,l),t.rect(c,a,h,l);else{const g={topLeft:i,topRight:s,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,tn(e,c,a,h,l,g,d)}if([i,s,r,o].every(g=>g===0)){const g=this.getBBox();this.hittester=g.containsPoint.bind(g),this.distanceSquared=(M,b)=>this.getBBox().distanceSquared(M,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=y}computeBBox(){const{x:e,y:t,width:n,height:i,clipBBox:s}=this;return s?.clone()??new H(e,t,n,i)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAlpha(e){const{fillOpacity:t,microPixelEffectOpacity:n,opacity:i}=this;e.globalAlpha*=i*t*n}renderStroke(e){const{stroke:t,effectiveStrokeWidth:n}=this;if(t&&n){const{globalAlpha:i}=e,{strokeOpacity:s,lineDash:r,lineDashOffset:o,lineCap:c,lineJoin:a,borderPath:h,borderClipPath:l,opacity:u,microPixelEffectOpacity:d}=this;l&&e.clip(l.getPath2D()),this.applyStroke(e),e.globalAlpha*=u*s*d,e.lineWidth=n,r&&e.setLineDash(r),o&&(e.lineDashOffset=o),c&&(e.lineCap=c),a&&(e.lineJoin=a),e.stroke(h.getPath2D()),e.globalAlpha=i}}};Q.className="Rect",m([S()],Q.prototype,"x",2),m([S()],Q.prototype,"y",2),m([S()],Q.prototype,"width",2),m([S()],Q.prototype,"height",2),m([S()],Q.prototype,"topLeftCornerRadius",2),m([S()],Q.prototype,"topRightCornerRadius",2),m([S()],Q.prototype,"bottomRightCornerRadius",2),m([S()],Q.prototype,"bottomLeftCornerRadius",2),m([S()],Q.prototype,"clipBBox",2),m([S()],Q.prototype,"crisp",2);var Tr=class nn{constructor(t,n,i,s){this.startAngle=t,this.endAngle=n,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:t,endAngle:n,innerRadius:i,outerRadius:s}=this;return new nn(t,n,i,s)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[xn](t,n){return new nn(this.startAngle*(1-n)+t.startAngle*n,this.endAngle*(1-n)+t.endAngle*n,this.innerRadius*(1-n)+t.innerRadius*n,this.outerRadius*(1-n)+t.outerRadius*n)}};function Fr({startAngle:e,endAngle:t,innerRadius:n,outerRadius:i}){let s=1/0,r=1/0,o=-1/0,c=-1/0;const a=(h,l)=>{s=Math.min(h,s),r=Math.min(l,r),o=Math.max(h,o),c=Math.max(l,c)};return a(n*Math.cos(e),n*Math.sin(e)),a(n*Math.cos(t),n*Math.sin(t)),a(i*Math.cos(e),i*Math.sin(e)),a(i*Math.cos(t),i*Math.sin(t)),Tt(0,e,t)&&a(i,0),Tt(Math.PI*.5,e,t)&&a(0,i),Tt(Math.PI,e,t)&&a(-i,0),Tt(Math.PI*1.5,e,t)&&a(0,-i),new H(s,r,o-s,c-r)}function wi(e,t,n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:s,outerRadius:r}=n;if(n.startAngle===n.endAngle||iMath.max(s,r))return!1;const o=In(n.startAngle),c=In(n.endAngle),a=Math.atan2(t,e);return o=o:a<=c&&a>=-Math.PI||a>=o&&a<=Math.PI}function Si(e,t,n,i){if(n===0&&i===0)return 0;if(Math.asin(Math.abs(1*n)/(e+1*n))+Math.asin(Math.abs(1*i)/(e+1*i))-t<0)return 1;let r=0,o=1;for(let c=0;c<8;c+=1){const a=(r+o)/2;Math.asin(Math.abs(a*n)/(e+a*n))+Math.asin(Math.abs(a*i)/(e+a*i))-t<0?r=a:o=a}return r}var Ir=1e-6;function pt(e,t){return $e(e,t)=2*Math.PI?2*Math.PI:z(t-e);return e=pt(e,n),t=e+s,{startAngle:e,endAngle:t}}function xe(e,t,n,i,s,r){const o=Math.sin(r),c=Math.cos(r),a=e**2+t**2-n**2;let h,l,u,d;if(c>.5){const w=o/c,R=1+w**2,C=-2*(e+t*w),T=C**2-4*R*a;if(T<0)return;const x=(-C+Math.sqrt(T))/(2*R),v=(-C-Math.sqrt(T))/(2*R);h=x,l=x*w,u=v,d=v*w}else{const w=c/o,R=1+w**2,C=-2*(t+e*w),T=C**2-4*R*a;if(T<0)return;const x=(-C+Math.sqrt(T))/(2*R),v=(-C-Math.sqrt(T))/(2*R);h=x*w,l=x,u=v*w,d=v}const f=c,p=o,y=h*f+l*p,g=u*f+d*p,M=y>0?pt(Math.atan2(l-t,h-e),i):NaN,b=g>0?pt(Math.atan2(d-t,u-e),i):NaN;if(M>=i&&M<=s)return M;if(b>=i&&b<=s)return b}function ve(e,t,n,i,s,r){const o=Math.hypot(e,t),c=(o**2-n**2+r**2)/(2*o),a=o-c,h=Math.atan2(t,e),l=Math.acos(-a/n),u=pt(h+l,i),d=pt(h-l,i);if(u>=i&&u<=s)return u;if(d>=i&&d<=s)return d}var en=class{constructor(e,t,n,i,s){this.cx=e,this.cy=t,this.r=n,this.a0=i,this.a1=s,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Y=class extends it{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return Fr(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:n}=this;return t=t>0?t+e:0,n=Math.max(n-e,0),{innerRadius:t,outerRadius:n}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:n}=be(this.startAngle,this.endAngle),{innerRadius:i,outerRadius:s}=this.normalizedRadii(),r=be(e.startAngle,e.endAngle,t);return new Tr(Math.max(t,r.startAngle),Math.min(n,r.endAngle),Math.max(i,e.innerRadius),Math.min(s,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,n,i,s,r,o,c){if(e<=0)return;const{startAngle:a,endAngle:h}=be(this.startAngle,this.endAngle),{innerRadius:l,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(c&&l<=0)return;const f=c?this.getAngleOffset(l+e):this.getAngleOffset(u-e),p=o?a+f+t:h-f-t,y=c?l+e:u-e,g=y*Math.cos(p),M=y*Math.sin(p);if(d!=null&&(!o&&!(p>=a-1e-6&&p<=d.endAngle-1e-6)||o&&!(p>=d.startAngle+1e-6&&p<=h-1e-6)||c&&yd.outerRadius+1e-6))return;const b=new en(g,M,e,n,i);if(d!=null){c?(b.clipStart(xe(g,M,e,n,i,d.endAngle)),b.clipEnd(xe(g,M,e,n,i,d.startAngle))):(b.clipStart(xe(g,M,e,n,i,d.startAngle)),b.clipEnd(xe(g,M,e,n,i,d.endAngle)));let x,v;if(o?(x=ve(g,M,e,n,i,d.innerRadius),v=ve(g,M,e,n,i,d.outerRadius)):(x=ve(g,M,e,n,i,d.outerRadius),v=ve(g,M,e,n,i,d.innerRadius)),b.clipStart(x),b.clipEnd(v),x!=null){const{x:A,y:P}=b.pointAt(x),I=pt(Math.atan2(P,A),a);o?r?.clipStart(I):s.clipEnd(I)}if(v!=null){const{x:A,y:P}=b.pointAt(v),I=pt(Math.atan2(P,A),a);o?s.clipStart(I):r?.clipEnd(I)}}if(d!=null){const{x,y:v}=b.pointAt((b.a0+b.a1)/2);if(!wi(x,v,d))return}const{x:w,y:R}=b.pointAt(o===c?b.a0:b.a1),C=pt(Math.atan2(R,w),a),T=c?r:s;return o?T?.clipStart(C):T?.clipEnd(C),b}updatePath(){const{path:t,centerX:n,centerY:i,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:c,startInnerCornerRadius:a,endInnerCornerRadius:h}=this;const{startAngle:l,endAngle:u}=be(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:f}=this.normalizedRadii(),p=this.normalizedClipSector(),y=u-l,g=y>=2*Math.PI-1e-6;if(t.clear(),d===0&&f===0||d>f)return;if((p?.startAngle??l)===(p?.endAngle??u))return;if(g&&this.clipSector==null&&o===0&&c===0&&a===0&&h===0){t.moveTo(n+f*Math.cos(l),i+f*Math.sin(l)),t.arc(n,i,f,l,u),d>s&&(t.moveTo(n+d*Math.cos(u),i+d*Math.sin(u)),t.arc(n,i,d,u,l,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(d-f)<1e-6){t.arc(n,i,f,l,u,!1),t.arc(n,i,f,u,l,!0),t.closePath();return}const M=this.getAngleOffset(d),b=this.getAngleOffset(f);if(y<2*b)return;const R=(p?.innerRadius??d)>s,C=d0?Math.min(T/x,1):1;o*=v,c*=v,a*=v,h*=v;const A=Si(f,y-2*b,-o,-c);if(o*=A,c*=A,!C&&R){const D=Si(d,y-2*M,a,h);a*=D,h*=D}else a=0,h=0;const P=Math.max(o+a,c+h),I=P>0?Math.min(T/P,1):1;o*=I,c*=I,a*=I,h*=I;let _=0,V=0;const Ce=o/(f-o),Pe=c/(f-c);if(Ce>=0&&Ce<1-1e-6)_=Math.asin(Ce);else{_=y/2;const D=f/(1/Math.sin(_)+1);o=Math.min(D,o)}if(Pe>=0&&Pe<1-1e-6)V=Math.asin(Pe);else{V=y/2;const D=f/(1/Math.sin(V)+1);c=Math.min(D,c)}const sn=Math.asin(a/(d+a)),rn=Math.asin(h/(d+h)),on=p?.outerRadius??f,an=this.getAngleOffset(on),ht=new en(0,0,on,l+an,u-an),cn=p?.innerRadius??d,hn=this.getAngleOffset(cn),st=R?new en(0,0,cn,l+hn,u-hn):void 0;p!=null&&(ht.clipStart(p.startAngle),ht.clipEnd(p.endAngle),st?.clipStart(p.startAngle),st?.clipEnd(p.endAngle));const ln=this.arc(o,_,l-Math.PI*.5,l+_,ht,st,!0,!1),un=this.arc(c,V,u-V,u+Math.PI*.5,ht,st,!1,!1),dn=this.arc(h,rn,u+Math.PI*.5,u+Math.PI-rn,ht,st,!1,!0),Ae=this.arc(a,sn,l+Math.PI+sn,l+Math.PI*1.5,ht,st,!0,!0);if(C){const D=y0&&D