You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/4809.d66fcebc.async.js

133 lines
1.2 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

!(function(){var RB=Object.defineProperty,LB=Object.defineProperties;var DB=Object.getOwnPropertyDescriptors;var rw=Object.getOwnPropertySymbols;var _B=Object.prototype.hasOwnProperty,IB=Object.prototype.propertyIsEnumerable;var as=Math.pow,V0=(V,Q,S)=>Q in V?RB(V,Q,{enumerable:!0,configurable:!0,writable:!0,value:S}):V[Q]=S,Bo=(V,Q)=>{for(var S in Q||(Q={}))_B.call(Q,S)&&V0(V,S,Q[S]);if(rw)for(var S of rw(Q))IB.call(Q,S)&&V0(V,S,Q[S]);return V},U0=(V,Q)=>LB(V,DB(Q));var Cn=(V,Q,S)=>V0(V,typeof Q!="symbol"?Q+"":Q,S);(self.webpackChunk=self.webpackChunk||[]).push([[4809],{62788:function(V,Q,S){"use strict";S.d(Q,{kJ:function(){return id},RN:function(){return gB}});var A={};S.r(A),S.d(A,{add:function(){return cw},adjoint:function(){return Mt},clone:function(){return he},copy:function(){return we},create:function(){return Wt},decompose:function(){return md},determinant:function(){return Yt},equals:function(){return dw},exactEquals:function(){return Ed},frob:function(){return lw},fromQuat:function(){return Wo},fromQuat2:function(){return _r},fromRotation:function(){return ei},fromRotationTranslation:function(){return Tr},fromRotationTranslationScale:function(){return yd},fromRotationTranslationScaleOrigin:function(){return ds},fromScaling:function(){return vn},fromTranslation:function(){return Hn},fromValues:function(){return Ae},fromXRotation:function(){return fi},fromYRotation:function(){return je},fromZRotation:function(){return Bn},frustum:function(){return bd},getRotation:function(){return Js},getScaling:function(){return Ca},getTranslation:function(){return Tn},identity:function(){return ge},invert:function(){return Ze},lookAt:function(){return ag},mul:function(){return og},multiply:function(){return Jt},multiplyScalar:function(){return uw},multiplyScalarAndAdd:function(){return hw},ortho:function(){return rg},orthoNO:function(){return ng},orthoZO:function(){return ig},perspective:function(){return xd},perspectiveFromFieldOfView:function(){return aw},perspectiveNO:function(){return Kl},perspectiveZO:function(){return iw},rotate:function(){return Je},rotateX:function(){return un},rotateY:function(){return fn},rotateZ:function(){return rr},scale:function(){return dn},set:function(){return cn},str:function(){return ow},sub:function(){return fw},subtract:function(){return sg},targetTo:function(){return sw},translate:function(){return Ht},transpose:function(){return xe}});var z={};S.r(z),S.d(z,{circle:function(){return m3},diamond:function(){return y3},rect:function(){return x3},simple:function(){return w3},triangle:function(){return v1},triangleRect:function(){return E3},vee:function(){return b3}});var D=S(33885),N=S(67732),T=S(83652),k=S(94480),R=S(22214),C=S(42403),P=S(42978),I=S(37271),L=I,Z=1e-6,Y=typeof Float32Array!="undefined"?Float32Array:Array,X=Math.random,nt="zyx";function tt(r){return r>=0?Math.round(r):r%.5===0?Math.floor(r):Math.round(r)}function q(r){Y=r}var it=Math.PI/180,at=180/Math.PI;function ct(r){return r*it}function ut(r){return r*at}function bt(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Z;return Math.abs(r-t)<=e*Math.max(1,Math.abs(r),Math.abs(t))}function gt(){var r=new Y(3);return Y!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function wt(r){var t=new Y(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function vt(r){var t=r[0],e=r[1],n=r[2];return Math.sqrt(t*t+e*e+n*n)}function Et(r,t,e){var n=new Y(3);return n[0]=r,n[1]=t,n[2]=e,n}function Pt(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function zt(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function Vt(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function Qt(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function Ee(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function Re(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function $e(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function nr(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function ti(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r}function la(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r}function ss(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r[2]=glMatrix.round(t[2]),r}function Rt(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function Dt(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r}function It(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return Math.sqrt(e*e+n*n+i*i)}function dt(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return e*e+n*n+i*i}function St(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function Ot(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function Gt(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function se(r,t){var e=t[0],n=t[1],i=t[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r}function be(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function de(r,t,e){var n=t[0],i=t[1],a=t[2],s=e[0],o=e[1],l=e[2];return r[0]=i*l-a*o,r[1]=a*s-n*l,r[2]=n*o-i*s,r}function Le(r,t,e,n){var i=t[0],a=t[1],s=t[2];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=s+n*(e[2]-s),r}function Mn(r,t,e,n){var i=Math.acos(Math.min(Math.max(be(t,e),-1),1)),a=Math.sin(i),s=Math.sin((1-n)*i)/a,o=Math.sin(n*i)/a;return r[0]=s*t[0]+o*e[0],r[1]=s*t[1]+o*e[1],r[2]=s*t[2]+o*e[2],r}function Nn(r,t,e,n,i,a){var s=a*a,o=s*(2*a-3)+1,l=s*(a-2)+a,c=s*(a-1),u=s*(3-2*a);return r[0]=t[0]*o+e[0]*l+n[0]*c+i[0]*u,r[1]=t[1]*o+e[1]*l+n[1]*c+i[1]*u,r[2]=t[2]*o+e[2]*l+n[2]*c+i[2]*u,r}function ke(r,t,e,n,i,a){var s=1-a,o=s*s,l=a*a,c=o*s,u=3*a*o,h=3*l*s,d=l*a;return r[0]=t[0]*c+e[0]*u+n[0]*h+i[0]*d,r[1]=t[1]*c+e[1]*u+n[1]*h+i[1]*d,r[2]=t[2]*c+e[2]*u+n[2]*h+i[2]*d,r}function Se(r,t){t=t===void 0?1:t;var e=glMatrix.RANDOM()*2*Math.PI,n=glMatrix.RANDOM()*2-1,i=Math.sqrt(1-n*n)*t;return r[0]=Math.cos(e)*i,r[1]=Math.sin(e)*i,r[2]=n*t,r}function re(r,t,e){var n=t[0],i=t[1],a=t[2],s=e[3]*n+e[7]*i+e[11]*a+e[15];return s=s||1,r[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/s,r[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/s,r[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/s,r}function Oe(r,t,e){var n=t[0],i=t[1],a=t[2];return r[0]=n*e[0]+i*e[3]+a*e[6],r[1]=n*e[1]+i*e[4]+a*e[7],r[2]=n*e[2]+i*e[5]+a*e[8],r}function ur(r,t,e){var n=e[0],i=e[1],a=e[2],s=e[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-n*c,d=n*l-i*o;return u=u+u,h=h+h,d=d+d,r[0]=o+s*u+i*d-a*h,r[1]=l+s*h+a*u-n*d,r[2]=c+s*d+n*h-i*u,r}function ca(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function ne(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function os(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function Lr(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],s=t[1],o=t[2],l=Math.sqrt((e*e+n*n+i*i)*(a*a+s*s+o*o)),c=l&&be(r,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function Yn(r){return r[0]=0,r[1]=0,r[2]=0,r}function Dr(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function ls(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function ua(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],s=t[1],o=t[2];return Math.abs(e-a)<=Z*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-s)<=Z*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=Z*Math.max(1,Math.abs(i),Math.abs(o))}var qs=Qt,ha=null,Fo=null,cs=It,us=null,hs=vt,Ai=null,Ti=function(){var r=gt();return function(t,e,n,i,a,s){var o,l;for(e||(e=3),n||(n=0),i?l=Math.min(i*e+n,t.length):l=t.length,o=n;o<l;o+=e)r[0]=t[o],r[1]=t[o+1],r[2]=t[o+2],a(r,r,s),t[o]=r[0],t[o+1]=r[1],t[o+2]=r[2];return t}}();function An(){var r=new Y(4);return Y!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function ud(r){var t=new Y(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function Ui(r,t,e,n){var i=new Y(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function Oi(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function zo(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function Oa(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function X0(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function hd(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r[3]=t[3]*e[3],r}function jo(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r[3]=t[3]/e[3],r}function K0(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r}function Q0(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r}function q0(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r[3]=Math.min(t[3],e[3]),r}function J0(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3]),r}function $0(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r[2]=glMatrix.round(t[2]),r[3]=glMatrix.round(t[3]),r}function dd(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function fd(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}function tg(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return Math.sqrt(e*e+n*n+i*i+a*a)}function eg(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return e*e+n*n+i*i+a*a}function vd(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.sqrt(t*t+e*e+n*n+i*i)}function gd(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function Zo(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function pd(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function Xl(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e*e+n*n+i*i+a*a;return s>0&&(s=1/Math.sqrt(s)),r[0]=e*s,r[1]=n*s,r[2]=i*s,r[3]=a*s,r}function U(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function x(r,t,e,n){var i=e[0]*n[1]-e[1]*n[0],a=e[0]*n[2]-e[2]*n[0],s=e[0]*n[3]-e[3]*n[0],o=e[1]*n[2]-e[2]*n[1],l=e[1]*n[3]-e[3]*n[1],c=e[2]*n[3]-e[3]*n[2],u=t[0],h=t[1],d=t[2],f=t[3];return r[0]=h*c-d*l+f*o,r[1]=-(u*c)+d*s-f*a,r[2]=u*l-h*s+f*i,r[3]=-(u*o)+h*a-d*i,r}function E(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=t[3];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=s+n*(e[2]-s),r[3]=o+n*(e[3]-o),r}function m(r,t){t=t===void 0?1:t;var e,n,i,a,s,o,l;l=glMatrix.RANDOM(),e=l*2-1,n=(4*glMatrix.RANDOM()-2)*Math.sqrt(l*-l+l),s=e*e+n*n,l=glMatrix.RANDOM(),i=l*2-1,a=(4*glMatrix.RANDOM()-2)*Math.sqrt(l*-l+l),o=i*i+a*a;var c=Math.sqrt((1-s)/o);return r[0]=t*e,r[1]=t*n,r[2]=t*i*c,r[3]=t*a*c,r}function M(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*s,r[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*s,r[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*s,r[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*s,r}function B(r,t,e){var n=e[0],i=e[1],a=e[2],s=e[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-n*c,d=n*l-i*o;return u=u+u,h=h+h,d=d+d,r[0]=o+s*u+i*d-a*h,r[1]=l+s*h+a*u-n*d,r[2]=c+s*d+n*h-i*u,r[3]=t[3],r}function J(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function $(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function st(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function ot(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],s=t[0],o=t[1],l=t[2],c=t[3];return Math.abs(e-s)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(n-o)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-l)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}var Tt=null,ft=null,Ft=null,qt=null,Lt=null,Zt=null,oe=null,mt=function(){var r=An();return function(t,e,n,i,a,s){var o,l;for(e||(e=4),n||(n=0),i?l=Math.min(i*e+n,t.length):l=t.length,o=n;o<l;o+=e)r[0]=t[o],r[1]=t[o+1],r[2]=t[o+2],r[3]=t[o+3],a(r,r,s),t[o]=r[0],t[o+1]=r[1],t[o+2]=r[2],t[o+3]=r[3];return t}}();function Wt(){var r=new Y(16);return Y!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function he(r){var t=new Y(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function we(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function Ae(r,t,e,n,i,a,s,o,l,c,u,h,d,f,v,g){var p=new Y(16);return p[0]=r,p[1]=t,p[2]=e,p[3]=n,p[4]=i,p[5]=a,p[6]=s,p[7]=o,p[8]=l,p[9]=c,p[10]=u,p[11]=h,p[12]=d,p[13]=f,p[14]=v,p[15]=g,p}function cn(r,t,e,n,i,a,s,o,l,c,u,h,d,f,v,g,p){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=s,r[6]=o,r[7]=l,r[8]=c,r[9]=u,r[10]=h,r[11]=d,r[12]=f,r[13]=v,r[14]=g,r[15]=p,r}function ge(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function xe(r,t){if(r===t){var e=t[1],n=t[2],i=t[3],a=t[6],s=t[7],o=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=a,r[11]=t[14],r[12]=i,r[13]=s,r[14]=o}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function Ze(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-n*s,w=e*l-i*s,O=e*c-a*s,_=n*l-i*o,F=n*c-a*o,W=i*c-a*l,j=u*g-h*v,H=u*p-d*v,K=u*y-f*v,et=h*p-d*g,rt=h*y-f*g,lt=d*y-f*p,ht=b*lt-w*rt+O*et+_*K-F*H+W*j;return ht?(ht=1/ht,r[0]=(o*lt-l*rt+c*et)*ht,r[1]=(i*rt-n*lt-a*et)*ht,r[2]=(g*W-p*F+y*_)*ht,r[3]=(d*F-h*W-f*_)*ht,r[4]=(l*K-s*lt-c*H)*ht,r[5]=(e*lt-i*K+a*H)*ht,r[6]=(p*O-v*W-y*w)*ht,r[7]=(u*W-d*O+f*w)*ht,r[8]=(s*rt-o*K+c*j)*ht,r[9]=(n*K-e*rt-a*j)*ht,r[10]=(v*F-g*O+y*b)*ht,r[11]=(h*O-u*F-f*b)*ht,r[12]=(o*H-s*et-l*j)*ht,r[13]=(e*et-n*H+i*j)*ht,r[14]=(g*w-v*_-p*b)*ht,r[15]=(u*_-h*w+d*b)*ht,r):null}function Mt(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-n*s,w=e*l-i*s,O=e*c-a*s,_=n*l-i*o,F=n*c-a*o,W=i*c-a*l,j=u*g-h*v,H=u*p-d*v,K=u*y-f*v,et=h*p-d*g,rt=h*y-f*g,lt=d*y-f*p;return r[0]=o*lt-l*rt+c*et,r[1]=i*rt-n*lt-a*et,r[2]=g*W-p*F+y*_,r[3]=d*F-h*W-f*_,r[4]=l*K-s*lt-c*H,r[5]=e*lt-i*K+a*H,r[6]=p*O-v*W-y*w,r[7]=u*W-d*O+f*w,r[8]=s*rt-o*K+c*j,r[9]=n*K-e*rt-a*j,r[10]=v*F-g*O+y*b,r[11]=h*O-u*F-f*b,r[12]=o*H-s*et-l*j,r[13]=e*et-n*H+i*j,r[14]=g*w-v*_-p*b,r[15]=u*_-h*w+d*b,r}function Yt(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],s=r[5],o=r[6],l=r[7],c=r[8],u=r[9],h=r[10],d=r[11],f=r[12],v=r[13],g=r[14],p=r[15],y=t*s-e*a,b=t*o-n*a,w=e*o-n*s,O=c*v-u*f,_=c*g-h*f,F=u*g-h*v,W=t*F-e*_+n*O,j=a*F-s*_+o*O,H=c*w-u*b+h*y,K=f*w-v*b+g*y;return l*W-i*j+p*H-d*K}function Jt(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],v=t[11],g=t[12],p=t[13],y=t[14],b=t[15],w=e[0],O=e[1],_=e[2],F=e[3];return r[0]=w*n+O*o+_*h+F*g,r[1]=w*i+O*l+_*d+F*p,r[2]=w*a+O*c+_*f+F*y,r[3]=w*s+O*u+_*v+F*b,w=e[4],O=e[5],_=e[6],F=e[7],r[4]=w*n+O*o+_*h+F*g,r[5]=w*i+O*l+_*d+F*p,r[6]=w*a+O*c+_*f+F*y,r[7]=w*s+O*u+_*v+F*b,w=e[8],O=e[9],_=e[10],F=e[11],r[8]=w*n+O*o+_*h+F*g,r[9]=w*i+O*l+_*d+F*p,r[10]=w*a+O*c+_*f+F*y,r[11]=w*s+O*u+_*v+F*b,w=e[12],O=e[13],_=e[14],F=e[15],r[12]=w*n+O*o+_*h+F*g,r[13]=w*i+O*l+_*d+F*p,r[14]=w*a+O*c+_*f+F*y,r[15]=w*s+O*u+_*v+F*b,r}function Ht(r,t,e){var n=e[0],i=e[1],a=e[2],s,o,l,c,u,h,d,f,v,g,p,y;return t===r?(r[12]=t[0]*n+t[4]*i+t[8]*a+t[12],r[13]=t[1]*n+t[5]*i+t[9]*a+t[13],r[14]=t[2]*n+t[6]*i+t[10]*a+t[14],r[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(s=t[0],o=t[1],l=t[2],c=t[3],u=t[4],h=t[5],d=t[6],f=t[7],v=t[8],g=t[9],p=t[10],y=t[11],r[0]=s,r[1]=o,r[2]=l,r[3]=c,r[4]=u,r[5]=h,r[6]=d,r[7]=f,r[8]=v,r[9]=g,r[10]=p,r[11]=y,r[12]=s*n+u*i+v*a+t[12],r[13]=o*n+h*i+g*a+t[13],r[14]=l*n+d*i+p*a+t[14],r[15]=c*n+f*i+y*a+t[15]),r}function dn(r,t,e){var n=e[0],i=e[1],a=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*i,r[6]=t[6]*i,r[7]=t[7]*i,r[8]=t[8]*a,r[9]=t[9]*a,r[10]=t[10]*a,r[11]=t[11]*a,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function Je(r,t,e,n){var i=n[0],a=n[1],s=n[2],o=Math.sqrt(i*i+a*a+s*s),l,c,u,h,d,f,v,g,p,y,b,w,O,_,F,W,j,H,K,et,rt,lt,ht,yt;return o<Z?null:(o=1/o,i*=o,a*=o,s*=o,l=Math.sin(e),c=Math.cos(e),u=1-c,h=t[0],d=t[1],f=t[2],v=t[3],g=t[4],p=t[5],y=t[6],b=t[7],w=t[8],O=t[9],_=t[10],F=t[11],W=i*i*u+c,j=a*i*u+s*l,H=s*i*u-a*l,K=i*a*u-s*l,et=a*a*u+c,rt=s*a*u+i*l,lt=i*s*u+a*l,ht=a*s*u-i*l,yt=s*s*u+c,r[0]=h*W+g*j+w*H,r[1]=d*W+p*j+O*H,r[2]=f*W+y*j+_*H,r[3]=v*W+b*j+F*H,r[4]=h*K+g*et+w*rt,r[5]=d*K+p*et+O*rt,r[6]=f*K+y*et+_*rt,r[7]=v*K+b*et+F*rt,r[8]=h*lt+g*ht+w*yt,r[9]=d*lt+p*ht+O*yt,r[10]=f*lt+y*ht+_*yt,r[11]=v*lt+b*ht+F*yt,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function un(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[4],s=t[5],o=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=a*i+c*n,r[5]=s*i+u*n,r[6]=o*i+h*n,r[7]=l*i+d*n,r[8]=c*i-a*n,r[9]=u*i-s*n,r[10]=h*i-o*n,r[11]=d*i-l*n,r}function fn(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],s=t[1],o=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i-c*n,r[1]=s*i-u*n,r[2]=o*i-h*n,r[3]=l*i-d*n,r[8]=a*n+c*i,r[9]=s*n+u*i,r[10]=o*n+h*i,r[11]=l*n+d*i,r}function rr(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],s=t[1],o=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i+c*n,r[1]=s*i+u*n,r[2]=o*i+h*n,r[3]=l*i+d*n,r[4]=c*i-a*n,r[5]=u*i-s*n,r[6]=h*i-o*n,r[7]=d*i-l*n,r}function Hn(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function vn(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function ei(r,t,e){var n=e[0],i=e[1],a=e[2],s=Math.sqrt(n*n+i*i+a*a),o,l,c;return s<Z?null:(s=1/s,n*=s,i*=s,a*=s,o=Math.sin(t),l=Math.cos(t),c=1-l,r[0]=n*n*c+l,r[1]=i*n*c+a*o,r[2]=a*n*c-i*o,r[3]=0,r[4]=n*i*c-a*o,r[5]=i*i*c+l,r[6]=a*i*c+n*o,r[7]=0,r[8]=n*a*c+i*o,r[9]=i*a*c-n*o,r[10]=a*a*c+l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function fi(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=e,r[7]=0,r[8]=0,r[9]=-e,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function je(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=0,r[2]=-e,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=e,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Bn(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=0,r[4]=-e,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Tr(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=n+n,l=i+i,c=a+a,u=n*o,h=n*l,d=n*c,f=i*l,v=i*c,g=a*c,p=s*o,y=s*l,b=s*c;return r[0]=1-(f+g),r[1]=h+b,r[2]=d-y,r[3]=0,r[4]=h-b,r[5]=1-(u+g),r[6]=v+p,r[7]=0,r[8]=d+y,r[9]=v-p,r[10]=1-(u+f),r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function _r(r,t){var e=new Y(3),n=-t[0],i=-t[1],a=-t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=n*n+i*i+a*a+s*s;return h>0?(e[0]=(o*s+u*n+l*a-c*i)*2/h,e[1]=(l*s+u*i+c*n-o*a)*2/h,e[2]=(c*s+u*a+o*i-l*n)*2/h):(e[0]=(o*s+u*n+l*a-c*i)*2,e[1]=(l*s+u*i+c*n-o*a)*2,e[2]=(c*s+u*a+o*i-l*n)*2),Tr(r,t,e),r}function Tn(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function Ca(r,t){var e=t[0],n=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return r[0]=Math.sqrt(e*e+n*n+i*i),r[1]=Math.sqrt(a*a+s*s+o*o),r[2]=Math.sqrt(l*l+c*c+u*u),r}function Js(r,t){var e=new Y(3);Ca(e,t);var n=1/e[0],i=1/e[1],a=1/e[2],s=t[0]*n,o=t[1]*i,l=t[2]*a,c=t[4]*n,u=t[5]*i,h=t[6]*a,d=t[8]*n,f=t[9]*i,v=t[10]*a,g=s+u+v,p=0;return g>0?(p=Math.sqrt(g+1)*2,r[3]=.25*p,r[0]=(h-f)/p,r[1]=(d-l)/p,r[2]=(o-c)/p):s>u&&s>v?(p=Math.sqrt(1+s-u-v)*2,r[3]=(h-f)/p,r[0]=.25*p,r[1]=(o+c)/p,r[2]=(d+l)/p):u>v?(p=Math.sqrt(1+u-s-v)*2,r[3]=(d-l)/p,r[0]=(o+c)/p,r[1]=.25*p,r[2]=(h+f)/p):(p=Math.sqrt(1+v-s-u)*2,r[3]=(o-c)/p,r[0]=(d+l)/p,r[1]=(h+f)/p,r[2]=.25*p),r}function md(r,t,e,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];var i=n[0],a=n[1],s=n[2],o=n[4],l=n[5],c=n[6],u=n[8],h=n[9],d=n[10];e[0]=Math.sqrt(i*i+a*a+s*s),e[1]=Math.sqrt(o*o+l*l+c*c),e[2]=Math.sqrt(u*u+h*h+d*d);var f=1/e[0],v=1/e[1],g=1/e[2],p=i*f,y=a*v,b=s*g,w=o*f,O=l*v,_=c*g,F=u*f,W=h*v,j=d*g,H=p+O+j,K=0;return H>0?(K=Math.sqrt(H+1)*2,r[3]=.25*K,r[0]=(_-W)/K,r[1]=(F-b)/K,r[2]=(y-w)/K):p>O&&p>j?(K=Math.sqrt(1+p-O-j)*2,r[3]=(_-W)/K,r[0]=.25*K,r[1]=(y+w)/K,r[2]=(F+b)/K):O>j?(K=Math.sqrt(1+O-p-j)*2,r[3]=(F-b)/K,r[0]=(y+w)/K,r[1]=.25*K,r[2]=(_+W)/K):(K=Math.sqrt(1+j-p-O)*2,r[3]=(y-w)/K,r[0]=(F+b)/K,r[1]=(_+W)/K,r[2]=.25*K),r}function yd(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,d=i*c,f=i*u,v=a*c,g=a*u,p=s*u,y=o*l,b=o*c,w=o*u,O=n[0],_=n[1],F=n[2];return r[0]=(1-(v+p))*O,r[1]=(d+w)*O,r[2]=(f-b)*O,r[3]=0,r[4]=(d-w)*_,r[5]=(1-(h+p))*_,r[6]=(g+y)*_,r[7]=0,r[8]=(f+b)*F,r[9]=(g-y)*F,r[10]=(1-(h+v))*F,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function ds(r,t,e,n,i){var a=t[0],s=t[1],o=t[2],l=t[3],c=a+a,u=s+s,h=o+o,d=a*c,f=a*u,v=a*h,g=s*u,p=s*h,y=o*h,b=l*c,w=l*u,O=l*h,_=n[0],F=n[1],W=n[2],j=i[0],H=i[1],K=i[2],et=(1-(g+y))*_,rt=(f+O)*_,lt=(v-w)*_,ht=(f-O)*F,yt=(1-(d+y))*F,Nt=(p+b)*F,Ct=(v+w)*W,pt=(p-b)*W,xt=(1-(d+g))*W;return r[0]=et,r[1]=rt,r[2]=lt,r[3]=0,r[4]=ht,r[5]=yt,r[6]=Nt,r[7]=0,r[8]=Ct,r[9]=pt,r[10]=xt,r[11]=0,r[12]=e[0]+j-(et*j+ht*H+Ct*K),r[13]=e[1]+H-(rt*j+yt*H+pt*K),r[14]=e[2]+K-(lt*j+Nt*H+xt*K),r[15]=1,r}function Wo(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e+e,o=n+n,l=i+i,c=e*s,u=n*s,h=n*o,d=i*s,f=i*o,v=i*l,g=a*s,p=a*o,y=a*l;return r[0]=1-h-v,r[1]=u+y,r[2]=d-p,r[3]=0,r[4]=u-y,r[5]=1-c-v,r[6]=f+g,r[7]=0,r[8]=d+p,r[9]=f-g,r[10]=1-c-h,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function bd(r,t,e,n,i,a,s){var o=1/(e-t),l=1/(i-n),c=1/(a-s);return r[0]=a*2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*l,r[6]=0,r[7]=0,r[8]=(e+t)*o,r[9]=(i+n)*l,r[10]=(s+a)*c,r[11]=-1,r[12]=0,r[13]=0,r[14]=s*a*2*c,r[15]=0,r}function Kl(r,t,e,n,i){var a=1/Math.tan(t/2);if(r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0){var s=1/(n-i);r[10]=(i+n)*s,r[14]=2*i*n*s}else r[10]=-1,r[14]=-2*n;return r}var xd=Kl;function iw(r,t,e,n,i){var a=1/Math.tan(t/2);if(r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0){var s=1/(n-i);r[10]=i*s,r[14]=i*n*s}else r[10]=-1,r[14]=-n;return r}function aw(r,t,e,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+o),c=2/(i+a);return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=-((s-o)*l*.5),r[9]=(i-a)*c*.5,r[10]=n/(e-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*e/(e-n),r[15]=0,r}function ng(r,t,e,n,i,a,s){var o=1/(t-e),l=1/(n-i),c=1/(a-s);return r[0]=-2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*c,r[11]=0,r[12]=(t+e)*o,r[13]=(i+n)*l,r[14]=(s+a)*c,r[15]=1,r}var rg=ng;function ig(r,t,e,n,i,a,s){var o=1/(t-e),l=1/(n-i),c=1/(a-s);return r[0]=-2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=0,r[12]=(t+e)*o,r[13]=(i+n)*l,r[14]=a*c,r[15]=1,r}function ag(r,t,e,n){var i,a,s,o,l,c,u,h,d,f,v=t[0],g=t[1],p=t[2],y=n[0],b=n[1],w=n[2],O=e[0],_=e[1],F=e[2];return Math.abs(v-O)<Z&&Math.abs(g-_)<Z&&Math.abs(p-F)<Z?ge(r):(u=v-O,h=g-_,d=p-F,f=1/Math.sqrt(u*u+h*h+d*d),u*=f,h*=f,d*=f,i=b*d-w*h,a=w*u-y*d,s=y*h-b*u,f=Math.sqrt(i*i+a*a+s*s),f?(f=1/f,i*=f,a*=f,s*=f):(i=0,a=0,s=0),o=h*s-d*a,l=d*i-u*s,c=u*a-h*i,f=Math.sqrt(o*o+l*l+c*c),f?(f=1/f,o*=f,l*=f,c*=f):(o=0,l=0,c=0),r[0]=i,r[1]=o,r[2]=u,r[3]=0,r[4]=a,r[5]=l,r[6]=h,r[7]=0,r[8]=s,r[9]=c,r[10]=d,r[11]=0,r[12]=-(i*v+a*g+s*p),r[13]=-(o*v+l*g+c*p),r[14]=-(u*v+h*g+d*p),r[15]=1,r)}function sw(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=n[0],l=n[1],c=n[2],u=i-e[0],h=a-e[1],d=s-e[2],f=u*u+h*h+d*d;f>0&&(f=1/Math.sqrt(f),u*=f,h*=f,d*=f);var v=l*d-c*h,g=c*u-o*d,p=o*h-l*u;return f=v*v+g*g+p*p,f>0&&(f=1/Math.sqrt(f),v*=f,g*=f,p*=f),r[0]=v,r[1]=g,r[2]=p,r[3]=0,r[4]=h*p-d*g,r[5]=d*v-u*p,r[6]=u*g-h*v,r[7]=0,r[8]=u,r[9]=h,r[10]=d,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,r}function ow(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function lw(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+r[6]*r[6]+r[7]*r[7]+r[8]*r[8]+r[9]*r[9]+r[10]*r[10]+r[11]*r[11]+r[12]*r[12]+r[13]*r[13]+r[14]*r[14]+r[15]*r[15])}function cw(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r}function sg(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r}function uw(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r}function hw(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r[9]=t[9]+e[9]*n,r[10]=t[10]+e[10]*n,r[11]=t[11]+e[11]*n,r[12]=t[12]+e[12]*n,r[13]=t[13]+e[13]*n,r[14]=t[14]+e[14]*n,r[15]=t[15]+e[15]*n,r}function Ed(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]}function dw(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],s=r[4],o=r[5],l=r[6],c=r[7],u=r[8],h=r[9],d=r[10],f=r[11],v=r[12],g=r[13],p=r[14],y=r[15],b=t[0],w=t[1],O=t[2],_=t[3],F=t[4],W=t[5],j=t[6],H=t[7],K=t[8],et=t[9],rt=t[10],lt=t[11],ht=t[12],yt=t[13],Nt=t[14],Ct=t[15];return Math.abs(e-b)<=Z*Math.max(1,Math.abs(e),Math.abs(b))&&Math.abs(n-w)<=Z*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-O)<=Z*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(a-_)<=Z*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(s-F)<=Z*Math.max(1,Math.abs(s),Math.abs(F))&&Math.abs(o-W)<=Z*Math.max(1,Math.abs(o),Math.abs(W))&&Math.abs(l-j)<=Z*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(c-H)<=Z*Math.max(1,Math.abs(c),Math.abs(H))&&Math.abs(u-K)<=Z*Math.max(1,Math.abs(u),Math.abs(K))&&Math.abs(h-et)<=Z*Math.max(1,Math.abs(h),Math.abs(et))&&Math.abs(d-rt)<=Z*Math.max(1,Math.abs(d),Math.abs(rt))&&Math.abs(f-lt)<=Z*Math.max(1,Math.abs(f),Math.abs(lt))&&Math.abs(v-ht)<=Z*Math.max(1,Math.abs(v),Math.abs(ht))&&Math.abs(g-yt)<=Z*Math.max(1,Math.abs(g),Math.abs(yt))&&Math.abs(p-Nt)<=Z*Math.max(1,Math.abs(p),Math.abs(Nt))&&Math.abs(y-Ct)<=Z*Math.max(1,Math.abs(y),Math.abs(Ct))}var og=Jt,fw=sg;function lg(){var r=new Y(9);return Y!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function vw(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r}function BB(r){var t=new glMatrix.ARRAY_TYPE(9);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function FB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function gw(r,t,e,n,i,a,s,o,l){var c=new Y(9);return c[0]=r,c[1]=t,c[2]=e,c[3]=n,c[4]=i,c[5]=a,c[6]=s,c[7]=o,c[8]=l,c}function zB(r,t,e,n,i,a,s,o,l,c){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=s,r[6]=o,r[7]=l,r[8]=c,r}function jB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function ZB(r,t){if(r===t){var e=t[1],n=t[2],i=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=i}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function WB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=u*s-o*c,d=-u*a+o*l,f=c*a-s*l,v=e*h+n*d+i*f;return v?(v=1/v,r[0]=h*v,r[1]=(-u*n+i*c)*v,r[2]=(o*n-i*s)*v,r[3]=d*v,r[4]=(u*e-i*l)*v,r[5]=(-o*e+i*a)*v,r[6]=f*v,r[7]=(-c*e+n*l)*v,r[8]=(s*e-n*a)*v,r):null}function GB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8];return r[0]=s*u-o*c,r[1]=i*c-n*u,r[2]=n*o-i*s,r[3]=o*l-a*u,r[4]=e*u-i*l,r[5]=i*a-e*o,r[6]=a*c-s*l,r[7]=n*l-e*c,r[8]=e*s-n*a,r}function VB(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],s=r[5],o=r[6],l=r[7],c=r[8];return t*(c*a-s*l)+e*(-c*i+s*o)+n*(l*i-a*o)}function UB(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],f=e[1],v=e[2],g=e[3],p=e[4],y=e[5],b=e[6],w=e[7],O=e[8];return r[0]=d*n+f*s+v*c,r[1]=d*i+f*o+v*u,r[2]=d*a+f*l+v*h,r[3]=g*n+p*s+y*c,r[4]=g*i+p*o+y*u,r[5]=g*a+p*l+y*h,r[6]=b*n+w*s+O*c,r[7]=b*i+w*o+O*u,r[8]=b*a+w*l+O*h,r}function YB(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],f=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=o,r[5]=l,r[6]=d*n+f*s+c,r[7]=d*i+f*o+u,r[8]=d*a+f*l+h,r}function HB(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(e),f=Math.cos(e);return r[0]=f*n+d*s,r[1]=f*i+d*o,r[2]=f*a+d*l,r[3]=f*s-d*n,r[4]=f*o-d*i,r[5]=f*l-d*a,r[6]=c,r[7]=u,r[8]=h,r}function XB(r,t,e){var n=e[0],i=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=i*t[3],r[4]=i*t[4],r[5]=i*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function KB(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=t[0],r[7]=t[1],r[8]=1,r}function QB(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=-e,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function qB(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=t[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function JB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=0,r[3]=t[2],r[4]=t[3],r[5]=0,r[6]=t[4],r[7]=t[5],r[8]=1,r}function $B(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e+e,o=n+n,l=i+i,c=e*s,u=n*s,h=n*o,d=i*s,f=i*o,v=i*l,g=a*s,p=a*o,y=a*l;return r[0]=1-h-v,r[3]=u-y,r[6]=d+p,r[1]=u+y,r[4]=1-c-v,r[7]=f-g,r[2]=d-p,r[5]=f+g,r[8]=1-c-h,r}function tF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-n*s,w=e*l-i*s,O=e*c-a*s,_=n*l-i*o,F=n*c-a*o,W=i*c-a*l,j=u*g-h*v,H=u*p-d*v,K=u*y-f*v,et=h*p-d*g,rt=h*y-f*g,lt=d*y-f*p,ht=b*lt-w*rt+O*et+_*K-F*H+W*j;return ht?(ht=1/ht,r[0]=(o*lt-l*rt+c*et)*ht,r[1]=(l*K-s*lt-c*H)*ht,r[2]=(s*rt-o*K+c*j)*ht,r[3]=(i*rt-n*lt-a*et)*ht,r[4]=(e*lt-i*K+a*H)*ht,r[5]=(n*K-e*rt-a*j)*ht,r[6]=(g*W-p*F+y*_)*ht,r[7]=(p*O-v*W-y*w)*ht,r[8]=(v*F-g*O+y*b)*ht,r):null}function eF(r,t,e){return r[0]=2/t,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/e,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function nF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function rF(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+r[6]*r[6]+r[7]*r[7]+r[8]*r[8])}function iF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r}function aF(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r}function sF(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r}function oF(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function lF(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]}function cF(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],s=r[4],o=r[5],l=r[6],c=r[7],u=r[8],h=t[0],d=t[1],f=t[2],v=t[3],g=t[4],p=t[5],y=t[6],b=t[7],w=t[8];return Math.abs(e-h)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(n-d)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-f)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-v)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-g)<=glMatrix.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(o-p)<=glMatrix.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(l-y)<=glMatrix.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(c-b)<=glMatrix.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(u-w)<=glMatrix.EPSILON*Math.max(1,Math.abs(u),Math.abs(w))}var uF=null,hF=null;function Xn(){var r=new Y(4);return Y!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function dF(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function Na(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function fF(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>glMatrix.EPSILON?(r[0]=t[0]/n,r[1]=t[1]/n,r[2]=t[2]/n):(r[0]=1,r[1]=0,r[2]=0),e}function vF(r,t){var e=Ew(r,t);return Math.acos(2*e*e-1)}function ka(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],l=e[1],c=e[2],u=e[3];return r[0]=n*u+s*o+i*c-a*l,r[1]=i*u+s*l+a*o-n*c,r[2]=a*u+s*c+n*l-i*o,r[3]=s*u-n*o-i*l-a*c,r}function gF(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return r[0]=n*l+s*o,r[1]=i*l+a*o,r[2]=a*l-i*o,r[3]=s*l-n*o,r}function pF(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return r[0]=n*l-a*o,r[1]=i*l+s*o,r[2]=a*l+n*o,r[3]=s*l-i*o,r}function mF(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return r[0]=n*l+i*o,r[1]=i*l-n*o,r[2]=a*l+s*o,r[3]=s*l-a*o,r}function yF(r,t){var e=t[0],n=t[1],i=t[2];return r[0]=e,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),r}function pw(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=Math.sqrt(e*e+n*n+i*i),o=Math.exp(a),l=s>0?o*Math.sin(s)/s:0;return r[0]=e*l,r[1]=n*l,r[2]=i*l,r[3]=o*Math.cos(s),r}function mw(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=Math.sqrt(e*e+n*n+i*i),o=s>0?Math.atan2(s,a)/s:0;return r[0]=e*o,r[1]=n*o,r[2]=i*o,r[3]=.5*Math.log(e*e+n*n+i*i+a*a),r}function bF(r,t,e){return mw(r,t),xw(r,r,e),pw(r,r),r}function wd(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=t[3],l=e[0],c=e[1],u=e[2],h=e[3],d,f,v,g,p;return f=i*l+a*c+s*u+o*h,f<0&&(f=-f,l=-l,c=-c,u=-u,h=-h),1-f>Z?(d=Math.acos(f),v=Math.sin(d),g=Math.sin((1-n)*d)/v,p=Math.sin(n*d)/v):(g=1-n,p=n),r[0]=g*i+p*l,r[1]=g*a+p*c,r[2]=g*s+p*u,r[3]=g*o+p*h,r}function xF(r){var t=glMatrix.RANDOM(),e=glMatrix.RANDOM(),n=glMatrix.RANDOM(),i=Math.sqrt(1-t),a=Math.sqrt(t);return r[0]=i*Math.sin(2*Math.PI*e),r[1]=i*Math.cos(2*Math.PI*e),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function Sd(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e*e+n*n+i*i+a*a,o=s?1/s:0;return r[0]=-e*o,r[1]=-n*o,r[2]=-i*o,r[3]=a*o,r}function EF(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function yw(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),r[i]=.5*n,n=.5/n,r[3]=(t[a*3+s]-t[s*3+a])*n,r[a]=(t[a*3+i]+t[i*3+a])*n,r[s]=(t[s*3+i]+t[i*3+s])*n}return r}function Ql(r,t,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:nt,a=Math.PI/360;t*=a,n*=a,e*=a;var s=Math.sin(t),o=Math.cos(t),l=Math.sin(e),c=Math.cos(e),u=Math.sin(n),h=Math.cos(n);switch(i){case"xyz":r[0]=s*c*h+o*l*u,r[1]=o*l*h-s*c*u,r[2]=o*c*u+s*l*h,r[3]=o*c*h-s*l*u;break;case"xzy":r[0]=s*c*h-o*l*u,r[1]=o*l*h-s*c*u,r[2]=o*c*u+s*l*h,r[3]=o*c*h+s*l*u;break;case"yxz":r[0]=s*c*h+o*l*u,r[1]=o*l*h-s*c*u,r[2]=o*c*u-s*l*h,r[3]=o*c*h+s*l*u;break;case"yzx":r[0]=s*c*h+o*l*u,r[1]=o*l*h+s*c*u,r[2]=o*c*u-s*l*h,r[3]=o*c*h-s*l*u;break;case"zxy":r[0]=s*c*h-o*l*u,r[1]=o*l*h+s*c*u,r[2]=o*c*u+s*l*h,r[3]=o*c*h-s*l*u;break;case"zyx":r[0]=s*c*h-o*l*u,r[1]=o*l*h+s*c*u,r[2]=o*c*u-s*l*h,r[3]=o*c*h+s*l*u;break;default:throw new Error("Unknown angle order "+i)}return r}function wF(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var SF=ud,bw=Ui,ql=Oi,cg=zo,MF=Oa,ug=ka,xw=dd,Ew=U,AF=E,TF=vd,OF=null,CF=gd,NF=null,Jl=Xl,kF=st;function PF(r,t){return Math.abs(vec4.dot(r,t))>=1-glMatrix.EPSILON}var RF=function(){var r=gt(),t=Et(1,0,0),e=Et(0,1,0);return function(n,i,a){var s=be(i,a);return s<-.999999?(de(r,t,i),hs(r)<1e-6&&de(r,e,i),se(r,r),Na(n,r,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(de(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+s,Jl(n,n))}}(),LF=function(){var r=Xn(),t=Xn();return function(e,n,i,a,s,o){return wd(r,n,s,o),wd(t,i,a,o),wd(e,r,t,2*o*(1-o)),e}}(),DF=function(){var r=lg();return function(t,e,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],Jl(t,yw(t,r))}}();function Md(){var r=new Y(2);return Y!=Float32Array&&(r[0]=0,r[1]=0),r}function _F(r){var t=new glMatrix.ARRAY_TYPE(2);return t[0]=r[0],t[1]=r[1],t}function IF(r,t){var e=new glMatrix.ARRAY_TYPE(2);return e[0]=r,e[1]=t,e}function ww(r,t){return r[0]=t[0],r[1]=t[1],r}function Sw(r,t,e){return r[0]=t,r[1]=e,r}function BF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function FF(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function zF(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function jF(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function ZF(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function WF(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function GF(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function VF(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function UF(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r}function YF(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function HF(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function XF(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.sqrt(e*e+n*n)}function KF(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function QF(r){var t=r[0],e=r[1];return Math.sqrt(t*t+e*e)}function qF(r){var t=r[0],e=r[1];return t*t+e*e}function JF(r,t){return r[0]=-t[0],r[1]=-t[1],r}function $F(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function Mw(r,t){var e=t[0],n=t[1],i=e*e+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r}function Aw(r,t){return r[0]*t[0]+r[1]*t[1]}function t8(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function e8(r,t,e,n){var i=t[0],a=t[1];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r}function n8(r,t){t=t===void 0?1:t;var e=glMatrix.RANDOM()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function r8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i,r[1]=e[1]*n+e[3]*i,r}function i8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i+e[4],r[1]=e[1]*n+e[3]*i+e[5],r}function a8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[3]*i+e[6],r[1]=e[1]*n+e[4]*i+e[7],r}function s8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[4]*i+e[12],r[1]=e[1]*n+e[5]*i+e[13],r}function o8(r,t,e,n){var i=t[0]-e[0],a=t[1]-e[1],s=Math.sin(n),o=Math.cos(n);return r[0]=i*o-a*s+e[0],r[1]=i*s+a*o+e[1],r}function l8(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(Math.atan2(n*i-e*a,e*i+n*a))}function c8(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.atan2(e*a-n*i,e*i+n*a)}function u8(r){return r[0]=0,r[1]=0,r}function h8(r){return"vec2("+r[0]+", "+r[1]+")"}function Tw(r,t){return r[0]===t[0]&&r[1]===t[1]}function d8(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))}var f8=null,v8=null,g8=null,p8=null,m8=null,y8=null,b8=null,x8=function(){var r=Md();return function(t,e,n,i,a,s){var o,l;for(e||(e=2),n||(n=0),i?l=Math.min(i*e+n,t.length):l=t.length,o=n;o<l;o+=e)r[0]=t[o],r[1]=t[o+1],a(r,r,s),t[o]=r[0],t[o+1]=r[1];return t}}();function ie(r){return typeof r=="number"}function Wr(r,t){return Math.sqrt((r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1]))}function ye(r){return r==null}function Ve(r){return typeof r=="string"}var Ow=function(r,t,e){return r<t?t:r>e?e:r},kn=Ow,G=S(80813),Go={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function hg(r){return Array.isArray(r)&&r.every(function(t){var e=t[0].toLowerCase();return Go[e]===t.length-1&&"achlmqstvz".includes(e)})}function dg(r){return hg(r)&&r.every(function(t){var e=t[0];return e===e.toUpperCase()})}function fg(r){return dg(r)&&r.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}var vg={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function gg(r){for(var t=r.pathValue[r.segmentStart],e=t.toLowerCase(),n=r.data;n.length>=Go[e]&&(e==="m"&&n.length>2?(r.segments.push([t].concat(n.splice(0,2))),e="l",t=t==="m"?"l":"L"):r.segments.push([t].concat(n.splice(0,Go[e]))),!!Go[e]););}function Cw(r){var t=r.index,e=r.pathValue,n=e.charCodeAt(t);if(n===48){r.param=0,r.index+=1;return}if(n===49){r.param=1,r.index+=1;return}r.err='[path-util]: invalid Arc flag "'.concat(e[t],'", expecting 0 or 1 at index ').concat(t)}function Nw(r){return r>=48&&r<=57||r===43||r===45||r===46}function $s(r){return r>=48&&r<=57}function kw(r){var t=r.max,e=r.pathValue,n=r.index,i=n,a=!1,s=!1,o=!1,l=!1,c;if(i>=t){r.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(c=e.charCodeAt(i),(c===43||c===45)&&(i+=1,c=e.charCodeAt(i)),!$s(c)&&c!==46){r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" is not a number');return}if(c!==46){if(a=c===48,i+=1,c=e.charCodeAt(i),a&&i<t&&c&&$s(c)){r.err="[path-util]: Invalid path value at index ".concat(n,', "').concat(e[n],'" illegal number');return}for(;i<t&&$s(e.charCodeAt(i));)i+=1,s=!0;c=e.charCodeAt(i)}if(c===46){for(l=!0,i+=1;$s(e.charCodeAt(i));)i+=1,o=!0;c=e.charCodeAt(i)}if(c===101||c===69){if(l&&!s&&!o){r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid float exponent');return}if(i+=1,c=e.charCodeAt(i),(c===43||c===45)&&(i+=1),i<t&&$s(e.charCodeAt(i)))for(;i<t&&$s(e.charCodeAt(i));)i+=1;else{r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid integer exponent');return}}r.index=i,r.param=+r.pathValue.slice(n,i)}function Pw(r){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return r===10||r===13||r===8232||r===8233||r===32||r===9||r===11||r===12||r===160||r>=5760&&t.includes(r)}function $l(r){for(var t=r.pathValue,e=r.max;r.index<e&&Pw(t.charCodeAt(r.index));)r.index+=1}function Rw(r){switch(r|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function Lw(r){return(r|32)===97}function Dw(r){var t=r.max,e=r.pathValue,n=r.index,i=e.charCodeAt(n),a=Go[e[n].toLowerCase()];if(r.segmentStart=n,!Rw(i)){r.err='[path-util]: Invalid path value "'.concat(e[n],'" is not a path command');return}if(r.index+=1,$l(r),r.data=[],!a){gg(r);return}for(;;){for(var s=a;s>0;s-=1){if(Lw(i)&&(s===3||s===4)?Cw(r):kw(r),r.err.length)return;r.data.push(r.param),$l(r),r.index<t&&e.charCodeAt(r.index)===44&&(r.index+=1,$l(r))}if(r.index>=r.max||!Nw(e.charCodeAt(r.index)))break}gg(r)}var _w=function(){function r(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return r}();function Iw(r){if(hg(r))return[].concat(r);var t=new _w(r);for($l(t);t.index<t.max&&!t.err.length;)Dw(t);return t.err?t.err:t.segments}function Bw(r){if(dg(r))return[].concat(r);var t=Iw(r),e=0,n=0,i=0,a=0;return t.map(function(s){var o=s.slice(1).map(Number),l=s[0],c=l.toUpperCase();if(l==="M")return e=o[0],n=o[1],i=e,a=n,["M",e,n];var u;if(l!==c)switch(c){case"A":u=[c,o[0],o[1],o[2],o[3],o[4],o[5]+e,o[6]+n];break;case"V":u=[c,o[0]+n];break;case"H":u=[c,o[0]+e];break;default:{var h=o.map(function(f,v){return f+(v%2?n:e)});u=[c].concat(h)}}else u=[c].concat(o);var d=u.length;switch(c){case"Z":e=i,n=a;break;case"H":e=u[1];break;case"V":n=u[1];break;default:e=u[d-2],n=u[d-1],c==="M"&&(i=e,a=n)}return u})}function Fw(r,t){var e=r[0],n=t.x1,i=t.y1,a=t.x2,s=t.y2,o=r.slice(1).map(Number),l=r;if("TQ".includes(e)||(t.qx=null,t.qy=null),e==="H")l=["L",r[1],i];else if(e==="V")l=["L",n,r[1]];else if(e==="S"){var c=n*2-a,u=i*2-s;t.x1=c,t.y1=u,l=["C",c,u].concat(o)}else if(e==="T"){var h=n*2-t.qx,d=i*2-t.qy;t.qx=h,t.qy=d,l=["Q",h,d].concat(o)}else if(e==="Q"){var f=o[0],v=o[1];t.qx=f,t.qy=v}return l}function tc(r){if(fg(r))return[].concat(r);for(var t=Bw(r),e=(0,G.pi)({},vg),n=0;n<t.length;n+=1){t[n]=Fw(t[n],e);var i=t[n],a=i.length;e.x1=+i[a-2],e.y1=+i[a-1],e.x2=+i[a-4]||e.x1,e.y2=+i[a-3]||e.y1}return t}function Pa(r,t,e){var n=r[0],i=r[1],a=t[0],s=t[1];return[n+(a-n)*e,i+(s-i)*e]}function Ad(r,t,e,n,i){var a=Wr([r,t],[e,n]),s={x:0,y:0};if(typeof i=="number")if(i<=0)s={x:r,y:t};else if(i>=a)s={x:e,y:n};else{var o=Pa([r,t],[e,n],i/a),l=o[0],c=o[1];s={x:l,y:c}}return{length:a,point:s,min:{x:Math.min(r,e),y:Math.min(t,n)},max:{x:Math.max(r,e),y:Math.max(t,n)}}}function pg(r,t){var e=r.x,n=r.y,i=t.x,a=t.y,s=e*i+n*a,o=Math.sqrt((Math.pow(e,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(a,2))),l=e*a-n*i<0?-1:1,c=l*Math.acos(s/o);return c}function zw(r,t,e,n,i,a,s,o,l,c){var u=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,v=Math.PI,g=u(e),p=u(n),y=(i%360+360)%360,b=y*(v/180);if(r===o&&t===l)return{x:r,y:t};if(g===0||p===0)return Ad(r,t,o,l,c).point;var w=(r-o)/2,O=(t-l)/2,_={x:d(b)*w+h(b)*O,y:-h(b)*w+d(b)*O},F=Math.pow(_.x,2)/Math.pow(g,2)+Math.pow(_.y,2)/Math.pow(p,2);F>1&&(g*=f(F),p*=f(F));var W=Math.pow(g,2)*Math.pow(p,2)-Math.pow(g,2)*Math.pow(_.y,2)-Math.pow(p,2)*Math.pow(_.x,2),j=Math.pow(g,2)*Math.pow(_.y,2)+Math.pow(p,2)*Math.pow(_.x,2),H=W/j;H=H<0?0:H;var K=(a!==s?1:-1)*f(H),et={x:K*(g*_.y/p),y:K*(-(p*_.x)/g)},rt={x:d(b)*et.x-h(b)*et.y+(r+o)/2,y:h(b)*et.x+d(b)*et.y+(t+l)/2},lt={x:(_.x-et.x)/g,y:(_.y-et.y)/p},ht=pg({x:1,y:0},lt),yt={x:(-_.x-et.x)/g,y:(-_.y-et.y)/p},Nt=pg(lt,yt);!s&&Nt>0?Nt-=2*v:s&&Nt<0&&(Nt+=2*v),Nt%=2*v;var Ct=ht+Nt*c,pt=g*d(Ct),xt=p*h(Ct),kt={x:d(b)*pt-h(b)*xt+rt.x,y:h(b)*pt+d(b)*xt+rt.y};return kt}function jw(r,t,e,n,i,a,s,o,l,c,u){var h,d=u.bbox,f=d===void 0?!0:d,v=u.length,g=v===void 0?!0:v,p=u.sampleSize,y=p===void 0?30:p,b=typeof c=="number",w=r,O=t,_=0,F=[w,O,_],W=[w,O],j=0,H={x:0,y:0},K=[{x:w,y:O}];b&&c<=0&&(H={x:w,y:O});for(var et=0;et<=y;et+=1){if(j=et/y,h=zw(r,t,e,n,i,a,s,o,l,j),w=h.x,O=h.y,f&&K.push({x:w,y:O}),g&&(_+=Wr(W,[w,O])),W=[w,O],b&&_>=c&&c>F[2]){var rt=(_-c)/(_-F[2]);H={x:W[0]*(1-rt)+F[0]*rt,y:W[1]*(1-rt)+F[1]*rt}}F=[w,O,_]}return b&&c>=_&&(H={x:o,y:l}),{length:_,point:H,min:{x:Math.min.apply(null,K.map(function(lt){return lt.x})),y:Math.min.apply(null,K.map(function(lt){return lt.y}))},max:{x:Math.max.apply(null,K.map(function(lt){return lt.x})),y:Math.max.apply(null,K.map(function(lt){return lt.y}))}}}function Zw(r,t,e,n,i,a,s,o,l){var c=1-l;return{x:Math.pow(c,3)*r+3*Math.pow(c,2)*l*e+3*c*Math.pow(l,2)*i+Math.pow(l,3)*s,y:Math.pow(c,3)*t+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*a+Math.pow(l,3)*o}}function mg(r,t,e,n,i,a,s,o,l,c){var u,h=c.bbox,d=h===void 0?!0:h,f=c.length,v=f===void 0?!0:f,g=c.sampleSize,p=g===void 0?10:g,y=typeof l=="number",b=r,w=t,O=0,_=[b,w,O],F=[b,w],W=0,j={x:0,y:0},H=[{x:b,y:w}];y&&l<=0&&(j={x:b,y:w});for(var K=0;K<=p;K+=1){if(W=K/p,u=Zw(r,t,e,n,i,a,s,o,W),b=u.x,w=u.y,d&&H.push({x:b,y:w}),v&&(O+=Wr(F,[b,w])),F=[b,w],y&&O>=l&&l>_[2]){var et=(O-l)/(O-_[2]);j={x:F[0]*(1-et)+_[0]*et,y:F[1]*(1-et)+_[1]*et}}_=[b,w,O]}return y&&l>=O&&(j={x:s,y:o}),{length:O,point:j,min:{x:Math.min.apply(null,H.map(function(rt){return rt.x})),y:Math.min.apply(null,H.map(function(rt){return rt.y}))},max:{x:Math.max.apply(null,H.map(function(rt){return rt.x})),y:Math.max.apply(null,H.map(function(rt){return rt.y}))}}}function Ww(r,t,e,n,i,a,s){var o=1-s;return{x:Math.pow(o,2)*r+2*o*s*e+Math.pow(s,2)*i,y:Math.pow(o,2)*t+2*o*s*n+Math.pow(s,2)*a}}function Gw(r,t,e,n,i,a,s,o){var l,c=o.bbox,u=c===void 0?!0:c,h=o.length,d=h===void 0?!0:h,f=o.sampleSize,v=f===void 0?10:f,g=typeof s=="number",p=r,y=t,b=0,w=[p,y,b],O=[p,y],_=0,F={x:0,y:0},W=[{x:p,y}];g&&s<=0&&(F={x:p,y});for(var j=0;j<=v;j+=1){if(_=j/v,l=Ww(r,t,e,n,i,a,_),p=l.x,y=l.y,u&&W.push({x:p,y}),d&&(b+=Wr(O,[p,y])),O=[p,y],g&&b>=s&&s>w[2]){var H=(b-s)/(b-w[2]);F={x:O[0]*(1-H)+w[0]*H,y:O[1]*(1-H)+w[1]*H}}w=[p,y,b]}return g&&s>=b&&(F={x:i,y:a}),{length:b,point:F,min:{x:Math.min.apply(null,W.map(function(K){return K.x})),y:Math.min.apply(null,W.map(function(K){return K.y}))},max:{x:Math.max.apply(null,W.map(function(K){return K.x})),y:Math.max.apply(null,W.map(function(K){return K.y}))}}}function yg(r,t,e){for(var n,i,a,s,o,l,c=tc(r),u=typeof t=="number",h,d=[],f,v=0,g=0,p=0,y=0,b,w=[],O=[],_=0,F={x:0,y:0},W=F,j=F,H=F,K=0,et=0,rt=c.length;et<rt;et+=1)b=c[et],f=b[0],h=f==="M",d=h?d:[v,g].concat(b.slice(1)),h?(p=b[1],y=b[2],F={x:p,y},W=F,_=0,u&&t<.001&&(H=F)):f==="L"?(n=Ad(d[0],d[1],d[2],d[3],(t||0)-K),_=n.length,F=n.min,W=n.max,j=n.point):f==="A"?(i=jw(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-K,e||{}),_=i.length,F=i.min,W=i.max,j=i.point):f==="C"?(a=mg(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-K,e||{}),_=a.length,F=a.min,W=a.max,j=a.point):f==="Q"?(s=Gw(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-K,e||{}),_=s.length,F=s.min,W=s.max,j=s.point):f==="Z"&&(d=[v,g,p,y],o=Ad(d[0],d[1],d[2],d[3],(t||0)-K),_=o.length,F=o.min,W=o.max,j=o.point),u&&K<t&&K+_>=t&&(H=j),O.push(W),w.push(F),K+=_,l=f!=="Z"?b.slice(-2):[p,y],v=l[0],g=l[1];return u&&t>=K&&(H={x:v,y:g}),{length:K,point:H,min:{x:Math.min.apply(null,w.map(function(lt){return lt.x})),y:Math.min.apply(null,w.map(function(lt){return lt.y}))},max:{x:Math.max.apply(null,O.map(function(lt){return lt.x})),y:Math.max.apply(null,O.map(function(lt){return lt.y}))}}}function Vw(r,t){return yg(r,void 0,(0,G.pi)((0,G.pi)({},t),{bbox:!1,length:!0})).length}function Gr(r){return Array.isArray(r)}var ec=function(r){if(Gr(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};function nc(r){if(!Array.isArray(r))return-1/0;var t=r.length;if(!t)return-1/0;for(var e=r[0],n=1;n<t;n++)e=Math.max(e,r[n]);return e}var Uw=1e-5;function Vo(r,t,e){return e===void 0&&(e=Uw),r===t||Math.abs(r-t)<e}var Yw=function(r,t){return(r%t+t)%t},bg=Yw;function Hw(r,t,e){if(r[e].length>7){r[e].shift();for(var n=r[e],i=e;n.length;)t[e]="A",r.splice(i+=1,0,["C"].concat(n.splice(0,6)));r.splice(e,1)}}function Xw(r){return fg(r)&&r.every(function(t){var e=t[0];return"MC".includes(e)})}function rc(r,t,e){var n=r*Math.cos(e)-t*Math.sin(e),i=r*Math.sin(e)+t*Math.cos(e);return{x:n,y:i}}function Td(r,t,e,n,i,a,s,o,l,c){var u=r,h=t,d=e,f=n,v=o,g=l,p=Math.PI*120/180,y=Math.PI/180*(+i||0),b=[],w,O,_,F,W;if(c)O=c[0],_=c[1],F=c[2],W=c[3];else{w=rc(u,h,-y),u=w.x,h=w.y,w=rc(v,g,-y),v=w.x,g=w.y;var j=(u-v)/2,H=(h-g)/2,K=j*j/(d*d)+H*H/(f*f);K>1&&(K=Math.sqrt(K),d*=K,f*=K);var et=d*d,rt=f*f,lt=(a===s?-1:1)*Math.sqrt(Math.abs((et*rt-et*H*H-rt*j*j)/(et*H*H+rt*j*j)));F=lt*d*H/f+(u+v)/2,W=lt*-f*j/d+(h+g)/2,O=Math.asin(((h-W)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),_=Math.asin(((g-W)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),O=u<F?Math.PI-O:O,_=v<F?Math.PI-_:_,O<0&&(O=Math.PI*2+O),_<0&&(_=Math.PI*2+_),s&&O>_&&(O-=Math.PI*2),!s&&_>O&&(_-=Math.PI*2)}var ht=_-O;if(Math.abs(ht)>p){var yt=_,Nt=v,Ct=g;_=O+p*(s&&_>O?1:-1),v=F+d*Math.cos(_),g=W+f*Math.sin(_),b=Td(v,g,d,f,i,0,s,Nt,Ct,[_,yt,F,W])}ht=_-O;var pt=Math.cos(O),xt=Math.sin(O),kt=Math.cos(_),jt=Math.sin(_),Xt=Math.tan(ht/4),ee=4/3*d*Xt,ce=4/3*f*Xt,ue=[u,h],le=[u+ee*xt,h-ce*pt],me=[v+ee*jt,g-ce*kt],De=[v,g];if(le[0]=2*ue[0]-le[0],le[1]=2*ue[1]-le[1],c)return le.concat(me,De,b);b=le.concat(me,De,b);for(var Ge=[],_e=0,tr=b.length;_e<tr;_e+=1)Ge[_e]=_e%2?rc(b[_e-1],b[_e],y).y:rc(b[_e],b[_e+1],y).x;return Ge}function Kw(r,t,e,n,i,a){var s=.3333333333333333,o=2/3;return[s*r+o*e,s*t+o*n,s*i+o*e,s*a+o*n,i,a]}var xg=function(r,t,e,n){var i=.5,a=Pa([r,t],[e,n],i);return(0,G.ev)((0,G.ev)([],a,!0),[e,n,e,n],!1)};function Qw(r,t){var e=r[0],n=r.slice(1).map(Number),i=n[0],a=n[1],s,o=t.x1,l=t.y1,c=t.x,u=t.y;switch("TQ".includes(e)||(t.qx=null,t.qy=null),e){case"M":return t.x=i,t.y=a,r;case"A":return s=[o,l].concat(n),["C"].concat(Td(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return t.qx=i,t.qy=a,s=[o,l].concat(n),["C"].concat(Kw(s[0],s[1],s[2],s[3],s[4],s[5]));case"L":return["C"].concat(xg(o,l,i,a));case"Z":return o===c&&l===u?["C",o,l,c,u,c,u]:["C"].concat(xg(o,l,c,u));default:}return r}function Od(r,t){if(t===void 0&&(t=!1),Xw(r)){var e=[].concat(r);return t?[e,[]]:e}for(var n=tc(r),i=(0,G.pi)({},vg),a=[],s="",o=n.length,l,c,u=[],h=0;h<o;h+=1){n[h]&&(s=n[h][0]),a[h]=s;var d=Qw(n[h],i);n[h]=d,Hw(n,a,h),o=n.length,s==="Z"&&u.push(h),l=n[h],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return t?[n,u]:n}var qw=50;function Jw(r,t){t===void 0&&(t=.5);var e=r.slice(0,2),n=r.slice(2,4),i=r.slice(4,6),a=r.slice(6,8),s=Pa(e,n,t),o=Pa(n,i,t),l=Pa(i,a,t),c=Pa(s,o,t),u=Pa(o,l,t),h=Pa(c,u,t);return[["C"].concat(s,c,h),["C"].concat(u,l,a)]}function Eg(r){return r.map(function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?mg(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,s;return e?s=a?Jw(i):[t,t]:s=[t],{s:t,ss:s,l:a}})}function wg(r,t,e,n){if(n===void 0&&(n=0),n>qw)return console.warn("Maximum recursion depth reached in equalizeSegments"),[r,t];var i=Eg(r),a=Eg(t),s=i.length,o=a.length,l=i.filter(function(y){return y.l}).length,c=a.filter(function(y){return y.l}).length,u=i.filter(function(y){return y.l}).reduce(function(y,b){var w=b.l;return y+w},0)/l||0,h=a.filter(function(y){return y.l}).reduce(function(y,b){var w=b.l;return y+w},0)/c||0,d=e||Math.max(s,o),f=[u,h],v=[d-s,d-o],g=0,p=[i,a].map(function(y,b){return y.l===d?y.map(function(w){return w.s}):y.map(function(w,O){return g=O&&v[b]&&w.l>=f[b],v[b]-=g?1:0,g?w.ss:[w.s]}).flat()});return p[0].length===p[1].length?p:wg(p[0],p[1],d,n+1)}function $w(r,t,e,n,i,a,s,o){return 3*((o-t)*(e+i)-(s-r)*(n+a)+n*(r-i)-e*(t-a)+o*(i+r/3)-s*(a+t/3))/20}function t2(r){var t=0,e=0,n=0;return Od(r).map(function(i){var a;switch(i[0]){case"M":return t=i[1],e=i[2],0;default:var s=i.slice(1),o=s[0],l=s[1],c=s[2],u=s[3],h=s[4],d=s[5];return n=$w(t,e,o,l,c,u,h,d),a=i.slice(-2),t=a[0],e=a[1],n}}).reduce(function(i,a){return i+a},0)}function Sg(r){return t2(r)>=0}function e2(r){var t=r.slice(1).map(function(e,n,i){return n?i[n-1].slice(-2).concat(e.slice(1)):r[0].slice(1).concat(e.slice(1))}).map(function(e){return e.map(function(n,i){return e[e.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(e){return["C"].concat(e.slice(2))}))}function n2(r){return r.map(function(t){return Array.isArray(t)?[].concat(t):t})}function r2(r){var t=r.length,e=t-1;return r.map(function(n,i){return r.map(function(a,s){var o=i+s,l;return s===0||r[o]&&r[o][0]==="M"?(l=r[o],["M"].concat(l.slice(-2))):(o>=t&&(o-=e),r[o])})})}function i2(r,t){var e=r.length-1,n=[],i=0,a=0,s=r2(r);return s.forEach(function(o,l){r.slice(1).forEach(function(c,u){a+=Wr(r[(l+u)%e].slice(-2),t[u%e].slice(-2))}),n[l]=a,a=0}),i=n.indexOf(Math.min.apply(null,n)),s[i]}var a2=function(r){return r===void 0},Te=a2,s2={}.toString,o2=function(r,t){return s2.call(r)==="[object "+t+"]"},Mg=o2,l2=function(r){return Mg(r,"Boolean")},Uo=l2;function fe(r){return typeof r=="function"}var Fn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function c2(r,t,e){return yg(r,t,(0,G.pi)((0,G.pi)({},e),{bbox:!1,length:!0})).point}var ae=S(20068),Ag=S(58289);function u2(r,t){for(;!{}.hasOwnProperty.call(r,t)&&(r=(0,Ag.Z)(r))!==null;);return r}function Cd(){return Cd=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(r,t,e){var n=u2(r,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?r:e):i.value}},Cd.apply(null,arguments)}function Tg(r,t,e,n){var i=Cd((0,Ag.Z)(1&n?r.prototype:r),t,e);return 2&n&&typeof i=="function"?function(a){return i.apply(e,a)}:i}function Or(r,t,e,n){var i=r-e,a=t-n;return Math.sqrt(i*i+a*a)}function ic(r,t){var e=Math.min.apply(Math,(0,k.Z)(r)),n=Math.min.apply(Math,(0,k.Z)(t)),i=Math.max.apply(Math,(0,k.Z)(r)),a=Math.max.apply(Math,(0,k.Z)(t));return{x:e,y:n,width:i-e,height:a-n}}function Og(r){return(r+Math.PI*2)%(Math.PI*2)}function Cg(r,t){var e=Math.abs(r);return t>0?e:e*-1}function h2(r,t,e,n,i,a){var s=e,o=n;if(s===0||o===0)return{x:r,y:t};for(var l=i-r,c=a-t,u=Math.abs(l),h=Math.abs(c),d=s*s,f=o*o,v=Math.PI/4,g=0,p=0,y=0;y<4;y++){g=s*Math.cos(v),p=o*Math.sin(v);var b=(d-f)*Math.pow(Math.cos(v),3)/s,w=(f-d)*Math.pow(Math.sin(v),3)/o,O=g-b,_=p-w,F=u-b,W=h-w,j=Math.hypot(_,O),H=Math.hypot(W,F),K=j*Math.asin((O*W-_*F)/(j*H)),et=K/Math.sqrt(d+f-g*g-p*p);v+=et,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+Cg(g,l),y:t+Cg(p,c)}}function d2(r,t,e,n,i,a,s,o){return-1*e*Math.cos(i)*Math.sin(o)-n*Math.sin(i)*Math.cos(o)}function f2(r,t,e,n,i,a,s,o){return-1*e*Math.sin(i)*Math.sin(o)+n*Math.cos(i)*Math.cos(o)}function v2(r,t,e){return Math.atan(-t/r*Math.tan(e))}function g2(r,t,e){return Math.atan(t/(r*Math.tan(e)))}function p2(r,t,e,n,i,a){return e*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function m2(r,t,e,n,i,a){return e*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+t}function y2(r,t,e,n){var i=Math.atan2(n*r,e*t);return(i+Math.PI*2)%(Math.PI*2)}function Ng(r,t,e){return{x:r*Math.cos(e),y:t*Math.sin(e)}}function kg(r,t,e){var n=Math.cos(e),i=Math.sin(e);return[r*n-t*i,r*i+t*n]}function b2(r,t,e,n,i,a,s){for(var o=v2(e,n,i),l=1/0,c=-1/0,u=[a,s],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var d=o+h;a<s?a<d&&d<s&&u.push(d):s<d&&d<a&&u.push(d)}for(var f=0;f<u.length;f++){var v=p2(r,t,e,n,i,u[f]);v<l&&(l=v),v>c&&(c=v)}for(var g=g2(e,n,i),p=1/0,y=-1/0,b=[a,s],w=-Math.PI*2;w<=Math.PI*2;w+=Math.PI){var O=g+w;a<s?a<O&&O<s&&b.push(O):s<O&&O<a&&b.push(O)}for(var _=0;_<b.length;_++){var F=m2(r,t,e,n,i,b[_]);F<p&&(p=F),F>y&&(y=F)}return{x:l,y:p,width:c-l,height:y-p}}function E8(r,t,e,n,i,a,s,o,l){var c=kg(o-r,l-t,-i),u=_slicedToArray(c,2),h=u[0],d=u[1],f=h2(0,0,e,n,h,d),v=y2(e,n,f.x,f.y);v<a?f=Ng(e,n,a):v>s&&(f=Ng(e,n,s));var g=kg(f.x,f.y,i);return{x:g[0]+r,y:g[1]+t}}function w8(r,t,e,n,i,a,s,o){var l=(s-a)*o+a,c=d2(r,t,e,n,i,a,s,l),u=f2(r,t,e,n,i,a,s,l);return Og(Math.atan2(u,c))}var x2=1e-4;function Pg(r,t,e,n,i,a){var s=-1,o=1/0,l=[e,n],c=20;a&&a>200&&(c=a/10);for(var u=1/c,h=u/10,d=0;d<=c;d++){var f=d*u,v=[i.apply(void 0,(0,k.Z)(r.concat([f]))),i.apply(void 0,(0,k.Z)(t.concat([f])))],g=Or(l[0],l[1],v[0],v[1]);g<o&&(s=f,o=g)}if(s===0)return{x:r[0],y:t[0]};if(s===1){var p=r.length;return{x:r[p-1],y:t[p-1]}}o=1/0;for(var y=0;y<32&&!(h<x2);y++){var b=s-h,w=s+h,O=[i.apply(void 0,(0,k.Z)(r.concat([b]))),i.apply(void 0,(0,k.Z)(t.concat([b])))],_=Or(l[0],l[1],O[0],O[1]);if(b>=0&&_<o)s=b,o=_;else{var F=[i.apply(void 0,(0,k.Z)(r.concat([w]))),i.apply(void 0,(0,k.Z)(t.concat([w])))],W=Or(l[0],l[1],F[0],F[1]);w<=1&&W<o?(s=w,o=W):h*=.5}}return{x:i.apply(void 0,(0,k.Z)(r.concat([s]))),y:i.apply(void 0,(0,k.Z)(t.concat([s])))}}function E2(r,t){for(var e=0,n=r.length,i=0;i<n;i++){var a=r[i],s=t[i],o=r[(i+1)%n],l=t[(i+1)%n];e+=Or(a,s,o,l)}return e/2}function S8(r,t,e,n){return ic([r,e],[t,n])}function Rg(r,t,e,n){return Or(r,t,e,n)}function Yi(r,t,e,n,i){return{x:(1-i)*r+i*e,y:(1-i)*t+i*n}}function w2(r,t,e,n,i,a){var s=(e-r)*(i-r)+(n-t)*(a-t);if(s<0)return Or(r,t,i,a);var o=(e-r)*(e-r)+(n-t)*(n-t);return s>o?Or(e,n,i,a):Lg(r,t,e,n,i,a)}function Lg(r,t,e,n,i,a){var s=[e-r,n-t];if(Tw(s,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var o=[-s[1],s[0]];Mw(o,o);var l=[i-r,a-t];return Math.abs(Aw(l,o))}function M8(r,t,e,n){return Math.atan2(n-t,e-r)}function fs(r,t,e,n,i){var a=1-i;return a*a*a*r+3*t*i*a*a+3*e*i*i*a+n*i*i*i}function Dg(r,t,e,n,i){var a=1-i;return 3*(a*a*(t-r)+2*a*i*(e-t)+i*i*(n-e))}function _g(r,t,e,n){var i=-3*r+9*t-9*e+3*n,a=6*r-12*t+6*e,s=3*t-3*r,o=[],l,c,u;if(Vo(i,0))Vo(a,0)||(l=-s/a,l>=0&&l<=1&&o.push(l));else{var h=a*a-4*i*s;Vo(h,0)?o.push(-a/(2*i)):h>0&&(u=Math.sqrt(h),l=(-a+u)/(2*i),c=(-a-u)/(2*i),l>=0&&l<=1&&o.push(l),c>=0&&c<=1&&o.push(c))}return o}function S2(r,t,e,n,i,a,s,o,l){var c=fs(r,e,i,s,l),u=fs(t,n,a,o,l),h=Yi(r,t,e,n,l),d=Yi(e,n,i,a,l),f=Yi(i,a,s,o,l),v=Yi(h.x,h.y,d.x,d.y,l),g=Yi(d.x,d.y,f.x,f.y,l);return[[r,t,h.x,h.y,v.x,v.y,c,u],[c,u,g.x,g.y,f.x,f.y,s,o]]}function Nd(r,t,e,n,i,a,s,o,l){if(l===0)return E2([r,e,i,s],[t,n,a,o]);var c=S2(r,t,e,n,i,a,s,o,.5),u=[].concat(_toConsumableArray(c[0]),[l-1]),h=[].concat(_toConsumableArray(c[1]),[l-1]);return Nd.apply(void 0,_toConsumableArray(u))+Nd.apply(void 0,_toConsumableArray(h))}function M2(r,t,e,n,i,a,s,o){for(var l=[r,s],c=[t,o],u=_g(r,e,i,s),h=_g(t,n,a,o),d=0;d<u.length;d++)l.push(fs(r,e,i,s,u[d]));for(var f=0;f<h.length;f++)c.push(fs(t,n,a,o,h[f]));return ic(l,c)}function A8(r,t,e,n,i,a,s,o){return Nd(r,t,e,n,i,a,s,o,3)}function A2(r,t,e,n,i,a,s,o,l,c,u){return Pg([r,e,i,s],[t,n,a,o],l,c,fs,u)}function Ig(r,t,e,n,i,a,s,o,l,c,u){var h=A2(r,t,e,n,i,a,s,o,l,c,u);return Or(h.x,h.y,l,c)}function T8(r,t,e,n,i,a,s,o,l){return{x:fs(r,e,i,s,l),y:fs(t,n,a,o,l)}}function O8(r,t,e,n,i,a,s,o,l){var c=Dg(r,e,i,s,l),u=Dg(t,n,a,o,l);return Og(Math.atan2(u,c))}function Bg(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],s=Or(i[0],i[1],a[0],a[1]),o={from:i,to:a,length:s};e.push(o),t+=s}return{segments:e,totalLength:t}}function Fg(r){if(r.length<2)return 0;for(var t=0,e=0;e<r.length-1;e++){var n=r[e],i=r[e+1];t+=Or(n[0],n[1],i[0],i[1])}return t}function zg(r,t){if(t>1||t<0||r.length<2)return null;var e=Bg(r),n=e.segments,i=e.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,s=null,o=0;o<n.length;o++){var l=n[o],c=l.from,u=l.to,h=l.length/i;if(t>=a&&t<=a+h){var d=(t-a)/h;s=Yi(c[0],c[1],u[0],u[1],d);break}a+=h}return s}function jg(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=Bg(r),n=e.segments,i=e.totalLength,a=0,s=0,o=0;o<n.length;o++){var l=n[o],c=l.from,u=l.to,h=l.length/i;if(t>=a&&t<=a+h){s=Math.atan2(u[1]-c[1],u[0]-c[0]);break}a+=h}return s}function Zg(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],s=r[i+1],o=w2(a[0],a[1],s[0],s[1],t,e);o<n&&(n=o)}return n}function T2(r){for(var t=[],e=[],n=0;n<r.length;n++){var i=r[n];t.push(i[0]),e.push(i[1])}return ic(t,e)}function O2(r){return Fg(r)}function C8(r,t){return zg(r,t)}function N8(r,t,e){return Zg(r,t,e)}function k8(r,t){return jg(r,t)}function ac(r){var t=r.slice(0);return r.length&&t.push(r[0]),t}function P8(r){return T2(r)}function R8(r){return Fg(ac(r))}function L8(r,t){return zg(ac(r),t)}function D8(r,t,e){return Zg(ac(r),t,e)}function _8(r,t){return jg(ac(r),t)}function Yo(r,t,e,n){var i=1-n;return i*i*r+2*n*i*t+n*n*e}function Wg(r,t,e){var n=r+e-2*t;if(Vo(n,0))return[.5];var i=(r-t)/n;return i<=1&&i>=0?[i]:[]}function C2(r,t,e,n,i,a,s){var o=Yo(r,e,i,s),l=Yo(t,n,a,s),c=Yi(r,t,e,n,s),u=Yi(e,n,i,a,s);return[[r,t,c.x,c.y,o,l],[o,l,u.x,u.y,i,a]]}function kd(r,t,e,n,i,a,s){if(s===0)return(Or(r,t,e,n)+Or(e,n,i,a)+Or(r,t,i,a))/2;var o=C2(r,t,e,n,i,a,.5),l=o[0],c=o[1];return l.push(s-1),c.push(s-1),kd.apply(void 0,_toConsumableArray(l))+kd.apply(void 0,_toConsumableArray(c))}function N2(r,t,e,n,i,a){var s=Wg(r,e,i)[0],o=Wg(t,n,a)[0],l=[r,i],c=[t,a];return s!==void 0&&l.push(Yo(r,e,i,s)),o!==void 0&&c.push(Yo(t,n,a,o)),ic(l,c)}function I8(r,t,e,n,i,a){return kd(r,t,e,n,i,a,3)}function k2(r,t,e,n,i,a,s,o){return Pg([r,e,i],[t,n,a],s,o,Yo)}function P2(r,t,e,n,i,a,s,o){var l=k2(r,t,e,n,i,a,s,o);return Or(l.x,l.y,s,o)}var Cr=S(75044),Ra=S(3202),La=S(19251),vs=S(75931);var _t=function(r){return r.GROUP="g",r.FRAGMENT="fragment",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh",r}({}),sc=function(r){return r[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",r}({}),Da=function(){function r(){(0,N.Z)(this,r),this.plugins=[]}return(0,T.Z)(r,[{key:"addRenderingPlugin",value:function(e){this.plugins.push(e),this.context.renderingPlugins.push(e)}},{key:"removeAllRenderingPlugins",value:function(){var e=this;this.plugins.forEach(function(n){var i=e.context.renderingPlugins.indexOf(n);i>=0&&e.context.renderingPlugins.splice(i,1)})}}])}(),R2=function(){function r(t){(0,N.Z)(this,r),this.clipSpaceNearZ=sc.NEGATIVE_ONE,this.plugins=[],this.config=(0,D.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},t)}return(0,T.Z)(r,[{key:"registerPlugin",value:function(e){var n=this.plugins.findIndex(function(i){return i===e});n===-1&&this.plugins.push(e)}},{key:"unregisterPlugin",value:function(e){var n=this.plugins.findIndex(function(i){return i===e});n>-1&&this.plugins.splice(n,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(e){return this.plugins.find(function(n){return n.name===e})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(e){Object.assign(this.config,e)}}])}(),Pd=Vt,to=Pt,L2=la,D2=ti,Gg=Rt,Rd=qs,gn=function(){function r(){(0,N.Z)(this,r),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,T.Z)(r,[{key:"update",value:function(e,n){to(this.center,e),to(this.halfExtents,n),Rd(this.min,this.center,this.halfExtents),Pd(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(e,n){Pd(this.center,n,e),Gg(this.center,this.center,.5),Rd(this.halfExtents,n,e),Gg(this.halfExtents,this.halfExtents,.5),to(this.min,e),to(this.max,n)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!r.isEmpty(e)){if(r.isEmpty(this)){this.setMinMax(e.getMin(),e.getMax());return}var n=this.center,i=n[0],a=n[1],s=n[2],o=this.halfExtents,l=o[0],c=o[1],u=o[2],h=i-l,d=i+l,f=a-c,v=a+c,g=s-u,p=s+u,y=e.center,b=y[0],w=y[1],O=y[2],_=e.halfExtents,F=_[0],W=_[1],j=_[2],H=b-F,K=b+F,et=w-W,rt=w+W,lt=O-j,ht=O+j;H<h&&(h=H),K>d&&(d=K),et<f&&(f=et),rt>v&&(v=rt),lt<g&&(g=lt),ht>p&&(p=ht),n[0]=(h+d)*.5,n[1]=(f+v)*.5,n[2]=(g+p)*.5,o[0]=(d-h)*.5,o[1]=(v-f)*.5,o[2]=(p-g)*.5,this.min[0]=h,this.min[1]=f,this.min[2]=g,this.max[0]=d,this.max[1]=v,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(e,n){var i=this.center,a=this.halfExtents,s=e.center,o=e.halfExtents,l=n[0],c=n[4],u=n[8],h=n[1],d=n[5],f=n[9],v=n[2],g=n[6],p=n[10],y=Math.abs(l),b=Math.abs(c),w=Math.abs(u),O=Math.abs(h),_=Math.abs(d),F=Math.abs(f),W=Math.abs(v),j=Math.abs(g),H=Math.abs(p);i[0]=n[12]+l*s[0]+c*s[1]+u*s[2],i[1]=n[13]+h*s[0]+d*s[1]+f*s[2],i[2]=n[14]+v*s[0]+g*s[1]+p*s[2],a[0]=y*o[0]+b*o[1]+w*o[2],a[1]=O*o[0]+_*o[1]+F*o[2],a[2]=W*o[0]+j*o[1]+H*o[2],Rd(this.min,i,a),Pd(this.max,i,a)}},{key:"intersects",value:function(e){var n=this.getMax(),i=this.getMin(),a=e.getMax(),s=e.getMin();return i[0]<=a[0]&&n[0]>=s[0]&&i[1]<=a[1]&&n[1]>=s[1]&&i[2]<=a[2]&&n[2]>=s[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new r,i=L2([0,0,0],this.getMin(),e.getMin()),a=D2([0,0,0],this.getMax(),e.getMax());return n.setMinMax(i,a),n}},{key:"getNegativeFarPoint",value:function(e){return e.pnVertexFlag===273?to([0,0,0],this.min):e.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:e.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(e){return e.pnVertexFlag===273?to([0,0,0],this.max):e.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:e.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(e){return!e||e.halfExtents[0]===0&&e.halfExtents[1]===0&&e.halfExtents[2]===0}}])}(),_2=function(){function r(t,e){(0,N.Z)(this,r),this.distance=t||0,this.normal=e||Et(0,1,0),this.updatePNVertexFlag()}return(0,T.Z)(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(e){return be(e,this.normal)-this.distance}},{key:"normalize",value:function(){var e=1/hs(this.normal);Rt(this.normal,this.normal,e),this.distance*=e}},{key:"intersectsLine",value:function(e,n,i){var a=this.distanceToPoint(e),s=this.distanceToPoint(n),o=a/(a-s),l=o>=0&&o<=1;return l&&i&&Le(i,e,n,o),l}}])}(),eo=function(r){return r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",r}({}),I2=function(){function r(t){if((0,N.Z)(this,r),this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new _2)}return(0,T.Z)(r,[{key:"extractFromVPMatrix",value:function(e){var n=(0,P.Z)(e,16),i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],v=n[10],g=n[11],p=n[12],y=n[13],b=n[14],w=n[15];zt(this.planes[0].normal,o-i,h-l,g-d),this.planes[0].distance=w-p,zt(this.planes[1].normal,o+i,h+l,g+d),this.planes[1].distance=w+p,zt(this.planes[2].normal,o+a,h+c,g+f),this.planes[2].distance=w+y,zt(this.planes[3].normal,o-a,h-c,g-f),this.planes[3].distance=w-y,zt(this.planes[4].normal,o-s,h-u,g-v),this.planes[4].distance=w-b,zt(this.planes[5].normal,o+s,h+u,g+v),this.planes[5].distance=w+b,this.planes.forEach(function(O){O.normalize(),O.updatePNVertexFlag()})}}])}(),gr=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;(0,N.Z)(this,r),this.x=0,this.y=0,this.x=t,this.y=e}return(0,T.Z)(r,[{key:"clone",value:function(){return new r(this.x,this.y)}},{key:"copyFrom",value:function(e){this.x=e.x,this.y=e.y}}])}(),no=function(){function r(t,e,n,i){(0,N.Z)(this,r),this.x=t,this.y=e,this.width=n,this.height=i,this.left=t,this.right=t+n,this.top=e,this.bottom=e+i}return(0,T.Z)(r,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new r(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var i=Ui(e.x,e.y,0,1),a=Ui(e.x+e.width,e.y,0,1),s=Ui(e.x,e.y+e.height,0,1),o=Ui(e.x+e.width,e.y+e.height,0,1),l=An(),c=An(),u=An(),h=An();M(l,i,n),M(c,a,n),M(u,s,n),M(h,o,n);var d=Math.min(l[0],c[0],u[0],h[0]),f=Math.min(l[1],c[1],u[1],h[1]),v=Math.max(l[0],c[0],u[0],h[0]),g=Math.max(l[1],c[1],u[1],h[1]);return r.fromRect({x:d,y:f,width:v-d,height:g-f})}}])}(),nn="Method not implemented.",ro="Use document.documentElement instead.",B2="Cannot append a destroyed element.";function io(r){return r===void 0?0:r>360||r<-360?r%360:r}var Ld=gt();function Ir(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(r)&&r.length===3?n?wt(r):Pt(Ld,r):ie(r)?n?Et(r,t,e):zt(Ld,r,t,e):n?Et(r[0],r[1]||t,r[2]||e):zt(Ld,r[0],r[1]||t,r[2]||e)}var F2=Math.PI/180;function rn(r){return r*F2}var z2=180/Math.PI;function Vr(r){return r*z2}var j2=.9;function B8(r){return r%=400,r<0&&(r+=400),r*j2}function F8(r){return r/360}function Z2(r){return 360*r}var oc=Math.PI/2;function W2(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e*e,o=n*n,l=i*i,c=a*a,u=s+o+l+c,h=e*a-n*i;return h>.499995*u?(r[0]=oc,r[1]=2*Math.atan2(n,e),r[2]=0):h<-.499995*u?(r[0]=-oc,r[1]=2*Math.atan2(n,e),r[2]=0):(r[0]=Math.asin(2*(e*i-a*n)),r[1]=Math.atan2(2*(e*a+n*i),1-2*(l+c)),r[2]=Math.atan2(2*(e*n+i*a),1-2*(o+l))),r}function G2(r,t){var e,n,i=Ca(gt(),t),a=(0,P.Z)(i,3),s=a[0],o=a[1],l=a[2],c=Math.asin(-t[2]/s);return c<oc?c>-oc?(e=Math.atan2(t[6]/o,t[10]/l),n=Math.atan2(t[1]/s,t[0]/s)):(n=0,e=-Math.atan2(t[4]/o,t[5]/o)):(n=0,e=Math.atan2(t[4]/o,t[5]/o)),r[0]=e,r[1]=c,r[2]=n,r}function Dd(r,t){return t.length===16?G2(r,t):W2(r,t)}function V2(r,t,e,n,i){var a=Math.cos(r),s=Math.sin(r);return gw(n*a,i*s,0,-n*s,i*a,0,t,e,1)}function U2(r,t,e,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,l=2*a,c=e-t,u=n-i,h=l/c,d=l/u,f=(e+t)/c,v=(n+i)/u,g,p,y=s-a,b=s*a;return o?(g=-s/y,p=-b/y):(g=-(s+a)/y,p=-2*b/y),r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=d,r[6]=0,r[7]=0,r[8]=f,r[9]=v,r[10]=g,r[11]=-1,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r}function Vg(r){var t=r[0],e=r[1],n=r[3],i=r[4],a=Math.sqrt(t*t+e*e),s=Math.sqrt(n*n+i*i),o=t*i-e*n;if(o<0&&(t<i?a=-a:s=-s),a){var l=1/a;t*=l,e*=l}if(s){var c=1/s;n*=c,i*=c}var u=Math.atan2(e,t),h=Vr(u);return[r[6],r[7],a,s,h]}var Hi=Wt(),Ci=Wt(),Ho=An(),Me=[gt(),gt(),gt()],Ug=gt();function Y2(r,t,e,n,i,a){if(!H2(Hi,r)||(we(Ci,Hi),Ci[3]=0,Ci[7]=0,Ci[11]=0,Ci[15]=1,Math.abs(Yt(Ci))<1e-8))return!1;var s=Hi[3],o=Hi[7],l=Hi[11],c=Hi[12],u=Hi[13],h=Hi[14],d=Hi[15];if(s!==0||o!==0||l!==0){Ho[0]=s,Ho[1]=o,Ho[2]=l,Ho[3]=d;var f=Ze(Ci,Ci);if(!f)return!1;xe(Ci,Ci),M(i,Ho,Ci)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=u,t[2]=h,X2(Me,Hi),e[0]=vt(Me[0]),se(Me[0],Me[0]),n[0]=be(Me[0],Me[1]),_d(Me[1],Me[1],Me[0],1,-n[0]),e[1]=vt(Me[1]),se(Me[1],Me[1]),n[0]/=e[1],n[1]=be(Me[0],Me[2]),_d(Me[2],Me[2],Me[0],1,-n[1]),n[2]=be(Me[1],Me[2]),_d(Me[2],Me[2],Me[1],1,-n[2]),e[2]=vt(Me[2]),se(Me[2],Me[2]),n[1]/=e[2],n[2]/=e[2],de(Ug,Me[1],Me[2]),be(Me[0],Ug)<0)for(var v=0;v<3;v++)e[v]*=-1,Me[v][0]*=-1,Me[v][1]*=-1,Me[v][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+Me[0][0]-Me[1][1]-Me[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Me[0][0]+Me[1][1]-Me[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Me[0][0]-Me[1][1]+Me[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Me[0][0]+Me[1][1]+Me[2][2],0)),Me[2][1]>Me[1][2]&&(a[0]=-a[0]),Me[0][2]>Me[2][0]&&(a[1]=-a[1]),Me[1][0]>Me[0][1]&&(a[2]=-a[2]),!0}function H2(r,t){var e=t[15];if(e===0)return!1;for(var n=1/e,i=0;i<16;i++)r[i]=t[i]*n;return!0}function X2(r,t){r[0][0]=t[0],r[0][1]=t[1],r[0][2]=t[2],r[1][0]=t[4],r[1][1]=t[5],r[1][2]=t[6],r[2][0]=t[8],r[2][1]=t[9],r[2][2]=t[10]}function _d(r,t,e,n,i){r[0]=t[0]*n+e[0]*i,r[1]=t[1]*n+e[1]*i,r[2]=t[2]*n+e[2]*i}var an=function(r){return r[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",r}({}),Id=function(r){return r[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",r}({}),vi=function(r){return r[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE",r}({}),Yg={UPDATED:"updated"},Hg=2e-4,Xg=function(){function r(){(0,N.Z)(this,r),this.clipSpaceNearZ=sc.NEGATIVE_ONE,this.eventEmitter=new L,this.matrix=Wt(),this.right=Et(1,0,0),this.up=Et(0,1,0),this.forward=Et(0,0,1),this.position=Et(0,0,1),this.focalPoint=Et(0,0,0),this.distanceVector=Et(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=Wt(),this.projectionMatrixInverse=Wt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=an.EXPLORING,this.trackingMode=Id.DEFAULT,this.projectionMode=vi.PERSPECTIVE,this.frustum=new I2,this.orthoMatrix=Wt()}return(0,T.Z)(r,[{key:"isOrtho",value:function(){return this.projectionMode===vi.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(e){this.enableUpdate=e}},{key:"setType",value:function(e,n){return this.type=e,this.type===an.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===an.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(e){return this.projectionMode=e,this}},{key:"setTrackingMode",value:function(e){if(this.type!==an.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this}},{key:"setWorldRotation",value:function(e){return this.rotateWorld=e,this._getAngles(),this}},{key:"getViewTransform",value:function(){return Ze(Wt(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(e,n){var i=Hn(Wt(),[e,n,0]);this.jitteredProjectionMatrix=Jt(Wt(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(e){return this.matrix=e,this._update(),this}},{key:"setProjectionMatrix",value:function(e){this.projectionMatrix=e}},{key:"setFov",value:function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this}},{key:"setAspect",value:function(e){return this.setPerspective(this.near,this.far,this.fov,e),this}},{key:"setNear",value:function(e){return this.projectionMode===vi.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this}},{key:"setFar",value:function(e){return this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this}},{key:"setViewOffset",value:function(e,n,i,a,s,o){return this.aspect=e/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(e){return this.zoom=e,this.projectionMode===vi.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===vi.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(e,n){var i=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),a=i.x,s=i.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(a,s),this.setFocalPoint(a,s),this.setZoom(e),this.rotate(0,0,o);var l=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),c=l.x,u=l.y,h=Et(c-a,u-s,0),d=be(h,this.right)/vt(this.right),f=be(h,this.up)/vt(this.up),v=this.getPosition(),g=(0,P.Z)(v,2),p=g[0],y=g[1],b=this.getFocalPoint(),w=(0,P.Z)(b,2),O=w[0],_=w[1];return this.setPosition(p-d,y-f),this.setFocalPoint(O-d,_-f),this}},{key:"setPerspective",value:function(e,n,i,a){var s;this.projectionMode=vi.PERSPECTIVE,this.fov=i,this.near=e,this.far=n,this.aspect=a;var o=this.near*Math.tan(rn(.5*this.fov))/this.zoom,l=2*o,c=this.aspect*l,u=-.5*c;if((s=this.view)!==null&&s!==void 0&&s.enabled){var h=this.view.fullWidth,d=this.view.fullHeight;u+=this.view.offsetX*c/h,o-=this.view.offsetY*l/d,c*=this.view.width/h,l*=this.view.height/d}return U2(this.projectionMatrix,u,u+c,o-l,o,e,this.far,this.clipSpaceNearZ===sc.ZERO),Ze(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(e,n,i,a,s,o){var l;this.projectionMode=vi.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=i,this.bottom=a,this.near=s,this.far=o;var c=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,d=(this.top+this.bottom)/2,f=h-c,v=h+c,g=d+u,p=d-u;if((l=this.view)!==null&&l!==void 0&&l.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,b=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f+=y*this.view.offsetX,v=f+y*this.view.width,g-=b*this.view.offsetY,p=g-b*this.view.height}return this.clipSpaceNearZ===sc.NEGATIVE_ONE?rg(this.projectionMatrix,f,v,g,p,s,o):ig(this.projectionMatrix,f,v,g,p,s,o),Ze(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],a=Ir(e,n,i);return this._setPosition(a),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],a=Et(0,1,0);if(this.focalPoint=Ir(e,n,i),this.trackingMode===Id.CINEMATIC){var s=Qt(gt(),this.focalPoint,this.position);e=s[0],n=s[1],i=s[2];var o=vt(s),l=Vr(Math.asin(n/o)),c=90+Vr(Math.atan2(i,e)),u=Wt();fn(u,u,rn(c)),un(u,u,rn(l)),a=re(gt(),[0,1,0],u)}return Ze(this.matrix,ag(Wt(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(e){if(this.distance===e||e<0)return this;this.distance=e,this.distance<Hg&&(this.distance=Hg),this.dollyingStep=this.distance/100;var n=gt();e=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=e*i[0]+a[0],n[1]=e*i[1]+a[1],n[2]=e*i[2]+a[2],this._setPosition(n),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(e){return this.maxDistance=e,this}},{key:"setMinDistance",value:function(e){return this.minDistance=e,this}},{key:"setAzimuth",value:function(e){return this.azimuth=io(e),this.computeMatrix(),this._getAxes(),this.type===an.ORBITING||this.type===an.EXPLORING?this._getPosition():this.type===an.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(e){return this.elevation=io(e),this.computeMatrix(),this._getAxes(),this.type===an.ORBITING||this.type===an.EXPLORING?this._getPosition():this.type===an.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(e){return this.roll=io(e),this.computeMatrix(),this._getAxes(),this.type===an.ORBITING||this.type===an.EXPLORING?this._getPosition():this.type===an.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var e=Na(Xn(),[0,0,1],rn(this.roll));ge(this.matrix);var n=Na(Xn(),[1,0,0],rn((this.rotateWorld&&this.type!==an.TRACKING||this.type===an.TRACKING?1:-1)*this.elevation)),i=Na(Xn(),[0,1,0],rn((this.rotateWorld&&this.type!==an.TRACKING||this.type===an.TRACKING?1:-1)*this.azimuth)),a=ka(Xn(),i,n);a=ka(Xn(),a,e);var s=Wo(Wt(),a);this.type===an.ORBITING||this.type===an.EXPLORING?(Ht(this.matrix,this.matrix,this.focalPoint),Jt(this.matrix,this.matrix,s),Ht(this.matrix,this.matrix,[0,0,this.distance])):this.type===an.TRACKING&&(Ht(this.matrix,this.matrix,this.position),Jt(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(e,n,i){this.position=Ir(e,n,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){Pt(this.right,Ir(M(An(),[1,0,0,0],this.matrix))),Pt(this.up,Ir(M(An(),[0,1,0,0],this.matrix))),Pt(this.forward,Ir(M(An(),[0,0,1,0],this.matrix))),se(this.right,this.right),se(this.up,this.up),se(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=vt(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===an.TRACKING?(this.elevation=Vr(Math.asin(n/a)),this.azimuth=Vr(Math.atan2(-e,-i))):this.rotateWorld?(this.elevation=Vr(Math.asin(n/a)),this.azimuth=Vr(Math.atan2(-e,-i))):(this.elevation=-Vr(Math.asin(n/a)),this.azimuth=-Vr(Math.atan2(-e,-i)))}},{key:"_getPosition",value:function(){Pt(this.position,Ir(M(An(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){Oe(this.distanceVector,[0,0,-this.distance],vw(lg(),this.matrix)),Vt(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Qt(gt(),this.focalPoint,this.position),this.distance=vt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===vi.ORTHOGRAPHIC){var e=this.position,n=Na(Xn(),[0,0,1],-this.roll*Math.PI/180);ds(this.orthoMatrix,n,Et((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),Et(this.zoom,this.zoom,1),e)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var e=this.getViewTransform(),n=Jt(Wt(),this.getPerspective(),e);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(Yg.UPDATED)}}},{key:"rotate",value:function(e,n,i){throw new Error(nn)}},{key:"pan",value:function(e,n){throw new Error(nn)}},{key:"dolly",value:function(e){throw new Error(nn)}},{key:"createLandmark",value:function(e,n){throw new Error(nn)}},{key:"gotoLandmark",value:function(e,n){throw new Error(nn)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(nn)}}])}(),K2=function(r){return r[r.Standard=0]="Standard",r}({}),lc=function(r){return r[r.ADDED=0]="ADDED",r[r.REMOVED=1]="REMOVED",r[r.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",r}({}),Q2=gt(),Xo=Wt(),q2=Xn();function Kg(r){if(r.localDirtyFlag){var t=r.localSkew[0]!==0||r.localSkew[1]!==0;if(t){ds(r.localTransform,r.localRotation,r.localPosition,Et(1,1,1),r.origin),(r.localSkew[0]!==0||r.localSkew[1]!==0)&&(ge(Xo),Xo[4]=Math.tan(r.localSkew[0]),Xo[1]=Math.tan(r.localSkew[1]),Jt(r.localTransform,r.localTransform,Xo));var e=ds(Xo,cg(q2,0,0,0,1),zt(Q2,1,1,1),r.localScale,r.origin);Jt(r.localTransform,r.localTransform,e)}else{var n=r.localTransform,i=r.localPosition,a=r.localRotation,s=r.localScale,o=r.origin,l=i[0]!==0||i[1]!==0||i[2]!==0,c=a[3]!==1||a[0]!==0||a[1]!==0||a[2]!==0,u=s[0]!==1||s[1]!==1||s[2]!==1,h=o[0]!==0||o[1]!==0||o[2]!==0;!c&&!u&&!h?l?Hn(n,i):ge(n):ds(n,a,i,s,o)}r.localDirtyFlag=!1}}function J2(r,t){r.dirtyFlag&&(t?Jt(r.worldTransform,t.worldTransform,r.localTransform):we(r.worldTransform,r.localTransform),r.dirtyFlag=!1)}var Qg={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new no(0,0,0,0)},$t=function(r){return r.COORDINATE="<coordinate>",r.COLOR="<color>",r.PAINT="<paint>",r.NUMBER="<number>",r.ANGLE="<angle>",r.OPACITY_VALUE="<opacity-value>",r.SHADOW_BLUR="<shadow-blur>",r.LENGTH="<length>",r.PERCENTAGE="<percentage>",r.LENGTH_PERCENTAGE="<length> | <percentage>",r.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",r.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",r.LIST_OF_POINTS="<list-of-points>",r.PATH="<path>",r.FILTER="<filter>",r.Z_INDEX="<z-index>",r.OFFSET_DISTANCE="<offset-distance>",r.DEFINED_PATH="<defined-path>",r.MARKER="<marker>",r.TRANSFORM="<transform>",r.TRANSFORM_ORIGIN="<transform-origin>",r.TEXT="<text>",r.TEXT_TRANSFORM="<text-transform>",r}({});function Bd(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function qg(r,t){var e=Object.create(r.prototype);for(var n in t)e[n]=t[n];return e}function Ko(){}var Qo=.7,cc=1/Qo,ao="\\s*([+-]?\\d+)\\s*",qo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$2=/^#([0-9a-f]{3,8})$/,tS=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),eS=new RegExp(`^rgb\\(${Xi},${Xi},${Xi}\\)$`),nS=new RegExp(`^rgba\\(${ao},${ao},${ao},${qo}\\)$`),rS=new RegExp(`^rgba\\(${Xi},${Xi},${Xi},${qo}\\)$`),iS=new RegExp(`^hsl\\(${qo},${Xi},${Xi}\\)$`),aS=new RegExp(`^hsla\\(${qo},${Xi},${Xi},${qo}\\)$`),Jg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bd(Ko,uc,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:$g,formatHex:$g,formatHex8:sS,formatHsl:oS,formatRgb:tp,toString:tp});function $g(){return this.rgb().formatHex()}function sS(){return this.rgb().formatHex8()}function oS(){return ap(this).formatHsl()}function tp(){return this.rgb().formatRgb()}function uc(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=$2.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?ep(t):e===3?new Ur(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?hc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?hc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=tS.exec(r))?new Ur(t[1],t[2],t[3],1):(t=eS.exec(r))?new Ur(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nS.exec(r))?hc(t[1],t[2],t[3],t[4]):(t=rS.exec(r))?hc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iS.exec(r))?ip(t[1],t[2]/100,t[3]/100,1):(t=aS.exec(r))?ip(t[1],t[2]/100,t[3]/100,t[4]):Jg.hasOwnProperty(r)?ep(Jg[r]):r==="transparent"?new Ur(NaN,NaN,NaN,0):null}function ep(r){return new Ur(r>>16&255,r>>8&255,r&255,1)}function hc(r,t,e,n){return n<=0&&(r=t=e=NaN),new Ur(r,t,e,n)}function lS(r){return r instanceof Ko||(r=uc(r)),r?(r=r.rgb(),new Ur(r.r,r.g,r.b,r.opacity)):new Ur}function cS(r,t,e,n){return arguments.length===1?lS(r):new Ur(r,t,e,n==null?1:n)}function Ur(r,t,e,n){this.r=+r,this.g=+t,this.b=+e,this.opacity=+n}Bd(Ur,cS,qg(Ko,{brighter(r){return r=r==null?cc:Math.pow(cc,r),new Ur(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Qo:Math.pow(Qo,r),new Ur(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Ur(gs(this.r),gs(this.g),gs(this.b),dc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:np,formatHex:np,formatHex8:uS,formatRgb:rp,toString:rp}));function np(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function uS(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function rp(){const r=dc(this.opacity);return`${r===1?"rgb(":"rgba("}${gs(this.r)}, ${gs(this.g)}, ${gs(this.b)}${r===1?")":`, ${r})`}`}function dc(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function gs(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function ps(r){return r=gs(r),(r<16?"0":"")+r.toString(16)}function ip(r,t,e,n){return n<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new Ni(r,t,e,n)}function ap(r){if(r instanceof Ni)return new Ni(r.h,r.s,r.l,r.opacity);if(r instanceof Ko||(r=uc(r)),!r)return new Ni;if(r instanceof Ni)return r;r=r.rgb();var t=r.r/255,e=r.g/255,n=r.b/255,i=Math.min(t,e,n),a=Math.max(t,e,n),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(e-n)/o+(e<n)*6:e===a?s=(n-t)/o+2:s=(t-e)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new Ni(s,o,l,r.opacity)}function hS(r,t,e,n){return arguments.length===1?ap(r):new Ni(r,t,e,n==null?1:n)}function Ni(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}Bd(Ni,hS,qg(Ko,{brighter(r){return r=r==null?cc:Math.pow(cc,r),new Ni(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Qo:Math.pow(Qo,r),new Ni(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*t,i=2*e-n;return new Ur(Fd(r>=240?r-240:r+120,i,n),Fd(r,i,n),Fd(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new Ni(sp(this.h),fc(this.s),fc(this.l),dc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=dc(this.opacity);return`${r===1?"hsl(":"hsla("}${sp(this.h)}, ${fc(this.s)*100}%, ${fc(this.l)*100}%${r===1?")":`, ${r})`}`}}));function sp(r){return r=(r||0)%360,r<0?r+360:r}function fc(r){return Math.max(0,Math.min(1,r||0))}function Fd(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}function zn(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var e=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=t?t.apply(this,a):a[0],l=e.cache;if(l.has(o))return l.get(o);var c=r.apply(this,a);return e.cache=l.set(o,c)||l,c};return e.cache=new(zn.Cache||Map),zn.cacheList.push(e.cache),e}zn.Cache=Map,zn.cacheList=[],zn.clearCache=function(){zn.cacheList.forEach(function(r){return r.clear()})};var te=function(r){return r[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",r}({}),ki=function(r){return r[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",r}({}),dS=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),fS=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),vS=[{name:"em",unit_type:te.kEms},{name:"px",unit_type:te.kPixels},{name:"deg",unit_type:te.kDegrees},{name:"rad",unit_type:te.kRadians},{name:"grad",unit_type:te.kGradians},{name:"ms",unit_type:te.kMilliseconds},{name:"s",unit_type:te.kSeconds},{name:"rem",unit_type:te.kRems},{name:"turn",unit_type:te.kTurns}],so=function(r){return r[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",r}({}),gS=function(t){return vS.find(function(e){return e.name===t}).unit_type},pS=function(t){return t?t==="number"?te.kNumber:t==="percent"||t==="%"?te.kPercentage:gS(t):te.kUnknown},mS=function(t){switch(t){case te.kNumber:case te.kInteger:return ki.kUNumber;case te.kPercentage:return ki.kUPercent;case te.kPixels:return ki.kULength;case te.kMilliseconds:case te.kSeconds:return ki.kUTime;case te.kDegrees:case te.kRadians:case te.kGradians:case te.kTurns:return ki.kUAngle;default:return ki.kUOther}},yS=function(t){switch(t){case ki.kUNumber:return te.kNumber;case ki.kULength:return te.kPixels;case ki.kUPercent:return te.kPercentage;case ki.kUTime:return te.kSeconds;case ki.kUAngle:return te.kDegrees;default:return te.kUnknown}},op=function(t){var e=1;switch(t){case te.kPixels:case te.kDegrees:case te.kSeconds:break;case te.kMilliseconds:e=.001;break;case te.kRadians:e=180/Math.PI;break;case te.kGradians:e=.9;break;case te.kTurns:e=360;break}return e},zd=function(t){switch(t){case te.kNumber:case te.kInteger:return"";case te.kPercentage:return"%";case te.kEms:return"em";case te.kRems:return"rem";case te.kPixels:return"px";case te.kDegrees:return"deg";case te.kRadians:return"rad";case te.kGradians:return"grad";case te.kMilliseconds:return"ms";case te.kSeconds:return"s";case te.kTurns:return"turn"}return""},vc=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"toString",value:function(){return this.buildCSSText(dS.kNo,fS.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=so.kUnitType&&this.getType()<=so.kClampType}}],[{key:"isAngle",value:function(e){return e===te.kDegrees||e===te.kRadians||e===te.kGradians||e===te.kTurns}},{key:"isLength",value:function(e){return e>=te.kEms&&e<te.kDegrees}},{key:"isRelativeUnit",value:function(e){return e===te.kPercentage||e===te.kEms||e===te.kRems}},{key:"isTime",value:function(e){return e===te.kSeconds||e===te.kMilliseconds}}])}(),bS=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,R.Z)(this,t),n.colorSpace=e,n}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"getType",value:function(){return so.kColorType}},{key:"to",value:function(n){return this}}])}(vc),_a=function(r){return r[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",r}({}),gc=function(r){function t(e,n){var i;return(0,N.Z)(this,t),i=(0,R.Z)(this,t),i.type=e,i.value=n,i}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.type,this.value)}},{key:"buildCSSText",value:function(n,i,a){return a}},{key:"getType",value:function(){return so.kColorType}}])}(vc),gi=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,R.Z)(this,t),n.value=e,n}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.value)}},{key:"getType",value:function(){return so.kKeywordType}},{key:"buildCSSText",value:function(n,i,a){return a+this.value}}])}(vc),xS=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n="";return Number.isFinite(t)?n="NaN":t>0?n="infinity":n="-infinity",n+=e},jd=function(t){return yS(mS(t))},sn=function(r){function t(e){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.kNumber;(0,N.Z)(this,t),n=(0,R.Z)(this,t);var a;return typeof i=="string"?a=pS(i):a=i,n.unit=a,n.value=e,n}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"equals",value:function(n){var i=n;return this.value===i.value&&this.unit===i.unit}},{key:"getType",value:function(){return so.kUnitType}},{key:"convertTo",value:function(n){if(this.unit===n)return new t(this.value,this.unit);var i=jd(this.unit);if(i!==jd(n)||i===te.kUnknown)return null;var a=op(this.unit)/op(n);return new t(this.value*a,n)}},{key:"buildCSSText",value:function(n,i,a){var s;switch(this.unit){case te.kUnknown:break;case te.kInteger:s=Number(this.value).toFixed(0);break;case te.kNumber:case te.kPercentage:case te.kEms:case te.kRems:case te.kPixels:case te.kDegrees:case te.kRadians:case te.kGradians:case te.kMilliseconds:case te.kSeconds:case te.kTurns:{var o=-999999,l=999999,c=this.value,u=zd(this.unit);if(c<o||c>l){var h=zd(this.unit);!Number.isFinite(c)||Number.isNaN(c)?s=xS(c,h):s=c+(h||"")}else s="".concat(c).concat(u)}}return a+=s,a}}])}(vc),Pi=new sn(0,"px");new sn(1,"px");var ms=new sn(0,"deg"),Zd=function(r){function t(e,n,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return(0,N.Z)(this,t),a=(0,R.Z)(this,t,["rgb"]),a.r=e,a.g=n,a.b=i,a.alpha=s,a.isNone=o,a}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(n,i,a){return"".concat(a,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(bS),lp=new gi("unset"),ES=new gi("initial"),wS=new gi("inherit"),Wd={"":lp,unset:lp,initial:ES,inherit:wS},SS=function(t){return Wd[t]||(Wd[t]=new gi(t)),Wd[t]},cp=new Zd(0,0,0,0,!0),up=new Zd(0,0,0,0),MS=zn(function(r,t,e,n){return new Zd(r,t,e,n)},function(r,t,e,n){return"rgba(".concat(r,",").concat(t,",").concat(e,",").concat(n,")")}),En=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.kNumber;return new sn(t,e)};new sn(50,"%");function AS(r){var t=r.type,e=r.value;return t==="hex"?"#".concat(e):t==="literal"?e:t==="rgb"?"rgb(".concat(e.join(","),")"):"rgba(".concat(e.join(","),")")}var TS=function(){var r={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function e(Ct){throw new Error("".concat(t,": ").concat(Ct))}function n(){var Ct=i();return t.length>0&&e("Invalid input not EOF"),Ct}function i(){return w(a)}function a(){return s("linear-gradient",r.linearGradient,l)||s("repeating-linear-gradient",r.repeatingLinearGradient,l)||s("radial-gradient",r.radialGradient,h)||s("repeating-radial-gradient",r.repeatingRadialGradient,h)||s("conic-gradient",r.conicGradient,h)}function s(Ct,pt,xt){return o(pt,function(kt){var jt=xt();return jt&&(yt(r.comma)||e("Missing comma before color stops")),{type:Ct,orientation:jt,colorStops:w(O)}})}function o(Ct,pt){var xt=yt(Ct);if(xt){yt(r.startCall)||e("Missing (");var kt=pt(xt);return yt(r.endCall)||e("Missing )"),kt}}function l(){return c()||u()}function c(){return ht("directional",r.sideOrCorner,1)}function u(){return ht("angular",r.angleValue,1)}function h(){var Ct,pt=d(),xt;return pt&&(Ct=[],Ct.push(pt),xt=t,yt(r.comma)&&(pt=d(),pt?Ct.push(pt):t=xt)),Ct}function d(){var Ct=f()||v();if(Ct)Ct.at=p();else{var pt=g();if(pt){Ct=pt;var xt=p();xt&&(Ct.at=xt)}else{var kt=y();kt&&(Ct={type:"default-radial",at:kt})}}return Ct}function f(){var Ct=ht("shape",/^(circle)/i,0);return Ct&&(Ct.style=lt()||g()),Ct}function v(){var Ct=ht("shape",/^(ellipse)/i,0);return Ct&&(Ct.style=et()||g()),Ct}function g(){return ht("extent-keyword",r.extentKeywords,1)}function p(){if(ht("position",/^at/,0)){var Ct=y();return Ct||e("Missing positioning value"),Ct}}function y(){var Ct=b();if(Ct.x||Ct.y)return{type:"position",value:Ct}}function b(){return{x:et(),y:et()}}function w(Ct){var pt=Ct(),xt=[];if(pt)for(xt.push(pt);yt(r.comma);)pt=Ct(),pt?xt.push(pt):e("One extra comma");return xt}function O(){var Ct=_();return Ct||e("Expected color definition"),Ct.length=et(),Ct}function _(){return W()||H()||j()||F()}function F(){return ht("literal",r.literalColor,0)}function W(){return ht("hex",r.hexColor,1)}function j(){return o(r.rgbColor,function(){return{type:"rgb",value:w(K)}})}function H(){return o(r.rgbaColor,function(){return{type:"rgba",value:w(K)}})}function K(){return yt(r.number)[1]}function et(){return ht("%",r.percentageValue,1)||rt()||lt()}function rt(){return ht("position-keyword",r.positionKeywords,1)}function lt(){return ht("px",r.pixelValue,1)||ht("em",r.emValue,1)}function ht(Ct,pt,xt){var kt=yt(pt);if(kt)return{type:Ct,value:kt[xt]}}function yt(Ct){var pt=/^[\n\r\t\s]+/.exec(t);pt&&Nt(pt[0].length);var xt=Ct.exec(t);return xt&&Nt(xt[0].length),xt}function Nt(Ct){t=t.substring(Ct)}return function(Ct){return t=Ct,n()}}();function OS(r,t,e,n){var i=rn(n.value),a=0,s=0,o=a+t/2,l=s+e/2,c=Math.abs(t*Math.cos(i))+Math.abs(e*Math.sin(i)),u=r[0]+o-Math.cos(i)*c/2,h=r[1]+l-Math.sin(i)*c/2,d=r[0]+o+Math.cos(i)*c/2,f=r[1]+l+Math.sin(i)*c/2;return{x1:u,y1:h,x2:d,y2:f}}function CS(r,t,e,n,i,a){var s=n.value,o=i.value;n.unit===te.kPercentage&&(s=n.value/100*t),i.unit===te.kPercentage&&(o=i.value/100*e);var l=Math.max(Wr([0,0],[s,o]),Wr([0,e],[s,o]),Wr([t,e],[s,o]),Wr([t,0],[s,o]));return a&&(a instanceof sn?l=a.value:a instanceof gi&&(a.value==="closest-side"?l=Math.min(s,t-s,o,e-o):a.value==="farthest-side"?l=Math.max(s,t-s,o,e-o):a.value==="closest-corner"&&(l=Math.min(Wr([0,0],[s,o]),Wr([0,e],[s,o]),Wr([t,e],[s,o]),Wr([t,0],[s,o]))))),{x:s+r[0],y:o+r[1],r:l}}var NS=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,kS=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,PS=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,hp=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function RS(r){var t,e=r.length;if(r[e-1].length=(t=r[e-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},e>1){var n;r[0].length=(n=r[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"}}for(var i=0,a=Number(r[0].length.value),s=1;s<e;s++){var o,l=(o=r[s].length)===null||o===void 0?void 0:o.value;if(!ye(l)&&!ye(a)){for(var c=1;c<s-i;c++)r[i+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-i))};i=s,a=Number(l)}}}var LS={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},DS=zn(function(r){var t;return r.type==="angular"?t=Number(r.value):t=LS[r.value]||0,En(t,"deg")}),_S=zn(function(r){var t=50,e=50,n="%",i="%";if((r==null?void 0:r.type)==="position"){var a=r.value,s=a.x,o=a.y;(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?t=0:s.value==="center"?t=50:s.value==="right"?t=100:s.value==="top"?e=0:s.value==="bottom"&&(e=100)),(o==null?void 0:o.type)==="position-keyword"&&(o.value==="left"?t=0:o.value==="center"?e=50:o.value==="right"?t=100:o.value==="top"?e=0:o.value==="bottom"&&(e=100)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(n=s==null?void 0:s.type,t=Number(s.value)),((o==null?void 0:o.type)==="px"||(o==null?void 0:o.type)==="%"||(o==null?void 0:o.type)==="em")&&(i=o==null?void 0:o.type,e=Number(o.value))}return{cx:En(t,n),cy:En(e,i)}}),IS=zn(function(r){if(r.indexOf("linear")>-1||r.indexOf("radial")>-1){var t=TS(r);return t.map(function(o){var l=o.type,c=o.orientation,u=o.colorStops;RS(u);var h=u.map(function(w){return{offset:En(Number(w.length.value),"%"),color:AS(w)}});if(l==="linear-gradient")return new gc(_a.LinearGradient,{angle:c?DS(c):ms,steps:h});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=_S(c[0].at),f=d.cx,v=d.cy,g;if(c[0].style){var p=c[0].style,y=p.type,b=p.value;y==="extent-keyword"?g=SS(b):g=En(b,y)}return new gc(_a.RadialGradient,{cx:f,cy:v,size:g,steps:h})}})}var e=r[0];if(r[1]==="("||r[2]==="("){if(e==="l"){var n=NS.exec(r);if(n){var i,a=((i=n[2].match(hp))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new gc(_a.LinearGradient,{angle:En(parseFloat(n[1]),"deg"),steps:a.map(function(o){var l=(0,P.Z)(o,2),c=l[0],u=l[1];return{offset:En(Number(c)*100,"%"),color:u}})})]}}else if(e==="r"){var s=BS(r);if(s)if(Ve(s))r=s;else return[new gc(_a.RadialGradient,s)]}else if(e==="p")return FS(r)}});function BS(r){var t=kS.exec(r);if(t){var e,n=((e=t[4].match(hp))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:En(50,"%"),cy:En(50,"%"),steps:n.map(function(i){var a=(0,P.Z)(i,2),s=a[0],o=a[1];return{offset:En(Number(s)*100,"%"),color:o}})}}return null}function FS(r){var t=PS.exec(r);if(t){var e=t[1],n=t[2];switch(e){case"a":e="repeat";break;case"x":e="repeat-x";break;case"y":e="repeat-y";break;case"n":e="no-repeat";break;default:e="no-repeat"}return{image:n,repetition:e}}return null}function z8(r){return!!r.type&&!!r.value}function ys(r){return r&&!!r.image}function pc(r){return r&&!ye(r.r)&&!ye(r.g)&&!ye(r.b)}var Jo=zn(function(r){if(ys(r))return(0,D.Z)({repetition:"repeat"},r);if(ye(r)&&(r=""),r==="transparent")return up;if(r==="currentColor")r="black";else if(r==="none")return cp;var t=IS(r);if(t)return t;var e=uc(r),n=[0,0,0,0];return e!==null&&(n[0]=e.r||0,n[1]=e.g||0,n[2]=e.b||0,n[3]=e.opacity),MS.apply(void 0,n)});function zS(r,t){if(!(!pc(r)||!pc(t)))return[[Number(r.r),Number(r.g),Number(r.b),Number(r.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(e){var n=e.slice();if(n[3])for(var i=0;i<3;i++)n[i]=Math.round(kn(n[i],0,255));return n[3]=kn(n[3],0,1),"rgba(".concat(n.join(","),")")}]}function $o(r,t){if(ye(t))return En(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(r)>=0)return En(Number(t),"px");if("deg".search(r)>=0)return En(Number(t),"deg")}var e=[];t=t.replace(r,function(i){return e.push(i),"U".concat(i)});var n="U(".concat(r.source,")");return e.map(function(i){return En(Number(t.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(n,"g"),"*0")),i)})[0]}var dp=function(t){return $o(new RegExp("px","g"),t)},jS=zn(dp),ZS=function(t){return $o(new RegExp("%","g"),t)};zn(ZS);var fp=function(t){return ie(t)||isFinite(Number(t))?En(Number(t)||0,"px"):$o(new RegExp("px|%|em|rem","g"),t)},Gd=zn(fp),vp=function(t){return $o(new RegExp("deg|rad|grad|turn","g"),t)},WS=zn(vp);function GS(r,t,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",s=r.value||0,o=t.value||0,l=jd(r.unit),c=r.convertTo(l),u=t.convertTo(l);return c&&u?(s=c.value,o=u.value,a=zd(r.unit)):(sn.isLength(r.unit)||sn.isLength(t.unit))&&(s=ni(r,i,e),o=ni(t,i,e),a="px"),[s,o,function(h){return n&&(h=Math.max(h,0)),h+a}]}function Yr(r){var t=0;return r.unit===te.kDegrees?t=r.value:r.unit===te.kRadians?t=Vr(Number(r.value)):r.unit===te.kTurns?t=Z2(Number(r.value)):r.value&&(t=r.value),t}function gp(r,t){var e;return Array.isArray(r)?e=r.map(function(n){return Number(n)}):Ve(r)?e=r.split(" ").map(function(n){return Number(n)}):ie(r)&&(e=[r]),t===2?e.length===1?[e[0],e[0]]:[e[0],e[1]]:t===4?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[0],e[1],e[0],e[1]]:e.length===3?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]:t==="even"&&e.length%2===1?[].concat((0,k.Z)(e),(0,k.Z)(e)):e}function ni(r,t,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r.unit===te.kPixels)return Number(r.value);if(r.unit===te.kPercentage&&e){var i=e.nodeName===_t.GROUP?e.getLocalBounds():e.getGeometryBounds();return(n?i.min[t]:0)+r.value/100*i.halfExtents[t]*2}return 0}var VS=function(t){return $o(/deg|rad|grad|turn|px|%/g,t)},US=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function YS(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(r=r.toLowerCase().trim(),r==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,e=[],n,i=0;n=t.exec(r);){if(n.index!==i)return[];if(i=n.index+n[0].length,US.indexOf(n[1])>-1&&e.push({name:n[1],params:n[2].split(" ").map(function(a){return VS(a)||Jo(a)})}),t.lastIndex===r.length)return e}return[]}function pp(r){return r.toString()}var mp=function(t){return typeof t=="number"?En(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?En(Number(t)):En(0)},Vd=zn(mp);zn(function(r){return Ve(r)?r.split(" ").map(Vd):r.map(Vd)});function Ud(r,t){return[r,t,pp]}function Yd(r,t){return function(e,n){return[e,n,function(i){return pp(kn(i,r,t))}]}}function yp(r,t){if(r.length===t.length)return[r,t,function(e){return e}]}function Hd(r){return r.parsedStyle.d.totalLength===0&&(r.parsedStyle.d.totalLength=Vw(r.parsedStyle.d.absolutePath)),r.parsedStyle.d.totalLength}function HS(r){return r.parsedStyle.points.totalLength===0&&(r.parsedStyle.points.totalLength=O2(r.parsedStyle.points.points)),r.parsedStyle.points.totalLength}function XS(r){for(var t=0;t<r.length;t++){var e=r[t-1],n=r[t],i=n[0];if(i==="M"&&e){var a=e[0],s=[n[1],n[2]],o=void 0;a==="L"||a==="M"?o=[e[1],e[2]]:(a==="C"||a==="A"||a==="Q")&&(o=[e[e.length-2],e[e.length-1]]),o&&mc(s,o)&&(r.splice(t,1),t--)}}}function KS(r){for(var t=!1,e=r.length,n=0;n<e;n++){var i=r[n],a=i[0];if(a==="C"||a==="A"||a==="Q"){t=!0;break}}return t}function QS(r){for(var t=[],e=[],n=[],i=0;i<r.length;i++){var a=r[i],s=a[0];s==="M"?(n.length&&(e.push(n),n=[]),n.push([a[1],a[2]])):s==="Z"?n.length&&(t.push(n),n=[]):n.push([a[1],a[2]])}return n.length>0&&e.push(n),{polygons:t,polylines:e}}function mc(r,t){return r[0]===t[0]&&r[1]===t[1]}function qS(r,t){for(var e=[],n=[],i=[],a=0;a<r.length;a++){var s=r[a],o=s.currentPoint,l=s.params,c=s.prePoint,u=void 0;switch(s.command){case"Q":u=N2(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=M2(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=s.arcParams;u=b2(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:e.push(o[0]),n.push(o[1]);break}u&&(s.box=u,e.push(u.x,u.x+u.width),n.push(u.y,u.y+u.height)),t&&(s.command==="L"||s.command==="M")&&s.prePoint&&s.nextPoint&&i.push(s)}e=e.filter(function(O){return!Number.isNaN(O)&&O!==1/0&&O!==-1/0}),n=n.filter(function(O){return!Number.isNaN(O)&&O!==1/0&&O!==-1/0});var d=ec(e),f=ec(n),v=nc(e),g=nc(n);if(i.length===0)return{x:d,y:f,width:v-d,height:g-f};for(var p=0;p<i.length;p++){var y=i[p],b=y.currentPoint,w=void 0;b[0]===d?(w=yc(y,t),d-=w.xExtra):b[0]===v&&(w=yc(y,t),v+=w.xExtra),b[1]===f?(w=yc(y,t),f-=w.yExtra):b[1]===g&&(w=yc(y,t),g+=w.yExtra)}return{x:d,y:f,width:v-d,height:g-f}}function yc(r,t){var e=r.prePoint,n=r.currentPoint,i=r.nextPoint,a=Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),o=Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2),l=Math.acos((a+s-o)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!l||Math.sin(l)===0||Vo(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),u=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var h={xExtra:Math.cos(l/2-c)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(u-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return h}function bp(r,t){return[t[0]+(t[0]-r[0]),t[1]+(t[1]-r[1])]}var xp=function(t,e){var n=t.x*e.x+t.y*e.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))),a=t.x*e.y-t.y*e.x<0?-1:1,s=a*Math.acos(n/i);return s},Ep=function(t,e,n,i,a,s,o,l){e=Math.abs(e),n=Math.abs(n),i=bg(i,360);var c=rn(i);if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(e===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var u=(t.x-o.x)/2,h=(t.y-o.y)/2,d={x:Math.cos(c)*u+Math.sin(c)*h,y:-Math.sin(c)*u+Math.cos(c)*h},f=Math.pow(d.x,2)/Math.pow(e,2)+Math.pow(d.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var v=Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(d.y,2)-Math.pow(n,2)*Math.pow(d.x,2),g=Math.pow(e,2)*Math.pow(d.y,2)+Math.pow(n,2)*Math.pow(d.x,2),p=v/g;p=p<0?0:p;var y=(a!==s?1:-1)*Math.sqrt(p),b={x:y*(e*d.y/n),y:y*(-(n*d.x)/e)},w={x:Math.cos(c)*b.x-Math.sin(c)*b.y+(t.x+o.x)/2,y:Math.sin(c)*b.x+Math.cos(c)*b.y+(t.y+o.y)/2},O={x:(d.x-b.x)/e,y:(d.y-b.y)/n},_=xp({x:1,y:0},O),F={x:(-d.x-b.x)/e,y:(-d.y-b.y)/n},W=xp(O,F);!s&&W>0?W-=2*Math.PI:s&&W<0&&(W+=2*Math.PI),W%=2*Math.PI;var j=_+W*l,H=e*Math.cos(j),K=n*Math.sin(j),et={x:Math.cos(c)*H-Math.sin(c)*K+w.x,y:Math.sin(c)*H+Math.cos(c)*K+w.y,ellipticalArcStartAngle:_,ellipticalArcEndAngle:_+W,ellipticalArcAngle:j,ellipticalArcCenter:w,resultantRx:e,resultantRy:n};return et};function JS(r){for(var t=[],e=null,n=null,i=null,a=0,s=r.length,o=0;o<s;o++){var l=r[o];n=r[o+1];var c=l[0],u={command:c,prePoint:e,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=o;break;case"A":var h=$S(e,l);u.arcParams=h;break}if(c==="Z")e=i,n=r[a+1];else{var d=l.length;e=[l[d-2],l[d-1]]}n&&n[0]==="Z"&&(n=r[a],t[a]&&(t[a].prePoint=e)),u.currentPoint=e,t[a]&&mc(e,t[a].currentPoint)&&(t[a].prePoint=u.prePoint);var f=n?[n[n.length-2],n[n.length-1]]:null;u.nextPoint=f;var v=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[v[0]-e[0],v[1]-e[1]],u.endTangent=[e[0]-v[0],e[1]-v[1]];else if(c==="Q"){var g=[l[1],l[2]];u.startTangent=[v[0]-g[0],v[1]-g[1]],u.endTangent=[e[0]-g[0],e[1]-g[1]]}else if(c==="T"){var p=t[o-1],y=bp(p.currentPoint,v);p.command==="Q"?(u.command="Q",u.startTangent=[v[0]-y[0],v[1]-y[1]],u.endTangent=[e[0]-y[0],e[1]-y[1]]):(u.command="TL",u.startTangent=[v[0]-e[0],v[1]-e[1]],u.endTangent=[e[0]-v[0],e[1]-v[1]])}else if(c==="C"){var b=[l[1],l[2]],w=[l[3],l[4]];u.startTangent=[v[0]-b[0],v[1]-b[1]],u.endTangent=[e[0]-w[0],e[1]-w[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[b[0]-w[0],b[1]-w[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[w[0]-b[0],w[1]-b[1]])}else if(c==="S"){var O=t[o-1],_=bp(O.currentPoint,v),F=[l[1],l[2]];O.command==="C"?(u.command="C",u.startTangent=[v[0]-_[0],v[1]-_[1]],u.endTangent=[e[0]-F[0],e[1]-F[1]]):(u.command="SQ",u.startTangent=[v[0]-F[0],v[1]-F[1]],u.endTangent=[e[0]-F[0],e[1]-F[1]])}else if(c==="A"){var W=wp(u,0),j=W.x,H=W.y,K=wp(u,1,!1),et=K.x,rt=K.y;u.startTangent=[j,H],u.endTangent=[et,rt]}t.push(u)}return t}function wp(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=r.arcParams,i=n.rx,a=i===void 0?0:i,s=n.ry,o=s===void 0?0:s,l=n.xRotation,c=n.arcFlag,u=n.sweepFlag,h=Ep({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!c,!!u,{x:r.currentPoint[0],y:r.currentPoint[1]},t),d=Ep({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!c,!!u,{x:r.currentPoint[0],y:r.currentPoint[1]},e?t+.005:t-.005),f=d.x-h.x,v=d.y-h.y,g=Math.sqrt(f*f+v*v);return{x:-f/g,y:-v/g}}function bc(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Xd(r,t){return bc(r)*bc(t)?(r[0]*t[0]+r[1]*t[1])/(bc(r)*bc(t)):1}function Sp(r,t){return(r[0]*t[1]<r[1]*t[0]?-1:1)*Math.acos(Xd(r,t))}function $S(r,t){var e=t[1],n=t[2],i=bg(rn(t[3]),Math.PI*2),a=t[4],s=t[5],o=r[0],l=r[1],c=t[6],u=t[7],h=Math.cos(i)*(o-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(o-c)/2+Math.cos(i)*(l-u)/2,f=h*h/(e*e)+d*d/(n*n);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var v=e*e*(d*d)+n*n*(h*h),g=v?Math.sqrt((e*e*(n*n)-v)/v):1;a===s&&(g*=-1),isNaN(g)&&(g=0);var p=n?g*e*d/n:0,y=e?g*-n*h/e:0,b=(o+c)/2+Math.cos(i)*p-Math.sin(i)*y,w=(l+u)/2+Math.sin(i)*p+Math.cos(i)*y,O=[(h-p)/e,(d-y)/n],_=[(-1*h-p)/e,(-1*d-y)/n],F=Sp([1,0],O),W=Sp(O,_);return Xd(O,_)<=-1&&(W=Math.PI),Xd(O,_)>=1&&(W=0),s===0&&W>0&&(W-=2*Math.PI),s===1&&W<0&&(W+=2*Math.PI),{cx:b,cy:w,rx:mc(r,[c,u])?0:e,ry:mc(r,[c,u])?0:n,startAngle:F,endAngle:F+W,xRotation:i,arcFlag:a,sweepFlag:s}}function tM(r,t,e){return r.reduce(function(n,i){var a="";if(i[0]==="M"||i[0]==="L"){var s=vec3.fromValues(i[1],i[2],0);e&&vec3.transformMat4(s,s,e),a="".concat(i[0]).concat(s[0],",").concat(s[1])}else if(i[0]==="Z")a=i[0];else if(i[0]==="C"){var o=vec3.fromValues(i[1],i[2],0),l=vec3.fromValues(i[3],i[4],0),c=vec3.fromValues(i[5],i[6],0);e&&(vec3.transformMat4(o,o,e),vec3.transformMat4(l,l,e),vec3.transformMat4(c,c,e)),a="".concat(i[0]).concat(o[0],",").concat(o[1],",").concat(l[0],",").concat(l[1],",").concat(c[0],",").concat(c[1])}else if(i[0]==="A"){var u=vec3.fromValues(i[6],i[7],0);e&&vec3.transformMat4(u,u,e),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(u[0],",").concat(u[1])}else if(i[0]==="Q"){var h=vec3.fromValues(i[1],i[2],0),d=vec3.fromValues(i[3],i[4],0);e&&(vec3.transformMat4(h,h,e),vec3.transformMat4(d,d,e)),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return n+=a},"")}function eM(r,t,e,n){return[["M",r,t],["L",e,n]]}function Mp(r,t,e,n){var i=(-1+Math.sqrt(2))/3*4,a=r*i,s=t*i,o=e-r,l=e+r,c=n-t,u=n+t;return[["M",o,n],["C",o,n-s,e-a,c,e,c],["C",e+a,c,l,n-s,l,n],["C",l,n+s,e+a,u,e,u],["C",e-a,u,o,n+s,o,n],["Z"]]}function nM(r,t){var e=r.map(function(n,i){return[i===0?"M":"L",n[0],n[1]]});return t&&e.push(["Z"]),e}function rM(r,t,e,n,i){if(i){var a=_slicedToArray(i,4),s=a[0],o=a[1],l=a[2],c=a[3],u=r>0?1:-1,h=t>0?1:-1,d=u+h!==0?1:0;return[["M",u*s+e,n],["L",r-u*o+e,n],o?["A",o,o,0,0,d,r+e,h*o+n]:null,["L",r+e,t-h*l+n],l?["A",l,l,0,0,d,r+e-u*l,t+n]:null,["L",e+u*c,t+n],c?["A",c,c,0,0,d,e,t+n-h*c]:null,["L",e,h*s+n],s?["A",s,s,0,0,d,u*s+e,n]:null,["Z"]].filter(function(f){return f})}return[["M",e,n],["L",e+r,n],["L",e+r,n+t],["L",e,n+t],["Z"]]}function j8(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.getLocalTransform(),e=[];switch(r.nodeName){case _t.LINE:var n=r.parsedStyle,i=n.x1,a=i===void 0?0:i,s=n.y1,o=s===void 0?0:s,l=n.x2,c=l===void 0?0:l,u=n.y2,h=u===void 0?0:u;e=eM(a,o,c,h);break;case _t.CIRCLE:{var d=r.parsedStyle,f=d.r,v=f===void 0?0:f,g=d.cx,p=g===void 0?0:g,y=d.cy,b=y===void 0?0:y;e=Mp(v,v,p,b);break}case _t.ELLIPSE:{var w=r.parsedStyle,O=w.rx,_=O===void 0?0:O,F=w.ry,W=F===void 0?0:F,j=w.cx,H=j===void 0?0:j,K=w.cy,et=K===void 0?0:K;e=Mp(_,W,H,et);break}case _t.POLYLINE:case _t.POLYGON:var rt=r.parsedStyle.points;e=nM(rt.points,r.nodeName===_t.POLYGON);break;case _t.RECT:var lt=r.parsedStyle,ht=lt.width,yt=ht===void 0?0:ht,Nt=lt.height,Ct=Nt===void 0?0:Nt,pt=lt.x,xt=pt===void 0?0:pt,kt=lt.y,jt=kt===void 0?0:kt,Xt=lt.radius,ee=Xt&&Xt.some(function(ue){return ue!==0});e=rM(yt,Ct,xt,jt,ee&&Xt.map(function(ue){return clamp(ue,0,Math.min(Math.abs(yt)/2,Math.abs(Ct)/2))}));break;case _t.PATH:var ce=r.parsedStyle.d.absolutePath;e=_toConsumableArray(ce);break}if(e.length)return tM(e,r,t)}function Z8(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=r.map(function(s,o){var l=s[0],c=r[o+1],u=o===0&&(t!==0||e!==0),h=(o===r.length-1||c&&(c[0]==="M"||c[0]==="Z"))&&n!==0&&i!==0,d=u?[t,e]:[0,0],f=_slicedToArray(d,2),v=f[0],g=f[1],p=h?[n,i]:[0,0],y=_slicedToArray(p,2),b=y[0],w=y[1];switch(l){case"M":return"M ".concat(s[1]+v,",").concat(s[2]+g);case"L":return"L ".concat(s[1]+b,",").concat(s[2]+w);case"Q":return"Q ".concat(s[1]," ").concat(s[2],",").concat(s[3]+b," ").concat(s[4]+w);case"C":return"C ".concat(s[1]," ").concat(s[2],",").concat(s[3]," ").concat(s[4],",").concat(s[5]+b," ").concat(s[6]+w);case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]," ").concat(s[7]).concat(h?" L ".concat(s[6]+n,",").concat(s[7]+i):"");case"Z":return"Z";default:return null}}).filter(function(s){return s!==null}).join(" ");return~a.indexOf("NaN")?"":a}var Ap=function(t){if(t===""||Array.isArray(t)&&t.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=tc(t)}catch(f){e=tc(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}XS(e);var n=KS(e),i=QS(e),a=i.polygons,s=i.polylines,o=JS(e),l=qS(o,0),c=l.x,u=l.y,h=l.width,d=l.height;return{absolutePath:e,hasArc:n,segments:o,polygons:a,polylines:s,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(h)?h:0,height:Number.isFinite(d)?d:0}}},iM=zn(Ap);function Tp(r){return Ve(r)?iM(r):Ap(r)}function aM(r,t,e){var n=r.curve,i=t.curve;(!n||n.length===0)&&(n=Od(r.absolutePath,!1),r.curve=n),(!i||i.length===0)&&(i=Od(t.absolutePath,!1),t.curve=i);var a=[n,i];n.length!==i.length&&(a=wg(n,i));var s=Sg(a[0])!==Sg(a[1])?e2(a[0]):n2(a[0]);return[s,i2(a[1],s),function(o){return o}]}function sM(r,t){var e;return Ve(r)?e=r.split(" ").map(function(n){var i=n.split(","),a=(0,P.Z)(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):e=r,{points:e,totalLength:0,segments:[]}}function oM(r,t){return[r.points,t.points,function(e){return e}]}var Pn=null,oo=/\s*(\w+)\(([^)]*)\)/g;function Hr(r){return function(t){var e=0;return r.map(function(n){return n===Pn?t[e++]:n})}}function bs(r){return r}var tl={matrix:["NNNNNN",[Pn,Pn,0,0,Pn,Pn,0,0,0,0,1,0,Pn,Pn,0,1],bs],matrix3d:["NNNNNNNNNNNNNNNN",bs],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Hr([Pn,Pn,new sn(1)]),bs],scaleX:["N",Hr([Pn,new sn(1),new sn(1)]),Hr([Pn,new sn(1)])],scaleY:["N",Hr([new sn(1),Pn,new sn(1)]),Hr([new sn(1),Pn])],scaleZ:["N",Hr([new sn(1),new sn(1),Pn])],scale3d:["NNN",bs],skew:["Aa",null,bs],skewX:["A",null,Hr([Pn,ms])],skewY:["A",null,Hr([ms,Pn])],translate:["Tt",Hr([Pn,Pn,Pi]),bs],translateX:["T",Hr([Pn,Pi,Pi]),Hr([Pn,Pi])],translateY:["T",Hr([Pi,Pn,Pi]),Hr([Pi,Pn])],translateZ:["L",Hr([Pi,Pi,Pn])],translate3d:["TTL",bs]};function Op(r){for(var t=[],e=r.length,n=0;n<e;n++){var i=r[n],a=i[0],s=i.slice(1);a==="translate"||a==="skew"?s.length===1&&s.push(0):a==="scale"&&s.length===1&&s.push(s[0]);var o=tl[a];if(!o)return[];var l=s.map(function(c){return En(c)});t.push({t:a,d:l})}return t}function Cp(r){if(Array.isArray(r))return Op(r);if(r=(r||"none").trim(),r==="none")return[];var t=[],e,n=0;for(oo.lastIndex=0;e=oo.exec(r);){if(e.index!==n)return[];n=e.index+e[0].length;var i=e[1],a=tl[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],c=0;c<o.length;c++){var u=s[c],h=o[c],d=void 0;if(u?d={A:function(v){return v.trim()==="0"?ms:WS(v)},N:Vd,T:Gd,L:jS}[h.toUpperCase()](u):d={a:ms,n:l[0],t:Pi}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),oo.lastIndex===r.length)return t}return[]}function lM(r){if(Array.isArray(r))return Op(r);if(r=(r||"none").trim(),r==="none")return[];var t=[],e,n=0;for(oo.lastIndex=0;e=oo.exec(r);){if(e.index!==n)return[];n=e.index+e[0].length;var i=e[1],a=tl[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],c=0;c<o.length;c++){var u=s[c],h=o[c],d=void 0;if(u?d={A:function(v){return v.trim()==="0"?ms:vp(v)},N:mp,T:fp,L:dp}[h.toUpperCase()](u):d={a:ms,n:l[0],t:Pi}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),oo.lastIndex===r.length)return t}return[]}function cM(r){var t,e,n,i;switch(r.t){case"rotateX":return i=rn(Yr(r.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=rn(Yr(r.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=rn(Yr(r.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=r.d[0].value,e=r.d[1].value,n=r.d[2].value,i=rn(Yr(r.d[3]));var a=t*t+e*e+n*n;if(a===0)t=1,e=0,n=0;else if(a!==1){var s=Math.sqrt(a);t/=s,e/=s,n/=s}var o=Math.sin(i/2),l=o*Math.cos(i/2),c=o*o;return[1-2*(e*e+n*n)*c,2*(t*e*c+n*l),2*(t*n*c-e*l),0,2*(t*e*c-n*l),1-2*(t*t+n*n)*c,2*(e*n*c+t*l),0,2*(t*n*c+e*l),2*(e*n*c-t*l),1-2*(t*t+e*e)*c,0,0,0,0,1];case"scale":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[r.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,r.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,r.d[0].value,0,0,0,0,1];case"scale3d":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,r.d[2].value,0,0,0,0,1];case"skew":var u=rn(Yr(r.d[0])),h=rn(Yr(r.d[1]));return[1,Math.tan(h),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=rn(Yr(r.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=rn(Yr(r.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return t=ni(r.d[0],0,null)||0,e=ni(r.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1];case"translateX":return t=ni(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,0,0,1];case"translateY":return e=ni(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,e,0,1];case"translateZ":return n=ni(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n,1];case"translate3d":return t=ni(r.d[0],0,null)||0,e=ni(r.d[1],0,null)||0,n=ni(r.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1];case"perspective":var d=ni(r.d[0],0,null)||0,f=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,f,0,0,0,1];case"matrix":return[r.d[0].value,r.d[1].value,0,0,r.d[2].value,r.d[3].value,0,0,0,0,1,0,r.d[4].value,r.d[5].value,0,1];case"matrix3d":return r.d.map(function(v){return v.value})}}function uM(r,t){return[r[0]*t[0]+r[4]*t[1]+r[8]*t[2]+r[12]*t[3],r[1]*t[0]+r[5]*t[1]+r[9]*t[2]+r[13]*t[3],r[2]*t[0]+r[6]*t[1]+r[10]*t[2]+r[14]*t[3],r[3]*t[0]+r[7]*t[1]+r[11]*t[2]+r[15]*t[3],r[0]*t[4]+r[4]*t[5]+r[8]*t[6]+r[12]*t[7],r[1]*t[4]+r[5]*t[5]+r[9]*t[6]+r[13]*t[7],r[2]*t[4]+r[6]*t[5]+r[10]*t[6]+r[14]*t[7],r[3]*t[4]+r[7]*t[5]+r[11]*t[6]+r[15]*t[7],r[0]*t[8]+r[4]*t[9]+r[8]*t[10]+r[12]*t[11],r[1]*t[8]+r[5]*t[9]+r[9]*t[10]+r[13]*t[11],r[2]*t[8]+r[6]*t[9]+r[10]*t[10]+r[14]*t[11],r[3]*t[8]+r[7]*t[9]+r[11]*t[10]+r[15]*t[11],r[0]*t[12]+r[4]*t[13]+r[8]*t[14]+r[12]*t[15],r[1]*t[12]+r[5]*t[13]+r[9]*t[14]+r[13]*t[15],r[2]*t[12]+r[6]*t[13]+r[10]*t[14]+r[14]*t[15],r[3]*t[12]+r[7]*t[13]+r[11]*t[14]+r[15]*t[15]]}function hM(r){return r.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:r.map(cM).reduce(uM)}function Np(r){var t=[0,0,0],e=[1,1,1],n=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return Y2(hM(r),t,e,n,i,a),[[t,e,n,a,i]]}var dM=function(){function r(n,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],s=0;s<4;s++)for(var o=0;o<4;o++)for(var l=0;l<4;l++)a[s][o]+=i[s][l]*n[l][o];return a}function t(n){return n[0][2]===0&&n[0][3]===0&&n[1][2]===0&&n[1][3]===0&&n[2][0]===0&&n[2][1]===0&&n[2][2]===1&&n[2][3]===0&&n[3][2]===0&&n[3][3]===1}function e(n,i,a,s,o){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=o[c];for(var u=0;u<3;u++)for(var h=0;h<3;h++)l[3][u]+=n[h]*l[h][u];var d=s[0],f=s[1],v=s[2],g=s[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+v*v),p[0][1]=2*(d*f-v*g),p[0][2]=2*(d*v+f*g),p[1][0]=2*(d*f+v*g),p[1][1]=1-2*(d*d+v*v),p[1][2]=2*(f*v-d*g),p[2][0]=2*(d*v-f*g),p[2][1]=2*(f*v+d*g),p[2][2]=1-2*(d*d+f*f),l=r(l,p);var y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(y[2][1]=a[2],l=r(l,y)),a[1]&&(y[2][1]=0,y[2][0]=a[0],l=r(l,y)),a[0]&&(y[2][0]=0,y[1][0]=a[0],l=r(l,y));for(var b=0;b<3;b++)for(var w=0;w<3;w++)l[b][w]*=i[b];return t(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return e}();function fM(r){return r.toFixed(6).replace(".000000","")}function Kd(r,t){var e,n;return r.decompositionPair!==t&&(r.decompositionPair=t,e=Np(r)),t.decompositionPair!==r&&(t.decompositionPair=r,n=Np(t)),e[0]===null||n[0]===null?[[!1],[!0],function(i){return i?t[0].d:r[0].d}]:(e[0].push(0),n[0].push(1),[e,n,function(i){var a=gM(e[0][3],n[0][3],i[5]),s=dM(i[0],i[1],i[2],a,i[4]),o=s.map(fM).join(",");return o}])}function vM(r,t){for(var e=0,n=0;n<r.length;n++)e+=r[n]*t[n];return e}function gM(r,t,e){var n=vM(r,t);n=kn(n,-1,1);var i=[];if(n===1)i=r;else for(var a=Math.acos(n),s=Math.sin(e*a)*1/Math.sqrt(1-n*n),o=0;o<4;o++)i.push(r[o]*(Math.cos(e*a)-n*s)+t[o]*s);return i}function Qd(r){return r.replace(/[XY]/,"")}function qd(r){return r.replace(/(X|Y|Z|3d)?$/,"3d")}var pM=function(t,e){return t==="perspective"&&e==="perspective"||(t==="matrix"||t==="matrix3d")&&(e==="matrix"||e==="matrix3d")};function mM(r,t,e){var n=!1;if(!r.length||!t.length){r.length||(n=!0,r=t,t=[]);for(var i=function(){var et=r[a],rt=et.t,lt=et.d,ht=rt.substring(0,5)==="scale"?1:0;t.push({t:rt,d:lt.map(function(yt){return typeof yt=="number"?En(ht):En(ht,yt.unit)})})},a=0;a<r.length;a++)i()}var s=[],o=[],l=[];if(r.length!==t.length){var c=Kd(r,t);s=[c[0]],o=[c[1]],l=[["matrix",[c[2]]]]}else for(var u=0;u<r.length;u++){var h=r[u].t,d=t[u].t,f=r[u].d,v=t[u].d,g=tl[h],p=tl[d],y=void 0;if(pM(h,d)){var b=Kd([r[u]],[t[u]]);s.push(b[0]),o.push(b[1]),l.push(["matrix",[b[2]]]);continue}else if(h===d)y=h;else if(g[2]&&p[2]&&Qd(h)===Qd(d))y=Qd(h),f=g[2](f),v=p[2](v);else if(g[1]&&p[1]&&qd(h)===qd(d))y=qd(h),f=g[1](f),v=p[1](v);else{var w=Kd(r,t);s=[w[0]],o=[w[1]],l=[["matrix",[w[2]]]];break}for(var O=[],_=[],F=[],W=0;W<f.length;W++){var j=GS(f[W],v[W],e,!1,W);O[W]=j[0],_[W]=j[1],F.push(j[2])}s.push(O),o.push(_),l.push([y,F])}if(n){var H=s;s=o,o=H}return[s,o,function(K){return K.map(function(et,rt){var lt=et.map(function(ht,yt){return l[rt][1][yt](ht)}).join(",");return l[rt][0]==="matrix"&&lt.split(",").length===16&&(l[rt][0]="matrix3d"),l[rt][0]==="matrix3d"&&lt.split(",").length===6&&(l[rt][0]="matrix"),"".concat(l[rt][0],"(").concat(lt,")")}).join(" ")}]}var yM=zn(function(r){if(Ve(r)){if(r==="text-anchor")return[En(0,"px"),En(0,"px")];var t=r.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[Gd(kp(t[0])),Gd(kp(t[1]))]}return[En(r[0]||0,"px"),En(r[1]||0,"px")]});function kp(r){return r==="center"?"50%":r==="left"||r==="top"?"0%":r==="right"||r==="bottom"?"100%":r}var Jd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:$t.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:$t.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:$t.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:$t.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:$t.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:$t.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:$t.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:$t.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:$t.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:$t.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:$t.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:$t.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:$t.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:$t.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:$t.FILTER},{n:"clipPath",syntax:$t.DEFINED_PATH},{n:"textPath",syntax:$t.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:$t.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:$t.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:$t.COORDINATE},{n:"y1",int:!0,l:!0,syntax:$t.COORDINATE},{n:"z1",int:!0,l:!0,syntax:$t.COORDINATE},{n:"x2",int:!0,l:!0,syntax:$t.COORDINATE},{n:"y2",int:!0,l:!0,syntax:$t.COORDINATE},{n:"z2",int:!0,l:!0,syntax:$t.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:$t.PATH,p:50},{n:"points",int:!0,l:!0,syntax:$t.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:$t.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:$t.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:$t.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:$t.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:$t.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:$t.NUMBER,d:function(t){return t===_t.PATH||t===_t.POLYGON||t===_t.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:$t.MARKER},{n:"markerEnd",syntax:$t.MARKER},{n:"markerMid",syntax:$t.MARKER},{n:"markerStartOffset",syntax:$t.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:$t.LENGTH,l:!0,int:!0,d:"0"}],bM=new Set(Jd.filter(function(r){return!!r.l}).map(function(r){return r.n})),Pp={},xM=function(){function r(t){var e=this;(0,N.Z)(this,r),this.runtime=t,Jd.forEach(function(n){e.registerMetadata(n)})}return(0,T.Z)(r,[{key:"registerMetadata",value:function(e){[e.n].concat((0,k.Z)(e.a||[])).forEach(function(n){Pp[n]=e})}},{key:"getPropertySyntax",value:function(e){return this.runtime.CSSPropertySyntaxFactory[e]}},{key:"processProperties",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(e.attributes,n);var a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;EM(e,n);var o=!!i.forceUpdateGeometry;if(!o){for(var l in n)if(bM.has(l)){o=!0;break}}var c=Rp(e);c.has("fill")&&n.fill&&(e.parsedStyle.fill=Jo(n.fill)),c.has("stroke")&&n.stroke&&(e.parsedStyle.stroke=Jo(n.stroke)),c.has("shadowColor")&&n.shadowColor&&(e.parsedStyle.shadowColor=Jo(n.shadowColor)),c.has("filter")&&n.filter&&(e.parsedStyle.filter=YS(n.filter)),c.has("radius")&&!ye(n.radius)&&(e.parsedStyle.radius=gp(n.radius,4)),c.has("lineDash")&&!ye(n.lineDash)&&(e.parsedStyle.lineDash=gp(n.lineDash,"even")),c.has("points")&&n.points&&(e.parsedStyle.points=sM(n.points)),c.has("d")&&n.d===""&&(e.parsedStyle.d=(0,D.Z)({},Qg)),c.has("d")&&n.d&&(e.parsedStyle.d=Tp(n.d)),c.has("textTransform")&&n.textTransform&&this.runtime.CSSPropertySyntaxFactory[$t.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},e,null),c.has("clipPath")&&!Te(n.clipPath)&&this.runtime.CSSPropertySyntaxFactory[$t.DEFINED_PATH].calculator("clipPath",a,n.clipPath,e,this.runtime),c.has("offsetPath")&&n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[$t.DEFINED_PATH].calculator("offsetPath",s,n.offsetPath,e,this.runtime),c.has("transform")&&n.transform&&(e.parsedStyle.transform=Cp(n.transform)),c.has("transformOrigin")&&n.transformOrigin&&(e.parsedStyle.transformOrigin=yM(n.transformOrigin)),c.has("markerStart")&&n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[$t.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),c.has("markerEnd")&&n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[$t.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),c.has("markerMid")&&n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[$t.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),c.has("zIndex")&&!ye(n.zIndex)&&this.runtime.CSSPropertySyntaxFactory[$t.Z_INDEX].postProcessor(e),c.has("offsetDistance")&&!ye(n.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[$t.OFFSET_DISTANCE].postProcessor(e),c.has("transform")&&n.transform&&this.runtime.CSSPropertySyntaxFactory[$t.TRANSFORM].postProcessor(e),c.has("transformOrigin")&&n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[$t.TRANSFORM_ORIGIN].postProcessor(e),o&&(e.dirty(!0,!0),i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(e))}},{key:"updateGeometry",value:function(e){var n=e.nodeName,i=this.runtime.geometryUpdaterFactory[n];if(i){var a=e.geometry;a.contentBounds||(a.contentBounds=new gn),a.renderBounds||(a.renderBounds=new gn);var s=e.parsedStyle,o=i.update(s,e),l=o.cx,c=l===void 0?0:l,u=o.cy,h=u===void 0?0:u,d=o.cz,f=d===void 0?0:d,v=o.hwidth,g=v===void 0?0:v,p=o.hheight,y=p===void 0?0:p,b=o.hdepth,w=b===void 0?0:b,O=[Math.abs(g),Math.abs(y),w],_=s.stroke,F=s.lineWidth,W=F===void 0?1:F,j=s.increasedLineWidthForHitTesting,H=j===void 0?0:j,K=s.shadowType,et=K===void 0?"outer":K,rt=s.shadowColor,lt=s.filter,ht=lt===void 0?[]:lt,yt=s.transformOrigin,Nt=[c,h,f];a.contentBounds.update(Nt,O);var Ct=n===_t.POLYLINE||n===_t.POLYGON||n===_t.PATH?Math.SQRT2:.5,pt=_&&!_.isNone;if(pt){var xt=((W||0)+(H||0))*Ct;O[0]+=xt,O[1]+=xt}if(a.renderBounds.update(Nt,O),rt&&et&&et!=="inner"){var kt=a.renderBounds,jt=kt.min,Xt=kt.max,ee=s.shadowBlur,ce=s.shadowOffsetX,ue=s.shadowOffsetY,le=ee||0,me=ce||0,De=ue||0,Ge=jt[0]-le+me,_e=Xt[0]+le+me,tr=jt[1]-le+De,yn=Xt[1]+le+De;jt[0]=Math.min(jt[0],Ge),Xt[0]=Math.max(Xt[0],_e),jt[1]=Math.min(jt[1],tr),Xt[1]=Math.max(Xt[1],yn),a.renderBounds.setMinMax(jt,Xt)}ht.forEach(function(vr){var Ma=vr.name,Ar=vr.params;if(Ma==="blur"){var $r=Ar[0].value;a.renderBounds.update(a.renderBounds.center,Vt(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[$r,$r,0]))}else if(Ma==="drop-shadow"){var Fe=Ar[0].value,Ke=Ar[1].value,ze=Ar[2].value,Ye=a.renderBounds,en=Ye.min,pe=Ye.max,He=en[0]-ze+Fe,Qe=pe[0]+ze+Fe,er=en[1]-ze+Ke,qe=pe[1]+ze+Ke;en[0]=Math.min(en[0],He),pe[0]=Math.max(pe[0],Qe),en[1]=Math.min(en[1],er),pe[1]=Math.max(pe[1],qe),a.renderBounds.setMinMax(en,pe)}}),e.geometry.dirty=!1;var Sr=g<0,lr=y<0,rs=(Sr?-1:1)*(yt?ni(yt[0],0,e,!0):0),Mr=(lr?-1:1)*(yt?ni(yt[1],1,e,!0):0);(rs||Mr)&&e.setOrigin(rs,Mr)}}},{key:"updateSizeAttenuation",value:function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===_t.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===_t.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))}}])}();function EM(r,t){var e=Rp(r);for(var n in t)e.has(n)&&(r.parsedStyle[n]=t[n])}function Rp(r){return r.constructor.PARSED_STYLE_LIST}var wM=function(){function r(){(0,N.Z)(this,r),this.mixer=Ud}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return Yr(i)}}])}(),SM=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a,s){return i instanceof gi&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(e,n,i,a),e==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtyToRoot(o)}),i}}])}(),MM=function(){function r(){(0,N.Z)(this,r),this.parser=Jo,this.mixer=zS}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof gi?i.value==="none"?cp:up:i}}])}(),AM=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i instanceof gi?[]:i}}])}();function Lp(r){var t=r.parsedStyle,e=t.fontSize;return ye(e)?null:e}var $d=function(){function r(){(0,N.Z)(this,r),this.mixer=Ud}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a,s){if(ie(i))return i;if(sn.isRelativeUnit(i.unit)){if(i.unit===te.kPercentage)return 0;if(i.unit===te.kEms){if(a.parentNode){var o=Lp(a.parentNode);if(o)return o*=i.value,o}return 0}if(i.unit===te.kRems){var l;if(a!=null&&(l=a.ownerDocument)!==null&&l!==void 0&&l.documentElement){var c=Lp(a.ownerDocument.documentElement);if(c)return c*=i.value,c}return 0}}else return i.value}}])}(),TM=function(){function r(){(0,N.Z)(this,r),this.mixer=yp}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.map(function(a){return a.value})}}])}(),OM=function(){function r(){(0,N.Z)(this,r),this.mixer=yp}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.map(function(a){return a.value})}}])}(),CM=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){var s;i instanceof gi&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),NM=function(){function r(){(0,N.Z)(this,r),this.mixer=Ud}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}}])}(),kM=function(){function r(){(0,N.Z)(this,r),this.mixer=Yd(0,1)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}},{key:"postProcessor",value:function(e){var n=e.parsedStyle,i=n.offsetPath,a=n.offsetDistance;if(i){var s=i.nodeName;if(s===_t.LINE||s===_t.PATH||s===_t.POLYLINE){var o=i.getPoint(a);o&&e.setLocalPosition(o.x,o.y)}}}}])}(),PM=function(){function r(){(0,N.Z)(this,r),this.mixer=Yd(0,1)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}}])}(),RM=function(){function r(){(0,N.Z)(this,r),this.parser=Tp,this.mixer=aM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i instanceof gi&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new no(0,0,0,0)}:i}}])}(),LM=(0,T.Z)(function r(){(0,N.Z)(this,r),this.mixer=oM}),DM=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.mixer=Yd(0,1/0),e}return(0,C.Z)(t,r),(0,T.Z)(t)}($d),_M=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof gi?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(e){e.nodeValue="".concat(e.parsedStyle.text)||""}}])}(),IM=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){var s=a.getAttribute("text");if(s){var o=s;i.value==="capitalize"?o=s.charAt(0).toUpperCase()+s.slice(1):i.value==="lowercase"?o=s.toLowerCase():i.value==="uppercase"&&(o=s.toUpperCase()),a.parsedStyle.text=o}return i.value}}])}(),W8=function(t){return Object.fromEntries(Object.entries(t).filter(function(e){var n=_slicedToArray(e,2),i=n[1];return i!==void 0}))},tf=new WeakMap;function BM(r,t,e){if(r){var n=typeof r=="string"?document.getElementById(r):r;tf.has(n)&&tf.get(n).destroy(e),tf.set(n,t)}}var ef=typeof window!="undefined"&&typeof window.document!="undefined";function FM(r){return!!r.getAttribute}function zM(r,t){for(var e=0,n=r.length;e<n;){var i=e+n>>>1;Dp(r[i],t)<0?e=i+1:n=i}return e}function Dp(r,t){var e=Number(r.parsedStyle.zIndex||0),n=Number(t.parsedStyle.zIndex||0);if(e===n){var i=r.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(r)-a.indexOf(t)}}return e-n}function _p(r){var t=r;do{var e,n=(e=t.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(n)return t;t=t.parentElement}while(t!==null);return null}var Ip="px";function jM(r,t,e){ef&&r.style&&(r.style.width=t+Ip,r.style.height=e+Ip)}function Bp(r,t){if(ef)return document.defaultView.getComputedStyle(r,null).getPropertyValue(t)}function ZM(r){var t=Bp(r,"width");return t==="auto"?r.offsetWidth:parseFloat(t)}function WM(r){var t=Bp(r,"height");return t==="auto"?r.offsetHeight:parseFloat(t)}var GM=1,VM={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},nf=typeof performance=="object"&&performance.now?performance:Date;function xc(r){return r.nodeName===_t.FRAGMENT?!0:r.getRootNode().nodeName===_t.FRAGMENT}function xs(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",t=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,n=!1,i=!1,a=!!t&&!t.isNone,s=!!e&&!e.isNone;return r==="visiblepainted"||r==="painted"||r==="auto"?(n=a,i=s):r==="visiblefill"||r==="fill"?n=!0:r==="visiblestroke"||r==="stroke"?i=!0:(r==="visible"||r==="all")&&(n=!0,i=!0),[n,i]}var UM=1,YM=function(){return UM++},Ki=typeof self=="object"&&self.self===self?self:typeof S.g=="object"&&S.g.global===S.g?S.g:{},HM=Date.now(),XM=function(){return Ki.performance&&typeof Ki.performance.now=="function"?Ki.performance.now():Date.now()-HM},el={},Fp=Date.now(),KM=function(t){if(typeof t!="function")throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Fp,i=n>16?0:16-n,a=YM();return el[a]=t,Object.keys(el).length>1||setTimeout(function(){Fp=e;var s=el;el={},Object.keys(s).forEach(function(o){return s[o](XM())})},i),a},QM=function(t){delete el[t]},qM=["","webkit","moz","ms","o"],zp=function(t){return typeof t!="string"?KM:t===""?Ki.requestAnimationFrame:Ki["".concat(t,"RequestAnimationFrame")]},JM=function(t){return typeof t!="string"?QM:t===""?Ki.cancelAnimationFrame:Ki["".concat(t,"CancelAnimationFrame")]||Ki["".concat(t,"CancelRequestAnimationFrame")]},$M=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n+=1}},jp=$M(qM,function(r){return!!zp(r)}),rf=zp(jp),Zp=JM(jp);Ki.requestAnimationFrame=rf,Ki.cancelAnimationFrame=Zp;var tA=function(){function r(){(0,N.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(e,n){this.callbacks.push(n)}},{key:"promise",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Promise.all(this.callbacks.map(function(a){return a.apply(void 0,n)}))}}])}(),eA=function(){function r(){(0,N.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"tapPromise",value:function(e,n){this.callbacks.push(n)}},{key:"promise",value:function(){var t=(0,Ra.Z)((0,Cr.Z)().mark(function n(){var i,a,s,o,l=arguments;return(0,Cr.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.callbacks.length){c.next=6;break}return c.next=1,(i=this.callbacks)[0].apply(i,l);case 1:a=c.sent,s=1;case 2:if(!(s<this.callbacks.length)){c.next=5;break}return o=this.callbacks[s],c.next=3,o(a);case 3:a=c.sent;case 4:s++,c.next=2;break;case 5:return c.abrupt("return",a);case 6:return c.abrupt("return",null);case 7:case"end":return c.stop()}},n,this)}));function e(){return t.apply(this,arguments)}return e}()}])}(),Br=function(){function r(){(0,N.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"tap",value:function(e,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var a=arguments;this.callbacks.forEach(function(s){s.apply(void 0,a)})}}])}(),af=function(){function r(){(0,N.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"tap",value:function(e,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(this.callbacks.length){for(var a=arguments,s=this.callbacks[0].apply(void 0,a),o=1;o<this.callbacks.length;o++){var l=this.callbacks[o];s=l(s)}return s}return null}}])}(),nA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],rA=/([\"\'])[^\'\"]+\1/;function Wp(r){var t=r.fontSize,e=t===void 0?16:t,n=r.fontFamily,i=n===void 0?"sans-serif":n,a=r.fontStyle,s=a===void 0?"normal":a,o=r.fontVariant,l=o===void 0?"normal":o,c=r.fontWeight,u=c===void 0?"normal":c;return{fontSize:e,fontFamily:i,fontStyle:s,fontVariant:l,fontWeight:u}}var Gp=zn(function(t){for(var e=Wp(t),n=e.fontSize,i=e.fontFamily,a=e.fontStyle,s=e.fontVariant,o=e.fontWeight,l=ie(n)&&"".concat(n,"px")||"16px",c=i.split(","),u=c.length-1;u>=0;u--){var h=c[u].trim();!rA.test(h)&&nA.indexOf(h)<0&&(h='"'.concat(h,'"')),c[u]=h}return"".concat(a," ").concat(s," ").concat(o," ").concat(l," ").concat(c.join(","))},function(r){var t=Wp(r),e=t.fontSize,n=t.fontFamily,i=t.fontStyle,a=t.fontVariant,s=t.fontWeight;return"".concat(i,"_").concat(a,"_").concat(s,"_").concat(e,"_").concat(n)}),iA=1e-6,nl=function(t){return Math.max(t,iA)};function sf(r,t,e){return ge(r),r[4]=Math.tan(t),r[1]=Math.tan(e),r}var jn=Wt(),aA=Wt(),sA={scale:function(t){vn(jn,[t[0].value,t[1].value,1].map(function(e){return nl(e)}))},scaleX:function(t){vn(jn,[t[0].value,1,1].map(function(e){return nl(e)}))},scaleY:function(t){vn(jn,[1,t[0].value,1].map(function(e){return nl(e)}))},scaleZ:function(t){vn(jn,[1,1,t[0].value].map(function(e){return nl(e)}))},scale3d:function(t){vn(jn,[t[0].value,t[1].value,t[2].value].map(function(e){return nl(e)}))},translate:function(t){Hn(jn,[t[0].value,t[1].value,0])},translateX:function(t){Hn(jn,[t[0].value,0,0])},translateY:function(t){Hn(jn,[0,t[0].value,0])},translateZ:function(t){Hn(jn,[0,0,t[0].value])},translate3d:function(t){Hn(jn,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Bn(jn,rn(Yr(t[0])))},rotateX:function(t){fi(jn,rn(Yr(t[0])))},rotateY:function(t){je(jn,rn(Yr(t[0])))},rotateZ:function(t){Bn(jn,rn(Yr(t[0])))},rotate3d:function(t){ei(jn,rn(Yr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){sf(jn,rn(t[0].value),rn(t[1].value))},skewX:function(t){sf(jn,rn(t[0].value),0)},skewY:function(t){sf(jn,0,rn(t[0].value))},matrix:function(t){cn(jn,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){cn.apply(A,[jn].concat((0,k.Z)(t.map(function(e){return e.value}))))}},oA=Et(1,1,1),lA=gt(),Vp={translate:function(t,e){Ut.sceneGraphService.setLocalScale(t,oA,!1),Ut.sceneGraphService.setLocalEulerAngles(t,lA,void 0,void 0,!1),Ut.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Ut.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Up(r,t){if(r.length){if(r.length===1&&Vp[r[0].t]){Vp[r[0].t](t,r[0].d);return}for(var e=ge(aA),n=0;n<r.length;n++){var i=r[n],a=i.t,s=i.d,o=sA[a];o&&(o(s),og(e,e,jn))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var cA=function(){function r(){(0,N.Z)(this,r),this.parser=lM,this.mixer=mM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof gi?[]:i}},{key:"postProcessor",value:function(e){Up(e.parsedStyle.transform,e)}}])}(),uA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"postProcessor",value:function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===te.kPixels&&n[1].unit===te.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()}}])}(),hA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i.value}},{key:"postProcessor",value:function(e){if(e.parentNode){var n=e.parentNode,i=n.renderable,a=n.sortable;i&&n.dirty(),a&&(a.dirty=!0,a.dirtyReason=lc.Z_INDEX_CHANGED)}}}])}(),dA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.cx,a=i===void 0?0:i,s=e.cy,o=s===void 0?0:s,l=e.r,c=l===void 0?0:l;return{cx:a,cy:o,hwidth:c,hheight:c}}}])}(),fA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.cx,a=i===void 0?0:i,s=e.cy,o=s===void 0?0:s,l=e.rx,c=l===void 0?0:l,u=e.ry,h=u===void 0?0:u;return{cx:a,cy:o,hwidth:c,hheight:h}}}])}(),vA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){var n=e.x1,i=e.y1,a=e.x2,s=e.y2,o=Math.min(n,a),l=Math.max(n,a),c=Math.min(i,s),u=Math.max(i,s),h=l-o,d=u-c,f=h/2,v=d/2;return{cx:o+f,cy:c+v,hwidth:f,hheight:v}}}])}(),gA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){var n=e.d,i=n.rect,a=i.x,s=i.y,o=i.width,l=i.height,c=o/2,u=l/2;return{cx:a+c,cy:s+u,hwidth:c,hheight:u}}}])}(),pA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){if(e.points&&Gr(e.points.points)){var n=e.points.points,i=Math.min.apply(Math,(0,k.Z)(n.map(function(d){return d[0]}))),a=Math.max.apply(Math,(0,k.Z)(n.map(function(d){return d[0]}))),s=Math.min.apply(Math,(0,k.Z)(n.map(function(d){return d[1]}))),o=Math.max.apply(Math,(0,k.Z)(n.map(function(d){return d[1]}))),l=a-i,c=o-s,u=l/2,h=c/2;return{cx:i+u,cy:s+h,hwidth:u,hheight:h}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),mA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=e.src,c=e.width,u=c===void 0?0:c,h=e.height,d=h===void 0?0:h,f=u,v=d;return l&&!Ve(l)&&(f||(f=l.width,e.width=f),v||(v=l.height,e.height=v)),{cx:a+f/2,cy:o+v/2,hwidth:f/2,hheight:v/2}}}])}(),yA=function(){function r(t){(0,N.Z)(this,r),this.globalRuntime=t}return(0,T.Z)(r,[{key:"isReadyToMeasure",value:function(e,n){var i=e.text;return i}},{key:"update",value:function(e,n){var i,a=e.text,s=e.textAlign,o=s===void 0?"start":s,l=e.lineWidth,c=l===void 0?1:l,u=e.textBaseline,h=u===void 0?"alphabetic":u,d=e.dx,f=d===void 0?0:d,v=e.dy,g=v===void 0?0:v,p=e.x,y=p===void 0?0:p,b=e.y,w=b===void 0?0:b;if(!this.isReadyToMeasure(e,n))return e.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var O=(n==null||(i=n.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0?void 0:i.getConfig())||{},_=O.offscreenCanvas,F=this.globalRuntime.textService.measureText(a,e,_);e.metrics=F;var W=F.width,j=F.height,H=W/2,K=j/2,et=y+H;o==="center"||o==="middle"?et+=c/2-H:(o==="right"||o==="end")&&(et+=c-H*2);var rt=w-K;return h==="middle"?rt+=K:h==="top"||h==="hanging"?rt+=K*2:h==="alphabetic"||(h==="bottom"||h==="ideographic")&&(rt+=0),f&&(et+=f),g&&(rt+=g),{cx:et,cy:rt,hwidth:H,hheight:K}}}])}(),bA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),xA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=e.width,c=l===void 0?0:l,u=e.height,h=u===void 0?0:u;return{cx:a+c/2,cy:o+h/2,hwidth:c/2,hheight:h/2}}}])}();function G8(r){return!!r.type}var Ec=function(){function r(t){(0,N.Z)(this,r),this.eventPhase=r.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new gr,this.page=new gr,this.canvas=new gr,this.viewport=new gr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return(0,T.Z)(r,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(nn)}}])}(),Yp=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.client=new gr,e.movement=new gr,e.offset=new gr,e.global=new gr,e.screen=new gr,e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)}},{key:"initMouseEvent",value:function(){throw new Error(nn)}}])}(Ec),wc=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.width=0,e.height=0,e.isPrimary=!1,e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"getCoalescedEvents",value:function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Yp),of=function(r){function t(){return(0,N.Z)(this,t),(0,R.Z)(this,t,arguments)}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Yp),Kn=function(r){function t(e,n){var i;return(0,N.Z)(this,t),i=(0,R.Z)(this,t,[null]),i.type=e,i.detail=n==null?void 0:n.detail,Object.assign(i,n),i}return(0,C.Z)(t,r),(0,T.Z)(t)}(Ec),Hp=function(){function r(){(0,N.Z)(this,r),this.emitter=new L}return(0,T.Z)(r,[{key:"on",value:function(e,n,i){return this.addEventListener(e,n,i),this}},{key:"addEventListener",value:function(e,n,i){var a=!1,s=!1;if(Uo(i))a=i;else if(i){var o=i.capture;a=o===void 0?!1:o;var l=i.once;s=l===void 0?!1:l}a&&(e+="capture"),n=fe(n)?n:n.handleEvent;var c=fe(n)?void 0:n;return s?this.emitter.once(e,n,c):this.emitter.on(e,n,c),this}},{key:"off",value:function(e,n,i){return e?this.removeEventListener(e,n,i):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var e;(e=this.emitter)===null||e===void 0||e.removeAllListeners()}},{key:"removeEventListener",value:function(e,n,i){var a;if(!this.emitter)return this;var s=Uo(i)?i:i==null?void 0:i.capture;s&&(e+="capture"),n=fe(n)?n:(a=n)===null||a===void 0?void 0:a.handleEvent;var o=fe(n)?void 0:n;return this.emitter.off(e,n,o),this}},{key:"emit",value:function(e,n){this.dispatchEvent(new Kn(e,{detail:n}))}},{key:"dispatchEventToSelf",value:function(e){e.target||(e.target=this),e.currentTarget=this,this.emitter.emit(e.type,e)}},{key:"dispatchEvent",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0;if(i)return this.dispatchEventToSelf(e),!0;var a;if(this.document)a=this;else if(this.defaultView)a=this.defaultView;else{var s;a=(s=this.ownerDocument)===null||s===void 0?void 0:s.defaultView}if(a){if(e.manager=a.getEventService(),!e.manager)return!1;e.defaultPrevented=!1,e.path?e.path.length=0:e.page=[],n||(e.target=this),e.manager.dispatchEvent(e,e.type,n)}else this.dispatchEventToSelf(e);return!e.defaultPrevented}}])}(),On=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e.destroyed=!1,e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"textContent",get:function(){var n="";this.nodeName===_t.TEXT&&(n+=this.style.text);var i=(0,La.Z)(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===_t.TEXT?n+=s.nodeValue:n+=s.textContent}}catch(o){i.e(o)}finally{i.f()}return n},set:function(n){var i=this;this.childNodes.slice().forEach(function(a){i.removeChild(a)}),this.nodeName===_t.TEXT&&(this.style.text="".concat(n))}},{key:"getRootNode",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(n){throw new Error(nn)}},{key:"lookupNamespaceURI",value:function(n){throw new Error(nn)}},{key:"lookupPrefix",value:function(n){throw new Error(nn)}},{key:"normalize",value:function(){throw new Error(nn)}},{key:"isEqualNode",value:function(n){return this===n}},{key:"isSameNode",value:function(n){return this.isEqualNode(n)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(n){if(n===this)return 0;for(var i=n,a=this,s=[i],o=[a];(l=i.parentNode)!==null&&l!==void 0?l:a.parentNode;){var l;i=i.parentNode?(s.push(i.parentNode),i.parentNode):i,a=a.parentNode?(o.push(a.parentNode),a.parentNode):a}if(i!==a)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var c=s.length>o.length?s:o,u=c===s?o:s;if(c[c.length-u.length]===u[0])return c===s?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var h=c.length-u.length,d=u.length-1;d>=0;d--){var f=u[d],v=c[h+d];if(v!==f){var g=f.parentNode.childNodes;return g.indexOf(f)<g.indexOf(v)?u===s?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:c===s?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(n){return this.contains(n)}},{key:"contains",value:function(n){for(var i=n;i&&this!==i;)i=i.parentNode;return!!i}},{key:"getAncestor",value:function(n){for(var i=this;n>0&&i;)i=i.parentNode,n--;return i}},{key:"forEach",value:function(n){for(var i=[this];i.length>0;){var a=i.pop(),s=n(a);if(s===!1)break;for(var o=a.childNodes.length-1;o>=0;o--)i.push(a.childNodes[o])}}}],[{key:"isNode",value:function(n){return!!n.childNodes}}])}(Hp);On.DOCUMENT_POSITION_DISCONNECTED=1,On.DOCUMENT_POSITION_PRECEDING=2,On.DOCUMENT_POSITION_FOLLOWING=4,On.DOCUMENT_POSITION_CONTAINS=8,On.DOCUMENT_POSITION_CONTAINED_BY=16,On.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var EA=2048,wA=function(){function r(t,e){var n=this;(0,N.Z)(this,r),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Wt(),this.tmpVec3=gt(),this.onPointerDown=function(i){var a=n.createPointerEvent(i);if(n.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")n.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var s=a.button===2;n.dispatchEvent(a,s?"rightdown":"mousedown")}var o=n.trackingData(i.pointerId);o.pressTargetsByButton[i.button]=a.composedPath(),n.freeEvent(a)},this.onPointerUp=function(i){var a=nf.now(),s=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(s,"pointerup"),s.pointerType==="touch")n.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;n.dispatchEvent(s,o?"rightup":"mouseup")}var l=n.trackingData(i.pointerId),c=n.findMountedTarget(l.pressTargetsByButton[i.button]),u=c;if(c&&!s.composedPath().includes(c)){for(var h=c;h&&!s.composedPath().includes(h);){if(s.currentTarget=h,n.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")n.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var d=s.button===2;n.notifyTarget(s,d?"rightupoutside":"mouseupoutside")}On.isNode(h)&&(h=h.parentNode)}delete l.pressTargetsByButton[i.button],u=h}if(u){var f,v=n.clonePointerEvent(s,"click");v.target=u,v.path=[],l.clicksByButton[i.button]||(l.clicksByButton[i.button]={clickCount:0,target:v.target,timeStamp:a});var g=n.context.renderingContext.root.ownerDocument.defaultView,p=l.clicksByButton[i.button];p.target===v.target&&a-p.timeStamp<g.getConfig().dblClickSpeed?++p.clickCount:p.clickCount=1,p.target=v.target,p.timeStamp=a,v.detail=p.clickCount,(f=s.detail)!==null&&f!==void 0&&f.preventClick||(!n.context.config.useNativeClickEvent&&(v.pointerType==="mouse"||v.pointerType==="touch")&&n.dispatchEvent(v,"click"),n.dispatchEvent(v,"pointertap")),n.freeEvent(v)}n.freeEvent(s)},this.onPointerMove=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),s=a.pointerType==="mouse"||a.pointerType==="pen",o=n.trackingData(i.pointerId),l=n.findMountedTarget(o.overTargets);if(o.overTargets&&l!==a.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=n.createPointerEvent(i,c,l||void 0);if(n.dispatchEvent(u,"pointerout"),s&&n.dispatchEvent(u,"mouseout"),!a.composedPath().includes(l)){var h=n.createPointerEvent(i,"pointerleave",l||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&!a.composedPath().includes(h.target);)h.currentTarget=h.target,n.notifyTarget(h),s&&n.notifyTarget(h,"mouseleave"),On.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}n.freeEvent(u)}if(l!==a.target){var d=i.type==="mousemove"?"mouseover":"pointerover",f=n.clonePointerEvent(a,d);n.dispatchEvent(f,"pointerover"),s&&n.dispatchEvent(f,"mouseover");for(var v=l&&On.isNode(l)&&l.parentNode;v&&v!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&v!==a.target;)v=v.parentNode;var g=!v||v===(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);if(g){var p=n.clonePointerEvent(a,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==l&&p.target!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);)p.currentTarget=p.target,n.notifyTarget(p),s&&n.notifyTarget(p,"mouseenter"),On.isNode(p.target)&&(p.target=p.target.parentNode);n.freeEvent(p)}n.freeEvent(f)}n.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&n.dispatchEvent(a,"touchmove"),s&&(n.dispatchEvent(a,"mousemove"),n.cursor=n.getCursor(a.target)),o.overTargets=a.composedPath(),n.freeEvent(a)},this.onPointerOut=function(i){var a=n.trackingData(i.pointerId);if(a.overTargets){var s=i.pointerType==="mouse"||i.pointerType==="pen",o=n.findMountedTarget(a.overTargets),l=n.createPointerEvent(i,"pointerout",o||void 0);n.dispatchEvent(l),s&&n.dispatchEvent(l,"mouseout");var c=n.createPointerEvent(i,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),s&&n.notifyTarget(c,"mouseleave"),On.isNode(c.target)&&(c.target=c.target.parentNode);a.overTargets=null,n.freeEvent(l),n.freeEvent(c)}n.cursor=null},this.onPointerOver=function(i){var a=n.trackingData(i.pointerId),s=n.createPointerEvent(i),o=s.pointerType==="mouse"||s.pointerType==="pen";n.dispatchEvent(s,"pointerover"),o&&n.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(n.cursor=n.getCursor(s.target));var l=n.clonePointerEvent(s,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),o&&n.notifyTarget(l,"mouseenter"),On.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=s.composedPath(),n.freeEvent(s),n.freeEvent(l)},this.onPointerUpOutside=function(i){var a=n.trackingData(i.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[i.button]),o=n.createPointerEvent(i);if(s){for(var l=s;l;)o.currentTarget=l,n.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch"||(o.pointerType==="mouse"||o.pointerType==="pen")&&n.notifyTarget(o,o.button===2?"rightupoutside":"mouseupoutside"),On.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[i.button]}n.freeEvent(o)},this.onWheel=function(i){var a=n.createWheelEvent(i);n.dispatchEvent(a),n.freeEvent(a)},this.onClick=function(i){if(n.context.config.useNativeClickEvent){var a=n.createPointerEvent(i);n.dispatchEvent(a),n.freeEvent(a)}},this.onPointerCancel=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(a),n.freeEvent(a)},this.globalRuntime=t,this.context=e}return(0,T.Z)(r,[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var e=this.context.contextService.getBoundingClientRect(),n=1,i=1,a=this.context.contextService.getDomElement();if(a&&e){var s=a.offsetWidth,o=a.offsetHeight;s&&o&&(n=e.width/s,i=e.height/o)}return{scaleX:n,scaleY:i,bbox:e}}},{key:"client2Viewport",value:function(e){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new gr((e.x-((s==null?void 0:s.left)||0))/i,(e.y-((s==null?void 0:s.top)||0))/a)}},{key:"viewport2Client",value:function(e){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new gr((e.x+((s==null?void 0:s.left)||0))*i,(e.y+((s==null?void 0:s.top)||0))*a)}},{key:"viewport2Canvas",value:function(e){var n=e.x,i=e.y,a=this.rootTarget.defaultView,s=a.getCamera(),o=this.context.config,l=o.width,c=o.height,u=s.getPerspectiveInverse(),h=s.getWorldTransform(),d=Jt(this.tmpMatrix,h,u),f=zt(this.tmpVec3,n/l*2-1,(1-i/c)*2-1,0);return re(f,f,d),new gr(f[0],f[1])}},{key:"canvas2Viewport",value:function(e){var n=this.rootTarget.defaultView,i=n.getCamera(),a=i.getPerspective(),s=i.getViewTransform(),o=Jt(this.tmpMatrix,a,s),l=zt(this.tmpVec3,e.x,e.y,0);re(this.tmpVec3,this.tmpVec3,o);var c=this.context.config,u=c.width,h=c.height;return new gr((l[0]+1)/2*u,(1-(l[1]+1)/2)*h)}},{key:"setPickHandler",value:function(e){this.pickHandler=e}},{key:"addEventMapping",value:function(e,n){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:n,priority:0}),this.mappingTable[e].sort(function(i,a){return i.priority-a.priority})}},{key:"mapEvent",value:function(e){if(this.rootTarget){var n=this.mappingTable[e.type];if(n)for(var i=0,a=n.length;i<a;i++)n[i].fn(e);else console.warn("[EventService]: Event mapping not defined for ".concat(e.type))}}},{key:"dispatchEvent",value:function(e,n,i){if(!i)e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,n);else{e.eventPhase=e.AT_TARGET;var a=this.rootTarget.defaultView||null;e.currentTarget=a,this.notifyListeners(e,n)}}},{key:"propagate",value:function(e,n){if(e.target){var i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(var a=i.length-1;a>=1;a--)if(e.currentTarget=i[a],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,n),!(e.propagationStopped||e.propagationImmediatelyStopped)){var s=i.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var o=s+1;o<i.length;o++)if(e.currentTarget=i[o],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(e){var n=[e],i=this.rootTarget.defaultView||null;if(i&&i===e)return n.unshift(i.document),n;for(var a=0;a<EA&&e!==this.rootTarget;a++)On.isNode(e)&&e.parentNode&&(n.push(e.parentNode),e=e.parentNode);return i&&n.push(i),n}},{key:"hitTest",value:function(e){var n=e.viewportX,i=e.viewportY,a=this.context.config,s=a.width,o=a.height,l=a.disableHitTesting;return n<0||i<0||n>s||i>o?null:!l&&this.pickHandler(e)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(e,n){var i,a=n==null?void 0:n.target;if((i=a)!==null&&i!==void 0&&i.shadowRoot&&(a=n.composedPath()[0]),a){if(a===e)return!0;if(e&&e.contains)return e.contains(a)}return n!=null&&n.composedPath?n.composedPath().indexOf(e)>-1:!1}},{key:"getExistedHTML",value:function(e){if(e.nativeEvent.composedPath)for(var n=0,i=e.nativeEvent.composedPath();n<i.length;n++){var a=i[n],s=this.nativeHTMLMap.get(a);if(s)return s}return null}},{key:"pickTarget",value:function(e){return this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})}},{key:"createPointerEvent",value:function(e,n,i,a){var s=this.allocateEvent(wc);this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e;var o=this.getExistedHTML(s),l=this.context.contextService.getDomElement();return s.target=i!=null?i:o||this.isNativeEventFromCanvas(l,s.nativeEvent)&&this.pickTarget(s)||a,typeof n=="string"&&(s.type=n),s}},{key:"createWheelEvent",value:function(e){var n=this.allocateEvent(of);this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e;var i=this.getExistedHTML(n),a=this.context.contextService.getDomElement();return n.target=i||this.isNativeEventFromCanvas(a,n.nativeEvent)&&this.pickTarget(n),n}},{key:"trackingData",value:function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}},{key:"cloneWheelEvent",value:function(e){var n=this.allocateEvent(of);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=e.type,n}},{key:"clonePointerEvent",value:function(e,n){var i=this.allocateEvent(wc);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=n!=null?n:i.type,i}},{key:"copyPointerData",value:function(e,n){n.pointerId=e.pointerId,n.width=e.width,n.height=e.height,n.isPrimary=e.isPrimary,n.pointerType=e.pointerType,n.pressure=e.pressure,n.tangentialPressure=e.tangentialPressure,n.tiltX=e.tiltX,n.tiltY=e.tiltY,n.twist=e.twist}},{key:"copyMouseData",value:function(e,n){n.altKey=e.altKey,n.button=e.button,n.buttons=e.buttons,n.ctrlKey=e.ctrlKey,n.metaKey=e.metaKey,n.shiftKey=e.shiftKey,n.client.copyFrom(e.client),n.movement.copyFrom(e.movement),n.canvas.copyFrom(e.canvas),n.screen.copyFrom(e.screen),n.global.copyFrom(e.global),n.offset.copyFrom(e.offset)}},{key:"copyWheelData",value:function(e,n){n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ}},{key:"copyData",value:function(e,n){n.isTrusted=e.isTrusted,n.timeStamp=nf.now(),n.type=e.type,n.detail=e.detail,n.view=e.view,n.page.copyFrom(e.page),n.viewport.copyFrom(e.viewport)}},{key:"allocateEvent",value:function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var n=this.eventPool.get(e).pop()||new e(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=e.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(e)}},{key:"notifyTarget",value:function(e,n){n=n!=null?n:e.type;var i=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(e,i),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,n)}},{key:"notifyListeners",value:function(e,n){var i=e.currentTarget.emitter,a=i._events[n];if(a)if("fn"in a)a.once&&i.removeListener(n,a.fn,void 0,!0),a.fn.call(e.currentTarget||a.context,e);else for(var s=0;s<a.length&&!e.propagationImmediatelyStopped;s++)a[s].once&&i.removeListener(n,a[s].fn,void 0,!0),a[s].fn.call(e.currentTarget||a[s].context,e)}},{key:"findMountedTarget",value:function(e){if(!e)return null;for(var n=e[e.length-1],i=e.length-2;i>=0;i--){var a=e[i];if(a===this.rootTarget||On.isNode(a)&&a.parentNode===n)n=e[i];else break}return n}},{key:"getCursor",value:function(e){for(var n=e;n;){var i=FM(n)&&n.getAttribute("cursor");if(i)return i;n=On.isNode(n)&&n.parentNode}}}])}(),lf=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"getOrCreateCanvas",value:function(e,n){if(this.canvas)return this.canvas;if(e||Ut.offscreenCanvas)this.canvas=e||Ut.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,D.Z)({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,D.Z)({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",(0,D.Z)({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(e,n){return this.context?this.context:(this.getOrCreateCanvas(e,n),this.context)}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(e){}try{return document.createElement("canvas")}catch(e){}return null}}])}(),lo=function(r){return r[r.CAMERA_CHANGED=0]="CAMERA_CHANGED",r[r.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",r[r.NONE=2]="NONE",r}({}),SA=function(){function r(t,e){(0,N.Z)(this,r),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Br,initAsync:new tA,dirtycheck:new af,cull:new af,beginFrame:new Br,beforeRender:new Br,render:new Br,afterRender:new Br,endFrame:new Br,destroy:new Br,pick:new eA,pickSync:new af,pointerDown:new Br,pointerUp:new Br,pointerMove:new Br,pointerOut:new Br,pointerOver:new Br,pointerWheel:new Br,pointerCancel:new Br,click:new Br},this.globalRuntime=t,this.context=e}return(0,T.Z)(r,[{key:"init",value:function(e){var n=this,i=(0,D.Z)((0,D.Z)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(a){a.apply(i,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,e()):this.hooks.initAsync.promise().then(function(){n.inited=!0,e()}).catch(function(a){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){var e=this.context.config.renderer,n=e.getConfig(),i=n.enableDirtyRectangleRendering;return!i||this.context.renderingContext.renderReasons.has(lo.CAMERA_CHANGED)}},{key:"render",value:function(e,n,i){var a=this,s=e.getConfig(),o=this.context.renderingContext;if(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.globalRuntime.sceneGraphService.notifyMutationObservers(e),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var l=o.renderReasons.size===1&&o.renderReasons.has(lo.CAMERA_CHANGED),c=!s.disableRenderHooks||!l;c&&this.renderDisplayObject(o.root,s,o),this.hooks.beginFrame.call(n),c&&o.renderListCurrentFrame.forEach(function(u){a.hooks.beforeRender.call(u),a.hooks.render.call(u),a.hooks.afterRender.call(u)}),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),i()}}},{key:"renderDisplayObject",value:function(e,n,i){var a=this,s=n.renderer.getConfig(),o=s.enableDirtyCheck,l=s.enableCulling;function c(g){var p=g.renderable,y=g.sortable,b=o?p.dirty||i.dirtyRectangleRenderingDisabled?g:null:g,w=null;b&&(w=l?a.hooks.cull.call(b,a.context.camera):b,w&&(a.stats.rendered+=1,i.renderListCurrentFrame.push(w))),g.dirty(!1),y.renderOrder=a.zIndexCounter,a.zIndexCounter+=1,a.stats.total+=1,y.dirty&&(a.sort(g,y),y.dirty=!1,y.dirtyChildren=[],y.dirtyReason=void 0)}for(var u=[e];u.length>0;){var h,d=u.pop();c(d);for(var f=((h=d.sortable)===null||h===void 0||(h=h.sorted)===null||h===void 0?void 0:h.length)>0?d.sortable.sorted:d.childNodes,v=f.length-1;v>=0;v--)u.push(f[v])}}},{key:"sort",value:function(e,n){var i,a;(n==null||(i=n.sorted)===null||i===void 0?void 0:i.length)>0&&n.dirtyReason!==lc.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(s){var o=n.sorted.indexOf(s);o>-1&&n.sorted.splice(o,1);var l=e.childNodes.indexOf(s);if(l>-1)if(n.sorted.length===0)n.sorted.push(s);else{var c=zM(n.sorted,s);n.sorted.splice(c,0,s)}}):n.sorted=e.childNodes.slice().sort(Dp),((a=n.sorted)===null||a===void 0?void 0:a.length)>0&&e.childNodes.filter(function(s){return s.parsedStyle.zIndex}).length===0&&(n.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearMutationObserverData()}},{key:"dirty",value:function(){this.context.renderingContext.renderReasons.add(lo.DISPLAY_OBJECT_CHANGED)}}])}(),MA=/\[\s*(.*)=(.*)\s*\]/,AA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"selectOne",value:function(e,n){var i=this;if(e.startsWith("."))return n.find(function(l){return((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.find(function(l){return l.id===i.getIdOrClassname(e)});if(e.startsWith("[")){var a=this.getAttribute(e),s=a.name,o=a.value;return s?n.find(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):null}return n.find(function(l){return n!==l&&l.nodeName===e})}},{key:"selectAll",value:function(e,n){var i=this;if(e.startsWith("."))return n.findAll(function(l){return n!==l&&((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.findAll(function(l){return n!==l&&l.id===i.getIdOrClassname(e)});if(e.startsWith("[")){var a=this.getAttribute(e),s=a.name,o=a.value;return s?n.findAll(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):[]}return n.findAll(function(l){return n!==l&&l.nodeName===e})}},{key:"is",value:function(e,n){if(e.startsWith("."))return n.className===this.getIdOrClassname(e);if(e.startsWith("#"))return n.id===this.getIdOrClassname(e);if(e.startsWith("[")){var i=this.getAttribute(e),a=i.name,s=i.value;return a==="name"?n.name===s:this.attributeToString(n,a)===s}return n.nodeName===e}},{key:"getIdOrClassname",value:function(e){return e.substring(1)}},{key:"getAttribute",value:function(e){var n=e.match(MA),i="",a="";return n&&n.length>2&&(i=n[1].replace(/"/g,""),a=n[2].replace(/"/g,"")),{name:i,value:a}}},{key:"attributeToString",value:function(e,n){if(!e.getAttribute)return"";var i=e.getAttribute(n);return ye(i)?"":i.toString?i.toString():""}}])}(),Ie=function(r){return r.ATTR_MODIFIED="DOMAttrModified",r.INSERTED="DOMNodeInserted",r.MOUNTED="DOMNodeInsertedIntoDocument",r.REMOVED="removed",r.UNMOUNTED="DOMNodeRemovedFromDocument",r.REPARENT="reparent",r.DESTROY="destroy",r.BOUNDS_CHANGED="bounds-changed",r.CULLED="culled",r}({}),Qi=function(r){function t(e,n,i,a,s,o,l,c){var u;return(0,N.Z)(this,t),u=(0,R.Z)(this,t,[null]),u.relatedNode=n,u.prevValue=i,u.newValue=a,u.attrName=s,u.attrChange=o,u.prevParsedValue=l,u.newParsedValue=c,u.type=e,u}return(0,C.Z)(t,r),(0,T.Z)(t)}(Ec);Qi.ADDITION=2,Qi.MODIFICATION=1,Qi.REMOVAL=3;var TA=new Qi(Ie.REPARENT,null,"","","",0,"",""),OA=Md(),Sc=gt(),CA=Et(1,1,1),NA=Wt(),kA=Md(),Es=gt(),PA=Wt(),ws=Xn(),RA=gt(),LA=Xn(),DA=gt(),rl=gt(),Ss=gt(),Mc=Wt(),Xp=Xn(),Kp=Xn(),Ac=Xn(),_A=function(){function r(t){(0,N.Z)(this,r),this.mutationsMap=new Map,this.displayObjectDependencyMap=new WeakMap,this.runtime=t}return(0,T.Z)(r,[{key:"matches",value:function(e,n){return this.runtime.sceneGraphSelector.is(e,n)}},{key:"querySelector",value:function(e,n){return this.runtime.sceneGraphSelector.selectOne(e,n)}},{key:"querySelectorAll",value:function(e,n){return this.runtime.sceneGraphSelector.selectAll(e,n)}},{key:"attach",value:function(e,n,i){var a,s=!1;e.parentNode&&(s=e.parentNode!==n,this.detach(e));var o=e.nodeName===_t.FRAGMENT,l=xc(n);e.parentNode=n;var c=o?e.childNodes:[e];ie(i)?c.forEach(function(g){n.childNodes.splice(i,0,g),g.parentNode=n}):c.forEach(function(g){n.childNodes.push(g),g.parentNode=n});var u=n,h=u.sortable;if((h!=null&&(a=h.sorted)!==null&&a!==void 0&&a.length||h.dirty||e.parsedStyle.zIndex)&&(h.dirtyChildren.indexOf(e)===-1&&h.dirtyChildren.push(e),h.dirty=!0,h.dirtyReason=lc.ADDED),!l){if(o)this.dirtyFragment(e);else{var d=e.transformable;d&&this.dirtyWorldTransform(e,d)}if(s){var f,v=((f=n.ownerDocument)===null||f===void 0||(f=f.defaultView)===null||f===void 0||(f=f.getConfig())===null||f===void 0||(f=f.future)===null||f===void 0?void 0:f.experimentalCancelEventPropagation)===!0;e.dispatchEvent(TA,v,v)}}}},{key:"detach",value:function(e){var n,i;if(e.parentNode){var a=e.transformable,s=e.parentNode,o=s.sortable;(o!=null&&(n=o.sorted)!==null&&n!==void 0&&n.length||(i=e.style)!==null&&i!==void 0&&i.zIndex)&&(o.dirtyChildren.indexOf(e)===-1&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=lc.REMOVED);var l=e.parentNode.childNodes.indexOf(e);l>-1&&e.parentNode.childNodes.splice(l,1),a&&this.dirtyWorldTransform(e,a),e.parentNode=null}}},{key:"getLocalPosition",value:function(e){return e.transformable.localPosition}},{key:"getLocalRotation",value:function(e){return e.transformable.localRotation}},{key:"getLocalScale",value:function(e){return e.transformable.localScale}},{key:"getLocalSkew",value:function(e){return e.transformable.localSkew}},{key:"getLocalTransform",value:function(e){var n=e.transformable;return Kg(n),n.localTransform}},{key:"setLocalPosition",value:function(e,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=e.transformable;rl[0]=n[0],rl[1]=n[1],rl[2]=(i=n[2])!==null&&i!==void 0?i:0,!ua(s.localPosition,rl)&&(Pt(s.localPosition,rl),a&&this.dirtyLocalTransform(e,s))}},{key:"translateLocal",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=Et(n,i,a));var s=e.transformable;ua(n,Sc)||(ur(n,n,s.localRotation),Vt(s.localPosition,s.localPosition,n),this.dirtyLocalTransform(e,s))}},{key:"setLocalRotation",value:function(e,n,i,a,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof n=="number"&&(n=cg(ws,n,i,a,s));var l=e.transformable;ql(l.localRotation,n),o&&this.dirtyLocalTransform(e,l)}},{key:"rotateLocal",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=Et(n,i,a));var s=e.transformable;Ql(Kp,n[0],n[1],n[2]),ug(s.localRotation,s.localRotation,Kp),this.dirtyLocalTransform(e,s)}},{key:"setLocalScale",value:function(e,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=e.transformable;zt(Es,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:s.localScale[2]),!ua(Es,s.localScale)&&(Pt(s.localScale,Es),a&&this.dirtyLocalTransform(e,s))}},{key:"scaleLocal",value:function(e,n){var i,a=e.transformable;Ee(a.localScale,a.localScale,zt(Es,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:1)),this.dirtyLocalTransform(e,a)}},{key:"setLocalSkew",value:function(e,n,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof n=="number"&&(n=Sw(kA,n,i));var s=e.transformable;ww(s.localSkew,n),a&&this.dirtyLocalTransform(e,s)}},{key:"setLocalEulerAngles",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof n=="number"&&(n=Et(n,i,a));var o=e.transformable;Ql(o.localRotation,n[0],n[1],n[2]),s&&this.dirtyLocalTransform(e,o)}},{key:"setLocalTransform",value:function(e,n){var i=Tn(RA,n),a=Js(LA,n),s=Ca(DA,n);this.setLocalScale(e,s,!1),this.setLocalPosition(e,i,!1),this.setLocalRotation(e,a,void 0,void 0,void 0,!1),this.dirtyLocalTransform(e,e.transformable)}},{key:"resetLocalTransform",value:function(e){this.setLocalScale(e,CA,!1),this.setLocalPosition(e,Sc,!1),this.setLocalEulerAngles(e,Sc,void 0,void 0,!1),this.setLocalSkew(e,OA,void 0,!1),this.dirtyLocalTransform(e,e.transformable)}},{key:"getPosition",value:function(e){var n=e.transformable;return Tn(n.position,this.getWorldTransform(e,n))}},{key:"getRotation",value:function(e){var n=e.transformable;return Js(n.rotation,this.getWorldTransform(e,n))}},{key:"getScale",value:function(e){var n=e.transformable;return Ca(n.scaling,this.getWorldTransform(e,n))}},{key:"getOrigin",value:function(e){return e.getGeometryBounds(),e.transformable.origin}},{key:"getWorldTransform",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.transformable;return!n.localDirtyFlag&&!n.dirtyFlag||(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.internalUpdateTransform(e)),n.worldTransform}},{key:"setPosition",value:function(e,n){var i,a=e.transformable;if(Ss[0]=n[0],Ss[1]=n[1],Ss[2]=(i=n[2])!==null&&i!==void 0?i:0,!ua(this.getPosition(e),Ss)){if(Pt(a.position,Ss),e.parentNode===null||!e.parentNode.transformable)Pt(a.localPosition,Ss);else{var s=e.parentNode.transformable;we(Mc,s.worldTransform),Ze(Mc,Mc),re(a.localPosition,Ss,Mc)}this.dirtyLocalTransform(e,a)}}},{key:"translate",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=zt(Es,n,i,a)),!ua(n,Sc)&&(Vt(Es,this.getPosition(e),n),this.setPosition(e,Es))}},{key:"setRotation",value:function(e,n,i,a,s){var o=e.transformable;if(typeof n=="number"&&(n=bw(n,i,a,s)),e.parentNode===null||!e.parentNode.transformable)this.setLocalRotation(e,n);else{var l=this.getRotation(e.parentNode);ql(ws,l),Sd(ws,ws),ka(o.localRotation,ws,n),Jl(o.localRotation,o.localRotation),this.dirtyLocalTransform(e,o)}}},{key:"rotate",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=Et(n,i,a));var s=e.transformable;if(e.parentNode===null||!e.parentNode.transformable)this.rotateLocal(e,n);else{var o=ws;Ql(o,n[0],n[1],n[2]);var l=this.getRotation(e),c=this.getRotation(e.parentNode);ql(Ac,c),Sd(Ac,Ac),ka(o,Ac,o),ka(s.localRotation,o,l),Jl(s.localRotation,s.localRotation),this.dirtyLocalTransform(e,s)}}},{key:"setOrigin",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=[n,i,a]);var s=e.transformable;if(!(n[0]===s.origin[0]&&n[1]===s.origin[1]&&n[2]===s.origin[2])){var o=s.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtyLocalTransform(e,s)}}},{key:"setEulerAngles",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=Et(n,i,a));var s=e.transformable;if(e.parentNode===null||!e.parentNode.transformable)this.setLocalEulerAngles(e,n);else{Ql(s.localRotation,n[0],n[1],n[2]);var o=this.getRotation(e.parentNode);ql(Xp,Sd(ws,o)),ug(s.localRotation,s.localRotation,Xp),this.dirtyLocalTransform(e,s)}}},{key:"getGeometryBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=e,a=i.geometry;a.dirty&&Ut.styleValueRegistry.updateGeometry(e);var s=n?a.renderBounds:a.contentBounds||null;return s||new gn}},{key:"getTransformedGeometryBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0,a=this.getGeometryBounds(e,n);if(!gn.isEmpty(a)){var s=i||new gn;return s.setFromTransformedAABB(a,this.getWorldTransform(e)),s}return null}},{key:"getBounds",value:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=e,s=a.renderable;if(!s.boundsDirty&&!i&&s.bounds)return s.bounds;if(!s.renderBoundsDirty&&i&&s.renderBounds)return s.renderBounds;var o=i?s.renderBounds:s.bounds,l=this.getTransformedGeometryBounds(e,i,o),c=e.childNodes;if(c.forEach(function(d){var f=n.getBounds(d,i);f&&(l?l.add(f):(l=o||new gn,l.update(f.center,f.halfExtents)))}),l||(l=new gn),i){var u=_p(e);if(u){var h=u.parsedStyle.clipPath.getBounds(i);l?h&&(l=h.intersection(l)):l.update(h.center,h.halfExtents)}}return i?(s.renderBounds=l,s.renderBoundsDirty=!1):(s.bounds=l,s.boundsDirty=!1),l}},{key:"getLocalBounds",value:function(e){if(e.parentNode){var n=NA;e.parentNode.transformable&&(n=Ze(PA,this.getWorldTransform(e.parentNode)));var i=this.getBounds(e);if(!gn.isEmpty(i)){var a=new gn;return a.setFromTransformedAABB(i,n),a}}return this.getBounds(e)}},{key:"getBoundingClientRect",value:function(e){var n,i,a=this.getGeometryBounds(e);gn.isEmpty(a)||(i=new gn,i.setFromTransformedAABB(a,this.getWorldTransform(e)));var s=(n=e.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0?void 0:n.getContextService().getBoundingClientRect();if(i){var o=i.getMin(),l=(0,P.Z)(o,2),c=l[0],u=l[1],h=i.getMax(),d=(0,P.Z)(h,2),f=d[0],v=d[1];return new no(c+((s==null?void 0:s.left)||0),u+((s==null?void 0:s.top)||0),f-c,v-u)}return new no((s==null?void 0:s.left)||0,(s==null?void 0:s.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(e){var n,i=(n=e.parentNode)===null||n===void 0?void 0:n.transformable;Kg(e.transformable),J2(e.transformable,i)}},{key:"internalUpdateElement",value:function(e,n){var i,a,s,o,l=((i=e.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0,c=n[n.length-1],u=(c==null?void 0:c.transformDirty)||((a=e.transformable)===null||a===void 0?void 0:a.localDirtyFlag);if(e.transformable){var h;(h=e.transformable).dirtyFlag||(h.dirtyFlag=u)}if(this.internalUpdateTransform(e),u){var d;(d=e.dirty)===null||d===void 0||d.call(e,!0,!0)}var f=((s=e.renderable)===null||s===void 0?void 0:s.boundsDirty)||((o=e.renderable)===null||o===void 0?void 0:o.renderBoundsDirty);if((u||f)&&(c==null?void 0:c.shapeUpdated)===!1&&l)for(var v=n.length-1;v>=0;){var g,p,y=n[v];if(y.shapeUpdated)break;(g=(p=y.node).dirty)===null||g===void 0||g.call(p,!0,!0),y.shapeUpdated=!0,v-=1}return u}},{key:"syncHierarchy",value:function(e){for(var n,i,a=[e],s=e.parentNode?[{node:e.parentNode,transformDirty:((n=e.parentNode.transformable)===null||n===void 0?void 0:n.localDirtyFlag)||((i=e.parentNode.transformable)===null||i===void 0?void 0:i.dirtyFlag),shapeUpdated:!1}]:[];a.length>0;){for(var o=a.pop(),l=s[s.length-1];s.length>0&&o.parentNode!==l.node;)l=s.pop();var c=this.internalUpdateElement(o,s);if(o.childNodes.length>0){for(var u=o.childNodes.length-1;u>=0;u--)a.push(o.childNodes[u]);s.push({node:o,transformDirty:c,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(e,n){xc(e)||n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtyWorldTransform(e,n))}},{key:"dirtyWorldTransform",value:function(e,n){this.dirtyWorldInternal(e,n),this.dirtyToRoot(e,!0)}},{key:"dirtyWorldInternal",value:function(e,n){var i,a=this,s=((i=e.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0;n.dirtyFlag||(n.dirtyFlag=!0,e.dirty(!0,!0),s||e.childNodes.forEach(function(o){var l=o.transformable;a.dirtyWorldInternal(o,l)}))}},{key:"dirtyToRoot",value:function(e){for(var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=e,s=((n=e.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig())===null||n===void 0||(n=n.future)===null||n===void 0?void 0:n.experimentalAttributeUpdateOptimization)===!0;a;){var o,l;if((o=(l=a).dirty)===null||o===void 0||o.call(l,!0,!0),s)break;a=a.parentNode}i&&e.forEach(function(u){var h;(h=u.dirty)===null||h===void 0||h.call(u,!0,!0)}),this.informDependentDisplayObjects(e);var c=this.mutationsMap.get(e);c?c._boundsChangeData={affectChildren:c._boundsChangeData.affectChildren||i}:(c={type:"attributes",target:e,_boundsChangeData:{affectChildren:i}},this.mutationsMap.set(e,c))}},{key:"dirtyFragment",value:function(e){var n,i,a=e.transformable;a&&(a.dirtyFlag=!0,a.localDirtyFlag=!0),(n=(i=e).dirty)===null||n===void 0||n.call(i,!0,!0);for(var s=e.childNodes.length,o=0;o<s;o++)this.dirtyFragment(e.childNodes[o])}},{key:"notifyMutationObservers",value:function(e){var n=new Kn(Ie.BOUNDS_CHANGED,{detail:Array.from(this.mutationsMap.values())});e.dispatchEvent(n,!0,!0),this.clearMutationObserverData()}},{key:"clearMutationObserverData",value:function(){this.mutationsMap.clear()}},{key:"updateDisplayObjectDependency",value:function(e,n,i,a){if(n&&n!==i){var s=this.displayObjectDependencyMap.get(n);if(s&&s[e]){var o=s[e].indexOf(a);s[e].splice(o,1)}}if(i){var l=this.displayObjectDependencyMap.get(i);l||(this.displayObjectDependencyMap.set(i,{}),l=this.displayObjectDependencyMap.get(i)),l[e]||(l[e]=[]),l[e].push(a)}}},{key:"informDependentDisplayObjects",value:function(e){var n,i=this,a=this.displayObjectDependencyMap.get(e);if(a){var s=(n=e.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig())===null||n===void 0||(n=n.future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation;Object.keys(a).forEach(function(o){a[o].forEach(function(l){i.dirtyToRoot(l,!0),l.dispatchEvent(new Qi(Ie.ATTR_MODIFIED,l,i,i,o,Qi.MODIFICATION,i,i),s,s),l.isCustomElement&&l.isConnected&&l.attributeChangedCallback&&l.attributeChangedCallback(o,i,i)})})}}}])}(),Qp=function(){function r(t){if((0,N.Z)(this,r),t<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=t,this.cache=new Map}return(0,T.Z)(r,[{key:"get",value:function(e){if(this.cache.has(e)){var n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}}},{key:"put",value:function(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.capacity){var i=this.cache.keys().next().value;this.cache.delete(i)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Ms={MetricsString:"|\xC9q\xC5",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},qp=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,IA=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,BA=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,FA=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,zA=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,jA=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,ZA=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,WA=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,GA=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,VA=new RegExp("".concat(IA.source,"|").concat(FA.source,"|").concat(jA.source,"|").concat(WA.source)),UA=new RegExp("".concat(BA.source,"|").concat(zA.source,"|").concat(ZA.source,"|").concat(GA.source)),YA=function(){function r(t){var e=this;(0,N.Z)(this,r),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(n,i){return e.isBreakingSpace(i)?!1:!!(n&&(UA.exec(i)||VA.exec(n)))},this.trimByKinsokuShorui=function(n){var i=(0,k.Z)(n),a=i[i.length-2];if(!a)return n;var s=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=s+i[i.length-1],i},this.runtime=t,this.charWidthCache=new Qp(100)}return(0,T.Z)(r,[{key:"measureFont",value:function(e,n){if(this.fontMetricsCache[e])return this.fontMetricsCache[e];var i={ascent:0,descent:0,fontSize:0},a=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),s=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});s.font=e;var o=Ms.MetricsString+Ms.BaselineSymbol,l=Math.ceil(s.measureText(o).width),c=Math.ceil(s.measureText(Ms.BaselineSymbol).width),u=Ms.HeightMultiplier*c;c=c*Ms.BaselineMultiplier|0,a.width=l,a.height=u,s.fillStyle="#f00",s.fillRect(0,0,l,u),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(o,0,c);var h=s.getImageData(0,0,l||1,u||1).data,d=h.length,f=l*4,v=0,g=0,p=!1;for(v=0;v<c;++v){for(var y=0;y<f;y+=4)if(h[g+y]!==255){p=!0;break}if(!p)g+=f;else break}for(i.ascent=c-v,g=d-f,p=!1,v=u;v>c;--v){for(var b=0;b<f;b+=4)if(h[g+b]!==255){p=!0;break}if(!p)g-=f;else break}return i.descent=v-c,i.fontSize=i.ascent+i.descent,this.fontMetricsCache[e]=i,i}},{key:"measureText",value:function(e,n,i){var a=n.fontSize,s=a===void 0?16:a,o=n.wordWrap,l=o===void 0?!1:o,c=n.lineHeight,u=n.lineWidth,h=u===void 0?1:u,d=n.textBaseline,f=d===void 0?"alphabetic":d,v=n.textAlign,g=v===void 0?"start":v,p=n.letterSpacing,y=p===void 0?0:p,b=n.textPath;n.textPathSide,n.textPathStartOffset;var w=n.leading,O=w===void 0?0:w,_=Gp(n),F=this.measureFont(_,i);F.fontSize===0&&(F.fontSize=s,F.ascent=s);var W=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);W.font=_,n.isOverflowing=!1;var j=l?this.wordWrap(e,n,i):e,H=j.split(/(?:\r\n|\r|\n)/),K=new Array(H.length),et=0;if(b){b.getTotalLength();for(var rt=0;rt<H.length;rt++)W.measureText(H[rt]).width+(H[rt].length-1)*y}else{for(var lt=0;lt<H.length;lt++){var ht=W.measureText(H[lt]).width+(H[lt].length-1)*y;K[lt]=ht,et=Math.max(et,ht)}var yt=et+h,Nt=c||F.fontSize+h,Ct=Math.max(Nt,F.fontSize+h)+(H.length-1)*(Nt+O);Nt+=O;var pt=0;return f==="middle"?pt=-Ct/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?pt=-Ct:(f==="top"||f==="hanging")&&(pt=0),{font:_,width:yt,height:Ct,lines:H,lineWidths:K,lineHeight:Nt,maxLineWidth:et,fontProperties:F,lineMetrics:K.map(function(xt,kt){var jt=0;return g==="center"||g==="middle"?jt-=xt/2:(g==="right"||g==="end")&&(jt-=xt),new no(jt-h/2,pt+kt*Nt,xt+h,Nt)})}}}},{key:"wordWrap",value:function(e,n,i){var a=this,s=Array.from(e);if(s.length===0)return"";var o=this,l=n.wordWrapWidth,c=l===void 0?0:l,u=n.letterSpacing,h=u===void 0?0:u,d=n.maxLines,f=d===void 0?1/0:d,v=n.textOverflow,g=this.runtime.offscreenCanvasCreator.getOrCreateContext(i),p=c+h,y="";v==="ellipsis"?y="...":v&&v!=="clip"&&(y=v);var b=[""],w=0,O=0,_=-1,F=Gp(n),W=this.charWidthCache.get(F);W||(W=new Qp(500),this.charWidthCache.put(F,W));var j=function(xt){return a.getFromCache(xt,h,W,g)},H=j(y);function K(pt,xt,kt,jt){for(;j(pt)<jt&&xt<s.length-1&&!o.isNewline(s[xt+1]);)xt+=1,pt+=s[xt];for(;j(pt)>jt&&xt>=kt;)xt-=1,pt=pt.slice(0,-1);return{lineTxt:pt,txtLastCharIndex:xt}}function et(pt,xt){if(!(H<=0||H>p)){if(!b[pt]){b[pt]=y;return}var kt=K(b[pt],xt,_+1,p-H);b[pt]=kt.lineTxt+y}}for(var rt=0;rt<s.length;rt++){var lt=s[rt],ht=s[rt-1],yt=s[rt+1],Nt=j(lt);if(this.isNewline(lt)){if(w+1>=f){rt<s.length-1&&et(w,rt-1),n.isOverflowing=!0;break}_=rt-1,w+=1,O=0,b[w]="";continue}if(Nt>p){et(w,rt-1),n.isOverflowing=!0;break}if(O>0&&O+Nt>p){var Ct=K(b[w],rt-1,_+1,p);if(Ct.txtLastCharIndex!==rt-1){if(b[w]=Ct.lineTxt,Ct.txtLastCharIndex===s.length-1)break;rt=Ct.txtLastCharIndex+1,lt=s[rt],ht=s[rt-1],yt=s[rt+1],Nt=j(lt)}if(w+1>=f){et(w,rt-1),n.isOverflowing=!0;break}if(_=rt-1,w+=1,O=0,b[w]="",this.isBreakingSpace(lt))continue;this.canBreakInLastChar(lt)||(b=this.trimToBreakable(b),O=this.sumTextWidthByCache(b[w]||"",j)),this.shouldBreakByKinsokuShorui(lt,yt)&&(b=this.trimByKinsokuShorui(b),O+=j(ht||""))}O+=Nt,b[w]+=lt}return b.join(`
`)}},{key:"isBreakingSpace",value:function(e){return typeof e!="string"?!1:Ms.BreakingSpaces.indexOf(e.charCodeAt(0))>=0}},{key:"isNewline",value:function(e){return typeof e!="string"?!1:Ms.Newlines.indexOf(e.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(e){var n=(0,k.Z)(e),i=n[n.length-2],a=this.findBreakableIndex(i);if(a===-1||!i)return n;var s=i.slice(a,a+1),o=this.isBreakingSpace(s),l=a+1,c=a+(o?0:1);return n[n.length-1]+=i.slice(l,i.length),n[n.length-2]=i.slice(0,c),n}},{key:"canBreakInLastChar",value:function(e){return!(e&&qp.test(e))}},{key:"sumTextWidthByCache",value:function(e,n){return e.split("").reduce(function(i,a){return i+n(a)},0)}},{key:"findBreakableIndex",value:function(e){for(var n=e.length-1;n>=0;n--)if(!qp.test(e[n]))return n;return-1}},{key:"getFromCache",value:function(e,n,i,a){var s=i.get(e);if(typeof s!="number"){var o=e.length*n,l=a.measureText(e);s=l.width+o,i.put(e,s)}return s}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Ut={},HA=function(r){var t=new mA,e=new pA;return r={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(r,_t.FRAGMENT,null),_t.CIRCLE,new dA),_t.ELLIPSE,new fA),_t.RECT,t),_t.IMAGE,t),_t.GROUP,new bA),_t.LINE,new vA),_t.TEXT,new yA(Ut)),_t.POLYLINE,e),_t.POLYGON,e),(0,ae.Z)((0,ae.Z)((0,ae.Z)(r,_t.PATH,new gA),_t.HTML,new xA),_t.MESH,null)}(),XA=function(r){var t=new MM,e=new $d;return r={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(r,$t.PERCENTAGE,null),$t.NUMBER,new NM),$t.ANGLE,new wM),$t.DEFINED_PATH,new SM),$t.PAINT,t),$t.COLOR,t),$t.FILTER,new AM),$t.LENGTH,e),$t.LENGTH_PERCENTAGE,e),$t.LENGTH_PERCENTAGE_12,new TM),(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(r,$t.LENGTH_PERCENTAGE_14,new OM),$t.COORDINATE,new $d),$t.OFFSET_DISTANCE,new kM),$t.OPACITY_VALUE,new PM),$t.PATH,new RM),$t.LIST_OF_POINTS,new LM),$t.SHADOW_BLUR,new DM),$t.TEXT,new _M),$t.TEXT_TRANSFORM,new IM),$t.TRANSFORM,new cA),(0,ae.Z)((0,ae.Z)((0,ae.Z)(r,$t.TRANSFORM_ORIGIN,new uA),$t.Z_INDEX,new hA),$t.MARKER,new CM)}(),KA=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:{}};Ut.CameraContribution=Xg,Ut.AnimationTimeline=null,Ut.EasingFunction=null,Ut.offscreenCanvasCreator=new lf,Ut.sceneGraphSelector=new AA,Ut.sceneGraphService=new _A(Ut),Ut.textService=new YA(Ut),Ut.geometryUpdaterFactory=HA,Ut.CSSPropertySyntaxFactory=XA,Ut.styleValueRegistry=new xM(Ut),Ut.layoutRegistry=null,Ut.globalThis=KA(),Ut.enableStyleSyntax=!0,Ut.enableSizeAttenuation=!1;var Jp=0;function V8(){Jp=0}var cf=new Qi(Ie.INSERTED,null,"","","",0,"",""),uf=new Qi(Ie.REMOVED,null,"","","",0,"",""),$p=new Kn(Ie.DESTROY),QA=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.entity=Jp++,e.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},e.cullable={strategy:K2.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.style={},e.computedStyle={},e.parsedStyle={},e.attributes={},e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"dirty",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1?arguments[1]:void 0;this.renderable.dirty=n,i!==void 0&&(this.renderable.boundsDirty=i,this.renderable.renderBoundsDirty=i,this.geometry.dirty=i)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(n){return n!==""})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null}},{key:"cloneNode",value:function(n){throw new Error(nn)}},{key:"appendChild",value:function(n,i){var a;if(n.destroyed)throw new Error(B2);return Ut.sceneGraphService.attach(n,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!xc(this)&&n.nodeName===_t.FRAGMENT?this.ownerDocument.defaultView.mountFragment(n):this.ownerDocument.defaultView.mountChildren(n)),this.isMutationObserved&&(cf.relatedNode=this,n.dispatchEvent(cf)),n}},{key:"insertBefore",value:function(n,i){if(!i)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var a=this.childNodes.indexOf(i);a===-1?this.appendChild(n):this.appendChild(n,a)}return n}},{key:"replaceChild",value:function(n,i){var a=this.childNodes.indexOf(i);return this.removeChild(i),this.appendChild(n,a),i}},{key:"removeChild",value:function(n){var i,a,s=((i=this.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;return uf.relatedNode=this,n.dispatchEvent(uf,s,s),(a=n.ownerDocument)!==null&&a!==void 0&&a.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),Ut.sceneGraphService.detach(n),n}},{key:"removeChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];this.removeChild(i)}}},{key:"destroyChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];i.childNodes.length>0&&i.destroyChildren(),i.destroy()}}},{key:"matches",value:function(n){return Ut.sceneGraphService.matches(n,this)}},{key:"getElementById",value:function(n){return Ut.sceneGraphService.querySelector("#".concat(n),this)}},{key:"getElementsByName",value:function(n){return Ut.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)}},{key:"getElementsByClassName",value:function(n){return Ut.sceneGraphService.querySelectorAll(".".concat(n),this)}},{key:"getElementsByTagName",value:function(n){return Ut.sceneGraphService.querySelectorAll(n,this)}},{key:"querySelector",value:function(n){return Ut.sceneGraphService.querySelector(n,this)}},{key:"querySelectorAll",value:function(n){return Ut.sceneGraphService.querySelectorAll(n,this)}},{key:"closest",value:function(n){var i=this;do{if(Ut.sceneGraphService.matches(n,i))return i;i=i.parentElement}while(i!==null);return null}},{key:"find",value:function(n){var i=this,a=null;return this.forEach(function(s){return s!==i&&n(s)?(a=s,!1):!0}),a}},{key:"findAll",value:function(n){var i=this,a=[];return this.forEach(function(s){s!==i&&n(s)&&a.push(s)}),a}},{key:"after",value:function(){var n=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];s.forEach(function(l,c){var u;return(u=n.parentNode)===null||u===void 0?void 0:u.appendChild(l,i+c+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var n,i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var l=s[0],c=s.slice(1);this.parentNode.appendChild(l,i),(n=l).after.apply(n,(0,k.Z)(c))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o){return n.appendChild(o)})}},{key:"prepend",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o,l){return n.appendChild(o,l)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var n,i=((n=this.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;this.destroyChildren(),this.dispatchEvent($p,i,i),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Ut.sceneGraphService.getGeometryBounds(this,n)}},{key:"getTransformedGeometryBounds",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Ut.sceneGraphService.getTransformedGeometryBounds(this,n)}},{key:"getBounds",value:function(){return Ut.sceneGraphService.getBounds(this)}},{key:"getRenderBounds",value:function(){return Ut.sceneGraphService.getBounds(this,!0)}},{key:"getLocalBounds",value:function(){return Ut.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Ut.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(n){if(typeof n!="symbol"){var i=this.attributes[n];return i}}},{key:"hasAttribute",value:function(n){return this.getAttributeNames().includes(n)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(n){this.setAttribute(n,null),delete this.attributes[n]}},{key:"setAttribute",value:function(n,i){this.attributes[n]=i}},{key:"getAttributeNS",value:function(n,i){throw new Error(nn)}},{key:"getAttributeNode",value:function(n){throw new Error(nn)}},{key:"getAttributeNodeNS",value:function(n,i){throw new Error(nn)}},{key:"hasAttributeNS",value:function(n,i){throw new Error(nn)}},{key:"removeAttributeNS",value:function(n,i){throw new Error(nn)}},{key:"removeAttributeNode",value:function(n){throw new Error(nn)}},{key:"setAttributeNS",value:function(n,i,a){throw new Error(nn)}},{key:"setAttributeNode",value:function(n){throw new Error(nn)}},{key:"setAttributeNodeNS",value:function(n){throw new Error(nn)}},{key:"toggleAttribute",value:function(n,i){throw new Error(nn)}}])}(On);function Ue(r){return!!(r!=null&&r.nodeName)}var qA=Ut.globalThis.Proxy?Ut.globalThis.Proxy:function(){},qi=new Qi(Ie.ATTR_MODIFIED,null,null,null,null,Qi.MODIFICATION,null,null),il=gt(),JA=Xn(),pn=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,R.Z)(this,t),n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=e,n.id=e.id||"",n.name=e.name||"",(e.className||e.class)&&(n.className=e.className||e.class),n.nodeName=e.type||_t.GROUP,e.initialParsedStyle&&Object.assign(n.parsedStyle,e.initialParsedStyle),n.initAttributes(e.style),Ut.enableStyleSyntax&&(n.style=new qA({setProperty:function(a,s){n.setAttribute(a,s)},getPropertyValue:function(a){return n.getAttribute(a)},removeProperty:function(a){n.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:n.getAttribute(s)},set:function(a,s,o){return n.setAttribute(s,o),!0}})),n}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"destroy",value:function(){Tg(t,"destroy",this,3)([]),this.getAnimations().forEach(function(n){n.cancel()})}},{key:"cloneNode",value:function(n,i){var a=(0,D.Z)({},this.attributes);for(var s in a){var o=a[s];Ue(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(n)),i&&(a[s]=i(s,o))}var l=new this.constructor((0,D.Z)((0,D.Z)({},this.config),{},{style:a}));return l.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(c){if(!c.style.isMarker){var u=c.cloneNode(n);l.appendChild(u)}}),l}},{key:"initAttributes",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={forceUpdateGeometry:!0};Ut.styleValueRegistry.processProperties(this,n,i),this.dirty()}},{key:"setAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;Te(i)||(a||i!==this.attributes[n])&&(this.internalSetAttribute(n,i,{memoize:s}),Tg(t,"setAttribute",this,3)([n,i]))}},{key:"internalSetAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.attributes[n],o=this.parsedStyle[n];Ut.styleValueRegistry.processProperties(this,(0,ae.Z)({},n,i),a),this.dirty();var l=this.parsedStyle[n];if(this.isConnected)if(qi.relatedNode=this,qi.prevValue=s,qi.newValue=i,qi.attrName=n,qi.prevParsedValue=o,qi.newParsedValue=l,this.isMutationObserved)this.dispatchEvent(qi);else{var c,u=((c=this.ownerDocument.defaultView.getConfig().future)===null||c===void 0?void 0:c.experimentalCancelEventPropagation)===!0;qi.target=this,this.ownerDocument.defaultView.dispatchEvent(qi,!0,u)}if(this.isCustomElement&&this.isConnected||!this.isCustomElement){var h,d;(h=(d=this).attributeChangedCallback)===null||h===void 0||h.call(d,n,s,i,o,l)}}},{key:"getBBox",value:function(){var n=this.getBounds(),i=n.getMin(),a=(0,P.Z)(i,2),s=a[0],o=a[1],l=n.getMax(),c=(0,P.Z)(l,2),u=c[0],h=c[1];return new no(s,o,u-s,h-o)}},{key:"setOrigin",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ut.sceneGraphService.setOrigin(this,Ir(n,i,a,!1)),this}},{key:"getOrigin",value:function(){return Ut.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ut.sceneGraphService.setPosition(this,Ir(n,i,a,!1)),this}},{key:"setLocalPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ut.sceneGraphService.setLocalPosition(this,Ir(n,i,a,!1)),this}},{key:"translate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ut.sceneGraphService.translate(this,Ir(n,i,a,!1)),this}},{key:"translateLocal",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ut.sceneGraphService.translateLocal(this,Ir(n,i,a,!1)),this}},{key:"getPosition",value:function(){return Ut.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Ut.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(n,i,a){return this.scaleLocal(n,i,a)}},{key:"scaleLocal",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=Ir(n,i,a,!1)),Ut.sceneGraphService.scaleLocal(this,n),this}},{key:"setLocalScale",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=Ir(n,i,a,!1)),Ut.sceneGraphService.setLocalScale(this,n),this}},{key:"getLocalScale",value:function(){return Ut.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Ut.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var n=Dd(il,Ut.sceneGraphService.getWorldTransform(this)),i=(0,P.Z)(n,3),a=i[2];return Vr(a)}},{key:"getLocalEulerAngles",value:function(){var n=Dd(il,Ut.sceneGraphService.getLocalRotation(this)),i=(0,P.Z)(n,3),a=i[2];return Vr(a)}},{key:"setEulerAngles",value:function(n){return Ut.sceneGraphService.setEulerAngles(this,0,0,n),this}},{key:"setLocalEulerAngles",value:function(n){return Ut.sceneGraphService.setLocalEulerAngles(this,0,0,n),this}},{key:"rotateLocal",value:function(n,i,a){return ye(i)&&ye(a)?Ut.sceneGraphService.rotateLocal(this,0,0,n):Ut.sceneGraphService.rotateLocal(this,n,i,a),this}},{key:"rotate",value:function(n,i,a){return ye(i)&&ye(a)?Ut.sceneGraphService.rotate(this,0,0,n):Ut.sceneGraphService.rotate(this,n,i,a),this}},{key:"setRotation",value:function(n,i,a,s){return Ut.sceneGraphService.setRotation(this,n,i,a,s),this}},{key:"setLocalRotation",value:function(n,i,a,s){return Ut.sceneGraphService.setLocalRotation(this,n,i,a,s),this}},{key:"setLocalSkew",value:function(n,i){return Ut.sceneGraphService.setLocalSkew(this,n,i),this}},{key:"getRotation",value:function(){return Ut.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Ut.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Ut.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Ut.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Ut.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(n){return Ut.sceneGraphService.setLocalTransform(this,n),this}},{key:"resetLocalTransform",value:function(){Ut.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(n,i){var a,s=(a=this.ownerDocument)===null||a===void 0?void 0:a.timeline;return s?s.play(this,n,i):null}},{key:"isVisible",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"}},{key:"isInteractive",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"}},{key:"isCulled",value:function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,(0,k.Z)(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,k.Z)(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=a[0],l=a[1];return o?Fn(o)?(Object.keys(o).forEach(function(c){n.setAttribute(c,o[c])}),this):a.length===2?(this.setAttribute(o,l),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(n){var i=n||this.getWorldTransform(),a=Tn(il,i),s=(0,P.Z)(a,2),o=s[0],l=s[1],c=Ca(il,i),u=(0,P.Z)(c,2),h=u[0],d=u[1],f=Js(JA,i),v=Dd(il,f),g=(0,P.Z)(v,3),p=g[0],y=g[2];return V2(p||y,o,l,h,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(n){var i=Vg(n),a=(0,P.Z)(i,5),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4];this.setEulerAngles(u).setPosition(s,o).setLocalScale(l,c)}},{key:"setLocalMatrix",value:function(n){var i=Vg(n),a=(0,P.Z)(i,5),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4];this.setLocalEulerAngles(u).setLocalPosition(s,o).setLocalScale(l,c)}},{key:"show",value:function(){this.forEach(function(n){n.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(n){n.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(n){return this.children[n]||null}},{key:"add",value:function(n,i){return this.appendChild(n,i)}},{key:"set",value:function(n,i){this.config[n]=i}},{key:"get",value:function(n){return this.config[n]}},{key:"moveTo",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"move",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"setZIndex",value:function(n){return this.style.zIndex=n,this}}])}(QA);pn.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ji=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.CIRCLE},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);Ji.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var $A=["style"],hf=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,$A);return(0,N.Z)(this,t),e=(0,R.Z)(this,t,[(0,D.Z)({style:i},a)]),e.isCustomElement=!0,e}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);hf.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var al=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.ELLIPSE},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);al.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var tT=function(r){function t(){return(0,N.Z)(this,t),(0,R.Z)(this,t,[{type:_t.FRAGMENT}])}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);tT.PARSED_STYLE_LIST=new Set(["class","className"]);var ir=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.GROUP},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);ir.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var eT=["style"],co=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,eT);return(0,N.Z)(this,t),e=(0,R.Z)(this,t,[(0,D.Z)({type:_t.HTML,style:i},a)]),e.cullable.enable=!1,e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var n=Ze(Wt(),this.parentNode.getWorldTransform()),i=this.getBounds();if(!gn.isEmpty(i)){var a=new gn;return a.setFromTransformedAABB(i,n),a}}return this.getBounds()}}])}(pn);co.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var sl=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.IMAGE},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);sl.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var nT=["style"],As=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,nT);(0,N.Z)(this,t),e=(0,R.Z)(this,t,[(0,D.Z)({type:_t.LINE,style:(0,D.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),e.markerStartAngle=0,e.markerEndAngle=0;var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd;return o&&Ue(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),l&&Ue(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Ue(s)&&(this.markerStartAngle=0,s.remove()),o&&Ue(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"&&(s&&Ue(s)&&(this.markerEndAngle=0,s.remove()),o&&Ue(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=i.x1,u=i.x2,h=i.y1,d=i.y2,f=n?a:s;if(!(!f||!Ue(f))){var v=0,g,p,y,b,w,O;n?(y=c,b=h,g=u-c,p=d-h,w=o||0,O=this.markerStartAngle):(y=u,b=d,g=c-u,p=h-d,w=l||0,O=this.markerEndAngle),v=Math.atan2(p,g),f.setLocalEulerAngles(v*180/Math.PI+O),f.setLocalPosition(y+Math.cos(v)*w,b+Math.sin(v)*w)}}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle,s=a.x1,o=a.y1,l=a.x2,c=a.y2,u=Yi(s,o,l,c,n),h=u.x,d=u.y,f=re(gt(),Et(h,d,0),i?this.getWorldTransform():this.getLocalTransform());return new gr(f[0],f[1])}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getTotalLength",value:function(){var n=this.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2;return Rg(i,a,s,o)}}])}(pn);As.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var rT=["style"],ri=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,rT);(0,N.Z)(this,t),e=(0,R.Z)(this,t,[(0,D.Z)({type:_t.PATH,style:i,initialParsedStyle:{miterLimit:4,d:(0,D.Z)({},Qg)}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ue(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ue(c)&&e.placeMarkerMid(c),l&&Ue(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Ue(s)&&(this.markerStartAngle=0,s.remove()),o&&Ue(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Ue(s)&&(this.markerEndAngle=0,s.remove()),o&&Ue(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=n?a:s;if(!(!c||!Ue(c))){var u=0,h,d,f,v,g,p;if(n){var y=this.getStartTangent(),b=(0,P.Z)(y,2),w=b[0],O=b[1];f=O[0],v=O[1],h=w[0]-O[0],d=w[1]-O[1],g=o||0,p=this.markerStartAngle}else{var _=this.getEndTangent(),F=(0,P.Z)(_,2),W=F[0],j=F[1];f=j[0],v=j[1],h=W[0]-j[0],d=W[1]-j[1],g=l||0,p=this.markerEndAngle}u=Math.atan2(d,h),c.setLocalEulerAngles(u*180/Math.PI+p),c.setLocalPosition(f+Math.cos(u)*g,v+Math.sin(u)*g)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(u){u.remove()}),n&&Ue(n))for(var a=1;a<i.length-1;a++){var s=(0,P.Z)(i[a].currentPoint,2),o=s[0],l=s[1],c=a===1?n:n.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(o,l)}}},{key:"getTotalLength",value:function(){return Hd(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=c2(a,n),o=s.x,l=s.y,c=re(gt(),Et(o,l,0),i?this.getWorldTransform():this.getLocalTransform());return new gr(c[0],c[1])}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(n*Hd(this),i)}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.d.segments,i=[];if(n.length>1){var a=n[0].currentPoint,s=n[1].currentPoint,o=n[1].startTangent;i=[],o?(i.push([a[0]-o[0],a[1]-o[1]]),i.push([a[0],a[1]])):(i.push([s[0],s[1]]),i.push([a[0],a[1]]))}return i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.d.segments,i=n.length,a=[];if(i>1){var s=n[i-2].currentPoint,o=n[i-1].currentPoint,l=n[i-1].endTangent;a=[],l?(a.push([o[0]-l[0],o[1]-l[1]]),a.push([o[0],o[1]])):(a.push([s[0],s[1]]),a.push([o[0],o[1]]))}return a}}])}(pn);ri.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var iT=["style"],Ts=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,iT);(0,N.Z)(this,t),e=(0,R.Z)(this,t,[(0,D.Z)({type:_t.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ue(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ue(c)&&e.placeMarkerMid(c),l&&Ue(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Ue(s)&&(this.markerStartAngle=0,s.remove()),o&&Ue(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Ue(s)&&(this.markerEndAngle=0,s.remove()),o&&Ue(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=i.points,u=c||{},h=u.points,d=n?a:s;if(!(!d||!Ue(d)||!h)){var f=0,v,g,p,y,b,w;if(p=h[0][0],y=h[0][1],n)v=h[1][0]-h[0][0],g=h[1][1]-h[0][1],b=o||0,w=this.markerStartAngle;else{var O=h.length;this.parsedStyle.isClosed?(v=h[O-1][0]-h[0][0],g=h[O-1][1]-h[0][1]):(p=h[O-1][0],y=h[O-1][1],v=h[O-2][0]-h[O-1][0],g=h[O-2][1]-h[O-1][1]),b=l||0,w=this.markerEndAngle}f=Math.atan2(g,v),d.setLocalEulerAngles(f*180/Math.PI+w),d.setLocalPosition(p+Math.cos(f)*b,y+Math.sin(f)*b)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.points,a=i||{},s=a.points;if(this.markerMidList.forEach(function(h){h.remove()}),this.markerMidList=[],n&&Ue(n)&&s)for(var o=1;o<(this.parsedStyle.isClosed?s.length:s.length-1);o++){var l=s[o][0],c=s[o][1],u=o===1?n:n.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(l,c)}}}])}(pn);Ts.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var aT=["style"],Tc=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.style,i=(0,vs.Z)(e,aT);return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"getTotalLength",value:function(){return HS(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var s=[],o=0,l,c,u=this.getTotalLength();a.forEach(function(y,b){a[b+1]&&(l=[0,0],l[0]=o/u,c=Rg(y[0],y[1],a[b+1][0],a[b+1][1]),o+=c,l[1]=o/u,s.push(l))}),this.parsedStyle.points.segments=s}var h=0,d=0;this.parsedStyle.points.segments.forEach(function(y,b){n>=y[0]&&n<=y[1]&&(h=(n-y[0])/(y[1]-y[0]),d=b)});var f=Yi(a[d][0],a[d][1],a[d+1][0],a[d+1][1],h),v=f.x,g=f.y,p=re(gt(),Et(v,g,0),i?this.getWorldTransform():this.getLocalTransform());return new gr(p[0],p[1])}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.points.points,i=[];return i.push([n[1][0],n[1][1]]),i.push([n[0][0],n[0][1]]),i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.points.points,i=n.length-1,a=[];return a.push([n[i-1][0],n[i-1][1]]),a.push([n[i][0],n[i][1]]),a}}])}(Ts);Tc.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(Ts.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var pr=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.RECT},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(pn);pr.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var sT=["style"],Os=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.style,i=(0,vs.Z)(e,sT);return(0,N.Z)(this,t),(0,R.Z)(this,t,[(0,D.Z)({type:_t.TEXT,style:(0,D.Z)({fill:"black"},n)},i)])}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"getComputedTextLength",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(pn);Os.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(pn.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textPathSide","textPathStartOffset","metrics","dx","dy"]));var oT=function(){function r(){(0,N.Z)(this,r),this.registry={},this.define(_t.CIRCLE,Ji),this.define(_t.ELLIPSE,al),this.define(_t.RECT,pr),this.define(_t.IMAGE,sl),this.define(_t.LINE,As),this.define(_t.GROUP,ir),this.define(_t.PATH,ri),this.define(_t.POLYGON,Ts),this.define(_t.POLYLINE,Tc),this.define(_t.TEXT,Os),this.define(_t.HTML,co)}return(0,T.Z)(r,[{key:"define",value:function(e,n){this.registry[e]=n}},{key:"get",value:function(e){return this.registry[e]}}])}(),U8={number:function(t){return new sn(t)},percent:function(t){return new sn(t,"%")},px:function(t){return new sn(t,"px")},em:function(t){return new sn(t,"em")},rem:function(t){return new sn(t,"rem")},deg:function(t){return new sn(t,"deg")},grad:function(t){return new sn(t,"grad")},rad:function(t){return new sn(t,"rad")},turn:function(t){return new sn(t,"turn")},s:function(t){return new sn(t,"s")},ms:function(t){return new sn(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,i=t.interpolable,a=t.initialValue,s=t.syntax;Ut.styleValueRegistry.registerMetadata({n:e,inh:n,int:i,d:a,syntax:s})},registerLayout:function(t,e){Ut.layoutRegistry.registerLayout(t,e)}},tm=function(r){function t(){var e;(0,N.Z)(this,t),e=(0,R.Z)(this,t),e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Ut.AnimationTimeline(e)}catch(i){}var n={};return Jd.forEach(function(i){var a=i.n,s=i.inh,o=i.d;s&&o&&(n[a]=fe(o)?o(_t.GROUP):o)}),e.documentElement=new ir({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(n,i){if(n==="svg")return this.documentElement;var a=this.defaultView.customElements.get(n);a||(console.warn("Unsupported tagName: ",n),a=n==="tspan"?Os:ir);var s=new a(i);return s.ownerDocument=this,s}},{key:"createElementNS",value:function(n,i,a){return this.createElement(i,a)}},{key:"cloneNode",value:function(n){throw new Error(nn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}}},{key:"elementsFromBBox",value:function(n,i,a,s){var o=[],l=function(u){if(!(!u.isInteractive()||u.isCulled())){var h=u.parsedStyle.pointerEvents,d=h===void 0?"auto":h,f=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(d);if(!f||u.isVisible()){var v=u.getTransformedGeometryBounds(!0);v&&!gn.isEmpty(v)&&v.max[0]>=n&&v.min[0]<=a&&v.max[1]>=i&&v.min[1]<=s&&o.push(u)}u.childNodes&&u.childNodes.forEach(function(g){g instanceof pn&&l(g)})}};return l(this.documentElement),o.sort(function(c,u){return u.sortable.renderOrder-c.sortable.renderOrder}),o}},{key:"elementFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),c=l.width,u=l.height;if(s<0||o<0||s>c||o>u)return null;var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),g=v.picked;return g&&g[0]||this.documentElement}},{key:"elementFromPoint",value:function(){var e=(0,Ra.Z)((0,Cr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Cr.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,c=o.y,u=this.defaultView.getConfig(),h=u.width,d=u.height,!(l<0||c<0||l>h||c>d)){b.next=1;break}return b.abrupt("return",null);case 1:return f=this.defaultView.viewport2Client({x:l,y:c}),v=f.x,g=f.y,b.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:s,viewportX:l,viewportY:c,clientX:v,clientY:g},picked:[]});case 2:return p=b.sent,y=p.picked,b.abrupt("return",y&&y[0]||this.documentElement);case 3:case"end":return b.stop()}},i,this)}));function n(i,a){return e.apply(this,arguments)}return n}()},{key:"elementsFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),c=l.width,u=l.height;if(s<0||o<0||s>c||o>u)return[];var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),g=v.picked;return g[g.length-1]!==this.documentElement&&g.push(this.documentElement),g}},{key:"elementsFromPoint",value:function(){var e=(0,Ra.Z)((0,Cr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Cr.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,c=o.y,u=this.defaultView.getConfig(),h=u.width,d=u.height,!(l<0||c<0||l>h||c>d)){b.next=1;break}return b.abrupt("return",[]);case 1:return f=this.defaultView.viewport2Client({x:l,y:c}),v=f.x,g=f.y,b.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:s,viewportX:l,viewportY:c,clientX:v,clientY:g},picked:[]});case 2:return p=b.sent,y=p.picked,y[y.length-1]!==this.documentElement&&y.push(this.documentElement),b.abrupt("return",y);case 3:case"end":return b.stop()}},i,this)}));function n(i,a){return e.apply(this,arguments)}return n}()},{key:"appendChild",value:function(n,i){throw new Error(ro)}},{key:"insertBefore",value:function(n,i){throw new Error(ro)}},{key:"removeChild",value:function(n,i){throw new Error(ro)}},{key:"replaceChild",value:function(n,i,a){throw new Error(ro)}},{key:"append",value:function(){throw new Error(ro)}},{key:"prepend",value:function(){throw new Error(ro)}},{key:"getElementById",value:function(n){return this.documentElement.getElementById(n)}},{key:"getElementsByName",value:function(n){return this.documentElement.getElementsByName(n)}},{key:"getElementsByTagName",value:function(n){return this.documentElement.getElementsByTagName(n)}},{key:"getElementsByClassName",value:function(n){return this.documentElement.getElementsByClassName(n)}},{key:"querySelector",value:function(n){return this.documentElement.querySelector(n)}},{key:"querySelectorAll",value:function(n){return this.documentElement.querySelectorAll(n)}},{key:"find",value:function(n){return this.documentElement.find(n)}},{key:"findAll",value:function(n){return this.documentElement.findAll(n)}}])}(On),em=function(){function r(t){(0,N.Z)(this,r),this.strategies=t}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=e.config,i=e.camera,a=e.renderingService,s=e.renderingContext,o=this.strategies;a.hooks.cull.tap(r.tag,function(l){if(l){var c,u=l.cullable;if(o.length===0?u.visible=s.unculledEntities.indexOf(l.entity)>-1:u.visible=o.every(function(d){return d.isVisible(i,l)}),!l.isCulled()&&l.isVisible())return l;var h=((c=n.future)===null||c===void 0?void 0:c.experimentalCancelEventPropagation)===!0;return l.dispatchEvent(new Kn(Ie.CULLED),h,h),null}return l}),a.hooks.afterRender.tap(r.tag,function(l){l.cullable.visibilityPlaneMask=-1})}}])}();em.tag="Culling";var nm=function(){function r(){var t=this;(0,N.Z)(this,r),this.autoPreventDefault=!1,this.rootPointerEvent=new wc(null),this.rootWheelEvent=new of(null),this.onPointerMove=function(e){var n,i=(n=t.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView;if(!(i.supportsTouchEvents&&e.pointerType==="touch")){var a=t.normalizeToPointerEvent(e,i),s=(0,La.Z)(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=t.bootstrapEvent(t.rootPointerEvent,l,i,e);t.context.eventService.mapEvent(c)}}catch(u){s.e(u)}finally{s.f()}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,i=(n=t.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView,a=t.normalizeToPointerEvent(e,i),s=(0,La.Z)(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=t.bootstrapEvent(t.rootPointerEvent,l,i,e);t.context.eventService.mapEvent(c)}}catch(u){s.e(u)}finally{s.f()}t.setCursor(t.context.eventService.cursor)}}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this;this.context=e;var i=e.renderingService,a=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(s){var o=n.context.renderingService.hooks.pickSync.call({position:s,picked:[],topmost:!0}),l=o.picked;return l[0]||null}),i.hooks.pointerWheel.tap(r.tag,function(s){var o=n.normalizeWheelEvent(s);n.context.eventService.mapEvent(o)}),i.hooks.pointerDown.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.normalizeToPointerEvent(s,a);if(n.autoPreventDefault&&o[0].isNormalized){var l=s.cancelable||!("cancelable"in s);l&&s.preventDefault()}var c=(0,La.Z)(o),u;try{for(c.s();!(u=c.n()).done;){var h=u.value,d=n.bootstrapEvent(n.rootPointerEvent,h,a,s);n.context.eventService.mapEvent(d)}}catch(f){c.e(f)}finally{c.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerUp.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.context.contextService.getDomElement(),l=n.context.eventService.isNativeEventFromCanvas(o,s),c=l?"":"outside",u=n.normalizeToPointerEvent(s,a),h=(0,La.Z)(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=n.bootstrapEvent(n.rootPointerEvent,f,a,s);v.type+=c,n.context.eventService.mapEvent(v)}}catch(g){h.e(g)}finally{h.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerMove.tap(r.tag,this.onPointerMove),i.hooks.pointerOver.tap(r.tag,this.onPointerMove),i.hooks.pointerOut.tap(r.tag,this.onPointerMove),i.hooks.click.tap(r.tag,this.onClick),i.hooks.pointerCancel.tap(r.tag,function(s){var o=n.normalizeToPointerEvent(s,a),l=(0,La.Z)(o),c;try{for(l.s();!(c=l.n()).done;){var u=c.value,h=n.bootstrapEvent(n.rootPointerEvent,u,a,s);n.context.eventService.mapEvent(h)}}catch(d){l.e(d)}finally{l.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(e,n,i,a){e.view=i,e.originalEvent=null,e.nativeEvent=a,e.pointerId=n.pointerId,e.width=n.width,e.height=n.height,e.isPrimary=n.isPrimary,e.pointerType=n.pointerType,e.pressure=n.pressure,e.tangentialPressure=n.tangentialPressure,e.tiltX=n.tiltX,e.tiltY=n.tiltY,e.twist=n.twist,this.transferMouseData(e,n);var s=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),o=s.x,l=s.y;e.viewport.x=o,e.viewport.y=l;var c=this.context.eventService.viewport2Canvas(e.viewport),u=c.x,h=c.y;return e.canvas.x=u,e.canvas.y=h,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=a.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=VM[e.type]||e.type),e}},{key:"normalizeWheelEvent",value:function(e){var n=this.rootWheelEvent;this.transferMouseData(n,e),n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ;var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,s=i.y;n.viewport.x=a,n.viewport.y=s;var o=this.context.eventService.viewport2Canvas(n.viewport),l=o.x,c=o.y;return n.canvas.x=l,n.canvas.y=c,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=e,n.type=e.type,n}},{key:"transferMouseData",value:function(e,n){e.isTrusted=n.isTrusted,e.srcElement=n.srcElement,e.timeStamp=nf.now(),e.type=n.type,e.altKey=n.altKey,e.metaKey=n.metaKey,e.shiftKey=n.shiftKey,e.ctrlKey=n.ctrlKey,e.button=n.button,e.buttons=n.buttons,e.client.x=n.clientX,e.client.y=n.clientY,e.movement.x=n.movementX,e.movement.y=n.movementY,e.page.x=n.pageX,e.page.y=n.pageY,e.screen.x=n.screenX,e.screen.y=n.screenY,e.relatedTarget=null}},{key:"setCursor",value:function(e){this.context.contextService.applyCursorStyle(e||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(e,n){var i=[];if(n.isTouchEvent(e))for(var a=0;a<e.changedTouches.length;a++){var s=e.changedTouches[a];Te(s.button)&&(s.button=0),Te(s.buttons)&&(s.buttons=1),Te(s.isPrimary)&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),Te(s.width)&&(s.width=s.radiusX||1),Te(s.height)&&(s.height=s.radiusY||1),Te(s.tiltX)&&(s.tiltX=0),Te(s.tiltY)&&(s.tiltY=0),Te(s.pointerType)&&(s.pointerType="touch"),Te(s.pointerId)&&(s.pointerId=s.identifier||0),Te(s.pressure)&&(s.pressure=s.force||.5),Te(s.twist)&&(s.twist=0),Te(s.tangentialPressure)&&(s.tangentialPressure=0),s.isNormalized=!0,s.type=e.type,i.push(s)}else if(n.isMouseEvent(e)){var o=e;Te(o.isPrimary)&&(o.isPrimary=!0),Te(o.width)&&(o.width=1),Te(o.height)&&(o.height=1),Te(o.tiltX)&&(o.tiltX=0),Te(o.tiltY)&&(o.tiltY=0),Te(o.pointerType)&&(o.pointerType="mouse"),Te(o.pointerId)&&(o.pointerId=GM),Te(o.pressure)&&(o.pressure=.5),Te(o.twist)&&(o.twist=0),Te(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(e);return i}}])}();nm.tag="Event";var lT=[_t.CIRCLE,_t.ELLIPSE,_t.IMAGE,_t.RECT,_t.LINE,_t.POLYLINE,_t.POLYGON,_t.TEXT,_t.PATH,_t.HTML],cT=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"isVisible",value:function(e,n){var i,a=n.cullable;if(!a.enable)return!0;var s=n.getRenderBounds();if(gn.isEmpty(s))return!1;var o=e.getFrustum(),l=(i=n.parentNode)===null||i===void 0||(i=i.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,s,l||eo.INDETERMINATE,o.planes),a.visible=a.visibilityPlaneMask!==eo.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(e,n,i,a){if(i===eo.OUTSIDE||i===eo.INSIDE)return i;for(var s=eo.INSIDE,o=lT.indexOf(e.nodeName)>-1,l=0,c=a.length;l<c;++l){var u=1<<l;if(i&u&&!(o&&(l===4||l===5))){var h=a[l],d=h.normal,f=h.distance;if(be(d,n.getPositiveFarPoint(a[l]))+f<0)return eo.OUTSIDE;be(d,n.getNegativeFarPoint(a[l]))+f<0&&(s|=u)}}return s}}])}(),rm=function(){function r(){(0,N.Z)(this,r),this.mutationRecords=[],this.isFirstTimeRendering=!0,this.isFirstTimeRenderingFinished=!1}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this,i,a=e.renderingService,s=e.renderingContext,o=s.root.ownerDocument.defaultView,l=function(v){a.dirty()},c=function(v){var g,p=v.detail;(g=n.mutationRecords).push.apply(g,(0,k.Z)(p)),a.dirty()},u=function(v){var g=v.target;Ut.enableSizeAttenuation&&Ut.styleValueRegistry.updateSizeAttenuation(g,o.getCamera().getZoom())},h=function(v){var g=v.target;Ut.sceneGraphService.dirtyToRoot(g),a.dirty()};a.hooks.init.tap(r.tag,function(){o.addEventListener(Ie.MOUNTED,u),o.addEventListener(Ie.UNMOUNTED,h),o.addEventListener(Ie.ATTR_MODIFIED,l),o.addEventListener(Ie.BOUNDS_CHANGED,c)}),a.hooks.destroy.tap(r.tag,function(){o.removeEventListener(Ie.MOUNTED,u),o.removeEventListener(Ie.UNMOUNTED,h),o.removeEventListener(Ie.ATTR_MODIFIED,l),o.removeEventListener(Ie.BOUNDS_CHANGED,c),n.mutationRecords=[]});var d=(i=Ut.globalThis.requestIdleCallback)!==null&&i!==void 0?i:rf.bind(Ut.globalThis);a.hooks.endFrame.tap(r.tag,function(){n.isFirstTimeRendering&&(n.isFirstTimeRendering=!1,d(function(){n.isFirstTimeRenderingFinished=!0})),n.mutationRecords=[]})}}])}();rm.tag="Prepare";function Y8(r){return!!r.document}var ii=function(r){return r.READY="ready",r.BEFORE_RENDER="beforerender",r.RERENDER="rerender",r.AFTER_RENDER="afterrender",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.RESIZE="resize",r.DIRTY_RECTANGLE="dirtyrectangle",r.RENDERER_CHANGED="rendererchanged",r}({}),im=500,uT=.1,hT=1e3,Oc=new Kn(Ie.MOUNTED),Cc=new Kn(Ie.UNMOUNTED),df=new Kn(ii.BEFORE_RENDER),am=new Kn(ii.RERENDER),ff=new Kn(ii.AFTER_RENDER),vf=function(r){function t(e){var n;(0,N.Z)(this,t),n=(0,R.Z)(this,t),n.Element=pn,n.inited=!1,n.context={};var i=e.container,a=e.canvas,s=e.renderer,o=e.width,l=e.height,c=e.background,u=e.cursor,h=e.supportsMutipleCanvasesInOneContainer,d=e.cleanUpOnDestroy,f=d===void 0?!0:d,v=e.offscreenCanvas,g=e.devicePixelRatio,p=e.requestAnimationFrame,y=e.cancelAnimationFrame,b=e.createImage,w=e.supportsTouchEvents,O=e.supportsPointerEvents,_=e.isTouchEvent,F=e.isMouseEvent,W=e.dblClickSpeed,j=o,H=l,K=g||ef&&window.devicePixelRatio||1;return K=K>=1?Math.ceil(K):1,a&&(j=o||ZM(a)||a.width/K,H=l||WM(a)||a.height/K),n.customElements=new oT,n.devicePixelRatio=K,n.requestAnimationFrame=p!=null?p:rf.bind(Ut.globalThis),n.cancelAnimationFrame=y!=null?y:Zp.bind(Ut.globalThis),n.createImage=b!=null?b:function(){return new window.Image},n.supportsTouchEvents=w!=null?w:"ontouchstart"in Ut.globalThis,n.supportsPointerEvents=O!=null?O:!!Ut.globalThis.PointerEvent,n.isTouchEvent=_!=null?_:function(et){return n.supportsTouchEvents&&et instanceof Ut.globalThis.TouchEvent},n.isMouseEvent=F!=null?F:function(et){return!Ut.globalThis.MouseEvent||et instanceof Ut.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(et instanceof Ut.globalThis.PointerEvent))},v&&(Ut.offscreenCanvas=v),n.document=new tm,n.document.defaultView=n,h||BM(i,n,f),n.initRenderingContext((0,D.Z)((0,D.Z)({},e),{},{width:j,height:H,background:c!=null?c:"transparent",cursor:u!=null?u:"default",cleanUpOnDestroy:f,devicePixelRatio:K,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:W!=null?W:200})),n.initDefaultCamera(j,H,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"initRenderingContext",value:function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(n,i,a){var s=this,o=new Ut.CameraContribution;o.clipSpaceNearZ=a,o.setType(an.EXPLORING,Id.DEFAULT).setPosition(n/2,i/2,im).setFocalPoint(n/2,i/2,0).setOrthographic(n/-2,n/2,i/2,i/-2,uT,hT),o.canvas=this,o.eventEmitter.on(Yg.UPDATED,function(){s.context.renderingContext.renderReasons.add(lo.CAMERA_CHANGED),Ut.enableSizeAttenuation&&s.getConfig().renderer.getConfig().enableSizeAttenuation&&s.updateSizeAttenuation()}),this.context.camera=o}},{key:"updateSizeAttenuation",value:function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(i){Ut.styleValueRegistry.updateSizeAttenuation(i,n)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(i){n.resolveReadyPromise=function(){i(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,a=arguments.length>1?arguments[1]:void 0;zn.clearCache();var s=((n=this.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;a||this.dispatchEvent(new Kn(ii.BEFORE_DESTROY),s,s),this.frameId&&this.cancelAnimationFrame(this.frameId);var o=this.getRoot();i&&(this.unmountChildren(o),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),a||this.dispatchEvent(new Kn(ii.AFTER_DESTROY),s,s);var l=function(u){u.currentTarget=null,u.manager=null,u.target=null,u.relatedNode=null};l(Oc),l(Cc),l(df),l(am),l(ff),l(qi),l(cf),l(uf),l($p),Ut.textService.clearCache()}},{key:"changeSize",value:function(n,i){this.resize(n,i)}},{key:"resize",value:function(n,i){var a,s=this.context.config;s.width=n,s.height=i,this.getContextService().resize(n,i);var o=this.context.camera,l=o.getProjectionMode();o.setPosition(n/2,i/2,im).setFocalPoint(n/2,i/2,0),l===vi.ORTHOGRAPHIC?o.setOrthographic(n/-2,n/2,i/2,i/-2,o.getNear(),o.getFar()):o.setAspect(n/i);var c=((a=s.future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;this.dispatchEvent(new Kn(ii.RESIZE,{width:n,height:i}),c,c)}},{key:"appendChild",value:function(n,i){return this.document.documentElement.appendChild(n,i)}},{key:"insertBefore",value:function(n,i){return this.document.documentElement.insertBefore(n,i)}},{key:"removeChild",value:function(n){return this.document.documentElement.removeChild(n)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(n){var i,a=this;n&&(df.detail=n,ff.detail=n);var s=((i=this.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;this.dispatchEvent(df,s,s);var o=this.getRenderingService();o.render(this,n,function(){a.dispatchEvent(am,s,s)}),this.dispatchEvent(ff,s,s)}},{key:"run",value:function(){var n=this,i=function(s,o){n.render(o),n.frameId=n.requestAnimationFrame(i)};i()}},{key:"initRenderer",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new nm,new rm,new em([new cT])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService((0,D.Z)((0,D.Z)({},Ut),this.context)),this.context.renderingService=new SA(Ut,this.context),this.context.eventService=new wA(Ut,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,a,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,a)}).catch(function(s){console.error(s)})}},{key:"initRenderingService",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.context.renderingService.init(function(){var o;i.inited=!0;var l=((o=i.getConfig().future)===null||o===void 0?void 0:o.experimentalCancelEventPropagation)===!0;a?s?i.requestAnimationFrame(function(){i.dispatchEvent(new Kn(ii.READY),l,l)}):i.dispatchEvent(new Kn(ii.READY),l,l):i.dispatchEvent(new Kn(ii.RENDERER_CHANGED),l,l),i.readyPromise&&i.resolveReadyPromise(),a||i.getRoot().forEach(function(c){var u,h;(u=(h=c).dirty)===null||u===void 0||u.call(h,!0,!0)}),i.mountChildren(i.getRoot()),n.getConfig().enableAutoRendering&&i.run()})}},{key:"loadRendererContainerModule",value:function(n){var i=this,a=n.getPlugins();a.forEach(function(s){s.context=i.context,s.init(Ut)})}},{key:"setRenderer",value:function(n){var i=this.getConfig();if(i.renderer!==n){var a=i.renderer;i.renderer=n,this.destroy(!1,!0),(0,k.Z)((a==null?void 0:a.getPlugins())||[]).reverse().forEach(function(s){s.destroy(Ut)}),this.initRenderer(n)}}},{key:"setCursor",value:function(n){var i=this.getConfig();i.cursor=n,this.getContextService().applyCursorStyle(n)}},{key:"unmountChildren",value:function(n){var i=this;if(n.childNodes.forEach(function(o){i.unmountChildren(o)}),this.inited){if(n.isMutationObserved)n.dispatchEvent(Cc);else{var a,s=((a=this.getConfig().future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;Cc.target=n,this.dispatchEvent(Cc,!0,s)}n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1}n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()}},{key:"mountChildren",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xc(n);if(this.inited){if(!n.isConnected&&(n.ownerDocument=this.document,n.isConnected=!0,!a))if(n.isMutationObserved)n.dispatchEvent(Oc);else{var s,o=((s=this.getConfig().future)===null||s===void 0?void 0:s.experimentalCancelEventPropagation)===!0;Oc.target=n,this.dispatchEvent(Oc,!0,o)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName);n.childNodes.forEach(function(l){i.mountChildren(l,a)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()}},{key:"mountFragment",value:function(n){this.mountChildren(n,!1)}},{key:"client2Viewport",value:function(n){return this.getEventService().client2Viewport(n)}},{key:"viewport2Client",value:function(n){return this.getEventService().viewport2Client(n)}},{key:"viewport2Canvas",value:function(n){return this.getEventService().viewport2Canvas(n)}},{key:"canvas2Viewport",value:function(n){return this.getEventService().canvas2Viewport(n)}},{key:"getPointByClient",value:function(n,i){return this.client2Viewport({x:n,y:i})}},{key:"getClientByPoint",value:function(n,i){return this.viewport2Client({x:n,y:i})}}])}(Hp);var dT=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.landmarks=[],e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"rotate",value:function(n,i,a){if(this.relElevation=io(i),this.relAzimuth=io(n),this.relRoll=io(a),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===an.EXPLORING){var s=Na(Xn(),[1,0,0],rn((this.rotateWorld?1:-1)*this.relElevation)),o=Na(Xn(),[0,1,0],rn((this.rotateWorld?1:-1)*this.relAzimuth)),l=Na(Xn(),[0,0,1],rn(this.relRoll)),c=ka(Xn(),o,s);c=ka(Xn(),c,l);var u=Wo(Wt(),c);Ht(this.matrix,this.matrix,[0,0,-this.distance]),Jt(this.matrix,this.matrix,u),Ht(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===an.ORBITING||this.type===an.EXPLORING?this._getPosition():this.type===an.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(n,i){var a=Ir(n,i,0),s=wt(this.position);return Vt(s,s,Rt(gt(),this.right,a[0])),Vt(s,s,Rt(gt(),this.up,a[1])),this._setPosition(s),this.triggerUpdate(),this}},{key:"dolly",value:function(n){var i=this.forward,a=wt(this.position),s=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return s=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,a[0]+=s*i[0],a[1]+=s*i[1],a[2]+=s*i[2],this._setPosition(a),this.type===an.ORBITING||this.type===an.EXPLORING?this._getDistance():this.type===an.TRACKING&&Vt(this.focalPoint,a,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(n){var i,a,s,o,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=l.position,u=c===void 0?this.position:c,h=l.focalPoint,d=h===void 0?this.focalPoint:h,f=l.roll,v=l.zoom,g=new Ut.CameraContribution;g.setType(this.type,void 0),g.setPosition(u[0],(i=u[1])!==null&&i!==void 0?i:this.position[1],(a=u[2])!==null&&a!==void 0?a:this.position[2]),g.setFocalPoint(d[0],(s=d[1])!==null&&s!==void 0?s:this.focalPoint[1],(o=d[2])!==null&&o!==void 0?o:this.focalPoint[2]),g.setRoll(f!=null?f:this.roll),g.setZoom(v!=null?v:this.zoom);var p={name:n,matrix:he(g.getWorldTransform()),right:wt(g.right),up:wt(g.up),forward:wt(g.forward),position:wt(g.getPosition()),focalPoint:wt(g.getFocalPoint()),distanceVector:wt(g.getDistanceVector()),distance:g.getDistance(),dollyingStep:g.getDollyingStep(),azimuth:g.getAzimuth(),elevation:g.getElevation(),roll:g.getRoll(),relAzimuth:g.relAzimuth,relElevation:g.relElevation,relRoll:g.relRoll,zoom:g.getZoom()};return this.landmarks.push(p),p}},{key:"gotoLandmark",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=Ve(n)?this.landmarks.find(function(et){return et.name===n}):n;if(s){var o=ie(a)?{duration:a}:a,l=o.easing,c=l===void 0?"linear":l,u=o.duration,h=u===void 0?100:u,d=o.easingFunction,f=d===void 0?void 0:d,v=o.onfinish,g=v===void 0?void 0:v,p=o.onframe,y=p===void 0?void 0:p,b=.01;this.cancelLandmarkAnimation();var w=s.position,O=s.focalPoint,_=s.zoom,F=s.roll,W=f||Ut.EasingFunction(c),j,H=function(){i.setFocalPoint(O),i.setPosition(w),i.setRoll(F),i.setZoom(_),i.computeMatrix(),i.triggerUpdate(),g==null||g()};if(h===0)return H();var K=function(rt){j===void 0&&(j=rt);var lt=rt-j;if(lt>=h){H();return}var ht=W(lt/h),yt=gt(),Nt=gt(),Ct=1,pt=0;Le(yt,i.focalPoint,O,ht),Le(Nt,i.position,w,ht),pt=i.roll*(1-ht)+F*ht,Ct=i.zoom*(1-ht)+_*ht,i.setFocalPoint(yt),i.setPosition(Nt),i.setRoll(pt),i.setZoom(Ct);var xt=cs(yt,O)+cs(Nt,w);if(xt<=b&&_===void 0&&F===void 0)return H();i.computeMatrix(),i.triggerUpdate(),lt<h&&(y==null||y(ht),i.landmarkAnimationID=i.canvas.requestAnimationFrame(K))};this.canvas.requestAnimationFrame(K)}}}])}(Xg);Ut.CameraContribution=dT;var sm=null,H8=0,om=new WeakMap,X8=null,K8=null,Nc,da;function Q8(r,t){return Nc=new sm(r,t)}function q8(r){return da||(da=sm.copy(Nc),da.oldValue=r,da)}function J8(){Nc=da=void 0}function fT(r){return r===da||r===Nc}function $8(r,t){return r===t?r:da&&fT(r)?da:null}function vT(r){r.nodes.forEach(function(t){var e=om.get(t);e&&e.forEach(function(n){n.observer===r&&n.removeTransientObservers()})})}function t9(r,t){for(var e=r;e;e=e.parentNode){var n=om.get(e);if(n)for(var i=0;i<n.length;i++){var a=n[i],s=a.options;if(!(e!==r&&!s.subtree)){var o=t(s);o&&a.enqueue(o)}}}}var gf=!1,pf=null;function e9(r){pf.push(r),gf||(gf=!0,typeof runtime.globalThis!="undefined"?runtime.globalThis.setTimeout(mf):mf())}function mf(){gf=!1;var r=pf;pf=[],r.sort(function(e,n){return e.uid-n.uid});var t=!1;r.forEach(function(e){var n=e.takeRecords();vT(e),n.length&&(e.callback(n,e),t=!0)}),t&&mf()}var yf=function(r){function t(e,n,i,a){var s;return(0,N.Z)(this,t),s=(0,R.Z)(this,t,[e]),s.currentTime=i,s.timelineTime=a,s.target=n,s.type="finish",s.bubbles=!1,s.currentTarget=n,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=i,s.timelineTime=a,s}return(0,C.Z)(t,r),(0,T.Z)(t)}(Ec),gT=0,pT=function(){function r(t,e){var n;(0,N.Z)(this,r),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(gT++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((n=this.effect)===null||n===void 0?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return(0,T.Z)(r,[{key:"pending",get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var e=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,i){e.resolveReadyPromise=function(){n(e)},e.rejectReadyPromise=function(){i(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var e=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,i){e.resolveFinishedPromise=function(){n(e)},e.rejectFinishedPromise=function(){i(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(e){if(e=Number(e),!isNaN(e)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var n;this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.currentTime)-e/this.playbackRate}this.currentTimePending=!1,this._currentTime!==e&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(e,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(e){if(e!==null){if(this.updatePromises(),e=Number(e),isNaN(e)||this._paused||this._idle)return;this._startTime=e,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(e){if(e!==this._playbackRate){this.updatePromises();var n=this.currentTime;this._playbackRate=e,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var e;if((e=this.effect.target)!==null&&e!==void 0&&e.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var n=this.oldPlayState,i=this.pending?"pending":this.playState;return this.readyPromise&&i!==n&&(i==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):n==="pending"?this.resolveReadyPromise():i==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&i!==n&&(i==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):i==="finished"?this.resolveFinishedPromise():n==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=i,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var e=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new yf(null,this,this.currentTime,null);setTimeout(function(){e.oncancel(n)})}}},{key:"reverse",value:function(){this.updatePromises();var e=this.currentTime;this.playbackRate*=-1,this.play(),e!==null&&(this.currentTime=e),this.updatePromises()}},{key:"updatePlaybackRate",value:function(e){this.playbackRate=e}},{key:"targetAnimations",value:function(){var e,n=(e=this.effect)===null||e===void 0?void 0:e.target;return n.getAnimations()}},{key:"markTarget",value:function(){var e=this.targetAnimations();e.indexOf(this)===-1&&e.push(this)}},{key:"unmarkTarget",value:function(){var e=this.targetAnimations(),n=e.indexOf(this);n!==-1&&e.splice(n,1)}},{key:"tick",value:function(e,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((e-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(e))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(nn)}},{key:"addEventListener",value:function(e,n,i){throw new Error(nn)}},{key:"removeEventListener",value:function(e,n,i){throw new Error(nn)}},{key:"dispatchEvent",value:function(e){throw new Error(nn)}},{key:"commitStyles",value:function(){throw new Error(nn)}},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var e;this._inEffect=!!((e=this.effect)!==null&&e!==void 0&&e.update(-1))}else{var n;this._inEffect=!!((n=this.effect)!==null&&n!==void 0&&n.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(e,n){e!==this._currentTime&&(this._currentTime=e,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(e){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var i=new yf(null,this,this.currentTime,e);setTimeout(function(){n.onfinish&&n.onfinish(i)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var a=new yf(null,this,this.currentTime,e);this.onframe(a)}this._finishedFlag=!1}}}])}(),mT=4,yT=.001,bT=1e-7,xT=10,ol=11,kc=1/(ol-1),ET=typeof Float32Array=="function",lm=function(t,e){return 1-3*e+3*t},cm=function(t,e){return 3*e-6*t},um=function(t){return 3*t},Pc=function(t,e,n){return((lm(e,n)*t+cm(e,n))*t+um(e))*t},hm=function(t,e,n){return 3*lm(e,n)*t*t+2*cm(e,n)*t+um(e)},wT=function(t,e,n,i,a){var s,o,l=0;do o=e+(n-e)/2,s=Pc(o,i,a)-t,s>0?n=o:e=o;while(Math.abs(s)>bT&&++l<xT);return o},ST=function(t,e,n,i){for(var a=0;a<mT;++a){var s=hm(e,n,i);if(s===0)return e;var o=Pc(e,n,i)-t;e-=o/s}return e},bf=function(t,e,n,i){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===i)return function(l){return l};for(var a=ET?new Float32Array(ol):new Array(ol),s=0;s<ol;++s)a[s]=Pc(s*kc,t,n);var o=function(c){for(var u=0,h=1,d=ol-1;h!==d&&a[h]<=c;++h)u+=kc;--h;var f=(c-a[h])/(a[h+1]-a[h]),v=u+f*kc,g=hm(v,t,n);return g>=yT?ST(c,v,t,n):g===0?v:wT(c,u,u+kc,t,n)};return function(l){return l===0||l===1?l:Pc(o(l),e,i)}},MT=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},Rc=function(t){return Math.pow(t,2)},Lc=function(t){return Math.pow(t,3)},Dc=function(t){return Math.pow(t,4)},_c=function(t){return Math.pow(t,5)},Ic=function(t){return Math.pow(t,6)},Bc=function(t){return 1-Math.cos(t*Math.PI/2)},Fc=function(t){return 1-Math.sqrt(1-t*t)},zc=function(t){return t*t*(3*t-2)},jc=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((e*3-2)/22-t,2)},Zc=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=(0,P.Z)(e,2),i=n[0],a=i===void 0?1:i,s=n[1],o=s===void 0?.5:s,l=kn(Number(a),1,10),c=kn(Number(o),.1,2);return t===0||t===1?t:-l*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(Math.PI*2)*Math.asin(1/l))*(Math.PI*2)/c)},ll=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=(0,P.Z)(e,4),a=i[0],s=a===void 0?1:a,o=i[1],l=o===void 0?100:o,c=i[2],u=c===void 0?10:c,h=i[3],d=h===void 0?0:h;s=kn(s,.1,1e3),l=kn(l,.1,1e3),u=kn(u,.1,1e3),d=kn(d,.1,1e3);var f=Math.sqrt(l/s),v=u/(2*Math.sqrt(l*s)),g=v<1?f*Math.sqrt(1-v*v):0,p=1,y=v<1?(v*f+-d)/g:-d+f,b=n?n*t/1e3:t;return v<1?b=Math.exp(-b*v*f)*(p*Math.cos(g*b)+y*Math.sin(g*b)):b=(p+y*b)*Math.exp(-b*f),t===0||t===1?t:1-b},xf=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e,i=(0,P.Z)(n,2),a=i[0],s=a===void 0?10:a,o=i[1],l=o==="start"?Math.ceil:Math.floor;return l(kn(t,0,1)*s)/s},dm=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=(0,P.Z)(e,4),i=n[0],a=n[1],s=n[2],o=n[3];return bf(i,a,s,o)(t)},Wc=bf(.42,0,1,1),pi=function(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,n,i)}},mi=function(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?t(e*2,n,i)/2:1-t(e*-2+2,n,i)/2}},yi=function(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-e*2,n,i))/2:(t(e*2-1,n,i)+1)/2}},fm={steps:xf,"step-start":function(t){return xf(t,[1,"start"])},"step-end":function(t){return xf(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":dm,ease:function(t){return dm(t,[.25,.1,.25,1])},in:Wc,out:pi(Wc),"in-out":mi(Wc),"out-in":yi(Wc),"in-quad":Rc,"out-quad":pi(Rc),"in-out-quad":mi(Rc),"out-in-quad":yi(Rc),"in-cubic":Lc,"out-cubic":pi(Lc),"in-out-cubic":mi(Lc),"out-in-cubic":yi(Lc),"in-quart":Dc,"out-quart":pi(Dc),"in-out-quart":mi(Dc),"out-in-quart":yi(Dc),"in-quint":_c,"out-quint":pi(_c),"in-out-quint":mi(_c),"out-in-quint":yi(_c),"in-expo":Ic,"out-expo":pi(Ic),"in-out-expo":mi(Ic),"out-in-expo":yi(Ic),"in-sine":Bc,"out-sine":pi(Bc),"in-out-sine":mi(Bc),"out-in-sine":yi(Bc),"in-circ":Fc,"out-circ":pi(Fc),"in-out-circ":mi(Fc),"out-in-circ":yi(Fc),"in-back":zc,"out-back":pi(zc),"in-out-back":mi(zc),"out-in-back":yi(zc),"in-bounce":jc,"out-bounce":pi(jc),"in-out-bounce":mi(jc),"out-in-bounce":yi(jc),"in-elastic":Zc,"out-elastic":pi(Zc),"in-out-elastic":mi(Zc),"out-in-elastic":yi(Zc),spring:ll,"spring-in":ll,"spring-out":pi(ll),"spring-in-out":mi(ll),"spring-out-in":yi(ll)},AT=function(t){return MT(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},TT=function(t){return fm[AT(t)]||fm.linear},OT=function(t){return t},CT=1,NT=.5,vm=0;function gm(r,t){return function(e){if(e>=1)return 1;var n=1/r;return e+=t*n,e-e%n}}var Gc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",kT=new RegExp("cubic-bezier\\(".concat(Gc,",").concat(Gc,",").concat(Gc,",").concat(Gc,"\\)")),PT=/steps\(\s*(\d+)\s*\)/,RT=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Ef(r){var t=kT.exec(r);if(t)return bf.apply(void 0,(0,k.Z)(t.slice(1).map(Number)));var e=PT.exec(r);if(e)return gm(Number(e[1]),vm);var n=RT.exec(r);return n?gm(Number(n[1]),{start:CT,middle:NT,end:vm}[n[2]]):TT(r)}function LT(r){return Math.abs(DT(r)/(r.playbackRate||1))}function DT(r){var t;return r.duration===0||r.iterations===0?0:(r.duration==="auto"?0:Number(r.duration))*((t=r.iterations)!==null&&t!==void 0?t:1)}var pm=0,wf=1,Vc=2,mm=3;function _T(r,t,e){if(t===null)return pm;var n=e.endTime;return t<Math.min(e.delay,n)?wf:t>=Math.min(e.delay+r+e.endDelay,n)?Vc:mm}function IT(r,t,e,n,i){switch(n){case wf:return t==="backwards"||t==="both"?0:null;case mm:return e-i;case Vc:return t==="forwards"||t==="both"?r:null;case pm:return null}}function BT(r,t,e,n,i){var a=i;return r===0?t!==wf&&(a+=e):a+=n/r,a}function FT(r,t,e,n,i,a){var s=r===1/0?t%1:r%1;return s===0&&e===Vc&&n!==0&&(i!==0||a===0)&&(s=1),s}function zT(r,t,e,n){return r===Vc&&t===1/0?1/0:e===1?Math.floor(n)-1:Math.floor(n)}function jT(r,t,e){var n=r;if(r!=="normal"&&r!=="reverse"){var i=t;r==="alternate-reverse"&&(i+=1),n="normal",i!==1/0&&i%2!==0&&(n="reverse")}return n==="normal"?e:1-e}function ZT(r,t,e){var n=_T(r,t,e),i=IT(r,e.fill,t,n,e.delay);if(i===null)return null;var a=e.duration==="auto"?0:e.duration,s=BT(a,n,e.iterations,i,e.iterationStart),o=FT(s,e.iterationStart,n,e.iterations,i,a),l=zT(n,e.iterations,o,s),c=jT(e.direction,l,o);return e.currentIteration=l,e.progress=c,e.easingFunction(c)}function WT(r,t,e){var n=GT(r,t),i=VT(n,e);return function(a,s){if(s!==null)i.filter(function(l){return s>=l.applyFrom&&s<l.applyTo}).forEach(function(l){var c=s-l.startOffset,u=l.endOffset-l.startOffset,h=u===0?0:c/u;a.setAttribute(l.property,l.interpolation(h),!1,!1)});else for(var o in n)ym(o)&&a.setAttribute(o,null)}}function ym(r){return r!=="offset"&&r!=="easing"&&r!=="composite"&&r!=="computedOffset"}function GT(r,t){for(var e={},n=0;n<r.length;n++)for(var i in r[n])if(ym(i)){var a={offset:r[n].offset,computedOffset:r[n].computedOffset,easing:r[n].easing,easingFunction:Ef(r[n].easing)||t.easingFunction,value:r[n][i]};e[i]=e[i]||[],e[i].push(a)}return e}function VT(r,t){var e=[];for(var n in r)for(var i=r[n],a=0;a<i.length-1;a++){var s=a,o=a+1,l=i[s].computedOffset,c=i[o].computedOffset,u=l,h=c;a===0&&(u=-1/0,c===0&&(o=s)),a===i.length-2&&(h=1/0,l===1&&(s=o)),e.push({applyFrom:u,applyTo:h,startOffset:i[s].computedOffset,endOffset:i[o].computedOffset,easingFunction:i[s].easingFunction,property:n,interpolation:UT(n,i[s].value,i[o].value,t)})}return e.sort(function(d,f){return d.startOffset-f.startOffset}),e}var bm=function(t,e,n){return function(i){var a=xm(t,e,i);return ie(a)?a:n(a)}};function UT(r,t,e,n){var i=Pp[r];if(i&&i.syntax&&i.int){var a=Ut.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var s=a.parser,o=s?s(t,n):t,l=s?s(e,n):e,c=a.mixer(o,l,n);if(c){var u=bm.apply(void 0,(0,k.Z)(c));return function(h){return h===0?t:h===1?e:u(h)}}}}return bm(!1,!0,function(h){return h?e:t})}function xm(r,t,e){if(typeof r=="number"&&typeof t=="number")return r*(1-e)+t*e;if(typeof r=="boolean"&&typeof t=="boolean"||typeof r=="string"&&typeof t=="string")return e<.5?r:t;if(Array.isArray(r)&&Array.isArray(t)){for(var n=r.length,i=t.length,a=Math.max(n,i),s=[],o=0;o<a;o++)s.push(xm(r[o<n?o:n-1],t[o<i?o:i-1],e));return s}throw new Error("Mismatched interpolation arguments ".concat(r,":").concat(t))}var YT=function(){function r(){(0,N.Z)(this,r),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=OT,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return(0,T.Z)(r,[{key:"easing",get:function(){return this._easing},set:function(e){this.easingFunction=Ef(e),this._easing=e}}])}();function HT(r){var t=[];for(var e in r)if(!(e in["easing","offset","composite"])){var n=r[e];Array.isArray(n)||(n=[n]);for(var i=n.length,a=0;a<i;a++){if(!t[a]){var s={};"offset"in r&&(s.offset=Number(r.offset)),"easing"in r&&(s.easing=r.easing),"composite"in r&&(s.composite=r.composite),t[a]=s}n[a]!==void 0&&n[a]!==null&&(t[a][e]=n[a])}}return t.sort(function(o,l){return(o.computedOffset||0)-(l.computedOffset||0)}),t}function Em(r,t){if(r===null)return[];Array.isArray(r)||(r=HT(r));for(var e=r.map(function(l){var c={};t!=null&&t.composite&&(c.composite="auto");for(var u in l){var h=l[u];if(u==="offset"){if(h!==null){if(h=Number(h),!isFinite(h))throw new Error("Keyframe offsets must be numbers.");if(h<0||h>1)throw new Error("Keyframe offsets must be between 0 and 1.");c.computedOffset=h}}else if(u==="composite"&&["replace","add","accumulate","auto"].indexOf(h)===-1)throw new Error("".concat(h," compositing is not supported"));c[u]=h}return c.offset===void 0&&(c.offset=null),c.easing===void 0&&(c.easing=(t==null?void 0:t.easing)||"linear"),c.composite===void 0&&(c.composite="auto"),c}),n=!0,i=-1/0,a=0;a<e.length;a++){var s=e[a].offset;if(ye(s))n=!1;else{if(s<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=s}}e=e.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function o(){var l,c=e,u=c.length;if(e[u-1].computedOffset=Number((l=e[u-1].offset)!==null&&l!==void 0?l:1),u>1){var h;e[0].computedOffset=Number((h=e[0].offset)!==null&&h!==void 0?h:0)}for(var d=0,f=Number(e[0].computedOffset),v=1;v<u;v++){var g=e[v].computedOffset;if(!ye(g)&&!ye(f)){for(var p=1;p<v-d;p++)e[d+p].computedOffset=f+(Number(g)-f)*p/(v-d);d=v,f=Number(g)}}}return n||o(),e}var XT="backwards|forwards|both|none".split("|"),KT="reverse|alternate|alternate-reverse".split("|");function QT(r,t){var e=new YT;return t&&(e.fill="both",e.duration="auto"),typeof r=="number"&&!isNaN(r)?e.duration=r:r!==void 0&&Object.keys(r).forEach(function(n){if(r[n]!==void 0&&r[n]!==null&&r[n]!=="auto"){if((typeof e[n]=="number"||n==="duration")&&(typeof r[n]!="number"||isNaN(r[n]))||n==="fill"&&XT.indexOf(r[n])===-1||n==="direction"&&KT.indexOf(r[n])===-1)return;e[n]=r[n]}}),e}function qT(r,t){return r=JT(r!=null?r:{duration:"auto"}),QT(r,t)}function JT(r){return typeof r=="number"&&(isNaN(r)?r={duration:"auto"}:r={duration:r}),r}var $T=function(){function r(t,e,n){var i=this;(0,N.Z)(this,r),this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=qT(n,!1),this.timing.effect=this,this.timing.activeDuration=LT(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Em(e,this.timing),this.interpolations=WT(this.normalizedKeyframes,this.timing,this.target);var a=Ut.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,l){return l==="duration"?o.duration==="auto"?0:o.duration:l==="fill"?o.fill==="auto"?"none":o.fill:l==="localTime"?i.animation&&i.animation.currentTime||null:l==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:l==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[l]},set:function(){return!0}}):this.timing}return(0,T.Z)(r,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(e){return e===null?!1:(this.timeFraction=ZT(this.timing.activeDuration,e,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(e){this.normalizedKeyframes=Em(e)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(e){var n=this;Object.keys(e||{}).forEach(function(i){n.timing[i]=e[i]})}}])}();function wm(r,t){return Number(r.id)-Number(t.id)}var tO=function(){function r(t){var e=this;(0,N.Z)(this,r),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(n){e.currentTime=n,e.discardAnimations(),e.animations.length===0?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(n){var i=e.rafCallbacks;e.rafCallbacks=[],n<Number(e.currentTime)&&(n=Number(e.currentTime)),e.animations.sort(wm),e.animations=e.tick(n,!0,e.animations)[0],i.forEach(function(a){a[1](n)}),e.applyPendingEffects()},this.document=t}return(0,T.Z)(r,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(e,n,i){var a=new $T(e,n,i),s=new pT(a,this);return this.animations.push(s),this.restartWebAnimationsNextTick(),s.updatePromises(),s.play(),s.updatePromises(),s}},{key:"applyDirtiedAnimation",value:function(e){var n=this;if(!this.inTick){e.markTarget();var i=e.targetAnimations();i.sort(wm);var a=this.tick(Number(this.currentTime),!1,i.slice())[1];a.forEach(function(s){var o=n.animations.indexOf(s);o!==-1&&n.animations.splice(o,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(e){e==null||e.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(e){return e.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(e){return e.playState!=="finished"&&e.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(e){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,e]),n}},{key:"requestAnimationFrame",value:function(e){var n=this;return this.rAF(function(i){n.updateAnimationsPromises(),e(i),n.updateAnimationsPromises()})}},{key:"tick",value:function(e,n,i){var a=this,s,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=e,this.ticking=!1;var l=[],c=[],u=[],h=[];return i.forEach(function(d){d.tick(e,n),d._inEffect?(c.push(d.effect),d.markTarget()):(l.push(d.effect),d.unmarkTarget()),d._needsTick&&(a.ticking=!0);var f=d._inEffect||d._needsTick;d._inTimeline=f,f?u.push(d):h.push(d)}),(s=this.pendingEffects).push.apply(s,l),(o=this.pendingEffects).push.apply(o,c),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[u,h]}}])}();Ut.EasingFunction=Ef,Ut.AnimationTimeline=tO;var Sm=function(r){return ye(r)?"":r.toString()},eO=function(r){var t=Sm(r);return t.charAt(0).toUpperCase()+t.substring(1)},Uc=eO,nO=function(r){return typeof r=="object"&&r!==null},Sf=nO,rO=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},cl=rO,Mf=function(r,t){if(r===t)return!0;if(!r||!t||Ve(r)||Ve(t))return!1;if(cl(r)||cl(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Mf(r[n],t[n]),!!e);n++);return e}if(Sf(r)||Sf(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=Mf(r[i[n]],t[i[n]]),!!e);n++);return e}return!1},Zn=Mf;const iO={duration:500},aO={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"},n9={CHANGE:"change"};var wn;(function(r){r.NodeAdded="NodeAdded",r.NodeUpdated="NodeUpdated",r.NodeRemoved="NodeRemoved",r.EdgeAdded="EdgeAdded",r.EdgeUpdated="EdgeUpdated",r.EdgeRemoved="EdgeRemoved",r.ComboAdded="ComboAdded",r.ComboUpdated="ComboUpdated",r.ComboRemoved="ComboRemoved"})(wn||(wn={}));var Xr;(function(r){r.DRAW="draw",r.COLLAPSE="collapse",r.EXPAND="expand",r.TRANSFORM="transform"})(Xr||(Xr={}));var fa;(function(r){r.CLICK="canvas:click",r.DBLCLICK="canvas:dblclick",r.POINTER_OVER="canvas:pointerover",r.POINTER_LEAVE="canvas:pointerleave",r.POINTER_ENTER="canvas:pointerenter",r.POINTER_MOVE="canvas:pointermove",r.POINTER_OUT="canvas:pointerout",r.POINTER_DOWN="canvas:pointerdown",r.POINTER_UP="canvas:pointerup",r.CONTEXT_MENU="canvas:contextmenu",r.DRAG_START="canvas:dragstart",r.DRAG="canvas:drag",r.DRAG_END="canvas:dragend",r.DRAG_ENTER="canvas:dragenter",r.DRAG_OVER="canvas:dragover",r.DRAG_LEAVE="canvas:dragleave",r.DROP="canvas:drop",r.WHEEL="canvas:wheel"})(fa||(fa={}));var Cs;(function(r){r.CLICK="combo:click",r.DBLCLICK="combo:dblclick",r.POINTER_OVER="combo:pointerover",r.POINTER_LEAVE="combo:pointerleave",r.POINTER_ENTER="combo:pointerenter",r.POINTER_MOVE="combo:pointermove",r.POINTER_OUT="combo:pointerout",r.POINTER_DOWN="combo:pointerdown",r.POINTER_UP="combo:pointerup",r.CONTEXT_MENU="combo:contextmenu",r.DRAG_START="combo:dragstart",r.DRAG="combo:drag",r.DRAG_END="combo:dragend",r.DRAG_ENTER="combo:dragenter",r.DRAG_OVER="combo:dragover",r.DRAG_LEAVE="combo:dragleave",r.DROP="combo:drop"})(Cs||(Cs={}));var Bt;(function(r){r.CLICK="click",r.DBLCLICK="dblclick",r.POINTER_OVER="pointerover",r.POINTER_LEAVE="pointerleave",r.POINTER_ENTER="pointerenter",r.POINTER_MOVE="pointermove",r.POINTER_OUT="pointerout",r.POINTER_DOWN="pointerdown",r.POINTER_UP="pointerup",r.CONTEXT_MENU="contextmenu",r.DRAG_START="dragstart",r.DRAG="drag",r.DRAG_END="dragend",r.DRAG_ENTER="dragenter",r.DRAG_OVER="dragover",r.DRAG_LEAVE="dragleave",r.DROP="drop",r.KEY_DOWN="keydown",r.KEY_UP="keyup",r.WHEEL="wheel",r.PINCH="pinch"})(Bt||(Bt={}));var uo;(function(r){r.KEY_DOWN="keydown",r.KEY_UP="keyup"})(uo||(uo={}));var Yc;(function(r){r.CLICK="edge:click",r.DBLCLICK="edge:dblclick",r.POINTER_OVER="edge:pointerover",r.POINTER_LEAVE="edge:pointerleave",r.POINTER_ENTER="edge:pointerenter",r.POINTER_MOVE="edge:pointermove",r.POINTER_OUT="edge:pointerout",r.POINTER_DOWN="edge:pointerdown",r.POINTER_UP="edge:pointerup",r.CONTEXT_MENU="edge:contextmenu",r.DRAG_ENTER="edge:dragenter",r.DRAG_OVER="edge:dragover",r.DRAG_LEAVE="edge:dragleave",r.DROP="edge:drop"})(Yc||(Yc={}));var Kt;(function(r){r.BEFORE_CANVAS_INIT="beforecanvasinit",r.AFTER_CANVAS_INIT="aftercanvasinit",r.BEFORE_SIZE_CHANGE="beforesizechange",r.AFTER_SIZE_CHANGE="aftersizechange",r.BEFORE_ELEMENT_CREATE="beforeelementcreate",r.AFTER_ELEMENT_CREATE="afterelementcreate",r.BEFORE_ELEMENT_UPDATE="beforeelementupdate",r.AFTER_ELEMENT_UPDATE="afterelementupdate",r.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",r.AFTER_ELEMENT_DESTROY="afterelementdestroy",r.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",r.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",r.BEFORE_DRAW="beforedraw",r.AFTER_DRAW="afterdraw",r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_ANIMATE="beforeanimate",r.AFTER_ANIMATE="afteranimate",r.BEFORE_LAYOUT="beforelayout",r.AFTER_LAYOUT="afterlayout",r.BEFORE_STAGE_LAYOUT="beforestagelayout",r.AFTER_STAGE_LAYOUT="afterstagelayout",r.BEFORE_TRANSFORM="beforetransform",r.AFTER_TRANSFORM="aftertransform",r.BATCH_START="batchstart",r.BATCH_END="batchend",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.BEFORE_RENDERER_CHANGE="beforerendererchange",r.AFTER_RENDERER_CHANGE="afterrendererchange"})(Kt||(Kt={}));var Ia;(function(r){r.UNDO="undo",r.REDO="redo",r.CANCEL="cancel",r.ADD="add",r.CLEAR="clear",r.CHANGE="change"})(Ia||(Ia={}));var bi;(function(r){r.CLICK="node:click",r.DBLCLICK="node:dblclick",r.POINTER_OVER="node:pointerover",r.POINTER_LEAVE="node:pointerleave",r.POINTER_ENTER="node:pointerenter",r.POINTER_MOVE="node:pointermove",r.POINTER_OUT="node:pointerout",r.POINTER_DOWN="node:pointerdown",r.POINTER_UP="node:pointerup",r.CONTEXT_MENU="node:contextmenu",r.DRAG_START="node:dragstart",r.DRAG="node:drag",r.DRAG_END="node:dragend",r.DRAG_ENTER="node:dragenter",r.DRAG_OVER="node:dragover",r.DRAG_LEAVE="node:dragleave",r.DROP="node:drop"})(bi||(bi={}));const hn="combo",ai="tree";var ul;(function(r){r.NODE="node",r.EDGE="edge",r.COMBO="combo",r.THEME="theme",r.PALETTE="palette",r.LAYOUT="layout",r.BEHAVIOR="behavior",r.PLUGIN="plugin",r.ANIMATION="animation",r.TRANSFORM="transform",r.SHAPE="shape"})(ul||(ul={}));const Af={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function va(r,t){var e;const n=(e=Af[r])===null||e===void 0?void 0:e[t];if(n)return n}function r9(r){return EXTENSION_REGISTRY[r]}const sO="5.0.49",oO="G6";function ga(r){return`[${oO} v${sO}] ${r}`}const Kr={mute:!1,debug:r=>{!Kr.mute&&console.debug(ga(r))},info:r=>{!Kr.mute&&console.info(ga(r))},warn:r=>{!Kr.mute&&console.warn(ga(r))},error:r=>{!Kr.mute&&console.error(ga(r))}};function Mm(r){const{theme:t}=r;if(!t)return{};const e=va(ul.THEME,t);return e||(Kr.warn(`The theme of ${t} is not registered.`),{})}function Tf(r,t){if(Array.isArray(r)&&r.length===0)return null;const e=Array.isArray(r)?r[0]:r,n=Array.isArray(r)?r.slice(1):t||[];return new Proxy(e,{get(i,a){return typeof i[a]=="function"&&!["onframe","onfinish"].includes(a)?(...s)=>{i[a](...s),n.forEach(o=>{var l;return(l=o[a])===null||l===void 0?void 0:l.call(o,...s)})}:a==="finished"?Promise.all([e.finished,...n.map(s=>s.finished)]):Reflect.get(i,a)},set(i,a,s){return["onframe","onfinish"].includes(a)||n.forEach(o=>{o[a]=s}),Reflect.set(i,a,s)}})}function Of(r){const t=r.reduce((n,i)=>(Object.entries(i).forEach(([a,s])=>{n[a]===void 0?n[a]=[s]:n[a].push(s)}),n),{});Object.entries(t).forEach(([n,i])=>{(i.length!==r.length||i.some(a=>ye(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(n)&&Zn(a,i[0])))&&delete t[n]});const e=Object.entries(t).reduce((n,[i,a])=>(a.forEach((s,o)=>{n[o]?n[o][i]=s:n[o]={[i]:s}}),n),[]);return r.length!==0&&e.length===0&&e.push({_:0},{_:0}),e}function hl(r){switch(r){case"opacity":return 1;case"x":case"y":case"z":case"zIndex":return 0;case"visibility":return"visible";case"collapsed":return!1;case"states":return[];default:return}}function Am(r,t){const{animation:e}=r;if(e===!1||t===!1)return!1;const n=Object.assign({},iO);return Fn(e)&&Object.assign(n,e),Fn(t)&&Object.assign(n,t),n}function lO(r){if(typeof r=="string"){const t=va(ul.ANIMATION,r);return t||(Kr.warn(`The animation of ${r} is not registered.`),[])}return r}function cO(r,t,e,n){var i,a;const{animation:s}=r;if(s===!1||n===!1)return[];const o=(i=r==null?void 0:r[t])===null||i===void 0?void 0:i.animation;if(o===!1)return[];const l=o==null?void 0:o[e];if(l===!1)return[];const c=(a=Mm(r)[t])===null||a===void 0?void 0:a.animation,u=(d=[])=>lO(d).map(f=>Object.assign(Object.assign(Object.assign(Object.assign({},aO),Fn(s)&&s),f),Fn(n)&&n));if(l)return u(l);if(!c)return[];const h=c[e];return h===!1?[]:u(h)}function Tm(r,t,e,n=[]){if(!n&&r===0&&t===0&&e===0)return null;if(Array.isArray(n)){let a=-1;const s=[];for(let o=0;o<n.length;o++){const l=n[o];if(l[0]==="translate"){if(l[1]===r&&l[2]===t)return null;a=o,s.push(["translate",r,t])}else if(l[0]==="translate3d"){if(l[1]===r&&l[2]===t&&l[3]===e)return null;a=o,s.push(["translate3d",r,t,e!=null?e:0])}else s.push(l)}return a===-1&&s.splice(0,0,ie(e)?["translate3d",r,t,e!=null?e:0]:["translate",r,t]),s.length===0?null:s}const i=n?n.replace(/translate(3d)?\([^)]*\)/g,""):"";return e===0?`translate(${r}, ${t})${i}`:`translate3d(${r}, ${t}, ${e})${i}`}var uO=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const hO=(r,t,e)=>{if(!e.length)return null;const[n,i]=t,a=c=>{var u;if(c){const h=r.getShape(c);if(!h)return null;const d=`get${Uc(c)}Style`,f=((u=r==null?void 0:r[d])===null||u===void 0?void 0:u.bind(r))||(p=>p),v=(f==null?void 0:f(n))||{},g=(f==null?void 0:f(i))||{};return{shape:h,fromStyle:v,toStyle:g}}else return{shape:r,fromStyle:n,toStyle:i}};let s;const o=e.map(c=>{var{fields:u,shape:h,states:d}=c,f=uO(c,["fields","shape","states"]);const v=a(h);if(!v)return null;const{shape:g,fromStyle:p,toStyle:y}=v,b=[{},{}];if(u.forEach(O=>{var _,F;Object.assign(b[0],{[O]:(_=p[O])!==null&&_!==void 0?_:hl(O)}),Object.assign(b[1],{[O]:(F=y[O])!==null&&F!==void 0?F:hl(O)})}),b.some(O=>Object.keys(O).some(_=>["x","y","z"].includes(_)))){const{x:O=0,y:_=0,z:F,transform:W=""}=g.attributes||{};b.forEach(j=>{var H,K,et;j.transform=Tm((H=j.x)!==null&&H!==void 0?H:O,(K=j.y)!==null&&K!==void 0?K:_,(et=j.z)!==null&&et!==void 0?et:F,W)})}const w=g.animate(Of(b),f);return h===void 0&&(s=w),w}).filter(Boolean),l=s||(o==null?void 0:o[0]);return l?Tf(l,o.filter(c=>c!==c)):null},dO=[{fields:["opacity"]}],fO=[{fields:["x","y"]}],Om=[{fields:["x","y"]}],vO=Om,Cm=[{fields:["sourceNode","targetNode"]}],gO=Cm,Nm=[{fields:["childrenNode","x","y"]}],pO=Nm,i9=[{fields:["childrenNode","x","y"]}];var mO=Object.prototype.hasOwnProperty;function yO(r,t){if(!t||!Gr(r))return{};for(var e={},n=fe(t)?t:function(o){return o[t]},i,a=0;a<r.length;a++){var s=r[a];i=n(s),mO.call(e,i)?e[i].push(s):e[i]=[s]}return e}var Hc=yO,km=function(r,t,e){var n,i,a,s,o=0;e||(e={});var l=function(){o=e.leading===!1?0:Date.now(),n=null,s=r.apply(i,a),n||(i=a=null)},c=function(){var u=Date.now();!o&&e.leading===!1&&(o=u);var h=t-(u-o);return i=this,a=arguments,h<=0||h>t?(n&&(clearTimeout(n),n=null),o=u,s=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(l,h)),s};return c.cancel=function(){clearTimeout(n),o=0,n=i=a=null},c},Cf=function(r){if(typeof r!="object"||r===null)return r;var t;if(Gr(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=Cf(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=Cf(r[i]):t[i]=r[i]}return t},ho=Cf;function bO(r){return"source"in r&&"target"in r}function xO(r){return r.length===2}function a9(r){return r.length===3}function fo(r){return r instanceof Float32Array?!0:Array.isArray(r)&&(r.length===2||r.length===3)?r.every(t=>typeof t=="number"):!1}function $i(r,t,e){return r>=t&&r<=e}function Ri(r=0){if(Array.isArray(r)){const[t=0,e=t,n=t,i=e]=r;return[t,e,n,i]}return[r,r,r,r]}function EO(r=0){const t=Ri(r);return t[0]+t[2]}function s9(r=0){const t=Ri(r);return t[1]+t[3]}function ta(r){return r.max[0]-r.min[0]}function ea(r){return r.max[1]-r.min[1]}function Ba(r){return[ta(r),ea(r)]}function Fa(r,t){const e=fo(r)?Nf(r):r.getShape("key").getBounds();return t?za(e,t):e}function Nf(r){const[t,e,n=0]=r,i=new gn;return i.setMinMax([t,e,n],[t,e,n]),i}function za(r,t){const[e,n,i,a]=Ri(t),[s,o,l]=r.min,[c,u,h]=r.max,d=new gn;return d.setMinMax([s-a,o-e,l],[c+n,u+i,h]),d}function dl(r){if(r.length===0)return new gn;if(r.length===1)return r[0];const t=new gn;t.setMinMax(r[0].min,r[0].max);for(let e=1;e<r.length;e++){const n=r[e];t.setMinMax([Math.min(t.min[0],n.min[0]),Math.min(t.min[1],n.min[1]),Math.min(t.min[2],n.min[2])],[Math.max(t.max[0],n.max[0]),Math.max(t.max[1],n.max[1]),Math.max(t.max[2],n.max[2])])}return t}function wO(r,t){const[e,n]=r.min,[i,a]=r.max,[s,o]=t.min,[l,c]=t.max;return e>=s&&i<=l&&n>=o&&a<=c}function Li(r,t){return $i(r[0],t.min[0],t.max[0])&&$i(r[1],t.min[1],t.max[1])}function Pm(r,t,e=!1){const{min:[n,i],max:[a,s]}=t,o=(r[1]===i||r[1]===s)&&(e||$i(r[0],n,a)),l=(r[0]===n||r[0]===a)&&(e||$i(r[1],i,s));return o||l}function SO(r,t){return!Li(r,t)}function Xc(r,t){const{center:e}=t;return r[0]===e[0]&&r[1]===e[1]}function fl(r,t){const[e,n]=r,[i,a]=t.min,[s,o]=t.max,l=e-i,c=s-e,u=n-a,h=o-n,d=Math.min(l,c,u,h);return d===l?"left":d===c?"right":d===u?"top":d===h?"bottom":"left"}function Ns(r,t){const e=ho(r);if(Li(r,t))switch(fl(r,t)){case"left":e[0]=t.min[0];break;case"right":e[0]=t.max[0];break;case"top":e[1]=t.min[1];break;case"bottom":e[1]=t.max[1];break}else{const[n,i]=r,[a,s]=t.min,[o,l]=t.max;e[0]=$i(n,a,o)?n:n<a?a:o,e[1]=$i(i,s,l)?i:i<s?s:l}return e}function MO(r,t){const{center:e}=r,[n,i]=Ba(r),a=t==="up"||t==="down"?e[0]:t==="right"?e[0]-n/6:e[0]+n/6,s=t==="left"||t==="right"?e[1]:t==="down"?e[1]-i/6:e[1]+i/6;return[a,s]}function AO(r,t){let[e,n]=Ba(r);return[e,n]=t==="up"||t==="down"?[e,n]:[n,e],(Math.pow(n,2)-Math.pow(Math.sqrt(Math.pow(e/2,2)+Math.pow(n,2))-e/2,2))/(2*n)}function TO(r){const{min:[t,e],max:[n,i]}=r,a=[t,i],s=[n,i],o=[n,e],l=[t,e];return[[a,s],[s,o],[o,l],[l,a]]}var OO=function(t,e){var n=t.nodes,i=t.edges,a=[],s={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(o,l){s[o.id]=l;var c=[];a.push(c)}),i&&i.forEach(function(o){var l=o.source,c=o.target,u=s[l],h=s[c];!u&&u!==0||!h&&h!==0||(a[u][h]=1,e||(a[h][u]=1))}),a},Kc=OO,CO=function(t,e){return t===e},Rm=function(){function r(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return r.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},r}(),NO=function(){function r(t){t===void 0&&(t=CO),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new Rm(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new Rm(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},r.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},r.prototype.find=function(t){var e=t.value,n=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var s=this.head;s;){if(a&&a(s.value)||n!==void 0&&this.compare(s.value,n))return s;s=s.next}return null},r.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},r.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},r.prototype.fromArray=function(t){var e=this;return t.forEach(function(n){return e.append(n)}),this},r.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},r.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},r.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},r}(),Lm=NO,kO=function(){function r(){this.linkedList=new Lm}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(t){this.linkedList.append(t)},r.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toString=function(t){return this.linkedList.toString(t)},r}(),PO=kO,xi=function(t,e,n){e===void 0&&(e=[]);var i=e.filter(function(l){return l.source===t||l.target===t});if(n==="target"){var a=function(c){return c.source===t};return i.filter(a).map(function(l){return l.target})}if(n==="source"){var s=function(c){return c.target===t};return i.filter(s).map(function(l){return l.source})}var o=function(c){return c.source===t?c.target:c.source};return i.map(o)},RO=function(t,e){return e.filter(function(n){return n.source===t})},Qc=function(t,e){return e.filter(function(n){return n.source===t||n.target===t})},Dm=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};function LO(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var s=a.next,o=s;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}var DO=function(t,e,n,i){i===void 0&&(i=!0);var a=LO(n),s=new PO,o=t.edges,l=o===void 0?[]:o;s.enqueue(e);for(var c="",u=function(){var d=s.dequeue();a.enter({current:d,previous:c}),xi(d,l,i?"target":void 0).forEach(function(f){a.allowTraversal({previous:c,current:d,next:f})&&s.enqueue(f)}),a.leave({current:d,previous:c}),c=d};!s.isEmpty();)u()},_O=DO,IO=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,s=[],o={},l=[],c=function f(v){l.push(v),o[v.id]=!0;for(var g=xi(v.id,a),p=function(w){var O=g[w];if(!o[O]){var _=n.filter(function(F){return F.id===O});_.length>0&&f(_[0])}},y=0;y<g.length;++y)p(y)},u=0;u<n.length;u++){var h=n[u];if(!o[h.id]){c(h);for(var d=[];l.length>0;)d.push(l.pop());s.push(d)}}return s},_m=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,s=[],o={},l={},c={},u=[],h=0,d=function p(y){l[y.id]=h,c[y.id]=h,h+=1,s.push(y),o[y.id]=!0;for(var b=xi(y.id,a,"target").filter(function(W){return n.map(function(j){return j.id}).indexOf(W)>-1}),w=function(j){var H=b[j];if(!l[H]&&l[H]!==0){var K=n.filter(function(et){return et.id===H});K.length>0&&p(K[0]),c[y.id]=Math.min(c[y.id],c[H])}else o[H]&&(c[y.id]=Math.min(c[y.id],l[H]))},O=0;O<b.length;O++)w(O);if(c[y.id]===l[y.id]){for(var _=[];s.length>0;){var F=s.pop();if(o[F.id]=!1,_.push(F),F===y)break}_.length>0&&u.push(_)}},f=0,v=n;f<v.length;f++){var g=v[f];!l[g.id]&&l[g.id]!==0&&d(g)}return u};function Im(r,t){return t?_m(r):IO(r)}var vl=function(t){var e={},n=t.nodes,i=n===void 0?[]:n,a=t.edges,s=a===void 0?[]:a;return i.forEach(function(o){e[o.id]={degree:0,inDegree:0,outDegree:0}}),s.forEach(function(o){e[o.source].degree++,e[o.source].outDegree++,e[o.target].degree++,e[o.target].inDegree++}),e},kf=vl,BO=function(t,e){var n=vl(t);return n[e]?vl(t)[e].inDegree:0},FO=function(t,e){var n=vl(t);return n[e]?vl(t)[e].outDegree:0};function zO(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var s=a.next;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}function Bm(r,t,e,n,i){i===void 0&&(i=!0),n.enter({current:t,previous:e});var a=r.edges,s=a===void 0?[]:a;xi(t,s,i?"target":void 0).forEach(function(o){n.allowTraversal({previous:e,current:t,next:o})&&Bm(r,o,t,n,i)}),n.leave({current:t,previous:e})}function Fm(r,t,e,n){n===void 0&&(n=!0),Bm(r,t,"",zO(e),n)}var jO=function(t){var e=null,n=t.nodes,i=n===void 0?[]:n,a={},s={},o={},l={};i.forEach(function(h){s[h.id]=h});for(var c={enter:function(d){var f=d.current,v=d.previous;if(o[f]){e={};for(var g=f,p=v;p!==f;)e[g]=p,g=p,p=a[p];e[g]=p}else o[f]=f,delete s[f],a[f]=v},leave:function(d){var f=d.current;l[f]=f,delete o[f]},allowTraversal:function(d){var f=d.next;return e?!1:!l[f]}};Object.keys(s).length;){var u=Object.keys(s)[0];Fm(t,u,c)}return e},zm=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var s=[],o=Im(t,!1),l=0,c=o;l<c.length;l++){var u=c[l];if(u.length)for(var h=u[0],d=h.id,f=[h],v=(i={},i[d]=h,i),g=(a={},a[d]=new Set,a);f.length>0;)for(var p=f.pop(),y=p.id,b=xi(y,t.edges),w=function(F){var W,j=b[F],H=t.nodes.find(function(yt){return yt.id===j});if(j===y)s.push((W={},W[j]=p,W));else if(!(j in g))v[j]=p,f.push(H),g[j]=new Set([p]);else if(!g[y].has(H)){for(var K=!0,et=[H,p],rt=v[y];g[j].size&&!g[j].has(rt)&&(et.push(rt),rt!==v[rt.id]);)rt=v[rt.id];if(et.push(rt),e&&n?(K=!1,et.findIndex(function(yt){return e.indexOf(yt.id)>-1})>-1&&(K=!0)):e&&!n&&et.findIndex(function(yt){return e.indexOf(yt.id)>-1})>-1&&(K=!1),K){for(var lt={},ht=1;ht<et.length;ht+=1)lt[et[ht-1].id]=et[ht];et.length&&(lt[et[et.length-1].id]=et[0]),s.push(lt)}g[j].add(p)}},O=0;O<b.length;O+=1)w(O)}return s},jm=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,s=[],o=[],l={},c={},u=function(rt){for(var lt=[rt];lt.length>0;){var ht=lt.pop();a.has(ht)&&(a.delete(ht),s[ht.id].forEach(function(yt){lt.push(yt)}),s[ht.id].clear())}},h=function et(rt,lt,ht){var yt=!1;if(e&&n===!1&&e.indexOf(rt.id)>-1)return yt;i.push(rt),a.add(rt);for(var Nt=ht[rt.id],Ct=0;Ct<Nt.length;Ct+=1){var pt=l[Nt[Ct]];if(pt===lt){for(var xt={},kt=1;kt<i.length;kt+=1)xt[i[kt-1].id]=i[kt];i.length&&(xt[i[i.length-1].id]=i[0]),o.push(xt),yt=!0}else a.has(pt)||et(pt,lt,ht)&&(yt=!0)}if(yt)u(rt);else for(var Ct=0;Ct<Nt.length;Ct+=1){var pt=l[Nt[Ct]];s[pt.id].has(rt)||s[pt.id].add(rt)}return i.pop(),yt},d=t.nodes,f=d===void 0?[]:d,v=0;v<f.length;v+=1){var g=f[v],p=g.id;c[p]=v,l[v]=g}if(e&&n)for(var y=function(rt){var lt=e[rt];c[f[rt].id]=c[lt],c[lt]=0,l[0]=f.find(function(ht){return ht.id===lt}),l[c[f[rt].id]]=f[rt]},v=0;v<e.length;v++)y(v);for(var b=function(rt){for(var lt,ht,yt=1/0,Nt=0;Nt<rt.length;Nt+=1)for(var Ct=rt[Nt],pt=0;pt<Ct.length;pt++){var xt=c[Ct[pt].id];xt<yt&&(yt=xt,ht=Nt)}for(var kt=rt[ht],jt=[],Nt=0;Nt<kt.length;Nt+=1){var Xt=kt[Nt];jt[Xt.id]=[];for(var ee=0,ce=xi(Xt.id,t.edges,"target").filter(function(me){return kt.map(function(De){return De.id}).indexOf(me)>-1});ee<ce.length;ee++){var ue=ce[ee];ue===Xt.id&&!(n===!1&&e.indexOf(Xt.id)>-1)?o.push((lt={},lt[Xt.id]=Xt,lt)):jt[Xt.id].push(c[ue])}}return{component:kt,adjList:jt,minIdx:yt}},w=0;w<f.length;){var O=f.filter(function(et){return c[et.id]>=w}),_=_m({nodes:O,edges:t.edges}).filter(function(et){return et.length>1});if(_.length===0)break;var F=b(_),W=F.minIdx,j=F.adjList,H=F.component;if(H.length>1){H.forEach(function(et){s[et.id]=new Set});var K=l[W];if(e&&n&&e.indexOf(K.id)===-1)return o;h(K,K,j),w=W+1}else break}return o},ZO=function(t,e,n,i){return i===void 0&&(i=!0),e?jm(t,n,i):zm(t,n,i)},Zm=jO,WO={}.toString,GO=function(r,t){return WO.call(r)==="[object "+t+"]"},qc=GO,Pf=function(r){return qc(r,"Function")},Rf=function(r){return Array.isArray?Array.isArray(r):qc(r,"Array")},VO=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function UO(r,t){if(r){var e;if(Rf(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(VO(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var Wm=UO,o9=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return Wm(r,function(e,n){Pf(r)&&n==="prototype"||t.push(n)}),t},l9=null;function c9(r,t){var e=keys(t),n=e.length;if(isNil(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var u9=null,h9=function(r){if(!isObjectLike(r)||!isType(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t},d9=null;function f9(r,t){if(!isArray(r))return null;var e;if(isFunction(t)&&(e=t),isPlainObject(t)&&(e=function(i){return isMatch(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}var v9=null,g9=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!isNil(a)){isArray(a)?e=a[0]:e=a;break}}return e},p9=null,m9=function(r){if(!isArray(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},y9=null,YO=function(r,t){if(t===void 0&&(t=[]),!isArray(r))t.push(r);else for(var e=0;e<r.length;e+=1)YO(r[e],t);return t},b9=null,x9=function(r){if(isArray(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},E9=function(r){if(isArray(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])},w9=function(r){var t=r.filter(function(s){return!isNaN(s)});if(!t.length)return{min:0,max:0};if(isArray(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=getMax(t),a=getMin(t);return{min:a,max:i}},S9=null,Gm=Array.prototype,HO=Gm.splice,XO=Gm.indexOf,M9=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=XO.call(r,i))>-1;)HO.call(r,a,1);return r},A9=null,KO=Array.prototype.splice,T9=function(t,e){if(!isArrayLike(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,s=e[n];(n===i||s!==a)&&(a=s,KO.call(t,s,1))}return t},O9=null,C9=function(r,t,e){if(!isArray(r)&&!isPlainObject(r))return r;var n=e;return each(r,function(i,a){n=t(n,i,a)}),n},N9=null,k9=function(r,t){var e=[];if(!isArrayLike(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var s=r[n];t(s,n,r)&&(e.push(s),i.push(n))}return pullAt(r,i),e},P9=null,Lf=function(r){return qc(r,"String")};function R9(r,t){var e;if(isFunction(t))e=function(i,a){return t(i)-t(a)};else{var n=[];isString(t)?n.push(t):isArray(t)&&(n=t),e=function(i,a){for(var s=0;s<n.length;s+=1){var o=n[s];if(i[o]>a[o])return 1;if(i[o]<a[o])return-1}return 0}}return r.sort(e),r}var L9=null;function Df(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var D9=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],s=a[t];if(!isNil(s)){isArray(s)||(s=[s]);for(var o=0;o<s.length;o++){var l=s[o];n[l]||(e.push(l),n[l]=!0)}}}return e};function _9(r,t){return isArray(r)||isString(r)?r[0]===t:!1}var I9=null;function B9(r,t){return isArray(r)||isString(r)?r[r.length-1]===t:!1}var F9=null,QO=Object.prototype.hasOwnProperty;function z9(r,t){if(!t||!isArray(r))return{};for(var e={},n=isFunction(t)?t:function(o){return o[t]},i,a=0;a<r.length;a++){var s=r[a];i=n(s),QO.call(e,i)?e[i].push(s):e[i]=[s]}return e}var j9=null;function Z9(r,t){if(!t)return{0:r};if(!isFunction(t)){var e=isArray(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,s=e.length;a<s;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return groupBy(r,t)}var W9=function(r,t){if(!t)return[r];var e=groupToMap(r,t),n=[];for(var i in e)n.push(e[i]);return n},Vm={};function G9(r){var t=Vm[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,Vm[r]=t}return t}var V9=null;function U9(r){var t=0,e=0,n=0,i=0;return isArray(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var Y9=null,qO=function(r){return qc(r,"Number")},JO=qO,H9=function(r){return isNumber(r)&&r%1!==0},X9=null,K9=function(r){return isNumber(r)&&r%2===0},Q9=null,q9=Number.isInteger?Number.isInteger:function(r){return JO(r)&&r%1===0},J9=null,$9=function(r){return isNumber(r)&&r<0},tz=null,ez=function(r){return isNumber(r)&&r%2!==0},nz=null,rz=function(r){return isNumber(r)&&r>0},iz=null,az=function(r,t){if(isArray(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],s=isFunction(t)?t(a):a[t];s>n&&(e=a,n=s)}return e}},sz=function(r,t){if(isArray(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],s=isFunction(t)?t(a):a[t];s<n&&(e=a,n=s)}return e}},$O=180/Math.PI,oz=function(r){return $O*r},lz=null,tC=Math.PI/180,cz=function(r){return tC*r},uz=null,hz=null,eC=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return Wm(r,function(e,n){Pf(r)&&n==="prototype"||t.push(e)}),t},nC=eC,dz=function(r,t){return contains(values(r),t)},rC={}.toString,fz=function(r){return rC.call(r).replace(/^\[object /,"").replace(/]$/,"")},vz=null,gz=function(r){return isType(r,"Arguments")},pz=null,mz=function(r){return isType(r,"Boolean")},yz=null,bz=function(r){return isType(r,"Date")},xz=null,Ez=function(r){return isType(r,"Error")},wz=null;function Sz(r){return isNumber(r)&&isFinite(r)}var iC=Object.prototype,Mz=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||iC;return r===e},Az=null,Tz=function(r){return isType(r,"RegExp")},Oz=null,Cz=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];isFunction(i)&&(i=i.prototype),mix(e.prototype,i)}},Nz=null,_f=function(r){if(typeof r!="object"||r===null)return r;var t;if(Rf(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=_f(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=_f(r[i]):t[i]=r[i]}return t},gl=_f,aC=function(r,t){if(!Pf(r))throw new TypeError("Expected a function");var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t?t.apply(this,n):n[0],s=e.cache;if(s.has(a))return s.get(a);var o=r.apply(this,n);return s.set(a,o),o};return e.cache=new Map,e},sC=5;function Um(r,t,e,n){e=e||0,n=n||sC;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&isPlainObject(a)?(isPlainObject(r[i])||(r[i]={}),e<n?Um(r[i],a,e+1,n):r[i]=t[i]):isArray(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var kz=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)Um(r,t[n]);return r},Pz=null,Rz=function(r,t,e,n){isFunction(t)||(e=t,t=r,r=function(){});var i=Object.create?function(s,o){return Object.create(s,{constructor:{value:o}})}:function(s,o){function l(){}l.prototype=s;var c=new l;return c.constructor=o,c},a=i(t.prototype,r);return r.prototype=mix(a,r.prototype),r.superclass=i(t.prototype,t),mix(a,e),mix(r,n),r},Lz=null,oC=Object.prototype.hasOwnProperty;function Dz(r){if(isNil(r))return!0;if(isArrayLike(r))return!r.length;var t=getType(r);if(t==="Map"||t==="Set")return!r.size;if(isPrototype(r))return!Object.keys(r).length;for(var e in r)if(oC.call(r,e))return!1;return!0}var _z=null,lC=function(r){return typeof r=="object"&&r!==null},Ym=lC,cC=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},Hm=cC,If=function(r,t){if(r===t)return!0;if(!r||!t||Lf(r)||Lf(t))return!1;if(Hm(r)||Hm(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=If(r[n],t[n]),!!e);n++);return e}if(Ym(r)||Ym(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=If(r[i[n]],t[i[n]]),!!e);n++);return e}return!1},uC=If,Iz=function(r,t,e){return isFunction(e)?!!e(r,t):isEqual(r,t)},Bz=function(r,t,e){for(var n=0,i=isString(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},Fz=function(r,t,e){var n=r,i=isString(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(isObject(n[a])||(n[a]=isNumber(i[s+1])?[]:{}),n=n[a]):n[a]=e}),r},hC=Object.prototype.hasOwnProperty,zz=function(r,t){if(r===null||!isPlainObject(r))return{};var e={};return each(t,function(n){hC.call(r,n)&&(e[n]=r[n])}),e},jz=function(r,t){return reduce(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},Jc={},Zz=function(r){return r=r||"g",Jc[r]?Jc[r]+=1:Jc[r]=1,r+Jc[r]},$c,Wz=aC(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return $c||($c=document.createElement("canvas").getContext("2d")),$c.font=[a,s,i,e+"px",n].join(" "),$c.measureText(Lf(r)?r:"").width},function(r,t){return t===void 0&&(t={}),(0,G.pr)([r],nC(t)).join("")}),Gz=function(r,t,e,n){n===void 0&&(n="...");var i=16,a=measureTextWidth(n,e),s=isString(r)?r:toString(r),o=t,l=[],c,u;if(measureTextWidth(r,e)<=t)return r;for(;c=s.substr(0,i),u=measureTextWidth(c,e),!(u+a>o&&u>o);)if(l.push(c),o-=u,s=s.substr(i),!s)return l.join("");for(;c=s.substr(0,1),u=measureTextWidth(c,e),!(u+a>o);)if(l.push(c),o-=u,s=s.substr(1),!s)return l.join("");return""+l.join("")+n},Vz=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}(),Uz=null,dC=function(t,e,n){for(var i=1/0,a,s=0;s<e.length;s++){var o=e[s].id;!n[o]&&t[o]<=i&&(i=t[o],a=e[s])}return a},fC=function(t,e,n,i){var a=t.nodes,s=a===void 0?[]:a,o=t.edges,l=o===void 0?[]:o,c=[],u={},h={},d={};s.forEach(function(w,O){var _=w.id;c.push(_),h[_]=1/0,_===e&&(h[_]=0)});for(var f=s.length,v=function(O){var _=dC(h,s,u),F=_.id;if(u[F]=!0,h[F]===1/0)return"continue";var W=[];n?W=RO(F,l):W=Qc(F,l),W.forEach(function(j){var H=j.target,K=j.source,et=H===F?K:H,rt=i&&j[i]?j[i]:1;h[et]>h[_.id]+rt?(h[et]=h[_.id]+rt,d[et]=[_.id]):h[et]===h[_.id]+rt&&d[et].push(_.id)})},g=0;g<f;g++)v(g);d[e]=[e];var p={};for(var y in h)h[y]!==1/0&&Xm(e,y,d,p);var b={};for(var y in p)b[y]=p[y][0];return{length:h,path:b,allPath:p}},tu=fC;function Xm(r,t,e,n){if(r===t)return[r];if(n[t])return n[t];for(var i=[],a=0,s=e[t];a<s.length;a++){var o=s[a],l=Xm(r,o,e,n);if(!l)return;for(var c=0,u=l;c<u.length;c++){var h=u[c];Rf(h)?i.push((0,G.ev)((0,G.ev)([],h,!0),[t],!1)):i.push([h,t])}}return n[t]=i,n[t]}var Bf=function(t,e,n,i,a){var s=tu(t,e,i,a),o=s.length,l=s.path,c=s.allPath;return{length:o[n],path:l[n],allPath:c[n]}},vC=function(t,e,n,i){var a;if(e===n)return[[e]];var s=t.edges,o=s===void 0?[]:s,l=[e],c=(a={},a[e]=!0,a),u=[],h=[],d=i?xi(e,o,"target"):xi(e,o);for(u.push(d);l.length>0&&u.length>0;){var f=u[u.length-1];if(f.length){var v=f.shift();v&&(l.push(v),c[v]=!0,d=i?xi(v,o,"target"):xi(v,o),u.push(d.filter(function(y){return!c[y]})))}else{var g=l.pop();c[g]=!1,u.pop();continue}if(l[l.length-1]===n){var p=l.map(function(b){return b});h.push(p);var g=l.pop();c[g]=!1,u.pop()}}return h},gC=function(t,e){for(var n=Kc(t,e),i=[],a=n.length,s=0;s<a;s+=1){i[s]=[];for(var o=0;o<a;o+=1)s===o?i[s][o]=0:n[s][o]===0||!n[s][o]?i[s][o]=1/0:i[s][o]=n[s][o]}for(var l=0;l<a;l+=1)for(var s=0;s<a;s+=1)for(var o=0;o<a;o+=1)i[s][o]>i[s][l]+i[l][o]&&(i[s][o]=i[s][l]+i[l][o]);return i},Ff=gC,pC=function(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=t.nodes,s=a===void 0?[]:a,o=t.edges,l=o===void 0?[]:o,c={},u={};s.forEach(function(O,_){var F=Dm();O.clusterId=F,c[F]={id:F,nodes:[O]},u[O.id]={node:O,idx:_}});var h=Kc(t,e),d=[],f={};h.forEach(function(O,_){var F=0,W=s[_].id;f[W]={},O.forEach(function(j,H){if(j){F+=j;var K=s[H].id;f[W][K]=j}}),d.push(F)});for(var v=0,g=function(){var _=!1;if(s.forEach(function(F){var W={};Object.keys(f[F.id]).forEach(function(yt){var Nt=f[F.id][yt],Ct=u[yt].node,pt=Ct.clusterId;W[pt]||(W[pt]=0),W[pt]+=Nt});var j=-1/0,H=[];if(Object.keys(W).forEach(function(yt){j<W[yt]?(j=W[yt],H=[yt]):j===W[yt]&&H.push(yt)}),!(H.length===1&&H[0]===F.clusterId)){var K=H.indexOf(F.clusterId);if(K>=0&&H.splice(K,1),H&&H.length){_=!0;var et=c[F.clusterId],rt=et.nodes.indexOf(F);et.nodes.splice(rt,1);var lt=Math.floor(Math.random()*H.length),ht=c[H[lt]];ht.nodes.push(F),F.clusterId=ht.id}}}),!_)return"break";v++};v<i;){var p=g();if(p==="break")break}Object.keys(c).forEach(function(O){var _=c[O];(!_.nodes||!_.nodes.length)&&delete c[O]});var y=[],b={};l.forEach(function(O){var _=O.source,F=O.target,W=O[n]||1,j=u[_].node.clusterId,H=u[F].node.clusterId,K="".concat(j,"---").concat(H);if(b[K])b[K].weight+=W,b[K].count++;else{var et={source:j,target:H,weight:W,count:1};b[K]=et,y.push(et)}});var w=[];return Object.keys(c).forEach(function(O){w.push(c[O])}),{clusters:w,clusterEdges:y}},mC=pC,yC=function(){function r(t){this.arr=t}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(t){var e=[];if(t!==0)for(var n in this.arr)e[n]=this.arr[n]/t;return new r(e)},r.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new r(t)},r.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},r.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var t=[],e=gl(this.arr);e.sort(function(s,o){return s-o});var n=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(n-i);return new r(t)},r.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},r.prototype.dot=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*t.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(t){var e,n=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Ei=yC,bC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,xC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,Km=function(t,e){t===void 0&&(t=[]),e===void 0&&(e=100);var n={};t.forEach(function(a){a.properties&&Object.keys(a.properties).forEach(function(s){if(s==="id"||!"".concat(a.properties[s]).match(bC)&&!"".concat(a.properties[s]).match(xC)&&isNaN(Number(a.properties[s]))){n.hasOwnProperty(s)&&delete n[s];return}n.hasOwnProperty(s)?n[s]+=1:n[s]=1})});var i=Object.keys(n).sort(function(a,s){return n[s]-n[a]});return i.length<e?i:i.slice(0,e)},EC=function(t,e){return e.map(function(n){return t.hasOwnProperty(n)?t[n]:0})},wC=function(t){for(var e=Km(t),n=[],i=0;i<t.length;i++)n[i]=EC(t[i].properties,e);return n},eu=function(t,e){e===void 0&&(e=void 0);var n=[];return t.forEach(function(i){e===void 0&&n.push(i),i[e]!==void 0&&n.push(i[e])}),n},Yz={getAllSortProperties:Km,getPropertyWeight:wC,getAllProperties:eu},Di;(function(r){r.EuclideanDistance="euclideanDistance"})(Di||(Di={}));var Qm=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(s){i=i.concat(Object.keys(s))}),i=Df(i));var a={};return i.forEach(function(s){var o=[];t.forEach(function(l){l[s]!==void 0&&l[s]!==""&&o.push(l[s])}),o.length&&!(n!=null&&n.includes(s))&&(a[s]=Df(o))}),a},nu=function(t,e,n){var i=Qm(t,e,n),a=[];if(!Object.keys(i).length)return a;var s=Object.values(i),o=s.every(function(l){return l.every(function(c){return typeof c=="number"})});return t.forEach(function(l,c){var u=[];Object.keys(i).forEach(function(h){var d=l[h],f=i[h],v=f.findIndex(function(y){return d===y}),g=[];if(o)g.push(d);else for(var p=0;p<f.length;p++)p===v?g.push(1):g.push(0);u=u.concat(g)}),a[c]=u}),a},zf=function(t,e,n,i){n===void 0&&(n=Di.EuclideanDistance);var a=0;switch(n){case Di.EuclideanDistance:a=new Ei(t).euclideanDistance(new Ei(e));break;default:break}return a},Hz={getAllKeyValueMap:Qm,oneHot:nu,getDistance:zf},qm=function(t,e,n,i){for(var a=e.length,s=2*i,o=0,l=0;l<a;l++)for(var c=t[l].clusterId,u=0;u<a;u++){var h=t[u].clusterId;if(c===h){var d=e[l][u]||0,f=n[l]||0,v=n[u]||0;o+=d-f*v/s}}return o*=1/s,o},jf=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new Ei([]),a=0;a<n;a++)i=i.add(new Ei(e[a]));var s=i.avg(n);s.normalize();for(var o=0,a=0;a<n;a++){var l=new Ei(e[a]),c=l.squareEuclideanDistance(s);o+=c}var u=[];t.forEach(function(){u.push([])});for(var a=0;a<n;a++){var l=new Ei(e[a]);t[a].clusterInertial=0;for(var h=0;h<n;h++){if(a===h){u[a][h]=0;continue}var d=new Ei(e[h]);u[a][h]=l.squareEuclideanDistance(d),t[a].clusterInertial+=u[a][h]}}for(var f=0,v=2*n*o,a=0;a<n;a++)for(var g=t[a].clusterId,h=0;h<n;h++){var p=t[h].clusterId;if(!(a===h||g!==p)){var y=t[a].clusterInertial*t[h].clusterInertial/Math.pow(v,2)-u[a][h]/v;f+=y}}return Number(f.toFixed(4))},SC=function(t,e,n,i,a,s,o,l,c){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),s===void 0&&(s=void 0),o===void 0&&(o=[]),l===void 0&&(l=["id"]),c===void 0&&(c=1);var u=t.nodes,h=u===void 0?[]:u,d=t.edges,f=d===void 0?[]:d,v=[];if(a){h.forEach(function(xt,kt){xt.properties=xt.properties||{},xt.originIndex=kt});var g=[];h.every(function(xt){return xt.hasOwnProperty("nodeType")})&&(g=Array.from(new Set(h.map(function(xt){return xt.nodeType}))),h.forEach(function(xt){xt.properties.nodeType=g.findIndex(function(kt){return kt===xt.nodeType})}));var p=eu(h,s);v=nu(p,o,l)}var y=1,b={},w={};h.forEach(function(xt,kt){var jt=String(y++);xt.clusterId=jt,b[jt]={id:jt,nodes:[xt]},w[xt.id]={node:xt,idx:kt}});var O=Kc(t,e),_=[],F={},W=0;O.forEach(function(xt,kt){var jt=0,Xt=h[kt].id;F[Xt]={},xt.forEach(function(ee,ce){if(ee){jt+=ee;var ue=h[ce].id;F[Xt][ue]=ee,W+=ee}}),_.push(jt)}),W/=2;for(var j=1/0,H=1/0,K=0,et=[],rt={};;){a&&h.every(function(xt){return xt.hasOwnProperty("properties")})?j=qm(h,O,_,W)+jf(h,v)*c:j=qm(h,O,_,W),K===0&&(H=j,et=h,rt=b);var lt=j>0&&j>H&&j-H<i;if(j>H&&(et=h.map(function(xt){return{node:xt,clusterId:xt.clusterId}}),rt=gl(b),H=j),lt||K>100)break;K++,Object.keys(b).forEach(function(xt){var kt=0;f.forEach(function(jt){var Xt=jt.source,ee=jt.target,ce=w[Xt].node.clusterId,ue=w[ee].node.clusterId;(ce===xt&&ue!==xt||ue===xt&&ce!==xt)&&(kt=kt+(jt[n]||1))}),b[xt].sumTot=kt}),h.forEach(function(xt,kt){var jt=b[xt.clusterId],Xt=0,ee,ce=_[kt]/(2*W),ue=0,le=jt.nodes;le.forEach(function(Mr){var vr=w[Mr.id].idx;ue+=O[kt][vr]||0});var me=ue-jt.sumTot*ce,De=le.filter(function(Mr){return Mr.id!==xt.id}),Ge=[];De.forEach(function(Mr,vr){Ge[vr]=v[Mr.originIndex]});var _e=jf(De,v)*c,tr=F[xt.id];if(Object.keys(tr).forEach(function(Mr){var vr=w[Mr].node,Ma=vr.clusterId;if(Ma!==xt.clusterId){var Ar=b[Ma],$r=Ar.nodes;if(!(!$r||!$r.length)){var Fe=0;$r.forEach(function(He){var Qe=w[He.id].idx;Fe+=O[kt][Qe]||0});var Ke=Fe-Ar.sumTot*ce,ze=$r.concat([xt]),Ye=[];ze.forEach(function(He,Qe){Ye[Qe]=v[He.originIndex]});var en=jf(ze,v)*c,pe=Ke-me;a&&(pe=Ke+en-(me+_e)),pe>Xt&&(Xt=pe,ee=Ar)}}}),Xt>0){ee.nodes.push(xt);var yn=xt.clusterId;xt.clusterId=ee.id;var Sr=jt.nodes.indexOf(xt);jt.nodes.splice(Sr,1);var lr=0,rs=0;f.forEach(function(Mr){var vr=Mr.source,Ma=Mr.target,Ar=w[vr].node.clusterId,$r=w[Ma].node.clusterId;(Ar===ee.id&&$r!==ee.id||$r===ee.id&&Ar!==ee.id)&&(lr=lr+(Mr[n]||1)),(Ar===yn&&$r!==yn||$r===yn&&Ar!==yn)&&(rs=rs+(Mr[n]||1))}),ee.sumTot=lr,jt.sumTot=rs}})}var ht={},yt=0;Object.keys(rt).forEach(function(xt){var kt=rt[xt];if(!kt.nodes||!kt.nodes.length){delete rt[xt];return}var jt=String(yt+1);jt!==xt&&(kt.id=jt,kt.nodes=kt.nodes.map(function(Xt){return{id:Xt.id,clusterId:jt}}),rt[jt]=kt,ht[xt]=jt,delete rt[xt],yt++)}),et.forEach(function(xt){var kt=xt.node,jt=xt.clusterId;kt&&(kt.clusterId=jt,kt.clusterId&&ht[kt.clusterId]&&(kt.clusterId=ht[kt.clusterId]))});var Nt=[],Ct={};f.forEach(function(xt){var kt=xt.source,jt=xt.target,Xt=xt[n]||1,ee=w[kt].node.clusterId,ce=w[jt].node.clusterId;if(!(!ee||!ce)){var ue="".concat(ee,"---").concat(ce);if(Ct[ue])Ct[ue].weight+=Xt,Ct[ue].count++;else{var le={source:ee,target:ce,weight:Xt,count:1};Ct[ue]=le,Nt.push(le)}}});var pt=[];return Object.keys(rt).forEach(function(xt){pt.push(rt[xt])}),{clusters:pt,clusterEdges:Nt}},Jm=SC,MC=function(t,e,n,i,a,s,o,l){return e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),s===void 0&&(s=[]),o===void 0&&(o=["id"]),l===void 0&&(l=1),Jm(t,e,n,i,!0,a,s,o,l)},AC=MC,TC=function(t,e){var n;e===void 0&&(e=1);for(var i=gl(t),a=i.nodes,s=a===void 0?[]:a,o=i.edges,l=o===void 0?[]:o,c=function(){var d=kf({nodes:s,edges:l}),f=Object.keys(d);f.sort(function(p,y){var b,w;return((b=d[p])===null||b===void 0?void 0:b.degree)-((w=d[y])===null||w===void 0?void 0:w.degree)});var v=f[0];if(!s.length||((n=d[v])===null||n===void 0?void 0:n.degree)>=e)return"break";var g=s.findIndex(function(p){return p.id===v});s.splice(g,1),l=l.filter(function(p){return!(p.source===v||p.target===v)})};;){var u=c();if(u==="break")break}return{nodes:s,edges:l}},OC=TC,$m=function(t,e,n){var i=[];switch(t){case Di.EuclideanDistance:i=e[n];break;default:i=[];break}return i},CC=function(t,e,n,i,a,s){e===void 0&&(e=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),s===void 0&&(s=Di.EuclideanDistance);var o=t.nodes,l=o===void 0?[]:o,c=t.edges,u=c===void 0?[]:c,h={clusters:[{id:"0",nodes:l}],clusterEdges:[]};if(s===Di.EuclideanDistance&&!l.every(function(jt){return jt.hasOwnProperty(n)}))return h;var d=[],f=[];if(s===Di.EuclideanDistance&&(d=eu(l,n),f=nu(d,i,a)),!f.length)return h;for(var v=Df(f.map(function(jt){return jt.join("")})),g=Math.min(e,l.length,v.length),p=0;p<l.length;p++)l[p].originIndex=p;for(var y=[],b=[],w=[],p=0;p<g;p++)if(p===0){var O=Math.floor(Math.random()*l.length);switch(s){case Di.EuclideanDistance:y[p]=f[O];break;default:y[p]=[];break}b.push(O),w[p]=[l[O]],l[O].clusterId=String(p)}else{for(var _=-1/0,F=0,W=function(ee){if(!b.includes(ee)){for(var ce=0,ue=0;ue<y.length;ue++){var le=0;switch(s){case Di.EuclideanDistance:le=zf(f[l[ee].originIndex],y[ue],s);break;default:break}ce+=le}var me=ce/y.length;me>_&&!y.find(function(De){return uC(De,$m(s,f,l[ee].originIndex))})&&(_=me,F=ee)}},j=0;j<l.length;j++)W(j);y[p]=$m(s,f,F),b.push(F),w[p]=[l[F]],l[F].clusterId=String(p)}for(var H=0;;){for(var p=0;p<l.length;p++){var K=0,et=1/0;if(!(H===0&&b.includes(p))){for(var rt=0;rt<y.length;rt++){var lt=0;switch(s){case Di.EuclideanDistance:lt=zf(f[p],y[rt],s);break;default:break}lt<et&&(et=lt,K=rt)}if(l[p].clusterId!==void 0)for(var ht=w[Number(l[p].clusterId)].length-1;ht>=0;ht--)w[Number(l[p].clusterId)][ht].id===l[p].id&&w[Number(l[p].clusterId)].splice(ht,1);l[p].clusterId=String(K),w[K].push(l[p])}}for(var yt=!1,p=0;p<w.length;p++){for(var Nt=w[p],Ct=new Ei([]),rt=0;rt<Nt.length;rt++)Ct=Ct.add(new Ei(f[Nt[rt].originIndex]));var pt=Ct.avg(Nt.length);pt.equal(new Ei(y[p]))||(yt=!0,y[p]=pt.getArr())}if(H++,l.every(function(jt){return jt.clusterId!==void 0})&&yt||H>=1e3)break}var xt=[],kt={};return u.forEach(function(jt){var Xt,ee,ce=jt.source,ue=jt.target,le=(Xt=l.find(function(_e){return _e.id===ce}))===null||Xt===void 0?void 0:Xt.clusterId,me=(ee=l.find(function(_e){return _e.id===ue}))===null||ee===void 0?void 0:ee.clusterId,De="".concat(le,"---").concat(me);if(kt[De])kt[De].count++;else{var Ge={source:le,target:me,count:1};kt[De]=Ge,xt.push(Ge)}}),{clusters:w,clusterEdges:xt}},NC=CC,kC=function(t,e){var n=new Ei(e),i=n.norm2(),a=new Ei(t),s=a.norm2(),o=n.dot(a),l=i*s,c=l?o/l:0;return c},ty=kC,PC=function(t,e,n,i,a){t===void 0&&(t=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var s=gl(t.filter(function(d){return d.id!==e.id})),o=t.findIndex(function(d){return d.id===e.id}),l=eu(t,n),c=nu(l,i,a),u=c[o],h=[];return s.forEach(function(d,f){if(d.id!==e.id){var v=c[f],g=ty(v,u);h.push(g),d.cosineSimilarity=g}}),s.sort(function(d,f){return f.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:h,similarNodes:s}},RC=PC,LC=function(){function r(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}return r.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},r.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},r.prototype.connected=function(t,e){return this.find(t)===this.find(e)},r}(),DC=LC,_C=function(t,e){return t-e},IC=function(){function r(t){t===void 0&&(t=_C),this.compareFn=t,this.list=[]}return r.prototype.getLeft=function(t){return 2*t+1},r.prototype.getRight=function(t){return 2*t+2},r.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},r.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},r.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},r.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),a=this.getRight(t),s=this.list.length;i!==null&&i<s&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<s&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},r}(),BC=IC,FC=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,s=t.edges,o=s===void 0?[]:s;if(a.length===0)return n;var l=a[0],c=new Set;c.add(l);var u=function(p,y){return e?p.weight-y.weight:0},h=new BC(u);for(Qc(l.id,o).forEach(function(g){h.insert(g)});!h.isEmpty();){var d=h.delMin(),f=d.source,v=d.target;c.has(f)&&c.has(v)||(n.push(d),c.has(f)||(c.add(f),Qc(f,o).forEach(function(g){h.insert(g)})),c.has(v)||(c.add(v),Qc(v,o).forEach(function(g){h.insert(g)})))}return n},ey=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,s=t.edges,o=s===void 0?[]:s;if(a.length===0)return n;var l=o.map(function(f){return f});e&&l.sort(function(f,v){return f.weight-v.weight});for(var c=new DC(a.map(function(f){return f.id}));l.length>0;){var u=l.shift(),h=u.source,d=u.target;c.connected(h,d)||(n.push(u),c.union(h,d))}return n},zC=function(t,e,n){var i={prim:FC,kruskal:ey};return n?i[n](t,e):ey(t,e)},jC=zC,ZC=function(t,e,n){typeof e!="number"&&(e=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,s=1e3,o=t.nodes,l=o===void 0?[]:o,c=t.edges,u=c===void 0?[]:c,h=l.length,d,f={},v={},g=0;g<h;++g){var p=l[g],y=p.id;f[y]=1/h,v[y]=1/h}for(var b=kf(t);s>0&&i>e;){a=0;for(var g=0;g<h;++g){var p=l[g],y=p.id;if(d=0,b[p.id].inDegree===0)f[y]=0;else{for(var w=xi(y,u,"source"),O=0;O<w.length;++O){var _=w[O],F=b[_].outDegree;F>0&&(d+=v[_]/F)}f[y]=n*d,a+=f[y]}}a=(1-a)/h,i=0;for(var g=0;g<h;++g){var p=l[g],y=p.id;d=f[y]+a,i+=Math.abs(d-v[y]),v[y]=d}s-=1}return v},ny=ZC,WC=-1,ru=-1,ry="-1",na="-1",iy=-1,Xz="-1",ay=function(){function r(t,e,n,i){t===void 0&&(t=WC),e===void 0&&(e=ru),n===void 0&&(n=ru),i===void 0&&(i=ry),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),GC=function(){function r(t,e){t===void 0&&(t=ru),e===void 0&&(e=na),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},r}(),sy=function(){function r(t,e,n){t===void 0&&(t=ru),e===void 0&&(e=!0),n===void 0&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new GC(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},r.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var a=new ay(t,e,n,i);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var s=new ay(t,n,e,i);this.nodeMap[n].addEdge(s),this.edgeLabelMap[i].push(s)}}},r}(),ks=function(){function r(t,e,n,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||na,edgeLabel:i||ry,nodeLabel2:a||na}}return r.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r}(),oy=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,n=t.length;if(e!==n)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r.prototype.pushBack=function(t,e,n,i,a){return this.dfsEdgeList.push(new ks(t,e,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(t,e){t===void 0&&(t=iy),e===void 0&&(e=!1);var n=new sy(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,s=i.toNode,o=i.nodeEdgeNodeLabel,l=o.nodeLabel1,c=o.edgeLabel,u=o.nodeLabel2;l!==na&&n.addNode(a,l),u!==na&&n.addNode(s,u),l!==na&&u!==l&&n.addEdge(void 0,a,s,c)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,n=e-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,s=i.toNode;a<s&&(t===void 0||s===t)&&(this.rmpath.push(n),t=a)}return this.rmpath},r.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},r}(),iu=function(){function r(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},r.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},r}(),VC=function(){function r(t){var e=t.graphs,n=t.minSupport,i=n===void 0?2:n,a=t.minNodeNum,s=a===void 0?1:a,o=t.maxNodeNum,l=o===void 0?4:o,c=t.top,u=c===void 0?10:c,h=t.directed,d=h===void 0?!1:h,f=t.verbose,v=f===void 0?!1:f;this.graphs=e,this.dfsCode=new oy,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=u,this.directed=d,this.counter=0,this.maxNodeNum=l,this.minNodeNum=s,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],a=t.nodeMap;return e.edges.forEach(function(s){(n.directed||e.label<=a[s.to].label)&&i.push(s)}),i},r.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var a=t.nodeMap,s=a[n.to],o=s.edges,l=o.length,c=0;c<l;c++){var u=o[c];if(!(i.hasEdge(u)||u.to!==e.from)){if(this.directed){if(a[e.from].label<a[n.to].label||a[e.from].label===a[n.to].label&&e.label<=u.label)return u}else if(e.label<u.label||e.label===u.label&&a[e.to].label<=a[n.to].label)return u}}return null},r.prototype.findForwardPureEdges=function(t,e,n,i){for(var a=[],s=e.to,o=t.nodeMap[s].edges,l=o.length,c=0;c<l;c++){var u=o[c],h=t.nodeMap[u.to];n<=h.label&&!i.hasNode(h)&&a.push(u)}return a},r.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var a=[],s=t.nodeMap,o=s[e.to].label,l=s[e.from],c=l.edges,u=c.length,h=0;h<u;h++){var d=c[h],f=s[d.to].label;e.to===d.to||n>f||i.hasNode(s[d.to])||(e.label<d.label||e.label===d.label&&o<=f)&&a.push(d)}return a},r.prototype.getSupport=function(t){var e={};return t.forEach(function(n){e[n.graphId]||(e[n.graphId]=!0)}),Object.keys(e).length},r.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i=t[n],a=i.nodeLabel1,s=i.edgeLabel,o=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:s,nodeLabel2:o};return}(a<e.nodeLabel1||a===e.nodeLabel1&&s<e.edgeLabel||a===e.nodeLabel1&&s===e.edgeLabel&&o<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:s,nodeLabel2:o})}),e},r.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var n=this.directed,i=e.toGraph(iy,n),a=i.nodeMap,s=new oy,o={};i.nodes.forEach(function(h){var d=t.findForwardRootEdges(i,h);d.forEach(function(f){var v=a[f.to],g="".concat(h.label,"-").concat(f.label,"-").concat(v.label);o[g]||(o[g]={projected:[],nodeLabel1:h.label,edgeLabel:f.label,nodeLabel2:v.label});var p={graphId:i.id,edge:f,preNode:null};o[g].projected.push(p)})});var l=this.findMinLabel(o);if(l){s.dfsEdgeList.push(new ks(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var c=function h(d){for(var f=s.buildRmpath(),v=s.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,g=s.dfsEdgeList[f[0]].toNode,p={},y=!1,b=0,w=n?-1:0,O=function(Ct){if(y)return"break";d.forEach(function(pt){var xt=new iu(pt),kt=t.findBackwardEdge(i,xt.edges[f[Ct]],xt.edges[f[0]],xt);kt&&(p[kt.label]||(p[kt.label]={projected:[],edgeLabel:kt.label}),p[kt.label].projected.push({graphId:i.id,edge:p,preNode:pt}),b=s.dfsEdgeList[f[Ct]].fromNode,y=!0)})},_=f.length-1;_>w;_--){var F=O(_);if(F==="break")break}if(y){var W=t.findMinLabel(p);s.dfsEdgeList.push(new ks(g,b,na,W.edgeLabel,na));var j=s.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[j]!==s.dfsEdgeList[j]?!1:h(p[W.edgeLabel].projected)}var H={};y=!1;var K=0;d.forEach(function(Nt){var Ct=new iu(Nt),pt=t.findForwardPureEdges(i,Ct.edges[f[0]],v,Ct);pt.length>0&&(y=!0,K=g,pt.forEach(function(xt){var kt="".concat(xt.label,"-").concat(a[xt.to].label);H[kt]||(H[kt]={projected:[],edgeLabel:xt.label,nodeLabel2:a[xt.to].label}),H[kt].projected.push({graphId:i.id,edge:xt,preNode:Nt})}))});for(var et=f.length,rt=function(Ct){if(y)return"break";var pt=f[Ct];d.forEach(function(xt){var kt=new iu(xt),jt=t.findForwardRmpathEdges(i,kt.edges[pt],v,kt);jt.length>0&&(y=!0,K=s.dfsEdgeList[pt].fromNode,jt.forEach(function(Xt){var ee="".concat(Xt.label,"-").concat(a[Xt.to].label);H[ee]||(H[ee]={projected:[],edgeLabel:Xt.label,nodeLabel2:a[Xt.to].label}),H[ee].projected.push({graphId:i.id,edge:Xt,preNode:xt})}))})},_=0;_<et;_++){var lt=rt(_);if(lt==="break")break}if(!y)return!0;var ht=t.findMinLabel(H);s.dfsEdgeList.push(new ks(K,g+1,na,ht.edgeLabel,ht.nodeLabel2));var yt=s.dfsEdgeList.length-1;return e.dfsEdgeList[yt]!==s.dfsEdgeList[yt]?!1:h(H["".concat(ht.edgeLabel,"-").concat(ht.nodeLabel2)].projected)},u="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return c(o[u].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(gl(t))}},r.prototype.subGraphMining=function(t){var e=this,n=this.getSupport(t);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),s=this.dfsCode.dfsEdgeList[a[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},c={};t.forEach(function(u){for(var h=e.graphs[u.graphId],d=h.nodeMap,f=new iu(u),v=a.length-1;v>=0;v--){var g=e.findBackwardEdge(h,f.edges[a[v]],f.edges[a[0]],f);if(g){var p="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(g.label);c[p]||(c[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:g.label}),c[p].projected.push({graphId:u.graphId,edge:g,preNode:u})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(h,f.edges[a[0]],o,f);y.forEach(function(w){var O="".concat(s,"-").concat(w.label,"-").concat(d[w.to].label);l[O]||(l[O]={projected:[],fromNodeId:s,edgeLabel:w.label,nodeLabel2:d[w.to].label}),l[O].projected.push({graphId:u.graphId,edge:w,preNode:u})});for(var b=function(O){var _=e.findForwardRmpathEdges(h,f.edges[a[O]],o,f);_.forEach(function(F){var W="".concat(e.dfsCode.dfsEdgeList[a[O]].fromNode,"-").concat(F.label,"-").concat(d[F.to].label);l[W]||(l[W]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[O]].fromNode,edgeLabel:F.label,nodeLabel2:d[F.to].label}),l[W].projected.push({graphId:u.graphId,edge:F,preNode:u})})},v=0;v<a.length;v++)b(v)}}),Object.keys(c).forEach(function(u){var h=c[u],d=h.toNodeId,f=h.edgeLabel;e.dfsCode.dfsEdgeList.push(new ks(s,d,"-1",f,"-1")),e.subGraphMining(c[u].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(u){var h=l[u],d=h.fromNodeId,f=h.edgeLabel,v=h.nodeLabel2;e.dfsCode.dfsEdgeList.push(new ks(d,s+1,na,f,v)),e.subGraphMining(l[u].projected),e.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},s={},o={},l={};return Object.keys(t).forEach(function(c){var u=t[c],h=u.nodeMap;u.nodes.forEach(function(d,f){var v=d.label,g="".concat(c,"-").concat(v);if(!o[g]){var p=a[v]||0;p++,a[v]=p}o[g]={graphKey:c,label:v},d.edges.forEach(function(y){var b=v,w=h[y.to].label;if(!e&&b>w){var O=w;w=b,b=O}var _=y.label,F="".concat(c,"-").concat(b,"-").concat(_,"-").concat(w),W="".concat(b,"-").concat(_,"-").concat(w);if(!s[W]){var j=s[W]||0;j++,s[W]=j}l[F]={graphId:c,nodeLabel1:b,edgeLabel:_,nodeLabel2:w}})})}),Object.keys(a).forEach(function(c){var u=a[c];if(!(u<n)){var h={nodes:[],edges:[]};h.nodes.push({id:"0",label:c}),i.push(h)}}),i},r.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=this.directed,i={};Object.keys(e).forEach(function(a){var s=e[a],o=s.nodeMap;s.nodes.forEach(function(l){var c=t.findForwardRootEdges(s,l);c.forEach(function(u){var h=o[u.to],d="".concat(l.label,"-").concat(u.label,"-").concat(h.label);i[d]||(i[d]={projected:[],nodeLabel1:l.label,edgeLabel:u.label,nodeLabel2:h.label});var f={graphId:a,edge:u,preNode:null};i[d].projected.push(f)})})}),Object.keys(i).forEach(function(a){var s=i[a],o=s.projected,l=s.nodeLabel1,c=s.edgeLabel,u=s.nodeLabel2;t.dfsCode.dfsEdgeList.push(new ks(0,1,l,c,u)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},r}(),UC=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(s,o){var l=t[s],c=new sy(o,!0,e),u={};l.nodes.forEach(function(h,d){c.addNode(d,h[n]),u[h.id]=d}),l.edges.forEach(function(h,d){var f=u[h.source],v=u[h.target];c.addEdge(-1,f,v,h[i])}),c&&c.getNodeNum()&&(a[c.id]=c)}),a},YC=function(t,e,n){var i=[];return t.forEach(function(a){var s={nodes:[],edges:[]};a.nodes.forEach(function(o){var l;s.nodes.push((l={id:"".concat(o.id)},l[e]=o.label,l))}),a.edges.forEach(function(o){var l;s.edges.push((l={source:"".concat(o.from),target:"".concat(o.to)},l[n]=o.label,l))}),i.push(s)}),i},ly="cluster",HC=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,s=a===void 0?ly:a,o=t.edgeLabelProp,l=o===void 0?ly:o,c=UC(e,i,s,l),u=t.minSupport,h=t.maxNodeNum,d=t.minNodeNum,f=t.verbose,v=t.top,g={graphs:c,minSupport:u,maxNodeNum:h,minNodeNum:d,top:v,verbose:f,directed:i},p=new VC(g);p.run();var y=YC(p.frequentSubgraphs,s,l);return y},XC=HC,cy=function(t,e,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],s=t.nodes;return e.forEach(function(o,l){a.push(uy(s,o,l,n,i))}),a},uy=function(t,e,n,i,a){var s=[n],o=[],l={};return e.forEach(function(c,u){if(c<=a&&n!==u){s.push(u),o.push(t[u]);var h=t[u][i];l[h]?(l[h].count++,l[h].dists.push(c)):l[h]={count:1,dists:[c]}}}),Object.keys(l).forEach(function(c){l[c].dists=l[c].dists.sort(function(u,h){return u-h})}),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:s,neighbors:o,neighborNum:s.length-1,nodeLabelCountMap:l}},KC=function(t,e,n,i,a){var s=Math.ceil(n/e),o={},l=0;return i.forEach(function(c,u){for(var h=0,d=0,f=c.nodeIdxs,v=c.neighborNum-1;h<s;){for(var g=f[1+Math.floor(Math.random()*v)],p=0;(o["".concat(u,"-").concat(g)]||o["".concat(g,"-").concat(u)])&&(g=Math.floor(Math.random()*e),p++,!(p>2*e)););if(p<2*e&&(o["".concat(u,"-").concat(g)]={start:u,end:g,distance:a[u][g]},h++,l++,l>=n))return o;if(d++,d>2*e)break}if(h<s){var y=s-h;s=(s+y)/(e-u-1)}}),o},au=function(t,e,n,i){var a=n.nodes;return i||(i={}),Object.keys(t).forEach(function(s){var o,l;if(!(i&&i[s])){i[s]={nodes:[],edges:[]};var c=t[s],u=(o=e[c.start])===null||o===void 0?void 0:o.nodeIdxs,h=(l=e[c.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!u||!h)){var d=new Set(h),f=u.filter(function(b){return d.has(b)});if(!(!f||!f.length)){for(var v={},g=f.length,p=0;p<g;p++){var y=a[f[p]];i[s].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(b){v[b.source]&&v[b.target]&&i[s].edges.push(b)})}}}}),i},su=function(t,e,n,i){var a,s,o={};t.nodes.forEach(function(c){o[c.id]=c});var l=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((s=e==null?void 0:e.nodes)===null||s===void 0?void 0:s.length)<2?0:(t.edges.forEach(function(c){var u=o[c.source][n],h=o[c.target][n],d=e==null?void 0:e.nodes[0][n],f=e==null?void 0:e.nodes[1][n],v=e==null?void 0:e.edges[0][i];c[i]===v&&(u===d&&h===f||u===f&&h===d)&&l++}),l)},QC=function(t,e,n){for(var i=1/0,a=0,s=function(c){var u=t[c],h=Object.keys(u).sort(function(b,w){return u[b]-u[w]}),d=10,f=[];h.forEach(function(b,w){f[w%d]||(f[w%d]={graphs:[],totalCount:0,aveCount:0}),f[w%d].graphs.push(b),f[w%d].totalCount+=u[b]});var v=0,g=[];f.forEach(function(b){var w=b.totalCount/b.graphs.length;b.aveCount=w,g.push(w);var O=0,_=b.length;b.graphs.forEach(function(F,W){var j=u[F];b.graphs.forEach(function(H,K){W!==K&&(O+=Math.abs(j-u[H]))})}),O/=_*(_-1)/2,v+=O}),v/=f.length;var p=0;g.forEach(function(b,w){g.forEach(function(O,_){w!==_&&(p+=Math.abs(b-O))}),p/=g.length*(g.length-1)/2});var y=p-v;i<y&&(i=y,a=c)},o=0;o<e;o++)s(o);return{structure:n[a],structureCountMap:t[a]}},hy=function(t,e){var n={},i={};return t.forEach(function(a,s){n[a.id]={idx:s,node:a,degree:0,inDegree:0,outDegree:0};var o=a[e];i[o]||(i[o]=[]),i[o].push(a)}),{nodeMap:n,nodeLabelMap:i}},dy=function(t,e,n){var i={},a={};return t.forEach(function(s,o){i["".concat(Dm)]={idx:o,edge:s};var l=s[e];a[l]||(a[l]=[]),a[l].push(s);var c=n[s.source];c&&(c.degree++,c.outDegree++);var u=n[s.target];u&&(u.degree++,u.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},fy=function(t,e,n){var i=e.length,a={};return e.forEach(function(s,o){for(var l=n?0:o+1,c=t[o].id,u=l;u<i;u++)if(o!==u){var h=t[u].id,d=s[u];a["".concat(c,"-").concat(h)]=d,n||(a["".concat(h,"-").concat(c)]=d)}}),a},qC=function(t,e,n,i,a,s,o,l,c,u,h){var d,f="".concat(e.id,"-").concat(n.id);if(u&&u[f])return u[f];var v=h?h[f]:void 0;if(!v){var g=(d={},d[f]={start:i[e.id].idx,end:i[n.id].idx,distance:a},d);h=au(g,s,t,h),v=h[f]}return su(v,o,l,c)},vy=function(t,e,n,i){var a,s,o,l=(a=t[e])===null||a===void 0?void 0:a.degree,c=(s=t[e])===null||s===void 0?void 0:s.inDegree,u=(o=t[e])===null||o===void 0?void 0:o.outDegree;return t[e]===void 0&&(l=1/0,c=1/0,u=1/0,i[e].forEach(function(h){var d=n[h.id].degree;l>d&&(l=d);var f=n[h.id].inDegree;c>f&&(c=f);var v=n[h.id].outDegree;u>v&&(u=v)}),t[e]={degree:l,inDegree:c,outDegree:u}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:c,minPatternNodeLabelOutDegree:u}},JC=function(t,e,n,i,a,s,o){var l;if(n===void 0&&(n=!1),s===void 0&&(s="cluster"),o===void 0&&(o="cluster"),!(!t||!t.nodes)){var c=t.nodes.length;if(c){var u=Ff(t,n),h=Ff(e,n),d=fy(t.nodes,u,n),f=fy(e.nodes,h,n),v=hy(t.nodes,s),g=v.nodeMap,p=v.nodeLabelMap,y=hy(e.nodes,s),b=y.nodeMap,w=y.nodeLabelMap;dy(t.edges,o,g);var O=dy(e.edges,o,b).edgeLabelMap,_=[];h==null||h.forEach(function(Fe){_=_.concat(Fe)}),a||(a=Math.max.apply(Math,(0,G.ev)((0,G.ev)([],_,!1),[2],!1))),i||(i=a);var F=cy(t,u,s,i),W=cy(e,h,s,i),j=Math.min(100,c*(c-1)/2),H=KC(i,c,j,F,u),K=au(H,F,t),et=10,rt=1,lt=1,ht=4,yt={graphs:K,nodeLabelProp:s,edgeLabelProp:o,minSupport:rt,minNodeNum:lt,maxNodeNum:ht,directed:n},Nt=XC(yt).slice(0,et),Ct=Nt.length,pt=[];Nt.forEach(function(Fe,Ke){pt[Ke]={},Object.keys(K).forEach(function(ze){var Ye=K[ze],en=su(Ye,Fe,s,o);pt[Ke][ze]=en})});var xt=QC(pt,Ct,Nt),kt=xt.structure,jt=xt.structureCountMap,Xt=e.nodes[0],ee=[],ce=(l=e.nodes[0])===null||l===void 0?void 0:l[s],ue=-1/0;e.nodes.forEach(function(Fe){var Ke=Fe[s],ze=p[Ke];(ze==null?void 0:ze.length)>ue&&(ue=ze.length,ee=ze,ce=Ke,Xt=Fe)});var le={},me={},De={},Ge={},_e={},tr={};Object.keys(w).forEach(function(Fe,Ke){_e[Fe]=[],n&&(tr[Fe]=[]);var ze=-1/0,Ye=w[Fe],en={};Ye.forEach(function(qe){var Xe=f["".concat(Xt.id,"-").concat(qe.id)];if(Xe&&_e[Fe].push(Xe),ze<Xe&&(ze=Xe),en["".concat(Xt.id,"-").concat(qe.id)]={start:0,end:b[qe.id].idx,distance:Xe},n){var In=f["".concat(qe.id,"-").concat(Xt.id)];In&&tr[Fe].push(In)}}),_e[Fe]=_e[Fe].sort(function(qe,Xe){return qe-Xe}),n&&(tr[Fe]=tr[Fe].sort(function(qe,Xe){return qe-Xe})),me=au(en,W,e,me);var pe=[];if(Object.keys(en).forEach(function(qe){if(De[qe]){pe.push(De[qe]);return}var Xe=me[qe];De[qe]=su(Xe,kt,s,o),pe.push(De[qe])}),pe=pe.sort(function(qe,Xe){return Xe-qe}),Ge["".concat(Xt.id,"-").concat(Fe)]=pe,Fe!==ce)for(var He=(ee==null?void 0:ee.length)||0,Qe=function(Xe){var In=ee[Xe],hi=F[g[In.id].idx],Un=hi.nodeLabelCountMap[Fe],Ks=w[Fe].length;if(!Un||Un.count<Ks)return ee.splice(Xe,1),"continue";for(var Io=!1,jr=0;jr<Ks;jr++)if(Un.dists[jr]>_e[Fe][jr]){Io=!0;break}if(Io)return ee.splice(Xe,1),"continue";var Mi={};hi.neighbors.forEach(function(Zr){var Vi=d["".concat(In.id,"-").concat(Zr.id)];Mi["".concat(In.id,"-").concat(Zr.id)]={start:g[In.id].idx,end:g[Zr.id].idx,distance:Vi}}),K=au(Mi,F,t,K);var sa=[];Object.keys(Mi).forEach(function(Zr){if(jt[Zr]){sa.push(jt[Zr]);return}var Vi=K[Zr];jt[Zr]=su(Vi,kt,s,o),sa.push(jt[Zr])}),sa=sa.sort(function(Zr,Vi){return Vi-Zr});for(var is=!1,jr=0;jr<Ks;jr++)if(sa[jr]<pe[jr]){is=!0;break}if(is)return ee.splice(Xe,1),"continue"},er=He-1;er>=0;er--)Qe(er)});var yn=[];ee==null||ee.forEach(function(Fe){for(var Ke=g[Fe.id].idx,ze=uy(t.nodes,u[Ke],Ke,s,a),Ye=ze.neighbors,en=Ye.length,pe=!1,He=en-1;He>=0;He--){if(Ye.length+1<e.nodes.length){pe=!0;return}var Qe=Ye[He],er=Qe[s];if(!w[er]||!w[er].length){Ye.splice(He,1);continue}if(!_e[er]||!_e[er].length){Ye.splice(He,1);continue}var qe="".concat(Fe.id,"-").concat(Qe.id),Xe=d[qe],In=_e[er].length-1,hi=_e[er][In];if(Xe>hi){Ye.splice(He,1);continue}if(n){var Un="".concat(Qe.id,"-").concat(Fe.id),Ks=d[Un];In=tr[er].length-1;var Io=tr[er][In];if(Ks>Io){Ye.splice(He,1);continue}}var jr=jt[qe]?jt[qe]:qC(t,Fe,Qe,g,Xe,F,kt,s,o,jt,K),Mi="".concat(Xt.id,"-").concat(er),sa=Ge[Mi][Ge[Mi].length-1];if(jr<sa){Ye.splice(He,1);continue}var is=vy(le,er,b,w),Zr=is.minPatternNodeLabelDegree,Vi=is.minPatternNodeLabelInDegree,Aa=is.minPatternNodeLabelOutDegree;if(g[Qe.id].degree<Zr){Ye.splice(He,1);continue}}pe||yn.push({nodes:[Fe].concat(Ye)})});var Sr=tu(e,Xt.id,!1).length,lr={};n?(Object.keys(Sr).forEach(function(Fe){var Ke=b[Fe].node[s];lr[Ke]?lr[Ke].push(Sr[Fe]):lr[Ke]=[Sr[Fe]]}),Object.keys(lr).forEach(function(Fe){lr[Fe].sort(function(Ke,ze){return Ke-ze})})):lr=_e;for(var rs=yn.length,Mr=function(Ke){var ze=yn[Ke],Ye=ze.nodes[0],en={},pe={};ze.nodes.forEach(function(xn,di){pe[xn.id]={idx:di,node:xn,degree:0,inDegree:0,outDegree:0};var cr=xn[s];en[cr]?en[cr]++:en[cr]=1});var He=[],Qe={};t.edges.forEach(function(xn){pe[xn.source]&&pe[xn.target]&&(He.push(xn),Qe[xn[o]]?Qe[xn[o]]++:Qe[xn[o]]=1,pe[xn.source].degree++,pe[xn.target].degree++,pe[xn.source].outDegree++,pe[xn.target].inDegree++)});for(var er=Object.keys(O).length,qe=!1,Xe=0;Xe<er;Xe++){var In=Object.keys(O)[Xe];if(!Qe[In]||Qe[In]<O[In].length){qe=!0;break}}if(qe)return yn.splice(Ke,1),"continue";var hi=He.length;if(hi<e.edges.length)return yn.splice(Ke,1),"break";for(var Un=!1,Ks=function(di){var cr=He[di],oa=cr[o],Qs=O[oa];if(!Qs||!Qs.length)return Qe[oa]--,Qs&&Qe[oa]<Qs.length?(Un=!0,"break"):(He.splice(di,1),pe[cr.source].degree--,pe[cr.target].degree--,pe[cr.source].outDegree--,pe[cr.target].inDegree--,"continue");var JE=pe[cr.source].node[s],$E=pe[cr.target].node[s],G0=!1;if(Qs.forEach(function(tw){var ew=b[tw.source].node,nw=b[tw.target].node;ew[s]===JE&&nw[s]===$E&&(G0=!0),!n&&ew[s]===$E&&nw[s]===JE&&(G0=!0)}),!G0)return Qe[oa]--,Qs&&Qe[oa]<Qs.length?(Un=!0,"break"):(He.splice(di,1),pe[cr.source].degree--,pe[cr.target].degree--,pe[cr.source].outDegree--,pe[cr.target].inDegree--,"continue")},Xe=hi-1;Xe>=0;Xe--){var Io=Ks(Xe);if(Io==="break")break}if(Un)return yn.splice(Ke,1),"continue";ze.edges=He;var jr=tu(ze,ze.nodes[0].id,!1).length;if(Object.keys(jr).reverse().forEach(function(xn){if(!(xn===ze.nodes[0].id||Un)){if(jr[xn]===1/0){var di=pe[xn].node[s];if(en[di]--,en[di]<w[di].length){Un=!0;return}var cr=ze.nodes.indexOf(pe[xn].node);ze.nodes.splice(cr,1),pe[xn]=void 0;return}var oa=g[xn].node[s];if(!lr[oa]||!lr[oa].length||jr[xn]>lr[oa][lr[oa].length-1]){var di=pe[xn].node[s];if(en[di]--,en[di]<w[di].length){Un=!0;return}var cr=ze.nodes.indexOf(pe[xn].node);ze.nodes.splice(cr,1),pe[xn]=void 0}}}),Un)return yn.splice(Ke,1),"continue";for(var Mi=!0,sa=0;Mi&&!Un;){Mi=!1;var is=n?pe[Ye.id].degree<b[Xt.id].degree||pe[Ye.id].inDegree<b[Xt.id].inDegree||pe[Ye.id].outDegree<b[Xt.id].outDegree:pe[Ye.id].degree<b[Xt.id].degree;if(is){Un=!0;break}if(en[Ye[s]]<w[Ye[s]].length){Un=!0;break}for(var Zr=ze.nodes.length,Vi=Zr-1;Vi>=0;Vi--){var Aa=ze.nodes[Vi],QE=pe[Aa.id].degree,TB=pe[Aa.id].inDegree,OB=pe[Aa.id].outDegree,CB=Aa[s],W0=vy(le,CB,b,w),qE=W0.minPatternNodeLabelDegree,NB=W0.minPatternNodeLabelInDegree,kB=W0.minPatternNodeLabelOutDegree,PB=n?QE<qE||TB<NB||OB<kB:QE<qE;if(PB){if(en[Aa[s]]--,en[Aa[s]]<w[Aa[s]].length){Un=!0;break}ze.nodes.splice(Vi,1),pe[Aa.id]=void 0,Mi=!0}}if(Un||!Mi&&sa!==0)break;hi=He.length;for(var ld=hi-1;ld>=0;ld--){var Ta=He[ld];if(!pe[Ta.source]||!pe[Ta.target]){He.splice(ld,1);var cd=Ta[o];if(Qe[cd]--,pe[Ta.source]&&(pe[Ta.source].degree--,pe[Ta.source].outDegree--),pe[Ta.target]&&(pe[Ta.target].degree--,pe[Ta.target].inDegree--),O[cd]&&Qe[cd]<O[cd].length){Un=!0;break}Mi=!0}}sa++}if(Un||Un||ze.nodes.length<e.nodes.length||He.length<e.edges.length)return yn.splice(Ke,1),"continue"},vr=rs-1;vr>=0;vr--){var Ma=Mr(vr);if(Ma==="break")break}for(var Ar=yn.length,$r=function(Ke){var ze=yn[Ke],Ye={};ze.edges.forEach(function(He){var Qe="".concat(He.source,"-").concat(He.target,"-").concat(He.label);Ye[Qe]?Ye[Qe]++:Ye[Qe]=1});for(var en=function(Qe){var er=yn[Qe],qe={};er.edges.forEach(function(In){var hi="".concat(In.source,"-").concat(In.target,"-").concat(In.label);qe[hi]?qe[hi]++:qe[hi]=1});var Xe=!0;Object.keys(qe).length!==Object.keys(Ye).length?Xe=!1:Object.keys(Ye).forEach(function(In){qe[In]!==Ye[In]&&(Xe=!1)}),Xe&&yn.splice(Qe,1)},pe=Ar-1;pe>Ke;pe--)en(pe);Ar=yn.length},vr=0;vr<=Ar-1;vr++)$r(vr);return yn}}},$C=JC,tN=function(){function r(t){t===void 0&&(t=10),this.linkedList=new Lm,this.maxStep=t}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),eN=tN,nN=Zm,Kz={getAdjMatrix:Kc,breadthFirstSearch:_O,connectedComponent:Im,getDegree:kf,getInDegree:BO,getOutDegree:FO,detectCycle:Zm,detectDirectedCycle:nN,detectAllCycles:ZO,detectAllDirectedCycle:jm,detectAllUndirectedCycle:zm,depthFirstSearch:Fm,dijkstra:tu,findAllPath:vC,findShortestPath:Bf,floydWarshall:Ff,labelPropagation:mC,louvain:Jm,iLouvain:AC,kCore:OC,kMeans:NC,cosineSimilarity:ty,nodesCosineSimilarity:RC,minimumSpanningTree:jC,pageRank:ny,getNeighbors:xi,Stack:eN,GADDI:$C};function At(r){if(r.id!==void 0)return r.id;if(r.source!==void 0&&r.target!==void 0)return`${r.source}-${r.target}`;throw new Error(ga("The datum does not have available id."))}function ou(r){return r.combo}function gy(r,t){const e={nodes:(r.nodes||[]).map(At),edges:(r.edges||[]).map(At),combos:(r.combos||[]).map(At)};return t?Object.values(e).flat():e}const py=(r,t,e)=>{var n;switch(e.type){case"degree":{const i=new Map;return(n=r.nodes)===null||n===void 0||n.forEach(a=>{const s=t(At(a),e.direction).length;i.set(At(a),s)}),i}case"betweenness":return rN(r,e.directed,e.weightPropertyName);case"closeness":return iN(r,e.directed,e.weightPropertyName);case"eigenvector":return sN(r,e.directed);case"pagerank":return aN(r,e.epsilon,e.linkProb);default:return my(r)}},my=r=>{var t;const e=new Map;return(t=r.nodes)===null||t===void 0||t.forEach(n=>{e.set(At(n),0)}),e},rN=(r,t,e)=>{const n=my(r),{nodes:i=[]}=r;return i.forEach(a=>{i.forEach(s=>{if(a!==s){const{allPath:o}=Bf(r,At(a),At(s),t,e),l=o.length;o.flat().forEach(c=>{c!==At(a)&&c!==At(s)&&n.set(c,n.get(c)+1/l)})}})}),n},iN=(r,t,e)=>{const n=new Map,{nodes:i=[]}=r;return i.forEach(a=>{const s=i.reduce((o,l)=>{if(a!==l){const{length:c}=Bf(r,At(a),At(l),t,e);o+=c}return o},0);n.set(At(a),1/s)}),n},aN=(r,t,e)=>{var n;const i=new Map,a=ny(r,t,e);return(n=r.nodes)===null||n===void 0||n.forEach(s=>{i.set(At(s),a[At(s)])}),i},sN=(r,t)=>{const{nodes:e=[]}=r,n=oN(r,t),i=lN(n,e.length),a=new Map;return e.forEach((s,o)=>{a.set(At(s),i[o])}),a},oN=(r,t)=>{const{nodes:e=[],edges:n=[]}=r,i=Array(e.length).fill(null).map(()=>Array(e.length).fill(0));return n.forEach(({source:a,target:s})=>{const o=e.findIndex(c=>At(c)===a),l=e.findIndex(c=>At(c)===s);t?i[o][l]=1:(i[o][l]=1,i[l][o]=1)}),i},lN=(r,t,e=100,n=1e-6)=>{let i=Array(t).fill(1),a=1/0;for(let s=0;s<e&&a>n;s++){const o=Array(t).fill(0);for(let c=0;c<t;c++)for(let u=0;u<t;u++)o[c]+=r[c][u]*i[u];const l=Math.sqrt(o.reduce((c,u)=>c+u*u,0));for(let c=0;c<t;c++)o[c]/=l;a=Math.sqrt(o.reduce((c,u,h)=>c+(u-i[h])*u,0)),i=o}return i};function ja(r,t,e,n=Zn){const i=new Map(r.map(d=>[e(d),d])),a=new Map(t.map(d=>[e(d),d])),s=new Set(i.keys()),o=new Set(a.keys()),l=[],c=[],u=[],h=[];return o.forEach(d=>{s.has(d)?n(i.get(d),a.get(d))?h.push(a.get(d)):c.push(a.get(d)):l.push(a.get(d))}),s.forEach(d=>{o.has(d)||u.push(i.get(d))}),{enter:l,exit:u,keep:h,update:c}}function Ps(r,t,e){const n=i=>{e&&!e(i)||(i.style.visibility=t)};r.forEach(i=>{n(i)})}function cN(r,t,e){const n={},i=a=>(a in n||(n[a]=0),`${t}-${a}-${n[a]++}`);return e.map(a=>typeof a=="string"?{type:a,key:i(a)}:typeof a=="function"?a.call(r):a.key?a:Object.assign(Object.assign({},a),{key:i(a.type)}))}class Zf{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=cN(this.context.graph,this.category,t),{enter:n,update:i,exit:a,keep:s}=ja(this.extensions,e,o=>o.key);this.createExtensions(n),this.updateExtensions([...i,...s]),this.destroyExtensions(a),this.extensions=e}createExtension(t){const{category:e}=this,{key:n,type:i}=t,a=va(e,i);if(!a)return Kr.warn(`The extension ${i} of ${e} is not registered.`);const s=new a(this.context,t);s.initialized=!0,this.extensionMap[n]=s}createExtensions(t){t.forEach(e=>this.createExtension(e))}updateExtension(t){const{key:e}=t,n=this.extensionMap[e];n&&n.update(t)}updateExtensions(t){t.forEach(e=>this.updateExtension(e))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.initialized&&!e.destroyed&&e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach(({key:e})=>this.destroyExtension(e))}destroy(){this.destroyExtensions(this.extensions),this.context={},this.extensions=[],this.extensionMap={}}}class Wf{constructor(t,e){this.events=[],this.initialized=!1,this.destroyed=!1,this.context=t,this.options=e}update(t){this.options=Object.assign(this.options,t)}destroy(){this.context={},this.options={},this.destroyed=!0}}class si extends Wf{}class lu extends si{constructor(t,e){super(t,Object.assign({},lu.defaultOptions,e)),this.isOverlapping=(n,i)=>i.some(a=>n.intersects(a)),this.occupiedBounds=[],this.detectLabelCollision=n=>{const i=this.context.viewport,a={show:[],hide:[]};return this.occupiedBounds=[],n.forEach(s=>{const o=s.getShape("label").getRenderBounds();i.isInViewport(o,!0)&&!this.isOverlapping(o,this.occupiedBounds)?(a.show.push(s),this.occupiedBounds.push(za(o,this.options.padding))):a.hide.push(s)}),a},this.hideLabelIfExceedViewport=(n,i)=>{const{exit:a}=ja(n,i,s=>s.id);a==null||a.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(n,i)=>{const{model:a}=this.context,s=a.getData(),o=a.getRelatedEdgesData.bind(a);return n.map(c=>(this.nodeCentralities.has(c.id)||(this.nodeCentralities=py(s,o,i)),{node:c,centrality:this.nodeCentralities.get(c.id)})).sort((c,u)=>u.centrality-c.centrality).map(c=>c.node)},this.sortLabelElementsInView=n=>{const{sort:i,sortNode:a,sortCombo:s,sortEdge:o}=this.options,{model:l}=this.context;if(fe(i))return n.sort((g,p)=>i(l.getElementDataById(g.id),l.getElementDataById(p.id)));const{node:c=[],edge:u=[],combo:h=[]}=Hc(n,g=>g.type),d=fe(s)?h.sort((g,p)=>s(...l.getComboData([g.id,p.id]))):h,f=fe(a)?c.sort((g,p)=>a(...l.getNodeData([g.id,p.id]))):this.sortNodesByCentrality(c,a),v=fe(o)?u.sort((g,p)=>o(...l.getEdgeData([g.id,p.id]))):u;return[...d,...f,...v]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=n=>{var i;if(((i=n.data)===null||i===void 0?void 0:i.stage)==="zIndex")return;if(!this.validate(n)){this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear());return}const a=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,a),this.labelElementsInView=a;const s=this.sortLabelElementsInView(this.labelElementsInView),{show:o,hide:l}=this.detectLabelCollision(s);for(let c=o.length-1;c>=0;c--)this.showLabel(o[c]);l.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=n=>{const i=n.getShape("label");i&&Ps(i,"hidden"),this.hiddenElements.set(n.id,n)},this.showLabel=n=>{const i=n.getShape("label");i&&Ps(i,"visible"),n.toFront(),this.hiddenElements.delete(n.id)},this.onTransform=km(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=n=>{this.enableToggle&&this.onToggleVisibility(n)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=n=>{this.onToggleVisibility(n),this.enableToggle=!0},this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents(),this.onToggleVisibility({})}getLabelElements(){const{elementMap:t}=this.context.element,e=[];for(const n in t){const i=t[n];i.isVisible()&&i.getShape("label")&&e.push(i)}return e}getLabelElementsInView(){const t=this.context.viewport;return this.getLabelElements().filter(e=>t.isInViewport(e.getShape("key").getRenderBounds()))}bindEvents(){const{graph:t}=this.context;t.on(Kt.BEFORE_RENDER,this.onBeforeRender),t.on(Kt.AFTER_RENDER,this.onAfterRender),t.on(Kt.AFTER_DRAW,this.toggle),t.on(Kt.AFTER_LAYOUT,this.toggle),t.on(Kt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.BEFORE_RENDER,this.onBeforeRender),t.off(Kt.AFTER_RENDER,this.onAfterRender),t.off(Kt.AFTER_DRAW,this.toggle),t.off(Kt.AFTER_LAYOUT,this.toggle),t.off(Kt.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}lu.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var uN=function(r){if(!Sf(r)||!Mg(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t},vo=uN,hN=5;function dN(r,t){if(Object.hasOwn)return Object.hasOwn(r,t);if(r==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(r),t)}function yy(r,t,e,n){e=e||0,n=n||hN;for(var i in t)if(dN(t,i)){var a=t[i];a!==null&&vo(a)?(vo(r[i])||(r[i]={}),e<n?yy(r[i],a,e+1,n):r[i]=t[i]):Gr(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var fN=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)yy(r,t[n]);return r},mr=fN;const by=[0,0,0];function Ce(r,t){return r.map((e,n)=>e+t[n])}function on(r,t){return r.map((e,n)=>e-t[n])}function _i(r,t){return typeof t=="number"?r.map(e=>e*t):r.map((e,n)=>e*t[n])}function Ii(r,t){return typeof t=="number"?r.map(e=>e/t):r.map((e,n)=>e/t[n])}function vN(r,t){return r.reduce((e,n,i)=>e+n*t[i],0)}function gN(r,t){const e=pl(r),n=pl(t);return[e[1]*n[2]-e[2]*n[1],e[2]*n[0]-e[0]*n[2],e[0]*n[1]-e[1]*n[0]]}function Za(r,t){return r.map(e=>e*t)}function bn(r,t){return Math.sqrt(r.reduce((e,n,i)=>e+Math.pow(n-t[i]||0,2),0))}function cu(r,t){return r.reduce((e,n,i)=>e+Math.abs(n-t[i]),0)}function pa(r){const t=r.reduce((e,n)=>e+Math.pow(n,2),0);return r.map(e=>e/Math.sqrt(t))}function Gf(r,t,e=!1){const n=r[0]*t[1]-r[1]*t[0];let i=Math.acos(_i(r,t).reduce((a,s)=>a+s,0)/(bn(r,by)*bn(t,by)));return e&&n<0&&(i=2*Math.PI-i),i}function Qz(r,t){return r.every((e,n)=>e===t[n])}function uu(r,t=!0){return t?[-r[1],r[0]]:[r[1],-r[0]]}function Vf(r,t){return r.map(e=>e%t)}function Rs(r){return[r[0],r[1]]}function pl(r){return xO(r)?[r[0],r[1],0]:r}function xy(r){const[t,e]=r;return!t&&!e?0:Math.atan2(e,t)}function Ey(r,t){const[e,n]=r,[i,a]=t,s=on(e,n),o=on(i,a);return gN(s,o).every(l=>l===0)}function Uf(r,t,e=!1){if(Ey(r,t))return;const[n,i]=r,[a,s]=t,o=((n[0]-a[0])*(a[1]-s[1])-(n[1]-a[1])*(a[0]-s[0]))/((n[0]-i[0])*(a[1]-s[1])-(n[1]-i[1])*(a[0]-s[0])),l=s[0]-a[0]?(n[0]-a[0]+o*(i[0]-n[0]))/(s[0]-a[0]):(n[1]-a[1]+o*(i[1]-n[1]))/(s[1]-a[1]);if(!(!e&&(!$i(o,0,1)||!$i(l,0,1))))return[n[0]+o*(i[0]-n[0]),n[1]+o*(i[1]-n[1])]}function wy(r){if(Array.isArray(r))return $i(r[0],0,1)&&$i(r[1],0,1)?r:[.5,.5];const t=r.split("-"),e=t.includes("left")?0:t.includes("right")?1:.5,n=t.includes("top")?0:t.includes("bottom")?1:.5;return[e,n]}function ar(r){const{x:t=0,y:e=0,z:n=0}=r.style||{};return[+t,+e,+n]}function pN(r){const{x:t,y:e,z:n}=r.style||{};return t!==void 0||e!==void 0||n!==void 0}function Sy(r,t){const[e,n]=t,{min:i,max:a}=r;return[i[0]+e*(a[0]-i[0]),i[1]+n*(a[1]-i[1])]}function ma(r,t="center"){const e=wy(t);return Sy(r,e)}function qz(r,t){const e=parseAnchor(t);return Sy(r,e)}const Jz=r=>{const[t,e]=r;return{left:Math.min(t[0],e[0]),right:Math.max(t[0],e[0]),top:Math.min(t[1],e[1]),bottom:Math.max(t[1],e[1])}};function yr(r){var t;return[r.x,r.y,(t=r.z)!==null&&t!==void 0?t:0]}function Bi(r){var t;return{x:r[0],y:r[1],z:(t=r[2])!==null&&t!==void 0?t:0}}function $z(r){return r.sort((t,e)=>t[0]-e[0]||t[1]-e[1])}function t7(r){const t=new Set;return r.filter(e=>{const n=e.join(",");return t.has(n)?!1:(t.add(n),!0)})}function ml(r,t=0){return r.map(e=>parseFloat(e.toFixed(t)))}function Wa(r,t,e,n=!1){if(Zn(r,t))return r;const i=n?on(r,t):on(t,r),a=pa(i),s=[a[0]*e,a[1]*e];return Ce(Rs(r),s)}function My(r,t){return r[1]===t[1]}function mN(r,t){return r[0]===t[0]}function yN(r,t){return My(r,t)||mN(r,t)}function Ay(r,t,e){return Ey([r,t],[t,e])}function Ty(r,t){return[2*t[0]-r[0],2*t[1]-r[1]]}function Oy(r,t,e,n=!0,i=!1){for(let a=0;a<e.length;a++){let s=e[a],o=e[(a+1)%e.length];n&&(s=Ce(t,s),o=Ce(t,o));const l=i?Ty(r,t):r,c=Uf([t,l],[s,o]);if(c)return{point:c,line:[s,o]}}return{point:t,line:void 0}}function bN(r,t,e,n){const i=r[0],a=r[1];let s=!1;e===void 0&&(e=0),n===void 0&&(n=t.length);const o=n-e;for(let l=0,c=o-1;l<o;c=l++){const u=t[l+e][0],h=t[l+e][1],d=t[c+e][0],f=t[c+e][1];h>a!=f>a&&i<(d-u)*(a-h)/(f-h)+u&&(s=!s)}return s}function xN(r,t,e=!1){const n=ma(t,"center"),i=[ma(t,"left-top"),ma(t,"right-top"),ma(t,"right-bottom"),ma(t,"left-bottom")];return Oy(r,n,i,!1,e).point}function hu(r,t,e=!1){const n=t.center,i=e?Ty(r,n):r,a=on(i,t.center),s=Math.atan2(a[1],a[0]);if(isNaN(s))return n;const o=ta(t)/2,l=ea(t)/2,c=n[0]+o*Math.cos(s),u=n[1]+l*Math.sin(s);return[c,u]}function EN(r,t){let e=1/0,n=[r[0],t[0]];return r.forEach(i=>{t.forEach(a=>{const s=bn(i,a);s<e&&(e=s,n=[i,a])})}),n}function wN(r,t){let e=1/0,n=[[0,0],[0,0]];return t.forEach(i=>{const a=SN(r,i);a<e&&(e=a,n=i)}),n}function SN(r,t){const e=Cy(r,t);return bn(r,e)}function Cy(r,t){const[e,n]=t[0],[i,a]=t[1],[s,o]=r,l=i-e,c=a-n;if(l===0&&c===0)return[e,n];let u=((s-e)*l+(o-n)*c)/(l*l+c*c);u>1?u=1:u<0&&(u=0);const h=e+u*l,d=n+u*c;return[h,d]}function MN(r){const t=r.reduce((e,n)=>Ce(e,n),[0,0]);return Ii(t,r.length)}function Yf(r,t=!0){const e=MN(r);return r.sort(([n,i],[a,s])=>{const o=Math.atan2(i-e[1],n-e[0]),l=Math.atan2(s-e[1],a-e[0]);return t?l-o:o-l})}function Ny(r,t){return[r,[r[0],t[1]],t,[t[0],r[1]]]}class Wn{constructor(t,e,n){if(this.phase=e,this.pointerByTouch=[],this.initialDistance=null,this.emitter=t,Wn.instance)return Wn.callbacks[this.phase].push(n),Wn.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),Wn.instance=this,Wn.callbacks[this.phase].push(n)}bindEvents(){const{emitter:t}=this;t.on(Bt.POINTER_DOWN,this.onPointerDown),t.on(Bt.POINTER_MOVE,this.onPointerMove),t.on(Bt.POINTER_UP,this.onPointerUp)}updatePointerPosition(t,e,n){const i=this.pointerByTouch.findIndex(a=>a.pointerId===t);i>=0&&(this.pointerByTouch[i]={x:e,y:n,pointerId:t})}onPointerDown(t){const{x:e,y:n}=t.client||{};if(!(e===void 0||n===void 0)&&(this.pointerByTouch.push({x:e,y:n,pointerId:t.pointerId}),t.pointerType==="touch"&&this.pointerByTouch.length===2)){Wn.isPinching=!0;const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y;this.initialDistance=Math.sqrt(i*i+a*a),Wn.callbacks.pinchstart.forEach(s=>s(t,{scale:0}))}}onPointerMove(t){if(this.pointerByTouch.length!==2||this.initialDistance===null)return;const{x:e,y:n}=t.client||{};if(e===void 0||n===void 0)return;this.updatePointerPosition(t.pointerId,e,n);const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y,o=Math.sqrt(i*i+a*a)/this.initialDistance;Wn.callbacks.pinchmove.forEach(l=>l(t,{scale:(o-1)*5}))}onPointerUp(t){var e;Wn.callbacks.pinchend.forEach(n=>n(t,{scale:0})),Wn.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],(e=Wn.instance)===null||e===void 0||e.tryDestroy()}destroy(){this.emitter.off(Bt.POINTER_DOWN,this.onPointerDown),this.emitter.off(Bt.POINTER_MOVE,this.onPointerMove),this.emitter.off(Bt.POINTER_UP,this.onPointerUp),Wn.instance=null}off(t,e){const n=Wn.callbacks[t].indexOf(e);n>-1&&Wn.callbacks[t].splice(n,1),this.tryDestroy()}tryDestroy(){Object.values(Wn.callbacks).every(t=>t.length===0)&&this.destroy()}}Wn.isPinching=!1,Wn.instance=null,Wn.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const ky=r=>r.map(t=>Ve(t)?t.toLocaleLowerCase():t);class go{constructor(t){this.map=new Map,this.boundHandlePinch=()=>{},this.recordKey=new Set,this.onKeyDown=e=>{e!=null&&e.key&&(this.recordKey.add(e.key),this.trigger(e))},this.onKeyUp=e=>{e!=null&&e.key&&this.recordKey.delete(e.key)},this.onWheel=e=>{this.triggerExtendKey(Bt.WHEEL,e)},this.onDrag=e=>{this.triggerExtendKey(Bt.DRAG,e)},this.handlePinch=(e,n)=>{this.triggerExtendKey(Bt.PINCH,Object.assign(Object.assign({},e),n))},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){t.length!==0&&(t.includes(Bt.PINCH)&&!this.pinchHandler&&(this.boundHandlePinch=this.handlePinch.bind(this),this.pinchHandler=new Wn(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(t,e))}unbind(t,e){this.map.forEach((n,i)=>{Zn(i,t)&&(!e||e===n)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(t){const e=ky(Array.from(this.recordKey)).sort(),n=ky(t).sort();return Zn(e,n)}bindEvents(){var t;const{emitter:e}=this;e.on(Bt.KEY_DOWN,this.onKeyDown),e.on(Bt.KEY_UP,this.onKeyUp),e.on(Bt.WHEEL,this.onWheel),e.on(Bt.DRAG,this.onDrag),(t=globalThis.addEventListener)===null||t===void 0||t.call(globalThis,"focus",this.onFocus)}trigger(t){this.map.forEach((e,n)=>{this.match(n)&&e(t)})}triggerExtendKey(t,e){this.map.forEach((n,i)=>{i.includes(t)&&Zn(Array.from(this.recordKey),i.filter(a=>a!==t))&&n(e)})}destroy(){var t,e;this.unbindAll(),this.emitter.off(Bt.KEY_DOWN,this.onKeyDown),this.emitter.off(Bt.KEY_UP,this.onKeyUp),this.emitter.off(Bt.WHEEL,this.onWheel),this.emitter.off(Bt.DRAG,this.onDrag),(t=this.pinchHandler)===null||t===void 0||t.off("pinchmove",this.boundHandlePinch),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"blur",this.onFocus)}}class yl extends si{constructor(t,e){super(t,mr({},yl.defaultOptions,e)),this.shortcut=new go(t.graph),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.clearStates=this.clearStates.bind(this),this.bindEvents()}onPointerDown(t){if(!this.validate(t)||!this.isKeydown()||this.startPoint)return;const{canvas:e,graph:n}=this.context,i=Object.assign({},this.options.style);this.options.style.lineWidth&&(i.lineWidth=+this.options.style.lineWidth/n.getZoom()),this.rectShape=new pr({id:"g6-brush-select",style:i}),e.appendChild(this.rectShape),this.startPoint=[t.canvas.x,t.canvas.y]}onPointerMove(t){var e;if(!this.startPoint)return;const{immediately:n,mode:i}=this.options;this.endPoint=du(t),(e=this.rectShape)===null||e===void 0||e.attr({x:Math.min(this.endPoint[0],this.startPoint[0]),y:Math.min(this.endPoint[1],this.startPoint[1]),width:Math.abs(this.endPoint[0]-this.startPoint[0]),height:Math.abs(this.endPoint[1]-this.startPoint[1])}),n&&i==="default"&&this.updateElementsStates(Ny(this.startPoint,this.endPoint))}onPointerUp(t){if(this.startPoint){if(!this.endPoint){this.clearBrush();return}this.endPoint=du(t),this.updateElementsStates(Ny(this.startPoint,this.endPoint)),this.clearBrush()}}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:t}=this.context,e=Object.values(t.getData()).reduce((n,i)=>Object.assign({},n,i.reduce((a,s)=>{var o;const l=(o=s.states||[])===null||o===void 0?void 0:o.filter(c=>c!==this.options.state);return a[At(s)]=l,a},{})),{});t.setElementState(e,this.options.animation)}updateElementsStates(t){const{graph:e}=this.context,{enableElements:n,state:i,mode:a,onSelect:s}=this.options,o=this.selector(e,t,n);let l={};switch(a){case"union":o.forEach(c=>{l[c]=[...e.getElementState(c),i]});break;case"diff":o.forEach(c=>{const u=e.getElementState(c);l[c]=u.includes(i)?u.filter(h=>h!==i):[...u,i]});break;case"intersect":o.forEach(c=>{const u=e.getElementState(c);l[c]=u.includes(i)?[i]:[]});break;case"default":default:o.forEach(c=>{l[c]=[i]});break}fe(s)&&(l=s(l)),e.setElementState(l,this.options.animation)}selector(t,e,n){if(!n||n.length===0)return[];const i=[],a=t.getData();if(n.forEach(s=>{a[`${s}s`].forEach(o=>{const l=At(o);t.getElementVisibility(l)!=="hidden"&&bN(t.getElementPosition(l),e)&&i.push(l)})}),n.includes("edge")){const s=a.edges;s==null||s.forEach(o=>{const{source:l,target:c}=o;i.includes(l)&&i.includes(c)&&i.push(At(o))})}return i}clearBrush(){var t;(t=this.rectShape)===null||t===void 0||t.remove(),this.rectShape=void 0,this.startPoint=void 0,this.endPoint=void 0}isKeydown(){const{trigger:t}=this.options,e=Array.isArray(t)?t:[t];return this.shortcut.match(e.filter(n=>n!=="drag"))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}bindEvents(){const{graph:t}=this.context;t.on(Bt.POINTER_DOWN,this.onPointerDown),t.on(Bt.POINTER_MOVE,this.onPointerMove),t.on(Bt.POINTER_UP,this.onPointerUp),t.on(fa.CLICK,this.clearStates)}unbindEvents(){const{graph:t}=this.context;t.off(Bt.POINTER_DOWN,this.onPointerDown),t.off(Bt.POINTER_MOVE,this.onPointerMove),t.off(Bt.POINTER_UP,this.onPointerUp),t.off(fa.CLICK,this.clearStates)}update(t){this.unbindEvents(),this.options=mr(this.options,t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}yl.defaultOptions={animation:!1,enable:!0,enableElements:["node","combo","edge"],immediately:!1,mode:"default",state:"selected",trigger:["shift"],style:{width:0,height:0,lineWidth:1,fill:"#1677FF",stroke:"#1677FF",fillOpacity:.1,zIndex:2,pointerEvents:"none"}};const du=r=>[r.canvas.x,r.canvas.y],ya=.8,Ls=["node","edge","combo"];function Ds(r,t,e,n,i=0){n==="TB"&&t(r,i);const a=e(r);if(a)for(const s of a)Ds(s,t,e,n,i+1);n==="BT"&&t(r,i)}function AN(r,t,e){const n=[[r,0]];for(;n.length;){const[i,a]=n.shift();t(i,a);const s=e(i);if(s)for(const o of s)n.push([o,a+1])}}function Py(r,t,e,n,i="both"){if(t==="combo"||t==="node")return Hf(r,e,n,i);const a=r.getEdgeData(e);if(!a)return[];const s=Hf(r,a.source,n-1,i),o=Hf(r,a.target,n-1,i);return Array.from(new Set([...s,...o,e]))}function Hf(r,t,e,n="both"){const i=new Set,a=new Set,s=new Set;return AN(t,(o,l)=>{l>e||(s.add(o),r.getRelatedEdgesData(o,n).forEach(c=>{const u=At(c);!a.has(u)&&l<e&&(s.add(u),a.add(u))}))},o=>r.getRelatedEdgesData(o,n).map(l=>l.source===o?l.target:l.source).filter(l=>i.has(l)?!1:(i.add(l),!0))),Array.from(s)}function Xf(r){return r.states||[]}var fu=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class vu extends si{constructor(t,e){super(t,Object.assign({},vu.defaultOptions,e)),this.onClickSelect=n=>fu(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.updateState(n),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.onClickCanvas=n=>fu(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.clearState(),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.shortcut=new go(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ls.forEach(e=>{t.on(`${e}:${Bt.CLICK}`,this.onClickSelect)}),t.on(fa.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:t,trigger:e}=this.options;return t&&this.shortcut.match(e)}getNeighborIds(t){const{target:e,targetType:n}=t,{graph:i}=this.context,{degree:a}=this.options;return Py(i,n,e.id,typeof a=="function"?a(t):a).filter(s=>s!==e.id)}updateState(t){return fu(this,void 0,void 0,function*(){const{state:e,unselectedState:n,neighborState:i,animation:a}=this.options;if(!e&&!i&&!n)return;const{target:s}=t,{graph:o}=this.context,l=o.getElementData(s.id),c=Xf(l).includes(e)?"unselect":"select",u={},h=this.isMultipleSelect,d=[s.id],f=this.getNeighborIds(t);if(h)if(Object.assign(u,this.getDataStates()),c==="select"){const v=(g,p)=>{g.forEach(y=>{const b=new Set(o.getElementState(y));b.add(p),b.delete(n),u[y]=Array.from(b)})};v(d,e),v(f,i),n&&Object.keys(u).forEach(g=>{const p=u[g];!p.includes(e)&&!p.includes(i)&&!p.includes(n)&&u[g].push(n)})}else{const v=u[s.id];u[s.id]=v.filter(g=>g!==e&&g!==i),v.includes(n)||u[s.id].push(n),f.forEach(g=>{u[g]=u[g].filter(p=>p!==i),u[g].includes(e)||u[g].push(n)})}else if(c==="select"){Object.assign(u,this.getClearStates(!!n));const v=(g,p)=>{g.forEach(y=>{u[y]||(u[y]=o.getElementState(y)),u[y].push(p)})};v(d,e),v(f,i),n&&Object.keys(u).forEach(g=>{!d.includes(g)&&!f.includes(g)&&u[g].push(n)})}else Object.assign(u,this.getClearStates());yield o.setElementState(u,a)})}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:n,combos:i}=t.getData(),a={};return[...e,...n,...i].forEach(s=>{a[At(s)]=Xf(s)}),a}getClearStates(t=!1){const{graph:e}=this.context,{state:n,unselectedState:i,neighborState:a}=this.options,s=new Set([n,i,a]),{nodes:o,edges:l,combos:c}=e.getData(),u={};return[...o,...l,...c].forEach(h=>{const d=Xf(h),f=d.filter(v=>!s.has(v));(t||f.length!==d.length)&&(u[At(h)]=f)}),u}clearState(){return fu(this,void 0,void 0,function*(){const{graph:t}=this.context;yield t.setElementState(this.getClearStates(),this.options.animation)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ls.forEach(e=>{t.off(`${e}:${Bt.CLICK}`,this.onClickSelect)}),t.off(fa.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}vu.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function Qr(r){var t;return!!(!((t=r.style)===null||t===void 0)&&t.collapsed)}var br=function(r,t,e){for(var n=0,i=Ve(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},bl=function(r,t,e){var n=r,i=Ve(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(Fn(n[a])||(n[a]=ie(i[s+1])?[]:{}),n=n[a]):n[a]=e}),r},TN=function(r){var t=Sm(r);return t.charAt(0).toLowerCase()+t.substring(1)},ON=TN;function xl(r,t){if(!r.startsWith(t))return!1;const e=r[t.length];return e>="A"&&e<="Z"}function Ry(r,t){return`${t}${Uc(r)}`}function Ly(r,t,e=!0){if(!t||!xl(r,t))return r;const n=r.slice(t.length);return e?ON(n):n}function Qn(r,t){const e=Object.entries(r).reduce((n,[i,a])=>(i==="className"||i==="class"||xl(i,t)&&Object.assign(n,{[Ly(i,t)]:a}),n),{});if("opacity"in r){const n=Ry("opacity",t),i=r.opacity;if(n in r){const a=r[n];Object.assign(e,{opacity:i*a})}else Object.assign(e,{opacity:i})}return e}function Kf(r,t){const e=t.length;return Object.keys(r).reduce((n,i)=>{if(i.startsWith(t)){const a=i.slice(e);n[a]=r[i]}return n},{})}function Dy(r,t){const e=typeof t=="string"?[t]:t,n={};return Object.keys(r).forEach(i=>{e.find(a=>i.startsWith(a))||(n[i]=r[i])}),n}function e7(r,t,e){return Object.entries(r).reduce((n,[i,a])=>(xl(i,t)?n[Ry(Ly(i,t,!1),e)]=a:n[i]=a,n),{})}function oi(r=0){if(typeof r=="number")return[r,r,r];const[t,e=t,n=t]=r;return[t,e,n]}var CN=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function _y(r,t){const{datum:e,graph:n}=t;return typeof r=="function"?r.call(n,e):Object.fromEntries(Object.entries(r).map(([i,a])=>typeof a=="function"?[i,a.call(n,e)]:[i,a]))}function hr(r,t){const e=(r==null?void 0:r.style)||{},n=(t==null?void 0:t.style)||{};for(const i in e)i in n||(n[i]=e[i]);return Object.assign({},r,t,{style:n})}function NN(r){const{x:t,y:e,z:n,class:i,className:a,transform:s,transformOrigin:o,zIndex:l,visibility:c}=r;return CN(r,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}function kN(r,t){const e=oi(r);let n={};return t.text&&!t.fontSize&&(n={fontSize:Math.min(...e)*.5}),t.src&&(!t.width||!t.height)&&(n={width:e[0]*.5,height:e[1]*.5}),n}function Iy(r){if(r)return typeof r=="string"||typeof r=="function"||Array.isArray(r)?{type:"group",field:t=>t.id,color:r,invert:!1}:r}function PN(r,t){if(!t)return{};const{type:e,color:n,field:i,invert:a}=t,s=l=>{const c=typeof n=="string"?va("palette",n):n;if(typeof c=="function"){const u={};return l.forEach(([h,d])=>{u[h]=c(a?1-d:d)}),u}else if(Array.isArray(c)){const u=a?[...c].reverse():c,h={};return l.forEach(([d,f])=>{h[d]=u[f%c.length]}),h}return{}},o=(l,c)=>{var u;return typeof l=="string"?(u=c.data)===null||u===void 0?void 0:u[l]:l==null?void 0:l(c)};if(e==="group"){const l=Hc(r,d=>{if(!i)return"default";const f=o(i,d);return f?String(f):"default"}),c=Object.keys(l),u=s(c.map((d,f)=>[d,f])),h={};return Object.entries(l).forEach(([d,f])=>{f.forEach(v=>{h[At(v)]=u[d]})}),h}else if(e==="value"){const[l,c]=r.reduce(([h,d],f)=>{const v=o(i,f);if(typeof v!="number")throw new Error(ga(`Palette field ${i} is not a number`));return[Math.min(h,v),Math.max(d,v)]},[1/0,-1/0]),u=c-l;return s(r.map(h=>[h.id,(o(i,h)-l)/u]))}}function By(r){const t=typeof r=="string"?va("palette",r):r;if(typeof t!="function")return t}function Fy(r,t){let e=2*r;return typeof t=="string"?e=r*Number(t.replace("%",""))/100:typeof t=="number"&&(e=t),isNaN(e)&&(e=2*r),e}function zy(r,t,e=1,n=!1){const i=n?e:1,a=(r.max[0]-r.min[0])*i;return Fy(a,t)}function RN(r,t,e=1){const n=bn(r[0],r[1])*e;return Fy(n,t)}var LN={}.toString,DN=function(r){return LN.call(r).replace(/^\[object /,"").replace(/]$/,"")},_N=DN,IN=Object.prototype,BN=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||IN;return r===e},FN=BN,zN=Object.prototype.hasOwnProperty;function jN(r){if(ye(r))return!0;if(cl(r))return!r.length;var t=_N(r);if(t==="Map"||t==="Set")return!r.size;if(FN(r))return!Object.keys(r).length;for(var e in r)if(zN.call(r,e))return!1;return!0}var ra=jN;class El extends hf{constructor(t){jy(t.style),super(t),this.shapeMap={},this.animateMap={},this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(t,e,n,i,a){var s,o,l,c,u,h,d,f;const v=this.shapeMap[t];if(n===!1){v&&((s=a==null?void 0:a.beforeDestroy)===null||s===void 0||s.call(a,v),i.removeChild(v),delete this.shapeMap[t],(o=a==null?void 0:a.afterDestroy)===null||o===void 0||o.call(a,v));return}const g=typeof e=="string"?va(ul.SHAPE,e):e;if(!g)throw new Error(ga(`Shape ${e} not found`));if(!v||v.destroyed||!(v instanceof g)){v&&((l=a==null?void 0:a.beforeDestroy)===null||l===void 0||l.call(a,v),v==null||v.destroy(),(c=a==null?void 0:a.afterDestroy)===null||c===void 0||c.call(a,v)),(u=a==null?void 0:a.beforeCreate)===null||u===void 0||u.call(a);const p=new g({className:t,style:n});return i.appendChild(p),this.shapeMap[t]=p,(h=a==null?void 0:a.afterCreate)===null||h===void 0||h.call(a,p),p}return(d=a==null?void 0:a.beforeUpdate)===null||d===void 0||d.call(a,v),mv(v,n),(f=a==null?void 0:a.afterUpdate)===null||f===void 0||f.call(a,v),v}update(t={}){const e=Object.assign({},this.attributes,t);jy(e),Z3(this,e),this.render(e,this),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return NN(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(t.length===0)return null;const n=[];if(t[0].x!==void 0||t[0].y!==void 0||t[0].z!==void 0){const{x:a=0,y:s=0,z:o=0}=this.attributes;t.forEach(l=>{const{x:c=a,y:u=s,z:h=o}=l;Object.assign(l,{transform:h?[["translate3d",c,u,h]]:[["translate",c,u]]})})}const i=super.animate(t,e);if(i&&(Qf(this,i),n.push(i)),Array.isArray(t)&&t.length>0){const a=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some(s=>!a.includes(s))){Object.entries(this.shapeMap).forEach(([o,l])=>{const c=`get${Uc(o)}Style`,u=this[c];if(fe(u)){const h=t.map(f=>u.call(this,Object.assign(Object.assign({},this.attributes),f))),d=l.animate(Of(h),e);d&&(Qf(l,d),n.push(d))}});const s=(o,l)=>{if(!ra(o)){const c=`get${Uc(l)}Style`,u=this[c];if(fe(u)){const h=t.map(d=>u.call(this,Object.assign(Object.assign({},this.attributes),d)));Object.entries(h[0]).map(([d])=>{const f=h.map(g=>g[d]),v=o[d];if(v){const g=v.animate(Of(f),e);g&&(Qf(v,g),n.push(g))}})}}};this.compositeShapes.forEach(([o,l])=>{const c=Kf(this.shapeMap,l);s(c,o)})}}return Tf(n)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Ps(this,t)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function Qf(r,t){t==null||t.finished.then(()=>{const e=r.activeAnimations.findIndex(n=>n===t);e>-1&&r.activeAnimations.splice(e,1)})}function jy(r){if(!r)return{};if("x"in r||"y"in r||"z"in r){const{x:t=0,y:e=0,z:n,transform:i}=r,a=Tm(t,e,n,i);a&&(r.transform=a)}return r}var ZN=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Ga extends El{constructor(t){super(hr({style:Ga.defaultStyleProps},t))}isTextStyle(t){return xl(t,"label")}isBackgroundStyle(t){return xl(t,"background")}getTextStyle(t){const e=this.getGraphicStyle(t),{padding:n}=e,i=ZN(e,["padding"]);return Dy(i,"background")}getBackgroundStyle(t){if(t.background===!1)return!1;const e=this.getGraphicStyle(t),{wordWrap:n,wordWrapWidth:i,padding:a}=e,s=Qn(e,"background"),{min:[o,l],center:[c,u],halfExtents:[h,d]}=this.shapeMap.text.getGeometryBounds(),[f,v,g,p]=Ri(a),y=h*2+p+v,{width:b,height:w}=s;b&&w?Object.assign(s,{x:c-Number(b)/2,y:u-Number(w)/2}):Object.assign(s,{x:o-p,y:l-f,width:n?Math.min(y,i+p+v):y,height:d*2+f+g});const{radius:O}=s;if(typeof O=="string"&&O.endsWith("%")){const _=Number(O.replace("%",""))/100;s.radius=Math.min(+s.width,+s.height)*_}return s}render(t=this.parsedAttributes,e=this){this.upsert("text",Os,this.getTextStyle(t),e),this.upsert("background",pr,this.getBackgroundStyle(t),e)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}Ga.defaultStyleProps={padding:0,fontSize:12,fontFamily:"system-ui, sans-serif",wordWrap:!0,maxLines:1,wordWrapWidth:128,textOverflow:"...",textBaseline:"middle",backgroundOpacity:.75,backgroundZIndex:-1,backgroundLineWidth:0};class po extends El{constructor(t){super(hr({style:po.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",Ga,this.getBadgeStyle(t),e)}getGeometryBounds(){const t=this.getShape("label");return(t.getShape("background")||t.getShape("text")).getGeometryBounds()}}po.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};function WN(r,t=!0){const e=[];return r.forEach((n,i)=>{e.push([i===0?"M":"L",...n])}),t&&e.push(["Z"]),e}const Zy={M:["x","y"],m:["dx","dy"],H:["x"],h:["dx"],V:["y"],v:["dy"],L:["x","y"],l:["dx","dy"],Z:[],z:[],C:["x1","y1","x2","y2","x","y"],c:["dx1","dy1","dx2","dy2","dx","dy"],S:["x2","y2","x","y"],s:["dx2","dy2","dx","dy"],Q:["x1","y1","x","y"],q:["dx1","dy1","dx","dy"],T:["x","y"],t:["dx","dy"],A:["rx","ry","rotation","large-arc","sweep","x","y"],a:["rx","ry","rotation","large-arc","sweep","dx","dy"]};function GN(r){const t=r.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),e=[];let n="",i={};for(;t.length>0;){let a=t.shift();a in Zy?n=a:t.unshift(a),i={type:n},Zy[n].forEach(l=>{a=t.shift(),i[l]=a}),n==="M"?n="L":n==="m"&&(n="l");const[s,...o]=Object.values(i);e.push([s,...o.map(Number)])}return e}function VN(r){const t=[];return(typeof r=="string"?GN(r):r).forEach(n=>{const i=n[0];if(i==="Z"){t.push(t[0]);return}if(i!=="A")for(let a=1;a<n.length;a=a+2)t.push([n[a],n[a+1],0]);else{const a=n.length;t.push([n[a-2],n[a-1],0])}}),t}const Wy=r=>{if(r.length<2)return[["M",0,0],["L",0,0]];const t=r[0],e=r[1],n=r[r.length-1],i=r[r.length-2];r.unshift(i,n),r.push(t,e);const a=[["M",n[0],n[1]]];for(let s=1;s<r.length-2;s+=1){const[o,l]=r[s-1],[c,u]=r[s],[h,d]=r[s+1],[f,v]=s!==r.length-2?r[s+2]:[h,d],g=c+(h-o)/6,p=u+(d-l)/6,y=h-(f-c)/6,b=d-(v-u)/6;a.push(["C",g,p,y,b,h,d])}return a};function UN(r,t,e,n,i,a,s){const[o,l]=ma(r,t),c={textAlign:t==="left"?"right":t==="right"?"left":"center",textBaseline:t==="top"?"bottom":t==="bottom"?"top":"middle",transform:[["translate",o+e,l+n]]};if(t==="center"||!i)return c;const u=VN(a);if(!u||u.length<=3)return c;const h=u.map((v,g)=>{const p=v,y=u[(g+1)%u.length];return Zn(p,y)?null:[p,y]}).filter(Boolean),d=wN([o,l],h),f=Cy([o,l],d);if(f&&d&&(c.transform=[["translate",f[0]+e,f[1]+n]],s)){const v=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));c.transform.push(["rotate",v/Math.PI*180]),c.textAlign="center",(t==="right"||t==="left")&&(v>0?c.textBaseline=t==="right"?"bottom":"top":c.textBaseline=t==="right"?"top":"bottom")}return c}var YN=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class wl extends El{constructor(t){super(hr({style:wl.defaultStyleProps},t))}getLabelStyle(t){if(!t.label||!t.d||t.d.length===0)return!1;const e=Qn(this.getGraphicStyle(t),"label"),{maxWidth:n,offsetX:i,offsetY:a,autoRotate:s,placement:o,closeToPath:l}=e,c=YN(e,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),u=this.shapeMap.key,h=u==null?void 0:u.getRenderBounds();return Object.assign(UN(h,o,i,a,l,t.d,s),{wordWrapWidth:zy(h,n)},c)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",ri,this.getKeyStyle(t),e),this.upsert("label",Ga,this.getLabelStyle(t),e)}}wl.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};function HN(r){const t=[],e=n=>{n!=null&&n.children.length&&n.children.forEach(i=>{t.push(i),e(i)})};return e(r),t}function XN(r){const t=[];let e=r.parentNode;for(;e;)t.push(e),e=e.parentNode;return t}class qf extends sl{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},mo=this,this.isMutationObserved=!0,this.addEventListener(Ie.MOUNTED,this.onMounted),this.addEventListener(Ie.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:t,clipPath:e,width:n=0,height:i=0}=this.attributes;if(t&&n&&i){const[a,s]=this.getBounds().min,o={x:a,y:s,radius:t,width:n,height:i};if(e)Object.assign(this.parsedStyle.clipPath.style,o);else{const l=new pr({style:o});this.style.clipPath=l}}else e&&(this.style.clipPath=null)}}const Jf=new WeakMap;let mo=null;const $f=r=>{if(mo&&XN(mo).includes(r)){const t=Jf.get(r);t?t.includes(mo)||t.push(mo):Jf.set(r,[mo])}},tv=r=>{const t=Jf.get(r);t&&t.forEach(e=>e.handleRadius())};class Gy extends El{constructor(t){super(t)}isImage(){const{src:t}=this.attributes;return!!t}getIconStyle(t=this.attributes){const{width:e=0,height:n=0}=t,i=this.getGraphicStyle(t);return this.isImage()?Object.assign({x:-e/2,y:-n/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(t=this.attributes,e=this){this.upsert("icon",this.isImage()?qf:Os,this.getIconStyle(t),e)}}class Vy extends El{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(t,e){const n=super.animate(t,e);return n&&(n.onframe=()=>this.onframe(),n.finished.then(()=>this.onframe())),n}}var gu=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Fi extends Vy{constructor(t){super(hr({style:Fi.defaultStyleProps},t)),this.type="node"}getSize(t=this.attributes){const{size:e}=t;return oi(e)}getKeyStyle(t){const e=this.getGraphicStyle(t);return Object.assign(Dy(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Qn(this.getGraphicStyle(t),"label"),{placement:n,maxWidth:i,offsetX:a,offsetY:s}=e,o=gu(e,["placement","maxWidth","offsetX","offsetY"]),l=this.getShape("key").getLocalBounds();return Object.assign(S1(l,n,a,s),{wordWrapWidth:zy(l,i)},o)}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),{fill:n}=e,i=gu(e,["fill"]),a=Qn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:n}),a)}getIconStyle(t){if(t.icon===!1||!t.iconText&&!t.iconSrc)return!1;const e=Qn(this.getGraphicStyle(t),"icon");return Object.assign(kN(t.size,e),e)}getBadgesStyle(t){var e;const n=Kf(this.shapeMap,"badge-"),i={};if(Object.keys(n).forEach(h=>{i[h]=!1}),t.badge===!1||!(!((e=t.badges)===null||e===void 0)&&e.length))return i;const{badges:a=[],badgePalette:s,opacity:o=1}=t,l=gu(t,["badges","badgePalette","opacity"]),c=By(s),u=Qn(this.getGraphicStyle(l),"badge");return a.forEach((h,d)=>{i[d]=Object.assign(Object.assign({backgroundFill:c?c[d%(c==null?void 0:c.length)]:void 0,opacity:o},u),this.getBadgeStyle(h))}),i}getBadgeStyle(t){const e=this.getShape("key"),{placement:n="top",offsetX:i,offsetY:a}=t,s=gu(t,["placement","offsetX","offsetY"]),o=S1(e.getLocalBounds(),n,i,a,!0);return Object.assign(Object.assign({},o),s)}getPortsStyle(t){var e;const n=this.getPorts(),i={};if(Object.keys(n).forEach(o=>{i[o]=!1}),t.port===!1||!(!((e=t.ports)===null||e===void 0)&&e.length))return i;const a=Qn(this.getGraphicStyle(t),"port"),{ports:s=[]}=t;return s.forEach((o,l)=>{const c=o.key||l,u=Object.assign(Object.assign({},a),o);if(x1(u))i[c]=!1;else{const[h,d]=this.getPortXY(t,o);i[c]=Object.assign({transform:[["translate",h,d]]},u)}}),i}getPortXY(t,e){const{placement:n="left"}=e,i=this.getShape("key");return vv(KN(this.context,i),n)}getPorts(){return Kf(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return xN(t,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t),i=this.getShape("key");this.upsert("halo",i.constructor,n,e)}drawIconShape(t,e){const n=this.getIconStyle(t);this.upsert("icon",Gy,n,e),$f(this)}drawBadgeShapes(t,e){const n=this.getBadgesStyle(t);Object.keys(n).forEach(i=>{const a=n[i];this.upsert(`badge-${i}`,po,a,e)})}drawPortShapes(t,e){const n=this.getPortsStyle(t);Object.keys(n).forEach(i=>{const a=n[i],s=`port-${i}`;this.upsert(s,Ji,a,e)})}drawLabelShape(t,e){const n=this.getLabelStyle(t);this.upsert("label",Ga,n,e)}_drawKeyShape(t,e){return this.drawKeyShape(t,e)}render(t=this.parsedAttributes,e=this){this._drawKeyShape(t,e),this.getShape("key")&&(this.drawHaloShape(t,e),this.drawIconShape(t,e),this.drawBadgeShapes(t,e),this.drawLabelShape(t,e),this.drawPortShapes(t,e))}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&tv(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}Fi.defaultStyleProps={x:0,y:0,size:32,droppable:!0,draggable:!0,port:!0,ports:[],portZIndex:2,portLinkToCenter:!1,badge:!0,badges:[],badgeZIndex:3,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloStrokeOpacity:.25,haloPointerEvents:"none",haloZIndex:-1,icon:!0,iconZIndex:1,label:!0,labelIsBillboard:!0,labelMaxWidth:"200%",labelPlacement:"bottom",labelWordWrap:!1,labelZIndex:0};function KN(r,t){if(!r)return t.getLocalBounds();const e=r.canvas.getLayer(),n=t.cloneNode();Ps(n,"hidden"),e.appendChild(n);const i=n.getLocalBounds();return n.destroy(),i}class _s extends Fi{constructor(t){super(hr({style:_s.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",Ji,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{r:Math.min(...this.getSize(t))/2})}getIconStyle(t){const e=super.getIconStyle(t),{r:n}=this.getShape("key").attributes,i=n*2*ya;return e?Object.assign({width:i,height:i},e):!1}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return hu(t,n,e)}}_s.defaultStyleProps={size:32};class pu extends Fi{constructor(t){super(t)}get parsedAttributes(){return this.attributes}drawKeyShape(t,e){return this.upsert("key",Ts,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{points:this.getPoints(t)})}getIntersectPoint(t,e=!1){var n,i;const{points:a}=this.getShape("key").attributes,s=[+(((n=this.attributes)===null||n===void 0?void 0:n.x)||0),+(((i=this.attributes)===null||i===void 0?void 0:i.y)||0)];return Oy(t,s,a,!0,e).point}}class QN extends pu{constructor(t){super(t)}getPoints(t){const[e,n]=this.getSize(t);return j3(e,n)}}var qN=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class mu extends _s{constructor(t){super(hr({style:mu.defaultStyleProps},t))}parseOuterR(){const{size:t}=this.parsedAttributes;return Math.min(...oi(t))/2}parseInnerR(){const{innerR:t}=this.parsedAttributes;return Ve(t)?parseInt(t)/100*this.parseOuterR():t}drawDonutShape(t,e){const{donuts:n}=t;if(!(n!=null&&n.length))return;const i=n.map(h=>ie(h)?{value:h}:h),a=Qn(this.getGraphicStyle(t),"donut"),s=By(t.donutPalette);if(!s)return;const o=i.reduce((h,d)=>{var f;return h+((f=d.value)!==null&&f!==void 0?f:0)},0),l=this.parseOuterR(),c=this.parseInnerR();let u=0;i.forEach((h,d)=>{const{value:f=0,color:v=s[d%s.length]}=h,g=qN(h,["value","color"]),p=(o===0?1/i.length:f/o)*360;this.upsert(`round${d}`,ri,Object.assign(Object.assign(Object.assign({},a),{d:tk(l,c,u,u+p),fill:v}),g),e),u+=p})}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}mu.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const yu=(r,t,e,n)=>[r+Math.sin(n)*e,t-Math.cos(n)*e],JN=(r,t,e,n)=>n<=0||e<=n?[["M",r-e,t],["A",e,e,0,1,1,r+e,t],["A",e,e,0,1,1,r-e,t],["Z"]]:[["M",r-e,t],["A",e,e,0,1,1,r+e,t],["A",e,e,0,1,1,r-e,t],["Z"],["M",r+n,t],["A",n,n,0,1,0,r-n,t],["A",n,n,0,1,0,r+n,t],["Z"]],$N=(r,t,e,n,i,a)=>{const[s,o]=[i/360*2*Math.PI,a/360*2*Math.PI],l=[yu(r,t,n,s),yu(r,t,e,s),yu(r,t,e,o),yu(r,t,n,o)],c=o-s>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",e,e,0,c,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",n,n,0,c,0,l[0][0],l[0][1]],["Z"]]},tk=(r=0,t=0,e,n)=>{const[i,a]=[0,0];return Math.abs(e-n)%360<1e-6?JN(i,a,r,t):$N(i,a,r,t,e,n)};class bu extends Fi{constructor(t){super(hr({style:bu.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",al,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,i]=this.getSize(t);return Object.assign(Object.assign({},e),{rx:n/2,ry:i/2})}getIconStyle(t){const e=super.getIconStyle(t),{rx:n,ry:i}=this.getShape("key").attributes,a=Math.min(+n,+i)*2*ya;return e?Object.assign({width:a,height:a},e):!1}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return hu(t,n,e)}}bu.defaultStyleProps={size:[45,35]};class ek extends pu{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return W3(this.getOuterR(t))}getIconStyle(t){const e=super.getIconStyle(t),n=this.getOuterR(t)*ya;return e?Object.assign({width:n,height:n},e):!1}}function nk(r,t){var e=t.cx,n=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,s=t.r;r.arc(n,a,s,0,Math.PI*2,!1)}function rk(r,t){var e=t.cx,n=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,s=t.rx,o=t.ry;if(r.ellipse)r.ellipse(n,a,s,o,0,0,Math.PI*2,!1);else{var l=s>o?s:o,c=s>o?1:s/o,u=s>o?o/s:1;r.save(),r.scale(c,u),r.arc(n,a,l,0,Math.PI*2)}}function ik(r,t){var e=t.x1,n=t.y1,i=t.x2,a=t.y2,s=t.markerStart,o=t.markerEnd,l=t.markerStartOffset,c=t.markerEndOffset,u=0,h=0,d=0,f=0,v=0,g,p;s&&Ue(s)&&l&&(g=i-e,p=a-n,v=Math.atan2(p,g),u=Math.cos(v)*(l||0),h=Math.sin(v)*(l||0)),o&&Ue(o)&&c&&(g=e-i,p=n-a,v=Math.atan2(p,g),d=Math.cos(v)*(c||0),f=Math.sin(v)*(c||0)),r.moveTo(e+u,n+h),r.lineTo(i+d,a+f)}function ak(r,t){var e=t.markerStart,n=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.d,o=s.absolutePath,l=s.segments,c=0,u=0,h=0,d=0,f=0,v,g;if(e&&Ue(e)&&i){var p=e.parentNode.getStartTangent(),y=(0,P.Z)(p,2),b=y[0],w=y[1];v=b[0]-w[0],g=b[1]-w[1],f=Math.atan2(g,v),c=Math.cos(f)*(i||0),u=Math.sin(f)*(i||0)}if(n&&Ue(n)&&a){var O=n.parentNode.getEndTangent(),_=(0,P.Z)(O,2),F=_[0],W=_[1];v=F[0]-W[0],g=F[1]-W[1],f=Math.atan2(g,v),h=Math.cos(f)*(a||0),d=Math.sin(f)*(a||0)}for(var j=0;j<o.length;j++){var H=o[j],K=H[0],et=o[j+1],rt=j===0&&(c!==0||u!==0),lt=(j===o.length-1||et&&(et[0]==="M"||et[0]==="Z"))&&h!==0&&d!==0,ht=rt?[c,u]:[0,0],yt=(0,P.Z)(ht,2),Nt=yt[0],Ct=yt[1],pt=lt?[h,d]:[0,0],xt=(0,P.Z)(pt,2),kt=xt[0],jt=xt[1];switch(K){case"M":r.moveTo(H[1]+Nt,H[2]+Ct);break;case"L":r.lineTo(H[1]+kt,H[2]+jt);break;case"Q":r.quadraticCurveTo(H[1],H[2],H[3]+kt,H[4]+jt);break;case"C":r.bezierCurveTo(H[1],H[2],H[3],H[4],H[5]+kt,H[6]+jt);break;case"A":{var Xt=l[j].arcParams,ee=Xt.cx,ce=Xt.cy,ue=Xt.rx,le=Xt.ry,me=Xt.startAngle,De=Xt.endAngle,Ge=Xt.xRotation,_e=Xt.sweepFlag;if(r.ellipse)r.ellipse(ee,ce,ue,le,Ge,me,De,!!(1-_e));else{var tr=ue>le?ue:le,yn=ue>le?1:ue/le,Sr=ue>le?le/ue:1;r.translate(ee,ce),r.rotate(Ge),r.scale(yn,Sr),r.arc(0,0,tr,me,De,!!(1-_e)),r.scale(1/yn,1/Sr),r.rotate(-Ge),r.translate(-ee,-ce)}lt&&r.lineTo(H[6]+h,H[7]+d);break}case"Z":r.closePath();break}}}function sk(r,t){var e=t.markerStart,n=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.points.points,o=s.length,l=s[0][0],c=s[0][1],u=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,g=0,p=0,y,b;e&&Ue(e)&&i&&(y=s[1][0]-s[0][0],b=s[1][1]-s[0][1],p=Math.atan2(b,y),d=Math.cos(p)*(i||0),f=Math.sin(p)*(i||0)),n&&Ue(n)&&a&&(y=s[o-1][0]-s[0][0],b=s[o-1][1]-s[0][1],p=Math.atan2(b,y),v=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),r.moveTo(l+(d||v),c+(f||g));for(var w=1;w<o-1;w++){var O=s[w];r.lineTo(O[0],O[1])}r.lineTo(u,h)}function ok(r,t){var e=t.markerStart,n=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.points.points,o=s.length,l=s[0][0],c=s[0][1],u=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,g=0,p=0,y,b;e&&Ue(e)&&i&&(y=s[1][0]-s[0][0],b=s[1][1]-s[0][1],p=Math.atan2(b,y),d=Math.cos(p)*(i||0),f=Math.sin(p)*(i||0)),n&&Ue(n)&&a&&(y=s[o-2][0]-s[o-1][0],b=s[o-2][1]-s[o-1][1],p=Math.atan2(b,y),v=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),r.moveTo(l+d,c+f);for(var w=1;w<o-1;w++){var O=s[w];r.lineTo(O[0],O[1])}r.lineTo(u+v,h+g)}function lk(r,t){var e=t.x,n=e===void 0?0:e,i=t.y,a=i===void 0?0:i,s=t.radius,o=t.width,l=t.height,c=o,u=l,h=s&&s.some(function(_){return _!==0});if(!h)r.rect(n,a,c,u);else{var d=o>0?1:-1,f=l>0?1:-1,v=d+f===0,g=s.map(function(_){return kn(_,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),p=(0,P.Z)(g,4),y=p[0],b=p[1],w=p[2],O=p[3];r.moveTo(d*y+n,a),r.lineTo(c-d*b+n,a),b!==0&&r.arc(c-d*b+n,f*b+a,b,-f*Math.PI/2,d>0?0:Math.PI,v),r.lineTo(c+n,u-f*w+a),w!==0&&r.arc(c-d*w+n,u-f*w+a,w,d>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,v),r.lineTo(d*O+n,u+a),O!==0&&r.arc(d*O+n,u-f*O+a,O,f>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,v),r.lineTo(n,f*y+a),y!==0&&r.arc(d*y+n,f*y+a,y,d>0?Math.PI:0,f>0?Math.PI*1.5:Math.PI/2,v)}}var ck=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.name="canvas-path-generator",e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){var n,i=(n={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(n,_t.CIRCLE,nk),_t.ELLIPSE,rk),_t.RECT,lk),_t.LINE,ik),_t.POLYLINE,ok),_t.POLYGON,sk),_t.PATH,ak),_t.TEXT,void 0),_t.GROUP,void 0),_t.IMAGE,void 0),(0,ae.Z)((0,ae.Z)((0,ae.Z)(n,_t.HTML,void 0),_t.MESH,void 0),_t.FRAGMENT,void 0));this.context.pathGeneratorFactory=i}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(Da);var uk=gt(),hk=gt(),dk=gt(),fk=Wt(),Uy=function(){function r(){var t=this;(0,N.Z)(this,r),this.isHit=function(e,n,i,a){var s=t.context.pointInPathPickerFactory[e.nodeName];if(s){var o=Ze(fk,i),l=re(hk,zt(dk,n[0],n[1],0),o);if(s(e,new gr(l[0],l[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var i=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),a=t.context.pathGeneratorFactory[e.nodeName];return a&&(i.beginPath(),a(i,e.parsedStyle),i.closePath()),i.isPointInPath(n.x,n.y)}}return(0,T.Z)(r,[{key:"apply",value:function(e,n){var i,a=this,s=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var l=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;s.hooks.pick.tapPromise(r.tag,function(){var c=(0,Ra.Z)((0,Cr.Z)().mark(function u(h){return(0,Cr.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",a.pick(l,h));case 1:case"end":return d.stop()}},u)}));return function(u){return c.apply(this,arguments)}}()),s.hooks.pickSync.tap(r.tag,function(c){return a.pick(l,c)})}},{key:"pick",value:function(e,n){var i=n.topmost,a=n.position,s=a.x,o=a.y,l=zt(uk,s,o,0),c=e.elementsFromBBox(l[0],l[1],l[0],l[1]),u=[],h=(0,La.Z)(c),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=f.getWorldTransform(),g=this.isHit(f,l,v,!1);if(g){var p=_p(f);if(p){var y=p.parsedStyle.clipPath,b=this.isHit(y,l,y.getWorldTransform(),!0);if(b){if(i)return n.picked=[f],n;u.push(f)}}else{if(i)return n.picked=[f],n;u.push(f)}}}}catch(w){h.e(w)}finally{h.f()}return n.picked=u,n}}])}();Uy.tag="CanvasPicker";function vk(r,t,e){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,l=n.r,c=n.fill,u=n.stroke,h=n.lineWidth,d=h===void 0?1:h,f=n.increasedLineWidthForHitTesting,v=f===void 0?0:f,g=n.pointerEvents,p=g===void 0?"auto":g,y=(d+v)/2,b=Or(a,o,t.x,t.y),w=xs(p,c,u),O=(0,P.Z)(w,2),_=O[0],F=O[1];return _&&F||e?b<=l+y:_?b<=l:F?b>=l-y&&b<=l+y:!1}function xu(r,t,e,n){return r/(e*e)+t/(n*n)}function gk(r,t,e){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,l=n.rx,c=n.ry,u=n.fill,h=n.stroke,d=n.lineWidth,f=d===void 0?1:d,v=n.increasedLineWidthForHitTesting,g=v===void 0?0:v,p=n.pointerEvents,y=p===void 0?"auto":p,b=t.x,w=t.y,O=xs(y,u,h),_=(0,P.Z)(O,2),F=_[0],W=_[1],j=(f+g)/2,H=(b-a)*(b-a),K=(w-o)*(w-o);return F&&W||e?xu(H,K,l+j,c+j)<=1:F?xu(H,K,l,c)<=1:W?xu(H,K,l-j,c-j)>=1&&xu(H,K,l+j,c+j)<=1:!1}function Is(r,t,e,n,i,a){return i>=r&&i<=r+e&&a>=t&&a<=t+n}function pk(r,t,e,n,i,a,s){var o=i/2;return Is(r-o,t-o,e,i,a,s)||Is(r+e-o,t-o,i,n,a,s)||Is(r+o,t+n-o,e,i,a,s)||Is(r-o,t+o,i,n,a,s)}function Eu(r,t,e,n,i,a,s,o){var l=(Math.atan2(o-t,s-r)+Math.PI*2)%(Math.PI*2),c={x:r+e*Math.cos(l),y:t+e*Math.sin(l)};return Or(c.x,c.y,s,o)<=a/2}function Va(r,t,e,n,i,a,s){var o=Math.min(r,e),l=Math.max(r,e),c=Math.min(t,n),u=Math.max(t,n),h=i/2;return a>=o-h&&a<=l+h&&s>=c-h&&s<=u+h?Lg(r,t,e,n,a,s)<=i/2:!1}function Yy(r,t,e,n,i){var a=r.length;if(a<2)return!1;for(var s=0;s<a-1;s++){var o=r[s][0],l=r[s][1],c=r[s+1][0],u=r[s+1][1];if(Va(o,l,c,u,t,e,n))return!0}if(i){var h=r[0],d=r[a-1];if(Va(h[0],h[1],d[0],d[1],t,e,n))return!0}return!1}var mk=1e-6;function ev(r){return Math.abs(r)<mk?0:r<0?-1:1}function yk(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}function Hy(r,t,e){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var s=r[a],o=r[(a+1)%i];if(yk(s,o,[t,e]))return!0;ev(s[1]-e)>0!=ev(o[1]-e)>0&&ev(t-(e-s[1])*(s[0]-o[0])/(s[1]-o[1])-s[0])<0&&(n=!n)}return n}function Xy(r,t,e){for(var n=!1,i=0;i<r.length;i++){var a=r[i];if(n=Hy(a,t,e),n)break}return n}function bk(r,t,e){var n=r.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2,l=n.lineWidth,c=l===void 0?1:l,u=n.increasedLineWidthForHitTesting,h=u===void 0?0:u,d=n.pointerEvents,f=d===void 0?"auto":d,v=n.fill,g=n.stroke,p=xs(f,v,g),y=(0,P.Z)(p,2),b=y[1];return!b&&!e||!c?!1:Va(i,a,s,o,c+h,t.x,t.y)}function xk(r,t,e,n,i){for(var a=!1,s=t/2,o=0;o<r.length;o++){var l=r[o],c=l.currentPoint,u=l.params,h=l.prePoint,d=l.box;if(!(d&&!Is(d.x-s,d.y-s,d.width+t,d.height+t,e,n)))switch(l.command){case"L":case"Z":if(a=Va(h[0],h[1],c[0],c[1],t,e,n),a)return!0;break;case"Q":var f=P2(h[0],h[1],u[1],u[2],u[3],u[4],e,n);if(a=f<=t/2,a)return!0;break;case"C":var v=Ig(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],e,n,i);if(a=v<=t/2,a)return!0;break;case"A":l.cubicParams||(l.cubicParams=Td(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var g=l.cubicParams,p=h,y=0;y<g.length;y+=6){var b=Ig(p[0],p[1],g[y],g[y+1],g[y+2],g[y+3],g[y+4],g[y+5],e,n,i);if(p=[g[y+4],g[y+5]],a=b<=t/2,a)return!0}break}}return a}function Ek(r,t,e,n,i,a){var s=r.parsedStyle,o=s.lineWidth,l=o===void 0?1:o,c=s.increasedLineWidthForHitTesting,u=c===void 0?0:c,h=s.stroke,d=s.fill,f=s.d,v=s.pointerEvents,g=v===void 0?"auto":v,p=f.segments,y=f.hasArc,b=f.polylines,w=f.polygons,O=xs(g,(w==null?void 0:w.length)&&d,h),_=(0,P.Z)(O,2),F=_[0],W=_[1],j=Hd(r),H=!1;return F||e?(y?H=n(r,t):H=Xy(w,t.x,t.y)||Xy(b,t.x,t.y),H):((W||e)&&(H=xk(p,l+u,t.x,t.y,j)),H)}function wk(r,t,e){var n=r.parsedStyle,i=n.stroke,a=n.fill,s=n.lineWidth,o=s===void 0?1:s,l=n.increasedLineWidthForHitTesting,c=l===void 0?0:l,u=n.points,h=n.pointerEvents,d=h===void 0?"auto":h,f=xs(d,a,i),v=(0,P.Z)(f,2),g=v[0],p=v[1],y=!1;return(p||e)&&(y=Yy(u.points,o+c,t.x,t.y,!0)),!y&&(g||e)&&(y=Hy(u.points,t.x,t.y)),y}function Sk(r,t,e){var n=r.parsedStyle,i=n.lineWidth,a=i===void 0?1:i,s=n.increasedLineWidthForHitTesting,o=s===void 0?0:s,l=n.points,c=n.pointerEvents,u=c===void 0?"auto":c,h=n.fill,d=n.stroke,f=xs(u,h,d),v=(0,P.Z)(f,2),g=v[1];return!g&&!e||!a?!1:Yy(l.points,a+o,t.x,t.y,!1)}function Mk(r,t,e,n,i){var a=r.parsedStyle,s=a.radius,o=a.fill,l=a.stroke,c=a.lineWidth,u=c===void 0?1:c,h=a.increasedLineWidthForHitTesting,d=h===void 0?0:h,f=a.x,v=f===void 0?0:f,g=a.y,p=g===void 0?0:g,y=a.width,b=a.height,w=a.pointerEvents,O=w===void 0?"auto":w,_=xs(O,o,l),F=(0,P.Z)(_,2),W=F[0],j=F[1],H=s&&s.some(function(lt){return lt!==0}),K=u+d;if(H){var rt=!1;return(j||e)&&(rt=Ak(v,p,y,b,s.map(function(lt){return kn(lt,0,Math.min(Math.abs(y)/2,Math.abs(b)/2))}),K,t.x,t.y)),!rt&&(W||e)&&(rt=n(r,t)),rt}else{var et=K/2;if(W&&j||e)return Is(v-et,p-et,y+et,b+et,t.x,t.y);if(W)return Is(v,p,y,b,t.x,t.y);if(j)return pk(v,p,y,b,K,t.x,t.y)}return!1}function Ak(r,t,e,n,i,a,s,o){var l=(0,P.Z)(i,4),c=l[0],u=l[1],h=l[2],d=l[3];return Va(r+c,t,r+e-u,t,a,s,o)||Va(r+e,t+u,r+e,t+n-h,a,s,o)||Va(r+e-h,t+n,r+d,t+n,a,s,o)||Va(r,t+n-d,r,t+c,a,s,o)||Eu(r+e-u,t+u,u,1.5*Math.PI,2*Math.PI,a,s,o)||Eu(r+e-h,t+n-h,h,0,.5*Math.PI,a,s,o)||Eu(r+d,t+n-d,d,.5*Math.PI,Math.PI,a,s,o)||Eu(r+c,t+c,c,Math.PI,1.5*Math.PI,a,s,o)}function Tk(r,t,e,n,i,a){var s=r.parsedStyle,o=s.pointerEvents,l=o===void 0?"auto":o,c=s.x,u=c===void 0?0:c,h=s.y,d=h===void 0?0:h,f=s.width,v=s.height;if(l==="non-transparent-pixel"){var g=i.config.offscreenCanvas,p=a.offscreenCanvasCreator.getOrCreateCanvas(g),y=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});p.width=f,p.height=v,i.defaultStyleRendererFactory[_t.IMAGE].render(y,(0,D.Z)((0,D.Z)({},r.parsedStyle),{},{x:0,y:0}),r,void 0,void 0,void 0);var b=y.getImageData(t.x-u,t.y-d,1,1).data;return b.every(function(w){return w!==0})}return!0}function Ok(r,t,e,n){var i=r.getGeometryBounds();return t.x>=i.min[0]&&t.y>=i.min[1]&&t.x<=i.max[0]&&t.y<=i.max[1]}var Ck=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.name="canvas-picker",e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){var n,i=(n={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(n,_t.CIRCLE,vk),_t.ELLIPSE,gk),_t.RECT,Mk),_t.LINE,bk),_t.POLYLINE,Sk),_t.POLYGON,wk),_t.PATH,Ek),_t.TEXT,Ok),_t.GROUP,null),_t.IMAGE,Tk),(0,ae.Z)((0,ae.Z)(n,_t.HTML,null),_t.MESH,null));this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new Uy)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(Da);function ia(r,t){if(!{}.hasOwnProperty.call(r,t))throw new TypeError("attempted to use private field on non-instance");return r}var Nk=0;function kk(r){return"__private_"+Nk+++"_"+r}var Pk=function(){function r(){(0,N.Z)(this,r),this.cacheStore=new Map}return(0,T.Z)(r,[{key:"onRefAdded",value:function(e){}},{key:"has",value:function(e){return this.cacheStore.has(e)}},{key:"put",value:function(e,n,i){return this.cacheStore.has(e)?!1:(this.cacheStore.set(e,{value:n,counter:new Set([i.entity])}),this.onRefAdded(i),!0)}},{key:"get",value:function(e,n){var i=this.cacheStore.get(e);return i?(i.counter.has(n.entity)||(i.counter.add(n.entity),this.onRefAdded(n)),i.value):null}},{key:"update",value:function(e,n,i){var a=this.cacheStore.get(e);return a?(a.value=(0,D.Z)((0,D.Z)({},a.value),n),a.counter.has(i.entity)||(a.counter.add(i.entity),this.onRefAdded(i)),!0):!1}},{key:"release",value:function(e,n){var i=this.cacheStore.get(e);return i?(i.counter.delete(n.entity),i.counter.size<=0&&this.cacheStore.delete(e),!0):!1}},{key:"releaseRef",value:function(e){var n=this;Array.from(this.cacheStore.keys()).forEach(function(i){n.release(i,e)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),nv=[],rv=[],iv=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,null,[{key:"stop",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;r.rafId&&(e.cancelAnimationFrame(r.rafId),r.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;nv.length<=0&&rv.length<=0||(rv.forEach(function(n){return n()}),rv=nv.splice(0,r.TASK_NUM_PER_FRAME),r.rafId=e.requestAnimationFrame(function(){r.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,i,a){for(var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:r.api,l=e.naturalWidth||e.width,c=e.naturalHeight||e.height,u=n-s,h=i-s,d=Math.ceil(l/u),f=Math.ceil(c/h),v={tileSize:[n,i],gridSize:[f,d],tiles:Array(f).fill(null).map(function(){return Array(d).fill(null)})},g=function(b){for(var w=function(F){nv.push(function(){var W=F*u,j=b*h,H=[Math.min(n,l-W),Math.min(i,c-j)],K=H[0],et=H[1],rt=o.createCanvas();rt.width=n,rt.height=i;var lt=rt.getContext("2d");lt.drawImage(e,W,j,K,et,0,0,K,et),v.tiles[b][F]={x:W,y:j,tileX:F,tileY:b,data:rt},a()})},O=0;O<d;O++)w(O)},p=0;p<f;p++)g(p);return r.stop(),r.executeTask(),v}}])}();iv.TASK_NUM_PER_FRAME=10;var li=new Pk;li.onRefAdded=function(t){var e=this;t.addEventListener(Ie.DESTROY,function(){e.releaseRef(t)},{once:!0})};var av=function(){function r(t,e){(0,N.Z)(this,r),this.gradientCache={},this.patternCache={},this.context=t,this.runtime=e}return(0,T.Z)(r,[{key:"getImageSync",value:function(e,n,i){var a=Ve(e)?e:e.src;if(li.has(a)){var s=li.get(a,n);if(s.img.complete)return i==null||i(s),s}return this.getOrCreateImage(e,n).then(function(o){i==null||i(o)}).catch(function(o){console.error(o)}),null}},{key:"getOrCreateImage",value:function(e,n){var i=this,a=Ve(e)?e:e.src;if(!Ve(e)&&!li.has(a)){var s={img:e,size:[e.naturalWidth||e.width,e.naturalHeight||e.height],tileSize:wu(e)};li.put(a,s,n)}if(li.has(a)){var o=li.get(a,n);return o.img.complete?Promise.resolve(o):new Promise(function(l,c){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=wu(o.img),l(o)}),o.img.addEventListener("error",function(u){c(u)})})}return new Promise(function(l,c){var u=i.context.config.createImage();if(u){var h={img:u,size:[0,0],tileSize:wu(u)};li.put(a,h,n),u.onload=function(){h.size=[u.naturalWidth||u.width,u.naturalHeight||u.height],h.tileSize=wu(h.img),l(h)},u.onerror=function(d){c(d)},u.crossOrigin="Anonymous",u.src=a}})}},{key:"createDownSampledImage",value:function(){var t=(0,Ra.Z)((0,Cr.Z)().mark(function n(i,a){var s,o,l,c,u,h,d,f,v,g,p,y,b,w;return(0,Cr.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=1,this.getOrCreateImage(i,a);case 1:if(s=O.sent,typeof s.downSamplingRate=="undefined"){O.next=2;break}return O.abrupt("return",s);case 2:if(o=this.context.config.enableLargeImageOptimization,l=typeof o=="boolean"?{}:o,c=l.maxDownSampledImageSize,u=c===void 0?2048:c,h=l.downSamplingRateThreshold,d=h===void 0?.5:h,f=this.runtime.globalThis.createImageBitmap,v=(0,P.Z)(s.size,2),g=v[0],p=v[1],y=s.img,b=Math.min((u+u)/(g+p),Math.max(.01,Math.min(d,.5))),w=(0,D.Z)((0,D.Z)({},s),{},{downSamplingRate:b}),li.update(s.img.src,w,a),!f){O.next=7;break}return O.prev=3,O.next=4,f(s.img,{resizeWidth:g*b,resizeHeight:p*b});case 4:y=O.sent,O.next=6;break;case 5:O.prev=5,O.catch(3),b=1;case 6:O.next=8;break;case 7:b=1;case 8:return w=(0,D.Z)((0,D.Z)({},this.getImageSync(i,a)),{},{downSampled:y,downSamplingRate:b}),li.update(s.img.src,w,a),O.abrupt("return",w);case 9:case"end":return O.stop()}},n,this,[[3,5]])}));function e(n,i){return t.apply(this,arguments)}return e}()},{key:"createImageTiles",value:function(){var t=(0,Ra.Z)((0,Cr.Z)().mark(function n(i,a,s,o){var l,c,u,h,d;return(0,Cr.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=1,this.getOrCreateImage(i,o);case 1:return l=f.sent,c=o.ownerDocument.defaultView,u=c.requestAnimationFrame,h=c.cancelAnimationFrame,iv.api={requestAnimationFrame:u,cancelAnimationFrame:h,createCanvas:function(){return lf.createCanvas()}},d=(0,D.Z)((0,D.Z)({},l),iv.sliceImage(l.img,l.tileSize[0],l.tileSize[0],s)),li.update(l.img.src,d,o),f.abrupt("return",d);case 2:case"end":return f.stop()}},n,this)}));function e(n,i,a,s){return t.apply(this,arguments)}return e}()},{key:"releaseImage",value:function(e,n){li.release(Ve(e)?e:e.src,n)}},{key:"releaseImageRef",value:function(e){li.releaseRef(e)}},{key:"getOrCreatePatternSync",value:function(e,n,i,a,s,o,l){var c=this.generatePatternKey(n);if(c&&this.patternCache[c])return this.patternCache[c];var u=n.image,h=n.repetition,d=n.transform,f,v=!1;if(Ve(u)){var g=this.getImageSync(u,e,l);f=g==null?void 0:g.img}else a?(f=a,v=!0):f=u;var p=f&&i.createPattern(f,h);if(p){var y;d?y=Up(Cp(d),new pn({})):y=ge(Wt()),v&&dn(y,y,[1/s,1/s,1]),p.setTransform({a:y[0],b:y[1],c:y[4],d:y[5],e:y[12]+o[0],f:y[13]+o[1]})}return c&&p&&(this.patternCache[c]=p),p}},{key:"getOrCreateGradient",value:function(e,n){var i=this.generateGradientKey(e),a=e.type,s=e.steps,o=e.min,l=e.width,c=e.height,u=e.angle,h=e.cx,d=e.cy,f=e.size;if(this.gradientCache[i])return this.gradientCache[i];var v=null;if(a===_a.LinearGradient){var g=OS(o,l,c,u),p=g.x1,y=g.y1,b=g.x2,w=g.y2;v=n.createLinearGradient(p,y,b,w)}else if(a===_a.RadialGradient){var O=CS(o,l,c,h,d,f),_=O.x,F=O.y,W=O.r;v=n.createRadialGradient(_,F,0,_,F,W)}return v&&(s.forEach(function(j){var H=j.offset,K=j.color;if(H.unit===te.kPercentage){var et;(et=v)===null||et===void 0||et.addColorStop(H.value/100,K.toString())}}),this.gradientCache[i]=v),this.gradientCache[i]}},{key:"generateGradientKey",value:function(e){var n=e.type,i=e.min,a=e.width,s=e.height,o=e.steps,l=e.angle,c=e.cx,u=e.cy,h=e.size;return"gradient-".concat(n,"-").concat((l==null?void 0:l.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat((u==null?void 0:u.toString())||0,"-").concat((h==null?void 0:h.toString())||0,"-").concat(i[0],"-").concat(i[1],"-").concat(a,"-").concat(s,"-").concat(o.map(function(d){var f=d.offset,v=d.color;return"".concat(f).concat(v)}).join("-"))}},{key:"generatePatternKey",value:function(e){var n=e.image,i=e.repetition;if(Ve(n))return"pattern-".concat(n,"-").concat(i);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(i)}}])}();av.isSupportTile=!!lf.createCanvas();function wu(r){if(!r.complete)return[0,0];var t=r.naturalWidth||r.width,e=r.naturalHeight||r.height,n=256;return[256,512].forEach(function(i){var a=Math.ceil(e/i),s=Math.ceil(t/i);a*s<1e3&&(n=i)}),[n,n]}var Ky=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=e.renderingService,i=e.renderingContext,a=e.imagePool,s=i.root.ownerDocument.defaultView,o=function(h,d,f){var v=h.parsedStyle,g=v.width,p=v.height;g&&!p?h.setAttribute("height",f/d*g):!g&&p&&h.setAttribute("width",d/f*p)},l=function(h){var d=h.target,f=d.nodeName,v=d.attributes;if(f===_t.IMAGE){var g=v.src,p=v.keepAspectRatio;a.getImageSync(g,d,function(y){var b=y.img,w=b.width,O=b.height;p&&o(d,w,O),d.dirty(),n.dirty()})}},c=function(h){var d=h.target,f=h.attrName,v=h.prevValue,g=h.newValue;d.nodeName!==_t.IMAGE||f!=="src"||(v!==g&&a.releaseImage(v,d),Ve(g)&&a.getOrCreateImage(g,d).then(function(p){var y=p.img,b=y.width,w=y.height;d.attributes.keepAspectRatio&&o(d,b,w),d.dirty(),n.dirty()}).catch(function(){}))};n.hooks.init.tap(r.tag,function(){s.addEventListener(Ie.MOUNTED,l),s.addEventListener(Ie.ATTR_MODIFIED,c)}),n.hooks.destroy.tap(r.tag,function(){s.removeEventListener(Ie.MOUNTED,l),s.removeEventListener(Ie.ATTR_MODIFIED,c)})}}])}();Ky.tag="LoadImage";var Rk=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.name="image-loader",e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(n){this.context.imagePool=new av(this.context,n),this.addRenderingPlugin(new Ky)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Da);var Gn=kk("renderState"),Qy=function(){function r(t){(0,N.Z)(this,r),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,Gn,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=Wt(),this.dprMatrix=Wt(),this.tmpMat4=Wt(),this.vec3a=gt(),this.vec3b=gt(),this.vec3c=gt(),this.vec3d=gt(),this.canvasRendererPluginOptions=t}return(0,T.Z)(r,[{key:"apply",value:function(e,n){var i=this;this.context=e;var a=this.context,s=a.config,o=a.camera,l=a.renderingService,c=a.renderingContext,u=a.rBushRoot,h=a.pathGeneratorFactory,d=s.renderer.getConfig().enableRenderingOptimization;s.renderer.getConfig().enableDirtyCheck=!1,s.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=u,this.pathGeneratorFactory=h;var f=e.contextService,v=c.root.ownerDocument.defaultView,g=function(O){var _=O.target,F=_.rBushNode;F!=null&&F.aabb&&i.removedRBushNodeAABBs.push(F.aabb)},p=function(O){var _=O.target,F=_.rBushNode;F.aabb&&i.removedRBushNodeAABBs.push(F.aabb)};l.hooks.init.tap(r.tag,function(){v.addEventListener(Ie.UNMOUNTED,g),v.addEventListener(Ie.CULLED,p);var w=f.getDPR(),O=s.width,_=s.height,F=f.getContext();i.clearRect(F,0,0,O*w,_*w,s.background)}),l.hooks.destroy.tap(r.tag,function(){v.removeEventListener(Ie.UNMOUNTED,g),v.removeEventListener(Ie.CULLED,p),i.renderQueue=[],i.removedRBushNodeAABBs=[],ia(i,Gn)[Gn]={restoreStack:[],prevObject:null,currentContext:null}});var y=function(){var O,_=f.getContext(),F=f.getDPR(),W=s.width,j=s.height,H=i.canvasRendererPluginOptions,K=H.dirtyObjectNumThreshold,et=H.dirtyObjectRatioThreshold,rt=l.getStats(),lt=rt.total,ht=rt.rendered,yt=ht/lt;i.clearFullScreen=i.clearFullScreenLastFrame||!((O=v.context.renderingPlugins[1])!==null&&O!==void 0&&O.isFirstTimeRenderingFinished)||l.disableDirtyRectangleRendering()||ht>K&&yt>et,_&&(typeof _.resetTransform=="function"?_.resetTransform():_.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(_,0,0,W*F,j*F,s.background))},b=function(O,_){for(var F=[O];F.length>0;){var W,j=F.pop();j.isVisible()&&!j.isCulled()&&(d?i.renderDisplayObjectOptimized(j,_,i.context,ia(i,Gn)[Gn],n):i.renderDisplayObject(j,_,i.context,ia(i,Gn)[Gn],n));for(var H=((W=j.sortable)===null||W===void 0||(W=W.sorted)===null||W===void 0?void 0:W.length)>0?j.sortable.sorted:j.childNodes,K=H.length-1;K>=0;K--)F.push(H[K])}};l.hooks.endFrame.tap(r.tag,function(){if(y(),c.root.childNodes.length===0){i.clearFullScreenLastFrame=!0;return}d=s.renderer.getConfig().enableRenderingOptimization,ia(i,Gn)[Gn]={restoreStack:[],prevObject:null,currentContext:ia(i,Gn)[Gn].currentContext},ia(i,Gn)[Gn].currentContext.clear(),i.clearFullScreenLastFrame=!1;var w=f.getContext(),O=f.getDPR();if(vn(i.dprMatrix,[O,O,1]),Jt(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(w.save(),b(c.root,w),w.restore()):b(c.root,w),i.removedRBushNodeAABBs=[];else{var _=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat((0,k.Z)(i.removedRBushNodeAABBs.map(function(le){var me=le.minX,De=le.minY,Ge=le.maxX,_e=le.maxY,tr=new gn;return tr.setMinMax([me,De,0],[Ge,_e,0]),tr}))));if(i.removedRBushNodeAABBs=[],gn.isEmpty(_)){i.renderQueue=[];return}var F=i.convertAABB2Rect(_),W=F.x,j=F.y,H=F.width,K=F.height,et=re(i.vec3a,[W,j,0],i.vpMatrix),rt=re(i.vec3b,[W+H,j,0],i.vpMatrix),lt=re(i.vec3c,[W,j+K,0],i.vpMatrix),ht=re(i.vec3d,[W+H,j+K,0],i.vpMatrix),yt=Math.min(et[0],rt[0],ht[0],lt[0]),Nt=Math.min(et[1],rt[1],ht[1],lt[1]),Ct=Math.max(et[0],rt[0],ht[0],lt[0]),pt=Math.max(et[1],rt[1],ht[1],lt[1]),xt=Math.floor(yt),kt=Math.floor(Nt),jt=Math.ceil(Ct-yt),Xt=Math.ceil(pt-Nt);w.save(),i.clearRect(w,xt,kt,jt,Xt,s.background),w.beginPath(),w.rect(xt,kt,jt,Xt),w.clip(),w.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]);var ee=s.renderer.getConfig(),ce=ee.enableDirtyRectangleRenderingDebug;ce&&v.dispatchEvent(new Kn(ii.DIRTY_RECTANGLE,{dirtyRect:{x:xt,y:kt,width:jt,height:Xt}}));var ue=i.searchDirtyObjects(_);ue.sort(function(le,me){return le.sortable.renderOrder-me.sortable.renderOrder}).forEach(function(le){le&&le.isVisible()&&!le.isCulled()&&i.renderDisplayObject(le,w,i.context,ia(i,Gn)[Gn],n)}),w.restore(),i.renderQueue.forEach(function(le){i.saveDirtyAABB(le)}),i.renderQueue=[]}ia(i,Gn)[Gn].restoreStack.forEach(function(){w.restore()}),ia(i,Gn)[Gn].restoreStack=[]}),l.hooks.render.tap(r.tag,function(w){i.clearFullScreen||i.renderQueue.push(w)})}},{key:"clearRect",value:function(e,n,i,a,s,o){e.clearRect(n,i,a,s),o&&(e.fillStyle=o,e.fillRect(n,i,a,s))}},{key:"renderDisplayObjectOptimized",value:function(e,n,i,a,s){var o=e.nodeName,l=!1,c=!1,u=this.context.styleRendererFactory[o],h=this.pathGeneratorFactory[o],d=e.parsedStyle.clipPath;if(d){l=!a.prevObject||!Ed(d.getWorldTransform(),a.prevObject.getWorldTransform()),l&&(this.applyWorldTransform(n,d),a.prevObject=null);var f=this.pathGeneratorFactory[d.nodeName];f&&(n.save(),c=!0,n.beginPath(),f(n,d.parsedStyle),n.closePath(),n.clip())}if(u){l=!a.prevObject||!Ed(e.getWorldTransform(),a.prevObject.getWorldTransform()),l&&this.applyWorldTransform(n,e);var v=!a.prevObject;if(!v){var g=a.prevObject.nodeName;o===_t.TEXT?v=g!==_t.TEXT:o===_t.IMAGE?v=g!==_t.IMAGE:v=g===_t.TEXT||g===_t.IMAGE}u.applyStyleToContext(n,e,v,a),a.prevObject=e}h&&(n.beginPath(),h(n,e.parsedStyle),o!==_t.LINE&&o!==_t.PATH&&o!==_t.POLYLINE&&n.closePath()),u&&u.drawToContext(n,e,ia(this,Gn)[Gn],this,s),c&&n.restore(),e.dirty(!1)}},{key:"renderDisplayObject",value:function(e,n,i,a,s){var o=e.nodeName,l=a.restoreStack[a.restoreStack.length-1];l&&!(e.compareDocumentPosition(l)&On.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),a.restoreStack.pop());var c=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],h=e.parsedStyle.clipPath;if(h){this.applyWorldTransform(n,h);var d=this.pathGeneratorFactory[h.nodeName];d&&(n.save(),a.restoreStack.push(e),n.beginPath(),d(n,h.parsedStyle),n.closePath(),n.clip())}c&&(this.applyWorldTransform(n,e),n.save(),this.applyAttributesToContext(n,e)),u&&(n.beginPath(),u(n,e.parsedStyle),o!==_t.LINE&&o!==_t.PATH&&o!==_t.POLYLINE&&n.closePath()),c&&(c.render(n,e.parsedStyle,e,i,this,s),n.restore()),e.dirty(!1)}},{key:"applyAttributesToContext",value:function(e,n){var i=n.parsedStyle,a=i.stroke,s=i.fill,o=i.opacity,l=i.lineDash,c=i.lineDashOffset;l&&e.setLineDash(l),ye(c)||(e.lineDashOffset=c),ye(o)||(e.globalAlpha*=o),!ye(a)&&!Array.isArray(a)&&!a.isNone&&(e.strokeStyle=n.attributes.stroke),!ye(s)&&!Array.isArray(s)&&!s.isNone&&(e.fillStyle=n.attributes.fill)}},{key:"convertAABB2Rect",value:function(e){var n=e.getMin(),i=e.getMax(),a=Math.floor(n[0]),s=Math.floor(n[1]),o=Math.ceil(i[0]),l=Math.ceil(i[1]),c=o-a,u=l-s;return{x:a,y:s,width:c,height:u}}},{key:"mergeDirtyAABBs",value:function(e){var n=new gn;return e.forEach(function(i){var a=i.getRenderBounds();n.add(a);var s=i.renderable.dirtyRenderBounds;s&&n.add(s)}),n}},{key:"searchDirtyObjects",value:function(e){var n=e.getMin(),i=(0,P.Z)(n,2),a=i[0],s=i[1],o=e.getMax(),l=(0,P.Z)(o,2),c=l[0],u=l[1],h=this.rBush.search({minX:a,minY:s,maxX:c,maxY:u});return h.map(function(d){var f=d.displayObject;return f})}},{key:"saveDirtyAABB",value:function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new gn);var i=e.getRenderBounds();i&&n.dirtyRenderBounds.update(i.center,i.halfExtents)}},{key:"applyWorldTransform",value:function(e,n,i){i?(we(this.tmpMat4,n.getLocalTransform()),Jt(this.tmpMat4,i,this.tmpMat4),Jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(we(this.tmpMat4,n.getWorldTransform()),Jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var e=new gn,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return i.forEach(function(s){e.add(s)}),e}}])}();Qy.tag="CanvasRenderer";function Su(r,t,e,n,i,a,s){var o,l;if(r.image.nodeName==="rect"){var c=r.image.parsedStyle,u=c.width,h=c.height;l=n.contextService.getDPR();var d=n.config.offscreenCanvas;o=a.offscreenCanvasCreator.getOrCreateCanvas(d),o.width=u*l,o.height=h*l;var f=a.offscreenCanvasCreator.getOrCreateContext(d),v={restoreStack:[],prevObject:null,currentContext:new Map};r.image.forEach(function(p){i.renderDisplayObject(p,f,n,v,a)}),v.restoreStack.forEach(function(){f.restore()})}var g=s.getOrCreatePatternSync(t,r,e,o,l,t.getGeometryBounds().min,function(){t.dirty(),n.renderingService.dirty()});return g}function Mu(r,t,e,n){var i;if(r.type===_a.LinearGradient||r.type===_a.RadialGradient){var a=t.getGeometryBounds(),s=a&&a.halfExtents[0]*2||1,o=a&&a.halfExtents[1]*2||1,l=a&&a.min||[0,0];i=n.getOrCreateGradient((0,D.Z)((0,D.Z)({type:r.type},r.value),{},{min:l,width:s,height:o}),e)}return i}var Au=["shadowBlur","shadowOffsetX","shadowOffsetY"],qy=["lineCap","lineJoin","miterLimit"],qn={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},Jy={};function Rn(r,t,e,n){var i=n.has(t)?n.get(t):qn[t];return i!==e&&(t==="lineDash"?r.setLineDash(e):r[t]=e,n.set(t,e)),i}var Lk=function(){function r(t){(0,N.Z)(this,r),this.imagePool=t}return(0,T.Z)(r,[{key:"applyAttributesToContext",value:function(e,n){}},{key:"render",value:function(e,n,i,a,s,o){}},{key:"applyCommonStyleToContext",value:function(e,n,i,a){var s=i?Jy:a.prevObject.parsedStyle,o=n.parsedStyle;(i||o.opacity!==s.opacity)&&Rn(e,"globalAlpha",ye(o.opacity)?qn.globalAlpha:o.opacity,a.currentContext),(i||o.blend!==s.blend)&&Rn(e,"globalCompositeOperation",ye(o.blend)?qn.globalCompositeOperation:o.blend,a.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(e,n,i,a){var s=i?Jy:a.prevObject.parsedStyle,o=n.parsedStyle,l=o.lineWidth,c=l===void 0?qn.lineWidth:l,u=o.fill&&!o.fill.isNone,h=o.stroke&&!o.stroke.isNone&&c>0;if(h){if(i||n.attributes.stroke!==a.prevObject.attributes.stroke){var d=!ye(o.stroke)&&!Array.isArray(o.stroke)&&!o.stroke.isNone?n.attributes.stroke:qn.strokeStyle;Rn(e,"strokeStyle",d,a.currentContext)}(i||o.lineWidth!==s.lineWidth)&&Rn(e,"lineWidth",ye(o.lineWidth)?qn.lineWidth:o.lineWidth,a.currentContext),(i||o.lineDash!==s.lineDash)&&Rn(e,"lineDash",o.lineDash||qn.lineDash,a.currentContext),(i||o.lineDashOffset!==s.lineDashOffset)&&Rn(e,"lineDashOffset",ye(o.lineDashOffset)?qn.lineDashOffset:o.lineDashOffset,a.currentContext);for(var f=0;f<qy.length;f++){var v=qy[f];(i||o[v]!==s[v])&&Rn(e,v,ye(o[v])?qn[v]:o[v],a.currentContext)}}if(u&&(i||n.attributes.fill!==a.prevObject.attributes.fill)){var g=!ye(o.fill)&&!Array.isArray(o.fill)&&!o.fill.isNone?n.attributes.fill:qn.fillStyle;Rn(e,"fillStyle",g,a.currentContext)}}},{key:"applyStyleToContext",value:function(e,n,i,a){var s=n.nodeName;this.applyCommonStyleToContext(e,n,i,a),s===_t.IMAGE||this.applyStrokeFillStyleToContext(e,n,i,a)}},{key:"applyShadowAndFilterStyleToContext",value:function(e,n,i,a){var s=n.parsedStyle;if(i){Rn(e,"shadowColor",s.shadowColor.toString(),a.currentContext);for(var o=0;o<Au.length;o++){var l=Au[o];Rn(e,l,s[l]||qn[l],a.currentContext)}}s.filter&&s.filter.length&&Rn(e,"filter",n.attributes.filter,a.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(e,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(n){Rn(e,"shadowColor",qn.shadowColor,a.currentContext);for(var o=0;o<Au.length;o++){var l=Au[o];Rn(e,l,qn[l],a.currentContext)}}if(i)if(n&&s){var c=e.filter;!ye(c)&&c.indexOf("drop-shadow")>-1&&Rn(e,"filter",c.replace(/drop-shadow\([^)]*\)/,"").trim()||qn.filter,a.currentContext)}else Rn(e,"filter",qn.filter,a.currentContext)}},{key:"fillToContext",value:function(e,n,i,a,s){var o=this,l=n.parsedStyle,c=l.fill,u=l.fillRule,h=null;if(Array.isArray(c)&&c.length>0)c.forEach(function(f){var v=Rn(e,"fillStyle",Mu(f,n,e,o.imagePool),i.currentContext);h=h!=null?h:v,u?e.fill(u):e.fill()});else{if(ys(c)){var d=Su(c,n,e,n.ownerDocument.defaultView.context,a,s,this.imagePool);d&&(e.fillStyle=d,h=!0)}u?e.fill(u):e.fill()}h!==null&&Rn(e,"fillStyle",h,i.currentContext)}},{key:"strokeToContext",value:function(e,n,i,a,s){var o=this,l=n.parsedStyle.stroke,c=null;if(Array.isArray(l)&&l.length>0)l.forEach(function(d){var f=Rn(e,"strokeStyle",Mu(d,n,e,o.imagePool),i.currentContext);c=c!=null?c:f,e.stroke()});else{if(ys(l)){var u=Su(l,n,e,n.ownerDocument.defaultView.context,a,s,this.imagePool);if(u){var h=Rn(e,"strokeStyle",u,i.currentContext);c=c!=null?c:h}}e.stroke()}c!==null&&Rn(e,"strokeStyle",c,i.currentContext)}},{key:"drawToContext",value:function(e,n,i,a,s){var o,l=n.nodeName,c=n.parsedStyle,u=c.opacity,h=u===void 0?qn.globalAlpha:u,d=c.fillOpacity,f=d===void 0?qn.fillOpacity:d,v=c.strokeOpacity,g=v===void 0?qn.strokeOpacity:v,p=c.lineWidth,y=p===void 0?qn.lineWidth:p,b=c.fill&&!c.fill.isNone,w=c.stroke&&!c.stroke.isNone&&y>0;if(!(!b&&!w)){var O=!ye(c.shadowColor)&&c.shadowBlur>0,_=c.shadowType==="inner",F=((o=c.fill)===null||o===void 0?void 0:o.alpha)===0,W=!!(c.filter&&c.filter.length),j=O&&w&&(l===_t.PATH||l===_t.LINE||l===_t.POLYLINE||F||_),H=null;if(b){j||this.applyShadowAndFilterStyleToContext(e,n,O,i);var K=h*f;H=Rn(e,"globalAlpha",K,i.currentContext),this.fillToContext(e,n,i,a,s),j||this.clearShadowAndFilterStyleForContext(e,O,W,i)}if(w){var et=!1,rt=h*g,lt=Rn(e,"globalAlpha",rt,i.currentContext);if(H=b?H:lt,j&&(this.applyShadowAndFilterStyleToContext(e,n,O,i),et=!0,_)){var ht=e.globalCompositeOperation;e.globalCompositeOperation="source-atop",this.strokeToContext(e,n,i,a,s),e.globalCompositeOperation=ht,this.clearShadowAndFilterStyleForContext(e,O,W,i,!0)}this.strokeToContext(e,n,i,a,s),et&&this.clearShadowAndFilterStyleForContext(e,O,W,i)}H!==null&&Rn(e,"globalAlpha",H,i.currentContext)}}}])}(),sv=function(r){function t(){return(0,N.Z)(this,t),(0,R.Z)(this,t,arguments)}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"render",value:function(n,i,a,s,o,l){var c=i.fill,u=i.fillRule,h=i.opacity,d=h===void 0?1:h,f=i.fillOpacity,v=f===void 0?1:f,g=i.stroke,p=i.strokeOpacity,y=p===void 0?1:p,b=i.lineWidth,w=b===void 0?1:b,O=i.lineCap,_=i.lineJoin,F=i.shadowType,W=i.shadowColor,j=i.shadowBlur,H=i.filter,K=i.miterLimit,et=c&&!c.isNone,rt=g&&!g.isNone&&w>0,lt=(c==null?void 0:c.alpha)===0,ht=!!(H&&H.length),yt=!ye(W)&&j>0,Nt=a.nodeName,Ct=F==="inner",pt=rt&&yt&&(Nt===_t.PATH||Nt===_t.LINE||Nt===_t.POLYLINE||lt||Ct);et&&(n.globalAlpha=d*v,pt||Tu(a,n,yt),$y(n,a,c,u,s,o,l,this.imagePool),pt||this.clearShadowAndFilter(n,ht,yt)),rt&&(n.globalAlpha=d*y,n.lineWidth=w,ye(K)||(n.miterLimit=K),ye(O)||(n.lineCap=O),ye(_)||(n.lineJoin=_),pt&&(Ct&&(n.globalCompositeOperation="source-atop"),Tu(a,n,!0),Ct&&(ov(n,a,g,s,o,l,this.imagePool),n.globalCompositeOperation=qn.globalCompositeOperation,this.clearShadowAndFilter(n,ht,!0))),ov(n,a,g,s,o,l,this.imagePool))}},{key:"clearShadowAndFilter",value:function(n,i,a){if(a&&(n.shadowColor="transparent",n.shadowBlur=0),i){var s=n.filter;!ye(s)&&s.indexOf("drop-shadow")>-1&&(n.filter=s.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Lk);function Tu(r,t,e){var n=r.parsedStyle,i=n.filter,a=n.shadowColor,s=n.shadowBlur,o=n.shadowOffsetX,l=n.shadowOffsetY;i&&i.length&&(t.filter=r.style.filter),e&&(t.shadowColor=a.toString(),t.shadowBlur=s||0,t.shadowOffsetX=o||0,t.shadowOffsetY=l||0)}function $y(r,t,e,n,i,a,s,o){var l=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1;Array.isArray(e)?e.forEach(function(c){r.fillStyle=Mu(c,t,r,o),l||(n?r.fill(n):r.fill())}):(ys(e)&&(r.fillStyle=Su(e,t,r,i,a,s,o)),l||(n?r.fill(n):r.fill()))}function ov(r,t,e,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1;Array.isArray(e)?e.forEach(function(l){r.strokeStyle=Mu(l,t,r,s),o||r.stroke()}):(ys(e)&&(r.strokeStyle=Su(e,t,r,n,i,a,s)),o||r.stroke())}function Dk(r,t){var e=(0,P.Z)(r,4),n=e[0],i=e[1],a=e[2],s=e[3],o=(0,P.Z)(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=Math.max(n,l),f=Math.max(i,c),v=Math.min(n+a,l+u),g=Math.min(i+s,c+h);return v<=d||g<=f?null:[d,f,v-d,g-f]}function _k(r,t){var e=re(gt(),[r[0],r[1],0],t),n=re(gt(),[r[0]+r[2],r[1],0],t),i=re(gt(),[r[0],r[1]+r[3],0],t),a=re(gt(),[r[0]+r[2],r[1]+r[3],0],t);return[Math.min(e[0],n[0],i[0],a[0]),Math.min(e[1],n[1],i[1],a[1]),Math.max(e[0],n[0],i[0],a[0])-Math.min(e[0],n[0],i[0],a[0]),Math.max(e[1],n[1],i[1],a[1])-Math.min(e[1],n[1],i[1],a[1])]}var Ik=function(r){function t(){return(0,N.Z)(this,t),(0,R.Z)(this,t,arguments)}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"renderDownSampled",value:function(n,i,a,s){var o=s.src,l=s.imageCache;if(!l.downSampled){this.imagePool.createDownSampledImage(o,a).then(function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirty())}).catch(function(c){console.error(c)});return}n.drawImage(l.downSampled,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}},{key:"renderTile",value:function(n,i,a,s){var o=s.src,l=s.imageCache,c=s.imageRect,u=s.drawRect,h=l.size,d=n.getTransform(),f=d.a,v=d.b,g=d.c,p=d.d,y=d.e,b=d.f;if(n.resetTransform(),!(l!=null&&l.gridSize)){this.imagePool.createImageTiles(o,[],function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirty())},a).catch(function(yt){console.error(yt)});return}for(var w=[h[0]/c[2],h[1]/c[3]],O=[l.tileSize[0]/w[0],l.tileSize[1]/w[1]],_=[Math.floor((u[0]-c[0])/O[0]),Math.ceil((u[0]+u[2]-c[0])/O[0])],F=_[0],W=_[1],j=[Math.floor((u[1]-c[1])/O[1]),Math.ceil((u[1]+u[3]-c[1])/O[1])],H=j[0],K=j[1],et=H;et<=K;et++)for(var rt=F;rt<=W;rt++){var lt=l.tiles[et][rt];if(lt){var ht=[Math.floor(c[0]+lt.tileX*O[0]),Math.floor(c[1]+lt.tileY*O[1]),Math.ceil(O[0]),Math.ceil(O[1])];n.drawImage(lt.data,ht[0],ht[1],ht[2],ht[3])}}n.setTransform(f,v,g,p,y,b)}},{key:"render",value:function(n,i,a){var s=i.x,o=s===void 0?0:s,l=i.y,c=l===void 0?0:l,u=i.width,h=i.height,d=i.src,f=i.shadowColor,v=i.shadowBlur,g=this.imagePool.getImageSync(d,a),p=g==null?void 0:g.img,y=u,b=h;if(p){y||(y=p.width),b||(b=p.height);var w=!ye(f)&&v>0;Tu(a,n,w);try{var O=a.ownerDocument.defaultView.getContextService().getDomElement(),_=O.width,F=O.height,W=n.getTransform(),j=W.a,H=W.b,K=W.c,et=W.d,rt=W.e,lt=W.f,ht=Ae(j,K,0,0,H,et,0,0,0,0,1,0,rt,lt,0,1),yt=_k([o,c,y,b],ht),Nt=Dk([0,0,_,F],yt);if(!Nt)return;if(!a.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){t.renderFull(n,i,a,{image:p,drawRect:[o,c,y,b]});return}var Ct=yt[2]/g.size[0];if(Ct<(g.downSamplingRate||.5)){this.renderDownSampled(n,i,a,{src:d,imageCache:g,drawRect:[o,c,y,b]});return}if(!av.isSupportTile){t.renderFull(n,i,a,{image:p,drawRect:[o,c,y,b]});return}this.renderTile(n,i,a,{src:d,imageCache:g,imageRect:yt,drawRect:Nt})}catch(pt){}}}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i)}}],[{key:"renderFull",value:function(n,i,a,s){n.drawImage(s.image,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}}])}(sv),Bk=function(r){function t(){return(0,N.Z)(this,t),(0,R.Z)(this,t,arguments)}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"render",value:function(n,i,a,s,o,l){a.getBounds();var c=i.lineWidth,u=c===void 0?1:c,h=i.textAlign,d=h===void 0?"start":h,f=i.textBaseline,v=f===void 0?"alphabetic":f,g=i.lineJoin,p=g===void 0?"miter":g,y=i.miterLimit,b=y===void 0?10:y,w=i.letterSpacing,O=w===void 0?0:w,_=i.stroke,F=i.fill,W=i.fillRule,j=i.fillOpacity,H=j===void 0?1:j,K=i.strokeOpacity,et=K===void 0?1:K,rt=i.opacity,lt=rt===void 0?1:rt,ht=i.metrics,yt=i.x,Nt=yt===void 0?0:yt,Ct=i.y,pt=Ct===void 0?0:Ct,xt=i.dx,kt=i.dy,jt=i.shadowColor,Xt=i.shadowBlur,ee=i.textDecorationLine,ce=ht.font,ue=ht.lines,le=ht.height,me=ht.lineHeight,De=ht.lineMetrics;n.font=ce,n.lineWidth=u,n.textAlign=d==="middle"?"center":d;var Ge=v;Ge==="alphabetic"&&(Ge="bottom"),n.lineJoin=p,ye(b)||(n.miterLimit=b);var _e=pt;v==="middle"?_e+=-le/2-me/2:v==="bottom"||v==="alphabetic"||v==="ideographic"?_e+=-le:(v==="top"||v==="hanging")&&(_e+=-me);var tr=Nt+(xt||0);_e+=kt||0,ue.length===1&&(Ge==="bottom"?(Ge="middle",_e-=.5*le):Ge==="top"&&(Ge="middle",_e+=.5*le)),n.textBaseline=Ge;var yn=!ye(jt)&&Xt>0;Tu(a,n,yn);for(var Sr=0;Sr<ue.length;Sr++){var lr=u/2+tr;_e+=me,!ye(_)&&!_.isNone&&u&&this.drawLetterSpacing(n,a,ue[Sr],De[Sr],d,lr,_e,O,F,W,H,_,et,lt,!0,s,o,l),ye(F)||this.drawLetterSpacing(n,a,ue[Sr],De[Sr],d,lr,_e,O,F,W,H,_,et,lt,!1,s,o,l)}ee&&ee!=="none"&&this.drawTextDecorations(n,i,a,ue,me,tr,pt+(kt||0),s,o,l)}},{key:"drawLetterSpacing",value:function(n,i,a,s,o,l,c,u,h,d,f,v,g,p,y,b,w,O){if(u===0){y?this.strokeText(n,i,a,l,c,v,g,b,w,O):this.fillText(n,i,a,l,c,h,d,f,p,b,w,O);return}var _=n.textAlign;n.textAlign="left";var F=l;o==="center"||o==="middle"?F=l-s.width/2:(o==="right"||o==="end")&&(F=l-s.width);for(var W=Array.from(a),j=n.measureText(a).width,H=0,K=0;K<W.length;++K){var et=W[K];y?this.strokeText(n,i,et,F,c,v,g,b,w,O):this.fillText(n,i,et,F,c,h,d,f,p,b,w,O),H=n.measureText(a.substring(K+1)).width,F+=j-H+u,j=H}n.textAlign=_}},{key:"fillText",value:function(n,i,a,s,o,l,c,u,h,d,f,v){$y(n,i,l,c,d,f,v,this.imagePool,!0);var g,p=!ye(u)&&u!==1;p&&(g=n.globalAlpha,n.globalAlpha=u*h),n.fillText(a,s,o),p&&(n.globalAlpha=g)}},{key:"strokeText",value:function(n,i,a,s,o,l,c,u,h,d){ov(n,i,l,u,h,d,this.imagePool,!0);var f,v=!ye(c)&&c!==1;v&&(f=n.globalAlpha,n.globalAlpha=c),n.strokeText(a,s,o),v&&(n.globalAlpha=f)}},{key:"drawTextDecorations",value:function(n,i,a,s,o,l,c,u,h,d){var f=i.textDecorationLine,v=i.textDecorationColor,g=i.textDecorationStyle,p=i.textDecorationThickness,y=p===void 0?1:p,b=i.textAlign,w=b===void 0?"start":b,O=i.lineWidth,_=O===void 0?1:O,F=i.metrics;if(!(!f||f==="none")){var W=F.lineMetrics,j=f.split(" ");switch(n.lineWidth=y,v&&(n.strokeStyle="rgba(".concat(v.r,", ").concat(v.g,", ").concat(v.b,", ").concat(v.alpha,")")),g){case"dashed":n.setLineDash([5,5]);break;case"dotted":n.setLineDash([2,2]);break;case"wavy":n.setLineDash([]);break;default:n.setLineDash([]);break}var H=c,K=i.textBaseline,et=K===void 0?"alphabetic":K;et==="middle"?H+=-F.height/2-o/2:et==="bottom"||et==="alphabetic"||et==="ideographic"?H+=-F.height:(et==="top"||et==="hanging")&&(H+=-o);for(var rt=0;rt<s.length;rt++){H+=o;var lt=W[rt];if(lt){var ht=_/2,yt=l,Nt=l+lt.width;w==="center"||w==="middle"?(yt=l-lt.width/2,Nt=l+lt.width/2):(w==="right"||w==="end")&&(yt=l-lt.width,Nt=l),yt+=ht,Nt+=ht;var Ct=(0,La.Z)(j),pt;try{for(Ct.s();!(pt=Ct.n()).done;){var xt=pt.value,kt=H;switch(xt){case"underline":kt+=2;break;case"overline":kt-=o-2;break;case"line-through":kt-=o/2;break;default:continue}g==="wavy"?this.drawWavyLine(n,yt,Nt,kt):(n.beginPath(),n.moveTo(yt,kt),n.lineTo(Nt,kt),n.stroke())}}catch(jt){Ct.e(jt)}finally{Ct.f()}}}n.setLineDash([])}}},{key:"drawWavyLine",value:function(n,i,a,s){var o=2,l=10,c=Math.floor((a-i)/l);n.beginPath(),n.moveTo(i,s);for(var u=0;u<c;u++){var h=i+u*l+l/4,d=s+o,f=i+u*l+l/2,v=s;n.quadraticCurveTo(h,d,f,v);var g=i+u*l+l*3/4,p=s-o,y=i+(u+1)*l,b=s;n.quadraticCurveTo(g,p,y,b)}n.stroke()}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i,i.ownerDocument.defaultView.context,s,o)}}])}(sv),Fk=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),e=(0,R.Z)(this,t),e.name="canvas-renderer",e.options=n,e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){var n,i=(0,D.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),a=this.context.imagePool,s=new sv(a),o=(n={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(n,_t.CIRCLE,s),_t.ELLIPSE,s),_t.RECT,s),_t.IMAGE,new Ik(a)),_t.TEXT,new Bk(a)),_t.LINE,s),_t.POLYLINE,s),_t.POLYGON,s),_t.PATH,s),_t.GROUP,void 0),(0,ae.Z)((0,ae.Z)((0,ae.Z)(n,_t.HTML,void 0),_t.MESH,void 0),_t.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new Qy(i))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(Da);var t1=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"apply",value:function(e,n){var i=this,a=e.renderingService,s=e.renderingContext,o=e.config;this.context=e;var l=s.root.ownerDocument.defaultView,c=function(j){a.hooks.pointerMove.call(j)},u=function(j){a.hooks.pointerUp.call(j)},h=function(j){a.hooks.pointerDown.call(j)},d=function(j){a.hooks.pointerOver.call(j)},f=function(j){a.hooks.pointerOut.call(j)},v=function(j){a.hooks.pointerCancel.call(j)},g=function(j){a.hooks.pointerWheel.call(j)},p=function(j){a.hooks.click.call(j)},y=function(j){n.globalThis.document.addEventListener("pointermove",c,!0),j.addEventListener("pointerdown",h,!0),j.addEventListener("pointerleave",f,!0),j.addEventListener("pointerover",d,!0),n.globalThis.addEventListener("pointerup",u,!0),n.globalThis.addEventListener("pointercancel",v,!0)},b=function(j){j.addEventListener("touchstart",h,!0),j.addEventListener("touchend",u,!0),j.addEventListener("touchmove",c,!0),j.addEventListener("touchcancel",v,!0)},w=function(j){n.globalThis.document.addEventListener("mousemove",c,!0),j.addEventListener("mousedown",h,!0),j.addEventListener("mouseout",f,!0),j.addEventListener("mouseover",d,!0),n.globalThis.addEventListener("mouseup",u,!0)},O=function(j){n.globalThis.document.removeEventListener("pointermove",c,!0),j.removeEventListener("pointerdown",h,!0),j.removeEventListener("pointerleave",f,!0),j.removeEventListener("pointerover",d,!0),n.globalThis.removeEventListener("pointerup",u,!0),n.globalThis.removeEventListener("pointercancel",v,!0)},_=function(j){j.removeEventListener("touchstart",h,!0),j.removeEventListener("touchend",u,!0),j.removeEventListener("touchmove",c,!0),j.removeEventListener("touchcancel",v,!0)},F=function(j){n.globalThis.document.removeEventListener("mousemove",c,!0),j.removeEventListener("mousedown",h,!0),j.removeEventListener("mouseout",f,!0),j.removeEventListener("mouseover",d,!0),n.globalThis.removeEventListener("mouseup",u,!0)};a.hooks.init.tap(r.tag,function(){var W=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(W.style.msContentZooming="none",W.style.msTouchAction="none"):l.supportsPointerEvents&&(W.style.touchAction="none"),l.supportsPointerEvents?y(W):w(W),l.supportsTouchEvents&&b(W),o.useNativeClickEvent&&W.addEventListener("click",p,!0),W.addEventListener("wheel",g,{passive:!0,capture:!0})}),a.hooks.destroy.tap(r.tag,function(){var W=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(W.style.msContentZooming="",W.style.msTouchAction=""):l.supportsPointerEvents&&(W.style.touchAction=""),l.supportsPointerEvents?O(W):F(W),l.supportsTouchEvents&&_(W),o.useNativeClickEvent&&W.removeEventListener("click",p,!0),W.removeEventListener("wheel",g,!0)})}}])}();t1.tag="DOMInteraction";var zk=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.name="dom-interaction",e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new t1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Da);var jk="g-canvas-camera",e1=function(){function r(){(0,N.Z)(this,r),this.displayObjectHTMLElementMap=new WeakMap}return(0,T.Z)(r,[{key:"joinTransformMatrix",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return"matrix(".concat([e[0],e[1],e[4],e[5],e[12]+n[0],e[13]+n[1]].join(","),")")}},{key:"apply",value:function(e,n){var i=this,a=e.camera,s=e.renderingContext,o=e.renderingService;this.context=e;var l=s.root.ownerDocument.defaultView,c=l.context.eventService.nativeHTMLMap,u=function(y,b){b.style.transform=i.joinTransformMatrix(y.getWorldTransform(),y.getOrigin())},h=function(y){var b=y.target;if(b.nodeName===_t.HTML){i.$camera||(i.$camera=i.createCamera(a));var w=i.getOrCreateEl(b);i.$camera.appendChild(w),Object.keys(b.attributes).forEach(function(O){i.updateAttribute(O,b)}),u(b,w),c.set(w,b)}},d=function(y){var b=y.target;if(b.nodeName===_t.HTML&&i.$camera){var w=i.getOrCreateEl(b);w&&(w.remove(),c.delete(w))}},f=function(y){var b=y.target;if(b.nodeName===_t.HTML){var w=y.attrName;i.updateAttribute(w,b)}},v=function(y){for(var b=y.detail,w=0;w<b.length;w++){var O=b[w],_=O.target,F=_.nodeName===_t.FRAGMENT?_.childNodes:[_];F.forEach(function(W){if(W.nodeName===_t.HTML){var j=i.getOrCreateEl(W);u(W,j)}})}},g=function(){if(i.$camera){var y=i.context.config,b=y.width,w=y.height;i.$camera.parentElement.style.width="".concat(b||0,"px"),i.$camera.parentElement.style.height="".concat(w||0,"px")}};o.hooks.init.tap(r.tag,function(){l.addEventListener(ii.RESIZE,g),l.addEventListener(Ie.MOUNTED,h),l.addEventListener(Ie.UNMOUNTED,d),l.addEventListener(Ie.ATTR_MODIFIED,f),l.addEventListener(Ie.BOUNDS_CHANGED,v)}),o.hooks.endFrame.tap(r.tag,function(){i.$camera&&s.renderReasons.has(lo.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(a.getOrthoMatrix()))}),o.hooks.destroy.tap(r.tag,function(){i.$camera&&i.$camera.remove(),l.removeEventListener(ii.RESIZE,g),l.removeEventListener(Ie.MOUNTED,h),l.removeEventListener(Ie.UNMOUNTED,d),l.removeEventListener(Ie.ATTR_MODIFIED,f),l.removeEventListener(Ie.BOUNDS_CHANGED,v)})}},{key:"createCamera",value:function(e){var n=this.context.config,i=n.document,a=n.width,s=n.height,o=this.context.contextService.getDomElement(),l=o.parentNode;if(l){var c=jk,u=l.querySelector("#".concat(c));if(!u){var h=(i||document).createElement("div");h.style.overflow="hidden",h.style.pointerEvents="none",h.style.position="absolute",h.style.left="0px",h.style.top="0px",h.style.width="".concat(a||0,"px"),h.style.height="".concat(s||0,"px");var d=(i||document).createElement("div");u=d,d.id=c,d.style.position="absolute",d.style.left="".concat(o.offsetLeft||0,"px"),d.style.top="".concat(o.offsetTop||0,"px"),d.style.transformOrigin="left top",d.style.transform=this.joinTransformMatrix(e.getOrthoMatrix()),d.style.pointerEvents="none",d.style.width="100%",d.style.height="100%",h.appendChild(d),l.appendChild(h)}return u}return null}},{key:"getOrCreateEl",value:function(e){var n=this.context.config.document,i=this.displayObjectHTMLElementMap.get(e);return i||(i=(n||document).createElement("div"),e.parsedStyle.$el=i,this.displayObjectHTMLElementMap.set(e,i),e.id&&(i.id=e.id),e.name&&i.setAttribute("name",e.name),e.className&&(i.className=e.className),i.style.position="absolute",i.style["will-change"]="transform",i.style.transform=this.joinTransformMatrix(e.getWorldTransform(),e.getOrigin())),i}},{key:"updateAttribute",value:function(e,n){var i=this.getOrCreateEl(n);switch(e){case"innerHTML":var a=n.parsedStyle.innerHTML;Ve(a)?i.innerHTML=a:(i.innerHTML="",i.appendChild(a));break;case"x":i.style.left="".concat(n.parsedStyle.x,"px");break;case"y":i.style.top="".concat(n.parsedStyle.y,"px");break;case"transformOrigin":var s=n.parsedStyle.transformOrigin;i.style["transform-origin"]="".concat(s[0].buildCSSText(null,null,"")," ").concat(s[1].buildCSSText(null,null,""));break;case"width":var o=n.parsedStyle.width;i.style.width=ie(o)?"".concat(o,"px"):o.toString();break;case"height":var l=n.parsedStyle.height;i.style.height=ie(l)?"".concat(l,"px"):l.toString();break;case"zIndex":var c=n.parsedStyle.zIndex;i.style["z-index"]="".concat(c);break;case"visibility":var u=n.parsedStyle.visibility;i.style.visibility=u;break;case"pointerEvents":var h=n.parsedStyle.pointerEvents,d=h===void 0?"auto":h;i.style.pointerEvents=d;break;case"opacity":var f=n.parsedStyle.opacity;i.style.opacity="".concat(f);break;case"fill":var v=n.parsedStyle.fill,g="";pc(v)?v.isNone?g="transparent":g=n.getAttribute("fill"):Array.isArray(v)?g=n.getAttribute("fill"):ys(v),i.style.background=g;break;case"stroke":var p=n.parsedStyle.stroke,y="";pc(p)?p.isNone?y="transparent":y=n.getAttribute("stroke"):Array.isArray(p)?y=n.getAttribute("stroke"):ys(p),i.style["border-color"]=y,i.style["border-style"]="solid";break;case"lineWidth":var b=n.parsedStyle.lineWidth;i.style["border-width"]="".concat(b||0,"px");break;case"lineDash":i.style["border-style"]="dashed";break;case"filter":var w=n.style.filter;i.style.filter=w;break;default:!ye(n.style[e])&&n.style[e]!==""&&(i.style[e]=n.style[e])}}}])}();e1.tag="HTMLRendering";var Zk=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.name="html-renderer",e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new e1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Da);var Wk=function(){function r(t){(0,N.Z)(this,r),this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return(0,T.Z)(r,[{key:"init",value:function(){var e=this.canvasConfig,n=e.container,i=e.canvas;if(i)this.$canvas=i,n&&i.parentElement!==n&&n.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=Ve(n)?document.getElementById(n):n,this.$container)){var a=document.createElement("canvas");this.$container.appendChild(a),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=a}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(e,n){var i=this.canvasConfig.devicePixelRatio;this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*n,jM(this.$canvas,e,n)),this.renderingContext.renderReasons.add(lo.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)}},{key:"toDataURL",value:function(){var t=(0,Ra.Z)((0,Cr.Z)().mark(function n(){var i,a,s,o=arguments;return(0,Cr.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return i=o.length>0&&o[0]!==void 0?o[0]:{},a=i.type,s=i.encoderOptions,l.abrupt("return",this.context.canvas.toDataURL(a,s));case 1:case"end":return l.stop()}},n,this)}));function e(){return t.apply(this,arguments)}return e}()}])}(),Gk=function(r){function t(){var e;(0,N.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=(0,R.Z)(this,t,[].concat(i)),e.name="canvas-context-register",e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.context.ContextService=Wk}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(Da),Sl=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,R.Z)(this,t,[e]),n.registerPlugin(new Gk),n.registerPlugin(new Rk),n.registerPlugin(new ck),n.registerPlugin(new Fk),n.registerPlugin(new zk),n.registerPlugin(new Ck),n.registerPlugin(new Zk),n}return(0,C.Z)(t,r),(0,T.Z)(t)}(R2);function Vk(r,t){if(r){var e;if(Gr(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(Fn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var n1=Vk,Uk=Object.prototype.hasOwnProperty,Bs=function(r,t){if(r===null||!vo(r))return{};var e={};return n1(t,function(n){Uk.call(r,n)&&(e[n]=r[n])}),e},Yk=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Ou extends Fi{constructor(t){super(Object.assign(Object.assign({},t),{style:Object.assign({},Ou.defaultStyleProps,t.style)})),this.rootPointerEvent=new wc(null),this.forwardEvents=e=>{const n=this.context.canvas,i=n.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(e,i).forEach(s=>{const o=this.bootstrapEvent(this.rootPointerEvent,s,i,e);bl(n.context.eventService,"mappingTable.pointerupoutside",[]),n.context.eventService.mapEvent(o)})}}get eventService(){return this.context.canvas.context.eventService}get events(){return[Bt.CLICK,Bt.POINTER_DOWN,Bt.POINTER_MOVE,Bt.POINTER_UP,Bt.POINTER_OVER,Bt.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.drawPortShapes(t,e)}getKeyStyle(t){const e=Bs(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:i=0}=e,a=Yk(e,["dx","dy"]),[s,o]=this.getSize(t);return Object.assign(Object.assign({x:n,y:i},a),{width:s,height:o})}drawKeyShape(t,e){const n=this.getKeyStyle(t),{x:i,y:a,width:s=0,height:o=0}=n,l=this.upsert("key-container",pr,{x:i,y:a,width:s,height:o,opacity:0},e);return this.upsert("key",co,n,l)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof Sl))return;const n=this.getDomElement();this.events.forEach(i=>{n.addEventListener(i,this.forwardEvents)})}attributeChangedCallback(t,e,n){t==="zIndex"&&e!==n&&(this.getDomElement().style.zIndex=n)}destroy(){const t=this.getDomElement();this.events.forEach(e=>{t.removeEventListener(e,this.forwardEvents)}),super.destroy()}normalizeToPointerEvent(t,e){const n=[];if(e.isTouchEvent(t))for(let i=0;i<t.changedTouches.length;i++){const a=t.changedTouches[i];Te(a.button)&&(a.button=0),Te(a.buttons)&&(a.buttons=1),Te(a.isPrimary)&&(a.isPrimary=t.touches.length===1&&t.type==="touchstart"),Te(a.width)&&(a.width=a.radiusX||1),Te(a.height)&&(a.height=a.radiusY||1),Te(a.tiltX)&&(a.tiltX=0),Te(a.tiltY)&&(a.tiltY=0),Te(a.pointerType)&&(a.pointerType="touch"),Te(a.pointerId)&&(a.pointerId=a.identifier||0),Te(a.pressure)&&(a.pressure=a.force||.5),Te(a.twist)&&(a.twist=0),Te(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,a.type=t.type,n.push(a)}else if(e.isMouseEvent(t)){const i=t;Te(i.isPrimary)&&(i.isPrimary=!0),Te(i.width)&&(i.width=1),Te(i.height)&&(i.height=1),Te(i.tiltX)&&(i.tiltX=0),Te(i.tiltY)&&(i.tiltY=0),Te(i.pointerType)&&(i.pointerType="mouse"),Te(i.pointerId)&&(i.pointerId=1),Te(i.pressure)&&(i.pressure=.5),Te(i.twist)&&(i.twist=0),Te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,n.push(i)}else n.push(t);return n}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}bootstrapEvent(t,e,n,i){t.view=n,t.originalEvent=null,t.nativeEvent=i,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:a,y:s}=this.getViewportXY(e);t.viewport.x=a,t.viewport.y=s;const[o,l]=this.context.canvas.getCanvasByViewport([a,s]);return t.canvas.x=o,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t}getViewportXY(t){let e,n;const{offsetX:i,offsetY:a,clientX:s,clientY:o}=t;if(!ye(i)&&!ye(a))e=i,n=a;else{const l=this.eventService.client2Viewport({x:s,y:o});e=l.x,n=l.y}return{x:e,y:n}}onframe(){super.onframe();const{opacity:t}=this.attributes;this.getDomElement().style.opacity=`${t}`}}Ou.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var r1=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Cu extends Fi{constructor(t){super(hr({style:Cu.defaultStyleProps},t))}getKeyStyle(t){const[e,n]=this.getSize(t),i=super.getKeyStyle(t),{fillOpacity:a,opacity:s=a}=i,o=r1(i,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:s},o),{width:e,height:n,x:-e/2,y:-n/2})}getBounds(){return this.getShape("key").getBounds()}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getShape("key").attributes,{fill:n,stroke:i}=e,a=r1(e,["fill","stroke"]),s=Qn(this.getGraphicStyle(t),"halo"),o=Number(s.lineWidth),[l,c]=Ce(this.getSize(t),[o,o]),{lineWidth:u}=s,h={fill:"transparent",lineWidth:u/2,width:l-u/2,height:c-u/2,x:-(l-u/2)/2,y:-(c-u/2)/2};return Object.assign(Object.assign({},s),h)}getIconStyle(t){const e=super.getIconStyle(t),[n,i]=this.getSize(t);return e?Object.assign({width:n*ya,height:i*ya},e):!1}drawKeyShape(t,e){const n=this.upsert("key",qf,this.getKeyStyle(t),e);return $f(this),n}drawHaloShape(t,e){this.upsert("halo",pr,this.getHaloStyle(t),e)}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&tv(this)}}Cu.defaultStyleProps={size:32};class Hk extends Fi{constructor(t){super(t)}getKeyStyle(t){const[e,n]=this.getSize(t);return Object.assign(Object.assign({},super.getKeyStyle(t)),{width:e,height:n,x:-e/2,y:-n/2})}getIconStyle(t){const e=super.getIconStyle(t),{width:n,height:i}=this.getShape("key").attributes;return e?Object.assign({width:n*ya,height:i*ya},e):!1}drawKeyShape(t,e){return this.upsert("key",pr,this.getKeyStyle(t),e)}}class Xk extends pu{constructor(t){super(t)}getInnerR(t){return t.innerR||this.getOuterR(t)*3/8}getOuterR(t){return Math.min(...this.getSize(t))/2}getPoints(t){return I3(this.getOuterR(t),this.getInnerR(t))}getIconStyle(t){const e=super.getIconStyle(t),n=this.getInnerR(t)*2*ya;return e?Object.assign({width:n,height:n},e):!1}getPortXY(t,e){const{placement:n="top"}=e,i=this.getShape("key").getLocalBounds(),a=B3(this.getOuterR(t),this.getInnerR(t));return vv(i,n,a,!1)}}class Nu extends pu{constructor(t){super(hr({style:Nu.defaultStyleProps},t))}getPoints(t){const{direction:e}=t,[n,i]=this.getSize(t);return F3(n,i,e)}getPortXY(t,e){const{direction:n}=t,{placement:i="top"}=e,a=this.getShape("key").getLocalBounds(),[s,o]=this.getSize(t),l=z3(s,o,n);return vv(a,i,l,!1)}getIconStyle(t){const{icon:e,iconText:n,iconSrc:i,direction:a}=t;if(e===!1||ra(n||i))return!1;const s=Qn(this.getGraphicStyle(t),"icon"),o=this.getShape("key").getLocalBounds(),[l,c]=MO(o,a),u=AO(o,a)*2*ya;return Object.assign({x:l,y:c,width:u,height:u},s)}}Nu.defaultStyleProps={size:40,direction:"up"};var i1=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class yo extends Fi{constructor(t){super(hr({style:yo.defaultStyleProps},t)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(t){const{collapsed:e,childrenNode:n=[]}=t;return n.length===0?this.getEmptyKeySize(t):e?this.getCollapsedKeySize(t):this.getExpandedKeySize(t)}getEmptyKeySize(t){const{padding:e,collapsedSize:n}=t,[i,a,s,o]=Ri(e);return Ce(oi(n),[o+a,i+s,0])}getCollapsedKeySize(t){return oi(t.collapsedSize)}getExpandedKeySize(t){const e=this.getContentBBox(t);return[ta(e),ea(e),0]}getContentBBox(t){const{childrenNode:e=[],padding:n}=t,i=e.map(s=>this.context.element.getElement(s)).filter(Boolean);if(i.length===0){const s=new gn,{x:o=0,y:l=0,size:c}=t,[u,h]=oi(c);return s.setMinMax([o-u/2,l-h/2,0],[o+u/2,l+h/2,0]),s}const a=dl(i.map(s=>s.getBounds()));return n?za(a,n):a}drawCollapsedMarkerShape(t,e){const n=this.getCollapsedMarkerStyle(t);this.upsert("collapsed-marker",Gy,n,e),$f(this)}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=Qn(this.getGraphicStyle(t),"collapsedMarker"),{type:n}=e,i=i1(e,["type"]),a=this.getShape("key"),[s,o]=ma(a.getLocalBounds(),"center"),l=Object.assign(Object.assign({},i),{x:s,y:o});if(n){const c=this.getCollapsedMarkerText(n,t);Object.assign(l,{text:c})}return l}getCollapsedMarkerText(t,e){const{childrenData:n=[]}=e,{model:i}=this.context;return t==="descendant-count"?i.getDescendantsData(this.id).length.toString():t==="child-count"?n.length.toString():t==="node-count"?i.getDescendantsData(this.id).filter(a=>i.getElementType(At(a))==="node").length.toString():fe(t)?t(n):""}getComboPosition(t){const{x:e=0,y:n=0,collapsed:i,childrenData:a=[]}=t;if(a.length===0)return[+e,+n,0];if(i){const{model:s}=this.context,o=s.getDescendantsData(this.id).filter(l=>!s.isCombo(At(l)));if(o.length>0&&o.some(pN)){const l=o.reduce((c,u)=>Ce(c,ar(u)),[0,0,0]);return Ii(l,o.length)}return[+e,+n,0]}return this.getContentBBox(t).center}getComboStyle(t){const[e,n]=this.getComboPosition(t);return{x:e,y:n,transform:[["translate",e,n]]}}updateComboPosition(t){const e=this.getComboStyle(t);Object.assign(this.style,e);const{x:n,y:i}=e;this.context.model.syncNodeLikeDatum({id:this.id,style:{x:n,y:i}}),tv(this)}render(t,e=this){super.render(t,e),this.drawCollapsedMarkerShape(t,e)}update(t={}){super.update(t),this.updateComboPosition(this.parsedAttributes)}onframe(){super.onframe(),this.attributes.collapsed||this.updateComboPosition(this.parsedAttributes),this.drawKeyShape(this.parsedAttributes,this)}animate(t,e){const n=super.animate(this.attributes.collapsed?t:t.map(i=>{var{x:a,y:s,z:o,transform:l}=i,c=i1(i,["x","y","z","transform"]);return c}),e);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}yo.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};class Kk extends yo{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",Ji,this.getKeyStyle(t),e)}getKeyStyle(t){const{collapsed:e}=t,n=super.getKeyStyle(t),[i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},n),e&&Qn(n,"collapsed")),{r:i/2})}getCollapsedKeySize(t){const[e,n]=oi(t.collapsedSize),i=Math.max(e,n)/2;return[i*2,i*2,0]}getExpandedKeySize(t){const e=this.getContentBBox(t),[n,i]=Ba(e),a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2))/2;return[a*2,a*2,0]}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return hu(t,n,e)}}class Qk extends yo{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",pr,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},e),t.collapsed&&Qn(e,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}var qk=function(r,t){if(!cl(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},Jk=qk,$k=function(r,t){return cl(r)?r.indexOf(t)>-1:!1},t3=$k,e3=function(r,t){return t===void 0&&(t=[]),Jk(r,function(e){return!t3(t,e)})},n3=e3;const r3={padding:10};function a1(r,t,e,n,i,a){const{padding:s}=Object.assign(r3,a),o=Fa(e,s),l=Fa(n,s),c=[r,...i,t];let u=null;const h=[];for(let d=0,f=c.length;d<f-1;d++){const v=d+1,g=c[d],p=c[v],y=yN(g,p);let b=null;if(d===0)if(v===f-1)if(o.intersects(l))b=cv(g,p,o,l);else if(!Xc(g,o)&&!Xc(p,l)){const w=Ns(g,o),O=Ns(p,l);b=o1(w,O,Fr(w,O)),b.points.unshift(w),b.points.push(O)}else y||(b=a3(g,p,o,l));else Li(p,o)?b=cv(g,p,o,Fa(p,s),u):y||(b=ku(g,p,o));else v===f-1?Li(g,l)?b=cv(g,p,Fa(g,s),l,u):y||(b=l1(g,p,l,u)):y||(b=o1(g,p,u));b?(h.push(...b.points),u=b.direction):u=Fr(g,p),v<f-1&&h.push(p)}return h.map(Rs)}const i3={N:"S",S:"N",W:"E",E:"W"},s1={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function Fr(r,t){const[e,n]=r,[i,a]=t;return e===i?n>a?"N":"S":n===a?e>i?"W":"E":null}function lv(r,t){return t==="N"||t==="S"?ea(r):ta(r)}function o1(r,t,e){const n=[r[0],t[1]],i=[t[0],r[1]],a=Fr(r,n),s=Fr(r,i),o=e?i3[e]:null,l=a===e||a!==o&&s!==e?n:i;return{points:[l],direction:Fr(l,t)}}function ku(r,t,e){if(Xc(r,e)){const n=Ml(r,t,e);return{points:[n],direction:Fr(n,t)}}else{const n=Ns(r,e),a=["left","right"].includes(fl(r,e))?[t[0],n[1]]:[n[0],t[1]];return{points:[a],direction:Fr(a,t)}}}function l1(r,t,e,n){const i=Xc(t,e)?t:Ns(t,e),a=[[i[0],r[1]],[r[0],i[1]]],s=a.filter(l=>SO(l,e)&&!Pm(l,e,!0)),o=s.filter(l=>Fr(l,r)!==n);if(o.length>0){const l=o.find(c=>Fr(r,c)===n)||o[0];return{points:[l],direction:Fr(l,t)}}else{const l=n3(a,s)[0],c=Wa(t,l,lv(e,n)/2);return{points:[Ml(c,r,e),c],direction:Fr(c,t)}}}function a3(r,t,e,n){let i=ku(r,t,e);const a=pl(i.points[0]);if(Li(a,n)){i=ku(t,r,n);const s=pl(i.points[0]);if(Li(s,e)){const o=Wa(r,a,lv(e,Fr(r,a))/2),l=Wa(t,s,lv(n,Fr(t,s))/2),c=[(o[0]+l[0])/2,(o[1]+l[1])/2],u=ku(r,c,e),h=l1(c,t,n,u.direction);i.points=[u.points[0],h.points[0]],i.direction=h.direction}}return i}function cv(r,t,e,n,i){const s=dl([e,n]),o=bn(t,s.center)>bn(r,s.center),[l,c]=o?[t,r]:[r,t],u=ea(s)+ta(s);let h;if(i){const v=[l[0]+u*Math.cos(s1[i]),l[1]+u*Math.sin(s1[i])];h=Wa(Ns(v,s),v,.01)}else h=Wa(Ns(l,s),l,-.01);let d=Ml(h,c,s),f=[ml(h,2),ml(d,2)];if(Zn(ml(h),ml(d))){const v=Gf(on(h,l),[1,0,0])+Math.PI/2;d=[c[0]+u*Math.cos(v),c[1]+u*Math.sin(v),0],d=ml(Wa(Ns(d,s),c,-.01),2);const g=Ml(h,d,s);f=[h,g,d]}return{points:o?f.reverse():f,direction:Fr(o?h:d,t)}}function Ml(r,t,e){let n=[r[0],t[1]];return Li(n,e)&&(n=[t[0],r[1]]),n}function c1(r,t,e,n,i){let l=typeof t=="number"?t:.5;t==="start"&&(l=0),t==="end"&&(l=.99);const c=yr(r.getPoint(l)),u=yr(r.getPoint(l+.01));let h=t==="start"?"left":t==="end"?"right":"center";if(My(c,u)||!e){const[y,b]=u1(r,l,n,i);return{transform:[["translate",y,b]],textAlign:h}}let d=Math.atan2(u[1]-c[1],u[0]-c[0]);u[0]<c[0]&&(h=h==="center"?h:h==="left"?"right":"left",n*=-1,d+=Math.PI);const[v,g]=u1(r,l,n,i,d),p=[["translate",v,g],["rotate",d/Math.PI*180]];return{textAlign:h,transform:p}}function s3(r,t,e,n,i){var a,s;const o=((a=r.badge)===null||a===void 0?void 0:a.getGeometryBounds().halfExtents[0])*2||0,l=((s=r.label)===null||s===void 0?void 0:s.getGeometryBounds().halfExtents[0])*2||0;return c1(r.key,e,!0,(l?(l/2+o/2)*(t==="suffix"?1:-1):0)+n,i)}function u1(r,t,e,n,i){const[a,s]=yr(r.getPoint(t));let o=e,l=n;return i&&(o=e*Math.cos(i)-n*Math.sin(i),l=e*Math.sin(i)+n*Math.cos(i)),[a+o,s+l]}function uv(r,t,e,n){if(Zn(r,t))return r;const i=on(t,r),a=[r[0]+e*i[0],r[1]+e*i[1]],s=pa(uu(i,!1));return a[0]+=n*s[0],a[1]+=n*s[1],a}function o3(r){return ie(r)?[r,-r]:r}function l3(r){return ie(r)?[r,1-r]:r}function c3(r,t,e){return[["M",r[0],r[1]],["Q",e[0],e[1],t[0],t[1]]]}function h1(r,t,e){return[["M",r[0],r[1]],["C",e[0][0],e[0][1],e[1][0],e[1][1],t[0],t[1]]]}function hv(r,t=0,e=!1){const n=r.length-1,i=r[0],a=r[n],s=r.slice(1,n),o=[["M",i[0],i[1]]];return s.forEach((l,c)=>{const u=s[c-1]||i,h=s[c+1]||a;if(!Ay(u,l,h)&&t){const[d,f]=u3(u,l,h,t);o.push(["L",d[0],d[1]],["Q",l[0],l[1],f[0],f[1]],["L",f[0],f[1]])}else o.push(["L",l[0],l[1]])}),o.push(["L",a[0],a[1]]),e&&o.push(["Z"]),o}function u3(r,t,e,n){const i=cu(r,t),a=cu(e,t),s=Math.min(n,Math.min(i,a)/2),o=[t[0]-s/i*(t[0]-r[0]),t[1]-s/i*(t[1]-r[1])],l=[t[0]-s/a*(t[0]-e[0]),t[1]-s/a*(t[1]-e[1])];return[o,l]}const h3=r=>{const t=Math.PI/2,e=ea(r)/2,n=ta(r)/2,i=Math.atan2(e,n)/2,a=Math.atan2(n,e)/2;return{top:[-t-a,-t+a],"top-right":[-t+a,-i],"right-top":[-t+a,-i],right:[-i,i],"bottom-right":[i,t-a],"right-bottom":[i,t-a],bottom:[t-a,t+a],"bottom-left":[t+a,Math.PI-i],"left-bottom":[t+a,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-t-a],"left-top":[Math.PI+i,-t-a]}};function d1(r,t,e,n,i){const a=Fa(r),s=r.getCenter();let o=n&&Ya(n),l=i&&Ya(i);if(!o||!l){const c=h3(a),u=c[t][0],h=c[t][1],[d,f]=Ba(a),v=Math.max(d,f),g=Ce(s,[v*Math.cos(u),v*Math.sin(u),0]),p=Ce(s,[v*Math.cos(h),v*Math.sin(h),0]);o=pv(r,g),l=pv(r,p),e||([o,l]=[l,o])}return[o,l]}function d3(r,t,e,n,i,a){const s=r.getPorts()[i||a],o=r.getPorts()[a||i];let[l,c]=d1(r,t,e,s,o);const u=f3(r,l,c,n);return s&&(l=Tl(s,u[0])),o&&(c=Tl(o,u.at(-1))),h1(l,c,u)}function f3(r,t,e,n){const i=r.getCenter();if(Zn(t,e)){const a=on(t,i),s=[n*Math.sign(a[0])||n/2,n*Math.sign(a[1])||-n/2,0];return[Ce(t,s),Ce(e,_i(s,[1,-1,1]))]}return[Wa(i,t,bn(i,t)+n),Wa(i,e,bn(i,e)+n)]}function v3(r,t,e,n,i,a,s){const o=gv(r),l=o[a||s],c=o[s||a];let[u,h]=d1(r,e,n,l,c);const d=g3(r,u,h,i);return l&&(u=Tl(l,d[0])),c&&(h=Tl(c,d.at(-1))),hv([u,...d,h],t)}function g3(r,t,e,n){const i=[],a=Fa(r);if(Zn(t,e))switch(fl(t,a)){case"left":i.push([t[0]-n,t[1]]),i.push([t[0]-n,t[1]+n]),i.push([t[0],t[1]+n]);break;case"right":i.push([t[0]+n,t[1]]),i.push([t[0]+n,t[1]+n]),i.push([t[0],t[1]+n]);break;case"top":i.push([t[0],t[1]-n]),i.push([t[0]+n,t[1]-n]),i.push([t[0]+n,t[1]]);break;case"bottom":i.push([t[0],t[1]+n]),i.push([t[0]+n,t[1]+n]),i.push([t[0]+n,t[1]]);break}else{const s=fl(t,a),o=fl(e,a);if(s===o){const l=s;let c,u;switch(l){case"left":c=Math.min(t[0],e[0])-n,i.push([c,t[1]]),i.push([c,e[1]]);break;case"right":c=Math.max(t[0],e[0])+n,i.push([c,t[1]]),i.push([c,e[1]]);break;case"top":u=Math.min(t[1],e[1])-n,i.push([t[0],u]),i.push([e[0],u]);break;case"bottom":u=Math.max(t[1],e[1])+n,i.push([t[0],u]),i.push([e[0],u]);break}}else{const l=(d,f)=>({left:[f[0]-n,f[1]],right:[f[0]+n,f[1]],top:[f[0],f[1]-n],bottom:[f[0],f[1]+n]})[d],c=l(s,t),u=l(o,e),h=Ml(c,u,a);i.push(c,h,u)}}return i}function dv(r,t){const e=new Set,n=new Set,i=new Set;return r.forEach(a=>{t(a).forEach(o=>{e.add(o),r.includes(o.source)&&r.includes(o.target)?n.add(o):i.add(o)})}),{edges:Array.from(e),internal:Array.from(n),external:Array.from(i)}}function f1(r,t){const e=[];let n=r;for(;n;){e.push(n);const i=t(At(n));if(i)n=i;else break}if(e.some(i=>{var a;return(a=i.style)===null||a===void 0?void 0:a.collapsed})){const i=e.reverse().findIndex(Qr);return e[i]||e.at(-1)}return r}function p3(r,t){return t||(r<4?10:r===4?12:r*2.5)}const m3=(r,t)=>{const e=Math.max(r,t)/2;return[["M",-r/2,0],["A",e,e,0,1,0,2*e-r/2,0],["A",e,e,0,1,0,-r/2,0],["Z"]]},v1=(r,t)=>[["M",-r/2,0],["L",r/2,-t/2],["L",r/2,t/2],["Z"]],y3=(r,t)=>[["M",-r/2,0],["L",0,-t/2],["L",r/2,0],["L",0,t/2],["Z"]],b3=(r,t)=>[["M",-r/2,0],["L",r/2,-t/2],["L",4*r/5-r/2,0],["L",r/2,t/2],["Z"]],x3=(r,t)=>[["M",-r/2,-t/2],["L",r/2,-t/2],["L",r/2,t/2],["L",-r/2,t/2],["Z"]],E3=(r,t)=>{const e=r/2,n=r/7,i=r-n;return[["M",-e,0],["L",0,-t/2],["L",0,t/2],["Z"],["M",i-e,-t/2],["L",i+n-e,-t/2],["L",i+n-e,t/2],["L",i-e,t/2],["Z"]]},w3=(r,t)=>[["M",r/2,-t/2],["L",-r/2,0],["L",r/2,0],["L",-r/2,0],["L",r/2,t/2]];var Pu=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Ua extends Vy{constructor(t){super(hr({style:Ua.defaultStyleProps},t)),this.type="edge"}get sourceNode(){const{sourceNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}get targetNode(){const{targetNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}getKeyStyle(t){const e=this.getGraphicStyle(t),{loop:n}=e,i=Pu(e,["loop"]),{sourceNode:a,targetNode:s}=this,l={d:n&&R3(a,s)?this.getLoopPath(t):this.getKeyPath(t)};return ri.PARSED_STYLE_LIST.forEach(c=>{c in i&&(l[c]=i[c])}),l}getLoopPath(t){const{sourcePort:e,targetPort:n}=t,i=this.sourceNode,a=Fa(i),s=Math.max(ta(a),ea(a)),{placement:o,clockwise:l,dist:c=s}=Qn(this.getGraphicStyle(t),"loop");return d3(i,o,l,c,e,n)}getEndpoints(t,e=!0,n=[]){const{sourcePort:i,targetPort:a}=t,{sourceNode:s,targetNode:o}=this,[l,c]=D3(s,o,i,a);if(!e){const f=l?Ya(l):s.getCenter(),v=c?Ya(c):o.getCenter();return[f,v]}const u=typeof n=="function"?n():n,h=w1(l||s,u[0]||c||o),d=w1(c||o,u[u.length-1]||l||s);return[h,d]}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),n=Qn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),n)}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Qn(this.getGraphicStyle(t),"label"),{placement:n,offsetX:i,offsetY:a,autoRotate:s,maxWidth:o}=e,l=Pu(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),c=c1(this.shapeMap.key,n,s,i,a),u=this.shapeMap.key.getLocalBounds(),h=RN([u.min,u.max],o);return Object.assign({wordWrapWidth:h},c,l)}getBadgeStyle(t){if(t.badge===!1||!t.badgeText)return!1;const e=Qn(t,"badge"),{offsetX:n,offsetY:i,placement:a}=e,s=Pu(e,["offsetX","offsetY","placement"]);return Object.assign(s,s3(this.shapeMap,a,t.labelPlacement,n,i))}drawArrow(t,e){var n;const i=e==="start",s=t[e==="start"?"startArrow":"endArrow"],o=this.shapeMap.key;if(s){const l=this.getArrowStyle(t,i),[c,u,h]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],d=o.parsedStyle[c];if(d)d.attr(l);else{const f=l.src?sl:ri,v=new f({style:l});o.style[c]=v}o.style[u]=t[h]||l.width/2+ +l.lineWidth}else{const l=i?"markerStart":"markerEnd";(n=o.style[l])===null||n===void 0||n.destroy(),o.style[l]=null}}getArrowStyle(t,e){const n=this.getShape("key").attributes,i=e?"startArrow":"endArrow",a=Qn(this.getGraphicStyle(t),i),{size:s,type:o}=a,l=Pu(a,["size","type"]),[c,u]=oi(p3(n.lineWidth,s)),d=(fe(o)?o:z[o]||v1)(c,u);return Object.assign(Bs(n,["stroke","strokeOpacity","fillOpacity"]),{width:c,height:u},Object.assign({},d&&{d,fill:o==="simple"?"":n.stroke}),l)}drawLabelShape(t,e){const n=this.getLabelStyle(t);this.upsert("label",Ga,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);this.upsert("halo",ri,n,e)}drawBadgeShape(t,e){const n=this.getBadgeStyle(t);this.upsert("badge",po,n,e)}drawSourceArrow(t){this.drawArrow(t,"start")}drawTargetArrow(t){this.drawArrow(t,"end")}drawKeyShape(t,e){const n=this.getKeyStyle(t);return this.upsert("key",ri,n,e)}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.getShape("key")&&(this.drawSourceArrow(t),this.drawTargetArrow(t),this.drawLabelShape(t,e),this.drawHaloShape(t,e),this.drawBadgeShape(t,e))}onframe(){this.drawKeyShape(this.parsedAttributes,this),this.drawSourceArrow(this.parsedAttributes),this.drawTargetArrow(this.parsedAttributes),this.drawHaloShape(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this),this.drawBadgeShape(this.parsedAttributes,this)}animate(t,e){const n=super.animate(t,e);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}Ua.defaultStyleProps={badge:!0,badgeOffsetX:0,badgeOffsetY:0,badgePlacement:"suffix",isBillboard:!0,label:!0,labelAutoRotate:!0,labelIsBillboard:!0,labelMaxWidth:"80%",labelOffsetX:4,labelOffsetY:0,labelPlacement:"center",labelTextBaseline:"middle",labelWordWrap:!1,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloPointerEvents:"none",haloStrokeOpacity:.25,haloZIndex:-1,loop:!0,startArrow:!1,startArrowLineDash:0,startArrowLineJoin:"round",startArrowLineWidth:1,startArrowTransformOrigin:"center",startArrowType:"vee",endArrow:!1,endArrowLineDash:0,endArrowLineJoin:"round",endArrowLineWidth:1,endArrowTransformOrigin:"center",endArrowType:"vee",loopPlacement:"top",loopClockwise:!0};class Fs extends Ua{constructor(t){super(hr({style:Fs.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t),{controlPoints:i,curvePosition:a,curveOffset:s}=t,o=this.getControlPoints(e,n,l3(a),o3(s),i);return h1(e,n,o)}getControlPoints(t,e,n,i,a){return(a==null?void 0:a.length)===2?a:[uv(t,e,n[0],i[0]),uv(t,e,n[1],i[1])]}}Fs.defaultStyleProps={curvePosition:.5,curveOffset:20};class Ru extends Fs{constructor(t){super(hr({style:Ru.defaultStyleProps},t))}getControlPoints(t,e,n,i){const a=e[0]-t[0];return[[t[0]+a*n[0]+i[0],t[1]],[e[0]-a*n[1]+i[1],e[1]]]}}Ru.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Lu extends Fs{constructor(t){super(hr({style:Lu.defaultStyleProps},t))}get ref(){return this.context.model.getRootsData()[0]}getEndpoints(t){if(this.sourceNode.id===this.ref.id)return super.getEndpoints(t);const e=ar(this.ref),n=this.sourceNode.getIntersectPoint(e,!0),i=this.targetNode.getIntersectPoint(e);return[n,i]}toRadialCoordinate(t){const e=ar(this.ref),n=bn(t,e),i=xy(on(t,e));return[n,i]}getControlPoints(t,e,n,i){const[a,s]=this.toRadialCoordinate(t),[o]=this.toRadialCoordinate(e),l=o-a;return[[t[0]+(l*n[0]+i[0])*Math.cos(s),t[1]+(l*n[0]+i[0])*Math.sin(s)],[e[0]-(l*n[1]-i[0])*Math.cos(s),e[1]-(l*n[1]-i[0])*Math.sin(s)]]}}Lu.defaultStyleProps={curvePosition:.5,curveOffset:20};class Du extends Fs{constructor(t){super(hr({style:Du.defaultStyleProps},t))}getControlPoints(t,e,n,i){const a=e[1]-t[1];return[[t[0],t[1]+a*n[0]+i[0]],[e[0],e[1]-a*n[1]+i[1]]]}}Du.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class _u extends Ua{constructor(t){super(hr({style:_u.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",n[0],n[1]]]}}_u.defaultStyleProps={};const S3={enableObstacleAvoidance:!1,offset:10,maxAllowedDirectionChange:Math.PI/2,maximumLoops:3e3,gridSize:5,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{right:{stepX:1,stepY:0},left:{stepX:-1,stepY:0},bottom:{stepX:0,stepY:1},top:{stepX:0,stepY:-1}},penalties:{0:0,90:0},distFunc:cu},ba=r=>`${Math.round(r[0])}|||${Math.round(r[1])}`;function zs(r,t){const e=n=>Math.round(n/t);return ie(r)?e(r):r.map(e)}function M3(r,t){const e=Math.abs(r-t);return e>Math.PI?2*Math.PI-e:e}function g1(r,t){const e=t[0]-r[0],n=t[1]-r[1];return!e&&!n?0:Math.atan2(n,e)}function p1(r,t,e,n){const i=g1(r,t),a=e[ba(r)],o=g1(a||n,r);return M3(o,i)}const A3=(r,t)=>{const{offset:e,gridSize:n}=t,i={};return r.forEach(a=>{if(!a||a.destroyed||!a.isVisible())return;const s=za(a.getRenderBounds(),e);for(let o=zs(s.min[0],n);o<=zs(s.max[0],n);o+=1)for(let l=zs(s.min[1],n);l<=zs(s.max[1],n);l+=1)i[`${o}|||${l}`]=!0}),i};function m1(r,t,e){return Math.min(...t.map(n=>e(r,n)))}function T3(r,t,e){let n=r[0],i=e(r[0],t);for(let a=0;a<r.length;a++){const s=r[a],o=e(s,t);o<i&&(n=s,i=o)}return n}const y1=(r,t,e,n)=>{if(!t)return[r];const{directionMap:i,offset:a}=n,s=za(t.getRenderBounds(),a),o=Object.keys(i).reduce((l,c)=>{if(e.includes(c)){const u=i[c],[h,d]=Ba(s),f=[r[0]+u.stepX*h,r[1]+u.stepY*d],v=TO(s);for(let g=0;g<v.length;g++){const p=Uf([r,f],v[g]);p&&Pm(p,s)&&l.push(p)}}return l},[]);return Li(r,s)||o.push(r),o.map(l=>zs(l,n.gridSize))},O3=(r,t,e,n,i,a,s)=>{const o=[];let l=[a[0]===n[0]?n[0]:r[0]*s,a[1]===n[1]?n[1]:r[1]*s];o.unshift(l);let c=r,u=t[ba(c)];for(;u;){const f=u,v=c;p1(f,v,t,e)&&(l=[f[0]===v[0]?l[0]:f[0]*s,f[1]===v[1]?l[1]:f[1]*s],o.unshift(l)),u=t[ba(f)],c=f}const h=i.map(f=>[f[0]*s,f[1]*s]),d=T3(h,l,cu);return o.unshift(d),o};function C3(r,t,e,n){const i=Rs(r.getCenter()),a=Rs(t.getCenter()),s=Object.assign(S3,n),{gridSize:o}=s,l=s.enableObstacleAvoidance?e:[r,t],c=A3(l,s),u=zs(i,o),h=zs(a,o),d=y1(i,r,s.startDirections,s),f=y1(a,t,s.endDirections,s);d.forEach(j=>delete c[ba(j)]),f.forEach(j=>delete c[ba(j)]);const v={},g={},p={},y={},b={},w=new N3;for(let j=0;j<d.length;j++){const H=d[j],K=ba(H);v[K]=H,y[K]=0,b[K]=m1(H,f,s.distFunc),w.add({id:K,value:b[K]})}const O=f.map(j=>ba(j));let _=s.maximumLoops,F,W=1/0;for(const[j,H]of Object.entries(v))b[j]<=W&&(W=b[j],F=H);for(;Object.keys(v).length>0&&_>0;){const j=w.minId(!1);if(j)F=v[j];else break;const H=ba(F);if(O.includes(H))return O3(F,p,u,a,d,h,o);delete v[H],w.remove(H),g[H]=!0;for(const K of Object.values(s.directionMap)){const et=Ce(F,[K.stepX,K.stepY]),rt=ba(et);if(g[rt])continue;const lt=p1(F,et,p,u);if(lt>s.maxAllowedDirectionChange||c[rt])continue;v[rt]||(v[rt]=et);const ht=s.penalties[lt],yt=s.distFunc(F,et)+(isNaN(ht)?o:ht),Nt=y[H]+yt,Ct=y[rt];Ct&&Nt>=Ct||(p[rt]=F,y[rt]=Nt,b[rt]=Nt+m1(et,f,s.distFunc),w.add({id:rt,value:b[rt]}))}_-=1}return[]}class N3{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let n=0,i=e-1;for(;i-n>1;){const a=Math.floor((n+i)/2);if(this.arr[a].value>t.value)i=a;else if(this.arr[a].value<t.value)n=a;else{this.arr.splice(a,0,t),this.map[t.id]=!0;return}}this.arr.splice(i,0,t),this.map[t.id]=!0}add(t){delete this.map[t.id];const e=this.arr.length;if(!e||this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)}remove(t){this.map[t]&&delete this.map[t]}_clearAndGetMinId(){let t;for(let e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t}_findFirstId(){for(;this.arr.length;){const t=this.arr.shift();if(this.map[t.id])return t.id}}minId(t){return t?this._clearAndGetMinId():this._findFirstId()}}class Iu extends Ua{constructor(t){super(hr({style:Iu.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:n,targetNode:i}=this,[a,s]=this.getEndpoints(t,!1);let o=[];if(!e)o=t.controlPoints;else if(e.type==="shortest-path"){const l=this.context.element.getNodes();o=C3(n,i,l,e),o.length||(o=a1(a,s,n,i,t.controlPoints,{padding:e.offset}))}else e.type==="orth"&&(o=a1(a,s,n,i,t.controlPoints,e));return o}getPoints(t){const e=this.getControlPoints(t),[n,i]=this.getEndpoints(t,!0,e);return[n,...e,i]}getKeyPath(t){const e=this.getPoints(t);return hv(e,t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:n,radius:i}=t,a=this.sourceNode,s=Fa(a),o=Math.max(ta(s),ea(s))/4,{placement:l,clockwise:c,dist:u=o}=Qn(this.getGraphicStyle(t),"loop");return v3(a,i,l,c,u,e,n)}}Iu.defaultStyleProps={radius:0,controlPoints:[],router:!1};class Bu extends Ua{constructor(t){super(hr({style:Bu.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:n}=t,[i,a]=this.getEndpoints(t),s=t.controlPoint||uv(i,a,e,n);return c3(i,a,s)}}Bu.defaultStyleProps={curvePosition:.5,curveOffset:30};var k3=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function Al(r){return r instanceof Fi&&r.type==="node"}function b1(r){return r instanceof Ua}function fv(r){return r instanceof yo}function P3(r){return Al(r)||b1(r)||fv(r)}function R3(r,t){return!r||!t?!1:r===t}const L3={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],"left-top":[0,0],"top-left":[0,0],"left-bottom":[0,1],"bottom-left":[0,1],"right-top":[1,0],"top-right":[1,0],"right-bottom":[1,1],"bottom-right":[1,1],default:[.5,.5]};function vv(r,t,e=L3,n=!0){const i=[.5,.5],a=Ve(t)?br(e,t.toLocaleLowerCase(),i):t;if(!n&&Ve(t))return a;const[s,o]=a||i;return[r.min[0]+ta(r)*s,r.min[1]+ea(r)*o]}function gv(r){if(!r)return{};const t=r.getPorts();return(r.attributes.ports||[]).forEach((n,i)=>{var a;const{key:s,placement:o}=n;x1(n)&&(t[a=s||i]||(t[a]=ma(r.getShape("key").getBounds(),o)))}),t}function x1(r){const{r:t}=r;return!t||Number(t)===0}function Ya(r){return fo(r)?r:r.getPosition()}function D3(r,t,e,n){const i=E1(r,t,e,n),a=E1(t,r,n,e);return[i,a]}function E1(r,t,e,n){const i=gv(r);if(e)return i[e];const a=Object.values(i);if(a.length===0)return;const s=a.map(c=>Ya(c)),o=_3(t,n),[l]=EN(s,o);return a.find(c=>Ya(c)===l)}function _3(r,t){const e=gv(r);if(t)return[Ya(e[t])];const n=Object.values(e);return n.length>0?n.map(i=>Ya(i)):[r.getCenter()]}function w1(r,t){return fv(r)||Al(r)?pv(r,t):Tl(r,t)}function Tl(r,t){if(!r||!t)return[0,0,0];if(fo(r))return r;if(r.attributes.linkToCenter)return r.getPosition();const e=fo(t)?t:Al(t)?t.getCenter():t.getPosition();return hu(e,r.getBounds())}function pv(r,t){if(!r||!t)return[0,0,0];const e=fo(t)?t:Al(t)?t.getCenter():t.getPosition();return r.getIntersectPoint(e)||r.getCenter()}function S1(r,t="bottom",e=0,n=0,i=!1){const a=t.split("-"),[s,o]=ma(r,t),[l,c]=i?["bottom","top"]:["top","bottom"],u=a.includes("top")?c:a.includes("bottom")?l:"middle",h=a.includes("left")?"right":a.includes("right")?"left":"center";return{transform:[["translate",s+e,o+n]],textBaseline:u,textAlign:h}}function I3(r,t){return[[0,-r],[t*Math.cos(3*Math.PI/10),-t*Math.sin(3*Math.PI/10)],[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[t*Math.cos(Math.PI/10),t*Math.sin(Math.PI/10)],[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[0,t],[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[-t*Math.cos(Math.PI/10),t*Math.sin(Math.PI/10)],[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[-t*Math.cos(3*Math.PI/10),-t*Math.sin(3*Math.PI/10)]]}function B3(r,t){const e={};return e.top=[0,-r],e.left=[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],e["left-bottom"]=[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],e.bottom=[0,t],e["right-bottom"]=[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],e.right=e.default=[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],e}function F3(r,t,e){const n=t/2,i=r/2,a={up:[[-i,n],[i,n],[0,-n]],left:[[-i,0],[i,n],[i,-n]],right:[[-i,n],[-i,-n],[i,0]],down:[[-i,-n],[i,-n],[0,n]]};return a[e]||a.up}function z3(r,t,e){const n=t/2,i=r/2,a={};return e==="down"?(a.bottom=a.default=[0,n],a.right=[i,-n],a.left=[-i,-n]):e==="left"?(a.top=[i,-n],a.bottom=[i,n],a.left=a.default=[-i,0]):e==="right"?(a.top=[-i,-n],a.bottom=[-i,n],a.right=a.default=[i,0]):(a.left=[-i,n],a.top=a.default=[0,-n],a.right=[i,n]),a}function n7(r,t){return[[r/2,-t/2],[r/2,t/2],[-r/2,t/2],[-r/2,-t/2]]}function j3(r,t){return[[0,-t/2],[r/2,0],[0,t/2],[-r/2,0]]}function M1(r){return br(r,["style","visibility"])!=="hidden"}function Z3(r,t){const{zIndex:e,transform:n,transformOrigin:i,visibility:a,cursor:s,clipPath:o,component:l}=t,c=k3(t,["zIndex","transform","transformOrigin","visibility","cursor","clipPath","component"]);Object.assign(r.attributes,c),n&&r.setAttribute("transform",n),ie(e)&&r.setAttribute("zIndex",e),i&&r.setAttribute("transformOrigin",i),a&&r.setAttribute("visibility",a),s&&r.setAttribute("cursor",s),o&&r.setAttribute("clipPath",o),l&&r.setAttribute("component",l)}function mv(r,t){"update"in r?r.update(t):r.attr(t)}function W3(r){return[[0,r],[r*Math.sqrt(3)/2,r/2],[r*Math.sqrt(3)/2,-r/2],[0,-r],[-r*Math.sqrt(3)/2,-r/2],[-r*Math.sqrt(3)/2,r/2]]}function G3(r){bl(r,"__to_be_destroyed__",!0)}function Ol(r){return br(r,"__to_be_destroyed__",!1)}var V3=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Fu extends si{constructor(t,e){super(t,Object.assign({},Fu.defaultOptions,e)),this.onCollapseExpand=n=>V3(this,void 0,void 0,function*(){if(!this.validate(n))return;const{target:i}=n;if(!P3(i))return;const a=i.id,{model:s,graph:o}=this.context,l=s.getElementDataById(a);if(!l)return!1;const{onCollapse:c,onExpand:u,animation:h,align:d}=this.options;Qr(l)?(yield o.expandElement(a,{animation:h,align:d}),u==null||u(a)):(yield o.collapseElement(a,{animation:h,align:d}),c==null||c(a))}),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`node:${e}`,this.onCollapseExpand),t.on(`combo:${e}`,this.onCollapseExpand)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`node:${e}`,this.onCollapseExpand),t.off(`combo:${e}`,this.onCollapseExpand)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Fu.defaultOptions={enable:!0,animation:!0,trigger:Bt.DBLCLICK,align:!0};var zu={},U3=function(r){return r=r||"g",zu[r]?zu[r]+=1:zu[r]=1,r+zu[r]},ju=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};const Y3="g6-create-edge-assist-edge-id",Zu="g6-create-edge-assist-node-id";class Wu extends si{constructor(t,e){super(t,Object.assign({},Wu.defaultOptions,e)),this.drop=n=>ju(this,void 0,void 0,function*(){const{targetType:i}=n;["combo","node"].includes(i)&&this.source?yield this.handleCreateEdge(n):yield this.cancelEdge()}),this.handleCreateEdge=n=>ju(this,void 0,void 0,function*(){var i,a,s;if(!this.validate(n))return;const{graph:o,canvas:l,batch:c,element:u}=this.context,{style:h}=this.options;if(this.source){this.createEdge(n),yield this.cancelEdge();return}c.startBatch(),l.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([n.target.id])[0];const d=o.getElementData(this.source);o.addNodeData([{id:Zu,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:(i=d.style)===null||i===void 0?void 0:i.x,y:(a=d.style)===null||a===void 0?void 0:a.y}}]),o.addEdgeData([{id:Y3,source:this.source,target:Zu,style:Object.assign({pointerEvents:"none"},h)}]),yield(s=u.draw({animation:!1}))===null||s===void 0?void 0:s.finished}),this.updateAssistEdge=n=>ju(this,void 0,void 0,function*(){var i;if(!this.source)return;const{model:a,element:s}=this.context;a.translateNodeTo(Zu,[n.canvas.x,n.canvas.y]),yield(i=s.draw({animation:!1,silence:!0}))===null||i===void 0?void 0:i.finished}),this.createEdge=n=>{var i,a;const{graph:s}=this.context,{style:o,onFinish:l,onCreate:c}=this.options;if(((i=n.target)===null||i===void 0?void 0:i.id)===void 0||this.source===void 0)return;const h=(a=this.getSelectedNodeIDs([n.target.id]))===null||a===void 0?void 0:a[0],d=`${this.source}-${h}-${U3()}`,f=c({id:d,source:this.source,target:h,style:o});f&&(s.addEdgeData([f]),l(f))},this.cancelEdge=()=>ju(this,void 0,void 0,function*(){var n;if(!this.source)return;const{graph:i,element:a,batch:s}=this.context;i.removeNodeData([Zu]),this.source=void 0,yield(n=a.draw({animation:!1}))===null||n===void 0?void 0:n.finished,s.endBatch()}),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;this.unbindEvents(),e==="click"?(t.on(bi.CLICK,this.handleCreateEdge),t.on(Cs.CLICK,this.handleCreateEdge),t.on(fa.CLICK,this.cancelEdge),t.on(Yc.CLICK,this.cancelEdge)):(t.on(bi.DRAG_START,this.handleCreateEdge),t.on(Cs.DRAG_START,this.handleCreateEdge),t.on(Bt.POINTER_UP,this.drop)),t.on(Bt.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;t.off(bi.CLICK,this.handleCreateEdge),t.off(Cs.CLICK,this.handleCreateEdge),t.off(fa.CLICK,this.cancelEdge),t.off(Yc.CLICK,this.cancelEdge),t.off(bi.DRAG_START,this.handleCreateEdge),t.off(Cs.DRAG_START,this.handleCreateEdge),t.off(Bt.POINTER_UP,this.drop),t.off(Bt.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}Wu.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:r=>r,onFinish:()=>{}};function H3(r,t,e){var n;return function(){var i=this,a=arguments,s=function(){n=null,e||r.apply(i,a)},o=e&&!n;clearTimeout(n),n=setTimeout(s,t),o&&r.apply(i,a)}}var Cl=H3,A1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Gu extends si{constructor(t,e){super(t,Object.assign({},Gu.defaultOptions,e)),this.isDragging=!1,this.onDragStart=n=>{this.validate(n)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=n=>{var i,a,s,o;if(!this.isDragging||Wn.isPinching)return;const l=(a=(i=n.movement)===null||i===void 0?void 0:i.x)!==null&&a!==void 0?a:n.dx,c=(o=(s=n.movement)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:n.dy;l|c&&this.translate([l,c],!1)},this.onDragEnd=()=>{var n,i;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},this.invokeOnFinish=Cl(()=>{var n,i;(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},300),this.shortcut=new go(t.graph),this.bindEvents(),this.defaultCursor=this.context.canvas.getConfig().cursor||"default"}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(Fn(t)){const{up:e=[],down:n=[],left:i=[],right:a=[]}=t;this.shortcut.bind(e,s=>this.onTranslate([0,1],s)),this.shortcut.bind(n,s=>this.onTranslate([0,-1],s)),this.shortcut.bind(i,s=>this.onTranslate([1,0],s)),this.shortcut.bind(a,s=>this.onTranslate([-1,0],s))}else{const{graph:e}=this.context;e.on(Bt.DRAG_START,this.onDragStart),e.on(Bt.DRAG,this.onDrag),e.on(Bt.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return A1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{sensitivity:n}=this.options,i=n*-1;yield this.translate(_i(t,i),this.options.animation),this.invokeOnFinish()})}translate(t,e){return A1(this,void 0,void 0,function*(){t=this.clampByDirection(t),t=this.clampByRange(t),t=this.clampByRotation(t),yield this.context.graph.translateBy(t,e)})}clampByRotation([t,e]){const n=this.context.graph.getRotation();if(n%360===0)return[t,e];const i=n*Math.PI/180,a=Math.cos(i),s=Math.sin(i);return[t*a-e*s,t*s+e*a]}clampByDirection([t,e]){const{direction:n}=this.options;return n==="x"?e=0:n==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,c,u]=Ri(this.options.range),h=[s*o,a*l,s*c,a*u],d=za(Nf(n.getCanvasCenter()),h),f=on(n.getViewportCenter(),[t,e,0]);if(!Li(f,d)){const{min:[v,g],max:[p,y]}=d;(f[0]<v&&t>0||f[0]>p&&t<0)&&(t=0),(f[1]<g&&e>0||f[1]>y&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return typeof e=="function"?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(Bt.DRAG_START,this.onDragStart),t.off(Bt.DRAG,this.onDrag),t.off(Bt.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Gu.defaultOptions={enable:r=>"targetType"in r?r.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};var T1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Nl extends si{constructor(t,e){super(t,Object.assign({},Nl.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=n=>T1(this,void 0,void 0,function*(){var i;if(this.options.dropEffect!=="link")return;const{model:a,element:s}=this.context,o=n.target.id;this.target.forEach(l=>{const c=a.getParentData(l,hn);c&&At(c)===o&&a.refreshComboData(o),a.setParent(l,o,hn)}),yield(i=s==null?void 0:s.draw({animation:!0}))===null||i===void 0?void 0:i.finished}),this.setCursor=n=>{if(this.isDragging)return;const{type:i}=n,{canvas:a}=this.context,{cursor:s}=this.options;i===Bt.POINTER_ENTER?a.setCursor((s==null?void 0:s.grab)||"grab"):a.setCursor((s==null?void 0:s.default)||"default")},this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onDrop=this.onDrop.bind(this),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t,canvas:e}=this.context,n=e.getLayer().getContextService().$canvas;n&&(n.addEventListener("blur",this.onDragEnd),n.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{t.on(`${i}:${Bt.DRAG_START}`,this.onDragStart),t.on(`${i}:${Bt.DRAG}`,this.onDrag),t.on(`${i}:${Bt.DRAG_END}`,this.onDragEnd),t.on(`${i}:${Bt.POINTER_ENTER}`,this.setCursor),t.on(`${i}:${Bt.POINTER_LEAVE}`,this.setCursor)}),["link"].includes(this.options.dropEffect)&&(t.on(Cs.DROP,this.onDrop),t.on(fa.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return Ii([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:n,canvas:i,graph:a}=this.context;i.setCursor(((e=this.options.cursor)===null||e===void 0?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch();const s=t.target.id;a.getElementState(s).includes(this.options.state)?this.target=this.getSelectedNodeIDs([s]):this.target=[s],this.hideEdge(),this.context.graph.frontElement(this.target),this.options.shadow&&this.createShadow(this.target)}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.options.shadow?this.moveShadow(e):this.moveElement(this.target,e)}onDragEnd(){var t,e,n;if(!this.enable)return;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:s=0,y:o=0}=this.shadow.attributes,[l,c]=on([+s,+o],this.shadowOrigin);this.moveElement(this.target,[l,c])}this.showEdges(),(e=(t=this.options).onFinish)===null||e===void 0||e.call(t,this.target);const{batch:i,canvas:a}=this.context;i.endBatch(),a.setCursor(((n=this.options.cursor)===null||n===void 0?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed||Ol(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}moveElement(t,e){return T1(this,void 0,void 0,function*(){const{graph:n,model:i}=this.context,{dropEffect:a}=this.options;a==="move"&&t.forEach(s=>i.refreshComboData(s)),n.translateElementBy(Object.fromEntries(t.map(s=>[s,e])),!1)})}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:n=0}=this.shadow.attributes,[i,a]=t;this.shadow.attr({x:+e+i,y:+n+a})}createShadow(t){const e=Qn(this.options,"shadow"),n=dl(t.map(c=>this.context.element.getElement(c).getBounds())),[i,a]=n.min;this.shadowOrigin=[i,a];const[s,o]=Ba(n),l={width:s,height:o,x:i,y:a};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),l),{visibility:"visible"})):(this.shadow=new pr({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),l),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||this.hiddenEdges.length===0||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if(t==="none"||e)return;const{graph:n}=this.context;t==="all"?this.hiddenEdges=n.getEdgeData().map(At):this.hiddenEdges=Array.from(new Set(this.target.map(i=>n.getRelatedEdgesData(i,t).map(At)).flat())),n.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:t,canvas:e}=this.context,n=e.getLayer().getContextService().$canvas;n&&(n.removeEventListener("blur",this.onDragEnd),n.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{t.off(`${i}:${Bt.DRAG_START}`,this.onDragStart),t.off(`${i}:${Bt.DRAG}`,this.onDrag),t.off(`${i}:${Bt.DRAG_END}`,this.onDragEnd),t.off(`${i}:${Bt.POINTER_ENTER}`,this.setCursor),t.off(`${i}:${Bt.POINTER_LEAVE}`,this.setCursor)}),t.off(`combo:${Bt.DROP}`,this.onDrop),t.off(`canvas:${Bt.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),(t=this.shadow)===null||t===void 0||t.destroy(),super.destroy()}}Nl.defaultOptions={animation:!0,enable:r=>["node","combo"].includes(r.targetType),dropEffect:"move",state:"selected",hideEdge:"none",shadow:!1,shadowZIndex:100,shadowFill:"#F3F9FF",shadowFillOpacity:.5,shadowStroke:"#1890FF",shadowStrokeOpacity:.9,shadowLineDash:[5,5],cursor:{default:"default",grab:"grab",grabbing:"grabbing"}};var X3="*",K3=function(){function r(){this._events={}}return r.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},r.prototype.once=function(t,e){return this.on(t,e,!0)},r.prototype.emit=function(t){for(var e=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[t]||[],s=this._events[X3]||[],o=function(l){for(var c=l.length,u=0;u<c;u++)if(l[u]){var h=l[u],d=h.callback,f=h.once;f&&(l.splice(u,1),l.length===0&&delete e._events[t],c--,u--),d.apply(e,n)}};o(a),o(s)},r.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var n=this._events[t]||[],i=n.length,a=0;a<i;a++)n[a].callback===e&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[t]}return this},r.prototype.getEvents=function(){return this._events},r}(),Vu=K3;function yv(r,t,e,n){for(;r.length;){const i=r.shift();if(e(i))return!0;t.add(i.id),n(i.id).forEach(s=>{t.has(s.id)||(t.add(s.id),r.push(s))})}return!1}function Uu(r,t,e,n){if(e(r))return!0;t.add(r.id);for(const a of n(r.id))if(!t.has(a.id)&&Uu(a,t,e,n))return!0;return!1}const O1=()=>!0;class Q3{constructor(t){Cn(this,"graph");Cn(this,"nodeFilter");Cn(this,"edgeFilter");Cn(this,"cacheEnabled");Cn(this,"inEdgesMap",new Map);Cn(this,"outEdgesMap",new Map);Cn(this,"bothEdgesMap",new Map);Cn(this,"allNodesMap",new Map);Cn(this,"allEdgesMap",new Map);Cn(this,"clearCache",()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()});Cn(this,"refreshCache",()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(t=>t.id))});Cn(this,"updateCache",t=>{const e=new Set;t.forEach(n=>{const i=this.bothEdgesMap.get(n);if(i&&i.forEach(a=>e.add(a.id)),!this.hasNode(n))this.inEdgesMap.delete(n),this.outEdgesMap.delete(n),this.bothEdgesMap.delete(n),this.allNodesMap.delete(n);else{const a=this.graph.getRelatedEdges(n,"in").filter(this.edgeFilter),s=this.graph.getRelatedEdges(n,"out").filter(this.edgeFilter),o=Array.from(new Set([...a,...s]));o.forEach(l=>e.add(l.id)),this.inEdgesMap.set(n,a),this.outEdgesMap.set(n,s),this.bothEdgesMap.set(n,o),this.allNodesMap.set(n,this.graph.getNode(n))}}),e.forEach(n=>{this.hasEdge(n)?this.allEdgesMap.set(n,this.graph.getEdge(n)):this.allEdgesMap.delete(n)})});Cn(this,"handleGraphChanged",t=>{const e=new Set;t.changes.forEach(n=>{switch(n.type){case"NodeAdded":e.add(n.value.id);break;case"NodeDataUpdated":e.add(n.id);break;case"EdgeAdded":e.add(n.value.source),e.add(n.value.target);break;case"EdgeUpdated":(n.propertyName==="source"||n.propertyName==="target")&&(e.add(n.oldValue),e.add(n.newValue));break;case"EdgeDataUpdated":if(t.graph.hasEdge(n.id)){const i=t.graph.getEdge(n.id);e.add(i.source),e.add(i.target)}break;case"EdgeRemoved":e.add(n.value.source),e.add(n.value.target);break;case"NodeRemoved":e.add(n.value.id);break;default:break}}),this.updateCache(e)});this.graph=t.graph;const e=t.nodeFilter||O1,n=t.edgeFilter||O1;this.nodeFilter=e,this.edgeFilter=i=>{const{source:a,target:s}=this.graph.getEdgeDetail(i.id);return!e(a)||!e(s)?!1:n(i,a,s)},t.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):t.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}checkNodeExistence(t){this.getNode(t)}hasNode(t){if(!this.graph.hasNode(t))return!1;const e=this.graph.getNode(t);return this.nodeFilter(e)}areNeighbors(t,e){return this.checkNodeExistence(t),this.getNeighbors(e).some(n=>n.id===t)}getNode(t){const e=this.graph.getNode(t);if(!this.nodeFilter(e))throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){return this.checkNodeExistence(t),this.cacheEnabled?e==="in"?this.inEdgesMap.get(t):e==="out"?this.outEdgesMap.get(t):this.bothEdgesMap.get(t):this.graph.getRelatedEdges(t,e).filter(this.edgeFilter)}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const n=this.getRelatedEdges(t,"out").map(i=>this.getNode(i.target));return Array.from(new Set(n))}getPredecessors(t){const n=this.getRelatedEdges(t,"in").map(i=>this.getNode(i.source));return Array.from(new Set(n))}getNeighbors(t){const e=this.getPredecessors(t),n=this.getSuccessors(t);return Array.from(new Set([...e,...n]))}hasEdge(t){if(!this.graph.hasEdge(t))return!1;const e=this.graph.getEdge(t);return this.edgeFilter(e)}getEdge(t){const e=this.graph.getEdge(t);if(!this.edgeFilter(e))throw new Error("Edge not found for id: "+t);return e}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}hasTreeStructure(t){return this.graph.hasTreeStructure(t)}getRoots(t){return this.graph.getRoots(t).filter(this.nodeFilter)}getChildren(t,e){return this.checkNodeExistence(t),this.graph.getChildren(t,e).filter(this.nodeFilter)}getParent(t,e){this.checkNodeExistence(t);const n=this.graph.getParent(t,e);return!n||!this.nodeFilter(n)?null:n}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(t,e,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];yv([this.getNode(t)],new Set,e,i)}dfs(t,e,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];Uu(this.getNode(t),new Set,e,i)}}class Vn extends Vu{constructor(e){super();Cn(this,"nodeMap",new Map);Cn(this,"edgeMap",new Map);Cn(this,"inEdgesMap",new Map);Cn(this,"outEdgesMap",new Map);Cn(this,"bothEdgesMap",new Map);Cn(this,"treeIndices",new Map);Cn(this,"changes",[]);Cn(this,"batchCount",0);Cn(this,"onChanged",()=>{});Cn(this,"batch",e=>{this.batchCount+=1,e(),this.batchCount-=1,this.batchCount||this.commit()});e&&(e.nodes&&this.addNodes(e.nodes),e.edges&&this.addEdges(e.edges),e.tree&&this.addTree(e.tree),e.onChanged&&(this.onChanged=e.onChanged))}commit(){const e=this.changes;this.changes=[];const n={graph:this,changes:e};this.emit("changed",n),this.onChanged(n)}reduceChanges(e){let n=[];return e.forEach(i=>{switch(i.type){case"NodeRemoved":{let a=!1;n=n.filter(s=>{if(s.type==="NodeAdded"){const o=s.value.id===i.value.id;return o&&(a=!0),!o}else{if(s.type==="NodeDataUpdated")return s.id!==i.value.id;if(s.type==="TreeStructureChanged")return s.nodeId!==i.value.id}return!0}),a||n.push(i);break}case"EdgeRemoved":{let a=!1;n=n.filter(s=>{if(s.type==="EdgeAdded"){const o=s.value.id===i.value.id;return o&&(a=!0),!o}else if(s.type==="EdgeDataUpdated"||s.type==="EdgeUpdated")return s.id!==i.value.id;return!0}),a||n.push(i);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const a=n.findIndex(o=>o.type===i.type&&o.id===i.id&&(i.propertyName===void 0||o.propertyName===i.propertyName)),s=n[a];s?i.propertyName!==void 0?s.newValue=i.newValue:(n.splice(a,1),n.push(i)):n.push(i);break}case"TreeStructureDetached":{n=n.filter(a=>a.type==="TreeStructureAttached"||a.type==="TreeStructureChanged"?a.treeKey!==i.treeKey:!0),n.push(i);break}case"TreeStructureChanged":{const a=n.find(s=>s.type==="TreeStructureChanged"&&s.treeKey===i.treeKey&&s.nodeId===i.nodeId);a?a.newParentId=i.newParentId:n.push(i);break}default:n.push(i);break}}),n}checkNodeExistence(e){this.getNode(e)}hasNode(e){return this.nodeMap.has(e)}areNeighbors(e,n){return this.getNeighbors(n).some(i=>i.id===e)}getNode(e){const n=this.nodeMap.get(e);if(!n)throw new Error("Node not found for id: "+e);return n}getRelatedEdges(e,n){if(this.checkNodeExistence(e),n==="in"){const i=this.inEdgesMap.get(e);return Array.from(i)}else if(n==="out"){const i=this.outEdgesMap.get(e);return Array.from(i)}else{const i=this.bothEdgesMap.get(e);return Array.from(i)}}getDegree(e,n){return this.getRelatedEdges(e,n).length}getSuccessors(e){const i=this.getRelatedEdges(e,"out").map(a=>this.getNode(a.target));return Array.from(new Set(i))}getPredecessors(e){const i=this.getRelatedEdges(e,"in").map(a=>this.getNode(a.source));return Array.from(new Set(i))}getNeighbors(e){const n=this.getPredecessors(e),i=this.getSuccessors(e);return Array.from(new Set([...n,...i]))}doAddNode(e){if(this.hasNode(e.id))throw new Error("Node already exists: "+e.id);this.nodeMap.set(e.id,e),this.inEdgesMap.set(e.id,new Set),this.outEdgesMap.set(e.id,new Set),this.bothEdgesMap.set(e.id,new Set),this.treeIndices.forEach(n=>{n.childrenMap.set(e.id,new Set)}),this.changes.push({type:"NodeAdded",value:e})}addNodes(e){this.batch(()=>{for(const n of e)this.doAddNode(n)})}addNode(e){this.addNodes([e])}doRemoveNode(e){const n=this.getNode(e),i=this.bothEdgesMap.get(e);i==null||i.forEach(a=>this.doRemoveEdge(a.id)),this.nodeMap.delete(e),this.treeIndices.forEach(a=>{var o,l;(o=a.childrenMap.get(e))==null||o.forEach(c=>{a.parentMap.delete(c.id)});const s=a.parentMap.get(e);s&&((l=a.childrenMap.get(s.id))==null||l.delete(n)),a.parentMap.delete(e),a.childrenMap.delete(e)}),this.bothEdgesMap.delete(e),this.inEdgesMap.delete(e),this.outEdgesMap.delete(e),this.changes.push({type:"NodeRemoved",value:n})}removeNodes(e){this.batch(()=>{e.forEach(n=>this.doRemoveNode(n))})}removeNode(e){this.removeNodes([e])}updateNodeDataProperty(e,n,i){const a=this.getNode(e);this.batch(()=>{const s=a.data[n],o=i;a.data[n]=o,this.changes.push({type:"NodeDataUpdated",id:e,propertyName:n,oldValue:s,newValue:o})})}mergeNodeData(e,n){this.batch(()=>{Object.entries(n).forEach(([i,a])=>{this.updateNodeDataProperty(e,i,a)})})}updateNodeData(...e){const n=e[0],i=this.getNode(n);if(typeof e[1]=="string"){this.updateNodeDataProperty(n,e[1],e[2]);return}let a;if(typeof e[1]=="function"){const s=e[1];a=s(i.data)}else typeof e[1]=="object"&&(a=e[1]);this.batch(()=>{const s=i.data,o=a;i.data=a,this.changes.push({type:"NodeDataUpdated",id:n,oldValue:s,newValue:o})})}checkEdgeExistence(e){if(!this.hasEdge(e))throw new Error("Edge not found for id: "+e)}hasEdge(e){return this.edgeMap.has(e)}getEdge(e){return this.checkEdgeExistence(e),this.edgeMap.get(e)}getEdgeDetail(e){const n=this.getEdge(e);return{edge:n,source:this.getNode(n.source),target:this.getNode(n.target)}}doAddEdge(e){if(this.hasEdge(e.id))throw new Error("Edge already exists: "+e.id);this.checkNodeExistence(e.source),this.checkNodeExistence(e.target),this.edgeMap.set(e.id,e);const n=this.inEdgesMap.get(e.target),i=this.outEdgesMap.get(e.source),a=this.bothEdgesMap.get(e.source),s=this.bothEdgesMap.get(e.target);n.add(e),i.add(e),a.add(e),s.add(e),this.changes.push({type:"EdgeAdded",value:e})}addEdges(e){this.batch(()=>{for(const n of e)this.doAddEdge(n)})}addEdge(e){this.addEdges([e])}doRemoveEdge(e){const n=this.getEdge(e),i=this.outEdgesMap.get(n.source),a=this.inEdgesMap.get(n.target),s=this.bothEdgesMap.get(n.source),o=this.bothEdgesMap.get(n.target);i.delete(n),a.delete(n),s.delete(n),o.delete(n),this.edgeMap.delete(e),this.changes.push({type:"EdgeRemoved",value:n})}removeEdges(e){this.batch(()=>{e.forEach(n=>this.doRemoveEdge(n))})}removeEdge(e){this.removeEdges([e])}updateEdgeSource(e,n){const i=this.getEdge(e);this.checkNodeExistence(n);const a=i.source,s=n;this.outEdgesMap.get(a).delete(i),this.bothEdgesMap.get(a).delete(i),this.outEdgesMap.get(s).add(i),this.bothEdgesMap.get(s).add(i),i.source=n,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"source",oldValue:a,newValue:s})})}updateEdgeTarget(e,n){const i=this.getEdge(e);this.checkNodeExistence(n);const a=i.target,s=n;this.inEdgesMap.get(a).delete(i),this.bothEdgesMap.get(a).delete(i),this.inEdgesMap.get(s).add(i),this.bothEdgesMap.get(s).add(i),i.target=n,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"target",oldValue:a,newValue:s})})}updateEdgeDataProperty(e,n,i){const a=this.getEdge(e);this.batch(()=>{const s=a.data[n],o=i;a.data[n]=o,this.changes.push({type:"EdgeDataUpdated",id:e,propertyName:n,oldValue:s,newValue:o})})}updateEdgeData(...e){const n=e[0],i=this.getEdge(n);if(typeof e[1]=="string"){this.updateEdgeDataProperty(n,e[1],e[2]);return}let a;if(typeof e[1]=="function"){const s=e[1];a=s(i.data)}else typeof e[1]=="object"&&(a=e[1]);this.batch(()=>{const s=i.data,o=a;i.data=a,this.changes.push({type:"EdgeDataUpdated",id:n,oldValue:s,newValue:o})})}mergeEdgeData(e,n){this.batch(()=>{Object.entries(n).forEach(([i,a])=>{this.updateEdgeDataProperty(e,i,a)})})}checkTreeExistence(e){if(!this.hasTreeStructure(e))throw new Error("Tree structure not found for treeKey: "+e)}hasTreeStructure(e){return this.treeIndices.has(e)}attachTreeStructure(e){this.treeIndices.has(e)||(this.treeIndices.set(e,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:e})}))}detachTreeStructure(e){this.checkTreeExistence(e),this.treeIndices.delete(e),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:e})})}addTree(e,n){this.batch(()=>{this.attachTreeStructure(n);const i=[],a=Array.isArray(e)?e:[e];for(;a.length;){const s=a.shift();i.push(s),s.children&&a.push(...s.children)}this.addNodes(i),i.forEach(s=>{var o;(o=s.children)==null||o.forEach(l=>{this.setParent(l.id,s.id,n)})})})}getRoots(e){return this.checkTreeExistence(e),this.getAllNodes().filter(n=>!this.getParent(n.id,e))}getChildren(e,n){this.checkNodeExistence(e),this.checkTreeExistence(n);const a=this.treeIndices.get(n).childrenMap.get(e);return Array.from(a||[])}getParent(e,n){return this.checkNodeExistence(e),this.checkTreeExistence(n),this.treeIndices.get(n).parentMap.get(e)||null}getAncestors(e,n){const i=[];let a=this.getNode(e),s;for(;s=this.getParent(a.id,n);)i.push(s),a=s;return i}setParent(e,n,i){var u,h;this.checkTreeExistence(i);const a=this.treeIndices.get(i);if(!a)return;const s=this.getNode(e),o=a.parentMap.get(e);if((o==null?void 0:o.id)===n)return;if(n==null){o&&((u=a.childrenMap.get(o.id))==null||u.delete(s)),a.parentMap.delete(e);return}const l=this.getNode(n);a.parentMap.set(e,l),o&&((h=a.childrenMap.get(o.id))==null||h.delete(s));let c=a.childrenMap.get(l.id);c||(c=new Set,a.childrenMap.set(l.id,c)),c.add(s),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:i,nodeId:e,oldParentId:o==null?void 0:o.id,newParentId:l.id})})}dfsTree(e,n,i){const a=s=>this.getChildren(s,i);return Uu(this.getNode(e),new Set,n,a)}bfsTree(e,n,i){const a=s=>this.getChildren(s,i);return yv([this.getNode(e)],new Set,n,a)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(e,n,i="out"){const a={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[i];return yv([this.getNode(e)],new Set,n,a)}dfs(e,n,i="out"){const a={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[i];return Uu(this.getNode(e),new Set,n,a)}clone(){const e=this.getAllNodes().map(a=>U0(Bo({},a),{data:Bo({},a.data)})),n=this.getAllEdges().map(a=>U0(Bo({},a),{data:Bo({},a.data)})),i=new Vn({nodes:e,edges:n});return this.treeIndices.forEach(({parentMap:a,childrenMap:s},o)=>{const l=new Map;a.forEach((u,h)=>{l.set(h,i.getNode(u.id))});const c=new Map;s.forEach((u,h)=>{c.set(h,new Set(Array.from(u).map(d=>i.getNode(d.id))))}),i.treeIndices.set(o,{parentMap:l,childrenMap:c})}),i}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(e){return new Q3(Bo({graph:this},e))}}class Yu{constructor(t,e){this.context=t,this.options=e||{}}}var q3=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},J3=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function r7(r){const{type:t}=r;return!!(["comboCombined","comboForce"].includes(t)||t==="antv-dagre"&&r.sortByCombo)}function $3(r){const{type:t}=r;return["compact-box","mindmap","dendrogram","indented"].includes(t)}function i7(r){return isNumber(r.x)&&isNumber(r.y)}function tP(r){return!Array.isArray(r)&&(r==null?void 0:r.preLayout)}function Hu(r){const{nodes:t,edges:e}=r,n={nodes:[],edges:[],combos:[]};return t.forEach(i=>{const a=i.data._isCombo?n.combos:n.nodes,{x:s,y:o,z:l=0}=i.data;a==null||a.push({id:i.id,style:{x:s,y:o,z:l}})}),e.forEach(i=>{const{id:a,source:s,target:o,data:{points:l=[],controlPoints:c=l.slice(1,l.length-1)}}=i;n.edges.push({id:a,source:s,target:o,style:Object.assign({},c!=null&&c.length?{controlPoints:c.map(yr)}:{})})}),n}function eP(r,t){class e extends Yu{constructor(i,a){if(super(i,a),this.instance=new r({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const s=this.instance;this.stop=s.stop.bind(s),this.tick=o=>{const l=s.tick(o);return Hu(l)}}}execute(i,a){return q3(this,void 0,void 0,function*(){return Hu(yield this.instance.execute(this.graphData2LayoutModel(i),this.transformOptions(mr({},this.options,a))))})}transformOptions(i){if(!("onTick"in i))return i;const a=i.onTick;return i.onTick=s=>a(Hu(s)),i}graphData2LayoutModel(i){const{nodes:a=[],edges:s=[],combos:o=[]}=i,l=a.map(f=>{const v=At(f),{data:g,style:p,combo:y}=f,b=J3(f,["data","style","combo"]),w={id:v,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{data:g}),y?{parentId:y}:{}),{style:p}),b)};return p!=null&&p.x&&Object.assign(w.data,{x:p.x}),p!=null&&p.y&&Object.assign(w.data,{y:p.y}),p!=null&&p.z&&Object.assign(w.data,{z:p.z}),w}),c=new Map(l.map(f=>[f.id,f])),u=s.filter(f=>{const{source:v,target:g}=f;return c.has(v)&&c.has(g)}).map(f=>{const{source:v,target:g,data:p,style:y}=f;return{id:At(f),source:v,target:g,data:Object.assign({},p),style:Object.assign({},y)}}),h=o.map(f=>({id:At(f),data:Object.assign({_isCombo:!0},f.data),style:Object.assign({},f.style)})),d=new Vn({nodes:[...l,...h],edges:u});return t.model.model.hasTreeStructure(hn)&&(d.attachTreeStructure(hn),l.forEach(f=>{const v=t.model.model.getParent(f.id,hn);v&&d.hasNode(v.id)&&d.setParent(f.id,v.id,hn)})),d}}return e}function bv(r,t,...e){if(t in r)return r[t](...e);if("instance"in r){const n=r.instance;if(t in n)return n[t](...e)}return null}function C1(r,t){if(t in r)return r[t];if("instance"in r){const e=r.instance;if(t in e)return e[t]}return null}var nP=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class rP extends Nl{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find(t=>["d3-force","d3-force-3d"].includes(t==null?void 0:t.id))}validate(t){return this.context.layout?this.forceLayoutInstance?super.validate(t):(Kr.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1):!1}moveElement(t,e){return nP(this,void 0,void 0,function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(t).forEach((i,a)=>{const{x:s=0,y:o=0}=i.style||{};n&&bv(n,"setFixedPosition",t[a],[...Ce([+s,+o],e)])})})}onDragStart(t){if(this.enable=this.validate(t),!this.enable)return;this.target=this.getSelectedNodeIDs([t.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target);const e=this.forceLayoutInstance;e&&C1(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach(n=>{const{x:i=0,y:a=0}=n.style||{};e&&bv(e,"setFixedPosition",At(n),[+i,+a])})}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.moveElement(this.target,e)}onDragEnd(){const t=this.forceLayoutInstance;t&&C1(t,"simulation").alphaTarget(0),!this.options.fixed&&this.context.graph.getNodeData(this.target).forEach(e=>{t&&bv(t,"setFixedPosition",At(e),[null,null,null])})}}var N1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Xu extends si{constructor(t,e){super(t,Object.assign({},Xu.defaultOptions,e)),this.isZoomEvent=n=>!!(n.data&&"scale"in n.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=n=>N1(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context,{state:a,nodeFilter:s,edgeFilter:o,comboFilter:l}=this.options,c=(a?i.getElementDataByState("node",a):i.getNodeData()).filter(s),u=(a?i.getElementDataByState("edge",a):i.getEdgeData()).filter(o),h=(a?i.getElementDataByState("combo",a):i.getComboData()).filter(l),d=this.isZoomEvent(n)?this.zoom=Math.max(.01,Math.min(n.data.scale,10)):this.zoom,f=[...c,...h];f.length>0&&f.forEach(v=>this.fixNodeLike(v,d)),this.updateRelatedEdges(),u.length>0&&u.forEach(v=>this.fixEdge(v,d))}),this.cachedStyles=new Map,this.getOriginalFieldValue=(n,i,a)=>{var s;const o=this.cachedStyles.get(n)||[],l=((s=o.find(c=>c.shape===i))===null||s===void 0?void 0:s.style)||{};return a in l||(l[a]=i.attributes[a],this.cachedStyles.set(n,[...o.filter(c=>c.shape!==i),{shape:i,style:l}])),l[a]},this.scaleEntireElement=(n,i,a)=>{i.setLocalScale(1/a);const s=this.cachedStyles.get(n)||[];s.push({shape:i}),this.cachedStyles.set(n,s)},this.scaleSpecificShapes=(n,i,a)=>{const s=HN(n);(Array.isArray(a)?a:[a]).forEach(l=>{const{shape:c,fields:u}=l,h=typeof c=="function"?c(s):n.getShape(c);if(h){if(!u){this.scaleEntireElement(n.id,h,i);return}u.forEach(d=>{const f=this.getOriginalFieldValue(n.id,h,d);ie(f)&&(h.style[d]=f/i)})}})},this.skipIfExceedViewport=n=>{const{viewport:i}=this.context;return!(i!=null&&i.isInViewport(n.getRenderBounds(),!1,30))},this.fixNodeLike=(n,i)=>{const a=At(n),{element:s,model:o}=this.context,l=s.getElement(a);if(!l||this.skipIfExceedViewport(l))return;o.getRelatedEdgesData(a).forEach(h=>this.relatedEdgeToUpdate.add(At(h)));const u=this.options[l.type];if(!u){this.scaleEntireElement(a,l,i);return}this.scaleSpecificShapes(l,i,u)},this.fixEdge=(n,i)=>{const a=At(n),s=this.context.element.getElement(a);if(!s||this.skipIfExceedViewport(s))return;const o=this.options.edge;if(!o){s.style.transformOrigin="center",this.scaleEntireElement(a,s,i);return}this.scaleSpecificShapes(s,i,o)},this.updateRelatedEdges=()=>{const{element:n}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach(i=>{const a=n.getElement(i);a==null||a.update({})}),this.relatedEdgeToUpdate.clear()},this.resetTransform=n=>N1(this,void 0,void 0,function*(){var i;!((i=n.data)===null||i===void 0)&&i.firstRender||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))}),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach(i=>{i.forEach(({shape:a,style:s})=>{if(ra(s))a.setLocalScale(1);else{if(this.options.state)return;Object.entries(s).forEach(([o,l])=>a.style[o]=l)}})});const{graph:t,element:e}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter(i=>i&&t.getElementType(i)==="node");if(n.length>0){const i=new Set;n.forEach(a=>{t.getRelatedEdgesData(a).forEach(s=>i.add(At(s)))}),i.forEach(a=>{const s=e==null?void 0:e.getElement(a);s==null||s.update({})})}}}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_DRAW,this.resetTransform),t.on(Kt.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_DRAW,this.resetTransform),t.off(Kt.AFTER_TRANSFORM,this.fixElementSize)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Xu.defaultOptions={enable:r=>r.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var iP=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Ku extends si{constructor(t,e){super(t,Object.assign({},Ku.defaultOptions,e)),this.focus=n=>iP(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context;yield i.focusElement(n.target.id,this.options.animation)}),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ls.forEach(e=>{t.on(`${e}:${Bt.CLICK}`,this.focus)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ls.forEach(e=>{t.off(`${e}:${Bt.CLICK}`,this.focus)})}destroy(){this.unbindEvents(),super.destroy()}}Ku.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class Qu extends si{constructor(t,e){super(t,Object.assign({},Qu.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=n=>{this.isFrozen=n.type==="dragstart"},this.hoverElement=n=>{if(!this.validate(n))return;const i=n.type===Bt.POINTER_ENTER;this.updateElementsState(n,i);const{onHover:a,onHoverEnd:s}=this.options;i?a==null||a(n):s==null||s(n)},this.updateElementsState=(n,i)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:a}=this.context,{state:s,animation:o,inactiveState:l}=this.options,c=this.getActiveIds(n),u={};if(s&&Object.assign(u,this.getElementsState(c,s,i)),l){const h=gy(a.getData(),!0).filter(d=>!c.includes(d));Object.assign(u,this.getElementsState(h,l,i))}a.setElementState(u,o)},this.getElementsState=(n,i,a)=>{const{graph:s}=this.context,o={};return n.forEach(l=>{const c=s.getElementState(l);a?o[l]=c.includes(i)?c:[...c,i]:o[l]=c.filter(u=>u!==i)}),o},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ls.forEach(n=>{t.on(`${n}:${Bt.POINTER_ENTER}`,this.hoverElement),t.on(`${n}:${Bt.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.addEventListener(`${Bt.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${Bt.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:n,direction:i}=this.options,a=t.target.id;return n?Py(e,t.targetType,a,typeof n=="function"?n(t):n,i):[a]}validate(t){if(this.destroyed||this.isFrozen||Ol(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ls.forEach(n=>{t.off(`${n}:${Bt.POINTER_ENTER}`,this.hoverElement),t.off(`${n}:${Bt.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.removeEventListener(`${Bt.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${Bt.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}Qu.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class aP extends yl{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e}=this.context;this.pathShape=new ri({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[du(t)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(du(t)),(e=this.pathShape)===null||e===void 0||e.setAttribute("d",WN(this.points)),n&&i==="default"&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){if(this.points){if(this.points.length<2){this.clearLasso();return}super.updateElementsStates(this.points),this.clearLasso()}}clearLasso(){var t;(t=this.pathShape)===null||t===void 0||t.remove(),this.pathShape=void 0,this.points=void 0}}class qu extends si{constructor(t,e){super(t,Object.assign({},qu.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(n,i,a)=>{n.filter(Boolean).forEach(s=>{i==="hidden"&&!s.isVisible()?this.hiddenShapes.push(s):i==="visible"&&this.hiddenShapes.includes(s)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(s),1):Ps(s,i,a)})},this.filterShapes=(n,i)=>{if(fe(i))return s=>!i(n,s);const a=i==null?void 0:i[n];return s=>s.className?!(a!=null&&a.includes(s.className)):!0},this.hideShapes=n=>{if(!this.validate(n)||!this.isVisible)return;const{element:i}=this.context,{shapes:a={}}=this.options;this.setElementsVisibility(i.getNodes(),"hidden",this.filterShapes("node",a)),this.setElementsVisibility(i.getEdges(),"hidden",this.filterShapes("edge",a)),this.setElementsVisibility(i.getCombos(),"hidden",this.filterShapes("combo",a)),this.isVisible=!1},this.showShapes=Cl(n=>{if(!this.validate(n)||this.isVisible)return;const{element:i}=this.context;this.setElementsVisibility(i.getNodes(),"visible"),this.setElementsVisibility(i.getEdges(),"visible"),this.setElementsVisibility(i.getCombos(),"visible"),this.isVisible=!0},this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(Kt.BEFORE_TRANSFORM,this.hideShapes),t.on(Kt.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.BEFORE_TRANSFORM,this.hideShapes),t.off(Kt.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}qu.defaultOptions={enable:!0,debounce:200,shapes:r=>r==="node"};var k1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Ju extends si{constructor(t,e){super(t,Object.assign({},Ju.defaultOptions,e)),this.onWheel=n=>k1(this,void 0,void 0,function*(){this.options.preventDefault&&n.preventDefault();const i=n.deltaX,a=n.deltaY;yield this.scroll([-i,-a],n)}),this.shortcut=new go(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),Fn(n)){(t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.onWheel);const{up:i=[],down:a=[],left:s=[],right:o=[]}=n;this.shortcut.bind(i,l=>this.scroll([0,-10],l)),this.shortcut.bind(a,l=>this.scroll([0,10],l)),this.shortcut.bind(s,l=>this.scroll([-10,0],l)),this.shortcut.bind(o,l=>this.scroll([10,0],l))}else(e=this.graphDom)===null||e===void 0||e.addEventListener(Bt.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=_i(t,e),t=this.clampByDirection(t),t=this.clampByRange(t),t}clampByDirection([t,e]){const{direction:n}=this.options;return n==="x"?e=0:n==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,c,u]=Ri(this.options.range),h=[s*o,a*l,s*c,a*u],d=za(Nf(n.getCanvasCenter()),h),f=on(n.getViewportCenter(),[t,e,0]);if(!Li(f,d)){const{min:[v,g],max:[p,y]}=d;(f[0]<v&&t>0||f[0]>p&&t<0)&&(t=0),(f[1]<g&&e>0||f[1]>y&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return k1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{onFinish:n}=this.options,i=this.context.graph,a=this.formatDisplacement(t);yield i.translateBy(a,!1),n==null||n()})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.onWheel),super.destroy()}}Ju.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var P1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class $u extends si{constructor(t,e){super(t,Object.assign({},$u.defaultOptions,e)),this.zoom=(n,i,a)=>P1(this,void 0,void 0,function*(){if(!this.validate(i))return;const{graph:s}=this.context;let o=this.options.origin;!o&&"viewport"in i&&(o=yr(i.viewport));const{sensitivity:l,onFinish:c}=this.options,u=1+kn(n,-50,50)*l/100,h=s.getZoom();yield s.zoomTo(h*u,a,o),c==null||c()}),this.onReset=()=>P1(this,void 0,void 0,function*(){yield this.context.graph.zoomTo(1,this.options.animation)}),this.preventDefault=n=>{this.options.preventDefault&&n.preventDefault()},this.shortcut=new go(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(this.shortcut.unbindAll(),Array.isArray(t))if(t.includes(Bt.PINCH))this.shortcut.bind([Bt.PINCH],e=>{this.zoom(e.scale,e,!1)});else{const e=this.context.canvas.getContainer();e==null||e.addEventListener(Bt.WHEEL,this.preventDefault),this.shortcut.bind([...t,Bt.WHEEL],n=>{const{deltaX:i,deltaY:a}=n;this.zoom(-(a!=null?a:i),n,!1)})}if(typeof t=="object"){const{zoomIn:e=[],zoomOut:n=[],reset:i=[]}=t;this.shortcut.bind(e,a=>this.zoom(10,a,this.options.animation)),this.shortcut.bind(n,a=>this.zoom(-10,a,this.options.animation)),this.shortcut.bind(i,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.context.canvas.getContainer())===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.preventDefault),super.destroy()}}$u.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var th=S(13722);const sP=(r,t)=>{if(r!=="next"&&r!=="prev")return t},R1=r=>{r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev};class oP{constructor(){const t={};t.prev=t,t.next=t.prev,this.shortcut=t}dequeue(){const t=this.shortcut,e=t.prev;if(e&&e!==t)return R1(e),e}enqueue(t){const e=this.shortcut;t.prev&&t.next&&R1(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e}toString(){const t=[],e=this.shortcut;let n=e.prev;for(;n!==e;)t.push(JSON.stringify(n,sP)),n=n==null?void 0:n.prev;return`[${t.join(", ")}]`}}class lP extends oP{}const cP=()=>1,uP=(r,t)=>{var e;if(r.getAllNodes().length<=1)return[];const n=dP(r,t||cP);return(e=hP(n.graph,n.buckets,n.zeroIdx).map(a=>r.getRelatedEdges(a.v,"out").filter(({target:s})=>s===a.w)))===null||e===void 0?void 0:e.flat()},hP=(r,t,e)=>{let n=[];const i=t[t.length-1],a=t[0];let s;for(;r.getAllNodes().length;){for(;s=a.dequeue();)xv(r,t,e,s);for(;s=i.dequeue();)xv(r,t,e,s);if(r.getAllNodes().length){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue(),s){n=n.concat(xv(r,t,e,s,!0));break}}}return n},xv=(r,t,e,n,i)=>{var a,s;const o=[];return r.hasNode(n.v)&&((a=r.getRelatedEdges(n.v,"in"))===null||a===void 0||a.forEach(l=>{const c=l.data.weight,u=r.getNode(l.source);i&&o.push({v:l.source,w:l.target,in:0,out:0}),u.data.out===void 0&&(u.data.out=0),u.data.out-=c,Ev(t,e,Object.assign({v:u.id},u.data))}),(s=r.getRelatedEdges(n.v,"out"))===null||s===void 0||s.forEach(l=>{const c=l.data.weight,u=l.target,h=r.getNode(u);h.data.in===void 0&&(h.data.in=0),h.data.in-=c,Ev(t,e,Object.assign({v:h.id},h.data))}),r.removeNode(n.v)),i?o:void 0},dP=(r,t)=>{const e=new Vn;let n=0,i=0;r.getAllNodes().forEach(l=>{e.addNode({id:l.id,data:{v:l.id,in:0,out:0}})}),r.getAllEdges().forEach(l=>{const c=e.getRelatedEdges(l.source,"out").find(h=>h.target===l.target),u=(t==null?void 0:t(l))||1;c?e.updateEdgeData(c==null?void 0:c.id,Object.assign(Object.assign({},c.data),{weight:c.data.weight+u})):e.addEdge({id:l.id,source:l.source,target:l.target,data:{weight:u}}),i=Math.max(i,e.getNode(l.source).data.out+=u),n=Math.max(n,e.getNode(l.target).data.in+=u)});const a=[],s=i+n+3;for(let l=0;l<s;l++)a.push(new lP);const o=n+1;return e.getAllNodes().forEach(l=>{Ev(a,o,Object.assign({v:l.id},e.getNode(l.id).data))}),{buckets:a,zeroIdx:o,graph:e}},Ev=(r,t,e)=>{e.out?e.in?r[e.out-e.in+t].enqueue(e):r[r.length-1].enqueue(e):r[0].enqueue(e)},fP=(r,t)=>{const n=t==="greedy"?uP(r,(i=>a=>a.data.weight||1)(r)):vP(r);n==null||n.forEach(i=>{const a=i.data;r.removeEdge(i.id),a.forwardName=i.data.name,a.reversed=!0,r.addEdge({id:i.id,source:i.target,target:i.source,data:Object.assign({},a)})})},vP=r=>{const t=[],e={},n={},i=a=>{n[a]||(n[a]=!0,e[a]=!0,r.getRelatedEdges(a,"out").forEach(s=>{e[s.target]?t.push(s):i(s.target)}),delete e[a])};return r.getAllNodes().forEach(a=>i(a.id)),t},gP=r=>{r.getAllEdges().forEach(t=>{const e=t.data;if(e.reversed){r.removeEdge(t.id);const n=e.forwardName;delete e.reversed,delete e.forwardName,r.addEdge({id:t.id,source:t.target,target:t.source,data:Object.assign(Object.assign({},e),{forwardName:n})})}})},pP=(r,t)=>Number(r)-Number(t),bo=(r,t,e,n)=>{let i;do i=`${n}${Math.random()}`;while(r.hasNode(i));return e.dummy=t,r.addNode({id:i,data:e}),i},mP=r=>{const t=new Vn;return r.getAllNodes().forEach(e=>{t.addNode(Object.assign({},e))}),r.getAllEdges().forEach(e=>{const n=t.getRelatedEdges(e.source,"out").find(i=>i.target===e.target);n?t.updateEdgeData(n==null?void 0:n.id,Object.assign(Object.assign({},n.data),{weight:n.data.weight+e.data.weight||0,minlen:Math.max(n.data.minlen,e.data.minlen||1)})):t.addEdge({id:e.id,source:e.source,target:e.target,data:{weight:e.data.weight||0,minlen:e.data.minlen||1}})}),t},L1=r=>{const t=new Vn;return r.getAllNodes().forEach(e=>{r.getChildren(e.id).length||t.addNode(Object.assign({},e))}),r.getAllEdges().forEach(e=>{t.addEdge(e)}),t},D1=(r,t)=>r==null?void 0:r.reduce((e,n,i)=>(e[n]=t[i],e),{}),a7=r=>{const t={};return r.getAllNodes().forEach(e=>{const n={};r.getRelatedEdges(e.id,"out").forEach(i=>{n[i.target]=(n[i.target]||0)+(i.data.weight||0)}),t[e.id]=n}),t},s7=r=>{const t=r.getAllNodes(),e=t.map(n=>{const i={};return r.getRelatedEdges(n.id,"in").forEach(a=>{i[a.source]=(i[a.source]||0)+a.data.weight}),i});return D1(t.map(n=>n.id),e)},_1=(r,t)=>{const e=Number(r.x),n=Number(r.y),i=Number(t.x)-e,a=Number(t.y)-n;let s=Number(r.width)/2,o=Number(r.height)/2;if(!i&&!a)return{x:0,y:0};let l,c;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,c=o):(i<0&&(s=-s),l=s,c=s*a/i),{x:e+l,y:n+c}},kl=r=>{const t=[],e=B1(r)+1;for(let n=0;n<e;n++)t.push([]);r.getAllNodes().forEach(n=>{const i=n.data.rank;i!==void 0&&t[i]&&t[i].push(n.id)});for(let n=0;n<e;n++)t[n]=t[n].sort((i,a)=>pP(r.getNode(i).data.order,r.getNode(a).data.order));return t},yP=r=>{const t=r.getAllNodes().filter(n=>n.data.rank!==void 0).map(n=>n.data.rank),e=Math.min(...t);r.getAllNodes().forEach(n=>{n.data.hasOwnProperty("rank")&&e!==1/0&&(n.data.rank-=e)})},bP=(r,t=0)=>{const e=r.getAllNodes(),n=e.filter(o=>o.data.rank!==void 0).map(o=>o.data.rank),i=Math.min(...n),a=[];e.forEach(o=>{const l=(o.data.rank||0)-i;a[l]||(a[l]=[]),a[l].push(o.id)});let s=0;for(let o=0;o<a.length;o++){const l=a[o];l===void 0?o%t!==0&&(s-=1):s&&(l==null||l.forEach(c=>{const u=r.getNode(c);u&&(u.data.rank=u.data.rank||0,u.data.rank+=s)}))}},I1=(r,t,e,n)=>{const i={width:0,height:0};return ie(e)&&ie(n)&&(i.rank=e,i.order=n),bo(r,"border",i,t)},B1=r=>{let t;return r.getAllNodes().forEach(e=>{const n=e.data.rank;n!==void 0&&(t===void 0||n>t)&&(t=n)}),t||(t=0),t},xP=(r,t)=>{const e={lhs:[],rhs:[]};return r==null||r.forEach(n=>{t(n)?e.lhs.push(n):e.rhs.push(n)}),e},wv=(r,t)=>r.reduce((e,n)=>{const i=t(e),a=t(n);return i>a?n:e}),F1=(r,t,e,n,i,a)=>{n.includes(t.id)||(n.push(t.id),e||a.push(t.id),i(t.id).forEach(s=>F1(r,s,e,n,i,a)),e&&a.push(t.id))},z1=(r,t,e,n)=>{const i=Array.isArray(t)?t:[t],a=l=>n?r.getSuccessors(l):r.getNeighbors(l),s=[],o=[];return i.forEach(l=>{if(r.hasNode(l.id))F1(r,l,e==="post",o,a,s);else throw new Error(`Graph does not have node: ${l}`)}),s},EP=r=>{const t=e=>{const n=r.getChildren(e),i=r.getNode(e);if(n!=null&&n.length&&n.forEach(a=>t(a.id)),i.data.hasOwnProperty("minRank")){i.data.borderLeft=[],i.data.borderRight=[];for(let a=i.data.minRank,s=i.data.maxRank+1;a<s;a+=1)j1(r,"borderLeft","_bl",e,i,a),j1(r,"borderRight","_br",e,i,a)}};r.getRoots().forEach(e=>t(e.id))},j1=(r,t,e,n,i,a)=>{const s={rank:a,borderType:t,width:0,height:0},o=i.data[t][a-1],l=bo(r,"border",s,e);i.data[t][a]=l,r.setParent(l,n),o&&r.addEdge({id:`e${Math.random()}`,source:o,target:l,data:{weight:1}})},wP=(r,t)=>{const e=t.toLowerCase();(e==="lr"||e==="rl")&&Z1(r)},SP=(r,t)=>{const e=t.toLowerCase();(e==="bt"||e==="rl")&&MP(r),(e==="lr"||e==="rl")&&(AP(r),Z1(r))},Z1=r=>{r.getAllNodes().forEach(t=>{W1(t)}),r.getAllEdges().forEach(t=>{W1(t)})},W1=r=>{const t=r.data.width;r.data.width=r.data.height,r.data.height=t},MP=r=>{r.getAllNodes().forEach(t=>{Sv(t.data)}),r.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(n=>Sv(n)),t.data.hasOwnProperty("y")&&Sv(t.data)})},Sv=r=>{r!=null&&r.y&&(r.y=-r.y)},AP=r=>{r.getAllNodes().forEach(t=>{Mv(t.data)}),r.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(n=>Mv(n)),t.data.hasOwnProperty("x")&&Mv(t.data)})},Mv=r=>{const t=r.x;r.x=r.y,r.y=t},TP=r=>{const t=bo(r,"root",{},"_root"),e=OP(r);let n=Math.max(...Object.values(e));Math.abs(n)===1/0&&(n=1);const i=n-1,a=2*i+1;r.getAllEdges().forEach(o=>{o.data.minlen*=a});const s=CP(r)+1;return r.getRoots().forEach(o=>{G1(r,t,a,s,i,e,o.id)}),{nestingRoot:t,nodeRankFactor:a}},G1=(r,t,e,n,i,a,s)=>{const o=r.getChildren(s);if(!(o!=null&&o.length)){s!==t&&r.addEdge({id:`e${Math.random()}`,source:t,target:s,data:{weight:0,minlen:e}});return}const l=I1(r,"_bt"),c=I1(r,"_bb"),u=r.getNode(s);r.setParent(l,s),u.data.borderTop=l,r.setParent(c,s),u.data.borderBottom=c,o==null||o.forEach(h=>{G1(r,t,e,n,i,a,h.id);const d=h.data.borderTop?h.data.borderTop:h.id,f=h.data.borderBottom?h.data.borderBottom:h.id,v=h.data.borderTop?n:2*n,g=d!==f?1:i-a[s]+1;r.addEdge({id:`e${Math.random()}`,source:l,target:d,data:{minlen:g,weight:v,nestingEdge:!0}}),r.addEdge({id:`e${Math.random()}`,source:f,target:c,data:{minlen:g,weight:v,nestingEdge:!0}})}),r.getParent(s)||r.addEdge({id:`e${Math.random()}`,source:t,target:l,data:{weight:0,minlen:i+a[s]}})},OP=r=>{const t={},e=(n,i)=>{const a=r.getChildren(n);a==null||a.forEach(s=>e(s.id,i+1)),t[n]=i};return r.getRoots().forEach(n=>e(n.id,1)),t},CP=r=>{let t=0;return r.getAllEdges().forEach(e=>{t+=e.data.weight}),t},NP=(r,t)=>{t&&r.removeNode(t),r.getAllEdges().forEach(e=>{e.data.nestingEdge&&r.removeEdge(e.id)})},kP="edge",V1="edge-label",PP=(r,t)=>{r.getAllEdges().forEach(e=>RP(r,e,t))},RP=(r,t,e)=>{let n=t.source,i=r.getNode(n).data.rank;const a=t.target,s=r.getNode(a).data.rank,o=t.data.labelRank;if(s===i+1)return;r.removeEdge(t.id);let l,c,u;for(u=0,++i;i<s;++u,++i)t.data.points=[],c={originalEdge:t,width:0,height:0,rank:i},l=bo(r,kP,c,"_d"),i===o&&(c.width=t.data.width,c.height=t.data.height,c.dummy=V1,c.labelpos=t.data.labelpos),r.addEdge({id:`e${Math.random()}`,source:n,target:l,data:{weight:t.data.weight}}),u===0&&e.push(l),n=l;r.addEdge({id:`e${Math.random()}`,source:n,target:a,data:{weight:t.data.weight}})},LP=(r,t)=>{t.forEach(e=>{let n=r.getNode(e);const{data:i}=n,a=i.originalEdge;let s;a&&r.addEdge(a);let o=e;for(;n.data.dummy;)s=r.getSuccessors(o)[0],r.removeNode(o),a.data.points.push({x:n.data.x,y:n.data.y}),n.data.dummy===V1&&(a.data.x=n.data.x,a.data.y=n.data.y,a.data.width=n.data.width,a.data.height=n.data.height),o=s.id,n=r.getNode(o)})},DP=(r,t,e)=>{const n={};let i;e==null||e.forEach(a=>{let s=r.getParent(a),o,l;for(;s;){if(o=r.getParent(s.id),o?(l=n[o.id],n[o.id]=s.id):(l=i,i=s.id),l&&l!==s.id){t.hasNode(l)||t.addNode({id:l,data:{}}),t.hasNode(s.id)||t.addNode({id:s.id,data:{}}),t.hasEdge(`e${l}-${s.id}`)||t.addEdge({id:`e${l}-${s.id}`,source:l,target:s.id,data:{}});return}s=o}})},_P=(r,t,e)=>{const n=IP(r),i=new Vn({tree:[{id:n,children:[],data:{}}]});return r.getAllNodes().forEach(a=>{const s=r.getParent(a.id);(a.data.rank===t||a.data.minRank<=t&&t<=a.data.maxRank)&&(i.hasNode(a.id)||i.addNode(Object.assign({},a)),s!=null&&s.id&&!i.hasNode(s==null?void 0:s.id)&&i.addNode(Object.assign({},s)),i.setParent(a.id,(s==null?void 0:s.id)||n),r.getRelatedEdges(a.id,e).forEach(o=>{const l=o.source===a.id?o.target:o.source;i.hasNode(l)||i.addNode(Object.assign({},r.getNode(l)));const c=i.getRelatedEdges(l,"out").find(({target:h})=>h===a.id),u=c!==void 0?c.data.weight:0;c?i.updateEdgeData(c.id,Object.assign(Object.assign({},c.data),{weight:o.data.weight+u})):i.addEdge({id:o.id,source:l,target:a.id,data:{weight:o.data.weight+u}})}),a.data.hasOwnProperty("minRank")&&i.updateNodeData(a.id,Object.assign(Object.assign({},a.data),{borderLeft:a.data.borderLeft[t],borderRight:a.data.borderRight[t]})))}),i},IP=r=>{let t;for(;r.hasNode(t=`_root${Math.random()}`););return t},BP=(r,t,e)=>{const n=D1(e,e.map((u,h)=>h)),a=t.map(u=>{const h=r.getRelatedEdges(u,"out").map(d=>({pos:n[d.target]||0,weight:d.data.weight}));return h==null?void 0:h.sort((d,f)=>d.pos-f.pos)}).flat().filter(u=>u!==void 0);let s=1;for(;s<e.length;)s<<=1;const o=2*s-1;s-=1;const l=Array(o).fill(0,0,o);let c=0;return a==null||a.forEach(u=>{if(u){let h=u.pos+s;l[h]+=u.weight;let d=0;for(;h>0;)h%2&&(d+=l[h+1]),h=h-1>>1,l[h]+=u.weight;c+=u.weight*d}}),c},U1=(r,t)=>{let e=0;for(let n=1;n<(t==null?void 0:t.length);n+=1)e+=BP(r,t[n-1],t[n]);return e},Y1=r=>{const t={},e=r.getAllNodes(),n=e.map(c=>{var u;return(u=c.data.rank)!==null&&u!==void 0?u:-1/0}),i=Math.max(...n),a=[];for(let c=0;c<i+1;c++)a.push([]);const s=e.sort((c,u)=>r.getNode(c.id).data.rank-r.getNode(u.id).data.rank),l=s.filter(c=>r.getNode(c.id).data.fixorder!==void 0).sort((c,u)=>r.getNode(c.id).data.fixorder-r.getNode(u.id).data.fixorder);return l==null||l.forEach(c=>{isNaN(r.getNode(c.id).data.rank)||a[r.getNode(c.id).data.rank].push(c.id),t[c.id]=!0}),s==null||s.forEach(c=>r.dfsTree(c.id,u=>{if(t.hasOwnProperty(u.id))return!0;t[u.id]=!0,isNaN(u.data.rank)||a[u.data.rank].push(u.id)})),a},FP=(r,t)=>t.map(e=>{const n=r.getRelatedEdges(e,"in");if(!(n!=null&&n.length))return{v:e};const i={sum:0,weight:0};return n==null||n.forEach(a=>{const s=r.getNode(a.source);i.sum+=a.data.weight*s.data.order,i.weight+=a.data.weight}),{v:e,barycenter:i.sum/i.weight,weight:i.weight}}),zP=(r,t)=>{var e,n,i;const a={};r==null||r.forEach((o,l)=>{a[o.v]={i:l,indegree:0,in:[],out:[],vs:[o.v]};const c=a[o.v];o.barycenter!==void 0&&(c.barycenter=o.barycenter,c.weight=o.weight)}),(e=t.getAllEdges())===null||e===void 0||e.forEach(o=>{const l=a[o.source],c=a[o.target];l!==void 0&&c!==void 0&&(c.indegree++,l.out.push(a[o.target]))});const s=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,o=>!o.indegree);return jP(s)},jP=r=>{var t,e;const n=[],i=l=>c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&ZP(l,c)},a=l=>c=>{c.in.push(l),--c.indegree===0&&r.push(c)};for(;r!=null&&r.length;){const l=r.pop();n.push(l),(t=l.in.reverse())===null||t===void 0||t.forEach(c=>i(l)(c)),(e=l.out)===null||e===void 0||e.forEach(c=>a(l)(c))}const s=n.filter(l=>!l.merged),o=["vs","i","barycenter","weight"];return s.map(l=>{const c={};return o==null||o.forEach(u=>{l[u]!==void 0&&(c[u]=l[u])}),c})},ZP=(r,t)=>{var e;let n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),r.vs=(e=t.vs)===null||e===void 0?void 0:e.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0};var WP=zP;const GP=(r,t,e,n)=>{const i=xP(r,d=>{const f=d.hasOwnProperty("fixorder")&&!isNaN(d.fixorder);return n?!f&&d.hasOwnProperty("barycenter"):f||d.hasOwnProperty("barycenter")}),a=i.lhs,s=i.rhs.sort((d,f)=>-d.i- -f.i),o=[];let l=0,c=0,u=0;a==null||a.sort(VP(!!t,!!e)),u=H1(o,s,u),a==null||a.forEach(d=>{var f;u+=(f=d.vs)===null||f===void 0?void 0:f.length,o.push(d.vs),l+=d.barycenter*d.weight,c+=d.weight,u=H1(o,s,u)});const h={vs:o.flat()};return c&&(h.barycenter=l/c,h.weight=c),h},H1=(r,t,e)=>{let n=e,i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),r==null||r.push(i.vs),n++;return n},VP=(r,t)=>(e,n)=>{if(e.fixorder!==void 0&&n.fixorder!==void 0)return e.fixorder-n.fixorder;if(e.barycenter<n.barycenter)return-1;if(e.barycenter>n.barycenter)return 1;if(t&&e.order!==void 0&&n.order!==void 0){if(e.order<n.order)return-1;if(e.order>n.order)return 1}return r?n.i-e.i:e.i-n.i},X1=(r,t,e,n,i,a)=>{var s,o,l,c;let u=r.getChildren(t).map(b=>b.id);const h=r.getNode(t),d=h?h.data.borderLeft:void 0,f=h?h.data.borderRight:void 0,v={};d&&(u=u==null?void 0:u.filter(b=>b!==d&&b!==f));const g=FP(r,u||[]);g==null||g.forEach(b=>{var w;if(!((w=r.getChildren(b.v))===null||w===void 0)&&w.length){const O=X1(r,b.v,e,n,a);v[b.v]=O,O.hasOwnProperty("barycenter")&&YP(b,O)}});const p=WP(g,e);UP(p,v),(s=p.filter(b=>b.vs.length>0))===null||s===void 0||s.forEach(b=>{const w=r.getNode(b.vs[0]);w&&(b.fixorder=w.data.fixorder,b.order=w.data.order)});const y=GP(p,n,i,a);if(d&&(y.vs=[d,y.vs,f].flat(),!((o=r.getPredecessors(d))===null||o===void 0)&&o.length)){const b=r.getNode(((l=r.getPredecessors(d))===null||l===void 0?void 0:l[0].id)||""),w=r.getNode(((c=r.getPredecessors(f))===null||c===void 0?void 0:c[0].id)||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.data.order+w.data.order)/(y.weight+2),y.weight+=2}return y},UP=(r,t)=>{r==null||r.forEach(e=>{var n;const i=(n=e.vs)===null||n===void 0?void 0:n.map(a=>t[a]?t[a].vs:a);e.vs=i.flat()})},YP=(r,t)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight):(r.barycenter=t.barycenter,r.weight=t.weight)},HP=(r,t)=>{const e=B1(r),n=[],i=[];for(let u=1;u<e+1;u++)n.push(u);for(let u=e-1;u>-1;u--)i.push(u);const a=K1(r,n,"in"),s=K1(r,i,"out");let o=Y1(r);Av(r,o);let l=Number.POSITIVE_INFINITY,c;for(let u=0,h=0;h<4;++u,++h){Q1(u%2?a:s,u%4>=2,!1,t),o=kl(r);const d=U1(r,o);d<l&&(h=0,c=ho(o),l=d)}o=Y1(r),Av(r,o);for(let u=0,h=0;h<4;++u,++h){Q1(u%2?a:s,u%4>=2,!0,t),o=kl(r);const d=U1(r,o);d<l&&(h=0,c=ho(o),l=d)}Av(r,c)},K1=(r,t,e)=>t.map(n=>_P(r,n,e)),Q1=(r,t,e,n)=>{const i=new Vn;r==null||r.forEach(a=>{var s;const o=a.getRoots()[0].id,l=X1(a,o,i,t,e,n);for(let c=0;c<((s=l.vs)===null||s===void 0?void 0:s.length);c++){const u=a.getNode(l.vs[c]);u&&(u.data.order=c)}DP(a,i,l.vs)})},Av=(r,t)=>{t==null||t.forEach(e=>{e==null||e.forEach((n,i)=>{r.getNode(n).data.order=i})})},XP=(r,t)=>{const n=r.getAllNodes().filter(s=>{var o;return!(!((o=r.getChildren(s.id))===null||o===void 0)&&o.length)}).map(s=>s.data.rank),i=Math.max(...n),a=[];for(let s=0;s<i+1;s++)a[s]=[];t==null||t.forEach(s=>{const o=r.getNode(s);!o||o.data.dummy||isNaN(o.data.rank)||(o.data.fixorder=a[o.data.rank].length,a[o.data.rank].push(s))})},KP=r=>{const t={};let e=0;const n=i=>{const a=e;r.getChildren(i).forEach(s=>n(s.id)),t[i]={low:a,lim:e++}};return r.getRoots().forEach(i=>n(i.id)),t},QP=(r,t,e,n)=>{var i,a;const s=[],o=[],l=Math.min(t[e].low,t[n].low),c=Math.max(t[e].lim,t[n].lim);let u,h;u=e;do u=(i=r.getParent(u))===null||i===void 0?void 0:i.id,s.push(u);while(u&&(t[u].low>l||c>t[u].lim));for(h=u,u=n;u&&u!==h;)o.push(u),u=(a=r.getParent(u))===null||a===void 0?void 0:a.id;return{lca:h,path:s.concat(o.reverse())}},qP=(r,t)=>{const e=KP(r);t.forEach(n=>{var i,a;let s=n,o=r.getNode(s);const l=o.data.originalEdge;if(!l)return;const c=QP(r,e,l.source,l.target),u=c.path,h=c.lca;let d=0,f=u[d],v=!0;for(;s!==l.target;){if(o=r.getNode(s),v){for(;f!==h&&((i=r.getNode(f))===null||i===void 0?void 0:i.data.maxRank)<o.data.rank;)d++,f=u[d];f===h&&(v=!1)}if(!v){for(;d<u.length-1&&((a=r.getNode(u[d+1]))===null||a===void 0?void 0:a.data.minRank)<=o.data.rank;)d++;f=u[d]}r.hasNode(f)&&r.setParent(s,f),s=r.getSuccessors(s)[0].id}})},q1=(r,t)=>{const e={},n=(i,a)=>{let s=0,o=0;const l=i.length,c=a==null?void 0:a[(a==null?void 0:a.length)-1];return a==null||a.forEach((u,h)=>{var d;const f=JP(r,u),v=f?r.getNode(f.id).data.order:l;(f||u===c)&&((d=a.slice(o,h+1))===null||d===void 0||d.forEach(g=>{var p;(p=r.getPredecessors(g))===null||p===void 0||p.forEach(y=>{var b;const w=r.getNode(y.id),O=w.data.order;(O<s||v<O)&&!(w.data.dummy&&(!((b=r.getNode(g))===null||b===void 0)&&b.data.dummy))&&$1(e,y.id,g)})}),o=h+1,s=v)}),a};return t!=null&&t.length&&t.reduce(n),e},J1=(r,t)=>{const e={};function n(o,l,c,u,h){var d,f;let v;for(let g=l;g<c;g++)v=o[g],!((d=r.getNode(v))===null||d===void 0)&&d.data.dummy&&((f=r.getPredecessors(v))===null||f===void 0||f.forEach(p=>{const y=r.getNode(p.id);y.data.dummy&&(y.data.order<u||y.data.order>h)&&$1(e,p.id,v)}))}function i(o){return JSON.stringify(o.slice(1))}function a(o,l){const c=i(o);l.get(c)||(n(...o),l.set(c,!0))}const s=(o,l)=>{let c=-1,u,h=0;const d=new Map;return l==null||l.forEach((f,v)=>{var g;if(((g=r.getNode(f))===null||g===void 0?void 0:g.data.dummy)==="border"){const p=r.getPredecessors(f)||[];p.length&&(u=r.getNode(p[0].id).data.order,a([l,h,v,c,u],d),h=v,c=u)}a([l,h,l.length,u,o.length],d)}),l};return t!=null&&t.length&&t.reduce(s),e},JP=(r,t)=>{var e,n;if(!((e=r.getNode(t))===null||e===void 0)&&e.data.dummy)return(n=r.getPredecessors(t))===null||n===void 0?void 0:n.find(i=>r.getNode(i.id).data.dummy)},$1=(r,t,e)=>{let n=t,i=e;if(n>i){const s=n;n=i,i=s}let a=r[n];a||(r[n]=a={}),a[i]=!0},$P=(r,t,e)=>{let n=t,i=e;if(n>i){const a=t;n=i,i=a}return!!r[n]},tb=(r,t,e,n)=>{const i={},a={},s={};return t==null||t.forEach(o=>{o==null||o.forEach((l,c)=>{i[l]=l,a[l]=l,s[l]=c})}),t==null||t.forEach(o=>{let l=-1;o==null||o.forEach(c=>{let u=n(c).map(h=>h.id);if(u.length){u=u.sort((d,f)=>s[d]-s[f]);const h=(u.length-1)/2;for(let d=Math.floor(h),f=Math.ceil(h);d<=f;++d){const v=u[d];a[c]===c&&l<s[v]&&!$P(e,c,v)&&(a[v]=c,a[c]=i[c]=i[v],l=s[v])}}})}),{root:i,align:a}},eb=(r,t,e,n,i,a,s)=>{var o;const l={},c=tR(r,t,e,i,a,s),u=s?"borderLeft":"borderRight",h=(v,g)=>{let p=c.getAllNodes(),y=p.pop();const b={};for(;y;)b[y.id]?v(y.id):(b[y.id]=!0,p.push(y),p=p.concat(g(y.id))),y=p.pop()},d=v=>{l[v]=(c.getRelatedEdges(v,"in")||[]).reduce((g,p)=>Math.max(g,(l[p.source]||0)+p.data.weight),0)},f=v=>{const g=(c.getRelatedEdges(v,"out")||[]).reduce((y,b)=>Math.min(y,(l[b.target]||0)-b.data.weight),Number.POSITIVE_INFINITY),p=r.getNode(v);g!==Number.POSITIVE_INFINITY&&p.data.borderType!==u&&(l[v]=Math.max(l[v],g))};return h(d,c.getPredecessors.bind(c)),h(f,c.getSuccessors.bind(c)),(o=Object.values(n))===null||o===void 0||o.forEach(v=>{l[v]=l[e[v]]}),l},tR=(r,t,e,n,i,a)=>{const s=new Vn,o=eR(n,i,a);return t==null||t.forEach(l=>{let c;l==null||l.forEach(u=>{const h=e[u];if(s.hasNode(h)||s.addNode({id:h,data:{}}),c){const d=e[c],f=s.getRelatedEdges(d,"out").find(v=>v.target===h);f?s.updateEdgeData(f.id,Object.assign(Object.assign({},f.data),{weight:Math.max(o(r,u,c),f.data.weight||0)})):s.addEdge({id:`e${Math.random()}`,source:d,target:h,data:{weight:Math.max(o(r,u,c),0)}})}c=u})}),s},nb=(r,t)=>wv(Object.values(t),e=>{var n;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(n=Object.keys(e))===null||n===void 0||n.forEach(s=>{const o=e[s],l=nR(r,s)/2;i=Math.max(o+l,i),a=Math.min(o-l,a)}),i-a});function rb(r,t){const e=Object.values(t),n=Math.min(...e),i=Math.max(...e);["u","d"].forEach(a=>{["l","r"].forEach(s=>{const o=a+s,l=r[o];let c;if(l===t)return;const u=Object.values(l);c=s==="l"?n-Math.min(...u):i-Math.max(...u),c&&(r[o]={},Object.keys(l).forEach(h=>{r[o][h]=l[h]+c}))})})}const ib=(r,t)=>{const e={};return Object.keys(r.ul).forEach(n=>{if(t)e[n]=r[t.toLowerCase()][n];else{const i=Object.values(r).map(a=>a[n]);e[n]=(i[0]+i[1])/2}}),e},o7=(r,t)=>{const{align:e,nodesep:n=0,edgesep:i=0}=t||{},a=buildLayerMatrix(r),s=Object.assign(q1(r,a),J1(r,a)),o={};let l;["u","d"].forEach(u=>{l=u==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(g=>Object.values(g).reverse()));const d=(u==="u"?r.getPredecessors:r.getSuccessors).bind(r),f=tb(r,l,s,d),v=eb(r,l,f.root,f.align,n,i,h==="r");h==="r"&&Object.keys(v).forEach(g=>{v[g]=-v[g]}),o[u+h]=v})});const c=nb(r,o);return rb(o,c),ib(o,e)},eR=(r,t,e)=>(n,i,a)=>{const s=n.getNode(i),o=n.getNode(a);let l=0,c=0;if(l+=s.data.width/2,s.data.hasOwnProperty("labelpos"))switch((s.data.labelpos||"").toLowerCase()){case"l":c=-s.data.width/2;break;case"r":c=s.data.width/2;break}if(c&&(l+=e?c:-c),c=0,l+=(s.data.dummy?t:r)/2,l+=(o.data.dummy?t:r)/2,l+=o.data.width/2,o.data.labelpos)switch((o.data.labelpos||"").toLowerCase()){case"l":c=o.data.width/2;break;case"r":c=-o.data.width/2;break}return c&&(l+=e?c:-c),c=0,l},nR=(r,t)=>r.getNode(t).data.width||0,rR=(r,t)=>{const{ranksep:e=0}=t||{},n=kl(r);let i=0;n==null||n.forEach(a=>{const s=a.map(l=>r.getNode(l).data.height),o=Math.max(...s,0);a==null||a.forEach(l=>{r.getNode(l).data.y=i+o/2}),i+=o+e})},iR=(r,t)=>{const{align:e,nodesep:n=0,edgesep:i=0}=t||{},a=kl(r),s=Object.assign(q1(r,a),J1(r,a)),o={};let l=[];["u","d"].forEach(u=>{l=u==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(g=>Object.values(g).reverse()));const d=(u==="u"?r.getPredecessors:r.getSuccessors).bind(r),f=tb(r,l,s,d),v=eb(r,l,f.root,f.align,n,i,h==="r");h==="r"&&Object.keys(v).forEach(g=>v[g]=-v[g]),o[u+h]=v})});const c=nb(r,o);return c&&rb(o,c),ib(o,e)},aR=(r,t)=>{var e;const n=L1(r);rR(n,t);const i=iR(n,t);(e=Object.keys(i))===null||e===void 0||e.forEach(a=>{n.getNode(a).data.x=i[a]})},ab=r=>{const t={},e=n=>{var i;const a=r.getNode(n);if(!a)return 0;if(t[n])return a.data.rank;t[n]=!0;let s;return(i=r.getRelatedEdges(n,"out"))===null||i===void 0||i.forEach(o=>{const l=e(o.target),c=o.data.minlen,u=l-c;u&&(s===void 0||u<s)&&(s=u)}),s||(s=0),a.data.rank=s,s};r.getAllNodes().filter(n=>r.getRelatedEdges(n.id,"in").length===0).forEach(n=>e(n.id))},sR=r=>{const t={};let e;const n=s=>{var o;const l=r.getNode(s);if(!l)return 0;if(t[s])return l.data.rank;t[s]=!0;let c;return(o=r.getRelatedEdges(s,"out"))===null||o===void 0||o.forEach(u=>{const h=n(u.target),d=u.data.minlen,f=h-d;f&&(c===void 0||f<c)&&(c=f)}),c||(c=0),(e===void 0||c<e)&&(e=c),l.data.rank=c,c};r.getAllNodes().filter(s=>r.getRelatedEdges(s.id,"in").length===0).forEach(s=>{s&&n(s.id)}),e===void 0&&(e=0);const i={},a=(s,o)=>{var l;const c=r.getNode(s),u=isNaN(c.data.layer)?o:c.data.layer;(c.data.rank===void 0||c.data.rank<u)&&(c.data.rank=u),!i[s]&&(i[s]=!0,(l=r.getRelatedEdges(s,"out"))===null||l===void 0||l.forEach(h=>{a(h.target,u+h.data.minlen)}))};r.getAllNodes().forEach(s=>{const o=s.data;o&&(isNaN(o.layer)?o.rank-=e:a(s.id,o.layer))})},Ha=(r,t)=>r.getNode(t.target).data.rank-r.getNode(t.source).data.rank-t.data.minlen,oR=r=>{const t=new Vn({tree:[]}),e=r.getAllNodes()[0],n=r.getAllNodes().length;t.addNode(e);let i,a;for(;lR(t,r)<n;)i=sb(t,r),a=t.hasNode(i.source)?Ha(r,i):-Ha(r,i),ob(t,r,a);return t},lR=(r,t)=>{const e=n=>{t.getRelatedEdges(n,"both").forEach(i=>{const a=i.source,s=n===a?i.target:a;!r.hasNode(s)&&!Ha(t,i)&&(r.addNode({id:s,data:{}}),r.addEdge({id:i.id,source:n,target:s,data:{}}),e(s))})};return r.getAllNodes().forEach(n=>e(n.id)),r.getAllNodes().length},cR=r=>{const t=new Vn({tree:[]}),e=r.getAllNodes()[0],n=r.getAllNodes().length;t.addNode(e);let i,a;for(;uR(t,r)<n;)i=sb(t,r),a=t.hasNode(i.source)?Ha(r,i):-Ha(r,i),ob(t,r,a);return t},uR=(r,t)=>{const e=n=>{var i;(i=t.getRelatedEdges(n,"both"))===null||i===void 0||i.forEach(a=>{const s=a.source,o=n===s?a.target:s;!r.hasNode(o)&&(t.getNode(o).data.layer!==void 0||!Ha(t,a))&&(r.addNode({id:o,data:{}}),r.addEdge({id:a.id,source:n,target:o,data:{}}),e(o))})};return r.getAllNodes().forEach(n=>e(n.id)),r.getAllNodes().length},sb=(r,t)=>wv(t.getAllEdges(),e=>r.hasNode(e.source)!==r.hasNode(e.target)?Ha(t,e):1/0),ob=(r,t,e)=>{r.getAllNodes().forEach(n=>{const i=t.getNode(n.id);i.data.rank||(i.data.rank=0),i.data.rank+=e})},hR=r=>{const t=mP(r);ab(t);const e=oR(t);cb(e),lb(e,t);let n,i;for(;n=vR(e);)i=gR(e,t,n),pR(e,t,n,i)},lb=(r,t)=>{let e=z1(r,r.getAllNodes(),"post",!1);e=e.slice(0,(e==null?void 0:e.length)-1),e.forEach(n=>{dR(r,t,n)})},dR=(r,t,e)=>{const i=r.getNode(e).data.parent,a=r.getRelatedEdges(e,"both").find(s=>s.target===i||s.source===i);a.data.cutvalue=fR(r,t,e)},fR=(r,t,e)=>{const i=r.getNode(e).data.parent;let a=!0,s=t.getRelatedEdges(e,"out").find(l=>l.target===i),o=0;return s||(a=!1,s=t.getRelatedEdges(i,"out").find(l=>l.target===e)),o=s.data.weight,t.getRelatedEdges(e,"both").forEach(l=>{const c=l.source===e,u=c?l.target:l.source;if(u!==i){const h=c===a,d=l.data.weight;if(o+=h?d:-d,yR(r,e,u)){const f=r.getRelatedEdges(e,"both").find(v=>v.source===u||v.target===u).data.cutvalue;o+=h?-f:f}}}),o},cb=(r,t=r.getAllNodes()[0].id)=>{ub(r,{},1,t)},ub=(r,t,e,n,i)=>{var a;const s=e;let o=e;const l=r.getNode(n);return t[n]=!0,(a=r.getNeighbors(n))===null||a===void 0||a.forEach(c=>{t[c.id]||(o=ub(r,t,o,c.id,n))}),l.data.low=s,l.data.lim=o++,i?l.data.parent=i:delete l.data.parent,o},vR=r=>r.getAllEdges().find(t=>t.data.cutvalue<0),gR=(r,t,e)=>{let n=e.source,i=e.target;t.getRelatedEdges(n,"out").find(u=>u.target===i)||(n=e.target,i=e.source);const a=r.getNode(n),s=r.getNode(i);let o=a,l=!1;a.data.lim>s.data.lim&&(o=s,l=!0);const c=t.getAllEdges().filter(u=>l===hb(r.getNode(u.source),o)&&l!==hb(r.getNode(u.target),o));return wv(c,u=>Ha(t,u))},pR=(r,t,e,n)=>{const i=r.getRelatedEdges(e.source,"both").find(a=>a.source===e.target||a.target===e.target);i&&r.removeEdge(i.id),r.addEdge({id:`e${Math.random()}`,source:n.source,target:n.target,data:{}}),cb(r),lb(r,t),mR(r,t)},mR=(r,t)=>{const e=r.getAllNodes().find(i=>!i.data.parent);let n=z1(r,e,"pre",!1);n=n.slice(1),n.forEach(i=>{const a=r.getNode(i).data.parent;let s=t.getRelatedEdges(i,"out").find(l=>l.target===a),o=!1;!s&&t.hasNode(a)&&(s=t.getRelatedEdges(a,"out").find(l=>l.target===i),o=!0),t.getNode(i).data.rank=(t.hasNode(a)&&t.getNode(a).data.rank||0)+(o?s==null?void 0:s.data.minlen:-(s==null?void 0:s.data.minlen))})},yR=(r,t,e)=>r.getRelatedEdges(t,"both").find(n=>n.source===e||n.target===e),hb=(r,t)=>t.data.low<=r.data.lim&&r.data.lim<=t.data.lim,bR=(r,t)=>{switch(t){case"network-simplex":ER(r);break;case"tight-tree":db(r);break;case"longest-path":xR(r);break;default:db(r)}},xR=ab,db=r=>{sR(r),cR(r)},ER=r=>{hR(r)},wR=(r,t)=>{const{edgeLabelSpace:e,keepNodeOrder:n,prevGraph:i,rankdir:a,ranksep:s}=t;!n&&i&&MR(r,i);const o=kR(r);e&&(t.ranksep=PR(o,{rankdir:a,ranksep:s}));let l;try{l=SR(o,t)}catch(c){if(c.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
`,c);return}throw c}return AR(r,o),l},SR=(r,t)=>{const{acyclicer:e,ranker:n,rankdir:i="tb",nodeOrder:a,keepNodeOrder:s,align:o,nodesep:l=50,edgesep:c=20,ranksep:u=50}=t;jR(r),fP(r,e);const{nestingRoot:h,nodeRankFactor:d}=TP(r);bR(L1(r),n),RR(r),bP(r,d),NP(r,h),yP(r),LR(r),DR(r);const f=[];PP(r,f),qP(r,f),EP(r),s&&XP(r,a),HP(r,s),ZR(r),wP(r,i),aR(r,{align:o,nodesep:l,edgesep:c,ranksep:u}),WR(r),zR(r),LP(r,f),BR(r),SP(r,i);const{width:v,height:g}=_R(r);return IR(r),FR(r),gP(r),{width:v,height:g}},MR=(r,t)=>{r.getAllNodes().forEach(e=>{const n=r.getNode(e.id);if(t.hasNode(e.id)){const i=t.getNode(e.id);n.data.fixorder=i.data._order,delete i.data._order}else delete n.data.fixorder})},AR=(r,t)=>{r.getAllNodes().forEach(e=>{var n;const i=r.getNode(e.id);if(i){const a=t.getNode(e.id);i.data.x=a.data.x,i.data.y=a.data.y,i.data._order=a.data.order,i.data._rank=a.data.rank,!((n=t.getChildren(e.id))===null||n===void 0)&&n.length&&(i.data.width=a.data.width,i.data.height=a.data.height)}}),r.getAllEdges().forEach(e=>{const n=r.getEdge(e.id),i=t.getEdge(e.id);n.data.points=i?i.data.points:[],i&&i.data.hasOwnProperty("x")&&(n.data.x=i.data.x,n.data.y=i.data.y)})},TR=["width","height","layer","fixorder"],OR={width:0,height:0},CR=["minlen","weight","width","height","labeloffset"],NR={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Tv=["labelpos"],kR=r=>{const t=new Vn({tree:[]});return r.getAllNodes().forEach(e=>{const n=vb(r.getNode(e.id).data),i=Object.assign(Object.assign({},OR),n),a=fb(i,TR);t.hasNode(e.id)||t.addNode({id:e.id,data:Object.assign({},a)});const s=r.hasTreeStructure("combo")?r.getParent(e.id,"combo"):r.getParent(e.id);ye(s)||(t.hasNode(s.id)||t.addNode(Object.assign({},s)),t.setParent(e.id,s.id))}),r.getAllEdges().forEach(e=>{const n=vb(r.getEdge(e.id).data),i={};Tv==null||Tv.forEach(a=>{n[a]!==void 0&&(i[a]=n[a])}),t.addEdge({id:e.id,source:e.source,target:e.target,data:Object.assign({},NR,fb(n,CR),i)})}),t},PR=(r,t)=>{const{ranksep:e=0,rankdir:n}=t;return r.getAllNodes().forEach(i=>{isNaN(i.data.layer)||i.data.layer||(i.data.layer=0)}),r.getAllEdges().forEach(i=>{var a;i.data.minlen*=2,((a=i.data.labelpos)===null||a===void 0?void 0:a.toLowerCase())!=="c"&&(n==="TB"||n==="BT"?i.data.width+=i.data.labeloffset:i.data.height+=i.data.labeloffset)}),e/2},RR=r=>{r.getAllEdges().forEach(t=>{if(t.data.width&&t.data.height){const e=r.getNode(t.source),n=r.getNode(t.target),i={e:t,rank:(n.data.rank-e.data.rank)/2+e.data.rank};bo(r,"edge-proxy",i,"_ep")}})},LR=r=>{let t=0;return r.getAllNodes().forEach(e=>{var n,i;e.data.borderTop&&(e.data.minRank=(n=r.getNode(e.data.borderTop))===null||n===void 0?void 0:n.data.rank,e.data.maxRank=(i=r.getNode(e.data.borderBottom))===null||i===void 0?void 0:i.data.rank,t=Math.max(t,e.data.maxRank||-1/0))}),t},DR=r=>{r.getAllNodes().forEach(t=>{t.data.dummy==="edge-proxy"&&(r.getEdge(t.data.e.id).data.labelRank=t.data.rank,r.removeNode(t.id))})},_R=(r,t)=>{let e,n=0,i,a=0;const{marginx:s=0,marginy:o=0}=t||{},l=c=>{if(!c.data)return;const u=c.data.x,h=c.data.y,d=c.data.width,f=c.data.height;!isNaN(u)&&!isNaN(d)&&(e===void 0&&(e=u-d/2),e=Math.min(e,u-d/2),n=Math.max(n,u+d/2)),!isNaN(h)&&!isNaN(f)&&(i===void 0&&(i=h-f/2),i=Math.min(i,h-f/2),a=Math.max(a,h+f/2))};return r.getAllNodes().forEach(c=>{l(c)}),r.getAllEdges().forEach(c=>{c!=null&&c.data.hasOwnProperty("x")&&l(c)}),e-=s,i-=o,r.getAllNodes().forEach(c=>{c.data.x-=e,c.data.y-=i}),r.getAllEdges().forEach(c=>{var u;(u=c.data.points)===null||u===void 0||u.forEach(h=>{h.x-=e,h.y-=i}),c.data.hasOwnProperty("x")&&(c.data.x-=e),c.data.hasOwnProperty("y")&&(c.data.y-=i)}),{width:n-e+s,height:a-i+o}},IR=r=>{r.getAllEdges().forEach(t=>{const e=r.getNode(t.source),n=r.getNode(t.target);let i,a;t.data.points?(i=t.data.points[0],a=t.data.points[t.data.points.length-1]):(t.data.points=[],i={x:n.data.x,y:n.data.y},a={x:e.data.x,y:e.data.y}),t.data.points.unshift(_1(e.data,i)),t.data.points.push(_1(n.data,a))})},BR=r=>{r.getAllEdges().forEach(t=>{if(t.data.hasOwnProperty("x"))switch((t.data.labelpos==="l"||t.data.labelpos==="r")&&(t.data.width-=t.data.labeloffset),t.data.labelpos){case"l":t.data.x-=t.data.width/2+t.data.labeloffset;break;case"r":t.data.x+=t.data.width/2+t.data.labeloffset;break}})},FR=r=>{r.getAllEdges().forEach(t=>{var e;t.data.reversed&&((e=t.data.points)===null||e===void 0||e.reverse())})},zR=r=>{r.getAllNodes().forEach(t=>{var e,n,i;if(!((e=r.getChildren(t.id))===null||e===void 0)&&e.length){const a=r.getNode(t.id),s=r.getNode(a.data.borderTop),o=r.getNode(a.data.borderBottom),l=r.getNode(a.data.borderLeft[((n=a.data.borderLeft)===null||n===void 0?void 0:n.length)-1]),c=r.getNode(a.data.borderRight[((i=a.data.borderRight)===null||i===void 0?void 0:i.length)-1]);a.data.width=Math.abs((c==null?void 0:c.data.x)-(l==null?void 0:l.data.x))||10,a.data.height=Math.abs((o==null?void 0:o.data.y)-(s==null?void 0:s.data.y))||10,a.data.x=((l==null?void 0:l.data.x)||0)+a.data.width/2,a.data.y=((s==null?void 0:s.data.y)||0)+a.data.height/2}}),r.getAllNodes().forEach(t=>{t.data.dummy==="border"&&r.removeNode(t.id)})},jR=r=>{r.getAllEdges().forEach(t=>{if(t.source===t.target){const e=r.getNode(t.source);e.data.selfEdges||(e.data.selfEdges=[]),e.data.selfEdges.push(t),r.removeEdge(t.id)}})},ZR=r=>{const t=kl(r);t==null||t.forEach(e=>{let n=0;e==null||e.forEach((i,a)=>{var s;const o=r.getNode(i);o.data.order=a+n,(s=o.data.selfEdges)===null||s===void 0||s.forEach(l=>{bo(r,"selfedge",{width:l.data.width,height:l.data.height,rank:o.data.rank,order:a+ ++n,e:l},"_se")}),delete o.data.selfEdges})})},WR=r=>{r.getAllNodes().forEach(t=>{const e=r.getNode(t.id);if(e.data.dummy==="selfedge"){const n=r.getNode(e.data.e.source),i=n.data.x+n.data.width/2,a=n.data.y,s=e.data.x-i,o=n.data.height/2;r.hasEdge(e.data.e.id)?r.updateEdgeData(e.data.e.id,e.data.e.data):r.addEdge({id:e.data.e.id,source:e.data.e.source,target:e.data.e.target,data:e.data.e.data}),r.removeNode(t.id),e.data.e.data.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{y:a,x:i+s},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],e.data.e.data.x=e.data.x,e.data.e.data.y=e.data.y}})},fb=(r,t)=>{const e={};return t==null||t.forEach(n=>{r[n]!==void 0&&(e[n]=+r[n])}),e},vb=(r={})=>{const t={};return Object.keys(r).forEach(e=>{t[e.toLowerCase()]=r[e]}),t};function Pl(r){if(!r)return[0,0,0];if(ie(r))return[r,r,r];if(r.length===0)return[0,0,0];const[t,e=t,n=t]=r;return[t,e,n]}function js(r,t){let e;return fe(t)?e=t:ie(t)?e=()=>t:e=()=>r,e}function Ov(r,t,e=!0){return!t&&t!==0?n=>{const{size:i}=n.data||{};return i?Array.isArray(i)?e?Math.max(...i)||r:i:Fn(i)&&i.width&&i.height?e?Math.max(i.width,i.height)||r:[i.width,i.height]:i:r}:fe(t)?t:ie(t)?()=>t:Array.isArray(t)?()=>e?Math.max(...t)||r:t:Fn(t)&&t.width&&t.height?()=>e?Math.max(t.width,t.height)||r:[t.width,t.height]:()=>r}const Cv=(r,t,e=10)=>{let n;const i=typeof t=="function"?t:()=>t||0;return r?Array.isArray(r)?n=s=>r:fe(r)?n=r:n=s=>r:n=s=>{var o,l,c;if(!((o=s.data)===null||o===void 0)&&o.bboxSize)return(l=s.data)===null||l===void 0?void 0:l.bboxSize;if(!((c=s.data)===null||c===void 0)&&c.size){const u=s.data.size;return Array.isArray(u)?u:Fn(u)?[u.width,u.height]:u}return e},s=>{const o=n(s),l=i(s);return Math.max(...Pl(o))+l}},Nv=r=>{if(r===null)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array){const t=[];return r.forEach(e=>{t.push(e)}),t.map(e=>Nv(e))}if(typeof r=="object"){const t={};return Object.keys(r).forEach(e=>{t[e]=Nv(r[e])}),t}return r},ci=(r,t)=>{const e=Nv(r);return e.data=e.data||{},t&&(ie(e.data.x)||(e.data.x=Math.random()*t[0]),ie(e.data.y)||(e.data.y=Math.random()*t[1])),e},GR={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class VR{constructor(t={}){this.options=t,this.id="antv-dagre",this.options=Object.assign(Object.assign({},GR),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,t,e)})}genericDagreLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{nodeSize:a,align:s,rankdir:o="TB",ranksep:l,nodesep:c,ranksepFunc:u,nodesepFunc:h,edgeLabelSpace:d,ranker:f,nodeOrder:v,begin:g,controlPoints:p,radial:y,sortByCombo:b,preset:w}=i,O=new Vn({tree:[]}),_=js(l||50,u),F=js(c||50,h);let W=F,j=_;(o==="LR"||o==="RL")&&(W=_,j=F);const H=Ov(10,a,!1),K=e.getAllNodes(),et=e.getAllEdges();K.forEach(pt=>{const xt=Pl(H(pt)),kt=j(pt),jt=W(pt),Xt=xt[0]+2*jt,ee=xt[1]+2*kt,ce=pt.data.layer;ie(ce)?O.addNode({id:pt.id,data:{width:Xt,height:ee,layer:ce}}):O.addNode({id:pt.id,data:{width:Xt,height:ee}})}),b&&(O.attachTreeStructure("combo"),K.forEach(pt=>{const{parentId:xt}=pt.data;xt!==void 0&&O.hasNode(xt)&&O.setParent(pt.id,xt,"combo")})),et.forEach(pt=>{O.addEdge({id:pt.id,source:pt.source,target:pt.target,data:{weight:pt.data.weight||1}})});let rt;w!=null&&w.length&&(rt=new Vn({nodes:w})),wR(O,{prevGraph:rt,edgeLabelSpace:d,keepNodeOrder:!!v,nodeOrder:v||[],acyclicer:"greedy",ranker:f,rankdir:o,nodesep:c,align:s});const lt=[0,0];if(g){let pt=1/0,xt=1/0;O.getAllNodes().forEach(kt=>{pt>kt.data.x&&(pt=kt.data.x),xt>kt.data.y&&(xt=kt.data.y)}),O.getAllEdges().forEach(kt=>{var jt;(jt=kt.data.points)===null||jt===void 0||jt.forEach(Xt=>{pt>Xt.x&&(pt=Xt.x),xt>Xt.y&&(xt=Xt.y)})}),lt[0]=g[0]-pt,lt[1]=g[1]-xt}const ht=o==="LR"||o==="RL";if(!y){const pt=new Set,kt=o==="BT"||o==="RL"?(ce,ue)=>ue-ce:(ce,ue)=>ce-ue;O.getAllNodes().forEach(ce=>{ce.data.x=ce.data.x+lt[0],ce.data.y=ce.data.y+lt[1],pt.add(ht?ce.data.x:ce.data.y)});const jt=Array.from(pt).sort(kt),Xt=ht?(ce,ue)=>ce.x!==ue.x:(ce,ue)=>ce.y!==ue.y,ee=ht?(ce,ue,le)=>{const me=Math.max(ue.y,le.y),De=Math.min(ue.y,le.y);return ce.filter(Ge=>Ge.y<=me&&Ge.y>=De)}:(ce,ue,le)=>{const me=Math.max(ue.x,le.x),De=Math.min(ue.x,le.x);return ce.filter(Ge=>Ge.x<=me&&Ge.x>=De)};O.getAllEdges().forEach((ce,ue)=>{var le;d&&p&&ce.data.type!=="loop"&&(ce.data.controlPoints=UR((le=ce.data.points)===null||le===void 0?void 0:le.map(({x:me,y:De})=>({x:me+lt[0],y:De+lt[1]})),O.getNode(ce.source),O.getNode(ce.target),jt,ht,Xt,ee))})}let yt=[];yt=O.getAllNodes().map(pt=>ci(pt));const Nt=O.getAllEdges();return t&&(yt.forEach(pt=>{e.mergeNodeData(pt.id,{x:pt.data.x,y:pt.data.y})}),Nt.forEach(pt=>{e.mergeEdgeData(pt.id,{controlPoints:pt.data.controlPoints})})),{nodes:yt,edges:Nt}})}}const UR=(r,t,e,n,i,a,s)=>{let o=(r==null?void 0:r.slice(1,r.length-1))||[];if(t&&e){let{x:l,y:c}=t.data,{x:u,y:h}=e.data;if(i&&(l=t.data.y,c=t.data.x,u=e.data.y,h=e.data.x),h!==c&&l!==u){const d=n.indexOf(c),f=n[d+1];if(f){const p=o[0],y=i?{x:(c+f)/2,y:(p==null?void 0:p.y)||u}:{x:(p==null?void 0:p.x)||u,y:(c+f)/2};(!p||a(p,y))&&o.unshift(y)}const v=n.indexOf(h),g=Math.abs(v-d);if(g===1)o=s(o,t.data,e.data),o.length||o.push(i?{x:(c+h)/2,y:l}:{x:l,y:(c+h)/2});else if(g>1){const p=n[v-1];if(p){const y=o[o.length-1],b=i?{x:(h+p)/2,y:(y==null?void 0:y.y)||u}:{x:(y==null?void 0:y.x)||l,y:(h+p)/2};(!y||a(y,b))&&o.push(b)}}}}return o},Zs=(r,t,e)=>{const n=r.getAllNodes(),i=r.getAllEdges();if(!(n!=null&&n.length))return{nodes:[],edges:i};if(n.length===1)return t&&r.mergeNodeData(n[0].id,{x:e[0],y:e[1]}),{nodes:[Object.assign(Object.assign({},n[0]),{data:Object.assign(Object.assign({},n[0].data),{x:e[0],y:e[1]})})],edges:i}},YR={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class HR{constructor(t={}){this.options=t,this.id="circular",this.options=Object.assign(Object.assign({},YR),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericCircularLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericCircularLayout(!0,t,e)})}genericCircularLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,divisions:l,startAngle:c=0,endAngle:u=2*Math.PI,angleRatio:h,ordering:d,clockwise:f,nodeSpacing:v,nodeSize:g}=i,p=e.getAllNodes(),y=e.getAllEdges(),[b,w,O]=KR(a,s,o),_=p==null?void 0:p.length;if(!_||_===1)return Zs(e,t,O);const F=(u-c)/_;let{radius:W,startRadius:j,endRadius:H}=i;if(v){const ht=js(10,v),yt=Ov(10,g);let Nt=-1/0;p.forEach(pt=>{const xt=yt(pt);Nt<xt&&(Nt=xt)});let Ct=0;p.forEach((pt,xt)=>{xt===0?Ct+=Nt||10:Ct+=(ht(pt)||0)+(Nt||10)}),W=Ct/(2*Math.PI)}else!W&&!j&&!H?W=Math.min(w,b)/2:!j&&H?j=H:j&&!H&&(H=j);const K=F*h;let et=[];d==="topology"?et=gb(e,p):d==="topology-directed"?et=gb(e,p,!0):d==="degree"?et=XR(e,p):et=p.map(ht=>ci(ht));const rt=Math.ceil(_/l);for(let ht=0;ht<_;++ht){let yt=W;!yt&&j!==null&&H!==null&&(yt=j+ht*(H-j)/(_-1)),yt||(yt=10+ht*100/(_-1));let Nt=c+ht%rt*K+2*Math.PI/l*Math.floor(ht/rt);f||(Nt=u-ht%rt*K-2*Math.PI/l*Math.floor(ht/rt)),et[ht].data.x=O[0]+Math.cos(Nt)*yt,et[ht].data.y=O[1]+Math.sin(Nt)*yt}return t&&et.forEach(ht=>{e.mergeNodeData(ht.id,{x:ht.data.x,y:ht.data.y})}),{nodes:et,edges:y}})}}const gb=(r,t,e=!1)=>{const n=[ci(t[0])],i={},a=t.length;i[t[0].id]=!0;let s=0;return t.forEach((o,l)=>{if(l!==0)if((l===a-1||r.getDegree(o.id,"both")!==r.getDegree(t[l+1].id,"both")||r.areNeighbors(n[s].id,o.id))&&!i[o.id])n.push(ci(o)),i[o.id]=!0,s++;else{const c=e?r.getSuccessors(n[s].id):r.getNeighbors(n[s].id);let u=!1;for(let d=0;d<c.length;d++){const f=c[d];if(r.getDegree(f.id)===r.getDegree(o.id)&&!i[f.id]){n.push(ci(f)),i[f.id]=!0,u=!0;break}}let h=0;for(;!u&&(i[t[h].id]||(n.push(ci(t[h])),i[t[h].id]=!0,u=!0),h++,h!==a););}}),n};function XR(r,t){const e=[];return t.forEach((n,i)=>{e.push(ci(n))}),e.sort((n,i)=>r.getDegree(n.id,"both")-r.getDegree(i.id,"both")),e}const KR=(r,t,e)=>{let n=r,i=t,a=e;return!n&&typeof window!="undefined"&&(n=window.innerWidth),!i&&typeof window!="undefined"&&(i=window.innerHeight),a||(a=[n/2,i/2]),[n,i,a]},xa=Array.isArray,QR={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class kv{constructor(t={}){this.options=t,this.id="concentric",this.options=Object.assign(Object.assign({},QR),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericConcentricLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericConcentricLayout(!0,t,e)})}genericConcentricLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o,sortBy:l,maxLevelDiff:c,sweep:u,clockwise:h,equidistant:d,preventOverlap:f,startAngle:v=3/2*Math.PI,nodeSize:g,nodeSpacing:p}=i,y=e.getAllNodes(),b=e.getAllEdges(),w=!s&&typeof window!="undefined"?window.innerWidth:s,O=!o&&typeof window!="undefined"?window.innerHeight:o,_=a||[w/2,O/2];if(!(y!=null&&y.length)||y.length===1)return Zs(e,t,_);const F=[];let W,j=0;xa(g)?W=Math.max(g[0],g[1]):fe(g)?(W=-1/0,y.forEach(pt=>{const xt=Math.max(...Pl(g(pt)));xt>W&&(W=xt)})):W=g,xa(p)?j=Math.max(p[0],p[1]):ie(p)&&(j=p),y.forEach(pt=>{const xt=ci(pt);F.push(xt);let kt=W;const{data:jt}=xt;xa(jt.size)?kt=Math.max(jt.size[0],jt.size[1]):ie(jt.size)?kt=jt.size:Fn(jt.size)&&(kt=Math.max(jt.size.width,jt.size.height)),W=Math.max(W,kt),fe(p)&&(j=Math.max(p(pt),j))});const H={};F.forEach((pt,xt)=>{H[pt.id]=xt});let K=l;(!Ve(K)||F[0].data[K]===void 0)&&(K="degree"),K==="degree"?F.sort((pt,xt)=>e.getDegree(xt.id,"both")-e.getDegree(pt.id,"both")):F.sort((pt,xt)=>xt.data[K]-pt.data[K]);const et=F[0],rt=(c||(K==="degree"?e.getDegree(et.id,"both"):et.data[K]))/4,lt=[{nodes:[]}];let ht=lt[0];F.forEach(pt=>{if(ht.nodes.length>0){const xt=Math.abs(K==="degree"?e.getDegree(ht.nodes[0].id,"both")-e.getDegree(pt.id,"both"):ht.nodes[0].data[K]-pt.data[K]);rt&&xt>=rt&&(ht={nodes:[]},lt.push(ht))}ht.nodes.push(pt)});let yt=W+j;if(!f){const pt=lt.length>0&&lt[0].nodes.length>1,kt=(Math.min(w,O)/2-yt)/(lt.length+(pt?1:0));yt=Math.min(yt,kt)}let Nt=0;if(lt.forEach(pt=>{const xt=u===void 0?2*Math.PI-2*Math.PI/pt.nodes.length:u;if(pt.dTheta=xt/Math.max(1,pt.nodes.length-1),pt.nodes.length>1&&f){const kt=Math.cos(pt.dTheta)-Math.cos(0),jt=Math.sin(pt.dTheta)-Math.sin(0),Xt=Math.sqrt(yt*yt/(kt*kt+jt*jt));Nt=Math.max(Xt,Nt)}pt.r=Nt,Nt+=yt}),d){let pt=0,xt=0;for(let kt=0;kt<lt.length;kt++){const Xt=(lt[kt].r||0)-xt;pt=Math.max(pt,Xt)}xt=0,lt.forEach((kt,jt)=>{jt===0&&(xt=kt.r||0),kt.r=xt,xt+=pt})}return lt.forEach(pt=>{const xt=pt.dTheta||0,kt=pt.r||0;pt.nodes.forEach((jt,Xt)=>{const ee=v+(h?1:-1)*xt*Xt;jt.data.x=_[0]+kt*Math.cos(ee),jt.data.y=_[1]+kt*Math.sin(ee)})}),t&&F.forEach(pt=>e.mergeNodeData(pt.id,{x:pt.data.x,y:pt.data.y})),{nodes:F,edges:b}})}}var Pv=S(14301),qR=S(7695);const JR=.81,Rv=.1;function $R(r,t,e,n,i=2){const a=t/e,s=r.getAllNodes(),o=s.map((u,h)=>{const{nodeStrength:d,x:f,y:v,z:g,size:p}=u.data;return{x:f,y:v,z:g,size:p,index:h,id:u.id,vx:0,vy:0,vz:0,weight:a*d}}),l=(i===2?(0,Pv.Z)(o,u=>u.x,u=>u.y):(0,qR.Z)(o,u=>u.x,u=>u.y,u=>u.z)).visitAfter(tL),c=new Map;return o.forEach(u=>{c.set(u.id,u),nL(u,l,i)}),o.map((u,h)=>{const{id:d,data:f}=s[h],{mass:v=1}=f;n[d]={x:u.vx/v,y:u.vy/v,z:u.vz/v}}),n}function tL(r){let t=0,e=0,n=0,i=0,a=0;const s=r.length;if(s){for(let o=0;o<s;o++){const l=r[o];l&&l.weight&&(t+=l.weight,e+=l.x*l.weight,n+=l.y*l.weight,i+=l.z*l.weight,a+=l.size*l.weight)}r.x=e/t,r.y=n/t,r.z=i/t,r.size=a/t,r.weight=t}else{const o=r;r.x=o.data.x,r.y=o.data.y,r.z=o.data.z,r.size=o.data.size,r.weight=o.data.weight}}const eL=(r,t,e,n,i,a,s)=>{var o;if(((o=r.data)===null||o===void 0?void 0:o.id)===a.id)return;const l=[e,n,i][s-1],c=a.x-r.x||Rv,u=a.y-r.y||Rv,h=a.z-r.z||Rv,d=[c,u,h],f=l-t;let v=0;for(let y=0;y<s;y++)v+=d[y]*d[y];const p=Math.sqrt(v)*v;if(f*f*JR<v){const y=r.weight/p;return a.vx+=c*y,a.vy+=u*y,a.vz+=h*y,!0}if(r.length)return!1;if(r.data!==a){const y=r.data.weight/p;a.vx+=c*y,a.vy+=u*y,a.vz+=h*y}};function nL(r,t,e){t.visit((n,i,a,s,o)=>eL(n,i,a,s,o,r,e))}const rL={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class pb{constructor(t={}){this.options=t,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},rL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericForceLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;(this.judgingDistance>this.lastOptions.minMovement||n<1)&&n<t;n++)this.runOneStep(this.lastCalcGraph,this.lastGraph,n,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),e}genericForceLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),a=e.getAllNodes(),s=e.getAllEdges(),o=this.formatOptions(i,e),{dimensions:l,width:c,height:u,nodeSize:h,getMass:d,nodeStrength:f,edgeStrength:v,linkDistance:g}=o,p=a.map((j,H)=>Object.assign(Object.assign({},j),{data:Object.assign(Object.assign({},j.data),{x:ie(j.data.x)?j.data.x:Math.random()*c,y:ie(j.data.y)?j.data.y:Math.random()*u,z:ie(j.data.z)?j.data.z:Math.random()*Math.sqrt(c*u),size:h(j)||30,mass:d(j),nodeStrength:f(j)})})),y=s.map(j=>Object.assign(Object.assign({},j),{data:Object.assign(Object.assign({},j.data),{edgeStrength:v(j),linkDistance:g(j,e.getNode(j.source),e.getNode(j.target))})}));if(!(a!=null&&a.length))return this.lastResult={nodes:[],edges:s},{nodes:[],edges:s};const b={};a.forEach((j,H)=>{b[j.id]={x:0,y:0,z:0}});const w=new Vn({nodes:p,edges:y});this.formatCentripetal(o,w);const{maxIteration:O,minMovement:_,onTick:F}=o;if(this.lastLayoutNodes=p,this.lastLayoutEdges=y,this.lastAssign=t,this.lastGraph=e,this.lastCalcGraph=w,this.lastOptions=o,this.lastVelMap=b,typeof window=="undefined")return;let W=0;return new Promise(j=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&j({nodes:Lv(e,p),edges:s}),this.runOneStep(w,e,W,b,o),this.updatePosition(e,w,b,o),t&&p.forEach(H=>e.mergeNodeData(H.id,{x:H.data.x,y:H.data.y,z:l===3?H.data.z:void 0})),F==null||F({nodes:Lv(e,p),edges:s}),W++,(W>=O||this.judgingDistance<_)&&(window.clearInterval(this.timeInterval),j({nodes:Lv(e,p),edges:s}))},0),this.running=!0})})}formatOptions(t,e){const n=Object.assign({},t),{width:i,height:a,getMass:s}=t;n.width=!i&&typeof window!="undefined"?window.innerWidth:i,n.height=!a&&typeof window!="undefined"?window.innerHeight:a,t.center||(n.center=[n.width/2,n.height/2]),s||(n.getMass=l=>{let c=1;ie(l==null?void 0:l.data.mass)&&(c=l==null?void 0:l.data.mass);const u=e.getDegree(l.id,"both");return!u||u<5?c:u*5*c}),n.nodeSize=Cv(t.nodeSize,t.nodeSpacing);const o=t.linkDistance?js(1,t.linkDistance):l=>1+n.nodeSize(e.getNode(l.source))+n.nodeSize(e.getNode(l.target));return n.linkDistance=o,n.nodeStrength=js(1,t.nodeStrength),n.edgeStrength=js(1,t.edgeStrength),n}formatCentripetal(t,e){const{dimensions:n,centripetalOptions:i,center:a,clusterNodeStrength:s,leafCluster:o,clustering:l,nodeClusterBy:c}=t,u=e.getAllNodes(),h=i||{leaf:2,single:2,others:1,center:y=>({x:a[0],y:a[1],z:n===3?a[2]:void 0})};typeof s!="function"&&(t.clusterNodeStrength=y=>s);let d,f;if(o&&c&&(d=mb(e,c),f=Array.from(new Set(u==null?void 0:u.map(y=>y.data[c])))||[],t.centripetalOptions=Object.assign(h,{single:100,leaf:y=>{const{siblingLeaves:b,sameTypeLeaves:w}=d[y.id]||{};return(w==null?void 0:w.length)===(b==null?void 0:b.length)||(f==null?void 0:f.length)===1?1:t.clusterNodeStrength(y)},others:1,center:y=>{const b=e.getDegree(y.id,"both");if(!b)return{x:100,y:100,z:0};let w;if(b===1){const{sameTypeLeaves:O=[]}=d[y.id]||{};O.length===1?w=void 0:O.length>1&&(w=yb(O))}else w=void 0;return{x:w==null?void 0:w.x,y:w==null?void 0:w.y,z:w==null?void 0:w.z}}})),l&&c){d||(d=mb(e,c)),f||(f=Array.from(new Set(u.map(b=>b.data[c])))),f=f.filter(b=>b!==void 0);const y={};f.forEach(b=>{const w=u.filter(O=>O.data[c]===b).map(O=>e.getNode(O.id));y[b]=yb(w)}),t.centripetalOptions=Object.assign(h,{single:b=>t.clusterNodeStrength(b),leaf:b=>t.clusterNodeStrength(b),others:b=>t.clusterNodeStrength(b),center:b=>{const w=y[b.data[c]];return{x:w==null?void 0:w.x,y:w==null?void 0:w.y,z:w==null?void 0:w.z}}})}const{leaf:v,single:g,others:p}=t.centripetalOptions||{};v&&typeof v!="function"&&(t.centripetalOptions.leaf=()=>v),g&&typeof g!="function"&&(t.centripetalOptions.single=()=>g),p&&typeof p!="function"&&(t.centripetalOptions.others=()=>p)}runOneStep(t,e,n,i,a){const s={},o=t.getAllNodes(),l=t.getAllEdges();if(!(o!=null&&o.length))return;const{monitor:c}=a;if(this.calRepulsive(t,s,a),l&&this.calAttractive(t,s,a),this.calGravity(t,e,s,a),this.updateVelocity(t,s,i,a),c){const u=this.calTotalEnergy(s,o);c({energy:u,nodes:e.getAllNodes(),edges:e.getAllEdges(),iterations:n})}}calTotalEnergy(t,e){if(!(e!=null&&e.length))return 0;let n=0;return e.forEach((i,a)=>{const s=t[i.id].x,o=t[i.id].y,l=this.options.dimensions===3?t[i.id].z:0,c=s*s+o*o+l*l,{mass:u=1}=i.data;n+=u*c*.5}),n}calRepulsive(t,e,n){const{dimensions:i,factor:a,coulombDisScale:s}=n;$R(t,a,s*s,e,i)}calAttractive(t,e,n){const{dimensions:i,nodeSize:a}=n;t.getAllEdges().forEach((s,o)=>{const{source:l,target:c}=s,u=t.getNode(l),h=t.getNode(c);if(!u||!h)return;let d=h.data.x-u.data.x,f=h.data.y-u.data.y,v=i===3?h.data.z-u.data.z:0;!d&&!f&&(d=Math.random()*.01,f=Math.random()*.01,i===3&&!v&&(v=Math.random()*.01));const g=Math.sqrt(d*d+f*f+v*v);if(g<a(u)+a(h))return;const p=d/g,y=f/g,b=v/g,{linkDistance:w=200,edgeStrength:O=200}=s.data||{},F=(w-g)*O,W=u.data.mass||1,j=h.data.mass||1,H=1/W,K=1/j,et=p*F,rt=y*F,lt=b*F;e[l].x-=et*H,e[l].y-=rt*H,e[l].z-=lt*H,e[c].x+=et*K,e[c].y+=rt*K,e[c].z+=lt*K})}calGravity(t,e,n,i){const{getCenter:a}=i,s=t.getAllNodes(),o=e.getAllNodes(),l=e.getAllEdges(),{width:c,height:u,center:h,gravity:d,centripetalOptions:f}=i;s&&s.forEach(v=>{const{id:g,data:p}=v,{mass:y,x:b,y:w,z:O}=p,_=e.getNode(g);let F=0,W=0,j=0,H=d;const K=t.getDegree(g,"in"),et=t.getDegree(g,"out"),rt=t.getDegree(g,"both"),lt=a==null?void 0:a(_,rt);if(lt){const[ht,yt,Nt]=lt;F=b-ht,W=w-yt,H=Nt}else F=b-h[0],W=w-h[1],j=O-h[2];if(H&&(n[g].x-=H*F/y,n[g].y-=H*W/y,n[g].z-=H*j/y),f){const{leaf:ht,single:yt,others:Nt,center:Ct}=f,{x:pt,y:xt,z:kt,centerStrength:jt}=(Ct==null?void 0:Ct(_,o,l,c,u))||{x:0,y:0,z:0,centerStrength:0};if(!ie(pt)||!ie(xt))return;const Xt=(b-pt)/y,ee=(w-xt)/y,ce=(O-kt)/y;if(jt&&(n[g].x-=jt*Xt,n[g].y-=jt*ee,n[g].z-=jt*ce),rt===0){const le=yt(_);if(!le)return;n[g].x-=le*Xt,n[g].y-=le*ee,n[g].z-=le*ce;return}if(K===0||et===0){const le=ht(_,o,l);if(!le)return;n[g].x-=le*Xt,n[g].y-=le*ee,n[g].z-=le*ce;return}const ue=Nt(_);if(!ue)return;n[g].x-=ue*Xt,n[g].y-=ue*ee,n[g].z-=ue*ce}})}updateVelocity(t,e,n,i){const{damping:a,maxSpeed:s,interval:o,dimensions:l}=i,c=t.getAllNodes();c!=null&&c.length&&c.forEach(u=>{const{id:h}=u;let d=(n[h].x+e[h].x*o)*a||.01,f=(n[h].y+e[h].y*o)*a||.01,v=l===3?(n[h].z+e[h].z*o)*a||.01:0;const g=Math.sqrt(d*d+f*f+v*v);if(g>s){const p=s/g;d=p*d,f=p*f,v=p*v}n[h]={x:d,y:f,z:v}})}updatePosition(t,e,n,i){const{distanceThresholdMode:a,interval:s,dimensions:o}=i,l=e.getAllNodes();if(!(l!=null&&l.length)){this.judgingDistance=0;return}let c=0;a==="max"?this.judgingDistance=-1/0:a==="min"&&(this.judgingDistance=1/0),l.forEach(u=>{const{id:h}=u,d=t.getNode(h);if(ie(d.data.fx)&&ie(d.data.fy)){e.mergeNodeData(h,{x:d.data.fx,y:d.data.fy,z:o===3?d.data.fz:void 0});return}const f=n[h].x*s,v=n[h].y*s,g=o===3?n[h].z*s:0;e.mergeNodeData(h,{x:u.data.x+f,y:u.data.y+v,z:u.data.z+g});const p=Math.sqrt(f*f+v*v+g*g);switch(a){case"max":this.judgingDistance<p&&(this.judgingDistance=p);break;case"min":this.judgingDistance>p&&(this.judgingDistance=p);break;default:c=c+p;break}}),(!a||a==="mean")&&(this.judgingDistance=c/l.length)}}const mb=(r,t)=>{const e=r.getAllNodes();if(!(e!=null&&e.length))return{};const n={};return e.forEach((i,a)=>{r.getDegree(i.id,"both")===1&&(n[i.id]=iL(r,"leaf",i,t))}),n},iL=(r,t,e,n)=>{const i=r.getDegree(e.id,"in"),a=r.getDegree(e.id,"out");let s=e,o=[];i===0?(s=r.getSuccessors(e.id)[0],o=r.getNeighbors(s.id)):a===0&&(s=r.getPredecessors(e.id)[0],o=r.getNeighbors(s.id)),o=o.filter(c=>r.getDegree(c.id,"in")===0||r.getDegree(c.id,"out")===0);const l=aL(r,t,n,e,o);return{coreNode:s,siblingLeaves:o,sameTypeLeaves:l}},aL=(r,t,e,n,i)=>{const a=n.data[e]||"";let s=(i==null?void 0:i.filter(o=>o.data[e]===a))||[];return t==="leaf"&&(s=s.filter(o=>r.getDegree(o.id,"in")===0||r.getDegree(o.id,"out")===0)),s},yb=r=>{const t={x:0,y:0};r.forEach(n=>{const{x:i,y:a}=n.data;t.x+=i||0,t.y+=a||0});const e=r.length||1;return{x:t.x/e,y:t.y/e}},Lv=(r,t)=>t.map(e=>{const{id:n,data:i}=e,a=r.getNode(n);return Object.assign(Object.assign({},a),{data:Object.assign(Object.assign({},a.data),{x:i.x,y:i.y,z:i.z})})});var We=S(13377);const l7=We.XA,c7=We.a_,u7=We.yQ,h7=We.Hs,d7=We.Ec,f7=We.dx,v7=We.LU,g7=We.Rm,Xa=We.y3,p7=We.qK,m7=We.pb,y7=We.j,b7=We.sO,x7=We.BZ,E7=We.EK,w7=We.Db,S7=We.Fx,M7=We.tU,A7=We.Ym,T7=We.rs,O7=We.QR,C7=We.TB,N7=We.oH,bb=We.Sc,k7=We.BN,P7=We.it,R7=We.$r,L7=We.QM,D7=We.AV;var _7=(We.y3,We.y3);const I7=We.GH,B7=We.SO,F7=We.uZ,z7=We.yU,j7=We.F1,Z7=We.re,xb=r=>{const t=[],e=r.length;for(let n=0;n<e;n+=1){t[n]=[];for(let i=0;i<e;i+=1)n===i?t[n][i]=0:r[n][i]===0||!r[n][i]?t[n][i]=1/0:t[n][i]=r[n][i]}for(let n=0;n<e;n+=1)for(let i=0;i<e;i+=1)for(let a=0;a<e;a+=1)t[i][a]>t[i][n]+t[n][a]&&(t[i][a]=t[i][n]+t[n][a]);return t},Eb=(r,t)=>{const{nodes:e,edges:n}=r,i=[],a={};if(!e)throw new Error("invalid nodes data!");return e&&e.forEach((s,o)=>{a[s.id]=o;const l=[];i.push(l)}),n==null||n.forEach(s=>{const{source:o,target:l}=s,c=a[o],u=a[l];c===void 0||u===void 0||(i[c][u]=1,t||(i[u][c]=1))}),i},sL=(r,t)=>{const e=[];return r.forEach(n=>{const i=[];n.forEach(a=>{i.push(a*t)}),e.push(i)}),e},oL=r=>{let t=1/0,e=1/0,n=-1/0,i=-1/0;return r.forEach(a=>{let s=a.data.size;xa(s)?s.length===1&&(s=[s[0],s[0]]):ie(s)?s=[s,s]:(s===void 0||isNaN(s))&&(s=[30,30]);const o=[s[0]/2,s[1]/2],l=a.data.x-o[0],c=a.data.x+o[0],u=a.data.y-o[1],h=a.data.y+o[1];t>l&&(t=l),e>u&&(e=u),n<c&&(n=c),i<h&&(i=h)}),{minX:t,minY:e,maxX:n,maxY:i}},wb=(r,t)=>Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)),Dv=(r,t,e,n="TB",i,a={})=>{if(!(t!=null&&t.length))return;const{stopBranchFn:s,stopAllFn:o}=a;for(let l=0;l<t.length;l++){const c=t[l];if(r.hasNode(c.id)&&!(s!=null&&s(c))){if(o!=null&&o(c))return;n==="TB"&&e(c),Dv(r,r.getChildren(c.id,i),e,n,i,a),n!=="TB"&&e(c)}}},lL={center:[0,0],linkDistance:50};class Sb{constructor(t={}){this.options=t,this.id="mds",this.options=Object.assign(Object.assign({},lL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericMDSLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericMDSLayout(!0,t,e)})}genericMDSLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a=[0,0],linkDistance:s=50}=i,o=e.getAllNodes(),l=e.getAllEdges();if(!(o!=null&&o.length)||o.length===1)return Zs(e,t,a);const c=Eb({nodes:o,edges:l},!1),u=xb(c);cL(u);const h=sL(u,s),d=uL(h),f=[];return d.forEach((g,p)=>{const y=ci(o[p]);y.data.x=g[0]+a[0],y.data.y=g[1]+a[1],f.push(y)}),t&&f.forEach(g=>e.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:f,edges:l}})}}const cL=r=>{let t=-999999;r.forEach(e=>{e.forEach(n=>{n!==1/0&&t<n&&(t=n)})}),r.forEach((e,n)=>{e.forEach((i,a)=>{i===1/0&&(r[n][a]=t)})})},uL=r=>{const e=Xa.mul(Xa.pow(r,2),-.5),n=e.mean("row"),i=e.mean("column"),a=e.mean();e.add(a).subRowVector(n).subColumnVector(i);const s=new bb(e),o=Xa.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map(l=>Xa.mul([l],[o]).toJSON()[0].splice(0,2))};function _v(r){return!!r.tick&&!!r.stop}const hL={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},dL={center:[0,0],comboPadding:10,treeKey:"combo"};class fL{constructor(t={}){this.options=t,this.id="comboCombined",this.options=Object.assign(Object.assign({},dL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericComboCombinedLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericComboCombinedLayout(!0,t,e)})}genericComboCombinedLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=this.initVals(Object.assign(Object.assign({},this.options),n)),{center:a,treeKey:s,outerLayout:o}=i,l=e.getAllNodes().filter(j=>!j.data._isCombo),c=e.getAllNodes().filter(j=>j.data._isCombo),u=e.getAllEdges(),h=l==null?void 0:l.length;if(!h||h===1)return Zs(e,t,a);const d=[],f=new Map;l.forEach(j=>{f.set(j.id,j)});const v=new Map;c.forEach(j=>{v.set(j.id,j)});const g=new Map,p=this.getInnerGraphs(e,s,f,v,u,i,g);yield Promise.all(p);const y=new Map,b=[],w=new Map;let O=!0;e.getRoots(s).forEach(j=>{const H=g.get(j.id),K=v.get(j.id)||f.get(j.id),et={id:j.id,data:Object.assign(Object.assign({},j.data),{x:H.data.x||K.data.x,y:H.data.y||K.data.y,fx:H.data.fx||K.data.fx,fy:H.data.fy||K.data.fy,mass:H.data.mass||K.data.mass,size:H.data.size})};b.push(et),y.set(j.id,!0),!isNaN(et.data.x)&&et.data.x!==0&&!isNaN(et.data.y)&&et.data.y!==0?O=!1:(et.data.x=Math.random()*100,et.data.y=Math.random()*100),Dv(e,[j],rt=>{rt.id!==j.id&&w.set(rt.id,j.id)},"TB",s)});const _=[];u.forEach(j=>{const H=w.get(j.source)||j.source,K=w.get(j.target)||j.target;H!==K&&y.has(H)&&y.has(K)&&_.push({id:j.id,source:H,target:K,data:{}})});let F;if(b!=null&&b.length){if(b.length===1)b[0].data.x=a[0],b[0].data.y=a[1];else{const j=new Vn({nodes:b,edges:_}),H=o||new pb;O&&hL[H.id]&&(yield(b.length<100?new Sb:new kv).assign(j));const K=Object.assign({center:a,kg:5,preventOverlap:!0,animate:!1},H.id==="force"?{gravity:1,factor:4,linkDistance:(et,rt,lt)=>{const ht=Math.max(...rt.data.size)||32,yt=Math.max(...lt.data.size)||32;return ht/2+yt/2+200}}:{});F=yield Mb(H,j,K)}g.forEach(j=>{var H;const K=F.nodes.find(lt=>lt.id===j.id);if(K){const{x:lt,y:ht}=K.data;j.data.visited=!0,j.data.x=lt,j.data.y=ht,d.push({id:j.id,data:{x:lt,y:ht}})}const{x:et,y:rt}=j.data;(H=j.data.nodes)===null||H===void 0||H.forEach(lt=>{d.push({id:lt.id,data:{x:lt.data.x+et,y:lt.data.y+rt}})})}),g.forEach(({data:j})=>{const{x:H,y:K,visited:et,nodes:rt}=j;rt==null||rt.forEach(lt=>{if(!et){const ht=d.find(yt=>yt.id===lt.id);ht.data.x+=H||0,ht.data.y+=K||0}})})}return t&&d.forEach(j=>{e.mergeNodeData(j.id,{x:j.data.x,y:j.data.y})}),{nodes:d,edges:u}})}initVals(t){const e=Object.assign({},t),{nodeSize:n,spacing:i,comboPadding:a}=t;let s,o;if(ie(i)?o=()=>i:fe(i)?o=i:o=()=>0,e.spacing=o,!n)s=c=>{const u=o(c);return c.size?xa(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+u)/2:Fn(c.size)?((c.size.width>c.size.height?c.size.width:c.size.height)+u)/2:(c.size+u)/2:32+u/2};else if(fe(n))s=c=>{const u=n(c),h=o(c);return xa(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+h)/2:((u||32)+h)/2};else if(xa(n)){const u=(n[0]>n[1]?n[0]:n[1])/2;s=h=>u+o(h)/2}else{const c=n/2;s=u=>c+o(u)/2}e.nodeSize=s;let l;return ie(a)?l=()=>a:xa(a)?l=()=>Math.max.apply(null,a):fe(a)?l=a:l=()=>0,e.comboPadding=l,e}getInnerGraphs(t,e,n,i,a,s,o){const{nodeSize:l,comboPadding:c,spacing:u,innerLayout:h}=s,d=h||new kv({}),f={center:[0,0],preventOverlap:!0,nodeSpacing:u},v=[],g=p=>{let y=(c==null?void 0:c(p))||10;return xa(y)&&(y=Math.max(...y)),{size:y?[y*2,y*2]:[30,30],padding:y}};return t.getRoots(e).forEach(p=>{o.set(p.id,{id:p.id,data:{nodes:[],size:g(p).size}});let y=Promise.resolve();Dv(t,[p],b=>{var w;if(!b.data._isCombo)return;const{size:O,padding:_}=g(b);if(!(!((w=t.getChildren(b.id,e))===null||w===void 0)&&w.length))o.set(b.id,{id:b.id,data:Object.assign(Object.assign({},b.data),{size:O})});else{const F=o.get(b.id);o.set(b.id,{id:b.id,data:Object.assign({nodes:[]},F==null?void 0:F.data)});const W=new Map,j=t.getChildren(b.id,e).map(et=>{if(et.data._isCombo)return o.has(et.id)||o.set(et.id,{id:et.id,data:Object.assign({},et.data)}),W.set(et.id,!0),o.get(et.id);const rt=n.get(et.id)||i.get(et.id);return W.set(et.id,!0),{id:et.id,data:Object.assign(Object.assign({},rt.data),et.data)}}),H={nodes:j,edges:a.filter(et=>W.has(et.source)&&W.has(et.target))};let K=1/0;j.forEach(et=>{var rt;let{size:lt}=et.data;lt||(lt=((rt=o.get(et.id))===null||rt===void 0?void 0:rt.data.size)||(l==null?void 0:l(et))||[30,30]),ie(lt)&&(lt=[lt,lt]);const[ht,yt]=lt;K>ht&&(K=ht),K>yt&&(K=yt),et.data.size=lt}),y=y.then(()=>(0,G.mG)(this,void 0,void 0,function*(){const et=new Vn(H);yield Mb(d,et,f,!0);const{minX:rt,minY:lt,maxX:ht,maxY:yt}=oL(j),Nt={x:(ht+rt)/2,y:(yt+lt)/2};H.nodes.forEach(pt=>{pt.data.x-=Nt.x,pt.data.y-=Nt.y});const Ct=[Math.max(ht-rt,K)+_*2,Math.max(yt-lt,K)+_*2];o.get(b.id).data.size=Ct,o.get(b.id).data.nodes=j}))}return!0},"BT",e),v.push(y)}),v}}function Mb(r,t,e,n){var i;return(0,G.mG)(this,void 0,void 0,function*(){return _v(r)?(r.execute(t,e),r.stop(),r.tick((i=e.iterations)!==null&&i!==void 0?i:300)):n?yield r.assign(t,e):yield r.execute(t,e)})}function sr(r){return function(){return r}}function Ka(r){return(r()-.5)*1e-6}function vL(r){return r.index}function Ab(r,t){var e=r.get(t);if(!e)throw new Error("node not found: "+t);return e}function gL(r){var t=vL,e=h,n,i=sr(30),a,s,o,l,c,u=1;r==null&&(r=[]);function h(p){return 1/Math.min(o[p.source.index],o[p.target.index])}function d(p){for(var y=0,b=r.length;y<u;++y)for(var w=0,O,_,F,W,j,H,K;w<b;++w)O=r[w],_=O.source,F=O.target,W=F.x+F.vx-_.x-_.vx||Ka(c),j=F.y+F.vy-_.y-_.vy||Ka(c),H=Math.sqrt(W*W+j*j),H=(H-a[w])/H*p*n[w],W*=H,j*=H,F.vx-=W*(K=l[w]),F.vy-=j*K,_.vx+=W*(K=1-K),_.vy+=j*K}function f(){if(s){var p,y=s.length,b=r.length,w=new Map(s.map((_,F)=>[t(_,F,s),_])),O;for(p=0,o=new Array(y);p<b;++p)O=r[p],O.index=p,typeof O.source!="object"&&(O.source=Ab(w,O.source)),typeof O.target!="object"&&(O.target=Ab(w,O.target)),o[O.source.index]=(o[O.source.index]||0)+1,o[O.target.index]=(o[O.target.index]||0)+1;for(p=0,l=new Array(b);p<b;++p)O=r[p],l[p]=o[O.source.index]/(o[O.source.index]+o[O.target.index]);n=new Array(b),v(),a=new Array(b),g()}}function v(){if(s)for(var p=0,y=r.length;p<y;++p)n[p]=+e(r[p],p,r)}function g(){if(s)for(var p=0,y=r.length;p<y;++p)a[p]=+i(r[p],p,r)}return d.initialize=function(p,y){s=p,c=y,f()},d.links=function(p){return arguments.length?(r=p,f(),d):r},d.id=function(p){return arguments.length?(t=p,d):t},d.iterations=function(p){return arguments.length?(u=+p,d):u},d.strength=function(p){return arguments.length?(e=typeof p=="function"?p:sr(+p),v(),d):e},d.distance=function(p){return arguments.length?(i=typeof p=="function"?p:sr(+p),g(),d):i},d}var pL=S(30168),mL=S(83833);const yL=1664525,bL=1013904223,Tb=4294967296;function xL(){let r=1;return()=>(r=(yL*r+bL)%Tb)/Tb}function EL(r){return r.x}function wL(r){return r.y}var SL=10,ML=Math.PI*(3-Math.sqrt(5));function AL(r){var t,e=1,n=.001,i=1-Math.pow(n,1/300),a=0,s=.6,o=new Map,l=(0,mL.HT)(h),c=(0,pL.Z)("tick","end"),u=xL();r==null&&(r=[]);function h(){d(),c.call("tick",t),e<n&&(l.stop(),c.call("end",t))}function d(g){var p,y=r.length,b;g===void 0&&(g=1);for(var w=0;w<g;++w)for(e+=(a-e)*i,o.forEach(function(O){O(e)}),p=0;p<y;++p)b=r[p],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function f(){for(var g=0,p=r.length,y;g<p;++g){if(y=r[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=SL*Math.sqrt(.5+g),w=g*ML;y.x=b*Math.cos(w),y.y=b*Math.sin(w)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function v(g){return g.initialize&&g.initialize(r,u),g}return f(),t={tick:d,restart:function(){return l.restart(h),t},stop:function(){return l.stop(),t},nodes:function(g){return arguments.length?(r=g,f(),o.forEach(v),t):r},alpha:function(g){return arguments.length?(e=+g,t):e},alphaMin:function(g){return arguments.length?(n=+g,t):n},alphaDecay:function(g){return arguments.length?(i=+g,t):+i},alphaTarget:function(g){return arguments.length?(a=+g,t):a},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(u=g,o.forEach(v),t):u},force:function(g,p){return arguments.length>1?(p==null?o.delete(g):o.set(g,v(p)),t):o.get(g)},find:function(g,p,y){var b=0,w=r.length,O,_,F,W,j;for(y==null?y=1/0:y*=y,b=0;b<w;++b)W=r[b],O=g-W.x,_=p-W.y,F=O*O+_*_,F<y&&(j=W,y=F);return j},on:function(g,p){return arguments.length>1?(c.on(g,p),t):c.on(g)}}}function TL(){var r,t,e,n,i=sr(-30),a,s=1,o=1/0,l=.81;function c(f){var v,g=r.length,p=(0,Pv.Z)(r,EL,wL).visitAfter(h);for(n=f,v=0;v<g;++v)t=r[v],p.visit(d)}function u(){if(r){var f,v=r.length,g;for(a=new Array(v),f=0;f<v;++f)g=r[f],a[g.index]=+i(g,f,r)}}function h(f){var v=0,g,p,y=0,b,w,O;if(f.length){for(b=w=O=0;O<4;++O)(g=f[O])&&(p=Math.abs(g.value))&&(v+=g.value,y+=p,b+=p*g.x,w+=p*g.y);f.x=b/y,f.y=w/y}else{g=f,g.x=g.data.x,g.y=g.data.y;do v+=a[g.data.index];while(g=g.next)}f.value=v}function d(f,v,g,p){if(!f.value)return!0;var y=f.x-t.x,b=f.y-t.y,w=p-v,O=y*y+b*b;if(w*w/l<O)return O<o&&(y===0&&(y=Ka(e),O+=y*y),b===0&&(b=Ka(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)),t.vx+=y*f.value*n/O,t.vy+=b*f.value*n/O),!0;if(f.length||O>=o)return;(f.data!==t||f.next)&&(y===0&&(y=Ka(e),O+=y*y),b===0&&(b=Ka(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)));do f.data!==t&&(w=a[f.data.index]*n/O,t.vx+=y*w,t.vy+=b*w);while(f=f.next)}return c.initialize=function(f,v){r=f,e=v,u()},c.strength=function(f){return arguments.length?(i=typeof f=="function"?f:sr(+f),u(),c):i},c.distanceMin=function(f){return arguments.length?(s=f*f,c):Math.sqrt(s)},c.distanceMax=function(f){return arguments.length?(o=f*f,c):Math.sqrt(o)},c.theta=function(f){return arguments.length?(l=f*f,c):Math.sqrt(l)},c}function OL(r,t){var e,n=1;r==null&&(r=0),t==null&&(t=0);function i(){var a,s=e.length,o,l=0,c=0;for(a=0;a<s;++a)o=e[a],l+=o.x,c+=o.y;for(l=(l/s-r)*n,c=(c/s-t)*n,a=0;a<s;++a)o=e[a],o.x-=l,o.y-=c}return i.initialize=function(a){e=a},i.x=function(a){return arguments.length?(r=+a,i):r},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function CL(r){return r.x+r.vx}function NL(r){return r.y+r.vy}function kL(r){var t,e,n,i=1,a=1;typeof r!="function"&&(r=sr(r==null?1:+r));function s(){for(var c,u=t.length,h,d,f,v,g,p,y=0;y<a;++y)for(h=(0,Pv.Z)(t,CL,NL).visitAfter(o),c=0;c<u;++c)d=t[c],g=e[d.index],p=g*g,f=d.x+d.vx,v=d.y+d.vy,h.visit(b);function b(w,O,_,F,W){var j=w.data,H=w.r,K=g+H;if(j){if(j.index>d.index){var et=f-j.x-j.vx,rt=v-j.y-j.vy,lt=et*et+rt*rt;lt<K*K&&(et===0&&(et=Ka(n),lt+=et*et),rt===0&&(rt=Ka(n),lt+=rt*rt),lt=(K-(lt=Math.sqrt(lt)))/lt*i,d.vx+=(et*=lt)*(K=(H*=H)/(p+H)),d.vy+=(rt*=lt)*K,j.vx-=et*(K=1-K),j.vy-=rt*K)}return}return O>f+K||F<f-K||_>v+K||W<v-K}}function o(c){if(c.data)return c.r=e[c.data.index];for(var u=c.r=0;u<4;++u)c[u]&&c[u].r>c.r&&(c.r=c[u].r)}function l(){if(t){var c,u=t.length,h;for(e=new Array(u),c=0;c<u;++c)h=t[c],e[h.index]=+r(h,c,t)}}return s.initialize=function(c,u){t=c,n=u,l()},s.iterations=function(c){return arguments.length?(a=+c,s):a},s.strength=function(c){return arguments.length?(i=+c,s):i},s.radius=function(c){return arguments.length?(r=typeof c=="function"?c:sr(+c),l(),s):r},s}function PL(r,t,e){var n,i=sr(.1),a,s;typeof r!="function"&&(r=sr(+r)),t==null&&(t=0),e==null&&(e=0);function o(c){for(var u=0,h=n.length;u<h;++u){var d=n[u],f=d.x-t||1e-6,v=d.y-e||1e-6,g=Math.sqrt(f*f+v*v),p=(s[u]-g)*a[u]*c/g;d.vx+=f*p,d.vy+=v*p}}function l(){if(n){var c,u=n.length;for(a=new Array(u),s=new Array(u),c=0;c<u;++c)s[c]=+r(n[c],c,n),a[c]=isNaN(s[c])?0:+i(n[c],c,n)}}return o.initialize=function(c){n=c,l()},o.strength=function(c){return arguments.length?(i=typeof c=="function"?c:sr(+c),l(),o):i},o.radius=function(c){return arguments.length?(r=typeof c=="function"?c:sr(+c),l(),o):r},o.x=function(c){return arguments.length?(t=+c,o):t},o.y=function(c){return arguments.length?(e=+c,o):e},o}function RL(r){var t=sr(.1),e,n,i;typeof r!="function"&&(r=sr(r==null?0:+r));function a(o){for(var l=0,c=e.length,u;l<c;++l)u=e[l],u.vx+=(i[l]-u.x)*n[l]*o}function s(){if(e){var o,l=e.length;for(n=new Array(l),i=new Array(l),o=0;o<l;++o)n[o]=isNaN(i[o]=+r(e[o],o,e))?0:+t(e[o],o,e)}}return a.initialize=function(o){e=o,s()},a.strength=function(o){return arguments.length?(t=typeof o=="function"?o:sr(+o),s(),a):t},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:sr(+o),s(),a):r},a}function LL(r){var t=sr(.1),e,n,i;typeof r!="function"&&(r=sr(r==null?0:+r));function a(o){for(var l=0,c=e.length,u;l<c;++l)u=e[l],u.vy+=(i[l]-u.y)*n[l]*o}function s(){if(e){var o,l=e.length;for(n=new Array(l),i=new Array(l),o=0;o<l;++o)n[o]=isNaN(i[o]=+r(e[o],o,e))?0:+t(e[o],o,e)}}return a.initialize=function(o){e=o,s()},a.strength=function(o){return arguments.length?(t=typeof o=="function"?o:sr(+o),s(),a):t},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:sr(+o),s(),a):r},a}class DL{constructor(t){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:gL,manyBody:TL,center:OL,collide:kL,radial:PL,x:RL,y:LL},this.options={link:{id:e=>e.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},mr(this.options,t),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericLayout(!0,t,e)})}stop(){this.simulation.stop()}tick(t){return this.simulation.tick(t),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(t,e){const n=this.context.nodes.find(i=>i.id===t);n&&e.forEach((i,a)=>{if(typeof i=="number"||i===null){const s=["fx","fy","fz"][a];n[s]=i}})}getOptions(t){var e,n;const i=mr({},this.options,t);return i.collide&&((e=i.collide)===null||e===void 0?void 0:e.radius)===void 0&&(i.collide=i.collide||{},i.collide.radius=(n=i.nodeSize)!==null&&n!==void 0?n:10),i.iterations===void 0&&(i.link&&i.link.iterations===void 0&&(i.iterations=i.link.iterations),i.collide&&i.collide.iterations===void 0&&(i.iterations=i.collide.iterations)),this.context.options=i,i}genericLayout(t,e,n){var i;return(0,G.mG)(this,void 0,void 0,function*(){const a=this.getOptions(n),s=e.getAllNodes().map(({id:u,data:h})=>Object.assign(Object.assign({id:u},h),Bs(h.data,this.config.inputNodeAttrs))),o=e.getAllEdges().map(u=>Object.assign({},u));Object.assign(this.context,{assign:t,nodes:s,edges:o,graph:e});const l=new Promise(u=>{this.resolver=u}),c=this.setSimulation(a);return c.nodes(s),(i=c.force("link"))===null||i===void 0||i.links(o),l})}getResult(){const{assign:t,nodes:e,edges:n,graph:i}=this.context,a=e.map(o=>({id:o.id,data:Object.assign(Object.assign({},o.data),Bs(o,this.config.outputNodeAttrs))})),s=n.map(({id:o,source:l,target:c,data:u})=>({id:o,source:typeof l=="object"?l.id:l,target:typeof c=="object"?c.id:c,data:u}));return t&&a.forEach(o=>i.mergeNodeData(o.id,o.data)),{nodes:a,edges:s}}initSimulation(){return AL()}setSimulation(t){const e=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=e.on("tick",()=>{var n;return(n=t.onTick)===null||n===void 0?void 0:n.call(t,this.getResult())}).on("end",()=>{var n;return(n=this.resolver)===null||n===void 0?void 0:n.call(this,this.getResult())})),Ob(e,this.config.simulationAttrs.map(n=>[n,t[n]])),Object.entries(this.forceMap).forEach(([n,i])=>{const a=n;if(t[n]){let s=e.force(a);s||(s=i(),e.force(a,s)),Ob(s,Object.entries(t[a]))}else e.force(a,null)}),e}}const Ob=(r,t)=>t.reduce((e,[n,i])=>!e[n]||i===void 0?e:e[n].call(r,i),r);var Cb=S(92546),_L=S.n(Cb);class eh{constructor(t){this.id="dagre",this.options={},Object.assign(this.options,eh.defaultOptions,t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,Object.assign(Object.assign({},this.options),e))})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,t,Object.assign(Object.assign({},this.options),e))})}genericDagreLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const{nodeSize:i}=n,a=new Cb.graphlib.Graph;a.setGraph(n),a.setDefaultEdgeLabel(()=>({}));const s=e.getAllNodes(),o=e.getAllEdges();[...s,...o].some(({id:c})=>ie(c))&&console.error("Dagre layout only support string id, it will convert number to string."),e.getAllNodes().forEach(c=>{const{id:u}=c,h=Object.assign({},c.data);if(i!==void 0){const[d,f]=Pl(fe(i)?i(c):i);Object.assign(h,{width:d,height:f})}a.setNode(u.toString(),h)}),e.getAllEdges().forEach(({id:c,source:u,target:h})=>{a.setEdge(u.toString(),h.toString(),{id:c})}),_L().layout(a);const l={nodes:[],edges:[]};return a.nodes().forEach(c=>{const u=a.node(c);l.nodes.push({id:c,data:u}),t&&e.mergeNodeData(c,u)}),a.edges().forEach(c=>{const u=a.edge(c),{id:h}=u,d=(0,G._T)(u,["id"]),{v:f,w:v}=c;l.edges.push({id:h,source:f,target:v,data:d}),t&&e.mergeEdgeData(h,d)}),l})}}eh.defaultOptions={};class Iv{constructor(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}distanceTo(t){const e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)}setPos(t,e){this.rx=t,this.ry=e}resetForce(){this.fx=0,this.fy=0}addForce(t){const e=t.rx-this.rx,n=t.ry-this.ry;let i=Math.hypot(e,n);i=i<1e-4?1e-4:i;const a=this.g*(this.degree+1)*(t.degree+1)/i;this.fx+=a*e/i,this.fy+=a*n/i}in(t){return t.contains(this.rx,this.ry)}add(t){const e=this.mass+t.mass,n=(this.rx*this.mass+t.rx*t.mass)/e,i=(this.ry*this.mass+t.ry*t.mass)/e,a=this.degree+t.degree,s={rx:n,ry:i,mass:e,degree:a};return new Iv(s)}}class xo{constructor(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}getLength(){return this.length}contains(t,e){const n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n}NW(){const t=this.xmid-this.length/4,e=this.ymid+this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new xo(i)}NE(){const t=this.xmid+this.length/4,e=this.ymid+this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new xo(i)}SW(){const t=this.xmid-this.length/4,e=this.ymid-this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new xo(i)}SE(){const t=this.xmid+this.length/4,e=this.ymid-this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new xo(i)}}class Eo{constructor(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,t!=null&&(this.quad=t)}insert(t){if(this.body==null){this.body=t;return}this._isExternal()?(this.quad&&(this.NW=new Eo(this.quad.NW()),this.NE=new Eo(this.quad.NE()),this.SW=new Eo(this.quad.SW()),this.SE=new Eo(this.quad.SE())),this._putBody(this.body),this._putBody(t),this.body=this.body.add(t)):(this.body=this.body.add(t),this._putBody(t))}_putBody(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(t){if(!(this.body==null||t===this.body))if(this._isExternal())t.addForce(this.body);else{const e=this.quad?this.quad.getLength():0,n=this.body.distanceTo(t);e/n<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t))}}}const IL={center:[0,0],width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1};class BL{constructor(t={}){this.options=t,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},IL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericForceAtlas2Layout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericForceAtlas2Layout(!0,t,e)})}genericForceAtlas2Layout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=e.getAllEdges(),a=e.getAllNodes(),s=this.formatOptions(n,a.length),{width:o,height:l,prune:c,maxIteration:u,nodeSize:h,center:d}=s;if(!(a!=null&&a.length)||a.length===1)return Zs(e,t,d);const f=a.map(y=>ci(y,[o,l])),v=i.filter(y=>{const{source:b,target:w}=y;return b!==w}),g=new Vn({nodes:f,edges:v}),p=this.getSizes(g,h);if(this.run(g,e,u,p,t,s),c){for(let b=0;b<v.length;b+=1){const{source:w,target:O}=v[b],_=g.getDegree(w),F=g.getDegree(w);if(_<=1){const W=g.getNode(O);g.mergeNodeData(w,{x:W.data.x,y:W.data.y})}else if(F<=1){const W=g.getNode(w);g.mergeNodeData(O,{x:W.data.x,y:W.data.y})}}const y=Object.assign(Object.assign({},s),{prune:!1,barnesHut:!1});this.run(g,e,100,p,t,y)}return{nodes:f,edges:i}})}getSizes(t,e){const n=t.getAllNodes(),i={};for(let a=0;a<n.length;a+=1){const s=n[a];i[s.id]=Cv(e,void 0)(s)}return i}formatOptions(t={},e){const n=Object.assign(Object.assign({},this.options),t),{center:i,width:a,height:s,barnesHut:o,prune:l,maxIteration:c,kr:u,kg:h}=n;return n.width=!a&&typeof window!="undefined"?window.innerWidth:a,n.height=!s&&typeof window!="undefined"?window.innerHeight:s,n.center=i||[n.width/2,n.height/2],o===void 0&&e>250&&(n.barnesHut=!0),l===void 0&&e>100&&(n.prune=!0),c===0&&!l?(n.maxIteration=250,e<=200&&e>100?n.maxIteration=1e3:e>200&&(n.maxIteration=1200)):c===0&&l&&(n.maxIteration=100,e<=200&&e>100?n.maxIteration=500:e>200&&(n.maxIteration=950)),u||(n.kr=50,e>100&&e<=500?n.kr=20:e>500&&(n.kr=1)),h||(n.kg=20,e>100&&e<=500?n.kg=10:e>500&&(n.kg=1)),n}run(t,e,n,i,a,s){const{kr:o,barnesHut:l,onTick:c}=s,u=t.getAllNodes();let h=0,d=n;const f={},v={},g={};for(let p=0;p<u.length;p+=1){const{data:y,id:b}=u[p];if(f[b]=[0,0],l){const w={id:p,rx:y.x,ry:y.y,mass:1,g:o,degree:t.getDegree(b)};g[b]=new Iv(w)}}for(;d>0;)h=this.oneStep(t,{iter:d,preventOverlapIters:50,krPrime:100,sg:h,forces:f,preForces:v,bodies:g,sizes:i},s),d--,c==null||c({nodes:u,edges:e.getAllEdges()});return t}oneStep(t,e,n){const{iter:i,preventOverlapIters:a,krPrime:s,sg:o,preForces:l,bodies:c,sizes:u}=e;let{forces:h}=e;const{preventOverlap:d,barnesHut:f}=n,v=t.getAllNodes();for(let g=0;g<v.length;g+=1){const{id:p}=v[g];l[p]=[...h[p]],h[p]=[0,0]}return h=this.getAttrForces(t,i,a,u,h,n),f&&(d&&i>a||!d)?h=this.getOptRepGraForces(t,h,c,n):h=this.getRepGraForces(t,i,a,h,s,u,n),this.updatePos(t,h,l,o,n)}getAttrForces(t,e,n,i,a,s){const{preventOverlap:o,dissuadeHubs:l,mode:c,prune:u}=s,h=t.getAllEdges();for(let d=0;d<h.length;d+=1){const{source:f,target:v}=h[d],g=t.getNode(f),p=t.getNode(v),y=t.getDegree(f),b=t.getDegree(v);if(u&&(y<=1||b<=1))continue;const w=[p.data.x-g.data.x,p.data.y-g.data.y];let O=Math.hypot(w[0],w[1]);O=O<1e-4?1e-4:O,w[0]=w[0]/O,w[1]=w[1]/O,o&&e<n&&(O=O-i[f]-i[v]);let _=O,F=_;c==="linlog"&&(_=Math.log(1+O),F=_),l&&(_=O/y,F=O/b),o&&e<n&&O<=0?(_=0,F=0):o&&e<n&&O>0&&(_=O,F=O),a[f][0]+=_*w[0],a[v][0]-=F*w[0],a[f][1]+=_*w[1],a[v][1]-=F*w[1]}return a}getOptRepGraForces(t,e,n,i){const{kg:a,center:s,prune:o}=i,l=t.getAllNodes(),c=l.length;let u=9e10,h=-9e10,d=9e10,f=-9e10;for(let b=0;b<c;b+=1){const{id:w,data:O}=l[b];o&&t.getDegree(w)<=1||(n[w].setPos(O.x,O.y),O.x>=h&&(h=O.x),O.x<=u&&(u=O.x),O.y>=f&&(f=O.y),O.y<=d&&(d=O.y))}const v=Math.max(h-u,f-d),g={xmid:(h+u)/2,ymid:(f+d)/2,length:v,massCenter:s,mass:c},p=new xo(g),y=new Eo(p);for(let b=0;b<c;b+=1){const{id:w}=l[b];o&&t.getDegree(w)<=1||n[w].in(p)&&y.insert(n[w])}for(let b=0;b<c;b+=1){const{id:w,data:O}=l[b],_=t.getDegree(w);if(o&&_<=1)continue;n[w].resetForce(),y.updateForce(n[w]),e[w][0]-=n[w].fx,e[w][1]-=n[w].fy;const F=[O.x-s[0],O.y-s[1]];let W=Math.hypot(F[0],F[1]);W=W<1e-4?1e-4:W,F[0]=F[0]/W,F[1]=F[1]/W;const j=a*(_+1);e[w][0]-=j*F[0],e[w][1]-=j*F[1]}return e}getRepGraForces(t,e,n,i,a,s,o){const{preventOverlap:l,kr:c,kg:u,center:h,prune:d}=o,f=t.getAllNodes(),v=f.length;for(let g=0;g<v;g+=1){const p=f[g],y=t.getDegree(p.id);for(let _=g+1;_<v;_+=1){const F=f[_],W=t.getDegree(F.id);if(d&&(y<=1||W<=1))continue;const j=[F.data.x-p.data.x,F.data.y-p.data.y];let H=Math.hypot(j[0],j[1]);H=H<1e-4?1e-4:H,j[0]=j[0]/H,j[1]=j[1]/H,l&&e<n&&(H=H-s[p.id]-s[F.id]);let K=c*(y+1)*(W+1)/H;l&&e<n&&H<0?K=a*(y+1)*(W+1):l&&e<n&&H===0?K=0:l&&e<n&&H>0&&(K=c*(y+1)*(W+1)/H),i[p.id][0]-=K*j[0],i[F.id][0]+=K*j[0],i[p.id][1]-=K*j[1],i[F.id][1]+=K*j[1]}const b=[p.data.x-h[0],p.data.y-h[1]],w=Math.hypot(b[0],b[1]);b[0]=b[0]/w,b[1]=b[1]/w;const O=u*(y+1);i[p.id][0]-=O*b[0],i[p.id][1]-=O*b[1]}return i}updatePos(t,e,n,i,a){const{ks:s,tao:o,prune:l,ksmax:c}=a,u=t.getAllNodes(),h=u.length,d=[],f=[];let v=0,g=0,p=i;for(let b=0;b<h;b+=1){const{id:w}=u[b],O=t.getDegree(w);if(l&&O<=1)continue;const _=[e[w][0]-n[w][0],e[w][1]-n[w][1]],F=Math.hypot(_[0],_[1]),W=[e[w][0]+n[w][0],e[w][1]+n[w][1]],j=Math.hypot(W[0],W[1]);d[b]=F,f[b]=j/2,v+=(O+1)*d[b],g+=(O+1)*f[b]}const y=p;p=o*g/v,y!==0&&(p=p>1.5*y?1.5*y:p);for(let b=0;b<h;b+=1){const{id:w,data:O}=u[b],_=t.getDegree(w);if(l&&_<=1||ie(O.fx)&&ie(O.fy))continue;let F=s*p/(1+p*Math.sqrt(d[b])),W=Math.hypot(e[w][0],e[w][1]);W=W<1e-4?1e-4:W;const j=c/W;F=F>j?j:F;const H=F*e[w][0],K=F*e[w][1];t.mergeNodeData(w,{x:O.x+H,y:O.y+K})}return p}}const FL={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},zL=800;class jL{constructor(t={}){this.options=t,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},FL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericFruchtermanLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericFruchtermanLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;n<t;n++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),e}genericFruchtermanLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){if(this.running)return;const i=this.formatOptions(n),{dimensions:a,width:s,height:o,center:l,clustering:c,nodeClusterBy:u,maxIteration:h,onTick:d}=i,f=e.getAllNodes(),v=e.getAllEdges();if(!(f!=null&&f.length)){const w={nodes:[],edges:v};return this.lastResult=w,w}if(f.length===1){t&&e.mergeNodeData(f[0].id,{x:l[0],y:l[1],z:a===3?l[2]:void 0});const w={nodes:[Object.assign(Object.assign({},f[0]),{data:Object.assign(Object.assign({},f[0].data),{x:l[0],y:l[1],z:a===3?l[2]:void 0})})],edges:v};return this.lastResult=w,w}const g=f.map(w=>ci(w,[s,o])),p=new Vn({nodes:g,edges:v}),y={};if(c&&g.forEach(w=>{const O=w.data[u];y[O]||(y[O]={name:O,cx:0,cy:0,count:0})}),this.lastLayoutNodes=g,this.lastLayoutEdges=v,this.lastAssign=t,this.lastGraph=p,this.lastOptions=i,this.lastClusterMap=y,typeof window=="undefined")return;let b=0;return new Promise(w=>{this.timeInterval=window.setInterval(()=>{if(!this.running){w({nodes:g,edges:v});return}this.runOneStep(p,y,i),t&&g.forEach(({id:O,data:_})=>e.mergeNodeData(O,{x:_.x,y:_.y,z:a===3?_.z:void 0})),d==null||d({nodes:g,edges:v}),b++,b>=h&&(window.clearInterval(this.timeInterval),w({nodes:g,edges:v}))},0),this.running=!0})})}formatOptions(t={}){const e=Object.assign(Object.assign({},this.options),t),{clustering:n,nodeClusterBy:i}=e,{center:a,width:s,height:o}=e;return e.width=!s&&typeof window!="undefined"?window.innerWidth:s,e.height=!o&&typeof window!="undefined"?window.innerHeight:o,e.center=a||[e.width/2,e.height/2],e.clustering=n&&!!i,e}runOneStep(t,e,n){const{dimensions:i,height:a,width:s,gravity:o,center:l,speed:c,clustering:u,nodeClusterBy:h,clusterGravity:d}=n,f=a*s,v=Math.sqrt(f)/10,g=t.getAllNodes(),p=f/(g.length+1),y=Math.sqrt(p),b={};if(this.applyCalculate(t,b,y,p),u){for(const O in e)e[O].cx=0,e[O].cy=0,e[O].count=0;g.forEach(O=>{const{data:_}=O,F=e[_[h]];ie(_.x)&&(F.cx+=_.x),ie(_.y)&&(F.cy+=_.y),F.count++});for(const O in e)e[O].cx/=e[O].count,e[O].cy/=e[O].count;const w=d||o;g.forEach((O,_)=>{const{id:F,data:W}=O;if(!ie(W.x)||!ie(W.y))return;const j=e[W[h]],H=Math.sqrt((W.x-j.cx)*(W.x-j.cx)+(W.y-j.cy)*(W.y-j.cy)),K=y*w;b[F].x-=K*(W.x-j.cx)/H,b[F].y-=K*(W.y-j.cy)/H})}g.forEach((w,O)=>{const{id:_,data:F}=w;if(!ie(F.x)||!ie(F.y))return;const W=.01*y*o;b[_].x-=W*(F.x-l[0]),b[_].y-=W*(F.y-l[1]),i===3&&(b[_].z-=W*(F.z-l[2]))}),g.forEach((w,O)=>{const{id:_,data:F}=w;if(ie(F.fx)&&ie(F.fy)){F.x=F.fx,F.y=F.fy,i===3&&(F.z=F.fz);return}if(!ie(F.x)||!ie(F.y))return;const W=Math.sqrt(b[_].x*b[_].x+b[_].y*b[_].y+(i===3?b[_].z*b[_].z:0));if(W>0){const j=Math.min(v*(c/zL),W);t.mergeNodeData(_,{x:F.x+b[_].x/W*j,y:F.y+b[_].y/W*j,z:i===3?F.z+b[_].z/W*j:void 0})}})}applyCalculate(t,e,n,i){this.calRepulsive(t,e,i),this.calAttractive(t,e,n)}calRepulsive(t,e,n){const i=t.getAllNodes();i.forEach(({data:a,id:s},o)=>{e[s]={x:0,y:0,z:0},i.forEach(({data:l,id:c},u)=>{if(o<=u||!ie(a.x)||!ie(l.x)||!ie(a.y)||!ie(l.y))return;let h=a.x-l.x,d=a.y-l.y,f=this.options.dimensions===3?a.z-l.z:0,v=h*h+d*d+f*f;v===0&&(v=1,h=.01,d=.01,f=.01);const g=n/v,p=h*g,y=d*g,b=f*g;e[s].x+=p,e[s].y+=y,e[c].x-=p,e[c].y-=y,this.options.dimensions===3&&(e[s].z+=b,e[c].z-=b)})})}calAttractive(t,e,n){t.getAllEdges().forEach(a=>{const{source:s,target:o}=a;if(!s||!o||s===o)return;const{data:l}=t.getNode(s),{data:c}=t.getNode(o);if(!ie(c.x)||!ie(l.x)||!ie(c.y)||!ie(l.y))return;const u=c.x-l.x,h=c.y-l.y,d=this.options.dimensions===3?c.z-l.z:0,f=Math.sqrt(u*u+h*h+d*d)/n,v=u*f,g=h*f,p=d*f;e[s].x+=v,e[s].y+=g,e[o].x-=v,e[o].y-=g,this.options.dimensions===3&&(e[s].z+=p,e[o].z-=p)})}}const ZL={begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,width:300,height:300};class WL{constructor(t={}){this.options=t,this.id="grid",this.options=Object.assign(Object.assign({},ZL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericGridLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericGridLayout(!0,t,e)})}genericGridLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{begin:a=[0,0],condense:s,preventOverlapPadding:o,preventOverlap:l,rows:c,cols:u,nodeSpacing:h,nodeSize:d,width:f,height:v,position:g}=i;let{sortBy:p}=i;const y=e.getAllNodes(),b=e.getAllEdges(),w=y==null?void 0:y.length;if(!w||w===1)return Zs(e,t,a);const O=y.map(yt=>ci(yt));p!=="id"&&(!Ve(p)||O[0].data[p]===void 0)&&(p="degree"),p==="degree"?O.sort((yt,Nt)=>e.getDegree(Nt.id,"both")-e.getDegree(yt.id,"both")):p==="id"?O.sort((yt,Nt)=>ie(Nt.id)&&ie(yt.id)?Nt.id-yt.id:`${yt.id}`.localeCompare(`${Nt.id}`)):O.sort((yt,Nt)=>Nt.data[p]-yt.data[p]);const _=!f&&typeof window!="undefined"?window.innerWidth:f,F=!v&&typeof window!="undefined"?window.innerHeight:v,W=w,j={rows:c,cols:u};if(c!=null&&u!=null)j.rows=c,j.cols=u;else if(c!=null&&u==null)j.rows=c,j.cols=Math.ceil(W/j.rows);else if(c==null&&u!=null)j.cols=u,j.rows=Math.ceil(W/j.cols);else{const yt=Math.sqrt(W*F/_);j.rows=Math.round(yt),j.cols=Math.round(_/F*yt)}if(j.rows=Math.max(j.rows,1),j.cols=Math.max(j.cols,1),j.cols*j.rows>W){const yt=nh(j),Nt=rh(j);(yt-1)*Nt>=W?nh(j,yt-1):(Nt-1)*yt>=W&&rh(j,Nt-1)}else for(;j.cols*j.rows<W;){const yt=nh(j),Nt=rh(j);(Nt+1)*yt>=W?rh(j,Nt+1):nh(j,yt+1)}let H=s?0:_/j.cols,K=s?0:F/j.rows;if(l||h){const yt=js(10,h),Nt=Ov(30,d,!1);O.forEach(Ct=>{(!Ct.data.x||!Ct.data.y)&&(Ct.data.x=0,Ct.data.y=0);const pt=e.getNode(Ct.id),[xt,kt]=Pl(Nt(pt)||30),jt=yt!==void 0?yt(Ct):o,Xt=xt+jt,ee=kt+jt;H=Math.max(H,Xt),K=Math.max(K,ee)})}const et={},rt={row:0,col:0},lt={};for(let yt=0;yt<O.length;yt++){const Nt=O[yt];let Ct;if(g&&(Ct=g(e.getNode(Nt.id))),Ct&&(Ct.row!==void 0||Ct.col!==void 0)){const pt={row:Ct.row,col:Ct.col};if(pt.col===void 0)for(pt.col=0;Bv(et,pt);)pt.col++;else if(pt.row===void 0)for(pt.row=0;Bv(et,pt);)pt.row++;lt[Nt.id]=pt,Nb(et,pt)}GL(Nt,a,H,K,lt,j,rt,et)}const ht={nodes:O,edges:b};return t&&O.forEach(yt=>{e.mergeNodeData(yt.id,{x:yt.data.x,y:yt.data.y})}),ht})}}const nh=(r,t)=>{let e;const n=r.rows||5,i=r.cols||5;return t==null?e=Math.min(n,i):Math.min(n,i)===r.rows?r.rows=t:r.cols=t,e},rh=(r,t)=>{let e;const n=r.rows||5,i=r.cols||5;return t==null?e=Math.max(n,i):Math.max(n,i)===r.rows?r.rows=t:r.cols=t,e},Bv=(r,t)=>r[`c-${t.row}-${t.col}`]||!1,Nb=(r,t)=>r[`c-${t.row}-${t.col}`]=!0,kb=(r,t)=>{const e=r.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},GL=(r,t,e,n,i,a,s,o)=>{let l,c;const u=i[r.id];if(u)l=u.col*e+e/2+t[0],c=u.row*n+n/2+t[1];else{for(;Bv(o,s);)kb(a,s);l=s.col*e+e/2+t[0],c=s.row*n+n/2+t[1],Nb(o,s),kb(a,s)}r.data.x=l,r.data.y=c},VL=(r,t,e)=>{try{const n=Xa.mul(Xa.pow(t,2),-.5),i=n.mean("row"),a=n.mean("column"),s=n.mean();n.add(s).subRowVector(i).subColumnVector(a);const o=new bb(n),l=Xa.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(c=>Xa.mul([c],[l]).toJSON()[0].splice(0,r))}catch(n){const i=[];for(let a=0;a<t.length;a++){const s=Math.random()*e,o=Math.random()*e;i.push([s,o])}return i}},UL=800,YL={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},HL=(r,t)=>{const e=Object.assign(Object.assign({},YL),t),{positions:n,iterations:i,width:a,k:s,speed:o=100,strictRadial:l,focusIdx:c,radii:u=[],nodeSizeFunc:h}=e,d=r.getAllNodes(),f=[],v=a/10;for(let g=0;g<i;g++)n.forEach((p,y)=>{f[y]={x:0,y:0}}),XL(d,n,f,s,u,h),KL(n,f,o,l,c,v,a,u);return n},XL=(r,t,e,n,i,a)=>{t.forEach((s,o)=>{e[o]={x:0,y:0},t.forEach((l,c)=>{if(o===c||i[o]!==i[c])return;let u=s.x-l.x,h=s.y-l.y,d=Math.sqrt(u*u+h*h);if(d===0){d=1;const f=o>c?1:-1;u=.01*f,h=.01*f}if(d<a(r[o])/2+a(r[c])/2){const f=n*n/d;e[o].x+=u/d*f,e[o].y+=h/d*f}})})},KL=(r,t,e,n,i,a,s,o)=>{const l=a||s/10;return n&&t.forEach((c,u)=>{const h=r[u].x-r[i].x,d=r[u].y-r[i].y,f=Math.sqrt(h*h+d*d);let v=d/f,g=-h/f;const p=Math.sqrt(c.x*c.x+c.y*c.y);let y=Math.acos((v*c.x+g*c.y)/p);y>Math.PI/2&&(y-=Math.PI/2,v*=-1,g*=-1);const b=Math.cos(y)*p;c.x=v*b,c.y=g*b}),r.forEach((c,u)=>{if(u===i)return;const h=Math.sqrt(t[u].x*t[u].x+t[u].y*t[u].y);if(h>0&&u!==i){const d=Math.min(l*(e/UL),h);if(c.x+=t[u].x/h*d,c.y+=t[u].y/h*d,n){let f=c.x-r[i].x,v=c.y-r[i].y;const g=Math.sqrt(f*f+v*v);f=f/g*o[u],v=v/g*o[u],c.x=r[i].x+f,c.y=r[i].y+v}}}),r},QL={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class qL{constructor(t={}){this.options=t,this.id="radial",this.options=Object.assign(Object.assign({},QL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericRadialLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericRadialLayout(!0,t,e)})}genericRadialLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,focusNode:l,unitRadius:c,nodeSize:u,nodeSpacing:h,strictRadial:d,preventOverlap:f,maxPreventOverlapIteration:v,sortBy:g,linkDistance:p=50,sortStrength:y=10,maxIteration:b=1e3}=i,w=e.getAllNodes(),O=e.getAllEdges(),_=!a&&typeof window!="undefined"?window.innerWidth:a,F=!s&&typeof window!="undefined"?window.innerHeight:s,W=o||[_/2,F/2];if(!(w!=null&&w.length)||w.length===1)return Zs(e,t,W);let j=w[0];if(Ve(l)){for(let me=0;me<w.length;me++)if(w[me].id===l){j=w[me];break}}else j=l||w[0];const H=tD(w,j.id),K=Eb({nodes:w,edges:O},!1),et=xb(K),rt=nD(et,H);eD(et,H,rt+1);const lt=et[H];let ht=_-W[0]>W[0]?W[0]:_-W[0],yt=F-W[1]>W[1]?W[1]:F-W[1];ht===0&&(ht=_/2),yt===0&&(yt=F/2);const Nt=Math.min(ht,yt),Ct=Math.max(...lt),pt=[],xt=c||Nt/Ct;lt.forEach((me,De)=>{pt[De]=me*xt});const kt=JL(w,et,p,pt,xt,g,y),jt=$L(kt),Xt=VL(p,kt,p);let ee=Xt.map(([me,De])=>({x:(isNaN(me)?Math.random()*p:me)-Xt[H][0],y:(isNaN(De)?Math.random()*p:De)-Xt[H][1]}));this.run(b,ee,jt,kt,pt,H);let ce;if(f){ce=Cv(u,h);const me={nodes:w,nodeSizeFunc:ce,positions:ee,radii:pt,height:F,width:_,strictRadial:!!d,focusIdx:H,iterations:v||200,k:ee.length/4.5};ee=HL(e,me)}const ue=[];return ee.forEach((me,De)=>{const Ge=ci(w[De]);Ge.data.x=me.x+W[0],Ge.data.y=me.y+W[1],ue.push(Ge)}),t&&ue.forEach(me=>e.mergeNodeData(me.id,{x:me.data.x,y:me.data.y})),{nodes:ue,edges:O}})}run(t,e,n,i,a,s){for(let o=0;o<=t;o++){const l=o/t;this.oneIteration(l,e,a,i,n,s)}}oneIteration(t,e,n,i,a,s){const o=1-t;e.forEach((l,c)=>{const u=wb(l,{x:0,y:0}),h=u===0?0:1/u;if(c===s)return;let d=0,f=0,v=0;e.forEach((p,y)=>{if(c===y)return;const b=wb(l,p),w=b===0?0:1/b,O=i[y][c];v+=a[c][y],d+=a[c][y]*(p.x+O*(l.x-p.x)*w),f+=a[c][y]*(p.y+O*(l.y-p.y)*w)});const g=n[c]===0?0:1/n[c];v*=o,v+=t*g*g,d*=o,d+=t*g*l.x*h,l.x=d/v,f*=o,f+=t*g*l.y*h,l.y=f/v})}}const JL=(r,t,e,n,i,a,s)=>{if(!r)return[];const o=[];if(t){const l={};t.forEach((c,u)=>{const h=[];c.forEach((d,f)=>{var v,g;if(u===f)h.push(0);else if(n[u]===n[f])if(a==="data")h.push(d*(Math.abs(u-f)*s)/(n[u]/i));else if(a){let p,y;if(l[r[u].id])p=l[r[u].id];else{const b=(a==="id"?r[u].id:(v=r[u].data)===null||v===void 0?void 0:v[a])||0;Ve(b)?p=b.charCodeAt(0):p=b,l[r[u].id]=p}if(l[r[f].id])y=l[r[f].id];else{const b=(a==="id"?r[f].id:(g=r[f].data)===null||g===void 0?void 0:g[a])||0;Ve(b)?y=b.charCodeAt(0):y=b,l[r[f].id]=y}h.push(d*(Math.abs(p-y)*s)/(n[u]/i))}else h.push(d*e/(n[u]/i));else{const p=(e+i)/2;h.push(d*p)}}),o.push(h)})}return o},$L=r=>{const t=r.length,e=r[0].length,n=[];for(let i=0;i<t;i++){const a=[];for(let s=0;s<e;s++)r[i][s]!==0?a.push(1/(r[i][s]*r[i][s])):a.push(0);n.push(a)}return n},tD=(r,t)=>{let e=-1;return r.forEach((n,i)=>{n.id===t&&(e=i)}),Math.max(e,0)},eD=(r,t,e)=>{const n=r.length;for(let i=0;i<n;i++)if(r[t][i]===1/0){r[t][i]=e,r[i][t]=e;for(let a=0;a<n;a++)r[i][a]!==1/0&&r[t][a]===1/0&&(r[t][a]=e+r[i][a],r[a][t]=e+r[i][a])}for(let i=0;i<n;i++)if(i!==t){for(let a=0;a<n;a++)if(r[i][a]===1/0){let s=Math.abs(r[t][i]-r[t][a]);s=s===0?1:s,r[i][a]=s}}},nD=(r,t)=>{let e=0;for(let n=0;n<r[t].length;n++)r[t][n]!==1/0&&(e=r[t][n]>e?r[t][n]:e);return e},rD={center:[0,0],width:300,height:300};class iD{constructor(t={}){this.options=t,this.id="random",this.options=Object.assign(Object.assign({},rD),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericRandomLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericRandomLayout(!0,t,e)})}genericRandomLayout(t,e,n){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o}=i,l=e.getAllNodes(),c=.9,u=!s&&typeof window!="undefined"?window.innerWidth:s,h=!o&&typeof window!="undefined"?window.innerHeight:o,d=a||[u/2,h/2],f=[];return l&&l.forEach(g=>{f.push({id:g.id,data:{x:(Math.random()-.5)*c*u+d[0],y:(Math.random()-.5)*c*h+d[1]}})}),t&&f.forEach(g=>e.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:f,edges:e.getAllEdges()}})}}function aD(r){var t,e,n,i=r||1;function a(o,l){++t>i&&(n=e,s(1),++t),e[o]=l}function s(o){t=0,e=Object.create(null),o||(n=Object.create(null))}return s(),{clear:s,has:function(o){return e[o]!==void 0||n[o]!==void 0},get:function(o){var l=e[o];if(l!==void 0)return l;if((l=n[o])!==void 0)return a(o,l),l},set:function(o,l){e[o]!==void 0?e[o]=l:a(o,l)}}}var Fv=new Map;function zv(r,t,e){e===void 0&&(e=128);var n=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=t?t.apply(this,i):i[0];Fv.has(r)||Fv.set(r,aD(e));var o=Fv.get(r);if(o.has(s))return o.get(s);var l=r.apply(this,i);return o.set(s,l),l};return n}var sD=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class ih extends Yu{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const t=this.context.model.getRootsData();if(!(ra(t)||t.length>2))return t[0]}formatSize(t){const e=typeof t=="function"?t:()=>t;return n=>oi(e(n))}doLayout(t,e){const{hGap:n,getRibSep:i,vGap:a,nodeSize:s,height:o}=e,{model:l}=this.context,c=this.formatSize(s);let u=c(t)[0]+i(t);const h=(w,O=0)=>{var _;return O+=n*((w.children||[]).length+1),(_=w.children)===null||_===void 0||_.forEach(F=>{var W;(W=l.getNodeLikeDatum(F).children)===null||W===void 0||W.forEach(H=>{const K=l.getNodeLikeDatum(H);O=h(K,O)})}),O},d=w=>{if(w.depth===1)return u;const O=l.getParentData(w.id,"tree");if(wo(w)){const _=l.getParentData(O.id,"tree"),F=g(w)-g(_);return d(O)+F*n/a}else{const _=(O.children||[]).indexOf(w.id),F=l.getNodeData((O.children||[]).slice(_));return f(O)-F.reduce((W,j)=>W+h(j),0)-c(O)[0]/2}},f=zv(w=>{if(jv(w))return c(w)[0]/2;const O=l.getParentData(w.id,"tree");if(wo(w))return d(w)+h(w)+c(w)[0]/2;{const _=g(w)-g(O),F=n/a;return d(w)+_*F}},w=>w.id),v=w=>g(l.getParentData(w,"tree")),g=zv(w=>{if(jv(w))return o/2;if(wo(w)){const O=l.getParentData(w.id,"tree"),_=O.children.indexOf(w.id);if(_===0)return v(O.id)+a;const F=l.getNodeLikeDatum(O.children[_-1]);if(ra(F.children))return g(F)+a;const W=l.getDescendantsData(F.id);return Math.max(...W.map(j=>wo(j)?v(j.id):g(j)))+a}else{if(ra(w.children))return v(w.id)+a;const O=l.getNodeLikeDatum(w.children.slice(-1)[0]);if(ra(O.children))return g(O)+a;const _=l.getDescendantsData(w.id).slice(-1)[0];return(wo(_)?v(_.id):g(_))+a}},w=>w.id);let p=0;const y={nodes:[],edges:[]},b=w=>{var O;(O=w.children)===null||O===void 0||O.forEach(H=>b(l.getNodeLikeDatum(H)));const _=g(w),F=f(w);if(y.nodes.push({id:w.id,x:F,y:_}),jv(w))return;const W=l.getRelatedEdgesData(w.id,"in")[0],j=[d(w),wo(w)?_:v(w.id)];y.edges.push({id:At(W),controlPoints:[j],relatedNodeId:w.id}),p=Math.max(p,F+i(w)),w.depth===1&&(u=p)};return b(t),y}placeAlterative(t,e){const n=(e.children||[]).filter((o,l)=>l%2!==0);if(n.length===0)return t;const{model:i}=this.context,a=t.nodes.find(o=>o.id===e.id).y,s=o=>{const l=i.getAncestorsData(o,"tree");if(ra(l))return!1;const c=l.length===1?o:l[l.length-2].id;return n.includes(c)};t.nodes.forEach(o=>{s(o.id)&&(o.y=2*a-o.y)}),t.edges.forEach(o=>{s(o.relatedNodeId)&&(o.controlPoints=o.controlPoints.map(l=>[l[0],2*a-l[1]]))})}rightToLeft(t,e){return t.nodes.forEach(n=>n.x=e.width-n.x),t.edges.forEach(n=>{n.controlPoints=n.controlPoints.map(i=>[e.width-i[0],i[1]])}),t}execute(t,e){return sD(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign({},ih.defaultOptions),this.options),e),{direction:i,nodeSize:a}=n,s=this.getRoot();if(!s)return t;const o=this.formatSize(a);n.vGap||(n.vGap=Math.max(...(t.nodes||[]).map(d=>o(d)[1]))),n.hGap||(n.hGap=Math.max(...(t.nodes||[]).map(d=>o(d)[0])));let l=this.doLayout(s,n);this.placeAlterative(l,s),i==="RL"&&(l=this.rightToLeft(l,n));const{model:c}=this.context,u=[],h=[];return l.nodes.forEach(d=>{const{id:f,x:v,y:g}=d,p=c.getNodeLikeDatum(f);u.push(Pb(p,{x:v,y:g}))}),l.edges.forEach(d=>{const{id:f,controlPoints:v}=d,g=c.getEdgeDatum(f);h.push(Pb(g,{controlPoints:v}))}),{nodes:u,edges:h}})}}ih.defaultOptions={direction:"RL",getRibSep:()=>60};const Pb=(r,t)=>Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},r.style||{}),t)}),jv=r=>r.depth===0,wo=r=>(r.depth||(r.depth=0))%2===0;var oD=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class ah extends Yu{constructor(){super(...arguments),this.id="snake"}formatSize(t,e){const n=typeof e=="function"?e:()=>e;return t.reduce((i,a)=>{const[s,o]=oi(n(a))||[0,0];return[Math.max(i[0],s),Math.max(i[1],o)]},[0,0])}validate(t){const{nodes:e=[],edges:n=[]}=t,i={},a={},s={};e.forEach(d=>{i[d.id]=0,a[d.id]=0,s[d.id]=[]}),n.forEach(d=>{i[d.target]++,a[d.source]++,s[d.source].push(d.target)});const o=new Set,l=d=>{o.has(d)||(o.add(d),s[d].forEach(l))};if(l(e[0].id),o.size!==e.length)return!1;const c=e.filter(d=>i[d.id]===0),u=e.filter(d=>a[d.id]===0);return!(c.length!==1||u.length!==1||e.filter(d=>i[d.id]===1&&a[d.id]===1).length!==e.length-2)}execute(t,e){return oD(this,void 0,void 0,function*(){var n;if(!this.validate(t))return t;const{nodeSize:i,padding:a,sortBy:s,cols:o,colGap:l,rowGap:c,clockwise:u,width:h,height:d}=Object.assign({},ah.defaultOptions,this.options,e),[f,v,g,p]=Ri(a),y=this.formatSize(t.nodes||[],i),b=Math.ceil((t.nodes||[]).length/o);let w=l||(h-p-v-o*y[0])/(o-1),O=c||(d-f-g-b*y[1])/(b-1);return(O===1/0||O<0)&&(O=0),(w===1/0||w<0)&&(w=0),{nodes:((s?(n=t.nodes)===null||n===void 0?void 0:n.sort(s):lD(t))||[]).map((W,j)=>{const H=Math.floor(j/o),K=j%o,et=u?H%2===0?K:o-1-K:H%2===0?o-1-K:K,rt=p+et*(y[0]+w)+y[0]/2,lt=f+H*(y[1]+O)+y[1]/2;return{id:W.id,style:{x:rt,y:lt}}})}})}}ah.defaultOptions={padding:0,cols:5,clockwise:!0};function lD(r){const{nodes:t=[],edges:e=[]}=r,n={},i={};t.forEach(o=>{n[o.id]=0,i[o.id]=[]}),e.forEach(o=>{n[o.target]++,i[o.source].push(o.target)});const a=[],s=[];for(t.forEach(o=>{n[o.id]===0&&a.push(o.id)});a.length>0;){const o=a.shift(),l=t.find(c=>c.id===o);s.push(l),i[o].forEach(c=>{n[c]--,n[c]===0&&a.push(c)})}return s}const cD=["rgb(158, 1, 66)","rgb(213, 62, 79)","rgb(244, 109, 67)","rgb(253, 174, 97)","rgb(254, 224, 139)","rgb(255, 255, 191)","rgb(230, 245, 152)","rgb(171, 221, 164)","rgb(102, 194, 165)","rgb(50, 136, 189)","rgb(94, 79, 162)"],uD=["rgb(78, 121, 167)","rgb(242, 142, 44)","rgb(225, 87, 89)","rgb(118, 183, 178)","rgb(89, 161, 79)","rgb(237, 201, 73)","rgb(175, 122, 161)","rgb(255, 157, 167)","rgb(156, 117, 95)","rgb(186, 176, 171)"],hD=["rgb(255, 245, 235)","rgb(254, 230, 206)","rgb(253, 208, 162)","rgb(253, 174, 107)","rgb(253, 141, 60)","rgb(241, 105, 19)","rgb(217, 72, 1)","rgb(166, 54, 3)","rgb(127, 39, 4)"],dD=["rgb(247, 252, 245)","rgb(229, 245, 224)","rgb(199, 233, 192)","rgb(161, 217, 155)","rgb(116, 196, 118)","rgb(65, 171, 93)","rgb(35, 139, 69)","rgb(0, 109, 44)","rgb(0, 68, 27)"],fD=["rgb(247, 251, 255)","rgb(222, 235, 247)","rgb(198, 219, 239)","rgb(158, 202, 225)","rgb(107, 174, 214)","rgb(66, 146, 198)","rgb(33, 113, 181)","rgb(8, 81, 156)","rgb(8, 48, 107)"];var vD=function(r,t,e){if(!Gr(r)&&!vo(r))return r;var n=e;return n1(r,function(i,a){n=t(n,i,a)}),n},gD=vD,Zv=function(r,t){return gD(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})};class xr extends Wf{}function So(r,t=!0,e){const n=document.createElement("div");return n.setAttribute("class",`g6-${r}`),Object.assign(n.style,{position:"absolute",display:"block"}),t&&Object.assign(n.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),e&&Object.assign(n.style,e),n}function Wv(r,t="div",e={},n="",i=document.body){const a=document.getElementById(r);a&&a.remove();const s=document.createElement(t);return s.innerHTML=n,s.id=r,Object.assign(s.style,e),i.appendChild(s),s}var pD=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class sh extends xr{constructor(t,e){super(t,Object.assign({},sh.defaultOptions,e)),this.$element=So("background"),this.context.canvas.getContainer().prepend(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return pD(this,void 0,void 0,function*(){e.update.call(this,t),Object.assign(this.$element.style,Zv(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}sh.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};function Gv(r,t,e,n,i,a){const s=r,o=t,l=e-s,c=n-o;let u=i-s,h=a-o,d=u*l+h*c,f=0;d<=0?f=0:(u=l-u,h=c-h,d=u*l+h*c,d<=0?f=0:f=d*d/(l*l+c*c));const v=u*u+h*h-f;return v<0?0:v}function Qa(r,t,e,n){return(r-e)*(r-e)+(t-n)*(t-n)}function Rb(r,t,e,n,i){return Qa(r,t,e,n)<i*i}function mD(r){if(!Number.isFinite(r))return e=>e;if(r===0)return Math.round;const t=Math.pow(10,r);return e=>Math.round(e*t)/t}function Lb(r){const t=Math.min(r.x1,r.x2),e=Math.max(r.x1,r.x2),n=Math.min(r.y1,r.y2),i=Math.max(r.y1,r.y2);return{x:t,y:n,x2:e,y2:i,width:e-t,height:i-n}}class dr{constructor(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}draw(t){t.moveTo(this.x1,this.y1),t.lineTo(this.x2,this.y2)}toString(){return`Line(from=(${this.x1},${this.y1}),to=(${this.x2},${this.y2}))`}static from(t){return new dr(t.x1,t.y1,t.x2,t.y2)}cuts(t,e){if(this.y1===this.y2||e<this.y1&&e<=this.y2||e>this.y1&&e>=this.y2||t>this.x1&&t>=this.x2)return!1;if(t<this.x1&&t<=this.x2)return!0;const n=this.x1+(e-this.y1)*(this.x2-this.x1)/(this.y2-this.y1);return t<=n}distSquare(t,e){return Gv(this.x1,this.y1,this.x2,this.y2,t,e)}ptClose(t,e,n){if(this.x1<this.x2){if(t<this.x1-n||t>this.x2+n)return!1}else if(t<this.x2-n||t>this.x1+n)return!1;if(this.y1<this.y2){if(e<this.y1-n||e>this.y2+n)return!1}else if(e<this.y2-n||e>this.y1+n)return!1;return!0}}var Dn;(function(r){r[r.POINT=1]="POINT",r[r.PARALLEL=2]="PARALLEL",r[r.COINCIDENT=3]="COINCIDENT",r[r.NONE=4]="NONE"})(Dn||(Dn={}));class Vv{constructor(t,e=0,n=0){this.state=t,this.x=e,this.y=n}}function oh(r,t){const e=(t.x2-t.x1)*(r.y1-t.y1)-(t.y2-t.y1)*(r.x1-t.x1),n=(r.x2-r.x1)*(r.y1-t.y1)-(r.y2-r.y1)*(r.x1-t.x1),i=(t.y2-t.y1)*(r.x2-r.x1)-(t.x2-t.x1)*(r.y2-r.y1);if(i){const a=e/i,s=n/i;return 0<=a&&a<=1&&0<=s&&s<=1?new Vv(Dn.POINT,r.x1+a*(r.x2-r.x1),r.y1+a*(r.y2-r.y1)):new Vv(Dn.NONE)}return new Vv(e===0||n===0?Dn.COINCIDENT:Dn.PARALLEL)}function Db(r,t){const e=(t.x2-t.x1)*(r.y1-t.y1)-(t.y2-t.y1)*(r.x1-t.x1),n=(r.x2-r.x1)*(r.y1-t.y1)-(r.y2-r.y1)*(r.x1-t.x1),i=(t.y2-t.y1)*(r.x2-r.x1)-(t.x2-t.x1)*(r.y2-r.y1);if(i){const a=e/i,s=n/i;if(0<=a&&a<=1&&0<=s&&s<=1)return a}return Number.POSITIVE_INFINITY}function yD(r,t){function e(i,a,s,o){let l=Db(t,new dr(i,a,s,o));return l=Math.abs(l-.5),l>=0&&l<=1?1:0}let n=e(r.x,r.y,r.x2,r.y);return n+=e(r.x,r.y,r.x,r.y2),n>1||(n+=e(r.x,r.y2,r.x2,r.y2),n>1)?!0:(n+=e(r.x2,r.y,r.x2,r.y2),n>0)}var _n;(function(r){r[r.LEFT=0]="LEFT",r[r.TOP=1]="TOP",r[r.RIGHT=2]="RIGHT",r[r.BOTTOM=3]="BOTTOM"})(_n||(_n={}));function lh(r,t,e){const n=new Set;return r.width<=0?(n.add(_n.LEFT),n.add(_n.RIGHT)):t<r.x?n.add(_n.LEFT):t>r.x+r.width&&n.add(_n.RIGHT),r.height<=0?(n.add(_n.TOP),n.add(_n.BOTTOM)):e<r.y?n.add(_n.TOP):e>r.y+r.height&&n.add(_n.BOTTOM),n}function _b(r,t){let e=t.x1,n=t.y1;const i=t.x2,a=t.y2,s=Array.from(lh(r,i,a));if(s.length===0)return!0;let o=lh(r,e,n);for(;o.size!==0;){for(const l of s)if(o.has(l))return!1;if(o.has(_n.RIGHT)||o.has(_n.LEFT)){let l=r.x;o.has(_n.RIGHT)&&(l+=r.width),n=n+(l-e)*(a-n)/(i-e),e=l}else{let l=r.y;o.has(_n.BOTTOM)&&(l+=r.height),e=e+(l-n)*(i-e)/(a-n),n=l}o=lh(r,e,n)}return!0}function bD(r,t){let e=Number.POSITIVE_INFINITY,n=0;function i(a,s,o,l){let c=Db(t,new dr(a,s,o,l));c=Math.abs(c-.5),c>=0&&c<=1&&(n++,c<e&&(e=c))}return i(r.x,r.y,r.x2,r.y),i(r.x,r.y,r.x,r.y2),n>1||(i(r.x,r.y2,r.x2,r.y2),n>1)?e:(i(r.x2,r.y,r.x2,r.y2),n===0?-1:e)}function xD(r,t){let e=0;const n=oh(r,new dr(t.x,t.y,t.x2,t.y));e+=n.state===Dn.POINT?1:0;const i=oh(r,new dr(t.x,t.y,t.x,t.y2));e+=i.state===Dn.POINT?1:0;const a=oh(r,new dr(t.x,t.y2,t.x2,t.y2));e+=a.state===Dn.POINT?1:0;const s=oh(r,new dr(t.x2,t.y,t.x2,t.y2));return e+=s.state===Dn.POINT?1:0,{top:n,left:i,bottom:a,right:s,count:e}}class Nr{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}get x2(){return this.x+this.width}get y2(){return this.y+this.height}get cx(){return this.x+this.width/2}get cy(){return this.y+this.height/2}get radius(){return Math.max(this.width,this.height)/2}static from(t){return new Nr(t.x,t.y,t.width,t.height)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}clone(){return new Nr(this.x,this.y,this.width,this.height)}add(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x2,t.x+t.width),a=Math.max(this.y2,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=a-n}addPoint(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x2,t.x),a=Math.max(this.y2,t.y);this.x=e,this.y=n,this.width=i-e,this.height=a-n}toString(){return`Rectangle[x=${this.x}, y=${this.y}, w=${this.width}, h=${this.height}]`}draw(t){t.rect(this.x,this.y,this.width,this.height)}containsPt(t,e){return t>=this.x&&t<=this.x2&&e>=this.y&&e<=this.y2}get area(){return this.width*this.height}intersects(t){return this.area<=0||t.width<=0||t.height<=0?!1:t.x+t.width>this.x&&t.y+t.height>this.y&&t.x<this.x2&&t.y<this.y2}distSquare(t,e){if(this.containsPt(t,e))return 0;const n=lh(this,t,e);return n.has(_n.TOP)?n.has(_n.LEFT)?Qa(t,e,this.x,this.y):n.has(_n.RIGHT)?Qa(t,e,this.x2,this.y):(this.y-e)*(this.y-e):n.has(_n.BOTTOM)?n.has(_n.LEFT)?Qa(t,e,this.x,this.y2):n.has(_n.RIGHT)?Qa(t,e,this.x2,this.y2):(e-this.y2)*(e-this.y2):n.has(_n.LEFT)?(this.x-t)*(this.x-t):n.has(_n.RIGHT)?(t-this.x2)*(t-this.x2):0}}function ED(r){if(r.length===0)return null;const t=r[0],e=new Nr(t.x,t.y,0,0);for(const n of r)e.addPoint(n);return e}class ch{constructor(t,e,n){this.cx=t,this.cy=e,this.radius=n}get x(){return this.cx-this.radius}get x2(){return this.cx+this.radius}get width(){return this.radius*2}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return this.radius*2}static from(t){return new ch(t.cx,t.cy,t.radius)}containsPt(t,e){return Qa(this.cx,this.cy,t,e)<this.radius*this.radius}distSquare(t,e){const n=Qa(this.cx,this.cy,t,e);if(n<this.radius*this.radius)return 0;const i=Math.sqrt(n)-this.radius;return i*i}draw(t){t.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,Math.PI*2)}}class Ws{constructor(t,e=0,n=0,i=0,a=0,s=10,o=10,l=new Float32Array(Math.max(0,s*o)).fill(0)){this.pixelGroup=t,this.i=e,this.j=n,this.pixelX=i,this.pixelY=a,this.width=s,this.height=o,this.area=l}createSub(t,e){return new Ws(this.pixelGroup,t.x,t.y,e.x,e.y,t.width,t.height)}static fromPixelRegion(t,e){return new Ws(e,0,0,t.x,t.y,Math.ceil(t.width/e),Math.ceil(t.height/e))}copy(t,e){return new Ws(this.pixelGroup,this.scaleX(e.x),this.scaleY(e.y),e.x,e.y,t.width,t.height,t.area)}boundX(t){return t<this.i?this.i:t>=this.width?this.width-1:t}boundY(t){return t<this.j?this.j:t>=this.height?this.height-1:t}scaleX(t){return this.boundX(Math.floor((t-this.pixelX)/this.pixelGroup))}scaleY(t){return this.boundY(Math.floor((t-this.pixelY)/this.pixelGroup))}scale(t){const e=this.scaleX(t.x),n=this.scaleY(t.y),i=this.boundX(Math.ceil((t.x+t.width-this.pixelX)/this.pixelGroup)),a=this.boundY(Math.ceil((t.y+t.height-this.pixelY)/this.pixelGroup)),s=i-e,o=a-n;return new Nr(e,n,s,o)}invertScaleX(t){return Math.round(t*this.pixelGroup+this.pixelX)}invertScaleY(t){return Math.round(t*this.pixelGroup+this.pixelY)}addPadding(t,e){const n=Math.ceil(e/this.pixelGroup),i=this.boundX(t.x-n),a=this.boundY(t.y-n),s=this.boundX(t.x2+n),o=this.boundY(t.y2+n),l=s-i,c=o-a;return new Nr(i,a,l,c)}get(t,e){return t<0||e<0||t>=this.width||e>=this.height?Number.NaN:this.area[t+e*this.width]}inc(t,e,n){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]+=n)}set(t,e,n){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]=n)}incArea(t,e){if(t.width<=0||t.height<=0||e===0)return;const n=this.width,i=t.width,a=Math.max(0,t.i),s=Math.max(0,t.j),o=Math.min(t.i+t.width,n),l=Math.min(t.j+t.height,this.height);if(!(l<=0||o<=0||a>=n||l>=this.height))for(let c=s;c<l;c++){const u=(c-t.j)*i,h=c*n;for(let d=a;d<o;d++){const f=t.area[d-t.i+u];f!==0&&(this.area[d+h]+=e*f)}}}fill(t){this.area.fill(t)}fillArea(t,e){const n=t.x+t.y*this.width;for(let i=0;i<t.height;i++){const a=n+i*this.width;this.area.fill(e,a,a+t.width)}}fillHorizontalLine(t,e,n,i){const a=t+e*this.width;this.area.fill(i,a,a+n)}fillVerticalLine(t,e,n,i){const a=t+e*this.width;for(let s=0;s<n;s++)this.area[a+s*this.width]=i}clear(){this.area.fill(0)}toString(){let t="";for(let e=0;e<this.height;e++){const n=e*this.width;for(let i=0;i<this.width;i++){const a=this.area[n+i];t+=a.toFixed(1).padStart(6),t+=" "}t+=`
`}return t}draw(t,e=!0){if(this.width<=0||this.height<=0)return;t.save(),e&&t.translate(this.pixelX,this.pixelY);const n=this.area.reduce((s,o)=>Math.min(s,o),Number.POSITIVE_INFINITY),i=this.area.reduce((s,o)=>Math.max(s,o),Number.NEGATIVE_INFINITY),a=s=>(s-n)/(i-n);t.scale(this.pixelGroup,this.pixelGroup);for(let s=0;s<this.width;s++)for(let o=0;o<this.height;o++){const l=this.area[s+o*this.width];t.fillStyle=`rgba(0, 0, 0, ${a(l)})`,t.fillRect(s,o,1,1)}t.restore()}drawThreshold(t,e,n=!0){if(!(this.width<=0||this.height<=0)){t.save(),n&&t.translate(this.pixelX,this.pixelY),t.scale(this.pixelGroup,this.pixelGroup);for(let i=0;i<this.width;i++)for(let a=0;a<this.height;a++){const s=this.area[i+a*this.width];t.fillStyle=s>e?"black":"white",t.fillRect(i,a,1,1)}t.restore()}}}function Ib(r,t){const e=n=>({x:n.x-t,y:n.y-t,width:n.width+2*t,height:n.height+2*t});return Array.isArray(r)?r.map(e):e(r)}function Bb(r,t,e){return Fb(Object.assign(Lb(r),{distSquare:(n,i)=>Gv(r.x1,r.y1,r.x2,r.y2,n,i)}),t,e)}function Fb(r,t,e){const n=Ib(r,e),i=t.scale(n),a=t.createSub(i,n);return wD(a,t,e,(s,o)=>r.distSquare(s,o)),a}function wD(r,t,e,n){const i=e*e;for(let a=0;a<r.height;a++)for(let s=0;s<r.width;s++){const o=t.invertScaleX(r.i+s),l=t.invertScaleY(r.j+a),c=n(o,l);if(c===0){r.set(s,a,i);continue}if(c<i){const u=e-Math.sqrt(c);r.set(s,a,u*u)}}return r}function SD(r,t,e){const n=t.scale(r),i=t.addPadding(n,e),a=t.createSub(i,{x:r.x-e,y:r.y-e}),s=n.x-i.x,o=n.y-i.y,l=i.x2-n.x2,c=i.y2-n.y2,u=i.width-s-l,h=i.height-o-c,d=e*e;a.fillArea({x:s,y:o,width:u+1,height:h+1},d);const f=[0],v=Math.max(o,s,l,c);{const b=t.invertScaleX(n.x+n.width/2);for(let w=1;w<v;w++){const O=t.invertScaleY(n.y-w),_=r.distSquare(b,O);if(_<d){const F=e-Math.sqrt(_);f.push(F*F)}else break}}const g=[],p=Math.max(s,l),y=Math.max(o,l);for(let b=1;b<p;b++){const w=t.invertScaleX(n.x-b),O=[];for(let _=1;_<y;_++){const F=t.invertScaleY(n.y-_),W=r.distSquare(w,F);if(W<d){const j=e-Math.sqrt(W);O.push(j*j)}else O.push(0)}g.push(O)}for(let b=1;b<Math.min(o,f.length);b++){const w=f[b];a.fillHorizontalLine(s,o-b,u+1,w)}for(let b=1;b<Math.min(c,f.length);b++){const w=f[b];a.fillHorizontalLine(s,o+h+b,u+1,w)}for(let b=1;b<Math.min(s,f.length);b++){const w=f[b];a.fillVerticalLine(s-b,o,h+1,w)}for(let b=1;b<Math.min(c,f.length);b++){const w=f[b];a.fillVerticalLine(s+u+b,o,h+1,w)}for(let b=1;b<s;b++){const w=g[b-1],O=s-b;for(let _=1;_<o;_++)a.set(O,o-_,w[_-1]);for(let _=1;_<c;_++)a.set(O,o+h+_,w[_-1])}for(let b=1;b<l;b++){const w=g[b-1],O=s+u+b;for(let _=1;_<o;_++)a.set(O,o-_,w[_-1]);for(let _=1;_<c;_++)a.set(O,o+h+_,w[_-1])}return a}function W7(r,t,e,n){return{x:r,y:t,width:e,height:n}}function G7(r,t,e){return{cx:r,cy:t,radius:e}}function V7(r,t,e,n){return{x1:r,y1:t,x2:e,y2:n}}function Sn(r,t){return{x:r,y:t}}function MD(r,t,e,n){if(r.length===0)return[];const i=ND(r);return i.map((a,s)=>{const o=i.slice(0,s);return AD(t,a,o,e,n)}).flat()}function AD(r,t,e,n,i){const a=Sn(t.cx,t.cy),s=CD(a,e,r);if(s==null)return[];const o=new dr(a.x,a.y,s.cx,s.cy),l=TD(o,r,n,i);return OD(l,r)}function TD(r,t,e,n){const i=[],a=[];a.push(r);let s=!0;for(let o=0;o<e&&s;o++)for(s=!1;!s&&a.length>0;){const l=a.pop(),c=zb(t,l),u=c?xD(l,c):null;if(!c||!u||u.count!==2){s||i.push(l);continue}let h=n,d=hh(c,h,u,!0),f=qa(d,a)||qa(d,i),v=uh(d,t);for(;!f&&v&&h>=1;)h/=1.5,d=hh(c,h,u,!0),f=qa(d,a)||qa(d,i),v=uh(d,t);if(d&&!f&&!v&&(a.push(new dr(l.x1,l.y1,d.x,d.y)),a.push(new dr(d.x,d.y,l.x2,l.y2)),s=!0),s)continue;h=n,d=hh(c,h,u,!1);let g=qa(d,a)||qa(d,i);for(v=uh(d,t);!g&&v&&h>=1;)h/=1.5,d=hh(c,h,u,!1),g=qa(d,a)||qa(d,i),v=uh(d,t);d&&!g&&(a.push(new dr(l.x1,l.y1,d.x,d.y)),a.push(new dr(d.x,d.y,l.x2,l.y2)),s=!0),s||i.push(l)}for(;a.length>0;)i.push(a.pop());return i}function OD(r,t){const e=[];for(;r.length>0;){const n=r.pop();if(r.length===0){e.push(n);break}const i=r.pop(),a=new dr(n.x1,n.y1,i.x2,i.y2);zb(t,a)?(e.push(n),r.push(i)):r.push(a)}return e}function CD(r,t,e){let n=Number.POSITIVE_INFINITY;return t.reduce((i,a)=>{const s=Qa(r.x,r.y,a.cx,a.cy);if(s>n)return i;const o=new dr(r.x,r.y,a.cx,a.cy),l=kD(e,o);return s*(l+1)*(l+1)<n&&(i=a,n=s*(l+1)*(l+1)),i},null)}function ND(r){if(r.length<2)return r;let t=0,e=0;return r.forEach(n=>{t+=n.cx,e+=n.cy}),t/=r.length,e/=r.length,r.map(n=>{const i=t-n.cx,a=e-n.cy,s=i*i+a*a;return[n,s]}).sort((n,i)=>n[1]-i[1]).map(n=>n[0])}function uh(r,t){return t.some(e=>e.containsPt(r.x,r.y))}function qa(r,t){return t.some(e=>!!(Rb(e.x1,e.y1,r.x,r.y,.001)||Rb(e.x2,e.y2,r.x,r.y,.001)))}function zb(r,t){let e=Number.POSITIVE_INFINITY,n=null;for(const i of r){if(!_b(i,t))continue;const a=bD(i,t);a>=0&&a<e&&(n=i,e=a)}return n}function kD(r,t){return r.reduce((e,n)=>_b(n,t)&&yD(n,t)?e+1:e,0)}function hh(r,t,e,n){const i=e.top,a=e.left,s=e.bottom,o=e.right;if(n){if(a.state===Dn.POINT){if(i.state===Dn.POINT)return Sn(r.x-t,r.y-t);if(s.state===Dn.POINT)return Sn(r.x-t,r.y2+t);const d=r.width*r.height;return r.width*((a.y-r.y+(o.y-r.y))*.5)<d*.5?a.y>o.y?Sn(r.x-t,r.y-t):Sn(r.x2+t,r.y-t):a.y<o.y?Sn(r.x-t,r.y2+t):Sn(r.x2+t,r.y2+t)}if(o.state===Dn.POINT){if(i.state===Dn.POINT)return Sn(r.x2+t,r.y-t);if(s.state===Dn.POINT)return Sn(r.x2+t,r.y2+t)}const u=r.height*r.width;return r.height*((i.x-r.x+(o.x-r.x))*.5)<u*.5?i.x>s.x?Sn(r.x-t,r.y-t):Sn(r.x-t,r.y2+t):i.x<s.x?Sn(r.x2+t,r.y-t):Sn(r.x2+t,r.y2+t)}if(a.state===Dn.POINT){if(i.state===Dn.POINT)return Sn(r.x2+t,r.y2+t);if(s.state===Dn.POINT)return Sn(r.x2+t,r.y-t);const u=r.height*r.width;return r.width*((a.y-r.y+(o.y-r.y))*.5)<u*.5?a.y>o.y?Sn(r.x2+t,r.y2+t):Sn(r.x-t,r.y2+t):a.y<o.y?Sn(r.x2+t,r.y-t):Sn(r.x-t,r.y-t)}if(o.state===Dn.POINT){if(i.state===Dn.POINT)return Sn(r.x-t,r.y2+t);if(s.state===Dn.POINT)return Sn(r.x-t,r.y-t)}const l=r.height*r.width;return r.height*((i.x-r.x+(o.x-r.x))*.5)<l*.5?i.x>s.x?Sn(r.x2+t,r.y2+t):Sn(r.x2+t,r.y-t):i.x<s.x?Sn(r.x-t,r.y2+t):Sn(r.x-t,r.y-t)}function PD(r,t,e,n){if(!(r.closed?e<r.length:e<r.length-1))return!1;const a=r.get(t),s=r.get(e+1);for(let o=t+1;o<=e;o++){const l=r.get(o);if(Gv(a.x,a.y,s.x,s.y,l.x,l.y)>n)return!1}return!0}function RD(r=0){return t=>{if(r<0||t.length<3)return t;const e=[];let n=0;const i=r*r;for(;n<t.length;){let a=n+1;for(;PD(t,n,a,i);)a++;e.push(t.get(n)),n=a}return new Gs(e)}}function LD(r,t){switch(r){case-2:return(((-t+3)*t-3)*t+1)/6;case-1:return((3*t-6)*t*t+4)/6;case 0:return(((-3*t+3)*t+3)*t+1)/6;case 1:return t*t*t/6;default:throw new Error("unknown error")}}function DD(r=6){function a(s,o,l){let c=0,u=0;for(let h=-2;h<=1;h++){const d=s.get(o+h),f=LD(h,l);c+=f*d.x,u+=f*d.y}return{x:c,y:u}}return s=>{if(s.length<3)return s;const o=[],l=s.closed,c=s.length+3-1+(l?0:2);o.push(a(s,2-(l?0:2),0));for(let u=2-(l?0:2);u<c;u++)for(let h=1;h<=r;h++)o.push(a(s,u,h/r));return new Gs(o)}}function _D(r=8){return t=>{let e=r,n=t.length;if(e>1)for(n=Math.floor(t.length/e);n<3&&e>1;)e-=1,n=Math.floor(t.length/e);const i=[];for(let a=0,s=0;s<n;s++,a+=e)i.push(t.get(a));return new Gs(i)}}class Gs{constructor(t=[],e=!0){this.points=t,this.closed=e}get(t){const e=t,n=this.points.length;return t<0?this.closed?this.get(t+n):this.points[0]:t>=n?this.closed?this.get(t-n):this.points[n-1]:this.points[e]}get length(){return this.points.length}toString(t=1/0){const e=this.points;if(e.length===0)return"";const n=typeof t=="function"?t:mD(t);let i="M";for(const a of e)i+=`${n(a.x)},${n(a.y)} L`;return i=i.slice(0,-1),this.closed&&(i+=" Z"),i}draw(t){const e=this.points;if(e.length!==0){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(const n of e)t.lineTo(n.x,n.y);this.closed&&t.closePath()}}sample(t){return _D(t)(this)}simplify(t){return RD(t)(this)}bSplines(t){return DD(t)(this)}apply(t){return t(this)}containsElements(t){const e=ED(this.points);return e?t.every(n=>e.containsPt(n.cx,n.cy)&&this.withinArea(n.cx,n.cy)):!1}withinArea(t,e){if(this.length===0)return!1;let n=0;const i=this.points[0],a=new dr(i.x,i.y,i.x,i.y);for(let s=1;s<this.points.length;s++){const o=this.points[s];a.x1=a.x2,a.y1=a.y2,a.x2=o.x,a.y2=o.y,a.cuts(t,e)&&n++}return a.x1=a.x2,a.y1=a.y2,a.x2=i.x,a.y2=i.y,a.cuts(t,e)&&n++,n%2===1}}class ID{constructor(t=0){this.count=0,this.arr=[],this.set=new Set,this.arr.length=t}add(t){this.set.add(`${t.x}x${t.y}`),this.arr[this.count++]=t}contains(t){return this.set.has(`${t.x}x${t.y}`)}isFirst(t){if(this.count===0)return!1;const e=this.arr[0];return e!=null&&e.x===t.x&&e.y===t.y}path(){return new Gs(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(t){return this.arr[t]}get length(){return this.count}}const Rl=0,dh=1,fh=2,Uv=3;function BD(r,t){const e=(Math.floor(r.width)+Math.floor(r.height))*2,n=new ID(e);function i(l,c,u,h){const d=r.get(l,c);return Number.isNaN(d)?Number.NaN:d>t?u+h:u}function a(l,c){let u=Rl;return u=i(l,c,u,1),u=i(l+1,c,u,2),u=i(l,c+1,u,4),u=i(l+1,c+1,u,8),Number.isNaN(u)?-1:u}let s=dh;function o(l,c){let u=l,h=c,d=r.invertScaleX(u),f=r.invertScaleY(h);for(let v=0;v<r.width*r.height;v++){const g={x:d,y:f};if(n.contains(g)){if(n.isFirst(g))return!0}else n.add(g);const p=a(u,h);switch(p){case-1:return!0;case 0:case 3:case 2:case 7:s=fh;break;case 12:case 14:case 4:s=Uv;break;case 6:s=s===Rl?Uv:fh;break;case 1:case 13:case 5:s=Rl;break;case 9:s=s===fh?Rl:dh;break;case 10:case 8:case 11:s=dh;break;default:return console.warn("Marching squares invalid state: "+p),!0}switch(s){case Rl:h--,f-=r.pixelGroup;break;case dh:h++,f+=r.pixelGroup;break;case Uv:u--,d-=r.pixelGroup;break;case fh:u++,d+=r.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+p),!0}}return!0}for(let l=0;l<r.width;l++)for(let c=0;c<r.height;c++){if(r.get(l,c)<=t)continue;const u=a(l,c);if(!(u<0||u===15)&&o(l,c))return n.path()}return null}const vh={maxRoutingIterations:100,maxMarchingIterations:20,pixelGroup:4,edgeR0:10,edgeR1:20,nodeR0:15,nodeR1:50,morphBuffer:10,threshold:1,memberInfluenceFactor:1,edgeInfluenceFactor:1,nonMemberInfluenceFactor:-.8,virtualEdges:!0};function Ll(r){return r!=null&&typeof r.radius=="number"}function jb(r,t){if(Ll(r)!==Ll(t))return!1;if(Ll(r)){const n=t;return r.cx===n.cx&&r.cy===n.cy&&r.radius===n.radius}const e=t;return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}var zi;(function(r){r[r.MEMBERS=0]="MEMBERS",r[r.NON_MEMBERS=1]="NON_MEMBERS",r[r.EDGES=2]="EDGES"})(zi||(zi={}));class Yv{constructor(t={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new Nr(0,0,0,0),this.potentialArea=new Ws(1,0,0,0,0,0,0),this.o=Object.assign({},vh,t)}pushMember(...t){if(t.length!==0){this.dirty.add(zi.MEMBERS);for(const e of t)this.members.push({raw:e,obj:Ll(e)?ch.from(e):Nr.from(e),area:null})}}removeMember(t){const e=this.members.findIndex(n=>jb(n.raw,t));return e<0?!1:(this.members.splice(e,1),this.dirty.add(zi.MEMBERS),!0)}removeNonMember(t){const e=this.nonMembers.findIndex(n=>jb(n.raw,t));return e<0?!1:(this.nonMembers.splice(e,1),this.dirty.add(zi.NON_MEMBERS),!0)}removeEdge(t){const e=this.edges.findIndex(n=>n.obj.equals(t));return e<0?!1:(this.edges.splice(e,1),this.dirty.add(zi.NON_MEMBERS),!0)}pushNonMember(...t){if(t.length!==0){this.dirty.add(zi.NON_MEMBERS);for(const e of t)this.nonMembers.push({raw:e,obj:Ll(e)?ch.from(e):Nr.from(e),area:null})}}pushEdge(...t){if(t.length!==0){this.dirty.add(zi.EDGES);for(const e of t)this.edges.push({raw:e,obj:dr.from(e),area:null})}}update(){const t=this.dirty.has(zi.MEMBERS),e=this.dirty.has(zi.NON_MEMBERS);let n=this.dirty.has(zi.EDGES);this.dirty.clear();const i=this.members.map(c=>c.obj);if(this.o.virtualEdges&&(t||e)){const c=this.nonMembers.map(d=>d.obj),u=MD(i,c,this.o.maxRoutingIterations,this.o.morphBuffer),h=new Map(this.virtualEdges.map(d=>[d.obj.toString(),d.area]));this.virtualEdges=u.map(d=>{var f;return{raw:d,obj:d,area:(f=h.get(d.toString()))!==null&&f!==void 0?f:null}}),n=!0}let a=!1;if(t||n){const c=this.virtualEdges.concat(this.edges).map(f=>f.obj),u=zD(i,c),h=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,d=Nr.from(Ib(u,h));d.equals(this.activeRegion)||(a=!0,this.activeRegion=d)}if(a){const c=Math.ceil(this.activeRegion.width/this.o.pixelGroup),u=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=Ws.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach(h=>h.area=null),this.nonMembers.forEach(h=>h.area=null),this.edges.forEach(h=>h.area=null),this.virtualEdges.forEach(h=>h.area=null)):(c!==this.potentialArea.width||u!==this.potentialArea.height)&&(this.potentialArea=Ws.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const s=new Map,o=c=>{if(c.area){const u=`${c.obj.width}x${c.obj.height}x${c.obj instanceof Nr?"R":"C"}`;s.set(u,c.area)}},l=c=>{if(c.area)return;const u=`${c.obj.width}x${c.obj.height}x${c.obj instanceof Nr?"R":"C"}`;if(s.has(u)){const d=s.get(u);c.area=this.potentialArea.copy(d,{x:c.obj.x-this.o.nodeR1,y:c.obj.y-this.o.nodeR1});return}const h=c.obj instanceof Nr?SD(c.obj,this.potentialArea,this.o.nodeR1):Fb(c.obj,this.potentialArea,this.o.nodeR1);c.area=h,s.set(u,h)};this.members.forEach(o),this.nonMembers.forEach(o),this.members.forEach(l),this.nonMembers.forEach(c=>{this.activeRegion.intersects(c.obj)?l(c):c.area=null}),this.edges.forEach(c=>{c.area||(c.area=Bb(c.obj,this.potentialArea,this.o.edgeR1))}),this.virtualEdges.forEach(c=>{c.area||(c.area=Bb(c.obj,this.potentialArea,this.o.edgeR1))})}drawMembers(t){for(const e of this.members)e.obj.draw(t)}drawNonMembers(t){for(const e of this.nonMembers)e.obj.draw(t)}drawEdges(t){for(const e of this.edges)e.obj.draw(t)}drawPotentialArea(t,e=!0){this.potentialArea.draw(t,e)}compute(){if(this.members.length===0)return new Gs([]);this.dirty.size>0&&this.update();const{o:t,potentialArea:e}=this,n=this.members.map(o=>o.area),i=this.virtualEdges.concat(this.edges).map(o=>o.area),a=this.nonMembers.filter(o=>o.area!=null).map(o=>o.area),s=this.members.map(o=>o.obj);return FD(e,n,i,a,o=>o.containsElements(s),t)}}function FD(r,t,e,n,i,a={}){const s=Object.assign({},vh,a);let o=s.threshold,l=s.memberInfluenceFactor,c=s.edgeInfluenceFactor,u=s.nonMemberInfluenceFactor;const h=(s.nodeR0-s.nodeR1)*(s.nodeR0-s.nodeR1),d=(s.edgeR0-s.edgeR1)*(s.edgeR0-s.edgeR1);for(let f=0;f<s.maxMarchingIterations;f++){if(r.clear(),l!==0){const g=l/h;for(const p of t)r.incArea(p,g)}if(c!==0){const g=c/d;for(const p of e)r.incArea(p,g)}if(u!==0){const g=u/h;for(const p of n)r.incArea(p,g)}const v=BD(r,o);if(v&&i(v))return v;if(o*=.95,f<=s.maxMarchingIterations*.5)l*=1.2,c*=1.2;else if(u!==0&&n.length>0)u*=.8;else break}return new Gs([])}function zD(r,t){if(r.length===0)return new Nr(0,0,0,0);const e=Nr.from(r[0]);for(const n of r)e.add(n);for(const n of t)e.add(Lb(n));return e}function U7(r,t=[],e=[],n={}){if(r.length===0)return new Gs([]);const i=new Yv(n);return i.pushMember(...r),i.pushNonMember(...t),i.pushEdge(...e),i.compute()}var jD=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class gh extends xr{constructor(t,e){super(t,mr({},gh.defaultOptions,e)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:n,bubbleSetOptions:i}=this.parseOptions();Zn(this.bubbleSetOptions,i)||this.init(),this.bubbleSetOptions=Object.assign({},i);const a=Object.assign(Object.assign({},n),{d:this.getPath()});this.shape?this.shape.update(a):(this.shape=new wl({style:a}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=n=>{if(!this.shape)return;const i=At(n.data);[...this.options.members,...this.options.avoidMembers].includes(i)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(i)}))},this.getPath=n=>{const{graph:i}=this.context,a=this.options.members,s=[...this.members.keys()],o=this.options.avoidMembers,l=[...this.avoidMembers.keys()];if(!n&&Zn(a,s)&&Zn(o,l))return this.path;const{enter:c=[],exit:u=[]}=ja(s,a,p=>p),{enter:h=[],exit:d=[]}=ja(l,o,p=>p);n&&(u.push(n),c.push(n));const f=(p,y,b)=>{p.forEach(w=>{const O=b?this.members:this.avoidMembers,_=b?"pushMember":"pushNonMember",F=b?"removeMember":"removeNonMember";if(y){let W;i.getElementType(w)==="edge"?([W]=WD(i,w),this.bubbleSets.pushEdge(W)):([W]=ZD(i,w),this.bubbleSets[_](W)),O.set(w,W)}else{const W=O.get(w);W&&(i.getElementType(w)==="edge"?this.bubbleSets.removeEdge(W):this.bubbleSets[F](W),O.delete(w))}})};f(u,!1,!0),f(c,!0,!0),f(d,!1,!1),f(h,!0,!1);const g=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=Wy(g.points.map(yr)),this.path},this.bindEvents(),this.bubbleSets=new Yv(this.options)}bindEvents(){this.context.graph.on(Kt.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(Kt.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new Yv(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const t=this.options,{type:e,key:n,members:i,avoidMembers:a}=t,s=jD(t,["type","key","members","avoidMembers"]),o=Object.keys(s).reduce((l,c)=>(c in vh?l.bubbleSetOptions[c]=s[c]:l.style[c]=s[c],l),{style:{},bubbleSetOptions:{}});return Object.assign({type:e,key:n,members:i,avoidMembers:a},o)}addMember(t){const e=Array.isArray(t)?t:[t];e.some(n=>this.options.avoidMembers.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!e.includes(n))),this.options.members=[...new Set([...this.options.members,...e])],this.drawBubbleSets()}removeMember(t){const e=Array.isArray(t)?t:[t];this.options.members=this.options.members.filter(n=>!e.includes(n)),this.drawBubbleSets()}updateMember(t){this.options.members=fe(t)?t(this.options.members):t,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(t){const e=Array.isArray(t)?t:[t];e.some(n=>this.options.members.includes(n))&&(this.options.members=this.options.members.filter(n=>!e.includes(n))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...e])],this.drawBubbleSets()}removeAvoidMember(t){const e=Array.isArray(t)?t:[t];this.options.avoidMembers.some(n=>e.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!e.includes(n)),this.drawBubbleSets())}updateAvoidMember(t){this.options.avoidMembers=Array.isArray(t)?t:[t],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(Kt.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(Kt.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}gh.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},vh);const ZD=(r,t)=>(Array.isArray(t)?t:[t]).map(n=>{const i=r.getElementRenderBounds(n);return new Nr(i.min[0],i.min[1],ta(i),ea(i))}),WD=(r,t)=>(Array.isArray(t)?t:[t]).map(n=>{const i=r.getEdgeData(n),a=r.getElementPosition(i.source),s=r.getElementPosition(i.target);return dr.from({x1:a[0],y1:a[1],x2:s[0],y2:s[1]})});class Y7 extends null{constructor(t,e){super(t,e),this.setOptions=n=>{const i={cameraType:"setType",near:"setNear",far:"setFar",fov:"setFov",aspect:"setAspect",projectionMode:"setProjectionMode",distance:"setDistance",minDistance:"setMinDistance",maxDistance:"setMaxDistance",roll:"setRoll",elevation:"setElevation",azimuth:"setAzimuth"},a=(s,o)=>{switch(s){case"projectionMode":return o==="perspective"?1:0;case"cameraType":return{orbiting:0,exploring:1,tracking:2}[o];case"aspect":return typeof o=="number"?o:this.getCanvasAspect();default:return o}};Object.entries(i).forEach(([s,o])=>{const l=n[s];if(l!==void 0){const c=a(s,l);this.context.canvas.getCamera()[o](c)}})},this.bindEvents()}update(t){this.setOptions(t),super.update(t)}bindEvents(){this.context.graph.once(GraphEvent.BEFORE_DRAW,()=>this.setOptions(this.options))}getCanvasAspect(){const[t,e]=this.context.viewport.getCanvasSize();return t/e}}function GD(r){return`
<ul class="g6-contextmenu-ul">
${r.map(t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`).join("")}
</ul>
`}const VD=`
.g6-contextmenu {
font-size: 12px;
background-color: rgba(255, 255, 255, 0.96);
border-radius: 4px;
overflow: hidden;
box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;
transition: visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
}
.g6-contextmenu-ul {
max-width: 256px;
min-width: 96px;
list-style: none;
padding: 0;
margin: 0;
}
.g6-contextmenu-li {
padding: 8px 12px;
cursor: pointer;
user-select: none;
}
.g6-contextmenu-li:hover {
background-color: #f5f5f5;
cursor: pointer;
}
`;var Zb=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class ph extends xr{constructor(t,e){super(t,Object.assign({},ph.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=n=>{var i;(i=n.preventDefault)===null||i===void 0||i.call(n),this.show(n)},this.onMenuItemClick=n=>{const{onClick:i,trigger:a}=this.options;if(n.target instanceof HTMLElement&&n.target.className.includes("g6-contextmenu-li")){const s=n.target.getAttribute("value");i==null||i(s,n.target,this.targetElement),this.hide()}a!=="click"&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=So("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t),this.context.canvas.getContainer().appendChild(this.$element),Wv("g6-contextmenu-css","style",{},VD,document.head)}show(t){return Zb(this,void 0,void 0,function*(){const{enable:e,offset:n}=this.options;if(typeof e=="function"&&!e(t)||!e){this.hide();return}const i=yield this.getDOMContent(t);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const a=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-a.left+n[0]}px`,this.$element.style.top=`${t.client.y-a.top+n[1]}px`,this.$element.style.display="block",this.targetElement=t.target})}hide(){this.$element.style.display="none",this.targetElement=null}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.$element.remove()}getDOMContent(t){return Zb(this,void 0,void 0,function*(){const{getContent:e,getItems:n}=this.options;return n?GD(yield n(t)):yield e(t)})}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`canvas:${e}`,this.onTriggerEvent),t.on(`node:${e}`,this.onTriggerEvent),t.on(`edge:${e}`,this.onTriggerEvent),t.on(`combo:${e}`,this.onTriggerEvent),document.addEventListener("click",this.onMenuItemClick)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`canvas:${e}`,this.onTriggerEvent),t.off(`node:${e}`,this.onTriggerEvent),t.off(`edge:${e}`,this.onTriggerEvent),t.off(`combo:${e}`,this.onTriggerEvent),document.removeEventListener("click",this.onMenuItemClick)}}ph.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class mh extends xr{constructor(t,e){super(t,Object.assign({},mh.defaultOptions,e)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:n,element:i}=this.context,a=n.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:s,iterRate:o,divRate:l}=this.options;let{lambda:c,divisions:u,iterations:h}=this.options;for(let d=0;d<s;d++){for(let f=0;f<h;f++){const v={};a.forEach(g=>{var p;if(g.source===g.target)return;const y=At(g);v[y]=this.getEdgeForces(g,u,c);for(let b=0;b<u+1;b++)(p=this.edgePoints)[y]||(p[y]=[]),this.edgePoints[y][b]=Ce(this.edgePoints[y][b],v[y][b])})}c/=2,u*=l,h*=o,this.divideEdges(u)}a.forEach(d=>{const f=At(d),v=i.getElement(f);v==null||v.update({d:hv(this.edgePoints[f])})})},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map(e=>[At(e),Rs(ar(e))]))}divideEdges(t){this.context.model.getEdgeData().forEach(n=>{var i;const a=At(n);(i=this.edgePoints)[a]||(i[a]=[]);const s=this.nodeMap[n.source],o=this.nodeMap[n.target];if(t===1)this.edgePoints[a].push(s),this.edgePoints[a].push(Ii(Ce(s,o),2)),this.edgePoints[a].push(o);else{const c=(this.edgePoints[a].length===0?bn(s,o):KD(this.edgePoints[a]))/(t+1);let u=c;const h=[s];for(let d=1;d<this.edgePoints[a].length;d++){const f=this.edgePoints[a][d-1],v=this.edgePoints[a][d];let g=bn(v,f);for(;g>u;){const p=u/g,y=Ce(f,_i(on(v,f),p));h.push(y),g-=u,u=c}u-=g}h.push(o),this.edgePoints[a]=h}})}getVectorPosition(t){const e=this.nodeMap[t.source],n=this.nodeMap[t.target],[i,a]=on(n,e),s=bn(e,n);return{source:e,target:n,vx:i,vy:a,length:s}}measureEdgeCompatibility(t,e){const n=this.getVectorPosition(t),i=this.getVectorPosition(e),a=UD(n,i),s=YD(n,i),o=HD(n,i),l=XD(n,i);return a*s*o*l}getEdgeBundles(){const t={},e=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach((i,a)=>{n.forEach((s,o)=>{var l,c;if(o<=a)return;this.measureEdgeCompatibility(i,s)>=e&&(t[l=At(i)]||(t[l]=[]),t[At(i)].push(s),t[c=At(s)]||(t[c]=[]),t[At(s)].push(i))})}),t}getSpringForce(t,e){const{pre:n,cur:i,next:a}=t;return _i(on(Ce(n,a),_i(i,2)),e)}getElectrostaticForce(t,e){ra(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[At(e)];let i=[0,0];return n==null||n.forEach(a=>{const s=this.edgePoints[At(a)][t],o=this.edgePoints[At(e)][t],l=on(s,o),c=bn(s,o);i=Ce(i,_i(l,1/c))}),i}getEdgeForces(t,e,n){const i=this.nodeMap[t.source],a=this.nodeMap[t.target],s=this.options.K/(bn(i,a)*(e+1)),o=[[0,0]],l=At(t);for(let c=1;c<e;c++){const u=this.getSpringForce({pre:this.edgePoints[l][c-1],cur:this.edgePoints[l][c],next:this.edgePoints[l][c+1]||[0,0]},s),h=this.getElectrostaticForce(c,t);o.push(_i(Ce(u,h),n))}return o.push([0,0]),o}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}mh.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const UD=(r,t)=>Math.abs(vN([r.vx,r.vy],[t.vx,t.vy])/(r.length*t.length)),YD=(r,t)=>{const e=(r.length+t.length)/2;return 2/(e/Math.min(r.length,t.length)+Math.max(r.length,t.length)/e)},HD=(r,t)=>{const e=(r.length+t.length)/2,n=Ii(Ce(r.source,r.target),2),i=Ii(Ce(t.source,t.target),2);return e/(e+bn(n,i))},Wb=(r,t)=>{if(t.source[0]===t.target[0])return[t.source[0],r[1]];if(t.source[1]===t.target[1])return[r[0],t.source[1]];const e=(t.source[1]-t.target[1])/(t.source[0]-t.target[0]),n=(e*e*t.source[0]+e*(r[1]-t.source[1])+r[0])/(e*e+1),i=e*(n-t.source[0])+t.source[1];return[n,i]},Gb=(r,t)=>{const e=Wb(t.source,r),n=Wb(t.target,r),i=Ii(Ce(e,n),2),a=Ii(Ce(r.source,r.target),2);return bn(e,n)===0?0:Math.max(0,1-2*bn(a,i)/bn(e,n))},XD=(r,t)=>Math.min(Gb(r,t),Gb(t,r)),KD=r=>{let t=0;for(let e=1;e<r.length;e++)t+=bn(r[e],r[e-1]);return t},QD={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0},Vb=.05;class yh extends xr{constructor(t,e){super(t,Object.assign({},yh.defaultOptions,e)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=yr(n.canvas);this.renderLens(i),this.renderFocusElements()},this.renderLens=n=>{const i=Object.assign({},QD,this.options.style);this.isLensOn||(this.lens=new _s({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Bi(n),{size:this.r*2}),this.lens.update(i)},this.getFilterData=()=>{const{filter:n}=this.options,{model:i}=this.context,a=i.getData();if(!n)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(c=>n(At(c),"node")),edges:o.filter(c=>n(At(c),"edge")),combos:l.filter(c=>n(At(c),"combo"))}},this.getFocusElements=n=>{const{nodes:i,edges:a}=this.getFilterData(),s=i.filter(c=>bn(ar(c),n)<this.r),o=s.map(c=>At(c)),l=a.filter(c=>{const{source:u,target:h}=c,d=o.includes(u),f=o.includes(h);switch(this.options.nodeType){case"both":return d&&f;case"either":return d!==f;case"source":return d&&!f;case"target":return!d&&f;default:return!1}});return{nodes:s,edges:l}},this.renderFocusElements=()=>{const{element:n,graph:i}=this.context;if(!this.isLensOn)return;const a=this.lens.getCenter(),{nodes:s,edges:o}=this.getFocusElements(a),l=new Set,c=u=>{const h=At(u);l.add(h);const d=n.getElement(h);if(!d)return;const f=this.shapes.get(h)||d.cloneNode();f.setPosition(d.getPosition()),f.id=d.id,this.shapes.has(h)?Object.entries(d.attributes).forEach(([p,y])=>{f.style[p]!==y&&(f.style[p]=y)}):(this.canvas.appendChild(f),this.shapes.set(h,f));const v=i.getElementType(h),g=this.getElementStyle(v,u);f.update(g)};s.forEach(c),o.forEach(c),this.shapes.forEach((u,h)=>{l.has(h)||(u.destroy(),this.shapes.delete(h))})},this.scaleRByWheel=n=>{var i;this.options.preventDefault&&n.preventDefault();const{clientX:a,clientY:s,deltaX:o,deltaY:l}=n,{graph:c,canvas:u}=this.context,h=c.getCanvasByClient([a,s]),d=(i=this.lens)===null||i===void 0?void 0:i.getCenter();if(!this.isLensOn||bn(h,d)>this.r)return;const{maxR:f,minR:v}=this.options,g=o+l>0?1/(1-Vb):1-Vb,p=Math.min(...u.getSize())/2;this.r=Math.max(v||0,Math.min(f||p,this.r*g)),this.renderLens(d),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=n=>{var i;const a=yr(n.canvas),s=(i=this.lens)===null||i===void 0?void 0:i.getCenter();!this.isLensOn||bn(a,s)>this.r||(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=yr(n.canvas);this.renderLens(i),this.renderFocusElements()},this.onDragEnd=()=>{this.isLensDragging=!1},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}getElementStyle(t,e){const n=t==="node"?this.options.nodeStyle:this.options.edgeStyle;return typeof n=="function"?n(e):n}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,a=e.getCanvas().getLayer();["click","drag"].includes(n)&&a.addEventListener(Bt.CLICK,this.onEdgeFilter),n==="pointermove"?a.addEventListener(Bt.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.addEventListener(Bt.DRAG_START,this.onDragStart),a.addEventListener(Bt.DRAG,this.onDrag),a.addEventListener(Bt.DRAG_END,this.onDragEnd)),i==="wheel"&&((t=this.graphDom)===null||t===void 0||t.addEventListener(Bt.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,a=e.getCanvas().getLayer();["click","drag"].includes(n)&&a.removeEventListener(Bt.CLICK,this.onEdgeFilter),n==="pointermove"?a.removeEventListener(Bt.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.removeEventListener(Bt.DRAG_START,this.onDragStart),a.removeEventListener(Bt.DRAG,this.onDrag),a.removeEventListener(Bt.DRAG_END,this.onDragEnd)),i==="wheel"&&((t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.scaleRByWheel))}update(t){var e;this.unbindEvents(),super.update(t),this.r=(e=t.r)!==null&&e!==void 0?e:this.r,this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach((t,e)=>{t.destroy(),this.shapes.delete(e)}),super.destroy()}}yh.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const qD={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12},Ub=.05,Yb=.1;class bh extends xr{constructor(t,e){super(t,Object.assign({},bh.defaultOptions,e)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=yr(n.canvas);this.onMagnify(i)},this.onMagnify=n=>{n.some(isNaN)||(this.renderLens(n),this.renderFocusElements())},this.renderLens=n=>{const i=Object.assign({},qD,this.options.style);this.isLensOn||(this.lens=new _s({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Bi(n),{size:this.r*2,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(i)},this.getDPercent=()=>{const{minD:n,maxD:i}=this.options;return`${Math.round((this.d-n)/(i-n)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:n}=this.context,i=this.lens.getCenter(),a=(this.d+1)*this.r,s=new Map,o=new Map;n.getNodeData().forEach(c=>{const u=ar(c),h=bn(u,i);if(h>this.r)return;const d=a*h/(this.d*h+this.r),[f,v]=u,[g,p]=i,y=(f-g)/h,b=(v-p)/h,w=[g+d*y,p+d*b],O=At(c),_=this.getNodeStyle(c),F=Bs(n.getElementRenderStyle(O),Object.keys(_));s.set(O,Object.assign(Object.assign({},Bi(w)),_)),o.set(O,Object.assign(Object.assign({},Bi(u)),F))}),this.updateStyle(s,o)},this.getNodeStyle=n=>{const{nodeStyle:i}=this.options;return typeof i=="function"?i(n):i},this.updateStyle=(n,i)=>{const{graph:a,element:s}=this.context,{enter:o,exit:l,keep:c}=ja(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(n.keys()),d=>d),u=new Set,h=(d,f)=>{const v=s.getElement(d);v==null||v.update(f),a.getRelatedEdgesData(d).forEach(g=>{u.add(At(g))})};[...o,...c].forEach(d=>{h(d,n.get(d))}),l.forEach(d=>{h(d,this.prevOriginStyleMap.get(d)),this.prevOriginStyleMap.delete(d)}),u.forEach(d=>{const f=s.getElement(d);f==null||f.update({})}),this.prevMagnifiedStyleMap=n,i.forEach((d,f)=>{this.prevOriginStyleMap.has(f)||this.prevOriginStyleMap.set(f,d)})},this.isWheelValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const{clientX:i,clientY:a}=n,s=this.context.graph.getCanvasByClient([i,a]),o=this.lens.getCenter();return!(bn(s,o)>this.r)},this.scaleR=n=>{const{maxR:i,minR:a}=this.options,s=n?1/(1-Ub):1-Ub,o=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(a||0,Math.min(i||o,this.r*s))},this.scaleD=n=>{const{maxD:i,minD:a}=this.options,s=n?this.d+Yb:this.d-Yb;this.d=Math.max(a,Math.min(i,s))},this.scaleRByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleR(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleD(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.isDragValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const i=yr(n.canvas),a=this.lens.getCenter();return!(bn(i,a)>this.r)},this.isLensDragging=!1,this.onDragStart=n=>{this.isDragValid(n)&&(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=yr(n.canvas);this.onMagnify(i)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleR(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleD(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.addEventListener(Bt.CLICK,this.onCreateFisheye),n==="pointermove"&&s.addEventListener(Bt.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.addEventListener(Bt.DRAG_START,this.onDragStart),s.addEventListener(Bt.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.addEventListener(Bt.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(t=this.graphDom)===null||t===void 0||t.addEventListener(Bt.WHEEL,o,{passive:!1})}}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.removeEventListener(Bt.CLICK,this.onCreateFisheye),n==="pointermove"&&s.removeEventListener(Bt.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.removeEventListener(Bt.DRAG_START,this.onDragStart),s.removeEventListener(Bt.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.removeEventListener(Bt.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,o)}}update(t){var e,n;this.unbindEvents(),super.update(t),this.r=(e=t.r)!==null&&e!==void 0?e:this.r,this.d=(n=t.d)!==null&&n!==void 0?n:this.d,this.bindEvents()}destroy(){var t;this.unbindEvents(),this.isLensOn&&((t=this.lens)===null||t===void 0||t.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}bh.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class xh extends xr{constructor(t,e){super(t,Object.assign({},xh.defaultOptions,e)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var n,i,a,s;const o=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(o),o?(i=(n=this.options).onEnter)===null||i===void 0||i.call(n):(s=(a=this.options).onExit)===null||s===void 0||s.call(a)},this.shortcut=new go(t.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML=`
:not(:root):fullscreen::backdrop {
background: transparent;
}
`}bindEvents(){this.unbindEvents(),this.shortcut.unbindAll();const{request:t=[],exit:e=[]}=this.options.trigger;this.shortcut.bind(t,this.request),this.shortcut.bind(e,this.exit),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(i=>{document.addEventListener(i,this.onFullscreenChange,!1)})}unbindEvents(){this.shortcut.unbindAll(),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(e=>{document.removeEventListener(e,this.onFullscreenChange,!1)})}setGraphSize(t=!0){var e,n;let i,a;t?(i=((e=globalThis.screen)===null||e===void 0?void 0:e.width)||0,a=((n=globalThis.screen)===null||n===void 0?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[i,a]=this.graphSize,this.context.graph.setSize(i,a),this.context.graph.render()}request(){document.fullscreenElement||!JD()||this.$el.requestFullscreen().catch(t=>{Kr.warn(`Error attempting to enable full-screen: ${t.message} (${t.name})`)})}exit(){document.fullscreenElement&&document.exitFullscreen()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.exit(),this.style.remove(),super.destroy()}}xh.defaultOptions={trigger:{},autoFit:!0};function JD(){return document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled")}class Eh extends xr{constructor(t,e){super(t,Object.assign({},Eh.defaultOptions,e)),this.$element=So("grid-line",!0),this.offset=[0,0],this.currentScale=1,this.followZoom=i=>{const{data:{scale:a,origin:s}}=i;if(!a)return;const o=this.currentScale;this.currentScale=a;const l=a/o,c=_i(s||this.context.graph.getCanvasCenter(),1-l),u=this.baseSize*a,h=_i(this.offset,l),d=Vf(h,u),f=Ce(d,c);this.$element.style.backgroundSize=`${u}px ${u}px`,this.$element.style.backgroundPosition=`${f[0]}px ${f[1]}px`,this.offset=Vf(f,u)},this.followTranslate=i=>{if(!this.options.follow)return;const{data:{translate:a}}=i;a&&this.updateOffset(a)},this.onTransform=i=>{const a=this.parseFollow(this.options.follow);a.zoom&&this.followZoom(i),a.translate&&this.followTranslate(i)},this.context.canvas.getContainer().prepend(this.$element),this.baseSize=this.options.size,this.updateStyle(),this.bindEvents()}update(t){super.update(t),t.size!==void 0&&(this.baseSize=t.size),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{stroke:t,lineWidth:e,border:n,borderLineWidth:i,borderStroke:a,borderStyle:s}=this.options,o=this.baseSize*this.currentScale;Object.assign(this.$element.style,{border:n?`${i}px ${s} ${a}`:"none",backgroundImage:`linear-gradient(${t} ${e}px, transparent ${e}px), linear-gradient(90deg, ${t} ${e}px, transparent ${e}px)`,backgroundSize:`${o}px ${o}px`,backgroundRepeat:"repeat"})}updateOffset(t){const e=this.baseSize*this.currentScale;this.offset=Vf(Ce(this.offset,t),e),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}parseFollow(t){var e,n;return Uo(t)?{translate:t,zoom:t}:{translate:(e=t==null?void 0:t.translate)!==null&&e!==void 0?e:!1,zoom:(n=t==null?void 0:t.zoom)!==null&&n!==void 0?n:!1}}destroy(){this.context.graph.off(Kt.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}Eh.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};function Hv(r){const t={Added:new Map,Updated:new Map,Removed:new Map};return r.forEach(e=>{const{type:n,value:i}=e,a=At(i);if(n==="NodeAdded"||n==="EdgeAdded"||n==="ComboAdded")t.Added.set(a,e);else if(n==="NodeUpdated"||n==="EdgeUpdated"||n==="ComboUpdated")if(t.Added.has(a))t.Added.set(a,{type:n.replace("Updated","Added"),value:i});else if(t.Updated.has(a)){const{original:s}=t.Updated.get(a);t.Updated.set(a,{type:n,value:i,original:s})}else t.Removed.has(a)||t.Updated.set(a,e);else(n==="NodeRemoved"||n==="EdgeRemoved"||n==="ComboRemoved")&&(t.Added.has(a)?t.Added.delete(a):(t.Updated.has(a)&&t.Updated.delete(a),t.Removed.set(a,e)))}),[...Array.from(t.Added.values()),...Array.from(t.Updated.values()),...Array.from(t.Removed.values())]}function Hb(r){const{NodeAdded:t=[],NodeUpdated:e=[],NodeRemoved:n=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:s=[],ComboAdded:o=[],ComboUpdated:l=[],ComboRemoved:c=[]}=Hc(r,u=>u.type);return{add:{nodes:t,edges:i,combos:o},update:{nodes:e,edges:a,combos:l},remove:{nodes:n,edges:s,combos:c}}}function Xb(r,t){for(const e in r)Fn(r[e])&&!Array.isArray(r[e])&&r[e]!==null?(t[e]||(t[e]={}),Xb(r[e],t[e])):t[e]===void 0&&(t[e]=hl(e))}function $D(r,t=!1,e){const n={animation:t,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:a,remove:s}=Hb(Hv(r));return["nodes","edges","combos"].forEach(o=>{a[o]&&a[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);let d=Object.assign({},l.original);if(e){const f=e.graph.getElementType(At(l.original)),v=f==="edge"?"stroke":"fill",g=e.element.getElementComputedStyle(f,l.original);d=Object.assign(Object.assign({},l.original),{style:Object.assign({[v]:g[v]},l.original.style)})}Xb(h,d),(c=n.current.update)[o]||(c[o]=[]),n.current.update[o].push(h),(u=n.original.update)[o]||(u[o]=[]),n.original.update[o].push(d)}),i[o]&&i[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);(c=n.current.add)[o]||(c[o]=[]),n.current.add[o].push(h),(u=n.original.remove)[o]||(u[o]=[]),n.original.remove[o].push(h)}),s[o]&&s[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);(c=n.current.remove)[o]||(c[o]=[]),n.current.remove[o].push(h),(u=n.original.add)[o]||(u[o]=[]),n.original.add[o].push(h)})}),n}class wh extends xr{constructor(t,e){super(t,Object.assign({},wh.defaultOptions,e)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(i,a=!0)=>{var s,o,l;this.freezed=!0,(o=(s=this.options).executeCommand)===null||o===void 0||o.call(s,i);const c=a?i.original:i.current;this.context.graph.addData(c.add),this.context.graph.updateData(c.update),this.context.graph.removeData(gy(c.remove,!1)),(l=this.context.element)===null||l===void 0||l.draw({silence:!0,animation:i.animation}),this.freezed=!1},this.addCommand=i=>{var a;if(!this.freezed){if(i.type===Kt.AFTER_DRAW){const{dataChanges:s=[],animation:o=!0}=i.data;if(!((a=this.context.batch)===null||a===void 0)&&a.isBatching){if(!this.batchChanges)return;this.batchChanges.push(s),this.batchAnimation&&(this.batchAnimation=o);return}this.batchChanges=[s],this.batchAnimation=o}this.undoStackPush($D(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(Ia.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=i=>{const{initiate:a}=i.data;this.batchAnimation=!1,a?this.batchChanges=[]:this.undoStack.pop()||(this.batchChanges=null)},this.emitter=new Vu;const{graph:n}=this.context;n.on(Kt.AFTER_DRAW,this.addCommand),n.on(Kt.BATCH_START,this.initBatchCommand),n.on(Kt.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var t,e,n,i;const a=this.undoStack.pop();if(a){if(this.executeCommand(a),((e=(t=this.options).beforeAddCommand)===null||e===void 0?void 0:e.call(t,a,!1))===!1)return;this.redoStack.push(a),(i=(n=this.options).afterAddCommand)===null||i===void 0||i.call(n,a,!1),this.notify(Ia.UNDO,a)}return this}redo(){const t=this.redoStack.pop();return t&&(this.executeCommand(t,!1),this.undoStackPush(t),this.notify(Ia.REDO,t)),this}undoAndCancel(){const t=this.undoStack.pop();return t&&(this.executeCommand(t,!1),this.redoStack=[],this.notify(Ia.CANCEL,t)),this}undoStackPush(t){var e,n,i,a;const{stackSize:s}=this.options;s!==0&&this.undoStack.length>=s&&this.undoStack.shift(),((n=(e=this.options).beforeAddCommand)===null||n===void 0?void 0:n.call(e,t,!0))!==!1&&(this.undoStack.push(t),(a=(i=this.options).afterAddCommand)===null||a===void 0||a.call(i,t,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(Ia.CLEAR,null)}notify(t,e){this.emitter.emit(t,{cmd:e}),this.emitter.emit(Ia.CHANGE,{cmd:e})}on(t,e){this.emitter.on(t,e)}destroy(){const{graph:t}=this.context;t.off(Kt.AFTER_DRAW,this.addCommand),t.off(Kt.BATCH_START,this.initBatchCommand),t.off(Kt.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}wh.defaultOptions={stackSize:0};const Xv={toXy(r,t){if(!t)return[...r];const e=t[0].slice(1),n=t[1].slice(1);return r.map(i=>[i[e],i[n]])},fromXy(r,t){if(!t)return[...r];const e=t[0].slice(1),n=t[1].slice(1);return r.map(([i,a])=>({[e]:i,[n]:a}))}};class t_{constructor(t,e){this._cells=[],this._cellSize=e,this._reverseCellSize=1/e;for(const n of t){const i=this.coordToCellNum(n[0]),a=this.coordToCellNum(n[1]);this._cells[i]||(this._cells[i]=[]),this._cells[i][a]||(this._cells[i][a]=[]),this._cells[i][a].push(n)}}cellPoints(t,e){var n;return((n=this._cells[t])===null||n===void 0?void 0:n[e])||[]}rangePoints(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),i=this.coordToCellNum(t[2]),a=this.coordToCellNum(t[3]),s=[];for(let o=e;o<=i;o++)for(let l=n;l<=a;l++){const c=this.cellPoints(o,l);for(const u of c)s.push(u)}return s}removePoint(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),i=this._cells[e][n],a=i.findIndex(([s,o])=>s===t[0]&&o===t[1]);return a>-1&&i.splice(a,1),i}trunc(t){return Math.trunc(t)}coordToCellNum(t){return this.trunc(t*this._reverseCellSize)}extendBbox(t,e){return[t[0]-e*this._cellSize,t[1]-e*this._cellSize,t[2]+e*this._cellSize,t[3]+e*this._cellSize]}}function e_(r,t){return new t_(r,t)}const Kb=+(Math.pow(2,27)+1);function Sh(r,t,e){const n=r*t,i=Kb*r,a=i-r,s=i-a,o=r-s,l=Kb*t,c=l-t,u=l-c,h=t-u,v=n-s*u-o*u-s*h,g=o*h-v;return e?(e[0]=g,e[1]=n,e):[g,n]}function n_(r,t,e){const n=r+t,i=n-r,a=n-i,s=t-i,o=r-a;return e?(e[0]=o+s,e[1]=n,e):[o+s,n]}function r_(r,t){const e=r.length;if(e===1){const o=Sh(r[0],t);return o[0]?o:[o[1]]}const n=new Array(2*e),i=[.1,.1],a=[.1,.1];let s=0;Sh(r[0],t,i),i[0]&&(n[s++]=i[0]);for(let o=1;o<e;++o){Sh(r[o],t,a);const l=i[1];n_(l,a[0],i),i[0]&&(n[s++]=i[0]);const c=a[1],u=i[1],h=c+u,d=h-c,f=u-d;i[1]=h,f&&(n[s++]=f)}return i[1]&&(n[s++]=i[1]),s===0&&(n[s++]=0),n.length=s,n}function i_(r,t){const e=r+t,n=e-r,i=e-n,a=t-n,o=r-i+a;return o?[o,e]:[e]}function a_(r,t){const e=r.length|0,n=t.length|0;if(e===1&&n===1)return i_(r[0],-t[0]);const i=e+n,a=new Array(i);let s=0,o=0,l=0;const c=Math.abs;let u=r[o],h=c(u),d=-t[l],f=c(d),v,g;h<f?(g=u,o+=1,o<e&&(u=r[o],h=c(u))):(g=d,l+=1,l<n&&(d=-t[l],f=c(d))),o<e&&h<f||l>=n?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=-t[l],f=c(d)));let p=v+g,y=p-v,b=g-y,w=b,O=p,_,F,W,j,H;for(;o<e&&l<n;)h<f?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=-t[l],f=c(d))),g=w,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),_=O+p,F=_-O,W=_-F,j=p-F,H=O-W,w=H+j,O=_;for(;o<e;)v=u,g=w,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),_=O+p,F=_-O,W=_-F,j=p-F,H=O-W,w=H+j,O=_,o+=1,o<e&&(u=r[o]);for(;l<n;)v=d,g=w,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),_=O+p,F=_-O,W=_-F,j=p-F,H=O-W,w=H+j,O=_,l+=1,l<n&&(d=-t[l]);return w&&(a[s++]=w),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}function s_(r,t){const e=r+t,n=e-r,i=e-n,a=t-n,o=r-i+a;return o?[o,e]:[e]}function o_(r,t){const e=r.length|0,n=t.length|0;if(e===1&&n===1)return s_(r[0],t[0]);const i=e+n,a=new Array(i);let s=0,o=0,l=0;const c=Math.abs;let u=r[o],h=c(u),d=t[l],f=c(d),v,g;h<f?(g=u,o+=1,o<e&&(u=r[o],h=c(u))):(g=d,l+=1,l<n&&(d=t[l],f=c(d))),o<e&&h<f||l>=n?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=t[l],f=c(d)));let p=v+g,y=p-v,b=g-y,w=b,O=p,_,F,W,j,H;for(;o<e&&l<n;)h<f?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=t[l],f=c(d))),g=w,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),_=O+p,F=_-O,W=_-F,j=p-F,H=O-W,w=H+j,O=_;for(;o<e;)v=u,g=w,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),_=O+p,F=_-O,W=_-F,j=p-F,H=O-W,w=H+j,O=_,o+=1,o<e&&(u=r[o]);for(;l<n;)v=d,g=w,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),_=O+p,F=_-O,W=_-F,j=p-F,H=O-W,w=H+j,O=_,l+=1,l<n&&(d=t[l]);return w&&(a[s++]=w),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}const Qb=5,Mh=11102230246251565e-32,l_=(3+16*Mh)*Mh,c_=(7+56*Mh)*Mh;function u_(r,t,e,n){return function(a,s,o){const l=r(r(t(s[1],o[0]),t(-o[1],s[0])),r(t(a[1],s[0]),t(-s[1],a[0]))),c=r(t(a[1],o[0]),t(-o[1],a[0])),u=n(l,c);return u[u.length-1]}}function h_(r,t,e,n){return function(a,s,o,l){const c=r(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),s[2]),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),l[2])))),u=r(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),r(e(r(t(s[1],o[0]),t(-o[1],s[0])),a[2]),r(e(r(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),o[2])))),h=n(c,u);return h[h.length-1]}}function d_(r,t,e,n){return function(a,s,o,l,c){const u=r(r(r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),o[2]),r(e(r(t(o[1],c[0]),t(-c[1],o[0])),-l[2]),e(r(t(o[1],l[0]),t(-l[1],o[0])),c[2]))),s[3]),r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-l[2]),e(r(t(s[1],l[0]),t(-l[1],s[0])),c[2]))),-o[3]),e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),c[2]))),l[3]))),r(e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),s[2]),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),-c[3]),r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-l[2]),e(r(t(s[1],l[0]),t(-l[1],s[0])),c[2]))),a[3]),e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-l[2]),e(r(t(a[1],l[0]),t(-l[1],a[0])),c[2]))),-s[3])))),r(r(e(r(e(r(t(s[1],c[0]),t(-c[1],s[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),l[3]),r(e(r(e(r(t(s[1],l[0]),t(-l[1],s[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-c[3]),e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),s[2]),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),a[3]))),r(e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-s[3]),r(e(r(e(r(t(s[1],l[0]),t(-l[1],s[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),o[3]),e(r(e(r(t(s[1],o[0]),t(-o[1],s[0])),a[2]),r(e(r(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),o[2]))),-l[3]))))),h=r(r(r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),o[2]),r(e(r(t(o[1],c[0]),t(-c[1],o[0])),-l[2]),e(r(t(o[1],l[0]),t(-l[1],o[0])),c[2]))),a[3]),e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-l[2]),e(r(t(a[1],l[0]),t(-l[1],a[0])),c[2]))),-o[3])),r(e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),l[3]),e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-c[3]))),r(r(e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),c[2]))),a[3]),e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),-s[3])),r(e(r(e(r(t(s[1],c[0]),t(-c[1],s[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),o[3]),e(r(e(r(t(s[1],o[0]),t(-o[1],s[0])),a[2]),r(e(r(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),o[2]))),-c[3])))),d=n(u,h);return d[d.length-1]}}function Ah(r){return(r===3?u_:r===4?h_:d_)(o_,Sh,r_,a_)}const f_=Ah(3),v_=Ah(4),Vs=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){const i=(t[1]-n[1])*(e[0]-n[0]),a=(t[0]-n[0])*(e[1]-n[1]),s=i-a;let o;if(i>0){if(a<=0)return s;o=i+a}else if(i<0){if(a>=0)return s;o=-(i+a)}else return s;const l=l_*o;return s>=l||s<=-l?s:f_(t,e,n)},function(t,e,n,i){const a=t[0]-i[0],s=e[0]-i[0],o=n[0]-i[0],l=t[1]-i[1],c=e[1]-i[1],u=n[1]-i[1],h=t[2]-i[2],d=e[2]-i[2],f=n[2]-i[2],v=s*u,g=o*c,p=o*l,y=a*u,b=a*c,w=s*l,O=h*(v-g)+d*(p-y)+f*(b-w),_=(Math.abs(v)+Math.abs(g))*Math.abs(h)+(Math.abs(p)+Math.abs(y))*Math.abs(d)+(Math.abs(b)+Math.abs(w))*Math.abs(f),F=c_*_;return O>F||-O>F?O:v_(t,e,n,i)}];function g_(r){let t=Vs[r.length];return t||(t=Vs[r.length]=Ah(r.length)),t.apply(void 0,...r)}function p_(r,t,e,n,i,a,s){return function(...l){switch(l.length){case 0:case 1:return 0;case 2:return n(l[0],l[1]);case 3:return i(l[0],l[1],l[2]);case 4:return a(l[0],l[1],l[2],l[3]);case 5:return s(l[0],l[1],l[2],l[3],l[4])}return r(l)}}function m_(){for(;Vs.length<=Qb;)Vs.push(Ah(Vs.length));const r=p_(void 0,g_,...Vs);for(let t=0;t<=Qb;++t)r[t]=Vs[t];return r}var Dl=m_();const qb=Dl[3];function y_(r){const t=r.length;if(t<3){const o=new Array(t);for(let l=0;l<t;++l)o[l]=l;return t===2&&r[0][0]===r[1][0]&&r[0][1]===r[1][1]?[0]:o}const e=new Array(t);for(let o=0;o<t;++o)e[o]=o;e.sort((o,l)=>{const c=r[o][0]-r[l][0];return c||r[o][1]-r[l][1]});const n=[e[0],e[1]],i=[e[0],e[1]];for(let o=2;o<t;++o){const l=e[o],c=r[l];let u=n.length;for(;u>1&&qb(r[n[u-2]],r[n[u-1]],c)<=0;)u-=1,n.pop();for(n.push(l),u=i.length;u>1&&qb(r[i[u-2]],r[i[u-1]],c)>=0;)u-=1,i.pop();i.push(l)}const a=new Array(i.length+n.length-2);let s=0;for(let o=0,l=n.length;o<l;++o)a[s++]=n[o];for(let o=i.length-2;o>0;--o)a[s++]=i[o];return a}function b_(r,t,e,n){for(let i=0;i<2;++i){const a=r[i],s=t[i],[o,l]=[Math.min(a,s),Math.max(a,s)],c=e[i],u=n[i],[h,d]=[Math.min(c,u),Math.max(c,u)];if(d<o||l<h)return!1}return!0}function x_(r,t,e,n){const i=Dl(r,e,n),a=Dl(t,e,n);if(i>0&&a>0||i<0&&a<0)return!1;const s=Dl(e,r,t),o=Dl(n,r,t);return s>0&&o>0||s<0&&o<0?!1:i===0&&a===0&&s===0&&o===0?b_(r,t,e,n):!0}function E_(r){const t=[r[0]];let e=r[0];for(let n=1;n<r.length;n++){const i=r[n];(e[0]!==i[0]||e[1]!==i[1])&&t.push(i),e=i}return t}function w_(r){return r.sort(function(t,e){return t[0]-e[0]||t[1]-e[1]})}function Kv(r,t){return Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2)}function Jb(r,t,e){const n=[t[0]-r[0],t[1]-r[1]],i=[e[0]-r[0],e[1]-r[1]],a=Kv(r,t),s=Kv(r,e);return(n[0]*i[0]+n[1]*i[1])/Math.sqrt(a*s)}function $b(r,t){for(let e=0;e<t.length-1;e++){const n=[t[e],t[e+1]];if(!(r[0][0]===n[0][0]&&r[0][1]===n[0][1]||r[0][0]===n[1][0]&&r[0][1]===n[1][1])&&x_(r[0],r[1],n[0],n[1]))return!0}return!1}function S_(r){let t=1/0,e=1/0,n=-1/0,i=-1/0;for(let a=r.length-1;a>=0;a--)r[a][0]<t&&(t=r[a][0]),r[a][1]<e&&(e=r[a][1]),r[a][0]>n&&(n=r[a][0]),r[a][1]>i&&(i=r[a][1]);return[n-t,i-e]}function M_(r){return[Math.min(r[0][0],r[1][0]),Math.min(r[0][1],r[1][1]),Math.max(r[0][0],r[1][0]),Math.max(r[0][1],r[1][1])]}function A_(r,t,e){let n=null,i=ex,a=ex,s,o;for(let l=0;l<t.length;l++)s=Jb(r[0],r[1],t[l]),o=Jb(r[1],r[0],t[l]),s>i&&o>a&&!$b([r[0],t[l]],e)&&!$b([r[1],t[l]],e)&&(i=s,a=o,n=t[l]);return n}function tx(r,t,e,n,i){let a=!1;for(let s=0;s<r.length-1;s++){const o=[r[s],r[s+1]],l=o[0][0]+","+o[0][1]+","+o[1][0]+","+o[1][1];if(Kv(o[0],o[1])<t||i.has(l))continue;let c=0,u=M_(o),h,d,f;do u=n.extendBbox(u,c),h=u[2]-u[0],d=u[3]-u[1],f=A_(o,n.rangePoints(u),r),c++;while(f===null&&(e[0]>h||e[1]>d));h>=e[0]&&d>=e[1]&&i.add(l),f!==null&&(r.splice(s+1,0,f),n.removePoint(f),a=!0)}return a?tx(r,t,e,n,i):r}function T_(r,t,e){const n=t||20,i=E_(w_(Xv.toXy(r,e)));if(i.length<4){const h=i.concat([i[0]]);return e?Xv.fromXy(h,e):h}const a=S_(i),s=[a[0]*nx,a[1]*nx],o=y_(i).reverse().map(h=>i[h]);o.push(o[0]);const l=i.filter(function(h){return o.indexOf(h)<0}),c=Math.ceil(1/(i.length/(a[0]*a[1]))),u=tx(o,Math.pow(n,2),s,e_(l,c),new Set);return e?Xv.fromXy(u,e):u}const ex=Math.cos(90/(180/Math.PI)),nx=.6;function O_(r,t,e){if(r.length===1)return C_(r[0],t,e);if(r.length===2)return rx(r,t,e);if(r.length===3){const[n,i,a]=Yf(r);if(Ay(n,i,a))return rx([n,a],t,e)}switch(e){case"smooth":return k_(r,t);case"sharp":return P_(r,t);case"rounded":default:return N_(r,t)}}const C_=(r,t,e)=>{if(e==="sharp")return[["M",r[0]-t,r[1]-t],["L",r[0]+t,r[1]-t],["L",r[0]+t,r[1]+t],["L",r[0]-t,r[1]+t],["Z"]];const n=[t,t,0,0,0];return[["M",r[0],r[1]-t],["A",...n,r[0],r[1]+t],["A",...n,r[0],r[1]-t]]},rx=(r,t,e)=>{const n=[t,t,0,0,0],i=e==="sharp"?Ce(r[0],Za(pa(on(r[0],r[1])),t)):r[0],a=e==="sharp"?Ce(r[1],Za(pa(on(r[1],r[0])),t)):r[1],s=Za(pa(uu(on(i,a),!1)),t),o=Za(s,-1),l=Ce(i,s),c=Ce(a,s),u=Ce(a,o),h=Ce(i,o);return e==="sharp"?[["M",l[0],l[1]],["L",c[0],c[1]],["L",u[0],u[1]],["L",h[0],h[1]],["Z"]]:[["M",l[0],l[1]],["L",c[0],c[1]],["A",...n,u[0],u[1]],["L",h[0],h[1]],["A",...n,l[0],l[1]]]},N_=(r,t)=>{const e=Yf(r).map((o,l)=>{const c=(l-2+r.length)%r.length,u=(l-1+r.length)%r.length,h=(l+1)%r.length,d=r[c],f=r[u],v=r[h],g=on(d,f),p=on(f,o),y=on(o,v),b=(W,j)=>Gf(W,j,!0)<Math.PI,w=b(g,p),O=b(p,y),_=W=>Za(pa(uu(W,!1)),t),F=_(p);return[{p:Rs(w?Ce(f,_(g)):Ce(f,F)),concave:w&&f},{p:Rs(O?Ce(o,_(y)):Ce(o,F)),concave:O&&o}]}),n=[t,t,0,0,0],i=e.findIndex((o,l)=>!e[(l-1+e.length)%e.length][0].concave&&!e[(l-1+e.length)%e.length][1].concave&&!o[0].concave&&!o[0].concave&&!o[1].concave),a=e.slice(i).concat(e.slice(0,i));let s=[];return a.flatMap((o,l)=>{const c=[],u=a[e.length-1];return l===0&&c.push(["M",...u[1].p]),o[0].concave?s.push(o[0].p,o[1].p):c.push(["A",...n,...o[0].p]),o[1].concave?s.unshift(o[1].p):c.push(["L",...o[1].p]),s.length===3&&(c.pop(),c.push(["C",...s.flat()]),s=[]),c})},k_=(r,t)=>{const e=Yf(r).map((n,i)=>{const a=r[(i+1)%r.length];return{p:n,v:pa(on(a,n))}});return e.forEach((n,i)=>{const a=i>0?i-1:r.length-1,s=e[a].v,o=pa(Ce(s,Za(n.v,Gf(s,n.v,!0)<Math.PI?1:-1)));n.p=Ce(n.p,Za(o,t))}),Wy(e.map(n=>n.p))},P_=(r,t)=>{const n=r.map((a,s)=>{const o=r[s===0?r.length-1:s-1],l=pl(Za(pa(uu(on(o,a),!1)),t));return[Ce(o,l),Ce(a,l)]}).flat();return n.map((a,s)=>{if(s%2===0)return null;const o=[n[(s-1)%n.length],n[s%n.length]],l=[n[(s+1)%n.length],n[(s+2)%n.length]];return Uf(o,l,!0)}).filter(Boolean).map((a,s)=>[s===0?"M":"L",a[0],a[1]]).concat([["Z"]])};var R_=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Th extends xr{constructor(t,e){super(t,Object.assign({},Th.defaultOptions,e)),this.hullMemberIds=[],this.drawHull=()=>{if(!this.shape)this.shape=new wl({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);else{const n=!Zn(this.optionsCache,this.options);this.shape.update(this.getHullStyle(n))}this.optionsCache=Object.assign({},this.options)},this.updateHullPath=n=>{this.shape&&this.options.members.includes(At(n.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(n=!1)=>{const{graph:i}=this.context,a=this.getMember();if(a.length===0)return"";const s=a.map(c=>i.getNodeData(c)),o=T_(s.map(ar),this.options.concavity).slice(1).reverse(),l=o.flatMap(c=>s.filter(u=>Zn(ar(u),c)).map(At));return Zn(l,this.hullMemberIds)&&!n?this.path:(this.hullMemberIds=l,this.path=O_(o,this.getPadding(),this.options.corner),this.path)},this.bindEvents()}bindEvents(){this.context.graph.on(Kt.AFTER_RENDER,this.drawHull),this.context.graph.on(Kt.AFTER_ELEMENT_UPDATE,this.updateHullPath)}unbindEvents(){this.context.graph.off(Kt.AFTER_RENDER,this.drawHull),this.context.graph.off(Kt.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(t){const e=this.options,{members:n,padding:i,corner:a}=e,s=R_(e,["members","padding","corner"]);return Object.assign(Object.assign({},s),{d:this.getHullPath(t)})}getPadding(){const{graph:t}=this.context;return this.hullMemberIds.reduce((n,i)=>{const{halfExtents:a}=t.getElementRenderBounds(i),s=Math.max(a[0],a[1]);return Math.max(n,s)},0)+this.options.padding}addMember(t){const e=Array.isArray(t)?t:[t];this.options.members=[...new Set([...this.options.members,...e])],this.shape.update({d:this.getHullPath()})}removeMember(t){const e=Array.isArray(t)?t:[t];this.options.members=this.options.members.filter(n=>!e.includes(n)),e.some(n=>this.hullMemberIds.includes(n))&&this.shape.update({d:this.getHullPath()})}updateMember(t){this.options.members=fe(t)?t(this.options.members):t,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.unbindEvents(),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}Th.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};function ix(r,t){t(r),r.children&&r.children.forEach(function(e){e&&ix(e,t)})}function _l(r){Oh(r,!0)}function ji(r){Oh(r,!1)}function Oh(r,t){var e=t?"visible":"hidden";ix(r,function(n){n.attr("visibility",e)})}var L_=5,ax=function(r,t,e,n){e===void 0&&(e=0),n===void 0&&(n=L_),Object.entries(t).forEach(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1],l=r;Object.prototype.hasOwnProperty.call(t,s)&&(o?vo(o)?(vo(r[s])||(l[s]={}),e<n?ax(r[s],o,e+1,n):l[s]=t[s]):Gr(o)?(l[s]=[],l[s]=l[s].concat(o)):l[s]=o:l[s]=o)})},Jn=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)ax(r,t[n]);return r},D_=function(r){(0,G.ZT)(t,r);function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=r.apply(this,(0,G.ev)([],(0,G.CR)(e),!1))||this;return i.isMutationObserved=!0,i.addEventListener(Ie.INSERTED,function(){ji(i)}),i}return t}(ir);function sx(r){var t=r.appendChild(new D_({class:"offscreen"}));return ji(t),t}function __(r){for(var t=r;t;){if(t.className==="offscreen")return!0;t=t.parent}return!1}function I_(){Oh(this,this.attributes.visibility!=="hidden")}var Ln=function(r){(0,G.ZT)(t,r);function t(e,n){n===void 0&&(n={});var i=r.call(this,Jn({},{style:n},e))||this;return i.initialized=!1,i._defaultOptions=n,i}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=sx(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t.prototype.attributeChangedCallback=function(e){e==="visibility"&&I_.call(this)},t.prototype.update=function(e,n){var i;return this.attr(Jn({},this.attributes,e||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,n)},t.prototype.clear=function(){this.removeChildren()},t.prototype.bindEvents=function(e,n){},t.prototype.getSubShapeStyle=function(e){var n=e.x,i=e.y,a=e.transform,s=e.transformOrigin,o=e.class,l=e.className,c=e.zIndex,u=(0,G._T)(e,["x","y","transform","transformOrigin","class","className","zIndex"]);return u},t}(hf);function Qv(r){return r.toString().charAt(0).toUpperCase()+r.toString().slice(1)}function B_(r){return r.toString().charAt(0).toLowerCase()+r.toString().slice(1)}function F_(r,t){return"".concat(t).concat(Qv(r))}function ox(r,t,e){var n;e===void 0&&(e=!0);var i=t||((n=r.match(/^([a-z][a-z0-9]+)/))===null||n===void 0?void 0:n[0])||"",a=r.replace(new RegExp("^(".concat(i,")")),"");return e?B_(a):a}function z_(r,t){Object.entries(t).forEach(function(e){var n=(0,G.CR)(e,2),i=n[0],a=n[1];(0,G.ev)([r],(0,G.CR)(r.querySelectorAll(i)),!1).filter(function(s){return s.matches(i)}).forEach(function(s){if(s){var o=s;o.style.cssText+=Object.entries(a).reduce(function(l,c){return"".concat(l).concat(c.join(":"),";")},"")}})})}var Ch=function(r,t){if(!(r!=null&&r.startsWith(t)))return!1;var e=r[t.length];return e>="A"&&e<="Z"};function Ne(r,t,e){e===void 0&&(e=!1);var n={};return Object.entries(r).forEach(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1];if(!(s==="className"||s==="class")){if(Ch(s,"show")&&Ch(ox(s,"show"),t)!==e)s===F_(t,"show")?n[s]=o:n[s.replace(new RegExp(Qv(t)),"")]=o;else if(!Ch(s,"show")&&Ch(s,t)!==e){var l=ox(s,t);l==="filter"&&typeof o=="function"||(n[l]=o)}}}),n}function Mo(r,t){return Object.entries(r).reduce(function(e,n){var i=(0,G.CR)(n,2),a=i[0],s=i[1];return a.startsWith("show")?e["show".concat(t).concat(a.slice(4))]=s:e["".concat(t).concat(Qv(a))]=s,e},{})}function Ea(r,t){t===void 0&&(t=["x","y","class","className"]);var e=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],n={},i={};return Object.entries(r).forEach(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];t.includes(o)||(e.indexOf(o)!==-1?i[o]=l:n[o]=l)}),[n,i]}var j_=function(r){if(!Gr(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},Z_=j_,qv=function(r){(0,G.ZT)(t,r);function t(e){e===void 0&&(e={});var n=e.style,i=(0,G._T)(e,["style"]);return r.call(this,(0,G.pi)({style:(0,G.pi)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},i))||this}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=sx(this)),this._offscreen},enumerable:!1,configurable:!0}),t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t}(Os);function W_(r,t){var e=new Map;return r.forEach(function(n){var i=t(n);e.has(i)||e.set(i,[]),e.get(i).push(n)}),e}function G_(r){throw new Error(r)}var V_=function(){function r(i,a,s,o,l,c,u){i===void 0&&(i=null),a===void 0&&(a=null),s===void 0&&(s=null),o===void 0&&(o=null),l===void 0&&(l=[null,null,null,null,null]),c===void 0&&(c=[]),u===void 0&&(u=[]),t.add(this),this._elements=Array.from(i),this._data=a,this._parent=s,this._document=o,this._enter=l[0],this._update=l[1],this._exit=l[2],this._merge=l[3],this._split=l[4],this._transitions=c,this._facetElements=u}r.prototype.selectAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(a,null,this._elements[0],this._document)},r.prototype.selectFacetAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(this._elements,null,this._parent,this._document,void 0,void 0,a)},r.prototype.select=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new e([a],null,a,this._document)},r.prototype.append=function(i){var a=this,s=typeof i=="function"?i:function(){return a.createElement(i)},o=[];if(this._data!==null){for(var l=0;l<this._data.length;l++){var c=this._data[l],u=(0,G.CR)(Array.isArray(c)?c:[c,null],2),h=u[0],d=u[1],f=s(h,l);f.__data__=h,d!==null&&(f.__fromElements__=d),this._parent.appendChild(f),o.push(f)}return new e(o,null,this._parent,this._document)}for(var l=0;l<this._elements.length;l++){var v=this._elements[l],h=v.__data__,f=s(h,l);v.appendChild(f),o.push(f)}return new e(o,null,o[0],this._document)},r.prototype.maybeAppend=function(i,a){var s=(0,G.Q_)(this,t,"m",n).call(this,i[0]==="#"?i:"#".concat(i),a);return s.attr("id",i),s},r.prototype.maybeAppendByClassName=function(i,a){var s=i.toString(),o=(0,G.Q_)(this,t,"m",n).call(this,s[0]==="."?s:".".concat(s),a);return o.attr("className",s),o},r.prototype.maybeAppendByName=function(i,a){var s=(0,G.Q_)(this,t,"m",n).call(this,'[name="'.concat(i,'"]'),a);return s.attr("name",i),s},r.prototype.data=function(i,a,s){var o,l;a===void 0&&(a=function(K){return K}),s===void 0&&(s=function(){return null});for(var c=[],u=[],h=new Set(this._elements),d=[],f=new Set,v=new Map(this._elements.map(function(K,et){return[a(K.__data__,et),K]})),g=new Map(this._facetElements.map(function(K,et){return[a(K.__data__,et),K]})),p=W_(this._elements,function(K){return s(K.__data__)}),y=0;y<i.length;y++){var b=i[y],w=a(b,y),O=s(b,y);if(v.has(w)){var _=v.get(w);_.__data__=b,_.__facet__=!1,u.push(_),h.delete(_),v.delete(w)}else if(g.has(w)){var _=g.get(w);_.__data__=b,_.__facet__=!0,u.push(_),g.delete(w)}else if(p.has(w)){var F=p.get(w);d.push([b,F]);try{for(var W=(o=void 0,(0,G.XA)(F)),j=W.next();!j.done;j=W.next()){var _=j.value;h.delete(_)}}catch(K){o={error:K}}finally{try{j&&!j.done&&(l=W.return)&&l.call(W)}finally{if(o)throw o.error}}p.delete(w)}else if(v.has(O)){var _=v.get(O);_.__toData__?_.__toData__.push(b):_.__toData__=[b],f.add(_),h.delete(_)}else c.push(b)}var H=[new e([],c,this._parent,this._document),new e(u,null,this._parent,this._document),new e(h,null,this._parent,this._document),new e([],d,this._parent,this._document),new e(f,null,this._parent,this._document)];return new e(this._elements,null,this._parent,this._document,H)},r.prototype.merge=function(i){var a=(0,G.ev)((0,G.ev)([],(0,G.CR)(this._elements),!1),(0,G.CR)(i._elements),!1),s=(0,G.ev)((0,G.ev)([],(0,G.CR)(this._transitions),!1),(0,G.CR)(i._transitions),!1);return new e(a,null,this._parent,this._document,void 0,s)},r.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var a=e.registry[i];return a?new a:G_("Unknown node type: ".concat(i))},r.prototype.join=function(i,a,s,o,l){i===void 0&&(i=function(v){return v}),a===void 0&&(a=function(v){return v}),s===void 0&&(s=function(v){return v.remove()}),o===void 0&&(o=function(v){return v}),l===void 0&&(l=function(v){return v.remove()});var c=i(this._enter),u=a(this._update),h=s(this._exit),d=o(this._merge),f=l(this._split);return u.merge(c).merge(h).merge(d).merge(f)},r.prototype.remove=function(){for(var i=function(o){var l=a._elements[o],c=a._transitions[o];c?c.then(function(){return l.remove()}):l.remove()},a=this,s=0;s<this._elements.length;s++)i(s);return new e([],null,this._parent,this._document,void 0,this._transitions)},r.prototype.each=function(i){for(var a=0;a<this._elements.length;a++){var s=this._elements[a],o=s.__data__;i.call(s,o,a)}return this},r.prototype.attr=function(i,a){var s=typeof a!="function"?function(){return a}:a;return this.each(function(o,l){a!==void 0&&(this[i]=s.call(this,o,l))})},r.prototype.style=function(i,a,s){s===void 0&&(s=!0);var o=typeof a!="function"||!s?function(){return a}:a;return this.each(function(l,c){a!==void 0&&(this.style[i]=o.call(this,l,c))})},r.prototype.styles=function(i,a){return i===void 0&&(i={}),a===void 0&&(a=!0),this.each(function(s,o){var l=this;Object.entries(i).forEach(function(c){var u=(0,G.CR)(c,2),h=u[0],d=u[1],f=typeof d!="function"||!a?function(){return d}:d;d!==void 0&&l.attr(h,f.call(l,s,o))})})},r.prototype.update=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},r.prototype.maybeUpdate=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},r.prototype.transition=function(i){var a=this._transitions,s=new Array(this._elements.length);return this.each(function(o,l){s[l]=i.call(this,o,l)}),this._transitions=Z_(s),this},r.prototype.on=function(i,a){return this.each(function(){this.addEventListener(i,a)}),this},r.prototype.call=function(i){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];return i.call.apply(i,(0,G.ev)([this._parent,this],(0,G.CR)(a),!1)),this},r.prototype.node=function(){return this._elements[0]},r.prototype.nodes=function(){return this._elements},r.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},r.prototype.parent=function(){return this._parent};var t,e,n;return e=r,t=new WeakSet,n=function(a,s){var o=this._elements[0],l=o.querySelector(a);if(l)return new e([l],null,this._parent,this._document);var c=typeof s=="string"?this.createElement(s):s();return o.appendChild(c),new e([c],null,this._parent,this._document)},r.registry={g:ir,rect:pr,circle:Ji,path:ri,text:qv,ellipse:al,image:sl,line:As,polygon:Ts,polyline:Tc,html:co},r}();function ve(r){return new V_([r],null,r,r.ownerDocument)}function U_(r,t,e){return r.querySelector(t)?ve(r).select(t):ve(r).append(e)}var kr=function(){function r(t,e,n,i){t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=i}return Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),r.fromRect=function(t){return new r(t.x,t.y,t.width,t.height)},r.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},r.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},r}();function H7(r){var t=r.getRenderBounds(),e=__read(t.min,2),n=e[0],i=e[1],a=__read(t.max,2),s=a[0],o=a[1],l=s-n,c=o-i;return new kr(n,i,l,c)}var Zi=function(r,t){var e=function(i){return"".concat(t,"-").concat(i)},n=Object.fromEntries(Object.entries(r).map(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1],l=e(o);return[s,{name:l,class:".".concat(l),id:"#".concat(l),toString:function(){return l}}]}));return Object.assign(n,{prefix:e}),n};function Nh(r){return/\S+-\S+/g.test(r)?r.split("-").map(function(t){return t[0]}):r.length>2?[r[0]]:r.split("")}function Er(r){if(ie(r))return[r,r,r,r];if(Gr(r)){var t=r.length;if(t===1)return[r[0],r[0],r[0],r[0]];if(t===2)return[r[0],r[1],r[0],r[1]];if(t===3)return[r[0],r[1],r[2],r[1]];if(t===4)return r}return[0,0,0,0]}function qr(r,t,e,n,i){return n===void 0&&(n=!0),i===void 0&&(i=function(a){a.node().removeChildren()}),r?e(t):(n&&i(t),null)}var lx=Zi({text:"text"},"title");function Y_(r,t){var e=r.attributes,n=e.position,i=e.spacing,a=e.inset,s=e.text,o=r.getBBox(),l=t.getBBox(),c=Nh(n),u=(0,G.CR)(Er(s?i:0),4),h=u[0],d=u[1],f=u[2],v=u[3],g=(0,G.CR)(Er(a),4),p=g[0],y=g[1],b=g[2],w=g[3],O=(0,G.CR)([v+d,h+f],2),_=O[0],F=O[1],W=(0,G.CR)([w+y,p+b],2),j=W[0],H=W[1];if(c[0]==="l")return new kr(o.x,o.y,l.width+o.width+_+j,Math.max(l.height+H,o.height));if(c[0]==="t")return new kr(o.x,o.y,Math.max(l.width+j,o.width),l.height+o.height+F+H);var K=(0,G.CR)([t.attributes.width||l.width,t.attributes.height||l.height],2),et=K[0],rt=K[1];return new kr(l.x,l.y,et+o.width+_+j,rt+o.height+F+H)}function H_(r,t){var e=Object.entries(t).reduce(function(n,i){var a=(0,G.CR)(i,2),s=a[0],o=a[1],l=r.node().attr(s);return l||(n[s]=o),n},{});r.styles(e)}function X_(r){var t,e,n,i,a=r,s=a.width,o=a.height,l=a.position,c=(0,G.CR)([+s/2,+o/2],2),u=c[0],h=c[1],d=(0,G.CR)([+u,+h,"center","middle"],4),f=d[0],v=d[1],g=d[2],p=d[3],y=Nh(l);return y.includes("l")&&(t=(0,G.CR)([0,"start"],2),f=t[0],g=t[1]),y.includes("r")&&(e=(0,G.CR)([+s,"end"],2),f=e[0],g=e[1]),y.includes("t")&&(n=(0,G.CR)([0,"top"],2),v=n[0],p=n[1]),y.includes("b")&&(i=(0,G.CR)([+o,"bottom"],2),v=i[0],p=i[1]),{x:f,y:v,textAlign:g,textBaseline:p}}var K_=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return t.prototype.getAvailableSpace=function(){var e=this,n=this.attributes,i=n.width,a=n.height,s=n.position,o=n.spacing,l=n.inset,c=e.querySelector(lx.text.class);if(!c)return new kr(0,0,+i,+a);var u=c.getBBox(),h=u.width,d=u.height,f=(0,G.CR)(Er(o),4),v=f[0],g=f[1],p=f[2],y=f[3],b=(0,G.CR)([0,0,+i,+a],4),w=b[0],O=b[1],_=b[2],F=b[3],W=Nh(s);if(W.includes("i"))return new kr(w,O,_,F);W.forEach(function(Nt,Ct){var pt,xt,kt,jt;Nt==="t"&&(pt=(0,G.CR)(Ct===0?[d+p,+a-d-p]:[0,+a],2),O=pt[0],F=pt[1]),Nt==="r"&&(xt=(0,G.CR)([+i-h-y],1),_=xt[0]),Nt==="b"&&(kt=(0,G.CR)([+a-d-v],1),F=kt[0]),Nt==="l"&&(jt=(0,G.CR)(Ct===0?[h+g,+i-h-g]:[0,+i],2),w=jt[0],_=jt[1])});var j=(0,G.CR)(Er(l),4),H=j[0],K=j[1],et=j[2],rt=j[3],lt=(0,G.CR)([rt+K,H+et],2),ht=lt[0],yt=lt[1];return new kr(w+rt,O+H,_-ht,F-yt)},t.prototype.getBBox=function(){return this.title?this.title.getBBox():new kr(0,0,0,0)},t.prototype.render=function(e,n){var i=this,a=e.width,s=e.height,o=e.position,l=e.spacing,c=(0,G._T)(e,["width","height","position","spacing"]),u=(0,G.CR)(Ea(c),1),h=u[0],d=X_(e),f=d.x,v=d.y,g=d.textAlign,p=d.textBaseline;qr(!!c.text,ve(n),function(y){i.title=y.maybeAppendByClassName(lx.text,"text").styles(h).call(H_,{x:f,y:v,textAlign:g,textBaseline:p}).node()})},t}(Ln),Jv=function(){};function Jr(r,t){return fe(r)?r.apply(void 0,(0,G.ev)([],(0,G.CR)(t),!1)):r}function Q_(r,t){return r.reduce(function(e,n){return(e[n[t]]=e[n[t]]||[]).push(n),e},{})}function q_(r){return typeof r=="boolean"?!1:"enter"in r&&"update"in r&&"exit"in r}function cx(r){if(!r)return{enter:!1,update:!1,exit:!1};var t=["enter","update","exit"],e=Object.fromEntries(Object.entries(r).filter(function(n){var i=(0,G.CR)(n,1),a=i[0];return!t.includes(a)}));return Object.fromEntries(t.map(function(n){return q_(r)?r[n]===!1?[n,!1]:[n,(0,G.pi)((0,G.pi)({},r[n]),e)]:[n,e]}))}function Ao(r,t){r?r.finished.then(t):t()}function J_(r,t){r.length===0?t():Promise.all(r.map(function(e){return e==null?void 0:e.finished})).then(t)}function ux(r,t){"update"in r?r.update(t):r.attr(t)}function hx(r,t,e){if(t.length===0)return null;if(!e){var n=t.slice(-1)[0];return ux(r,{style:n}),null}return r.animate(t,e)}function $_(r,t){return!(r.nodeName!=="text"||t.nodeName!=="text"||r.attributes.text!==t.attributes.text)}function tI(r,t,e,n){if(n===void 0&&(n="destroy"),$_(r,t))return r.remove(),[null];var i=function(){n==="destroy"?r.destroy():n==="hide"&&ji(r),t.isVisible()&&_l(t)};if(!e)return i(),[null];var a=e.duration,s=a===void 0?0:a,o=e.delay,l=o===void 0?0:o,c=Math.ceil(+s/2),u=+s/4,h=(0,G.CR)(r.getGeometryBounds().center,2),d=h[0],f=h[1],v=(0,G.CR)(t.getGeometryBounds().center,2),g=v[0],p=v[1],y=(0,G.CR)([(d+g)/2-d,(f+p)/2-f],2),b=y[0],w=y[1],O=r.style.opacity,_=O===void 0?1:O,F=t.style.opacity,W=F===void 0?1:F,j=r.style.transform||"",H=t.style.transform||"",K=r.animate([{opacity:_,transform:"translate(0, 0) ".concat(j)},{opacity:0,transform:"translate(".concat(b,", ").concat(w,") ").concat(j)}],(0,G.pi)((0,G.pi)({fill:"both"},e),{duration:l+c+u})),et=t.animate([{opacity:0,transform:"translate(".concat(-b,", ").concat(-w,") ").concat(H),offset:.01},{opacity:W,transform:"translate(0, 0) ".concat(H)}],(0,G.pi)((0,G.pi)({fill:"both"},e),{duration:c+u,delay:l+c-u}));return Ao(et,i),[K,et]}function Wi(r,t,e){var n={},i={};return Object.entries(t).forEach(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];if(!ye(l)){var c=r.style[o]||r.parsedStyle[o]||0;c!==l&&(n[o]=c,i[o]=l)}}),e?hx(r,[n,i],(0,G.pi)({fill:"both"},e)):(ux(r,i),null)}function eI(r){var t;return((t=r[0])===null||t===void 0?void 0:t.map(function(e,n){return r.map(function(i){return i[n]})}))||[]}function $v(r,t,e){e===void 0&&(e=!1);var n=r.getBBox(),i=n.width,a=n.height,s=t/Math.max(i,a);return e&&(r.style.transform="scale(".concat(s,")")),s}var dx=function(r,t,e){return[["M",r-e,t],["A",e,e,0,1,0,r+e,t],["A",e,e,0,1,0,r-e,t],["Z"]]},nI=dx,rI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t-e],["L",r+e,t+e],["L",r-e,t+e],["Z"]]},iI=function(r,t,e){return[["M",r-e,t],["L",r,t-e],["L",r+e,t],["L",r,t+e],["Z"]]},aI=function(r,t,e){var n=e*Math.sin(.3333333333333333*Math.PI);return[["M",r-e,t+n],["L",r,t-n],["L",r+e,t+n],["Z"]]},sI=function(r,t,e){var n=e*Math.sin(.3333333333333333*Math.PI);return[["M",r-e,t-n],["L",r+e,t-n],["L",r,t+n],["Z"]]},oI=function(r,t,e){var n=e/2*Math.sqrt(3);return[["M",r,t-e],["L",r+n,t-e/2],["L",r+n,t+e/2],["L",r,t+e],["L",r-n,t+e/2],["L",r-n,t-e/2],["Z"]]},lI=function(r,t,e){var n=e-1.5;return[["M",r-e,t-n],["L",r+e,t+n],["L",r+e,t-n],["L",r-e,t+n],["Z"]]},fx=function(r,t,e){return[["M",r,t+e],["L",r,t-e]]},cI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t+e],["M",r+e,t-e],["L",r-e,t+e]]},uI=function(r,t,e){return[["M",r-e/2,t-e],["L",r+e/2,t-e],["M",r,t-e],["L",r,t+e],["M",r-e/2,t+e],["L",r+e/2,t+e]]},hI=function(r,t,e){return[["M",r-e,t],["L",r+e,t],["M",r,t-e],["L",r,t+e]]},dI=function(r,t,e){return[["M",r-e,t],["L",r+e,t]]},vx=function(r,t,e){return[["M",r-e,t],["L",r+e,t]]},fI=vx,vI=function(r,t,e){return[["M",r-e,t],["A",e/2,e/2,0,1,1,r,t],["A",e/2,e/2,0,1,0,r+e,t]]},gI=function(r,t,e){return[["M",r-e-1,t-2.5],["L",r,t-2.5],["L",r,t+2.5],["L",r+e+1,t+2.5]]},pI=function(r,t,e){return[["M",r-e-1,t+2.5],["L",r,t+2.5],["L",r,t-2.5],["L",r+e+1,t-2.5]]},mI=function(r,t,e){return[["M",r-(e+1),t+2.5],["L",r-e/2,t+2.5],["L",r-e/2,t-2.5],["L",r+e/2,t-2.5],["L",r+e/2,t+2.5],["L",r+e+1,t+2.5]]};function yI(r,t){return[["M",r-5,t+2.5],["L",r-5,t],["L",r,t],["L",r,t-3],["L",r,t+3],["L",r+6.5,t+3]]}var bI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t],["L",r-e,t+e],["Z"]]},xI=function(r,t,e){var n=e,i=e*.2,a=e*.7;return[["M",r-n,t],["A",n,n,0,1,0,r+n,t],["A",n,n,0,1,0,r-n,t],["Z"],["M",r-a,t],["L",r-i,t],["M",r+i,t],["L",r+a,t],["M",r,t-a],["L",r,t-i],["M",r,t+i],["L",r,t+a]]},wi=Zi({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),EI=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:bI(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,a){return"".concat(i,"/").concat(a)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new ir({class:wi.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new ir({class:wi.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Object.defineProperty(t.prototype,"defaultPage",{get:function(){var e=this.attributes.defaultPage;return kn(e,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageShape",{get:function(){var e=this.pageViews,n=(0,G.CR)(eI(e.map(function(h){var d=h.getBBox(),f=d.width,v=d.height;return[f,v]})).map(function(h){return Math.max.apply(Math,(0,G.ev)([],(0,G.CR)(h),!1))}),2),i=n[0],a=n[1],s=this.attributes,o=s.pageWidth,l=o===void 0?i:o,c=s.pageHeight,u=c===void 0?a:c;return{pageWidth:l,pageHeight:u}},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(t.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e=r.prototype.getBBox.call(this),n=e.x,i=e.y,a=this.controllerShape,s=this.pageShape,o=s.pageWidth,l=s.pageHeight;return new kr(n,i,o+a.width,l)},t.prototype.goTo=function(e){var n=this,i=this.attributes.animate,a=this,s=a.currPage,o=a.playState,l=a.playWindow,c=a.pageViews;if(o!=="idle"||e<0||c.length<=0||e>=c.length)return null;c[s].setLocalPosition(0,0),this.prepareFollowingPage(e);var u=(0,G.CR)(this.getFollowingPageDiff(e),2),h=u[0],d=u[1];this.playState="running";var f=hx(l,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-h,", ").concat(-d,")")}],i);return Ao(f,function(){n.innerCurrPage=e,n.playState="idle",n.setVisiblePages([e]),n.updatePageInfo()}),f},t.prototype.prev=function(){var e=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!e&&i<=0)return null;var a=e?(i-1+n)%n:kn(i-1,0,n);return this.goTo(a)},t.prototype.next=function(){var e=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!e&&i>=n-1)return null;var a=e?(i+1)%n:kn(i+1,0,n);return this.goTo(a)},t.prototype.renderClipPath=function(e){var n=this.pageShape,i=n.pageWidth,a=n.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=e.maybeAppendByClassName(wi.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},t.prototype.setVisiblePages=function(e){this.playWindow.children.forEach(function(n,i){e.includes(i)?_l(n):ji(n)})},t.prototype.adjustControllerLayout=function(){var e=this,n=e.prevBtnGroup,i=e.nextBtnGroup,a=e.pageInfoGroup,s=this.attributes,o=s.orientation,l=s.controllerPadding,c=a.getBBox(),u=c.width,h=c.height,d=(0,G.CR)(o==="horizontal"?[-180,0]:[-90,90],2),f=d[0],v=d[1];n.setLocalEulerAngles(f),i.setLocalEulerAngles(v);var g=n.getBBox(),p=g.width,y=g.height,b=i.getBBox(),w=b.width,O=b.height,_=Math.max(p,u,w),F=o==="horizontal"?{offset:[[0,0],[p/2+l,0],[p+u+l*2,0]],textAlign:"start"}:{offset:[[_/2,-y-l],[_/2,0],[_/2,O+l]],textAlign:"center"},W=(0,G.CR)(F.offset,3),j=(0,G.CR)(W[0],2),H=j[0],K=j[1],et=(0,G.CR)(W[1],2),rt=et[0],lt=et[1],ht=(0,G.CR)(W[2],2),yt=ht[0],Nt=ht[1],Ct=F.textAlign,pt=a.querySelector("text");pt&&(pt.style.textAlign=Ct),n.setLocalPosition(H,K),a.setLocalPosition(rt,lt),i.setLocalPosition(yt,Nt)},t.prototype.updatePageInfo=function(){var e,n=this,i=n.currPage,a=n.pageViews,s=n.attributes.formatter;a.length<2||((e=this.pageInfoGroup.querySelector(wi.pageInfo.class))===null||e===void 0||e.attr("text",s(i+1,a.length)),this.adjustControllerLayout())},t.prototype.getFollowingPageDiff=function(e){var n=this.currPage;if(n===e)return[0,0];var i=this.attributes.orientation,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=e<n?-1:1;return i==="horizontal"?[l*s,0]:[0,l*o]},t.prototype.prepareFollowingPage=function(e){var n=this,i=n.currPage,a=n.pageViews;if(this.setVisiblePages([e,i]),e!==i){var s=(0,G.CR)(this.getFollowingPageDiff(e),2),o=s[0],l=s[1];a[e].setLocalPosition(o,l)}},t.prototype.renderController=function(e){var n=this,i=this.attributes.controllerSpacing,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=this.pageViews.length>=2,c=e.maybeAppendByClassName(wi.controller,"g");if(Oh(c.node(),l),!!l){var u=Ne(this.attributes,"button"),h=Ne(this.attributes,"pageNum"),d=(0,G.CR)(Ea(u),2),f=d[0],v=d[1],g=f.size,p=(0,G._T)(f,["size"]),y=!c.select(wi.prevBtnGroup.class).node(),b=c.maybeAppendByClassName(wi.prevBtnGroup,"g").styles(v);this.prevBtnGroup=b.node();var w=b.maybeAppendByClassName(wi.prevBtn,"path"),O=c.maybeAppendByClassName(wi.nextBtnGroup,"g").styles(v);this.nextBtnGroup=O.node();var _=O.maybeAppendByClassName(wi.nextBtn,"path");[w,_].forEach(function(W){W.styles((0,G.pi)((0,G.pi)({},p),{transformOrigin:"center"})),$v(W.node(),g,!0)});var F=c.maybeAppendByClassName(wi.pageInfoGroup,"g");this.pageInfoGroup=F.node(),F.maybeAppendByClassName(wi.pageInfo,"text").styles(h),this.updatePageInfo(),c.node().setLocalPosition(s+i,o/2),y&&(this.prevBtnGroup.addEventListener("click",function(){n.prev()}),this.nextBtnGroup.addEventListener("click",function(){n.next()}))}},t.prototype.render=function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s;this.attr("transform","translate(".concat(a,", ").concat(o,")"));var l=ve(n);this.renderClipPath(l),this.renderController(l),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},t.prototype.bindEvents=function(){var e=this,n=Cl(function(){return e.render(e.attributes,e)},50);this.playWindow.addEventListener(Ie.INSERTED,n),this.playWindow.addEventListener(Ie.REMOVED,n)},t}(Ln);function wI(r){var t="default";if(Fn(r)&&r instanceof Image)t="image";else if(fe(r))t="symbol";else if(Ve(r)){var e=new RegExp("data:(image|text)");r.match(e)?t="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(r)?t="url":t="symbol"}return t}function SI(r){var t=wI(r);return["base64","url","image"].includes(t)?"image":r&&t==="symbol"?"path":null}var tn=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=this.getSubShapeStyle(e),c=l.symbol,u=l.size,h=u===void 0?16:u,d=(0,G._T)(l,["symbol","size"]),f=SI(c);qr(!!f,ve(n),function(v){v.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call(function(g){if(f==="image"){var p=h*2;g.styles({img:c,width:p,height:p,x:a-h,y:o-h})}else{var p=h/2,y=fe(c)?c:t.getSymbol(c);g.styles((0,G.pi)({d:y==null?void 0:y(a,o,p)},d))}})})},t.MARKER_SYMBOL_MAP=new Map,t.registerSymbol=function(e,n){t.MARKER_SYMBOL_MAP.set(e,n)},t.getSymbol=function(e){return t.MARKER_SYMBOL_MAP.get(e)},t.getSymbols=function(){return Array.from(t.MARKER_SYMBOL_MAP.keys())},t}(Ln);tn.registerSymbol("cross",cI),tn.registerSymbol("hyphen",dI),tn.registerSymbol("line",fx),tn.registerSymbol("plus",hI),tn.registerSymbol("tick",uI),tn.registerSymbol("circle",dx),tn.registerSymbol("point",nI),tn.registerSymbol("bowtie",lI),tn.registerSymbol("hexagon",oI),tn.registerSymbol("square",rI),tn.registerSymbol("diamond",iI),tn.registerSymbol("triangle",aI),tn.registerSymbol("triangle-down",sI),tn.registerSymbol("line",fx),tn.registerSymbol("dot",vx),tn.registerSymbol("dash",fI),tn.registerSymbol("smooth",vI),tn.registerSymbol("hv",gI),tn.registerSymbol("vh",pI),tn.registerSymbol("hvh",mI),tn.registerSymbol("vhv",yI),tn.registerSymbol("focus",xI);function X7(r,t,e){var n=Math.round((r-e)/t);return e+n*t}function MI(r,t,e){var n=1.4,i=n*e;return[["M",r-e,t-i],["L",r+e,t-i],["L",r+e,t+i],["L",r-e,t+i],["Z"]]}var gx=1.4,px=.4;function AI(r,t,e){var n=e,i=n*gx,a=n/2,s=n/6,o=r+i*px;return[["M",r,t],["L",o,t+a],["L",r+i,t+a],["L",r+i,t-a],["L",o,t-a],["Z"],["M",o,t+s],["L",r+i-2,t+s],["M",o,t-s],["L",r+i-2,t-s]]}function TI(r,t,e){var n=e,i=n*gx,a=n/2,s=n/6,o=t+i*px;return[["M",r,t],["L",r-a,o],["L",r-a,t+i],["L",r+a,t+i],["L",r+a,o],["Z"],["M",r-s,o],["L",r-s,t+i-2],["M",r+s,o],["L",r+s,t+i-2]]}tn.registerSymbol("hiddenHandle",MI),tn.registerSymbol("verticalHandle",AI),tn.registerSymbol("horizontalHandle",TI);var K7=function(r,t,e){return r===void 0&&(r="horizontal"),r==="horizontal"?t:e};function Q7(r,t,e,n){var i;n===void 0&&(n=4);var a=__read(r,2),s=a[0],o=a[1],l=__read(t,2),c=l[0],u=l[1],h=__read(e,2),d=h[0],f=h[1],v=__read([c,u],2),g=v[0],p=v[1],y=p-g;return g>p&&(i=__read([p,g],2),g=i[0],p=i[1]),y>o-s?[s,o]:g<s?d===s&&f===p?[s,p]:[s,y+s]:p>o?f===o&&d===g?[g,o]:[o-y,o]:[g,p]}function t0(r,t,e){return r===void 0&&(r="horizontal"),r==="horizontal"?t:e}function q7(r){var t=r&&r.getRenderBounds();if(!t)return{width:0,height:0};var e=t.getMax(),n=t.getMin();return{width:e[0]-n[0],height:e[1]-n[1]}}function mx(r){var t=r.getLocalBounds(),e=t.min,n=t.max,i=(0,G.CR)([e,n],2),a=(0,G.CR)(i[0],2),s=a[0],o=a[1],l=(0,G.CR)(i[1],2),c=l[0],u=l[1];return{x:s,y:o,width:c-s,height:u-o,left:s,bottom:u,top:o,right:c}}function J7(r,t){var e=select(r).append("text").node();return e.attr(__assign(__assign({},t),{visibility:"hidden"})),e}function OI(r,t){var e=(0,G.CR)(r,2),n=e[0],i=e[1],a=(0,G.CR)(t,2),s=a[0],o=a[1];return n!==s&&i===o}function $7(r,t){var e=__read(r,2),n=e[0],i=e[1],a=__read(t,2),s=a[0],o=a[1];return n===s&&i!==o}function CI(r,t){var e,n,i=t.attributes;try{for(var a=(0,G.XA)(Object.entries(i)),s=a.next();!s.done;s=a.next()){var o=(0,G.CR)(s.value,2),l=o[0],c=o[1];l!=="id"&&l!=="className"&&r.attr(l,c)}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}}function wa(r){return typeof r=="function"?r():Ve(r)||ie(r)?new qv({style:{text:String(r)}}):r}function NI(r,t){return typeof r=="function"?r():Ve(r)||ie(r)?new co({style:(0,G.pi)((0,G.pi)({},t),{innerHTML:String(r)})}):r}var kh,e0;function tj(r){e0=r}var kI=zv(function(r,t){var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return e0?e0(r,e):(kh||(kh=Ut.offscreenCanvasCreator.getOrCreateContext(void 0)),kh.font=[a,s,i,"".concat(e,"px"),n].join(" "),kh.measureText(r).width)},function(r,t){return[r,Object.values(t||yx(r)).join()].join("")},4096),yx=function(r){var t=r.style.fontFamily||"sans-serif",e=r.style.fontWeight||"normal",n=r.style.fontStyle||"normal",i=r.style.fontVariant,a=r.style.fontSize;return a=typeof a=="object"?a.value:a,{fontSize:a,fontFamily:t,fontWeight:e,fontStyle:n,fontVariant:i}};function bx(r){return r.nodeName==="text"?r:r.nodeName==="g"&&r.children.length===1&&r.children[0].nodeName==="text"?r.children[0]:null}function xx(r,t){var e=bx(r);e&&e.attr(t)}function n0(r,t,e){e===void 0&&(e="..."),xx(r,{wordWrap:!0,wordWrapWidth:t,maxLines:1,textOverflow:e})}function r0(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function PI(r,t,e,n){return t&&r0(r,t),e&&r0(r,e),n&&r0(r,n),r}function RI(r){return r instanceof Element||r instanceof Document}var Be,LI="component-poptip",Pe={CONTAINER:"component-poptip",ARROW:"component-poptip-arrow",TEXT:"component-poptip-text"},Ex=(Be={},Be[".".concat(Pe.CONTAINER)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},Be[".".concat(Pe.TEXT)]={"text-align":"center"},Be[".".concat(Pe.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, -100%)"},Be[".".concat(Pe.CONTAINER,"[data-position='left']")]={transform:"translate(-100%, -50%)"},Be[".".concat(Pe.CONTAINER,"[data-position='right']")]={transform:"translate(0, -50%)"},Be[".".concat(Pe.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},Be[".".concat(Pe.CONTAINER,"[data-position='top-left']")]={transform:"translate(0,-100%)"},Be[".".concat(Pe.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},Be[".".concat(Pe.CONTAINER,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},Be[".".concat(Pe.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},Be[".".concat(Pe.CONTAINER,"[data-position='right-top']")]={transform:"translate(0, 0)"},Be[".".concat(Pe.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},Be[".".concat(Pe.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},Be[".".concat(Pe.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},Be[".".concat(Pe.ARROW)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},Be[".".concat(Pe.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},Be["[data-position='top'] .".concat(Pe.ARROW)]={bottom:"-2px"},Be[".".concat(Pe.CONTAINER,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},Be["[data-position='left'] .".concat(Pe.ARROW)]={right:"-2px"},Be[".".concat(Pe.CONTAINER,"[data-position='right']")]={transform:"translate(5px, -50%)"},Be["[data-position='right'] .".concat(Pe.ARROW)]={left:"-2px"},Be[".".concat(Pe.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},Be["[data-position='bottom'] .".concat(Pe.ARROW)]={top:"-2px"},Be[".".concat(Pe.CONTAINER,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},Be["[data-position='top-left'] .".concat(Pe.ARROW)]={left:"10px",bottom:"-2px"},Be[".".concat(Pe.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},Be["[data-position='top-right'] .".concat(Pe.ARROW)]={right:"10px",bottom:"-2px"},Be[".".concat(Pe.CONTAINER,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},Be["[data-position='left-top'] .".concat(Pe.ARROW)]={right:"-2px",top:"8px"},Be[".".concat(Pe.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},Be["[data-position='left-bottom'] .".concat(Pe.ARROW)]={right:"-2px",bottom:"8px"},Be[".".concat(Pe.CONTAINER,"[data-position='right-top']")]={transform:"translate(5px, 0)"},Be["[data-position='right-top'] .".concat(Pe.ARROW)]={left:"-2px",top:"8px"},Be[".".concat(Pe.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},Be["[data-position='right-bottom'] .".concat(Pe.ARROW)]={left:"-2px",bottom:"8px"},Be[".".concat(Pe.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},Be["[data-position='bottom-left'] .".concat(Pe.ARROW)]={top:"-2px",left:"8px"},Be[".".concat(Pe.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},Be["[data-position='bottom-right'] .".concat(Pe.ARROW)]={top:"-2px",right:"8px"},Be),DI=void 0;function _I(r,t,e,n,i,a){if(i===void 0&&(i=!1),a===void 0&&(a=!1),a)return[r,t];var s=e.getBoundingClientRect(),o=s.x,l=s.y,c=s.width,u=s.height;switch(n){case"top":return i?[o+c/2,l]:[r,l];case"left":return i?[o,l+u/2]:[o,t];case"bottom":return i?[o+c/2,l+u]:[r,l+u];case"right":return i?[o+c,l+u/2]:[o+c,t];case"top-right":case"right-top":return[o+c,l];case"left-bottom":case"bottom-left":return[o,l+u];case"right-bottom":case"bottom-right":return[o+c,l+u];case"top-left":case"left-top":default:return[o,l]}}var II=function(r){var t;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t||(t=r.apply(DI,e)),t}};function BI(r){var t=r&&document.getElementById(r);return t||(t=document.createElement("div"),t.setAttribute("id",r),document.body.appendChild(t)),t}function FI(r){var t=II(BI)(r);return t}var zI=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,mr({style:{id:LI}},t.defaultOptions,e))||this;return n.visibility="visible",n.map=new Map,n.domStyles="",n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(t.prototype,"visible",{get:function(){return this.visibility==="visible"},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){this.visibility=this.style.visibility,this.updatePoptipElement()},t.prototype.update=function(e){this.attr(mr({},this.style,e)),this.render(this.attributes,this)},t.prototype.bind=function(e,n){var i=this;if(e){var a=this.style.text,s=function(l){var c=e,u=i.style,h=a;if(n){var d=typeof n=="function"?n.call(null,l):n,f=d.html,v=d.target,g=(0,G._T)(d,["html","target"]);u=PI({},i.style,g),(v||v===!1)&&(c=v),typeof f=="string"&&(h=f)}var p=u.position,y=u.arrowPointAtCenter,b=u.follow,w=u.offset;if(c){var O=l,_=O.clientX,F=O.clientY,W=(0,G.CR)(_I(_,F,c,p,y,b),2),j=W[0],H=W[1];i.showTip(j,H,{text:h,position:p,offset:w})}else i.hideTip()},o=function(){i.hideTip()};e.addEventListener("mousemove",s),e.addEventListener("mouseleave",o),this.map.set(e,[s,o])}},t.prototype.unbind=function(e){if(this.map.has(e)){var n=(0,G.CR)(this.map.get(e)||[],2),i=n[0],a=n[1];i&&e.removeEventListener("mousemove",i),a&&e.removeEventListener("mouseleave",a),this.map.delete(e)}},t.prototype.clear=function(){this.container.innerHTML=""},t.prototype.destroy=function(){var e=this,n;(0,G.ev)([],(0,G.CR)(this.map.keys()),!1).forEach(function(i){return e.unbind(i)}),(n=this.container)===null||n===void 0||n.remove(),r.prototype.destroy.call(this)},t.prototype.showTip=function(e,n,i){var a=br(i,"text");if(!(a&&typeof a!="string")&&(this.applyStyles(),e&&n&&i)){var s=i.offset,o=i.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(e,n,s),typeof a=="string"){var l=this.container.querySelector(".".concat(Pe.TEXT));l&&(l.innerHTML=a)}this.visibility="visible",this.container.style.visibility="visible"}},t.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},t.prototype.getContainer=function(){return this.container},t.prototype.getClassName=function(){var e=this.style.containerClassName;return"".concat(Pe.CONTAINER).concat(e?" ".concat(e):"")},t.prototype.initShape=function(){var e=this,n=this.style.id;this.container=FI(n),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return e.showTip()}),this.container.addEventListener("mouseleave",function(){return e.hideTip()})},t.prototype.updatePoptipElement=function(){var e=this.container;this.clear();var n=this.style,i=n.id,a=n.template,s=n.text;this.container.setAttribute("id",i),this.container.className=this.getClassName();var o='<span class="'.concat(Pe.ARROW,'"></span>');e.innerHTML=o,Ve(a)?e.innerHTML+=a:a&&RI(a)&&e.appendChild(a),s&&(e.getElementsByClassName(Pe.TEXT)[0].textContent=s),this.applyStyles(),this.container.style.visibility=this.visibility},t.prototype.applyStyles=function(){var e=Jn({},Ex,this.style.domStyles),n=Object.entries(e).reduce(function(a,s){var o=(0,G.CR)(s,2),l=o[0],c=o[1],u=Object.entries(c).reduce(function(h,d){var f=(0,G.CR)(d,2),v=f[0],g=f[1];return"".concat(h).concat(v,": ").concat(g,";")},"");return"".concat(a).concat(l,"{").concat(u,"}")},"");if(this.domStyles!==n){this.domStyles=n;var i=this.container.querySelector("style");i&&this.container.removeChild(i),i=document.createElement("style"),i.innerHTML=n,this.container.appendChild(i)}},t.prototype.setOffsetPosition=function(e,n,i){i===void 0&&(i=this.style.offset);var a=(0,G.CR)(i,2),s=a[0],o=s===void 0?0:s,l=a[1],c=l===void 0?0:l;this.container.style.left="".concat(e+o,"px"),this.container.style.top="".concat(n+c,"px")},t.tag="poptip",t.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:Ex,template:'<div class="'.concat(Pe.TEXT,'"></div>')}},t}(Ln),Pr=Zi({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),jI={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};function ZI(r){var t=r.querySelector(Pr.marker.class);return t?t.style:{}}var WI=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,{span:[1,1],marker:function(){return new Ji({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(t.prototype,"showValue",{get:function(){var e=this.attributes.valueText;return e?typeof e=="string"||typeof e=="number"?e!=="":typeof e=="function"?!0:e.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"actualSpace",{get:function(){var e=this.labelGroup,n=this.valueGroup,i=this.attributes,a=i.markerSize,s=i.focus,o=i.focusMarkerSize,l=e.node().getBBox(),c=l.width,u=l.height,h=n.node().getBBox(),d=h.width,f=h.height,v=s?o!=null?o:12:0;return{markerWidth:a,labelWidth:c,valueWidth:d,focusWidth:v,height:Math.max(a,u,f)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"span",{get:function(){var e=this.attributes.span;if(!e)return[1,1];var n=(0,G.CR)(Er(e),2),i=n[0],a=n[1],s=this.showValue?a:0,o=i+s;return[i/o,s/o]},enumerable:!1,configurable:!0}),t.prototype.setAttribute=function(e,n){r.prototype.setAttribute.call(this,e,n)},Object.defineProperty(t.prototype,"shape",{get:function(){var e,n=this.attributes,i=n.markerSize,a=n.width,s=this.actualSpace,o=s.markerWidth,l=s.focusWidth,c=s.height,u=this.actualSpace,h=u.labelWidth,d=u.valueWidth,f=(0,G.CR)(this.spacing,3),v=f[0],g=f[1],p=f[2];if(a){var y=a-i-v-g-l-p,b=(0,G.CR)(this.span,2),w=b[0],O=b[1];e=(0,G.CR)([w*y,O*y],2),h=e[0],d=e[1]}var _=o+h+d+v+g+l+p;return{width:_,height:c,markerWidth:o,labelWidth:h,valueWidth:d,focusWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){var e=this.attributes,n=e.spacing,i=e.focus;if(!n)return[0,0,0];var a=(0,G.CR)(Er(n),3),s=a[0],o=a[1],l=a[2];return[s,this.showValue?o:0,i?l:0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){var e=this.shape,n=e.markerWidth,i=e.labelWidth,a=e.valueWidth,s=e.focusWidth,o=e.width,l=e.height,c=(0,G.CR)(this.spacing,3),u=c[0],h=c[1],d=c[2];return{height:l,width:o,markerWidth:n,labelWidth:i,valueWidth:a,focusWidth:s,position:[n/2,n+u,n+i+u+h,n+i+a+u+h+d+s/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleSize",{get:function(){var e=ZI(this.markerGroup.node()),n=this.attributes,i=n.markerSize,a=n.markerStrokeWidth,s=a===void 0?e.strokeWidth:a,o=n.markerLineWidth,l=o===void 0?e.lineWidth:o,c=n.markerStroke,u=c===void 0?e.stroke:c,h=+(s||l||(u?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),f=d.width,v=d.height;return(1-h/Math.max(f,v))*i},enumerable:!1,configurable:!0}),t.prototype.renderMarker=function(e){var n=this,i=this.attributes.marker,a=Ne(this.attributes,"marker");this.markerGroup=e.maybeAppendByClassName(Pr.markerGroup,"g").style("zIndex",0),qr(!!i,this.markerGroup,function(){var s,o=n.markerGroup.node(),l=(s=o.childNodes)===null||s===void 0?void 0:s[0],c=typeof i=="string"?new tn({style:{symbol:i},className:Pr.marker.name}):i();l?c.nodeName===l.nodeName?l instanceof tn?l.update((0,G.pi)((0,G.pi)({},a),{symbol:i})):(CI(l,c),ve(l).styles(a)):(l.remove(),ve(c).attr("className",Pr.marker.name).styles(a),o.appendChild(c)):(c instanceof tn||ve(c).attr("className",Pr.marker.name).styles(a),o.appendChild(c)),n.markerGroup.node().scale(1/n.markerGroup.node().getScale()[0]);var u=$v(n.markerGroup.node(),n.scaleSize,!0);n.markerGroup.node().style._transform="scale(".concat(u,")")})},t.prototype.renderLabel=function(e){var n=Ne(this.attributes,"label"),i=n.text,a=(0,G._T)(n,["text"]);this.labelGroup=e.maybeAppendByClassName(Pr.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Pr.label,function(){return wa(i)}).styles(a)},t.prototype.renderValue=function(e){var n=this,i=Ne(this.attributes,"value"),a=i.text,s=(0,G._T)(i,["text"]);this.valueGroup=e.maybeAppendByClassName(Pr.valueGroup,"g").style("zIndex",0),qr(this.showValue,this.valueGroup,function(){n.valueGroup.maybeAppendByClassName(Pr.value,function(){return wa(a)}).styles(s)})},t.prototype.createPoptip=function(){var e=this.attributes.poptip,n=e||{},i=n.render,a=(0,G._T)(n,["render"]),s=new zI({style:Jn(jI,a)});return this.poptipGroup=s,s},t.prototype.bindPoptip=function(e){var n=this,i=this.attributes.poptip;if(i){var a=this.poptipGroup||this.createPoptip();a.bind(e,function(){var s=n.attributes,o=s.labelText,l=s.valueText,c=s.markerFill,u=typeof o=="string"?o:o==null?void 0:o.attr("text"),h=typeof l=="string"?l:l==null?void 0:l.attr("text");if(typeof i.render=="function")return{html:i.render({label:u,value:h,color:c})};var d="";return(typeof u=="string"||typeof u=="number")&&(d+='<div class="component-poptip-label">'.concat(u,"</div>")),(typeof h=="string"||typeof h=="number")&&(d+='<div class="component-poptip-value">'.concat(h,"</div>")),{html:d}})}},t.prototype.renderFocus=function(e){var n=this,i=this.attributes,a=i.focus,s=i.focusMarkerSize,o={x:0,y:0,size:s,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};Te(a)||(this.focusGroup=e.maybeAppendByClassName(Pr.focusGroup,"g").style("zIndex",0),qr(a,this.focusGroup,function(){var l=new tn({style:(0,G.pi)((0,G.pi)({},o),{symbol:"focus"})}),c=new Ji({style:{r:o.size/2,fill:"transparent"}}),u=n.focusGroup.node();u.appendChild(c),u.appendChild(l),l.update({opacity:0}),e.node().addEventListener("pointerenter",function(){l.update({opacity:1})}),e.node().addEventListener("pointerleave",function(){l.update({opacity:0})})}))},t.prototype.renderPoptip=function(e){var n=this,i=this.attributes.poptip;if(i){var a=e.maybeAppendByClassName(Pr.value,"g").node(),s=e.maybeAppendByClassName(Pr.label,"g").node();[a,s].forEach(function(o){o&&n.bindPoptip(o)})}},t.prototype.renderBackground=function(e){var n=this.shape,i=n.width,a=n.height,s=Ne(this.attributes,"background");this.background=e.maybeAppendByClassName(Pr.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Pr.background,"rect").styles((0,G.pi)({width:i,height:a},s))},t.prototype.adjustLayout=function(){var e=this.layout,n=e.labelWidth,i=e.valueWidth,a=e.height,s=(0,G.CR)(e.position,4),o=s[0],l=s[1],c=s[2],u=s[3],h=a/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(h,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(l,", ").concat(h,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(u,", ").concat(h,")")}),n0(this.labelGroup.select(Pr.label.class).node(),Math.ceil(n)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(c,", ").concat(h,")")}),n0(this.valueGroup.select(Pr.value.class).node(),Math.ceil(i)))},t.prototype.render=function(e,n){var i=ve(n),a=e.x,s=a===void 0?0:a,o=e.y,l=o===void 0?0:o;i.styles({transform:"translate(".concat(s,", ").concat(l,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.renderPoptip(i),this.renderFocus(i),this.adjustLayout()},t}(Ln),Us=Zi({page:"item-page",navigator:"navigator",item:"item"},"items"),wx=function(r,t,e){return e===void 0&&(e=!0),r?t(r):e},GI=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:Jv,mouseenter:Jv,mouseleave:Jv})||this;return n.navigatorShape=[0,0],n}return Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){var e=this.attributes,n=e.gridRow,i=e.gridCol,a=e.data;if(!n&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return n&&i?[n,i]:n?[n,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderData",{get:function(){var e=this.attributes,n=e.data,i=e.layout,a=e.poptip,s=e.focus,o=e.focusMarkerSize,l=Ne(this.attributes,"item"),c=n.map(function(u,h){var d=u.id,f=d===void 0?h:d,v=u.label,g=u.value;return{id:"".concat(f),index:h,style:(0,G.pi)({layout:i,labelText:v,valueText:g,poptip:a,focus:s,focusMarkerSize:o},Object.fromEntries(Object.entries(l).map(function(p){var y=(0,G.CR)(p,2),b=y[0],w=y[1];return[b,Jr(w,[u,h,n])]})))}});return c},enumerable:!1,configurable:!0}),t.prototype.getGridLayout=function(){var e=this,n=this.attributes,i=n.orientation,a=n.width,s=n.rowPadding,o=n.colPadding,l=(0,G.CR)(this.navigatorShape,1),c=l[0],u=(0,G.CR)(this.grid,2),h=u[0],d=u[1],f=d*h,v=0;return this.pageViews.children.map(function(g,p){var y,b,w=Math.floor(p/f),O=p%f,_=e.ifHorizontal(d,h),F=[Math.floor(O/_),O%_];i==="vertical"&&F.reverse();var W=(0,G.CR)(F,2),j=W[0],H=W[1],K=(a-c-(d-1)*o)/d,et=g.getBBox().height,rt=(0,G.CR)([0,0],2),lt=rt[0],ht=rt[1];return i==="horizontal"?(y=(0,G.CR)([v,j*(et+s)],2),lt=y[0],ht=y[1],v=H===d-1?0:v+K+o):(b=(0,G.CR)([H*(K+o),v],2),lt=b[0],ht=b[1],v=j===h-1?0:v+et+s),{page:w,index:p,row:j,col:H,pageIndex:O,width:K,height:et,x:lt,y:ht}})},t.prototype.getFlexLayout=function(){var e=this.attributes,n=e.width,i=e.height,a=e.rowPadding,s=e.colPadding,o=(0,G.CR)(this.navigatorShape,1),l=o[0],c=(0,G.CR)(this.grid,2),u=c[0],h=c[1],d=(0,G.CR)([n-l,i],2),f=d[0],v=d[1],g=(0,G.CR)([0,0,0,0,0,0,0,0],8),p=g[0],y=g[1],b=g[2],w=g[3],O=g[4],_=g[5],F=g[6],W=g[7];return this.pageViews.children.map(function(j,H){var K,et,rt,lt,ht=j.getBBox(),yt=ht.width,Nt=ht.height,Ct=F===0?0:s,pt=F+Ct+yt;if(pt<=f&&wx(O,function(kt){return kt<h}))return K=(0,G.CR)([F+Ct,W,pt],3),p=K[0],y=K[1],F=K[2],{width:yt,height:Nt,x:p,y,page:b,index:H,pageIndex:w++,row:_,col:O++};et=(0,G.CR)([_+1,0,0,W+Nt+a],4),_=et[0],O=et[1],F=et[2],W=et[3];var xt=W+Nt;return xt<=v&&wx(_,function(kt){return kt<u})?(rt=(0,G.CR)([F,W,yt],3),p=rt[0],y=rt[1],F=rt[2],{width:yt,height:Nt,x:p,y,page:b,index:H,pageIndex:w++,row:_,col:O++}):(lt=(0,G.CR)([0,0,yt,0,b+1,0,0,0],8),p=lt[0],y=lt[1],F=lt[2],W=lt[3],b=lt[4],w=lt[5],_=lt[6],O=lt[7],{width:yt,height:Nt,x:p,y,page:b,index:H,pageIndex:w++,row:_,col:O++})})},Object.defineProperty(t.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var e=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,n=e.call(this);return n.slice(-1)[0].page>0?(this.navigatorShape=[55,0],e.call(this)):n},enumerable:!1,configurable:!0}),t.prototype.ifHorizontal=function(e,n){var i=this.attributes.orientation;return t0(i,e,n)},t.prototype.flattenPage=function(e){e.querySelectorAll(Us.item.class).forEach(function(n){e.appendChild(n)}),e.querySelectorAll(Us.page.class).forEach(function(n){var i=e.removeChild(n);i.destroy()})},t.prototype.renderItems=function(e){var n=this.attributes,i=n.click,a=n.mouseenter,s=n.mouseleave;this.flattenPage(e);var o=this.dispatchCustomEvent.bind(this);ve(e).selectAll(Us.item.class).data(this.renderData,function(l){return l.id}).join(function(l){return l.append(function(c){var u=c.style;return new WI({style:u})}).attr("className",Us.item.name).on("click",function(){i==null||i(this),o("itemClick",{item:this})}).on("pointerenter",function(){a==null||a(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){s==null||s(this),o("itemMouseleave",{item:this})})},function(l){return l.each(function(c){var u=c.style;this.update(u)})},function(l){return l.remove()})},t.prototype.relayoutNavigator=function(){var e,n=this.attributes,i=n.layout,a=n.width,s=((e=this.pageViews.children[0])===null||e===void 0?void 0:e.getBBox().height)||0,o=(0,G.CR)(this.navigatorShape,2),l=o[0],c=o[1];this.navigator.update(i==="grid"?{pageWidth:a-l,pageHeight:s-c}:{})},t.prototype.adjustLayout=function(){var e=this,n=Object.entries(Q_(this.itemsLayout,"page")).map(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];return{page:o,layouts:l}}),i=(0,G.ev)([],(0,G.CR)(this.navigator.getContainer().children),!1);n.forEach(function(a){var s=a.layouts,o=e.pageViews.appendChild(new ir({className:Us.page.name}));s.forEach(function(l){var c=l.x,u=l.y,h=l.index,d=l.width,f=l.height,v=i[h];o.appendChild(v),bl(v,"__layout__",l),v.update({x:c,y:u,width:d,height:f})})}),this.relayoutNavigator()},t.prototype.renderNavigator=function(e){var n=this.attributes.orientation,i=Ne(this.attributes,"nav"),a=Jn({orientation:n},i),s=this;return e.selectAll(Us.navigator.class).data(["nav"]).join(function(o){return o.append(function(){return new EI({style:a})}).attr("className",Us.navigator.name).each(function(){s.navigator=this})},function(o){return o.each(function(){this.update(a)})},function(o){return o.remove()}),this.navigator},t.prototype.getBBox=function(){return this.navigator.getBBox()},t.prototype.render=function(e,n){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(ve(n));this.renderItems(a.getContainer()),this.adjustLayout()}},t.prototype.dispatchCustomEvent=function(e,n){var i=new Kn(e,{detail:n});this.dispatchEvent(i)},t}(Ln),Il=Zi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Sx={showLabel:!0,formatter:function(r){return r.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},ej=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,Sx)||this}return t.prototype.render=function(e,n){var i=ve(n).maybeAppendByClassName(Il.markerGroup,"g");this.renderMarker(i);var a=ve(n).maybeAppendByClassName(Il.labelGroup,"g");this.renderLabel(a)},t.prototype.renderMarker=function(e){var n=this,i=this.attributes,a=i.orientation,s=i.markerSymbol,o=s===void 0?t0(a,"horizontalHandle","verticalHandle"):s;qr(!!o,e,function(l){var c=Ne(n.attributes,"marker"),u=(0,G.pi)({symbol:o},c);n.marker=l.maybeAppendByClassName(Il.marker,function(){return new tn({style:u})}).update(u)})},t.prototype.renderLabel=function(e){var n=this,i=this.attributes,a=i.showLabel,s=i.orientation,o=i.spacing,l=o===void 0?0:o,c=i.formatter;qr(a,e,function(u){var h,d=Ne(n.attributes,"label"),f=d.text,v=(0,G._T)(d,["text"]),g=((h=u.select(Il.marker.class))===null||h===void 0?void 0:h.node().getBBox())||{},p=g.width,y=p===void 0?0:p,b=g.height,w=b===void 0?0:b,O=(0,G.CR)(t0(s,[0,w+l,"center","top"],[y+l,0,"start","middle"]),4),_=O[0],F=O[1],W=O[2],j=O[3];u.maybeAppendByClassName(Il.label,"text").styles((0,G.pi)((0,G.pi)({},v),{x:_,y:F,text:c(f).toString(),textAlign:W,textBaseline:j}))})},t}(Ln),Mx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},VI=Jn({},Mx,{}),nj=Jn({},Mx,Mo(Sx,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),rj=.01,ij=.5,Bl=Zi({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),UI=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,VI)||this}return t.prototype.renderTitle=function(e,n,i){var a=this.attributes,s=a.showTitle,o=a.titleText,l=Ne(this.attributes,"title"),c=(0,G.CR)(Ea(l),2),u=c[0],h=c[1];this.titleGroup=e.maybeAppendByClassName(Bl.titleGroup,"g").styles(h);var d=(0,G.pi)((0,G.pi)({width:n,height:i},u),{text:s?o:""});this.title=this.titleGroup.maybeAppendByClassName(Bl.title,function(){return new K_({style:d})}).update(d)},t.prototype.renderItems=function(e,n){var i=n.x,a=n.y,s=n.width,o=n.height,l=Ne(this.attributes,"title",!0),c=(0,G.CR)(Ea(l),2),u=c[0],h=c[1],d=(0,G.pi)((0,G.pi)({},u),{width:s,height:o,x:0,y:0});this.itemsGroup=e.maybeAppendByClassName(Bl.itemsGroup,"g").styles((0,G.pi)((0,G.pi)({},h),{transform:"translate(".concat(i,", ").concat(a,")")}));var f=this;this.itemsGroup.selectAll(Bl.items.class).data(["items"]).join(function(v){return v.append(function(){return new GI({style:d})}).attr("className",Bl.items.name).each(function(){f.items=ve(this)})},function(v){return v.update(d)},function(v){return v.remove()})},t.prototype.adjustLayout=function(){var e=this.attributes.showTitle;if(e){var n=this.title.node().getAvailableSpace(),i=n.x,a=n.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,n=e.showTitle,i=e.width,a=e.height;return n?this.title.node().getAvailableSpace():new kr(0,0,i,a)},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e,n,i=(e=this.title)===null||e===void 0?void 0:e.node(),a=(n=this.items)===null||n===void 0?void 0:n.node();return!i||!a?r.prototype.getBBox.call(this):Y_(i,a)},t.prototype.render=function(e,n){var i=this.attributes,a=i.width,s=i.height,o=i.x,l=o===void 0?0:o,c=i.y,u=c===void 0?0:c,h=ve(n);n.style.transform="translate(".concat(l,", ").concat(u,")"),this.renderTitle(h,a,s),this.renderItems(h,this.availableSpace),this.adjustLayout()},t}(Ln);function i0(r){const{width:t,height:e,renderer:n}=r,i=YI(r),a=new vf({width:t,height:e,container:i,renderer:n||new Sl});return[i,a]}function YI(r){var t;const{container:e,className:n,graphCanvas:i}=r;if(e)return typeof e=="string"?document.getElementById(e):e;const a=So(n,!1),{width:s,height:o,containerStyle:l}=r,[c,u]=HI(r);return Object.assign(a.style,Object.assign({position:"absolute",left:c+"px",top:u+"px",width:s+"px",height:o+"px"},l)),(t=i.getContainer())===null||t===void 0||t.appendChild(a),a}function HI(r){const{width:t,height:e,placement:n,graphCanvas:i}=r,[a,s]=i.getSize(),[o,l]=wy(n);return[o*(a-t),l*(s-e)]}var XI=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Ph extends xr{constructor(t,e){super(t,Object.assign({},Ph.defaultOptions,e)),this.typePrefix="__data__",this.draw=!1,this.fieldMap={node:new Map,edge:new Map,combo:new Map},this.selectedItems=[],this.bindEvents=()=>{const{graph:n}=this.context;n.on(Kt.AFTER_DRAW,this.createElement)},this.changeState=(n,i)=>{const{graph:a}=this.context,{typePrefix:s}=this,o=br(n,[s,"id"]),l=br(n,[s,"style","labelText"]),[c]=o.split("__"),u=this.fieldMap[c].get(l)||[];a.setElementState(Object.fromEntries(u==null?void 0:u.map(h=>[h,i])))},this.click=n=>{if(this.options.trigger==="hover")return;const i=br(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?(this.selectedItems=this.selectedItems.filter(a=>a!==i),this.changeState(n,[])):(this.selectedItems.push(i),this.changeState(n,"selected"))},this.mouseleave=n=>{this.options.trigger!=="click"&&(this.selectedItems=[],this.changeState(n,[]))},this.mouseenter=n=>{if(this.options.trigger==="click")return;const i=br(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?this.selectedItems=this.selectedItems.filter(a=>a!==i):(this.selectedItems.push(i),this.changeState(n,"active"))},this.setFieldMap=(n,i,a)=>{if(!n)return;const s=this.fieldMap[a];if(s)if(!s.has(n))s.set(n,[i]);else{const o=s.get(n);o&&(o.push(i),s.set(n,o))}},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(n,i)=>{if(!n)return[];const{model:a,element:s}=this.context,{nodes:o,edges:l,combos:c}=a.getData(),u={},h=p=>fe(n)?n(p):n,d={node:"circle",edge:"line",combo:"rect"},f={circle:"circle",ellipse:"circle",image:"bowtie",rect:"square",star:"cross",triangle:"triangle",diamond:"diamond",cubic:"dot",line:"hyphen",polyline:"hyphen",quadratic:"hv","cubic-horizontal":"hyphen","cubic-vertical":"line"},v=(p,y)=>s==null?void 0:s.getElementComputedStyle(p,y),g=(p,y)=>{p.forEach(b=>{const{id:w}=b,O=br(b,["data",h(b)]),_=(s==null?void 0:s.getElementType(y,b))||"circle",F=v(y,b),W=(y==="edge"?F==null?void 0:F.stroke:F==null?void 0:F.fill)||"#1783ff";w&&O&&O.replace(/\s+/g,"")&&(this.setFieldMap(O,w,y),u[O]||(u[O]={id:`${y}__${w}`,label:O,marker:f[_]||d[y],elementType:y,lineWidth:1,stroke:W,fill:W}))})};switch(i){case"node":g(o,"node");break;case"edge":g(l,"edge");break;case"combo":g(c,"combo");break;default:return[]}return Object.values(u)},this.createElement=()=>{if(this.draw){this.updateElement();return}const n=this.options,{width:i,height:a,nodeField:s,edgeField:o,comboField:l,trigger:c,position:u,container:h,containerStyle:d,className:f}=n,v=XI(n,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),g=this.getMarkerData(s,"node"),p=this.getMarkerData(o,"edge"),y=this.getMarkerData(l,"combo"),b=[...g,...y,...p],w=Object.assign({width:i,height:a,data:b,itemMarkerLineWidth:({lineWidth:F})=>F,itemMarker:({marker:F})=>F,itemMarkerStroke:({stroke:F})=>F,itemMarkerFill:({fill:F})=>F,gridCol:g.length},v,this.getEvents()),O=new UI({className:"legend",style:w});this.category=O,this.upsertCanvas().appendChild(O),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||e.remove(),this.canvas=void 0,this.container=void 0,this.draw=!1}updateElement(){this.category&&this.category.update({itemMarkerOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5,itemLabelOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5})}upsertCanvas(){if(this.canvas)return this.canvas;const t=this.context.canvas,[e,n]=t.getSize(),{width:i=e,height:a=n,position:s,container:o,containerStyle:l,className:c}=this.options,[u,h]=i0({width:i,height:a,graphCanvas:t,container:o,containerStyle:l,placement:s,className:"legend"});return this.container=u,c&&u.classList.add(c),this.canvas=h,this.canvas}destroy(){this.clear(),this.context.graph.off(Kt.AFTER_DRAW,this.createElement),super.destroy()}}Ph.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class Rh extends xr{constructor(t,e){super(t,Object.assign({},Rh.defaultOptions,e)),this.onDraw=n=>{var i;!((i=n==null?void 0:n.data)===null||i===void 0)&&i.render||this.onRender()},this.shapes=new Map,this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=n=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(n.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=n=>{if(!this.mask||!this.isMaskDragging)return;const{size:[i,a]}=this.options,{movementX:s,movementY:o}=n,{left:l,top:c,width:u,height:h}=this.mask.style,[,,d,f]=this.maskBBox;let v=parseInt(l)+s,g=parseInt(c)+o,p=parseInt(u),y=parseInt(h);v<0&&(v=0),g<0&&(g=0),v+p>i&&(v=$a(i-p,0)),g+y>a&&(g=$a(a-y,0)),p<d&&(s>0?(v=$a(v-s,0),p=Ja(p+s,i)):s<0&&(p=Ja(p-s,i))),y<f&&(o>0?(g=$a(g-o,0),y=Ja(y+o,a)):o<0&&(y=Ja(y-o,a))),Object.assign(this.mask.style,{left:v+"px",top:g+"px",width:p+"px",height:y+"px"});const b=parseInt(l)-v,w=parseInt(c)-g;if(b===0&&w===0)return;const O=this.context.canvas.getCamera().getZoom(),_=this.canvas.getCamera().getZoom(),F=O/_;this.context.graph.translateBy([b*F,w*F],!1)},this.onMaskDragEnd=n=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(n.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=km(()=>{this.isMaskDragging||(this.updateMask(),this.setCamera())},32,{leading:!0}),this.setOnRender(),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),"delay"in t&&this.setOnRender(),this.bindEvents()}setOnRender(){this.onRender=Cl(()=>{this.renderMinimap(),this.renderMask()},this.options.delay)}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_DRAW,this.onDraw),t.on(Kt.AFTER_RENDER,this.onRender),t.on(Kt.AFTER_ANIMATE,this.onRender),t.on(Kt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_DRAW,this.onDraw),t.off(Kt.AFTER_RENDER,this.onRender),t.off(Kt.AFTER_ANIMATE,this.onRender),t.off(Kt.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const t=this.getElements(),e=this.initCanvas();this.setShapes(e,t)}getElements(){const{filter:t}=this.options,{model:e,element:n}=this.context,i=e.getData(),a={nodes:i.nodes.filter(c=>n==null?void 0:n.getElement(At(c))),edges:i.edges.filter(c=>{const u=n==null?void 0:n.getElement(At(c));return u&&M1(u)}),combos:i.combos.filter(c=>n==null?void 0:n.getElement(At(c)))};if(!t)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(c=>t(At(c),"node")),edges:o.filter(c=>t(At(c),"edge")),combos:l.filter(c=>t(At(c),"combo"))}}setShapes(t,e){const{nodes:n,edges:i,combos:a}=e,{shape:s}=this.options,{element:o}=this.context;if(s==="key"){const c=new Set,u=h=>{const d=At(h);c.add(d);const f=o.getElement(d);if(!f)return;const v=f.getShape("key"),g=this.shapes.get(d)||v.cloneNode();g.setPosition(v.getPosition()),f.style.zIndex&&(g.style.zIndex=f.style.zIndex),g.id=f.id,this.shapes.has(d)?Object.entries(v.attributes).forEach(([p,y])=>{g.style[p]!==y&&(g.style[p]=y)}):(t.appendChild(g),this.shapes.set(d,g))};i.forEach(u),a.forEach(u),n.forEach(u),this.shapes.forEach((h,d)=>{c.has(d)||(t.removeChild(h),this.shapes.delete(d))});return}const l=(c,u)=>{const d=o.getElement(c).getPosition();return u.setPosition(d),u};t.removeChildren(),i.forEach(c=>t.appendChild(s(At(c),"edge"))),a.forEach(c=>{t.appendChild(l(At(c),s(At(c),"combo")))}),n.forEach(c=>{t.appendChild(l(At(c),s(At(c),"node")))})}initCanvas(){const{renderer:t,size:[e,n]}=this.options;if(this.canvas){const{width:i,height:a}=this.canvas.getConfig();(e!==i||n!==a)&&this.canvas.resize(e,n),t&&this.canvas.setRenderer(t)}else{const{className:i,position:a,container:s,containerStyle:o}=this.options,[l,c]=i0({renderer:t,width:e,height:n,placement:a,className:"minimap",container:s,containerStyle:o,graphCanvas:this.context.canvas});i&&l.classList.add(i),this.container=l,this.canvas=c}return this.setCamera(),this.canvas}createLandmark(t,e,n){const i=`${t.join(",")}-${e.join(",")}-${n}`;if(this.landmarkMap.has(i))return this.landmarkMap.get(i);const s=this.canvas.getCamera().createLandmark(i,{position:t,focalPoint:e,zoom:n});return this.landmarkMap.set(i,s),s}setCamera(){var t;const{canvas:e}=this.context,n=(t=this.canvas)===null||t===void 0?void 0:t.getCamera();if(!n)return;const{size:[i,a],padding:s}=this.options,[o,l,c,u]=Ri(s),{min:h,max:d,center:f}=e.getBounds("elements"),v=d[0]-h[0],g=d[1]-h[1],p=i-u-l,y=a-o-c,b=p/v,w=y/g,O=Math.min(b,w),_=this.createLandmark(f,f,O);n.gotoLandmark(_,0)}get maskBBox(){const{canvas:t}=this.context,e=t.getSize(),n=t.getCanvasByViewport([0,0]),i=t.getCanvasByViewport(e),a=this.canvas.canvas2Viewport(Bi(n)),s=this.canvas.canvas2Viewport(Bi(i)),o=s.x-a.x,l=s.y-a.y;return[a.x,a.y,o,l]}calculateMaskBBox(){const{size:[t,e]}=this.options;let[n,i,a,s]=this.maskBBox;return n<0&&(a=Ja(a+n,t),n=0),i<0&&(s=Ja(s+i,e),i=0),n+a>t&&(a=$a(t-n,0)),i+s>e&&(s=$a(e-i,0)),[Ja(n,t),Ja(i,e),$a(a,0),$a(s,0)]}renderMask(){const{maskStyle:t}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart),this.mask.draggable=!0,this.mask.addEventListener("dragstart",e=>e.preventDefault&&e.preventDefault())),this.container.appendChild(this.mask),Object.assign(this.mask.style,Object.assign(Object.assign({},t),{cursor:"move",position:"absolute",pointerEvents:"auto"})),this.updateMask()}updateMask(){if(!this.mask)return;const[t,e,n,i]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:e+"px",left:t+"px",width:n+"px",height:i+"px"})}destroy(){var t,e,n;this.unbindEvents(),(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.mask)===null||e===void 0||e.remove(),(n=this.container)===null||n===void 0||n.remove(),super.destroy()}}Rh.defaultOptions={size:[240,160],shape:"key",padding:10,position:"right-bottom",maskStyle:{border:"1px solid #ddd",background:"rgba(0, 0, 0, 0.1)"},containerStyle:{border:"1px solid #ddd",background:"#fff"},delay:128};const Ja=(r,t)=>Math.min(r,t),$a=(r,t)=>Math.max(r,t);var a0=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};const s0={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class Lh extends xr{constructor(t,e){super(t,Object.assign({},Lh.defaultOptions,e)),this.initSnapline=()=>{const n=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=n.appendChild(new As({style:Object.assign(Object.assign({},s0),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=n.appendChild(new As({style:Object.assign(Object.assign({},s0),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(n,i,a)=>a0(this,void 0,void 0,function*(){const{verticalX:s,horizontalY:o}=a,{tolerance:l}=this.options,{min:[c,u],max:[h,d],center:[f,v]}=i;let g=0,p=0;s!==null&&(Rr(h,s)<l&&(g=s-h),Rr(c,s)<l&&(g=s-c),Rr(f,s)<l&&(g=s-f),g!==0&&(this.isVerticalSticking=!0)),o!==null&&(Rr(d,o)<l&&(p=o-d),Rr(u,o)<l&&(p=o-u),Rr(v,o)<l&&(p=o-v),p!==0&&(this.isHorizontalSticking=!0)),(g!==0||p!==0)&&(yield this.context.graph.translateElementBy({[n]:[g,p]},!1))}),this.enableSnap=n=>{const{target:i}=n,a=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[s,o]=this.getDelta(n);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(s)<=a&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,-o]},!1),!1;if(this.isHorizontalSticking&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[0,-o]},!1),!1;if(this.isVerticalSticking&&Math.abs(s)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout(()=>{this.enableStick=!0},200)}return this.enableStick},this.calcSnaplineMetadata=(n,i)=>{const{tolerance:a,shape:s}=this.options,{min:[o,l],max:[c,u],center:[h,d]}=i;let f=null,v=null,g=null,p=null,y=null,b=null;return this.getNodes().some(w=>{if(Zn(n.id,w.id))return!1;const O=Ax(w,s).getRenderBounds(),{min:[_,F],max:[W,j],center:[H,K]}=O;return f===null&&(Rr(H,h)<a?f=H:Rr(_,o)<a||Rr(_,c)<a?f=_:(Rr(W,c)<a||Rr(W,o)<a)&&(f=W),f!==null&&(v=Math.min(F,l),g=Math.max(j,u))),p===null&&(Rr(K,d)<a?p=K:Rr(F,l)<a||Rr(F,u)<a?p=F:(Rr(j,u)<a||Rr(j,l)<a)&&(p=j),p!==null&&(y=Math.min(_,o),b=Math.max(W,c))),f!==null&&p!==null}),{verticalX:f,verticalMinY:v,verticalMaxY:g,horizontalY:p,horizontalMinX:y,horizontalMaxX:b}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=n=>a0(this,void 0,void 0,function*(){const{target:i}=n;if(this.options.autoSnap&&!this.enableSnap(n))return;const a=Ax(i,this.options.shape).getRenderBounds(),s=this.calcSnaplineMetadata(i,a);this.hideSnapline(),(s.verticalX!==null||s.horizontalY!==null)&&this.updateSnapline(s),this.options.autoSnap&&(yield this.autoSnapToLine(i.id,a,s))}),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var t;const{filter:e}=this.options,i=(((t=this.context.element)===null||t===void 0?void 0:t.getNodes())||[]).filter(a=>{var s;return M1(a)&&((s=this.context.viewport)===null||s===void 0?void 0:s.isInViewport(a.getRenderBounds()))});return e?i.filter(a=>e(a)):i}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(t){const{lineWidth:e}=this.options[`${t}LineStyle`];return+(e||s0.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(t){const{verticalX:e,verticalMinY:n,verticalMaxY:i,horizontalY:a,horizontalMinX:s,horizontalMaxX:o}=t,[l,c]=this.context.canvas.getSize(),{offset:u}=this.options;a!==null?Object.assign(this.horizontalLine.style,{x1:u===1/0?0:s-u,y1:a,x2:u===1/0?l:o+u,y2:a,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",e!==null?Object.assign(this.verticalLine.style,{x1:e,y1:u===1/0?0:n-u,x2:e,y2:u===1/0?c:i+u,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(t){const e=this.context.graph.getZoom();return Ii([t.dx,t.dy],e)}bindEvents(){return a0(this,void 0,void 0,function*(){const{graph:t}=this.context;t.on(bi.DRAG_START,this.onDragStart),t.on(bi.DRAG,this.onDrag),t.on(bi.DRAG_END,this.onDragEnd)})}unbindEvents(){const{graph:t}=this.context;t.off(bi.DRAG_START,this.onDragStart),t.off(bi.DRAG,this.onDrag),t.off(bi.DRAG_END,this.onDragEnd)}destroyElements(){var t,e;(t=this.horizontalLine)===null||t===void 0||t.destroy(),(e=this.verticalLine)===null||e===void 0||e.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}Lh.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const Rr=(r,t)=>Math.abs(r-t),Ax=(r,t)=>typeof t=="function"?t(r):r.getShape(t);var Tx=null,KI=null;function Dh(r){return r instanceof Date?r:new Date(r)}function QI(r){for(var t=__read(r,2),e=t[0],n=t[1],i=Tx.indexOf(e),a=Tx.indexOf(n),s="",o=i;o<=a;o+=1)if(s+=KI[o],o<a){var l="-";o===2?l=" ":o>2&&(l=":"),s+=l}return s}function zr(r,t){var e={YYYY:r.getFullYear(),MM:r.getMonth()+1,DD:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds()},n=t;return Object.keys(e).forEach(function(i){var a=e[i];n=n.replace(i,i==="YYYY"?"".concat(a):"".concat(a).padStart(2,"0"))}),n}function aj(r,t){return Dh(r).getTime()-Dh(t).getTime()}function sj(r,t){var e=__read([Dh(r),Dh(t)],2),n=e[0],i=e[1];return n.getFullYear()!==i.getFullYear()?"year":n.getMonth()!==i.getMonth()?"month":n.getDay()!==i.getDay()?"day":n.getHours()!==i.getHours()?"hour":n.getMinutes()!==i.getMinutes()?"minute":"second"}function oj(r,t){var e=new Date(r),n={year:function(i){i.setMonth(0),i.setHours(0,0,0,0)},month:function(i){i.setDate(1),i.setHours(0,0,0,0)},day:function(i){return i.setHours(0,0,0,0)},hour:function(i){return i.setMinutes(0,0,0)},minute:function(i){return i.setSeconds(0,0)},second:function(i){return i.setMilliseconds(0)}};return n[t](e),zr(e,QI(["year",t]))}function qI(r,t){if(r.length<=t)return r;for(var e=Math.floor(r.length/t),n=[],i=0;i<r.length;i+=e)n.push(r[i]);return n}var o0={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new ri({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]},lj=mr({},o0,{style:{type:"arc"}}),cj=mr({},o0,{style:{}}),ln=Zi({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis");function Sa(r,t){return[r[0]*t,r[1]*t]}function Fl(r,t){return[r[0]+t[0],r[1]+t[1]]}function l0(r,t){return[r[0]-t[0],r[1]-t[1]]}function Ys(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1])]}function Hs(r,t){return[Math.max(r[0],t[0]),Math.max(r[1],t[1])]}function zl(r,t){return Math.sqrt(Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2))}function Ox(r){if(r[0]===0&&r[1]===0)return[0,0];var t=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2));return[r[0]/t,r[1]/t]}function uj(r,t,e){var n=__read(r,2),i=n[0],a=n[1],s=__read(t,2),o=s[0],l=s[1],c=i-o,u=a-l,h=Math.sin(e),d=Math.cos(e);return[c*d-u*h+o,c*h+u*d+l]}function JI(r,t){return t?[r[1],-r[0]]:[-r[1],r[0]]}function To(r){return r*Math.PI/180}function Cx(r){return Number((r*180/Math.PI).toPrecision(5))}function _h(r,t){return r.style.opacity||(r.style.opacity=1),Wi(r,{opacity:0},t)}var $I=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function t6(r){return $I.includes(r)}function Nx(r){var t={};for(var e in r)t6(e)&&(t[e]=r[e]);return t}var Oo=Zi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function kx(r){return r.reduce(function(t,e,n){return t.push((0,G.ev)([n===0?"M":"L"],(0,G.CR)(e),!1)),t},[])}function e6(r,t,e){var n=t.connect,i=n===void 0?"line":n,a=t.center;if(i==="line")return kx(r);if(!a)return[];var s=zl(r[0],a),o=e?0:1;return r.reduce(function(l,c,u){return u===0?l.push((0,G.ev)(["M"],(0,G.CR)(c),!1)):l.push((0,G.ev)(["A",s,s,0,0,o],(0,G.CR)(c),!1)),l},[])}function c0(r,t,e){return t.type==="surround"?e6(r,t,e):kx(r)}function n6(r,t,e){var n=e.type,i=e.connect,a=e.center,s=e.closed,o=s?[["Z"]]:[],l=(0,G.CR)([c0(r,e),c0(t.slice().reverse(),e,!0)],2),c=l[0],u=l[1],h=(0,G.CR)([r[0],t.slice(-1)[0]],2),d=h[0],f=h[1],v=function(b,w){return[c,b,u,w,o].flat()};if(i==="line"||n==="surround")return v([(0,G.ev)(["L"],(0,G.CR)(f),!1)],[(0,G.ev)(["L"],(0,G.CR)(d),!1)]);if(!a)throw new Error("Arc grid need to specified center");var g=(0,G.CR)([zl(f,a),zl(d,a)],2),p=g[0],y=g[1];return v([(0,G.ev)(["A",p,p,0,0,1],(0,G.CR)(f),!1),(0,G.ev)(["L"],(0,G.CR)(f),!1)],[(0,G.ev)(["A",y,y,0,0,0],(0,G.CR)(d),!1),(0,G.ev)(["L"],(0,G.CR)(d),!1)])}function r6(r,t,e,n){var i=e.animate,a=e.isBillboard,s=t.map(function(o,l){return{id:o.id||"grid-line-".concat(l),d:c0(o.points,e)}});return r.selectAll(Oo.line.class).data(s,function(o){return o.id}).join(function(o){return o.append("path").each(function(l,c){var u=Jr(Nx((0,G.pi)({d:l.d},n)),[l,c,s]);this.attr((0,G.pi)({class:Oo.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},u))})},function(o){return o.transition(function(l,c){var u=Jr(Nx((0,G.pi)({d:l.d},n)),[l,c,s]);return Wi(this,u,i.update)})},function(o){return o.transition(function(){var l=this,c=_h(this,i.exit);return Ao(c,function(){return l.remove()}),c})}).transitions()}function i6(r,t,e){var n=e.animate,i=e.connect,a=e.areaFill;if(t.length<2||!a||!i)return[];for(var s=Array.isArray(a)?a:[a,"transparent"],o=function(v){return s[v%s.length]},l=[],c=0;c<t.length-1;c++){var u=(0,G.CR)([t[c].points,t[c+1].points],2),h=u[0],d=u[1],f=n6(h,d,e);l.push({d:f,fill:o(c)})}return r.selectAll(Oo.region.class).data(l,function(v,g){return g}).join(function(v){return v.append("path").each(function(g,p){var y=Jr(g,[g,p,l]);this.attr(y)}).attr("className",Oo.region.name)},function(v){return v.transition(function(g,p){var y=Jr(g,[g,p,l]);return Wi(this,y,n.update)})},function(v){return v.transition(function(){var g=this,p=_h(this,n.exit);return Ao(p,function(){return g.remove()}),p})}).transitions()}function a6(r){var t=r.data,e=t===void 0?[]:t,n=r.closed;return n?e.map(function(i){var a=i.points,s=(0,G.CR)(a,1),o=s[0];return(0,G.pi)((0,G.pi)({},i),{points:(0,G.ev)((0,G.ev)([],(0,G.CR)(a),!1),[o],!1)})}):e}var s6=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,n){var i=e.type,a=e.center,s=e.areaFill,o=e.closed,l=(0,G._T)(e,["type","center","areaFill","closed"]),c=a6(e),u=ve(n).maybeAppendByClassName(Oo.lineGroup,"g"),h=ve(n).maybeAppendByClassName(Oo.regionGroup,"g"),d=r6(u,c,e,l),f=i6(h,c,e);return(0,G.ev)((0,G.ev)([],(0,G.CR)(d),!1),(0,G.CR)(f),!1)},t}(Ln),o6=function(r,t){return function(e){return r*(1-e)+t*e}};function l6(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0;return function(i){var a=new Array(n),s=new Array(e),o=0;for(o=0;o<n;++o)a[o]=u0(r[o],t[o]);for(;o<e;++o)s[o]=t[o];for(o=0;o<n;++o)s[o]=a[o](i);return s}}function c6(r,t){r===void 0&&(r={}),t===void 0&&(t={});var e={},n={};return Object.entries(t).forEach(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1];s in r?e[s]=u0(r[s],o):n[s]=o}),function(i){return Object.entries(e).forEach(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];return n[o]=l(i)}),n}}function u0(r,t){return typeof r=="number"&&typeof t=="number"?o6(r,t):Array.isArray(r)&&Array.isArray(t)?l6(r,t):typeof r=="object"&&typeof t=="object"?c6(r,t):function(e){return r}}function u6(r,t,e,n){if(!n)return r.attr("__keyframe_data__",e),null;var i=n.duration,a=i===void 0?0:i,s=u0(t,e),o=Math.ceil(+a/16),l=new Array(o).fill(0).map(function(c,u,h){return{__keyframe_data__:s(u/(h.length-1))}});return r.animate(l,(0,G.pi)({fill:"both"},n))}function Px(r,t){var e={},n=Array.isArray(t)?t:[t];for(var i in r)n.includes(i)||(e[i]=r[i]);return e}function Rx(r,t){return Object.fromEntries(Object.entries(r).map(function(e){var n=(0,G.CR)(e,2),i=n[0],a=n[1];return[i,Jr(a,t)]}))}function hj(r){if(r.type==="linear"){var t=r.startPos,e=r.endPos;return __spreadArray(__spreadArray([],__read(t),!1),__read(e),!1)}var n=r.startAngle,i=r.endAngle,a=r.center,s=r.radius;return __spreadArray(__spreadArray([n,i],__read(a),!1),[s],!1)}function h0(r,t){return t&&fe(t)?r.filter(t):r}function Lx(r,t){var e=t.startAngle,n=t.endAngle;return(n-e)*r+e}function Ih(r,t){if(t.type==="linear"){var e=(0,G.CR)(t.startPos,2),n=e[0],i=e[1],a=(0,G.CR)(t.endPos,2),s=a[0],o=a[1],l=(0,G.CR)([s-n,o-i],2),c=l[0],u=l[1];return Ox([c,u])}var h=To(Lx(r,t));return[-Math.sin(h),Math.cos(h)]}function d0(r,t,e){var n=Ih(r,e);return JI(n,t!=="positive")}function Co(r,t){return d0(r,t.labelDirection,t)}function h6(r,t){var e=(0,G.CR)(t.startPos,2),n=e[0],i=e[1],a=(0,G.CR)(t.endPos,2),s=a[0],o=a[1],l=(0,G.CR)([s-n,o-i],2),c=l[0],u=l[1];return[n+c*r,i+u*r]}function d6(r,t){var e=t.radius,n=(0,G.CR)(t.center,2),i=n[0],a=n[1],s=To(Lx(r,t));return[i+e*Math.cos(s),a+e*Math.sin(s)]}function Bh(r,t){return t.type==="linear"?h6(r,t):d6(r,t)}function f0(r){return Ih(0,r)[1]===0}function Dx(r){return Ih(0,r)[0]===0}function _x(r,t){return t-r===360}function Ix(r,t,e,n,i){var a=t-r,s=(0,G.CR)([i,i],2),o=s[0],l=s[1],c=(0,G.CR)([To(r),To(t)],2),u=c[0],h=c[1],d=function(K){return[e+i*Math.cos(K),n+i*Math.sin(K)]},f=(0,G.CR)(d(u),2),v=f[0],g=f[1],p=(0,G.CR)(d(h),2),y=p[0],b=p[1];if(_x(r,t)){var w=(h+u)/2,O=(0,G.CR)(d(w),2),_=O[0],F=O[1];return[["M",v,g],["A",o,l,0,1,0,_,F],["A",o,l,0,1,0,y,b]]}var W=a>180?1:0,j=r>t?0:1,H=!1;return H?"M".concat(e,",").concat(n,",L").concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(W,",").concat(j,",").concat(y,",").concat(b,",L").concat(e,",").concat(n):"M".concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(W,",").concat(j,",").concat(y,",").concat(b)}function f6(r){var t=r.attributes,e=t.startAngle,n=t.endAngle,i=t.center,a=t.radius;return(0,G.ev)((0,G.ev)([e,n],(0,G.CR)(i),!1),[a],!1)}function v6(r,t,e,n){var i=t.startAngle,a=t.endAngle,s=t.center,o=t.radius;return r.selectAll(ln.line.class).data([{d:Ix.apply(void 0,(0,G.ev)((0,G.ev)([i,a],(0,G.CR)(s),!1),[o],!1))}],function(l,c){return c}).join(function(l){return l.append("path").attr("className",ln.line.name).styles(t).styles({d:function(c){return c.d}})},function(l){return l.transition(function(){var c=this,u=u6(this,f6(this),(0,G.ev)((0,G.ev)([i,a],(0,G.CR)(s),!1),[o],!1),n.update);if(u){var h=function(){var d=br(c.attributes,"__keyframe_data__");c.style.d=Ix.apply(void 0,(0,G.ev)([],(0,G.CR)(d),!1))};u.onframe=h,u.onfinish=h}return u}).styles(t)},function(l){return l.remove()}).styles(e).transitions()}function g6(r,t){var e=t.truncRange,n=t.truncShape,i=t.lineExtension}function p6(r,t,e){e===void 0&&(e=[0,0]);var n=(0,G.CR)([r,t,e],3),i=(0,G.CR)(n[0],2),a=i[0],s=i[1],o=(0,G.CR)(n[1],2),l=o[0],c=o[1],u=(0,G.CR)(n[2],2),h=u[0],d=u[1],f=(0,G.CR)([l-a,c-s],2),v=f[0],g=f[1],p=Math.sqrt(Math.pow(v,2)+Math.pow(g,2)),y=(0,G.CR)([-h/p,d/p],2),b=y[0],w=y[1];return[b*v,b*g,w*v,w*g]}function Bx(r){var t=(0,G.CR)(r,2),e=(0,G.CR)(t[0],2),n=e[0],i=e[1],a=(0,G.CR)(t[1],2),s=a[0],o=a[1];return{x1:n,y1:i,x2:s,y2:o}}function m6(r,t,e,n){var i=t.showTrunc,a=t.startPos,s=t.endPos,o=t.truncRange,l=t.lineExtension,c=(0,G.CR)([a,s],2),u=(0,G.CR)(c[0],2),h=u[0],d=u[1],f=(0,G.CR)(c[1],2),v=f[0],g=f[1],p=(0,G.CR)(l?p6(a,s,l):new Array(4).fill(0),4),y=p[0],b=p[1],w=p[2],O=p[3],_=function(pt){return r.selectAll(ln.line.class).data(pt,function(xt,kt){return kt}).join(function(xt){return xt.append("line").attr("className",function(kt){return"".concat(ln.line.name," ").concat(kt.className)}).styles(e).transition(function(kt){return Wi(this,Bx(kt.line),!1)})},function(xt){return xt.styles(e).transition(function(kt){var jt=kt.line;return Wi(this,Bx(jt),n.update)})},function(xt){return xt.remove()}).transitions()};if(!i||!o)return _([{line:[[h+y,d+b],[v+w,g+O]],className:ln.line.name}]);var F=(0,G.CR)(o,2),W=F[0],j=F[1],H=v-h,K=g-d,et=(0,G.CR)([h+H*W,d+K*W],2),rt=et[0],lt=et[1],ht=(0,G.CR)([h+H*j,d+K*j],2),yt=ht[0],Nt=ht[1],Ct=_([{line:[[h+y,d+b],[rt,lt]],className:ln.lineFirst.name},{line:[[yt,Nt],[v+w,g+O]],className:ln.lineSecond.name}]);return g6(r,t),Ct}function y6(r,t,e,n){var i=e.showArrow,a=e.showTrunc,s=e.lineArrow,o=e.lineArrowOffset,l=e.lineArrowSize,c;if(t==="arc"?c=r.select(ln.line.class):a?c=r.select(ln.lineSecond.class):c=r.select(ln.line.class),!i||!s||e.type==="arc"&&_x(e.startAngle,e.endAngle)){var u=c.node();u&&(u.style.markerEnd=void 0);return}var h=wa(s);h.attr(n),$v(h,l,!0),c.style("markerEnd",h).style("markerEndOffset",-o)}function b6(r,t,e){var n=t.type,i,a=Ne(t,"line");return n==="linear"?i=m6(r,t,Px(a,"arrow"),e):i=v6(r,t,Px(a,"arrow"),e),y6(r,n,t,a),i}function x6(r,t){return d0(r,t.gridDirection,t)}function Fx(r){var t=r.type,e=r.gridCenter;return t==="linear"?e:e||r.center}function E6(r,t){var e=t.gridLength;return r.map(function(n,i){var a=n.value,s=(0,G.CR)(Bh(a,t),2),o=s[0],l=s[1],c=(0,G.CR)(Sa(x6(a,t),e),2),u=c[0],h=c[1];return{id:i,points:[[o,l],[o+u,l+h]]}})}function w6(r,t){var e=t.gridControlAngles,n=Fx(t);if(!n)throw new Error("grid center is not provide");if(r.length<2)throw new Error("Invalid grid data");if(!e||e.length===0)throw new Error("Invalid gridControlAngles");var i=(0,G.CR)(n,2),a=i[0],s=i[1];return r.map(function(o,l){var c=o.value,u=(0,G.CR)(Bh(c,t),2),h=u[0],d=u[1],f=(0,G.CR)([h-a,d-s],2),v=f[0],g=f[1],p=[];return e.forEach(function(y){var b=To(y),w=(0,G.CR)([Math.cos(b),Math.sin(b)],2),O=w[0],_=w[1],F=v*O-g*_+a,W=v*_+g*O+s;p.push([F,W])}),{points:p,id:l}})}function S6(r,t,e,n){var i=Ne(e,"grid"),a=i.type,s=i.areaFill,o=Fx(e),l=h0(t,e.gridFilter),c=a==="segment"?E6(l,e):w6(l,e),u=(0,G.pi)((0,G.pi)({},i),{center:o,areaFill:fe(s)?l.map(function(h,d){return Jr(s,[h,d,l])}):s,animate:n,data:c});return r.selectAll(ln.grid.class).data([1]).join(function(h){return h.append(function(){return new s6({style:u})}).attr("className",ln.grid.name)},function(h){return h.transition(function(){return this.update(u)})},function(h){return h.remove()}).transitions()}function wr(r,t,e,n,i){return n===void 0&&(n=!0),i===void 0&&(i=!1),n&&r===t||i&&r===e?!0:r>t&&r<e}var M6=function(r){var t=new DOMParser,e=t.parseFromString(r,"text/html"),n=e.body.firstElementChild;if(console.log(n==null?void 0:n.getClientRects(),11),!n)return 0;var i=n.getAttribute("style")||"",a=Object.fromEntries(i.split(";").map(function(p){return p.trim()}).filter(function(p){return p.includes(":")}).map(function(p){var y=(0,G.CR)(p.split(":").map(function(O){return O.trim()}),2),b=y[0],w=y[1];return[b.toLowerCase(),w]})),s=function(p){if(!p)return 0;var y=p.match(/([\d.]+)px/);return y?parseFloat(y[1]):0};if(a.height)return s(a.height);var o=s(a["font-size"])||16,l=a["line-height"],c;!l||l==="normal"?c=1.2*o:l.endsWith("px")?c=s(l):/^[\d.]+$/.test(l)?c=parseFloat(l)*o:c=o;var u=s(a["padding-top"]),h=s(a["padding-bottom"]);if(a.padding){var d=a.padding.split(/\s+/).map(s);d.length===1||d.length===2?(u=d[0],h=d[0]):(d.length===3||d.length===4)&&(u=d[0],h=d[2])}var f=s(a["border-top-width"]),v=s(a["border-bottom-width"]);if(a.border){var g=a.border.match(/([\d.]+)px/);g&&(f=parseFloat(g[1]),v=parseFloat(g[1]))}if(a["border-width"]){var d=a["border-width"].split(/\s+/).map(s);d.length===1||d.length===2?(f=d[0],v=d[0]):(d.length===3||d.length===4)&&(f=d[0],v=d[2])}return c+u+h+f+v};function A6(r,t,e,n){e===void 0&&(e=2),n===void 0&&(n="top"),xx(r,{wordWrap:!0,wordWrapWidth:t,maxLines:e,textBaseline:n})}function T6(r,t,e){var n=r.getBBox(),i=n.width,a=n.height,s=(0,G.CR)([t,e].map(function(c,u){var h;return c.includes("%")?parseFloat(((h=c.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||h===void 0?void 0:h[0])||"0")/100*(u===0?i:a):c}),2),o=s[0],l=s[1];return[o,l]}function zx(r,t){if(t)try{var e=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,n=t.replace(e,function(i,a,s){return"translate(".concat(T6(r,a,s),")")});r.attr("transform",n)}catch(i){}}var v0=function(){function r(t,e,n,i){this.set(t,e,n,i)}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),r.prototype.rotatedPoints=function(t,e,n){var i=this,a=i.x1,s=i.y1,o=i.x2,l=i.y2,c=Math.cos(t),u=Math.sin(t),h=e-e*c+n*u,d=n-e*u-n*c,f=[[c*a-u*l+h,u*a+c*l+d],[c*o-u*l+h,u*o+c*l+d],[c*a-u*s+h,u*a+c*s+d],[c*o-u*s+h,u*o+c*s+d]];return f},r.prototype.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},r.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},r}();function Fh(r,t){var e=r.getEulerAngles()||0;r.setEulerAngles(0);var n=r.getBounds(),i=(0,G.CR)(n.min,2),a=i[0],s=i[1],o=(0,G.CR)(n.max,2),l=o[0],c=o[1],u=r.getBBox(),h=u.width,d=u.height,f=d,v=0,g=0,p=a,y=s,b=bx(r);if(b){f-=1.5;var w=b.style.textAlign,O=b.style.textBaseline;w==="center"?p=(a+l)/2:(w==="right"||w==="end")&&(p=l),O==="middle"?y=(s+c)/2:O==="bottom"&&(y=c)}var _=(0,G.CR)(Er(t),4),F=_[0],W=F===void 0?0:F,j=_[1],H=j===void 0?0:j,K=_[2],et=K===void 0?W:K,rt=_[3],lt=rt===void 0?H:rt,ht=new v0((v+=a)-lt,(g+=s)-W,v+h+H,g+f+et);return r.setEulerAngles(e),ht.rotatedPoints(To(e),p,y)}function jl(r,t){return t[0]<=Math.max(r[0][0],r[1][0])&&t[0]<=Math.min(r[0][0],r[1][0])&&t[1]<=Math.max(r[0][1],r[1][1])&&t[1]<=Math.min(r[0][1],r[1][1])}function Zl(r,t,e){var n=(t[1]-r[1])*(e[0]-t[0])-(t[0]-r[0])*(e[1]-t[1]);return n===0?0:n<0?2:1}function O6(r,t){var e=Zl(r[0],r[1],t[0]),n=Zl(r[0],r[1],t[1]),i=Zl(t[0],t[1],r[0]),a=Zl(t[0],t[1],r[1]);return!!(e!==n&&i!==a||e===0&&jl(r,t[0])||n===0&&jl(r,t[1])||i===0&&jl(t,r[0])||a===0&&jl(t,r[1]))}function C6(r,t){var e=r.length;if(e<3)return!1;var n=[t,[9999,t[1]]],i=0,a=0;do{var s=[r[a],r[(a+1)%e]];if(O6(s,n)){if(Zl(s[0],t,s[1])===0)return jl(s,t);i++}a=(a+1)%e}while(a!==0);return!!(i&1)}function N6(r,t){return t.every(function(e){return C6(r,e)})}function k6(r,t,e){var n=r.x1,i=r.x2,a=r.y1,s=r.y2,o=[[n,a],[i,a],[i,s],[n,s]],l=Fh(t,e);return N6(o,l)}function jx(r,t){var e=(0,G.CR)(r,4),n=e[0],i=e[1],a=e[2],s=e[3],o=(0,G.CR)(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=a-n,f=s-i,v=u-l,g=h-c,p=d*g-v*f;if(p===0)return!1;var y=p>0,b=n-l,w=i-c,O=d*w-f*b;if(O<0===y)return!1;var _=v*w-g*b;return!(_<0===y||O>p===y||_>p===y)}function Zx(r,t){var e=[[r[0],r[1],r[2],r[3]],[r[2],r[3],r[4],r[5]],[r[4],r[5],r[6],r[7]],[r[6],r[7],r[0],r[1]]];return e.some(function(n){return jx(t,n)})}var dj={lineToLine:jx,intersectBoxLine:Zx,getBounds:Fh};function P6(r,t,e){var n,i,a=Fh(r,e).flat(1),s=Fh(t,e).flat(1),o=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var l=(0,G.XA)(o),c=l.next();!c.done;c=l.next()){var u=c.value;if(Zx(s,u))return!0}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return!1}function R6(r,t){var e=r.type,n=r.labelDirection,i=r.crossSize;if(!i)return!1;if(e==="arc"){var a=r.center,s=r.radius,o=(0,G.CR)(a,2),l=o[0],c=o[1],u=n==="negative"?0:i,h=-s-u,d=s+u,f=(0,G.CR)(Er(t),4),v=f[0],g=f[1],p=f[2],y=f[3];return new v0(l+h-y,c+h-v,l+d+g,c+d+p)}var b=(0,G.CR)(r.startPos,2),w=b[0],O=b[1],_=(0,G.CR)(r.endPos,2),F=_[0],W=_[1],j=(0,G.CR)(Dx(r)?[-t,0,t,0]:[0,t,0,-t],4),H=j[0],K=j[1],et=j[2],rt=j[3],lt=Co(0,r),ht=Sa(lt,i),yt=new v0(w,O,F,W);return yt.x1+=rt,yt.y1+=H,yt.x2+=K+ht[0],yt.y2+=et+ht[1],yt}function zh(r,t,e){var n,i,a=t.crossPadding,s=new Set,o=null,l=R6(t,a),c=function(v){return l?k6(l,v):!0},u=function(v,g){return!v||!v.firstChild?!0:!P6(v.firstChild,g.firstChild,Er(e))};try{for(var h=(0,G.XA)(r),d=h.next();!d.done;d=h.next()){var f=d.value;c(f)?!o||u(o,f)?o=f:(s.add(o),s.add(f)):s.add(f)}}catch(v){n={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return Array.from(s)}function g0(r,t){return t===void 0&&(t={}),ye(r)?0:typeof r=="number"?r:Math.floor(kI(r,t))}function L6(r,t,e,n){if(!(r.length<=0)){var i=t.suffix,a=i===void 0?"...":i,s=t.minLength,o=t.maxLength,l=o===void 0?1/0:o,c=t.step,u=c===void 0?" ":c,h=t.margin,d=h===void 0?[0,0,0,0]:h,f=yx(n.getTextShape(r[0])),v=g0(u,f),g=s?g0(s,f):v,p=g0(l,f);(ye(p)||p===1/0)&&(p=Math.max.apply(null,r.map(function(ht){return ht.getBBox().width})));for(var y=r.slice(),b=(0,G.CR)(d,4),w=b[0],O=w===void 0?0:w,_=b[1],F=_===void 0?0:_,W=b[2],j=W===void 0?O:W,H=b[3],K=H===void 0?F:H,et=function(ht){if(y.forEach(function(yt){n.ellipsis(n.getTextShape(yt),ht,a)}),y=zh(r,e,d),y.length<1)return{value:void 0}},rt=p;rt>g+v;rt-=v){var lt=et(rt);if(typeof lt=="object")return lt.value}}}var D6=function(r){return r!==void 0&&r!=null&&!Number.isNaN(r)},_6={parity:function(r,t){var e=t.seq,n=e===void 0?2:e;return r.filter(function(i,a){return a%n?(ji(i),!1):!0})}},I6=function(r){return r.filter(D6)};function B6(r,t,e,n){var i=r.length,a=t.keepHeader,s=t.keepTail;if(!(i<=1||i===2&&a&&s)){var o=_6.parity,l=function(w){return w.forEach(n.show),w},c=2,u=r.slice(),h=r.slice(),d=Math.min.apply(Math,(0,G.ev)([1],(0,G.CR)(r.map(function(w){return w.getBBox().width})),!1));if(e.type==="linear"&&(f0(e)||Dx(e))){var f=mx(r[0]).left,v=mx(r[i-1]).right,g=Math.abs(v-f)||1;c=Math.max(Math.floor(i*d/g),c)}var p,y;for(a&&(p=u.splice(0,1)[0]),s&&(y=u.splice(-1,1)[0],u.reverse()),l(u);c<r.length&&zh(I6(y?(0,G.ev)((0,G.ev)([y],(0,G.CR)(h),!1),[p],!1):(0,G.ev)([p],(0,G.CR)(h),!1)),e,t==null?void 0:t.margin).length;){if(y&&!p&&c%2===0){var b=u.splice(0,1);b.forEach(n.hide)}else if(y&&p){var b=u.splice(0,1);b.forEach(n.hide)}h=o(l(u),{seq:c}),c++}}}function F6(r,t,e,n){var i,a,s=t.optionalAngles,o=s===void 0?[0,45,90]:s,l=t.margin,c=t.recoverWhenFailed,u=c===void 0?!0:c,h=r.map(function(y){return y.getLocalEulerAngles()}),d=function(){return zh(r,e,l).length<1},f=function(y){return r.forEach(function(b,w){var O=Array.isArray(y)?y[w]:y;n.rotate(b,+O)})};try{for(var v=(0,G.XA)(o),g=v.next();!g.done;g=v.next()){var p=g.value;if(f(p),d())return}}catch(y){i={error:y}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}u&&f(h)}function z6(r){var t=r.type,e=r.labelDirection;return t==="linear"&&f0(r)?e==="negative"?"bottom":"top":"middle"}function j6(r,t,e,n,i){var a,s=t.maxLines,o=s===void 0?3:s,l=t.recoverWhenFailed,c=l===void 0?!0:l,u=t.margin,h=u===void 0?[0,0,0,0]:u,d=Jr((a=t.wordWrapWidth)!==null&&a!==void 0?a:50,[i]),f=r.map(function(w){return w.attr("maxLines")||1}),v=Math.min.apply(Math,(0,G.ev)([],(0,G.CR)(f),!1)),g=function(){return zh(r,e,h).length<1},p=z6(e),y=function(w){return r.forEach(function(O,_){var F=Array.isArray(w)?w[_]:w;n.wrap(O,d,F,p)})};if(!(v>o)){if(e.type==="linear"&&f0(e)){if(y(o),g())return}else for(var b=v;b<=o;b++)if(y(b),g())return;c&&y(f)}}var Z6=new Map([["hide",B6],["rotate",F6],["ellipsis",L6],["wrap",j6]]);function W6(r,t,e){return t.labelOverlap.length<1?!1:e==="hide"?!__(r[0]):e==="rotate"?!r.some(function(n){var i;return!!(!((i=n.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):e==="ellipsis"||e==="wrap"?r.filter(function(n){return n.querySelector("text")}).length>=1:!0}function G6(r,t,e,n){var i=t.labelOverlap,a=i===void 0?[]:i;a.length&&a.forEach(function(s){var o=s.type,l=Z6.get(o);W6(r,t,o)&&(l==null||l(r,s,t,n,e))})}function V6(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=function(n){return n==="positive"?-1:1};return r.reduce(function(n,i){return n*e(i)},1)}function Wx(r){for(var t=r;t<0;)t+=360;return Math.round(t%360)}function p0(r,t){var e=(0,G.CR)(r,2),n=e[0],i=e[1],a=(0,G.CR)(t,2),s=a[0],o=a[1],l=(0,G.CR)([n*s+i*o,n*o-i*s],2),c=l[0],u=l[1];return Math.atan2(u,c)}function U6(r){var t=(r+360)%180;return wr(t,-90,90)||(t+=180),t}function Y6(r,t,e){var n,i=e.labelAlign,a=(n=t.style.transform)===null||n===void 0?void 0:n.includes("rotate");if(a)return t.getLocalEulerAngles();var s=0,o=Co(r.value,e),l=Ih(r.value,e);return i==="horizontal"?0:(i==="perpendicular"?s=p0([1,0],o):s=p0([l[0]<0?-1:1,0],l),U6(Cx(s)))}function Gx(r,t,e){var n=e.type,i=e.labelAlign,a=Co(r,e),s=Wx(t),o=Wx(Cx(p0([1,0],a))),l="center",c="middle";return n==="linear"?[90,270].includes(o)&&s===0?(l="center",c=a[1]===1?"top":"bottom"):!(o%180)&&[90,270].includes(s)?l="center":o===0?(wr(s,0,90,!1,!0)||wr(s,0,90)||wr(s,270,360))&&(l="start"):o===90?wr(s,0,90,!1,!0)?l="start":(wr(s,90,180)||wr(s,270,360))&&(l="end"):o===270?wr(s,0,90,!1,!0)?l="end":(wr(s,90,180)||wr(s,270,360))&&(l="start"):o===180&&(s===90?l="start":(wr(s,0,90)||wr(s,270,360))&&(l="end")):i==="parallel"?wr(o,0,180,!0)?c="top":c="bottom":i==="horizontal"?wr(o,90,270,!1)?l="end":(wr(o,270,360,!1)||wr(o,0,90))&&(l="start"):i==="perpendicular"&&(wr(o,90,270)?l="end":l="start"),{textAlign:l,textBaseline:c}}function H6(r,t,e){t.setLocalEulerAngles(r);var n=t.__data__.value,i=Gx(n,r,e),a=t.querySelector(ln.labelItem.class);a&&Ux(a,i)}function Vx(r,t,e){var n=e.showTick,i=e.tickLength,a=e.tickDirection,s=e.labelDirection,o=e.labelSpacing,l=t.indexOf(r),c=Jr(o,[r,l,t]),u=(0,G.CR)([Co(r.value,e),V6(s,a)],2),h=u[0],d=u[1],f=d===1?Jr(n?i:0,[r,l,t]):0,v=(0,G.CR)(Fl(Sa(h,c+f),Bh(r.value,e)),2),g=v[0],p=v[1];return{x:g,y:p}}function X6(r,t,e,n){var i=n.labelFormatter,a=fe(i)?function(){return wa(Jr(i,[r,t,e,Co(r.value,n)]))}:function(){return wa(r.label||"")};return a}function K6(r,t,e,n){var i=n.labelRender,a=(br(n,"endPos.0",400)-br(n,"startPos.0",0))/e.length,s=fe(i)?Jr(i,[r,t,e,Co(r.value,n)]):r.label||"",o=M6(s)||30;return function(){return NI(s,{width:a,height:o})}}function Ux(r,t){["text","html"].includes(r.nodeName)&&r.attr(t)}function Q6(r,t){G6(this.node().childNodes,r,t,{hide:ji,show:_l,rotate:function(e,n){H6(+n,e,r)},ellipsis:function(e,n,i){e&&n0(e,n||1/0,i)},wrap:function(e,n,i){e&&A6(e,n,i)},getTextShape:function(e){return e.querySelector("text")}})}function Yx(r,t,e,n,i){var a=e.indexOf(t),s=i.labelRender,o=ve(r).append(s?K6(t,a,e,i):X6(t,a,e,i)).attr("className",ln.labelItem.name).node(),l=(0,G.CR)(Ea(Rx(n,[t,a,e])),2),c=l[0],u=l[1],h=u.transform,d=(0,G._T)(u,["transform"]);zx(o,h);var f=Y6(t,o,i);return o.getLocalEulerAngles()||o.setLocalEulerAngles(f),Ux(o,(0,G.pi)((0,G.pi)({},Gx(t.value,f,i)),c)),r.attr(d),o}function q6(r,t,e,n,i){var a=h0(t,e.labelFilter),s=Ne(e,"label"),o,l=r.selectAll(ln.label.class).data(a,function(c,u){return u}).join(function(c){return c.append("g").attr("className",ln.label.name).transition(function(u){Yx(this,u,t,s,e);var h=Vx(u,t,e),d=h.x,f=h.y;return this.style.transform="translate(".concat(d,", ").concat(f,")"),null})},function(c){return c.transition(function(u){var h=this.querySelector(ln.labelItem.class),d=Yx(this,u,t,s,e),f=tI(h,d,n.update),v=Vx(u,t,e),g=v.x,p=v.y,y=Wi(this,{transform:"translate(".concat(g,", ").concat(p,")")},n.update);return(0,G.ev)((0,G.ev)([],(0,G.CR)(f),!1),[y],!1)})},function(c){return o=c,c.transition(function(){var u=this,h=_h(this.childNodes[0],n.exit);return Ao(h,function(){return ve(u).remove()}),h}),o}).transitions();return J_(l,function(){Q6.call(r,e,i)}),l}function Hx(r,t){return d0(r,t.tickDirection,t)}function J6(r,t){var e=(0,G.CR)(r,2),n=e[0],i=e[1];return[[0,0],[n*t,i*t]]}function $6(r,t,e,n,i){var a=i.tickLength,s=(0,G.CR)(J6(n,Jr(a,[r,t,e])),2),o=(0,G.CR)(s[0],2),l=o[0],c=o[1],u=(0,G.CR)(s[1],2),h=u[0],d=u[1];return{x1:l,x2:h,y1:c,y2:d}}function t5(r,t,e,n,i){var a=i.tickFormatter,s=Hx(t.value,i),o="line";return fe(a)&&(o=function(){return Jr(a,[t,e,n,s])}),r.append(o).attr("className",ln.tickItem.name)}function e5(r,t,e,n,i,a,s){var o=Hx(r.value,a),l=$6(r,t,e,o,a),c=l.x1,u=l.x2,h=l.y1,d=l.y2,f=(0,G.CR)(Ea(Rx(s,[r,t,e,o])),2),v=f[0],g=f[1];n.node().nodeName==="line"&&n.styles((0,G.pi)({x1:c,x2:u,y1:h,y2:d},v)),i.attr(g),n.styles(v)}function Xx(r,t,e,n,i,a){var s=t5(ve(this),r,t,e,n);e5(r,t,e,s,this,n,i);var o=(0,G.CR)(Bh(r.value,n),2),l=o[0],c=o[1];return Wi(this,{transform:"translate(".concat(l,", ").concat(c,")")},a)}function n5(r,t,e,n){var i=h0(t,e.tickFilter),a=Ne(e,"tick");return r.selectAll(ln.tick.class).data(i,function(s){return s.id||s.label}).join(function(s){return s.append("g").attr("className",ln.tick.name).transition(function(o,l){return Xx.call(this,o,l,i,e,a,!1)})},function(s){return s.transition(function(o,l){return this.removeChildren(),Xx.call(this,o,l,i,e,a,n.update)})},function(s){return s.transition(function(){var o=this,l=_h(this.childNodes[0],n.exit);return Ao(l,function(){return o.remove()}),l})}).transitions()}function r5(r,t,e){var n=e.titlePosition,i=n===void 0?"lb":n,a=e.titleSpacing,s=Nh(i),o=r.node().getLocalBounds(),l=(0,G.CR)(o.min,2),c=l[0],u=l[1],h=(0,G.CR)(o.halfExtents,2),d=h[0],f=h[1],v=(0,G.CR)(t.node().getLocalBounds().halfExtents,2),g=v[0],p=v[1],y=(0,G.CR)([c+d,u+f],2),b=y[0],w=y[1],O=(0,G.CR)(Er(a),4),_=O[0],F=O[1],W=O[2],j=O[3];if(["start","end"].includes(i)&&e.type==="linear"){var H=e.startPos,K=e.endPos,et=(0,G.CR)(i==="start"?[H,K]:[K,H],2),rt=et[0],lt=et[1],ht=Ox([-lt[0]+rt[0],-lt[1]+rt[1]]),yt=(0,G.CR)(Sa(ht,_),2),Nt=yt[0],Ct=yt[1];return{x:rt[0]+Nt,y:rt[1]+Ct}}return s.includes("t")&&(w-=f+p+_),s.includes("r")&&(b+=d+g+F),s.includes("l")&&(b-=d+g+j),s.includes("b")&&(w+=f+p+W),{x:b,y:w}}function i5(r,t,e){var n=r.getGeometryBounds().halfExtents,i=n[1]*2;if(t==="vertical"){if(e==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(e==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function Kx(r,t,e,n,i){var a=Ne(n,"title"),s=(0,G.CR)(Ea(a),2),o=s[0],l=s[1],c=l.transform,u=l.transformOrigin,h=(0,G._T)(l,["transform","transformOrigin"]);t.styles(h);var d=c||i5(r.node(),o.direction,o.position);r.styles((0,G.pi)((0,G.pi)({},o),{transformOrigin:u})),zx(r.node(),d);var f=r5(ve(e._offscreen||e.querySelector(ln.mainGroup.class)),t,n),v=f.x,g=f.y,p=Wi(t.node(),{transform:"translate(".concat(v,", ").concat(g,")")},i);return p}function a5(r,t,e,n){var i=e.titleText;return r.selectAll(ln.title.class).data([{title:i}].filter(function(a){return!!a.title}),function(a,s){return a.title}).join(function(a){return a.append(function(){return wa(i)}).attr("className",ln.title.name).transition(function(){return Kx(ve(this),r,t,e,n.enter)})},function(a){return a.transition(function(){return Kx(ve(this),r,t,e,n.update)})},function(a){return a.remove()}).transitions()}function Qx(r,t,e,n){var i=r.showLine,a=r.showTick,s=r.showLabel,o=t.maybeAppendByClassName(ln.lineGroup,"g"),l=qr(i,o,function(f){return b6(f,r,n)})||[],c=t.maybeAppendByClassName(ln.tickGroup,"g"),u=qr(a,c,function(f){return n5(f,e,r,n)})||[],h=t.maybeAppendByClassName(ln.labelGroup,"g"),d=qr(s,h,function(f){return q6(f,e,r,n,t.node())})||[];return(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(l),!1),(0,G.CR)(u),!1),(0,G.CR)(d),!1).filter(function(f){return!!f})}var s5=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,o0)||this}return t.prototype.render=function(e,n,i){var a=this,s=e.titleText,o=e.data,l=e.animate,c=e.showTitle,u=e.showGrid,h=e.dataThreshold,d=e.truncRange,f=qI(o,h).filter(function(_){var F=_.value;return!(d&&F>d[0]&&F<d[1])}),v=cx(i===void 0?l:i),g=ve(n).maybeAppendByClassName(ln.gridGroup,"g"),p=qr(u,g,function(_){return S6(_,f,e,v)})||[],y=ve(n).maybeAppendByClassName(ln.mainGroup,"g");s&&(!this.initialized&&v.enter||this.initialized&&v.update)&&Qx(e,ve(this.offscreenGroup),f,cx(!1));var b=Qx(e,ve(y.node()),f,v),w=ve(n).maybeAppendByClassName(ln.titleGroup,"g"),O=qr(c,w,function(_){return a5(_,a,e,v)})||[];return(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(p),!1),(0,G.CR)(b),!1),(0,G.CR)(O),!1).flat().filter(function(_){return!!_})},t}(Ln);function qx(r){var t=r.canvas,e=r.touches,n=r.offsetX,i=r.offsetY;if(t){var a=t.x,s=t.y;return[a,s]}if(e){var o=e[0],l=o.clientX,c=o.clientY;return[l,c]}return n&&i?[n,i]:[0,0]}function m0(r,t){return+r.toPrecision(t)}function fj(r){return r.toLocaleString()}function vj(r){return r.toExponential()}function gj(r,t){return t===void 0&&(t=0),Math.abs(r)<1e3?String(r):"".concat(m0(r/1e3,t).toLocaleString(),"K")}var pj=function(r,t,e){return r<0&&Number.isFinite(r)?t:e},mj=function(r,t,e){return r>0&&Number.isFinite(r)?t:e},yj=function(r,t){return r*t},bj=function(r,t){return r/2+(t||0)/2},y0=function(r){return r};class Jx{constructor(t){this.options=mr({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=mr({},this.options,t),this.rescale(t)}rescale(t){}}function b0(r,t){return t-r?e=>(e-r)/(t-r):e=>.5}function jh(r,...t){return t.reduce((e,n)=>i=>e(n(i)),r)}function o5(r,t,e,n,i){let a=e||0,s=n||r.length;const o=i||(l=>l);for(;a<s;){const l=Math.floor((a+s)/2);o(r[l])>t?s=l:a=l+1}return a}var l5=S(75196),c5=S.n(l5);function x0(r,t,e){let n=e;return n<0&&(n+=1),n>1&&(n-=1),n<1/6?r+(t-r)*6*n:n<1/2?t:n<2/3?r+(t-r)*(2/3-n)*6:r}function u5(r){const t=r[0]/360,e=r[1]/100,n=r[2]/100,i=r[3];if(e===0)return[n*255,n*255,n*255,i];const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a,o=x0(s,a,t+1/3),l=x0(s,a,t),c=x0(s,a,t-1/3);return[o*255,l*255,c*255,i]}function $x(r){const t=c5().get(r);if(!t)return null;const{model:e,value:n}=t;return e==="rgb"?n:e==="hsl"?u5(n):null}const Zh=(r,t)=>e=>r*(1-e)+t*e,h5=(r,t)=>{const e=$x(r),n=$x(t);return e===null||n===null?e?()=>r:()=>t:i=>{const a=new Array(4);for(let u=0;u<4;u+=1){const h=e[u],d=n[u];a[u]=h*(1-i)+d*i}const[s,o,l,c]=a;return`rgba(${Math.round(s)}, ${Math.round(o)}, ${Math.round(l)}, ${c})`}},d5=(r,t)=>typeof r=="number"&&typeof t=="number"?Zh(r,t):typeof r=="string"&&typeof t=="string"?h5(r,t):()=>r,f5=(r,t)=>{const e=Zh(r,t);return n=>Math.round(e(n))};function v5(r){return r===null}function tE(r){return!Te(r)&&!v5(r)&&!Number.isNaN(r)}const E0=Math.sqrt(50),w0=Math.sqrt(10),S0=Math.sqrt(2);function Wh(r,t,e){const n=(t-r)/Math.max(0,e),i=Math.floor(Math.log(n)/Math.LN10),a=n/as(10,i);return i>=0?(a>=E0?10:a>=w0?5:a>=S0?2:1)*as(10,i):-as(10,-i)/(a>=E0?10:a>=w0?5:a>=S0?2:1)}function xj(r,t,e){const n=Math.abs(t-r)/Math.max(0,e);let i=as(10,Math.floor(Math.log(n)/Math.LN10));const a=n/i;return a>=E0?i*=10:a>=w0?i*=5:a>=S0&&(i*=2),t<r?-i:i}const g5=(r,t,e=5)=>{const n=[r,t];let i=0,a=n.length-1,s=n[i],o=n[a],l;return o<s&&([s,o]=[o,s],[i,a]=[a,i]),l=Wh(s,o,e),l>0?(s=Math.floor(s/l)*l,o=Math.ceil(o/l)*l,l=Wh(s,o,e)):l<0&&(s=Math.ceil(s*l)/l,o=Math.floor(o*l)/l,l=Wh(s,o,e)),l>0?(n[i]=Math.floor(s/l)*l,n[a]=Math.ceil(o/l)*l):l<0&&(n[i]=Math.ceil(s*l)/l,n[a]=Math.floor(o*l)/l),n};function p5(r,t){const e=t<r?t:r,n=r>t?r:t;return i=>Math.min(Math.max(e,i),n)}const m5=(r,t,e)=>{const[n,i]=r,[a,s]=t;let o,l;return n<i?(o=b0(n,i),l=e(a,s)):(o=b0(i,n),l=e(s,a)),jh(l,o)},y5=(r,t,e)=>{const n=Math.min(r.length,t.length)-1,i=new Array(n),a=new Array(n),s=r[0]>r[n],o=s?[...r].reverse():r,l=s?[...t].reverse():t;for(let c=0;c<n;c+=1)i[c]=b0(o[c],o[c+1]),a[c]=e(l[c],l[c+1]);return c=>{const u=o5(r,c,1,n)-1,h=i[u],d=a[u];return jh(d,h)(c)}},eE=(r,t,e,n)=>(Math.min(r.length,t.length)>2?y5:m5)(r,t,n?f5:e);class b5 extends Jx{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Zh,tickCount:5}}map(t){return tE(t)?this.output(t):this.options.unknown}invert(t){return tE(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...i)}getTicks(){const{tickMethod:t}=this.options,[e,n,i,...a]=this.getTickMethodOptions();return t(e,n,i,...a)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options,n=t[0],i=t[t.length-1];return[n,i,e]}chooseNice(){return g5}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,i=this.options.domain.map(t),a=Math.min(i.length,n.length);return e?p5(i[0],i[a-1]):y0}composeOutput(t,e){const{domain:n,range:i,round:a,interpolate:s}=this.options,o=eE(n.map(t),i,s,a);this.output=jh(o,e,t)}composeInput(t,e,n){const{domain:i,range:a}=this.options,s=eE(a,i.map(t),Zh);this.input=jh(e,n,s)}}const x5=(r,t,e)=>{let n,i,a=r,s=t;if(a===s&&e>0)return[a];let o=Wh(a,s,e);if(o===0||!Number.isFinite(o))return[];if(o>0){a=Math.ceil(a/o),s=Math.floor(s/o),i=new Array(n=Math.ceil(s-a+1));for(let l=0;l<n;l+=1)i[l]=(a+l)*o}else{o=-o,a=Math.ceil(a*o),s=Math.floor(s*o),i=new Array(n=Math.ceil(s-a+1));for(let l=0;l<n;l+=1)i[l]=(a+l)/o}return i};class Wl extends b5{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:d5,tickMethod:x5,tickCount:5}}chooseTransforms(){return[y0,y0]}clone(){return new Wl(this.options)}}function nE({map:r,initKey:t},e){const n=t(e);return r.has(n)?r.get(n):e}function E5({map:r,initKey:t},e){const n=t(e);return r.has(n)?r.get(n):(r.set(n,e),e)}function w5({map:r,initKey:t},e){const n=t(e);return r.has(n)&&(e=r.get(n),r.delete(n)),e}function S5(r){return typeof r=="object"?r.valueOf():r}class rE extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=S5,t!==null)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(nE({map:this.map,initKey:this.initKey},t))}has(t){return super.has(nE({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(E5({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(w5({map:this.map,initKey:this.initKey},t))}}const M0=Symbol("defaultUnknown");function iE(r,t,e){for(let n=0;n<t.length;n+=1)r.has(t[n])||r.set(e(t[n]),n)}function aE(r){const{value:t,from:e,to:n,mapper:i,notFoundReturn:a}=r;let s=i.get(t);if(s===void 0){if(a!==M0)return a;s=e.push(t)-1,i.set(t,s)}return n[s%n.length]}function sE(r){return r instanceof Date?t=>`${t}`:typeof r=="object"?t=>JSON.stringify(t):t=>t}class A0 extends Jx{getDefaultOptions(){return{domain:[],range:[],unknown:M0}}constructor(t){super(t)}map(t){return this.domainIndexMap.size===0&&iE(this.domainIndexMap,this.getDomain(),this.domainKey),aE({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return this.rangeIndexMap.size===0&&iE(this.rangeIndexMap,this.getRange(),this.rangeKey),aE({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=sE(e),this.rangeKey=sE(n),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!t||t.range)&&this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new A0(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function M5(r){const t=Math.min(...r);return r.map(e=>e/t)}function A5(r,t){const e=r.length,n=t-e;return n>0?[...r,...new Array(n).fill(1)]:n<0?r.slice(0,t):r}function T5(r){return Math.round(r*1e12)/1e12}function O5(r){const{domain:t,range:e,paddingOuter:n,paddingInner:i,flex:a,round:s,align:o}=r,l=t.length,c=A5(a,l),[u,h]=e,d=h-u,f=2/l*n+1-1/l*i,v=d/f,g=v*i/l,p=v-l*g,y=M5(c),b=y.reduce((rt,lt)=>rt+lt),w=p/b,O=new rE(t.map((rt,lt)=>{const ht=y[lt]*w;return[rt,s?Math.floor(ht):ht]})),_=new rE(t.map((rt,lt)=>{const yt=y[lt]*w+g;return[rt,s?Math.floor(yt):yt]})),F=Array.from(_.values()).reduce((rt,lt)=>rt+lt),j=(d-(F-F/l*i))*o,H=u+j;let K=s?Math.round(H):H;const et=new Array(l);for(let rt=0;rt<l;rt+=1){et[rt]=T5(K);const lt=t[rt];K+=_.get(lt)}return{valueBandWidth:O,valueStep:_,adjustedRange:et}}function C5(r){var t;const{domain:e}=r,n=e.length;if(n===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((t=r.flex)===null||t===void 0)&&t.length))return O5(r);const{range:a,paddingOuter:s,paddingInner:o,round:l,align:c}=r;let u,h,d=a[0];const v=a[1]-d,g=s*2,p=n-o;u=v/Math.max(1,g+p),l&&(u=Math.floor(u)),d+=(v-u*(n-o))*c,h=u*(1-o),l&&(d=Math.round(d),h=Math.round(h));const y=new Array(n).fill(0).map((b,w)=>d+w*u);return{valueStep:u,valueBandWidth:h,adjustedRange:y}}class T0 extends A0{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:M0,flex:[]}}constructor(t){super(t)}clone(){return new T0(this.options)}getStep(t){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:t===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:t===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:i,flex:a}=this.options,{adjustedRange:s,valueBandWidth:o,valueStep:l}=C5({align:t,range:n,round:i,flex:a,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=l,this.valueBandWidth=o,this.adjustedRange=s}}var N5=function(r){(0,G.ZT)(t,r);function t(e){var n=this,i=e.style,a=(0,G._T)(e,["style"]);return n=r.call(this,mr({},{type:"column"},(0,G.pi)({style:i},a)))||this,n.columnsGroup=new ir({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return t.prototype.render=function(){var e=this.attributes,n=e.columns,i=e.x,a=e.y;this.columnsGroup.style.transform="translate(".concat(i,", ").concat(a,")"),ve(this.columnsGroup).selectAll(".column").data(n.flat()).join(function(s){return s.append("rect").attr("className","column").each(function(o){this.attr(o)})},function(s){return s.each(function(o){this.attr(o)})},function(s){return s.remove()})},t.prototype.update=function(e){this.attr(Jn({},this.attributes,e)),this.render()},t.prototype.clear=function(){this.removeChildren()},t}(pn),k5=function(r){(0,G.ZT)(t,r);function t(e){var n=this,i=e.style,a=(0,G._T)(e,["style"]);return n=r.call(this,mr({},{type:"lines"},(0,G.pi)({style:i},a)))||this,n.linesGroup=n.appendChild(new ir),n.areasGroup=n.appendChild(new ir),n.render(),n}return t.prototype.render=function(){var e=this.attributes,n=e.lines,i=e.areas,a=e.x,s=e.y;this.style.transform="translate(".concat(a,", ").concat(s,")"),n&&this.renderLines(n),i&&this.renderAreas(i)},t.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},t.prototype.update=function(e){this.attr(Jn({},this.attributes,e)),this.render()},t.prototype.renderLines=function(e){ve(this.linesGroup).selectAll(".line").data(e).join(function(n){return n.append("path").attr("className","line").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.attr(i)})},function(n){return n.remove()})},t.prototype.renderAreas=function(e){ve(this.linesGroup).selectAll(".area").data(e).join(function(n){return n.append("path").attr("className","area").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.style(i)})},function(n){return n.remove()})},t}(pn);function P5(r,t,e,n){var i,a=[],s=!!n,o,l,c=[1/0,1/0],u=[-1/0,-1/0],h,d,f;if(s){i=(0,G.CR)(n,2),c=i[0],u=i[1];for(var v=0,g=r.length;v<g;v+=1){var p=r[v];c=Ys(c,p),u=Hs(u,p)}}for(var v=0,y=r.length;v<y;v+=1){var p=r[v];if(v===0&&!e)f=p;else if(v===y-1&&!e)d=p,a.push(f),a.push(d);else{var b=[v?v-1:y-1,v-1][e?0:1];o=r[b],l=r[e?(v+1)%y:v+1];var w=[0,0];w=l0(l,o),w=Sa(w,t);var O=zl(p,o),_=zl(p,l),F=O+_;F!==0&&(O/=F,_/=F);var W=Sa(w,-O),j=Sa(w,_);d=Fl(p,W),h=Fl(p,j),h=Ys(h,Hs(l,p)),h=Hs(h,Ys(l,p)),W=l0(h,p),W=Sa(W,-O/_),d=Fl(p,W),d=Ys(d,Hs(o,p)),d=Hs(d,Ys(o,p)),j=l0(p,d),j=Sa(j,_/O),h=Fl(p,j),s&&(d=Hs(d,c),d=Ys(d,u),h=Hs(h,c),h=Ys(h,u)),a.push(f),a.push(d),f=h}}return e&&a.push(a.shift()),a}function R5(r,t,e){var n;t===void 0&&(t=!1),e===void 0&&(e=[[0,0],[1,1]]);for(var i=!!t,a=[],s=0,o=r.length;s<o;s+=2)a.push([r[s],r[s+1]]);for(var l=P5(a,.4,i,e),c=a.length,u=[],h,d,f,s=0;s<c-1;s+=1)h=l[s*2],d=l[s*2+1],f=a[s+1],u.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]]);return i&&(h=l[c],d=l[c+1],n=(0,G.CR)(a,1),f=n[0],u.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]])),u}function L5(r,t){var e,n=t.x,i=t.y,a=(0,G.CR)(i.getOptions().range||[0,0],2),s=a[0],o=a[1];return o>s&&(e=(0,G.CR)([s,o],2),o=e[0],s=e[1]),r.map(function(l){var c=l.map(function(u,h){return[n.map(h),kn(i.map(u),o,s)]});return c})}function Gl(r,t){t===void 0&&(t=!1);var e=t?r.length-1:0,n=r.map(function(i,a){return(0,G.ev)([a===e?"M":"L"],(0,G.CR)(i),!1)});return t?n.reverse():n}function Gh(r,t){if(t===void 0&&(t=!1),r.length<=2)return Gl(r);for(var e=[],n=r.length,i=0;i<n;i+=1){var a=t?r[n-i-1]:r[i];Zn(a,e.slice(-2))||e.push.apply(e,(0,G.ev)([],(0,G.CR)(a),!1))}var s=R5(e,!1);return t?s.unshift((0,G.ev)(["M"],(0,G.CR)(r[n-1]),!1)):s.unshift((0,G.ev)(["M"],(0,G.CR)(r[0]),!1)),s}function O0(r,t,e){var n=ho(r);return n.push(["L",t,e],["L",0,e],["Z"]),n}function D5(r,t,e,n){return r.map(function(i){return O0(t?Gh(i):Gl(i),e,n)})}function _5(r,t,e){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=Gl(a),o=void 0;if(i===0)o=O0(s,t,e);else{var l=r[i-1],c=Gl(l,!0);c[0][0]="L",o=(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(s),!1),(0,G.CR)(c),!1),[["Z"]],!1)}n.push(o)}return n}function I5(r,t,e){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=Gh(a),o=void 0;if(i===0)o=O0(s,t,e);else{var l=r[i-1],c=Gh(l,!0),u=a[0];c[0][0]="L",o=(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(s),!1),(0,G.CR)(c),!1),[(0,G.ev)(["M"],(0,G.CR)(u),!1),["Z"]],!1)}n.push(o)}return n}var B5=function(r,t){if(Gr(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],s=fe(t)?t(a):a[t];s<n&&(e=a,n=s)}return e}},F5=function(r,t){if(Gr(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],s=fe(t)?t(a):a[t];s>n&&(e=a,n=s)}return e}};function oE(r){return r.length===0?[0,0]:[ec(B5(r,function(t){return ec(t)||0})),nc(F5(r,function(t){return nc(t)||0}))]}function lE(r){for(var t=ho(r),e=t[0].length,n=(0,G.CR)([Array(e).fill(0),Array(e).fill(0)],2),i=n[0],a=n[1],s=0;s<t.length;s+=1)for(var o=t[s],l=0;l<e;l+=1)o[l]>=0?(o[l]+=i[l],i[l]=o[l]):(o[l]+=a[l],a[l]=o[l]);return t}var z5=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(t.prototype,"rawData",{get:function(){var e=this.attributes.data;if(!e||(e==null?void 0:e.length)===0)return[[]];var n=ho(e);return ie(n[0])?[n]:n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.attributes.isStack?lE(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseline",{get:function(){var e=this.scales.y,n=(0,G.CR)(e.getOptions().domain||[0,0],2),i=n[0],a=n[1];return a<0?e.map(a):e.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"containerShape",{get:function(){var e=this.attributes,n=e.width,i=e.height;return{width:n,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linesStyle",{get:function(){var e=this,n=this.attributes,i=n.type,a=n.isStack,s=n.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var o=Ne(this.attributes,"area"),l=Ne(this.attributes,"line"),c=this.containerShape.width,u=this.data;if(u[0].length===0)return{lines:[],areas:[]};var h=this.scales,d=h.x,f=h.y,v=L5(u,{type:"line",x:d,y:f}),g=[];if(o){var p=this.baseline;a?g=s?I5(v,c,p):_5(v,c,p):g=D5(v,s,c,p)}return{lines:v.map(function(y,b){return(0,G.pi)({stroke:e.getColor(b),d:s?Gh(y):Gl(y)},l)}),areas:g.map(function(y,b){return(0,G.pi)({d:y,fill:e.getColor(b)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnsStyle",{get:function(){var e=this,n=Ne(this.attributes,"column"),i=this.attributes,a=i.isStack,s=i.type,o=i.scale;if(s!=="column")throw new Error("columnsStyle can only be used in column type");var l=this.containerShape.height,c=this.rawData;if(!c)return{columns:[]};a&&(c=lE(c));var u=this.createScales(c),h=u.x,d=u.y,f=(0,G.CR)(oE(c),2),v=f[0],g=f[1],p=new Wl({domain:[0,g-(v>0?0:v)],range:[0,l*o]}),y=h.getBandWidth(),b=this.rawData;return{columns:c.map(function(w,O){return w.map(function(_,F){var W=y/c.length,j=function(){return{x:h.map(F)+W*O,y:_>=0?d.map(_):d.map(0),width:W,height:p.map(Math.abs(_))}},H=function(){return{x:h.map(F),y:d.map(_),width:y,height:p.map(b[O][F])}};return(0,G.pi)((0,G.pi)({fill:e.getColor(O)},n),a?H():j())})})}},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){U_(n,".container","rect").attr("className","container").node();var i=e.type,a=e.x,s=e.y,o="spark".concat(i),l=(0,G.pi)({x:a,y:s},i==="line"?this.linesStyle:this.columnsStyle);ve(n).selectAll(".spark").data([i]).join(function(c){return c.append(function(u){return u==="line"?new k5({className:o,style:l}):new N5({className:o,style:l})}).attr("className","spark ".concat(o))},function(c){return c.update(l)},function(c){return c.remove()})},t.prototype.getColor=function(e){var n=this.attributes.color;return Gr(n)?n[e%n.length]:fe(n)?n.call(null,e):n},t.prototype.createScales=function(e){var n,i,a=this.attributes,s=a.type,o=a.scale,l=a.range,c=l===void 0?[]:l,u=a.spacing,h=this.containerShape,d=h.width,f=h.height,v=(0,G.CR)(oE(e),2),g=v[0],p=v[1],y=new Wl({domain:[(n=c[0])!==null&&n!==void 0?n:g,(i=c[1])!==null&&i!==void 0?i:p],range:[f,f*(1-o)]});return s==="line"?{type:s,x:new Wl({domain:[0,e[0].length-1],range:[0,d]}),y}:{type:s,x:new T0({domain:e[0].map(function(b,w){return w}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y}},t.tag="sparkline",t}(Ln),cE={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},uE={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},hE={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},aa=Zi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),ts=Zi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),j5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,n){var i=e.x,a=e.y,s=e.size,o=s===void 0?10:s,l=e.radius,c=l===void 0?o/4:l,u=e.orientation,h=(0,G._T)(e,["x","y","size","radius","orientation"]),d=o,f=d*2.4,v=ve(n).maybeAppendByClassName(ts.iconRect,"rect").styles((0,G.pi)((0,G.pi)({},h),{width:d,height:f,radius:c,x:i-d/2,y:a-f/2,transformOrigin:"center"})),g=i+1/3*d-d/2,p=i+2/3*d-d/2,y=a+1/4*f-f/2,b=a+3/4*f-f/2;v.maybeAppendByClassName("".concat(ts.iconLine,"-1"),"line").styles((0,G.pi)({x1:g,x2:g,y1:y,y2:b},h)),v.maybeAppendByClassName("".concat(ts.iconLine,"-2"),"line").styles((0,G.pi)({x1:p,x2:p,y1:y,y2:b},h)),u==="vertical"&&(v.node().style.transform="rotate(90)")},t}(Ln),Z5=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,hE)||this}return t.prototype.renderLabel=function(e){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.showLabel,l=Ne(this.attributes,"label"),c=l.x,u=c===void 0?0:c,h=l.y,d=h===void 0?0:h,f=l.transform,v=l.transformOrigin,g=(0,G._T)(l,["x","y","transform","transformOrigin"]),p=(0,G.CR)(Ea(g,[]),2),y=p[0],b=p[1],w=ve(e).maybeAppendByClassName(ts.labelGroup,"g").styles(b),O=(0,G.pi)((0,G.pi)({},uE),y),_=O.text,F=(0,G._T)(O,["text"]);qr(!!o,w,function(W){n.label=W.maybeAppendByClassName(ts.label,"text").styles((0,G.pi)((0,G.pi)({},F),{x:a+u,y:s+d,transform:f,transformOrigin:v,text:"".concat(_)})),n.label.on("mousedown",function(j){j.stopPropagation()}),n.label.on("touchstart",function(j){j.stopPropagation()})})},t.prototype.renderIcon=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.orientation,o=n.type,l=(0,G.pi)((0,G.pi)({x:i,y:a,orientation:s},cE),Ne(this.attributes,"icon")),c=this.attributes.iconShape,u=c===void 0?function(){return new j5({style:l})}:c,h=ve(e).maybeAppendByClassName(ts.iconGroup,"g");h.selectAll(ts.icon.class).data([u]).join(function(d){return d.append(typeof u=="string"?u:function(){return u(o)}).attr("className",ts.icon.name)},function(d){return d.update(l)},function(d){return d.remove()})},t.prototype.render=function(e,n){this.renderIcon(n),this.renderLabel(n)},t}(Ln),W5=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e,(0,G.pi)((0,G.pi)((0,G.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Mo(hE,"handle")),Mo(cE,"handleIcon")),Mo(uE,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(i){return function(a){a.stopPropagation(),n.target=i,n.prevPos=n.getOrientVal(qx(a));var s=n.availableSpace,o=s.x,l=s.y,c=n.getBBox(),u=c.x,h=c.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([o,l])-n.getOrientVal([+u,+h])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(i){var a=n.attributes,s=a.slidable,o=a.brushable,l=a.type;i.stopPropagation();var c=n.getOrientVal(qx(i)),u=c-n.prevPos;if(u){var h=n.getRatio(u);switch(n.target){case"start":s&&n.setValuesOffset(h);break;case"end":s&&n.setValuesOffset(0,h);break;case"selection":s&&n.setValuesOffset(h,h);break;case"track":if(!o)return;n.selectionWidth+=h,l==="range"?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0);break;default:break}n.prevPos=c}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(i){var a=n.attributes,s=a.onChange,o=a.type,l=o==="range"?i:i[1],c=o==="range"?n.getValues():n.getValues()[1],u=new Kn("valuechange",{detail:{oldValue:l,value:c}});n.dispatchEvent(u),s==null||s(c)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Object.defineProperty(t.prototype,"values",{get:function(){return this.attributes.values},set:function(e){this.attributes.values=this.clampValues(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sparklineStyle",{get:function(){var e=this.attributes.orientation;if(e!=="horizontal")return null;var n=Ne(this.attributes,"sparkline");return(0,G.pi)((0,G.pi)({zIndex:0},this.availableSpace),n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shape",{get:function(){var e=this.attributes,n=e.trackLength,i=e.trackSize,a=(0,G.CR)(this.getOrientVal([[n,i],[i,n]]),2),s=a[0],o=a[1];return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,n=e.x,i=e.y,a=e.padding,s=(0,G.CR)(Er(a),4),o=s[0],l=s[1],c=s[2],u=s[3],h=this.shape,d=h.width,f=h.height;return{x:u,y:o,width:d-(u+l),height:f-(o+c)}},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){return this.values},t.prototype.setValues=function(e,n){e===void 0&&(e=[0,0]),n===void 0&&(n=!1),this.attributes.values=e;var i=n===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},t.prototype.updateSelectionArea=function(e){var n=this.calcSelectionArea();this.foregroundGroup.selectAll(aa.selection.class).each(function(i,a){Wi(this,n[a],e)})},t.prototype.updateHandlesPosition=function(e){this.attributes.showHandle&&(this.startHandle&&Wi(this.startHandle,this.getHandleStyle("start"),e),this.endHandle&&Wi(this.endHandle,this.getHandleStyle("end"),e))},t.prototype.innerSetValues=function(e,n){e===void 0&&(e=[0,0]),n===void 0&&(n=!1);var i=this.values,a=this.clampValues(e);this.attributes.values=a,this.setValues(a),n&&this.onValueChange(i)},t.prototype.renderTrack=function(e){var n=this.attributes,i=n.x,a=n.y,s=Ne(this.attributes,"track");this.trackShape=ve(e).maybeAppendByClassName(aa.track,"rect").styles((0,G.pi)((0,G.pi)({x:i,y:a},this.shape),s))},t.prototype.renderBrushArea=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.brushable;this.brushArea=ve(e).maybeAppendByClassName(aa.brushArea,"rect").styles((0,G.pi)({x:i,y:a,fill:"transparent",cursor:s?"crosshair":"default"},this.shape))},t.prototype.renderSparkline=function(e){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.orientation,l=ve(e).maybeAppendByClassName(aa.sparklineGroup,"g");qr(o==="horizontal",l,function(c){var u=(0,G.pi)((0,G.pi)({},n.sparklineStyle),{x:a,y:s});c.maybeAppendByClassName(aa.sparkline,function(){return new z5({style:u})}).update(u)})},t.prototype.renderHandles=function(){var e=this,n,i=this.attributes,a=i.showHandle,s=i.type,o=s==="range"?["start","end"]:["end"],l=a?o:[],c=this;(n=this.foregroundGroup)===null||n===void 0||n.selectAll(aa.handle.class).data(l.map(function(u){return{type:u}}),function(u){return u.type}).join(function(u){return u.append(function(h){var d=h.type;return new Z5({style:e.getHandleStyle(d)})}).each(function(h){var d=h.type;this.attr("class","".concat(aa.handle.name," ").concat(d,"-handle"));var f="".concat(d,"Handle");c[f]=this,this.addEventListener("pointerdown",c.onDragStart(d))})},function(u){return u.each(function(h){var d=h.type;this.update(c.getHandleStyle(d))})},function(u){return u.each(function(h){var d=h.type,f="".concat(d,"Handle");c[f]=void 0}).remove()})},t.prototype.renderSelection=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.type,o=n.selectionType;this.foregroundGroup=ve(e).maybeAppendByClassName(aa.foreground,"g");var l=Ne(this.attributes,"selection"),c=function(h){return h.style("visibility",function(d){return d.show?"visible":"hidden"}).style("cursor",function(d){return o==="select"?"grab":o==="invert"?"crosshair":"default"}).styles((0,G.pi)((0,G.pi)({},l),{transform:"translate(".concat(i,", ").concat(a,")")}))},u=this;this.foregroundGroup.selectAll(aa.selection.class).data(s==="value"?[]:this.calcSelectionArea().map(function(h,d){return{style:(0,G.pi)({},h),index:d,show:o==="select"?d===1:d!==1}}),function(h){return h.index}).join(function(h){return h.append("rect").attr("className",aa.selection.name).call(c).each(function(d,f){var v=this;f===1?(u.selectionShape=ve(this),this.on("pointerdown",function(g){v.attr("cursor","grabbing"),u.onDragStart("selection")(g)}),u.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),u.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),u.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){v.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){v.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){v.attr("cursor","pointer")})):this.on("pointerdown",u.onDragStart("track"))})},function(h){return h.call(c)},function(h){return h.remove()}),this.updateSelectionArea(!1),this.renderHandles()},t.prototype.render=function(e,n){this.renderTrack(n),this.renderSparkline(n),this.renderBrushArea(n),this.renderSelection(n)},t.prototype.clampValues=function(e,n){var i;n===void 0&&(n=4);var a=(0,G.CR)(this.range,2),s=a[0],o=a[1],l=(0,G.CR)(this.getValues().map(function(p){return m0(p,n)}),2),c=l[0],u=l[1],h=Array.isArray(e)?e:[c,e!=null?e:u],d=(0,G.CR)((h||[c,u]).map(function(p){return m0(p,n)}),2),f=d[0],v=d[1];if(this.attributes.type==="value")return[0,kn(v,s,o)];f>v&&(i=(0,G.CR)([v,f],2),f=i[0],v=i[1]);var g=v-f;return g>o-s?[s,o]:f<s?c===s&&u===v?[s,v]:[s,g+s]:v>o?u===o&&c===f?[f,o]:[o-g,o]:[f,v]},t.prototype.calcSelectionArea=function(e){var n=(0,G.CR)(this.clampValues(e),2),i=n[0],a=n[1],s=this.availableSpace,o=s.x,l=s.y,c=s.width,u=s.height;return this.getOrientVal([[{y:l,height:u,x:o,width:i*c},{y:l,height:u,x:i*c+o,width:(a-i)*c},{y:l,height:u,x:a*c,width:(1-a)*c}],[{x:o,width:c,y:l,height:i*u},{x:o,width:c,y:i*u+l,height:(a-i)*u},{x:o,width:c,y:a*u,height:(1-a)*u}]])},t.prototype.calcHandlePosition=function(e){var n=this.attributes.handleIconOffset,i=this.availableSpace,a=i.x,s=i.y,o=i.width,l=i.height,c=(0,G.CR)(this.clampValues(),2),u=c[0],h=c[1],d=e==="start"?-n:n,f=(e==="start"?u:h)*this.getOrientVal([o,l])+d;return{x:a+this.getOrientVal([f,o/2]),y:s+this.getOrientVal([l/2,f])}},t.prototype.inferTextStyle=function(e){var n=this.attributes.orientation;return n==="horizontal"?{}:e==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:e==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},t.prototype.calcHandleText=function(e){var n,i=this.attributes,a=i.type,s=i.orientation,o=i.formatter,l=i.autoFitLabel,c=Ne(this.attributes,"handle"),u=Ne(c,"label"),h=c.spacing,d=this.getHandleSize(),f=this.clampValues(),v=e==="start"?f[0]:f[1],g=o(v),p=new qv({style:(0,G.pi)((0,G.pi)((0,G.pi)({},u),this.inferTextStyle(e)),{text:g})}),y=p.getBBox(),b=y.width,w=y.height;if(p.destroy(),!l){if(a==="value")return{text:g,x:0,y:-w-h};var O=h+d+(s==="horizontal"?b/2:0);return n={text:g},n[s==="horizontal"?"x":"y"]=e==="start"?-O:O,n}var _=0,F=0,W=this.availableSpace,j=W.width,H=W.height,K=this.calcSelectionArea()[1],et=K.x,rt=K.y,lt=K.width,ht=K.height,yt=h+d;if(s==="horizontal"){var Nt=yt+b/2;if(e==="start"){var Ct=et-yt-b;_=Ct>0?-Nt:Nt}else{var pt=j-et-lt-yt>b;_=pt?Nt:-Nt}}else{var xt=yt,kt=w+yt;e==="start"?F=rt-d>w?-kt:xt:F=H-(rt+ht)-d>w?kt:-xt}return{x:_,y:F,text:g}},t.prototype.getHandleLabelStyle=function(e){var n=Ne(this.attributes,"handleLabel");return(0,G.pi)((0,G.pi)((0,G.pi)({},n),this.calcHandleText(e)),this.inferTextStyle(e))},t.prototype.getHandleIconStyle=function(){var e=this.attributes.handleIconShape,n=Ne(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),a=this.getHandleSize();return(0,G.pi)({cursor:i,shape:e,size:a},n)},t.prototype.getHandleStyle=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.showLabel,o=n.showLabelOnInteraction,l=n.orientation,c=this.calcHandlePosition(e),u=c.x,h=c.y,d=this.calcHandleText(e),f=s;return!s&&o&&(this.target?f=!0:f=!1),(0,G.pi)((0,G.pi)((0,G.pi)({},Mo(this.getHandleIconStyle(),"icon")),Mo((0,G.pi)((0,G.pi)({},this.getHandleLabelStyle(e)),d),"label")),{transform:"translate(".concat(u+i,", ").concat(h+a,")"),orientation:l,showLabel:f,type:e,zIndex:3})},t.prototype.getHandleSize=function(){var e=this.attributes,n=e.handleIconSize,i=e.width,a=e.height;return n||Math.floor((this.getOrientVal([+a,+i])+4)/2.4)},t.prototype.getOrientVal=function(e){var n=(0,G.CR)(e,2),i=n[0],a=n[1],s=this.attributes.orientation;return s==="horizontal"?i:a},t.prototype.setValuesOffset=function(e,n){n===void 0&&(n=0);var i=this.attributes.type,a=(0,G.CR)(this.getValues(),2),s=a[0],o=a[1],l=i==="range"?e:0,c=[s+l,o+n].sort();this.innerSetValues(c,!0)},t.prototype.getRatio=function(e){var n=this.availableSpace,i=n.width,a=n.height;return e/this.getOrientVal([i,a])},t.prototype.dispatchCustomEvent=function(e,n,i){var a=this;e.on(n,function(s){s.stopPropagation(),a.dispatchEvent(new Kn(i,{detail:s}))})},t.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var e=this.brushArea;this.dispatchCustomEvent(e,"click","trackClick"),this.dispatchCustomEvent(e,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(e,"pointerleave","trackMouseleave"),e.on("pointerdown",this.onDragStart("track"))},t.prototype.onScroll=function(e){var n=this.attributes.scrollable;if(n){var i=e.deltaX,a=e.deltaY,s=a||i,o=this.getRatio(s);this.setValuesOffset(o,o)}},t.tag="slider",t}(Ln),G5={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(r){return r.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},C0=Zi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),V5=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e,G5)||this;return n.point=[0,0],n.group=n.appendChild(new ir({})),n.isMutationObserved=!0,n}return t.prototype.renderBackground=function(){if(this.label){var e=this.attributes,n=e.position,i=e.padding,a=(0,G.CR)(Er(i),4),s=a[0],o=a[1],l=a[2],c=a[3],u=this.label.node().getLocalBounds(),h=u.min,d=u.max,f=new kr(h[0]-c,h[1]-s,d[0]+o-h[0]+c,d[1]+l-h[1]+s),v=this.getPath(n,f),g=Ne(this.attributes,"background");this.background=ve(this.group).maybeAppendByClassName(C0.background,"path").styles((0,G.pi)((0,G.pi)({},g),{d:v})),this.group.appendChild(this.label.node())}},t.prototype.renderLabel=function(){var e=this.attributes,n=e.formatter,i=e.labelText,a=Ne(this.attributes,"label"),s=(0,G.CR)(Ea(a),2),o=s[0],l=s[1],c=o.text,u=(0,G._T)(o,["text"]);if(this.label=ve(this.group).maybeAppendByClassName(C0.labelGroup,"g").styles(l),!!i){var h=this.label.maybeAppendByClassName(C0.label,function(){return wa(n(i))}).style("text",n(i).toString());h.selectAll("text").styles(u)}},t.prototype.adjustLayout=function(){var e=(0,G.CR)(this.point,2),n=e[0],i=e[1],a=this.attributes,s=a.x,o=a.y;this.group.attr("transform","translate(".concat(s-n,", ").concat(o-i,")"))},t.prototype.getPath=function(e,n){var i=this.attributes.radius,a=n.x,s=n.y,o=n.width,l=n.height,c=[["M",a+i,s],["L",a+o-i,s],["A",i,i,0,0,1,a+o,s+i],["L",a+o,s+l-i],["A",i,i,0,0,1,a+o-i,s+l],["L",a+i,s+l],["A",i,i,0,0,1,a,s+l-i],["L",a,s+i],["A",i,i,0,0,1,a+i,s],["Z"]],u={top:4,right:6,bottom:0,left:2},h=u[e],d=this.createCorner([c[h].slice(-2),c[h+1].slice(-2)]);return c.splice.apply(c,(0,G.ev)([h+1,1],(0,G.CR)(d),!1)),c[0][0]="M",c},t.prototype.createCorner=function(e,n){n===void 0&&(n=10);var i=.8,a=OI.apply(void 0,(0,G.ev)([],(0,G.CR)(e),!1)),s=(0,G.CR)(e,2),o=(0,G.CR)(s[0],2),l=o[0],c=o[1],u=(0,G.CR)(s[1],2),h=u[0],d=u[1],f=(0,G.CR)(a?[h-l,[l,h]]:[d-c,[c,d]],2),v=f[0],g=(0,G.CR)(f[1],2),p=g[0],y=g[1],b=v/2,w=v/Math.abs(v),O=n*w,_=O/2,F=O*Math.sqrt(3)/2*i,W=(0,G.CR)([p,p+b-_,p+b,p+b+_,y],5),j=W[0],H=W[1],K=W[2],et=W[3],rt=W[4];return a?(this.point=[K,c-F],[["L",j,c],["L",H,c],["L",K,c-F],["L",et,c],["L",rt,c]]):(this.point=[l+F,K],[["L",l,j],["L",l,H],["L",l+F,K],["L",l,et],["L",l,rt]])},t.prototype.applyVisibility=function(){var e=this.attributes.visibility;e==="hidden"?ji(this):_l(this)},t.prototype.bindEvents=function(){this.label.on(Ie.BOUNDS_CHANGED,this.renderBackground)},t.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},t}(Ln),U5=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},t.defaultOptions,e))||this;return n.hoverColor="#f5f5f5",n.selectedColor="#e6f7ff",n.background=n.appendChild(new pr({})),n.label=n.background.appendChild(new ir({})),n}return Object.defineProperty(t.prototype,"padding",{get:function(){return Er(this.style.padding)},enumerable:!1,configurable:!0}),t.prototype.renderLabel=function(){var e=this.style,n=e.label,i=e.value,a=Ne(this.attributes,"label");ve(this.label).maybeAppend(".label",function(){return wa(n)}).attr("className","label").styles(a),this.label.attr("__data__",i)},t.prototype.renderBackground=function(){var e=this.label.getBBox(),n=(0,G.CR)(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3],l=e.width,c=e.height,u=l+o+a,h=c+i+s,d=Ne(this.attributes,"background"),f=this.style,v=f.width,g=v===void 0?0:v,p=f.height,y=p===void 0?0:p,b=f.selected;this.background.attr((0,G.pi)((0,G.pi)({},d),{width:Math.max(u,g),height:Math.max(h,y),fill:b?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(o,", ").concat((h-c)/2,")")})},t.prototype.render=function(){this.renderLabel(),this.renderBackground()},t.prototype.bindEvents=function(){var e=this;this.addEventListener("pointerenter",function(){e.style.selected||e.background.attr("fill",e.hoverColor)}),this.addEventListener("pointerleave",function(){e.style.selected||e.background.attr("fill",e.style.backgroundFill)});var n=this;this.addEventListener("click",function(){var i=e.style,a=i.label,s=i.value,o=i.onClick;o==null||o(s,{label:a,value:s},n)})},t.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},t}(Ln),Y5=function(r){(0,G.ZT)(t,r);function t(e){var n,i,a=r.call(this,Jn({},t.defaultOptions,e))||this;a.currentValue=(n=t.defaultOptions.style)===null||n===void 0?void 0:n.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new pr({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new pr({className:"dropdown"}));var s=a.style.defaultValue;return s&&(!((i=a.style.options)===null||i===void 0)&&i.some(function(o){return o.value===s}))&&(a.currentValue=s),a}return t.prototype.setValue=function(e){this.currentValue=e,this.render()},t.prototype.getValue=function(){return this.currentValue},Object.defineProperty(t.prototype,"dropdownPadding",{get:function(){return Er(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),t.prototype.renderSelect=function(){var e=this,n,i=this.style,a=i.x,s=i.y,o=i.width,l=i.height,c=i.bordered,u=i.showDropdownIcon,h=Ne(this.attributes,"select"),d=Ne(this.attributes,"placeholder");this.select.attr((0,G.pi)((0,G.pi)({x:a,y:s,width:o,height:l},h),{fill:"#fff",strokeWidth:c?1:0}));var f=this.dropdownPadding,v=10;u&&ve(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(a+o-v-f[1]-f[3],", ").concat(s+l/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var g=(n=this.style.options)===null||n===void 0?void 0:n.find(function(w){return w.value===e.currentValue}),p=(0,G.pi)({x:a+f[3]},d);ve(this.select).selectAll(".placeholder").data(g?[]:[1]).join(function(w){return w.append("text").attr("className","placeholder").styles(p).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(w){return w.styles(p)},function(w){return w.remove()});var y=Ne(this.attributes,"optionLabel"),b=(0,G.pi)({x:a+f[3]},y);ve(this.select).selectAll(".value").data(g?[g]:[]).join(function(w){return w.append(function(O){return wa(O.label)}).attr("className","value").styles(b).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(w){return w.styles(b)},function(w){return w.remove()})},t.prototype.renderDropdown=function(){var e=this,n,i,a=this.style,s=a.x,o=a.y,l=a.width,c=a.height,u=a.options,h=a.onSelect,d=a.open,f=Ne(this.attributes,"dropdown"),v=Ne(this.attributes,"option"),g=this.dropdownPadding;ve(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(u,function(b){return b.value}).join(function(b){return b.append(function(w){return new U5({className:"dropdown-item",style:(0,G.pi)((0,G.pi)((0,G.pi)({},w),v),{width:l-g[1]-g[3],selected:w.value===e.currentValue,onClick:function(O,_,F){e.setValue(O),h==null||h(O,_,F),e.dispatchEvent(new Kn("change",{detail:{value:O,option:_,item:F}})),ji(e.dropdown)}})})}).each(function(w,O){var _,F=(_=this.parentNode)===null||_===void 0?void 0:_.children,W=F.reduce(function(j,H,K){return K<O&&(j+=H.getBBox().height),j},0);this.attr("transform","translate(".concat(g[3],", ").concat(g[0]+W,")"))})},function(b){return b.update(function(w){return{selected:w.value===e.currentValue}})},function(b){return b.remove()});var p=(i=(n=this.dropdown.getElementsByClassName("dropdown-container"))===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.getBBox(),y=f.spacing;this.dropdown.attr((0,G.pi)({transform:"translate(".concat(s,", ").concat(o+c+y,")"),width:p.width+g[1]+g[3],height:p.height+g[0]+g[2]},f)),!d&&ji(this.dropdown)},t.prototype.render=function(){this.renderSelect(),this.renderDropdown()},t.prototype.bindEvents=function(){var e=this;this.addEventListener("click",function(n){n.stopPropagation()}),this.select.addEventListener("click",function(){e.dropdown.style.visibility==="visible"?ji(e.dropdown):_l(e.dropdown)}),this.addEventListener("pointerenter",function(){e.isPointerInSelect=!0}),this.addEventListener("pointerleave",function(){e.isPointerInSelect=!1}),document==null||document.addEventListener("click",function(){e.isPointerInSelect||ji(e.dropdown)})},t.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"\u8BF7\u9009\u62E9",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}},t}(Ln),Gi=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},{style:{backgroundOpacity:t.backgroundOpacities.default}},t.defaultOptions,e))||this;return n.showBackground=!0,n.background=n.appendChild(new pr({})),n.icon=n.appendChild(new ir({})),n}return Object.defineProperty(t.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return Er(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconSize",{get:function(){var e=this.attributes.size,n=(0,G.CR)(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3];return Math.max(e-Math.max(o+a,i+s),this.lineWidth*2+1)},enumerable:!1,configurable:!0}),t.prototype.renderBackground=function(){var e=this.attributes,n=e.x,i=e.y,a=e.size,s=a/2,o=Ne(this.attributes,"background");this.background.attr((0,G.pi)({x:n-s,y:i-s,width:a,height:a},o))},t.prototype.showIndicator=function(){if(this.label){var e=this.attributes.size,n=this.background.getBBox(),i=n.x,a=n.y;this.indicator.update({x:i+e/2,y:a-5,labelText:this.label,visibility:"visible"})}},t.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},t.prototype.connectedCallback=function(){var e;r.prototype.connectedCallback.call(this);var n=this.attributes.size,i=this.background.getBBox(),a=i.x,s=i.y,o=(e=this.ownerDocument)===null||e===void 0?void 0:e.defaultView;o&&(this.indicator=o.appendChild(new V5({style:{x:a+n/2,y:s-n/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},t.prototype.disconnectedCallback=function(){this.indicator.destroy()},t.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},t.prototype.bindEvents=function(){var e=this,n=this.attributes.onClick;if(this.addEventListener("click",function(){n==null||n(e)}),this.showBackground){var i=function(){return e.background.attr({opacity:t.backgroundOpacities.default})},a=function(){return e.background.attr({opacity:t.backgroundOpacities.hover})},s=function(){return e.background.attr({opacity:t.backgroundOpacities.active})};this.addEventListener("pointerenter",function(){a(),e.showIndicator()}),this.addEventListener("pointerleave",function(){i(),e.hideIndicator()}),this.addEventListener("pointerdown",function(){s()}),this.addEventListener("pointerup",function(){i()})}},t.tag="IconBase",t.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},t.backgroundOpacities={default:0,hover:.8,active:1},t}(Ln),Vl=function(r,t){return t===void 0&&(t="#565758"),new ri({style:{fill:t,d:"M ".concat(r,",").concat(r," L -").concat(r,",0 L ").concat(r,",-").concat(r," Z"),transformOrigin:"center"}})},H5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.arcPath=function(e,n,i){var a=(0,G.CR)([i,i],2),s=a[0],o=a[1],l=function(g){return[e+i*Math.cos(g),n+i*Math.sin(g)]},c=(0,G.CR)(l(-5/4*Math.PI),2),u=c[0],h=c[1],d=(0,G.CR)(l(1/4*Math.PI),2),f=d[0],v=d[1];return"M".concat(u,",").concat(h,",A").concat(s,",").concat(o,",0,1,1,").concat(f,",").concat(v)},Object.defineProperty(t.prototype,"label",{get:function(){return"\u91CD\u7F6E"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=this.lineWidth,l=o+.5;ve(this.icon).maybeAppend(".reset","path").styles({stroke:a,lineWidth:o,d:this.arcPath(n,i,s/2-o),markerStart:Vl(l,a)})},t}(Gi),X5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5FEB\u9000"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),c=[[n,i],[n,i-l],[n-o,i],[n,i+l],[n,i],[n+o,i-l],[n+o,i+l],[n,i]];ve(this.icon).maybeAppend(".backward","polygon").styles({points:c,fill:a})},t}(Gi),K5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5FEB\u8FDB"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),c=[[n,i],[n,i-l],[n+o,i],[n,i+l],[n,i],[n-o,i-l],[n-o,i+l],[n,i]];ve(this.icon).maybeAppend(".forward","polygon").styles({points:c,fill:a})},t}(Gi),Q5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u64AD\u653E"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/3*Math.pow(3,.5)*.8,l=[[n+o,i],[n-o/2,i-s/2*.8],[n-o/2,i+s/2*.8],[n+o,i]];ve(this.icon).maybeAppend(".play","polygon").styles({points:l,fill:a})},t}(Gi),q5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6682\u505C"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/3,l=[[n-o,i-s/2],[n-o,i+s/2],[n-o/2,i+s/2],[n-o/2,i-s/2],[n-o,i-s/2],[n+o/2,i-s/2],[n+o/2,i+s/2],[n+o,i+s/2],[n+o,i-s/2]];ve(this.icon).maybeAppend(".pause","polygon").styles({points:l,fill:a})},t}(Gi),J5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u8303\u56F4\u65F6\u95F4"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth,c=l;ve(this.icon).maybeAppend(".left-line","line").styles({x1:n-o/2,y1:i-o/2,x2:n-o/2,y2:i+o/2,stroke:a,lineWidth:l}),ve(this.icon).maybeAppend(".right-line","line").styles({x1:n+o/2,y1:i-o/2,x2:n+o/2,y2:i+o/2,stroke:a,lineWidth:l}),ve(this.icon).maybeAppend(".left-arrow","line").styles({x1:n,y1:i,x2:n-o/2+c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)}),ve(this.icon).maybeAppend(".right-arrow","line").styles({x1:n,y1:i,x2:n+o/2-c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)})},t}(Gi),$5=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5355\u4E00\u65F6\u95F4"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth;ve(this.icon).maybeAppend(".line","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:l});var c=l;ve(this.icon).maybeAppend(".left-arrow","line").styles({x1:n-o/2-c*2,y1:i,x2:n-c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)}),ve(this.icon).maybeAppend(".right-arrow","line").styles({x1:n+o/2+c*2,y1:i,x2:n+c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)})},t}(Gi),dE=function(r){return[[-r/2,-r/2],[-r/2,r/2],[r/2,r/2]]},t4=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6298\u7EBF\u56FE"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth,c=l,u=(o-c*2-l)/4,h=(o-c*2-l)/2,d=(0,G.CR)([n-o/2+c,i+o/2-c*2],2),f=d[0],v=d[1];ve(this.icon).maybeAppend(".coordinate","polyline").styles({points:dE(o).map(function(g){var p=(0,G.CR)(g,2),y=p[0],b=p[1];return[y+n,b+i]}),stroke:a,lineWidth:l}),ve(this.icon).maybeAppend(".line","polyline").styles({points:[[f,v],[f+u,v-h],[f+u*2,v],[f+u*4,v-h*2]],stroke:a,lineWidth:l})},t}(Gi),e4=function(r){(0,G.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6761\u5F62\u56FE"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.data,n=this.attributes,i=n.x,a=n.y,s=n.color,o=this,l=o.iconSize,c=o.lineWidth,u=c,h=(l-u)/e.length,d=(l-u*2)/4,f=(0,G.CR)([i-l/2+u*2,a+l/2-u],2),v=f[0],g=f[1];ve(this.icon).maybeAppend(".coordinate","polyline").styles({points:dE(l).map(function(p){var y=(0,G.CR)(p,2),b=y[0],w=y[1];return[b+i,w+a]}),stroke:s,lineWidth:c}),ve(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(function(p,y){return{value:p,index:y}})).join(function(p){return p.append("line").attr("className","column").style("x1",function(y){var b=y.index;return v+h*b}).style("y1",g).style("x2",function(y){var b=y.index;return v+h*b}).style("y2",function(y){var b=y.value;return g-d*b}).styles({y1:g,stroke:s,lineWidth:c})})},t}(Gi),n4=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},{style:{color:"#d8d9d9"}},e))||this;return n.showBackground=!1,n}return t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth;ve(this.icon).maybeAppend(".split","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:l})},t}(Gi),N0=function(r){(0,G.ZT)(t,r);function t(){var e=r.apply(this,(0,G.ev)([],(0,G.CR)(arguments),!1))||this;return e.showBackground=!1,e}return Object.defineProperty(t.prototype,"padding",{get:function(){return Er(0)},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.iconSize,n=this.attributes,i=n.x,a=n.y,s=n.speed,o=s===void 0?1:s,l=Zv(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),c=kn(e,20,1/0),u=20,h=(0,G.pi)((0,G.pi)({},l),{x:i-c/2,y:a-u/2,width:c,height:u,defaultValue:o,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:e/5,placeholderFontSize:e/2,optionPadding:0,optionLabelFontSize:e/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});ve(this.icon).maybeAppend(".speed",function(){return new Y5({style:h})}).attr("className","speed").each(function(){this.update(h)})},t.tag="SpeedSelect",t}(Gi),k0=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e)||this;return n.icon=n.appendChild(new ir({})),n.currentType=n.attributes.type,n}return t.prototype.getType=function(){return this.currentType},t.prototype.render=function(){var e=this,n=this.attributes,i=n.onChange,a=(0,G._T)(n,["onChange"]);ve(this.icon).selectAll(".icon").data([this.currentType]).join(function(s){return s.append(function(o){var l,c=(l=e.toggles.find(function(u){var h=(0,G.CR)(u,1),d=h[0];return d===o}))===null||l===void 0?void 0:l[1];if(!c)throw new Error("Invalid type: ".concat(o));return new c({})}).attr("className","icon").styles(a,!1).update({})},function(s){return s.styles({restStyles:a}).update({})},function(s){return s.remove()})},t.prototype.bindEvents=function(){var e=this,n=this.attributes.onChange;this.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation();var a=(e.toggles.findIndex(function(o){var l=(0,G.CR)(o,1),c=l[0];return c===e.currentType})+1)%e.toggles.length,s=e.toggles[a][0];n==null||n(e.currentType),e.currentType=s,e.render()})},t.tag="ToggleIcon",t}(Ln),P0=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},{style:{type:"play"}},e))||this;return n.toggles=[["play",Q5],["pause",q5]],n}return t}(k0),R0=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},{style:{type:"range"}},e))||this;return n.toggles=[["range",J5],["value",$5]],n}return t}(k0),L0=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},{style:{type:"column"}},e))||this;return n.toggles=[["line",t4],["column",e4]],n}return t}(k0),r4={reset:H5,speed:N0,backward:X5,playPause:P0,forward:K5,selectionType:R0,chartType:L0,split:n4},i4=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},t.defaultOptions,e))||this;return n.background=n.appendChild(new pr({})),n.functions=n.appendChild(new ir({})),n}return Object.defineProperty(t.prototype,"padding",{get:function(){return Er(this.attributes.padding)},enumerable:!1,configurable:!0}),t.prototype.renderBackground=function(){var e=this.style,n=e.x,i=e.y,a=e.width,s=e.height,o=Ne(this.attributes,"background");this.background.attr((0,G.pi)({x:n,y:i,width:a,height:s},o))},t.prototype.renderFunctions=function(){var e=this,n,i=this.attributes,a=i.functions,s=i.iconSize,o=i.iconSpacing,l=i.x,c=i.y,u=i.width,h=i.height,d=i.align,f=(0,G.CR)(this.padding,4),v=f[1],g=f[3],p=a.reduce(function(w,O){return w.length&&O.length?w.concat.apply(w,(0,G.ev)(["split"],(0,G.CR)(O),!1)):w.concat.apply(w,(0,G.ev)([],(0,G.CR)(O),!1))},[]),y=p.length*(s+o)-o,b={left:g+s/2,center:(u-y)/2+s/2,right:u-y-g-v+s/2}[d]||0;(n=this.speedSelect)===null||n===void 0||n.destroy(),this.functions.removeChildren(),p.forEach(function(w,O){var _,F=r4[w],W={x:l+O*(s+o)+b,y:c+h/2,size:s};if(F===N0?(W.speed=e.attributes.speed,W.onSelect=function(H){return e.handleFunctionChange(w,{value:H})}):[P0,R0,L0].includes(F)?(W.onChange=function(H){return e.handleFunctionChange(w,{value:H})},F===P0&&(W.type=e.attributes.state==="play"?"pause":"play"),F===R0&&(W.type=e.attributes.selectionType==="range"?"value":"range"),F===L0&&(W.type=e.attributes.chartType==="line"?"column":"line")):W.onClick=function(){return e.handleFunctionChange(w,{value:w})},F===N0){var j=(_=e.ownerDocument)===null||_===void 0?void 0:_.defaultView;j&&(e.speedSelect=new F({style:(0,G.pi)((0,G.pi)({},W),{zIndex:100})}),j.appendChild(e.speedSelect))}else e.functions.appendChild(new F({style:W}))})},t.prototype.disconnectedCallback=function(){var e;r.prototype.disconnectedCallback.call(this),(e=this.speedSelect)===null||e===void 0||e.destroy()},t.prototype.render=function(){this.renderBackground(),this.renderFunctions()},t.prototype.handleFunctionChange=function(e,n){var i=this.attributes.onChange;i==null||i(e,n)},t.defaultOptions={style:{x:0,y:0,width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}},t}(Ln),a4=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},t.defaultOptions,e))||this;return n.bindEvents(),n}return t.prototype.bindEvents=function(){var e=this;this.addEventListener("mouseenter",function(){e.attr("lineWidth",Math.ceil(+(e.style.r||0)/2))}),this.addEventListener("mouseleave",function(){e.attr("lineWidth",0)})},t.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},t}(Ji),s4=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,Jn({},t.defaultOptions,e))||this}return t.prototype.renderBackground=function(){var e=this.attributes,n=e.x,i=e.y,a=e.width,s=e.height,o=Ne(this.attributes,"background");ve(this).maybeAppend("background","rect").attr("className","background").styles((0,G.pi)({x:n-a/2,y:i-s/2,width:a,height:s},o))},t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.iconSize,s=Ne(this.attributes,"icon"),o=1,l=a/2;ve(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles((0,G.pi)({x1:n-o,y1:i-l,x2:n-o,y2:i+l},s)),ve(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles((0,G.pi)({x1:n+o,y1:i-l,x2:n+o,y2:i+l},s))},t.prototype.renderBorder=function(){var e=this.attributes,n=e.x,i=e.y,a=e.width,s=e.height,o=e.type,l=Ne(this.attributes,"border"),c=o==="start"?+a/2:-a/2;ve(this).maybeAppend("border","line").attr("className","border").styles((0,G.pi)({x1:c+n,y1:i-s/2,x2:c+n,y2:i+s/2},l))},t.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},t.defaultOptions={style:{x:0,y:0,width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}},t}(Ln);function o4(r,t){return typeof r=="number"?fE(r):l4(r,t)}function l4(r,t){var e=new Date(r);switch(t){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(e.getHours())&&e.getMinutes()===0?zr(e,`HH:mm
YYYY-MM-DD`):zr(e,"HH:mm");case"half-day":return e.getHours()<12?`AM
`.concat(zr(e,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(e.getDate())?zr(e,`DD
YYYY-MM`):zr(e,"DD");case"week":return e.getDate()<=7?zr(e,`DD
YYYY-MM`):zr(e,"DD");case"month":return[0,6].includes(e.getMonth())?zr(e,`MM\u6708
YYYY`):zr(e,"MM\u6708");case"season":return[0].includes(e.getMonth())?zr(e,`MM\u6708
YYYY`):zr(e,"MM\u6708");case"year":return zr(e,"YYYY");default:return zr(e,"YYYY-MM-DD HH:mm")}}function fE(r){var t=String(Math.floor(r/3600)).padStart(2,"0"),e=String(Math.floor(r%3600/60)).padStart(2,"0"),n=String(Math.floor(r%60)).padStart(2,"0");return r<3600?"".concat(e,":").concat(n):"".concat(t,":").concat(e,":").concat(n)}var c4=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,Jn({},t.defaultOptions,e))||this;n.axis=n.appendChild(new s5({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),n.timeline=n.appendChild(new W5({style:{onChange:function(h){n.handleSliderChange(h)}}})),n.controller=n.appendChild(new i4({})),n.states={},n.handleSliderChange=function(h){var d=function(){var f=n.states.values;return Array.isArray(f)?(0,G.ev)([],(0,G.CR)(f),!1):f}();n.setBySliderValues(h),n.dispatchOnChange(d)};var i=n.attributes,a=i.selectionType,s=i.chartType,o=i.speed,l=i.state,c=i.playMode,u=i.values;return n.states={chartType:s,playMode:c,selectionType:a,speed:o,state:l},n.setByTimebarValues(u),n}return Object.defineProperty(t.prototype,"data",{get:function(){var e=this.attributes.data,n=function(i,a){return i.time<a.time?-1:i.time>a.time?1:0};return e.sort(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"space",{get:function(){var e=this.attributes,n=e.x,i=e.y,a=e.width,s=e.height,o=e.type,l=e.controllerHeight,c=kn(+s-l,0,+s),u=new kr(n,i+ +s-l,+a,l),h,d=0;o==="chart"?(d=35,h=new kr(n,i+c-d,+a,d)):h=new kr;var f=o==="time"?10:c,v=new kr(n,i+(o==="time"?c:c-f),+a,f-d);return{axisBBox:h,controllerBBox:u,timelineBBox:v}},enumerable:!1,configurable:!0}),t.prototype.setBySliderValues=function(e){var n,i,a=this.data,s=(0,G.CR)(Array.isArray(e)?e:[0,e],2),o=s[0],l=s[1],c=a.length,u=a[Math.floor(o*c)],h=a[Math.ceil(l*c)-(Array.isArray(e)?0:1)];this.states.values=[(n=u==null?void 0:u.time)!==null&&n!==void 0?n:a[0].time,(i=h==null?void 0:h.time)!==null&&i!==void 0?i:1/0]},t.prototype.setByTimebarValues=function(e){var n,i,a,s=this.data,o=(0,G.CR)(Array.isArray(e)?e:[void 0,e],2),l=o[0],c=o[1],u=s.find(function(d){var f=d.time;return f===l}),h=s.find(function(d){var f=d.time;return f===c});this.states.values=[(n=u==null?void 0:u.time)!==null&&n!==void 0?n:(i=s[0])===null||i===void 0?void 0:i.time,(a=h==null?void 0:h.time)!==null&&a!==void 0?a:1/0]},t.prototype.setByIndex=function(e){var n,i,a,s,o=this.data,l=(0,G.CR)(e,2),c=l[0],u=l[1];this.states.values=[(i=(n=o[c])===null||n===void 0?void 0:n.time)!==null&&i!==void 0?i:o[0].time,(s=(a=this.data[u])===null||a===void 0?void 0:a.time)!==null&&s!==void 0?s:1/0]},Object.defineProperty(t.prototype,"sliderValues",{get:function(){var e=this.states,n=e.values,i=e.selectionType,a=(0,G.CR)(Array.isArray(n)?n:[void 0,n],2),s=a[0],o=a[1],l=this.data,c=l.length,u=i==="value",h=function(){var f=l.findIndex(function(v){var g=v.time;return g===s});return u?0:f>-1?f/c:0},d=function(){if(o===1/0)return 1;var f=l.findIndex(function(v){var g=v.time;return g===o});return f>-1?f/c:u?.5:1};return[h(),d()]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var e=this.states,n=e.values,i=e.selectionType,a=(0,G.CR)(Array.isArray(n)?n:[this.data[0].time,n],2),s=a[0],o=a[1];return i==="value"?o:[s,o]},enumerable:!1,configurable:!0}),t.prototype.getDatumByRatio=function(e){var n=this.data,i=n.length,a=Math.floor(e*(i-1));return n[a]},Object.defineProperty(t.prototype,"chartHandleIconShape",{get:function(){var e=this.states.selectionType,n=this.space.timelineBBox.height;return e==="range"?function(i){return new s4({style:{type:i,height:n,iconSize:n/6}})}:function(){return new As({style:{x1:0,y1:-n/2,x2:0,y2:n/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),t.prototype.getChartStyle=function(e){var n=this,i=e.x,a=e.y,s=e.width,o=e.height,l=this.states,c=l.selectionType,u=l.chartType,h=this.data,d=this.attributes,f=d.type,v=d.labelFormatter,g=Ne(this.attributes,"chart"),p=g.type,y=(0,G._T)(g,["type"]),b=c==="range";if(f==="time")return(0,G.pi)({handleIconShape:function(){return new a4({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:b?-15:0,autoFitLabel:b,handleSpacing:b?-15:0,trackFill:"#edeeef",trackLength:s,trackOpacity:.5,trackRadius:o/2,trackSize:o/2,type:c,values:this.sliderValues,formatter:function(_){if(v)return v(_);var F=n.getDatumByRatio(_).time;return typeof F=="number"?fE(F):zr(F,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y);var w=c==="range"?5:0,O=h.map(function(_){var F=_.value;return F});return(0,G.pi)({handleIconOffset:w,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:O,sparklineType:u,sparklineScale:.8,trackLength:s,trackSize:o,type:c,values:this.sliderValues,transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y)},t.prototype.renderChart=function(e){e===void 0&&(e=this.space.timelineBBox),this.timeline.update(this.getChartStyle(e))},t.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},t.prototype.getAxisStyle=function(e){var n=this.data,i=this.attributes,a=i.interval,s=i.labelFormatter,o=Ne(this.attributes,"axis"),l=e.x,c=e.y,u=e.width,h=(0,G.ev)((0,G.ev)([],(0,G.CR)(n),!1),[{time:0}],!1).map(function(f,v,g){var p=f.time;return{label:"".concat(p),value:v/(g.length-1),time:p}}),d=(0,G.pi)({startPos:[l,c],endPos:[l+u,c],data:h,labelFilter:function(f,v){return v<h.length-1},labelFormatter:function(f){var v=f.time;return s?s(v):o4(v,a)}},o);return d},t.prototype.renderAxis=function(e){e===void 0&&(e=this.space.axisBBox);var n=this.attributes.type;n==="chart"&&this.axis.update(this.getAxisStyle(e))},t.prototype.renderController=function(e){e===void 0&&(e=this.space.controllerBBox);var n=this.attributes.type,i=this.states,a=i.state,s=i.speed,o=i.selectionType,l=i.chartType,c=Ne(this.attributes,"controller"),u=this,h=(0,G.pi)((0,G.pi)((0,G.pi)({},e),{iconSize:20,speed:s,state:a,selectionType:o,chartType:l,onChange:function(d,f){var v=f.value;switch(d){case"reset":u.internalReset();break;case"speed":u.handleSpeedChange(v);break;case"backward":u.internalBackward();break;case"playPause":v==="play"?u.internalPlay():u.internalPause();break;case"forward":u.internalForward();break;case"selectionType":u.handleSelectionTypeChange(v);break;case"chartType":u.handleChartTypeChange(v);break;default:break}}}),c);n==="time"&&(h.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(h)},t.prototype.dispatchOnChange=function(e){var n=this.data,i=this.attributes.onChange,a=this.states,s=a.values,o=a.selectionType,l=(0,G.CR)(s,2),c=l[0],u=l[1],h=u===1/0?n.at(-1).time:u,d=o==="range"?[c,h]:h,f=function(v,g){return Array.isArray(v)?Array.isArray(g)?v[0]===g[0]&&(v[1]===g[1]||v[1]===1/0||g[1]===1/0):!1:Array.isArray(g)?!1:v===g};(!e||!f(e,d))&&(i==null||i(o==="range"?[c,h]:h))},t.prototype.internalReset=function(e){var n,i,a=this.states.selectionType;this.internalPause(),this.setBySliderValues(a==="range"?[0,1]:[0,0]),this.renderController(),this.updateSelection(),e||((i=(n=this.attributes)===null||n===void 0?void 0:n.onReset)===null||i===void 0||i.call(n),this.dispatchOnChange())},t.prototype.reset=function(){this.internalReset()},t.prototype.moveSelection=function(e,n){var i=this.data,a=i.length,s=this.states,o=s.values,l=s.selectionType,c=s.playMode,u=(0,G.CR)(o,2),h=u[0],d=u[1],f=i.findIndex(function(w){var O=w.time;return O===h}),v=i.findIndex(function(w){var O=w.time;return O===d});v===-1&&(v=a);var g=e==="backward"?-1:1,p;l==="range"?c==="acc"?(p=[f,v+g],g===-1&&f===v&&(p=[f,a])):p=[f+g,v+g]:p=[f,v+g];var y=function(w){var O=(0,G.CR)(w.sort(function(j,H){return j-H}),2),_=O[0],F=O[1],W=function(j){return kn(j,0,a)};return F>a?l==="value"?[0,0]:c==="acc"?[W(_),W(_)]:[0,W(F-_)]:_<0?c==="acc"?[0,W(F)]:[W(_+a-F),a]:[W(_),W(F)]},b=y(p);return this.setByIndex(b),this.updateSelection(),b},t.prototype.internalBackward=function(e){var n,i,a=this.moveSelection("backward",e);return e||((i=(n=this.attributes)===null||n===void 0?void 0:n.onBackward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},t.prototype.backward=function(){this.internalBackward()},t.prototype.internalPlay=function(e){var n=this,i,a,s=this.data,o=this.attributes.loop,l=this.states.speed,c=l===void 0?1:l;this.playInterval=window.setInterval(function(){var u=n.internalForward();u[1]===s.length&&!o&&(n.internalPause(),n.renderController())},1e3/c),this.states.state="play",!e&&((a=(i=this.attributes)===null||i===void 0?void 0:i.onPlay)===null||a===void 0||a.call(i))},t.prototype.play=function(){this.internalPlay()},t.prototype.internalPause=function(e){var n,i;clearInterval(this.playInterval),this.states.state="pause",!e&&((i=(n=this.attributes)===null||n===void 0?void 0:n.onPause)===null||i===void 0||i.call(n))},t.prototype.pause=function(){this.internalPause()},t.prototype.internalForward=function(e){var n,i,a=this.moveSelection("forward",e);return e||((i=(n=this.attributes)===null||n===void 0?void 0:n.onForward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},t.prototype.forward=function(){this.internalForward()},t.prototype.handleSpeedChange=function(e){var n,i;this.states.speed=e;var a=this.states.state;a==="play"&&(this.internalPause(!0),this.internalPlay(!0)),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSpeedChange)===null||i===void 0||i.call(n,e)},t.prototype.handleSelectionTypeChange=function(e){var n,i;this.states.selectionType=e,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSelectionTypeChange)===null||i===void 0||i.call(n,e)},t.prototype.handleChartTypeChange=function(e){var n,i;this.states.chartType=e,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onChartTypeChange)===null||i===void 0||i.call(n,e)},t.prototype.render=function(){var e=this.space,n=e.axisBBox,i=e.controllerBBox,a=e.timelineBBox;this.renderController(i),this.renderAxis(n),this.renderChart(a),this.states.state==="play"&&this.internalPlay()},t.prototype.destroy=function(){r.prototype.destroy.call(this),this.internalPause(!0)},t.defaultOptions={style:{x:0,y:0,axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}},t}(Ln);function u4(r){return r instanceof Date}var h4=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},d4=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const f4=["timestamp","time","date","datetime"];class Vh extends xr{get padding(){return Ri(this.options.padding)}constructor(t,e){super(t,Object.assign({},Vh.defaultOptions,e)),this.backup(),this.upsertTimebar()}play(){var t;(t=this.timebar)===null||t===void 0||t.play()}pause(){var t;(t=this.timebar)===null||t===void 0||t.pause()}forward(){var t;(t=this.timebar)===null||t===void 0||t.forward()}backward(){var t;(t=this.timebar)===null||t===void 0||t.backward()}reset(){var t;(t=this.timebar)===null||t===void 0||t.reset()}update(t){super.update(t),this.backup(),this.upsertTimebar()}backup(){this.originalData=vE(this.context.graph.getData())}upsertTimebar(){const{canvas:t}=this.context,e=this.options,{onChange:n,timebarType:i,data:a,x:s,y:o,width:l,height:c,mode:u}=e,h=d4(e,["onChange","timebarType","data","x","y","width","height","mode"]),d=t.getSize(),[f]=this.padding;this.upsertCanvas().ready.then(()=>{var v;const g=Object.assign(Object.assign({x:d[0]/2-l/2,y:f,onChange:p=>{const y=(Gr(p)?p:[p,p]).map(b=>u4(b)?b.getTime():b);this.options.mode==="modify"?this.filterElements(y):this.hiddenElements(y),n==null||n(y)}},h),{data:a.map(p=>ie(p)?{time:p,value:0}:p),width:l,height:c,type:i});this.timebar?this.timebar.update(g):(this.timebar=new c4({style:g}),(v=this.canvas)===null||v===void 0||v.appendChild(this.timebar))})}upsertCanvas(){if(this.canvas)return this.canvas;const{className:t,height:e,position:n}=this.options,i=this.context.canvas,[a]=i.getSize(),[s,,o]=this.padding,[l,c]=i0({width:a,height:e+s+o,graphCanvas:i,className:"timebar",placement:n});return this.container=l,t&&l.classList.add(t),this.canvas=c,this.canvas}filterElements(t){return h4(this,void 0,void 0,function*(){var e;if(!this.originalData)return;const{elementTypes:n,getTime:i}=this.options,{graph:a,element:s}=this.context,o=vE(this.originalData);n.forEach(c=>{const u=`${c}s`;o[u]=(this.originalData[u]||[]).filter(h=>{const d=i(h);return!!gE(d,t)})});const l=[...o.nodes,...o.combos].map(c=>At(c));o.edges=o.edges.filter(c=>{const u=c.source,h=c.target;return l.includes(u)&&l.includes(h)}),a.setData(o),yield(e=s.draw({animation:!1,silence:!0}))===null||e===void 0?void 0:e.finished})}hiddenElements(t){const{graph:e}=this.context,{elementTypes:n,getTime:i}=this.options,a=[],s=[];n.forEach(o=>{var l;const c=`${o}s`;(((l=this.originalData)===null||l===void 0?void 0:l[c])||[]).forEach(h=>{const d=At(h),f=i(h);gE(f,t)?s.push(d):a.push(d)})}),e.hideElement(a,!1),e.showElement(s,!1)}destroy(){var t,e,n;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),(t=this.timebar)===null||t===void 0||t.destroy(),(e=this.canvas)===null||e===void 0||e.destroy(),(n=this.container)===null||n===void 0||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}Vh.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:r=>v4(r,f4,void 0),loop:!1};const vE=r=>{const{nodes:t=[],edges:e=[],combos:n=[]}=r;return{nodes:[...t],edges:[...e],combos:[...n]}},gE=(r,t)=>{if(ie(t))return r===t;const[e,n]=t;return r>=e&&r<=n},v4=(r,t,e)=>{var n;for(let i=0;i<t.length;i++){const a=t[i],s=(n=r.data)===null||n===void 0?void 0:n[a];if(s)return s}return e};function g4(r){const t={top:"unset",right:"unset",bottom:"unset",left:"unset"};return r.split("-").forEach(n=>{t[n]="8px"}),t.flexDirection=r.startsWith("top")||r.startsWith("bottom")?"row":"column",t}const p4=`
.g6-toolbar {
position: absolute;
z-index: 100;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 4px;
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
opacity: 0.65;
}
.g6-toolbar .g6-toolbar-item {
display: inline-block;
width: 16px;
height: 16px;
padding: 4px;
cursor: pointer;
box-sizing: content-box;
}
.g6-toolbar .g6-toolbar-item:hover {
background-color: #f0f0f0;
}
.g6-toolbar .g6-toolbar-item svg {
display: inline-block;
width: 100%;
height: 100%;
pointer-events: none;
}
`,m4=`
<svg>
<symbol id="zoom-in" viewBox="64 64 896 896">
<path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
</symbol>
<symbol id="zoom-out" viewBox="64 64 896 896">
<path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
</symbol>
<symbol id="edit" viewBox="64 64 896 896">
<path d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"></path>
</symbol>
<symbol id="delete" viewBox="64 64 896 896">
<path d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"></path>
</symbol>
<symbol id="redo" viewBox="64 64 896 896">
<path d="M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"></path>
</symbol>
<symbol id="undo" viewBox="64 64 896 896">
<path d="M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"></path>
</symbol>
<symbol id="export" viewBox="64 64 896 896">
<path d="M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"></path>
</symbol>
<symbol id="auto-fit" viewBox="64 64 896 896">
<path d="M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"></path>
<path d="M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"></path>
</symbol>
<symbol id="reset" viewBox="64 64 896 896">
<path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"></path>
</symbol>
<symbol id="exit-fullscreen" viewBox="0 0 1024 1024">
<path d="M418.13333333 361.43786666c0 0.2048-0.13653333 0.4096-0.13653334 0.68266667C417.99679999 362.32533333 418.13333333 362.53013333 418.13333333 362.73493333 418.13333333 371.54133333 414.44693333 379.392 408.78079999 385.39946666 408.43946666 385.7408 408.30293333 386.21866666 408.02986666 386.49173333c-1.09226667 1.09226667-2.59413333 1.77493333-3.82293333 2.73066667C398.40426666 393.65973333 391.64586666 396.8 383.93173333 396.8 383.72693333 396.8 383.59039999 396.73173333 383.38559999 396.73173333S382.97599999 396.8 382.77119999 396.8L112.29866666 396.8C92.50133333 396.8 76.79999999 381.50826666 76.79999999 362.66666666 76.66346666 343.89333333 92.63786666 328.53333333 112.16213333 328.53333333l189.44 0L87.44959999 114.51733333C73.59146666 100.59093333 73.25013333 78.5408 86.63039999 65.29706666c13.17546667-13.44853333 35.36213333-12.97066667 49.152 0.88746667l214.08426667 214.08426667L349.86666666 90.89706666C349.79839999 71.23626666 365.22666666 55.46666666 383.99999999 55.46666666 402.77333333 55.33013333 418.13333333 71.30453333 418.13333333 90.8288L418.13333333 361.43786666zM928.90453333 328.53333333l-189.44 0 214.15253333-214.08426667c13.85813333-13.9264 14.19946667-35.90826667 0.88746667-49.22026666-13.17546667-13.44853333-35.36213333-12.97066667-49.152 0.88746666l-214.08426667 214.08426667L691.26826666 90.89706666C691.26826666 71.23626666 675.83999999 55.46666666 657.06666666 55.46666666 638.29333333 55.33013333 622.93333333 71.30453333 622.93333333 90.8288l0 270.60906666c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 362.32533333 622.93333333 362.53013333 622.93333333 362.73493333 622.93333333 371.54133333 626.61973333 379.392 632.28586666 385.39946666c0.34133333 0.34133333 0.47786667 0.8192 0.8192 1.09226667 1.09226667 1.09226667 2.59413333 1.77493333 3.8912 2.73066667C642.66239999 393.65973333 649.42079999 396.8 657.13493333 396.8c0.2048 0 0.34133333-0.06826667 0.54613333-0.06826667S658.09066666 396.8 658.29546666 396.8l270.5408 0C948.56533333 396.8 964.26666666 381.50826666 964.26666666 362.66666666 964.40319999 343.89333333 948.42879999 328.53333333 928.90453333 328.53333333zM418.13333333 635.73333333c0-8.8064-3.6864-16.5888-9.35253334-22.66453333C408.43946666 612.72746666 408.30293333 612.2496 408.02986666 611.90826666 406.86933333 610.88426666 405.43573333 610.2016 404.20693333 609.24586666 398.47253333 604.80853333 391.64586666 601.6 383.93173333 601.6 383.72693333 601.6 383.59039999 601.73653333 383.38559999 601.73653333S382.97599999 601.6 382.77119999 601.6L112.29866666 601.6C92.50133333 601.6 76.79999999 616.96 76.79999999 635.73333333 76.66346666 654.50666666 92.63786666 669.86666666 112.16213333 669.86666666l189.44 0-214.15253334 214.15253334c-13.85813333 13.85813333-14.19946667 35.84-0.88746666 49.22026666 13.17546667 13.44853333 35.36213333 12.9024 49.152-0.95573333l214.08426666-214.08426667 0 189.37173334c0 19.59253333 15.42826667 35.49866667 34.2016 35.36213333C402.77333333 943.2064 418.13333333 927.232 418.13333333 907.5712L418.13333333 637.09866666c0-0.27306667-0.13653333-0.47786667-0.13653334-0.68266666C417.99679999 636.14293333 418.13333333 635.93813333 418.13333333 635.73333333zM739.46453333 669.86666666l189.44 0c19.456 0 35.49866667-15.36 35.36213333-34.13333333C964.26666666 616.96 948.56533333 601.6 928.76799999 601.6L658.29546666 601.6C658.09066666 601.6 657.88586666 601.73653333 657.68106666 601.73653333S657.33973333 601.6 657.13493333 601.6C649.42079999 601.6 642.59413333 604.80853333 636.85973333 609.24586666 635.63093333 610.2016 634.19733333 610.88426666 633.03679999 611.90826666 632.76373333 612.2496 632.62719999 612.72746666 632.28586666 613.0688 626.61973333 619.14453333 622.93333333 626.92693333 622.93333333 635.73333333c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 636.6208 622.93333333 636.8256 622.93333333 637.09866666l0 270.5408C622.93333333 927.232 638.29333333 943.2064 657.06666666 942.93333333c18.77333333 0.13653333 34.2016-15.70133333 34.2016-35.36213333l0-189.37173334 214.08426667 214.08426667c13.78986667 13.85813333 35.90826667 14.40426667 49.152 0.95573333 13.312-13.312 12.97066667-35.36213333-0.88746667-49.22026666L739.46453333 669.86666666z" ></path></symbol>
<symbol id="request-fullscreen" viewBox="0 0 1024 1024">
<path d="M69.818182 87.598545v273.128728a34.909091 34.909091 0 0 0 69.818182 0V163.653818l221.928727 222.021818a33.512727 33.512727 0 0 0 47.383273-47.383272L186.926545 116.363636h197.073455a34.909091 34.909091 0 0 0 0-69.818181H110.871273C85.364364 46.545455 69.818182 59.671273 69.818182 87.598545zM938.542545 46.545455H665.413818a34.909091 34.909091 0 0 0 0 69.818181h197.073455L640.465455 338.292364a33.512727 33.512727 0 0 0 47.383272 47.383272l221.928728-222.021818v197.073455a34.909091 34.909091 0 0 0 69.818181 0V87.598545c0-27.927273-15.453091-41.053091-40.96-41.05309z m-827.671272 907.636363h273.128727a34.909091 34.909091 0 0 0 0-69.818182H186.926545l222.021819-221.928727a33.512727 33.512727 0 0 0-47.383273-47.383273L139.636364 837.073455V640a34.909091 34.909091 0 0 0-69.818182 0v273.128727c0 27.927273 15.546182 41.053091 41.053091 41.053091z m868.724363-41.053091V640a34.909091 34.909091 0 0 0-69.818181 0v197.073455L687.941818 615.051636a33.512727 33.512727 0 0 0-47.383273 47.383273L862.487273 884.363636H665.413818a34.909091 34.909091 0 0 0 0 69.818182h273.128727c25.6 0 41.053091-13.125818 41.053091-41.053091z" ></path></symbol>
</svg>
`;var pE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Uh extends xr{constructor(t,e){super(t,Object.assign({},Uh.defaultOptions,e)),this.$element=So("toolbar",!1),this.onToolbarItemClick=i=>{const{onClick:a}=this.options;if(i.target instanceof Element&&i.target.className.includes("g6-toolbar-item")){const s=i.target.getAttribute("value");a==null||a(s,i.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),Wv("g6-toolbar-css","style",{},p4,document.head),Wv("g6-toolbar-svgicon","div",{display:"none"},m4),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return pE(this,void 0,void 0,function*(){e.update.call(this,t);const{className:n,position:i,style:a}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,a,g4(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return pE(this,void 0,void 0,function*(){return(yield this.options.getItems()).map(e=>{var n;return`
<div class="g6-toolbar-item" value="${e.value}" title="${(n=e.title)!==null&&n!==void 0?n:""}">
<svg aria-hidden="true" focusable="false">
<use xlink:href="#${e.id}"></use>
</svg>
</div>`}).join("")})}}Uh.defaultOptions={position:"top-left"};function D0(r){var t=document.createElement("div");t.innerHTML=r;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function y4(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var b4=y4,mE=function(r,t){if(t==null){r.innerHTML="";return}r.replaceChildren?Array.isArray(t)?r.replaceChildren.apply(r,(0,G.ev)([],(0,G.CR)(t),!1)):r.replaceChildren(t):(r.innerHTML="",Array.isArray(t)?t.forEach(function(e){return r.appendChild(e)}):r.appendChild(t))};function _0(r){return r===void 0&&(r=""),{CONTAINER:"".concat(r,"tooltip"),TITLE:"".concat(r,"tooltip-title"),LIST:"".concat(r,"tooltip-list"),LIST_ITEM:"".concat(r,"tooltip-list-item"),NAME:"".concat(r,"tooltip-list-item-name"),MARKER:"".concat(r,"tooltip-list-item-marker"),NAME_LABEL:"".concat(r,"tooltip-list-item-name-label"),VALUE:"".concat(r,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(r,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(r,"tooltip-crosshair-y")}}var yE={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function x4(r){var t;r===void 0&&(r="");var e=_0(r);return t={},t[".".concat(e.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},t[".".concat(e.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},t[".".concat(e.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},t[".".concat(e.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},t[".".concat(e.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},t[".".concat(e.NAME)]={display:"flex","align-items":"center","max-width":"216px"},t[".".concat(e.NAME_LABEL)]=(0,G.pi)({flex:1},yE),t[".".concat(e.VALUE)]=(0,G.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},yE),t[".".concat(e.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t[".".concat(e.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t}var E4=function(r){(0,G.ZT)(t,r);function t(e){var n=this,i,a,s=(a=(i=e.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,o=_0(s);return n=r.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,`" data-index={index}>
<span class="`).concat(o.NAME,`">
<span class="`).concat(o.MARKER,`" style="background:{color}"></span>
<span class="`).concat(o.NAME_LABEL,`" title="{name}">{name}</span>
</span>
<span class="`).concat(o.VALUE,`" title="{value}">{value}</span>
</li>`)},style:x4(s)})||this,n.timestamp=-1,n.prevCustomContentKey=n.attributes.contentKey,n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(t.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.element},Object.defineProperty(t.prototype,"elementSize",{get:function(){var e=this.element.offsetWidth,n=this.element.offsetHeight;return{width:e,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HTMLTooltipItemsElements",{get:function(){var e=this.attributes,n=e.data,i=e.template;return n.map(function(a,s){var o=a.name,l=o===void 0?"":o,c=a.color,u=c===void 0?"black":c,h=a.index,d=(0,G._T)(a,["name","color","index"]),f=(0,G.pi)({name:l,color:u,index:h!=null?h:s},d);return D0(b4(i.item,f))})},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){this.renderHTMLTooltipElement(),this.updatePosition()},t.prototype.destroy=function(){var e;(e=this.element)===null||e===void 0||e.remove(),r.prototype.destroy.call(this)},t.prototype.show=function(e,n){var i=this;if(e!==void 0&&n!==void 0){var a=this.element.style.visibility==="hidden",s=function(){i.attributes.x=e!=null?e:i.attributes.x,i.attributes.y=n!=null?n:i.attributes.y,i.updatePosition()};a?this.closeTransition(s):s()}this.element.style.visibility="visible"},t.prototype.hide=function(e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=this.attributes.enterable;i&&this.isCursorEntered(e,n)||(this.element.style.visibility="hidden")},t.prototype.initShape=function(){var e=this.attributes.template;this.element=D0(e.container),this.id&&this.element.setAttribute("id",this.id)},t.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var e=this.attributes.content;e&&(typeof e=="string"?this.element.innerHTML=e:mE(this.element,e))}},t.prototype.renderHTMLTooltipElement=function(){var e,n,i=this.attributes,a=i.template,s=i.title,o=i.enterable,l=i.style,c=i.content,u=_0(a.prefixCls),h=this.element;if(this.element.style.pointerEvents=o?"auto":"none",c)this.renderCustomContent();else{s?(h.innerHTML=a.title,h.getElementsByClassName(u.TITLE)[0].innerHTML=s):(n=(e=h.getElementsByClassName(u.TITLE))===null||e===void 0?void 0:e[0])===null||n===void 0||n.remove();var d=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=u.LIST,mE(f,d);var v=this.element.querySelector(".".concat(u.LIST));v?v.replaceWith(f):h.appendChild(f)}z_(h,l)},t.prototype.getRelativeOffsetFromCursor=function(e){var n=this.attributes,i=n.position,a=n.offset,s=e||i,o=s.split("-"),l={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},c=this.elementSize,u=c.width,h=c.height,d=[-u/2,-h/2];return o.forEach(function(f){var v=(0,G.CR)(d,2),g=v[0],p=v[1],y=(0,G.CR)(l[f],2),b=y[0],w=y[1];d=[g+(u/2+a[0])*b,p+(h/2+a[1])*w]}),d},t.prototype.setOffsetPosition=function(e){var n=(0,G.CR)(e,2),i=n[0],a=n[1],s=this.attributes,o=s.x,l=o===void 0?0:o,c=s.y,u=c===void 0?0:c,h=s.container,d=h.x,f=h.y;this.element.style.left="".concat(+l+d+i,"px"),this.element.style.top="".concat(+u+f+a,"px")},t.prototype.updatePosition=function(){var e=this.attributes.showDelay,n=e===void 0?60:e,i=Date.now();this.timestamp>0&&i-this.timestamp<n||(this.timestamp=i,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},t.prototype.autoPosition=function(e){var n=(0,G.CR)(e,2),i=n[0],a=n[1],s=this.attributes,o=s.x,l=s.y,c=s.bounding,u=s.position;if(!c)return[i,a];var h=this.element,d=h.offsetWidth,f=h.offsetHeight,v=(0,G.CR)([+o+i,+l+a],2),g=v[0],p=v[1],y={left:"right",right:"left",top:"bottom",bottom:"top"},b=c.x,w=c.y,O=c.width,_=c.height,F={left:g<b,right:g+d>b+O,top:p<w,bottom:p+f>w+_},W=[];u.split("-").forEach(function(H){F[H]?W.push(y[H]):W.push(H)});var j=W.join("-");return this.getRelativeOffsetFromCursor(j)},t.prototype.isCursorEntered=function(e,n){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,s=i.y,o=i.width,l=i.height;return new kr(a,s,o,l).isPointIn(e,n)}return!1},t.prototype.closeTransition=function(e){var n=this,i=this.element.style.transition;this.element.style.transition="none",e(),setTimeout(function(){n.element.style.transition=i},10)},t.tag="tooltip",t}(Ln),bE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Yh extends xr{constructor(t,e){super(t,Object.assign({},Yh.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=(n,i)=>{const{enable:a}=this.options;return typeof a=="function"?a(n,i):a},this.onClick=n=>{const{target:{id:i}}=n;this.currentTarget===i?this.hide(n):this.show(n)},this.onPointerMove=n=>{const{target:i}=n;!this.currentTarget||i.id===this.currentTarget||this.show(n)},this.onPointerLeave=n=>{this.hide(n)},this.onCanvasMove=n=>{this.hide(n)},this.onPointerOver=n=>{this.show(n)},this.showById=n=>bE(this,void 0,void 0,function*(){const i={target:{id:n}};yield this.show(i)}),this.getElementData=(n,i)=>{const{model:a}=this.context;switch(i){case"node":return a.getNodeData([n]);case"edge":return a.getEdgeData([n]);case"combo":return a.getComboData([n]);default:return[]}},this.show=n=>bE(this,void 0,void 0,function*(){var i,a;const{client:s,target:{id:o}}=n;if(Ol(n.target))return;const l=this.context.graph.getElementType(o),{getContent:c,title:u}=this.options,h=this.getElementData(o,l);if(!this.tooltipElement||!this.isEnable(n,h))return;let d={};if(c){if(d.content=yield c(n,h),!d.content)return}else{const g=this.context.graph.getElementRenderStyle(o),p=l==="node"?g.fill:g.stroke;d={title:u||l,data:h.map(y=>({name:"ID",value:y.id||`${y.source} -> ${y.target}`,color:p}))}}this.currentTarget=o;let f,v;if(s)f=s.x,v=s.y;else{const g=br(h,"0.style",{x:0,y:0});f=g.x,v=g.y}(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!0),this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:f,y:v,style:{".tooltip":{visibility:"visible"}}}),d))}),this.hide=n=>{var i,a,s,o,l;if(!n){(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!1),(s=this.tooltipElement)===null||s===void 0||s.hide(),this.currentTarget=null;return}if(!this.tooltipElement||!this.currentTarget)return;const{client:{x:c,y:u}}=n;(l=(o=this.options).onOpenChange)===null||l===void 0||l.call(o,!1),this.tooltipElement.hide(c,u),this.currentTarget=null},this.initTooltip=()=>{var n;const i=new E4({className:"tooltip",style:this.tooltipStyleProps});return(n=this.container)===null||n===void 0||n.appendChild(i.HTMLTooltipElement),i},this.render(),this.bindEvents()}getEvents(){return this.options.trigger==="click"?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerover":this.onPointerOver,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerover":this.onPointerOver,"edge:pointermove":this.onPointerMove,"combo:pointerover":this.onPointerOver,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(t){var e;this.unbindEvents(),super.update(t),this.tooltipElement&&((e=this.container)===null||e===void 0||e.removeChild(this.tooltipElement.HTMLTooltipElement)),this.tooltipElement=this.initTooltip(),this.bindEvents()}render(){const{canvas:t}=this.context,e=t.getContainer();e&&(this.container=e,this.tooltipElement=this.initTooltip())}unbindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach(n=>{t.off(n,e[n])})}bindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach(n=>{t.on(n,e[n])})}get tooltipStyleProps(){const{canvas:t}=this.context,{center:e}=t.getBounds(),n=t.getContainer(),{top:i,left:a}=n.getBoundingClientRect(),{style:s,position:o,enterable:l,container:c={x:-a,y:-i},title:u,offset:h}=this.options,[d,f]=e,[v,g]=t.getSize();return{x:d,y:f,container:c,title:u,bounding:{x:0,y:0,width:v,height:g},position:o,enterable:l,offset:h,style:s}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&((t=this.container)===null||t===void 0||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}Yh.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var xE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};let No;function EE(r,t){return No||(No=document.createElement("canvas")),No.width=r,No.height=t,No.getContext("2d").clearRect(0,0,r,t),No}function w4(r,t,e,n){return xE(this,void 0,void 0,function*(){const i=EE(r,t),a=i.getContext("2d"),{rotate:s,opacity:o,textFill:l,textFontSize:c,textFontFamily:u,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:v}=n;return a.textAlign=f,a.textBaseline=v,a.translate(r/2,t/2),a.font=`${c}px ${u} ${h} ${d}`,s&&a.rotate(s),o&&(a.globalAlpha=o),l&&(a.fillStyle=l,a.fillText(`${e}`,0,0)),i.toDataURL()})}function S4(r,t,e,n){return xE(this,void 0,void 0,function*(){const i=EE(r,t),a=i.getContext("2d"),{rotate:s,opacity:o}=n;s&&a.rotate(s),o&&(a.globalAlpha=o);const l=new Image;return l.crossOrigin="anonymous",l.src=e,new Promise(c=>{l.onload=function(){const u=r>l.width?(r-l.width)/2:0,h=t>l.height?(t-l.height)/2:0;a.drawImage(l,0,0,l.width,l.height,u,h,r-u*2,t-h*2),c(i.toDataURL())}})})}var M4=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},A4=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Hh extends xr{constructor(t,e){super(t,Object.assign({},Hh.defaultOptions,e)),this.$element=So("watermark"),this.context.canvas.getContainer().appendChild(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return M4(this,void 0,void 0,function*(){e.update.call(this,t);const n=this.options,{width:i,height:a,text:s,imageURL:o}=n,l=A4(n,["width","height","text","imageURL"]);Object.keys(l).forEach(u=>{u.startsWith("background")&&(this.$element.style[u]=t[u])});const c=o?yield S4(i,a,o,l):yield w4(i,a,s,l);this.$element.style.backgroundImage=`url(${c})`})}destroy(){super.destroy(),this.$element.remove()}}Hh.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};const T4=["#7E92B5","#F4664A","#FFBE3A"],O4={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},C4={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function wE(r){const{bgColor:t,textColor:e,nodeColor:n,nodeColorDisabled:i,nodeStroke:a,nodeHaloStrokeOpacityActive:s=.15,nodeHaloStrokeOpacitySelected:o=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:c=.85,nodeOpacityInactive:u=.25,nodeBadgePalette:h=T4,nodePaletteOptions:d=O4,edgeColor:f,edgeColorDisabled:v,edgePaletteOptions:g=C4,comboColor:p,comboColorDisabled:y,comboStroke:b,comboStrokeDisabled:w,edgeColorInactive:O}=r;return{background:t,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:n,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:e,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:n,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:o,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:s},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:u,donutOpacity:u,fillOpacity:u,iconOpacity:c,labelFill:e,labelFillOpacity:u,strokeOpacity:u},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:i,fillOpacity:l,iconFill:i,iconOpacity:.25,labelFill:e,labelFillOpacity:.25,strokeOpacity:l}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"node-expand",collapse:"node-collapse",update:[{fields:["x","y","fill","stroke"]}],translate:[{fields:["x","y"]}]}},edge:{palette:g,style:{badgeBackgroundFill:f,badgeFill:"#fff",badgeFontSize:8,badgeOffsetX:10,fillOpacity:1,halo:!1,haloLineWidth:12,haloStrokeOpacity:1,increasedLineWidthForHitTesting:2,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:e,labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelPlacement:"center",labelTextBaseline:"middle",lineWidth:1,stroke:f,strokeOpacity:1,zIndex:1},state:{selected:{halo:!0,haloStrokeOpacity:.25,labelFontSize:14,labelFontWeight:"bold",lineWidth:3},active:{halo:!0,haloStrokeOpacity:.15},highlight:{labelFontWeight:"bold",lineWidth:3},inactive:{stroke:O,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:v,fillOpacity:.45,strokeOpacity:.45,labelOpacity:.25,badgeBackgroundOpacity:.45}},animation:{enter:"fade",exit:"fade",expand:"path-in",collapse:"path-out",show:"fade",hide:"fade",update:[{fields:["sourceNode","targetNode"]},{fields:["stroke"],shape:"key"}],translate:[{fields:["sourceNode","targetNode"]}]}},combo:{style:{collapsedMarkerFill:t,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:p,halo:!1,haloLineWidth:12,haloStroke:b,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:e,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:b},state:{selected:{halo:!0,labelFontSize:14,labelFontWeight:700,lineWidth:4},active:{halo:!0},highlight:{labelFontWeight:700,lineWidth:4},inactive:{fillOpacity:.65,labelOpacity:.25,strokeOpacity:.65},disabled:{fill:y,fillOpacity:.25,labelOpacity:.25,stroke:w,strokeOpacity:.25}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"combo-expand",collapse:"combo-collapse",update:[{fields:["x","y"]},{fields:["fill","stroke","lineWidth"],shape:"key"}],translate:[{fields:["x","y"]}]}}}}const N4=wE({bgColor:"#000000",comboColor:"#fdfdfd",comboColorDisabled:"#d0e4ff",comboStroke:"#99add1",comboStrokeDisabled:"#969696",edgeColor:"#637088",edgeColorDisabled:"#637088",edgeColorInactive:"#D0E4FF",edgePaletteOptions:{type:"group",color:["#637088","#0F55A6","#008383","#9C5D38","#8B53A6","#4E40A6","#8F6608","#3E801D","#A65383","#175E75","#0F8248"]},nodeColor:"#1783ff",nodeColorDisabled:"#D0E4FF",nodeHaloStrokeOpacityActive:.25,nodeHaloStrokeOpacitySelected:.45,nodeIconOpacityInactive:.45,nodeOpacityDisabled:.25,nodeOpacityInactive:.45,nodeStroke:"#d0e4ff",textColor:"#ffffff"}),k4=wE({bgColor:"#ffffff",comboColor:"#99ADD1",comboColorDisabled:"#f0f0f0",comboStroke:"#99add1",comboStrokeDisabled:"#d9d9d9",edgeColor:"#99add1",edgeColorDisabled:"#d9d9d9",edgeColorInactive:"#1B324F",nodeColor:"#1783ff",nodeColorDisabled:"#1B324F",nodeHaloStrokeOpacityActive:.15,nodeHaloStrokeOpacitySelected:.25,nodeIconOpacityInactive:.85,nodeOpacityDisabled:.06,nodeOpacityInactive:.25,nodeStroke:"#000000",textColor:"#000000"});class es extends Wf{beforeDraw(t,e){return t}afterLayout(t,e){}}class P4 extends es{beforeDraw(t){const{model:e}=this.context,n=t.add.combos,i=a=>{const s=[];return a.forEach((o,l)=>{const u=e.getAncestorsData(l,"combo").map(h=>At(h)).reverse();s.push([l,o,u.length])}),new Map(s.sort(([,,o],[,,l])=>l-o).map(([o,l])=>[o,l]))};return t.add.combos=i(n),t.update.combos=i(t.update.combos),t}}function ui(r,t,e,n,i){const a=At(n),s=`${e}s`,o=i?n:r.add[s].get(a)||r.update[s].get(a)||r.remove[s].get(a)||n;Object.entries(r).forEach(([l,c])=>{t===l?c[s].set(a,o):c[s].delete(a)})}function Xh(r,t){return Object.keys(r).every(e=>r[e]===t[e])}class R4 extends es{beforeDraw(t,e){if(e.stage==="visibility"||!this.context.model.model.hasTreeStructure(hn))return t;const{model:n}=this.context,{add:i,update:a}=t,s=[...t.update.combos.entries(),...t.add.combos.entries()];for(;s.length;){const[o,l]=s.pop();if(Qr(l)){const c=n.getDescendantsData(o),u=c.map(At),{internal:h,external:d}=dv(u,f=>n.getRelatedEdgesData(f));c.forEach(f=>{const v=At(f),g=s.findIndex(([y])=>y===v);g!==-1&&s.splice(g,1);const p=n.getElementType(v);ui(t,"remove",p,f)}),h.forEach(f=>ui(t,"remove","edge",f)),d.forEach(f=>{var v;const g=At(f);((v=this.context.element)===null||v===void 0?void 0:v.getElement(g))?a.edges.set(g,f):i.edges.set(g,f)})}else{const c=n.getChildrenData(o),u=c.map(At),{edges:h}=dv(u,d=>n.getRelatedEdgesData(d));[...c,...h].forEach(d=>{var f;const v=At(d),g=n.getElementType(v);((f=this.context.element)===null||f===void 0?void 0:f.getElement(v))?ui(t,"update",g,d):ui(t,"add",g,d),g==="combo"&&s.push([v,d])})}}return t}}const SE=(r,t,e,n)=>{const i=`${e}s`,a=At(n);!r.add[i].has(a)&&!r.update[i].has(a)&&r[t][i].set(At(n),n)};class L4 extends es{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(SE(e,"add","node",t),Qr(t))return;const n=At(t);SE(e,"add","node",t),this.context.model.getRelatedEdgesData(n).forEach(s=>{ui(e,"add","edge",s)}),this.context.model.getChildrenData(n).forEach(s=>{this.handleExpand(s,e)})}beforeDraw(t){const{graph:e,model:n}=this.context;if(!n.model.hasTreeStructure(ai))return t;const{add:{nodes:i,edges:a},update:{nodes:s}}=t,o=new Map,l=new Map;i.forEach((u,h)=>{Qr(u)&&o.set(h,u)}),a.forEach(u=>{if(e.getElementType(u.source)!=="node")return;const h=e.getNodeData(u.source);Qr(h)&&o.set(u.source,h)}),s.forEach((u,h)=>{const d=this.getElement(h);if(!d)return;const f=d.attributes.collapsed;Qr(u)?f||o.set(h,u):f&&l.set(h,u)});const c=new Set;return o.forEach((u,h)=>{n.getDescendantsData(h).forEach(f=>{const v=At(f);if(c.has(v))return;ui(t,"remove","node",f),n.getRelatedEdgesData(v).forEach(p=>{ui(t,"remove","edge",p)}),c.add(v)})}),l.forEach((u,h)=>{if(n.getAncestorsData(h,ai).some(Qr)){ui(t,"remove","node",u);return}this.handleExpand(u,t)}),t}}const I0=new WeakMap;function Mj(r,t,e){I0.has(r)||I0.set(r,{});const n=I0.get(r);if(!n[t])return n[t]=e,!0;const i=n[t];return ME(i,e)?!1:(n[t]=e,!0)}const ME=(r,t,e=2)=>{if(typeof r!="object"||typeof t!="object")return r===t;const n=Object.keys(r),i=Object.keys(t);if(n.length!==i.length)return!1;for(const a of n){const s=r[a],o=t[a];if(e>1&&typeof s=="object"&&typeof o=="object"){if(!ME(s,o,e-1))return!1}else if(s!==o)return!1}return!0};function D4(r,t,e){Af[r][t]&&Kr.warn(`The extension ${t} of ${r} has been registered before, and will be overridden.`),Object.assign(Af[r],{[t]:e})}var AE=function(){function r(t){(0,N.Z)(this,r),this.dragndropPluginOptions=t}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this,i=e.renderingService,a=e.renderingContext,s=a.root.ownerDocument,o=s.defaultView,l=function(u){var h=u.target,d=h===s,f=d&&n.dragndropPluginOptions.isDocumentDraggable?s:h.closest&&h.closest("[draggable=true]");if(f){var v=!1,g=u.timeStamp,p=[u.clientX,u.clientY],y=null,b=[u.clientX,u.clientY],w=function(){var _=(0,Ra.Z)((0,Cr.Z)().mark(function F(W){var j,H,K,et,rt,lt;return(0,Cr.Z)().wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(v){ht.next=2;break}if(j=W.timeStamp-g,H=Wr([W.clientX,W.clientY],p),!(j<=n.dragndropPluginOptions.dragstartTimeThreshold||H<=n.dragndropPluginOptions.dragstartDistanceThreshold)){ht.next=1;break}return ht.abrupt("return");case 1:W.type="dragstart",f.dispatchEvent(W),v=!0;case 2:if(W.type="drag",W.dx=W.clientX-b[0],W.dy=W.clientY-b[1],f.dispatchEvent(W),b=[W.clientX,W.clientY],d){ht.next=4;break}return K=n.dragndropPluginOptions.overlap==="pointer"?[W.canvasX,W.canvasY]:h.getBounds().center,ht.next=3,s.elementsFromPoint(K[0],K[1]);case 3:et=ht.sent,rt=et[et.indexOf(h)+1],lt=(rt==null?void 0:rt.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?s:null),y!==lt&&(y&&(W.type="dragleave",W.target=y,y.dispatchEvent(W)),lt&&(W.type="dragenter",W.target=lt,lt.dispatchEvent(W)),y=lt,y&&(W.type="dragover",W.target=y,y.dispatchEvent(W)));case 4:case"end":return ht.stop()}},F)}));return function(W){return _.apply(this,arguments)}}();o.addEventListener("pointermove",w);var O=function(F){if(v){F.detail={preventClick:!0};var W=F.clone();y&&(W.type="drop",W.target=y,y.dispatchEvent(W)),W.type="dragend",f.dispatchEvent(W),v=!1}o.removeEventListener("pointermove",w)};h.addEventListener("pointerup",O,{once:!0}),h.addEventListener("pointerupoutside",O,{once:!0})}};i.hooks.init.tap(r.tag,function(){o.addEventListener("pointerdown",l)}),i.hooks.destroy.tap(r.tag,function(){o.removeEventListener("pointerdown",l)})}}])}();AE.tag="Dragndrop";var _4=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),e=(0,R.Z)(this,t),e.name="dragndrop",e.options=n,e}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new AE((0,D.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)}}])}(Da),TE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},OE=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const CE=["main"],NE=["background","main","label","transient"];function I4(r){return r.main}class kE{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||I4(this.getLayers())}getLayers(){return this.extends.layers}getRenderer(t){return this.extends.renderers[t]}getCamera(t="main"){return this.getLayer(t).getCamera()}getRoot(t="main"){return this.getLayer(t).getRoot()}getContextService(t="main"){return this.getLayer(t).getContextService()}setCursor(t){this.config.cursor=t,this.getLayer().setCursor(t)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(t){this.config={enableMultiLayer:!0},Object.assign(this.config,t);const e=this.config,{renderer:n,background:i,cursor:a,enableMultiLayer:s}=e,o=OE(e,["renderer","background","cursor","enableMultiLayer"]),l=s?NE:CE,c=PE(n,l),u=Object.fromEntries(l.map(h=>{const d=new vf(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:s,renderer:c[h],background:s?h==="background"?i:void 0:i}));return[h,d]}));RE(u),this.extends={config:this.config,renderer:n,renderers:c,layers:u}}get ready(){return Promise.all(Object.entries(this.getLayers()).map(([,t])=>t.ready))}resize(t,e){Object.assign(this.extends.config,{width:t,height:e}),Object.values(this.getLayers()).forEach(n=>{const i=n.getCamera(),a=i.getPosition(),s=i.getFocalPoint();n.resize(t,e),i.setPosition(a),i.setFocalPoint(s)})}getBounds(t){return dl(Object.values(this.getLayers()).map(e=>t?e.getRoot().childNodes.find(i=>i.classList.includes(t)):e.getRoot()).filter(e=>(e==null?void 0:e.childNodes.length)>0).map(e=>e.getBounds()))}getContainer(){const t=this.extends.config.container;return typeof t=="string"?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var n;const i=((n=t.style)===null||n===void 0?void 0:n.$layer)||"main";return this.getLayer(i).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=PE(t,this.config.enableMultiLayer?NE:CE);this.extends.renderers=e,Object.entries(e).forEach(([n,i])=>this.getLayer(n).setRenderer(i)),RE(this.getLayers())}getCanvasByViewport(t){return yr(this.getLayer().viewport2Canvas(Bi(t)))}getViewportByCanvas(t){return yr(this.getLayer().canvas2Viewport(Bi(t)))}getViewportByClient(t){return yr(this.getLayer().client2Viewport(Bi(t)))}getClientByViewport(t){return yr(this.getLayer().viewport2Client(Bi(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),n=e.client2Viewport(Bi(t));return yr(e.viewport2Canvas(n))}toDataURL(){return TE(this,arguments,void 0,function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:n="viewport"}=t,i=OE(t,["mode"]);let[a,s,o,l]=[0,0,0,0];if(n==="viewport")[o,l]=this.getSize();else if(n==="overall"){const y=this.getBounds(),b=Ba(y);[a,s]=y.min,[o,l]=b}const c=D0('<div id="virtual-image"></div>'),u=new vf({width:o,height:l,renderer:new Sl,devicePixelRatio:e,container:c,background:this.extends.config.background});yield u.ready,u.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),u.appendChild(this.getRoot().cloneNode(!0));const h=this.getLayer("label").getRoot().cloneNode(!0),d=u.viewport2Canvas({x:0,y:0}),f=this.getCanvasByViewport([0,0]);h.translate([f[0]-d.x,f[1]-d.y]),h.scale(1/this.getCamera().getZoom()),u.appendChild(h),u.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const v=this.getCamera(),g=u.getCamera();if(n==="viewport")g.setZoom(v.getZoom()),g.setPosition(v.getPosition()),g.setFocalPoint(v.getFocalPoint());else if(n==="overall"){const[y,b,w]=g.getPosition(),[O,_,F]=g.getFocalPoint();g.setPosition([y+a,b+s,w]),g.setFocalPoint([O+a,_+s,F])}const p=u.getContextService();return new Promise(y=>{u.addEventListener(ii.RERENDER,()=>TE(this,void 0,void 0,function*(){yield new Promise(w=>setTimeout(w,300));const b=yield p.toDataURL(i);y(b)}))})})}destroy(){Object.values(this.getLayers()).forEach(t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()})}}function PE(r,t){return Object.fromEntries(t.map(e=>{const n=(r==null?void 0:r(e))||new Sl;return n instanceof Sl&&n.setConfig({enableDirtyRectangleRendering:!1}),e==="main"?n.registerPlugin(new _4({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[e,n]}))}function RE(r){Object.entries(r).forEach(([t,e])=>{const n=e.getContextService().getDomElement();n!=null&&n.style&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,t!=="main"&&(n.style.pointerEvents="none")),n!=null&&n.parentElement&&(n.parentElement.style.display="grid",n.parentElement.style.isolation="isolate")})}const ko=r=>r?parseInt(r):0;function B4(r){const t=getComputedStyle(r),e=r.clientWidth||ko(t.width),n=r.clientHeight||ko(t.height),i=ko(t.paddingLeft)+ko(t.paddingRight),a=ko(t.paddingTop)+ko(t.paddingBottom);return[e-i,n-a]}function LE(r){if(!r)return[0,0];let t=640,e=480;const[n,i]=B4(r);t=n||t,e=i||e;const a=1,s=1;return[Math.max(ie(t)?t:a,a),Math.max(ie(e)?e:s,s)]}class Kh{constructor(t){this.type=t}}class $n extends Kh{constructor(t,e){super(t),this.data=e}}class Si extends Kh{constructor(t,e,n,i){super(t),this.animationType=e,this.animation=n,this.data=i}}class Po extends Kh{constructor(t,e,n){super(t),this.elementType=e,this.data=n}}class Qh extends Kh{constructor(t,e){super(t),this.data=e}}function or(r,t){r.emit(t.type,t)}function F4(r){if(!r)return null;if(r instanceof tm)return{type:"canvas",element:r};let t=r;for(;t;){if(Al(t))return{type:"node",element:t};if(b1(t))return{type:"edge",element:t};if(fv(t))return{type:"combo",element:t};t=t.parentElement}return null}function DE(r){var t;return((t=r==null?void 0:r.style)===null||t===void 0?void 0:t.zIndex)||0}const Ro="cachedStyle",qh=r=>`__${r}__`;function z4(r,t){const e=Array.isArray(t)?t:[t];br(r,Ro)||bl(r,Ro,{}),e.forEach(n=>{bl(br(r,Ro),qh(n),r.attributes[n])})}function _E(r,t){return br(r,[Ro,qh(t)])}function j4(r,t){return qh(t)in(br(r,Ro)||{})}function Aj(r,t,e){set(r,[Ro,qh(t)],e)}class Z4{constructor(t){this.tasks=[],this.animations=new Set,this.context=t}getTasks(){const t=[...this.tasks];return this.tasks=[],t}add(t,e){this.tasks.push([t,e])}animate(t,e,n){var i,a,s;(i=e==null?void 0:e.before)===null||i===void 0||i.call(e);const o=this.getTasks().map(([c,u])=>{var h,d,f;const{element:v,elementType:g,stage:p}=c,y=cO(this.context.options,g,p,t);(h=u==null?void 0:u.before)===null||h===void 0||h.call(u);const b=y.length?hO(v,this.inferStyle(c,n),y):null;return b?((d=u==null?void 0:u.beforeAnimate)===null||d===void 0||d.call(u,b),b.finished.then(()=>{var w,O;(w=u==null?void 0:u.afterAnimate)===null||w===void 0||w.call(u,b),(O=u==null?void 0:u.after)===null||O===void 0||O.call(u),this.animations.delete(b)})):(f=u==null?void 0:u.after)===null||f===void 0||f.call(u),b}).filter(Boolean);o.forEach(c=>this.animations.add(c));const l=Tf(o);return l?((a=e==null?void 0:e.beforeAnimate)===null||a===void 0||a.call(e,l),l.finished.then(()=>{var c,u;(c=e==null?void 0:e.afterAnimate)===null||c===void 0||c.call(e,l),(u=e==null?void 0:e.after)===null||u===void 0||u.call(e),this.release()})):(s=e==null?void 0:e.after)===null||s===void 0||s.call(e),l}inferStyle(t,e){var n,i;const{element:a,elementType:s,stage:o,originalStyle:l,updatedStyle:c={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},l),c));const{modifiedStyle:u}=t,h={},d={};if(o==="enter")Object.assign(h,{opacity:0});else if(o==="exit")Object.assign(d,{opacity:0});else if(o==="show")Object.assign(h,{opacity:0}),Object.assign(d,{opacity:(n=_E(a,"opacity"))!==null&&n!==void 0?n:hl("opacity")});else if(o==="hide")Object.assign(h,{opacity:(i=_E(a,"opacity"))!==null&&i!==void 0?i:hl("opacity")}),Object.assign(d,{opacity:0});else if(o==="collapse"){const{collapse:f}=e||{},{target:v,descendants:g,position:p}=f;if(s==="node"){if(g.includes(a.id)){const[y,b,w]=p;Object.assign(d,{x:y,y:b,z:w})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b]=p;Object.assign(d,{x:y,y:b,childrenNode:l.childrenNode})}}else s==="edge"&&Object.assign(d,{sourceNode:u.sourceNode,targetNode:u.targetNode})}else if(o==="expand"){const{expand:f}=e||{},{target:v,descendants:g,position:p}=f;if(s==="node"){if(a.id===v||g.includes(a.id)){const[y,b,w]=p;Object.assign(h,{x:y,y:b,z:w})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b,w]=p;Object.assign(h,{x:y,y:b,z:w,childrenNode:u.childrenNode})}}else s==="edge"&&Object.assign(h,{sourceNode:u.sourceNode,targetNode:u.targetNode})}return[Object.keys(h).length>0?Object.assign({},l,h):l,Object.keys(d).length>0?Object.assign({},u,d):u]}stop(){this.animations.forEach(t=>t.cancel())}clear(){this.tasks=[]}release(){var t,e;const{canvas:n}=this.context,i=(e=(t=n.document)===null||t===void 0?void 0:t.timeline)===null||e===void 0?void 0:e.animationsWithPromises;i&&(n.document.timeline.animationsWithPromises=i.filter(a=>a.playState!=="finished"))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class W4{constructor(t){this.batchCount=0,this.context=t}emit(t){const{graph:e}=this.context;e.emit(t.type,t)}startBatch(t=!0){this.batchCount++,this.batchCount===1&&this.emit(new $n(Kt.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,this.batchCount===0&&this.emit(new $n(Kt.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class G4 extends Zf{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=e=>{const{target:n}=e,i=F4(n);if(!i)return;const{graph:a,canvas:s}=this.context,{type:o,element:l}=i;if("destroyed"in l&&(Ol(l)||l.destroyed))return;const{type:c,detail:u,button:h}=e,d=Object.assign(Object.assign({},e),{target:l,targetType:o,originalTarget:n});c===Bt.POINTER_MOVE&&(this.currentTarget!==l&&(this.currentTarget&&a.emit(`${this.currentTargetType}:${Bt.POINTER_LEAVE}`,Object.assign(Object.assign({},d),{type:Bt.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),l&&(Object.assign(d,{type:Bt.POINTER_ENTER}),a.emit(`${o}:${Bt.POINTER_ENTER}`,d))),this.currentTarget=l,this.currentTargetType=o),c===Bt.CLICK&&h===2||(a.emit(`${o}:${c}`,d),a.emit(c,d)),c===Bt.CLICK&&u===2&&(Object.assign(d,{type:Bt.DBLCLICK}),a.emit(`${o}:${Bt.DBLCLICK}`,d),a.emit(Bt.DBLCLICK,d)),c===Bt.POINTER_DOWN&&h===2&&(Object.assign(d,{type:Bt.CONTEXT_MENU,preventDefault:()=>{var f;(f=s.getContainer())===null||f===void 0||f.addEventListener(Bt.CONTEXT_MENU,v=>v.preventDefault(),{once:!0})}}),a.emit(`${o}:${Bt.CONTEXT_MENU}`,d),a.emit(Bt.CONTEXT_MENU,d))},this.forwardContainerEvents=e=>{this.context.graph.emit(e.type,e)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[uo.KEY_DOWN,uo.KEY_UP].forEach(n=>{t.addEventListener(n,this.forwardContainerEvents)});const e=this.context.canvas.document;e&&[Bt.CLICK,Bt.DBLCLICK,Bt.POINTER_OVER,Bt.POINTER_LEAVE,Bt.POINTER_ENTER,Bt.POINTER_MOVE,Bt.POINTER_OUT,Bt.POINTER_DOWN,Bt.POINTER_UP,Bt.CONTEXT_MENU,Bt.DRAG_START,Bt.DRAG,Bt.DRAG_END,Bt.DRAG_ENTER,Bt.DRAG_OVER,Bt.DRAG_LEAVE,Bt.DROP,Bt.WHEEL].forEach(n=>{e.addEventListener(n,this.forwardCanvasEvents)})}destroy(){const t=this.context.canvas.getContainer();t&&[uo.KEY_DOWN,uo.KEY_UP].forEach(e=>{t.removeEventListener(e,this.forwardContainerEvents)}),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}function V4(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var Ul=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function ns(r,t){const{data:e,style:n}=r,i=Ul(r,["data","style"]),{data:a,style:s}=t,o=Ul(t,["data","style"]),l=Object.assign(Object.assign({},i),o);return(e||a)&&Object.assign(l,{data:Object.assign(Object.assign({},e),a)}),(n||s)&&Object.assign(l,{style:Object.assign(Object.assign({},n),s)}),l}function B0(r){const{data:t,style:e}=r,i=Ul(r,["data","style"]);return t&&(i.data=Object.assign({},t)),e&&(i.style=Object.assign({},e)),i}function Tj(r){return!get(r,["nodes","length"])&&!get(r,["edges","length"])&&!get(r,["combos","length"])}function Lo(r={},t={}){const{states:e=[],data:n={},style:i={},children:a=[]}=r,s=Ul(r,["states","data","style","children"]),{states:o=[],data:l={},style:c={},children:u=[]}=t,h=Ul(t,["states","data","style","children"]),d=(v,g)=>v.length!==g.length?!1:v.every((p,y)=>p===g[y]),f=(v,g)=>{const p=Object.keys(v),y=Object.keys(g);return p.length!==y.length?!1:p.every(b=>v[b]===g[b])};return!(!f(s,h)||!d(a,u)||!d(e,o)||!f(n,l)||!f(i,c))}var U4=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function F0(r){const{id:t=At(r),style:e,data:n}=r,i=U4(r,["id","style","data"]),a=Object.assign(Object.assign({},r),{style:Object.assign({},e),data:Object.assign({},n)});return bO(r)?Object.assign({id:t,data:a},i):{id:t,data:a}}function fr(r){return r.data}function Y4(r){if(r.hasTreeStructure(ai))return;r.attachTreeStructure(ai);const t=r.getAllEdges();for(const e of t){const{source:n,target:i}=e;r.setParent(i,n,ai)}}class H4{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new Vn}pushChange(t){if(this.isTraceless)return;const{type:e}=t;if(e===wn.NodeUpdated||e===wn.EdgeUpdated||e===wn.ComboUpdated){const{value:n,original:i}=t;this.changes.push({value:B0(n),original:B0(i),type:e})}else this.changes.push({value:B0(t.value),type:e})}getChanges(){return this.changes}clearChanges(){this.changes=[]}batch(t){this.batchCount++,this.model.batch(t),this.batchCount--}isBatching(){return this.batchCount>0}silence(t){this.isTraceless=!0,t(),this.isTraceless=!1}isCombo(t){return this.comboIds.has(t)||this.latestRemovedComboIds.has(t)}getData(){return{nodes:this.getNodeData(),edges:this.getEdgeData(),combos:this.getComboData()}}getNodeData(t){return this.model.getAllNodes().reduce((e,n)=>{const i=fr(n);return this.isCombo(At(i))||(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getEdgeDatum(t){return fr(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce((e,n)=>{const i=fr(n);return(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getComboData(t){return this.model.getAllNodes().reduce((e,n)=>{const i=fr(n);return this.isCombo(At(i))&&(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getRootsData(t=ai){return this.model.getRoots(t).map(fr)}getAncestorsData(t,e){const{model:n}=this;return!n.hasNode(t)||!n.hasTreeStructure(e)?[]:n.getAncestors(t,e).map(fr)}getDescendantsData(t){const e=this.getElementDataById(t),n=[];return Ds(e,i=>{i!==e&&n.push(i)},i=>this.getChildrenData(At(i)),"TB"),n}getParentData(t,e){const{model:n}=this;if(!e){Kr.warn("The hierarchy structure key is not specified");return}if(!n.hasNode(t)||!n.hasTreeStructure(e))return;const i=n.getParent(t,e);return i?fr(i):void 0}getChildrenData(t){const e=this.getElementType(t)==="node"?ai:hn,{model:n}=this;return!n.hasNode(t)||!n.hasTreeStructure(e)?[]:n.getChildren(t,e).map(fr)}getElementsDataByType(t){return t==="node"?this.getNodeData():t==="edge"?this.getEdgeData():t==="combo"?this.getComboData():[]}getElementDataById(t){return this.getElementType(t)==="edge"?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){const e=this.model.getNode(t);return fr(e)}getNodeLikeData(t){return this.model.getAllNodes().reduce((e,n)=>{const i=fr(n);return t?t.includes(At(i))&&e.push(i):e.push(i),e},[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter(i=>{var a;return(a=i.states)===null||a===void 0?void 0:a.includes(e)})}getElementState(t){var e;return((e=this.getElementDataById(t))===null||e===void 0?void 0:e.states)||[]}hasNode(t){return this.model.hasNode(t)&&!this.isCombo(t)}hasEdge(t){return this.model.hasEdge(t)}hasCombo(t){return this.model.hasNode(t)&&this.isCombo(t)}getRelatedEdgesData(t,e="both"){return this.model.getRelatedEdges(t,e).map(fr)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(fr)}setData(t){const{nodes:e=[],edges:n=[],combos:i=[]}=t,{nodes:a,edges:s,combos:o}=this.getData(),l=ja(a,e,h=>At(h),Lo),c=ja(s,n,h=>At(h),Lo),u=ja(o,i,h=>At(h),Lo);this.batch(()=>{const h={nodes:l.enter,edges:c.enter,combos:u.enter};this.addData(h),this.computeZIndex(h,"add",!0);const d={nodes:l.update,edges:c.update,combos:u.update};this.updateData(d),this.computeZIndex(d,"update",!0);const f={nodes:l.exit.map(At),edges:c.exit.map(At),combos:u.exit.map(At)};this.removeData(f)})}addData(t){const{nodes:e,edges:n,combos:i}=t;this.batch(()=>{this.addComboData(i),this.addNodeData(e),this.addEdgeData(n)}),this.computeZIndex(t,"add")}addNodeData(t=[]){t.length&&(this.model.addNodes(t.map(e=>(this.pushChange({value:e,type:wn.NodeAdded}),F0(e)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map(e=>(this.pushChange({value:e,type:wn.EdgeAdded}),F0(e)))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(hn)||e.attachTreeStructure(hn),e.addNodes(t.map(n=>(this.comboIds.add(At(n)),this.pushChange({value:n,type:wn.ComboAdded}),F0(n)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const n=this.getNodeLikeDatum(t),i=e.map(At);this.addNodeData(e),this.updateNodeData([{id:t,children:[...n.children||[],...i]}]),this.addEdgeData(i.map(a=>({source:t,target:a})))}computeZIndex(t,e,n=!1){!n&&this.isBatching()||this.batch(()=>{const{nodes:i=[],edges:a=[],combos:s=[]}=t;s.forEach(o=>{var l,c,u;const h=At(o);if(e==="add"&&ie((l=o.style)===null||l===void 0?void 0:l.zIndex)||e==="update"&&!("combo"in o))return;const d=this.getParentData(h,hn),f=d?((u=(c=d.style)===null||c===void 0?void 0:c.zIndex)!==null&&u!==void 0?u:0)+1:0;this.preventUpdateNodeLikeHierarchy(()=>{this.updateComboData([{id:h,style:{zIndex:f}}])})}),i.forEach(o=>{var l,c,u;const h=At(o);if(e==="add"&&ie((l=o.style)===null||l===void 0?void 0:l.zIndex)||e==="update"&&!("combo"in o)&&!("children"in o))return;let d=0;const f=this.getParentData(h,hn);if(f)d=(((c=f.style)===null||c===void 0?void 0:c.zIndex)||0)+1;else{const v=this.getParentData(h,ai);v&&(d=((u=v==null?void 0:v.style)===null||u===void 0?void 0:u.zIndex)||0)}this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:h,style:{zIndex:d}}])})}),a.forEach(o=>{var l,c,u,h,d;if(ie((l=o.style)===null||l===void 0?void 0:l.zIndex))return;let{id:f,source:v,target:g}=o;if(!f)f=At(o);else{const b=this.getEdgeDatum(f);v=b.source,g=b.target}if(!v||!g)return;const p=((u=(c=this.getNodeLikeDatum(v))===null||c===void 0?void 0:c.style)===null||u===void 0?void 0:u.zIndex)||0,y=((d=(h=this.getNodeLikeDatum(g))===null||h===void 0?void 0:h.style)===null||d===void 0?void 0:d.zIndex)||0;this.updateEdgeData([{id:At(o),style:{zIndex:Math.max(p,y)-1}}])})})}getFrontZIndex(t){var e;const n=this.getElementType(t),i=this.getElementDataById(t),a=this.getData();if(Object.assign(a,{[`${n}s`]:a[`${n}s`].filter(s=>At(s)!==t)}),n==="combo"&&!Qr(i)){const s=new Set(this.getAncestorsData(t,hn).map(At));a.nodes=a.nodes.filter(o=>!s.has(At(o))),a.combos=a.combos.filter(o=>!s.has(At(o))),a.edges=a.edges.filter(({source:o,target:l})=>!s.has(o)&&!s.has(l))}return Math.max(((e=i.style)===null||e===void 0?void 0:e.zIndex)||0,0,...Object.values(a).flat().map(s=>{var o;return(((o=s==null?void 0:s.style)===null||o===void 0?void 0:o.zIndex)||0)+1}))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach(n=>{const i=At(n),a=ou(n);a!==void 0&&(e.hasTreeStructure(hn)||e.attachTreeStructure(hn),a===null&&this.refreshComboData(i),this.setParent(i,ou(n),hn));const s=n.children||[];if(s.length){e.hasTreeStructure(ai)||e.attachTreeStructure(ai);const o=s.filter(l=>e.hasNode(l));o.forEach(l=>this.setParent(l,i,ai)),o.length!==s.length&&this.updateNodeData([{id:i,children:o}])}})}preventUpdateNodeLikeHierarchy(t){this.enableUpdateNodeLikeHierarchy=!1,t(),this.enableUpdateNodeLikeHierarchy=!0}updateData(t){const{nodes:e,edges:n,combos:i}=t;this.batch(()=>{this.updateNodeData(e),this.updateComboData(i),this.updateEdgeData(n)}),this.computeZIndex(t,"update")}updateNodeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{const n=[];t.forEach(i=>{const a=At(i),s=fr(e.getNode(a));if(Lo(s,i))return;const o=ns(s,i);this.pushChange({value:o,original:s,type:wn.NodeUpdated}),e.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:n}=this.getData();t.forEach(i=>{this.pushChange({value:i,original:i,type:wn.NodeUpdated})}),e.forEach(i=>{this.pushChange({value:i,original:i,type:wn.EdgeUpdated})}),n.forEach(i=>{this.pushChange({value:i,original:i,type:wn.ComboUpdated})})}syncNodeLikeDatum(t){const{model:e}=this,n=At(t);if(!e.hasNode(n))return;const i=fr(e.getNode(n)),a=ns(i,t);e.mergeNodeData(n,a)}syncEdgeDatum(t){const{model:e}=this,n=At(t);if(!e.hasEdge(n))return;const i=fr(e.getEdge(n)),a=ns(i,t);e.mergeEdgeData(n,a)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{t.forEach(n=>{const i=At(n),a=fr(e.getEdge(i));if(Lo(a,n))return;n.source&&a.source!==n.source&&e.updateEdgeSource(i,n.source),n.target&&a.target!==n.target&&e.updateEdgeTarget(i,n.target);const s=ns(a,n);this.pushChange({value:s,original:a,type:wn.EdgeUpdated}),e.mergeEdgeData(i,s)})}),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch(()=>{const n=[];t.forEach(i=>{const a=At(i),s=fr(e.getNode(a));if(Lo(s,i))return;const o=ns(s,i);this.pushChange({value:o,original:s,type:wn.ComboUpdated}),e.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({combos:t},"update")}setParent(t,e,n,i=!0){if(t===e)return;const a=this.getNodeLikeDatum(t),s=ou(a);if(s!==e&&n===hn){const o={id:t,combo:e};this.isCombo(t)?this.syncNodeLikeDatum(o):this.syncNodeLikeDatum(o)}this.model.setParent(t,e,n),i&&n===hn&&V4([s,e]).forEach(o=>{o!==void 0&&this.refreshComboData(o)})}refreshComboData(t){const e=this.getComboData([t])[0],n=this.getAncestorsData(t,hn);e&&this.pushChange({value:e,original:e,type:wn.ComboUpdated}),n.forEach(i=>{this.pushChange({value:i,original:i,type:wn.ComboUpdated})})}getElementPosition(t){const e=this.getElementDataById(t);return ar(e)}translateNodeLikeBy(t,e){this.isCombo(t)?this.translateComboBy(t,e):this.translateNodeBy(t,e)}translateNodeLikeTo(t,e){this.isCombo(t)?this.translateComboTo(t,e):this.translateNodeTo(t,e)}translateNodeBy(t,e){const n=this.getElementPosition(t),i=Ce(n,[...e,0].slice(0,3));this.translateNodeTo(t,i)}translateNodeTo(t,e){const[n=0,i=0,a=0]=e;this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:t,style:{x:n,y:i,z:a}}])})}translateComboBy(t,e){const[n=0,i=0,a=0]=e;if([n,i,a].some(isNaN)||[n,i,a].every(l=>l===0))return;const s=this.getComboData([t])[0];if(!s)return;const o=new Set;Ds(s,l=>{const c=At(l);if(o.has(c))return;o.add(c);const[u,h,d]=ar(l),f=ns(l,{style:{x:u+n,y:h+i,z:d+a}});this.pushChange({value:f,original:l,type:this.isCombo(c)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(c,f)},l=>this.getChildrenData(At(l)),"BT")}translateComboTo(t,e){var n;if(e.some(isNaN))return;const[i=0,a=0,s=0]=e,o=(n=this.getComboData([t]))===null||n===void 0?void 0:n[0];if(!o)return;const[l,c,u]=ar(o),h=i-l,d=a-c,f=s-u;Ds(o,v=>{const g=At(v),[p,y,b]=ar(v),w=ns(v,{style:{x:p+h,y:y+d,z:b+f}});this.pushChange({value:w,original:v,type:this.isCombo(g)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(g,w)},v=>this.getChildrenData(At(v)),"BT")}removeData(t){const{nodes:e,edges:n,combos:i}=t;this.batch(()=>{this.removeEdgeData(n),this.removeNodeData(e),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)})}removeNodeData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.removeEdgeData(this.getRelatedEdgesData(e).map(At)),this.pushChange({value:this.getNodeData([e])[0],type:wn.NodeRemoved}),this.removeNodeLikeHierarchy(e)}),this.model.removeNodes(t)})}removeEdgeData(t=[]){t.length&&(t.forEach(e=>this.pushChange({value:this.getEdgeData([e])[0],type:wn.EdgeRemoved})),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.pushChange({value:this.getComboData([e])[0],type:wn.ComboRemoved}),this.removeNodeLikeHierarchy(e),this.comboIds.delete(e)}),this.model.removeNodes(t)})}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(hn)){const e=ou(this.getNodeLikeDatum(t));this.setParent(t,void 0,hn,!1),this.model.getChildren(t,hn).forEach(n=>{const i=fr(n),a=At(i);this.setParent(At(i),e,hn,!1);const s=ns(i,{id:At(i),combo:e});this.pushChange({value:s,original:i,type:this.isCombo(a)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(At(i),s)}),ye(e)||this.refreshComboData(e)}}getElementType(t){if(this.model.hasNode(t))return this.isCombo(t)?"combo":"node";if(this.model.hasEdge(t))return"edge";throw new Error(ga(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),n=t.getAllEdges();t.removeEdges(n.map(i=>i.id)),t.removeNodes(e.map(i=>i.id)),this.context={}}}var Yl=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class X4{constructor(t){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=t}init(){this.initContainer()}initContainer(){if(!this.container||this.container.destroyed){const{canvas:t}=this.context;this.container=t.appendChild(new ir({className:"elements"}))}}emit(t,e){e.silence||or(this.context.graph,t)}forEachElementData(t){Ls.forEach(e=>{const n=this.context.model.getElementsDataByType(e);t(e,n)})}getElementType(t,e){var n;const{options:i,graph:a}=this.context,s=((n=i[t])===null||n===void 0?void 0:n.type)||e.type;return s?typeof s=="string"?s:s.call(a,e):t==="edge"?"line":"circle"}getTheme(t){return Mm(this.context.options)[t]||{}}getThemeStyle(t){return this.getTheme(t).style||{}}getThemeStateStyle(t,e){const{state:n={}}=this.getTheme(t);return Object.assign({},...e.map(i=>n[i]||{}))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData((e,n)=>{var i,a;const s=Object.assign({},Iy((i=this.getTheme(e))===null||i===void 0?void 0:i.palette),Iy((a=t[e])===null||a===void 0?void 0:a.palette));s!=null&&s.field&&Object.assign(this.paletteStyle,PN(n,s))})}getPaletteStyle(t,e){const n=this.paletteStyle[e];return n?t==="edge"?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(t,e){var n;const{options:i}=this.context,a=((n=i[t])===null||n===void 0?void 0:n.style)||{};"transform"in a&&Array.isArray(a.transform)&&(a.transform=[...a.transform]),this.defaultStyle[At(e.datum)]=_y(a,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];(t===void 0||t.includes(At(o)))&&this.computeElementDefaultStyle(n,{datum:o,graph:e})}})}getDefaultStyle(t){return this.defaultStyle[t]||{}}getElementState(t){try{const{model:e}=this.context;return e.getElementState(t)}catch(e){return[]}}getElementStateStyle(t,e,n){var i,a;const{options:s}=this.context,o=((a=(i=s[t])===null||i===void 0?void 0:i.state)===null||a===void 0?void 0:a[e])||{};return _y(o,n)}computeElementStatesStyle(t,e,n){this.stateStyle[At(n.datum)]=Object.assign({},...e.map(i=>this.getElementStateStyle(t,i,n)))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];if(t===void 0||t.includes(At(o))){const l=this.getElementState(At(o));this.computeElementStatesStyle(n,l,{datum:o,graph:e})}}})}getStateStyle(t){return this.stateStyle[t]||{}}computeStyle(t,e){t&&["translate","zIndex"].includes(t)||(this.computePaletteStyle(),this.computeElementsDefaultStyle(e),this.computeElementsStatesStyle(e))}getElement(t){return this.elementMap[t]}getNodes(){return this.context.model.getNodeData().map(({id:t})=>this.elementMap[t])}getEdges(){return this.context.model.getEdgeData().map(t=>this.elementMap[At(t)])}getCombos(){return this.context.model.getComboData().map(({id:t})=>this.elementMap[t])}getElementComputedStyle(t,e){const n=At(e),i=this.getThemeStyle(t),a=this.getPaletteStyle(t,n),s=e.style||{},o=this.getDefaultStyle(n),l=this.getThemeStateStyle(t,this.getElementState(n)),c=this.getStateStyle(n),u=Object.assign({},i,a,s,o,l,c);if(t==="combo"){const h=this.context.model.getChildrenData(n),f=!!u.collapsed?[]:h.map(At).filter(v=>this.getElement(v));Object.assign(u,{childrenNode:f,childrenData:h})}return u}getDrawData(t){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:n="draw",stage:i=n}=t;return this.markDestroyElement(e.drawData),this.computeStyle(i),{type:n,stage:i,data:e}}draw(t={animation:!0}){const e=this.getDrawData(t);if(!e)return;const{data:{drawData:{add:n,update:i,remove:a}}}=e;return this.destroyElements(a,t),this.createElements(n,t),this.updateElements(i,t),this.setAnimationTask(t,e)}preLayoutDraw(){return Yl(this,arguments,void 0,function*(t={animation:!0}){var e,n;const i=this.getDrawData(t);if(!i)return;const{data:{drawData:a}}=i;yield(n=(e=this.context.layout)===null||e===void 0?void 0:e.preLayout)===null||n===void 0?void 0:n.call(e,a);const{add:s,update:o,remove:l}=a;return this.destroyElements(l,t),this.createElements(s,t),this.updateElements(o,t),this.setAnimationTask(t,i)})}setAnimationTask(t,e){const{animation:n,silence:i}=t,{data:{dataChanges:a,drawData:s},stage:o,type:l}=e;return this.context.animation.animate(n,i?{}:{before:()=>this.emit(new $n(Kt.BEFORE_DRAW,{dataChanges:a,animation:n,stage:o,render:l==="render"}),t),beforeAnimate:c=>this.emit(new Si(Kt.BEFORE_ANIMATE,Xr.DRAW,c,s),t),afterAnimate:c=>this.emit(new Si(Kt.AFTER_ANIMATE,Xr.DRAW,c,s),t),after:()=>this.emit(new $n(Kt.AFTER_DRAW,{dataChanges:a,animation:n,stage:o,render:l==="render",firstRender:this.context.graph.rendered===!1}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,n=e.getChanges(),i=Hv(n);if(i.length===0)return null;const{NodeAdded:a=[],NodeUpdated:s=[],NodeRemoved:o=[],EdgeAdded:l=[],EdgeUpdated:c=[],EdgeRemoved:u=[],ComboAdded:h=[],ComboUpdated:d=[],ComboRemoved:f=[]}=Hc(i,y=>y.type),v=y=>new Map(y.map(b=>{const w=b.value;return[At(w),w]})),g={add:{nodes:v(a),edges:v(l),combos:v(h)},update:{nodes:v(s),edges:v(c),combos:v(d)},remove:{nodes:v(o),edges:v(u),combos:v(f)}},p=this.transformData(g,t);return e.clearChanges(),{dataChanges:n,drawData:p}}transformData(t,e){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce((i,a)=>a.beforeDraw(i,e),t)}createElement(t,e,n){var i;const a=At(e);if(this.getElement(a))return;const o=this.getElementType(t,e),l=this.getElementComputedStyle(t,e),c=va(t,o);if(!c)return Kr.warn(`The element ${o} of ${t} is not registered.`);this.emit(new Po(Kt.BEFORE_ELEMENT_CREATE,t,e),n);const u=this.container.appendChild(new c({id:a,context:this.context,style:l}));this.shapeTypeMap[a]=o,this.elementMap[a]=u;const{stage:h="enter"}=n;(i=this.context.animation)===null||i===void 0||i.add({element:u,elementType:t,stage:h,originalStyle:Object.assign({},u.attributes),updatedStyle:l},{after:()=>{var d;this.emit(new Po(Kt.AFTER_ELEMENT_CREATE,t,e),n),(d=u.onCreate)===null||d===void 0||d.call(u)}})}createElements(t,e){const{nodes:n,edges:i,combos:a}=t;[["node",n],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(c=>this.createElement(o,c,e))})}getUpdateStageStyle(t,e,n){const{stage:i="update"}=n;if(i==="translate")if(t==="node"||t==="combo"){const{style:{x:a=0,y:s=0,z:o=0}={}}=e;return{x:a,y:s,z:o}}else return{};return this.getElementComputedStyle(t,e)}updateElement(t,e,n){var i;const a=At(e),{stage:s="update"}=n,o=this.getElement(a);if(!o)return()=>null;this.emit(new Po(Kt.BEFORE_ELEMENT_UPDATE,t,e),n);const l=this.getElementType(t,e),c=this.getUpdateStageStyle(t,e,n);this.shapeTypeMap[a]!==l&&(o.destroy(),delete this.shapeTypeMap[a],delete this.elementMap[a],this.createElement(t,e,{animation:!1,silence:!0}));const u=s!=="visibility"?s:c.visibility==="hidden"?"hide":"show";u==="hide"&&delete c.visibility,(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:t,stage:u,originalStyle:Object.assign({},o.attributes),updatedStyle:c},{before:()=>{const h=this.elementMap[a];s!=="collapse"&&mv(h,c),s==="visibility"&&(j4(h,"opacity")||z4(h,"opacity"),this.visibilityCache.set(h,u==="show"?"visible":"hidden"),u==="show"&&Ps(h,"visible"))},after:()=>{var h;const d=this.elementMap[a];s==="collapse"&&mv(d,c),u==="hide"&&Ps(d,this.visibilityCache.get(d)),this.emit(new Po(Kt.AFTER_ELEMENT_UPDATE,t,e),n),(h=d.onUpdate)===null||h===void 0||h.call(d)}})}updateElements(t,e){const{nodes:n,edges:i,combos:a}=t;[["node",n],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(c=>this.updateElement(o,c,e))})}markDestroyElement(t){Object.values(t.remove).forEach(e=>{e.forEach(n=>{const i=At(n),a=this.getElement(i);a&&G3(a)})})}destroyElement(t,e,n){var i;const{stage:a="exit"}=n,s=At(e),o=this.elementMap[s];if(!o)return()=>null;this.emit(new Po(Kt.BEFORE_ELEMENT_DESTROY,t,e),n),(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:t,stage:a,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var l;this.clearElement(s),o.destroy(),(l=o.onDestroy)===null||l===void 0||l.call(o),this.emit(new Po(Kt.AFTER_ELEMENT_DESTROY,t,e),n)}})}destroyElements(t,e){const{nodes:n,edges:i,combos:a}=t;[["combo",a],["edge",i],["node",n]].forEach(([o,l])=>{l.forEach(c=>this.destroyElement(o,c,e))})}clearElement(t){delete this.paletteStyle[t],delete this.defaultStyle[t],delete this.stateStyle[t],delete this.elementMap[t],delete this.shapeTypeMap[t]}alignLayoutResultToElement(t,e){var n,i;const a=(n=t.nodes)===null||n===void 0?void 0:n.find(s=>At(s)===e);if(a){const s=ar(this.context.model.getNodeLikeDatum(e)),o=ar(a),l=on(s,o);(i=t.nodes)===null||i===void 0||i.forEach(c=>{var u,h,d;!((u=c.style)===null||u===void 0)&&u.x&&(c.style.x+=l[0]),!((h=c.style)===null||h===void 0)&&h.y&&(c.style.y+=l[1]),!((d=c.style)===null||d===void 0)&&d.z&&(c.style.z+=l[2]||0)})}}collapseNode(t,e){return Yl(this,void 0,void 0,function*(){var n;const{animation:i}=e,{model:a}=this.context,s=this.computeChangesAndDrawData({stage:"collapse",animation:i});if(!s)return;const{drawData:o}=s,{add:l,remove:c,update:u}=o;this.markDestroyElement(o);const h={animation:i,stage:"collapse",data:o};this.destroyElements(c,h),this.createElements(l,h),this.updateElements(u,h),yield(n=this.context.animation.animate(i,{beforeAnimate:d=>this.emit(new Si(Kt.BEFORE_ANIMATE,Xr.COLLAPSE,d,o),h),afterAnimate:d=>this.emit(new Si(Kt.AFTER_ANIMATE,Xr.COLLAPSE,d,o),h)},{collapse:{target:t,descendants:Array.from(c.nodes).map(([,d])=>At(d)),position:ar(u.nodes.get(t))}}))===null||n===void 0?void 0:n.finished})}expandNode(t,e){return Yl(this,void 0,void 0,function*(){var n;const{model:i,layout:a}=this.context,{animation:s,align:o}=e,l=ar(i.getNodeData([t])[0]),c=this.computeChangesAndDrawData({stage:"expand",animation:s});if(this.createElements(c.drawData.add,{animation:!1,stage:"expand",target:t}),this.context.animation.clear(),this.computeStyle("expand"),!c)return;const{drawData:u}=c,{update:h,add:d}=u,f={animation:s,stage:"expand",data:u};d.edges.forEach(v=>h.edges.set(At(v),v)),d.nodes.forEach(v=>h.nodes.set(At(v),v)),this.updateElements(h,f),yield(n=this.context.animation.animate(s,{beforeAnimate:v=>this.emit(new Si(Kt.BEFORE_ANIMATE,Xr.EXPAND,v,u),f),afterAnimate:v=>this.emit(new Si(Kt.AFTER_ANIMATE,Xr.EXPAND,v,u),f)},{expand:{target:t,descendants:Array.from(d.nodes).map(([,v])=>At(v)),position:l}}))===null||n===void 0?void 0:n.finished})}collapseCombo(t,e){return Yl(this,void 0,void 0,function*(){var n;const{model:i,element:a}=this.context;if(i.getAncestorsData(t,hn).some(g=>Qr(g)))return;const s=a.getElement(t),o=s.getComboPosition(Object.assign(Object.assign({},s.attributes),{collapsed:!0})),l=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!l)return;const{dataChanges:c,drawData:u}=l;this.markDestroyElement(u);const{update:h,remove:d}=u,f={animation:e,stage:"collapse",data:u};this.destroyElements(d,f),this.updateElements(h,f);const v=g=>Array.from(g).map(([,p])=>At(p));yield(n=this.context.animation.animate(e,{before:()=>this.emit(new $n(Kt.BEFORE_DRAW,{dataChanges:c,animation:e}),f),beforeAnimate:g=>this.emit(new Si(Kt.BEFORE_ANIMATE,Xr.COLLAPSE,g,u),f),afterAnimate:g=>this.emit(new Si(Kt.AFTER_ANIMATE,Xr.COLLAPSE,g,u),f),after:()=>this.emit(new $n(Kt.AFTER_DRAW,{dataChanges:c,animation:e}),f)},{collapse:{target:t,descendants:[...v(d.nodes),...v(d.combos)],position:o}}))===null||n===void 0?void 0:n.finished})}expandCombo(t,e){return Yl(this,void 0,void 0,function*(){var n;const{model:i}=this.context,a=ar(i.getComboData([t])[0]);this.computeStyle("expand");const s=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!s)return;const{dataChanges:o,drawData:l}=s,{add:c,update:u}=l,h={animation:e,stage:"expand",data:l,target:t};this.createElements(c,h),this.updateElements(u,h);const d=f=>Array.from(f).map(([,v])=>At(v));yield(n=this.context.animation.animate(e,{before:()=>this.emit(new $n(Kt.BEFORE_DRAW,{dataChanges:o,animation:e}),h),beforeAnimate:f=>this.emit(new Si(Kt.BEFORE_ANIMATE,Xr.EXPAND,f,l),h),afterAnimate:f=>this.emit(new Si(Kt.AFTER_ANIMATE,Xr.EXPAND,f,l),h),after:()=>this.emit(new $n(Kt.AFTER_DRAW,{dataChanges:o,animation:e}),h)},{expand:{target:t,descendants:[...d(c.nodes),...d(c.combos)],position:a}}))===null||n===void 0?void 0:n.finished})}clear(){this.container.destroy(),this.initContainer(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={}}destroy(){this.clear(),this.container.destroy(),this.context={}}}const IE=Symbol("Comlink.proxy"),K4=Symbol("Comlink.endpoint"),BE=Symbol("Comlink.releaseProxy"),z0=Symbol("Comlink.finalizer"),Jh=Symbol("Comlink.thrown"),FE=r=>typeof r=="object"&&r!==null||typeof r=="function",Q4={canHandle:r=>FE(r)&&r[IE],serialize(r){const{port1:t,port2:e}=new MessageChannel;return jE(r,t),[e,[e]]},deserialize(r){return r.start(),WE(r)}},q4={canHandle:r=>FE(r)&&Jh in r,serialize({value:r}){let t;return r instanceof Error?t={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:t={isError:!1,value:r},[t,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},zE=new Map([["proxy",Q4],["throw",q4]]);function J4(r,t){for(const e of r)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function jE(r,t=globalThis,e=["*"]){t.addEventListener("message",function n(i){if(!i||!i.data)return;if(!J4(e,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:s,path:o}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(Xs);let c;try{const u=o.slice(0,-1).reduce((d,f)=>d[f],r),h=o.reduce((d,f)=>d[f],r);switch(s){case"GET":c=h;break;case"SET":u[o.slice(-1)[0]]=Xs(i.data.value),c=!0;break;case"APPLY":c=h.apply(u,l);break;case"CONSTRUCT":{const d=new h(...l);c=iB(d)}break;case"ENDPOINT":{const{port1:d,port2:f}=new MessageChannel;jE(r,f),c=rB(d,[d])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[Jh]:0}}Promise.resolve(c).catch(u=>({value:u,[Jh]:0})).then(u=>{const[h,d]=nd(u);t.postMessage(Object.assign(Object.assign({},h),{id:a}),d),s==="RELEASE"&&(t.removeEventListener("message",n),ZE(t),z0 in r&&typeof r[z0]=="function"&&r[z0]())}).catch(u=>{const[h,d]=nd({value:new TypeError("Unserializable return value"),[Jh]:0});t.postMessage(Object.assign(Object.assign({},h),{id:a}),d)})}),t.start&&t.start()}function $4(r){return r.constructor.name==="MessagePort"}function ZE(r){$4(r)&&r.close()}function WE(r,t){const e=new Map;return r.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const s=e.get(a.id);if(s)try{s(a)}finally{e.delete(a.id)}}),j0(r,e,[],t)}function $h(r){if(r)throw new Error("Proxy has been released and is not useable")}function GE(r){return Do(r,new Map,{type:"RELEASE"}).then(()=>{ZE(r)})}const td=new WeakMap,ed="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const t=(td.get(r)||0)-1;td.set(r,t),t===0&&GE(r)});function tB(r,t){const e=(td.get(t)||0)+1;td.set(t,e),ed&&ed.register(r,t,r)}function eB(r){ed&&ed.unregister(r)}function j0(r,t,e=[],n=function(){}){let i=!1;const a=new Proxy(n,{get(s,o){if($h(i),o===BE)return()=>{eB(a),GE(r),t.clear(),i=!0};if(o==="then"){if(e.length===0)return{then:()=>a};const l=Do(r,t,{type:"GET",path:e.map(c=>c.toString())}).then(Xs);return l.then.bind(l)}return j0(r,t,[...e,o])},set(s,o,l){$h(i);const[c,u]=nd(l);return Do(r,t,{type:"SET",path:[...e,o].map(h=>h.toString()),value:c},u).then(Xs)},apply(s,o,l){$h(i);const c=e[e.length-1];if(c===K4)return Do(r,t,{type:"ENDPOINT"}).then(Xs);if(c==="bind")return j0(r,t,e.slice(0,-1));const[u,h]=VE(l);return Do(r,t,{type:"APPLY",path:e.map(d=>d.toString()),argumentList:u},h).then(Xs)},construct(s,o){$h(i);const[l,c]=VE(o);return Do(r,t,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:l},c).then(Xs)}});return tB(a,r),a}function nB(r){return Array.prototype.concat.apply([],r)}function VE(r){const t=r.map(nd);return[t.map(e=>e[0]),nB(t.map(e=>e[1]))]}const UE=new WeakMap;function rB(r,t){return UE.set(r,t),r}function iB(r){return Object.assign(r,{[IE]:!0})}function Oj(r,t=globalThis,e="*"){return{postMessage:(n,i)=>r.postMessage(n,e,i),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function nd(r){for(const[t,e]of zE)if(e.canHandle(r)){const[n,i]=e.serialize(r);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:r},UE.get(r)||[]]}function Xs(r){switch(r.type){case"HANDLER":return zE.get(r.name).deserialize(r.value);case"RAW":return r.value}}function Do(r,t,e,n){return new Promise(i=>{const a=aB();t.set(a,i),r.start&&r.start(),r.postMessage(Object.assign({id:a},e),n)})}function aB(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class sB extends Vu{constructor(t,e,n){super(),this.graph=t,this.layout=e,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=WE(new Worker(new URL(S.p+S.u(5030),S.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var t;return(0,G.mG)(this,void 0,void 0,function*(){if(this.running)return this;this.running=!0;const e=this.layout.options,{onTick:n}=e,i=(0,G._T)(e,["onTick"]),a={};Object.keys(i).forEach(c=>{fe(i[c])||(a[c]=i[c])});const s={layout:{id:this.layout.id,options:a,iterations:(t=this.options)===null||t===void 0?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[l]=yield this.proxy.calculateLayout(s,[o]);return l})}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[BE]()}isRunning(){return this.running}}var _o=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},oB=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class lB{get presetOptions(){return{animation:!!Am(this.context.options,!0)}}get options(){const{options:t}=this.context;return t.layout}constructor(t){this.instances=[],this.context=t}getLayoutInstance(){return this.instances}preLayout(t){return _o(this,void 0,void 0,function*(){var e,n,i,a;const{graph:s,model:o}=this.context,{add:l}=t;or(s,new $n(Kt.BEFORE_LAYOUT,{type:"pre"}));const c=yield(e=this.context.layout)===null||e===void 0?void 0:e.simulate();(n=c==null?void 0:c.nodes)===null||n===void 0||n.forEach(u=>{const h=At(u),d=l.nodes.get(h);o.syncNodeLikeDatum(u),d&&Object.assign(d.style,u.style)}),(i=c==null?void 0:c.edges)===null||i===void 0||i.forEach(u=>{const h=At(u),d=l.edges.get(h);o.syncEdgeDatum(u),d&&Object.assign(d.style,u.style)}),(a=c==null?void 0:c.combos)===null||a===void 0||a.forEach(u=>{const h=At(u),d=l.combos.get(h);o.syncNodeLikeDatum(u),d&&Object.assign(d.style,u.style)}),or(s,new $n(Kt.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",t)})}postLayout(){return _o(this,arguments,void 0,function*(t=this.options){if(!t)return;const e=Array.isArray(t)?t:[t],{graph:n}=this.context;or(n,new $n(Kt.BEFORE_LAYOUT,{type:"post"}));for(let i=0;i<e.length;i++){const a=e[i],s=this.getLayoutData(a),o=Object.assign(Object.assign({},this.presetOptions),a);or(n,new $n(Kt.BEFORE_STAGE_LAYOUT,{options:o,index:i}));const l=yield this.stepLayout(s,o,i);or(n,new $n(Kt.AFTER_STAGE_LAYOUT,{options:o,index:i})),a.animation||this.updateElementPosition(l,!1)}or(n,new $n(Kt.AFTER_LAYOUT,{type:"post"})),this.transformDataAfterLayout("post")})}transformDataAfterLayout(t,e){const n=this.context.transform.getTransformInstance();Object.values(n).forEach(i=>i.afterLayout(t,e))}simulate(){return _o(this,void 0,void 0,function*(){if(!this.options)return{};const t=Array.isArray(this.options)?this.options:[this.options];let e={};for(let n=0;n<t.length;n++){const i=t[n],a=this.getLayoutData(i);e=yield this.stepLayout(a,Object.assign(Object.assign(Object.assign({},this.presetOptions),i),{animation:!1}),n)}return e})}stepLayout(t,e,n){return _o(this,void 0,void 0,function*(){return $3(e)?yield this.treeLayout(t,e,n):yield this.graphLayout(t,e,n)})}graphLayout(t,e,n){return _o(this,void 0,void 0,function*(){const{animation:i,enableWorker:a,iterations:s=300}=e,o=this.initGraphLayout(e);if(!o)return{};if(this.instances[n]=o,this.instance=o,a){const c=o;return this.supervisor=new sB(c.graphData2LayoutModel(t),c.instance,{iterations:s}),Hu(yield this.supervisor.execute())}if(_v(o))return i?yield o.execute(t,{onTick:c=>{this.updateElementPosition(c,!1)}}):(o.execute(t),o.stop(),o.tick(s));const l=yield o.execute(t);if(i){const c=this.updateElementPosition(l,i);yield c==null?void 0:c.finished}return l})}treeLayout(t,e,n){return _o(this,void 0,void 0,function*(){const{type:i,animation:a}=e,s=va("layout",i);if(!s)return{};const{nodes:o=[],edges:l=[]}=t,c=new Vn({nodes:o.map(v=>({id:At(v),data:v.data||{}})),edges:l.map(v=>({id:At(v),source:v.source,target:v.target,data:v.data||{}}))});Y4(c);const u={nodes:[],edges:[]},h={nodes:[],edges:[]};c.getRoots(ai).forEach(v=>{Ds(v,w=>{w.children=c.getSuccessors(w.id)},w=>c.getSuccessors(w.id),"TB");const g=s(v,e),{x:p,y,z:b=0}=g;Ds(g,w=>{const{id:O,x:_,y:F,z:W=0}=w;u.nodes.push({id:O,style:{x:p,y,z:b}}),h.nodes.push({id:O,style:{x:_,y:F,z:W}})},w=>w.children,"TB")});const f=this.inferTreeLayoutOffset(h);if(YE(h,f),a){YE(u,f),this.updateElementPosition(u,!1);const v=this.updateElementPosition(h,a);yield v==null?void 0:v.finished}return h})}inferTreeLayoutOffset(t){var e;let[n,i]=[1/0,-1/0],[a,s]=[1/0,-1/0];(e=t.nodes)===null||e===void 0||e.forEach(g=>{const{x:p=0,y=0}=g.style||{};n=Math.min(n,p),i=Math.max(i,p),a=Math.min(a,y),s=Math.max(s,y)});const{canvas:o}=this.context,l=o.getSize(),[c,u]=o.getCanvasByViewport([0,0]),[h,d]=o.getCanvasByViewport(l);if(n>=c&&i<=h&&a>=u&&s<=d)return[0,0];const f=(c+h)/2,v=(u+d)/2;return[f-(n+i)/2,v-(a+s)/2]}stopLayout(){this.instance&&_v(this.instance)&&(this.instance.stop(),this.instance=void 0),this.supervisor&&(this.supervisor.stop(),this.supervisor=void 0),this.animationResult&&(this.animationResult.finish(),this.animationResult=void 0)}getLayoutData(t){const{nodeFilter:e=()=>!0,preLayout:n=!1,isLayoutInvisibleNodes:i=!1}=t,{nodes:a,edges:s,combos:o}=this.context.model.getData(),{element:l,model:c}=this.context,u=g=>l.getElement(g),h=n?g=>{var p;return!i&&(((p=g.style)===null||p===void 0?void 0:p.visibility)==="hidden"||c.getAncestorsData(g.id,ai).some(Qr)||c.getAncestorsData(g.id,hn).some(Qr))?!1:e(g)}:g=>{const p=At(g),y=u(p);return!y||Ol(y)?!1:e(g)},d=a.filter(h),f=new Map(d.map(g=>[At(g),g]));o.forEach(g=>f.set(At(g),g));const v=s.filter(({source:g,target:p})=>f.has(g)&&f.has(p));return{nodes:d,edges:v,combos:o}}initGraphLayout(t){var e;const{element:n,viewport:i}=this.context,{type:a,enableWorker:s,animation:o,iterations:l}=t,c=oB(t,["type","enableWorker","animation","iterations"]),[u,h]=i.getCanvasSize(),d=[u/2,h/2],f=(e=t==null?void 0:t.nodeSize)!==null&&e!==void 0?e:b=>{const w=n==null?void 0:n.getElement(b.id);return w?w.attributes.size:n==null?void 0:n.getElementComputedStyle("node",b).size},v=va("layout",a);if(!v)return Kr.warn(`The layout of ${a} is not registered.`);const g=Object.getPrototypeOf(v.prototype)===Yu.prototype?v:eP(v,this.context),p=new g(this.context),y={nodeSize:f,width:u,height:h,center:d};switch(p.id){case"d3-force":case"d3-force-3d":Object.assign(y,{center:{x:u/2,y:h/2,z:0}});break;default:break}return mr(p.options,y,c),p}updateElementPosition(t,e){const{model:n,element:i}=this.context;return i?(n.updateData(t),i.draw({animation:e,silence:!0})):null}destroy(){var t;this.stopLayout(),this.context={},(t=this.supervisor)===null||t===void 0||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const YE=(r,t)=>{var e;const[n,i]=t;(e=r.nodes)===null||e===void 0||e.forEach(a=>{if(a.style){const{x:s=0,y:o=0}=a.style;a.style.x=s+n,a.style.y=o+i}else a.style={x:n,y:i}})};function cB(r){return[uB].reduce((e,n)=>n(e),r)}function uB(r){return!r.layout||Array.isArray(r.layout)||"preLayout"in r.layout||["antv-dagre","combo-combined","compact-box","circular","concentric","dagre","fishbone","grid","indented","mds","radial","random","snake","dendrogram","mindmap"].includes(r.layout.type)&&(r.layout.preLayout=!0),r}class hB extends Zf{constructor(t){super(t),this.category="plugin",this.setPlugins(this.context.options.plugins||[])}setPlugins(t){this.setExtensions(t)}getPluginInstance(t){const e=this.extensionMap[t];if(e)return e;Kr.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const n=this.extensions.find(i=>i.type===t);if(n)return this.extensionMap[n.key]}}const rd=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class dB extends Zf{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...rd.slice(0,rd.length-1),...t,rd[rd.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var Hl=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class fB{get padding(){return Ri(this.context.options.padding)}get paddingOffset(){const[t,e,n,i]=this.padding,[a,s,o]=[(i-e)/2,(t-n)/2,0];return[a,s,o]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,n]=this.paddingOffset,{zoom:i,rotation:a,x:s=e,y:o=n}=t.options;this.transform({mode:"absolute",scale:i,translate:[s,o],rotate:a},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,n)=>{const a=Object.entries(t.getLayers()).filter(([o])=>!["main"].includes(o)).map(([,o])=>o.getCamera()),s=e[n];if(typeof s=="function")return(...o)=>{const l=s.apply(e,o);return a.forEach(c=>{c[n].apply(c,o)}),l}}})}createLandmark(t){return this.camera.createLandmark(`landmark-${this.landmarkCounter++}`,t)}getAnimation(t){const e=Am(this.context.options,t);return e?Bs(Object.assign({},e),["easing","duration"]):!1}getCanvasSize(){const{canvas:t}=this.context,{width:e=0,height:n=0}=t.getConfig();return[e,n]}getCanvasCenter(){const{canvas:t}=this.context,{width:e=0,height:n=0}=t.getConfig();return[e/2,n/2,0]}getViewportCenter(){const[t,e]=this.camera.getPosition();return[t,e,0]}getGraphCenter(){return this.context.graph.getViewportByCanvas(this.getCanvasCenter())}getZoom(){return this.camera.getZoom()}getRotation(){return this.camera.getRoll()}getTranslateOptions(t){const{camera:e}=this,{mode:n,translate:i=[]}=t,a=this.getZoom(),s=e.getPosition(),o=e.getFocalPoint(),[l,c]=this.getCanvasCenter(),[u=0,h=0,d=0]=i,f=Ii([-u,-h,-d],a);return n==="relative"?{position:Ce(s,f),focalPoint:Ce(o,f)}:{position:Ce([l,c,s[2]],f),focalPoint:Ce([l,c,o[2]],f)}}getRotateOptions(t){const{mode:e,rotate:n=0}=t;return{roll:e==="relative"?this.camera.getRoll()+n:n}}getZoomOptions(t){const{zoomRange:e}=this.context.options,n=this.camera.getZoom(),{mode:i,scale:a=1}=t;return kn(i==="relative"?n*a:a,...e)}transform(t,e){return Hl(this,void 0,void 0,function*(){const{graph:n}=this.context,{translate:i,rotate:a,scale:s,origin:o}=t;this.cancelAnimation();const l=this.getAnimation(e);if(or(n,new Qh(Kt.BEFORE_TRANSFORM,t)),!a&&s&&!i&&o&&!l){this.camera.setZoomByViewportPoint(this.getZoomOptions(t),o),or(n,new Qh(Kt.AFTER_TRANSFORM,t));return}const c={};if(i&&Object.assign(c,this.getTranslateOptions(t)),ie(a)&&Object.assign(c,this.getRotateOptions(t)),ie(s)&&Object.assign(c,{zoom:this.getZoomOptions(t)}),l)return or(n,new Si(Kt.BEFORE_ANIMATE,Xr.TRANSFORM,null,t)),new Promise(u=>{this.transformResolver=u,this.camera.gotoLandmark(this.createLandmark(c),Object.assign(Object.assign({},l),{onfinish:()=>{or(n,new Si(Kt.AFTER_ANIMATE,Xr.TRANSFORM,null,t)),or(n,new Qh(Kt.AFTER_TRANSFORM,t)),this.transformResolver=void 0,u()}}))});this.camera.gotoLandmark(this.createLandmark(c),{duration:0}),or(n,new Qh(Kt.AFTER_TRANSFORM,t))})}fitView(t,e){return Hl(this,void 0,void 0,function*(){const[n,i,a,s]=this.padding,{when:o="always",direction:l="both"}=t||{},[c,u]=this.context.canvas.getSize(),h=c-s-i,d=u-n-a,f=this.context.canvas.getBounds(),v=this.getBBoxInViewport(f),[g,p]=Ba(v),y=l==="x"&&g>=h||l==="y"&&p>=d||l==="both"&&g>=h&&p>=d;if(o==="overflow"&&!y)return yield this.fitCenter({animation:e});const b=h/g,w=d/p,O=l==="x"?b:l==="y"?w:Math.min(b,w),_=this.getAnimation(e);yield this.transform({mode:"relative",scale:O,translate:Ce(on(this.getCanvasCenter(),this.getBBoxInViewport(f).center),Ii(this.paddingOffset,O))},_)})}fitCenter(t){return Hl(this,void 0,void 0,function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)})}focusElements(t){return Hl(this,arguments,void 0,function*(e,n={}){const{element:i}=this.context;if(!i)return;const a=o=>n.shapes?o.getShape(n.shapes).getRenderBounds():o.getRenderBounds(),s=dl(e.map(o=>a(i.getElement(o))));yield this.focus(s,n)})}focus(t,e){return Hl(this,void 0,void 0,function*(){const n=this.context.graph.getViewportByCanvas(t.center),i=e.position||this.getCanvasCenter(),a=on(i,n);yield this.transform({mode:"relative",translate:Ce(a,this.paddingOffset)},e.animation)})}getBBoxInViewport(t){const{min:e,max:n}=t,{graph:i}=this.context,[a,s]=i.getViewportByCanvas(e),[o,l]=i.getViewportByCanvas(n),c=new gn;return c.setMinMax([a,s,0],[o,l,0]),c}isInViewport(t,e=!1,n=0){const{graph:i}=this.context,a=this.getCanvasSize(),[s,o]=i.getCanvasByViewport([0,0]),[l,c]=i.getCanvasByViewport(a);let u=new gn;return u.setMinMax([s,o,0],[l,c,0]),n&&(u=za(u,n)),fo(t)?Li(t,u):e?wO(t,u):u.intersects(t)}cancelAnimation(){var t,e;!((t=this.camera.landmarks)===null||t===void 0)&&t.length&&this.camera.cancelLandmarkAnimation(),(e=this.transformResolver)===null||e===void 0||e.call(this)}}var mn=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class id extends Vu{constructor(t){var e;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new H4},this.isCollapsingExpanding=!1,this.onResize=Cl(()=>{this.resize()},300),this._setOptions(Object.assign({},id.defaultOptions,t),!0),this.context.graph=this,this.options.autoResize&&((e=globalThis.addEventListener)===null||e===void 0||e.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(t){this._setOptions(t,!1)}_setOptions(t,e){if(this.updateCanvas(t),Object.assign(this.options,cB(t)),e){const{data:d}=t;d&&this.addData(d);return}const{behaviors:n,combo:i,data:a,edge:s,layout:o,node:l,plugins:c,theme:u,transforms:h}=t;n&&this.setBehaviors(n),a&&this.setData(a),l&&this.setNode(l),s&&this.setEdge(s),i&&this.setCombo(i),o&&this.setLayout(o),u&&this.setTheme(u),c&&this.setPlugins(c),h&&this.setTransforms(h)}getSize(){return this.context.canvas?this.context.canvas.getSize():[this.options.width||0,this.options.height||0]}setSize(t,e){t&&(this.options.width=t),e&&(this.options.height=e),this.resize(t,e)}setZoomRange(t){this.options.zoomRange=t}getZoomRange(){return this.options.zoomRange}setNode(t){this.options.node=t,this.context.model.refreshData()}setEdge(t){this.options.edge=t,this.context.model.refreshData()}setCombo(t){this.options.combo=t,this.context.model.refreshData()}getTheme(){return this.options.theme}setTheme(t){this.options.theme=fe(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=fe(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=fe(t)?t(this.getBehaviors()):t,(e=this.context.behavior)===null||e===void 0||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors(e=>e.map(n=>typeof n=="object"&&n.key===t.key?Object.assign(Object.assign({},n),t):n))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=fe(t)?t(this.getPlugins()):t,(e=this.context.plugin)===null||e===void 0||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins(e=>e.map(n=>typeof n=="object"&&n.key===t.key?Object.assign(Object.assign({},n),t):n))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=fe(t)?t(this.getTransforms()):t,(e=this.context.transform)===null||e===void 0||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms(e=>e.map(n=>typeof n=="object"&&n.key===t.key?Object.assign(Object.assign({},n),t):n)),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}getElementData(t){return Array.isArray(t)?t.map(e=>this.context.model.getElementDataById(e)):this.context.model.getElementDataById(t)}getNodeData(t){return t===void 0?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):this.context.model.getNodeLikeDatum(t)}getEdgeData(t){return t===void 0?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):this.context.model.getEdgeDatum(t)}getComboData(t){return t===void 0?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):this.context.model.getNodeLikeDatum(t)}setData(t){this.context.model.setData(fe(t)?t(this.getData()):t)}addData(t){this.context.model.addData(fe(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData(fe(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData(fe(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData(fe(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData(fe(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData(fe(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData(fe(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData(fe(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData(fe(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData(fe(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData(fe(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData(fe(t)?t(this.getComboData()):t)}getElementType(t){return this.context.model.getElementType(t)}getRelatedEdgesData(t,e="both"){return this.context.model.getRelatedEdgesData(t,e)}getNeighborNodesData(t){return this.context.model.getNeighborNodesData(t)}getAncestorsData(t,e){return this.context.model.getAncestorsData(t,e)}getParentData(t,e){return this.context.model.getParentData(t,e)}getChildrenData(t){return this.context.model.getChildrenData(t)}getDescendantsData(t){return this.context.model.getDescendantsData(t)}getElementDataByState(t,e){return this.context.model.getElementDataByState(t,e)}initCanvas(){return mn(this,void 0,void 0,function*(){var t;if(this.context.canvas)return yield this.context.canvas.ready;const{container:e="container",width:n,height:i,renderer:a,cursor:s,background:o,canvas:l,devicePixelRatio:c=(t=globalThis.devicePixelRatio)!==null&&t!==void 0?t:1}=this.options;if(e instanceof kE)this.context.canvas=e,s&&e.setCursor(s),a&&e.setRenderer(a),yield e.ready;else{const u=Ve(e)?document.getElementById(e):e,h=LE(u);this.emit(Kt.BEFORE_CANVAS_INIT,{container:u,width:n,height:i});const d=Object.assign(Object.assign({},l),{container:u,width:n||h[0],height:i||h[1],background:o,renderer:a,cursor:s,devicePixelRatio:c}),f=new kE(d);this.context.canvas=f,yield f.ready,this.emit(Kt.AFTER_CANVAS_INIT,{canvas:f})}})}updateCanvas(t){var e,n;const{renderer:i,cursor:a,height:s,width:o}=t,l=this.context.canvas;l&&(i&&(this.emit(Kt.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),l.setRenderer(i),this.emit(Kt.AFTER_RENDERER_CHANGE,{renderer:i})),a&&l.setCursor(a),(ie(o)||ie(s))&&this.setSize((e=o!=null?o:this.options.width)!==null&&e!==void 0?e:0,(n=s!=null?s:this.options.height)!==null&&n!==void 0?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new W4(this.context)),this.context.plugin||(this.context.plugin=new hB(this.context)),this.context.viewport||(this.context.viewport=new fB(this.context)),this.context.transform||(this.context.transform=new dB(this.context)),this.context.element||(this.context.element=new X4(this.context)),this.context.animation||(this.context.animation=new Z4(this.context)),this.context.layout||(this.context.layout=new lB(this.context)),this.context.behavior||(this.context.behavior=new G4(this.context))}prepare(){return mn(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed){console.error(ga("The graph instance has been destroyed"));return}yield this.initCanvas(),this.initRuntime()})}render(){return mn(this,void 0,void 0,function*(){if(yield this.prepare(),or(this,new $n(Kt.BEFORE_RENDER)),this.options.layout)if(!this.rendered&&tP(this.options.layout)){const t=yield this.context.element.preLayoutDraw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.context.layout.postLayout()]),yield this.autoFit()}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}this.rendered=!0,or(this,new $n(Kt.AFTER_RENDER))})}draw(){return mn(this,void 0,void 0,function*(){var t;yield this.prepare(),yield(t=this.context.element.draw())===null||t===void 0?void 0:t.finished})}layout(t){return mn(this,void 0,void 0,function*(){yield this.context.layout.postLayout(t)})}stopLayout(){this.context.layout.stopLayout()}clear(){return mn(this,void 0,void 0,function*(){const{model:t,element:e}=this.context;t.setData({}),t.clearChanges(),e==null||e.clear()})}destroy(){var t;or(this,new $n(Kt.BEFORE_DESTROY));const{layout:e,animation:n,element:i,model:a,canvas:s,behavior:o,plugin:l}=this.context;l==null||l.destroy(),o==null||o.destroy(),e==null||e.destroy(),n==null||n.destroy(),i==null||i.destroy(),a.destroy(),s==null||s.destroy(),this.options={},this.context={},this.off(),(t=globalThis.removeEventListener)===null||t===void 0||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,or(this,new $n(Kt.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var n;const i=LE((n=this.context.canvas)===null||n===void 0?void 0:n.getContainer()),a=[t||i[0],e||i[1]];if(!this.context.canvas)return;const s=this.context.canvas.getSize();Zn(a,s)||(or(this,new $n(Kt.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),or(this,new $n(Kt.AFTER_SIZE_CHANGE,{size:a})))}fitView(t,e){return mn(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.fitView(t,e)})}fitCenter(t){return mn(this,void 0,void 0,function*(){var e;yield(e=this.context.viewport)===null||e===void 0?void 0:e.fitCenter({animation:t})})}autoFit(){return mn(this,void 0,void 0,function*(){const{autoFit:t}=this.context.options;if(t)if(Ve(t))t==="view"?yield this.fitView():t==="center"&&(yield this.fitCenter());else{const{type:e,animation:n}=t;e==="view"?yield this.fitView(t.options,n):e==="center"&&(yield this.fitCenter(n))}})}focusElement(t,e){return mn(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.focusElements(Array.isArray(t)?t:[t],{animation:e})})}zoomBy(t,e,n){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:n},e)})}zoomTo(t,e,n){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",scale:t,origin:n},e)})}getZoom(){return this.context.viewport.getZoom()}rotateBy(t,e,n){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:n},e)})}rotateTo(t,e,n){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",rotate:t,origin:n},e)})}getRotation(){return this.context.viewport.getRotation()}translateBy(t,e){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)})}translateTo(t,e){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)})}getPosition(){return on([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return mn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=Fn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(l).forEach(([u,h])=>this.context.model.translateNodeLikeBy(u,h)),yield(o=this.context.element.draw({animation:c,stage:"translate"}))===null||o===void 0?void 0:o.finished})}translateElementTo(t,e){return mn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=Fn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(l).forEach(([u,h])=>this.context.model.translateNodeLikeTo(u,h)),yield(o=this.context.element.draw({animation:c,stage:"translate"}))===null||o===void 0?void 0:o.finished})}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return Zv(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return mn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=Fn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],u={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([f,v])=>{const g=this.getElementType(f);u[`${g}s`].push({id:f,style:{visibility:v}})});const{model:h,element:d}=this.context;h.preventUpdateNodeLikeHierarchy(()=>{h.updateData(u)}),yield(o=d.draw({animation:c,stage:"visibility"}))===null||o===void 0?void 0:o.finished})}showElement(t,e){return mn(this,void 0,void 0,function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"visible"])),e)})}hideElement(t,e){return mn(this,void 0,void 0,function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"hidden"])),e)})}getElementVisibility(t){var e,n;const i=this.context.element.getElement(t);return(n=(e=i==null?void 0:i.style)===null||e===void 0?void 0:e.visibility)!==null&&n!==void 0?n:"visible"}setElementZIndex(t,e){return mn(this,void 0,void 0,function*(){var n;const i={nodes:[],edges:[],combos:[]},a=Fn(t)?t:{[t]:e};Object.entries(a).forEach(([l,c])=>{const u=this.getElementType(l);i[`${u}s`].push({id:l,style:{zIndex:c}})});const{model:s,element:o}=this.context;s.preventUpdateNodeLikeHierarchy(()=>s.updateData(i)),yield(n=o.draw({animation:!1,stage:"zIndex"}))===null||n===void 0?void 0:n.finished})}frontElement(t){return mn(this,void 0,void 0,function*(){const e=Array.isArray(t)?t:[t],{model:n}=this.context,i={};e.map(a=>{const s=n.getFrontZIndex(a);if(n.getElementType(a)==="combo"){const l=n.getAncestorsData(a,hn).at(-1)||this.getComboData(a),c=[l,...n.getDescendantsData(At(l))],u=s-DE(l);c.forEach(d=>{i[At(d)]=this.getElementZIndex(At(d))+u});const{internal:h}=dv(c.map(At),d=>n.getRelatedEdgesData(d));h.forEach(d=>{const f=At(d);i[f]=this.getElementZIndex(f)+u})}else i[a]=s}),yield this.setElementZIndex(i)})}getElementZIndex(t){return DE(this.context.model.getElementDataById(t))}setElementState(t,e){return mn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=Fn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],u=d=>d?Array.isArray(d)?d:[d]:[],h={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([d,f])=>{const v=this.getElementType(d);h[`${v}s`].push({id:d,states:u(f)})}),this.updateData(h),yield(o=this.context.element.draw({animation:c,stage:"state"}))===null||o===void 0?void 0:o.finished})}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return mn(this,arguments,void 0,function*(e,n=!0){const{model:i,element:a}=this.context;if(Qr(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof n=="boolean"&&(n={animation:n,align:!0});const s=i.getElementType(e);yield this.frontElement(e),this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:e,style:{collapsed:!0}}]}:{combos:[{id:e,style:{collapsed:!0}}]}),s==="node"?yield a.collapseNode(e,n):s==="combo"&&(yield a.collapseCombo(e,!!n.animation)),this.isCollapsingExpanding=!1})}expandElement(t){return mn(this,arguments,void 0,function*(e,n=!0){const{model:i,element:a}=this.context;if(!Qr(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof n=="boolean"&&(n={animation:n,align:!0});const s=i.getElementType(e);this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:e,style:{collapsed:!1}}]}:{combos:[{id:e,style:{collapsed:!1}}]}),s==="node"?yield a.expandNode(e,n):s==="combo"&&(yield a.expandCombo(e,!!n.animation)),this.isCollapsingExpanding=!1})}setElementCollapsibility(t,e){const n=this.getElementType(t);n==="node"?this.updateNodeData([{id:t,style:{collapsed:e}}]):n==="combo"&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return mn(this,arguments,void 0,function*(t={}){return this.context.canvas.toDataURL(t)})}getCanvasByViewport(t){return this.context.canvas.getCanvasByViewport(t)}getViewportByCanvas(t){return this.context.canvas.getViewportByCanvas(t)}getClientByCanvas(t){return this.context.canvas.getClientByCanvas(t)}getCanvasByClient(t){return this.context.canvas.getCanvasByClient(t)}getViewportCenter(){return this.context.viewport.getViewportCenter()}getCanvasCenter(){return this.context.viewport.getCanvasCenter()}on(t,e,n){return super.on(t,e,n)}once(t,e){return super.once(t,e)}off(t,e){return super.off(t,e)}}id.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};var vB=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function gB(r,t){const{getNodeData:e=(o,l)=>{if(o.depth=l,!o.children)return o;const{children:c}=o,u=vB(o,["children"]);return Object.assign(Object.assign({},u),{children:c.map(h=>h.id)})},getEdgeData:n=(o,l)=>({source:o.id,target:l.id}),getChildren:i=o=>o.children||[]}=t||{},a=[],s=[];return Ds(r,(o,l)=>{a.push(e(o,l));const c=i(o);for(const u of c)s.push(n(o,u))},o=>i(o),"TB"),{nodes:a,edges:s}}class pB extends es{beforeDraw(t){const{add:e,update:n}=t,{model:i}=this.context;return[...e.edges.entries(),...n.edges.entries()].forEach(([,a])=>{HE(i,a)}),t}}const HE=(r,t)=>{const{source:e,target:n}=t,i=r.getElementDataById(e),a=r.getElementDataById(n),s=f1(i,h=>r.getParentData(h,hn)),o=f1(a,h=>r.getParentData(h,hn)),l=At(s),c=At(o),u={sourceNode:l,targetNode:c};return t.style?Object.assign(t.style,u):t.style=u,t},mB=(r,t,e)=>{const[n,i]=t,[a,s]=e;if(i===n)return a;const o=(r-n)/(i-n);return a+o*(s-a)},yB=(r,t,e)=>{const[n,i]=t,[a,s]=e,o=Math.log(r-n+1)/Math.log(i-n+1);return a+o*(s-a)},bB=(r,t,e,n=2)=>{const[i,a]=t,[s,o]=e,l=Math.pow((r-i)/(a-i),n);return s+l*(o-s)},xB=(r,t,e)=>{const[n,i]=t,[a,s]=e,o=Math.sqrt((r-n)/(i-n));return a+o*(s-a)};class ad extends es{constructor(t,e){super(t,mr({},ad.defaultOptions,e)),this.assignSizeByCentrality=(n,i,a,s,o,l)=>{const c=[i,a],u=[s[0],o[0]],h=[s[1],o[1]],d=[s[2],o[2]],f=(v,g)=>{if(typeof l=="function")return l(v,c,g);switch(l){case"linear":return mB(v,c,g);case"log":return yB(v,c,g);case"pow":return bB(v,c,g,2);case"sqrt":return xB(v,c,g);default:return g[0]}};return[f(n,u),f(n,h),f(n,d)]}}beforeDraw(t){const{model:e}=this.context,n=e.getNodeData(),i=oi(this.options.maxSize),a=oi(this.options.minSize),s=this.getCentralities(this.options.centrality),o=s.size>0?Math.max(...s.values()):0,l=s.size>0?Math.min(...s.values()):0;return n.forEach(c=>{var u;const h=this.assignSizeByCentrality(s.get(At(c))||0,l,o,a,i,this.options.scale),d=(u=this.context.element)===null||u===void 0?void 0:u.getElement(At(c)),f={size:h};this.assignLabelStyle(f,h,c,d),(!d||!Xh(f,d.attributes))&&ui(t,d?"update":"add","node",mr(c,{style:f}),!0)}),t}assignLabelStyle(t,e,n,i){var a;const s=i?i.config.style:(a=this.context.element)===null||a===void 0?void 0:a.getElementComputedStyle("node",n);if(Object.assign(t,Bs(s,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const o=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:o,labelLineHeight:o+EO(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,n){const i=Math.min(...t)/2,[a,s]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,e];return Math.min(s,Math.max(i,a))}getCentralities(t){const{model:e}=this.context,n=e.getData();if(typeof t=="function")return t(n);const i=e.getRelatedEdgesData.bind(e);return py(n,i,t)}}ad.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class sd extends es{constructor(t,e){super(t,Object.assign({},sd.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=ar(this.ref),{graph:n,model:i}=this.context;(t=i.getData().nodes)===null||t===void 0||t.forEach(s=>{var o;if(At(s)===At(this.ref))return;const l=xy(on(ar(s),e)),c=Math.abs(l)>Math.PI/2,u=!s.children||s.children.length===0,h=At(s),d=(o=this.context.element)===null||o===void 0?void 0:o.getElement(h);if(!d||!d.isVisible())return;const f=oi(n.getElementRenderStyle(h).size)[0]/2,v=(u?1:-1)*(f+this.options.offset),g=[["translate",v*Math.cos(l),v*Math.sin(l)],["rotate",c?Vr(l)+180:Vr(l)]];i.updateNodeData([{id:At(s),style:{labelTextAlign:c===u?"right":"left",labelTextBaseline:"middle",labelTransform:g}}])}),n.draw()}}sd.defaultOptions={offset:5};const EB="quadratic",XE=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class od extends es{constructor(t,e){super(t,Object.assign({},od.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=n=>{const{add:{edges:i},update:{nodes:a,edges:s,combos:o},remove:{edges:l}}=n,{model:c}=this.context,u=new Map,h=(v,g)=>{c.getRelatedEdgesData(g).forEach(y=>!u.has(At(y))&&u.set(At(y),y))};a.forEach(h),o.forEach(h);const d=v=>{const g=c.getEdgeData().map(y=>HE(c,y));wB(v,g,!0).forEach(y=>!u.has(At(y))&&u.set(At(y),y))};if(l.size&&l.forEach(d),i.size&&i.forEach(d),s.size){const v=Hb(Hv(c.getChanges())).update.edges;s.forEach(g=>{var p;d(g);const y=(p=v.find(b=>At(b.value)===At(g)))===null||p===void 0?void 0:p.original;y&&!Z0(g,y)&&d(y)})}ra(this.options.edges)||u.forEach((v,g)=>!this.options.edges.includes(g)&&u.delete(g));const f=c.getEdgeData().map(At);return new Map([...u].sort((v,g)=>f.indexOf(v[0])-f.indexOf(g[0])))},this.applyBundlingStyle=(n,i,a)=>{const{edgeMap:s,reverses:o}=KE(i);s.forEach(l=>{l.forEach((c,u,h)=>{var d;const f=h.length,v=c.style||{};if(c.source===c.target){const y=XE.length;v.loopPlacement=XE[u%y],v.loopDist=Math.floor(u/y)*a+50}else if(f===1)v.curveOffset=0;else{const y=(u%2===0?1:-1)*(o[`${c.source}|${c.target}|${u}`]?-1:1);v.curveOffset=f%2===1?y*Math.ceil(u/2)*a*2:y*(Math.floor(u/2)*a*2+a)}const g=Object.assign(c,{type:EB,style:v}),p=(d=this.context.element)===null||d===void 0?void 0:d.getElement(At(c));(!p||!Xh(g.style,p.attributes))&&ui(n,p?"update":"add","edge",g,!0)})})},this.resetEdgeStyle=n=>{const i=n.style||{},a=this.cacheMergeStyle.get(At(n))||{};return Object.keys(a).forEach(s=>{Zn(i[s],a[s])&&(n[s]?i[s]=n[s]:delete i[s])}),Object.assign(n,{style:i})},this.applyMergingStyle=(n,i)=>{const{edgeMap:a,reverses:s}=KE(i);a.forEach(o=>{var l;if(o.length===1){const u=o[0],h=(l=this.context.element)===null||l===void 0?void 0:l.getElement(At(u)),d=this.resetEdgeStyle(u);(!h||!Xh(d,h.attributes))&&ui(n,h?"update":"add","edge",d);return}const c=o.map(({source:u,target:h,style:d={}},f)=>{const{startArrow:v,endArrow:g}=d,p={},[y,b]=s[`${u}|${h}|${f}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return Uo(v)&&(p[y]=v),Uo(g)&&(p[b]=g),p}).reduce((u,h)=>Object.assign(Object.assign({},u),h),{});o.forEach((u,h,d)=>{var f;if(h!==0){ui(n,"remove","edge",u);return}const v=Object.assign({},fe(this.options.style)?this.options.style(d):this.options.style,{childrenData:d});this.cacheMergeStyle.set(At(u),v);const g=Object.assign(Object.assign({},u),{type:"line",style:Object.assign(Object.assign(Object.assign({},u.style),c),v)}),p=(f=this.context.element)===null||f===void 0?void 0:f.getElement(At(u));(!p||!Xh(g.style,p.attributes))&&ui(n,p?"update":"add","edge",g,!0)})})}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return e.size===0||(this.options.mode==="bundle"?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}od.defaultOptions={mode:"bundle",distance:15};const KE=r=>{const t=new Map,e=new Set,n={},i=new Map;for(const[a,s]of r){if(e.has(a))continue;const{source:o,target:l}=s,c=`${o}-${l}`;t.has(c)||(t.set(c,[]),i.set(c,new Set));const u=t.get(c),h=i.get(c);u&&h&&!h.has(a)&&(u.push(s),h.add(a),e.add(a));for(const[d,f]of r)if(!(e.has(d)||d===a)&&Z0(s,f)){const v=t.get(c),g=i.get(c);v&&g&&!g.has(d)&&(v.push(f),g.add(d),o===f.target&&l===f.source&&(n[`${f.source}|${f.target}|${v.length-1}`]=!0),e.add(d))}}return{edgeMap:t,reverses:n}},wB=(r,t,e)=>t.filter(n=>(e||At(n)!==At(r))&&Z0(n,r)),Z0=(r,t)=>{const{sourceNode:e,targetNode:n}=r.style||{},{sourceNode:i,targetNode:a}=t.style||{};return e===i&&n===a||e===a&&n===i};class SB extends es{beforeDraw(t,e){const{stage:n}=e;if(n==="visibility")return t;const{model:i}=this.context,{update:{nodes:a,edges:s,combos:o}}=t,l=(c,u)=>{i.getRelatedEdgesData(u).forEach(d=>!s.has(At(d))&&s.set(At(d),d))};return a.forEach(l),o.forEach(l),t}}const MB={animation:{"combo-collapse":Nm,"combo-expand":pO,"node-collapse":Om,"node-expand":vO,"path-in":Cm,"path-out":gO,fade:dO,translate:fO},behavior:{"brush-select":yl,"click-select":vu,"collapse-expand":Fu,"create-edge":Wu,"drag-canvas":Gu,"drag-element-force":rP,"drag-element":Nl,"fix-element-size":Xu,"focus-element":Ku,"hover-activate":Qu,"lasso-select":aP,"auto-adapt-label":lu,"optimize-viewport-transform":qu,"scroll-canvas":Ju,"zoom-canvas":$u},combo:{circle:Kk,rect:Qk},edge:{cubic:Fs,line:_u,polyline:Iu,quadratic:Bu,"cubic-horizontal":Ru,"cubic-radial":Lu,"cubic-vertical":Du},layout:{"antv-dagre":VR,"combo-combined":fL,"compact-box":th.compactBox,"d3-force":DL,"force-atlas2":BL,circular:HR,concentric:kv,dagre:eh,dendrogram:th.dendrogram,fishbone:ih,force:pb,fruchterman:jL,grid:WL,indented:th.indented,mds:Sb,mindmap:th.mindmap,radial:qL,random:iD,snake:ah},node:{circle:_s,diamond:QN,ellipse:bu,hexagon:ek,html:Ou,image:Cu,rect:Hk,star:Xk,donut:mu,triangle:Nu},palette:{spectral:cD,tableau:uD,oranges:hD,greens:dD,blues:fD},theme:{dark:N4,light:k4},plugin:{"bubble-sets":gh,"edge-bundling":mh,"edge-filter-lens":yh,"grid-line":Eh,background:sh,contextmenu:ph,fisheye:bh,fullscreen:xh,history:wh,hull:Th,legend:Ph,minimap:Rh,snapline:Lh,timebar:Vh,toolbar:Uh,tooltip:Yh,watermark:Hh},transform:{"arrange-draw-order":P4,"collapse-expand-combo":R4,"collapse-expand-node":L4,"get-edge-actual-ends":pB,"map-node-size":ad,"place-radial-labels":sd,"process-parallel-edges":od,"update-related-edges":SB},shape:{circle:Ji,ellipse:al,group:ir,html:co,image:qf,line:As,path:ri,polygon:Ts,polyline:Tc,rect:pr,text:Os,label:Ga,badge:po}};function AB(){Object.entries(MB).forEach(([r,t])=>{Object.entries(t).forEach(([e,n])=>{D4(r,e,n)})})}AB();const Cj={css:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css",js:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.js"}},13722:function(V){(function(S,A){V.exports=A()})(typeof self!="undefined"?self:this,function(){return function(Q){var S={};function A(z){if(S[z])return S[z].exports;var D=S[z]={i:z,l:!1,exports:{}};return Q[z].call(D.exports,D,D.exports,A),D.l=!0,D.exports}return A.m=Q,A.c=S,A.d=function(z,D,N){A.o(z,D)||Object.defineProperty(z,D,{configurable:!1,enumerable:!0,get:N})},A.n=function(z){var D=z&&z.__esModule?function(){return z.default}:function(){return z};return A.d(D,"a",D),D},A.o=function(z,D){return Object.prototype.hasOwnProperty.call(z,D)},A.p="",A(A.s=5)}([function(Q,S){function A(z,D,N,T){return T===void 0&&(T="height"),N==="center"?(z[T]+D[T])/2:z.height}Q.exports={assign:Object.assign,getHeight:A}},function(Q,S,A){var z=A(3),D=function(){function N(k,R){R===void 0&&(R={});var C=this;C.options=R,C.rootNode=z(k,R)}var T=N.prototype;return T.execute=function(){throw new Error("please override this method")},N}();Q.exports=D},function(Q,S,A){var z=A(4),D=["LR","RL","TB","BT","H","V"],N=["LR","RL","H"],T=function(P){return N.indexOf(P)>-1},k=D[0];Q.exports=function(C,P,I){var L=P.direction||k;if(P.isHorizontal=T(L),L&&D.indexOf(L)===-1)throw new TypeError("Invalid direction: "+L);if(L===D[0])I(C,P);else if(L===D[1])I(C,P),C.right2left();else if(L===D[2])I(C,P);else if(L===D[3])I(C,P),C.bottom2top();else if(L===D[4]||L===D[5]){var Z=z(C,P),Y=Z.left,X=Z.right;I(Y,P),I(X,P),P.isHorizontal?Y.right2left():Y.bottom2top(),X.translate(Y.x-X.x,Y.y-X.y),C.x=Y.x,C.y=X.y;var nt=C.getBoundingBox();P.isHorizontal?nt.top<0&&C.translate(0,-nt.top):nt.left<0&&C.translate(-nt.left,0)}var tt=P.fixedRoot;return tt===void 0&&(tt=!0),tt&&C.translate(-(C.x+C.width/2+C.hgap),-(C.y+C.height/2+C.vgap)),R(C,P),C};function R(C,P){if(P.radial){var I=P.isHorizontal?["x","y"]:["y","x"],L=I[0],Z=I[1],Y={x:1/0,y:1/0},X={x:-1/0,y:-1/0},nt=0;C.DFTraverse(function(it){nt++;var at=it.x,ct=it.y;Y.x=Math.min(Y.x,at),Y.y=Math.min(Y.y,ct),X.x=Math.max(X.x,at),X.y=Math.max(X.y,ct)});var tt=X[Z]-Y[Z];if(tt===0)return;var q=Math.PI*2/nt;C.DFTraverse(function(it){var at=(it[Z]-Y[Z])/tt*(Math.PI*2-q)+q,ct=it[L]-C[L];it.x=Math.cos(at)*ct,it.y=Math.sin(at)*ct})}}},function(Q,S,A){var z=A(0),D=18,N=D*2,T=D,k={getId:function(I){return I.id||I.name},getPreH:function(I){return I.preH||0},getPreV:function(I){return I.preV||0},getHGap:function(I){return I.hgap||T},getVGap:function(I){return I.vgap||T},getChildren:function(I){return I.children},getHeight:function(I){return I.height||N},getWidth:function(I){var L=I.label||" ";return I.width||L.split("").length*D}};function R(P,I){var L=this;if(L.vgap=L.hgap=0,P instanceof R)return P;L.data=P;var Z=I.getHGap(P),Y=I.getVGap(P);return L.preH=I.getPreH(P),L.preV=I.getPreV(P),L.width=I.getWidth(P),L.height=I.getHeight(P),L.width+=L.preH,L.height+=L.preV,L.id=I.getId(P),L.x=L.y=0,L.depth=0,L.children||(L.children=[]),L.addGap(Z,Y),L}z.assign(R.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(I,L){var Z=this;Z.hgap+=I,Z.vgap+=L,Z.width+=2*I,Z.height+=2*L},eachNode:function(I){for(var L=this,Z=[L],Y;Y=Z.shift();)I(Y),Z=Y.children.concat(Z)},DFTraverse:function(I){this.eachNode(I)},BFTraverse:function(I){for(var L=this,Z=[L],Y;Y=Z.shift();)I(Y),Z=Z.concat(Y.children)},getBoundingBox:function(){var I={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(L){I.left=Math.min(I.left,L.x),I.top=Math.min(I.top,L.y),I.width=Math.max(I.width,L.x+L.width),I.height=Math.max(I.height,L.y+L.height)}),I},translate:function(I,L){I===void 0&&(I=0),L===void 0&&(L=0),this.eachNode(function(Z){Z.x+=I,Z.y+=L,Z.x+=Z.preH,Z.y+=Z.preV})},right2left:function(){var I=this,L=I.getBoundingBox();I.eachNode(function(Z){Z.x=Z.x-(Z.x-L.left)*2-Z.width}),I.translate(L.width,0)},bottom2top:function(){var I=this,L=I.getBoundingBox();I.eachNode(function(Z){Z.y=Z.y-(Z.y-L.top)*2-Z.height}),I.translate(0,L.height)}});function C(P,I,L){I===void 0&&(I={}),I=z.assign({},k,I);var Z=new R(P,I),Y=[Z],X;if(!L&&!P.collapsed){for(;X=Y.shift();)if(!X.data.collapsed){var nt=I.getChildren(X.data),tt=nt?nt.length:0;if(X.children=new Array(tt),nt&&tt)for(var q=0;q<tt;q++){var it=new R(nt[q],I);X.children[q]=it,Y.push(it),it.parent=X,it.depth=X.depth+1}}}return Z}Q.exports=C},function(Q,S,A){var z=A(3);Q.exports=function(D,N){for(var T=z(D.data,N,!0),k=z(D.data,N,!0),R=D.children.length,C=Math.round(R/2),P=N.getSide||function(Y,X){return X<C?"right":"left"},I=0;I<R;I++){var L=D.children[I],Z=P(L,I);Z==="right"?k.children.push(L):T.children.push(L)}return T.eachNode(function(Y){Y.isRoot()||(Y.side="left")}),k.eachNode(function(Y){Y.isRoot()||(Y.side="right")}),{left:T,right:k}}},function(Q,S,A){var z={compactBox:A(6),dendrogram:A(8),indented:A(10),mindmap:A(12)};Q.exports=z},function(Q,S,A){function z(L,Z){L.prototype=Object.create(Z.prototype),L.prototype.constructor=L,D(L,Z)}function D(L,Z){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,X){return Y.__proto__=X,Y},D(L,Z)}var N=A(1),T=A(7),k=A(2),R=A(0),C=function(L){function Z(){return L.apply(this,arguments)||this}z(Z,L);var Y=Z.prototype;return Y.execute=function(){var nt=this;return k(nt.rootNode,nt.options,T)},Z}(N),P={};function I(L,Z){return Z=R.assign({},P,Z),new C(L,Z).execute()}Q.exports=I},function(Q,S){function A(R,C,P,I){I===void 0&&(I=[]);var L=this;L.w=R||0,L.h=C||0,L.y=P||0,L.x=0,L.c=I||[],L.cs=I.length,L.prelim=0,L.mod=0,L.shift=0,L.change=0,L.tl=null,L.tr=null,L.el=null,L.er=null,L.msel=0,L.mser=0}A.fromNode=function(R,C){if(!R)return null;var P=[];return R.children.forEach(function(I){P.push(A.fromNode(I,C))}),C?new A(R.height,R.width,R.x,P):new A(R.width,R.height,R.y,P)};function z(R,C,P){P?R.y+=C:R.x+=C,R.children.forEach(function(I){z(I,C,P)})}function D(R,C){var P=C?R.y:R.x;return R.children.forEach(function(I){P=Math.min(D(I,C),P)}),P}function N(R,C){var P=D(R,C);z(R,-P,C)}function T(R,C,P){P?C.y=R.x:C.x=R.x,R.c.forEach(function(I,L){T(I,C.children[L],P)})}function k(R,C,P){P===void 0&&(P=0),C?(R.x=P,P+=R.width):(R.y=P,P+=R.height),R.children.forEach(function(I){k(I,C,P)})}Q.exports=function(R,C){C===void 0&&(C={});var P=C.isHorizontal;function I(vt){if(vt.cs===0){L(vt);return}I(vt.c[0]);for(var Et=gt(tt(vt.c[0].el),0,null),Pt=1;Pt<vt.cs;++Pt){I(vt.c[Pt]);var zt=tt(vt.c[Pt].er);Z(vt,Pt,Et),Et=gt(zt,Pt,Et)}at(vt),L(vt)}function L(vt){vt.cs===0?(vt.el=vt,vt.er=vt,vt.msel=vt.mser=0):(vt.el=vt.c[0].el,vt.msel=vt.c[0].msel,vt.er=vt.c[vt.cs-1].er,vt.mser=vt.c[vt.cs-1].mser)}function Z(vt,Et,Pt){for(var zt=vt.c[Et-1],Vt=zt.mod,Qt=vt.c[Et],Ee=Qt.mod;zt!==null&&Qt!==null;){tt(zt)>Pt.low&&(Pt=Pt.nxt);var Re=Vt+zt.prelim+zt.w-(Ee+Qt.prelim);Re>0&&(Ee+=Re,Y(vt,Et,Pt.index,Re));var $e=tt(zt),nr=tt(Qt);$e<=nr&&(zt=nt(zt),zt!==null&&(Vt+=zt.mod)),$e>=nr&&(Qt=X(Qt),Qt!==null&&(Ee+=Qt.mod))}!zt&&Qt?q(vt,Et,Qt,Ee):zt&&!Qt&&it(vt,Et,zt,Vt)}function Y(vt,Et,Pt,zt){vt.c[Et].mod+=zt,vt.c[Et].msel+=zt,vt.c[Et].mser+=zt,ut(vt,Et,Pt,zt)}function X(vt){return vt.cs===0?vt.tl:vt.c[0]}function nt(vt){return vt.cs===0?vt.tr:vt.c[vt.cs-1]}function tt(vt){return vt.y+vt.h}function q(vt,Et,Pt,zt){var Vt=vt.c[0].el;Vt.tl=Pt;var Qt=zt-Pt.mod-vt.c[0].msel;Vt.mod+=Qt,Vt.prelim-=Qt,vt.c[0].el=vt.c[Et].el,vt.c[0].msel=vt.c[Et].msel}function it(vt,Et,Pt,zt){var Vt=vt.c[Et].er;Vt.tr=Pt;var Qt=zt-Pt.mod-vt.c[Et].mser;Vt.mod+=Qt,Vt.prelim-=Qt,vt.c[Et].er=vt.c[Et-1].er,vt.c[Et].mser=vt.c[Et-1].mser}function at(vt){vt.prelim=(vt.c[0].prelim+vt.c[0].mod+vt.c[vt.cs-1].mod+vt.c[vt.cs-1].prelim+vt.c[vt.cs-1].w)/2-vt.w/2}function ct(vt,Et){Et+=vt.mod,vt.x=vt.prelim+Et,bt(vt);for(var Pt=0;Pt<vt.cs;Pt++)ct(vt.c[Pt],Et)}function ut(vt,Et,Pt,zt){if(Pt!==Et-1){var Vt=Et-Pt;vt.c[Pt+1].shift+=zt/Vt,vt.c[Et].shift-=zt/Vt,vt.c[Et].change-=zt-zt/Vt}}function bt(vt){for(var Et=0,Pt=0,zt=0;zt<vt.cs;zt++)Et+=vt.c[zt].shift,Pt+=Et+vt.c[zt].change,vt.c[zt].mod+=Pt}function gt(vt,Et,Pt){for(;Pt!==null&&vt>=Pt.low;)Pt=Pt.nxt;return{low:vt,index:Et,nxt:Pt}}k(R,P);var wt=A.fromNode(R,P);return I(wt),ct(wt,0),T(wt,R,P),N(R,P),R}},function(Q,S,A){function z(L,Z){L.prototype=Object.create(Z.prototype),L.prototype.constructor=L,D(L,Z)}function D(L,Z){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,X){return Y.__proto__=X,Y},D(L,Z)}var N=A(1),T=A(9),k=A(2),R=A(0),C=function(L){function Z(){return L.apply(this,arguments)||this}z(Z,L);var Y=Z.prototype;return Y.execute=function(){var nt=this;return nt.rootNode.width=0,k(nt.rootNode,nt.options,T)},Z}(N),P={};function I(L,Z){return Z=R.assign({},P,Z),new C(L,Z).execute()}Q.exports=I},function(Q,S,A){var z=A(0);function D(k,R){k===void 0&&(k=0),R===void 0&&(R=[]);var C=this;C.x=C.y=0,C.leftChild=C.rightChild=null,C.height=0,C.children=R}var N={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function T(k,R,C){C?(R.x=k.x,R.y=k.y):(R.x=k.y,R.y=k.x),k.children.forEach(function(P,I){T(P,R.children[I],C)})}Q.exports=function(k,R){R===void 0&&(R={}),R=z.assign({},N,R);var C=0;function P(X){if(!X)return null;X.width=0,X.depth&&X.depth>C&&(C=X.depth);var nt=X.children,tt=nt.length,q=new D(X.height,[]);return nt.forEach(function(it,at){var ct=P(it);q.children.push(ct),at===0&&(q.leftChild=ct),at===tt-1&&(q.rightChild=ct)}),q.originNode=X,q.isLeaf=X.isLeaf(),q}function I(X){if(X.isLeaf||X.children.length===0)X.drawingDepth=C;else{var nt=X.children.map(function(q){return I(q)}),tt=Math.min.apply(null,nt);X.drawingDepth=tt-1}return X.drawingDepth}var L;function Z(X){X.x=X.drawingDepth*R.rankSep,X.isLeaf?(X.y=0,L&&(X.y=L.y+L.height+R.nodeSep,X.originNode.parent!==L.originNode.parent&&(X.y+=R.subTreeSep)),L=X):(X.children.forEach(function(nt){Z(nt)}),X.y=(X.leftChild.y+X.rightChild.y)/2)}var Y=P(k);return I(Y),Z(Y),T(Y,k,R.isHorizontal),k}},function(Q,S,A){function z(Y,X){Y.prototype=Object.create(X.prototype),Y.prototype.constructor=Y,D(Y,X)}function D(Y,X){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,tt){return nt.__proto__=tt,nt},D(Y,X)}var N=A(1),T=A(11),k=A(4),R=A(0),C=["LR","RL","H"],P=C[0],I=function(Y){function X(){return Y.apply(this,arguments)||this}z(X,Y);var nt=X.prototype;return nt.execute=function(){var q=this,it=q.options,at=q.rootNode;it.isHorizontal=!0;var ct=it.indent,ut=ct===void 0?20:ct,bt=it.dropCap,gt=bt===void 0?!0:bt,wt=it.direction,vt=wt===void 0?P:wt,Et=it.align;if(vt&&C.indexOf(vt)===-1)throw new TypeError("Invalid direction: "+vt);if(vt===C[0])T(at,ut,gt,Et);else if(vt===C[1])T(at,ut,gt,Et),at.right2left();else if(vt===C[2]){var Pt=k(at,it),zt=Pt.left,Vt=Pt.right;T(zt,ut,gt,Et),zt.right2left(),T(Vt,ut,gt,Et);var Qt=zt.getBoundingBox();Vt.translate(Qt.width,0),at.x=Vt.x-at.width/2}return at},X}(N),L={};function Z(Y,X){return X=R.assign({},L,X),new I(Y,X).execute()}Q.exports=Z},function(Q,S,A){var z=A(0);function D(N,T,k,R,C){var P=(typeof k=="function"?k(N):k)*N.depth;if(!R)try{if(N.id===N.parent.children[0].id){N.x+=P,N.y=T?T.y:0;return}}catch(Z){}if(N.x+=P,T){if(N.y=T.y+z.getHeight(T,N,C),T.parent&&N.parent.id!==T.parent.id){var I=T.parent,L=I.y+z.getHeight(I,N,C);N.y=L>N.y?L:N.y}}else N.y=0}Q.exports=function(N,T,k,R){var C=null;N.eachNode(function(P){D(P,C,T,k,R),C=P})}},function(Q,S,A){function z(L,Z){L.prototype=Object.create(Z.prototype),L.prototype.constructor=L,D(L,Z)}function D(L,Z){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,X){return Y.__proto__=X,Y},D(L,Z)}var N=A(1),T=A(13),k=A(2),R=A(0),C=function(L){function Z(){return L.apply(this,arguments)||this}z(Z,L);var Y=Z.prototype;return Y.execute=function(){var nt=this;return k(nt.rootNode,nt.options,T)},Z}(N),P={};function I(L,Z){return Z=R.assign({},P,Z),new C(L,Z).execute()}Q.exports=I},function(Q,S,A){var z=A(0);function D(k,R){var C=0;return k.children.length?k.children.forEach(function(P){C+=D(P,R)}):C=k.height,k._subTreeSep=R.getSubTreeSep(k.data),k.totalHeight=Math.max(k.height,C)+2*k._subTreeSep,k.totalHeight}function N(k){var R=k.children,C=R.length;if(C){R.forEach(function(X){N(X)});var P=R[0],I=R[C-1],L=I.y-P.y+I.height,Z=0;if(R.forEach(function(X){Z+=X.totalHeight}),L>k.height)k.y=P.y+L/2-k.height/2;else if(R.length!==1||k.height>Z){var Y=k.y+(k.height-L)/2-P.y;R.forEach(function(X){X.translate(0,Y)})}else k.y=(P.y+P.height/2+I.y+I.height/2)/2-k.height/2}}var T={getSubTreeSep:function(){return 0}};Q.exports=function(k,R){R===void 0&&(R={}),R=z.assign({},T,R),k.parent={x:0,width:0,height:0,y:0},k.BFTraverse(function(C){C.x=C.parent.x+C.parent.width}),k.parent=null,D(k,R),k.startY=0,k.y=k.totalHeight/2-k.height/2,k.eachNode(function(C){var P=C.children,I=P.length;if(I){var L=P[0];if(L.startY=C.startY+C._subTreeSep,I===1)L.y=C.y+C.height/2-L.height/2;else{L.y=L.startY+L.totalHeight/2-L.height/2;for(var Z=1;Z<I;Z++){var Y=P[Z];Y.startY=P[Z-1].startY+P[Z-1].totalHeight,Y.y=Y.startY+Y.totalHeight/2-Y.height/2}}}}),N(k)}}])})},32168:function(V,Q,S){"use strict";var A=S(59301),z=S(42441),D=S(48961),N=S.n(D),T=Object.defineProperty,k=Object.defineProperties,R=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,L=(q,it,at)=>it in q?T(q,it,{enumerable:!0,configurable:!0,writable:!0,value:at}):q[it]=at,Z=(q,it)=>{for(var at in it||(it={}))P.call(it,at)&&L(q,at,it[at]);if(C)for(var at of C(it))I.call(it,at)&&L(q,at,it[at]);return q},Y=(q,it)=>k(q,R(it));function X(q,it,at=1/3,ct){let ut=q*Math.PI*2,bt=it*Math.PI*2;return{u:{min:-Math.PI,max:Math.PI*3,step:Math.PI/32},v:{min:0,max:Math.PI*2,step:Math.PI/20},x:function(gt,wt){return gt<ut?Math.cos(ut)*(1+Math.cos(wt)*at):gt>bt?Math.cos(bt)*(1+Math.cos(wt)*at):Math.cos(gt)*(1+Math.cos(wt)*at)},y:function(gt,wt){return gt<ut?Math.sin(ut)*(1+Math.cos(wt)*at):gt>bt?Math.sin(bt)*(1+Math.cos(wt)*at):Math.sin(gt)*(1+Math.cos(wt)*at)},z:function(gt,wt){return gt<-Math.PI*.5?Math.sin(gt):gt>Math.PI*2.5?Math.sin(gt)*ct*.1:Math.sin(wt)>0?1*ct*.1:-1}}}function nt({pieData:q=[],internalDiameterRatio:it=1/3}){var at,ct,ut,bt;const gt=[],wt=q==null?void 0:q.reduce((Vt,Qt)=>(Vt||0)+((Qt==null?void 0:Qt.value)||0),0);let vt=0,Et=0;const Pt=[];for(let Vt=0;Vt<(q==null?void 0:q.length);Vt++){Et=vt+(wt==0?1:((at=q==null?void 0:q[Vt])==null?void 0:at.value)||0);const Qt={itemStyle:((ct=q==null?void 0:q[Vt])==null?void 0:ct.itemStyle)||{},name:((ut=q==null?void 0:q[Vt])==null?void 0:ut.name)||`name${Vt}`,type:"surface",parametric:!0,parametricEquation:X(vt/(wt||(q==null?void 0:q.length)),Et/(wt||(q==null?void 0:q.length)),it,((bt=q==null?void 0:q[Vt])==null?void 0:bt.value)||(wt==0?25:0)),wireframe:{show:!1},pieData:q==null?void 0:q[Vt]};Pt.push(Qt.name),gt.push(Qt),vt=Et}return gt.push({name:"pie2d",type:"pie",showEmptyCircle:!0,label:{show:!0,formatter:Vt=>`${Vt.value}
${Vt.name}`},startAngle:-35,radius:["49%","50%"],center:["50%","40%"],data:[...q||[]].reverse(),itemStyle:{opacity:0}}),{legend:{left:"50%",top:"center",textStyle:{fontSize:12},data:Pt},xAxis3D:{},yAxis3D:{},zAxis3D:{},grid3D:{viewControl:{alpha:45,rotateSensitivity:0,zoomSensitivity:0,panSensitivity:0,autoRotate:!1},left:"center",top:"-10%",show:!1,boxHeight:25},series:gt}}const tt=({dataSource:q=[{name:"\u638C\u63E1\u738780%~100%",value:0,itemStyle:{color:"rgb(223,209,38)"}},{name:"\u638C\u63D0\u738760%~79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"\u638C\u63A8\u738759%\u4EE5\u4E0B",value:0,itemStyle:{color:"rgb(6,110,247)"}}],className:it="",style:at={},legend:ct={},internalDiameterRatio:ut=1/3})=>{const[bt,gt]=(0,A.useState)([]),wt=(0,A.useCallback)(Pt=>{const zt=Pt.selected||{},Vt=q.map(Qt=>Qt.name).filter(Qt=>zt[Qt]===!1);gt(Vt)},[q]),vt=(0,A.useMemo)(()=>q.filter(Pt=>!bt.includes(Pt.name)),[q,bt]),Et=(0,A.useMemo)(()=>{const Pt=nt({pieData:vt,internalDiameterRatio:ut}),zt=q.map(Qt=>Qt.name),Vt=q.reduce((Qt,Ee)=>(Qt[Ee.name]=!bt.includes(Ee.name),Qt),{});return Pt.legend=Y(Z(Z({},Pt.legend),ct),{data:zt,selected:Vt}),Pt},[vt,ct,ut,q,bt]);return A.createElement(z.Z,{onEvents:{legendselectchanged:wt},className:`w-full h-full ${it}`,option:Et,style:Z({height:"100%"},at)})};Q.Z=tt},13377:function(V,Q,S){"use strict";var A,z=Object.defineProperty,D=U=>{throw TypeError(U)},N=Math.pow,T=(U,x,E)=>x in U?z(U,x,{enumerable:!0,configurable:!0,writable:!0,value:E}):U[x]=E,k=(U,x,E)=>T(U,typeof x!="symbol"?x+"":x,E),R=(U,x,E)=>x.has(U)||D("Cannot "+E),C=(U,x,E)=>(R(U,x,"read from private field"),E?E.call(U):x.get(U)),P=(U,x,E)=>x.has(U)?D("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(U):x.set(U,E),I=(U,x,E,m)=>(R(U,x,"write to private field"),m?m.call(U,E):x.set(U,E),E),L=(U,x,E)=>(R(U,x,"access private method"),E),Z,Y,X;A={value:!0};var nt=S(34634),tt=S(34402);const q=" ".repeat(2),it=" ".repeat(4);function at(){return ct(this)}function ct(U,x={}){const{maxRows:E=15,maxColumns:m=10,maxNumSize:M=8,padMinus:B="auto"}=x;return`${U.constructor.name} {
${q}[
${it}${ut(U,E,m,M,B)}
${q}]
${q}rows: ${U.rows}
${q}columns: ${U.columns}
}`}function ut(U,x,E,m,M){const{rows:B,columns:J}=U,$=Math.min(B,x),st=Math.min(J,E),ot=[];if(M==="auto"){M=!1;t:for(let Tt=0;Tt<$;Tt++)for(let ft=0;ft<st;ft++)if(U.get(Tt,ft)<0){M=!0;break t}}for(let Tt=0;Tt<$;Tt++){let ft=[];for(let Ft=0;Ft<st;Ft++)ft.push(bt(U.get(Tt,Ft),m,M));ot.push(`${ft.join(" ")}`)}return st!==J&&(ot[ot.length-1]+=` ... ${J-E} more columns`),$!==B&&ot.push(`... ${B-x} more rows`),ot.join(`
${it}`)}function bt(U,x,E){return(U>=0&&E?` ${gt(U,x-1)}`:gt(U,x)).padEnd(x)}function gt(U,x){let E=U.toString();if(E.length<=x)return E;let m=U.toFixed(x);if(m.length>x&&(m=U.toFixed(Math.max(0,x-(m.length-x)))),m.length<=x&&!m.startsWith("0.000")&&!m.startsWith("-0.000"))return m;let M=U.toExponential(x);return M.length>x&&(M=U.toExponential(Math.max(0,x-(M.length-x)))),M.slice(0)}function wt(U,x){U.prototype.add=function(m){return typeof m=="number"?this.addS(m):this.addM(m)},U.prototype.addS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)+m);return this},U.prototype.addM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)+m.get(M,B));return this},U.add=function(m,M){return new x(m).add(M)},U.prototype.sub=function(m){return typeof m=="number"?this.subS(m):this.subM(m)},U.prototype.subS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)-m);return this},U.prototype.subM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)-m.get(M,B));return this},U.sub=function(m,M){return new x(m).sub(M)},U.prototype.subtract=U.prototype.sub,U.prototype.subtractS=U.prototype.subS,U.prototype.subtractM=U.prototype.subM,U.subtract=U.sub,U.prototype.mul=function(m){return typeof m=="number"?this.mulS(m):this.mulM(m)},U.prototype.mulS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)*m);return this},U.prototype.mulM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)*m.get(M,B));return this},U.mul=function(m,M){return new x(m).mul(M)},U.prototype.multiply=U.prototype.mul,U.prototype.multiplyS=U.prototype.mulS,U.prototype.multiplyM=U.prototype.mulM,U.multiply=U.mul,U.prototype.div=function(m){return typeof m=="number"?this.divS(m):this.divM(m)},U.prototype.divS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)/m);return this},U.prototype.divM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)/m.get(M,B));return this},U.div=function(m,M){return new x(m).div(M)},U.prototype.divide=U.prototype.div,U.prototype.divideS=U.prototype.divS,U.prototype.divideM=U.prototype.divM,U.divide=U.div,U.prototype.mod=function(m){return typeof m=="number"?this.modS(m):this.modM(m)},U.prototype.modS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)%m);return this},U.prototype.modM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)%m.get(M,B));return this},U.mod=function(m,M){return new x(m).mod(M)},U.prototype.modulus=U.prototype.mod,U.prototype.modulusS=U.prototype.modS,U.prototype.modulusM=U.prototype.modM,U.modulus=U.mod,U.prototype.and=function(m){return typeof m=="number"?this.andS(m):this.andM(m)},U.prototype.andS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)&m);return this},U.prototype.andM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)&m.get(M,B));return this},U.and=function(m,M){return new x(m).and(M)},U.prototype.or=function(m){return typeof m=="number"?this.orS(m):this.orM(m)},U.prototype.orS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)|m);return this},U.prototype.orM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)|m.get(M,B));return this},U.or=function(m,M){return new x(m).or(M)},U.prototype.xor=function(m){return typeof m=="number"?this.xorS(m):this.xorM(m)},U.prototype.xorS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)^m);return this},U.prototype.xorM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)^m.get(M,B));return this},U.xor=function(m,M){return new x(m).xor(M)},U.prototype.leftShift=function(m){return typeof m=="number"?this.leftShiftS(m):this.leftShiftM(m)},U.prototype.leftShiftS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)<<m);return this},U.prototype.leftShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)<<m.get(M,B));return this},U.leftShift=function(m,M){return new x(m).leftShift(M)},U.prototype.signPropagatingRightShift=function(m){return typeof m=="number"?this.signPropagatingRightShiftS(m):this.signPropagatingRightShiftM(m)},U.prototype.signPropagatingRightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)>>m);return this},U.prototype.signPropagatingRightShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)>>m.get(M,B));return this},U.signPropagatingRightShift=function(m,M){return new x(m).signPropagatingRightShift(M)},U.prototype.rightShift=function(m){return typeof m=="number"?this.rightShiftS(m):this.rightShiftM(m)},U.prototype.rightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)>>>m);return this},U.prototype.rightShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,this.get(M,B)>>>m.get(M,B));return this},U.rightShift=function(m,M){return new x(m).rightShift(M)},U.prototype.zeroFillRightShift=U.prototype.rightShift,U.prototype.zeroFillRightShiftS=U.prototype.rightShiftS,U.prototype.zeroFillRightShiftM=U.prototype.rightShiftM,U.zeroFillRightShift=U.rightShift,U.prototype.not=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,~this.get(m,M));return this},U.not=function(m){return new x(m).not()},U.prototype.abs=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.abs(this.get(m,M)));return this},U.abs=function(m){return new x(m).abs()},U.prototype.acos=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.acos(this.get(m,M)));return this},U.acos=function(m){return new x(m).acos()},U.prototype.acosh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.acosh(this.get(m,M)));return this},U.acosh=function(m){return new x(m).acosh()},U.prototype.asin=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.asin(this.get(m,M)));return this},U.asin=function(m){return new x(m).asin()},U.prototype.asinh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.asinh(this.get(m,M)));return this},U.asinh=function(m){return new x(m).asinh()},U.prototype.atan=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.atan(this.get(m,M)));return this},U.atan=function(m){return new x(m).atan()},U.prototype.atanh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.atanh(this.get(m,M)));return this},U.atanh=function(m){return new x(m).atanh()},U.prototype.cbrt=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cbrt(this.get(m,M)));return this},U.cbrt=function(m){return new x(m).cbrt()},U.prototype.ceil=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.ceil(this.get(m,M)));return this},U.ceil=function(m){return new x(m).ceil()},U.prototype.clz32=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.clz32(this.get(m,M)));return this},U.clz32=function(m){return new x(m).clz32()},U.prototype.cos=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cos(this.get(m,M)));return this},U.cos=function(m){return new x(m).cos()},U.prototype.cosh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cosh(this.get(m,M)));return this},U.cosh=function(m){return new x(m).cosh()},U.prototype.exp=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.exp(this.get(m,M)));return this},U.exp=function(m){return new x(m).exp()},U.prototype.expm1=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.expm1(this.get(m,M)));return this},U.expm1=function(m){return new x(m).expm1()},U.prototype.floor=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.floor(this.get(m,M)));return this},U.floor=function(m){return new x(m).floor()},U.prototype.fround=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.fround(this.get(m,M)));return this},U.fround=function(m){return new x(m).fround()},U.prototype.log=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log(this.get(m,M)));return this},U.log=function(m){return new x(m).log()},U.prototype.log1p=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log1p(this.get(m,M)));return this},U.log1p=function(m){return new x(m).log1p()},U.prototype.log10=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log10(this.get(m,M)));return this},U.log10=function(m){return new x(m).log10()},U.prototype.log2=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log2(this.get(m,M)));return this},U.log2=function(m){return new x(m).log2()},U.prototype.round=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.round(this.get(m,M)));return this},U.round=function(m){return new x(m).round()},U.prototype.sign=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sign(this.get(m,M)));return this},U.sign=function(m){return new x(m).sign()},U.prototype.sin=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sin(this.get(m,M)));return this},U.sin=function(m){return new x(m).sin()},U.prototype.sinh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sinh(this.get(m,M)));return this},U.sinh=function(m){return new x(m).sinh()},U.prototype.sqrt=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sqrt(this.get(m,M)));return this},U.sqrt=function(m){return new x(m).sqrt()},U.prototype.tan=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.tan(this.get(m,M)));return this},U.tan=function(m){return new x(m).tan()},U.prototype.tanh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.tanh(this.get(m,M)));return this},U.tanh=function(m){return new x(m).tanh()},U.prototype.trunc=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.trunc(this.get(m,M)));return this},U.trunc=function(m){return new x(m).trunc()},U.pow=function(m,M){return new x(m).pow(M)},U.prototype.pow=function(m){return typeof m=="number"?this.powS(m):this.powM(m)},U.prototype.powS=function(m){for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,N(this.get(M,B),m));return this},U.prototype.powM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let B=0;B<this.columns;B++)this.set(M,B,N(this.get(M,B),m.get(M,B)));return this}}function vt(U,x,E){let m=E?U.rows:U.rows-1;if(x<0||x>m)throw new RangeError("Row index out of range")}function Et(U,x,E){let m=E?U.columns:U.columns-1;if(x<0||x>m)throw new RangeError("Column index out of range")}function Pt(U,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==U.columns)throw new RangeError("vector size must be the same as the number of columns");return x}function zt(U,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==U.rows)throw new RangeError("vector size must be the same as the number of rows");return x}function Vt(U,x){if(!nt.isAnyArray(x))throw new TypeError("row indices must be an array");for(let E=0;E<x.length;E++)if(x[E]<0||x[E]>=U.rows)throw new RangeError("row indices are out of range")}function Qt(U,x){if(!nt.isAnyArray(x))throw new TypeError("column indices must be an array");for(let E=0;E<x.length;E++)if(x[E]<0||x[E]>=U.columns)throw new RangeError("column indices are out of range")}function Ee(U,x,E,m,M){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if($e("startRow",x),$e("endRow",E),$e("startColumn",m),$e("endColumn",M),x>E||m>M||x<0||x>=U.rows||E<0||E>=U.rows||m<0||m>=U.columns||M<0||M>=U.columns)throw new RangeError("Submatrix indices are out of range")}function Re(U,x=0){let E=[];for(let m=0;m<U;m++)E.push(x);return E}function $e(U,x){if(typeof x!="number")throw new TypeError(`${U} must be a number`)}function nr(U){if(U.isEmpty())throw new Error("Empty matrix has no elements to index")}function ti(U){let x=Re(U.rows);for(let E=0;E<U.rows;++E)for(let m=0;m<U.columns;++m)x[E]+=U.get(E,m);return x}function la(U){let x=Re(U.columns);for(let E=0;E<U.rows;++E)for(let m=0;m<U.columns;++m)x[m]+=U.get(E,m);return x}function ss(U){let x=0;for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)x+=U.get(E,m);return x}function Rt(U){let x=Re(U.rows,1);for(let E=0;E<U.rows;++E)for(let m=0;m<U.columns;++m)x[E]*=U.get(E,m);return x}function Dt(U){let x=Re(U.columns,1);for(let E=0;E<U.rows;++E)for(let m=0;m<U.columns;++m)x[m]*=U.get(E,m);return x}function It(U){let x=1;for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)x*=U.get(E,m);return x}function dt(U,x,E){const m=U.rows,M=U.columns,B=[];for(let J=0;J<m;J++){let $=0,st=0,ot=0;for(let Tt=0;Tt<M;Tt++)ot=U.get(J,Tt)-E[J],$+=ot,st+=ot*ot;x?B.push((st-$*$/M)/(M-1)):B.push((st-$*$/M)/M)}return B}function St(U,x,E){const m=U.rows,M=U.columns,B=[];for(let J=0;J<M;J++){let $=0,st=0,ot=0;for(let Tt=0;Tt<m;Tt++)ot=U.get(Tt,J)-E[J],$+=ot,st+=ot*ot;x?B.push((st-$*$/m)/(m-1)):B.push((st-$*$/m)/m)}return B}function Ot(U,x,E){const m=U.rows,M=U.columns,B=m*M;let J=0,$=0,st=0;for(let ot=0;ot<m;ot++)for(let Tt=0;Tt<M;Tt++)st=U.get(ot,Tt)-E,J+=st,$+=st*st;return x?($-J*J/B)/(B-1):($-J*J/B)/B}function Gt(U,x){for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)U.set(E,m,U.get(E,m)-x[E])}function se(U,x){for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)U.set(E,m,U.get(E,m)-x[m])}function be(U,x){for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)U.set(E,m,U.get(E,m)-x)}function de(U){const x=[];for(let E=0;E<U.rows;E++){let m=0;for(let M=0;M<U.columns;M++)m+=N(U.get(E,M),2)/(U.columns-1);x.push(Math.sqrt(m))}return x}function Le(U,x){for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)U.set(E,m,U.get(E,m)/x[E])}function Mn(U){const x=[];for(let E=0;E<U.columns;E++){let m=0;for(let M=0;M<U.rows;M++)m+=N(U.get(M,E),2)/(U.rows-1);x.push(Math.sqrt(m))}return x}function Nn(U,x){for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)U.set(E,m,U.get(E,m)/x[m])}function ke(U){const x=U.size-1;let E=0;for(let m=0;m<U.columns;m++)for(let M=0;M<U.rows;M++)E+=N(U.get(M,m),2)/x;return Math.sqrt(E)}function Se(U,x){for(let E=0;E<U.rows;E++)for(let m=0;m<U.columns;m++)U.set(E,m,U.get(E,m)/x)}class re{static from1DArray(x,E,m){if(x*E!==m.length)throw new RangeError("data length does not match given dimensions");let B=new ne(x,E);for(let J=0;J<x;J++)for(let $=0;$<E;$++)B.set(J,$,m[J*E+$]);return B}static rowVector(x){let E=new ne(1,x.length);for(let m=0;m<x.length;m++)E.set(0,m,x[m]);return E}static columnVector(x){let E=new ne(x.length,1);for(let m=0;m<x.length;m++)E.set(m,0,x[m]);return E}static zeros(x,E){return new ne(x,E)}static ones(x,E){return new ne(x,E).fill(1)}static rand(x,E,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{random:M=Math.random}=m;let B=new ne(x,E);for(let J=0;J<x;J++)for(let $=0;$<E;$++)B.set(J,$,M());return B}static randInt(x,E,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{min:M=0,max:B=1e3,random:J=Math.random}=m;if(!Number.isInteger(M))throw new TypeError("min must be an integer");if(!Number.isInteger(B))throw new TypeError("max must be an integer");if(M>=B)throw new RangeError("min must be smaller than max");let $=B-M,st=new ne(x,E);for(let ot=0;ot<x;ot++)for(let Tt=0;Tt<E;Tt++){let ft=M+Math.round(J()*$);st.set(ot,Tt,ft)}return st}static eye(x,E,m){E===void 0&&(E=x),m===void 0&&(m=1);let M=Math.min(x,E),B=this.zeros(x,E);for(let J=0;J<M;J++)B.set(J,J,m);return B}static diag(x,E,m){let M=x.length;E===void 0&&(E=M),m===void 0&&(m=E);let B=Math.min(M,E,m),J=this.zeros(E,m);for(let $=0;$<B;$++)J.set($,$,x[$]);return J}static min(x,E){x=this.checkMatrix(x),E=this.checkMatrix(E);let m=x.rows,M=x.columns,B=new ne(m,M);for(let J=0;J<m;J++)for(let $=0;$<M;$++)B.set(J,$,Math.min(x.get(J,$),E.get(J,$)));return B}static max(x,E){x=this.checkMatrix(x),E=this.checkMatrix(E);let m=x.rows,M=x.columns,B=new this(m,M);for(let J=0;J<m;J++)for(let $=0;$<M;$++)B.set(J,$,Math.max(x.get(J,$),E.get(J,$)));return B}static checkMatrix(x){return re.isMatrix(x)?x:new ne(x)}static isMatrix(x){return x!=null&&x.klass==="Matrix"}get size(){return this.rows*this.columns}apply(x){if(typeof x!="function")throw new TypeError("callback must be a function");for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)x.call(this,E,m);return this}to1DArray(){let x=[];for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)x.push(this.get(E,m));return x}to2DArray(){let x=[];for(let E=0;E<this.rows;E++){x.push([]);for(let m=0;m<this.columns;m++)x[E].push(this.get(E,m))}return x}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let x=0;x<this.rows;x++)for(let E=0;E<=x;E++)if(this.get(x,E)!==this.get(E,x))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let x=0;x<this.rows;x++)if(this.get(x,x)!==0)return!1;return!0}isEchelonForm(){let x=0,E=0,m=-1,M=!0,B=!1;for(;x<this.rows&&M;){for(E=0,B=!1;E<this.columns&&B===!1;)this.get(x,E)===0?E++:this.get(x,E)===1&&E>m?(B=!0,m=E):(M=!1,B=!0);x++}return M}isReducedEchelonForm(){let x=0,E=0,m=-1,M=!0,B=!1;for(;x<this.rows&&M;){for(E=0,B=!1;E<this.columns&&B===!1;)this.get(x,E)===0?E++:this.get(x,E)===1&&E>m?(B=!0,m=E):(M=!1,B=!0);for(let J=E+1;J<this.rows;J++)this.get(x,J)!==0&&(M=!1);x++}return M}echelonForm(){let x=this.clone(),E=0,m=0;for(;E<x.rows&&m<x.columns;){let M=E;for(let B=E;B<x.rows;B++)x.get(B,m)>x.get(M,m)&&(M=B);if(x.get(M,m)===0)m++;else{x.swapRows(E,M);let B=x.get(E,m);for(let J=m;J<x.columns;J++)x.set(E,J,x.get(E,J)/B);for(let J=E+1;J<x.rows;J++){let $=x.get(J,m)/x.get(E,m);x.set(J,m,0);for(let st=m+1;st<x.columns;st++)x.set(J,st,x.get(J,st)-x.get(E,st)*$)}E++,m++}}return x}reducedEchelonForm(){let x=this.echelonForm(),E=x.columns,m=x.rows,M=m-1;for(;M>=0;)if(x.maxRow(M)===0)M--;else{let B=0,J=!1;for(;B<m&&J===!1;)x.get(M,B)===1?J=!0:B++;for(let $=0;$<M;$++){let st=x.get($,B);for(let ot=B;ot<E;ot++){let Tt=x.get($,ot)-st*x.get(M,ot);x.set($,ot,Tt)}}M--}return x}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{rows:E=1,columns:m=1}=x;if(!Number.isInteger(E)||E<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(m)||m<=0)throw new TypeError("columns must be a positive integer");let M=new ne(this.rows*E,this.columns*m);for(let B=0;B<E;B++)for(let J=0;J<m;J++)M.setSubMatrix(this,this.rows*B,this.columns*J);return M}fill(x){for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,x);return this}neg(){return this.mulS(-1)}getRow(x){vt(this,x);let E=[];for(let m=0;m<this.columns;m++)E.push(this.get(x,m));return E}getRowVector(x){return ne.rowVector(this.getRow(x))}setRow(x,E){vt(this,x),E=Pt(this,E);for(let m=0;m<this.columns;m++)this.set(x,m,E[m]);return this}swapRows(x,E){vt(this,x),vt(this,E);for(let m=0;m<this.columns;m++){let M=this.get(x,m);this.set(x,m,this.get(E,m)),this.set(E,m,M)}return this}getColumn(x){Et(this,x);let E=[];for(let m=0;m<this.rows;m++)E.push(this.get(m,x));return E}getColumnVector(x){return ne.columnVector(this.getColumn(x))}setColumn(x,E){Et(this,x),E=zt(this,E);for(let m=0;m<this.rows;m++)this.set(m,x,E[m]);return this}swapColumns(x,E){Et(this,x),Et(this,E);for(let m=0;m<this.rows;m++){let M=this.get(m,x);this.set(m,x,this.get(m,E)),this.set(m,E,M)}return this}addRowVector(x){x=Pt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)+x[m]);return this}subRowVector(x){x=Pt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)-x[m]);return this}mulRowVector(x){x=Pt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)*x[m]);return this}divRowVector(x){x=Pt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)/x[m]);return this}addColumnVector(x){x=zt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)+x[E]);return this}subColumnVector(x){x=zt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)-x[E]);return this}mulColumnVector(x){x=zt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)*x[E]);return this}divColumnVector(x){x=zt(this,x);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)this.set(E,m,this.get(E,m)/x[E]);return this}mulRow(x,E){vt(this,x);for(let m=0;m<this.columns;m++)this.set(x,m,this.get(x,m)*E);return this}mulColumn(x,E){Et(this,x);for(let m=0;m<this.rows;m++)this.set(m,x,this.get(m,x)*E);return this}max(x){if(this.isEmpty())return NaN;switch(x){case"row":{const E=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>E[m]&&(E[m]=this.get(m,M));return E}case"column":{const E=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>E[M]&&(E[M]=this.get(m,M));return E}case void 0:{let E=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>E&&(E=this.get(m,M));return E}default:throw new Error(`invalid option: ${x}`)}}maxIndex(){nr(this);let x=this.get(0,0),E=[0,0];for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>x&&(x=this.get(m,M),E[0]=m,E[1]=M);return E}min(x){if(this.isEmpty())return NaN;switch(x){case"row":{const E=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<E[m]&&(E[m]=this.get(m,M));return E}case"column":{const E=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<E[M]&&(E[M]=this.get(m,M));return E}case void 0:{let E=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<E&&(E=this.get(m,M));return E}default:throw new Error(`invalid option: ${x}`)}}minIndex(){nr(this);let x=this.get(0,0),E=[0,0];for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<x&&(x=this.get(m,M),E[0]=m,E[1]=M);return E}maxRow(x){if(vt(this,x),this.isEmpty())return NaN;let E=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)>E&&(E=this.get(x,m));return E}maxRowIndex(x){vt(this,x),nr(this);let E=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)>E&&(E=this.get(x,M),m[1]=M);return m}minRow(x){if(vt(this,x),this.isEmpty())return NaN;let E=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)<E&&(E=this.get(x,m));return E}minRowIndex(x){vt(this,x),nr(this);let E=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)<E&&(E=this.get(x,M),m[1]=M);return m}maxColumn(x){if(Et(this,x),this.isEmpty())return NaN;let E=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)>E&&(E=this.get(m,x));return E}maxColumnIndex(x){Et(this,x),nr(this);let E=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)>E&&(E=this.get(M,x),m[0]=M);return m}minColumn(x){if(Et(this,x),this.isEmpty())return NaN;let E=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)<E&&(E=this.get(m,x));return E}minColumnIndex(x){Et(this,x),nr(this);let E=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)<E&&(E=this.get(M,x),m[0]=M);return m}diag(){let x=Math.min(this.rows,this.columns),E=[];for(let m=0;m<x;m++)E.push(this.get(m,m));return E}norm(x="frobenius"){switch(x){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${x}`)}}cumulativeSum(){let x=0;for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)x+=this.get(E,m),this.set(E,m,x);return this}dot(x){re.isMatrix(x)&&(x=x.to1DArray());let E=this.to1DArray();if(E.length!==x.length)throw new RangeError("vectors do not have the same size");let m=0;for(let M=0;M<E.length;M++)m+=E[M]*x[M];return m}mmul(x){x=ne.checkMatrix(x);let E=this.rows,m=this.columns,M=x.columns,B=new ne(E,M),J=new Float64Array(m);for(let $=0;$<M;$++){for(let st=0;st<m;st++)J[st]=x.get(st,$);for(let st=0;st<E;st++){let ot=0;for(let Tt=0;Tt<m;Tt++)ot+=this.get(st,Tt)*J[Tt];B.set(st,$,ot)}}return B}mpow(x){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(x)||x<0)throw new RangeError("Exponent must be a non-negative integer");let E=ne.eye(this.rows),m=this;for(let M=x;M>=1;M/=2)M&1&&(E=E.mmul(m)),m=m.mmul(m);return E}strassen2x2(x){x=ne.checkMatrix(x);let E=new ne(2,2);const m=this.get(0,0),M=x.get(0,0),B=this.get(0,1),J=x.get(0,1),$=this.get(1,0),st=x.get(1,0),ot=this.get(1,1),Tt=x.get(1,1),ft=(m+ot)*(M+Tt),Ft=($+ot)*M,qt=m*(J-Tt),Lt=ot*(st-M),Zt=(m+B)*Tt,oe=($-m)*(M+J),mt=(B-ot)*(st+Tt),Wt=ft+Lt-Zt+mt,he=qt+Zt,we=Ft+Lt,Ae=ft-Ft+qt+oe;return E.set(0,0,Wt),E.set(0,1,he),E.set(1,0,we),E.set(1,1,Ae),E}strassen3x3(x){x=ne.checkMatrix(x);let E=new ne(3,3);const m=this.get(0,0),M=this.get(0,1),B=this.get(0,2),J=this.get(1,0),$=this.get(1,1),st=this.get(1,2),ot=this.get(2,0),Tt=this.get(2,1),ft=this.get(2,2),Ft=x.get(0,0),qt=x.get(0,1),Lt=x.get(0,2),Zt=x.get(1,0),oe=x.get(1,1),mt=x.get(1,2),Wt=x.get(2,0),he=x.get(2,1),we=x.get(2,2),Ae=(m+M+B-J-$-Tt-ft)*oe,cn=(m-J)*(-qt+oe),ge=$*(-Ft+qt+Zt-oe-mt-Wt+we),xe=(-m+J+$)*(Ft-qt+oe),Ze=(J+$)*(-Ft+qt),Mt=m*Ft,Yt=(-m+ot+Tt)*(Ft-Lt+mt),Jt=(-m+ot)*(Lt-mt),Ht=(ot+Tt)*(-Ft+Lt),dn=(m+M+B-$-st-ot-Tt)*mt,Je=Tt*(-Ft+Lt+Zt-oe-mt-Wt+he),un=(-B+Tt+ft)*(oe+Wt-he),fn=(B-ft)*(oe-he),rr=B*Wt,Hn=(Tt+ft)*(-Wt+he),vn=(-B+$+st)*(mt+Wt-we),ei=(B-st)*(mt-we),fi=($+st)*(-Wt+we),je=M*Zt,Bn=st*he,Tr=J*Lt,_r=ot*qt,Tn=ft*we,Ca=Mt+rr+je,Js=Ae+xe+Ze+Mt+un+rr+Hn,md=Mt+Yt+Ht+dn+rr+vn+fi,yd=cn+ge+xe+Mt+rr+vn+ei,ds=cn+xe+Ze+Mt+Bn,Wo=rr+vn+ei+fi+Tr,bd=Mt+Yt+Jt+Je+un+fn+rr,Kl=un+fn+rr+Hn+_r,xd=Mt+Yt+Jt+Ht+Tn;return E.set(0,0,Ca),E.set(0,1,Js),E.set(0,2,md),E.set(1,0,yd),E.set(1,1,ds),E.set(1,2,Wo),E.set(2,0,bd),E.set(2,1,Kl),E.set(2,2,xd),E}mmulStrassen(x){x=ne.checkMatrix(x);let E=this.clone(),m=E.rows,M=E.columns,B=x.rows,J=x.columns;M!==B&&console.warn(`Multiplying ${m} x ${M} and ${B} x ${J} matrix: dimensions do not match.`);function $(ft,Ft,qt){let Lt=ft.rows,Zt=ft.columns;if(Lt===Ft&&Zt===qt)return ft;{let oe=re.zeros(Ft,qt);return oe=oe.setSubMatrix(ft,0,0),oe}}let st=Math.max(m,B),ot=Math.max(M,J);E=$(E,st,ot),x=$(x,st,ot);function Tt(ft,Ft,qt,Lt){if(qt<=512||Lt<=512)return ft.mmul(Ft);qt%2===1&&Lt%2===1?(ft=$(ft,qt+1,Lt+1),Ft=$(Ft,qt+1,Lt+1)):qt%2===1?(ft=$(ft,qt+1,Lt),Ft=$(Ft,qt+1,Lt)):Lt%2===1&&(ft=$(ft,qt,Lt+1),Ft=$(Ft,qt,Lt+1));let Zt=parseInt(ft.rows/2,10),oe=parseInt(ft.columns/2,10),mt=ft.subMatrix(0,Zt-1,0,oe-1),Wt=Ft.subMatrix(0,Zt-1,0,oe-1),he=ft.subMatrix(0,Zt-1,oe,ft.columns-1),we=Ft.subMatrix(0,Zt-1,oe,Ft.columns-1),Ae=ft.subMatrix(Zt,ft.rows-1,0,oe-1),cn=Ft.subMatrix(Zt,Ft.rows-1,0,oe-1),ge=ft.subMatrix(Zt,ft.rows-1,oe,ft.columns-1),xe=Ft.subMatrix(Zt,Ft.rows-1,oe,Ft.columns-1),Ze=Tt(re.add(mt,ge),re.add(Wt,xe),Zt,oe),Mt=Tt(re.add(Ae,ge),Wt,Zt,oe),Yt=Tt(mt,re.sub(we,xe),Zt,oe),Jt=Tt(ge,re.sub(cn,Wt),Zt,oe),Ht=Tt(re.add(mt,he),xe,Zt,oe),dn=Tt(re.sub(Ae,mt),re.add(Wt,we),Zt,oe),Je=Tt(re.sub(he,ge),re.add(cn,xe),Zt,oe),un=re.add(Ze,Jt);un.sub(Ht),un.add(Je);let fn=re.add(Yt,Ht),rr=re.add(Mt,Jt),Hn=re.sub(Ze,Mt);Hn.add(Yt),Hn.add(dn);let vn=re.zeros(2*un.rows,2*un.columns);return vn=vn.setSubMatrix(un,0,0),vn=vn.setSubMatrix(fn,un.rows,0),vn=vn.setSubMatrix(rr,0,un.columns),vn=vn.setSubMatrix(Hn,un.rows,un.columns),vn.subMatrix(0,qt-1,0,Lt-1)}return Tt(E,x,st,ot)}scaleRows(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:E=0,max:m=1}=x;if(!Number.isFinite(E))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(E>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let B=0;B<this.rows;B++){const J=this.getRow(B);J.length>0&&tt(J,{min:E,max:m,output:J}),M.setRow(B,J)}return M}scaleColumns(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:E=0,max:m=1}=x;if(!Number.isFinite(E))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(E>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let B=0;B<this.columns;B++){const J=this.getColumn(B);J.length&&tt(J,{min:E,max:m,output:J}),M.setColumn(B,J)}return M}flipRows(){const x=Math.ceil(this.columns/2);for(let E=0;E<this.rows;E++)for(let m=0;m<x;m++){let M=this.get(E,m),B=this.get(E,this.columns-1-m);this.set(E,m,B),this.set(E,this.columns-1-m,M)}return this}flipColumns(){const x=Math.ceil(this.rows/2);for(let E=0;E<this.columns;E++)for(let m=0;m<x;m++){let M=this.get(m,E),B=this.get(this.rows-1-m,E);this.set(m,E,B),this.set(this.rows-1-m,E,M)}return this}kroneckerProduct(x){x=ne.checkMatrix(x);let E=this.rows,m=this.columns,M=x.rows,B=x.columns,J=new ne(E*M,m*B);for(let $=0;$<E;$++)for(let st=0;st<m;st++)for(let ot=0;ot<M;ot++)for(let Tt=0;Tt<B;Tt++)J.set(M*$+ot,B*st+Tt,this.get($,st)*x.get(ot,Tt));return J}kroneckerSum(x){if(x=ne.checkMatrix(x),!this.isSquare()||!x.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let E=this.rows,m=x.rows,M=this.kroneckerProduct(ne.eye(m,m)),B=ne.eye(E,E).kroneckerProduct(x);return M.add(B)}transpose(){let x=new ne(this.columns,this.rows);for(let E=0;E<this.rows;E++)for(let m=0;m<this.columns;m++)x.set(m,E,this.get(E,m));return x}sortRows(x=Oe){for(let E=0;E<this.rows;E++)this.setRow(E,this.getRow(E).sort(x));return this}sortColumns(x=Oe){for(let E=0;E<this.columns;E++)this.setColumn(E,this.getColumn(E).sort(x));return this}subMatrix(x,E,m,M){Ee(this,x,E,m,M);let B=new ne(E-x+1,M-m+1);for(let J=x;J<=E;J++)for(let $=m;$<=M;$++)B.set(J-x,$-m,this.get(J,$));return B}subMatrixRow(x,E,m){if(E===void 0&&(E=0),m===void 0&&(m=this.columns-1),E>m||E<0||E>=this.columns||m<0||m>=this.columns)throw new RangeError("Argument out of range");let M=new ne(x.length,m-E+1);for(let B=0;B<x.length;B++)for(let J=E;J<=m;J++){if(x[B]<0||x[B]>=this.rows)throw new RangeError(`Row index out of range: ${x[B]}`);M.set(B,J-E,this.get(x[B],J))}return M}subMatrixColumn(x,E,m){if(E===void 0&&(E=0),m===void 0&&(m=this.rows-1),E>m||E<0||E>=this.rows||m<0||m>=this.rows)throw new RangeError("Argument out of range");let M=new ne(m-E+1,x.length);for(let B=0;B<x.length;B++)for(let J=E;J<=m;J++){if(x[B]<0||x[B]>=this.columns)throw new RangeError(`Column index out of range: ${x[B]}`);M.set(J-E,B,this.get(J,x[B]))}return M}setSubMatrix(x,E,m){if(x=ne.checkMatrix(x),x.isEmpty())return this;let M=E+x.rows-1,B=m+x.columns-1;Ee(this,E,M,m,B);for(let J=0;J<x.rows;J++)for(let $=0;$<x.columns;$++)this.set(E+J,m+$,x.get(J,$));return this}selection(x,E){Vt(this,x),Qt(this,E);let m=new ne(x.length,E.length);for(let M=0;M<x.length;M++){let B=x[M];for(let J=0;J<E.length;J++){let $=E[J];m.set(M,J,this.get(B,$))}}return m}trace(){let x=Math.min(this.rows,this.columns),E=0;for(let m=0;m<x;m++)E+=this.get(m,m);return E}clone(){return this.constructor.copy(this,new ne(this.rows,this.columns))}static copy(x,E){for(const[m,M,B]of x.entries())E.set(m,M,B);return E}sum(x){switch(x){case"row":return ti(this);case"column":return la(this);case void 0:return ss(this);default:throw new Error(`invalid option: ${x}`)}}product(x){switch(x){case"row":return Rt(this);case"column":return Dt(this);case void 0:return It(this);default:throw new Error(`invalid option: ${x}`)}}mean(x){const E=this.sum(x);switch(x){case"row":{for(let m=0;m<this.rows;m++)E[m]/=this.columns;return E}case"column":{for(let m=0;m<this.columns;m++)E[m]/=this.rows;return E}case void 0:return E/this.size;default:throw new Error(`invalid option: ${x}`)}}variance(x,E={}){if(typeof x=="object"&&(E=x,x=void 0),typeof E!="object")throw new TypeError("options must be an object");const{unbiased:m=!0,mean:M=this.mean(x)}=E;if(typeof m!="boolean")throw new TypeError("unbiased must be a boolean");switch(x){case"row":{if(!nt.isAnyArray(M))throw new TypeError("mean must be an array");return dt(this,m,M)}case"column":{if(!nt.isAnyArray(M))throw new TypeError("mean must be an array");return St(this,m,M)}case void 0:{if(typeof M!="number")throw new TypeError("mean must be a number");return Ot(this,m,M)}default:throw new Error(`invalid option: ${x}`)}}standardDeviation(x,E){typeof x=="object"&&(E=x,x=void 0);const m=this.variance(x,E);if(x===void 0)return Math.sqrt(m);for(let M=0;M<m.length;M++)m[M]=Math.sqrt(m[M]);return m}center(x,E={}){if(typeof x=="object"&&(E=x,x=void 0),typeof E!="object")throw new TypeError("options must be an object");const{center:m=this.mean(x)}=E;switch(x){case"row":{if(!nt.isAnyArray(m))throw new TypeError("center must be an array");return Gt(this,m),this}case"column":{if(!nt.isAnyArray(m))throw new TypeError("center must be an array");return se(this,m),this}case void 0:{if(typeof m!="number")throw new TypeError("center must be a number");return be(this,m),this}default:throw new Error(`invalid option: ${x}`)}}scale(x,E={}){if(typeof x=="object"&&(E=x,x=void 0),typeof E!="object")throw new TypeError("options must be an object");let m=E.scale;switch(x){case"row":{if(m===void 0)m=de(this);else if(!nt.isAnyArray(m))throw new TypeError("scale must be an array");return Le(this,m),this}case"column":{if(m===void 0)m=Mn(this);else if(!nt.isAnyArray(m))throw new TypeError("scale must be an array");return Nn(this,m),this}case void 0:{if(m===void 0)m=ke(this);else if(typeof m!="number")throw new TypeError("scale must be a number");return Se(this,m),this}default:throw new Error(`invalid option: ${x}`)}}toString(x){return ct(this,x)}[Symbol.iterator](){return this.entries()}*entries(){for(let x=0;x<this.rows;x++)for(let E=0;E<this.columns;E++)yield[x,E,this.get(x,E)]}*values(){for(let x=0;x<this.rows;x++)for(let E=0;E<this.columns;E++)yield this.get(x,E)}}re.prototype.klass="Matrix",typeof Symbol!="undefined"&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=at);function Oe(U,x){return U-x}function ur(U){return U.every(x=>typeof x=="number")}re.random=re.rand,re.randomInt=re.randInt,re.diagonal=re.diag,re.prototype.diagonal=re.prototype.diag,re.identity=re.eye,re.prototype.negate=re.prototype.neg,re.prototype.tensorProduct=re.prototype.kroneckerProduct;const ca=class Y0 extends re{constructor(x,E){if(super(),P(this,Z),k(this,"data"),Y0.isMatrix(x))L(this,Z,Y).call(this,x.rows,x.columns),Y0.copy(x,this);else if(Number.isInteger(x)&&x>=0)L(this,Z,Y).call(this,x,E);else if(nt.isAnyArray(x)){const m=x;if(x=m.length,E=x?m[0].length:0,typeof E!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let M=0;M<x;M++){if(m[M].length!==E)throw new RangeError("Inconsistent array dimensions");if(!ur(m[M]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(m[M]))}this.rows=x,this.columns=E}else throw new TypeError("First argument must be a positive number or an array")}set(x,E,m){return this.data[x][E]=m,this}get(x,E){return this.data[x][E]}removeRow(x){return vt(this,x),this.data.splice(x,1),this.rows-=1,this}addRow(x,E){return E===void 0&&(E=x,x=this.rows),vt(this,x,!0),E=Float64Array.from(Pt(this,E)),this.data.splice(x,0,E),this.rows+=1,this}removeColumn(x){Et(this,x);for(let E=0;E<this.rows;E++){const m=new Float64Array(this.columns-1);for(let M=0;M<x;M++)m[M]=this.data[E][M];for(let M=x+1;M<this.columns;M++)m[M-1]=this.data[E][M];this.data[E]=m}return this.columns-=1,this}addColumn(x,E){typeof E=="undefined"&&(E=x,x=this.columns),Et(this,x,!0),E=zt(this,E);for(let m=0;m<this.rows;m++){const M=new Float64Array(this.columns+1);let B=0;for(;B<x;B++)M[B]=this.data[m][B];for(M[B++]=E[m];B<this.columns+1;B++)M[B]=this.data[m][B-1];this.data[m]=M}return this.columns+=1,this}};Z=new WeakSet,Y=function(U,x){if(this.data=[],Number.isInteger(x)&&x>=0)for(let E=0;E<U;E++)this.data.push(new Float64Array(x));else throw new TypeError("nColumns must be a positive integer");this.rows=U,this.columns=x};let ne=ca;wt(re,ne);const os=class H0 extends re{constructor(x){if(super(),P(this,X),ne.isMatrix(x)){if(!x.isSymmetric())throw new TypeError("not symmetric data");I(this,X,ne.copy(x,new ne(x.rows,x.rows)))}else if(Number.isInteger(x)&&x>=0)I(this,X,new ne(x,x));else if(I(this,X,new ne(x)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return C(this,X).size}get rows(){return C(this,X).rows}get columns(){return C(this,X).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(x){return ne.isMatrix(x)&&x.klassType==="SymmetricMatrix"}static zeros(x){return new this(x)}static ones(x){return new this(x).fill(1)}clone(){const x=new H0(this.diagonalSize);for(const[E,m,M]of this.upperRightEntries())x.set(E,m,M);return x}toMatrix(){return new ne(this)}get(x,E){return C(this,X).get(x,E)}set(x,E,m){return C(this,X).set(x,E,m),C(this,X).set(E,x,m),this}removeCross(x){return C(this,X).removeRow(x),C(this,X).removeColumn(x),this}addCross(x,E){E===void 0&&(E=x,x=this.diagonalSize);const m=E.slice();return m.splice(x,1),C(this,X).addRow(x,m),C(this,X).addColumn(x,E),this}applyMask(x){if(x.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const E=[];for(const[m,M]of x.entries())M||E.push(m);E.reverse();for(const m of E)this.removeCross(m);return this}toCompact(){const{diagonalSize:x}=this,E=new Array(x*(x+1)/2);for(let m=0,M=0,B=0;B<E.length;B++)E[B]=this.get(M,m),++m>=x&&(m=++M);return E}static fromCompact(x){const E=x.length,m=(Math.sqrt(8*E+1)-1)/2;if(!Number.isInteger(m))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(x)}`);const M=new H0(m);for(let B=0,J=0,$=0;$<E;$++)M.set(B,J,x[$]),++B>=m&&(B=++J);return M}*upperRightEntries(){for(let x=0,E=0;x<this.diagonalSize;void 0){const m=this.get(x,E);yield[x,E,m],++E>=this.diagonalSize&&(E=++x)}}*upperRightValues(){for(let x=0,E=0;x<this.diagonalSize;void 0)yield this.get(x,E),++E>=this.diagonalSize&&(E=++x)}};X=new WeakMap;let Lr=os;Lr.prototype.klassType="SymmetricMatrix";class Yn extends Lr{static isDistanceMatrix(x){return Lr.isSymmetricMatrix(x)&&x.klassSubType==="DistanceMatrix"}constructor(x){if(super(x),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(x,E,m){return x===E&&(m=0),super.set(x,E,m)}addCross(x,E){return E===void 0&&(E=x,x=this.diagonalSize),E=E.slice(),E[x]=0,super.addCross(x,E)}toSymmetricMatrix(){return new Lr(this)}clone(){const x=new Yn(this.diagonalSize);for(const[E,m,M]of this.upperRightEntries())E!==m&&x.set(E,m,M);return x}toCompact(){const{diagonalSize:x}=this,E=(x-1)*x/2,m=new Array(E);for(let M=1,B=0,J=0;J<m.length;J++)m[J]=this.get(B,M),++M>=x&&(M=++B+1);return m}static fromCompact(x){const E=x.length;if(E===0)return new this(0);const m=(Math.sqrt(8*E+1)+1)/2;if(!Number.isInteger(m))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(x)}`);const M=new this(m);for(let B=1,J=0,$=0;$<E;$++)M.set(B,J,x[$]),++B>=m&&(B=++J+1);return M}}Yn.prototype.klassSubType="DistanceMatrix";class Dr extends re{constructor(x,E,m){super(),this.matrix=x,this.rows=E,this.columns=m}}class ls extends Dr{constructor(x,E){Et(x,E),super(x,x.rows,1),this.column=E}set(x,E,m){return this.matrix.set(x,this.column,m),this}get(x){return this.matrix.get(x,this.column)}}class ua extends Dr{constructor(x,E){Qt(x,E),super(x,x.rows,E.length),this.columnIndices=E}set(x,E,m){return this.matrix.set(x,this.columnIndices[E],m),this}get(x,E){return this.matrix.get(x,this.columnIndices[E])}}class qs extends Dr{constructor(x){super(x,x.rows,x.columns)}set(x,E,m){return this.matrix.set(x,this.columns-E-1,m),this}get(x,E){return this.matrix.get(x,this.columns-E-1)}}class ha extends Dr{constructor(x){super(x,x.rows,x.columns)}set(x,E,m){return this.matrix.set(this.rows-x-1,E,m),this}get(x,E){return this.matrix.get(this.rows-x-1,E)}}class Fo extends Dr{constructor(x,E){vt(x,E),super(x,1,x.columns),this.row=E}set(x,E,m){return this.matrix.set(this.row,E,m),this}get(x,E){return this.matrix.get(this.row,E)}}class cs extends Dr{constructor(x,E){Vt(x,E),super(x,E.length,x.columns),this.rowIndices=E}set(x,E,m){return this.matrix.set(this.rowIndices[x],E,m),this}get(x,E){return this.matrix.get(this.rowIndices[x],E)}}class us extends Dr{constructor(x,E,m){Vt(x,E),Qt(x,m),super(x,E.length,m.length),this.rowIndices=E,this.columnIndices=m}set(x,E,m){return this.matrix.set(this.rowIndices[x],this.columnIndices[E],m),this}get(x,E){return this.matrix.get(this.rowIndices[x],this.columnIndices[E])}}class hs extends Dr{constructor(x,E,m,M,B){Ee(x,E,m,M,B),super(x,m-E+1,B-M+1),this.startRow=E,this.startColumn=M}set(x,E,m){return this.matrix.set(this.startRow+x,this.startColumn+E,m),this}get(x,E){return this.matrix.get(this.startRow+x,this.startColumn+E)}}class Ai extends Dr{constructor(x){super(x,x.columns,x.rows)}set(x,E,m){return this.matrix.set(E,x,m),this}get(x,E){return this.matrix.get(E,x)}}class Ti extends re{constructor(x,E={}){const{rows:m=1}=E;if(x.length%m!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=m,this.columns=x.length/m,this.data=x}set(x,E,m){let M=this._calculateIndex(x,E);return this.data[M]=m,this}get(x,E){let m=this._calculateIndex(x,E);return this.data[m]}_calculateIndex(x,E){return x*this.columns+E}}class An extends re{constructor(x){super(),this.data=x,this.rows=x.length,this.columns=x[0].length}set(x,E,m){return this.data[x][E]=m,this}get(x,E){return this.data[x][E]}}function ud(U,x){if(nt.isAnyArray(U))return U[0]&&nt.isAnyArray(U[0])?new An(U):new Ti(U,x);throw new Error("the argument is not an array")}class Ui{constructor(x){x=An.checkMatrix(x);let E=x.clone(),m=E.rows,M=E.columns,B=new Float64Array(m),J=1,$,st,ot,Tt,ft,Ft,qt,Lt,Zt;for($=0;$<m;$++)B[$]=$;for(Lt=new Float64Array(m),st=0;st<M;st++){for($=0;$<m;$++)Lt[$]=E.get($,st);for($=0;$<m;$++){for(Zt=Math.min($,st),ft=0,ot=0;ot<Zt;ot++)ft+=E.get($,ot)*Lt[ot];Lt[$]-=ft,E.set($,st,Lt[$])}for(Tt=st,$=st+1;$<m;$++)Math.abs(Lt[$])>Math.abs(Lt[Tt])&&(Tt=$);if(Tt!==st){for(ot=0;ot<M;ot++)Ft=E.get(Tt,ot),E.set(Tt,ot,E.get(st,ot)),E.set(st,ot,Ft);qt=B[Tt],B[Tt]=B[st],B[st]=qt,J=-J}if(st<m&&E.get(st,st)!==0)for($=st+1;$<m;$++)E.set($,st,E.get($,st)/E.get(st,st))}this.LU=E,this.pivotVector=B,this.pivotSign=J}isSingular(){let x=this.LU,E=x.columns;for(let m=0;m<E;m++)if(x.get(m,m)===0)return!0;return!1}solve(x){x=ne.checkMatrix(x);let E=this.LU;if(E.rows!==x.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let M=x.columns,B=x.subMatrixRow(this.pivotVector,0,M-1),J=E.columns,$,st,ot;for(ot=0;ot<J;ot++)for($=ot+1;$<J;$++)for(st=0;st<M;st++)B.set($,st,B.get($,st)-B.get(ot,st)*E.get($,ot));for(ot=J-1;ot>=0;ot--){for(st=0;st<M;st++)B.set(ot,st,B.get(ot,st)/E.get(ot,ot));for($=0;$<ot;$++)for(st=0;st<M;st++)B.set($,st,B.get($,st)-B.get(ot,st)*E.get($,ot))}return B}get determinant(){let x=this.LU;if(!x.isSquare())throw new Error("Matrix must be square");let E=this.pivotSign,m=x.columns;for(let M=0;M<m;M++)E*=x.get(M,M);return E}get lowerTriangularMatrix(){let x=this.LU,E=x.rows,m=x.columns,M=new ne(E,m);for(let B=0;B<E;B++)for(let J=0;J<m;J++)B>J?M.set(B,J,x.get(B,J)):B===J?M.set(B,J,1):M.set(B,J,0);return M}get upperTriangularMatrix(){let x=this.LU,E=x.rows,m=x.columns,M=new ne(E,m);for(let B=0;B<E;B++)for(let J=0;J<m;J++)B<=J?M.set(B,J,x.get(B,J)):M.set(B,J,0);return M}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Oi(U,x){let E=0;return Math.abs(U)>Math.abs(x)?(E=x/U,Math.abs(U)*Math.sqrt(1+E*E)):x!==0?(E=U/x,Math.abs(x)*Math.sqrt(1+E*E)):0}class zo{constructor(x){x=An.checkMatrix(x);let E=x.clone(),m=x.rows,M=x.columns,B=new Float64Array(M),J,$,st,ot;for(st=0;st<M;st++){let Tt=0;for(J=st;J<m;J++)Tt=Oi(Tt,E.get(J,st));if(Tt!==0){for(E.get(st,st)<0&&(Tt=-Tt),J=st;J<m;J++)E.set(J,st,E.get(J,st)/Tt);for(E.set(st,st,E.get(st,st)+1),$=st+1;$<M;$++){for(ot=0,J=st;J<m;J++)ot+=E.get(J,st)*E.get(J,$);for(ot=-ot/E.get(st,st),J=st;J<m;J++)E.set(J,$,E.get(J,$)+ot*E.get(J,st))}}B[st]=-Tt}this.QR=E,this.Rdiag=B}solve(x){x=ne.checkMatrix(x);let E=this.QR,m=E.rows;if(x.rows!==m)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let M=x.columns,B=x.clone(),J=E.columns,$,st,ot,Tt;for(ot=0;ot<J;ot++)for(st=0;st<M;st++){for(Tt=0,$=ot;$<m;$++)Tt+=E.get($,ot)*B.get($,st);for(Tt=-Tt/E.get(ot,ot),$=ot;$<m;$++)B.set($,st,B.get($,st)+Tt*E.get($,ot))}for(ot=J-1;ot>=0;ot--){for(st=0;st<M;st++)B.set(ot,st,B.get(ot,st)/this.Rdiag[ot]);for($=0;$<ot;$++)for(st=0;st<M;st++)B.set($,st,B.get($,st)-B.get(ot,st)*E.get($,ot))}return B.subMatrix(0,J-1,0,M-1)}isFullRank(){let x=this.QR.columns;for(let E=0;E<x;E++)if(this.Rdiag[E]===0)return!1;return!0}get upperTriangularMatrix(){let x=this.QR,E=x.columns,m=new ne(E,E),M,B;for(M=0;M<E;M++)for(B=0;B<E;B++)M<B?m.set(M,B,x.get(M,B)):M===B?m.set(M,B,this.Rdiag[M]):m.set(M,B,0);return m}get orthogonalMatrix(){let x=this.QR,E=x.rows,m=x.columns,M=new ne(E,m),B,J,$,st;for($=m-1;$>=0;$--){for(B=0;B<E;B++)M.set(B,$,0);for(M.set($,$,1),J=$;J<m;J++)if(x.get($,$)!==0){for(st=0,B=$;B<E;B++)st+=x.get(B,$)*M.get(B,J);for(st=-st/x.get($,$),B=$;B<E;B++)M.set(B,J,M.get(B,J)+st*x.get(B,$))}}return M}}class Oa{constructor(x,E={}){if(x=An.checkMatrix(x),x.isEmpty())throw new Error("Matrix must be non-empty");let m=x.rows,M=x.columns;const{computeLeftSingularVectors:B=!0,computeRightSingularVectors:J=!0,autoTranspose:$=!1}=E;let st=!!B,ot=!!J,Tt=!1,ft;if(m<M)if(!$)ft=x.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{ft=x.transpose(),m=ft.rows,M=ft.columns,Tt=!0;let Mt=st;st=ot,ot=Mt}else ft=x.clone();let Ft=Math.min(m,M),qt=Math.min(m+1,M),Lt=new Float64Array(qt),Zt=new ne(m,Ft),oe=new ne(M,M),mt=new Float64Array(M),Wt=new Float64Array(m),he=new Float64Array(qt);for(let Mt=0;Mt<qt;Mt++)he[Mt]=Mt;let we=Math.min(m-1,M),Ae=Math.max(0,Math.min(M-2,m)),cn=Math.max(we,Ae);for(let Mt=0;Mt<cn;Mt++){if(Mt<we){Lt[Mt]=0;for(let Yt=Mt;Yt<m;Yt++)Lt[Mt]=Oi(Lt[Mt],ft.get(Yt,Mt));if(Lt[Mt]!==0){ft.get(Mt,Mt)<0&&(Lt[Mt]=-Lt[Mt]);for(let Yt=Mt;Yt<m;Yt++)ft.set(Yt,Mt,ft.get(Yt,Mt)/Lt[Mt]);ft.set(Mt,Mt,ft.get(Mt,Mt)+1)}Lt[Mt]=-Lt[Mt]}for(let Yt=Mt+1;Yt<M;Yt++){if(Mt<we&&Lt[Mt]!==0){let Jt=0;for(let Ht=Mt;Ht<m;Ht++)Jt+=ft.get(Ht,Mt)*ft.get(Ht,Yt);Jt=-Jt/ft.get(Mt,Mt);for(let Ht=Mt;Ht<m;Ht++)ft.set(Ht,Yt,ft.get(Ht,Yt)+Jt*ft.get(Ht,Mt))}mt[Yt]=ft.get(Mt,Yt)}if(st&&Mt<we)for(let Yt=Mt;Yt<m;Yt++)Zt.set(Yt,Mt,ft.get(Yt,Mt));if(Mt<Ae){mt[Mt]=0;for(let Yt=Mt+1;Yt<M;Yt++)mt[Mt]=Oi(mt[Mt],mt[Yt]);if(mt[Mt]!==0){mt[Mt+1]<0&&(mt[Mt]=0-mt[Mt]);for(let Yt=Mt+1;Yt<M;Yt++)mt[Yt]/=mt[Mt];mt[Mt+1]+=1}if(mt[Mt]=-mt[Mt],Mt+1<m&&mt[Mt]!==0){for(let Yt=Mt+1;Yt<m;Yt++)Wt[Yt]=0;for(let Yt=Mt+1;Yt<m;Yt++)for(let Jt=Mt+1;Jt<M;Jt++)Wt[Yt]+=mt[Jt]*ft.get(Yt,Jt);for(let Yt=Mt+1;Yt<M;Yt++){let Jt=-mt[Yt]/mt[Mt+1];for(let Ht=Mt+1;Ht<m;Ht++)ft.set(Ht,Yt,ft.get(Ht,Yt)+Jt*Wt[Ht])}}if(ot)for(let Yt=Mt+1;Yt<M;Yt++)oe.set(Yt,Mt,mt[Yt])}}let ge=Math.min(M,m+1);if(we<M&&(Lt[we]=ft.get(we,we)),m<ge&&(Lt[ge-1]=0),Ae+1<ge&&(mt[Ae]=ft.get(Ae,ge-1)),mt[ge-1]=0,st){for(let Mt=we;Mt<Ft;Mt++){for(let Yt=0;Yt<m;Yt++)Zt.set(Yt,Mt,0);Zt.set(Mt,Mt,1)}for(let Mt=we-1;Mt>=0;Mt--)if(Lt[Mt]!==0){for(let Yt=Mt+1;Yt<Ft;Yt++){let Jt=0;for(let Ht=Mt;Ht<m;Ht++)Jt+=Zt.get(Ht,Mt)*Zt.get(Ht,Yt);Jt=-Jt/Zt.get(Mt,Mt);for(let Ht=Mt;Ht<m;Ht++)Zt.set(Ht,Yt,Zt.get(Ht,Yt)+Jt*Zt.get(Ht,Mt))}for(let Yt=Mt;Yt<m;Yt++)Zt.set(Yt,Mt,-Zt.get(Yt,Mt));Zt.set(Mt,Mt,1+Zt.get(Mt,Mt));for(let Yt=0;Yt<Mt-1;Yt++)Zt.set(Yt,Mt,0)}else{for(let Yt=0;Yt<m;Yt++)Zt.set(Yt,Mt,0);Zt.set(Mt,Mt,1)}}if(ot)for(let Mt=M-1;Mt>=0;Mt--){if(Mt<Ae&&mt[Mt]!==0)for(let Yt=Mt+1;Yt<M;Yt++){let Jt=0;for(let Ht=Mt+1;Ht<M;Ht++)Jt+=oe.get(Ht,Mt)*oe.get(Ht,Yt);Jt=-Jt/oe.get(Mt+1,Mt);for(let Ht=Mt+1;Ht<M;Ht++)oe.set(Ht,Yt,oe.get(Ht,Yt)+Jt*oe.get(Ht,Mt))}for(let Yt=0;Yt<M;Yt++)oe.set(Yt,Mt,0);oe.set(Mt,Mt,1)}let xe=ge-1,Ze=Number.EPSILON;for(;ge>0;){let Mt,Yt;for(Mt=ge-2;Mt>=-1&&Mt!==-1;Mt--){const Jt=Number.MIN_VALUE+Ze*Math.abs(Lt[Mt]+Math.abs(Lt[Mt+1]));if(Math.abs(mt[Mt])<=Jt||Number.isNaN(mt[Mt])){mt[Mt]=0;break}}if(Mt===ge-2)Yt=4;else{let Jt;for(Jt=ge-1;Jt>=Mt&&Jt!==Mt;Jt--){let Ht=(Jt!==ge?Math.abs(mt[Jt]):0)+(Jt!==Mt+1?Math.abs(mt[Jt-1]):0);if(Math.abs(Lt[Jt])<=Ze*Ht){Lt[Jt]=0;break}}Jt===Mt?Yt=3:Jt===ge-1?Yt=1:(Yt=2,Mt=Jt)}switch(Mt++,Yt){case 1:{let Jt=mt[ge-2];mt[ge-2]=0;for(let Ht=ge-2;Ht>=Mt;Ht--){let dn=Oi(Lt[Ht],Jt),Je=Lt[Ht]/dn,un=Jt/dn;if(Lt[Ht]=dn,Ht!==Mt&&(Jt=-un*mt[Ht-1],mt[Ht-1]=Je*mt[Ht-1]),ot)for(let fn=0;fn<M;fn++)dn=Je*oe.get(fn,Ht)+un*oe.get(fn,ge-1),oe.set(fn,ge-1,-un*oe.get(fn,Ht)+Je*oe.get(fn,ge-1)),oe.set(fn,Ht,dn)}break}case 2:{let Jt=mt[Mt-1];mt[Mt-1]=0;for(let Ht=Mt;Ht<ge;Ht++){let dn=Oi(Lt[Ht],Jt),Je=Lt[Ht]/dn,un=Jt/dn;if(Lt[Ht]=dn,Jt=-un*mt[Ht],mt[Ht]=Je*mt[Ht],st)for(let fn=0;fn<m;fn++)dn=Je*Zt.get(fn,Ht)+un*Zt.get(fn,Mt-1),Zt.set(fn,Mt-1,-un*Zt.get(fn,Ht)+Je*Zt.get(fn,Mt-1)),Zt.set(fn,Ht,dn)}break}case 3:{const Jt=Math.max(Math.abs(Lt[ge-1]),Math.abs(Lt[ge-2]),Math.abs(mt[ge-2]),Math.abs(Lt[Mt]),Math.abs(mt[Mt])),Ht=Lt[ge-1]/Jt,dn=Lt[ge-2]/Jt,Je=mt[ge-2]/Jt,un=Lt[Mt]/Jt,fn=mt[Mt]/Jt,rr=((dn+Ht)*(dn-Ht)+Je*Je)/2,Hn=Ht*Je*(Ht*Je);let vn=0;(rr!==0||Hn!==0)&&(rr<0?vn=0-Math.sqrt(rr*rr+Hn):vn=Math.sqrt(rr*rr+Hn),vn=Hn/(rr+vn));let ei=(un+Ht)*(un-Ht)+vn,fi=un*fn;for(let je=Mt;je<ge-1;je++){let Bn=Oi(ei,fi);Bn===0&&(Bn=Number.MIN_VALUE);let Tr=ei/Bn,_r=fi/Bn;if(je!==Mt&&(mt[je-1]=Bn),ei=Tr*Lt[je]+_r*mt[je],mt[je]=Tr*mt[je]-_r*Lt[je],fi=_r*Lt[je+1],Lt[je+1]=Tr*Lt[je+1],ot)for(let Tn=0;Tn<M;Tn++)Bn=Tr*oe.get(Tn,je)+_r*oe.get(Tn,je+1),oe.set(Tn,je+1,-_r*oe.get(Tn,je)+Tr*oe.get(Tn,je+1)),oe.set(Tn,je,Bn);if(Bn=Oi(ei,fi),Bn===0&&(Bn=Number.MIN_VALUE),Tr=ei/Bn,_r=fi/Bn,Lt[je]=Bn,ei=Tr*mt[je]+_r*Lt[je+1],Lt[je+1]=-_r*mt[je]+Tr*Lt[je+1],fi=_r*mt[je+1],mt[je+1]=Tr*mt[je+1],st&&je<m-1)for(let Tn=0;Tn<m;Tn++)Bn=Tr*Zt.get(Tn,je)+_r*Zt.get(Tn,je+1),Zt.set(Tn,je+1,-_r*Zt.get(Tn,je)+Tr*Zt.get(Tn,je+1)),Zt.set(Tn,je,Bn)}mt[ge-2]=ei;break}case 4:{if(Lt[Mt]<=0&&(Lt[Mt]=Lt[Mt]<0?-Lt[Mt]:0,ot))for(let Jt=0;Jt<=xe;Jt++)oe.set(Jt,Mt,-oe.get(Jt,Mt));for(;Mt<xe&&!(Lt[Mt]>=Lt[Mt+1]);){let Jt=Lt[Mt];if(Lt[Mt]=Lt[Mt+1],Lt[Mt+1]=Jt,ot&&Mt<M-1)for(let Ht=0;Ht<M;Ht++)Jt=oe.get(Ht,Mt+1),oe.set(Ht,Mt+1,oe.get(Ht,Mt)),oe.set(Ht,Mt,Jt);if(st&&Mt<m-1)for(let Ht=0;Ht<m;Ht++)Jt=Zt.get(Ht,Mt+1),Zt.set(Ht,Mt+1,Zt.get(Ht,Mt)),Zt.set(Ht,Mt,Jt);Mt++}ge--;break}}}if(Tt){let Mt=oe;oe=Zt,Zt=Mt}this.m=m,this.n=M,this.s=Lt,this.U=Zt,this.V=oe}solve(x){let E=x,m=this.threshold,M=this.s.length,B=ne.zeros(M,M);for(let Ft=0;Ft<M;Ft++)Math.abs(this.s[Ft])<=m?B.set(Ft,Ft,0):B.set(Ft,Ft,1/this.s[Ft]);let J=this.U,$=this.rightSingularVectors,st=$.mmul(B),ot=$.rows,Tt=J.rows,ft=ne.zeros(ot,Tt);for(let Ft=0;Ft<ot;Ft++)for(let qt=0;qt<Tt;qt++){let Lt=0;for(let Zt=0;Zt<M;Zt++)Lt+=st.get(Ft,Zt)*J.get(qt,Zt);ft.set(Ft,qt,Lt)}return ft.mmul(E)}solveForDiagonal(x){return this.solve(ne.diag(x))}inverse(){let x=this.V,E=this.threshold,m=x.rows,M=x.columns,B=new ne(m,this.s.length);for(let Tt=0;Tt<m;Tt++)for(let ft=0;ft<M;ft++)Math.abs(this.s[ft])>E&&B.set(Tt,ft,x.get(Tt,ft)/this.s[ft]);let J=this.U,$=J.rows,st=J.columns,ot=new ne(m,$);for(let Tt=0;Tt<m;Tt++)for(let ft=0;ft<$;ft++){let Ft=0;for(let qt=0;qt<st;qt++)Ft+=B.get(Tt,qt)*J.get(ft,qt);ot.set(Tt,ft,Ft)}return ot}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let x=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,E=0,m=this.s;for(let M=0,B=m.length;M<B;M++)m[M]>x&&E++;return E}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ne.diag(this.s)}}function X0(U,x=!1){return U=An.checkMatrix(U),x?new Oa(U).inverse():hd(U,ne.eye(U.rows))}function hd(U,x,E=!1){return U=An.checkMatrix(U),x=An.checkMatrix(x),E?new Oa(U).solve(x):U.isSquare()?new Ui(U).solve(x):new zo(U).solve(x)}function jo(U){if(U=ne.checkMatrix(U),U.isSquare()){if(U.columns===0)return 1;let x,E,m,M;if(U.columns===2)return x=U.get(0,0),E=U.get(0,1),m=U.get(1,0),M=U.get(1,1),x*M-E*m;if(U.columns===3){let B,J,$;return B=new us(U,[1,2],[1,2]),J=new us(U,[1,2],[0,2]),$=new us(U,[1,2],[0,1]),x=U.get(0,0),E=U.get(0,1),m=U.get(0,2),x*jo(B)-E*jo(J)+m*jo($)}else return new Ui(U).determinant}else throw Error("determinant can only be calculated for a square matrix")}function K0(U,x){let E=[];for(let m=0;m<U;m++)m!==x&&E.push(m);return E}function Q0(U,x,E,m=1e-9,M=1e-9){if(U>M)return new Array(x.rows+1).fill(0);{let B=x.addRow(E,[0]);for(let J=0;J<B.rows;J++)Math.abs(B.get(J,0))<m&&B.set(J,0,0);return B.to1DArray()}}function q0(U,x={}){const{thresholdValue:E=1e-9,thresholdError:m=1e-9}=x;U=ne.checkMatrix(U);let M=U.rows,B=new ne(M,M);for(let J=0;J<M;J++){let $=ne.columnVector(U.getRow(J)),st=U.subMatrixRow(K0(M,J)).transpose(),Tt=new Oa(st).solve($),ft=ne.sub($,st.mmul(Tt)).abs().max();B.setRow(J,Q0(ft,Tt,J,E,m))}return B}function J0(U,x=Number.EPSILON){if(U=ne.checkMatrix(U),U.isEmpty())return U.transpose();let E=new Oa(U,{autoTranspose:!0}),m=E.leftSingularVectors,M=E.rightSingularVectors,B=E.diagonal;for(let J=0;J<B.length;J++)Math.abs(B[J])>x?B[J]=1/B[J]:B[J]=0;return M.mmul(ne.diag(B).mmul(m.transpose()))}function $0(U,x=U,E={}){U=new ne(U);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!nt.isAnyArray(x)?(E=x,x=U,m=!0):x=new ne(x),U.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0}=E;M&&(U=U.center("column"),m||(x=x.center("column")));const B=U.transpose().mmul(x);for(let J=0;J<B.rows;J++)for(let $=0;$<B.columns;$++)B.set(J,$,B.get(J,$)*(1/(U.rows-1)));return B}function dd(U,x=U,E={}){U=new ne(U);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!nt.isAnyArray(x)?(E=x,x=U,m=!0):x=new ne(x),U.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0,scale:B=!0}=E;M&&(U.center("column"),m||x.center("column")),B&&(U.scale("column"),m||x.scale("column"));const J=U.standardDeviation("column",{unbiased:!0}),$=m?J:x.standardDeviation("column",{unbiased:!0}),st=U.transpose().mmul(x);for(let ot=0;ot<st.rows;ot++)for(let Tt=0;Tt<st.columns;Tt++)st.set(ot,Tt,st.get(ot,Tt)*(1/(J[ot]*$[Tt]))*(1/(U.rows-1)));return st}class fd{constructor(x,E={}){const{assumeSymmetric:m=!1}=E;if(x=An.checkMatrix(x),!x.isSquare())throw new Error("Matrix is not a square matrix");if(x.isEmpty())throw new Error("Matrix must be non-empty");let M=x.columns,B=new ne(M,M),J=new Float64Array(M),$=new Float64Array(M),st=x,ot,Tt,ft=!1;if(m?ft=!0:ft=x.isSymmetric(),ft){for(ot=0;ot<M;ot++)for(Tt=0;Tt<M;Tt++)B.set(ot,Tt,st.get(ot,Tt));tg(M,$,J,B),eg(M,$,J,B)}else{let Ft=new ne(M,M),qt=new Float64Array(M);for(Tt=0;Tt<M;Tt++)for(ot=0;ot<M;ot++)Ft.set(ot,Tt,st.get(ot,Tt));vd(M,Ft,qt,B),gd(M,$,J,B,Ft)}this.n=M,this.e=$,this.d=J,this.V=B}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let x=this.n,E=this.e,m=this.d,M=new ne(x,x),B,J;for(B=0;B<x;B++){for(J=0;J<x;J++)M.set(B,J,0);M.set(B,B,m[B]),E[B]>0?M.set(B,B+1,E[B]):E[B]<0&&M.set(B,B-1,E[B])}return M}}function tg(U,x,E,m){let M,B,J,$,st,ot,Tt,ft;for(st=0;st<U;st++)E[st]=m.get(U-1,st);for($=U-1;$>0;$--){for(ft=0,J=0,ot=0;ot<$;ot++)ft=ft+Math.abs(E[ot]);if(ft===0)for(x[$]=E[$-1],st=0;st<$;st++)E[st]=m.get($-1,st),m.set($,st,0),m.set(st,$,0);else{for(ot=0;ot<$;ot++)E[ot]/=ft,J+=E[ot]*E[ot];for(M=E[$-1],B=Math.sqrt(J),M>0&&(B=-B),x[$]=ft*B,J=J-M*B,E[$-1]=M-B,st=0;st<$;st++)x[st]=0;for(st=0;st<$;st++){for(M=E[st],m.set(st,$,M),B=x[st]+m.get(st,st)*M,ot=st+1;ot<=$-1;ot++)B+=m.get(ot,st)*E[ot],x[ot]+=m.get(ot,st)*M;x[st]=B}for(M=0,st=0;st<$;st++)x[st]/=J,M+=x[st]*E[st];for(Tt=M/(J+J),st=0;st<$;st++)x[st]-=Tt*E[st];for(st=0;st<$;st++){for(M=E[st],B=x[st],ot=st;ot<=$-1;ot++)m.set(ot,st,m.get(ot,st)-(M*x[ot]+B*E[ot]));E[st]=m.get($-1,st),m.set($,st,0)}}E[$]=J}for($=0;$<U-1;$++){if(m.set(U-1,$,m.get($,$)),m.set($,$,1),J=E[$+1],J!==0){for(ot=0;ot<=$;ot++)E[ot]=m.get(ot,$+1)/J;for(st=0;st<=$;st++){for(B=0,ot=0;ot<=$;ot++)B+=m.get(ot,$+1)*m.get(ot,st);for(ot=0;ot<=$;ot++)m.set(ot,st,m.get(ot,st)-B*E[ot])}}for(ot=0;ot<=$;ot++)m.set(ot,$+1,0)}for(st=0;st<U;st++)E[st]=m.get(U-1,st),m.set(U-1,st,0);m.set(U-1,U-1,1),x[0]=0}function eg(U,x,E,m){let M,B,J,$,st,ot,Tt,ft,Ft,qt,Lt,Zt,oe,mt,Wt,he;for(J=1;J<U;J++)x[J-1]=x[J];x[U-1]=0;let we=0,Ae=0,cn=Number.EPSILON;for(ot=0;ot<U;ot++){for(Ae=Math.max(Ae,Math.abs(E[ot])+Math.abs(x[ot])),Tt=ot;Tt<U&&!(Math.abs(x[Tt])<=cn*Ae);)Tt++;if(Tt>ot)do{for(M=E[ot],ft=(E[ot+1]-M)/(2*x[ot]),Ft=Oi(ft,1),ft<0&&(Ft=-Ft),E[ot]=x[ot]/(ft+Ft),E[ot+1]=x[ot]*(ft+Ft),qt=E[ot+1],B=M-E[ot],J=ot+2;J<U;J++)E[J]-=B;for(we=we+B,ft=E[Tt],Lt=1,Zt=Lt,oe=Lt,mt=x[ot+1],Wt=0,he=0,J=Tt-1;J>=ot;J--)for(oe=Zt,Zt=Lt,he=Wt,M=Lt*x[J],B=Lt*ft,Ft=Oi(ft,x[J]),x[J+1]=Wt*Ft,Wt=x[J]/Ft,Lt=ft/Ft,ft=Lt*E[J]-Wt*M,E[J+1]=B+Wt*(Lt*M+Wt*E[J]),st=0;st<U;st++)B=m.get(st,J+1),m.set(st,J+1,Wt*m.get(st,J)+Lt*B),m.set(st,J,Lt*m.get(st,J)-Wt*B);ft=-Wt*he*oe*mt*x[ot]/qt,x[ot]=Wt*ft,E[ot]=Lt*ft}while(Math.abs(x[ot])>cn*Ae);E[ot]=E[ot]+we,x[ot]=0}for(J=0;J<U-1;J++){for(st=J,ft=E[J],$=J+1;$<U;$++)E[$]<ft&&(st=$,ft=E[$]);if(st!==J)for(E[st]=E[J],E[J]=ft,$=0;$<U;$++)ft=m.get($,J),m.set($,J,m.get($,st)),m.set($,st,ft)}}function vd(U,x,E,m){let M=0,B=U-1,J,$,st,ot,Tt,ft,Ft;for(ft=M+1;ft<=B-1;ft++){for(Ft=0,ot=ft;ot<=B;ot++)Ft=Ft+Math.abs(x.get(ot,ft-1));if(Ft!==0){for(st=0,ot=B;ot>=ft;ot--)E[ot]=x.get(ot,ft-1)/Ft,st+=E[ot]*E[ot];for($=Math.sqrt(st),E[ft]>0&&($=-$),st=st-E[ft]*$,E[ft]=E[ft]-$,Tt=ft;Tt<U;Tt++){for(J=0,ot=B;ot>=ft;ot--)J+=E[ot]*x.get(ot,Tt);for(J=J/st,ot=ft;ot<=B;ot++)x.set(ot,Tt,x.get(ot,Tt)-J*E[ot])}for(ot=0;ot<=B;ot++){for(J=0,Tt=B;Tt>=ft;Tt--)J+=E[Tt]*x.get(ot,Tt);for(J=J/st,Tt=ft;Tt<=B;Tt++)x.set(ot,Tt,x.get(ot,Tt)-J*E[Tt])}E[ft]=Ft*E[ft],x.set(ft,ft-1,Ft*$)}}for(ot=0;ot<U;ot++)for(Tt=0;Tt<U;Tt++)m.set(ot,Tt,ot===Tt?1:0);for(ft=B-1;ft>=M+1;ft--)if(x.get(ft,ft-1)!==0){for(ot=ft+1;ot<=B;ot++)E[ot]=x.get(ot,ft-1);for(Tt=ft;Tt<=B;Tt++){for($=0,ot=ft;ot<=B;ot++)$+=E[ot]*m.get(ot,Tt);for($=$/E[ft]/x.get(ft,ft-1),ot=ft;ot<=B;ot++)m.set(ot,Tt,m.get(ot,Tt)+$*E[ot])}}}function gd(U,x,E,m,M){let B=U-1,J=0,$=U-1,st=Number.EPSILON,ot=0,Tt=0,ft=0,Ft=0,qt=0,Lt=0,Zt=0,oe=0,mt,Wt,he,we,Ae,cn,ge,xe,Ze,Mt,Yt,Jt,Ht,dn,Je;for(mt=0;mt<U;mt++)for((mt<J||mt>$)&&(E[mt]=M.get(mt,mt),x[mt]=0),Wt=Math.max(mt-1,0);Wt<U;Wt++)Tt=Tt+Math.abs(M.get(mt,Wt));for(;B>=J;){for(we=B;we>J&&(Lt=Math.abs(M.get(we-1,we-1))+Math.abs(M.get(we,we)),Lt===0&&(Lt=Tt),!(Math.abs(M.get(we,we-1))<st*Lt));)we--;if(we===B)M.set(B,B,M.get(B,B)+ot),E[B]=M.get(B,B),x[B]=0,B--,oe=0;else if(we===B-1){if(ge=M.get(B,B-1)*M.get(B-1,B),ft=(M.get(B-1,B-1)-M.get(B,B))/2,Ft=ft*ft+ge,Zt=Math.sqrt(Math.abs(Ft)),M.set(B,B,M.get(B,B)+ot),M.set(B-1,B-1,M.get(B-1,B-1)+ot),xe=M.get(B,B),Ft>=0){for(Zt=ft>=0?ft+Zt:ft-Zt,E[B-1]=xe+Zt,E[B]=E[B-1],Zt!==0&&(E[B]=xe-ge/Zt),x[B-1]=0,x[B]=0,xe=M.get(B,B-1),Lt=Math.abs(xe)+Math.abs(Zt),ft=xe/Lt,Ft=Zt/Lt,qt=Math.sqrt(ft*ft+Ft*Ft),ft=ft/qt,Ft=Ft/qt,Wt=B-1;Wt<U;Wt++)Zt=M.get(B-1,Wt),M.set(B-1,Wt,Ft*Zt+ft*M.get(B,Wt)),M.set(B,Wt,Ft*M.get(B,Wt)-ft*Zt);for(mt=0;mt<=B;mt++)Zt=M.get(mt,B-1),M.set(mt,B-1,Ft*Zt+ft*M.get(mt,B)),M.set(mt,B,Ft*M.get(mt,B)-ft*Zt);for(mt=J;mt<=$;mt++)Zt=m.get(mt,B-1),m.set(mt,B-1,Ft*Zt+ft*m.get(mt,B)),m.set(mt,B,Ft*m.get(mt,B)-ft*Zt)}else E[B-1]=xe+ft,E[B]=xe+ft,x[B-1]=Zt,x[B]=-Zt;B=B-2,oe=0}else{if(xe=M.get(B,B),Ze=0,ge=0,we<B&&(Ze=M.get(B-1,B-1),ge=M.get(B,B-1)*M.get(B-1,B)),oe===10){for(ot+=xe,mt=J;mt<=B;mt++)M.set(mt,mt,M.get(mt,mt)-xe);Lt=Math.abs(M.get(B,B-1))+Math.abs(M.get(B-1,B-2)),xe=Ze=.75*Lt,ge=-.4375*Lt*Lt}if(oe===30&&(Lt=(Ze-xe)/2,Lt=Lt*Lt+ge,Lt>0)){for(Lt=Math.sqrt(Lt),Ze<xe&&(Lt=-Lt),Lt=xe-ge/((Ze-xe)/2+Lt),mt=J;mt<=B;mt++)M.set(mt,mt,M.get(mt,mt)-Lt);ot+=Lt,xe=Ze=ge=.964}for(oe=oe+1,Ae=B-2;Ae>=we&&(Zt=M.get(Ae,Ae),qt=xe-Zt,Lt=Ze-Zt,ft=(qt*Lt-ge)/M.get(Ae+1,Ae)+M.get(Ae,Ae+1),Ft=M.get(Ae+1,Ae+1)-Zt-qt-Lt,qt=M.get(Ae+2,Ae+1),Lt=Math.abs(ft)+Math.abs(Ft)+Math.abs(qt),ft=ft/Lt,Ft=Ft/Lt,qt=qt/Lt,!(Ae===we||Math.abs(M.get(Ae,Ae-1))*(Math.abs(Ft)+Math.abs(qt))<st*(Math.abs(ft)*(Math.abs(M.get(Ae-1,Ae-1))+Math.abs(Zt)+Math.abs(M.get(Ae+1,Ae+1))))));)Ae--;for(mt=Ae+2;mt<=B;mt++)M.set(mt,mt-2,0),mt>Ae+2&&M.set(mt,mt-3,0);for(he=Ae;he<=B-1&&(dn=he!==B-1,he!==Ae&&(ft=M.get(he,he-1),Ft=M.get(he+1,he-1),qt=dn?M.get(he+2,he-1):0,xe=Math.abs(ft)+Math.abs(Ft)+Math.abs(qt),xe!==0&&(ft=ft/xe,Ft=Ft/xe,qt=qt/xe)),xe!==0);he++)if(Lt=Math.sqrt(ft*ft+Ft*Ft+qt*qt),ft<0&&(Lt=-Lt),Lt!==0){for(he!==Ae?M.set(he,he-1,-Lt*xe):we!==Ae&&M.set(he,he-1,-M.get(he,he-1)),ft=ft+Lt,xe=ft/Lt,Ze=Ft/Lt,Zt=qt/Lt,Ft=Ft/ft,qt=qt/ft,Wt=he;Wt<U;Wt++)ft=M.get(he,Wt)+Ft*M.get(he+1,Wt),dn&&(ft=ft+qt*M.get(he+2,Wt),M.set(he+2,Wt,M.get(he+2,Wt)-ft*Zt)),M.set(he,Wt,M.get(he,Wt)-ft*xe),M.set(he+1,Wt,M.get(he+1,Wt)-ft*Ze);for(mt=0;mt<=Math.min(B,he+3);mt++)ft=xe*M.get(mt,he)+Ze*M.get(mt,he+1),dn&&(ft=ft+Zt*M.get(mt,he+2),M.set(mt,he+2,M.get(mt,he+2)-ft*qt)),M.set(mt,he,M.get(mt,he)-ft),M.set(mt,he+1,M.get(mt,he+1)-ft*Ft);for(mt=J;mt<=$;mt++)ft=xe*m.get(mt,he)+Ze*m.get(mt,he+1),dn&&(ft=ft+Zt*m.get(mt,he+2),m.set(mt,he+2,m.get(mt,he+2)-ft*qt)),m.set(mt,he,m.get(mt,he)-ft),m.set(mt,he+1,m.get(mt,he+1)-ft*Ft)}}}if(Tt!==0){for(B=U-1;B>=0;B--)if(ft=E[B],Ft=x[B],Ft===0)for(we=B,M.set(B,B,1),mt=B-1;mt>=0;mt--){for(ge=M.get(mt,mt)-ft,qt=0,Wt=we;Wt<=B;Wt++)qt=qt+M.get(mt,Wt)*M.get(Wt,B);if(x[mt]<0)Zt=ge,Lt=qt;else if(we=mt,x[mt]===0?M.set(mt,B,ge!==0?-qt/ge:-qt/(st*Tt)):(xe=M.get(mt,mt+1),Ze=M.get(mt+1,mt),Ft=(E[mt]-ft)*(E[mt]-ft)+x[mt]*x[mt],cn=(xe*Lt-Zt*qt)/Ft,M.set(mt,B,cn),M.set(mt+1,B,Math.abs(xe)>Math.abs(Zt)?(-qt-ge*cn)/xe:(-Lt-Ze*cn)/Zt)),cn=Math.abs(M.get(mt,B)),st*cn*cn>1)for(Wt=mt;Wt<=B;Wt++)M.set(Wt,B,M.get(Wt,B)/cn)}else if(Ft<0)for(we=B-1,Math.abs(M.get(B,B-1))>Math.abs(M.get(B-1,B))?(M.set(B-1,B-1,Ft/M.get(B,B-1)),M.set(B-1,B,-(M.get(B,B)-ft)/M.get(B,B-1))):(Je=Zo(0,-M.get(B-1,B),M.get(B-1,B-1)-ft,Ft),M.set(B-1,B-1,Je[0]),M.set(B-1,B,Je[1])),M.set(B,B-1,0),M.set(B,B,1),mt=B-2;mt>=0;mt--){for(Mt=0,Yt=0,Wt=we;Wt<=B;Wt++)Mt=Mt+M.get(mt,Wt)*M.get(Wt,B-1),Yt=Yt+M.get(mt,Wt)*M.get(Wt,B);if(ge=M.get(mt,mt)-ft,x[mt]<0)Zt=ge,qt=Mt,Lt=Yt;else if(we=mt,x[mt]===0?(Je=Zo(-Mt,-Yt,ge,Ft),M.set(mt,B-1,Je[0]),M.set(mt,B,Je[1])):(xe=M.get(mt,mt+1),Ze=M.get(mt+1,mt),Jt=(E[mt]-ft)*(E[mt]-ft)+x[mt]*x[mt]-Ft*Ft,Ht=(E[mt]-ft)*2*Ft,Jt===0&&Ht===0&&(Jt=st*Tt*(Math.abs(ge)+Math.abs(Ft)+Math.abs(xe)+Math.abs(Ze)+Math.abs(Zt))),Je=Zo(xe*qt-Zt*Mt+Ft*Yt,xe*Lt-Zt*Yt-Ft*Mt,Jt,Ht),M.set(mt,B-1,Je[0]),M.set(mt,B,Je[1]),Math.abs(xe)>Math.abs(Zt)+Math.abs(Ft)?(M.set(mt+1,B-1,(-Mt-ge*M.get(mt,B-1)+Ft*M.get(mt,B))/xe),M.set(mt+1,B,(-Yt-ge*M.get(mt,B)-Ft*M.get(mt,B-1))/xe)):(Je=Zo(-qt-Ze*M.get(mt,B-1),-Lt-Ze*M.get(mt,B),Zt,Ft),M.set(mt+1,B-1,Je[0]),M.set(mt+1,B,Je[1]))),cn=Math.max(Math.abs(M.get(mt,B-1)),Math.abs(M.get(mt,B))),st*cn*cn>1)for(Wt=mt;Wt<=B;Wt++)M.set(Wt,B-1,M.get(Wt,B-1)/cn),M.set(Wt,B,M.get(Wt,B)/cn)}for(mt=0;mt<U;mt++)if(mt<J||mt>$)for(Wt=mt;Wt<U;Wt++)m.set(mt,Wt,M.get(mt,Wt));for(Wt=U-1;Wt>=J;Wt--)for(mt=J;mt<=$;mt++){for(Zt=0,he=J;he<=Math.min(Wt,$);he++)Zt=Zt+m.get(mt,he)*M.get(he,Wt);m.set(mt,Wt,Zt)}}}function Zo(U,x,E,m){let M,B;return Math.abs(E)>Math.abs(m)?(M=m/E,B=E+M*m,[(U+M*x)/B,(x-M*U)/B]):(M=E/m,B=m+M*E,[(M*U+x)/B,(M*x-U)/B])}class pd{constructor(x){if(x=An.checkMatrix(x),!x.isSymmetric())throw new Error("Matrix is not symmetric");let E=x,m=E.rows,M=new ne(m,m),B=!0,J,$,st;for($=0;$<m;$++){let ot=0;for(st=0;st<$;st++){let Tt=0;for(J=0;J<st;J++)Tt+=M.get(st,J)*M.get($,J);Tt=(E.get($,st)-Tt)/M.get(st,st),M.set($,st,Tt),ot=ot+Tt*Tt}for(ot=E.get($,$)-ot,B&&(B=ot>0),M.set($,$,Math.sqrt(Math.max(ot,0))),st=$+1;st<m;st++)M.set($,st,0)}this.L=M,this.positiveDefinite=B}isPositiveDefinite(){return this.positiveDefinite}solve(x){x=An.checkMatrix(x);let E=this.L,m=E.rows;if(x.rows!==m)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let M=x.columns,B=x.clone(),J,$,st;for(st=0;st<m;st++)for($=0;$<M;$++){for(J=0;J<st;J++)B.set(st,$,B.get(st,$)-B.get(J,$)*E.get(st,J));B.set(st,$,B.get(st,$)/E.get(st,st))}for(st=m-1;st>=0;st--)for($=0;$<M;$++){for(J=st+1;J<m;J++)B.set(st,$,B.get(st,$)-B.get(J,$)*E.get(J,st));B.set(st,$,B.get(st,$)/E.get(st,st))}return B}get lowerTriangularMatrix(){return this.L}}class Xl{constructor(x,E={}){x=An.checkMatrix(x);let{Y:m}=E;const{scaleScores:M=!1,maxIterations:B=1e3,terminationCriteria:J=1e-10}=E;let $;if(m){if(nt.isAnyArray(m)&&typeof m[0]=="number"?m=ne.columnVector(m):m=An.checkMatrix(m),m.rows!==x.rows)throw new Error("Y should have the same number of rows as X");$=m.getColumnVector(0)}else $=x.getColumnVector(0);let st=1,ot,Tt,ft,Ft;for(let qt=0;qt<B&&st>J;qt++)ft=x.transpose().mmul($).div($.transpose().mmul($).get(0,0)),ft=ft.div(ft.norm()),ot=x.mmul(ft).div(ft.transpose().mmul(ft).get(0,0)),qt>0&&(st=ot.clone().sub(Ft).pow(2).sum()),Ft=ot.clone(),m?(Tt=m.transpose().mmul(ot).div(ot.transpose().mmul(ot).get(0,0)),Tt=Tt.div(Tt.norm()),$=m.mmul(Tt).div(Tt.transpose().mmul(Tt).get(0,0))):$=ot;if(m){let qt=x.transpose().mmul(ot).div(ot.transpose().mmul(ot).get(0,0));qt=qt.div(qt.norm());let Lt=x.clone().sub(ot.clone().mmul(qt.transpose())),Zt=$.transpose().mmul(ot).div(ot.transpose().mmul(ot).get(0,0)),oe=m.clone().sub(ot.clone().mulS(Zt.get(0,0)).mmul(Tt.transpose()));this.t=ot,this.p=qt.transpose(),this.w=ft.transpose(),this.q=Tt,this.u=$,this.s=ot.transpose().mmul(ot),this.xResidual=Lt,this.yResidual=oe,this.betas=Zt}else this.w=ft.transpose(),this.s=ot.transpose().mmul(ot).sqrt(),M?this.t=ot.clone().div(this.s.get(0,0)):this.t=ot,this.xResidual=x.sub(ot.mmul(ft.transpose()))}}Q.XA=re,Q.a_=pd,Q.yQ=pd,Q.Hs=Yn,Q.Ec=fd,Q.dx=fd,Q.LU=Ui,Q.Rm=Ui,Q.y3=ne,Q.qK=ua,Q.pb=ls,Q.j=qs,Q.sO=ha,Q.BZ=cs,Q.EK=Fo,Q.Db=us,Q.Fx=hs,Q.tU=Ai,Q.Ym=Xl,Q.rs=Xl,Q.QR=zo,Q.TB=zo,Q.oH=Oa,Q.Sc=Oa,Q.BN=Lr,Q.it=Ti,Q.$r=An,Q.QM=dd,Q.AV=$0,A=ne,Q.GH=jo,Q.SO=X0,Q.uZ=q0,Q.yU=J0,Q.F1=hd,Q.re=ud},45411:function(V){"use strict";V.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},75196:function(V,Q,S){var A=S(45411),z=S(81683),D=Object.hasOwnProperty,N=Object.create(null);for(var T in A)D.call(A,T)&&(N[A[T]]=T);var k=V.exports={to:{},get:{}};k.get=function(P){var I=P.substring(0,3).toLowerCase(),L,Z;switch(I){case"hsl":L=k.get.hsl(P),Z="hsl";break;case"hwb":L=k.get.hwb(P),Z="hwb";break;default:L=k.get.rgb(P),Z="rgb";break}return L?{model:Z,value:L}:null},k.get.rgb=function(P){if(!P)return null;var I=/^#([a-f0-9]{3,4})$/i,L=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,Z=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,Y=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,X=/^(\w+)$/,nt=[0,0,0,1],tt,q,it;if(tt=P.match(L)){for(it=tt[2],tt=tt[1],q=0;q<3;q++){var at=q*2;nt[q]=parseInt(tt.slice(at,at+2),16)}it&&(nt[3]=parseInt(it,16)/255)}else if(tt=P.match(I)){for(tt=tt[1],it=tt[3],q=0;q<3;q++)nt[q]=parseInt(tt[q]+tt[q],16);it&&(nt[3]=parseInt(it+it,16)/255)}else if(tt=P.match(Z)){for(q=0;q<3;q++)nt[q]=parseInt(tt[q+1],0);tt[4]&&(tt[5]?nt[3]=parseFloat(tt[4])*.01:nt[3]=parseFloat(tt[4]))}else if(tt=P.match(Y)){for(q=0;q<3;q++)nt[q]=Math.round(parseFloat(tt[q+1])*2.55);tt[4]&&(tt[5]?nt[3]=parseFloat(tt[4])*.01:nt[3]=parseFloat(tt[4]))}else return(tt=P.match(X))?tt[1]==="transparent"?[0,0,0,0]:D.call(A,tt[1])?(nt=A[tt[1]],nt[3]=1,nt):null:null;for(q=0;q<3;q++)nt[q]=R(nt[q],0,255);return nt[3]=R(nt[3],0,1),nt},k.get.hsl=function(P){if(!P)return null;var I=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,L=P.match(I);if(L){var Z=parseFloat(L[4]),Y=(parseFloat(L[1])%360+360)%360,X=R(parseFloat(L[2]),0,100),nt=R(parseFloat(L[3]),0,100),tt=R(isNaN(Z)?1:Z,0,1);return[Y,X,nt,tt]}return null},k.get.hwb=function(P){if(!P)return null;var I=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,L=P.match(I);if(L){var Z=parseFloat(L[4]),Y=(parseFloat(L[1])%360+360)%360,X=R(parseFloat(L[2]),0,100),nt=R(parseFloat(L[3]),0,100),tt=R(isNaN(Z)?1:Z,0,1);return[Y,X,nt,tt]}return null},k.to.hex=function(){var P=z(arguments);return"#"+C(P[0])+C(P[1])+C(P[2])+(P[3]<1?C(Math.round(P[3]*255)):"")},k.to.rgb=function(){var P=z(arguments);return P.length<4||P[3]===1?"rgb("+Math.round(P[0])+", "+Math.round(P[1])+", "+Math.round(P[2])+")":"rgba("+Math.round(P[0])+", "+Math.round(P[1])+", "+Math.round(P[2])+", "+P[3]+")"},k.to.rgb.percent=function(){var P=z(arguments),I=Math.round(P[0]/255*100),L=Math.round(P[1]/255*100),Z=Math.round(P[2]/255*100);return P.length<4||P[3]===1?"rgb("+I+"%, "+L+"%, "+Z+"%)":"rgba("+I+"%, "+L+"%, "+Z+"%, "+P[3]+")"},k.to.hsl=function(){var P=z(arguments);return P.length<4||P[3]===1?"hsl("+P[0]+", "+P[1]+"%, "+P[2]+"%)":"hsla("+P[0]+", "+P[1]+"%, "+P[2]+"%, "+P[3]+")"},k.to.hwb=function(){var P=z(arguments),I="";return P.length>=4&&P[3]!==1&&(I=", "+P[3]),"hwb("+P[0]+", "+P[1]+"%, "+P[2]+"%"+I+")"},k.to.keyword=function(P){return N[P.slice(0,3)]};function R(P,I,L){return Math.min(Math.max(I,P),L)}function C(P){var I=Math.round(P).toString(16).toUpperCase();return I.length<2?"0"+I:I}},92546:function(V,Q,S){V.exports={graphlib:S(76626),layout:S(47194),debug:S(11303),util:{time:S(53063).time,notime:S(53063).notime},version:S(11897)}},81255:function(V,Q,S){"use strict";var A=S(72361),z=S(39240);V.exports={run:D,undo:T};function D(k){var R=k.graph().acyclicer==="greedy"?z(k,C(k)):N(k);A.forEach(R,function(P){var I=k.edge(P);k.removeEdge(P),I.forwardName=P.name,I.reversed=!0,k.setEdge(P.w,P.v,I,A.uniqueId("rev"))});function C(P){return function(I){return P.edge(I).weight}}}function N(k){var R=[],C={},P={};function I(L){A.has(P,L)||(P[L]=!0,C[L]=!0,A.forEach(k.outEdges(L),function(Z){A.has(C,Z.w)?R.push(Z):I(Z.w)}),delete C[L])}return A.forEach(k.nodes(),I),R}function T(k){A.forEach(k.edges(),function(R){var C=k.edge(R);if(C.reversed){k.removeEdge(R);var P=C.forwardName;delete C.reversed,delete C.forwardName,k.setEdge(R.w,R.v,C,P)}})}},60765:function(V,Q,S){var A=S(72361),z=S(53063);V.exports=D;function D(T){function k(R){var C=T.children(R),P=T.node(R);if(C.length&&A.forEach(C,k),A.has(P,"minRank")){P.borderLeft=[],P.borderRight=[];for(var I=P.minRank,L=P.maxRank+1;I<L;++I)N(T,"borderLeft","_bl",R,P,I),N(T,"borderRight","_br",R,P,I)}}A.forEach(T.children(),k)}function N(T,k,R,C,P,I){var L={width:0,height:0,rank:I,borderType:k},Z=P[k][I-1],Y=z.addDummyNode(T,"border",L,R);P[k][I]=Y,T.setParent(Y,C),Z&&T.setEdge(Z,Y,{weight:1})}},13257:function(V,Q,S){"use strict";var A=S(72361);V.exports={adjust:z,undo:D};function z(I){var L=I.graph().rankdir.toLowerCase();(L==="lr"||L==="rl")&&N(I)}function D(I){var L=I.graph().rankdir.toLowerCase();(L==="bt"||L==="rl")&&k(I),(L==="lr"||L==="rl")&&(C(I),N(I))}function N(I){A.forEach(I.nodes(),function(L){T(I.node(L))}),A.forEach(I.edges(),function(L){T(I.edge(L))})}function T(I){var L=I.width;I.width=I.height,I.height=L}function k(I){A.forEach(I.nodes(),function(L){R(I.node(L))}),A.forEach(I.edges(),function(L){var Z=I.edge(L);A.forEach(Z.points,R),A.has(Z,"y")&&R(Z)})}function R(I){I.y=-I.y}function C(I){A.forEach(I.nodes(),function(L){P(I.node(L))}),A.forEach(I.edges(),function(L){var Z=I.edge(L);A.forEach(Z.points,P),A.has(Z,"x")&&P(Z)})}function P(I){var L=I.x;I.x=I.y,I.y=L}},21135:function(V){V.exports=Q;function Q(){var z={};z._next=z._prev=z,this._sentinel=z}Q.prototype.dequeue=function(){var z=this._sentinel,D=z._prev;if(D!==z)return S(D),D},Q.prototype.enqueue=function(z){var D=this._sentinel;z._prev&&z._next&&S(z),z._next=D._next,D._next._prev=z,D._next=z,z._prev=D},Q.prototype.toString=function(){for(var z=[],D=this._sentinel,N=D._prev;N!==D;)z.push(JSON.stringify(N,A)),N=N._prev;return"["+z.join(", ")+"]"};function S(z){z._prev._next=z._next,z._next._prev=z._prev,delete z._next,delete z._prev}function A(z,D){if(z!=="_next"&&z!=="_prev")return D}},11303:function(V,Q,S){var A=S(72361),z=S(53063),D=S(76626).Graph;V.exports={debugOrdering:N};function N(T){var k=z.buildLayerMatrix(T),R=new D({compound:!0,multigraph:!0}).setGraph({});return A.forEach(T.nodes(),function(C){R.setNode(C,{label:C}),R.setParent(C,"layer"+T.node(C).rank)}),A.forEach(T.edges(),function(C){R.setEdge(C.v,C.w,{},C.name)}),A.forEach(k,function(C,P){var I="layer"+P;R.setNode(I,{rank:"same"}),A.reduce(C,function(L,Z){return R.setEdge(L,Z,{style:"invis"}),Z})}),R}},76626:function(V,Q,S){var A;try{A=S(75172)}catch(z){}A||(A=window.graphlib),V.exports=A},39240:function(V,Q,S){var A=S(72361),z=S(76626).Graph,D=S(21135);V.exports=T;var N=A.constant(1);function T(I,L){if(I.nodeCount()<=1)return[];var Z=C(I,L||N),Y=k(Z.graph,Z.buckets,Z.zeroIdx);return A.flatten(A.map(Y,function(X){return I.outEdges(X.v,X.w)}),!0)}function k(I,L,Z){for(var Y=[],X=L[L.length-1],nt=L[0],tt;I.nodeCount();){for(;tt=nt.dequeue();)R(I,L,Z,tt);for(;tt=X.dequeue();)R(I,L,Z,tt);if(I.nodeCount()){for(var q=L.length-2;q>0;--q)if(tt=L[q].dequeue(),tt){Y=Y.concat(R(I,L,Z,tt,!0));break}}}return Y}function R(I,L,Z,Y,X){var nt=X?[]:void 0;return A.forEach(I.inEdges(Y.v),function(tt){var q=I.edge(tt),it=I.node(tt.v);X&&nt.push({v:tt.v,w:tt.w}),it.out-=q,P(L,Z,it)}),A.forEach(I.outEdges(Y.v),function(tt){var q=I.edge(tt),it=tt.w,at=I.node(it);at.in-=q,P(L,Z,at)}),I.removeNode(Y.v),nt}function C(I,L){var Z=new z,Y=0,X=0;A.forEach(I.nodes(),function(q){Z.setNode(q,{v:q,in:0,out:0})}),A.forEach(I.edges(),function(q){var it=Z.edge(q.v,q.w)||0,at=L(q),ct=it+at;Z.setEdge(q.v,q.w,ct),X=Math.max(X,Z.node(q.v).out+=at),Y=Math.max(Y,Z.node(q.w).in+=at)});var nt=A.range(X+Y+3).map(function(){return new D}),tt=Y+1;return A.forEach(Z.nodes(),function(q){P(nt,tt,Z.node(q))}),{graph:Z,buckets:nt,zeroIdx:tt}}function P(I,L,Z){Z.out?Z.in?I[Z.out-Z.in+L].enqueue(Z):I[I.length-1].enqueue(Z):I[0].enqueue(Z)}},47194:function(V,Q,S){"use strict";var A=S(72361),z=S(81255),D=S(27163),N=S(64505),T=S(53063).normalizeRanks,k=S(71970),R=S(53063).removeEmptyRanks,C=S(31733),P=S(60765),I=S(13257),L=S(62852),Z=S(93021),Y=S(53063),X=S(76626).Graph;V.exports=nt;function nt(dt,St){var Ot=St&&St.debugTiming?Y.time:Y.notime;Ot("layout",function(){var Gt=Ot(" buildLayoutGraph",function(){return Et(dt)});Ot(" runLayout",function(){tt(Gt,Ot)}),Ot(" updateInputGraph",function(){q(dt,Gt)})})}function tt(dt,St){St(" makeSpaceForEdgeLabels",function(){Pt(dt)}),St(" removeSelfEdges",function(){la(dt)}),St(" acyclic",function(){z.run(dt)}),St(" nestingGraph.run",function(){C.run(dt)}),St(" rank",function(){N(Y.asNonCompoundGraph(dt))}),St(" injectEdgeLabelProxies",function(){zt(dt)}),St(" removeEmptyRanks",function(){R(dt)}),St(" nestingGraph.cleanup",function(){C.cleanup(dt)}),St(" normalizeRanks",function(){T(dt)}),St(" assignRankMinMax",function(){Vt(dt)}),St(" removeEdgeLabelProxies",function(){Qt(dt)}),St(" normalize.run",function(){D.run(dt)}),St(" parentDummyChains",function(){k(dt)}),St(" addBorderSegments",function(){P(dt)}),St(" order",function(){L(dt)}),St(" insertSelfEdges",function(){ss(dt)}),St(" adjustCoordinateSystem",function(){I.adjust(dt)}),St(" position",function(){Z(dt)}),St(" positionSelfEdges",function(){Rt(dt)}),St(" removeBorderNodes",function(){ti(dt)}),St(" normalize.undo",function(){D.undo(dt)}),St(" fixupEdgeLabelCoords",function(){$e(dt)}),St(" undoCoordinateSystem",function(){I.undo(dt)}),St(" translateGraph",function(){Ee(dt)}),St(" assignNodeIntersects",function(){Re(dt)}),St(" reversePoints",function(){nr(dt)}),St(" acyclic.undo",function(){z.undo(dt)})}function q(dt,St){A.forEach(dt.nodes(),function(Ot){var Gt=dt.node(Ot),se=St.node(Ot);Gt&&(Gt.x=se.x,Gt.y=se.y,St.children(Ot).length&&(Gt.width=se.width,Gt.height=se.height))}),A.forEach(dt.edges(),function(Ot){var Gt=dt.edge(Ot),se=St.edge(Ot);Gt.points=se.points,A.has(se,"x")&&(Gt.x=se.x,Gt.y=se.y)}),dt.graph().width=St.graph().width,dt.graph().height=St.graph().height}var it=["nodesep","edgesep","ranksep","marginx","marginy"],at={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ct=["acyclicer","ranker","rankdir","align"],ut=["width","height"],bt={width:0,height:0},gt=["minlen","weight","width","height","labeloffset"],wt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vt=["labelpos"];function Et(dt){var St=new X({multigraph:!0,compound:!0}),Ot=It(dt.graph());return St.setGraph(A.merge({},at,Dt(Ot,it),A.pick(Ot,ct))),A.forEach(dt.nodes(),function(Gt){var se=It(dt.node(Gt));St.setNode(Gt,A.defaults(Dt(se,ut),bt)),St.setParent(Gt,dt.parent(Gt))}),A.forEach(dt.edges(),function(Gt){var se=It(dt.edge(Gt));St.setEdge(Gt,A.merge({},wt,Dt(se,gt),A.pick(se,vt)))}),St}function Pt(dt){var St=dt.graph();St.ranksep/=2,A.forEach(dt.edges(),function(Ot){var Gt=dt.edge(Ot);Gt.minlen*=2,Gt.labelpos.toLowerCase()!=="c"&&(St.rankdir==="TB"||St.rankdir==="BT"?Gt.width+=Gt.labeloffset:Gt.height+=Gt.labeloffset)})}function zt(dt){A.forEach(dt.edges(),function(St){var Ot=dt.edge(St);if(Ot.width&&Ot.height){var Gt=dt.node(St.v),se=dt.node(St.w),be={rank:(se.rank-Gt.rank)/2+Gt.rank,e:St};Y.addDummyNode(dt,"edge-proxy",be,"_ep")}})}function Vt(dt){var St=0;A.forEach(dt.nodes(),function(Ot){var Gt=dt.node(Ot);Gt.borderTop&&(Gt.minRank=dt.node(Gt.borderTop).rank,Gt.maxRank=dt.node(Gt.borderBottom).rank,St=A.max(St,Gt.maxRank))}),dt.graph().maxRank=St}function Qt(dt){A.forEach(dt.nodes(),function(St){var Ot=dt.node(St);Ot.dummy==="edge-proxy"&&(dt.edge(Ot.e).labelRank=Ot.rank,dt.removeNode(St))})}function Ee(dt){var St=Number.POSITIVE_INFINITY,Ot=0,Gt=Number.POSITIVE_INFINITY,se=0,be=dt.graph(),de=be.marginx||0,Le=be.marginy||0;function Mn(Nn){var ke=Nn.x,Se=Nn.y,re=Nn.width,Oe=Nn.height;St=Math.min(St,ke-re/2),Ot=Math.max(Ot,ke+re/2),Gt=Math.min(Gt,Se-Oe/2),se=Math.max(se,Se+Oe/2)}A.forEach(dt.nodes(),function(Nn){Mn(dt.node(Nn))}),A.forEach(dt.edges(),function(Nn){var ke=dt.edge(Nn);A.has(ke,"x")&&Mn(ke)}),St-=de,Gt-=Le,A.forEach(dt.nodes(),function(Nn){var ke=dt.node(Nn);ke.x-=St,ke.y-=Gt}),A.forEach(dt.edges(),function(Nn){var ke=dt.edge(Nn);A.forEach(ke.points,function(Se){Se.x-=St,Se.y-=Gt}),A.has(ke,"x")&&(ke.x-=St),A.has(ke,"y")&&(ke.y-=Gt)}),be.width=Ot-St+de,be.height=se-Gt+Le}function Re(dt){A.forEach(dt.edges(),function(St){var Ot=dt.edge(St),Gt=dt.node(St.v),se=dt.node(St.w),be,de;Ot.points?(be=Ot.points[0],de=Ot.points[Ot.points.length-1]):(Ot.points=[],be=se,de=Gt),Ot.points.unshift(Y.intersectRect(Gt,be)),Ot.points.push(Y.intersectRect(se,de))})}function $e(dt){A.forEach(dt.edges(),function(St){var Ot=dt.edge(St);if(A.has(Ot,"x"))switch((Ot.labelpos==="l"||Ot.labelpos==="r")&&(Ot.width-=Ot.labeloffset),Ot.labelpos){case"l":Ot.x-=Ot.width/2+Ot.labeloffset;break;case"r":Ot.x+=Ot.width/2+Ot.labeloffset;break}})}function nr(dt){A.forEach(dt.edges(),function(St){var Ot=dt.edge(St);Ot.reversed&&Ot.points.reverse()})}function ti(dt){A.forEach(dt.nodes(),function(St){if(dt.children(St).length){var Ot=dt.node(St),Gt=dt.node(Ot.borderTop),se=dt.node(Ot.borderBottom),be=dt.node(A.last(Ot.borderLeft)),de=dt.node(A.last(Ot.borderRight));Ot.width=Math.abs(de.x-be.x),Ot.height=Math.abs(se.y-Gt.y),Ot.x=be.x+Ot.width/2,Ot.y=Gt.y+Ot.height/2}}),A.forEach(dt.nodes(),function(St){dt.node(St).dummy==="border"&&dt.removeNode(St)})}function la(dt){A.forEach(dt.edges(),function(St){if(St.v===St.w){var Ot=dt.node(St.v);Ot.selfEdges||(Ot.selfEdges=[]),Ot.selfEdges.push({e:St,label:dt.edge(St)}),dt.removeEdge(St)}})}function ss(dt){var St=Y.buildLayerMatrix(dt);A.forEach(St,function(Ot){var Gt=0;A.forEach(Ot,function(se,be){var de=dt.node(se);de.order=be+Gt,A.forEach(de.selfEdges,function(Le){Y.addDummyNode(dt,"selfedge",{width:Le.label.width,height:Le.label.height,rank:de.rank,order:be+ ++Gt,e:Le.e,label:Le.label},"_se")}),delete de.selfEdges})})}function Rt(dt){A.forEach(dt.nodes(),function(St){var Ot=dt.node(St);if(Ot.dummy==="selfedge"){var Gt=dt.node(Ot.e.v),se=Gt.x+Gt.width/2,be=Gt.y,de=Ot.x-se,Le=Gt.height/2;dt.setEdge(Ot.e,Ot.label),dt.removeNode(St),Ot.label.points=[{x:se+2*de/3,y:be-Le},{x:se+5*de/6,y:be-Le},{x:se+de,y:be},{x:se+5*de/6,y:be+Le},{x:se+2*de/3,y:be+Le}],Ot.label.x=Ot.x,Ot.label.y=Ot.y}})}function Dt(dt,St){return A.mapValues(A.pick(dt,St),Number)}function It(dt){var St={};return A.forEach(dt,function(Ot,Gt){St[Gt.toLowerCase()]=Ot}),St}},72361:function(V,Q,S){var A;try{A={cloneDeep:S(20250),constant:S(13503),defaults:S(28548),each:S(76934),filter:S(64725),find:S(79785),flatten:S(39807),forEach:S(99204),forIn:S(23190),has:S(99946),isUndefined:S(16513),last:S(10611),map:S(9924),mapValues:S(70642),max:S(95987),merge:S(28440),min:S(80991),minBy:S(83296),now:S(5795),pick:S(89409),range:S(60859),reduce:S(16473),sortBy:S(351),uniqueId:S(95708),values:S(81229),zipObject:S(65441)}}catch(z){}A||(A=window._),V.exports=A},31733:function(V,Q,S){var A=S(72361),z=S(53063);V.exports={run:D,cleanup:R};function D(C){var P=z.addDummyNode(C,"root",{},"_root"),I=T(C),L=A.max(A.values(I))-1,Z=2*L+1;C.graph().nestingRoot=P,A.forEach(C.edges(),function(X){C.edge(X).minlen*=Z});var Y=k(C)+1;A.forEach(C.children(),function(X){N(C,P,Z,Y,L,I,X)}),C.graph().nodeRankFactor=Z}function N(C,P,I,L,Z,Y,X){var nt=C.children(X);if(!nt.length){X!==P&&C.setEdge(P,X,{weight:0,minlen:I});return}var tt=z.addBorderNode(C,"_bt"),q=z.addBorderNode(C,"_bb"),it=C.node(X);C.setParent(tt,X),it.borderTop=tt,C.setParent(q,X),it.borderBottom=q,A.forEach(nt,function(at){N(C,P,I,L,Z,Y,at);var ct=C.node(at),ut=ct.borderTop?ct.borderTop:at,bt=ct.borderBottom?ct.borderBottom:at,gt=ct.borderTop?L:2*L,wt=ut!==bt?1:Z-Y[X]+1;C.setEdge(tt,ut,{weight:gt,minlen:wt,nestingEdge:!0}),C.setEdge(bt,q,{weight:gt,minlen:wt,nestingEdge:!0})}),C.parent(X)||C.setEdge(P,tt,{weight:0,minlen:Z+Y[X]})}function T(C){var P={};function I(L,Z){var Y=C.children(L);Y&&Y.length&&A.forEach(Y,function(X){I(X,Z+1)}),P[L]=Z}return A.forEach(C.children(),function(L){I(L,1)}),P}function k(C){return A.reduce(C.edges(),function(P,I){return P+C.edge(I).weight},0)}function R(C){var P=C.graph();C.removeNode(P.nestingRoot),delete P.nestingRoot,A.forEach(C.edges(),function(I){var L=C.edge(I);L.nestingEdge&&C.removeEdge(I)})}},27163:function(V,Q,S){"use strict";var A=S(72361),z=S(53063);V.exports={run:D,undo:T};function D(k){k.graph().dummyChains=[],A.forEach(k.edges(),function(R){N(k,R)})}function N(k,R){var C=R.v,P=k.node(C).rank,I=R.w,L=k.node(I).rank,Z=R.name,Y=k.edge(R),X=Y.labelRank;if(L!==P+1){k.removeEdge(R);var nt,tt,q;for(q=0,++P;P<L;++q,++P)Y.points=[],tt={width:0,height:0,edgeLabel:Y,edgeObj:R,rank:P},nt=z.addDummyNode(k,"edge",tt,"_d"),P===X&&(tt.width=Y.width,tt.height=Y.height,tt.dummy="edge-label",tt.labelpos=Y.labelpos),k.setEdge(C,nt,{weight:Y.weight},Z),q===0&&k.graph().dummyChains.push(nt),C=nt;k.setEdge(C,I,{weight:Y.weight},Z)}}function T(k){A.forEach(k.graph().dummyChains,function(R){var C=k.node(R),P=C.edgeLabel,I;for(k.setEdge(C.edgeObj,P);C.dummy;)I=k.successors(R)[0],k.removeNode(R),P.points.push({x:C.x,y:C.y}),C.dummy==="edge-label"&&(P.x=C.x,P.y=C.y,P.width=C.width,P.height=C.height),R=I,C=k.node(R)})}},52205:function(V,Q,S){var A=S(72361);V.exports=z;function z(D,N,T){var k={},R;A.forEach(T,function(C){for(var P=D.parent(C),I,L;P;){if(I=D.parent(P),I?(L=k[I],k[I]=P):(L=R,R=P),L&&L!==P){N.setEdge(L,P);return}P=I}})}},99506:function(V,Q,S){var A=S(72361);V.exports=z;function z(D,N){return A.map(N,function(T){var k=D.inEdges(T);if(k.length){var R=A.reduce(k,function(C,P){var I=D.edge(P),L=D.node(P.v);return{sum:C.sum+I.weight*L.order,weight:C.weight+I.weight}},{sum:0,weight:0});return{v:T,barycenter:R.sum/R.weight,weight:R.weight}}else return{v:T}})}},59105:function(V,Q,S){var A=S(72361),z=S(76626).Graph;V.exports=D;function D(T,k,R){var C=N(T),P=new z({compound:!0}).setGraph({root:C}).setDefaultNodeLabel(function(I){return T.node(I)});return A.forEach(T.nodes(),function(I){var L=T.node(I),Z=T.parent(I);(L.rank===k||L.minRank<=k&&k<=L.maxRank)&&(P.setNode(I),P.setParent(I,Z||C),A.forEach(T[R](I),function(Y){var X=Y.v===I?Y.w:Y.v,nt=P.edge(X,I),tt=A.isUndefined(nt)?0:nt.weight;P.setEdge(X,I,{weight:T.edge(Y).weight+tt})}),A.has(L,"minRank")&&P.setNode(I,{borderLeft:L.borderLeft[k],borderRight:L.borderRight[k]}))}),P}function N(T){for(var k;T.hasNode(k=A.uniqueId("_root")););return k}},45456:function(V,Q,S){"use strict";var A=S(72361);V.exports=z;function z(N,T){for(var k=0,R=1;R<T.length;++R)k+=D(N,T[R-1],T[R]);return k}function D(N,T,k){for(var R=A.zipObject(k,A.map(k,function(Y,X){return X})),C=A.flatten(A.map(T,function(Y){return A.sortBy(A.map(N.outEdges(Y),function(X){return{pos:R[X.w],weight:N.edge(X).weight}}),"pos")}),!0),P=1;P<k.length;)P<<=1;var I=2*P-1;P-=1;var L=A.map(new Array(I),function(){return 0}),Z=0;return A.forEach(C.forEach(function(Y){var X=Y.pos+P;L[X]+=Y.weight;for(var nt=0;X>0;)X%2&&(nt+=L[X+1]),X=X-1>>1,L[X]+=Y.weight;Z+=Y.weight*nt})),Z}},62852:function(V,Q,S){"use strict";var A=S(72361),z=S(18043),D=S(45456),N=S(86490),T=S(59105),k=S(52205),R=S(76626).Graph,C=S(53063);V.exports=P;function P(Y){var X=C.maxRank(Y),nt=I(Y,A.range(1,X+1),"inEdges"),tt=I(Y,A.range(X-1,-1,-1),"outEdges"),q=z(Y);Z(Y,q);for(var it=Number.POSITIVE_INFINITY,at,ct=0,ut=0;ut<4;++ct,++ut){L(ct%2?nt:tt,ct%4>=2),q=C.buildLayerMatrix(Y);var bt=D(Y,q);bt<it&&(ut=0,at=A.cloneDeep(q),it=bt)}Z(Y,at)}function I(Y,X,nt){return A.map(X,function(tt){return T(Y,tt,nt)})}function L(Y,X){var nt=new R;A.forEach(Y,function(tt){var q=tt.graph().root,it=N(tt,q,nt,X);A.forEach(it.vs,function(at,ct){tt.node(at).order=ct}),k(tt,nt,it.vs)})}function Z(Y,X){A.forEach(X,function(nt){A.forEach(nt,function(tt,q){Y.node(tt).order=q})})}},18043:function(V,Q,S){"use strict";var A=S(72361);V.exports=z;function z(D){var N={},T=A.filter(D.nodes(),function(I){return!D.children(I).length}),k=A.max(A.map(T,function(I){return D.node(I).rank})),R=A.map(A.range(k+1),function(){return[]});function C(I){if(!A.has(N,I)){N[I]=!0;var L=D.node(I);R[L.rank].push(I),A.forEach(D.successors(I),C)}}var P=A.sortBy(T,function(I){return D.node(I).rank});return A.forEach(P,C),R}},45926:function(V,Q,S){"use strict";var A=S(72361);V.exports=z;function z(T,k){var R={};A.forEach(T,function(P,I){var L=R[P.v]={indegree:0,in:[],out:[],vs:[P.v],i:I};A.isUndefined(P.barycenter)||(L.barycenter=P.barycenter,L.weight=P.weight)}),A.forEach(k.edges(),function(P){var I=R[P.v],L=R[P.w];!A.isUndefined(I)&&!A.isUndefined(L)&&(L.indegree++,I.out.push(R[P.w]))});var C=A.filter(R,function(P){return!P.indegree});return D(C)}function D(T){var k=[];function R(I){return function(L){L.merged||(A.isUndefined(L.barycenter)||A.isUndefined(I.barycenter)||L.barycenter>=I.barycenter)&&N(I,L)}}function C(I){return function(L){L.in.push(I),--L.indegree===0&&T.push(L)}}for(;T.length;){var P=T.pop();k.push(P),A.forEach(P.in.reverse(),R(P)),A.forEach(P.out,C(P))}return A.map(A.filter(k,function(I){return!I.merged}),function(I){return A.pick(I,["vs","i","barycenter","weight"])})}function N(T,k){var R=0,C=0;T.weight&&(R+=T.barycenter*T.weight,C+=T.weight),k.weight&&(R+=k.barycenter*k.weight,C+=k.weight),T.vs=k.vs.concat(T.vs),T.barycenter=R/C,T.weight=C,T.i=Math.min(k.i,T.i),k.merged=!0}},86490:function(V,Q,S){var A=S(72361),z=S(99506),D=S(45926),N=S(1349);V.exports=T;function T(C,P,I,L){var Z=C.children(P),Y=C.node(P),X=Y?Y.borderLeft:void 0,nt=Y?Y.borderRight:void 0,tt={};X&&(Z=A.filter(Z,function(bt){return bt!==X&&bt!==nt}));var q=z(C,Z);A.forEach(q,function(bt){if(C.children(bt.v).length){var gt=T(C,bt.v,I,L);tt[bt.v]=gt,A.has(gt,"barycenter")&&R(bt,gt)}});var it=D(q,I);k(it,tt);var at=N(it,L);if(X&&(at.vs=A.flatten([X,at.vs,nt],!0),C.predecessors(X).length)){var ct=C.node(C.predecessors(X)[0]),ut=C.node(C.predecessors(nt)[0]);A.has(at,"barycenter")||(at.barycenter=0,at.weight=0),at.barycenter=(at.barycenter*at.weight+ct.order+ut.order)/(at.weight+2),at.weight+=2}return at}function k(C,P){A.forEach(C,function(I){I.vs=A.flatten(I.vs.map(function(L){return P[L]?P[L].vs:L}),!0)})}function R(C,P){A.isUndefined(C.barycenter)?(C.barycenter=P.barycenter,C.weight=P.weight):(C.barycenter=(C.barycenter*C.weight+P.barycenter*P.weight)/(C.weight+P.weight),C.weight+=P.weight)}},1349:function(V,Q,S){var A=S(72361),z=S(53063);V.exports=D;function D(k,R){var C=z.partition(k,function(tt){return A.has(tt,"barycenter")}),P=C.lhs,I=A.sortBy(C.rhs,function(tt){return-tt.i}),L=[],Z=0,Y=0,X=0;P.sort(T(!!R)),X=N(L,I,X),A.forEach(P,function(tt){X+=tt.vs.length,L.push(tt.vs),Z+=tt.barycenter*tt.weight,Y+=tt.weight,X=N(L,I,X)});var nt={vs:A.flatten(L,!0)};return Y&&(nt.barycenter=Z/Y,nt.weight=Y),nt}function N(k,R,C){for(var P;R.length&&(P=A.last(R)).i<=C;)R.pop(),k.push(P.vs),C++;return C}function T(k){return function(R,C){return R.barycenter<C.barycenter?-1:R.barycenter>C.barycenter?1:k?C.i-R.i:R.i-C.i}}},71970:function(V,Q,S){var A=S(72361);V.exports=z;function z(T){var k=N(T);A.forEach(T.graph().dummyChains,function(R){for(var C=T.node(R),P=C.edgeObj,I=D(T,k,P.v,P.w),L=I.path,Z=I.lca,Y=0,X=L[Y],nt=!0;R!==P.w;){if(C=T.node(R),nt){for(;(X=L[Y])!==Z&&T.node(X).maxRank<C.rank;)Y++;X===Z&&(nt=!1)}if(!nt){for(;Y<L.length-1&&T.node(X=L[Y+1]).minRank<=C.rank;)Y++;X=L[Y]}T.setParent(R,X),R=T.successors(R)[0]}})}function D(T,k,R,C){var P=[],I=[],L=Math.min(k[R].low,k[C].low),Z=Math.max(k[R].lim,k[C].lim),Y,X;Y=R;do Y=T.parent(Y),P.push(Y);while(Y&&(k[Y].low>L||Z>k[Y].lim));for(X=Y,Y=C;(Y=T.parent(Y))!==X;)I.push(Y);return{path:P.concat(I.reverse()),lca:X}}function N(T){var k={},R=0;function C(P){var I=R;A.forEach(T.children(P),C),k[P]={low:I,lim:R++}}return A.forEach(T.children(),C),k}},92080:function(V,Q,S){"use strict";var A=S(72361),z=S(76626).Graph,D=S(53063);V.exports={positionX:nt,findType1Conflicts:N,findType2Conflicts:T,addConflict:R,hasConflict:C,verticalAlignment:P,horizontalCompaction:I,alignCoordinates:Y,findSmallestWidthAlignment:Z,balance:X};function N(it,at){var ct={};function ut(bt,gt){var wt=0,vt=0,Et=bt.length,Pt=A.last(gt);return A.forEach(gt,function(zt,Vt){var Qt=k(it,zt),Ee=Qt?it.node(Qt).order:Et;(Qt||zt===Pt)&&(A.forEach(gt.slice(vt,Vt+1),function(Re){A.forEach(it.predecessors(Re),function($e){var nr=it.node($e),ti=nr.order;(ti<wt||Ee<ti)&&!(nr.dummy&&it.node(Re).dummy)&&R(ct,$e,Re)})}),vt=Vt+1,wt=Ee)}),gt}return A.reduce(at,ut),ct}function T(it,at){var ct={};function ut(gt,wt,vt,Et,Pt){var zt;A.forEach(A.range(wt,vt),function(Vt){zt=gt[Vt],it.node(zt).dummy&&A.forEach(it.predecessors(zt),function(Qt){var Ee=it.node(Qt);Ee.dummy&&(Ee.order<Et||Ee.order>Pt)&&R(ct,Qt,zt)})})}function bt(gt,wt){var vt=-1,Et,Pt=0;return A.forEach(wt,function(zt,Vt){if(it.node(zt).dummy==="border"){var Qt=it.predecessors(zt);Qt.length&&(Et=it.node(Qt[0]).order,ut(wt,Pt,Vt,vt,Et),Pt=Vt,vt=Et)}ut(wt,Pt,wt.length,Et,gt.length)}),wt}return A.reduce(at,bt),ct}function k(it,at){if(it.node(at).dummy)return A.find(it.predecessors(at),function(ct){return it.node(ct).dummy})}function R(it,at,ct){if(at>ct){var ut=at;at=ct,ct=ut}var bt=it[at];bt||(it[at]=bt={}),bt[ct]=!0}function C(it,at,ct){if(at>ct){var ut=at;at=ct,ct=ut}return A.has(it[at],ct)}function P(it,at,ct,ut){var bt={},gt={},wt={};return A.forEach(at,function(vt){A.forEach(vt,function(Et,Pt){bt[Et]=Et,gt[Et]=Et,wt[Et]=Pt})}),A.forEach(at,function(vt){var Et=-1;A.forEach(vt,function(Pt){var zt=ut(Pt);if(zt.length){zt=A.sortBy(zt,function($e){return wt[$e]});for(var Vt=(zt.length-1)/2,Qt=Math.floor(Vt),Ee=Math.ceil(Vt);Qt<=Ee;++Qt){var Re=zt[Qt];gt[Pt]===Pt&&Et<wt[Re]&&!C(ct,Pt,Re)&&(gt[Re]=Pt,gt[Pt]=bt[Pt]=bt[Re],Et=wt[Re])}}})}),{root:bt,align:gt}}function I(it,at,ct,ut,bt){var gt={},wt=L(it,at,ct,bt),vt=bt?"borderLeft":"borderRight";function Et(Vt,Qt){for(var Ee=wt.nodes(),Re=Ee.pop(),$e={};Re;)$e[Re]?Vt(Re):($e[Re]=!0,Ee.push(Re),Ee=Ee.concat(Qt(Re))),Re=Ee.pop()}function Pt(Vt){gt[Vt]=wt.inEdges(Vt).reduce(function(Qt,Ee){return Math.max(Qt,gt[Ee.v]+wt.edge(Ee))},0)}function zt(Vt){var Qt=wt.outEdges(Vt).reduce(function(Re,$e){return Math.min(Re,gt[$e.w]-wt.edge($e))},Number.POSITIVE_INFINITY),Ee=it.node(Vt);Qt!==Number.POSITIVE_INFINITY&&Ee.borderType!==vt&&(gt[Vt]=Math.max(gt[Vt],Qt))}return Et(Pt,wt.predecessors.bind(wt)),Et(zt,wt.successors.bind(wt)),A.forEach(ut,function(Vt){gt[Vt]=gt[ct[Vt]]}),gt}function L(it,at,ct,ut){var bt=new z,gt=it.graph(),wt=tt(gt.nodesep,gt.edgesep,ut);return A.forEach(at,function(vt){var Et;A.forEach(vt,function(Pt){var zt=ct[Pt];if(bt.setNode(zt),Et){var Vt=ct[Et],Qt=bt.edge(Vt,zt);bt.setEdge(Vt,zt,Math.max(wt(it,Pt,Et),Qt||0))}Et=Pt})}),bt}function Z(it,at){return A.minBy(A.values(at),function(ct){var ut=Number.NEGATIVE_INFINITY,bt=Number.POSITIVE_INFINITY;return A.forIn(ct,function(gt,wt){var vt=q(it,wt)/2;ut=Math.max(gt+vt,ut),bt=Math.min(gt-vt,bt)}),ut-bt})}function Y(it,at){var ct=A.values(at),ut=A.min(ct),bt=A.max(ct);A.forEach(["u","d"],function(gt){A.forEach(["l","r"],function(wt){var vt=gt+wt,Et=it[vt],Pt;if(Et!==at){var zt=A.values(Et);Pt=wt==="l"?ut-A.min(zt):bt-A.max(zt),Pt&&(it[vt]=A.mapValues(Et,function(Vt){return Vt+Pt}))}})})}function X(it,at){return A.mapValues(it.ul,function(ct,ut){if(at)return it[at.toLowerCase()][ut];var bt=A.sortBy(A.map(it,ut));return(bt[1]+bt[2])/2})}function nt(it){var at=D.buildLayerMatrix(it),ct=A.merge(N(it,at),T(it,at)),ut={},bt;A.forEach(["u","d"],function(wt){bt=wt==="u"?at:A.values(at).reverse(),A.forEach(["l","r"],function(vt){vt==="r"&&(bt=A.map(bt,function(Vt){return A.values(Vt).reverse()}));var Et=(wt==="u"?it.predecessors:it.successors).bind(it),Pt=P(it,bt,ct,Et),zt=I(it,bt,Pt.root,Pt.align,vt==="r");vt==="r"&&(zt=A.mapValues(zt,function(Vt){return-Vt})),ut[wt+vt]=zt})});var gt=Z(it,ut);return Y(ut,gt),X(ut,it.graph().align)}function tt(it,at,ct){return function(ut,bt,gt){var wt=ut.node(bt),vt=ut.node(gt),Et=0,Pt;if(Et+=wt.width/2,A.has(wt,"labelpos"))switch(wt.labelpos.toLowerCase()){case"l":Pt=-wt.width/2;break;case"r":Pt=wt.width/2;break}if(Pt&&(Et+=ct?Pt:-Pt),Pt=0,Et+=(wt.dummy?at:it)/2,Et+=(vt.dummy?at:it)/2,Et+=vt.width/2,A.has(vt,"labelpos"))switch(vt.labelpos.toLowerCase()){case"l":Pt=vt.width/2;break;case"r":Pt=-vt.width/2;break}return Pt&&(Et+=ct?Pt:-Pt),Pt=0,Et}}function q(it,at){return it.node(at).width}},93021:function(V,Q,S){"use strict";var A=S(72361),z=S(53063),D=S(92080).positionX;V.exports=N;function N(k){k=z.asNonCompoundGraph(k),T(k),A.forEach(D(k),function(R,C){k.node(C).x=R})}function T(k){var R=z.buildLayerMatrix(k),C=k.graph().ranksep,P=0;A.forEach(R,function(I){var L=A.max(A.map(I,function(Z){return k.node(Z).height}));A.forEach(I,function(Z){k.node(Z).y=P+L/2}),P+=L+C})}},61031:function(V,Q,S){"use strict";var A=S(72361),z=S(76626).Graph,D=S(2416).slack;V.exports=N;function N(C){var P=new z({directed:!1}),I=C.nodes()[0],L=C.nodeCount();P.setNode(I,{});for(var Z,Y;T(P,C)<L;)Z=k(P,C),Y=P.hasNode(Z.v)?D(C,Z):-D(C,Z),R(P,C,Y);return P}function T(C,P){function I(L){A.forEach(P.nodeEdges(L),function(Z){var Y=Z.v,X=L===Y?Z.w:Y;!C.hasNode(X)&&!D(P,Z)&&(C.setNode(X,{}),C.setEdge(L,X,{}),I(X))})}return A.forEach(C.nodes(),I),C.nodeCount()}function k(C,P){return A.minBy(P.edges(),function(I){if(C.hasNode(I.v)!==C.hasNode(I.w))return D(P,I)})}function R(C,P,I){A.forEach(C.nodes(),function(L){P.node(L).rank+=I})}},64505:function(V,Q,S){"use strict";var A=S(2416),z=A.longestPath,D=S(61031),N=S(77076);V.exports=T;function T(P){switch(P.graph().ranker){case"network-simplex":C(P);break;case"tight-tree":R(P);break;case"longest-path":k(P);break;default:C(P)}}var k=z;function R(P){z(P),D(P)}function C(P){N(P)}},77076:function(V,Q,S){"use strict";var A=S(72361),z=S(61031),D=S(2416).slack,N=S(2416).longestPath,T=S(76626).alg.preorder,k=S(76626).alg.postorder,R=S(53063).simplify;V.exports=C,C.initLowLimValues=Z,C.initCutValues=P,C.calcCutValue=L,C.leaveEdge=X,C.enterEdge=nt,C.exchangeEdges=tt;function C(ct){ct=R(ct),N(ct);var ut=z(ct);Z(ut),P(ut,ct);for(var bt,gt;bt=X(ut);)gt=nt(ut,ct,bt),tt(ut,ct,bt,gt)}function P(ct,ut){var bt=k(ct,ct.nodes());bt=bt.slice(0,bt.length-1),A.forEach(bt,function(gt){I(ct,ut,gt)})}function I(ct,ut,bt){var gt=ct.node(bt),wt=gt.parent;ct.edge(bt,wt).cutvalue=L(ct,ut,bt)}function L(ct,ut,bt){var gt=ct.node(bt),wt=gt.parent,vt=!0,Et=ut.edge(bt,wt),Pt=0;return Et||(vt=!1,Et=ut.edge(wt,bt)),Pt=Et.weight,A.forEach(ut.nodeEdges(bt),function(zt){var Vt=zt.v===bt,Qt=Vt?zt.w:zt.v;if(Qt!==wt){var Ee=Vt===vt,Re=ut.edge(zt).weight;if(Pt+=Ee?Re:-Re,it(ct,bt,Qt)){var $e=ct.edge(bt,Qt).cutvalue;Pt+=Ee?-$e:$e}}}),Pt}function Z(ct,ut){arguments.length<2&&(ut=ct.nodes()[0]),Y(ct,{},1,ut)}function Y(ct,ut,bt,gt,wt){var vt=bt,Et=ct.node(gt);return ut[gt]=!0,A.forEach(ct.neighbors(gt),function(Pt){A.has(ut,Pt)||(bt=Y(ct,ut,bt,Pt,gt))}),Et.low=vt,Et.lim=bt++,wt?Et.parent=wt:delete Et.parent,bt}function X(ct){return A.find(ct.edges(),function(ut){return ct.edge(ut).cutvalue<0})}function nt(ct,ut,bt){var gt=bt.v,wt=bt.w;ut.hasEdge(gt,wt)||(gt=bt.w,wt=bt.v);var vt=ct.node(gt),Et=ct.node(wt),Pt=vt,zt=!1;vt.lim>Et.lim&&(Pt=Et,zt=!0);var Vt=A.filter(ut.edges(),function(Qt){return zt===at(ct,ct.node(Qt.v),Pt)&&zt!==at(ct,ct.node(Qt.w),Pt)});return A.minBy(Vt,function(Qt){return D(ut,Qt)})}function tt(ct,ut,bt,gt){var wt=bt.v,vt=bt.w;ct.removeEdge(wt,vt),ct.setEdge(gt.v,gt.w,{}),Z(ct),P(ct,ut),q(ct,ut)}function q(ct,ut){var bt=A.find(ct.nodes(),function(wt){return!ut.node(wt).parent}),gt=T(ct,bt);gt=gt.slice(1),A.forEach(gt,function(wt){var vt=ct.node(wt).parent,Et=ut.edge(wt,vt),Pt=!1;Et||(Et=ut.edge(vt,wt),Pt=!0),ut.node(wt).rank=ut.node(vt).rank+(Pt?Et.minlen:-Et.minlen)})}function it(ct,ut,bt){return ct.hasEdge(ut,bt)}function at(ct,ut,bt){return bt.low<=ut.lim&&ut.lim<=bt.lim}},2416:function(V,Q,S){"use strict";var A=S(72361);V.exports={longestPath:z,slack:D};function z(N){var T={};function k(R){var C=N.node(R);if(A.has(T,R))return C.rank;T[R]=!0;var P=A.min(A.map(N.outEdges(R),function(I){return k(I.w)-N.edge(I).minlen}));return(P===Number.POSITIVE_INFINITY||P===void 0||P===null)&&(P=0),C.rank=P}A.forEach(N.sources(),k)}function D(N,T){return N.node(T.w).rank-N.node(T.v).rank-N.edge(T).minlen}},53063:function(V,Q,S){"use strict";var A=S(72361),z=S(76626).Graph;V.exports={addDummyNode:D,simplify:N,asNonCompoundGraph:T,successorWeights:k,predecessorWeights:R,intersectRect:C,buildLayerMatrix:P,normalizeRanks:I,removeEmptyRanks:L,addBorderNode:Z,maxRank:Y,partition:X,time:nt,notime:tt};function D(q,it,at,ct){var ut;do ut=A.uniqueId(ct);while(q.hasNode(ut));return at.dummy=it,q.setNode(ut,at),ut}function N(q){var it=new z().setGraph(q.graph());return A.forEach(q.nodes(),function(at){it.setNode(at,q.node(at))}),A.forEach(q.edges(),function(at){var ct=it.edge(at.v,at.w)||{weight:0,minlen:1},ut=q.edge(at);it.setEdge(at.v,at.w,{weight:ct.weight+ut.weight,minlen:Math.max(ct.minlen,ut.minlen)})}),it}function T(q){var it=new z({multigraph:q.isMultigraph()}).setGraph(q.graph());return A.forEach(q.nodes(),function(at){q.children(at).length||it.setNode(at,q.node(at))}),A.forEach(q.edges(),function(at){it.setEdge(at,q.edge(at))}),it}function k(q){var it=A.map(q.nodes(),function(at){var ct={};return A.forEach(q.outEdges(at),function(ut){ct[ut.w]=(ct[ut.w]||0)+q.edge(ut).weight}),ct});return A.zipObject(q.nodes(),it)}function R(q){var it=A.map(q.nodes(),function(at){var ct={};return A.forEach(q.inEdges(at),function(ut){ct[ut.v]=(ct[ut.v]||0)+q.edge(ut).weight}),ct});return A.zipObject(q.nodes(),it)}function C(q,it){var at=q.x,ct=q.y,ut=it.x-at,bt=it.y-ct,gt=q.width/2,wt=q.height/2;if(!ut&&!bt)throw new Error("Not possible to find intersection inside of the rectangle");var vt,Et;return Math.abs(bt)*gt>Math.abs(ut)*wt?(bt<0&&(wt=-wt),vt=wt*ut/bt,Et=wt):(ut<0&&(gt=-gt),vt=gt,Et=gt*bt/ut),{x:at+vt,y:ct+Et}}function P(q){var it=A.map(A.range(Y(q)+1),function(){return[]});return A.forEach(q.nodes(),function(at){var ct=q.node(at),ut=ct.rank;A.isUndefined(ut)||(it[ut][ct.order]=at)}),it}function I(q){var it=A.min(A.map(q.nodes(),function(at){return q.node(at).rank}));A.forEach(q.nodes(),function(at){var ct=q.node(at);A.has(ct,"rank")&&(ct.rank-=it)})}function L(q){var it=A.min(A.map(q.nodes(),function(bt){return q.node(bt).rank})),at=[];A.forEach(q.nodes(),function(bt){var gt=q.node(bt).rank-it;at[gt]||(at[gt]=[]),at[gt].push(bt)});var ct=0,ut=q.graph().nodeRankFactor;A.forEach(at,function(bt,gt){A.isUndefined(bt)&&gt%ut!==0?--ct:ct&&A.forEach(bt,function(wt){q.node(wt).rank+=ct})})}function Z(q,it,at,ct){var ut={width:0,height:0};return arguments.length>=4&&(ut.rank=at,ut.order=ct),D(q,"border",ut,it)}function Y(q){return A.max(A.map(q.nodes(),function(it){var at=q.node(it).rank;if(!A.isUndefined(at))return at}))}function X(q,it){var at={lhs:[],rhs:[]};return A.forEach(q,function(ct){it(ct)?at.lhs.push(ct):at.rhs.push(ct)}),at}function nt(q,it){var at=A.now();try{return it()}finally{console.log(q+" time: "+(A.now()-at)+"ms")}}function tt(q,it){return it()}},11897:function(V){V.exports="0.8.5"},37271:function(V){"use strict";var Q=Object.prototype.hasOwnProperty,S="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(S=!1));function z(k,R,C){this.fn=k,this.context=R,this.once=C||!1}function D(k,R,C,P,I){if(typeof C!="function")throw new TypeError("The listener must be a function");var L=new z(C,P||k,I),Z=S?S+R:R;return k._events[Z]?k._events[Z].fn?k._events[Z]=[k._events[Z],L]:k._events[Z].push(L):(k._events[Z]=L,k._eventsCount++),k}function N(k,R){--k._eventsCount===0?k._events=new A:delete k._events[R]}function T(){this._events=new A,this._eventsCount=0}T.prototype.eventNames=function(){var R=[],C,P;if(this._eventsCount===0)return R;for(P in C=this._events)Q.call(C,P)&&R.push(S?P.slice(1):P);return Object.getOwnPropertySymbols?R.concat(Object.getOwnPropertySymbols(C)):R},T.prototype.listeners=function(R){var C=S?S+R:R,P=this._events[C];if(!P)return[];if(P.fn)return[P.fn];for(var I=0,L=P.length,Z=new Array(L);I<L;I++)Z[I]=P[I].fn;return Z},T.prototype.listenerCount=function(R){var C=S?S+R:R,P=this._events[C];return P?P.fn?1:P.length:0},T.prototype.emit=function(R,C,P,I,L,Z){var Y=S?S+R:R;if(!this._events[Y])return!1;var X=this._events[Y],nt=arguments.length,tt,q;if(X.fn){switch(X.once&&this.removeListener(R,X.fn,void 0,!0),nt){case 1:return X.fn.call(X.context),!0;case 2:return X.fn.call(X.context,C),!0;case 3:return X.fn.call(X.context,C,P),!0;case 4:return X.fn.call(X.context,C,P,I),!0;case 5:return X.fn.call(X.context,C,P,I,L),!0;case 6:return X.fn.call(X.context,C,P,I,L,Z),!0}for(q=1,tt=new Array(nt-1);q<nt;q++)tt[q-1]=arguments[q];X.fn.apply(X.context,tt)}else{var it=X.length,at;for(q=0;q<it;q++)switch(X[q].once&&this.removeListener(R,X[q].fn,void 0,!0),nt){case 1:X[q].fn.call(X[q].context);break;case 2:X[q].fn.call(X[q].context,C);break;case 3:X[q].fn.call(X[q].context,C,P);break;case 4:X[q].fn.call(X[q].context,C,P,I);break;default:if(!tt)for(at=1,tt=new Array(nt-1);at<nt;at++)tt[at-1]=arguments[at];X[q].fn.apply(X[q].context,tt)}}return!0},T.prototype.on=function(R,C,P){return D(this,R,C,P,!1)},T.prototype.once=function(R,C,P){return D(this,R,C,P,!0)},T.prototype.removeListener=function(R,C,P,I){var L=S?S+R:R;if(!this._events[L])return this;if(!C)return N(this,L),this;var Z=this._events[L];if(Z.fn)Z.fn===C&&(!I||Z.once)&&(!P||Z.context===P)&&N(this,L);else{for(var Y=0,X=[],nt=Z.length;Y<nt;Y++)(Z[Y].fn!==C||I&&!Z[Y].once||P&&Z[Y].context!==P)&&X.push(Z[Y]);X.length?this._events[L]=X.length===1?X[0]:X:N(this,L)}return this},T.prototype.removeAllListeners=function(R){var C;return R?(C=S?S+R:R,this._events[C]&&N(this,C)):(this._events=new A,this._eventsCount=0),this},T.prototype.off=T.prototype.removeListener,T.prototype.addListener=T.prototype.on,T.prefixed=S,T.EventEmitter=T,V.exports=T},75172:function(V,Q,S){var A=S(89224);V.exports={Graph:A.Graph,json:S(17401),alg:S(54613),version:A.version}},91606:function(V,Q,S){var A=S(95329);V.exports=z;function z(D){var N={},T=[],k;function R(C){A.has(N,C)||(N[C]=!0,k.push(C),A.each(D.successors(C),R),A.each(D.predecessors(C),R))}return A.each(D.nodes(),function(C){k=[],R(C),k.length&&T.push(k)}),T}},21482:function(V,Q,S){var A=S(95329);V.exports=z;function z(N,T,k){A.isArray(T)||(T=[T]);var R=(N.isDirected()?N.successors:N.neighbors).bind(N),C=[],P={};return A.each(T,function(I){if(!N.hasNode(I))throw new Error("Graph does not have node: "+I);D(N,I,k==="post",P,R,C)}),C}function D(N,T,k,R,C,P){A.has(R,T)||(R[T]=!0,k||P.push(T),A.each(C(T),function(I){D(N,I,k,R,C,P)}),k&&P.push(T))}},40845:function(V,Q,S){var A=S(13746),z=S(95329);V.exports=D;function D(N,T,k){return z.transform(N.nodes(),function(R,C){R[C]=A(N,C,T,k)},{})}},13746:function(V,Q,S){var A=S(95329),z=S(36614);V.exports=N;var D=A.constant(1);function N(k,R,C,P){return T(k,String(R),C||D,P||function(I){return k.outEdges(I)})}function T(k,R,C,P){var I={},L=new z,Z,Y,X=function(nt){var tt=nt.v!==Z?nt.v:nt.w,q=I[tt],it=C(nt),at=Y.distance+it;if(it<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+nt+" Weight: "+it);at<q.distance&&(q.distance=at,q.predecessor=Z,L.decrease(tt,at))};for(k.nodes().forEach(function(nt){var tt=nt===R?0:Number.POSITIVE_INFINITY;I[nt]={distance:tt},L.add(nt,tt)});L.size()>0&&(Z=L.removeMin(),Y=I[Z],Y.distance!==Number.POSITIVE_INFINITY);)P(Z).forEach(X);return I}},59324:function(V,Q,S){var A=S(95329),z=S(94558);V.exports=D;function D(N){return A.filter(z(N),function(T){return T.length>1||T.length===1&&N.hasEdge(T[0],T[0])})}},22893:function(V,Q,S){var A=S(95329);V.exports=D;var z=A.constant(1);function D(T,k,R){return N(T,k||z,R||function(C){return T.outEdges(C)})}function N(T,k,R){var C={},P=T.nodes();return P.forEach(function(I){C[I]={},C[I][I]={distance:0},P.forEach(function(L){I!==L&&(C[I][L]={distance:Number.POSITIVE_INFINITY})}),R(I).forEach(function(L){var Z=L.v===I?L.w:L.v,Y=k(L);C[I][Z]={distance:Y,predecessor:I}})}),P.forEach(function(I){var L=C[I];P.forEach(function(Z){var Y=C[Z];P.forEach(function(X){var nt=Y[I],tt=L[X],q=Y[X],it=nt.distance+tt.distance;it<q.distance&&(q.distance=it,q.predecessor=tt.predecessor)})})}),C}},54613:function(V,Q,S){V.exports={components:S(91606),dijkstra:S(13746),dijkstraAll:S(40845),findCycles:S(59324),floydWarshall:S(22893),isAcyclic:S(588),postorder:S(98049),preorder:S(67158),prim:S(66058),tarjan:S(94558),topsort:S(7793)}},588:function(V,Q,S){var A=S(7793);V.exports=z;function z(D){try{A(D)}catch(N){if(N instanceof A.CycleException)return!1;throw N}return!0}},98049:function(V,Q,S){var A=S(21482);V.exports=z;function z(D,N){return A(D,N,"post")}},67158:function(V,Q,S){var A=S(21482);V.exports=z;function z(D,N){return A(D,N,"pre")}},66058:function(V,Q,S){var A=S(95329),z=S(55954),D=S(36614);V.exports=N;function N(T,k){var R=new z,C={},P=new D,I;function L(Y){var X=Y.v===I?Y.w:Y.v,nt=P.priority(X);if(nt!==void 0){var tt=k(Y);tt<nt&&(C[X]=I,P.decrease(X,tt))}}if(T.nodeCount()===0)return R;A.each(T.nodes(),function(Y){P.add(Y,Number.POSITIVE_INFINITY),R.setNode(Y)}),P.decrease(T.nodes()[0],0);for(var Z=!1;P.size()>0;){if(I=P.removeMin(),A.has(C,I))R.setEdge(I,C[I]);else{if(Z)throw new Error("Input graph is not connected: "+T);Z=!0}T.nodeEdges(I).forEach(L)}return R}},94558:function(V,Q,S){var A=S(95329);V.exports=z;function z(D){var N=0,T=[],k={},R=[];function C(P){var I=k[P]={onStack:!0,lowlink:N,index:N++};if(T.push(P),D.successors(P).forEach(function(Y){A.has(k,Y)?k[Y].onStack&&(I.lowlink=Math.min(I.lowlink,k[Y].index)):(C(Y),I.lowlink=Math.min(I.lowlink,k[Y].lowlink))}),I.lowlink===I.index){var L=[],Z;do Z=T.pop(),k[Z].onStack=!1,L.push(Z);while(P!==Z);R.push(L)}}return D.nodes().forEach(function(P){A.has(k,P)||C(P)}),R}},7793:function(V,Q,S){var A=S(95329);V.exports=z,z.CycleException=D;function z(N){var T={},k={},R=[];function C(P){if(A.has(k,P))throw new D;A.has(T,P)||(k[P]=!0,T[P]=!0,A.each(N.predecessors(P),C),delete k[P],R.push(P))}if(A.each(N.sinks(),C),A.size(T)!==N.nodeCount())throw new D;return R}function D(){}D.prototype=new Error},36614:function(V,Q,S){var A=S(95329);V.exports=z;function z(){this._arr=[],this._keyIndices={}}z.prototype.size=function(){return this._arr.length},z.prototype.keys=function(){return this._arr.map(function(D){return D.key})},z.prototype.has=function(D){return A.has(this._keyIndices,D)},z.prototype.priority=function(D){var N=this._keyIndices[D];if(N!==void 0)return this._arr[N].priority},z.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},z.prototype.add=function(D,N){var T=this._keyIndices;if(D=String(D),!A.has(T,D)){var k=this._arr,R=k.length;return T[D]=R,k.push({key:D,priority:N}),this._decrease(R),!0}return!1},z.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var D=this._arr.pop();return delete this._keyIndices[D.key],this._heapify(0),D.key},z.prototype.decrease=function(D,N){var T=this._keyIndices[D];if(N>this._arr[T].priority)throw new Error("New priority is greater than current priority. Key: "+D+" Old: "+this._arr[T].priority+" New: "+N);this._arr[T].priority=N,this._decrease(T)},z.prototype._heapify=function(D){var N=this._arr,T=2*D,k=T+1,R=D;T<N.length&&(R=N[T].priority<N[R].priority?T:R,k<N.length&&(R=N[k].priority<N[R].priority?k:R),R!==D&&(this._swap(D,R),this._heapify(R)))},z.prototype._decrease=function(D){for(var N=this._arr,T=N[D].priority,k;D!==0&&(k=D>>1,!(N[k].priority<T));)this._swap(D,k),D=k},z.prototype._swap=function(D,N){var T=this._arr,k=this._keyIndices,R=T[D],C=T[N];T[D]=C,T[N]=R,k[C.key]=D,k[R.key]=N}},55954:function(V,Q,S){"use strict";var A=S(95329);V.exports=T;var z="\0",D="\0",N="";function T(L){this._isDirected=A.has(L,"directed")?L.directed:!0,this._isMultigraph=A.has(L,"multigraph")?L.multigraph:!1,this._isCompound=A.has(L,"compound")?L.compound:!1,this._label=void 0,this._defaultNodeLabelFn=A.constant(void 0),this._defaultEdgeLabelFn=A.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[D]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}T.prototype._nodeCount=0,T.prototype._edgeCount=0,T.prototype.isDirected=function(){return this._isDirected},T.prototype.isMultigraph=function(){return this._isMultigraph},T.prototype.isCompound=function(){return this._isCompound},T.prototype.setGraph=function(L){return this._label=L,this},T.prototype.graph=function(){return this._label},T.prototype.setDefaultNodeLabel=function(L){return A.isFunction(L)||(L=A.constant(L)),this._defaultNodeLabelFn=L,this},T.prototype.nodeCount=function(){return this._nodeCount},T.prototype.nodes=function(){return A.keys(this._nodes)},T.prototype.sources=function(){var L=this;return A.filter(this.nodes(),function(Z){return A.isEmpty(L._in[Z])})},T.prototype.sinks=function(){var L=this;return A.filter(this.nodes(),function(Z){return A.isEmpty(L._out[Z])})},T.prototype.setNodes=function(L,Z){var Y=arguments,X=this;return A.each(L,function(nt){Y.length>1?X.setNode(nt,Z):X.setNode(nt)}),this},T.prototype.setNode=function(L,Z){return A.has(this._nodes,L)?(arguments.length>1&&(this._nodes[L]=Z),this):(this._nodes[L]=arguments.length>1?Z:this._defaultNodeLabelFn(L),this._isCompound&&(this._parent[L]=D,this._children[L]={},this._children[D][L]=!0),this._in[L]={},this._preds[L]={},this._out[L]={},this._sucs[L]={},++this._nodeCount,this)},T.prototype.node=function(L){return this._nodes[L]},T.prototype.hasNode=function(L){return A.has(this._nodes,L)},T.prototype.removeNode=function(L){var Z=this;if(A.has(this._nodes,L)){var Y=function(X){Z.removeEdge(Z._edgeObjs[X])};delete this._nodes[L],this._isCompound&&(this._removeFromParentsChildList(L),delete this._parent[L],A.each(this.children(L),function(X){Z.setParent(X)}),delete this._children[L]),A.each(A.keys(this._in[L]),Y),delete this._in[L],delete this._preds[L],A.each(A.keys(this._out[L]),Y),delete this._out[L],delete this._sucs[L],--this._nodeCount}return this},T.prototype.setParent=function(L,Z){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(A.isUndefined(Z))Z=D;else{Z+="";for(var Y=Z;!A.isUndefined(Y);Y=this.parent(Y))if(Y===L)throw new Error("Setting "+Z+" as parent of "+L+" would create a cycle");this.setNode(Z)}return this.setNode(L),this._removeFromParentsChildList(L),this._parent[L]=Z,this._children[Z][L]=!0,this},T.prototype._removeFromParentsChildList=function(L){delete this._children[this._parent[L]][L]},T.prototype.parent=function(L){if(this._isCompound){var Z=this._parent[L];if(Z!==D)return Z}},T.prototype.children=function(L){if(A.isUndefined(L)&&(L=D),this._isCompound){var Z=this._children[L];if(Z)return A.keys(Z)}else{if(L===D)return this.nodes();if(this.hasNode(L))return[]}},T.prototype.predecessors=function(L){var Z=this._preds[L];if(Z)return A.keys(Z)},T.prototype.successors=function(L){var Z=this._sucs[L];if(Z)return A.keys(Z)},T.prototype.neighbors=function(L){var Z=this.predecessors(L);if(Z)return A.union(Z,this.successors(L))},T.prototype.isLeaf=function(L){var Z;return this.isDirected()?Z=this.successors(L):Z=this.neighbors(L),Z.length===0},T.prototype.filterNodes=function(L){var Z=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});Z.setGraph(this.graph());var Y=this;A.each(this._nodes,function(tt,q){L(q)&&Z.setNode(q,tt)}),A.each(this._edgeObjs,function(tt){Z.hasNode(tt.v)&&Z.hasNode(tt.w)&&Z.setEdge(tt,Y.edge(tt))});var X={};function nt(tt){var q=Y.parent(tt);return q===void 0||Z.hasNode(q)?(X[tt]=q,q):q in X?X[q]:nt(q)}return this._isCompound&&A.each(Z.nodes(),function(tt){Z.setParent(tt,nt(tt))}),Z},T.prototype.setDefaultEdgeLabel=function(L){return A.isFunction(L)||(L=A.constant(L)),this._defaultEdgeLabelFn=L,this},T.prototype.edgeCount=function(){return this._edgeCount},T.prototype.edges=function(){return A.values(this._edgeObjs)},T.prototype.setPath=function(L,Z){var Y=this,X=arguments;return A.reduce(L,function(nt,tt){return X.length>1?Y.setEdge(nt,tt,Z):Y.setEdge(nt,tt),tt}),this},T.prototype.setEdge=function(){var L,Z,Y,X,nt=!1,tt=arguments[0];typeof tt=="object"&&tt!==null&&"v"in tt?(L=tt.v,Z=tt.w,Y=tt.name,arguments.length===2&&(X=arguments[1],nt=!0)):(L=tt,Z=arguments[1],Y=arguments[3],arguments.length>2&&(X=arguments[2],nt=!0)),L=""+L,Z=""+Z,A.isUndefined(Y)||(Y=""+Y);var q=C(this._isDirected,L,Z,Y);if(A.has(this._edgeLabels,q))return nt&&(this._edgeLabels[q]=X),this;if(!A.isUndefined(Y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(L),this.setNode(Z),this._edgeLabels[q]=nt?X:this._defaultEdgeLabelFn(L,Z,Y);var it=P(this._isDirected,L,Z,Y);return L=it.v,Z=it.w,Object.freeze(it),this._edgeObjs[q]=it,k(this._preds[Z],L),k(this._sucs[L],Z),this._in[Z][q]=it,this._out[L][q]=it,this._edgeCount++,this},T.prototype.edge=function(L,Z,Y){var X=arguments.length===1?I(this._isDirected,arguments[0]):C(this._isDirected,L,Z,Y);return this._edgeLabels[X]},T.prototype.hasEdge=function(L,Z,Y){var X=arguments.length===1?I(this._isDirected,arguments[0]):C(this._isDirected,L,Z,Y);return A.has(this._edgeLabels,X)},T.prototype.removeEdge=function(L,Z,Y){var X=arguments.length===1?I(this._isDirected,arguments[0]):C(this._isDirected,L,Z,Y),nt=this._edgeObjs[X];return nt&&(L=nt.v,Z=nt.w,delete this._edgeLabels[X],delete this._edgeObjs[X],R(this._preds[Z],L),R(this._sucs[L],Z),delete this._in[Z][X],delete this._out[L][X],this._edgeCount--),this},T.prototype.inEdges=function(L,Z){var Y=this._in[L];if(Y){var X=A.values(Y);return Z?A.filter(X,function(nt){return nt.v===Z}):X}},T.prototype.outEdges=function(L,Z){var Y=this._out[L];if(Y){var X=A.values(Y);return Z?A.filter(X,function(nt){return nt.w===Z}):X}},T.prototype.nodeEdges=function(L,Z){var Y=this.inEdges(L,Z);if(Y)return Y.concat(this.outEdges(L,Z))};function k(L,Z){L[Z]?L[Z]++:L[Z]=1}function R(L,Z){--L[Z]||delete L[Z]}function C(L,Z,Y,X){var nt=""+Z,tt=""+Y;if(!L&&nt>tt){var q=nt;nt=tt,tt=q}return nt+N+tt+N+(A.isUndefined(X)?z:X)}function P(L,Z,Y,X){var nt=""+Z,tt=""+Y;if(!L&&nt>tt){var q=nt;nt=tt,tt=q}var it={v:nt,w:tt};return X&&(it.name=X),it}function I(L,Z){return C(L,Z.v,Z.w,Z.name)}},89224:function(V,Q,S){V.exports={Graph:S(55954),version:S(16544)}},17401:function(V,Q,S){var A=S(95329),z=S(55954);V.exports={write:D,read:k};function D(R){var C={options:{directed:R.isDirected(),multigraph:R.isMultigraph(),compound:R.isCompound()},nodes:N(R),edges:T(R)};return A.isUndefined(R.graph())||(C.value=A.clone(R.graph())),C}function N(R){return A.map(R.nodes(),function(C){var P=R.node(C),I=R.parent(C),L={v:C};return A.isUndefined(P)||(L.value=P),A.isUndefined(I)||(L.parent=I),L})}function T(R){return A.map(R.edges(),function(C){var P=R.edge(C),I={v:C.v,w:C.w};return A.isUndefined(C.name)||(I.name=C.name),A.isUndefined(P)||(I.value=P),I})}function k(R){var C=new z(R.options).setGraph(R.value);return A.each(R.nodes,function(P){C.setNode(P.v,P.value),P.parent&&C.setParent(P.v,P.parent)}),A.each(R.edges,function(P){C.setEdge({v:P.v,w:P.w,name:P.name},P.value)}),C}},95329:function(V,Q,S){var A;try{A={clone:S(76833),constant:S(13503),each:S(76934),filter:S(64725),has:S(99946),isArray:S(80744),isEmpty:S(61627),isFunction:S(9363),isUndefined:S(16513),keys:S(55451),map:S(9924),reduce:S(16473),size:S(40617),transform:S(91116),union:S(44065),values:S(81229)}}catch(z){}A||(A=window._),V.exports=A},16544:function(V){V.exports="2.1.8"},34634:function(V,Q,S){"use strict";S.r(Q),S.d(Q,{isAnyArray:function(){return z}});const A=Object.prototype.toString;function z(D){const N=A.call(D);return N.endsWith("Array]")&&!N.includes("Big")}},55973:function(V){V.exports=function(S){return!S||typeof S=="string"?!1:S instanceof Array||Array.isArray(S)||S.length>=0&&(S.splice instanceof Function||Object.getOwnPropertyDescriptor(S,S.length-1)&&S.constructor.name!=="String")}},15584:function(V,Q,S){var A=S(73893),z=S(33152),D=A(z,"DataView");V.exports=D},97288:function(V,Q,S){var A=S(73893),z=S(33152),D=A(z,"Promise");V.exports=D},23599:function(V,Q,S){var A=S(73893),z=S(33152),D=A(z,"Set");V.exports=D},98924:function(V,Q,S){var A=S(52166),z=S(34776),D=S(40393);function N(T){var k=-1,R=T==null?0:T.length;for(this.__data__=new A;++k<R;)this.add(T[k])}N.prototype.add=N.prototype.push=z,N.prototype.has=D,V.exports=N},26873:function(V,Q,S){var A=S(73893),z=S(33152),D=A(z,"WeakMap");V.exports=D},74809:function(V){function Q(S,A){for(var z=-1,D=S==null?0:S.length;++z<D&&A(S[z],z,S)!==!1;);return S}V.exports=Q},86952:function(V){function Q(S,A){for(var z=-1,D=S==null?0:S.length,N=0,T=[];++z<D;){var k=S[z];A(k,z,S)&&(T[N++]=k)}return T}V.exports=Q},84271:function(V,Q,S){var A=S(17424);function z(D,N){var T=D==null?0:D.length;return!!T&&A(D,N,0)>-1}V.exports=z},94874:function(V){function Q(S,A,z){for(var D=-1,N=S==null?0:S.length;++D<N;)if(z(A,S[D]))return!0;return!1}V.exports=Q},75010:function(V){function Q(S,A){for(var z=-1,D=S==null?0:S.length,N=Array(D);++z<D;)N[z]=A(S[z],z,S);return N}V.exports=Q},57095:function(V){function Q(S,A){for(var z=-1,D=A.length,N=S.length;++z<D;)S[N+z]=A[z];return S}V.exports=Q},99861:function(V){function Q(S,A,z,D){var N=-1,T=S==null?0:S.length;for(D&&T&&(z=S[++N]);++N<T;)z=A(z,S[N],N,S);return z}V.exports=Q},64045:function(V){function Q(S,A){for(var z=-1,D=S==null?0:S.length;++z<D;)if(A(S[z],z,S))return!0;return!1}V.exports=Q},26539:function(V,Q,S){var A=S(22310),z=A("length");V.exports=z},91937:function(V,Q,S){var A=S(95378),z=S(55451);function D(N,T){return N&&A(T,z(T),N)}V.exports=D},26680:function(V,Q,S){var A=S(95378),z=S(56730);function D(N,T){return N&&A(T,z(T),N)}V.exports=D},99045:function(V,Q,S){var A=S(91866),z=S(74809),D=S(60348),N=S(91937),T=S(26680),k=S(32315),R=S(47760),C=S(15168),P=S(71678),I=S(12076),L=S(22675),Z=S(66139),Y=S(79264),X=S(97541),nt=S(4084),tt=S(80744),q=S(57835),it=S(41626),at=S(20816),ct=S(65226),ut=S(55451),bt=S(56730),gt=1,wt=2,vt=4,Et="[object Arguments]",Pt="[object Array]",zt="[object Boolean]",Vt="[object Date]",Qt="[object Error]",Ee="[object Function]",Re="[object GeneratorFunction]",$e="[object Map]",nr="[object Number]",ti="[object Object]",la="[object RegExp]",ss="[object Set]",Rt="[object String]",Dt="[object Symbol]",It="[object WeakMap]",dt="[object ArrayBuffer]",St="[object DataView]",Ot="[object Float32Array]",Gt="[object Float64Array]",se="[object Int8Array]",be="[object Int16Array]",de="[object Int32Array]",Le="[object Uint8Array]",Mn="[object Uint8ClampedArray]",Nn="[object Uint16Array]",ke="[object Uint32Array]",Se={};Se[Et]=Se[Pt]=Se[dt]=Se[St]=Se[zt]=Se[Vt]=Se[Ot]=Se[Gt]=Se[se]=Se[be]=Se[de]=Se[$e]=Se[nr]=Se[ti]=Se[la]=Se[ss]=Se[Rt]=Se[Dt]=Se[Le]=Se[Mn]=Se[Nn]=Se[ke]=!0,Se[Qt]=Se[Ee]=Se[It]=!1;function re(Oe,ur,ca,ne,os,Lr){var Yn,Dr=ur&gt,ls=ur&wt,ua=ur&vt;if(ca&&(Yn=os?ca(Oe,ne,os,Lr):ca(Oe)),Yn!==void 0)return Yn;if(!at(Oe))return Oe;var qs=tt(Oe);if(qs){if(Yn=Y(Oe),!Dr)return R(Oe,Yn)}else{var ha=Z(Oe),Fo=ha==Ee||ha==Re;if(q(Oe))return k(Oe,Dr);if(ha==ti||ha==Et||Fo&&!os){if(Yn=ls||Fo?{}:nt(Oe),!Dr)return ls?P(Oe,T(Yn,Oe)):C(Oe,N(Yn,Oe))}else{if(!Se[ha])return os?Oe:{};Yn=X(Oe,ha,Dr)}}Lr||(Lr=new A);var cs=Lr.get(Oe);if(cs)return cs;Lr.set(Oe,Yn),ct(Oe)?Oe.forEach(function(Ai){Yn.add(re(Ai,ur,ca,Ai,Oe,Lr))}):it(Oe)&&Oe.forEach(function(Ai,Ti){Yn.set(Ti,re(Ai,ur,ca,Ti,Oe,Lr))});var us=ua?ls?L:I:ls?bt:ut,hs=qs?void 0:us(Oe);return z(hs||Oe,function(Ai,Ti){hs&&(Ti=Ai,Ai=Oe[Ti]),D(Yn,Ti,re(Ai,ur,ca,Ti,Oe,Lr))}),Yn}V.exports=re},44107:function(V,Q,S){var A=S(1585),z=S(49164),D=z(A);V.exports=D},2659:function(V,Q,S){var A=S(45029);function z(D,N,T){for(var k=-1,R=D.length;++k<R;){var C=D[k],P=N(C);if(P!=null&&(I===void 0?P===P&&!A(P):T(P,I)))var I=P,L=C}return L}V.exports=z},32872:function(V,Q,S){var A=S(44107);function z(D,N){var T=[];return A(D,function(k,R,C){N(k,R,C)&&T.push(k)}),T}V.exports=z},51533:function(V){function Q(S,A,z,D){for(var N=S.length,T=z+(D?1:-1);D?T--:++T<N;)if(A(S[T],T,S))return T;return-1}V.exports=Q},9256:function(V,Q,S){var A=S(57095),z=S(88133);function D(N,T,k,R,C){var P=-1,I=N.length;for(k||(k=z),C||(C=[]);++P<I;){var L=N[P];T>0&&k(L)?T>1?D(L,T-1,k,R,C):A(C,L):R||(C[C.length]=L)}return C}V.exports=D},1585:function(V,Q,S){var A=S(14018),z=S(55451);function D(N,T){return N&&A(N,T,z)}V.exports=D},89147:function(V,Q,S){var A=S(1186),z=S(9171);function D(N,T){T=A(T,N);for(var k=0,R=T.length;N!=null&&k<R;)N=N[z(T[k++])];return k&&k==R?N:void 0}V.exports=D},75635:function(V,Q,S){var A=S(57095),z=S(80744);function D(N,T,k){var R=T(N);return z(N)?R:A(R,k(N))}V.exports=D},40302:function(V){function Q(S,A){return S>A}V.exports=Q},3251:function(V){var Q=Object.prototype,S=Q.hasOwnProperty;function A(z,D){return z!=null&&S.call(z,D)}V.exports=A},62348:function(V){function Q(S,A){return S!=null&&A in Object(S)}V.exports=Q},17424:function(V,Q,S){var A=S(51533),z=S(8373),D=S(49237);function N(T,k,R){return k===k?D(T,k,R):A(T,z,R)}V.exports=N},77295:function(V,Q,S){var A=S(84412),z=S(93913);function D(N,T,k,R,C){return N===T?!0:N==null||T==null||!z(N)&&!z(T)?N!==N&&T!==T:A(N,T,k,R,D,C)}V.exports=D},84412:function(V,Q,S){var A=S(91866),z=S(50401),D=S(57710),N=S(4983),T=S(66139),k=S(80744),R=S(57835),C=S(18397),P=1,I="[object Arguments]",L="[object Array]",Z="[object Object]",Y=Object.prototype,X=Y.hasOwnProperty;function nt(tt,q,it,at,ct,ut){var bt=k(tt),gt=k(q),wt=bt?L:T(tt),vt=gt?L:T(q);wt=wt==I?Z:wt,vt=vt==I?Z:vt;var Et=wt==Z,Pt=vt==Z,zt=wt==vt;if(zt&&R(tt)){if(!R(q))return!1;bt=!0,Et=!1}if(zt&&!Et)return ut||(ut=new A),bt||C(tt)?z(tt,q,it,at,ct,ut):D(tt,q,wt,it,at,ct,ut);if(!(it&P)){var Vt=Et&&X.call(tt,"__wrapped__"),Qt=Pt&&X.call(q,"__wrapped__");if(Vt||Qt){var Ee=Vt?tt.value():tt,Re=Qt?q.value():q;return ut||(ut=new A),ct(Ee,Re,it,at,ut)}}return zt?(ut||(ut=new A),N(tt,q,it,at,ct,ut)):!1}V.exports=nt},55005:function(V,Q,S){var A=S(66139),z=S(93913),D="[object Map]";function N(T){return z(T)&&A(T)==D}V.exports=N},51524:function(V,Q,S){var A=S(91866),z=S(77295),D=1,N=2;function T(k,R,C,P){var I=C.length,L=I,Z=!P;if(k==null)return!L;for(k=Object(k);I--;){var Y=C[I];if(Z&&Y[2]?Y[1]!==k[Y[0]]:!(Y[0]in k))return!1}for(;++I<L;){Y=C[I];var X=Y[0],nt=k[X],tt=Y[1];if(Z&&Y[2]){if(nt===void 0&&!(X in k))return!1}else{var q=new A;if(P)var it=P(nt,tt,X,k,R,q);if(!(it===void 0?z(tt,nt,D|N,P,q):it))return!1}}return!0}V.exports=T},8373:function(V){function Q(S){return S!==S}V.exports=Q},38652:function(V,Q,S){var A=S(66139),z=S(93913),D="[object Set]";function N(T){return z(T)&&A(T)==D}V.exports=N},95979:function(V,Q,S){var A=S(17632),z=S(38933),D=S(46962),N=S(80744),T=S(35769);function k(R){return typeof R=="function"?R:R==null?D:typeof R=="object"?N(R)?z(R[0],R[1]):A(R):T(R)}V.exports=k},6019:function(V,Q,S){var A=S(7975),z=S(23730),D=Object.prototype,N=D.hasOwnProperty;function T(k){if(!A(k))return z(k);var R=[];for(var C in Object(k))N.call(k,C)&&C!="constructor"&&R.push(C);return R}V.exports=T},93757:function(V){function Q(S,A){return S<A}V.exports=Q},65487:function(V,Q,S){var A=S(44107),z=S(24665);function D(N,T){var k=-1,R=z(N)?Array(N.length):[];return A(N,function(C,P,I){R[++k]=T(C,P,I)}),R}V.exports=D},17632:function(V,Q,S){var A=S(51524),z=S(10261),D=S(24122);function N(T){var k=z(T);return k.length==1&&k[0][2]?D(k[0][0],k[0][1]):function(R){return R===T||A(R,T,k)}}V.exports=N},38933:function(V,Q,S){var A=S(77295),z=S(44231),D=S(37879),N=S(86773),T=S(88411),k=S(24122),R=S(9171),C=1,P=2;function I(L,Z){return N(L)&&T(Z)?k(R(L),Z):function(Y){var X=z(Y,L);return X===void 0&&X===Z?D(Y,L):A(Z,X,C|P)}}V.exports=I},58506:function(V,Q,S){var A=S(75010),z=S(89147),D=S(95979),N=S(65487),T=S(33065),k=S(38342),R=S(11249),C=S(46962),P=S(80744);function I(L,Z,Y){Z.length?Z=A(Z,function(tt){return P(tt)?function(q){return z(q,tt.length===1?tt[0]:tt)}:tt}):Z=[C];var X=-1;Z=A(Z,k(D));var nt=N(L,function(tt,q,it){var at=A(Z,function(ct){return ct(tt)});return{criteria:at,index:++X,value:tt}});return T(nt,function(tt,q){return R(tt,q,Y)})}V.exports=I},88832:function(V,Q,S){var A=S(10867),z=S(37879);function D(N,T){return A(N,T,function(k,R){return z(N,R)})}V.exports=D},10867:function(V,Q,S){var A=S(89147),z=S(36897),D=S(1186);function N(T,k,R){for(var C=-1,P=k.length,I={};++C<P;){var L=k[C],Z=A(T,L);R(Z,L)&&z(I,D(L,T),Z)}return I}V.exports=N},22310:function(V){function Q(S){return function(A){return A==null?void 0:A[S]}}V.exports=Q},96916:function(V,Q,S){var A=S(89147);function z(D){return function(N){return A(N,D)}}V.exports=z},36121:function(V){var Q=Math.ceil,S=Math.max;function A(z,D,N,T){for(var k=-1,R=S(Q((D-z)/(N||1)),0),C=Array(R);R--;)C[T?R:++k]=z,z+=N;return C}V.exports=A},30739:function(V){function Q(S,A,z,D,N){return N(S,function(T,k,R){z=D?(D=!1,T):A(z,T,k,R)}),z}V.exports=Q},36897:function(V,Q,S){var A=S(60348),z=S(1186),D=S(70213),N=S(20816),T=S(9171);function k(R,C,P,I){if(!N(R))return R;C=z(C,R);for(var L=-1,Z=C.length,Y=Z-1,X=R;X!=null&&++L<Z;){var nt=T(C[L]),tt=P;if(nt==="__proto__"||nt==="constructor"||nt==="prototype")return R;if(L!=Y){var q=X[nt];tt=I?I(q,nt,X):void 0,tt===void 0&&(tt=N(q)?q:D(C[L+1])?[]:{})}A(X,nt,tt),X=X[nt]}return R}V.exports=k},33065:function(V){function Q(S,A){var z=S.length;for(S.sort(A);z--;)S[z]=S[z].value;return S}V.exports=Q},50230:function(V,Q,S){var A=S(91869),z=S(75010),D=S(80744),N=S(45029),T=1/0,k=A?A.prototype:void 0,R=k?k.toString:void 0;function C(P){if(typeof P=="string")return P;if(D(P))return z(P,C)+"";if(N(P))return R?R.call(P):"";var I=P+"";return I=="0"&&1/P==-T?"-0":I}V.exports=C},13927:function(V,Q,S){var A=S(15333),z=/^\s+/;function D(N){return N&&N.slice(0,A(N)+1).replace(z,"")}V.exports=D},29098:function(V,Q,S){var A=S(98924),z=S(84271),D=S(94874),N=S(1931),T=S(47506),k=S(79679),R=200;function C(P,I,L){var Z=-1,Y=z,X=P.length,nt=!0,tt=[],q=tt;if(L)nt=!1,Y=D;else if(X>=R){var it=I?null:T(P);if(it)return k(it);nt=!1,Y=N,q=new A}else q=I?[]:tt;t:for(;++Z<X;){var at=P[Z],ct=I?I(at):at;if(at=L||at!==0?at:0,nt&&ct===ct){for(var ut=q.length;ut--;)if(q[ut]===ct)continue t;I&&q.push(ct),tt.push(at)}else Y(q,ct,L)||(q!==tt&&q.push(ct),tt.push(at))}return tt}V.exports=C},20720:function(V,Q,S){var A=S(75010);function z(D,N){return A(N,function(T){return D[T]})}V.exports=z},94484:function(V){function Q(S,A,z){for(var D=-1,N=S.length,T=A.length,k={};++D<N;){var R=D<T?A[D]:void 0;z(k,S[D],R)}return k}V.exports=Q},1931:function(V){function Q(S,A){return S.has(A)}V.exports=Q},11756:function(V,Q,S){var A=S(46962);function z(D){return typeof D=="function"?D:A}V.exports=z},1186:function(V,Q,S){var A=S(80744),z=S(86773),D=S(40493),N=S(44140);function T(k,R){return A(k)?k:z(k,R)?[k]:D(N(k))}V.exports=T},27984:function(V,Q,S){var A=S(20188);function z(D,N){var T=N?A(D.buffer):D.buffer;return new D.constructor(T,D.byteOffset,D.byteLength)}V.exports=z},78583:function(V){var Q=/\w*$/;function S(A){var z=new A.constructor(A.source,Q.exec(A));return z.lastIndex=A.lastIndex,z}V.exports=S},28757:function(V,Q,S){var A=S(91869),z=A?A.prototype:void 0,D=z?z.valueOf:void 0;function N(T){return D?Object(D.call(T)):{}}V.exports=N},83018:function(V,Q,S){var A=S(45029);function z(D,N){if(D!==N){var T=D!==void 0,k=D===null,R=D===D,C=A(D),P=N!==void 0,I=N===null,L=N===N,Z=A(N);if(!I&&!Z&&!C&&D>N||C&&P&&L&&!I&&!Z||k&&P&&L||!T&&L||!R)return 1;if(!k&&!C&&!Z&&D<N||Z&&T&&R&&!k&&!C||I&&T&&R||!P&&R||!L)return-1}return 0}V.exports=z},11249:function(V,Q,S){var A=S(83018);function z(D,N,T){for(var k=-1,R=D.criteria,C=N.criteria,P=R.length,I=T.length;++k<P;){var L=A(R[k],C[k]);if(L){if(k>=I)return L;var Z=T[k];return L*(Z=="desc"?-1:1)}}return D.index-N.index}V.exports=z},15168:function(V,Q,S){var A=S(95378),z=S(58966);function D(N,T){return A(N,z(N),T)}V.exports=D},71678:function(V,Q,S){var A=S(95378),z=S(66817);function D(N,T){return A(N,z(N),T)}V.exports=D},49164:function(V,Q,S){var A=S(24665);function z(D,N){return function(T,k){if(T==null)return T;if(!A(T))return D(T,k);for(var R=T.length,C=N?R:-1,P=Object(T);(N?C--:++C<R)&&k(P[C],C,P)!==!1;);return T}}V.exports=z},19554:function(V,Q,S){var A=S(95979),z=S(24665),D=S(55451);function N(T){return function(k,R,C){var P=Object(k);if(!z(k)){var I=A(R,3);k=D(k),R=function(Z){return I(P[Z],Z,P)}}var L=T(k,R,C);return L>-1?P[I?k[L]:L]:void 0}}V.exports=N},76106:function(V,Q,S){var A=S(36121),z=S(8138),D=S(97341);function N(T){return function(k,R,C){return C&&typeof C!="number"&&z(k,R,C)&&(R=C=void 0),k=D(k),R===void 0?(R=k,k=0):R=D(R),C=C===void 0?k<R?1:-1:D(C),A(k,R,C,T)}}V.exports=N},47506:function(V,Q,S){var A=S(23599),z=S(9958),D=S(79679),N=1/0,T=A&&1/D(new A([,-0]))[1]==N?function(k){return new A(k)}:z;V.exports=T},50401:function(V,Q,S){var A=S(98924),z=S(64045),D=S(1931),N=1,T=2;function k(R,C,P,I,L,Z){var Y=P&N,X=R.length,nt=C.length;if(X!=nt&&!(Y&&nt>X))return!1;var tt=Z.get(R),q=Z.get(C);if(tt&&q)return tt==C&&q==R;var it=-1,at=!0,ct=P&T?new A:void 0;for(Z.set(R,C),Z.set(C,R);++it<X;){var ut=R[it],bt=C[it];if(I)var gt=Y?I(bt,ut,it,C,R,Z):I(ut,bt,it,R,C,Z);if(gt!==void 0){if(gt)continue;at=!1;break}if(ct){if(!z(C,function(wt,vt){if(!D(ct,vt)&&(ut===wt||L(ut,wt,P,I,Z)))return ct.push(vt)})){at=!1;break}}else if(!(ut===bt||L(ut,bt,P,I,Z))){at=!1;break}}return Z.delete(R),Z.delete(C),at}V.exports=k},57710:function(V,Q,S){var A=S(91869),z=S(77945),D=S(43607),N=S(50401),T=S(83383),k=S(79679),R=1,C=2,P="[object Boolean]",I="[object Date]",L="[object Error]",Z="[object Map]",Y="[object Number]",X="[object RegExp]",nt="[object Set]",tt="[object String]",q="[object Symbol]",it="[object ArrayBuffer]",at="[object DataView]",ct=A?A.prototype:void 0,ut=ct?ct.valueOf:void 0;function bt(gt,wt,vt,Et,Pt,zt,Vt){switch(vt){case at:if(gt.byteLength!=wt.byteLength||gt.byteOffset!=wt.byteOffset)return!1;gt=gt.buffer,wt=wt.buffer;case it:return!(gt.byteLength!=wt.byteLength||!zt(new z(gt),new z(wt)));case P:case I:case Y:return D(+gt,+wt);case L:return gt.name==wt.name&&gt.message==wt.message;case X:case tt:return gt==wt+"";case Z:var Qt=T;case nt:var Ee=Et&R;if(Qt||(Qt=k),gt.size!=wt.size&&!Ee)return!1;var Re=Vt.get(gt);if(Re)return Re==wt;Et|=C,Vt.set(gt,wt);var $e=N(Qt(gt),Qt(wt),Et,Pt,zt,Vt);return Vt.delete(gt),$e;case q:if(ut)return ut.call(gt)==ut.call(wt)}return!1}V.exports=bt},4983:function(V,Q,S){var A=S(12076),z=1,D=Object.prototype,N=D.hasOwnProperty;function T(k,R,C,P,I,L){var Z=C&z,Y=A(k),X=Y.length,nt=A(R),tt=nt.length;if(X!=tt&&!Z)return!1;for(var q=X;q--;){var it=Y[q];if(!(Z?it in R:N.call(R,it)))return!1}var at=L.get(k),ct=L.get(R);if(at&&ct)return at==R&&ct==k;var ut=!0;L.set(k,R),L.set(R,k);for(var bt=Z;++q<X;){it=Y[q];var gt=k[it],wt=R[it];if(P)var vt=Z?P(wt,gt,it,R,k,L):P(gt,wt,it,k,R,L);if(!(vt===void 0?gt===wt||I(gt,wt,C,P,L):vt)){ut=!1;break}bt||(bt=it=="constructor")}if(ut&&!bt){var Et=k.constructor,Pt=R.constructor;Et!=Pt&&"constructor"in k&&"constructor"in R&&!(typeof Et=="function"&&Et instanceof Et&&typeof Pt=="function"&&Pt instanceof Pt)&&(ut=!1)}return L.delete(k),L.delete(R),ut}V.exports=T},522:function(V,Q,S){var A=S(39807),z=S(19652),D=S(71152);function N(T){return D(z(T,void 0,A),T+"")}V.exports=N},12076:function(V,Q,S){var A=S(75635),z=S(58966),D=S(55451);function N(T){return A(T,D,z)}V.exports=N},22675:function(V,Q,S){var A=S(75635),z=S(66817),D=S(56730);function N(T){return A(T,D,z)}V.exports=N},10261:function(V,Q,S){var A=S(88411),z=S(55451);function D(N){for(var T=z(N),k=T.length;k--;){var R=T[k],C=N[R];T[k]=[R,C,A(C)]}return T}V.exports=D},58966:function(V,Q,S){var A=S(86952),z=S(4134),D=Object.prototype,N=D.propertyIsEnumerable,T=Object.getOwnPropertySymbols,k=T?function(R){return R==null?[]:(R=Object(R),A(T(R),function(C){return N.call(R,C)}))}:z;V.exports=k},66817:function(V,Q,S){var A=S(57095),z=S(49217),D=S(58966),N=S(4134),T=Object.getOwnPropertySymbols,k=T?function(R){for(var C=[];R;)A(C,D(R)),R=z(R);return C}:N;V.exports=k},66139:function(V,Q,S){var A=S(15584),z=S(40164),D=S(97288),N=S(23599),T=S(26873),k=S(86756),R=S(63256),C="[object Map]",P="[object Object]",I="[object Promise]",L="[object Set]",Z="[object WeakMap]",Y="[object DataView]",X=R(A),nt=R(z),tt=R(D),q=R(N),it=R(T),at=k;(A&&at(new A(new ArrayBuffer(1)))!=Y||z&&at(new z)!=C||D&&at(D.resolve())!=I||N&&at(new N)!=L||T&&at(new T)!=Z)&&(at=function(ct){var ut=k(ct),bt=ut==P?ct.constructor:void 0,gt=bt?R(bt):"";if(gt)switch(gt){case X:return Y;case nt:return C;case tt:return I;case q:return L;case it:return Z}return ut}),V.exports=at},63100:function(V,Q,S){var A=S(1186),z=S(13053),D=S(80744),N=S(70213),T=S(11156),k=S(9171);function R(C,P,I){P=A(P,C);for(var L=-1,Z=P.length,Y=!1;++L<Z;){var X=k(P[L]);if(!(Y=C!=null&&I(C,X)))break;C=C[X]}return Y||++L!=Z?Y:(Z=C==null?0:C.length,!!Z&&T(Z)&&N(X,Z)&&(D(C)||z(C)))}V.exports=R},55015:function(V){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",z="\\u20d0-\\u20ff",D=S+A+z,N="\\ufe0e\\ufe0f",T="\\u200d",k=RegExp("["+T+Q+D+N+"]");function R(C){return k.test(C)}V.exports=R},79264:function(V){var Q=Object.prototype,S=Q.hasOwnProperty;function A(z){var D=z.length,N=new z.constructor(D);return D&&typeof z[0]=="string"&&S.call(z,"index")&&(N.index=z.index,N.input=z.input),N}V.exports=A},97541:function(V,Q,S){var A=S(20188),z=S(27984),D=S(78583),N=S(28757),T=S(78358),k="[object Boolean]",R="[object Date]",C="[object Map]",P="[object Number]",I="[object RegExp]",L="[object Set]",Z="[object String]",Y="[object Symbol]",X="[object ArrayBuffer]",nt="[object DataView]",tt="[object Float32Array]",q="[object Float64Array]",it="[object Int8Array]",at="[object Int16Array]",ct="[object Int32Array]",ut="[object Uint8Array]",bt="[object Uint8ClampedArray]",gt="[object Uint16Array]",wt="[object Uint32Array]";function vt(Et,Pt,zt){var Vt=Et.constructor;switch(Pt){case X:return A(Et);case k:case R:return new Vt(+Et);case nt:return z(Et,zt);case tt:case q:case it:case at:case ct:case ut:case bt:case gt:case wt:return T(Et,zt);case C:return new Vt;case P:case Z:return new Vt(Et);case I:return D(Et);case L:return new Vt;case Y:return N(Et)}}V.exports=vt},88133:function(V,Q,S){var A=S(91869),z=S(13053),D=S(80744),N=A?A.isConcatSpreadable:void 0;function T(k){return D(k)||z(k)||!!(N&&k&&k[N])}V.exports=T},86773:function(V,Q,S){var A=S(80744),z=S(45029),D=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N=/^\w*$/;function T(k,R){if(A(k))return!1;var C=typeof k;return C=="number"||C=="symbol"||C=="boolean"||k==null||z(k)?!0:N.test(k)||!D.test(k)||R!=null&&k in Object(R)}V.exports=T},88411:function(V,Q,S){var A=S(20816);function z(D){return D===D&&!A(D)}V.exports=z},83383:function(V){function Q(S){var A=-1,z=Array(S.size);return S.forEach(function(D,N){z[++A]=[N,D]}),z}V.exports=Q},24122:function(V){function Q(S,A){return function(z){return z==null?!1:z[S]===A&&(A!==void 0||S in Object(z))}}V.exports=Q},26332:function(V,Q,S){var A=S(52858),z=500;function D(N){var T=A(N,function(R){return k.size===z&&k.clear(),R}),k=T.cache;return T}V.exports=D},23730:function(V,Q,S){var A=S(31030),z=A(Object.keys,Object);V.exports=z},34776:function(V){var Q="__lodash_hash_undefined__";function S(A){return this.__data__.set(A,Q),this}V.exports=S},40393:function(V){function Q(S){return this.__data__.has(S)}V.exports=Q},79679:function(V){function Q(S){var A=-1,z=Array(S.size);return S.forEach(function(D){z[++A]=D}),z}V.exports=Q},49237:function(V){function Q(S,A,z){for(var D=z-1,N=S.length;++D<N;)if(S[D]===A)return D;return-1}V.exports=Q},29405:function(V,Q,S){var A=S(26539),z=S(55015),D=S(60844);function N(T){return z(T)?D(T):A(T)}V.exports=N},40493:function(V,Q,S){var A=S(26332),z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/\\(\\)?/g,N=A(function(T){var k=[];return T.charCodeAt(0)===46&&k.push(""),T.replace(z,function(R,C,P,I){k.push(P?I.replace(D,"$1"):C||R)}),k});V.exports=N},9171:function(V,Q,S){var A=S(45029),z=1/0;function D(N){if(typeof N=="string"||A(N))return N;var T=N+"";return T=="0"&&1/N==-z?"-0":T}V.exports=D},15333:function(V){var Q=/\s/;function S(A){for(var z=A.length;z--&&Q.test(A.charAt(z)););return z}V.exports=S},60844:function(V){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",z="\\u20d0-\\u20ff",D=S+A+z,N="\\ufe0e\\ufe0f",T="["+Q+"]",k="["+D+"]",R="\\ud83c[\\udffb-\\udfff]",C="(?:"+k+"|"+R+")",P="[^"+Q+"]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",Z="\\u200d",Y=C+"?",X="["+N+"]?",nt="(?:"+Z+"(?:"+[P,I,L].join("|")+")"+X+Y+")*",tt=X+Y+nt,q="(?:"+[P+k+"?",k,I,L,T].join("|")+")",it=RegExp(R+"(?="+R+")|"+q+tt,"g");function at(ct){for(var ut=it.lastIndex=0;it.test(ct);)++ut;return ut}V.exports=at},76833:function(V,Q,S){var A=S(99045),z=4;function D(N){return A(N,z)}V.exports=D},20250:function(V,Q,S){var A=S(99045),z=1,D=4;function N(T){return A(T,z|D)}V.exports=N},28548:function(V,Q,S){var A=S(92918),z=S(43607),D=S(8138),N=S(56730),T=Object.prototype,k=T.hasOwnProperty,R=A(function(C,P){C=Object(C);var I=-1,L=P.length,Z=L>2?P[2]:void 0;for(Z&&D(P[0],P[1],Z)&&(L=1);++I<L;)for(var Y=P[I],X=N(Y),nt=-1,tt=X.length;++nt<tt;){var q=X[nt],it=C[q];(it===void 0||z(it,T[q])&&!k.call(C,q))&&(C[q]=Y[q])}return C});V.exports=R},76934:function(V,Q,S){V.exports=S(99204)},64725:function(V,Q,S){var A=S(86952),z=S(32872),D=S(95979),N=S(80744);function T(k,R){var C=N(k)?A:z;return C(k,D(R,3))}V.exports=T},79785:function(V,Q,S){var A=S(19554),z=S(9991),D=A(z);V.exports=D},9991:function(V,Q,S){var A=S(51533),z=S(95979),D=S(12824),N=Math.max;function T(k,R,C){var P=k==null?0:k.length;if(!P)return-1;var I=C==null?0:D(C);return I<0&&(I=N(P+I,0)),A(k,z(R,3),I)}V.exports=T},39807:function(V,Q,S){var A=S(9256);function z(D){var N=D==null?0:D.length;return N?A(D,1):[]}V.exports=z},99204:function(V,Q,S){var A=S(74809),z=S(44107),D=S(11756),N=S(80744);function T(k,R){var C=N(k)?A:z;return C(k,D(R))}V.exports=T},23190:function(V,Q,S){var A=S(14018),z=S(11756),D=S(56730);function N(T,k){return T==null?T:A(T,z(k),D)}V.exports=N},44231:function(V,Q,S){var A=S(89147);function z(D,N,T){var k=D==null?void 0:A(D,N);return k===void 0?T:k}V.exports=z},99946:function(V,Q,S){var A=S(3251),z=S(63100);function D(N,T){return N!=null&&z(N,T,A)}V.exports=D},37879:function(V,Q,S){var A=S(62348),z=S(63100);function D(N,T){return N!=null&&z(N,T,A)}V.exports=D},61627:function(V,Q,S){var A=S(6019),z=S(66139),D=S(13053),N=S(80744),T=S(24665),k=S(57835),R=S(7975),C=S(18397),P="[object Map]",I="[object Set]",L=Object.prototype,Z=L.hasOwnProperty;function Y(X){if(X==null)return!0;if(T(X)&&(N(X)||typeof X=="string"||typeof X.splice=="function"||k(X)||C(X)||D(X)))return!X.length;var nt=z(X);if(nt==P||nt==I)return!X.size;if(R(X))return!A(X).length;for(var tt in X)if(Z.call(X,tt))return!1;return!0}V.exports=Y},41626:function(V,Q,S){var A=S(55005),z=S(38342),D=S(52495),N=D&&D.isMap,T=N?z(N):A;V.exports=T},65226:function(V,Q,S){var A=S(38652),z=S(38342),D=S(52495),N=D&&D.isSet,T=N?z(N):A;V.exports=T},7941:function(V,Q,S){var A=S(86756),z=S(80744),D=S(93913),N="[object String]";function T(k){return typeof k=="string"||!z(k)&&D(k)&&A(k)==N}V.exports=T},45029:function(V,Q,S){var A=S(86756),z=S(93913),D="[object Symbol]";function N(T){return typeof T=="symbol"||z(T)&&A(T)==D}V.exports=N},16513:function(V){function Q(S){return S===void 0}V.exports=Q},55451:function(V,Q,S){var A=S(63333),z=S(6019),D=S(24665);function N(T){return D(T)?A(T):z(T)}V.exports=N},10611:function(V){function Q(S){var A=S==null?0:S.length;return A?S[A-1]:void 0}V.exports=Q},9924:function(V,Q,S){var A=S(75010),z=S(95979),D=S(65487),N=S(80744);function T(k,R){var C=N(k)?A:D;return C(k,z(R,3))}V.exports=T},70642:function(V,Q,S){var A=S(42813),z=S(1585),D=S(95979);function N(T,k){var R={};return k=D(k,3),z(T,function(C,P,I){A(R,P,k(C,P,I))}),R}V.exports=N},95987:function(V,Q,S){var A=S(2659),z=S(40302),D=S(46962);function N(T){return T&&T.length?A(T,D,z):void 0}V.exports=N},52858:function(V,Q,S){var A=S(52166),z="Expected a function";function D(N,T){if(typeof N!="function"||T!=null&&typeof T!="function")throw new TypeError(z);var k=function(){var R=arguments,C=T?T.apply(this,R):R[0],P=k.cache;if(P.has(C))return P.get(C);var I=N.apply(this,R);return k.cache=P.set(C,I)||P,I};return k.cache=new(D.Cache||A),k}D.Cache=A,V.exports=D},80991:function(V,Q,S){var A=S(2659),z=S(93757),D=S(46962);function N(T){return T&&T.length?A(T,D,z):void 0}V.exports=N},83296:function(V,Q,S){var A=S(2659),z=S(95979),D=S(93757);function N(T,k){return T&&T.length?A(T,z(k,2),D):void 0}V.exports=N},9958:function(V){function Q(){}V.exports=Q},5795:function(V,Q,S){var A=S(33152),z=function(){return A.Date.now()};V.exports=z},89409:function(V,Q,S){var A=S(88832),z=S(522),D=z(function(N,T){return N==null?{}:A(N,T)});V.exports=D},35769:function(V,Q,S){var A=S(22310),z=S(96916),D=S(86773),N=S(9171);function T(k){return D(k)?A(N(k)):z(k)}V.exports=T},60859:function(V,Q,S){var A=S(76106),z=A();V.exports=z},16473:function(V,Q,S){var A=S(99861),z=S(44107),D=S(95979),N=S(30739),T=S(80744);function k(R,C,P){var I=T(R)?A:N,L=arguments.length<3;return I(R,D(C,4),P,L,z)}V.exports=k},40617:function(V,Q,S){var A=S(6019),z=S(66139),D=S(24665),N=S(7941),T=S(29405),k="[object Map]",R="[object Set]";function C(P){if(P==null)return 0;if(D(P))return N(P)?T(P):P.length;var I=z(P);return I==k||I==R?P.size:A(P).length}V.exports=C},351:function(V,Q,S){var A=S(9256),z=S(58506),D=S(92918),N=S(8138),T=D(function(k,R){if(k==null)return[];var C=R.length;return C>1&&N(k,R[0],R[1])?R=[]:C>2&&N(R[0],R[1],R[2])&&(R=[R[0]]),z(k,A(R,1),[])});V.exports=T},4134:function(V){function Q(){return[]}V.exports=Q},97341:function(V,Q,S){var A=S(59406),z=1/0,D=17976931348623157e292;function N(T){if(!T)return T===0?T:0;if(T=A(T),T===z||T===-z){var k=T<0?-1:1;return k*D}return T===T?T:0}V.exports=N},12824:function(V,Q,S){var A=S(97341);function z(D){var N=A(D),T=N%1;return N===N?T?N-T:N:0}V.exports=z},59406:function(V,Q,S){var A=S(13927),z=S(20816),D=S(45029),N=NaN,T=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,R=/^0o[0-7]+$/i,C=parseInt;function P(I){if(typeof I=="number")return I;if(D(I))return N;if(z(I)){var L=typeof I.valueOf=="function"?I.valueOf():I;I=z(L)?L+"":L}if(typeof I!="string")return I===0?I:+I;I=A(I);var Z=k.test(I);return Z||R.test(I)?C(I.slice(2),Z?2:8):T.test(I)?N:+I}V.exports=P},44140:function(V,Q,S){var A=S(50230);function z(D){return D==null?"":A(D)}V.exports=z},91116:function(V,Q,S){var A=S(74809),z=S(35024),D=S(1585),N=S(95979),T=S(49217),k=S(80744),R=S(57835),C=S(9363),P=S(20816),I=S(18397);function L(Z,Y,X){var nt=k(Z),tt=nt||R(Z)||I(Z);if(Y=N(Y,4),X==null){var q=Z&&Z.constructor;tt?X=nt?new q:[]:P(Z)?X=C(q)?z(T(Z)):{}:X={}}return(tt?A:D)(Z,function(it,at,ct){return Y(X,it,at,ct)}),X}V.exports=L},44065:function(V,Q,S){var A=S(9256),z=S(92918),D=S(29098),N=S(41590),T=z(function(k){return D(A(k,1,N,!0))});V.exports=T},95708:function(V,Q,S){var A=S(44140),z=0;function D(N){var T=++z;return A(N)+T}V.exports=D},81229:function(V,Q,S){var A=S(20720),z=S(55451);function D(N){return N==null?[]:A(N,z(N))}V.exports=D},65441:function(V,Q,S){var A=S(60348),z=S(94484);function D(N,T){return z(N||[],T||[],A)}V.exports=D},34402:function(V,Q,S){"use strict";S.r(Q),S.d(Q,{default:function(){return N}});var A=S(34634);function z(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,A.isAnyArray)(T))throw new TypeError("input must be an array");if(T.length===0)throw new TypeError("input must not be empty");var R=k.fromIndex,C=R===void 0?0:R,P=k.toIndex,I=P===void 0?T.length:P;if(C<0||C>=T.length||!Number.isInteger(C))throw new Error("fromIndex must be a positive integer smaller than length");if(I<=C||I>T.length||!Number.isInteger(I))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var L=T[C],Z=C+1;Z<I;Z++)T[Z]>L&&(L=T[Z]);return L}function D(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,A.isAnyArray)(T))throw new TypeError("input must be an array");if(T.length===0)throw new TypeError("input must not be empty");var R=k.fromIndex,C=R===void 0?0:R,P=k.toIndex,I=P===void 0?T.length:P;if(C<0||C>=T.length||!Number.isInteger(C))throw new Error("fromIndex must be a positive integer smaller than length");if(I<=C||I>T.length||!Number.isInteger(I))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var L=T[C],Z=C+1;Z<I;Z++)T[Z]<L&&(L=T[Z]);return L}function N(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,A.isAnyArray)(T)){if(T.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var R;if(k.output!==void 0){if(!(0,A.isAnyArray)(k.output))throw new TypeError("output option must be an array if specified");R=k.output}else R=new Array(T.length);var C=D(T),P=z(T);if(C===P)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var I=k.min,L=I===void 0?k.autoMinMax?C:0:I,Z=k.max,Y=Z===void 0?k.autoMinMax?P:1:Z;if(L>=Y)throw new RangeError("min option must be smaller than max option");for(var X=(Y-L)/(P-C),nt=0;nt<T.length;nt++)R[nt]=(T[nt]-C)*X+L;return R}},81683:function(V,Q,S){"use strict";var A=S(55973),z=Array.prototype.concat,D=Array.prototype.slice,N=V.exports=function(k){for(var R=[],C=0,P=k.length;C<P;C++){var I=k[C];A(I)?R=z.call(R,D.call(I)):R.push(I)}return R};N.wrap=function(T){return function(){return T(N(arguments))}}},99755:function(V){"use strict";V.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABSCAYAAADKMvPcAAAAAXNSR0IArs4c6QAAFkdJREFUeF7NXXlsHNd5/2Z3Z3e5S3J5LClREklJlGxZtmzJUVo0boEICdI2BYICrQQ0PaJaV2JZSOO6NtC/+EfbFC36T902QBpFllxbDYXayFH1MArXQRugKIIojmQ7kSlKpMX7Wh6z3B3uvuJ7b76ZNzNvDl6ulqZI7szOfO/3ft/93lgDz+vP2ZuFHsh37YSOhkZIJ7zHN+NvHQAMMKEOrD4O8+YirCw0wNj9E9qJ2lqv389YoqP8/Z3bkoXmgpZPt+q6loa0Rtcxwy4YcBDl87/wXRMqwOr3K/OVCbN8/1zb0ZL3PPvGjDHtCvzX/r3Q1WQAfpmA9xP/bu4LRdOtrxzogN8MUuxOZXyxmimP/L52bCXqjv1sIN0De3b1mvkWTU9rhomSkrRRUqshs+8pDdk5E+UE0HUdCpDjv9+oTc3+XsMTQ7KsHFAE8zL898ECNGenoQQlG1BZyKghxjsuBEQ4gQOJoqGA+F3Ed0yAH+oj989rx8aDrvg37H/aHzGbesu6ppVMw5ZXkECgYWOi5EMEoNIFhKQosZA6ZwGKsnbpObhZG536QsPRYZKVA/rX7D/62iHfMgYlwG8EFL8/CoaK2dahCAUOaJf1832YmD+pPTXoBfVvjbe7e1OtndNgAH1zAkgMVWIYqGhRbBWQyoCinEU9Bz1QgHZoYO/lpn9yTjvK76D1s+/mdkPLI8NQgmGYBsFQ0+IozfRmqr0koCkU32aoLgDtgSL/OVKdXP585hPvE6hfK7+1e3uyvR1lxYnnspqmzVBOLElU+lUJGT8YBqb7mA2oJS+yEwHt04tQWl1c+O3Ckdsc0L9g1/tqUG8ZhGkOqGCnV3U2D1BSIT4cDigOC1VeAItAclB1AeoNY2TsxfxnRr86/73Wnlxx7xgYXE78KdQdJ9/kSMpSqsG0QPINxwMsHhc+yAU6gYqyFnUEU3x3QzP75dy+H2maxrQ/Zf/y+ATM6ggoqbsDZzy7uK6zLDDJopJzEmovwMTvJkixm0sjg9sbO/YsQjXJzZKJ7HQmnkMp/pNefoYhe2UnEyi3Gcxcbke5iUIbKgA9oBdhyJj52Ysdv7io/XH1n568q89qpO7k3dcFUpwP2aP2Dk14UbSo3EZZgCJrESqUC0EkMPFvLmsMp8PJZoEpyBcAWEwzQHKi2vdBkQNaSlTvPd98dFr7QzbwsfdhzGancEVb+FIA6iiWmP2cqUNBF8Di3wgBykUenUwSv1QMQPGcWMzEs2I4Lx6hmKj2OejRC3BIL0K+3lA53fbETe08e+XJ2zChOer+UYAZ7BBIpdC+oq0iNuE4bVZScLRmMEMcURx2WrYVQzuUiwBFtd9RbxaAnmXffPI2zHJARTi/Ra8AZvqGaNkvglJWTwrj7EtFORfu+Gg8ER49dODSZ63zUHMKus7tPKp8MZmtfLnt4ze1U+zykTswldhSQF3CKpwF2TVuEGXl9IOgtpkK5ln3JGcdaDdD1dy6rsvrSzEp6NwxHdALsCvbtvJs0+Fb2in2jSN3YH7rAF0jM4P1Iyjk8Yc29rREsjPMZkrX9U2OlTVZgKLK70w0rjzX/nO3tDPs0uEPYIaHI5uu8hFg0mHOnjgqF8Nh8AmJ64RCwiMxsX5VlxmPNp57er3oAHqyeunwPX2LALW9sNvHuhSb/xEEqCLgDok1bQgiHQyCHpFyEpghpkMAKmJRm6FPs4tPDMFcatMZGoOdwmHETP/W7NHX64TCWOl2cP8PgPoH5aiMZPCVhtM/MPdpfvZuPNZ0201ZVqFV7jtglCxUXmLoaXb58UGY0jeVoQp2knBC5Cib6XcI8cCMUOO4GuHRBnFVf3SiBrTy948PpkubA2iEV3XNbxwn5MuEFIC5HFCECQm1m/4owg+hM608W+J1hxz05SSGnmWXDt2GmXQchgbPf1hIExwj+jU9Ss39IZK3IqSyHsEaEcfpuWNjOYrI8XKj5eUzTSvPtR++pZ2sXDp0L60GlG4nV6194YSPRWr1sAdqMVMmKP1uvxfDAZFDQxm9KqlSUQJCKb93FmzT4JQEXSJZWqEE9BS78tgdmMx4GSoEFV+5atLMpFMzddBW8d6NSieCb+YDj8Cy/9ASANShqtVqtUYjBQUhtKqC5Fc+ki1T1eq5ZOO0vlqr8o+jCPxeIbJYotCp3jP5x/GfPMCyUWkwNdZW1WqanKVRO8TH0FOVbzx2Jz3vApTAxHy10dTrVX3bzR9q50KtXjCS8Y583Pir7pVqtdNQNgbd3hULJ9jbQRvWZiZ+9p2OU4vx7rK+sz7509eK5SzrdcqFpiCaHNiTyp9hLz/6AUxnZYaSwRWNs6zxz9pX3lufKPE/9bmpi00TubmHsKWBMyf+VYRdJgCqGsaAbSxf/07rF34U/y7rO7Of9SfeHj54hPfZrEK2wEjKlGxAKy8/ei8tAKXGHFXPsZKyHVrqZWi+dU07IVRqi16fW764YxYqXVjzVBW5KezCOiSykxp6zbXG2y+1f3Zhi8Tilz07+2bh/uLSPixwi2agmGoBqJUpEaDn2DcPDsFsgxdQwU5smGEronk1CdkZHUxTh5Tdyw8eBNa0Q17cSCFsGbacX4aFFS03Xy+13odFbToAUMrPHVWzZGON9Tqk5nS9oaxDWYtjO72S2bYU7U0O7SaAmauz5WWAWm0xs5hibaPl5ST2sdyASoE9AXqaXXlkGCZzKoYKQIsWqKLNKyzHWl7q2BHnWW5r2J3MmIBikwwdgmjmWdV93SlI+yRcgwfAU0WHwIQx04BhE/tYom29LkBlGyqaZYKt6AQIToV1i6gYuYfoCC0E5W1hC0xZ5bmqe6pHvLhr9capj4/FXvqiOyknPkbFSkw2gMFBFKCibMK+yyqvYOhZdunAXZjJywyVvTyt6PDBSYZEEjAss/AyRhh37KmLvjr110lgb0zqzqOFnvDWM3dQwkl5c233PaOCeOds4RQRUEs+q12NMlNPA69Gk8pzea1p5bkuEdgfGE27AcVLC1sl0ita3ZExswwrbdyeBZbcQvghgU+evGLWNEMX6kVmAK/AT7WZqY5Dian4M6MnGYc0Iv1VG6u0eFtyuyZUOUsrqzWN1F9ur7vDJgnQp9nFhz+EuUZvkw6FxC8EMw/J+XYwRq5p/Zvu6XFd1a8sXGydqRu9Fa2acHW1AsAh1UZWZrWM0VrO3r3WfaK8Fsse99zjkwONE4uwp8LMtB0jW006NDPYqHMx9Ay7/NA9mGpSqTyC2W5ma0/pf/ROv6bV4wqxnvOemnppR1mvd4ng2Un5VL0gco1c1Yu5d69pWwMmjePXh95oma6ZfRTY22ETb9JZxREnsPcD6qziKEAnFIxvaWc+ksB+Vq88JBZ+kdKrXB/ZzxxsSzXW/7H1Nz+SwP4Hw08cQbMke3nOUAKUbOg5dmn/ECw0j/F1TcJKcNtkiqUmPdBhfk37/DvrYd1aPnO8NNBWYqU9TmgSkCmRh+chUwG2FfI/7teO8RrDVr0u3L6eGUnXHyNPT/dRAnpy5dL+0Ywf0KJZEC1S6IIE1Ef/TPuNsa0SGO3omaVvHRirreRwqU3YciC+AMJapYe2qwFS83/S8infssfNlPXZ8bf3TFQW25zQSVxdLBpDlS/CTi0rvPwp9sq+cZgtiJV3FkNNEYZgUI9rdzB4zkCqnKhoq5lMGjJKadXvuk6tAOCHK/gTKrgknC1ABeZWzYYJbVEXAXQIoLYzcOqQyNJmlqqa9VQFJcikQ+SI5VLR41dhoVKBMmOsnNTSU5XFLAX3aI7IwtNyIV5gJkDPspf77kOpxQbUFCovqtEivaOlhRQ+BS8aCFpr5J8BVGgeg2ImgmtTEUwpuPd/QrRNeNJh2S6eFqNZ0gt2aBdYC42gLFlrCizQVoqgXmRJ7uBeyOGKQ9MWQ8+uvNx3P1NqwQFRcYQSf8rnaTUcBc+hgAYKLjkYa5YpsEdVotXIOBDlgiCr6EtJh2CHtfJZFxmcCPW8r7UlyrQskk+4FdBz+SyHROZIhJRC5Q/kCtBJDP0Se3XvMEy3IkvwAuQKKHB1gmchdHQ13BlQGPA8sLfA44EzpnuujQcSMJ5ekCvp4HVRAtMrXQCYvvTTfR7JJuf0fKGavVRIoOQsdChAJzH0NLuyZwzm2mSG4lCICQSs/XdgoytYeCq94bXksVC2RHGncqGvxUyZdwQbTbA3i49nksKZS3VPOxW267TutU2coXoAoGI7jXiR0DKwtIxPrdVulQ42WfJARLuDcmf/ZpjgdjNl7k4G74XRuo+iGCImWAG7JzXGMcjAyrqHQvPVd1am1JnGXP7RW9oX2dXdIzDZ7rWh1NYX+bEOmWRiKccS1Xolqh7q97Led4SXB0hkdFYGU6vVodGsmbqLoQpm0oAICmJoBjJG3VytZALiD/fkZn1zzd+xZKINUsm0zmpVUyuvmrmalsgQ0fiHJefoA/Q8e7X3LpSKY6YIm9BWyNUmtJwNK3DvP5ufn45wlOs+/Mm3+lPLB4oPr6RqWTIDYWuPZPuey2Qm/739t0bWffOID2KMfOzda33lhGgiykUbjDZ8gJ4qv9o7niwV5UxJ7MsQhZF2lqlez1z4yVYJTNf91MLl9qXK8m5h/MMMhuOEeMG7C25cW8eWxrWM5/jIQMP0kn5Qlo3CNwJ0V7pp5VlU+bPscs+kudzBvbwVsNgxFhSgg2XLr2aefnctAqznXGzSLULSyuWDthYKZefhCuRge6q1frHzs1ufy/f3J278zi8csdszcl9e13m1ybahz7Cr3aPmXKcLUBP4PhwM7Luhtf5Lev2d9WxsXQuwJ5cGtk+VzZ28++rZcyQ7A6zR2gE1FKDM0j/9u85j2OLfsteF29ebx7XkfpF6ikyJmx1ebdL5Uhyboc8YV7tHU25AaRcG3ykGRWhmueW76buDX9+i3vyFmevNtVpl7z3NSPL9R1Y86kZIsJMCarE5rAA7k9kqtMIHz2mf2JJ6aP/QUHYpObpvtFrJYLZEsnkBtRl6mv3DrmlzYZsd2OtihxuygNJOBBXrfllIsbxVeCYzt8Y8hJwkD0cqepXNmGVtAsraoDltN8IowfCGKbaztOqQCCiuHkY7ljVTLM/7SmGveNJiXFzRdVaqGjC5Wk4MG6JRh9mSC1BsI+eEytsM/SIb2DlulrbzXN7OlNy7xbBIItJPquOj0PGECxoe9WfQblNnUbBTxMK+hQ7WDJIERe5hRQMRf6JdRRX0QRri4AJlk/pJqOY8lzesbZBeledxaM6xoc+yqzs+NJe6BKAiEnRUy9l2jbkzDYZDGbmk2iuuJ72z7KTcoPOnn/7A3snlnU23GGCvr84QHPxTqimah4KZos4gXtzLc4YKQG2GPr18dces7gZUfEB8UZ7sgBmiVpEg+0GlYgMVRew4NGDDAA2HPwyA5LPy+cBNhyFJAoEjsnNMjZGC4ifP5a2Jp5+kOTag6OWxOEKZ0tnlV7om9ZUdVDqTAxZyA2IdiOMUYu3YIIJGFSKsJW1i5t13tw2uRHZKiZ1Jp8mnk5xJc2oIqrKiwmSFpJ6OdE7iKnt5KWwa2D5llnZyo+uqlbsFo4WtfjE879hChdhYhV1zv+VWRfeVFBIoNGPjBRJhbny23Jpl0g5SeRvQL7PXto2ay7vCAI3aoMrnLKCH7jf8UevrreMWvYhljhsMmsAQR6mYZOUkKR2YLIFjIILDpqXXtpXSXkCl20WorD2M2MwMYq7/ni6VVUUVLtkCrhtgP51rh43Va0aEpaValeyUnGrT4uudM5mF7mETH48h1coDZ8vDOes8j4HwEzPCMXBBPfeMd82IEC4EUNtfB4ZW8pQ6YJL9VtrQC2ygY9w0ehBQ53ETqghNbT1jq3qcHRjC8tthCf2ptIeRE2QBrQDLNVGhYEoCWcyUV/QrAT3LvlucM2Z6qUlnczSOqtureaMcUMhxgk8JpId9bpKEJxdxVT3UbnoZGsOGnmevt88ZC7sH6XlNyv3TG2Bn3NhUGpi4W5hN3AQ1l8nnU0i6N82goyviVHmNvScOPb/wevtc0gLUWp/pvr7fq0baNrrAGsD0WysFoFGOz2awW0IZlvh2U3ZIXtUQRsgpMEup51dKA20TKWMPFkeo3ucA6g8uYj9ZJnT7odqzBjIzhvmxiBPIbN+1I22nzQrrFzdrAwH9Evtea8koYSs5EtD4+9AjVFKxdTpUK1zqGWav1abJvnYsx+hFWgbSY0P5pgWPyv8Be6Nl0jD6/IAGsTO+g1HFCrZt9NhMRy39Jsbt99VX9W5RVEIbGR4FEUFWeSkOlQrMdhz6InuzMGJM7iNA8aOqOYql6pGhjF/VQ+2xy2b6LaHDvGCNsFU9EMwwWxl0zLKhUj3UBvQCu968YMztxwIvX0ooEcB2FJsZHknqGw/MGOYjTkIQGB7JtlJ2jWHvSy0Qbz30Bfbtpglj6aFBqTjiunecHD0uMwOD7CA1lxmiUHXPff3WLqpu4NhEd5hGghLA8nnid+6UpHqozdAXpr7dNJFzAJUXanEB44Qqa3zMhd9fSmC5QA+z12GrSiRWhzJTBZwKZH88agPqdUrPTA40LufhYVR550GscZ8sE8UAtc2MdkBrY6baKMSVTRW8e4H2MzWw2vQ8+7f8lFE64AU0cntKXDW3WK6yTi41i83M4PaLzyYHslM+oFJrWTNUzlDKlKwWiK3y/eyt7JAx9ShVm2ing7ASIZ418rkh7rqmn3PrCI8CJtGR1LpmqEf3jssbEpGdk8/zT4DNUMspFSFdfr73yXc13Lo8ahw6fNuc1cSGAff6O2XUt0Z2ulVSYRfjslNx33is9NpFFYiyw/CC6bb63nooLmdsyqbnX9h2aJDvLD658NqB0fpynnbbBoTO4u24YEog+Rgk38DHpgBHpPDosqVT1VOd26jY5o0JvDrkBV3+21pwIS0WSzYnBvtbj8xzQH93/Ep+Lrv68BSs8Kduh2pMnPTNuoBbucKACok1Q6KM+OwM89xes+aeJifMcdMC/8LFtrjIYlcmV+rv/tgHeBd77/vxyUvbp9OrO90LDaRZ8zw5Uc1iqxQch3UbUHM//GGPenMzi1oYjkNUHZftqHukCCQPmaxtibu0bLUwXHmv/5jYK+V6mMDx2YHCXHWuZzFZS+NtnI6fNIsK+op+tqeCGQcwF/toiYV4k/+rUHNnimV++sOzULO1zoOcLjp/RgFfWNGebZ6Z+d+RkWsnnP9DhO/pDOikfry4p3VxFfIsUUuximmdE3MfkktY/2ph5Vis/UtGHdJstZbjk2mB7fWvYu2qsGGJVKKerIGhJeurfPVy5P+fYZ1ISh9r1JN10FLV1qbC3Nd3HHUtbPYxdOO32/gVfvX29cxKcmm3gcvEPY8col44bi3Pa5mpo3s//eFWb+pd64hiPD9krZfc+Pm4DPvXhl7vmanXinJHhq+q1nVIm9m7bzzy6ZmN32nzr/BAAorDRNPzg8HHDxqwmhGlQwFmkTXMX96/tXs7NwLzAwsoDur4rX9tMzKre2jFMIYpzT3dN1/S9lt7NjYy9K357AMNKP6/koaG3zpCgHYmM7W/3PXUja2BYnOu+kADikO8MPb9DnM5qWUSZS2Xblr96q6ffyBtJ03H/wHu5An4eGwyKAAAAABJRU5ErkJggg=="},92691:function(V){"use strict";V.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABUCAYAAAB9czKDAAAAAXNSR0IArs4c6QAAD9VJREFUeF7tXWtsHFcVPrO7s4/Zlx9rx27IuiUkTeqEqk8VQYQqVYgfBYlSWS0tFQikAEKV2n8gEP7Bjz6iSK1KRalQW0RbCBIqlUBFqOIHCUIlTR8kbY1jx02J7cRO7F17Z707uzvo3MfszO7szJ19WdHuJI7t7J07957vnsc995wzErR46bouLbz7YjIg+aL+YCyglbb8LXbZ4dvDALAFAPjd/mr8CUAoKOuqulGRwaddVtWNfV/4zkYrA5aavfmTfx6N+IZ2p6PD10YBJAk0DfAP4Bd+6+Ald7Bv566rT5Zl/FkG0AuV7KWza2N/mjkvTU9XvA6tKQBmTj6X2jF+S1qTSpKmZgA0FTRQAUGwUL/DQDSerIlQbETtBU0GAoCsgCwrAHISCvk1bfT9K2ekqamyFxA8A3Dm77+Ije69ea+Wz0qaugqahl8q+aIA4OWB8tiUU6fmNisZvUxLrG1zoNC7zADISgrwq5RfV1MH7/lQ7Om0lWcAzp/944EASCE1swSaugQq4YAMaLWrn4+CExXHLYhLc4QhZGm43h37tFsEjcYry2y9IAcgJyRBVpIgJ8dBSY5DZmlufuLQD9ZEQfAEwEfHH48nxib3qpnzgF8GAETu14gfpxHUThjZmdxfT6bmwaADMNOxcV/s+USuuy8U0orpAOQEzgFyKg1ywL85cuM3ZzoCwNzJ59KBYGgkk5ljAKxS+W+IHjZpQlDRIYhIcufV7eVJrpxg6cydbZEfCAegGEqmIRDfWdl52/3viI7JEwfMv/fr6yv5tRgCoGWWQNVQ/FBK+wO+YiAQUIuaLIVCIdHnAxQAgDfHn/HC3/nPNj156L2mQ96xtx64WYrGKxQK4K8UQmVJD/O5oyKmAIyDktoH48PZ09Kehx1mUJ2UJwBmT/3yhlLuUoQDQBQvV0igrB164M/z4pS/elueevW+awKFrXHO/UQMoS4gAOyGnCzN7rnj4azIDD0B8MG/nzpQ2lgKqcgBxAKiqx9ZMCLH1m/92u/nRB56tbeZOfa9nRUtO6apKH4zKIQAFOQCCkBC8s8N3vnIusg8vQFw4skDpcJyiChhFeW/Rswxwn6RkcwtX372rMhDr/Y2Z197dJem50e1DNIAxTBZhSAnU6Ak0wCKPD9x6EdClpAnAGbfOjqZXVsIawiAhg9HY0ABRRkHX3Q0e9OXnpy92okrMv65v/0srRc2R1AP0o0oIQRZiMgBoMnzE3d3BIDHJvNri2GDA4j8TxL7NxIfy97wxZ/3BACL/3gsrWZyI7gQURR3HYBM5jyAmiG+HwpAGpTkjo39h6b/K7KCrvY2828emfCXMil11Q6ANICmdJ4DCOshAMQGToMS3rGx/64+AF0TQQgAcoDCAeghDlh888iE1pADuqQDKAeg8kclnAa55zhATamr1Bzvug6gfqDeBYByQD0ACprj3bKCDADQDE32FgdsHwDHH5vM56gZ2gcAOYB6hC0b0j4HdN7IrXIAmuNLxCVDPQLjgC7pzm3E+hxA0OUAaIwD+gB0ftFbnmAFgB7JGi7pPgd0Hg17DkBvaLLDVlBfBNmIoBoOQG8odMoZ1wegHoDMEjtEpu7oDivho5P53EKNGUq9ob20E7aIIDwTwJgoYAB0lgP6ANRbQTQwgRzIsIP5DoqgPgAGAHk1Rc4DajgAvQJa53RAH4A6DthOEUQDlHpUB2wnB5CYIHTDmo4ke04JbycA6IQi0QAMAIyH6W0AaFglj4rorA5YXwijB5AcRPQBoEqYW0EsLGUbAMDzgLGN/Xf9uCcO5RfffGYC8ldSxC1PlHA3OSC3ENZW0QVr5oBeA+DIBOTVKgA8LqgbHFDCnXAdAKgDdvUQB9gDoKArotP7gNI6uiKsHEDC8XpKBG0rABeoL4iHJpKwlHGQ470TF4S+IC6CIEODlI0Y2VSHd8IWDsCQSBYVHI6NqaFwdFkNxn1xiAMkyF9yZR0CtfWYphsefGrZGlc8Fql+xv43w9okYgr7rBqEzH9KlqN19/FO14DGzA6U6ttcYY0GSgXL/anBuL6Cn11agUpR1SV/YEd548qgcTbeLQA+Pn50Ul2v4QDmhCIeURKiOE6cUiQ5iKf8NDgjaZzR5XSo0mrSUpMHNpiGi7lwuOJRBPOwRAxQ6xYAs8ePTpY4AGwfwBPVSEwMIX6SxIvyHCo3UtpnhjVJpLrbvIPV6A6SC4HpWEhwND0xP4J8qTSzjYfpd1IEWTiAAMDsX5IvmwQgxGe5s2xQjqRkeWSEUURyylw4SqgPNqCmuI9wgUoDk9ETQBI0WJLK9gFAKM0SljFXBBOX6f81uuw/MZOkEV+YcnTtOie0sEGyJomQ3spG4QK+dVQsG5RxQ7U6AM2TIOcBXecAg1Y4VJZD6wIAmT/NaaCX7eo3wYTqBGSoyHK5DJCNyrES3lbQykaCSUj268Vy0Sdr/phWyYdoyQQRtrJfJgxq0wB5Ki0dMO262v/2AGDkBrusdiMP2Jkz7EhBICVlAWSIKvLZ3VN/qLGVrHdh8ZAPXvrGDT4tH+bJ48Yi56DzRdM8PtWH8j67zwG0RgTXA25q07s65IKC12RIwrAyMDM69eym27NmXvnWvkouF63mMJtWahtHTObEwewmACRHjIdlu1HDURu43UzSoNl5axJ8keFSJJZYiUnh3EZY9/n8IUlSg5LPvyXl8kUpoBf9uq+UrGxkY8Rby0zEWhnnvBhqlUJ9awtHcabmJQu6pwM4BzQmYrOrvtqjFQB66E0LY9AqJVTv8DIJxERE0xBtdQ6ASReIj8dZpDLfm3Xi3eeADgNAWJsrdWrmGiUBFNxncAC4LkQbHSu2sM0SL6PD9JQY8WutgupdtnqEQ0DWAStXQDgAOpMjxvcBZCeIZWpU+wIdlGytb7EMS4RkoiPBORBK/U6bb5QMO71av4isWDdpJ/C5E1+Q8RlmaIcAOHviqQOwuUoStXmSnpipV5WrvNiLwHyNJoYlxPUBFz2WBcsULatbZJTPqdsb2C+O1gCiC4TGhqbRPzY/IFiyxlOi9rm3nhgrr2XkcvFyRa8UdRVZvoUL17H4RVvjv3l/0H7ceYBIMKBjpJplZGSceCf/Lv7U2paNxiwFgpIUS0iR2A5JzUiru6YezYs8xRMAIh3223ijQB8Ab/Rqe+s+AG0nqbcO+wB4o1fbW/cBaDtJvXXoGYBzb70wlhz+9EgwFPZpuRzocqXh8Z+3odi0LuL/BV27cW/h2kXrDYJBgGIRSsXs5sBn7xauHOYJgMVTL08kd92cMmrkGO5YJ7eih01ZO72UgiT1MDrnHk2FXDfOv31x+I4H/ycyBGEAZv/128TI+Gf2UOKjz4VWS+Eu99Y2MiJDdZm/py48kJ2vrUZnF+SsAq+q01ALRPQLp5dPT05NER52uoQAQB/72swbB8v6lsyrRJEjObL9N69+syfRwyRtRtgWQM3eEGOYdFzN7MidCEkr6VJ/FSRToFW0zZHbplzrhwoBsHjypbQcHR6hsZAsMBfPQ0m9aPthuRPQvKTcW/OniLc0jcvl4KVV3xUZExdB3GOLEXLqeVeXhCsAs395OjRw7bWTWvaiVAUAD6X5YYzpeLEtMtzKOe0guHMf7k8Q42VWypgDkEpDQBnUojd/9T+SJDU0VFwBWHz/lX0AehTjYHg0sCF+LIu/3vtJptaGYz8ricTIYceXRj9ucr3u5uozHZ/OvbYsRhQdc6Gythr5/AMfNxJfjgAsnnwuJUd3TpDCRKReNK8SaFr9doPloRptdUu7qTOmCBs0sxDfrKpEunWsQV3DQdwrynKG5cSn9MzS0kfXfOWwreeyIQC6fsy/8kH0YGlrxc8BoCdO/EzcLvyDzoYopDaII3fh4K4ZCK1rIzCaAMAKr5P+wqopeDZAK+liAadyKLQ1fPu9Z+ywbgjApXde3iP55QQSv1702MkVk3XRBrHjvJ7NhG988GMhfgtj8iwCjVLGKYBUGpRUGvTs+oXYnd9ergXBFoC1d14YKIVHdhOxQ8QPFT28VnSdYGc0QGuCxEkSm7h5+S++8jlMDfQP10HmBSsocszN6O1edA97w4bBBWnQ46OVuVPLp289fNiyFOoAQJv/0unXD5aLazKpCMWKk5LzVv6OmJpJbB/h66lZt+qbXAj1atdd3FlAM5mlkKKFnHyafyNx6D5LGlcdAMTmDyZGSIFuYvlgSa4Gb8ggstW0Xltkc7FTZPeVaFhfTRK/ntTeeNK4n59jE12QpmGLamZ+4NADRl1pCwCzs0+HBjRm8xuih5ZjMcSOWdywNya1Y1cpNkUX4ruGO4rJn/qxiI2utndzTBMgCOP1ewMLAItv/24/QFnR8A0ZmAdGwq+pz8cq92ksjmHtiM3LwboW6cCZCHU2vllsi3RfF0DmZOm4d1jVG3gcjRYRC99PpaGoly8Pfu7+BezFAGD5xG9G/UNDu8w2P40ss5qvjmvQ1vfS2J5xFybuE3W1llh8UdVr6Px6lebWenWctgobxTRXyFjic2yXrsClGenGh3IEgDPHpoMjk7dPljYu+KjJycJOzFEPpGfBVWhHN04IYpkwWdHgxT31FogYEPatqmOuG715RyygvzyDY4TEMDeFiQsqodBW/PZ7zxAAVt47dj1IEKuufpb9zXZTEoAq++IZLSKVo2SW9N/tujr+9JxpZvgw8++Ck5aKJUnSKwmtXIqbE1kgieIoTfRBOZv/mALw4V9voXKfeztR7qPokUGqyOsHD7/WE68mEaStp2bLz3/3uoqqDhnyw7Q3qMQTBQLApXdfvSl/ZYGJH/ZaDnKHAnJo4PL++18kCqN/eafA8vM/vM6vbQ1ZXnjEnHX+wR0UgMUTz0xom+baB3T187yvYDixEvAN0LeGJpP0m/ex9MYdzFUmqVtSRS4kSmpmGI0ZHipv+IlSadgqRj8hAODu99wbP91b2Lgc47WQCQPwiF8eEs6jkquHcFclUd1NCbEtoe3k2SkhcdlnaLg8JnPTN46wjauSgkB8cHXw6z+hOoCCMO079/ransLmSoy6HXjjJGAKKs2ArKaferYI2gaV1UnQtm4FrCCRZ1FXCE1pJUQneQr4MzPnMbE9FL0y8NCRc9ifZSNGXs782vcnttTscNVu5q9s5d9rSe9g5omM2K2Ni6nY3oXQuDezV8P1mSSdlYOAx7aM+LIMvkj84vCDTxgRE7be0E+OPTK0CbmdoBWMkBsS/075wrodMCW+1R40Ge0tuQJ2uzXXKbUW3+9xdbe+pPhLratBCz5/IC/FlAtDU49bkgwbngdMT0/77tlzMRkJa1FtS7e8ppy+WzFM/haKNFWUv2+x4A9I+HORpZCStzaG+e8h9trI6gskeTs3RuCfN/c2SNHeWTvHt0BW30PpNpZg0F/WpNKWpqqZaw7/yvZE7P8Vipiu8V4ihQAAAABJRU5ErkJggg=="},46016:function(V){"use strict";V.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAYAAABVVmH3AAAAAXNSR0IArs4c6QAAIABJREFUeF7tfXuwJFd53+/0Y3p65r53V8vu6slDKAghg4SE3kgCSwjjOCSlKuwKxIaUE7tC4nJRJtiFbxWOE5yKqxLsuMDBGMlAkHAcwBAS7AjbvFYsK7FiV4+VWImVFkm7e++dVz/Oo7/U1z09t6enZ6Z3JcgfydRu3ZmefpzzO7/v933nO48R+P+vWggcJfLC57FvEGCXA/i2Az828C2AKEHfBn545UV4TAhBfENR664/gZOOETV3DbASGCwqwqLvoZ0YNKSBIxzYQsKBDUoIyrKhJEHZAbSyEDVdbIaEzQtX0Mkr9mIU+b5j1GxbeJlN2J0YrCY2ElJIDIAk/Ze9yMCCA+EQQtPA/TdcIDb/rwFLRN5WhJfoBLsswk4Q2lqDwIXnsnLpkX4mrYfvAZicDAaCT3FESg4hDIQGSNjoJ4QNO8EzF52D588G6MPHaS3SuNh2sCfWIKWRCAuGy8fvidIGToHlolkCFv/3GnBAiJ5/Bf73TxRYIrIj4Fylcb6KcA5x4RhIg0TzewM2I1I2EhMBNkAMFtnpcQzBTi3NmAxQB4BkYAUsh48LWImBxYALCzqx8SxCnHjlefjRPJAfPE77jMErAaxECobBlBpGJUiMgpGERCRIlAJx40sbZBkI14GADdu14DRtuK0mvv8TAfZ5ooWGwiVWgr1Gwo6BxLZTBjA7UyZYNkykQQ6lhU6iFNEMUMXMzVg7ehkNoQWEw2gCgsEUTspcSySwLAcWg50I2CnoCZS28ITcgyeuFEIV73XgBO1EgsuExopUMIpgtIBOFEygkOgYxthIkgSJVClb0/9FKbA9WC0bTtNFo+3h9I8VWCJa6ir8vSTGPrApZSCmYNoEE+oM4CEDUhNjs2dmjABlc1egIhKRznwDA5qaI7NTQzTclMmWcCFS8zQZsA0LduLAshM4FrPOwpOnNY76Gg3LxattYHcOaGygKYGOE5hIwuRgMlOZoTmYatjQsQRZAsITEG4TdqsBz3cR/liAZf0MFF4jNc4zGsayoTXBEJsVYIhSMBPbQRKwWRESBi9MRTUrvGRGDNGUw2P8mQ+JTFdHJGZQNSBcF/xGRALCNrBcF4IS2JYLyxOwVZKBLACL9ZmZnfqeBCZMYLSEJgM9ICSxRGIlSLS1raWCWSvRtRrouAmCTY0FinEus5fBbdgpsI2VNuIXFVgiEp0YL1UGl7KFEqAVGzEDSjDMCtvJGMqsTEHM3qeaVQa0yFJV+DB6OwQ6Za+A0Gob9MSC5TpAEsOymb0WLKsBhslpZBLBoHIhWDMTEtB9CcOAMjuTITtTYgr0mg6ef8cV2BBCjKKBj/4t7bEMLuglGfhNC5bfgrvURvSiAXuCqOVHuBoJlhlQTdCkoROCDhUMV4CZmrKPgcwdQEGrcvCmATqUh4y2mfaOXmXgmUF8QqrDFizHBVLGssMj2Hl0kUYgFpJBkAGaWgq/mBkSGzvbeOZtV4pgXOGzT587RJec3MIOI6ClBDUaqdW4q8DGiwJsENA+beG1UsLmOJMIipmaAEbKzPRTL5qBm4I6BkoBpSo2ngmgIw0sPIBBZmfHrOb3+d/UQtgZ2SD+OwLPwcYS8Myd1wpWp6mvP/8OXddNYIUB1IBALgDfhbu0gKdfELBs+psSlwngpcxOxYBqaGJQKW3F2YBWmTczccxnD5lZg6U5jWc1GgObsrnwnNzDG3ZCDYgG4cl3XieenwXqVw/QctfC63shZF9BhTESvpaBXW7i0FkDy6B2Fa5OFHZHGZiK2cqAxir9zGY1Yug80y1WdMS6wpsz0du6DC8/hyWj5cD2mnB8G0//g9eKJ6eB+z8fp1d3etjTDRBHYRrKJZTAai9B/NPX41tnBex9RM4VEa6RCmsJQeagyiFLWU8LzmmmFk5l2RCduZJRxfBpllBu3ZJO58A6LlyOR1sOnr/jMny/3LFYJ7Ku+j7e1FEw3QHiWEPHBGoQ7MU2tn7pDeLIGQPLoL62jxsVYYEsSKmhpMyYmrBzOhMdnWH2JTUYk4cz1eGZ1lCgJLFXt2E1Xbg+B/pNNDwHp2+9GAeK4H7pIF1gHLyqFyDaCCCjYeTXdOD4Dh5+z7XizJwXm38vwvWxwiqDGkZQJoE0zNQM0GQYvoxZ0LxQqa7pvhiAVpA2syiV9vlFw4HdsmEza9tNuJ4Lr+ni+JsuEYf4NMbgS9/DG0MNdzNAPJCQLAN8bctD8s+uwXe4EWozNtXUEFdJjd2JhZhBTRKoFNRkGE6Vvf2c2LMuoMXzpknDGGCF+HZCrwtNXnaS6VfMWA+WTXCWm3AcN2Vtw7Pw6O2Xisf/1yO0N5K4vBtBdmLE7F/SDgLBbrVw4p9fk+lybWA3+nSZSXCRIkipIBnUKElDqyRRhfgv160z8OJ1HFve6xoDas4zpoFaBWjeYMw824JgcInBdeB4rLmcuTI4pAUuijT8QQgVKigpYBIB0UxgbZ7GgfU7hawN7GBAe3oGV5GGlGz6CWTMmsp96cxRbfehK5xObVAKCL8YZl/W6SqtnSYNbgLLZ+YCTtuB02jC4U4D96Olhu5oaGlgDMevMaxGC6f+5U3iaN6Ycxl74gS1nGW80cSAsRAHMjV/xaDGQ0dVLvDM0KiKZVMALVa6CPSE2XNkXhX7Fs2+gr4TDrKEsmtn4AqC7TRg2RYsNvuYe2gGJg5AnF3zBRz7Ihx47ytEXBvYjZBuiCWWJCGWCkpLqDhJdSWNUXPhn2XOdbX0x8HS1OxLwFcyuVSB/BwGl8MwDv6TLAcMxfnjYXaLv1tZxMavXC8eLbTjbI3dDOnCQOEyoxAzW+MgTadpk4VVo+zTNIa+mIDWarhizSpCuWlmP4/tNneJLQh7mK5k82ddZbAXbVi2xMH33rHN1pkae/gwNdbOxa2cb45DSC0QG5mFVZwBmrCskieeyuQqsy+BMNPsy+CVPtfV0XKjTwW98AU7tfyja8FqO7DdFp59303iWLkYUzX2mU16LWnsjQWiiGO1JJUAkwxBrdPFnMWyMwW+CrB5GlkFVhWgdUAtnsMAew7sBVeZi7bcB+68Mx1+G3tVAstDKeEmbuawClYKrIolDCeEixFAbW8/rYtZPl7h2MrPmArWHOdVF9D55ynOnAuvCXvVAf3aLVmHoBawT27R6yDxkjhBrGPEQ7YmHAWMJKBG8F9mWRVLp5r98EGVma5CLYr3nJCnGefVcWDTmMwObdFR9oLnNnwnPParN7WOzwWWw6ukiZs5+A0lYm0goyRja3pxWUurWFbQzLEK1NThOmZfRyPr6m25cfN7s8mbZDSgOYzpXLiJshZ92E1PNHZ4oPdc53y9zNoJKXh6ky6PFPZqBlUg7kloBpVkjeT0DCc0pskFKkzoZAWVzuacOo1TbnS+JmH9tEGxwWOWjYuRwOLMlUkUpXEbD//Yymo1XWvR042dbXhtzzn6C68TTxVZOwYs5wOePInbeCS1ZxArk/ayTBQP2VqMw6v642X2lj6XzXYsbq0b5NfR0jrnVOmGDYvNfMnBsffdJp5f/zKda2zsiwNFyrgJg8u3Tru8Duy1lnAWPXhtH9EvXeV+cyqwx0/RPqlweWQQSQ6vBtA9Zuv2+H6t8aZKyTgDllZ6+5LgTdXIOedNM3sGlP8v+Nj6jVuyYJ/zrt5X1BVBAqsbuQnHrxlzgaYLu+kIe7WNxkoTzRU4f1scyhlj7A9O0VWxxGpoEIVRxladpEPWLwzQCm0+I/2ry8Ap0ccEOUuWlIdPyz70+TfjwTt52sfw9R/+hs4bDHB+SEr3wtTXpKxt2LBaTVgrlnBX2vCabfPUe65oPp5fNwKWE9jnP4uf7hvEWqYJbMnj64aHdqc4rDFyTEvVzZCMounU8dKV5/DBgoycKZMZVA72PUfbCTmH1+8Q3WK5PnqA3F4PV3f62mxpMjzizN/zdY0E1oIn3KUW3F0LjnrPNeIbE8A+eZL2DDR+SsWIujrtEGieWjMWt9Z1TjVDsZLVjuozK603xr45TK5yTmXg2fyb7OGBE+9/s/hhEdT8/Ue+SZds9vWO0wHpiFlrg7iMzNrFFuwlT6ROTCjnW796s+jzdSPGPvEsXRZIcHowlhGkNtDRcCJC2WzHnE6hJNMko46HHoFcx+zrnFOy//FLhjRnc/Zgtdvo/8Z1ODJt0twf7KeLN3p6d7dPkuUgGoZgzFoOu1Y84bY8eEu+88REovvICboxSuCqAeRAQIZx5rQqh1WqmDtF3+YF+HW1tgr4s5aP3LOTshcWXaUsHFq/mWcpTb7uPkB7eqG+9NQA8ZYk1QtgpMk6SgyssGEtN4TDTuycVef0L18pHhoxloich57Gm8MY8UCnYZZmp8WzO6qEv1ihOsBP3GN4oI7J12VyOZSbKjNDQFhXFywlfMf9/vtuE4MqUD/+CC1aA31dL4DeGiA+HZEMojQXm+QYsBysNISz2ERjxYP69VuzsCuVAp5oqwivDw3iIIIMYmhtMpF+Mcy+qpK1gXjBZp9Blt0m6+dzz4klAL77+PrN4lQVqOv3kXPpMm7ajE2jE1DcjRFvBJROl8qlIGWtgfBbsHc0RWNt0XEH9+Fr6+siSYE9coIuCDReyRebADHPvONoYF6YVRlv1gGizjkVrVH5vNJ5U88Zao5ru1ajqSzPcp9bf8v0CRn3HFTXBEqs9RVJHuLu9iE3NaUykHZzh9EOy4Hvwt7ZEs6Kj+aq7xz8lRuGU+UPPkWvijlFGCGOAdmL07Gs0cVjplyKAUffzfPQVYI4OaIyGoousmg2WEVGjnNPpXfjbmh2B9ZDjj09z+399q14eJqzuufb8asiy37ZICK5lTIVqqMytqZxbKlADOxSU7hrbTTW2s4T/+oG8cOUsYeeoisijZWORjyIoHSUjmdNDBDO09tZujYvSz8k1BgydZzTVJkptTjnALgbutR25SWbOFSVQ+VL/vwI7QkG5vUDlUYAcktCbsWkBqyt0WhC9Fg5XRc26+xyG+45i+b4r93Q/EEK7LeO09VygHasU43VoRkydlqWanjbeR6/jo5WnTMTrCnRR3bNkKGFVuIjaSfAhrXaBCVN96H1m0VUpav3HKYFE5qb+hq0EVDcZ1AlKXZYDGye6SoTzHMyB7bURGN11fnRB24Qj6XA3v8MXRv04HVCyFhDKTO9G1sn8Vw1gDcVrHkSUqEJU5lcApRlwLZUCuqyD8Bzj6wPA/gysPcQ2eY7+o1dEs1AUtwJILcGUBthQVcLFxXLwMD6Puwdjmgse8npD97uHU6B/cZjdGNgYA0iyAFPx+SIoNwVreia1mHWbBC2S3o2jmmMpSPzcQsRQMZUlxdeWOFj67cvb1QxlY996kG6Ko7NOf2hrvZ60Kfktq5OlTmVWcRyC/ZOXzRWm9T94O2N72WMPUY3dSKIrQhShhmw02LVCZ3NZaHiyXU08myBH4GaWn/moIr34srySOqCD7tF7pPrbxXPTgP17u9Er9TkXBxpkhtd1lRIdlaprupqXS36hCKwOxedwW/eKg6mwP7NY3TjIILoh5CsrzwZoXhhhTWOlXGe1o4wr2v2tXU0K8a2tm5fOIoAYJ79N2/1x5LQxcJ/+iHaLSNzdaRInuxB9mPIriLdDdM1XvnqnTHTKpOBLIilFuw1T7gvWaTBB9/ceCAD9nG6dhDAZWBZCnS2SGziVcmuOmDNOefMgC+GUGz2k6XKQXXs5PS/u307lVeu0KcO0WpicO1gYKgjKd7ieDWA7qlMV4sdgZGlVtTFGcayuxeEe47vdNffIrIZ3X99mK7iBbcMbJczWnp7xKBSR3PnO4NZVYyvY/ZV52wDv/1gVZ7eMoyJ0zwpZ6xsd+NDP4PHp8Wqf/ZtWhKeub4fQHQlxd0QaqMPyaAO8k5AoSVmES0HdseCcHe3ks0P5c7rr4/S6wY9LHYiKJ6dnAP749TI0b3nNc7Q2KHypOskS/NbMKguwVp0k60P/aw3WoldZuoXD1BrS+DGQBu7F5LkCKAzgOKeVTDsBExjaBXRRsA2hXvOonPyd94iHk0Z+9WH6bIowo6tLNzSgxJj6+ptHbDqnLNd+DwUqTb5YsPnoHpN6n74rY1HpjH1E/dR013UNw6McAd9Upsx4l4I3SHSHK/Gua7WkMKcxQwsa+yOpnD3rpkT628adhD+7mG6eCPGPl6o0C8wtq72na3ZV8pMmV4lb191DWfyhQNrqeX2fvct07uqPBrQTlKm+v2QZFdCDiTUKVUAtU5YWTqHgW21tL3Ldxurrfjov3/rwrMpY79yhPYMJC7hLhzPJ9AmnZ81MbujjjTMBKuW2W9392Zq8vBBzNQcVO9+PMKZpUm3C3AHIH4QN4ShWQgiUhsy9SdpWDWLqeUyVGmt5ShrueXau3zR2LPmHOROSAosa452cc1AIhpEmRQkJWDPJiKoYvxsB5Z/O11HR6Cl4/uwGkOmem/BI+uF5ZhFcHlY/zPfxXWBMqvM1BzUvibT68JoGxTF40SqQ6I8IvEc11pb0M7OpmjsPtT8u1HaMAX3IXrjRgwe01GDsJArqGj+OqFYWUtnevtCC0wwpPj84Zf8h5nKoLYt6rYONR6dxlQG9VP71dURWbvyFCCbf87U/owcwMiBlcxwvIwK7YZrr3rC2eEr84f/qLWfTx+NeX3+IbqyG8CPePmigWE5mFrJGSY9dk0BiAnpHC2Izbz9XLMfVm4MVNfd+vDPbu/DUiUBd+2XV6rE2ttTFG+FUL2h+Xf6maMqJlYq61s6uP0xe8f6apGwdvpwz9lhn/6Dt3mPjAH7pQfp4k6APaHkhG7arR2fAzv1AVl16gOan51N16nqNY2xfRhlFUOq1Pz9ZPN37/COzto149Pfpdf0pbkw1CQ3A8iBgtqMSc0DtXoW+LZMZbXN5MoxEO2GsHe14exc9B//j39fPDcG7F88QCuRxk/1AkiODOJhyHU2Zl/lwMaODW860+wLDM2ZmE+SsJru6d+/DU/MAvVP748vVYn98mDIVE4BnuZeVUgmZ2o9v5GBuE2fgv4roMly5AtrzReN2G7uv7dq1cxnv0PX9TTQD6H7JQdWR8xnRwR5AXOzH5+sNcv7cpKDp6s3mrBalJz6vZ/zfjAL1LsPyssjaV0YaciNXjoKIDtyNqjp8yutcrvc6Smlc2wH1toC66sjP3ln47s5CcamGH3xAF3yrMGudJl4BJPLwUz9m6u3bO/bLX6mLC2C2m64z/zeHeLpKi3lY+yo7n5AXRFLax+D2pUkN3ps/lA5U+v1/8ssZcy3h3jyNmB99Rxh7fLh7myJ4x+70x9N+BgD9i8P0epGH6/psh5pGGbtpNMZb9kq0LMHDws3FKwq91TW5fK98nH7lg8s2O6xf3uHODkL1LsewBukNOcwqCd7lAb/DGoQUdJV6Ty0sdi8zNKxEYhRVregAqW3DOxKW6Q9Lu00789lYExj8xb/zP14QyeGtRlmOQOeYTeuj9tVm+vJp4A65pwmy50e4TEq1lTfQ9JuuUc//GbRmQZqGvwf1NeGUqymieoIahaos5cobTspVeFginVmfV1aEM6uRbt399u97xfLNzHx+E/up/MiiQu5B5bLQRmI6YBus3T7nG0trRs55KAuLrl6ReGR9bdVbx3CFbnnMDXCUF8XK7GYg5qGVBK6E1HCI6tFplY746KOuigDWlVfzsFyNLDmwVlZ8h+56+3i9Exg19fJOvc2XDMIQJsKWsU1Yr0xVc+95pkDyhXIx+kXPETKdh/5SGn9VLHwnFBpLOvrewPhc/CfM5VBTceqNJIc1PpmP6mlxWfmIDeJ59IK65wWqc/+4/bBsjVVrpq5az9dtCGxLxg6sXxOaLXeqtHQSB7bVRUkPTYs1TQHlvamiHcCcrdOxHj83oplPvm9eUS139fXSSkaOai8IntLw3QLoFbLzrinH5V7hiMuyiHHrk1HWGsLcNZW/MfvfvvkNieVwN53HzkPC1wzCKFPM2sLnYWJqKSOc5oCaH6v1PNzoN3kPQLdZz7yD6d7fr7mowdouUm4NlDG7gxIcTJli7upkvQgzsapmKmTLM2bZRvYOktCy43D2sps3bng6Ht+3j1YeznSpw/QzkGIV58OIHlxR5RGB+wzt5PNeUD3wkKx7Qm87KRMHDzxR7+wsjnNSfHxT+6nHQbmmtgA00ANSwmVsSil0GuaN4mkyidwJJCzdYetH73rXUtj2pqXfYKxHAve8yCu3RqgkWbWYyjeNDHKV40M9TR7aLFHcqbd2iGoPJTiuPGOVTw6bSJFXtiPf532km2ukAmSTkQqHfuXUOlwypCpZVC3wanv7adFQXyc2er5wtrn293PvtN7eBoJJoD9wmE6vx/hVZ0AERd8QyodaXe4xuvMkiWVmjx0UGz6nPZbqqGn3Nif/IZ8lXLsl4cSelOSDEMoBnWLzT9Cwmm/Me8/mhVTALRitslUiyvIV04fZitHAqttiAt3+w/McqwTy5E+/xBu3QpgbfBoQpoJglaRGg4DF6SgnJGao6M5yAwod035Tlbb/eF/njHeP9RT1yNcpYzZGcRQmyoL/Dd60IOE9FYvi1q2vX+un9vNOqJDHedUhfTwVgsNYS+3YS86+OG972o9M0uyxoD90hG6YBDg1d0E0amBjgeBo4JIJbzGqczVOjFpuYw5S5d9N45dHP3YjPiUC80jqdrRb5CRaHY1FHdRexF4zF9vJRlTTYGpk2Y/2befcL6lOcBVVsYkqCsBExrL5va5Q7ilF2lnIJ240+FurTIBb3oAGL65Jlij0KtO6w+fknt9Nv2FZnJqx895x6Zl+/OC/fG36VyLzOt4T9meIh5G0cxUHvfnGJUzVKOBv+JkuJFHmh/oV4di254jL0suAcsLpAdPtr73tfXqafXFRhkx9s++F5xrK//yQYJoo6tlRzoqiDMJ0Ik+YVt+30BdzMAamW4NOrY/YTGQGT1gWHIek+JllL7nHvvDUg+lzBBu4Lv2y8uUsF8aaKhekIZQsqehTwXQ3O+vBnW6c5oWN6fPnmH6/JU/jAIWFxzRpM6RL7x7V2+WBEww9r89SNf3Y90+HaTDwSok0hzj+Z6b2E08wIsfPvBXtFtLdRHvhRLobC5+8SFleeDP6XooG1Z72T36Rz8jZoZS64epcUGkr9ZKrHVjqL4ilTupzZAMmz6DOopRx5jKZj+JUiWoM8As1icPrdo+rNVl/7F77xRTJ9WVwU4Ze9f3qN1U5o1bimJeHTKQxPsTkMUbKCI5+Tt3NJ/IL/zNL9EFcaz3hknWDx9Lw1XIQzou1YTVEMLZueacXjsXx4qb0uT3/cQDtAKFN4TSNJipuZ5udKH7uZ4moHC45LK4aq7cETgTHS26uuJ7BpX/L7d5dMA/9pmfz0YG6r5SYD/3IF3akzivG+h0XmiXeM9xwCNh77ac75b3O/mtL0avUMbexTNH8unjuVmVycB7ZfP09GVXOEseGqtt3onNec5J8OS7rxepWf2Xb9AFwsLlIZmkH6U9Kd3hnlQ3m0eVZ/zDsbRfBsO8hEmVk50HDidYWAK4d7W45B//wjvEiXnXVDL2Mwfp1n6grdMxGFilLErcWFjLK073/beIw1U3/e2v0vm9gT63H2bglhPIeYVYClou7GVLOIuLcBYaaCy4wvVtOLZjb8RKhRDWPt4WJTf9Uxz0RzCZnqqkr91kWwzHh0YqtX14sMzkyUAsH73armFu/k0PYsU3x/7inYsztzudBrj4+Ndp0fXMDZshxZ0IEY+185wCX/DUb+coLy+fdvEHPk+7exoXdSKV6u34pgnZVekCYILV8GAt8XRyF47nw/Et3uxOpNs5x4p49w6dh1J97klFSPqF7FRxAK92V3SOlpaBzkFdajlYWnI5CVRbUycY+18fopd1A/3yToB4qwMZs8PnuUi8K9r97v3TxuvzG/36F2lnINXLeT7pYDjvafSQwpIdnk7e5p3XhLAXmrB93jN7uEFuyF3mGAmzNCQyW5EaBv3uMOOfITRvHm5V+JTr7fhw4CRVGFTbEdaOBdJLCy12VOma2LN9iT/9Ll0RhXotdVoDqIBlIBHW2pLT+cCbxJFpN07X8n8N58dS793oAjytPC5NfywCwcxl7eIIoZnuKix4Q/J0w3IepVCCkkiCWE9ZVsZ6UhXMO9sQqlyf3Enx2NWqqzvN1cWjs9KVdYEWn9ivbhjEaJwcIO4p4m1KqCWE015wnvytW8VEt40z9lEXL1NCn9cZACdZlwdQveEUyPJUnbIGckV4xzXHy1KFvFmgSRxix5R1TbONFuowNGdjdvJ2lXMTL5t6+XjO0uUmkee2jn/5F6dPp68LaH6e+MS36c2nBtps9BEHw2igxVq46Bz51zdkcScH7X/yAPZ4hPOFZXZHESgwWUjEE3Z5dQmPgrImTluyUyxYcfpjjsk2oGfvnOpWvshSr2FtNqLjT/2P975itC9h3fvMOk98/Bvqp5/Plt7IPv/ODwB2MqvLzrMLFDu27a00LbMLFmz+6RJtwYQx8cQ53Y94rJ5DI9JsxkVQyabQsYWjNBp8vJx9ygAd51B5JWGJiKN6VMWtVZUsx6gcQuVD1m3fiXzLfeq//6LYejGALN9D/PF+uuVkR5tTARRHBPyjDCwFTRfOkg+3acO2LWEREYUKFAOal9zHhgFGwh48BZVAPKnCst2YBJ7+9DuQJoDvvLe/00oW9mqpmtzpYO3k3K5OcseUm/38XtMI6CmamzuoWTq64CUhifbTX3k3Nuf9qM8LAVz8p2/Kq7b6wt8aAsskshsQS65weFtl3m2SBASvreWENy/8YEA5OaMMpYtAeDUQ/+yJsd0Td78dz5YLzFLyrrt6a+R5e7rStJV2wPFpzvDpyelx3ZzVry+DkAf5ZAleRIw2WZ2m7z3342LoBGM/sp8u2urqCza3stXNXNl0+6MGBPuXdDNaTsRoIElYWyndzSe/UcOFJOU+17PxXB0L1Ju/AAABOklEQVRv+i++fNTbPL13bUDOjlibNkcFzGKTUOrA8vtOG10d0+rhGAabNx/nv1niRKS7FrsNu++76nTwVPtUnYzUC2HoBLAcNvl/pa7aCIWzKUnlXp1bnH9GZFTRgvmxydugvorjH33ynYv8+ysTs7/rFPKKj5J7sTVYi22nHQnRTqCbscw6DXlPTsf8MzRDuSgMBjn8o1LD13DGDDUoiVqu3ZNCdpaWljp1GrpOOc/mnLRwv/9N8jcH8uW9rrXEixyYRflruHty+tG23cCR4aa17G/MS1KfTWFYMu68F030+wtd13KsSNjkCIeMcITk300DqAHjpD/mQEaJRDWarXCXRPiJf4L4bBv4bMo675qxEYT3/+XWahA1d1LLc2VfIkoodnUS+w0/jjex9bFfHv+BsXk3/3/5+/8DKIf6sstcS3AAAAAASUVORK5CYII="},37426:function(V){"use strict";V.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAEKNJREFUeF7tnAuQFdWZx/+nH/c1M84MyAzOIBpjBYRgNujWqMFE86AUNYpbRGMqmlTMEtmEGC2yZrfUcTdhw6KbJyYQNUIFycbEVMgTDBoRMwQzBAyia5AFBKI4w7zuq1/nbJ1+3Nu3b9/b3ffeGZDNqbIGb58+ffp3/v2d7/vO6SaIWD71ezYpl0OLoCJhyIgzBtFsQrMasv+Ut+o64FvH82PFdvg1qh10rqxa/7D/lPbHOV+ErgGaQDHa1YKBxz9CfKtHRFS1Ognb2CeeZglqYLouoCUK4EYMQM1teBRQbaANAiomcWDbx8hQWCa11AsFfNGPmChNwmwiQHZLuC6lcmlV63HQE2HDDNNGlAETxrC37w6SqwVmmHNCAb95C+vWCaZOmNlooHmKKgoiYXD7J8mBMPBqqRMInDFGbtyEd4sxkKrAgyCFsfMRTEAU1ZaBqdJXQsHObMee8bLngcC57VZVzA6cp6oBDzMhBpmQeo/7zOiV7kmn2Ne/mIzUouCgcwKBL3qStcoU53o7J4sYeuyDZH/QBU7m4z2PsFkwkCz00b5JXcTB/sVkYDz6Hgx8K5uCHKZ7L35KAP8umwURSe/srYs42r+Y/PWEAP/4JtaRB870XtzQMPTE1W9xhXPg1KVwO46IE7zedxs5cvIA1wADpxZwt8k8uYDb/rPwN+A1PQCBNnzhJtYhaUWT4ijhVAGueUwKp2gQvL77RJmUvwGvScgVTwqtcK9beEoq3L5JI3aCFc5cJsUZulMOuEtRJxb4E6yDxcrdwvECzhhLAJgKoBmADCDwKaz1odeqtC0DrNZ2AegAMgCOEULG3O0E3sxCP+AaIMiNdQt5zgZAB4BuTQMbHIRycEjRaK6uGy9llohHZ5hXop2TALraidx1eiwmy5A4dABHCCGUNxQNuDufIWPolw0MfBhjnQCmvXJAzaz8njY0eDxdg8KainD482EXQ8sG3mclqqKcKvYj7a7FBexfJLmJ6VqGLPt022kXz42fBuA4IVYGMrAjBYV7E1ANBG6bkVmvHFCzd60YOh5NUu7aJw9wp1eLb5ZbPnBhvB3Aq4SQ4XDAiWXDS5hTDP3yHxoT2jPGztY0tC/pzRytTdm8d42H7UArqDyCwt0yWH1fbGp7e0wnhLx0sgCfc+h1GLff90aNGToXbH6nzUA9ZsT7hNUL/K7PNLfOnYVWALtCAVdthZd0pLEKn/uHl5SxFd8cjpCD9kC2QTfCbjca+I1XSKnrFyROB/DiSQO8b6cyuvJ7w6OV7bcPYA/kYNgV2jA9uMqlXoUv+pCUXHRNYgqAvdGBF7cYNNKGzzWBb9CqAA8/lRbNSSXA1doqh3/igLtnTbGhk2ZdwP3tdRG2bruF83taYgveJzR1dcXiMYD8dRDqM8+PZH/+rJTLZLLmKEgFN7AI/sQA96wp8hWfBnopkYBXnhDLIU9qayI3XSWmLnpXvKm9yYxcy4qmwfjDXiW7/ql05tA+anihTzxwvTw9ezID54q+5MJm+cOXJ5tmdiMly8HxhjMK+w6p+Wf20PTGzUa+ODKW2kXFFQRVsfs88HGPanQbbgN3W5SGA9+rjH51zUhJ3iGc1S5V9Y1XxJLz57U2d7YjFu58/1oZDfq2PyqZB/9bH7PSIlZ2RJQc6NUjzZqBz3+CdcCl8IInIGJoS+MCn7l9ezH61TXHIgJ3wY7x8D2F1XfKU6Z1xuqC7dxjVgP93PKBNwaGkoYDvajyiQTO1zQTJwp4qefhTIhoSsHQcoTqIB9+b3P8ip5E6tzp4JnHyOWNIai/2a5kN242snmVMUnmCTSvWZlo4MDQlo81LLSPoHAf4DZsrnAaAzE0QnSSE5YsnJS8vgfNGQ2sLQWhGnmeoeT//eUo1DsezA2LMmOCCsb/IpOFxP+WmJWJAu6sijQY+NZdytgDj45U8MPL/emisjkFrm5CaCxrwqZyylT6LR8SUtdfGk9e25sfuepSErtqjpCY/TaZp0wL5cgwjCd3qfkntlDlnpuEJsbAvrjWGBE0MFHLMEECE02VTzRwj1sYoxg5LY5D7s63n2PnrvvLteT9qeUdxTz305fhfAu4Hjrw8QdeVLehp8glc4n8lVvibV/bqKR/3geNGiBnT4HwnllxKZlQSf9+pu/eD13QGbtgJhHv+Wi85ck/KdkHN9LMiQO+jnVALHcLS5CG2TvIT6iwRXn7rcDWXcroisdGI06ajrpz5oTpNieGnCJxHWTpIqHp2p5Y8s1h0J0HoW7fqxpHjjOqKMD0DpDzz4qLl8yA3N0B6eXDUJd9Oz+SZoyWA+feScblqYyXSXEBD9r6W+uO1nqBc+xFk9JEqAyi5fMCk5Pk7GlEXH+7mY8OLKt+pYxt2JTNy4kEFbQsEzXG5GSSTqwNt4HXCjPMnvLtt9Wq8JQJkXsnlsJLbbhOFCEmJ8jmf0tMln1jzNIx+NL3laHf76GaoOWYnExQc9IseCnWjFka/NizqGco6wp85q9jHZrLpBTaDto+bJsQp37ZgLl+ePY2oC/QpFhw/YoFHOATpSETQnU+cfJ/pwjTQX7wBbHtbd2lk6W3HU3TsOBu4029mjkpizYnCngQbNdecS4sX9j2AX6MK7wUeGW4XlAObOv3oh3nwPkA6IQI738nif37J8y1xYrlJ33IfPPHuYwg5ZjATQlLUq5ugLuElv02cyolqz4TATwkbI/AS2/UNSD8QBE4D6OjF8ekmCq3/XAO21I5IbKSF5be0JZceBF8R/LP+1X1jjV0RNUYkxio5YNnTXPC2yy4hBOq8CDQQSbEx7Y4TTrAl68dK9NPNPwuO64T0nVWSlxypdD8251MeWo3M3pmE+nG95HkOZ0xkadnXzsO/amdirLu6Zzyzu4E+ex1QurxZ2h6xytprWi/be/E7sjE2HAa4BZ6YEadYC3gGF2+dqAO4ClQPUuQskL8ZTc1N3/gwniTDBD+XuePn0Pm4U2KWrLLRAEEkbGr302kf7pOaEmlZHMu+NM+Nfef6/Xh0WMZcy/JxCuc4syoEAvK9ObRfWx6/cAtS8HNSVwmZMU/Jttm+eRRshrYtt2quuJnLKfqYJ+9Mh5///lITGkrD/uHMtD+5eu5wUNH0yX58QlTeCN8cF+7rgHblwJbdyhjKzeMRbThNmhT2ZYvvvafJ0+a1lk9NfuNjUg/96pi/OgLcb6SXrFkNBhLv5Y99vrBDHUmztIU7ThMmpetYs1Cs7nEX1J83xy1VqlCF6f685/B1OjAS2FzD2Xp9ammq3tQ1Rvh5mXhcmVoZCSPH97Telp3m/3qeoVe7z2k5pat0I5bGUPuimdcOfFxAB6aXh0VGWNzt+xQ0is3GJEUbtlsS9kc+Ia7k5M72v2X0ZzuDWdBr703P8z//9ufTzTPmVb9aeADdM0Xs0eLAZA7vP9/AtwBzW/Xgc1dwM1fTnaGiSgXfHlkeHAkTn/xr4k2P/vt1c5da/Jv7noprbmzhtWW2+qKNOsQbuhToyrcBM6L7ZFQM7pMkmceSPLdt4HlvnXK2PP/C/0X94bLsXzl4fzAs3uo6lZ5lPXNSGuagb1vQIVqwAtwvdexYXNTwhcbeDp22zfMzTaBZf0WNbdzP9Mf+HTc+jJGQLnv0fzgc/1pVaZJWlj9ibC+GRn4NatZalDEFEGAqBowk/KFPrrWtiv1u6yK54cdt2Py1t3K2MpHy224L3BzvrSX1OzFBp6oeu7+Nr6dLLD0vQx132HoH/+gf+TpbcABXlyMSLHSybN6qjYS8PnrWNNoDjMkAaRaAop3slbXsZ+7hbuVsRUPhYw0U06W0EpSOTmT392fOD1EUhB8lefV11TjvXPCLTZ/6bv5wf4XqWoBzzDTRSzxVhoEvLeXCZunYZbB4P/qQMhwPyho6r/TBv5YAHDHj3SZEyv3TQQmgzxye6J1xrTqXoojjOFhGFMCXEJel3s1N9x9fIBJCcMK98cR+HseZl06xRllz2gQ6KDjnsehUcCnnk7Ezy2Ip7omQyTQyvZNSrLMeNfMRKUGuD0aXbPq8zpm9zRgNA9j7a/zmT2vMU0Gs/PjfsD5Gf4q5x5LKJNy5a9YfOg1zGaCz66lal/ziQibV3/BV+HVU7SFRQfX6o654GAkCJVg5sG9zyUx/N8XMuvy10GkOAMUCCIYX+dU9TwTaYLKZo48y+QET9mOE/CLH2LnUuaKMCOC9LXpFdY+OfBtf1TS//F4+MDHDdyy4YpAbdgxiRC+YOw3e3KY/He+pskHhNvKnJEncSSgiXEWVxSoImOCDsbrSibsHJNZggqSlbItt+HVFR64P3zeetauZXFOSYcjAA+y2d7jT90KZEaQX7IqG+kDX+Y6pivvzZXKQZsKNxQTYkHldmYw2KlSIOhxEzbhoM31Te+WCe+kWRk4P2K/XMXTI7vLVHBZL5OyUzGbiOYrb2WuRzVPpSJoVzt+de6/Crh8OugNywePKVoy1NtrBYXrOYJksrC85pgHU+GV9l1VoO6oH8hDYnHKvRILNivsT6m8AlTZU/lOb3tHZ2eMEULK34C45CF2lsFQ9GeDlN2A4zPPAH56C9D3ZzVz7w/C703xha7nCfgnUJKAA7/4pFqkiZQoDqonCydK1ioPB23FG1mYwLmHYh/zX3LzB37zDa2p6y5LTAZwgBAyWKJwnhnMxTDDrewwqo1iryt5PEvnAbfNA55+QUn/16PptCJXV3pxLdPJGjpK5wvKxa8qVY6CXKRtxQvN1jU5bAs0//8sOHhFTbJUYX3TMiGla5zlwD/50damKy4W22VZHiWE7DMH2+kQfxP44ocwk/EQrl7VekYgyKY7fbjzcuDWHmA4A2P/UVU5PBDTRkejvQms2EZb1xQft5B7Ie5SuW2JFj2alpjbu8lDlr3tFNvkk3BnB5Gnd8bj7daWaZ6ZPEgI4a+DF4Ff+gibouaL37YKA6mmOj4nuX+aewbA1d4zvdRPrqxU60ihjRArTJXacnYYFKJV+x9holefNp137Ute9DVVcMFqJgsEswW9mIwPghkUxvuaGc/k6buFwlWHR/DemzWvW83OBX3x0yYT6vu1Pt+57ZyEIzuWIeh9UoMQ4jv5O8DfLhloq3ovDTQzYeaFege0UfdS1g4DPU/Bnv415amloKfQNCnzHmTtGnCO3w0yHbooIc8/URz42WGPOQxlecO0y3sZtW1XZ8P2u6y/BoggIaXR8gCKGhjIryIHwwD21iEXrWLnMYKUF7jIcGzHEhyu9GjUcrG32jnc1L68B7MYgeQ1Y+f9HV7oXxxd5eSCb7GZTHR/GcDCQsbx65RvFfDcc2v5PGZTHq96TGp3J1480EuCA1fPzZILVrNWZuDckt/5OzwEVBBwXNMRudFKb9RVf8Ha07MQlUNUKW20ygneQ4xAEIA2qpQvUhgGhpU15NVahONMmmcwA13exyZo4go6HmbiCvKGwrQRxiPyhRPkCPg0rEvIXXsp/ufxjxCjZuD8xL9fxaYaOrrrukGP21fWoQAfvFA/CEQDjzvXrJYjcuroFLk5DH+p1UMxTbUbCjcvqorpoBX2ati9qlnZQaA8o13tOmGejCDlhznu8KEy3rxrEg739lrfrqq1lIW/vYwJP/kOWomOJqr555TN3xOlySHmqlueNOL5NxSSd4GTgsdHC6zP796nUuB5FSoULs9AJQHZGQqG61G1e3D+Dy50RqLE9NSOAAAAAElFTkSuQmCC"},19150:function(V){"use strict";V.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABGCAYAAAA3mEEuAAAAAXNSR0IArs4c6QAAEaRJREFUeF7dnHuQHMV5wL+v57Fv3UvHoUMCvYUNBpMirsiOsMSpXEiOcABLgAAXkkicwoQ4xFUJdipWGYfghMTP2I4jYqPEIUiAFQEWyIV0Fc4KihzAkiPkQgJ0Euhxx2n3HvuYR3+pnt3Zm92d3Z2ZnQ0i84dutTvzdff36+/7ur/uHoSQL9q7WYZz+7oBzE6QIApIMpiEoRSjA4DikCT+H9ZlyxZ/mcQBmQ6mmQVFTsPa584hIoVVlJuccBQEAESEsH1FHyjKhQCGFHqlnYoKXXhJYD2wJhWAxYbx9l3j7So6FBC0ba0EkZF5wLGjXRWFdoHwY1UavY0bBk+3o40tg7AsYeeKBW2D4EdRQTXkpwxMHsf1T48GLarec62D+PeBPuB8dtgVq5DnR1HNKtKqLI4EBj+MGwbzzYry83tLIGjvchnScDkAhhsT2umG7GDfChAJ03jLnmN+FN3s3tZAPPWJCwD1Oc0KCfR7K4qqV2BYMoWcyxcdxKt/EJZEaBHEwGJAngqk6HYrq1q+rTJhEWGorxAdxo27RsJqe4sgVlwJCHJYlQlFQW6VCUPx1XKZchZv3X0irLYHBmGNlnZc+xuhVMQ5UQtbaWHLsxusYxrvDC9OBAch5g7K6IdDASGEtENh7ZBp11WiDN4xeDSs9r83IISCZKUAnAqA3ASTK8CkOHCThdUwS06YIKpHcu9rEKbI4RgjEIuN4OpdBafSafNmBosOdICSnwXAYy0BCRNA2RWV8ly27PctCBPy0EPHcEXjiVAxZzXQD0AX+oLRDuU7IVRXxqAM3vV+c03IcqB1/xrXbTe9KpfEjL3gc8YeNoxGE8v3HQjhjnqM15pZghsgenJgPpi8qym8sGfiXuYcPkDQtrUqnBuZAUoMoVeewjVPZ6vb1P5greNpXLfn7abKdLmBfroqAuOFy4A1WM8I2woauSNnHT2AsABMjfSDgT3WOopdV6QMzOh90+kh2gtCFJyM/qo6MPuBQtuWLwSok15vBwSvMhuAsBbH3tw3C8DoLXeiarkc0/jZ6XlIm0GwHK574bAfxVffS9tW9QLkL6743quy/BTs1725gLDWZSbSfUDUB3LVUNytzh0zD+O67TlRzfaBsBqGabyhtdkn/cuqGaDmF5XnBWFkT+sB8gPYAcIaes/fNxN0fRZIpZSPF7CcjuNnB621jfaCkHAUb9pz3E/HrLGIrZ9IQFS/NPQJmj3hCwrWoAxs2nsMtq7sBo79gKbqarUNk4zsJP7eC2fCB1HdC5g8jp/+2estgdi2sgN0c2FFsGtFYPWzfqygMlgXQLY2FERrquPFGqyHPIAgIrHYIyi7px1GRxkc+ovFDXUiqzos+0ZrCyhDX+uB7PFeX7rXswCZU/VzHJ4V5avU4s2+ZDcAQURxABCLPckA1Th/HhEwhvcCvLwFQM/U1iuoJbi10Fa+DcKzFuqAIKJZANCvT6WN9JkDWeP0QS2XHXHfzxMFEAmhvGZUxZmoi60Wa1bQTPeYVGvcdWUU5VSXWdny+Mx5UqznciV5ydIYZDMIQw8BjL4coMd61mjABKMLCCLqBoB5E28PTRze9ZmMmc5STiOERLEyTvMQ35e+Bvt38YGJ++tcwszA+mf6ymvc82Bh+tE45PU65VSlClM9V0qzV/5dp5rsVmDHnQDZ0DdfBARg66AKBBGJ2H6ZNnZU+8U//Xa5tqGBiE8z8KN8J7QiiOK/XkFYHahzLltw0096YfQQwu77fXRxj7e25OJqQfQBwOxX/u1Tp3In9xt2FQSIZLnrT1fMt0W0G0SDpLn4qXvpVxIzr7w5BTtuKwVxj0pudltLEITwWhDzdH2q48A3F7zjLDunELpF7DIIB6QEJMCyoKrL6ZJaswZhCTF3V9YEhDp3tTL3uq/3wNADAMf2NlNv4999jYqaFVULYtHkuWORg4987GzoIErOPQiEypDiPTY42yAYMbkLF971Uh/s/xbAkR3NtFP/91AhuFvEYm1yWPnF9z9SsT3Ej0UwLe7aW+NxMbLyHpRr44IdE6oifbW266gvdBDBMbo8WWsRLYAo+ie3EZNQXV6uhFCrzmJPjyq58jDZTtZbz5dHSHVA1HFLzq9bsginFYS1J6qMpN0gSsHZtoSiQmOYnDWXpWZ/VInGZzOMdzPKjvF89iQffWPIkLPD1uqdlYrMFVFEOxKUzzQ5W/F/ASJUK3AKazMIVrICAaAQ7WL9v/kn8RkLr42qidnOYyYVzdOmTuqFEz/Pnxl6MMuNvGUdFpSKDy4aaRcIL6t0QQGVZbcIouyGLK9U6ZpsCEyPYf/H/yjWeen6lBLv9LxNRs+mefrQ1snMf33bsouowsgViAcAtp4Cu6aWh6d1SLULhA1GQBBWgHIM+1dv6UhevCzwthht+MXciWfunpgy8+QKo10gQh8ZNUgEKiFahD1ackKYe/OOLrXrA5Gglms/p505pJ14cn2azDzVWEeDUVL1T74tot2WYFcwbBDCCgSIAkXY/Ou+l0ouWtlgrNkYjz7yuqn0Liqft5g8uit3ZvcfTpCJZRiNwoaboXgG0S5rqNfksEAwRYxoEhaEhBzDzsXrohdc+0BnUEvQDv1Y006+YiZXPVyhz5HB+zPjh58pkJqnbK4qbjgKq+cHm4JohwV4SY2HAiIh5g5xZBpHpsQwkeK48NbBHkhcFGibvn54h0kvPqTBkuuZuvyLFW5NT79lntj2yTEyGAk3xRVWMapqFojeUxCNIIcGQo5jUiu6pFlXb4r2Lv2zYKdKR18j7ak/0DVukHrZDUxd9oWaYe74f3x1fPTIY4WsUSBuYkUAP29BNHMNLYNQCC1rEC5Jj6EUMVnfmq0dyTkfDRagf7LJmDr9OimqyWHuJ5k68MUaENqJfYW3d941kTOQVKZxO3g3a6s163fLNbXDHYnC/MhtBYSVeS25paTMUaIIYxGVzd9wYCYo7vmmhso6vJNr+x42gSPpoIPStQTUtT+s3BFhNTBLpx/52FiWaZyMAongbbuoZjBqQPhRVjPh9u9BJoCtg0hAUiPUohGW5CZLphbIfXc8L1b4/F3ZDMATt+haPksgGcVc00XLmXrdX7rOwE88OpA2Jk8ZHCXuHNI2K7QCxKEWsq/1Cgo62vIMwmVhyJq8JRIgc5OJkZJckKXUvKVq7/VbmscHsVQZnzndnAPfNbVXHjet2CAh4dUbZeWqjXWD/fgzG8bHTr6q84LGs8p0rHhPQQSxBN/ziDogmFKMDymKMIkpUmretZGZq7/T+HTp8H7QX/gqKWv+BmHmpQDZDGjbPq0VrQFJvfR3Jbcg7VTyxHOfnxw7ulfjqHOOGvfqntpiEUGtwNmgVi1CgLDiQzTCEgVFkrs+qPauf2JG3Z753z8kePVHBJyRvmQNKtfcx+DwdlP7+Td14AZB/xWorvn7aOWrZ2qlTTx+y0R24jU9WxAgiu7JS5z4fw1CpghLRlQmaYaUSHXJvZv2ubomXSxNDj7ILYVzgygWIfXWnYr21MaCln6Hq1KEcO2jMaWjv+mOjvEffXw8nztnmlw2s6i/NyDCDPQtWURp6CqTyZKRCEuwlCRxJneufTyl9C6ssyvwKOnP/bFJ2XFuBeVF16H22rOm5ZKW3a+oS66vmx4vD0pGjvL0U7dPEudmtjDBs8i412Fs2SKGQlgqFRUStTWoIOoPRsMtWI3DVztAdCy7L6Z+6LbaYaddlew7pD15jwbGKNdMnUATI6QrMfmp7zebj1kSpl7eqpsHvpvLl0BwZJx7nE+EAqI6JhBl4O69x+AHK3rAlPoBeNPOVEOlJRAaoYgRRYvoZAkmWxYR61mkJG/+53hDP58+yief2JQnrltD1ei6x2JK5yUe1ip00B6/I5tJv2UIizD5pHmuNLHzFSNasQgXEPi54mFGa1v+RS/2gmbOAvT4ghghL6G+iXc9PyZkWH6ZiNzXrBuMmkSwlpkqSVpKiscliZkozxz4chQW/07DXJP+5l5j/GdfKkQW3ygnl3/B00xc5KHyQ3+dz1POzHHTNLlhBgrWQUDUiwlEGRuE3dPLB1U06gNqcmZcyMXor/De4jHnlkCIWbUYvgqriMkxGeM9cnLdY1FQOhoG3snBBwuRq+5UvQRoPTsKhe0b85Q9ZeSJm5wbVqCuC6K8nDftCFiqtJ0mCAghxg2GC4gykH/4fQWMty4Echzdqp6Bi7Mj90yfHQkMQswjBIjeiMqYJktMYXIUYxLr+5CSWP0dFZRGLtOZI24Qz3QdtJ/eo2kjBw0ibubINHOazk3VMEWaY6qU/CtLcIEgfvMNwsscoQGIMpBvrYoATvUDl7rL5zuEWgr0Lnx++TDiZm7fGwiEc2ZtFAypOzKDiTgRRSYhkyR14YCsXvMlBZTA60MitwT6nq8YheEhC4KwBnvEJAK168w6LBD1rMDZZzyAcLgsFc6OFSe8CXPK7e1nvkFYPUzMrDWyArawikREtYJ2lMUlFDCQSWr3AglXPqQoHWKnv88rcwr0PX9uFM4cMUUuxbYG0nTudEtWBtYork00unxZhNd5gg8QzeoXKEYUQUynwQWIJFdZXLgoJkkxlIogSGJAEsOrbpeUD98mebIOcbjkl1u59uoTJmCOa4bJiZtmnhmcuFKMDdV5pjpW4Gy8ZxBeIRRHODXB2ovC690T0CKKIMR2Sm0qwiQyLauIRxQrXlguSpEtEKo4rC7FES9ZypQ51zDoXYSgdCLEO6x8E+hp0keOgHLyJa6/8Z+kFbLWuoRmSJzQ4JZb0gyeswL0dJAur0eEAcLLsma1Bs8LEKUDLPbikOWeJEJJUyQBI6oqDLVpGOJNyMgIldJrjHWTsCaWy0i6poOCjItsLCErQhAwmM5FfokMpIrY4AGCp2DtxxLKjv98sAgnCHvNWhYhVGWMuGUZqCosyotWgcQZMBnFtFtjZP2tuIQiJCSNMwJTJ2EJeVayCK1oCTkFyV4Q8mMNDUF4GR3V8yXnjUVYI4DSBgIBQY9hwoYR4YyRwjokFZFkpnGTRSQF0RBuSuz8UEEFzcpyWJeEROJ9qjKjgqmTygyeN5FEcLYgGEikFFfl/EJoCiKoYzcwjfe2dpjfWbQdIxZOnTsZ++UjV1uHr+2r6YmhEgirsaUtNUwvWkZMJtRIYTEpgihmmZKCUUZYMDjWTKdlVgKhkwAApkZiwpYzC0QtWEKZszi+teH5C2DobwGOPOtvXbkeKIPO4L2DJ4NyrH7OBnEJgN6z7+E5FYKbnqFzgLDPQdiWgRJhXI5gQUAxOIr/g7AQYRVVF4mD4yajPORB9HoyNAuAsIRItSWIZz3GBruYzivWRy4Y+HIXPHs/wKn94YDIq2/ifcU8URiXDUK8E2n+G0NfGzn90tfLr1r2A8K2Cmvvqx6zVvBQJ0RhETKhOMErPguLsE7zlo705kulkbAKYQ0ChuWKxObjHEQDuiOncvpv2tKRnPVbMXj0Bmui2PKF4h1UXQf9vAisWZk2CPF3ia5PRV/9x4+c1rPvWlNvLyCqz87Ze2DFAZNYLA7CVVmfozFAnaM4nC0AOSsmer/o5YJJpAqAxUxsKPNpBbb86BU3Ri4e+Ksu2L8F4OV/baYPb7+TchY/F947X0WhZYUQkeijH9D1NB/e+8DYmYM/LgQB4TwlVPwcQ+tgvF7cKV6EUtleoWPR88W3zv5qAQjgiqxnYqXTpB+8MQWjxwCevTscl2SAAWP0P7h5sHz61hu9xndV9kwiobO51oFmfcqYfPe4TpQrJ6bcRKGmT8uosyxkDVt1x31h1LyuDBXUVK+kJi8UuS60gvPQ98JxSWJkN0P+NX5m91TYTagNnOItkwA9ACA2E9d/KUp1TfQpCbLjDdYivMya/C9yuSpEvHtjdBjg2G6A4dKrH1rVnLCEXOoN/NOdE62Kcu3QYQqlbWuTkDk3BxTTW9rVC5sgFQxbrkhbZ3rfwc3by1OfINVq9EzTnRNBCqSn18ThbL4TkEeBuAJiyGr5pyDSWnwmSJmKYgLpOkRiU5BMZnBd+wDYrftf5H4s7DrfhR4AAAAASUVORK5CYII="},55303:function(V){"use strict";V.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAFIpJREFUeF7VnHt0HNV9x3/33pnZl6SVJXltyw9kGyMjBztgNwk05diFHmJIk7QElYQmYBxIUx9oCOSc0D8a9eQP2rTp6Ukf5NGWJqchB7vlD5pwTpwmuAnBGGJjbPzCdg0SRpK1eqz2OXNn7u25Mzs7M7szOyN5ZZT5w5K1d+7M/dzffO/v97u/WQS/wccAH2rLlUudhJAOpKO4zoHJTKkgrE1vS70/uw8NGotteGix3VDY/QzxIfydfL5LQtIyGkNxmcq+p2CNGIYOl9b3wKUDaEgP6/dKff4bA3wrf1DOQk+PXjQyTEGShVkGoEGorBZIAyYxnI116eMn0ZB2pcAGXWfRA+/lQ0mlUsmoxOiSgSDBt2bTAdbtalGbEASEA7DpnpIxfrh3qPRegV+UwDnnaC38ZVpTS8s4xm1uOAI2pQKpv5T4wXbOt86REJnFenz8XPfDs1ca/KICvp0PSW+D1k01I2MgXXHDM0HXrDtcShqlxpkge9IULJclWRs/1f74FEKIXwn4iwJ4Hx+Ka1DOANBuThH2WKlbQgQRU7Pnat117c0nxD5kYIxTjvilvhOl7IEdC7vAvmfAhWysh690aMAyBrAOc/i1BbARaNRF0tuPA7XGtw6226oRR4wTyKIp+dK5DQ+rC2HxVxz4XXwv+QW80g0AGQw85gZh/e6F7RUC96TU46i2bPBaGnpoOrH2hGFCphO8e/zY8s8WWwn+igG/mn8zVoK3MkChh8tCNlyHB1IjcFO75+CR1C+S9ZMavOA2ShYBXIxRMn5szRdmWqHzCw78av5QRwWkjAE4HWgpAVJSWyjnBdv7tJjT2ESyHCnyXx8UXVE1DS59Zv2fZIcQYvO1+gUBLqLBb4HaDVDJIMDxpjcXsAh6hCAkuAnTbceV9NF0+08RF2OscgNJeKJ9Fb50GH0+8M6CxtxS4AN8SMlBKQOg9TAgJJIV1A3U6/5VrdR3WC5LDJGksAU5kufjuoa4MuKEc86mlkN87MDaXZVIYxXnRW3YrJ1IIuXV4jIds85Aj62+gyi6HSF09w/taz6NGSRZ0xbgSkax7DrYnngAAAhFOd7RMXYyM1gI4zlv4MKtWwV/3sVM/5kkwy7U8LnPQD3WHajbdZ5MmHWH6XbESW0IvHwMiBGpmAQYe63vvlzQAjtn4EKfvwfaUgraMgN4UAQSzr+ZlMzR6mwbdl/U1u1WW3fDtXzcUMyhwhJo7NTKzzZEsHMCvpI/3g2grmKApHCiTVo0te5mYXs0Tfcukk1sIsz7qcmRNRZLSnz6CzAQBFiVSuTi8c33TNs0IgNfwR+9CgB6Lgu0fdcBemoOpum6HxTcNMqMT7jjvfUoklUHvCGl0ETOahejAHGITb628e63hcxEAt7Hv9ipAlnfGtheOA1hTpgL2CSStHtunk2cXz4m2LLrJtsDyTEgrMgTJ9cPDkcC3ssf7eEAwsLnfzTxt2uPapj7V3tC6tXa9f9armSeXkndPQQ+KWGLcf0ahVHxeP+nT0cCfhe/i/wS1vQjgMS8iAfcnAdJRD31Xt8n79J0wRXWHaTp/nLlOJjeSfVbqD335roO4kTtbMfnD64eLEcCLjrayr8tj8L5dRwMz4ZApAlo4pGYj78cpN0uCLZfZl7QJ9/i0Vs/qOIajgftO3G+1l3XV5huu8aKOONxLI19vP/uMTsdEBm4uEHhe/fBI8s1CitAJtHObSIlNSsJ0+0GKWmE4GuJbqqtWCQ99xEuWYizd08NfGbUfRuh0ATkeiu+Hf5BeUMdWYVirDPYwiN4FE00uzacMIuqQWjm/oUsbPYgqvrvPAfR0gc1BnXGhZl88eSmwbGmwKuAlwFAFwiPpkXhfyTpaVEjMe5hmoP99DQ8WToCJTu+b+jfaxQ+K4JzRrNF0vyMawCK4r5EKHDOuVgU1wJAYqQwrb6dm9YuieoOsdZoavOnwdlKcCZc07znxKzEoU9ToPVt7V48Q4g2I104gTd0ZOQ1bW2xLC3BY7n9cIh6nmzvOtCg3dF0W2g0wiSrsdx4u7G0u8zZisjAOecietw0Q4vwxK9+Mfm9068E1HCkAFKNA+dSHdxqEy7RKnQn3cKJ/be6fux+VfF5sENU+yTEZ/pQ11rp7zbe2rkstUT+aPZpOE+zrgs2Sl5UjwRznUnAJ+QcGz+8zUrRXn/6h71zBb4OANIfefY/xl7PjdQqlbhaDzIAuGjnOxELCDyCwXe1daADv7N76QjkyGB2H1B7799l1bYD1Bw4AMFYZ1i5tOzC+Yn6zeb+0z/sRS4LF30ZQRrOORfP+qZnh89O7/nZf+bd42gEDgCpRrJmu4jARTte8bFyz/lJgIbJdu5sLgHBvf0fin2t/+auB7I/hhfosNWJy430XSRdbTg2vffxT6793ETQbo9t4c7kyWAw8F80OeciR3LV7p8+N/r8Oyc8inbZwIU8mCBdGdwq2AboCwQ8gWV05qOPLP+X0hH4q9yhhnxNkGUjQKqRTI59esWbU0NoqOm2mltS7P6aARdiv2L5t/72HRSjnoKYKwrcNmB7gppYuN00qqUf3rkn8ys6Qh7LvlB7TILCdgKkDJiNvbFq93TUjWMBXK9JitVzM+C9FGD5mqeeGKmXxdYBt3uuWnqQrIhmcwAumkeBfnDnnqVH6Zj0Z9n9ZpzqjTktQIyxYjuD0cPrP5+LsDx4mjiSUo2a5SsB3GOh1n94TVLmAVyc0iIrdwMX3bqtG2FplhXZ2JmNuz3r11ygOxbueD8GCdbwy7ZwC66zcHJVttxBty6L34sA9W5hqqrvLMC1dA+8HIGCn8XbwB/L7q/1oCMyk1QSY60o9rGAkxXufH7rgAuKdR6J44enYHWM4xWdK7EYuIG9buUFqrKp/Ky1TqQAWNWC13d04TRucwIlF7VT46OsHJM5lJ0q4yjg3XNz1CUpEpenukh+7ODqL821m8Dp9gMeJ3DxVb/QnnMeaOHuKzh6XqVtexumZafMOfjHm29L375yY3szQ3ynWNS+dPD53OuVd4xd/b8Ve6jvgx0pWQ4sqygBZY++/OPpn2cvUDf4udASwEd5wfiUcuTsOXR7pLrBG1/amyi00bh7iyxoXCZwjXgizRYCr142larJSFKV0Y5118j/dvPHMxGeepihReOZkTeK96++ocNMz4Ycpwrj6t2/3DtTMXQu7Bwxy5uKCv3ELXt6MqlUHiF0Iexa2y88FR9VyQrEWRdmaOLkpnurznvwmX7A5yUp/hbuBZ5KpSAhyeiBjZuTX7zuw0vCBjSfz4WVb9//3axqGNwNvZXAB07sVRgu9gKgbntVxWo48J1nn4+NVEr9iDOP5SgSeffwwJ2N6dm5S4oDPCnJiEsy6iYS2n3dDYkvbNi2UMD57/38+5NUV5kNvcxkDlCKZOXNLHw7f0GaunhxOS1rGY6wJ+EWBlxMEjGgHwBcaTbL8SRENhI5eubgTYM1uzA7nx/wFIiFUlh33OBYicXx7ms3xx96301NcuTzsW3rHAqUf+zAD6byOmY5VuCVqqULaYli5X7AhzjHz5z6zjKUUJYxA/msITJgVQ+UlK2//rZM5XQ/R9gvAVp1PpGmaKtOH962zYzgLxu4sPBERxp1KnF817oNiUcGbgyukp0/bxP4H7y4b6aMwcgLKy8K6DovzwO4yPlvOPdUDyHGCsSaLCBUBsz8gW9/4QVpIjNxDTb84i5bWazwilO19Mkb/uiMyMPMH7i5YMoomZbRkhjDaXkJ/tg16+KPrLeAf/fc65Xj+Xe5hDEiCHke011rrpcHOpfWasS/f+ENejz/LgPZ9VRSDQzO+eeuukG0JRSAD770TK6CuZEvzLI8xaxi5OcMfPPw0zM6La/ktZcBmm+VBQG/7tgPlgDIIsPqc3hjWcS52jW15PSBHTv0ywJuWrcko1gsjpfGEbl19UD8y9d+0Hx9JEcpLwLllHqzguJWlibTyD3MHC3BDPXmcOxR9FbbCuD3HNw3W6EVY1LX2KyuMk3DrMyqPn3I0/Prj+zpeZ1O4Icn/4eE14k7dxcEXFxuy9G9KxmG5d5Le63bMKiR6Vx6+sDaHWaFbUuApxOYtCud+NbVa2vAT85MGCNawXTdMBIT6wziA50Zkpad7OGxXJaPa4W6bBwFqgH8dqYPp2VZvJ/J7zny3GxFV43JwqwFXMKsXNDNhTPsqEWao07yyvflrIZ9yWANF9K05di+Po7kLic7YydbrSoBhcO5w9sGa7mZ1gLP9Ma//P6bTQv/1/PH1BOFUW7KiawA0XXzp6FTdP/qLdK16Z6azPz7W0eNs+ok0ygAkWQuSIvtJiJJfNeaTdJAypKU+w79Vz5HVaOsCR2fYdOGIVI1bO7Am204ez9rZuFinKK49dljAxs4gjZnAi3tRpyPHNvyh5fcxtAy4CmeJLes36B8ZcEWzVYBfzH4YagrpbB2bYIt3O5ILKBTXdMbOdKr3ooMksSyrw3c+Xb9xVoGXEjKTT3LY1+9Ybu5aJYo5TVddhsNpUjosvtGcpTCDC3V8vCyLPxr6+iVk+biKiz8/iPPzU6XCsyycJVNGwVeKei8PofvR9SRlADgLilxL3kGkydObhoMjTRF8DOsVjZipkuIQ+H1zXe96ZdLXzDg3zh5qPyWkWOMYiSKBwxKkRJTgAFG9/b2K1s6e2teypMXjtD/y2eZUZUTXZY4qNYe9q61W+XrOzOSreGleuCGzu0wv5mONwXuU6xk20hU4OLaAyf2tskUX7VkS/eZA2iH7zdYtBT4B3ozytfe97tm4DNBS+ySpjHk9lLMUciwQUkRd/4kS0v8YrHIZRksy3Zt8vWlOklSlk0LF4tm64E3ltnV7UtGsnB7ssVC2myXqKXAt3RnlK9vtYC3+vAAF8FPoSopl2PhATWPllnUtsnmBDxs3C0Gnla+vnXnggGveSmBwINfNTq4c5e5xfbYqEvDm0iJ7XEYDBYhcMCkPd2J+9vSyjdvWnjgRV1j+bzGcpLKRHjvaPgcgIdZd1XWDLJYgEMKRFgvIs30FQAu6gMfOPKT2RzRjKII7XWN5agN3PFqgh5py8InpcdE4NPUsi1BsdeR9xS4ezB2HuWKAj/xk9lSqchmtLIhgFOxXWda+FyBe4MbbzDubAKL8S4u4CKXknYsfH2yXf7nD9+xYPnw+1/5UUHVNSMIuFkhEHC8/IkHe0wLHxahvbcixVN5VVfYaWgwcXJbuB8etljan89p0Wyw8CpwK3mVJOk4kf5p2x2dS5NWsNLK4+jMhPE3bx0q5nRHUmwLj7IDYQIvCUnxBj4e9D716osKuNjp6Uk72cKkkiBrEt3yHX3rYjLCIo2CMIjUrAwi66zrlgUKH3xzeilKgiyyinCqNCGyirX5Eb9JEnChoww4n+Uq++n429pUKW+IXIq5aLo0fL7AfYVlMVu42PFJSp1oSZzhdHoJTsYSpB2w1NGmEFniJEaSGLBhklfMxJWOzIy3LMO6VBe6b+UA+fu3XjWmNLUWymtV8AZnXOTDxU8dY6NSKbE8BaNkFNi0Vjaojq3Q3tD5fIB7M9Ze3XaeTBkMjS4eSbGAOzs+3XEgCSVBYnKMtMsKQVjCiThCSDdwLWNoArc2GnpiMTRetL4PwMwSVg+NakCqwHXGuMoMljMoE/pd0jVWKGhs1nQJrQ1lE3hIvdvLt3klxaviQd80tMiAi0IU9yZEexyRNimNOxUgmEg4QSRs7fhgxJD4KSSluqsTA5CotQEiDpE5wa4cisFlrsuM67zCixWDM0NnJYMyW07Uos4ryvyAu0N38+I+2m0trBQWkYZbxT+iHoWnrV17RYnjdkXBkqTglGRgLMlYRhgJ6OI9E1kTwGNgYAt0rArfqcqxElZCj1RVBZ3LnMqM00qZU2ZwAVtIib2JjA2Zm3v2c7Rwy7qDZMQ2ARk4MmhPNv/mgR3Rvw8lzFG4DC/FAi6qsey6lFiM4TjuQLJi4A7chhimSMEYyZggoeTmMLEFXRzMtHjnwNySFRWsKaCmf10BAVtjBhewxU9RJiFAm3IS8bAl5XHbSwl5jZBTg/Z0db9pb41FvExoMxt4YH14UA9W2ZtVY2gGQULPUymIGQwzIqE4kVAikQBGNKRUYTMsIfGqBTPrDa0XrMS/jV+nUzH/hpnCK1AGEdiIv6hM59hQTNg16w4dotXg5dseXPpqaZL8hQm82Yu4FCQdymoMzp3cNNjy76q1gQe+AdEcuPP6iZAWAV9EnpxoKAlJENWwTJWQWNCSyWStcDNGnJdqjWqwQmIyF79romjTNQvlqmRgRVg1mKDFPUUr/7HuXkz+yZ0PLXs6exq+kT0SALxavGPIkxvO0pF9gwvzVdg2cOsdn7PHp/e8+KNINdKews5aUaeMxOs/TtlyChLErp61JsAEYMqK41ZwjQq/kbt/io9LZQCsON7LXCC7DeWPr9oce+K6W5b86fCL8GJp1HeRFFVSFOjwiU2DUxEfmnk1q2ko53w9Bej4xPP7Ro+Mnwv9ovPmlbT2vYhFta5m3JXQi4t3M5NJKEEJxBNhWa71NpC9Dy/CdRSTOcfVnzPUfGKiLJSivy7Sjv731k/1jFGdDA5Xa8PrvBJJIllcyr5rvwI4L5IRT3IDF8/UwLSm8a++9LOpfReONi3pbQDuMDZ/q31eqyN3Km3tP5m5j6QzA0zTEFYULn6638FyxmK1reVMQnzvGztXkb++/tbOVakl8uD5/XC+5H2ThEh4lpRiFw9v+/3wOouIQMOaebwEzrkYkXgTOT5cmKqcmZnRJqaLRnV9C+vL//OYeIu5/l1PVyleDECv+9xTqFf9j65hJCkKr2/rd9GueAL3JTrlq9u6YiWg8PjoIThUyppSYhAwMFMme9rSE632QKIAasiucc5F4sl+114MNzADF+UC71WbUVqC/blheDJ7HPJMrwBIeWIk83ded0fucr5Z83LH0xRm9YsOFg3wfQDov8f3x0fYZAJUSSrrREK6JiGZSFQHwiQwFGroZUwoJxLlpTJVtP6CXbl6ubBacf7/A7kxJfsyNujOAAAAAElFTkSuQmCC"},22214:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return N}});var A=S(58289),z=S(75538),D=S(85458);function N(T,k,R){return k=(0,A.Z)(k),(0,D.Z)(T,(0,z.Z)()?Reflect.construct(k,R||[],(0,A.Z)(T).constructor):k.apply(T,R))}},30168:function(V,Q){"use strict";var S={value:()=>{}};function A(){for(var k=0,R=arguments.length,C={},P;k<R;++k){if(!(P=arguments[k]+"")||P in C||/[\s.]/.test(P))throw new Error("illegal type: "+P);C[P]=[]}return new z(C)}function z(k){this._=k}function D(k,R){return k.trim().split(/^|\s+/).map(function(C){var P="",I=C.indexOf(".");if(I>=0&&(P=C.slice(I+1),C=C.slice(0,I)),C&&!R.hasOwnProperty(C))throw new Error("unknown type: "+C);return{type:C,name:P}})}z.prototype=A.prototype={constructor:z,on:function(k,R){var C=this._,P=D(k+"",C),I,L=-1,Z=P.length;if(arguments.length<2){for(;++L<Z;)if((I=(k=P[L]).type)&&(I=N(C[I],k.name)))return I;return}if(R!=null&&typeof R!="function")throw new Error("invalid callback: "+R);for(;++L<Z;)if(I=(k=P[L]).type)C[I]=T(C[I],k.name,R);else if(R==null)for(I in C)C[I]=T(C[I],k.name,null);return this},copy:function(){var k={},R=this._;for(var C in R)k[C]=R[C].slice();return new z(k)},call:function(k,R){if((I=arguments.length-2)>0)for(var C=new Array(I),P=0,I,L;P<I;++P)C[P]=arguments[P+2];if(!this._.hasOwnProperty(k))throw new Error("unknown type: "+k);for(L=this._[k],P=0,I=L.length;P<I;++P)L[P].value.apply(R,C)},apply:function(k,R,C){if(!this._.hasOwnProperty(k))throw new Error("unknown type: "+k);for(var P=this._[k],I=0,L=P.length;I<L;++I)P[I].value.apply(R,C)}};function N(k,R){for(var C=0,P=k.length,I;C<P;++C)if((I=k[C]).name===R)return I.value}function T(k,R,C){for(var P=0,I=k.length;P<I;++P)if(k[P].name===R){k[P]=S,k=k.slice(0,P).concat(k.slice(P+1));break}return C!=null&&k.push({name:R,value:C}),k}Q.Z=A},12713:function(V,Q,S){"use strict";S.d(Q,{H:function(){return D},Z:function(){return A}});function A(N){const T=+this._x.call(null,N),k=+this._y.call(null,N),R=+this._z.call(null,N);return z(this.cover(T,k,R),T,k,R,N)}function z(N,T,k,R,C){if(isNaN(T)||isNaN(k)||isNaN(R))return N;var P,I=N._root,L={data:C},Z=N._x0,Y=N._y0,X=N._z0,nt=N._x1,tt=N._y1,q=N._z1,it,at,ct,ut,bt,gt,wt,vt,Et,Pt,zt;if(!I)return N._root=L,N;for(;I.length;)if((wt=T>=(it=(Z+nt)/2))?Z=it:nt=it,(vt=k>=(at=(Y+tt)/2))?Y=at:tt=at,(Et=R>=(ct=(X+q)/2))?X=ct:q=ct,P=I,!(I=I[Pt=Et<<2|vt<<1|wt]))return P[Pt]=L,N;if(ut=+N._x.call(null,I.data),bt=+N._y.call(null,I.data),gt=+N._z.call(null,I.data),T===ut&&k===bt&&R===gt)return L.next=I,P?P[Pt]=L:N._root=L,N;do P=P?P[Pt]=new Array(8):N._root=new Array(8),(wt=T>=(it=(Z+nt)/2))?Z=it:nt=it,(vt=k>=(at=(Y+tt)/2))?Y=at:tt=at,(Et=R>=(ct=(X+q)/2))?X=ct:q=ct;while((Pt=Et<<2|vt<<1|wt)===(zt=(gt>=ct)<<2|(bt>=at)<<1|ut>=it));return P[zt]=I,P[Pt]=L,N}function D(N){Array.isArray(N)||(N=Array.from(N));const T=N.length,k=new Float64Array(T),R=new Float64Array(T),C=new Float64Array(T);let P=1/0,I=1/0,L=1/0,Z=-1/0,Y=-1/0,X=-1/0;for(let nt=0,tt,q,it,at;nt<T;++nt)isNaN(q=+this._x.call(null,tt=N[nt]))||isNaN(it=+this._y.call(null,tt))||isNaN(at=+this._z.call(null,tt))||(k[nt]=q,R[nt]=it,C[nt]=at,q<P&&(P=q),q>Z&&(Z=q),it<I&&(I=it),it>Y&&(Y=it),at<L&&(L=at),at>X&&(X=at));if(P>Z||I>Y||L>X)return this;this.cover(P,I,L).cover(Z,Y,X);for(let nt=0;nt<T;++nt)z(this,k[nt],R[nt],C[nt],N[nt]);return this}},17646:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(z,D,N){if(isNaN(z=+z)||isNaN(D=+D)||isNaN(N=+N))return this;var T=this._x0,k=this._y0,R=this._z0,C=this._x1,P=this._y1,I=this._z1;if(isNaN(T))C=(T=Math.floor(z))+1,P=(k=Math.floor(D))+1,I=(R=Math.floor(N))+1;else{for(var L=C-T||1,Z=this._root,Y,X;T>z||z>=C||k>D||D>=P||R>N||N>=I;)switch(X=(N<R)<<2|(D<k)<<1|z<T,Y=new Array(8),Y[X]=Z,Z=Y,L*=2,X){case 0:C=T+L,P=k+L,I=R+L;break;case 1:T=C-L,P=k+L,I=R+L;break;case 2:C=T+L,k=P-L,I=R+L;break;case 3:T=C-L,k=P-L,I=R+L;break;case 4:C=T+L,P=k+L,R=I-L;break;case 5:T=C-L,P=k+L,R=I-L;break;case 6:C=T+L,k=P-L,R=I-L;break;case 7:T=C-L,k=P-L,R=I-L;break}this._root&&this._root.length&&(this._root=Z)}return this._x0=T,this._y0=k,this._z0=R,this._x1=C,this._y1=P,this._z1=I,this}},39894:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var z=[];return this.visit(function(D){if(!D.length)do z.push(D.data);while(D=D.next)}),z}},56033:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(z){return arguments.length?this.cover(+z[0][0],+z[0][1],+z[0][2]).cover(+z[1][0],+z[1][1],+z[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}},77480:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z}});var A=S(26805);function z(D,N,T,k){var R,C=this._x0,P=this._y0,I=this._z0,L,Z,Y,X,nt,tt,q=this._x1,it=this._y1,at=this._z1,ct=[],ut=this._root,bt,gt;for(ut&&ct.push(new A.Z(ut,C,P,I,q,it,at)),k==null?k=1/0:(C=D-k,P=N-k,I=T-k,q=D+k,it=N+k,at=T+k,k*=k);bt=ct.pop();)if(!(!(ut=bt.node)||(L=bt.x0)>q||(Z=bt.y0)>it||(Y=bt.z0)>at||(X=bt.x1)<C||(nt=bt.y1)<P||(tt=bt.z1)<I))if(ut.length){var wt=(L+X)/2,vt=(Z+nt)/2,Et=(Y+tt)/2;ct.push(new A.Z(ut[7],wt,vt,Et,X,nt,tt),new A.Z(ut[6],L,vt,Et,wt,nt,tt),new A.Z(ut[5],wt,Z,Et,X,vt,tt),new A.Z(ut[4],L,Z,Et,wt,vt,tt),new A.Z(ut[3],wt,vt,Y,X,nt,Et),new A.Z(ut[2],L,vt,Y,wt,nt,Et),new A.Z(ut[1],wt,Z,Y,X,vt,Et),new A.Z(ut[0],L,Z,Y,wt,vt,Et)),(gt=(T>=Et)<<2|(N>=vt)<<1|D>=wt)&&(bt=ct[ct.length-1],ct[ct.length-1]=ct[ct.length-1-gt],ct[ct.length-1-gt]=bt)}else{var Pt=D-+this._x.call(null,ut.data),zt=N-+this._y.call(null,ut.data),Vt=T-+this._z.call(null,ut.data),Qt=Pt*Pt+zt*zt+Vt*Vt;if(Qt<k){var Ee=Math.sqrt(k=Qt);C=D-Ee,P=N-Ee,I=T-Ee,q=D+Ee,it=N+Ee,at=T+Ee,R=ut.data}}return R}},72096:function(V,Q,S){"use strict";S.d(Q,{r:function(){return z}});const A=(D,N,T,k,R,C)=>Math.sqrt(as(D-k,2)+as(N-R,2)+as(T-C,2));function z(D,N,T,k){const R=[],C=D-k,P=N-k,I=T-k,L=D+k,Z=N+k,Y=T+k;return this.visit((X,nt,tt,q,it,at,ct)=>{if(!X.length)do{const ut=X.data;A(D,N,T,this._x(ut),this._y(ut),this._z(ut))<=k&&R.push(ut)}while(X=X.next);return nt>L||tt>Z||q>Y||it<C||at<P||ct<I}),R}},26805:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(z,D,N,T,k,R,C){this.node=z,this.x0=D,this.y0=N,this.z0=T,this.x1=k,this.y1=R,this.z1=C}},7695:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return nt}});var A=S(12713),z=S(17646),D=S(39894),N=S(56033),T=S(77480),k=S(72096),R=S(36989),C=S(10325),P=S(15902),I=S(12027),L=S(66612),Z=S(14763),Y=S(94009),X=S(68889);function nt(at,ct,ut,bt){var gt=new tt(ct==null?Z.P:ct,ut==null?Y.q:ut,bt==null?X.i:bt,NaN,NaN,NaN,NaN,NaN,NaN);return at==null?gt:gt.addAll(at)}function tt(at,ct,ut,bt,gt,wt,vt,Et,Pt){this._x=at,this._y=ct,this._z=ut,this._x0=bt,this._y0=gt,this._z0=wt,this._x1=vt,this._y1=Et,this._z1=Pt,this._root=void 0}function q(at){for(var ct={data:at.data},ut=ct;at=at.next;)ut=ut.next={data:at.data};return ct}var it=nt.prototype=tt.prototype;it.copy=function(){var at=new tt(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),ct=this._root,ut,bt;if(!ct)return at;if(!ct.length)return at._root=q(ct),at;for(ut=[{source:ct,target:at._root=new Array(8)}];ct=ut.pop();)for(var gt=0;gt<8;++gt)(bt=ct.source[gt])&&(bt.length?ut.push({source:bt,target:ct.target[gt]=new Array(8)}):ct.target[gt]=q(bt));return at},it.add=A.Z,it.addAll=A.H,it.cover=z.Z,it.data=D.Z,it.extent=N.Z,it.find=T.Z,it.findAllWithinRadius=k.r,it.remove=R.Z,it.removeAll=R.x,it.root=C.Z,it.size=P.Z,it.visit=I.Z,it.visitAfter=L.Z,it.x=Z.Z,it.y=Y.Z,it.z=X.Z},36989:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return z}});function A(D){if(isNaN(nt=+this._x.call(null,D))||isNaN(tt=+this._y.call(null,D))||isNaN(q=+this._z.call(null,D)))return this;var N,T=this._root,k,R,C,P=this._x0,I=this._y0,L=this._z0,Z=this._x1,Y=this._y1,X=this._z1,nt,tt,q,it,at,ct,ut,bt,gt,wt,vt;if(!T)return this;if(T.length)for(;;){if((ut=nt>=(it=(P+Z)/2))?P=it:Z=it,(bt=tt>=(at=(I+Y)/2))?I=at:Y=at,(gt=q>=(ct=(L+X)/2))?L=ct:X=ct,N=T,!(T=T[wt=gt<<2|bt<<1|ut]))return this;if(!T.length)break;(N[wt+1&7]||N[wt+2&7]||N[wt+3&7]||N[wt+4&7]||N[wt+5&7]||N[wt+6&7]||N[wt+7&7])&&(k=N,vt=wt)}for(;T.data!==D;)if(R=T,!(T=T.next))return this;return(C=T.next)&&delete T.next,R?(C?R.next=C:delete R.next,this):N?(C?N[wt]=C:delete N[wt],(T=N[0]||N[1]||N[2]||N[3]||N[4]||N[5]||N[6]||N[7])&&T===(N[7]||N[6]||N[5]||N[4]||N[3]||N[2]||N[1]||N[0])&&!T.length&&(k?k[vt]=T:this._root=T),this):(this._root=C,this)}function z(D){for(var N=0,T=D.length;N<T;++N)this.remove(D[N]);return this}},10325:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},15902:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var z=0;return this.visit(function(D){if(!D.length)do++z;while(D=D.next)}),z}},12027:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z}});var A=S(26805);function z(D){var N=[],T,k=this._root,R,C,P,I,L,Z,Y;for(k&&N.push(new A.Z(k,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));T=N.pop();)if(!D(k=T.node,C=T.x0,P=T.y0,I=T.z0,L=T.x1,Z=T.y1,Y=T.z1)&&k.length){var X=(C+L)/2,nt=(P+Z)/2,tt=(I+Y)/2;(R=k[7])&&N.push(new A.Z(R,X,nt,tt,L,Z,Y)),(R=k[6])&&N.push(new A.Z(R,C,nt,tt,X,Z,Y)),(R=k[5])&&N.push(new A.Z(R,X,P,tt,L,nt,Y)),(R=k[4])&&N.push(new A.Z(R,C,P,tt,X,nt,Y)),(R=k[3])&&N.push(new A.Z(R,X,nt,I,L,Z,tt)),(R=k[2])&&N.push(new A.Z(R,C,nt,I,X,Z,tt)),(R=k[1])&&N.push(new A.Z(R,X,P,I,L,nt,tt)),(R=k[0])&&N.push(new A.Z(R,C,P,I,X,nt,tt))}return this}},66612:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z}});var A=S(26805);function z(D){var N=[],T=[],k;for(this._root&&N.push(new A.Z(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));k=N.pop();){var R=k.node;if(R.length){var C,P=k.x0,I=k.y0,L=k.z0,Z=k.x1,Y=k.y1,X=k.z1,nt=(P+Z)/2,tt=(I+Y)/2,q=(L+X)/2;(C=R[0])&&N.push(new A.Z(C,P,I,L,nt,tt,q)),(C=R[1])&&N.push(new A.Z(C,nt,I,L,Z,tt,q)),(C=R[2])&&N.push(new A.Z(C,P,tt,L,nt,Y,q)),(C=R[3])&&N.push(new A.Z(C,nt,tt,L,Z,Y,q)),(C=R[4])&&N.push(new A.Z(C,P,I,q,nt,tt,X)),(C=R[5])&&N.push(new A.Z(C,nt,I,q,Z,tt,X)),(C=R[6])&&N.push(new A.Z(C,P,tt,q,nt,Y,X)),(C=R[7])&&N.push(new A.Z(C,nt,tt,q,Z,Y,X))}T.push(k)}for(;k=T.pop();)D(k.node,k.x0,k.y0,k.z0,k.x1,k.y1,k.z1);return this}},14763:function(V,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return z}});function A(D){return D[0]}function z(D){return arguments.length?(this._x=D,this):this._x}},94009:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z},q:function(){return A}});function A(D){return D[1]}function z(D){return arguments.length?(this._y=D,this):this._y}},68889:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z},i:function(){return A}});function A(D){return D[2]}function z(D){return arguments.length?(this._z=D,this):this._z}},60272:function(V,Q,S){"use strict";S.d(Q,{H:function(){return D},Z:function(){return A}});function A(N){const T=+this._x.call(null,N),k=+this._y.call(null,N);return z(this.cover(T,k),T,k,N)}function z(N,T,k,R){if(isNaN(T)||isNaN(k))return N;var C,P=N._root,I={data:R},L=N._x0,Z=N._y0,Y=N._x1,X=N._y1,nt,tt,q,it,at,ct,ut,bt;if(!P)return N._root=I,N;for(;P.length;)if((at=T>=(nt=(L+Y)/2))?L=nt:Y=nt,(ct=k>=(tt=(Z+X)/2))?Z=tt:X=tt,C=P,!(P=P[ut=ct<<1|at]))return C[ut]=I,N;if(q=+N._x.call(null,P.data),it=+N._y.call(null,P.data),T===q&&k===it)return I.next=P,C?C[ut]=I:N._root=I,N;do C=C?C[ut]=new Array(4):N._root=new Array(4),(at=T>=(nt=(L+Y)/2))?L=nt:Y=nt,(ct=k>=(tt=(Z+X)/2))?Z=tt:X=tt;while((ut=ct<<1|at)===(bt=(it>=tt)<<1|q>=nt));return C[bt]=P,C[ut]=I,N}function D(N){var T,k,R=N.length,C,P,I=new Array(R),L=new Array(R),Z=1/0,Y=1/0,X=-1/0,nt=-1/0;for(k=0;k<R;++k)isNaN(C=+this._x.call(null,T=N[k]))||isNaN(P=+this._y.call(null,T))||(I[k]=C,L[k]=P,C<Z&&(Z=C),C>X&&(X=C),P<Y&&(Y=P),P>nt&&(nt=P));if(Z>X||Y>nt)return this;for(this.cover(Z,Y).cover(X,nt),k=0;k<R;++k)z(this,I[k],L[k],N[k]);return this}},51097:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(z,D){if(isNaN(z=+z)||isNaN(D=+D))return this;var N=this._x0,T=this._y0,k=this._x1,R=this._y1;if(isNaN(N))k=(N=Math.floor(z))+1,R=(T=Math.floor(D))+1;else{for(var C=k-N||1,P=this._root,I,L;N>z||z>=k||T>D||D>=R;)switch(L=(D<T)<<1|z<N,I=new Array(4),I[L]=P,P=I,C*=2,L){case 0:k=N+C,R=T+C;break;case 1:N=k-C,R=T+C;break;case 2:k=N+C,T=R-C;break;case 3:N=k-C,T=R-C;break}this._root&&this._root.length&&(this._root=P)}return this._x0=N,this._y0=T,this._x1=k,this._y1=R,this}},58007:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var z=[];return this.visit(function(D){if(!D.length)do z.push(D.data);while(D=D.next)}),z}},12070:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(z){return arguments.length?this.cover(+z[0][0],+z[0][1]).cover(+z[1][0],+z[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}},47064:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z}});var A=S(44213);function z(D,N,T){var k,R=this._x0,C=this._y0,P,I,L,Z,Y=this._x1,X=this._y1,nt=[],tt=this._root,q,it;for(tt&&nt.push(new A.Z(tt,R,C,Y,X)),T==null?T=1/0:(R=D-T,C=N-T,Y=D+T,X=N+T,T*=T);q=nt.pop();)if(!(!(tt=q.node)||(P=q.x0)>Y||(I=q.y0)>X||(L=q.x1)<R||(Z=q.y1)<C))if(tt.length){var at=(P+L)/2,ct=(I+Z)/2;nt.push(new A.Z(tt[3],at,ct,L,Z),new A.Z(tt[2],P,ct,at,Z),new A.Z(tt[1],at,I,L,ct),new A.Z(tt[0],P,I,at,ct)),(it=(N>=ct)<<1|D>=at)&&(q=nt[nt.length-1],nt[nt.length-1]=nt[nt.length-1-it],nt[nt.length-1-it]=q)}else{var ut=D-+this._x.call(null,tt.data),bt=N-+this._y.call(null,tt.data),gt=ut*ut+bt*bt;if(gt<T){var wt=Math.sqrt(T=gt);R=D-wt,C=N-wt,Y=D+wt,X=N+wt,k=tt.data}}return k}},44213:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(z,D,N,T,k){this.node=z,this.x0=D,this.y0=N,this.x1=T,this.y1=k}},14301:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return Y}});var A=S(60272),z=S(51097),D=S(58007),N=S(12070),T=S(47064),k=S(88866),R=S(10864),C=S(68984),P=S(3715),I=S(73607),L=S(56570),Z=S(30992);function Y(q,it,at){var ct=new X(it==null?L.P:it,at==null?Z.q:at,NaN,NaN,NaN,NaN);return q==null?ct:ct.addAll(q)}function X(q,it,at,ct,ut,bt){this._x=q,this._y=it,this._x0=at,this._y0=ct,this._x1=ut,this._y1=bt,this._root=void 0}function nt(q){for(var it={data:q.data},at=it;q=q.next;)at=at.next={data:q.data};return it}var tt=Y.prototype=X.prototype;tt.copy=function(){var q=new X(this._x,this._y,this._x0,this._y0,this._x1,this._y1),it=this._root,at,ct;if(!it)return q;if(!it.length)return q._root=nt(it),q;for(at=[{source:it,target:q._root=new Array(4)}];it=at.pop();)for(var ut=0;ut<4;++ut)(ct=it.source[ut])&&(ct.length?at.push({source:ct,target:it.target[ut]=new Array(4)}):it.target[ut]=nt(ct));return q},tt.add=A.Z,tt.addAll=A.H,tt.cover=z.Z,tt.data=D.Z,tt.extent=N.Z,tt.find=T.Z,tt.remove=k.Z,tt.removeAll=k.x,tt.root=R.Z,tt.size=C.Z,tt.visit=P.Z,tt.visitAfter=I.Z,tt.x=L.Z,tt.y=Z.Z},88866:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return z}});function A(D){if(isNaN(Y=+this._x.call(null,D))||isNaN(X=+this._y.call(null,D)))return this;var N,T=this._root,k,R,C,P=this._x0,I=this._y0,L=this._x1,Z=this._y1,Y,X,nt,tt,q,it,at,ct;if(!T)return this;if(T.length)for(;;){if((q=Y>=(nt=(P+L)/2))?P=nt:L=nt,(it=X>=(tt=(I+Z)/2))?I=tt:Z=tt,N=T,!(T=T[at=it<<1|q]))return this;if(!T.length)break;(N[at+1&3]||N[at+2&3]||N[at+3&3])&&(k=N,ct=at)}for(;T.data!==D;)if(R=T,!(T=T.next))return this;return(C=T.next)&&delete T.next,R?(C?R.next=C:delete R.next,this):N?(C?N[at]=C:delete N[at],(T=N[0]||N[1]||N[2]||N[3])&&T===(N[3]||N[2]||N[1]||N[0])&&!T.length&&(k?k[ct]=T:this._root=T),this):(this._root=C,this)}function z(D){for(var N=0,T=D.length;N<T;++N)this.remove(D[N]);return this}},10864:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},68984:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var z=0;return this.visit(function(D){if(!D.length)do++z;while(D=D.next)}),z}},3715:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z}});var A=S(44213);function z(D){var N=[],T,k=this._root,R,C,P,I,L;for(k&&N.push(new A.Z(k,this._x0,this._y0,this._x1,this._y1));T=N.pop();)if(!D(k=T.node,C=T.x0,P=T.y0,I=T.x1,L=T.y1)&&k.length){var Z=(C+I)/2,Y=(P+L)/2;(R=k[3])&&N.push(new A.Z(R,Z,Y,I,L)),(R=k[2])&&N.push(new A.Z(R,C,Y,Z,L)),(R=k[1])&&N.push(new A.Z(R,Z,P,I,Y)),(R=k[0])&&N.push(new A.Z(R,C,P,Z,Y))}return this}},73607:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z}});var A=S(44213);function z(D){var N=[],T=[],k;for(this._root&&N.push(new A.Z(this._root,this._x0,this._y0,this._x1,this._y1));k=N.pop();){var R=k.node;if(R.length){var C,P=k.x0,I=k.y0,L=k.x1,Z=k.y1,Y=(P+L)/2,X=(I+Z)/2;(C=R[0])&&N.push(new A.Z(C,P,I,Y,X)),(C=R[1])&&N.push(new A.Z(C,Y,I,L,X)),(C=R[2])&&N.push(new A.Z(C,P,X,Y,Z)),(C=R[3])&&N.push(new A.Z(C,Y,X,L,Z))}T.push(k)}for(;k=T.pop();)D(k.node,k.x0,k.y0,k.x1,k.y1);return this}},56570:function(V,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return z}});function A(D){return D[0]}function z(D){return arguments.length?(this._x=D,this):this._x}},30992:function(V,Q,S){"use strict";S.d(Q,{Z:function(){return z},q:function(){return A}});function A(D){return D[1]}function z(D){return arguments.length?(this._y=D,this):this._y}},83833:function(V,Q,S){"use strict";S.d(Q,{HT:function(){return nt}});var A=0,z=0,D=0,N=1e3,T,k,R=0,C=0,P=0,I=typeof performance=="object"&&performance.now?performance:Date,L=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(ut){setTimeout(ut,17)};function Z(){return C||(L(Y),C=I.now()+P)}function Y(){C=0}function X(){this._call=this._time=this._next=null}X.prototype=nt.prototype={constructor:X,restart:function(ut,bt,gt){if(typeof ut!="function")throw new TypeError("callback is not a function");gt=(gt==null?Z():+gt)+(bt==null?0:+bt),!this._next&&k!==this&&(k?k._next=this:T=this,k=this),this._call=ut,this._time=gt,ct()},stop:function(){this._call&&(this._call=null,this._time=1/0,ct())}};function nt(ut,bt,gt){var wt=new X;return wt.restart(ut,bt,gt),wt}function tt(){Z(),++A;for(var ut=T,bt;ut;)(bt=C-ut._time)>=0&&ut._call.call(void 0,bt),ut=ut._next;--A}function q(){C=(R=I.now())+P,A=z=0;try{tt()}finally{A=0,at(),C=0}}function it(){var ut=I.now(),bt=ut-R;bt>N&&(P-=bt,R=ut)}function at(){for(var ut,bt=T,gt,wt=1/0;bt;)bt._call?(wt>bt._time&&(wt=bt._time),ut=bt,bt=bt._next):(gt=bt._next,bt._next=null,bt=ut?ut._next=gt:T=gt);k=ut,ct(wt)}function ct(ut){if(!A){z&&(z=clearTimeout(z));var bt=ut-C;bt>24?(ut<1/0&&(z=setTimeout(q,ut-I.now()-P)),D&&(D=clearInterval(D))):(D||(R=I.now(),D=setInterval(it,N)),A=1,L(q))}}},80813:function(V,Q,S){"use strict";S.d(Q,{CR:function(){return q},Jh:function(){return Y},Q_:function(){return Qt},XA:function(){return tt},ZT:function(){return z},_T:function(){return N},ev:function(){return ct},mG:function(){return Z},pi:function(){return D},pr:function(){return at}});var A=function(Rt,Dt){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(It,dt){It.__proto__=dt}||function(It,dt){for(var St in dt)Object.prototype.hasOwnProperty.call(dt,St)&&(It[St]=dt[St])},A(Rt,Dt)};function z(Rt,Dt){if(typeof Dt!="function"&&Dt!==null)throw new TypeError("Class extends value "+String(Dt)+" is not a constructor or null");A(Rt,Dt);function It(){this.constructor=Rt}Rt.prototype=Dt===null?Object.create(Dt):(It.prototype=Dt.prototype,new It)}var D=function(){return D=Object.assign||function(Dt){for(var It,dt=1,St=arguments.length;dt<St;dt++){It=arguments[dt];for(var Ot in It)Object.prototype.hasOwnProperty.call(It,Ot)&&(Dt[Ot]=It[Ot])}return Dt},D.apply(this,arguments)};function N(Rt,Dt){var It={};for(var dt in Rt)Object.prototype.hasOwnProperty.call(Rt,dt)&&Dt.indexOf(dt)<0&&(It[dt]=Rt[dt]);if(Rt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var St=0,dt=Object.getOwnPropertySymbols(Rt);St<dt.length;St++)Dt.indexOf(dt[St])<0&&Object.prototype.propertyIsEnumerable.call(Rt,dt[St])&&(It[dt[St]]=Rt[dt[St]]);return It}function T(Rt,Dt,It,dt){var St=arguments.length,Ot=St<3?Dt:dt===null?dt=Object.getOwnPropertyDescriptor(Dt,It):dt,Gt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ot=Reflect.decorate(Rt,Dt,It,dt);else for(var se=Rt.length-1;se>=0;se--)(Gt=Rt[se])&&(Ot=(St<3?Gt(Ot):St>3?Gt(Dt,It,Ot):Gt(Dt,It))||Ot);return St>3&&Ot&&Object.defineProperty(Dt,It,Ot),Ot}function k(Rt,Dt){return function(It,dt){Dt(It,dt,Rt)}}function R(Rt,Dt,It,dt,St,Ot){function Gt(ur){if(ur!==void 0&&typeof ur!="function")throw new TypeError("Function expected");return ur}for(var se=dt.kind,be=se==="getter"?"get":se==="setter"?"set":"value",de=!Dt&&Rt?dt.static?Rt:Rt.prototype:null,Le=Dt||(de?Object.getOwnPropertyDescriptor(de,dt.name):{}),Mn,Nn=!1,ke=It.length-1;ke>=0;ke--){var Se={};for(var re in dt)Se[re]=re==="access"?{}:dt[re];for(var re in dt.access)Se.access[re]=dt.access[re];Se.addInitializer=function(ur){if(Nn)throw new TypeError("Cannot add initializers after decoration has completed");Ot.push(Gt(ur||null))};var Oe=(0,It[ke])(se==="accessor"?{get:Le.get,set:Le.set}:Le[be],Se);if(se==="accessor"){if(Oe===void 0)continue;if(Oe===null||typeof Oe!="object")throw new TypeError("Object expected");(Mn=Gt(Oe.get))&&(Le.get=Mn),(Mn=Gt(Oe.set))&&(Le.set=Mn),(Mn=Gt(Oe.init))&&St.unshift(Mn)}else(Mn=Gt(Oe))&&(se==="field"?St.unshift(Mn):Le[be]=Mn)}de&&Object.defineProperty(de,dt.name,Le),Nn=!0}function C(Rt,Dt,It){for(var dt=arguments.length>2,St=0;St<Dt.length;St++)It=dt?Dt[St].call(Rt,It):Dt[St].call(Rt);return dt?It:void 0}function P(Rt){return typeof Rt=="symbol"?Rt:"".concat(Rt)}function I(Rt,Dt,It){return typeof Dt=="symbol"&&(Dt=Dt.description?"[".concat(Dt.description,"]"):""),Object.defineProperty(Rt,"name",{configurable:!0,value:It?"".concat(It," ",Dt):Dt})}function L(Rt,Dt){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Rt,Dt)}function Z(Rt,Dt,It,dt){function St(Ot){return Ot instanceof It?Ot:new It(function(Gt){Gt(Ot)})}return new(It||(It=Promise))(function(Ot,Gt){function se(Le){try{de(dt.next(Le))}catch(Mn){Gt(Mn)}}function be(Le){try{de(dt.throw(Le))}catch(Mn){Gt(Mn)}}function de(Le){Le.done?Ot(Le.value):St(Le.value).then(se,be)}de((dt=dt.apply(Rt,Dt||[])).next())})}function Y(Rt,Dt){var It={label:0,sent:function(){if(Ot[0]&1)throw Ot[1];return Ot[1]},trys:[],ops:[]},dt,St,Ot,Gt=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return Gt.next=se(0),Gt.throw=se(1),Gt.return=se(2),typeof Symbol=="function"&&(Gt[Symbol.iterator]=function(){return this}),Gt;function se(de){return function(Le){return be([de,Le])}}function be(de){if(dt)throw new TypeError("Generator is already executing.");for(;Gt&&(Gt=0,de[0]&&(It=0)),It;)try{if(dt=1,St&&(Ot=de[0]&2?St.return:de[0]?St.throw||((Ot=St.return)&&Ot.call(St),0):St.next)&&!(Ot=Ot.call(St,de[1])).done)return Ot;switch(St=0,Ot&&(de=[de[0]&2,Ot.value]),de[0]){case 0:case 1:Ot=de;break;case 4:return It.label++,{value:de[1],done:!1};case 5:It.label++,St=de[1],de=[0];continue;case 7:de=It.ops.pop(),It.trys.pop();continue;default:if(Ot=It.trys,!(Ot=Ot.length>0&&Ot[Ot.length-1])&&(de[0]===6||de[0]===2)){It=0;continue}if(de[0]===3&&(!Ot||de[1]>Ot[0]&&de[1]<Ot[3])){It.label=de[1];break}if(de[0]===6&&It.label<Ot[1]){It.label=Ot[1],Ot=de;break}if(Ot&&It.label<Ot[2]){It.label=Ot[2],It.ops.push(de);break}Ot[2]&&It.ops.pop(),It.trys.pop();continue}de=Dt.call(Rt,It)}catch(Le){de=[6,Le],St=0}finally{dt=Ot=0}if(de[0]&5)throw de[1];return{value:de[0]?de[1]:void 0,done:!0}}}var X=Object.create?function(Rt,Dt,It,dt){dt===void 0&&(dt=It);var St=Object.getOwnPropertyDescriptor(Dt,It);(!St||("get"in St?!Dt.__esModule:St.writable||St.configurable))&&(St={enumerable:!0,get:function(){return Dt[It]}}),Object.defineProperty(Rt,dt,St)}:function(Rt,Dt,It,dt){dt===void 0&&(dt=It),Rt[dt]=Dt[It]};function nt(Rt,Dt){for(var It in Rt)It!=="default"&&!Object.prototype.hasOwnProperty.call(Dt,It)&&X(Dt,Rt,It)}function tt(Rt){var Dt=typeof Symbol=="function"&&Symbol.iterator,It=Dt&&Rt[Dt],dt=0;if(It)return It.call(Rt);if(Rt&&typeof Rt.length=="number")return{next:function(){return Rt&&dt>=Rt.length&&(Rt=void 0),{value:Rt&&Rt[dt++],done:!Rt}}};throw new TypeError(Dt?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(Rt,Dt){var It=typeof Symbol=="function"&&Rt[Symbol.iterator];if(!It)return Rt;var dt=It.call(Rt),St,Ot=[],Gt;try{for(;(Dt===void 0||Dt-- >0)&&!(St=dt.next()).done;)Ot.push(St.value)}catch(se){Gt={error:se}}finally{try{St&&!St.done&&(It=dt.return)&&It.call(dt)}finally{if(Gt)throw Gt.error}}return Ot}function it(){for(var Rt=[],Dt=0;Dt<arguments.length;Dt++)Rt=Rt.concat(q(arguments[Dt]));return Rt}function at(){for(var Rt=0,Dt=0,It=arguments.length;Dt<It;Dt++)Rt+=arguments[Dt].length;for(var dt=Array(Rt),St=0,Dt=0;Dt<It;Dt++)for(var Ot=arguments[Dt],Gt=0,se=Ot.length;Gt<se;Gt++,St++)dt[St]=Ot[Gt];return dt}function ct(Rt,Dt,It){if(It||arguments.length===2)for(var dt=0,St=Dt.length,Ot;dt<St;dt++)(Ot||!(dt in Dt))&&(Ot||(Ot=Array.prototype.slice.call(Dt,0,dt)),Ot[dt]=Dt[dt]);return Rt.concat(Ot||Array.prototype.slice.call(Dt))}function ut(Rt){return this instanceof ut?(this.v=Rt,this):new ut(Rt)}function bt(Rt,Dt,It){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var dt=It.apply(Rt,Dt||[]),St,Ot=[];return St=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),se("next"),se("throw"),se("return",Gt),St[Symbol.asyncIterator]=function(){return this},St;function Gt(ke){return function(Se){return Promise.resolve(Se).then(ke,Mn)}}function se(ke,Se){dt[ke]&&(St[ke]=function(re){return new Promise(function(Oe,ur){Ot.push([ke,re,Oe,ur])>1||be(ke,re)})},Se&&(St[ke]=Se(St[ke])))}function be(ke,Se){try{de(dt[ke](Se))}catch(re){Nn(Ot[0][3],re)}}function de(ke){ke.value instanceof ut?Promise.resolve(ke.value.v).then(Le,Mn):Nn(Ot[0][2],ke)}function Le(ke){be("next",ke)}function Mn(ke){be("throw",ke)}function Nn(ke,Se){ke(Se),Ot.shift(),Ot.length&&be(Ot[0][0],Ot[0][1])}}function gt(Rt){var Dt,It;return Dt={},dt("next"),dt("throw",function(St){throw St}),dt("return"),Dt[Symbol.iterator]=function(){return this},Dt;function dt(St,Ot){Dt[St]=Rt[St]?function(Gt){return(It=!It)?{value:ut(Rt[St](Gt)),done:!1}:Ot?Ot(Gt):Gt}:Ot}}function wt(Rt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Dt=Rt[Symbol.asyncIterator],It;return Dt?Dt.call(Rt):(Rt=typeof tt=="function"?tt(Rt):Rt[Symbol.iterator](),It={},dt("next"),dt("throw"),dt("return"),It[Symbol.asyncIterator]=function(){return this},It);function dt(Ot){It[Ot]=Rt[Ot]&&function(Gt){return new Promise(function(se,be){Gt=Rt[Ot](Gt),St(se,be,Gt.done,Gt.value)})}}function St(Ot,Gt,se,be){Promise.resolve(be).then(function(de){Ot({value:de,done:se})},Gt)}}function vt(Rt,Dt){return Object.defineProperty?Object.defineProperty(Rt,"raw",{value:Dt}):Rt.raw=Dt,Rt}var Et=Object.create?function(Rt,Dt){Object.defineProperty(Rt,"default",{enumerable:!0,value:Dt})}:function(Rt,Dt){Rt.default=Dt},Pt=function(Rt){return Pt=Object.getOwnPropertyNames||function(Dt){var It=[];for(var dt in Dt)Object.prototype.hasOwnProperty.call(Dt,dt)&&(It[It.length]=dt);return It},Pt(Rt)};function zt(Rt){if(Rt&&Rt.__esModule)return Rt;var Dt={};if(Rt!=null)for(var It=Pt(Rt),dt=0;dt<It.length;dt++)It[dt]!=="default"&&X(Dt,Rt,It[dt]);return Et(Dt,Rt),Dt}function Vt(Rt){return Rt&&Rt.__esModule?Rt:{default:Rt}}function Qt(Rt,Dt,It,dt){if(It==="a"&&!dt)throw new TypeError("Private accessor was defined without a getter");if(typeof Dt=="function"?Rt!==Dt||!dt:!Dt.has(Rt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return It==="m"?dt:It==="a"?dt.call(Rt):dt?dt.value:Dt.get(Rt)}function Ee(Rt,Dt,It,dt,St){if(dt==="m")throw new TypeError("Private method is not writable");if(dt==="a"&&!St)throw new TypeError("Private accessor was defined without a setter");if(typeof Dt=="function"?Rt!==Dt||!St:!Dt.has(Rt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return dt==="a"?St.call(Rt,It):St?St.value=It:Dt.set(Rt,It),It}function Re(Rt,Dt){if(Dt===null||typeof Dt!="object"&&typeof Dt!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Rt=="function"?Dt===Rt:Rt.has(Dt)}function $e(Rt,Dt,It){if(Dt!=null){if(typeof Dt!="object"&&typeof Dt!="function")throw new TypeError("Object expected.");var dt,St;if(It){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");dt=Dt[Symbol.asyncDispose]}if(dt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");dt=Dt[Symbol.dispose],It&&(St=dt)}if(typeof dt!="function")throw new TypeError("Object not disposable.");St&&(dt=function(){try{St.call(this)}catch(Ot){return Promise.reject(Ot)}}),Rt.stack.push({value:Dt,dispose:dt,async:It})}else It&&Rt.stack.push({async:!0});return Dt}var nr=typeof SuppressedError=="function"?SuppressedError:function(Rt,Dt,It){var dt=new Error(It);return dt.name="SuppressedError",dt.error=Rt,dt.suppressed=Dt,dt};function ti(Rt){function Dt(Ot){Rt.error=Rt.hasError?new nr(Ot,Rt.error,"An error was suppressed during disposal."):Ot,Rt.hasError=!0}var It,dt=0;function St(){for(;It=Rt.stack.pop();)try{if(!It.async&&dt===1)return dt=0,Rt.stack.push(It),Promise.resolve().then(St);if(It.dispose){var Ot=It.dispose.call(It.value);if(It.async)return dt|=2,Promise.resolve(Ot).then(St,function(Gt){return Dt(Gt),St()})}else dt|=1}catch(Gt){Dt(Gt)}if(dt===1)return Rt.hasError?Promise.reject(Rt.error):Promise.resolve();if(Rt.hasError)throw Rt.error}return St()}function la(Rt,Dt){return typeof Rt=="string"&&/^\.\.?\//.test(Rt)?Rt.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(It,dt,St,Ot,Gt){return dt?Dt?".jsx":".js":St&&(!Ot||!Gt)?It:St+Ot+"."+Gt.toLowerCase()+"js"}):Rt}var ss={__extends:z,__assign:D,__rest:N,__decorate:T,__param:k,__esDecorate:R,__runInitializers:C,__propKey:P,__setFunctionName:I,__metadata:L,__awaiter:Z,__generator:Y,__createBinding:X,__exportStar:nt,__values:tt,__read:q,__spread:it,__spreadArrays:at,__spreadArray:ct,__await:ut,__asyncGenerator:bt,__asyncDelegator:gt,__asyncValues:wt,__makeTemplateObject:vt,__importStar:zt,__importDefault:Vt,__classPrivateFieldGet:Qt,__classPrivateFieldSet:Ee,__classPrivateFieldIn:Re,__addDisposableResource:$e,__disposeResources:ti,__rewriteRelativeImportExtension:la}}}]);
}());