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/8305.abd36859.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 YB=Object.defineProperty,HB=Object.defineProperties;var XB=Object.getOwnPropertyDescriptors;var cw=Object.getOwnPropertySymbols;var KB=Object.prototype.hasOwnProperty,QB=Object.prototype.propertyIsEnumerable;var is=Math.pow,Y0=(U,Q,S)=>Q in U?YB(U,Q,{enumerable:!0,configurable:!0,writable:!0,value:S}):U[Q]=S,Bo=(U,Q)=>{for(var S in Q||(Q={}))KB.call(Q,S)&&Y0(U,S,Q[S]);if(cw)for(var S of cw(Q))QB.call(Q,S)&&Y0(U,S,Q[S]);return U},H0=(U,Q)=>HB(U,XB(Q));var Cn=(U,Q,S)=>Y0(U,typeof Q!="symbol"?Q+"":Q,S);(self.webpackChunk=self.webpackChunk||[]).push([[8305],{66083:function(U,Q,S){"use strict";S.d(Q,{kJ:function(){return sd},RN:function(){return NB}});var A={};S.r(A),S.d(A,{add:function(){return gw},adjoint:function(){return Mt},clone:function(){return ue},copy:function(){return we},create:function(){return Wt},decompose:function(){return bd},determinant:function(){return Yt},equals:function(){return yw},exactEquals:function(){return Sd},frob:function(){return vw},fromQuat:function(){return Wo},fromQuat2:function(){return _r},fromRotation:function(){return ti},fromRotationTranslation:function(){return Mr},fromRotationTranslationScale:function(){return xd},fromRotationTranslationScaleOrigin:function(){return hs},fromScaling:function(){return gn},fromTranslation:function(){return Xn},fromValues:function(){return Ae},fromXRotation:function(){return vi},fromYRotation:function(){return ze},fromZRotation:function(){return Fn},frustum:function(){return Ed},getRotation:function(){return Js},getScaling:function(){return Na},getTranslation:function(){return Tn},identity:function(){return ge},invert:function(){return Ze},lookAt:function(){return og},mul:function(){return cg},multiply:function(){return Jt},multiplyScalar:function(){return pw},multiplyScalarAndAdd:function(){return mw},ortho:function(){return ag},orthoNO:function(){return ig},orthoZO:function(){return sg},perspective:function(){return wd},perspectiveFromFieldOfView:function(){return hw},perspectiveNO:function(){return Kl},perspectiveZO:function(){return uw},rotate:function(){return $e},rotateX:function(){return hn},rotateY:function(){return vn},rotateZ:function(){return nr},scale:function(){return fn},set:function(){return un},str:function(){return fw},sub:function(){return bw},subtract:function(){return lg},targetTo:function(){return dw},translate:function(){return Ht},transpose:function(){return be}});var Z={};S.r(Z),S.d(Z,{circle:function(){return A3},diamond:function(){return T3},rect:function(){return C3},simple:function(){return k3},triangle:function(){return y1},triangleRect:function(){return N3},vee:function(){return O3}});var B=S(33885),N=S(67732),T=S(83652),k=S(94480),_=S(22214),C=S(42403),L=S(42978),z=S(37271),D=z,W=1e-6,X=typeof Float32Array!="undefined"?Float32Array:Array,K=Math.random,rt="zyx";function nt(r){return r>=0?Math.round(r):r%.5===0?Math.floor(r):Math.round(r)}function q(r){X=r}var it=Math.PI/180,at=180/Math.PI;function ut(r){return r*it}function ht(r){return r*at}function xt(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:W;return Math.abs(r-t)<=e*Math.max(1,Math.abs(r),Math.abs(t))}function pt(){var r=new X(3);return X!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function wt(r){var t=new X(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function gt(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 X(3);return n[0]=r,n[1]=t,n[2]=e,n}function kt(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 Ut(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 Le(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function tn(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function er(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function $r(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 ca(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 as(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r[2]=glMatrix.round(t[2]),r}function Pt(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function _t(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 Ct(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 oe(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 ye(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 _e(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(ye(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 Pe(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 cr(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 ua(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 ss(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 Rr(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&&ye(r,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function Hn(r){return r[0]=0,r[1]=0,r[2]=0,r}function Lr(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function os(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function ha(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)<=W*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-s)<=W*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=W*Math.max(1,Math.abs(i),Math.abs(o))}var qs=Qt,da=null,Fo=null,ls=It,cs=null,us=gt,Ti=null,Oi=function(){var r=pt();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 X(4);return X!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function dd(r){var t=new X(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 X(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function Ci(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 Ca(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 Q0(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 fd(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 q0(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 J0(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 $0(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 tg(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 eg(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 vd(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 gd(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 ng(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 rg(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 pd(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 md(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 yd(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 H(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 w(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 j(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 tt(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function et(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 lt(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,vt=null,Ft=null,qt=null,Lt=null,Zt=null,le=null,bt=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 X(16);return X!=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 ue(r){var t=new X(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 X(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 un(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 be(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,E=e*l-i*s,O=e*c-a*s,P=n*l-i*o,R=n*c-a*o,F=i*c-a*l,I=u*g-h*v,V=u*p-d*v,Y=u*y-f*v,J=h*p-d*g,$=h*y-f*g,ot=d*y-f*p,ct=b*ot-E*$+O*J+P*Y-R*V+F*I;return ct?(ct=1/ct,r[0]=(o*ot-l*$+c*J)*ct,r[1]=(i*$-n*ot-a*J)*ct,r[2]=(g*F-p*R+y*P)*ct,r[3]=(d*R-h*F-f*P)*ct,r[4]=(l*Y-s*ot-c*V)*ct,r[5]=(e*ot-i*Y+a*V)*ct,r[6]=(p*O-v*F-y*E)*ct,r[7]=(u*F-d*O+f*E)*ct,r[8]=(s*$-o*Y+c*I)*ct,r[9]=(n*Y-e*$-a*I)*ct,r[10]=(v*R-g*O+y*b)*ct,r[11]=(h*O-u*R-f*b)*ct,r[12]=(o*V-s*J-l*I)*ct,r[13]=(e*J-n*V+i*I)*ct,r[14]=(g*E-v*P-p*b)*ct,r[15]=(u*P-h*E+d*b)*ct,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,E=e*l-i*s,O=e*c-a*s,P=n*l-i*o,R=n*c-a*o,F=i*c-a*l,I=u*g-h*v,V=u*p-d*v,Y=u*y-f*v,J=h*p-d*g,$=h*y-f*g,ot=d*y-f*p;return r[0]=o*ot-l*$+c*J,r[1]=i*$-n*ot-a*J,r[2]=g*F-p*R+y*P,r[3]=d*R-h*F-f*P,r[4]=l*Y-s*ot-c*V,r[5]=e*ot-i*Y+a*V,r[6]=p*O-v*F-y*E,r[7]=u*F-d*O+f*E,r[8]=s*$-o*Y+c*I,r[9]=n*Y-e*$-a*I,r[10]=v*R-g*O+y*b,r[11]=h*O-u*R-f*b,r[12]=o*V-s*J-l*I,r[13]=e*J-n*V+i*I,r[14]=g*E-v*P-p*b,r[15]=u*P-h*E+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,E=e*o-n*s,O=c*v-u*f,P=c*g-h*f,R=u*g-h*v,F=t*R-e*P+n*O,I=a*R-s*P+o*O,V=c*E-u*b+h*y,Y=f*E-v*b+g*y;return l*F-i*I+p*V-d*Y}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],E=e[0],O=e[1],P=e[2],R=e[3];return r[0]=E*n+O*o+P*h+R*g,r[1]=E*i+O*l+P*d+R*p,r[2]=E*a+O*c+P*f+R*y,r[3]=E*s+O*u+P*v+R*b,E=e[4],O=e[5],P=e[6],R=e[7],r[4]=E*n+O*o+P*h+R*g,r[5]=E*i+O*l+P*d+R*p,r[6]=E*a+O*c+P*f+R*y,r[7]=E*s+O*u+P*v+R*b,E=e[8],O=e[9],P=e[10],R=e[11],r[8]=E*n+O*o+P*h+R*g,r[9]=E*i+O*l+P*d+R*p,r[10]=E*a+O*c+P*f+R*y,r[11]=E*s+O*u+P*v+R*b,E=e[12],O=e[13],P=e[14],R=e[15],r[12]=E*n+O*o+P*h+R*g,r[13]=E*i+O*l+P*d+R*p,r[14]=E*a+O*c+P*f+R*y,r[15]=E*s+O*u+P*v+R*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 fn(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 $e(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,E,O,P,R,F,I,V,Y,J,$,ot,ct,ft;return o<W?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],E=t[8],O=t[9],P=t[10],R=t[11],F=i*i*u+c,I=a*i*u+s*l,V=s*i*u-a*l,Y=i*a*u-s*l,J=a*a*u+c,$=s*a*u+i*l,ot=i*s*u+a*l,ct=a*s*u-i*l,ft=s*s*u+c,r[0]=h*F+g*I+E*V,r[1]=d*F+p*I+O*V,r[2]=f*F+y*I+P*V,r[3]=v*F+b*I+R*V,r[4]=h*Y+g*J+E*$,r[5]=d*Y+p*J+O*$,r[6]=f*Y+y*J+P*$,r[7]=v*Y+b*J+R*$,r[8]=h*ot+g*ct+E*ft,r[9]=d*ot+p*ct+O*ft,r[10]=f*ot+y*ct+P*ft,r[11]=v*ot+b*ct+R*ft,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function hn(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 vn(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 nr(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 Xn(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 gn(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 ti(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<W?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 vi(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 ze(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 Fn(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 Mr(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 X(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),Mr(r,t,e),r}function Tn(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function Na(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 X(3);Na(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 bd(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,E=o*f,O=l*v,P=c*g,R=u*f,F=h*v,I=d*g,V=p+O+I,Y=0;return V>0?(Y=Math.sqrt(V+1)*2,r[3]=.25*Y,r[0]=(P-F)/Y,r[1]=(R-b)/Y,r[2]=(y-E)/Y):p>O&&p>I?(Y=Math.sqrt(1+p-O-I)*2,r[3]=(P-F)/Y,r[0]=.25*Y,r[1]=(y+E)/Y,r[2]=(R+b)/Y):O>I?(Y=Math.sqrt(1+O-p-I)*2,r[3]=(R-b)/Y,r[0]=(y+E)/Y,r[1]=.25*Y,r[2]=(P+F)/Y):(Y=Math.sqrt(1+I-p-O)*2,r[3]=(y-E)/Y,r[0]=(R+b)/Y,r[1]=(P+F)/Y,r[2]=.25*Y),r}function xd(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,E=o*u,O=n[0],P=n[1],R=n[2];return r[0]=(1-(v+p))*O,r[1]=(d+E)*O,r[2]=(f-b)*O,r[3]=0,r[4]=(d-E)*P,r[5]=(1-(h+p))*P,r[6]=(g+y)*P,r[7]=0,r[8]=(f+b)*R,r[9]=(g-y)*R,r[10]=(1-(h+v))*R,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function hs(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,E=l*u,O=l*h,P=n[0],R=n[1],F=n[2],I=i[0],V=i[1],Y=i[2],J=(1-(g+y))*P,$=(f+O)*P,ot=(v-E)*P,ct=(f-O)*R,ft=(1-(d+y))*R,Nt=(p+b)*R,Ot=(v+E)*F,mt=(p-b)*F,yt=(1-(d+g))*F;return r[0]=J,r[1]=$,r[2]=ot,r[3]=0,r[4]=ct,r[5]=ft,r[6]=Nt,r[7]=0,r[8]=Ot,r[9]=mt,r[10]=yt,r[11]=0,r[12]=e[0]+I-(J*I+ct*V+Ot*Y),r[13]=e[1]+V-($*I+ft*V+mt*Y),r[14]=e[2]+Y-(ot*I+Nt*V+yt*Y),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 Ed(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 wd=Kl;function uw(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 hw(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 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]=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 ag=ig;function sg(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 og(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],E=n[2],O=e[0],P=e[1],R=e[2];return Math.abs(v-O)<W&&Math.abs(g-P)<W&&Math.abs(p-R)<W?ge(r):(u=v-O,h=g-P,d=p-R,f=1/Math.sqrt(u*u+h*h+d*d),u*=f,h*=f,d*=f,i=b*d-E*h,a=E*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 dw(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 fw(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 vw(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 gw(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 lg(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 pw(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 mw(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 Sd(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 yw(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],E=t[1],O=t[2],P=t[3],R=t[4],F=t[5],I=t[6],V=t[7],Y=t[8],J=t[9],$=t[10],ot=t[11],ct=t[12],ft=t[13],Nt=t[14],Ot=t[15];return Math.abs(e-b)<=W*Math.max(1,Math.abs(e),Math.abs(b))&&Math.abs(n-E)<=W*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(i-O)<=W*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(a-P)<=W*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(s-R)<=W*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(o-F)<=W*Math.max(1,Math.abs(o),Math.abs(F))&&Math.abs(l-I)<=W*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(c-V)<=W*Math.max(1,Math.abs(c),Math.abs(V))&&Math.abs(u-Y)<=W*Math.max(1,Math.abs(u),Math.abs(Y))&&Math.abs(h-J)<=W*Math.max(1,Math.abs(h),Math.abs(J))&&Math.abs(d-$)<=W*Math.max(1,Math.abs(d),Math.abs($))&&Math.abs(f-ot)<=W*Math.max(1,Math.abs(f),Math.abs(ot))&&Math.abs(v-ct)<=W*Math.max(1,Math.abs(v),Math.abs(ct))&&Math.abs(g-ft)<=W*Math.max(1,Math.abs(g),Math.abs(ft))&&Math.abs(p-Nt)<=W*Math.max(1,Math.abs(p),Math.abs(Nt))&&Math.abs(y-Ot)<=W*Math.max(1,Math.abs(y),Math.abs(Ot))}var cg=Jt,bw=lg;function ug(){var r=new X(9);return X!=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 xw(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 qB(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 JB(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 Ew(r,t,e,n,i,a,s,o,l){var c=new X(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 $B(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 tF(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 eF(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 nF(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 rF(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 iF(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 aF(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],E=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+E*s+O*c,r[7]=b*i+E*o+O*u,r[8]=b*a+E*l+O*h,r}function sF(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 oF(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 lF(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 cF(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 uF(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 hF(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 dF(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 fF(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 vF(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,E=e*l-i*s,O=e*c-a*s,P=n*l-i*o,R=n*c-a*o,F=i*c-a*l,I=u*g-h*v,V=u*p-d*v,Y=u*y-f*v,J=h*p-d*g,$=h*y-f*g,ot=d*y-f*p,ct=b*ot-E*$+O*J+P*Y-R*V+F*I;return ct?(ct=1/ct,r[0]=(o*ot-l*$+c*J)*ct,r[1]=(l*Y-s*ot-c*V)*ct,r[2]=(s*$-o*Y+c*I)*ct,r[3]=(i*$-n*ot-a*J)*ct,r[4]=(e*ot-i*Y+a*V)*ct,r[5]=(n*Y-e*$-a*I)*ct,r[6]=(g*F-p*R+y*P)*ct,r[7]=(p*O-v*F-y*E)*ct,r[8]=(v*R-g*O+y*b)*ct,r):null}function gF(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 pF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function mF(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 yF(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 bF(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 xF(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 EF(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 wF(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 SF(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],E=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-E)<=glMatrix.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))}var MF=null,AF=null;function Kn(){var r=new X(4);return X!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function TF(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function ka(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 OF(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 CF(r,t){var e=Ow(r,t);return Math.acos(2*e*e-1)}function Pa(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 NF(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 kF(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 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+i*o,r[1]=i*l-n*o,r[2]=a*l+s*o,r[3]=s*l-a*o,r}function RF(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 ww(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 Sw(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 LF(r,t,e){return Sw(r,t),Tw(r,r,e),ww(r,r),r}function Md(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>W?(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 _F(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 Ad(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 DF(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function Mw(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]:rt,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 IF(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var BF=dd,Aw=Ui,ql=Ci,hg=zo,FF=Ca,dg=Pa,Tw=vd,Ow=H,zF=w,jF=pd,ZF=null,WF=md,GF=null,Jl=Xl,VF=st;function UF(r,t){return Math.abs(vec4.dot(r,t))>=1-glMatrix.EPSILON}var YF=function(){var r=pt(),t=Et(1,0,0),e=Et(0,1,0);return function(n,i,a){var s=ye(i,a);return s<-.999999?(de(r,t,i),us(r)<1e-6&&de(r,e,i),oe(r,r),ka(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))}}(),HF=function(){var r=Kn(),t=Kn();return function(e,n,i,a,s,o){return Md(r,n,s,o),Md(t,i,a,o),Md(e,r,t,2*o*(1-o)),e}}(),XF=function(){var r=ug();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,Mw(t,r))}}();function Td(){var r=new X(2);return X!=Float32Array&&(r[0]=0,r[1]=0),r}function KF(r){var t=new glMatrix.ARRAY_TYPE(2);return t[0]=r[0],t[1]=r[1],t}function QF(r,t){var e=new glMatrix.ARRAY_TYPE(2);return e[0]=r,e[1]=t,e}function Cw(r,t){return r[0]=t[0],r[1]=t[1],r}function Nw(r,t,e){return r[0]=t,r[1]=e,r}function qF(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 $F(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function t8(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function e8(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function n8(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function r8(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function i8(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function a8(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r}function s8(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function o8(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function l8(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.sqrt(e*e+n*n)}function c8(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function u8(r){var t=r[0],e=r[1];return Math.sqrt(t*t+e*e)}function h8(r){var t=r[0],e=r[1];return t*t+e*e}function d8(r,t){return r[0]=-t[0],r[1]=-t[1],r}function f8(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function kw(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 Pw(r,t){return r[0]*t[0]+r[1]*t[1]}function v8(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function g8(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 p8(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 m8(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 y8(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 b8(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 x8(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 E8(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 w8(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 S8(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 M8(r){return r[0]=0,r[1]=0,r}function A8(r){return"vec2("+r[0]+", "+r[1]+")"}function Rw(r,t){return r[0]===t[0]&&r[1]===t[1]}function T8(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 O8=null,C8=null,N8=null,k8=null,P8=null,R8=null,L8=null,_8=function(){var r=Td();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 Zr(r,t){return Math.sqrt((r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1]))}function me(r){return r==null}function Ge(r){return typeof r=="string"}var Lw=function(r,t,e){return r<t?t:r>e?e:r},kn=Lw,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 fg(r){return Array.isArray(r)&&r.every(function(t){var e=t[0].toLowerCase();return Go[e]===t.length-1&&"achlmqstvz".includes(e)})}function vg(r){return fg(r)&&r.every(function(t){var e=t[0];return e===e.toUpperCase()})}function gg(r){return vg(r)&&r.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}var pg={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function mg(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 _w(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 Dw(r){return r>=48&&r<=57||r===43||r===45||r===46}function $s(r){return r>=48&&r<=57}function Iw(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 Bw(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&&Bw(t.charCodeAt(r.index));)r.index+=1}function Fw(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 zw(r){return(r|32)===97}function jw(r){var t=r.max,e=r.pathValue,n=r.index,i=e.charCodeAt(n),a=Go[e[n].toLowerCase()];if(r.segmentStart=n,!Fw(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){mg(r);return}for(;;){for(var s=a;s>0;s-=1){if(zw(i)&&(s===3||s===4)?_w(r):Iw(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||!Dw(e.charCodeAt(r.index)))break}mg(r)}var Zw=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 Ww(r){if(fg(r))return[].concat(r);var t=new Zw(r);for($l(t);t.index<t.max&&!t.err.length;)jw(t);return t.err?t.err:t.segments}function Gw(r){if(vg(r))return[].concat(r);var t=Ww(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 Vw(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(gg(r))return[].concat(r);for(var t=Gw(r),e=(0,G.pi)({},pg),n=0;n<t.length;n+=1){t[n]=Vw(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 Ra(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 Od(r,t,e,n,i){var a=Zr([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=Ra([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 yg(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 Uw(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 Od(r,t,o,l,c).point;var E=(r-o)/2,O=(t-l)/2,P={x:d(b)*E+h(b)*O,y:-h(b)*E+d(b)*O},R=Math.pow(P.x,2)/Math.pow(g,2)+Math.pow(P.y,2)/Math.pow(p,2);R>1&&(g*=f(R),p*=f(R));var F=Math.pow(g,2)*Math.pow(p,2)-Math.pow(g,2)*Math.pow(P.y,2)-Math.pow(p,2)*Math.pow(P.x,2),I=Math.pow(g,2)*Math.pow(P.y,2)+Math.pow(p,2)*Math.pow(P.x,2),V=F/I;V=V<0?0:V;var Y=(a!==s?1:-1)*f(V),J={x:Y*(g*P.y/p),y:Y*(-(p*P.x)/g)},$={x:d(b)*J.x-h(b)*J.y+(r+o)/2,y:h(b)*J.x+d(b)*J.y+(t+l)/2},ot={x:(P.x-J.x)/g,y:(P.y-J.y)/p},ct=yg({x:1,y:0},ot),ft={x:(-P.x-J.x)/g,y:(-P.y-J.y)/p},Nt=yg(ot,ft);!s&&Nt>0?Nt-=2*v:s&&Nt<0&&(Nt+=2*v),Nt%=2*v;var Ot=ct+Nt*c,mt=g*d(Ot),yt=p*h(Ot),Rt={x:d(b)*mt-h(b)*yt+$.x,y:h(b)*mt+d(b)*yt+$.y};return Rt}function Yw(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",E=r,O=t,P=0,R=[E,O,P],F=[E,O],I=0,V={x:0,y:0},Y=[{x:E,y:O}];b&&c<=0&&(V={x:E,y:O});for(var J=0;J<=y;J+=1){if(I=J/y,h=Uw(r,t,e,n,i,a,s,o,l,I),E=h.x,O=h.y,f&&Y.push({x:E,y:O}),g&&(P+=Zr(F,[E,O])),F=[E,O],b&&P>=c&&c>R[2]){var $=(P-c)/(P-R[2]);V={x:F[0]*(1-$)+R[0]*$,y:F[1]*(1-$)+R[1]*$}}R=[E,O,P]}return b&&c>=P&&(V={x:o,y:l}),{length:P,point:V,min:{x:Math.min.apply(null,Y.map(function(ot){return ot.x})),y:Math.min.apply(null,Y.map(function(ot){return ot.y}))},max:{x:Math.max.apply(null,Y.map(function(ot){return ot.x})),y:Math.max.apply(null,Y.map(function(ot){return ot.y}))}}}function Hw(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 bg(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,E=t,O=0,P=[b,E,O],R=[b,E],F=0,I={x:0,y:0},V=[{x:b,y:E}];y&&l<=0&&(I={x:b,y:E});for(var Y=0;Y<=p;Y+=1){if(F=Y/p,u=Hw(r,t,e,n,i,a,s,o,F),b=u.x,E=u.y,d&&V.push({x:b,y:E}),v&&(O+=Zr(R,[b,E])),R=[b,E],y&&O>=l&&l>P[2]){var J=(O-l)/(O-P[2]);I={x:R[0]*(1-J)+P[0]*J,y:R[1]*(1-J)+P[1]*J}}P=[b,E,O]}return y&&l>=O&&(I={x:s,y:o}),{length:O,point:I,min:{x:Math.min.apply(null,V.map(function($){return $.x})),y:Math.min.apply(null,V.map(function($){return $.y}))},max:{x:Math.max.apply(null,V.map(function($){return $.x})),y:Math.max.apply(null,V.map(function($){return $.y}))}}}function Xw(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 Kw(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,E=[p,y,b],O=[p,y],P=0,R={x:0,y:0},F=[{x:p,y}];g&&s<=0&&(R={x:p,y});for(var I=0;I<=v;I+=1){if(P=I/v,l=Xw(r,t,e,n,i,a,P),p=l.x,y=l.y,u&&F.push({x:p,y}),d&&(b+=Zr(O,[p,y])),O=[p,y],g&&b>=s&&s>E[2]){var V=(b-s)/(b-E[2]);R={x:O[0]*(1-V)+E[0]*V,y:O[1]*(1-V)+E[1]*V}}E=[p,y,b]}return g&&s>=b&&(R={x:i,y:a}),{length:b,point:R,min:{x:Math.min.apply(null,F.map(function(Y){return Y.x})),y:Math.min.apply(null,F.map(function(Y){return Y.y}))},max:{x:Math.max.apply(null,F.map(function(Y){return Y.x})),y:Math.max.apply(null,F.map(function(Y){return Y.y}))}}}function xg(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,E=[],O=[],P=0,R={x:0,y:0},F=R,I=R,V=R,Y=0,J=0,$=c.length;J<$;J+=1)b=c[J],f=b[0],h=f==="M",d=h?d:[v,g].concat(b.slice(1)),h?(p=b[1],y=b[2],R={x:p,y},F=R,P=0,u&&t<.001&&(V=R)):f==="L"?(n=Od(d[0],d[1],d[2],d[3],(t||0)-Y),P=n.length,R=n.min,F=n.max,I=n.point):f==="A"?(i=Yw(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-Y,e||{}),P=i.length,R=i.min,F=i.max,I=i.point):f==="C"?(a=bg(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-Y,e||{}),P=a.length,R=a.min,F=a.max,I=a.point):f==="Q"?(s=Kw(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-Y,e||{}),P=s.length,R=s.min,F=s.max,I=s.point):f==="Z"&&(d=[v,g,p,y],o=Od(d[0],d[1],d[2],d[3],(t||0)-Y),P=o.length,R=o.min,F=o.max,I=o.point),u&&Y<t&&Y+P>=t&&(V=I),O.push(F),E.push(R),Y+=P,l=f!=="Z"?b.slice(-2):[p,y],v=l[0],g=l[1];return u&&t>=Y&&(V={x:v,y:g}),{length:Y,point:V,min:{x:Math.min.apply(null,E.map(function(ot){return ot.x})),y:Math.min.apply(null,E.map(function(ot){return ot.y}))},max:{x:Math.max.apply(null,O.map(function(ot){return ot.x})),y:Math.max.apply(null,O.map(function(ot){return ot.y}))}}}function Qw(r,t){return xg(r,void 0,(0,G.pi)((0,G.pi)({},t),{bbox:!1,length:!0})).length}function Wr(r){return Array.isArray(r)}var ec=function(r){if(Wr(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 qw=1e-5;function Vo(r,t,e){return e===void 0&&(e=qw),r===t||Math.abs(r-t)<e}var Jw=function(r,t){return(r%t+t)%t},Eg=Jw;function $w(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 t2(r){return gg(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 Cd(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=[],E,O,P,R,F;if(c)O=c[0],P=c[1],R=c[2],F=c[3];else{E=rc(u,h,-y),u=E.x,h=E.y,E=rc(v,g,-y),v=E.x,g=E.y;var I=(u-v)/2,V=(h-g)/2,Y=I*I/(d*d)+V*V/(f*f);Y>1&&(Y=Math.sqrt(Y),d*=Y,f*=Y);var J=d*d,$=f*f,ot=(a===s?-1:1)*Math.sqrt(Math.abs((J*$-J*V*V-$*I*I)/(J*V*V+$*I*I)));R=ot*d*V/f+(u+v)/2,F=ot*-f*I/d+(h+g)/2,O=Math.asin(((h-F)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),P=Math.asin(((g-F)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),O=u<R?Math.PI-O:O,P=v<R?Math.PI-P:P,O<0&&(O=Math.PI*2+O),P<0&&(P=Math.PI*2+P),s&&O>P&&(O-=Math.PI*2),!s&&P>O&&(P-=Math.PI*2)}var ct=P-O;if(Math.abs(ct)>p){var ft=P,Nt=v,Ot=g;P=O+p*(s&&P>O?1:-1),v=R+d*Math.cos(P),g=F+f*Math.sin(P),b=Cd(v,g,d,f,i,0,s,Nt,Ot,[P,ft,R,F])}ct=P-O;var mt=Math.cos(O),yt=Math.sin(O),Rt=Math.cos(P),jt=Math.sin(P),Xt=Math.tan(ct/4),ee=4/3*d*Xt,ae=4/3*f*Xt,he=[u,h],ce=[u+ee*yt,h-ae*mt],xe=[v+ee*jt,g-ae*Rt],Ce=[v,g];if(ce[0]=2*he[0]-ce[0],ce[1]=2*he[1]-ce[1],c)return ce.concat(xe,Ce,b);b=ce.concat(xe,Ce,b);for(var je=[],Ue=0,or=b.length;Ue<or;Ue+=1)je[Ue]=Ue%2?rc(b[Ue-1],b[Ue],y).y:rc(b[Ue],b[Ue+1],y).x;return je}function e2(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 wg=function(r,t,e,n){var i=.5,a=Ra([r,t],[e,n],i);return(0,G.ev)((0,G.ev)([],a,!0),[e,n,e,n],!1)};function n2(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(Cd(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(e2(s[0],s[1],s[2],s[3],s[4],s[5]));case"L":return["C"].concat(wg(o,l,i,a));case"Z":return o===c&&l===u?["C",o,l,c,u,c,u]:["C"].concat(wg(o,l,c,u));default:}return r}function Nd(r,t){if(t===void 0&&(t=!1),t2(r)){var e=[].concat(r);return t?[e,[]]:e}for(var n=tc(r),i=(0,G.pi)({},pg),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=n2(n[h],i);n[h]=d,$w(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 r2=50;function i2(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=Ra(e,n,t),o=Ra(n,i,t),l=Ra(i,a,t),c=Ra(s,o,t),u=Ra(o,l,t),h=Ra(c,u,t);return[["C"].concat(s,c,h),["C"].concat(u,l,a)]}function Sg(r){return r.map(function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?bg(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?i2(i):[t,t]:s=[t],{s:t,ss:s,l:a}})}function Mg(r,t,e,n){if(n===void 0&&(n=0),n>r2)return console.warn("Maximum recursion depth reached in equalizeSegments"),[r,t];var i=Sg(r),a=Sg(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 E=b.l;return y+E},0)/l||0,h=a.filter(function(y){return y.l}).reduce(function(y,b){var E=b.l;return y+E},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(E){return E.s}):y.map(function(E,O){return g=O&&v[b]&&E.l>=f[b],v[b]-=g?1:0,g?E.ss:[E.s]}).flat()});return p[0].length===p[1].length?p:Mg(p[0],p[1],d,n+1)}function a2(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 s2(r){var t=0,e=0,n=0;return Nd(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=a2(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 Ag(r){return s2(r)>=0}function o2(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 l2(r){return r.map(function(t){return Array.isArray(t)?[].concat(t):t})}function c2(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 u2(r,t){var e=r.length-1,n=[],i=0,a=0,s=c2(r);return s.forEach(function(o,l){r.slice(1).forEach(function(c,u){a+=Zr(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 h2=function(r){return r===void 0},Te=h2,d2={}.toString,f2=function(r,t){return d2.call(r)==="[object "+t+"]"},Tg=f2,v2=function(r){return Tg(r,"Boolean")},Uo=v2;function fe(r){return typeof r=="function"}var zn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function g2(r,t,e){return xg(r,t,(0,G.pi)((0,G.pi)({},e),{bbox:!1,length:!0})).point}var se=S(20068),Og=S(58289);function p2(r,t){for(;!{}.hasOwnProperty.call(r,t)&&(r=(0,Og.Z)(r))!==null;);return r}function kd(){return kd=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(r,t,e){var n=p2(r,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?r:e):i.value}},kd.apply(null,arguments)}function Cg(r,t,e,n){var i=kd((0,Og.Z)(1&n?r.prototype:r),t,e);return 2&n&&typeof i=="function"?function(a){return i.apply(e,a)}:i}function Ar(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 Ng(r){return(r+Math.PI*2)%(Math.PI*2)}function kg(r,t){var e=Math.abs(r);return t>0?e:e*-1}function m2(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,E=(f-d)*Math.pow(Math.sin(v),3)/o,O=g-b,P=p-E,R=u-b,F=h-E,I=Math.hypot(P,O),V=Math.hypot(F,R),Y=I*Math.asin((O*F-P*R)/(I*V)),J=Y/Math.sqrt(d+f-g*g-p*p);v+=J,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+kg(g,l),y:t+kg(p,c)}}function y2(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 b2(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 x2(r,t,e){return Math.atan(-t/r*Math.tan(e))}function E2(r,t,e){return Math.atan(t/(r*Math.tan(e)))}function w2(r,t,e,n,i,a){return e*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function S2(r,t,e,n,i,a){return e*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+t}function M2(r,t,e,n){var i=Math.atan2(n*r,e*t);return(i+Math.PI*2)%(Math.PI*2)}function Pg(r,t,e){return{x:r*Math.cos(e),y:t*Math.sin(e)}}function Rg(r,t,e){var n=Math.cos(e),i=Math.sin(e);return[r*n-t*i,r*i+t*n]}function A2(r,t,e,n,i,a,s){for(var o=x2(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=w2(r,t,e,n,i,u[f]);v<l&&(l=v),v>c&&(c=v)}for(var g=E2(e,n,i),p=1/0,y=-1/0,b=[a,s],E=-Math.PI*2;E<=Math.PI*2;E+=Math.PI){var O=g+E;a<s?a<O&&O<s&&b.push(O):s<O&&O<a&&b.push(O)}for(var P=0;P<b.length;P++){var R=S2(r,t,e,n,i,b[P]);R<p&&(p=R),R>y&&(y=R)}return{x:l,y:p,width:c-l,height:y-p}}function D8(r,t,e,n,i,a,s,o,l){var c=Rg(o-r,l-t,-i),u=_slicedToArray(c,2),h=u[0],d=u[1],f=m2(0,0,e,n,h,d),v=M2(e,n,f.x,f.y);v<a?f=Pg(e,n,a):v>s&&(f=Pg(e,n,s));var g=Rg(f.x,f.y,i);return{x:g[0]+r,y:g[1]+t}}function I8(r,t,e,n,i,a,s,o){var l=(s-a)*o+a,c=y2(r,t,e,n,i,a,s,l),u=b2(r,t,e,n,i,a,s,l);return Ng(Math.atan2(u,c))}var T2=1e-4;function Lg(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=Ar(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<T2);y++){var b=s-h,E=s+h,O=[i.apply(void 0,(0,k.Z)(r.concat([b]))),i.apply(void 0,(0,k.Z)(t.concat([b])))],P=Ar(l[0],l[1],O[0],O[1]);if(b>=0&&P<o)s=b,o=P;else{var R=[i.apply(void 0,(0,k.Z)(r.concat([E]))),i.apply(void 0,(0,k.Z)(t.concat([E])))],F=Ar(l[0],l[1],R[0],R[1]);E<=1&&F<o?(s=E,o=F):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 O2(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+=Ar(a,s,o,l)}return e/2}function B8(r,t,e,n){return ic([r,e],[t,n])}function _g(r,t,e,n){return Ar(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 C2(r,t,e,n,i,a){var s=(e-r)*(i-r)+(n-t)*(a-t);if(s<0)return Ar(r,t,i,a);var o=(e-r)*(e-r)+(n-t)*(n-t);return s>o?Ar(e,n,i,a):Dg(r,t,e,n,i,a)}function Dg(r,t,e,n,i,a){var s=[e-r,n-t];if(Rw(s,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var o=[-s[1],s[0]];kw(o,o);var l=[i-r,a-t];return Math.abs(Pw(l,o))}function F8(r,t,e,n){return Math.atan2(n-t,e-r)}function ds(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 Ig(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 Bg(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 N2(r,t,e,n,i,a,s,o,l){var c=ds(r,e,i,s,l),u=ds(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 Pd(r,t,e,n,i,a,s,o,l){if(l===0)return O2([r,e,i,s],[t,n,a,o]);var c=N2(r,t,e,n,i,a,s,o,.5),u=[].concat(_toConsumableArray(c[0]),[l-1]),h=[].concat(_toConsumableArray(c[1]),[l-1]);return Pd.apply(void 0,_toConsumableArray(u))+Pd.apply(void 0,_toConsumableArray(h))}function k2(r,t,e,n,i,a,s,o){for(var l=[r,s],c=[t,o],u=Bg(r,e,i,s),h=Bg(t,n,a,o),d=0;d<u.length;d++)l.push(ds(r,e,i,s,u[d]));for(var f=0;f<h.length;f++)c.push(ds(t,n,a,o,h[f]));return ic(l,c)}function z8(r,t,e,n,i,a,s,o){return Pd(r,t,e,n,i,a,s,o,3)}function P2(r,t,e,n,i,a,s,o,l,c,u){return Lg([r,e,i,s],[t,n,a,o],l,c,ds,u)}function Fg(r,t,e,n,i,a,s,o,l,c,u){var h=P2(r,t,e,n,i,a,s,o,l,c,u);return Ar(h.x,h.y,l,c)}function j8(r,t,e,n,i,a,s,o,l){return{x:ds(r,e,i,s,l),y:ds(t,n,a,o,l)}}function Z8(r,t,e,n,i,a,s,o,l){var c=Ig(r,e,i,s,l),u=Ig(t,n,a,o,l);return Ng(Math.atan2(u,c))}function zg(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],s=Ar(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 jg(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+=Ar(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=zg(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 Wg(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=zg(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 Gg(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],s=r[i+1],o=C2(a[0],a[1],s[0],s[1],t,e);o<n&&(n=o)}return n}function R2(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 L2(r){return jg(r)}function W8(r,t){return Zg(r,t)}function G8(r,t,e){return Gg(r,t,e)}function V8(r,t){return Wg(r,t)}function ac(r){var t=r.slice(0);return r.length&&t.push(r[0]),t}function U8(r){return R2(r)}function Y8(r){return jg(ac(r))}function H8(r,t){return Zg(ac(r),t)}function X8(r,t,e){return Gg(ac(r),t,e)}function K8(r,t){return Wg(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 Vg(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 _2(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 Rd(r,t,e,n,i,a,s){if(s===0)return(Ar(r,t,e,n)+Ar(e,n,i,a)+Ar(r,t,i,a))/2;var o=_2(r,t,e,n,i,a,.5),l=o[0],c=o[1];return l.push(s-1),c.push(s-1),Rd.apply(void 0,_toConsumableArray(l))+Rd.apply(void 0,_toConsumableArray(c))}function D2(r,t,e,n,i,a){var s=Vg(r,e,i)[0],o=Vg(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 Q8(r,t,e,n,i,a){return Rd(r,t,e,n,i,a,3)}function I2(r,t,e,n,i,a,s,o){return Lg([r,e,i],[t,n,a],s,o,Yo)}function B2(r,t,e,n,i,a,s,o){var l=I2(r,t,e,n,i,a,s,o);return Ar(l.x,l.y,s,o)}var Tr=S(75044),La=S(3202),fs=S(19251),vs=S(75931);var F2=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:typeof self!="undefined"?self:{},Ug={exports:{}};(function(r,t){(function(e,n){r.exports=n()})(F2,function(){function e(P,R,F,I,V){n(P,R,F||0,I||P.length-1,V||a)}function n(P,R,F,I,V){for(;I>F;){if(I-F>600){var Y=I-F+1,J=R-F+1,$=Math.log(Y),ot=.5*Math.exp(2*$/3),ct=.5*Math.sqrt($*ot*(Y-ot)/Y)*(J-Y/2<0?-1:1),ft=Math.max(F,Math.floor(R-J*ot/Y+ct)),Nt=Math.min(I,Math.floor(R+(Y-J)*ot/Y+ct));n(P,R,ft,Nt,V)}var Ot=P[R],mt=F,yt=I;for(i(P,F,R),V(P[I],Ot)>0&&i(P,F,I);mt<yt;){for(i(P,mt,yt),mt++,yt--;V(P[mt],Ot)<0;)mt++;for(;V(P[yt],Ot)>0;)yt--}V(P[F],Ot)===0?i(P,F,yt):(yt++,i(P,yt,I)),yt<=R&&(F=yt+1),R<=yt&&(I=yt-1)}}function i(P,R,F){var I=P[R];P[R]=P[F],P[F]=I}function a(P,R){return P<R?-1:P>R?1:0}var s=function(R){R===void 0&&(R=9),this._maxEntries=Math.max(4,R),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(R){var F=this.data,I=[];if(!b(R,F))return I;for(var V=this.toBBox,Y=[];F;){for(var J=0;J<F.children.length;J++){var $=F.children[J],ot=F.leaf?V($):$;b(R,ot)&&(F.leaf?I.push($):y(R,ot)?this._all($,I):Y.push($))}F=Y.pop()}return I},s.prototype.collides=function(R){var F=this.data;if(!b(R,F))return!1;for(var I=[];F;){for(var V=0;V<F.children.length;V++){var Y=F.children[V],J=F.leaf?this.toBBox(Y):Y;if(b(R,J)){if(F.leaf||y(R,J))return!0;I.push(Y)}}F=I.pop()}return!1},s.prototype.load=function(R){if(!(R&&R.length))return this;if(R.length<this._minEntries){for(var F=0;F<R.length;F++)this.insert(R[F]);return this}var I=this._build(R.slice(),0,R.length-1,0);if(!this.data.children.length)this.data=I;else if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var V=this.data;this.data=I,I=V}this._insert(I,this.data.height-I.height-1,!0)}return this},s.prototype.insert=function(R){return R&&this._insert(R,this.data.height-1),this},s.prototype.clear=function(){return this.data=E([]),this},s.prototype.remove=function(R,F){if(!R)return this;for(var I=this.data,V=this.toBBox(R),Y=[],J=[],$,ot,ct;I||Y.length;){if(I||(I=Y.pop(),ot=Y[Y.length-1],$=J.pop(),ct=!0),I.leaf){var ft=o(R,I.children,F);if(ft!==-1)return I.children.splice(ft,1),Y.push(I),this._condense(Y),this}!ct&&!I.leaf&&y(I,V)?(Y.push(I),J.push($),$=0,ot=I,I=I.children[0]):ot?($++,I=ot.children[$],ct=!1):I=null}return this},s.prototype.toBBox=function(R){return R},s.prototype.compareMinX=function(R,F){return R.minX-F.minX},s.prototype.compareMinY=function(R,F){return R.minY-F.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(R){return this.data=R,this},s.prototype._all=function(R,F){for(var I=[];R;)R.leaf?F.push.apply(F,R.children):I.push.apply(I,R.children),R=I.pop();return F},s.prototype._build=function(R,F,I,V){var Y=I-F+1,J=this._maxEntries,$;if(Y<=J)return $=E(R.slice(F,I+1)),l($,this.toBBox),$;V||(V=Math.ceil(Math.log(Y)/Math.log(J)),J=Math.ceil(Y/Math.pow(J,V-1))),$=E([]),$.leaf=!1,$.height=V;var ot=Math.ceil(Y/J),ct=ot*Math.ceil(Math.sqrt(J));O(R,F,I,ct,this.compareMinX);for(var ft=F;ft<=I;ft+=ct){var Nt=Math.min(ft+ct-1,I);O(R,ft,Nt,ot,this.compareMinY);for(var Ot=ft;Ot<=Nt;Ot+=ot){var mt=Math.min(Ot+ot-1,Nt);$.children.push(this._build(R,Ot,mt,V-1))}}return l($,this.toBBox),$},s.prototype._chooseSubtree=function(R,F,I,V){for(;V.push(F),!(F.leaf||V.length-1===I);){for(var Y=1/0,J=1/0,$=void 0,ot=0;ot<F.children.length;ot++){var ct=F.children[ot],ft=f(ct),Nt=g(R,ct)-ft;Nt<J?(J=Nt,Y=ft<Y?ft:Y,$=ct):Nt===J&&ft<Y&&(Y=ft,$=ct)}F=$||F.children[0]}return F},s.prototype._insert=function(R,F,I){var V=I?R:this.toBBox(R),Y=[],J=this._chooseSubtree(V,this.data,F,Y);for(J.children.push(R),u(J,V);F>=0&&Y[F].children.length>this._maxEntries;)this._split(Y,F),F--;this._adjustParentBBoxes(V,Y,F)},s.prototype._split=function(R,F){var I=R[F],V=I.children.length,Y=this._minEntries;this._chooseSplitAxis(I,Y,V);var J=this._chooseSplitIndex(I,Y,V),$=E(I.children.splice(J,I.children.length-J));$.height=I.height,$.leaf=I.leaf,l(I,this.toBBox),l($,this.toBBox),F?R[F-1].children.push($):this._splitRoot(I,$)},s.prototype._splitRoot=function(R,F){this.data=E([R,F]),this.data.height=R.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(R,F,I){for(var V,Y=1/0,J=1/0,$=F;$<=I-F;$++){var ot=c(R,0,$,this.toBBox),ct=c(R,$,I,this.toBBox),ft=p(ot,ct),Nt=f(ot)+f(ct);ft<Y?(Y=ft,V=$,J=Nt<J?Nt:J):ft===Y&&Nt<J&&(J=Nt,V=$)}return V||I-F},s.prototype._chooseSplitAxis=function(R,F,I){var V=R.leaf?this.compareMinX:h,Y=R.leaf?this.compareMinY:d,J=this._allDistMargin(R,F,I,V),$=this._allDistMargin(R,F,I,Y);J<$&&R.children.sort(V)},s.prototype._allDistMargin=function(R,F,I,V){R.children.sort(V);for(var Y=this.toBBox,J=c(R,0,F,Y),$=c(R,I-F,I,Y),ot=v(J)+v($),ct=F;ct<I-F;ct++){var ft=R.children[ct];u(J,R.leaf?Y(ft):ft),ot+=v(J)}for(var Nt=I-F-1;Nt>=F;Nt--){var Ot=R.children[Nt];u($,R.leaf?Y(Ot):Ot),ot+=v($)}return ot},s.prototype._adjustParentBBoxes=function(R,F,I){for(var V=I;V>=0;V--)u(F[V],R)},s.prototype._condense=function(R){for(var F=R.length-1,I=void 0;F>=0;F--)R[F].children.length===0?F>0?(I=R[F-1].children,I.splice(I.indexOf(R[F]),1)):this.clear():l(R[F],this.toBBox)};function o(P,R,F){if(!F)return R.indexOf(P);for(var I=0;I<R.length;I++)if(F(P,R[I]))return I;return-1}function l(P,R){c(P,0,P.children.length,R,P)}function c(P,R,F,I,V){V||(V=E(null)),V.minX=1/0,V.minY=1/0,V.maxX=-1/0,V.maxY=-1/0;for(var Y=R;Y<F;Y++){var J=P.children[Y];u(V,P.leaf?I(J):J)}return V}function u(P,R){return P.minX=Math.min(P.minX,R.minX),P.minY=Math.min(P.minY,R.minY),P.maxX=Math.max(P.maxX,R.maxX),P.maxY=Math.max(P.maxY,R.maxY),P}function h(P,R){return P.minX-R.minX}function d(P,R){return P.minY-R.minY}function f(P){return(P.maxX-P.minX)*(P.maxY-P.minY)}function v(P){return P.maxX-P.minX+(P.maxY-P.minY)}function g(P,R){return(Math.max(R.maxX,P.maxX)-Math.min(R.minX,P.minX))*(Math.max(R.maxY,P.maxY)-Math.min(R.minY,P.minY))}function p(P,R){var F=Math.max(P.minX,R.minX),I=Math.max(P.minY,R.minY),V=Math.min(P.maxX,R.maxX),Y=Math.min(P.maxY,R.maxY);return Math.max(0,V-F)*Math.max(0,Y-I)}function y(P,R){return P.minX<=R.minX&&P.minY<=R.minY&&R.maxX<=P.maxX&&R.maxY<=P.maxY}function b(P,R){return R.minX<=P.maxX&&R.minY<=P.maxY&&R.maxX>=P.minX&&R.maxY>=P.minY}function E(P){return{children:P,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function O(P,R,F,I,V){for(var Y=[R,F];Y.length;)if(F=Y.pop(),R=Y.pop(),!(F-R<=I)){var J=R+Math.ceil((F-R)/I/2)*I;e(P,J,R,F,V),Y.push(R,J,J,F)}}return s})})(Ug);var z2=Ug.exports,Dt=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}({}),_a=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)})}}])}(),j2=function(){function r(t){(0,N.Z)(this,r),this.clipSpaceNearZ=sc.NEGATIVE_ONE,this.plugins=[],this.config=(0,B.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)}}])}(),Ld=Ut,to=kt,Z2=ca,W2=$r,Yg=Pt,_d=qs,pn=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),_d(this.min,this.center,this.halfExtents),Ld(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(e,n){Ld(this.center,n,e),Yg(this.center,this.center,.5),_d(this.halfExtents,n,e),Yg(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],E=y[1],O=y[2],P=e.halfExtents,R=P[0],F=P[1],I=P[2],V=b-R,Y=b+R,J=E-F,$=E+F,ot=O-I,ct=O+I;V<h&&(h=V),Y>d&&(d=Y),J<f&&(f=J),$>v&&(v=$),ot<g&&(g=ot),ct>p&&(p=ct),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),E=Math.abs(u),O=Math.abs(h),P=Math.abs(d),R=Math.abs(f),F=Math.abs(v),I=Math.abs(g),V=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]+E*o[2],a[1]=O*o[0]+P*o[1]+R*o[2],a[2]=F*o[0]+I*o[1]+V*o[2],_d(this.min,i,a),Ld(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=Z2([0,0,0],this.getMin(),e.getMin()),a=W2([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}}])}(),G2=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 ye(e,this.normal)-this.distance}},{key:"normalize",value:function(){var e=1/us(this.normal);Pt(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&&_e(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}({}),V2=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 G2)}return(0,T.Z)(r,[{key:"extractFromVPMatrix",value:function(e){var n=(0,L.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],E=n[15];zt(this.planes[0].normal,o-i,h-l,g-d),this.planes[0].distance=E-p,zt(this.planes[1].normal,o+i,h+l,g+d),this.planes[1].distance=E+p,zt(this.planes[2].normal,o+a,h+c,g+f),this.planes[2].distance=E+y,zt(this.planes[3].normal,o-a,h-c,g-f),this.planes[3].distance=E-y,zt(this.planes[4].normal,o-s,h-u,g-v),this.planes[4].distance=E-b,zt(this.planes[5].normal,o+s,h+u,g+v),this.planes[5].distance=E+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})}}])}(),rn="Method not implemented.",ro="Use document.documentElement instead.",U2="Cannot append a destroyed element.";function io(r){return r===void 0?0:r>360||r<-360?r%360:r}var Dd=pt();function Dr(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):kt(Dd,r):ie(r)?n?Et(r,t,e):zt(Dd,r,t,e):n?Et(r[0],r[1]||t,r[2]||e):zt(Dd,r[0],r[1]||t,r[2]||e)}var Y2=Math.PI/180;function an(r){return r*Y2}var H2=180/Math.PI;function Gr(r){return r*H2}var X2=.9;function q8(r){return r%=400,r<0&&(r+=400),r*X2}function J8(r){return r/360}function K2(r){return 360*r}var oc=Math.PI/2;function Q2(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 q2(r,t){var e,n,i=Na(pt(),t),a=(0,L.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 Id(r,t){return t.length===16?q2(r,t):Q2(r,t)}function J2(r,t,e,n,i){var a=Math.cos(r),s=Math.sin(r);return Ew(n*a,i*s,0,-n*s,i*a,0,t,e,1)}function $2(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 Hg(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=Gr(u);return[r[6],r[7],a,s,h]}var Hi=Wt(),Ni=Wt(),Ho=An(),Me=[pt(),pt(),pt()],Xg=pt();function tS(r,t,e,n,i,a){if(!eS(Hi,r)||(we(Ni,Hi),Ni[3]=0,Ni[7]=0,Ni[11]=0,Ni[15]=1,Math.abs(Yt(Ni))<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(Ni,Ni);if(!f)return!1;be(Ni,Ni),M(i,Ho,Ni)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=u,t[2]=h,nS(Me,Hi),e[0]=gt(Me[0]),oe(Me[0],Me[0]),n[0]=ye(Me[0],Me[1]),Bd(Me[1],Me[1],Me[0],1,-n[0]),e[1]=gt(Me[1]),oe(Me[1],Me[1]),n[0]/=e[1],n[1]=ye(Me[0],Me[2]),Bd(Me[2],Me[2],Me[0],1,-n[1]),n[2]=ye(Me[1],Me[2]),Bd(Me[2],Me[2],Me[1],1,-n[2]),e[2]=gt(Me[2]),oe(Me[2],Me[2]),n[1]/=e[2],n[2]/=e[2],de(Xg,Me[1],Me[2]),ye(Me[0],Xg)<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 eS(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 nS(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 Bd(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 sn=function(r){return r[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",r}({}),Fd=function(r){return r[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",r}({}),gi=function(r){return r[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE",r}({}),Kg={UPDATED:"updated"},Qg=2e-4,qg=function(){function r(){(0,N.Z)(this,r),this.clipSpaceNearZ=sc.NEGATIVE_ONE,this.eventEmitter=new D,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=sn.EXPLORING,this.trackingMode=Fd.DEFAULT,this.projectionMode=gi.PERSPECTIVE,this.frustum=new V2,this.orthoMatrix=Wt()}return(0,T.Z)(r,[{key:"isOrtho",value:function(){return this.projectionMode===gi.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===sn.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===sn.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!==sn.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=Xn(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===gi.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===gi.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===gi.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===gi.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===gi.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===gi.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=ye(h,this.right)/gt(this.right),f=ye(h,this.up)/gt(this.up),v=this.getPosition(),g=(0,L.Z)(v,2),p=g[0],y=g[1],b=this.getFocalPoint(),E=(0,L.Z)(b,2),O=E[0],P=E[1];return this.setPosition(p-d,y-f),this.setFocalPoint(O-d,P-f),this}},{key:"setPerspective",value:function(e,n,i,a){var s;this.projectionMode=gi.PERSPECTIVE,this.fov=i,this.near=e,this.far=n,this.aspect=a;var o=this.near*Math.tan(an(.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 $2(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=gi.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?ag(this.projectionMatrix,f,v,g,p,s,o):sg(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=Dr(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=Dr(e,n,i),this.trackingMode===Fd.CINEMATIC){var s=Qt(pt(),this.focalPoint,this.position);e=s[0],n=s[1],i=s[2];var o=gt(s),l=Gr(Math.asin(n/o)),c=90+Gr(Math.atan2(i,e)),u=Wt();vn(u,u,an(c)),hn(u,u,an(l)),a=re(pt(),[0,1,0],u)}return Ze(this.matrix,og(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<Qg&&(this.distance=Qg),this.dollyingStep=this.distance/100;var n=pt();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===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.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===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.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===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.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=ka(Kn(),[0,0,1],an(this.roll));ge(this.matrix);var n=ka(Kn(),[1,0,0],an((this.rotateWorld&&this.type!==sn.TRACKING||this.type===sn.TRACKING?1:-1)*this.elevation)),i=ka(Kn(),[0,1,0],an((this.rotateWorld&&this.type!==sn.TRACKING||this.type===sn.TRACKING?1:-1)*this.azimuth)),a=Pa(Kn(),i,n);a=Pa(Kn(),a,e);var s=Wo(Wt(),a);this.type===sn.ORBITING||this.type===sn.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===sn.TRACKING&&(Ht(this.matrix,this.matrix,this.position),Jt(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(e,n,i){this.position=Dr(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(){kt(this.right,Dr(M(An(),[1,0,0,0],this.matrix))),kt(this.up,Dr(M(An(),[0,1,0,0],this.matrix))),kt(this.forward,Dr(M(An(),[0,0,1,0],this.matrix))),oe(this.right,this.right),oe(this.up,this.up),oe(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=gt(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===sn.TRACKING?(this.elevation=Gr(Math.asin(n/a)),this.azimuth=Gr(Math.atan2(-e,-i))):this.rotateWorld?(this.elevation=Gr(Math.asin(n/a)),this.azimuth=Gr(Math.atan2(-e,-i))):(this.elevation=-Gr(Math.asin(n/a)),this.azimuth=-Gr(Math.atan2(-e,-i)))}},{key:"_getPosition",value:function(){kt(this.position,Dr(M(An(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){Oe(this.distanceVector,[0,0,-this.distance],xw(ug(),this.matrix)),Ut(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Qt(pt(),this.focalPoint,this.position),this.distance=gt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===gi.ORTHOGRAPHIC){var e=this.position,n=ka(Kn(),[0,0,1],-this.roll*Math.PI/180);hs(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(Kg.UPDATED)}}},{key:"rotate",value:function(e,n,i){throw new Error(rn)}},{key:"pan",value:function(e,n){throw new Error(rn)}},{key:"dolly",value:function(e){throw new Error(rn)}},{key:"createLandmark",value:function(e,n){throw new Error(rn)}},{key:"gotoLandmark",value:function(e,n){throw new Error(rn)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(rn)}}])}(),rS=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}({}),iS=pt(),Xo=Wt(),aS=Kn();function Jg(r){if(r.localDirtyFlag){var t=r.localSkew[0]!==0||r.localSkew[1]!==0;if(t){hs(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=hs(Xo,hg(aS,0,0,0,1),zt(iS,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?Xn(n,i):ge(n):hs(n,a,i,s,o)}r.localDirtyFlag=!1}}function sS(r,t){r.dirtyFlag&&(t?Jt(r.worldTransform,t.worldTransform,r.localTransform):we(r.worldTransform,r.localTransform),r.dirtyFlag=!1)}var $g={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 zd(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function tp(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*",oS=/^#([0-9a-f]{3,8})$/,lS=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),cS=new RegExp(`^rgb\\(${Xi},${Xi},${Xi}\\)$`),uS=new RegExp(`^rgba\\(${ao},${ao},${ao},${qo}\\)$`),hS=new RegExp(`^rgba\\(${Xi},${Xi},${Xi},${qo}\\)$`),dS=new RegExp(`^hsl\\(${qo},${Xi},${Xi}\\)$`),fS=new RegExp(`^hsla\\(${qo},${Xi},${Xi},${qo}\\)$`),ep={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};zd(Ko,uc,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:np,formatHex:np,formatHex8:vS,formatHsl:gS,formatRgb:rp,toString:rp});function np(){return this.rgb().formatHex()}function vS(){return this.rgb().formatHex8()}function gS(){return lp(this).formatHsl()}function rp(){return this.rgb().formatRgb()}function uc(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=oS.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?ip(t):e===3?new Vr(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=lS.exec(r))?new Vr(t[1],t[2],t[3],1):(t=cS.exec(r))?new Vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=uS.exec(r))?hc(t[1],t[2],t[3],t[4]):(t=hS.exec(r))?hc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dS.exec(r))?op(t[1],t[2]/100,t[3]/100,1):(t=fS.exec(r))?op(t[1],t[2]/100,t[3]/100,t[4]):ep.hasOwnProperty(r)?ip(ep[r]):r==="transparent"?new Vr(NaN,NaN,NaN,0):null}function ip(r){return new Vr(r>>16&255,r>>8&255,r&255,1)}function hc(r,t,e,n){return n<=0&&(r=t=e=NaN),new Vr(r,t,e,n)}function pS(r){return r instanceof Ko||(r=uc(r)),r?(r=r.rgb(),new Vr(r.r,r.g,r.b,r.opacity)):new Vr}function mS(r,t,e,n){return arguments.length===1?pS(r):new Vr(r,t,e,n==null?1:n)}function Vr(r,t,e,n){this.r=+r,this.g=+t,this.b=+e,this.opacity=+n}zd(Vr,mS,tp(Ko,{brighter(r){return r=r==null?cc:Math.pow(cc,r),new Vr(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Qo:Math.pow(Qo,r),new Vr(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Vr(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:ap,formatHex:ap,formatHex8:yS,formatRgb:sp,toString:sp}));function ap(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function yS(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function sp(){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 op(r,t,e,n){return n<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new ki(r,t,e,n)}function lp(r){if(r instanceof ki)return new ki(r.h,r.s,r.l,r.opacity);if(r instanceof Ko||(r=uc(r)),!r)return new ki;if(r instanceof ki)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 ki(s,o,l,r.opacity)}function bS(r,t,e,n){return arguments.length===1?lp(r):new ki(r,t,e,n==null?1:n)}function ki(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}zd(ki,bS,tp(Ko,{brighter(r){return r=r==null?cc:Math.pow(cc,r),new ki(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Qo:Math.pow(Qo,r),new ki(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 Vr(jd(r>=240?r-240:r+120,i,n),jd(r,i,n),jd(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new ki(cp(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("}${cp(this.h)}, ${fc(this.s)*100}%, ${fc(this.l)*100}%${r===1?")":`, ${r})`}`}}));function cp(r){return r=(r||0)%360,r<0?r+360:r}function fc(r){return Math.max(0,Math.min(1,r||0))}function jd(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 jn(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(jn.Cache||Map),jn.cacheList.push(e.cache),e}jn.Cache=Map,jn.cacheList=[],jn.clearCache=function(){jn.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}({}),Pi=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}({}),xS=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),ES=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),wS=[{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}({}),SS=function(t){return wS.find(function(e){return e.name===t}).unit_type},MS=function(t){return t?t==="number"?te.kNumber:t==="percent"||t==="%"?te.kPercentage:SS(t):te.kUnknown},AS=function(t){switch(t){case te.kNumber:case te.kInteger:return Pi.kUNumber;case te.kPercentage:return Pi.kUPercent;case te.kPixels:return Pi.kULength;case te.kMilliseconds:case te.kSeconds:return Pi.kUTime;case te.kDegrees:case te.kRadians:case te.kGradians:case te.kTurns:return Pi.kUAngle;default:return Pi.kUOther}},TS=function(t){switch(t){case Pi.kUNumber:return te.kNumber;case Pi.kULength:return te.kPixels;case Pi.kUPercent:return te.kPercentage;case Pi.kUTime:return te.kSeconds;case Pi.kUAngle:return te.kDegrees;default:return te.kUnknown}},up=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(xS.kNo,ES.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}}])}(),OS=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,_.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),Da=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,_.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),pi=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,_.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),CS=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},Wd=function(t){return TS(AS(t))},on=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,_.Z)(this,t);var a;return typeof i=="string"?a=MS(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=Wd(this.unit);if(i!==Wd(n)||i===te.kUnknown)return null;var a=up(this.unit)/up(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=CS(c,h):s=c+(h||"")}else s="".concat(c).concat(u)}}return a+=s,a}}])}(vc),Ri=new on(0,"px");new on(1,"px");var ms=new on(0,"deg"),Gd=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,_.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,")")}}])}(OS),hp=new pi("unset"),NS=new pi("initial"),kS=new pi("inherit"),Vd={"":hp,unset:hp,initial:NS,inherit:kS},PS=function(t){return Vd[t]||(Vd[t]=new pi(t)),Vd[t]},dp=new Gd(0,0,0,0,!0),fp=new Gd(0,0,0,0),RS=jn(function(r,t,e,n){return new Gd(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 on(t,e)};new on(50,"%");function LS(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 _S=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(Ot){throw new Error("".concat(t,": ").concat(Ot))}function n(){var Ot=i();return t.length>0&&e("Invalid input not EOF"),Ot}function i(){return E(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(Ot,mt,yt){return o(mt,function(Rt){var jt=yt();return jt&&(ft(r.comma)||e("Missing comma before color stops")),{type:Ot,orientation:jt,colorStops:E(O)}})}function o(Ot,mt){var yt=ft(Ot);if(yt){ft(r.startCall)||e("Missing (");var Rt=mt(yt);return ft(r.endCall)||e("Missing )"),Rt}}function l(){return c()||u()}function c(){return ct("directional",r.sideOrCorner,1)}function u(){return ct("angular",r.angleValue,1)}function h(){var Ot,mt=d(),yt;return mt&&(Ot=[],Ot.push(mt),yt=t,ft(r.comma)&&(mt=d(),mt?Ot.push(mt):t=yt)),Ot}function d(){var Ot=f()||v();if(Ot)Ot.at=p();else{var mt=g();if(mt){Ot=mt;var yt=p();yt&&(Ot.at=yt)}else{var Rt=y();Rt&&(Ot={type:"default-radial",at:Rt})}}return Ot}function f(){var Ot=ct("shape",/^(circle)/i,0);return Ot&&(Ot.style=ot()||g()),Ot}function v(){var Ot=ct("shape",/^(ellipse)/i,0);return Ot&&(Ot.style=J()||g()),Ot}function g(){return ct("extent-keyword",r.extentKeywords,1)}function p(){if(ct("position",/^at/,0)){var Ot=y();return Ot||e("Missing positioning value"),Ot}}function y(){var Ot=b();if(Ot.x||Ot.y)return{type:"position",value:Ot}}function b(){return{x:J(),y:J()}}function E(Ot){var mt=Ot(),yt=[];if(mt)for(yt.push(mt);ft(r.comma);)mt=Ot(),mt?yt.push(mt):e("One extra comma");return yt}function O(){var Ot=P();return Ot||e("Expected color definition"),Ot.length=J(),Ot}function P(){return F()||V()||I()||R()}function R(){return ct("literal",r.literalColor,0)}function F(){return ct("hex",r.hexColor,1)}function I(){return o(r.rgbColor,function(){return{type:"rgb",value:E(Y)}})}function V(){return o(r.rgbaColor,function(){return{type:"rgba",value:E(Y)}})}function Y(){return ft(r.number)[1]}function J(){return ct("%",r.percentageValue,1)||$()||ot()}function $(){return ct("position-keyword",r.positionKeywords,1)}function ot(){return ct("px",r.pixelValue,1)||ct("em",r.emValue,1)}function ct(Ot,mt,yt){var Rt=ft(mt);if(Rt)return{type:Ot,value:Rt[yt]}}function ft(Ot){var mt=/^[\n\r\t\s]+/.exec(t);mt&&Nt(mt[0].length);var yt=Ot.exec(t);return yt&&Nt(yt[0].length),yt}function Nt(Ot){t=t.substring(Ot)}return function(Ot){return t=Ot,n()}}();function DS(r,t,e,n){var i=an(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 IS(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(Zr([0,0],[s,o]),Zr([0,e],[s,o]),Zr([t,e],[s,o]),Zr([t,0],[s,o]));return a&&(a instanceof on?l=a.value:a instanceof pi&&(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(Zr([0,0],[s,o]),Zr([0,e],[s,o]),Zr([t,e],[s,o]),Zr([t,0],[s,o]))))),{x:s+r[0],y:o+r[1],r:l}}var BS=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,FS=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,zS=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,vp=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function jS(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(!me(l)&&!me(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 ZS={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},WS=jn(function(r){var t;return r.type==="angular"?t=Number(r.value):t=ZS[r.value]||0,En(t,"deg")}),GS=jn(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)}}),VS=jn(function(r){if(r.indexOf("linear")>-1||r.indexOf("radial")>-1){var t=_S(r);return t.map(function(o){var l=o.type,c=o.orientation,u=o.colorStops;jS(u);var h=u.map(function(E){return{offset:En(Number(E.length.value),"%"),color:LS(E)}});if(l==="linear-gradient")return new gc(Da.LinearGradient,{angle:c?WS(c):ms,steps:h});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=GS(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=PS(b):g=En(b,y)}return new gc(Da.RadialGradient,{cx:f,cy:v,size:g,steps:h})}})}var e=r[0];if(r[1]==="("||r[2]==="("){if(e==="l"){var n=BS.exec(r);if(n){var i,a=((i=n[2].match(vp))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new gc(Da.LinearGradient,{angle:En(parseFloat(n[1]),"deg"),steps:a.map(function(o){var l=(0,L.Z)(o,2),c=l[0],u=l[1];return{offset:En(Number(c)*100,"%"),color:u}})})]}}else if(e==="r"){var s=US(r);if(s)if(Ge(s))r=s;else return[new gc(Da.RadialGradient,s)]}else if(e==="p")return YS(r)}});function US(r){var t=FS.exec(r);if(t){var e,n=((e=t[4].match(vp))===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,L.Z)(i,2),s=a[0],o=a[1];return{offset:En(Number(s)*100,"%"),color:o}})}}return null}function YS(r){var t=zS.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 $8(r){return!!r.type&&!!r.value}function ys(r){return r&&!!r.image}function pc(r){return r&&!me(r.r)&&!me(r.g)&&!me(r.b)}var Jo=jn(function(r){if(ys(r))return(0,B.Z)({repetition:"repeat"},r);if(me(r)&&(r=""),r==="transparent")return fp;if(r==="currentColor")r="black";else if(r==="none")return dp;var t=VS(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),RS.apply(void 0,n)});function HS(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(me(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 gp=function(t){return $o(new RegExp("px","g"),t)},XS=jn(gp),KS=function(t){return $o(new RegExp("%","g"),t)};jn(KS);var pp=function(t){return ie(t)||isFinite(Number(t))?En(Number(t)||0,"px"):$o(new RegExp("px|%|em|rem","g"),t)},Ud=jn(pp),mp=function(t){return $o(new RegExp("deg|rad|grad|turn","g"),t)},QS=jn(mp);function qS(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=Wd(r.unit),c=r.convertTo(l),u=t.convertTo(l);return c&&u?(s=c.value,o=u.value,a=Zd(r.unit)):(on.isLength(r.unit)||on.isLength(t.unit))&&(s=ei(r,i,e),o=ei(t,i,e),a="px"),[s,o,function(h){return n&&(h=Math.max(h,0)),h+a}]}function Ur(r){var t=0;return r.unit===te.kDegrees?t=r.value:r.unit===te.kRadians?t=Gr(Number(r.value)):r.unit===te.kTurns?t=K2(Number(r.value)):r.value&&(t=r.value),t}function yp(r,t){var e;return Array.isArray(r)?e=r.map(function(n){return Number(n)}):Ge(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 ei(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===Dt.GROUP?e.getLocalBounds():e.getGeometryBounds();return(n?i.min[t]:0)+r.value/100*i.halfExtents[t]*2}return 0}var JS=function(t){return $o(/deg|rad|grad|turn|px|%/g,t)},$S=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function tM(){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,$S.indexOf(n[1])>-1&&e.push({name:n[1],params:n[2].split(" ").map(function(a){return JS(a)||Jo(a)})}),t.lastIndex===r.length)return e}return[]}function bp(r){return r.toString()}var xp=function(t){return typeof t=="number"?En(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?En(Number(t)):En(0)},Yd=jn(xp);jn(function(r){return Ge(r)?r.split(" ").map(Yd):r.map(Yd)});function Hd(r,t){return[r,t,bp]}function Xd(r,t){return function(e,n){return[e,n,function(i){return bp(kn(i,r,t))}]}}function Ep(r,t){if(r.length===t.length)return[r,t,function(e){return e}]}function Kd(r){return r.parsedStyle.d.totalLength===0&&(r.parsedStyle.d.totalLength=Qw(r.parsedStyle.d.absolutePath)),r.parsedStyle.d.totalLength}function eM(r){return r.parsedStyle.points.totalLength===0&&(r.parsedStyle.points.totalLength=L2(r.parsedStyle.points.points)),r.parsedStyle.points.totalLength}function nM(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 rM(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 iM(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 aM(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=D2(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=k2(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=s.arcParams;u=A2(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,E=void 0;b[0]===d?(E=yc(y,t),d-=E.xExtra):b[0]===v&&(E=yc(y,t),v+=E.xExtra),b[1]===f?(E=yc(y,t),f-=E.yExtra):b[1]===g&&(E=yc(y,t),g+=E.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 wp(r,t){return[t[0]+(t[0]-r[0]),t[1]+(t[1]-r[1])]}var Sp=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},Mp=function(t,e,n,i,a,s,o,l){e=Math.abs(e),n=Math.abs(n),i=Eg(i,360);var c=an(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)},E={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},P=Sp({x:1,y:0},O),R={x:(-d.x-b.x)/e,y:(-d.y-b.y)/n},F=Sp(O,R);!s&&F>0?F-=2*Math.PI:s&&F<0&&(F+=2*Math.PI),F%=2*Math.PI;var I=P+F*l,V=e*Math.cos(I),Y=n*Math.sin(I),J={x:Math.cos(c)*V-Math.sin(c)*Y+E.x,y:Math.sin(c)*V+Math.cos(c)*Y+E.y,ellipticalArcStartAngle:P,ellipticalArcEndAngle:P+F,ellipticalArcAngle:I,ellipticalArcCenter:E,resultantRx:e,resultantRy:n};return J};function sM(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=oM(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=wp(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]],E=[l[3],l[4]];u.startTangent=[v[0]-b[0],v[1]-b[1]],u.endTangent=[e[0]-E[0],e[1]-E[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[b[0]-E[0],b[1]-E[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[E[0]-b[0],E[1]-b[1]])}else if(c==="S"){var O=t[o-1],P=wp(O.currentPoint,v),R=[l[1],l[2]];O.command==="C"?(u.command="C",u.startTangent=[v[0]-P[0],v[1]-P[1]],u.endTangent=[e[0]-R[0],e[1]-R[1]]):(u.command="SQ",u.startTangent=[v[0]-R[0],v[1]-R[1]],u.endTangent=[e[0]-R[0],e[1]-R[1]])}else if(c==="A"){var F=Ap(u,0),I=F.x,V=F.y,Y=Ap(u,1,!1),J=Y.x,$=Y.y;u.startTangent=[I,V],u.endTangent=[J,$]}t.push(u)}return t}function Ap(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=Mp({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!c,!!u,{x:r.currentPoint[0],y:r.currentPoint[1]},t),d=Mp({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 Qd(r,t){return bc(r)*bc(t)?(r[0]*t[0]+r[1]*t[1])/(bc(r)*bc(t)):1}function Tp(r,t){return(r[0]*t[1]<r[1]*t[0]?-1:1)*Math.acos(Qd(r,t))}function oM(r,t){var e=t[1],n=t[2],i=Eg(an(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,E=(l+u)/2+Math.sin(i)*p+Math.cos(i)*y,O=[(h-p)/e,(d-y)/n],P=[(-1*h-p)/e,(-1*d-y)/n],R=Tp([1,0],O),F=Tp(O,P);return Qd(O,P)<=-1&&(F=Math.PI),Qd(O,P)>=1&&(F=0),s===0&&F>0&&(F-=2*Math.PI),s===1&&F<0&&(F+=2*Math.PI),{cx:b,cy:E,rx:mc(r,[c,u])?0:e,ry:mc(r,[c,u])?0:n,startAngle:R,endAngle:R+F,xRotation:i,arcFlag:a,sweepFlag:s}}function lM(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 cM(r,t,e,n){return[["M",r,t],["L",e,n]]}function Op(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 uM(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 hM(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 t9(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.getLocalTransform(),e=[];switch(r.nodeName){case Dt.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=cM(a,o,c,h);break;case Dt.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=Op(v,v,p,b);break}case Dt.ELLIPSE:{var E=r.parsedStyle,O=E.rx,P=O===void 0?0:O,R=E.ry,F=R===void 0?0:R,I=E.cx,V=I===void 0?0:I,Y=E.cy,J=Y===void 0?0:Y;e=Op(P,F,V,J);break}case Dt.POLYLINE:case Dt.POLYGON:var $=r.parsedStyle.points;e=uM($.points,r.nodeName===Dt.POLYGON);break;case Dt.RECT:var ot=r.parsedStyle,ct=ot.width,ft=ct===void 0?0:ct,Nt=ot.height,Ot=Nt===void 0?0:Nt,mt=ot.x,yt=mt===void 0?0:mt,Rt=ot.y,jt=Rt===void 0?0:Rt,Xt=ot.radius,ee=Xt&&Xt.some(function(he){return he!==0});e=hM(ft,Ot,yt,jt,ee&&Xt.map(function(he){return clamp(he,0,Math.min(Math.abs(ft)/2,Math.abs(Ot)/2))}));break;case Dt.PATH:var ae=r.parsedStyle.d.absolutePath;e=_toConsumableArray(ae);break}if(e.length)return lM(e,r,t)}function e9(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],E=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]+E);case"Q":return"Q ".concat(s[1]," ").concat(s[2],",").concat(s[3]+b," ").concat(s[4]+E);case"C":return"C ".concat(s[1]," ").concat(s[2],",").concat(s[3]," ").concat(s[4],",").concat(s[5]+b," ").concat(s[6]+E);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 Cp=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))}nM(e);var n=rM(e),i=iM(e),a=i.polygons,s=i.polylines,o=sM(e),l=aM(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}}},dM=jn(Cp);function Np(r){return Ge(r)?dM(r):Cp(r)}function fM(r,t,e){var n=r.curve,i=t.curve;(!n||n.length===0)&&(n=Nd(r.absolutePath,!1),r.curve=n),(!i||i.length===0)&&(i=Nd(t.absolutePath,!1),t.curve=i);var a=[n,i];n.length!==i.length&&(a=Mg(n,i));var s=Ag(a[0])!==Ag(a[1])?o2(a[0]):l2(a[0]);return[s,u2(a[1],s),function(o){return o}]}function vM(r,t){var e;return Ge(r)?e=r.split(" ").map(function(n){var i=n.split(","),a=(0,L.Z)(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):e=r,{points:e,totalLength:0,segments:[]}}function gM(r,t){return[r.points,t.points,function(e){return e}]}var Pn=null,oo=/\s*(\w+)\(([^)]*)\)/g;function Yr(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",Yr([Pn,Pn,new on(1)]),bs],scaleX:["N",Yr([Pn,new on(1),new on(1)]),Yr([Pn,new on(1)])],scaleY:["N",Yr([new on(1),Pn,new on(1)]),Yr([new on(1),Pn])],scaleZ:["N",Yr([new on(1),new on(1),Pn])],scale3d:["NNN",bs],skew:["Aa",null,bs],skewX:["A",null,Yr([Pn,ms])],skewY:["A",null,Yr([ms,Pn])],translate:["Tt",Yr([Pn,Pn,Ri]),bs],translateX:["T",Yr([Pn,Ri,Ri]),Yr([Pn,Ri])],translateY:["T",Yr([Ri,Pn,Ri]),Yr([Ri,Pn])],translateZ:["L",Yr([Ri,Ri,Pn])],translate3d:["TTL",bs]};function kp(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 Pp(r){if(Array.isArray(r))return kp(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:QS(v)},N:Yd,T:Ud,L:XS}[h.toUpperCase()](u):d={a:ms,n:l[0],t:Ri}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),oo.lastIndex===r.length)return t}return[]}function pM(r){if(Array.isArray(r))return kp(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:mp(v)},N:xp,T:pp,L:gp}[h.toUpperCase()](u):d={a:ms,n:l[0],t:Ri}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),oo.lastIndex===r.length)return t}return[]}function mM(r){var t,e,n,i;switch(r.t){case"rotateX":return i=an(Ur(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=an(Ur(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=an(Ur(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=an(Ur(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=an(Ur(r.d[0])),h=an(Ur(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=an(Ur(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=an(Ur(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=ei(r.d[0],0,null)||0,e=ei(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=ei(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=ei(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=ei(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=ei(r.d[0],0,null)||0,e=ei(r.d[1],0,null)||0,n=ei(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=ei(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 yM(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 bM(r){return r.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:r.map(mM).reduce(yM)}function Rp(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 tS(bM(r),t,e,n,i,a),[[t,e,n,a,i]]}var xM=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 E=0;E<3;E++)l[b][E]*=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 EM(r){return r.toFixed(6).replace(".000000","")}function qd(r,t){var e,n;return r.decompositionPair!==t&&(r.decompositionPair=t,e=Rp(r)),t.decompositionPair!==r&&(t.decompositionPair=r,n=Rp(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=SM(e[0][3],n[0][3],i[5]),s=xM(i[0],i[1],i[2],a,i[4]),o=s.map(EM).join(",");return o}])}function wM(r,t){for(var e=0,n=0;n<r.length;n++)e+=r[n]*t[n];return e}function SM(r,t,e){var n=wM(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 Jd(r){return r.replace(/[XY]/,"")}function $d(r){return r.replace(/(X|Y|Z|3d)?$/,"3d")}var MM=function(t,e){return t==="perspective"&&e==="perspective"||(t==="matrix"||t==="matrix3d")&&(e==="matrix"||e==="matrix3d")};function AM(r,t,e){var n=!1;if(!r.length||!t.length){r.length||(n=!0,r=t,t=[]);for(var i=function(){var J=r[a],$=J.t,ot=J.d,ct=$.substring(0,5)==="scale"?1:0;t.push({t:$,d:ot.map(function(ft){return typeof ft=="number"?En(ct):En(ct,ft.unit)})})},a=0;a<r.length;a++)i()}var s=[],o=[],l=[];if(r.length!==t.length){var c=qd(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(MM(h,d)){var b=qd([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]&&Jd(h)===Jd(d))y=Jd(h),f=g[2](f),v=p[2](v);else if(g[1]&&p[1]&&$d(h)===$d(d))y=$d(h),f=g[1](f),v=p[1](v);else{var E=qd(r,t);s=[E[0]],o=[E[1]],l=[["matrix",[E[2]]]];break}for(var O=[],P=[],R=[],F=0;F<f.length;F++){var I=qS(f[F],v[F],e,!1,F);O[F]=I[0],P[F]=I[1],R.push(I[2])}s.push(O),o.push(P),l.push([y,R])}if(n){var V=s;s=o,o=V}return[s,o,function(Y){return Y.map(function(J,$){var ot=J.map(function(ct,ft){return l[$][1][ft](ct)}).join(",");return l[$][0]==="matrix"&&ot.split(",").length===16&&(l[$][0]="matrix3d"),l[$][0]==="matrix3d"&&ot.split(",").length===6&&(l[$][0]="matrix"),"".concat(l[$][0],"(").concat(ot,")")}).join(" ")}]}var TM=jn(function(r){if(Ge(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:[Ud(Lp(t[0])),Ud(Lp(t[1]))]}return[En(r[0]||0,"px"),En(r[1]||0,"px")]});function Lp(r){return r==="center"?"50%":r==="left"||r==="top"?"0%":r==="right"||r==="bottom"?"100%":r}var tf=[{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===Dt.PATH||t===Dt.POLYGON||t===Dt.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"}],OM=new Set(tf.filter(function(r){return!!r.l}).map(function(r){return r.n})),_p={},CM=function(){function r(t){var e=this;(0,N.Z)(this,r),this.runtime=t,tf.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){_p[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;NM(e,n);var o=!!i.forceUpdateGeometry;if(!o){for(var l in n)if(OM.has(l)){o=!0;break}}var c=Dp(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=tM(n.filter)),c.has("radius")&&!me(n.radius)&&(e.parsedStyle.radius=yp(n.radius,4)),c.has("lineDash")&&!me(n.lineDash)&&(e.parsedStyle.lineDash=yp(n.lineDash,"even")),c.has("points")&&n.points&&(e.parsedStyle.points=vM(n.points)),c.has("d")&&n.d===""&&(e.parsedStyle.d=(0,B.Z)({},$g)),c.has("d")&&n.d&&(e.parsedStyle.d=Np(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=Pp(n.transform)),c.has("transformOrigin")&&n.transformOrigin&&(e.parsedStyle.transformOrigin=TM(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")&&!me(n.zIndex)&&this.runtime.CSSPropertySyntaxFactory[$t.Z_INDEX].postProcessor(e),c.has("offsetDistance")&&!me(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.geometry.dirty=!0,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 pn),a.renderBounds||(a.renderBounds=new pn);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,E=b===void 0?0:b,O=[Math.abs(g),Math.abs(y),E],P=s.stroke,R=s.lineWidth,F=R===void 0?1:R,I=s.increasedLineWidthForHitTesting,V=I===void 0?0:I,Y=s.shadowType,J=Y===void 0?"outer":Y,$=s.shadowColor,ot=s.filter,ct=ot===void 0?[]:ot,ft=s.transformOrigin,Nt=[c,h,f];a.contentBounds.update(Nt,O);var Ot=n===Dt.POLYLINE||n===Dt.POLYGON||n===Dt.PATH?Math.SQRT2:.5,mt=P&&!P.isNone;if(mt){var yt=((F||0)+(V||0))*Ot;O[0]+=yt,O[1]+=yt}if(a.renderBounds.update(Nt,O),$&&J&&J!=="inner"){var Rt=a.renderBounds,jt=Rt.min,Xt=Rt.max,ee=s.shadowBlur,ae=s.shadowOffsetX,he=s.shadowOffsetY,ce=ee||0,xe=ae||0,Ce=he||0,je=jt[0]-ce+xe,Ue=Xt[0]+ce+xe,or=jt[1]-ce+Ce,Ke=Xt[1]+ce+Ce;jt[0]=Math.min(jt[0],je),Xt[0]=Math.max(Xt[0],Ue),jt[1]=Math.min(jt[1],or),Xt[1]=Math.max(Xt[1],Ke),a.renderBounds.setMinMax(jt,Xt)}ct.forEach(function(vr){var Aa=vr.name,Sr=vr.params;if(Aa==="blur"){var Jr=Sr[0].value;a.renderBounds.update(a.renderBounds.center,Ut(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[Jr,Jr,0]))}else if(Aa==="drop-shadow"){var Be=Sr[0].value,Qe=Sr[1].value,Fe=Sr[2].value,Ye=a.renderBounds,nn=Ye.min,pe=Ye.max,He=nn[0]-Fe+Be,qe=pe[0]+Fe+Be,tr=nn[1]-Fe+Qe,Je=pe[1]+Fe+Qe;nn[0]=Math.min(nn[0],He),pe[0]=Math.max(pe[0],qe),nn[1]=Math.min(nn[1],tr),pe[1]=Math.max(pe[1],Je),a.renderBounds.setMinMax(nn,pe)}}),e.geometry.dirty=!1;var hi=g<0,Pr=y<0,ns=(hi?-1:1)*(ft?ei(ft[0],0,e,!0):0),wr=(Pr?-1:1)*(ft?ei(ft[1],1,e,!0):0);(ns||wr)&&e.setOrigin(ns,wr)}}},{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===Dt.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===Dt.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))}}])}();function NM(r,t){var e=Dp(r);for(var n in t)e.has(n)&&(r.parsedStyle[n]=t[n])}function Dp(r){return r.constructor.PARSED_STYLE_LIST}var kM=function(){function r(){(0,N.Z)(this,r),this.mixer=Hd}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return Ur(i)}}])}(),PM=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 pi&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(e,n,i,a),e==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtyToRoot(o)}),i}}])}(),RM=function(){function r(){(0,N.Z)(this,r),this.parser=Jo,this.mixer=HS}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof pi?i.value==="none"?dp:fp:i}}])}(),LM=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i instanceof pi?[]:i}}])}();function Ip(r){var t=r.parsedStyle,e=t.fontSize;return me(e)?null:e}var ef=function(){function r(){(0,N.Z)(this,r),this.mixer=Hd}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a,s){if(ie(i))return i;if(on.isRelativeUnit(i.unit)){if(i.unit===te.kPercentage)return 0;if(i.unit===te.kEms){if(a.parentNode){var o=Ip(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=Ip(a.ownerDocument.documentElement);if(c)return c*=i.value,c}return 0}}else return i.value}}])}(),_M=function(){function r(){(0,N.Z)(this,r),this.mixer=Ep}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.map(function(a){return a.value})}}])}(),DM=function(){function r(){(0,N.Z)(this,r),this.mixer=Ep}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.map(function(a){return a.value})}}])}(),IM=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 pi&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),BM=function(){function r(){(0,N.Z)(this,r),this.mixer=Hd}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}}])}(),FM=function(){function r(){(0,N.Z)(this,r),this.mixer=Xd(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===Dt.LINE||s===Dt.PATH||s===Dt.POLYLINE){var o=i.getPoint(a);o&&e.setLocalPosition(o.x,o.y)}}}}])}(),zM=function(){function r(){(0,N.Z)(this,r),this.mixer=Xd(0,1)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}}])}(),jM=function(){function r(){(0,N.Z)(this,r),this.parser=Np,this.mixer=fM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i instanceof pi&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new no(0,0,0,0)}:i}}])}(),ZM=(0,T.Z)(function r(){(0,N.Z)(this,r),this.mixer=gM}),WM=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,_.Z)(this,t,[].concat(i)),e.mixer=Xd(0,1/0),e}return(0,C.Z)(t,r),(0,T.Z)(t)}(ef),GM=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof pi?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(e){e.nodeValue="".concat(e.parsedStyle.text)||""}}])}(),VM=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}}])}(),n9=function(t){return Object.fromEntries(Object.entries(t).filter(function(e){var n=_slicedToArray(e,2),i=n[1];return i!==void 0}))},nf=new WeakMap;function UM(r,t,e){if(r){var n=typeof r=="string"?document.getElementById(r):r;nf.has(n)&&nf.get(n).destroy(e),nf.set(n,t)}}var rf=typeof window!="undefined"&&typeof window.document!="undefined";function YM(r){return!!r.getAttribute}function HM(r,t){for(var e=0,n=r.length;e<n;){var i=e+n>>>1;Bp(r[i],t)<0?e=i+1:n=i}return e}function Bp(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 Fp(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 zp="px";function XM(r,t,e){rf&&r.style&&(r.style.width=t+zp,r.style.height=e+zp)}function jp(r,t){if(rf)return document.defaultView.getComputedStyle(r,null).getPropertyValue(t)}function KM(r){var t=jp(r,"width");return t==="auto"?r.offsetWidth:parseFloat(t)}function QM(r){var t=jp(r,"height");return t==="auto"?r.offsetHeight:parseFloat(t)}var qM=1,JM={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},af=typeof performance=="object"&&performance.now?performance:Date;function xc(r){return r.nodeName===Dt.FRAGMENT?!0:r.getRootNode().nodeName===Dt.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 $M=1,tA=function(){return $M++},Ki=typeof self=="object"&&self.self===self?self:typeof S.g=="object"&&S.g.global===S.g?S.g:{},eA=Date.now(),nA=function(){return Ki.performance&&typeof Ki.performance.now=="function"?Ki.performance.now():Date.now()-eA},el={},Zp=Date.now(),rA=function(t){if(typeof t!="function")throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Zp,i=n>16?0:16-n,a=tA();return el[a]=t,Object.keys(el).length>1||setTimeout(function(){Zp=e;var s=el;el={},Object.keys(s).forEach(function(o){return s[o](nA())})},i),a},iA=function(t){delete el[t]},aA=["","webkit","moz","ms","o"],Wp=function(t){return typeof t!="string"?rA:t===""?Ki.requestAnimationFrame:Ki["".concat(t,"RequestAnimationFrame")]},sA=function(t){return typeof t!="string"?iA:t===""?Ki.cancelAnimationFrame:Ki["".concat(t,"CancelAnimationFrame")]||Ki["".concat(t,"CancelRequestAnimationFrame")]},oA=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n+=1}},Gp=oA(aA,function(r){return!!Wp(r)}),sf=Wp(Gp),Vp=sA(Gp);Ki.requestAnimationFrame=sf,Ki.cancelAnimationFrame=Vp;var lA=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)}))}}])}(),cA=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,La.Z)((0,Tr.Z)().mark(function n(){var i,a,s,o,l=arguments;return(0,Tr.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=0;case 2:if(!(s<this.callbacks.length-1)){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}()}])}(),Ir=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)})}}])}(),of=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=0;o<this.callbacks.length-1;o++){var l=this.callbacks[o];s=l(s)}return s}return null}}])}(),uA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],hA=/([\"\'])[^\'\"]+\1/;function Up(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 Yp=jn(function(t){for(var e=Up(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();!hA.test(h)&&uA.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=Up(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)}),dA=1e-6,nl=function(t){return Math.max(t,dA)};function lf(r,t,e){return ge(r),r[4]=Math.tan(t),r[1]=Math.tan(e),r}var Zn=Wt(),fA=Wt(),vA={scale:function(t){gn(Zn,[t[0].value,t[1].value,1].map(function(e){return nl(e)}))},scaleX:function(t){gn(Zn,[t[0].value,1,1].map(function(e){return nl(e)}))},scaleY:function(t){gn(Zn,[1,t[0].value,1].map(function(e){return nl(e)}))},scaleZ:function(t){gn(Zn,[1,1,t[0].value].map(function(e){return nl(e)}))},scale3d:function(t){gn(Zn,[t[0].value,t[1].value,t[2].value].map(function(e){return nl(e)}))},translate:function(t){Xn(Zn,[t[0].value,t[1].value,0])},translateX:function(t){Xn(Zn,[t[0].value,0,0])},translateY:function(t){Xn(Zn,[0,t[0].value,0])},translateZ:function(t){Xn(Zn,[0,0,t[0].value])},translate3d:function(t){Xn(Zn,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Fn(Zn,an(Ur(t[0])))},rotateX:function(t){vi(Zn,an(Ur(t[0])))},rotateY:function(t){ze(Zn,an(Ur(t[0])))},rotateZ:function(t){Fn(Zn,an(Ur(t[0])))},rotate3d:function(t){ti(Zn,an(Ur(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){lf(Zn,an(t[0].value),an(t[1].value))},skewX:function(t){lf(Zn,an(t[0].value),0)},skewY:function(t){lf(Zn,0,an(t[0].value))},matrix:function(t){un(Zn,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){un.apply(A,[Zn].concat((0,k.Z)(t.map(function(e){return e.value}))))}},gA=Et(1,1,1),pA=pt(),Hp={translate:function(t,e){Vt.sceneGraphService.setLocalScale(t,gA,!1),Vt.sceneGraphService.setLocalEulerAngles(t,pA,void 0,void 0,!1),Vt.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Vt.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Xp(r,t){if(r.length){if(r.length===1&&Hp[r[0].t]){Hp[r[0].t](t,r[0].d);return}for(var e=ge(fA),n=0;n<r.length;n++){var i=r[n],a=i.t,s=i.d,o=vA[a];o&&(o(s),cg(e,e,Zn))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var mA=function(){function r(){(0,N.Z)(this,r),this.parser=pM,this.mixer=AM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof pi?[]:i}},{key:"postProcessor",value:function(e){Xp(e.parsedStyle.transform,e)}}])}(),yA=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()}}])}(),bA=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)}}}])}(),xA=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}}}])}(),EA=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}}}])}(),wA=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}}}])}(),SA=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}}}])}(),MA=function(){function r(){(0,N.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){if(e.points&&Wr(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}}}])}(),AA=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&&!Ge(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}}}])}(),TA=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,E=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())||{},P=O.offscreenCanvas,R=this.globalRuntime.textService.measureText(a,e,P);e.metrics=R;var F=R.width,I=R.height,V=F/2,Y=I/2,J=y+V;o==="center"||o==="middle"?J+=c/2-V:(o==="right"||o==="end")&&(J+=c-V*2);var $=E-Y;return h==="middle"?$+=Y:h==="top"||h==="hanging"?$+=Y*2:h==="alphabetic"||(h==="bottom"||h==="ideographic")&&($+=0),f&&(J+=f),g&&($+=g),{cx:J,cy:$,hwidth:V,hheight:Y}}}])}(),OA=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}}}])}(),CA=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 r9(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(rn)}}])}(),Kp=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,_.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(rn)}}])}(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,_.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)}}])}(Kp),cf=function(r){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,arguments)}return(0,C.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Kp),Qn=function(r){function t(e,n){var i;return(0,N.Z)(this,t),i=(0,_.Z)(this,t,[null]),i.type=e,i.detail=n,Object.assign(i,n),i}return(0,C.Z)(t,r),(0,T.Z)(t)}(Ec),Qp=function(){function r(){(0,N.Z)(this,r),this.emitter=new D}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 Qn(e,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,_.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===Dt.TEXT&&(n+=this.style.text);var i=(0,fs.Z)(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===Dt.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===Dt.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(rn)}},{key:"lookupNamespaceURI",value:function(n){throw new Error(rn)}},{key:"lookupPrefix",value:function(n){throw new Error(rn)}},{key:"normalize",value:function(){throw new Error(rn)}},{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}}])}(Qp);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 NA=2048,kA=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=pt(),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=af.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<NA&&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(cf);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(cf);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=af.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=YM(n)&&n.getAttribute("cursor");if(i)return i;n=On.isNode(n)&&n.parentNode}}}])}(),uf=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||Vt.offscreenCanvas)this.canvas=e||Vt.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,B.Z)({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,B.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,B.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}({}),PA=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 Ir,initAsync:new lA,dirtycheck:new of,cull:new of,beginFrame:new Ir,beforeRender:new Ir,render:new Ir,afterRender:new Ir,endFrame:new Ir,destroy:new Ir,pick:new cA,pickSync:new of,pointerDown:new Ir,pointerUp:new Ir,pointerMove:new Ir,pointerOut:new Ir,pointerOver:new Ir,pointerWheel:new Ir,pointerCancel:new Ir,click:new Ir},this.globalRuntime=t,this.context=e}return(0,T.Z)(r,[{key:"init",value:function(e){var n=this,i=(0,B.Z)((0,B.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;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var s=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(s.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),s.renderReasons.size&&this.inited){s.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=s.renderReasons.size===1&&s.renderReasons.has(lo.CAMERA_CHANGED),l=!e.disableRenderHooks||!o;l&&this.renderDisplayObject(s.root,e,s),this.hooks.beginFrame.call(n),l&&s.renderListCurrentFrame.forEach(function(c){a.hooks.beforeRender.call(c),a.hooks.render.call(c),a.hooks.afterRender.call(c)}),this.hooks.endFrame.call(n),s.renderListCurrentFrame=[],s.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,E=null;b&&(E=l?a.hooks.cull.call(b,a.context.camera):b,E&&(a.stats.rendered+=1,i.renderListCurrentFrame.push(E))),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=HM(n.sorted,s);n.sorted.splice(c,0,s)}}):n.sorted=e.childNodes.slice().sort(Bp),((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.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(lo.DISPLAY_OBJECT_CHANGED)}}])}(),RA=/\[\s*(.*)=(.*)\s*\]/,LA=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(RA),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 me(i)?"":i.toString?i.toString():""}}])}(),De=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,_.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 _A=new Qi(De.REPARENT,null,"","","",0,"",""),DA=Td(),Sc=pt(),IA=Et(1,1,1),BA=Wt(),FA=Td(),Es=pt(),zA=Wt(),ws=Kn(),jA=pt(),ZA=Kn(),WA=pt(),rl=pt(),Ss=pt(),Mc=Wt(),qp=Kn(),Jp=Kn(),Ac=Kn(),Tc={affectChildren:!0},GA=function(){function r(t){(0,N.Z)(this,r),this.pendingEvents=new Map,this.boundsChangedEvent=new Qn(De.BOUNDS_CHANGED),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===Dt.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.dirtifyFragment(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(_A,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 Jg(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,!ha(s.localPosition,rl)&&(kt(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;ha(n,Sc)||(cr(n,n,s.localRotation),Ut(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=hg(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(Jp,n[0],n[1],n[2]),dg(s.localRotation,s.localRotation,Jp),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]),!ha(Es,s.localScale)&&(kt(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=Nw(FA,n,i));var s=e.transformable;Cw(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(jA,n),a=Js(ZA,n),s=Na(WA,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,IA,!1),this.setLocalPosition(e,Sc,!1),this.setLocalEulerAngles(e,Sc,void 0,void 0,!1),this.setLocalSkew(e,DA,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 Na(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,!ha(this.getPosition(e),Ss)){if(kt(a.position,Ss),e.parentNode===null||!e.parentNode.transformable)kt(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)),!ha(n,Sc)&&(Ut(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=Aw(n,i,a,s)),e.parentNode===null||!e.parentNode.transformable)this.setLocalRotation(e,n);else{var l=this.getRotation(e.parentNode);ql(ws,l),Ad(ws,ws),Pa(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),Ad(Ac,Ac),Pa(o,Ac,o),Pa(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(qp,Ad(ws,o)),dg(s.localRotation,s.localRotation,qp),this.dirtyLocalTransform(e,s)}}},{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(!pn.isEmpty(a)){var s=i||new pn;return s.setFromTransformedAABB(a,this.getWorldTransform(e)),s}return null}},{key:"getGeometryBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=e,a=i.geometry;a.dirty&&Vt.styleValueRegistry.updateGeometry(e);var s=n?a.renderBounds:a.contentBounds||null;return s||new pn}},{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 pn,l.update(f.center,f.halfExtents)))}),l||(l=new pn),i){var u=Fp(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=BA;e.parentNode.transformable&&(n=Ze(zA,this.getWorldTransform(e.parentNode)));var i=this.getBounds(e);if(!pn.isEmpty(i)){var a=new pn;return a.setFromTransformedAABB(i,n),a}}return this.getBounds(e)}},{key:"getBoundingClientRect",value:function(e){var n,i,a=this.getGeometryBounds(e);pn.isEmpty(a)||(i=new pn,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,L.Z)(o,2),c=l[0],u=l[1],h=i.getMax(),d=(0,L.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;Jg(e.transformable),sS(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.dirtifyWorldInternal(e,n),this.dirtyToRoot(e,!0)}},{key:"dirtifyWorldInternal",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.dirtifyWorldInternal(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(c){var u;(u=c.dirty)===null||u===void 0||u.call(c,!0,!0)}),this.informDependentDisplayObjects(e),this.pendingEvents.set(e,i)}},{key:"dirtifyFragment",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.dirtifyFragment(e.childNodes[o]);e.nodeName===Dt.FRAGMENT&&this.pendingEvents.set(e,!1)}},{key:"triggerPendingEvents",value:function(){var e=this,n=new Set,i,a,s=function(l,c){if(!(!l.isConnected||n.has(l)||l.nodeName===Dt.FRAGMENT)){if(e.boundsChangedEvent.detail=c,e.boundsChangedEvent.target=l,l.isMutationObserved)l.dispatchEvent(e.boundsChangedEvent);else{if(i===void 0){var u;i=((u=l.ownerDocument.defaultView)===null||u===void 0||(u=u.getConfig())===null||u===void 0||(u=u.future)===null||u===void 0?void 0:u.experimentalCancelEventPropagation)===!0}l.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0,i)}n.add(l)}};this.pendingEvents.forEach(function(o,l){if(l.nodeName!==Dt.FRAGMENT){if(a===void 0){var c;a=((c=l.ownerDocument)===null||c===void 0||(c=c.defaultView)===null||c===void 0||(c=c.getConfig())===null||c===void 0||(c=c.future)===null||c===void 0?void 0:c.experimentalAttributeUpdateOptimization)===!0}Tc.affectChildren=o,a?s(l,Tc):o?l.forEach(function(u){s(u,Tc)}):s(l,Tc)}}),n.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.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(De.ATTR_MODIFIED,l,i,i,o,Qi.MODIFICATION,i,i),s,s),l.isCustomElement&&l.isConnected&&l.attributeChangedCallback&&l.attributeChangedCallback(o,i,i)})})}}}])}(),$p=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]},tm=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,VA=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,UA=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,YA=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,HA=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,XA=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,KA=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,QA=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,qA=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,JA=new RegExp("".concat(VA.source,"|").concat(YA.source,"|").concat(XA.source,"|").concat(QA.source)),$A=new RegExp("".concat(UA.source,"|").concat(HA.source,"|").concat(KA.source,"|").concat(qA.source)),tT=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&&($A.exec(i)||JA.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 $p(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 E=n.leading,O=E===void 0?0:E,P=Yp(n),R=this.measureFont(P,i);R.fontSize===0&&(R.fontSize=s,R.ascent=s);var F=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);F.font=P,n.isOverflowing=!1;var I=l?this.wordWrap(e,n,i):e,V=I.split(/(?:\r\n|\r|\n)/),Y=new Array(V.length),J=0;if(b){b.getTotalLength();for(var $=0;$<V.length;$++)F.measureText(V[$]).width+(V[$].length-1)*y}else{for(var ot=0;ot<V.length;ot++){var ct=F.measureText(V[ot]).width+(V[ot].length-1)*y;Y[ot]=ct,J=Math.max(J,ct)}var ft=J+h,Nt=c||R.fontSize+h,Ot=Math.max(Nt,R.fontSize+h)+(V.length-1)*(Nt+O);Nt+=O;var mt=0;return f==="middle"?mt=-Ot/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?mt=-Ot:(f==="top"||f==="hanging")&&(mt=0),{font:P,width:ft,height:Ot,lines:V,lineWidths:Y,lineHeight:Nt,maxLineWidth:J,fontProperties:R,lineMetrics:Y.map(function(yt,Rt){var jt=0;return g==="center"||g==="middle"?jt-=yt/2:(g==="right"||g==="end")&&(jt-=yt),new no(jt-h/2,mt+Rt*Nt,yt+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=[""],E=0,O=0,P=-1,R=Yp(n),F=this.charWidthCache.get(R);F||(F=new $p(500),this.charWidthCache.put(R,F));var I=function(yt){return a.getFromCache(yt,h,F,g)},V=I(y);function Y(mt,yt,Rt,jt){for(;I(mt)<jt&&yt<s.length-1&&!o.isNewline(s[yt+1]);)yt+=1,mt+=s[yt];for(;I(mt)>jt&&yt>=Rt;)yt-=1,mt=mt.slice(0,-1);return{lineTxt:mt,txtLastCharIndex:yt}}function J(mt,yt){if(!(V<=0||V>p)){if(!b[mt]){b[mt]=y;return}var Rt=Y(b[mt],yt,P+1,p-V);b[mt]=Rt.lineTxt+y}}for(var $=0;$<s.length;$++){var ot=s[$],ct=s[$-1],ft=s[$+1],Nt=I(ot);if(this.isNewline(ot)){if(E+1>=f){$<s.length-1&&J(E,$-1),n.isOverflowing=!0;break}P=$-1,E+=1,O=0,b[E]="";continue}if(Nt>p){J(E,$-1),n.isOverflowing=!0;break}if(O>0&&O+Nt>p){var Ot=Y(b[E],$-1,P+1,p);if(Ot.txtLastCharIndex!==$-1){if(b[E]=Ot.lineTxt,Ot.txtLastCharIndex===s.length-1)break;$=Ot.txtLastCharIndex+1,ot=s[$],ct=s[$-1],ft=s[$+1],Nt=I(ot)}if(E+1>=f){J(E,$-1),n.isOverflowing=!0;break}if(P=$-1,E+=1,O=0,b[E]="",this.isBreakingSpace(ot))continue;this.canBreakInLastChar(ot)||(b=this.trimToBreakable(b),O=this.sumTextWidthByCache(b[E]||"",I)),this.shouldBreakByKinsokuShorui(ot,ft)&&(b=this.trimByKinsokuShorui(b),O+=I(ct||""))}O+=Nt,b[E]+=ot}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&&tm.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(!tm.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()}}])}(),Vt={},eT=function(r){var t=new AA,e=new MA;return r={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.FRAGMENT,null),Dt.CIRCLE,new xA),Dt.ELLIPSE,new EA),Dt.RECT,t),Dt.IMAGE,t),Dt.GROUP,new OA),Dt.LINE,new wA),Dt.TEXT,new TA(Vt)),Dt.POLYLINE,e),Dt.POLYGON,e),(0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.PATH,new SA),Dt.HTML,new CA),Dt.MESH,null)}(),nT=function(r){var t=new RM,e=new ef;return r={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(r,$t.PERCENTAGE,null),$t.NUMBER,new BM),$t.ANGLE,new kM),$t.DEFINED_PATH,new PM),$t.PAINT,t),$t.COLOR,t),$t.FILTER,new LM),$t.LENGTH,e),$t.LENGTH_PERCENTAGE,e),$t.LENGTH_PERCENTAGE_12,new _M),(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(r,$t.LENGTH_PERCENTAGE_14,new DM),$t.COORDINATE,new ef),$t.OFFSET_DISTANCE,new FM),$t.OPACITY_VALUE,new zM),$t.PATH,new jM),$t.LIST_OF_POINTS,new ZM),$t.SHADOW_BLUR,new WM),$t.TEXT,new GM),$t.TEXT_TRANSFORM,new VM),$t.TRANSFORM,new mA),(0,se.Z)((0,se.Z)((0,se.Z)(r,$t.TRANSFORM_ORIGIN,new yA),$t.Z_INDEX,new bA),$t.MARKER,new IM)}(),rT=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:{}};Vt.CameraContribution=qg,Vt.AnimationTimeline=null,Vt.EasingFunction=null,Vt.offscreenCanvasCreator=new uf,Vt.sceneGraphSelector=new LA,Vt.sceneGraphService=new GA(Vt),Vt.textService=new tT(Vt),Vt.geometryUpdaterFactory=eT,Vt.CSSPropertySyntaxFactory=nT,Vt.styleValueRegistry=new CM(Vt),Vt.layoutRegistry=null,Vt.globalThis=rT(),Vt.enableStyleSyntax=!0,Vt.enableSizeAttenuation=!1;var em=0;function i9(){em=0}var hf=new Qi(De.INSERTED,null,"","","",0,"",""),df=new Qi(De.REMOVED,null,"","","",0,"",""),nm=new Qn(De.DESTROY),iT=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,_.Z)(this,t,[].concat(i)),e.entity=em++,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:rS.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?arguments[1]:!1;this.renderable.dirty=n,i&&(this.renderable.boundsDirty=n,this.renderable.renderBoundsDirty=n)}},{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(rn)}},{key:"appendChild",value:function(n,i){var a;if(n.destroyed)throw new Error(U2);return Vt.sceneGraphService.attach(n,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!xc(this)&&n.nodeName===Dt.FRAGMENT?this.ownerDocument.defaultView.mountFragment(n):this.ownerDocument.defaultView.mountChildren(n)),this.isMutationObserved&&(hf.relatedNode=this,n.dispatchEvent(hf)),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 df.relatedNode=this,n.dispatchEvent(df,s,s),(a=n.ownerDocument)!==null&&a!==void 0&&a.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),Vt.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 Vt.sceneGraphService.matches(n,this)}},{key:"getElementById",value:function(n){return Vt.sceneGraphService.querySelector("#".concat(n),this)}},{key:"getElementsByName",value:function(n){return Vt.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)}},{key:"getElementsByClassName",value:function(n){return Vt.sceneGraphService.querySelectorAll(".".concat(n),this)}},{key:"getElementsByTagName",value:function(n){return Vt.sceneGraphService.querySelectorAll(n,this)}},{key:"querySelector",value:function(n){return Vt.sceneGraphService.querySelector(n,this)}},{key:"querySelectorAll",value:function(n){return Vt.sceneGraphService.querySelectorAll(n,this)}},{key:"closest",value:function(n){var i=this;do{if(Vt.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(nm,i,i),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Vt.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Vt.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Vt.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Vt.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Vt.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,a,s){this.attributes[n]=i}},{key:"getAttributeNS",value:function(n,i){throw new Error(rn)}},{key:"getAttributeNode",value:function(n){throw new Error(rn)}},{key:"getAttributeNodeNS",value:function(n,i){throw new Error(rn)}},{key:"hasAttributeNS",value:function(n,i){throw new Error(rn)}},{key:"removeAttributeNS",value:function(n,i){throw new Error(rn)}},{key:"removeAttributeNode",value:function(n){throw new Error(rn)}},{key:"setAttributeNS",value:function(n,i,a){throw new Error(rn)}},{key:"setAttributeNode",value:function(n){throw new Error(rn)}},{key:"setAttributeNodeNS",value:function(n){throw new Error(rn)}},{key:"toggleAttribute",value:function(n,i){throw new Error(rn)}}])}(On);function Ve(r){return!!(r!=null&&r.nodeName)}var aT=Vt.globalThis.Proxy?Vt.globalThis.Proxy:function(){},qi=new Qi(De.ATTR_MODIFIED,null,null,null,null,Qi.MODIFICATION,null,null),il=pt(),sT=Kn(),yn=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,_.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||Dt.GROUP,e.initialParsedStyle&&Object.assign(n.parsedStyle,e.initialParsedStyle),n.initAttributes(e.style),Vt.enableStyleSyntax&&(n.style=new aT({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(){Cg(t,"destroy",this,3)([]),this.getAnimations().forEach(function(n){n.cancel()})}},{key:"cloneNode",value:function(n,i){var a=(0,B.Z)({},this.attributes);for(var s in a){var o=a[s];Ve(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(n)),i&&(a[s]=i(s,o))}var l=new this.constructor((0,B.Z)((0,B.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};Vt.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}),Cg(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];Vt.styleValueRegistry.processProperties(this,(0,se.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,L.Z)(i,2),s=a[0],o=a[1],l=n.getMax(),c=(0,L.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 Vt.sceneGraphService.setOrigin(this,Dr(n,i,a,!1)),this}},{key:"getOrigin",value:function(){return Vt.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 Vt.sceneGraphService.setPosition(this,Dr(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 Vt.sceneGraphService.setLocalPosition(this,Dr(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 Vt.sceneGraphService.translate(this,Dr(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 Vt.sceneGraphService.translateLocal(this,Dr(n,i,a,!1)),this}},{key:"getPosition",value:function(){return Vt.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Vt.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=Dr(n,i,a,!1)),Vt.sceneGraphService.scaleLocal(this,n),this}},{key:"setLocalScale",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=Dr(n,i,a,!1)),Vt.sceneGraphService.setLocalScale(this,n),this}},{key:"getLocalScale",value:function(){return Vt.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Vt.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var n=Id(il,Vt.sceneGraphService.getWorldTransform(this)),i=(0,L.Z)(n,3),a=i[2];return Gr(a)}},{key:"getLocalEulerAngles",value:function(){var n=Id(il,Vt.sceneGraphService.getLocalRotation(this)),i=(0,L.Z)(n,3),a=i[2];return Gr(a)}},{key:"setEulerAngles",value:function(n){return Vt.sceneGraphService.setEulerAngles(this,0,0,n),this}},{key:"setLocalEulerAngles",value:function(n){return Vt.sceneGraphService.setLocalEulerAngles(this,0,0,n),this}},{key:"rotateLocal",value:function(n,i,a){return me(i)&&me(a)?Vt.sceneGraphService.rotateLocal(this,0,0,n):Vt.sceneGraphService.rotateLocal(this,n,i,a),this}},{key:"rotate",value:function(n,i,a){return me(i)&&me(a)?Vt.sceneGraphService.rotate(this,0,0,n):Vt.sceneGraphService.rotate(this,n,i,a),this}},{key:"setRotation",value:function(n,i,a,s){return Vt.sceneGraphService.setRotation(this,n,i,a,s),this}},{key:"setLocalRotation",value:function(n,i,a,s){return Vt.sceneGraphService.setLocalRotation(this,n,i,a,s),this}},{key:"setLocalSkew",value:function(n,i){return Vt.sceneGraphService.setLocalSkew(this,n,i),this}},{key:"getRotation",value:function(){return Vt.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Vt.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Vt.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Vt.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Vt.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(n){return Vt.sceneGraphService.setLocalTransform(this,n),this}},{key:"resetLocalTransform",value:function(){Vt.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?zn(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,L.Z)(a,2),o=s[0],l=s[1],c=Na(il,i),u=(0,L.Z)(c,2),h=u[0],d=u[1],f=Js(sT,i),v=Id(il,f),g=(0,L.Z)(v,3),p=g[0],y=g[2];return J2(p||y,o,l,h,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(n){var i=Hg(n),a=(0,L.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=Hg(n),a=(0,L.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}}])}(iT);yn.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,_.Z)(this,t,[(0,B.Z)({type:Dt.CIRCLE},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);Ji.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var oT=["style"],ff=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,oT);return(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({style:i},a)]),e.isCustomElement=!0,e}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);ff.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,_.Z)(this,t,[(0,B.Z)({type:Dt.ELLIPSE},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);al.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var lT=function(r){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,[{type:Dt.FRAGMENT}])}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);lT.PARSED_STYLE_LIST=new Set(["class","className"]);var rr=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.GROUP},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);rr.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var cT=["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,cT);return(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.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(!pn.isEmpty(i)){var a=new pn;return a.setFromTransformedAABB(i,n),a}}return this.getBounds()}}])}(yn);co.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.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,_.Z)(this,t,[(0,B.Z)({type:Dt.IMAGE},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);sl.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var uT=["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,uT);(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.LINE,style:(0,B.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&&Ve(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),l&&Ve(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&&Ve(s)&&(this.markerStartAngle=0,s.remove()),o&&Ve(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"&&(s&&Ve(s)&&(this.markerEndAngle=0,s.remove()),o&&Ve(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||!Ve(f))){var v=0,g,p,y,b,E,O;n?(y=c,b=h,g=u-c,p=d-h,E=o||0,O=this.markerStartAngle):(y=u,b=d,g=c-u,p=h-d,E=l||0,O=this.markerEndAngle),v=Math.atan2(p,g),f.setLocalEulerAngles(v*180/Math.PI+O),f.setLocalPosition(y+Math.cos(v)*E,b+Math.sin(v)*E)}}},{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(pt(),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 _g(i,a,s,o)}}])}(yn);As.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var hT=["style"],ni=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,vs.Z)(n,hT);(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.PATH,style:i,initialParsedStyle:{miterLimit:4,d:(0,B.Z)({},$g)}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ve(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ve(c)&&e.placeMarkerMid(c),l&&Ve(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&&Ve(s)&&(this.markerStartAngle=0,s.remove()),o&&Ve(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Ve(s)&&(this.markerEndAngle=0,s.remove()),o&&Ve(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||!Ve(c))){var u=0,h,d,f,v,g,p;if(n){var y=this.getStartTangent(),b=(0,L.Z)(y,2),E=b[0],O=b[1];f=O[0],v=O[1],h=E[0]-O[0],d=E[1]-O[1],g=o||0,p=this.markerStartAngle}else{var P=this.getEndTangent(),R=(0,L.Z)(P,2),F=R[0],I=R[1];f=I[0],v=I[1],h=F[0]-I[0],d=F[1]-I[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&&Ve(n))for(var a=1;a<i.length-1;a++){var s=(0,L.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 Kd(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=g2(a,n),o=s.x,l=s.y,c=re(pt(),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*Kd(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}}])}(yn);ni.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var dT=["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,dT);(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.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&&Ve(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ve(c)&&e.placeMarkerMid(c),l&&Ve(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&&Ve(s)&&(this.markerStartAngle=0,s.remove()),o&&Ve(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Ve(s)&&(this.markerEndAngle=0,s.remove()),o&&Ve(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||!Ve(d)||!h)){var f=0,v,g,p,y,b,E;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,E=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,E=this.markerEndAngle}f=Math.atan2(g,v),d.setLocalEulerAngles(f*180/Math.PI+E),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&&Ve(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)}}}])}(yn);Ts.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var fT=["style"],Oc=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.style,i=(0,vs.Z)(e,fT);return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.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 eM(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=_g(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(pt(),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);Oc.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,_.Z)(this,t,[(0,B.Z)({type:Dt.RECT},e)])}return(0,C.Z)(t,r),(0,T.Z)(t)}(yn);pr.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var vT=["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,vT);return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.TEXT,style:(0,B.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}}])}(yn);Os.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.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","textPathSide","textPathStartOffset","metrics","dx","dy"]));var gT=function(){function r(){(0,N.Z)(this,r),this.registry={},this.define(Dt.CIRCLE,Ji),this.define(Dt.ELLIPSE,al),this.define(Dt.RECT,pr),this.define(Dt.IMAGE,sl),this.define(Dt.LINE,As),this.define(Dt.GROUP,rr),this.define(Dt.PATH,ni),this.define(Dt.POLYGON,Ts),this.define(Dt.POLYLINE,Oc),this.define(Dt.TEXT,Os),this.define(Dt.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]}}])}(),a9={number:function(t){return new on(t)},percent:function(t){return new on(t,"%")},px:function(t){return new on(t,"px")},em:function(t){return new on(t,"em")},rem:function(t){return new on(t,"rem")},deg:function(t){return new on(t,"deg")},grad:function(t){return new on(t,"grad")},rad:function(t){return new on(t,"rad")},turn:function(t){return new on(t,"turn")},s:function(t){return new on(t,"s")},ms:function(t){return new on(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,i=t.interpolable,a=t.initialValue,s=t.syntax;Vt.styleValueRegistry.registerMetadata({n:e,inh:n,int:i,d:a,syntax:s})},registerLayout:function(t,e){Vt.layoutRegistry.registerLayout(t,e)}},rm=function(r){function t(){var e;(0,N.Z)(this,t),e=(0,_.Z)(this,t),e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Vt.AnimationTimeline(e)}catch(i){}var n={};return tf.forEach(function(i){var a=i.n,s=i.inh,o=i.d;s&&o&&(n[a]=fe(o)?o(Dt.GROUP):o)}),e.documentElement=new rr({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:rr);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(rn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}}},{key:"elementsFromBBox",value:function(n,i,a,s){var o=this.defaultView.context.rBushRoot,l=o.search({minX:n,minY:i,maxX:a,maxY:s}),c=[];return l.forEach(function(u){var h=u.displayObject,d=h.parsedStyle.pointerEvents,f=d===void 0?"auto":d,v=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(f);(!v||v&&h.isVisible())&&!h.isCulled()&&h.isInteractive()&&c.push(h)}),c.sort(function(u,h){return h.sortable.renderOrder-u.sortable.renderOrder}),c}},{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,La.Z)((0,Tr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Tr.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,La.Z)((0,Tr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Tr.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),im=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 Qn(De.CULLED),h,h),null}return l}),a.hooks.afterRender.tap(r.tag,function(l){l.cullable.visibilityPlaneMask=-1})}}])}();im.tag="Culling";var am=function(){function r(){var t=this;(0,N.Z)(this,r),this.autoPreventDefault=!1,this.rootPointerEvent=new wc(null),this.rootWheelEvent=new cf(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,fs.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,fs.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,fs.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,fs.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,fs.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=JM[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=af.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=qM),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}}])}();am.tag="Event";var pT=[Dt.CIRCLE,Dt.ELLIPSE,Dt.IMAGE,Dt.RECT,Dt.LINE,Dt.POLYLINE,Dt.POLYGON,Dt.TEXT,Dt.PATH,Dt.HTML],mT=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(pn.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=pT.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(ye(d,n.getPositiveFarPoint(a[l]))+f<0)return eo.OUTSIDE;ye(d,n.getNegativeFarPoint(a[l]))+f<0&&(s|=u)}}return s}}])}(),sm=function(){function r(){(0,N.Z)(this,r),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this,i,a,s=e.config,o=e.renderingService,l=e.renderingContext,c=e.rBushRoot,u=l.root.ownerDocument.defaultView;this.rBush=c;var h=function(b){o.dirtify()},d=function(b){n.syncTasks.set(b.target,b.detail.affectChildren),o.dirtify()},f=function(b){var E=b.target;Vt.enableSizeAttenuation&&Vt.styleValueRegistry.updateSizeAttenuation(E,u.getCamera().getZoom())},v=function(b){var E=b.target,O=E.rBushNode;O!=null&&O.aabb&&n.rBush.remove(O.aabb),n.syncTasks.delete(E),Vt.sceneGraphService.dirtyToRoot(E),o.dirtify()};o.hooks.init.tap(r.tag,function(){u.addEventListener(De.MOUNTED,f),u.addEventListener(De.UNMOUNTED,v),u.addEventListener(De.ATTR_MODIFIED,h),u.addEventListener(De.BOUNDS_CHANGED,d)}),o.hooks.destroy.tap(r.tag,function(){u.removeEventListener(De.MOUNTED,f),u.removeEventListener(De.UNMOUNTED,v),u.removeEventListener(De.ATTR_MODIFIED,h),u.removeEventListener(De.BOUNDS_CHANGED,d),n.syncTasks.clear()});var g=(i=Vt.globalThis.requestIdleCallback)!==null&&i!==void 0?i:sf.bind(Vt.globalThis),p=((a=s.future)===null||a===void 0?void 0:a.experimentalRICSyncRTree)===!0;o.hooks.endFrame.tap(r.tag,function(){n.isFirstTimeRendering?(n.isFirstTimeRendering=!1,n.syncing=!0,g(function(){n.syncRTree(!0),n.isFirstTimeRenderingFinished=!0})):p&&Vt.globalThis.requestIdleCallback&&Vt.globalThis.cancelIdleCallback?(Vt.globalThis.cancelIdleCallback(n.ricSyncRTreeId),n.ricSyncRTreeId=Vt.globalThis.requestIdleCallback(function(){return n.syncRTree()})):n.syncRTree()})}},{key:"syncNode",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.isConnected){var i=e.rBushNode;i.aabb&&this.rBush.remove(i.aabb);var a=e.getRenderBounds();if(a){var s=e.renderable;n&&(s.dirtyRenderBounds||(s.dirtyRenderBounds=new pn),s.dirtyRenderBounds.update(a.center,a.halfExtents));var o=a.getMin(),l=(0,L.Z)(o,2),c=l[0],u=l[1],h=a.getMax(),d=(0,L.Z)(h,2),f=d[0],v=d[1];i.aabb||(i.aabb={}),i.aabb.displayObject=e,i.aabb.minX=c,i.aabb.minY=u,i.aabb.maxX=f,i.aabb.maxY=v}if(i.aabb&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.minX)&&!isNaN(i.aabb.minY))return i.aabb}}},{key:"syncRTree",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(!n&&(this.syncing||this.syncTasks.size===0))){this.syncing=!0;var i=[],a=new Set,s=function(l){if(!a.has(l)&&l.renderable){var c=e.syncNode(l,n);c&&(i.push(c),a.add(l))}};this.syncTasks.forEach(function(o,l){o&&l.forEach(s);for(var c=l;c;)s(c),c=c.parentElement}),this.rBush.load(i),i.length=0,this.syncing=!1}}}])}();sm.tag="Prepare";function s9(r){return!!r.document}var ri=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}({}),om=500,yT=.1,bT=1e3,Cc=new Qn(De.MOUNTED),Nc=new Qn(De.UNMOUNTED),vf=new Qn(ri.BEFORE_RENDER),lm=new Qn(ri.RERENDER),gf=new Qn(ri.AFTER_RENDER),pf=function(r){function t(e){var n;(0,N.Z)(this,t),n=(0,_.Z)(this,t),n.Element=yn,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,E=e.supportsTouchEvents,O=e.supportsPointerEvents,P=e.isTouchEvent,R=e.isMouseEvent,F=e.dblClickSpeed,I=o,V=l,Y=g||rf&&window.devicePixelRatio||1;return Y=Y>=1?Math.ceil(Y):1,a&&(I=o||KM(a)||a.width/Y,V=l||QM(a)||a.height/Y),n.customElements=new gT,n.devicePixelRatio=Y,n.requestAnimationFrame=p!=null?p:sf.bind(Vt.globalThis),n.cancelAnimationFrame=y!=null?y:Vp.bind(Vt.globalThis),n.createImage=b!=null?b:function(){return new window.Image},n.supportsTouchEvents=E!=null?E:"ontouchstart"in Vt.globalThis,n.supportsPointerEvents=O!=null?O:!!Vt.globalThis.PointerEvent,n.isTouchEvent=P!=null?P:function(J){return n.supportsTouchEvents&&J instanceof Vt.globalThis.TouchEvent},n.isMouseEvent=R!=null?R:function(J){return!Vt.globalThis.MouseEvent||J instanceof Vt.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(J instanceof Vt.globalThis.PointerEvent))},v&&(Vt.offscreenCanvas=v),n.document=new rm,n.document.defaultView=n,h||UM(i,n,f),n.initRenderingContext((0,B.Z)((0,B.Z)({},e),{},{width:I,height:V,background:c!=null?c:"transparent",cursor:u!=null?u:"default",cleanUpOnDestroy:f,devicePixelRatio:Y,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:F!=null?F:200})),n.initDefaultCamera(I,V,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 Vt.CameraContribution;o.clipSpaceNearZ=a,o.setType(sn.EXPLORING,Fd.DEFAULT).setPosition(n/2,i/2,om).setFocalPoint(n/2,i/2,0).setOrthographic(n/-2,n/2,i/2,i/-2,yT,bT),o.canvas=this,o.eventEmitter.on(Kg.UPDATED,function(){s.context.renderingContext.renderReasons.add(lo.CAMERA_CHANGED),Vt.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){Vt.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;jn.clearCache();var s=((n=this.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;a||this.dispatchEvent(new Qn(ri.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(),this.context.rBushRoot&&this.context.rBushRoot.clear(),a||this.dispatchEvent(new Qn(ri.AFTER_DESTROY),s,s);var l=function(u){u.currentTarget=null,u.manager=null,u.target=null,u.relatedNode=null};l(Cc),l(Nc),l(vf),l(lm),l(gf),l(qi),l(hf),l(df),l(nm),Vt.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,om).setFocalPoint(n/2,i/2,0),l===gi.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 Qn(ri.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&&(vf.detail=n,gf.detail=n);var s=((i=this.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;this.dispatchEvent(vf,s,s);var o=this.getRenderingService();o.render(this.getConfig(),n,function(){a.dispatchEvent(lm,s,s)}),this.dispatchEvent(gf,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.rBushRoot=new z2,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new am,new sm,new im([new mT])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService((0,B.Z)((0,B.Z)({},Vt),this.context)),this.context.renderingService=new PA(Vt,this.context),this.context.eventService=new kA(Vt,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 Qn(ri.READY),l,l)}):i.dispatchEvent(new Qn(ri.READY),l,l):i.dispatchEvent(new Qn(ri.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(Vt)})}},{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(Vt)}),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(Nc);else{var a,s=((a=this.getConfig().future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;Nc.target=n,this.dispatchEvent(Nc,!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(Cc);else{var s,o=((s=this.getConfig().future)===null||s===void 0?void 0:s.experimentalCancelEventPropagation)===!0;Cc.target=n,this.dispatchEvent(Cc,!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})}}])}(Qp);var xT=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,_.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===sn.EXPLORING){var s=ka(Kn(),[1,0,0],an((this.rotateWorld?1:-1)*this.relElevation)),o=ka(Kn(),[0,1,0],an((this.rotateWorld?1:-1)*this.relAzimuth)),l=ka(Kn(),[0,0,1],an(this.relRoll)),c=Pa(Kn(),o,s);c=Pa(Kn(),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===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(n,i){var a=Dr(n,i,0),s=wt(this.position);return Ut(s,s,Pt(pt(),this.right,a[0])),Ut(s,s,Pt(pt(),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===sn.ORBITING||this.type===sn.EXPLORING?this._getDistance():this.type===sn.TRACKING&&Ut(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 Vt.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:ue(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=Ge(n)?this.landmarks.find(function(J){return J.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 E=s.position,O=s.focalPoint,P=s.zoom,R=s.roll,F=f||Vt.EasingFunction(c),I,V=function(){i.setFocalPoint(O),i.setPosition(E),i.setRoll(R),i.setZoom(P),i.computeMatrix(),i.triggerUpdate(),g==null||g()};if(h===0)return V();var Y=function($){I===void 0&&(I=$);var ot=$-I;if(ot>=h){V();return}var ct=F(ot/h),ft=pt(),Nt=pt(),Ot=1,mt=0;_e(ft,i.focalPoint,O,ct),_e(Nt,i.position,E,ct),mt=i.roll*(1-ct)+R*ct,Ot=i.zoom*(1-ct)+P*ct,i.setFocalPoint(ft),i.setPosition(Nt),i.setRoll(mt),i.setZoom(Ot);var yt=ls(ft,O)+ls(Nt,E);if(yt<=b&&P===void 0&&R===void 0)return V();i.computeMatrix(),i.triggerUpdate(),ot<h&&(y==null||y(ct),i.landmarkAnimationID=i.canvas.requestAnimationFrame(Y))};this.canvas.requestAnimationFrame(Y)}}}])}(qg);Vt.CameraContribution=xT;var cm=null,o9=0,um=new WeakMap,l9=null,c9=null,kc,fa;function u9(r,t){return kc=new cm(r,t)}function h9(r){return fa||(fa=cm.copy(kc),fa.oldValue=r,fa)}function d9(){kc=fa=void 0}function ET(r){return r===fa||r===kc}function f9(r,t){return r===t?r:fa&&ET(r)?fa:null}function wT(r){r.nodes.forEach(function(t){var e=um.get(t);e&&e.forEach(function(n){n.observer===r&&n.removeTransientObservers()})})}function v9(r,t){for(var e=r;e;e=e.parentNode){var n=um.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 mf=!1,yf=null;function g9(r){yf.push(r),mf||(mf=!0,typeof runtime.globalThis!="undefined"?runtime.globalThis.setTimeout(bf):bf())}function bf(){mf=!1;var r=yf;yf=[],r.sort(function(e,n){return e.uid-n.uid});var t=!1;r.forEach(function(e){var n=e.takeRecords();wT(e),n.length&&(e.callback(n,e),t=!0)}),t&&bf()}var xf=function(r){function t(e,n,i,a){var s;return(0,N.Z)(this,t),s=(0,_.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),ST=0,MT=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(ST++),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 xf(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(rn)}},{key:"addEventListener",value:function(e,n,i){throw new Error(rn)}},{key:"removeEventListener",value:function(e,n,i){throw new Error(rn)}},{key:"dispatchEvent",value:function(e){throw new Error(rn)}},{key:"commitStyles",value:function(){throw new Error(rn)}},{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 xf(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 xf(null,this,this.currentTime,e);this.onframe(a)}this._finishedFlag=!1}}}])}(),AT=4,TT=.001,OT=1e-7,CT=10,ol=11,Pc=1/(ol-1),NT=typeof Float32Array=="function",hm=function(t,e){return 1-3*e+3*t},dm=function(t,e){return 3*e-6*t},fm=function(t){return 3*t},Rc=function(t,e,n){return((hm(e,n)*t+dm(e,n))*t+fm(e))*t},vm=function(t,e,n){return 3*hm(e,n)*t*t+2*dm(e,n)*t+fm(e)},kT=function(t,e,n,i,a){var s,o,l=0;do o=e+(n-e)/2,s=Rc(o,i,a)-t,s>0?n=o:e=o;while(Math.abs(s)>OT&&++l<CT);return o},PT=function(t,e,n,i){for(var a=0;a<AT;++a){var s=vm(e,n,i);if(s===0)return e;var o=Rc(e,n,i)-t;e-=o/s}return e},Ef=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=NT?new Float32Array(ol):new Array(ol),s=0;s<ol;++s)a[s]=Rc(s*Pc,t,n);var o=function(c){for(var u=0,h=1,d=ol-1;h!==d&&a[h]<=c;++h)u+=Pc;--h;var f=(c-a[h])/(a[h+1]-a[h]),v=u+f*Pc,g=vm(v,t,n);return g>=TT?PT(c,v,t,n):g===0?v:kT(c,u,u+Pc,t,n)};return function(l){return l===0||l===1?l:Rc(o(l),e,i)}},RT=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},Lc=function(t){return Math.pow(t,2)},_c=function(t){return Math.pow(t,3)},Dc=function(t){return Math.pow(t,4)},Ic=function(t){return Math.pow(t,5)},Bc=function(t){return Math.pow(t,6)},Fc=function(t){return 1-Math.cos(t*Math.PI/2)},zc=function(t){return 1-Math.sqrt(1-t*t)},jc=function(t){return t*t*(3*t-2)},Zc=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)},Wc=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=(0,L.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,L.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},wf=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e,i=(0,L.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},gm=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=(0,L.Z)(e,4),i=n[0],a=n[1],s=n[2],o=n[3];return Ef(i,a,s,o)(t)},Gc=Ef(.42,0,1,1),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 1-t(1-e,n,i)}},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?t(e*2,n,i)/2:1-t(e*-2+2,n,i)/2}},bi=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}},pm={steps:wf,"step-start":function(t){return wf(t,[1,"start"])},"step-end":function(t){return wf(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":gm,ease:function(t){return gm(t,[.25,.1,.25,1])},in:Gc,out:mi(Gc),"in-out":yi(Gc),"out-in":bi(Gc),"in-quad":Lc,"out-quad":mi(Lc),"in-out-quad":yi(Lc),"out-in-quad":bi(Lc),"in-cubic":_c,"out-cubic":mi(_c),"in-out-cubic":yi(_c),"out-in-cubic":bi(_c),"in-quart":Dc,"out-quart":mi(Dc),"in-out-quart":yi(Dc),"out-in-quart":bi(Dc),"in-quint":Ic,"out-quint":mi(Ic),"in-out-quint":yi(Ic),"out-in-quint":bi(Ic),"in-expo":Bc,"out-expo":mi(Bc),"in-out-expo":yi(Bc),"out-in-expo":bi(Bc),"in-sine":Fc,"out-sine":mi(Fc),"in-out-sine":yi(Fc),"out-in-sine":bi(Fc),"in-circ":zc,"out-circ":mi(zc),"in-out-circ":yi(zc),"out-in-circ":bi(zc),"in-back":jc,"out-back":mi(jc),"in-out-back":yi(jc),"out-in-back":bi(jc),"in-bounce":Zc,"out-bounce":mi(Zc),"in-out-bounce":yi(Zc),"out-in-bounce":bi(Zc),"in-elastic":Wc,"out-elastic":mi(Wc),"in-out-elastic":yi(Wc),"out-in-elastic":bi(Wc),spring:ll,"spring-in":ll,"spring-out":mi(ll),"spring-in-out":yi(ll),"spring-out-in":bi(ll)},LT=function(t){return RT(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},_T=function(t){return pm[LT(t)]||pm.linear},DT=function(t){return t},IT=1,BT=.5,mm=0;function ym(r,t){return function(e){if(e>=1)return 1;var n=1/r;return e+=t*n,e-e%n}}var Vc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",FT=new RegExp("cubic-bezier\\(".concat(Vc,",").concat(Vc,",").concat(Vc,",").concat(Vc,"\\)")),zT=/steps\(\s*(\d+)\s*\)/,jT=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Sf(r){var t=FT.exec(r);if(t)return Ef.apply(void 0,(0,k.Z)(t.slice(1).map(Number)));var e=zT.exec(r);if(e)return ym(Number(e[1]),mm);var n=jT.exec(r);return n?ym(Number(n[1]),{start:IT,middle:BT,end:mm}[n[2]]):_T(r)}function ZT(r){return Math.abs(WT(r)/(r.playbackRate||1))}function WT(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 bm=0,Mf=1,Uc=2,xm=3;function GT(r,t,e){if(t===null)return bm;var n=e.endTime;return t<Math.min(e.delay,n)?Mf:t>=Math.min(e.delay+r+e.endDelay,n)?Uc:xm}function VT(r,t,e,n,i){switch(n){case Mf:return t==="backwards"||t==="both"?0:null;case xm:return e-i;case Uc:return t==="forwards"||t==="both"?r:null;case bm:return null}}function UT(r,t,e,n,i){var a=i;return r===0?t!==Mf&&(a+=e):a+=n/r,a}function YT(r,t,e,n,i,a){var s=r===1/0?t%1:r%1;return s===0&&e===Uc&&n!==0&&(i!==0||a===0)&&(s=1),s}function HT(r,t,e,n){return r===Uc&&t===1/0?1/0:e===1?Math.floor(n)-1:Math.floor(n)}function XT(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 KT(r,t,e){var n=GT(r,t,e),i=VT(r,e.fill,t,n,e.delay);if(i===null)return null;var a=e.duration==="auto"?0:e.duration,s=UT(a,n,e.iterations,i,e.iterationStart),o=YT(s,e.iterationStart,n,e.iterations,i,a),l=HT(n,e.iterations,o,s),c=XT(e.direction,l,o);return e.currentIteration=l,e.progress=c,e.easingFunction(c)}function QT(r,t,e){var n=qT(r,t),i=JT(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)Em(o)&&a.setAttribute(o,null)}}function Em(r){return r!=="offset"&&r!=="easing"&&r!=="composite"&&r!=="computedOffset"}function qT(r,t){for(var e={},n=0;n<r.length;n++)for(var i in r[n])if(Em(i)){var a={offset:r[n].offset,computedOffset:r[n].computedOffset,easing:r[n].easing,easingFunction:Sf(r[n].easing)||t.easingFunction,value:r[n][i]};e[i]=e[i]||[],e[i].push(a)}return e}function JT(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:$T(n,i[s].value,i[o].value,t)})}return e.sort(function(d,f){return d.startOffset-f.startOffset}),e}var wm=function(t,e,n){return function(i){var a=Sm(t,e,i);return ie(a)?a:n(a)}};function $T(r,t,e,n){var i=_p[r];if(i&&i.syntax&&i.int){var a=Vt.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=wm.apply(void 0,(0,k.Z)(c));return function(h){return h===0?t:h===1?e:u(h)}}}}return wm(!1,!0,function(h){return h?e:t})}function Sm(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(Sm(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 tO=function(){function r(){(0,N.Z)(this,r),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=DT,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=Sf(e),this._easing=e}}])}();function eO(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 Mm(r,t){if(r===null)return[];Array.isArray(r)||(r=eO(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(me(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(!me(g)&&!me(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 nO="backwards|forwards|both|none".split("|"),rO="reverse|alternate|alternate-reverse".split("|");function iO(r,t){var e=new tO;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"&&nO.indexOf(r[n])===-1||n==="direction"&&rO.indexOf(r[n])===-1)return;e[n]=r[n]}}),e}function aO(r,t){return r=sO(r!=null?r:{duration:"auto"}),iO(r,t)}function sO(r){return typeof r=="number"&&(isNaN(r)?r={duration:"auto"}:r={duration:r}),r}var oO=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=aO(n,!1),this.timing.effect=this,this.timing.activeDuration=ZT(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Mm(e,this.timing),this.interpolations=QT(this.normalizedKeyframes,this.timing,this.target);var a=Vt.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=KT(this.timing.activeDuration,e,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(e){this.normalizedKeyframes=Mm(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 Am(r,t){return Number(r.id)-Number(t.id)}var lO=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(Am),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 oO(e,n,i),s=new MT(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(Am);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]}}])}();Vt.EasingFunction=Sf,Vt.AnimationTimeline=lO;var Tm=function(r){return me(r)?"":r.toString()},cO=function(r){var t=Tm(r);return t.charAt(0).toUpperCase()+t.substring(1)},Yc=cO,uO=function(r){return typeof r=="object"&&r!==null},Af=uO,hO=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},cl=hO,Tf=function(r,t){if(r===t)return!0;if(!r||!t||Ge(r)||Ge(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=Tf(r[n],t[n]),!!e);n++);return e}if(Af(r)||Af(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=Tf(r[i[n]],t[i[n]]),!!e);n++);return e}return!1},Wn=Tf;const dO={duration:500},fO={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"},p9={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 Hr;(function(r){r.DRAW="draw",r.COLLAPSE="collapse",r.EXPAND="expand",r.TRANSFORM="transform"})(Hr||(Hr={}));var va;(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"})(va||(va={}));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 Hc;(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"})(Hc||(Hc={}));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 xi;(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"})(xi||(xi={}));const dn="combo",ii="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 Of={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function ga(r,t){var e;const n=(e=Of[r])===null||e===void 0?void 0:e[t];if(n)return n}function m9(r){return EXTENSION_REGISTRY[r]}const vO="5.0.50",gO="G6";function pa(r){return`[${gO} v${vO}] ${r}`}const Xr={mute:!1,debug:r=>{!Xr.mute&&console.debug(pa(r))},info:r=>{!Xr.mute&&console.info(pa(r))},warn:r=>{!Xr.mute&&console.warn(pa(r))},error:r=>{!Xr.mute&&console.error(pa(r))}};function Om(r){const{theme:t}=r;if(!t)return{};const e=ga(ul.THEME,t);return e||(Xr.warn(`The theme of ${t} is not registered.`),{})}function Cf(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 Nf(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=>me(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(n)&&Wn(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 Cm(r,t){const{animation:e}=r;if(e===!1||t===!1)return!1;const n=Object.assign({},dO);return zn(e)&&Object.assign(n,e),zn(t)&&Object.assign(n,t),n}function pO(r){if(typeof r=="string"){const t=ga(ul.ANIMATION,r);return t||(Xr.warn(`The animation of ${r} is not registered.`),[])}return r}function mO(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=Om(r)[t])===null||a===void 0?void 0:a.animation,u=(d=[])=>pO(d).map(f=>Object.assign(Object.assign(Object.assign(Object.assign({},fO),zn(s)&&s),f),zn(n)&&n));if(l)return u(l);if(!c)return[];const h=c[e];return h===!1?[]:u(h)}function Nm(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 yO=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 bO=(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${Yc(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=yO(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 P,R;Object.assign(b[0],{[O]:(P=p[O])!==null&&P!==void 0?P:hl(O)}),Object.assign(b[1],{[O]:(R=y[O])!==null&&R!==void 0?R:hl(O)})}),b.some(O=>Object.keys(O).some(P=>["x","y","z"].includes(P)))){const{x:O=0,y:P=0,z:R,transform:F=""}=g.attributes||{};b.forEach(I=>{var V,Y,J;I.transform=Nm((V=I.x)!==null&&V!==void 0?V:O,(Y=I.y)!==null&&Y!==void 0?Y:P,(J=I.z)!==null&&J!==void 0?J:R,F)})}const E=g.animate(Nf(b),f);return h===void 0&&(s=E),E}).filter(Boolean),l=s||(o==null?void 0:o[0]);return l?Cf(l,o.filter(c=>c!==c)):null},xO=[{fields:["opacity"]}],EO=[{fields:["x","y"]}],km=[{fields:["x","y"]}],wO=km,Pm=[{fields:["sourceNode","targetNode"]}],SO=Pm,Rm=[{fields:["childrenNode","x","y"]}],MO=Rm,y9=[{fields:["childrenNode","x","y"]}];var AO=Object.prototype.hasOwnProperty;function TO(r,t){if(!t||!Wr(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),AO.call(e,i)?e[i].push(s):e[i]=[s]}return e}var Xc=TO,Lm=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},kf=function(r){if(typeof r!="object"||r===null)return r;var t;if(Wr(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=kf(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=kf(r[i]):t[i]=r[i]}return t},ho=kf;function OO(r){return"source"in r&&"target"in r}function CO(r){return r.length===2}function b9(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 ai(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 NO(r=0){const t=ai(r);return t[0]+t[2]}function x9(r=0){const t=ai(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)?Pf(r):r.getShape("key").getBounds();return t?za(e,t):e}function Pf(r){const[t,e,n=0]=r,i=new pn;return i.setMinMax([t,e,n],[t,e,n]),i}function za(r,t){const[e,n,i,a]=ai(t),[s,o,l]=r.min,[c,u,h]=r.max,d=new pn;return d.setMinMax([s-a,o-e,l],[c+n,u+i,h]),d}function dl(r){if(r.length===0)return new pn;if(r.length===1)return r[0];const t=new pn;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 kO(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 _m(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 PO(r,t){return!Li(r,t)}function Kc(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 RO(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 LO(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 _O(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 DO=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},Qc=DO,IO=function(t,e){return t===e},Dm=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}(),BO=function(){function r(t){t===void 0&&(t=IO),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new Dm(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new Dm(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}(),Im=BO,FO=function(){function r(){this.linkedList=new Im}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}(),zO=FO,Ei=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)},jO=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})},Bm=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 ZO(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 WO=function(t,e,n,i){i===void 0&&(i=!0);var a=ZO(n),s=new zO,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}),Ei(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()},GO=WO,VO=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=Ei(v.id,a),p=function(E){var O=g[E];if(!o[O]){var P=n.filter(function(R){return R.id===O});P.length>0&&f(P[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},Fm=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=Ei(y.id,a,"target").filter(function(F){return n.map(function(I){return I.id}).indexOf(F)>-1}),E=function(I){var V=b[I];if(!l[V]&&l[V]!==0){var Y=n.filter(function(J){return J.id===V});Y.length>0&&p(Y[0]),c[y.id]=Math.min(c[y.id],c[V])}else o[V]&&(c[y.id]=Math.min(c[y.id],l[V]))},O=0;O<b.length;O++)E(O);if(c[y.id]===l[y.id]){for(var P=[];s.length>0;){var R=s.pop();if(o[R.id]=!1,P.push(R),R===y)break}P.length>0&&u.push(P)}},f=0,v=n;f<v.length;f++){var g=v[f];!l[g.id]&&l[g.id]!==0&&d(g)}return u};function zm(r,t){return t?Fm(r):VO(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},Rf=vl,UO=function(t,e){var n=vl(t);return n[e]?vl(t)[e].inDegree:0},YO=function(t,e){var n=vl(t);return n[e]?vl(t)[e].outDegree:0};function HO(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 jm(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;Ei(t,s,i?"target":void 0).forEach(function(o){n.allowTraversal({previous:e,current:t,next:o})&&jm(r,o,t,n,i)}),n.leave({current:t,previous:e})}function Zm(r,t,e,n){n===void 0&&(n=!0),jm(r,t,"",HO(e),n)}var XO=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];Zm(t,u,c)}return e},Wm=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var s=[],o=zm(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=Ei(y,t.edges),E=function(R){var F,I=b[R],V=t.nodes.find(function(ft){return ft.id===I});if(I===y)s.push((F={},F[I]=p,F));else if(!(I in g))v[I]=p,f.push(V),g[I]=new Set([p]);else if(!g[y].has(V)){for(var Y=!0,J=[V,p],$=v[y];g[I].size&&!g[I].has($)&&(J.push($),$!==v[$.id]);)$=v[$.id];if(J.push($),e&&n?(Y=!1,J.findIndex(function(ft){return e.indexOf(ft.id)>-1})>-1&&(Y=!0)):e&&!n&&J.findIndex(function(ft){return e.indexOf(ft.id)>-1})>-1&&(Y=!1),Y){for(var ot={},ct=1;ct<J.length;ct+=1)ot[J[ct-1].id]=J[ct];J.length&&(ot[J[J.length-1].id]=J[0]),s.push(ot)}g[I].add(p)}},O=0;O<b.length;O+=1)E(O)}return s},Gm=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,s=[],o=[],l={},c={},u=function($){for(var ot=[$];ot.length>0;){var ct=ot.pop();a.has(ct)&&(a.delete(ct),s[ct.id].forEach(function(ft){ot.push(ft)}),s[ct.id].clear())}},h=function J($,ot,ct){var ft=!1;if(e&&n===!1&&e.indexOf($.id)>-1)return ft;i.push($),a.add($);for(var Nt=ct[$.id],Ot=0;Ot<Nt.length;Ot+=1){var mt=l[Nt[Ot]];if(mt===ot){for(var yt={},Rt=1;Rt<i.length;Rt+=1)yt[i[Rt-1].id]=i[Rt];i.length&&(yt[i[i.length-1].id]=i[0]),o.push(yt),ft=!0}else a.has(mt)||J(mt,ot,ct)&&(ft=!0)}if(ft)u($);else for(var Ot=0;Ot<Nt.length;Ot+=1){var mt=l[Nt[Ot]];s[mt.id].has($)||s[mt.id].add($)}return i.pop(),ft},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($){var ot=e[$];c[f[$].id]=c[ot],c[ot]=0,l[0]=f.find(function(ct){return ct.id===ot}),l[c[f[$].id]]=f[$]},v=0;v<e.length;v++)y(v);for(var b=function($){for(var ot,ct,ft=1/0,Nt=0;Nt<$.length;Nt+=1)for(var Ot=$[Nt],mt=0;mt<Ot.length;mt++){var yt=c[Ot[mt].id];yt<ft&&(ft=yt,ct=Nt)}for(var Rt=$[ct],jt=[],Nt=0;Nt<Rt.length;Nt+=1){var Xt=Rt[Nt];jt[Xt.id]=[];for(var ee=0,ae=Ei(Xt.id,t.edges,"target").filter(function(xe){return Rt.map(function(Ce){return Ce.id}).indexOf(xe)>-1});ee<ae.length;ee++){var he=ae[ee];he===Xt.id&&!(n===!1&&e.indexOf(Xt.id)>-1)?o.push((ot={},ot[Xt.id]=Xt,ot)):jt[Xt.id].push(c[he])}}return{component:Rt,adjList:jt,minIdx:ft}},E=0;E<f.length;){var O=f.filter(function(J){return c[J.id]>=E}),P=Fm({nodes:O,edges:t.edges}).filter(function(J){return J.length>1});if(P.length===0)break;var R=b(P),F=R.minIdx,I=R.adjList,V=R.component;if(V.length>1){V.forEach(function(J){s[J.id]=new Set});var Y=l[F];if(e&&n&&e.indexOf(Y.id)===-1)return o;h(Y,Y,I),E=F+1}else break}return o},KO=function(t,e,n,i){return i===void 0&&(i=!0),e?Gm(t,n,i):Wm(t,n,i)},Vm=XO,QO={}.toString,qO=function(r,t){return QO.call(r)==="[object "+t+"]"},Jc=qO,Lf=function(r){return Jc(r,"Function")},_f=function(r){return Array.isArray?Array.isArray(r):Jc(r,"Array")},JO=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function $O(r,t){if(r){var e;if(_f(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(JO(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var Um=$O,E9=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return Um(r,function(e,n){Lf(r)&&n==="prototype"||t.push(n)}),t},w9=null;function S9(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 M9=null,A9=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},T9=null;function O9(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 C9=null,N9=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},k9=null,P9=function(r){if(!isArray(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},R9=null,tC=function(r,t){if(t===void 0&&(t=[]),!isArray(r))t.push(r);else for(var e=0;e<r.length;e+=1)tC(r[e],t);return t},L9=null,_9=function(r){if(isArray(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},D9=function(r){if(isArray(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])},I9=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}},B9=null,Ym=Array.prototype,eC=Ym.splice,nC=Ym.indexOf,F9=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=nC.call(r,i))>-1;)eC.call(r,a,1);return r},z9=null,rC=Array.prototype.splice,j9=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,rC.call(t,s,1))}return t},Z9=null,W9=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},G9=null,V9=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},U9=null,Df=function(r){return Jc(r,"String")};function Y9(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 H9=null;function If(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 X9=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 K9(r,t){return isArray(r)||isString(r)?r[0]===t:!1}var Q9=null;function q9(r,t){return isArray(r)||isString(r)?r[r.length-1]===t:!1}var J9=null,iC=Object.prototype.hasOwnProperty;function $9(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),iC.call(e,i)?e[i].push(s):e[i]=[s]}return e}var tz=null;function ez(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 nz=function(r,t){if(!t)return[r];var e=groupToMap(r,t),n=[];for(var i in e)n.push(e[i]);return n},Hm={};function rz(r){var t=Hm[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,Hm[r]=t}return t}var iz=null;function az(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 sz=null,aC=function(r){return Jc(r,"Number")},sC=aC,oz=function(r){return isNumber(r)&&r%1!==0},lz=null,cz=function(r){return isNumber(r)&&r%2===0},uz=null,hz=Number.isInteger?Number.isInteger:function(r){return sC(r)&&r%1===0},dz=null,fz=function(r){return isNumber(r)&&r<0},vz=null,gz=function(r){return isNumber(r)&&r%2!==0},pz=null,mz=function(r){return isNumber(r)&&r>0},yz=null,bz=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}},xz=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}},oC=180/Math.PI,Ez=function(r){return oC*r},wz=null,lC=Math.PI/180,Sz=function(r){return lC*r},Mz=null,Az=null,cC=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return Um(r,function(e,n){Lf(r)&&n==="prototype"||t.push(e)}),t},uC=cC,Tz=function(r,t){return contains(values(r),t)},hC={}.toString,Oz=function(r){return hC.call(r).replace(/^\[object /,"").replace(/]$/,"")},Cz=null,Nz=function(r){return isType(r,"Arguments")},kz=null,Pz=function(r){return isType(r,"Boolean")},Rz=null,Lz=function(r){return isType(r,"Date")},_z=null,Dz=function(r){return isType(r,"Error")},Iz=null;function Bz(r){return isNumber(r)&&isFinite(r)}var dC=Object.prototype,Fz=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||dC;return r===e},zz=null,jz=function(r){return isType(r,"RegExp")},Zz=null,Wz=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)}},Gz=null,Bf=function(r){if(typeof r!="object"||r===null)return r;var t;if(_f(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=Bf(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=Bf(r[i]):t[i]=r[i]}return t},gl=Bf,fC=function(r,t){if(!Lf(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},vC=5;function Xm(r,t,e,n){e=e||0,n=n||vC;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&isPlainObject(a)?(isPlainObject(r[i])||(r[i]={}),e<n?Xm(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 Vz=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)Xm(r,t[n]);return r},Uz=null,Yz=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},Hz=null,gC=Object.prototype.hasOwnProperty;function Xz(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(gC.call(r,e))return!1;return!0}var Kz=null,pC=function(r){return typeof r=="object"&&r!==null},Km=pC,mC=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},Qm=mC,Ff=function(r,t){if(r===t)return!0;if(!r||!t||Df(r)||Df(t))return!1;if(Qm(r)||Qm(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Ff(r[n],t[n]),!!e);n++);return e}if(Km(r)||Km(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=Ff(r[i[n]],t[i[n]]),!!e);n++);return e}return!1},yC=Ff,Qz=function(r,t,e){return isFunction(e)?!!e(r,t):isEqual(r,t)},qz=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},Jz=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},bC=Object.prototype.hasOwnProperty,$z=function(r,t){if(r===null||!isPlainObject(r))return{};var e={};return each(t,function(n){bC.call(r,n)&&(e[n]=r[n])}),e},t7=function(r,t){return reduce(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},$c={},e7=function(r){return r=r||"g",$c[r]?$c[r]+=1:$c[r]=1,r+$c[r]},tu,n7=fC(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return tu||(tu=document.createElement("canvas").getContext("2d")),tu.font=[a,s,i,e+"px",n].join(" "),tu.measureText(Df(r)?r:"").width},function(r,t){return t===void 0&&(t={}),(0,G.pr)([r],uC(t)).join("")}),r7=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},i7=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}(),a7=null,xC=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},EC=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(E,O){var P=E.id;c.push(P),h[P]=1/0,P===e&&(h[P]=0)});for(var f=s.length,v=function(O){var P=xC(h,s,u),R=P.id;if(u[R]=!0,h[R]===1/0)return"continue";var F=[];n?F=jO(R,l):F=qc(R,l),F.forEach(function(I){var V=I.target,Y=I.source,J=V===R?Y:V,$=i&&I[i]?I[i]:1;h[J]>h[P.id]+$?(h[J]=h[P.id]+$,d[J]=[P.id]):h[J]===h[P.id]+$&&d[J].push(P.id)})},g=0;g<f;g++)v(g);d[e]=[e];var p={};for(var y in h)h[y]!==1/0&&qm(e,y,d,p);var b={};for(var y in p)b[y]=p[y][0];return{length:h,path:b,allPath:p}},eu=EC;function qm(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=qm(r,o,e,n);if(!l)return;for(var c=0,u=l;c<u.length;c++){var h=u[c];_f(h)?i.push((0,G.ev)((0,G.ev)([],h,!0),[t],!1)):i.push([h,t])}}return n[t]=i,n[t]}var zf=function(t,e,n,i,a){var s=eu(t,e,i,a),o=s.length,l=s.path,c=s.allPath;return{length:o[n],path:l[n],allPath:c[n]}},wC=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?Ei(e,o,"target"):Ei(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?Ei(v,o,"target"):Ei(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},SC=function(t,e){for(var n=Qc(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},jf=SC,MC=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,P){var R=Bm();O.clusterId=R,c[R]={id:R,nodes:[O]},u[O.id]={node:O,idx:P}});var h=Qc(t,e),d=[],f={};h.forEach(function(O,P){var R=0,F=s[P].id;f[F]={},O.forEach(function(I,V){if(I){R+=I;var Y=s[V].id;f[F][Y]=I}}),d.push(R)});for(var v=0,g=function(){var P=!1;if(s.forEach(function(R){var F={};Object.keys(f[R.id]).forEach(function(ft){var Nt=f[R.id][ft],Ot=u[ft].node,mt=Ot.clusterId;F[mt]||(F[mt]=0),F[mt]+=Nt});var I=-1/0,V=[];if(Object.keys(F).forEach(function(ft){I<F[ft]?(I=F[ft],V=[ft]):I===F[ft]&&V.push(ft)}),!(V.length===1&&V[0]===R.clusterId)){var Y=V.indexOf(R.clusterId);if(Y>=0&&V.splice(Y,1),V&&V.length){P=!0;var J=c[R.clusterId],$=J.nodes.indexOf(R);J.nodes.splice($,1);var ot=Math.floor(Math.random()*V.length),ct=c[V[ot]];ct.nodes.push(R),R.clusterId=ct.id}}}),!P)return"break";v++};v<i;){var p=g();if(p==="break")break}Object.keys(c).forEach(function(O){var P=c[O];(!P.nodes||!P.nodes.length)&&delete c[O]});var y=[],b={};l.forEach(function(O){var P=O.source,R=O.target,F=O[n]||1,I=u[P].node.clusterId,V=u[R].node.clusterId,Y="".concat(I,"---").concat(V);if(b[Y])b[Y].weight+=F,b[Y].count++;else{var J={source:I,target:V,weight:F,count:1};b[Y]=J,y.push(J)}});var E=[];return Object.keys(c).forEach(function(O){E.push(c[O])}),{clusters:E,clusterEdges:y}},AC=MC,TC=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}(),wi=TC,OC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,CC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,Jm=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(OC)&&!"".concat(a.properties[s]).match(CC)&&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)},NC=function(t,e){return e.map(function(n){return t.hasOwnProperty(n)?t[n]:0})},kC=function(t){for(var e=Jm(t),n=[],i=0;i<t.length;i++)n[i]=NC(t[i].properties,e);return n},nu=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},s7={getAllSortProperties:Jm,getPropertyWeight:kC,getAllProperties:nu},_i;(function(r){r.EuclideanDistance="euclideanDistance"})(_i||(_i={}));var $m=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(s){i=i.concat(Object.keys(s))}),i=If(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]=If(o))}),a},ru=function(t,e,n){var i=$m(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=_i.EuclideanDistance);var a=0;switch(n){case _i.EuclideanDistance:a=new wi(t).euclideanDistance(new wi(e));break;default:break}return a},o7={getAllKeyValueMap:$m,oneHot:ru,getDistance:Zf},ty=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},Wf=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new wi([]),a=0;a<n;a++)i=i.add(new wi(e[a]));var s=i.avg(n);s.normalize();for(var o=0,a=0;a<n;a++){var l=new wi(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 wi(e[a]);t[a].clusterInertial=0;for(var h=0;h<n;h++){if(a===h){u[a][h]=0;continue}var d=new wi(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))},PC=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(yt,Rt){yt.properties=yt.properties||{},yt.originIndex=Rt});var g=[];h.every(function(yt){return yt.hasOwnProperty("nodeType")})&&(g=Array.from(new Set(h.map(function(yt){return yt.nodeType}))),h.forEach(function(yt){yt.properties.nodeType=g.findIndex(function(Rt){return Rt===yt.nodeType})}));var p=nu(h,s);v=ru(p,o,l)}var y=1,b={},E={};h.forEach(function(yt,Rt){var jt=String(y++);yt.clusterId=jt,b[jt]={id:jt,nodes:[yt]},E[yt.id]={node:yt,idx:Rt}});var O=Qc(t,e),P=[],R={},F=0;O.forEach(function(yt,Rt){var jt=0,Xt=h[Rt].id;R[Xt]={},yt.forEach(function(ee,ae){if(ee){jt+=ee;var he=h[ae].id;R[Xt][he]=ee,F+=ee}}),P.push(jt)}),F/=2;for(var I=1/0,V=1/0,Y=0,J=[],$={};;){a&&h.every(function(yt){return yt.hasOwnProperty("properties")})?I=ty(h,O,P,F)+Wf(h,v)*c:I=ty(h,O,P,F),Y===0&&(V=I,J=h,$=b);var ot=I>0&&I>V&&I-V<i;if(I>V&&(J=h.map(function(yt){return{node:yt,clusterId:yt.clusterId}}),$=gl(b),V=I),ot||Y>100)break;Y++,Object.keys(b).forEach(function(yt){var Rt=0;f.forEach(function(jt){var Xt=jt.source,ee=jt.target,ae=E[Xt].node.clusterId,he=E[ee].node.clusterId;(ae===yt&&he!==yt||he===yt&&ae!==yt)&&(Rt=Rt+(jt[n]||1))}),b[yt].sumTot=Rt}),h.forEach(function(yt,Rt){var jt=b[yt.clusterId],Xt=0,ee,ae=P[Rt]/(2*F),he=0,ce=jt.nodes;ce.forEach(function(wr){var vr=E[wr.id].idx;he+=O[Rt][vr]||0});var xe=he-jt.sumTot*ae,Ce=ce.filter(function(wr){return wr.id!==yt.id}),je=[];Ce.forEach(function(wr,vr){je[vr]=v[wr.originIndex]});var Ue=Wf(Ce,v)*c,or=R[yt.id];if(Object.keys(or).forEach(function(wr){var vr=E[wr].node,Aa=vr.clusterId;if(Aa!==yt.clusterId){var Sr=b[Aa],Jr=Sr.nodes;if(!(!Jr||!Jr.length)){var Be=0;Jr.forEach(function(He){var qe=E[He.id].idx;Be+=O[Rt][qe]||0});var Qe=Be-Sr.sumTot*ae,Fe=Jr.concat([yt]),Ye=[];Fe.forEach(function(He,qe){Ye[qe]=v[He.originIndex]});var nn=Wf(Fe,v)*c,pe=Qe-xe;a&&(pe=Qe+nn-(xe+Ue)),pe>Xt&&(Xt=pe,ee=Sr)}}}),Xt>0){ee.nodes.push(yt);var Ke=yt.clusterId;yt.clusterId=ee.id;var hi=jt.nodes.indexOf(yt);jt.nodes.splice(hi,1);var Pr=0,ns=0;f.forEach(function(wr){var vr=wr.source,Aa=wr.target,Sr=E[vr].node.clusterId,Jr=E[Aa].node.clusterId;(Sr===ee.id&&Jr!==ee.id||Jr===ee.id&&Sr!==ee.id)&&(Pr=Pr+(wr[n]||1)),(Sr===Ke&&Jr!==Ke||Jr===Ke&&Sr!==Ke)&&(ns=ns+(wr[n]||1))}),ee.sumTot=Pr,jt.sumTot=ns}})}var ct={},ft=0;Object.keys($).forEach(function(yt){var Rt=$[yt];if(!Rt.nodes||!Rt.nodes.length){delete $[yt];return}var jt=String(ft+1);jt!==yt&&(Rt.id=jt,Rt.nodes=Rt.nodes.map(function(Xt){return{id:Xt.id,clusterId:jt}}),$[jt]=Rt,ct[yt]=jt,delete $[yt],ft++)}),J.forEach(function(yt){var Rt=yt.node,jt=yt.clusterId;Rt&&(Rt.clusterId=jt,Rt.clusterId&&ct[Rt.clusterId]&&(Rt.clusterId=ct[Rt.clusterId]))});var Nt=[],Ot={};f.forEach(function(yt){var Rt=yt.source,jt=yt.target,Xt=yt[n]||1,ee=E[Rt].node.clusterId,ae=E[jt].node.clusterId;if(!(!ee||!ae)){var he="".concat(ee,"---").concat(ae);if(Ot[he])Ot[he].weight+=Xt,Ot[he].count++;else{var ce={source:ee,target:ae,weight:Xt,count:1};Ot[he]=ce,Nt.push(ce)}}});var mt=[];return Object.keys($).forEach(function(yt){mt.push($[yt])}),{clusters:mt,clusterEdges:Nt}},ey=PC,RC=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),ey(t,e,n,i,!0,a,s,o,l)},LC=RC,_C=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=Rf({nodes:s,edges:l}),f=Object.keys(d);f.sort(function(p,y){var b,E;return((b=d[p])===null||b===void 0?void 0:b.degree)-((E=d[y])===null||E===void 0?void 0:E.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}},DC=_C,ny=function(t,e,n){var i=[];switch(t){case _i.EuclideanDistance:i=e[n];break;default:i=[];break}return i},IC=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=_i.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===_i.EuclideanDistance&&!l.every(function(jt){return jt.hasOwnProperty(n)}))return h;var d=[],f=[];if(s===_i.EuclideanDistance&&(d=nu(l,n),f=ru(d,i,a)),!f.length)return h;for(var v=If(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=[],E=[],p=0;p<g;p++)if(p===0){var O=Math.floor(Math.random()*l.length);switch(s){case _i.EuclideanDistance:y[p]=f[O];break;default:y[p]=[];break}b.push(O),E[p]=[l[O]],l[O].clusterId=String(p)}else{for(var P=-1/0,R=0,F=function(ee){if(!b.includes(ee)){for(var ae=0,he=0;he<y.length;he++){var ce=0;switch(s){case _i.EuclideanDistance:ce=Zf(f[l[ee].originIndex],y[he],s);break;default:break}ae+=ce}var xe=ae/y.length;xe>P&&!y.find(function(Ce){return yC(Ce,ny(s,f,l[ee].originIndex))})&&(P=xe,R=ee)}},I=0;I<l.length;I++)F(I);y[p]=ny(s,f,R),b.push(R),E[p]=[l[R]],l[R].clusterId=String(p)}for(var V=0;;){for(var p=0;p<l.length;p++){var Y=0,J=1/0;if(!(V===0&&b.includes(p))){for(var $=0;$<y.length;$++){var ot=0;switch(s){case _i.EuclideanDistance:ot=Zf(f[p],y[$],s);break;default:break}ot<J&&(J=ot,Y=$)}if(l[p].clusterId!==void 0)for(var ct=E[Number(l[p].clusterId)].length-1;ct>=0;ct--)E[Number(l[p].clusterId)][ct].id===l[p].id&&E[Number(l[p].clusterId)].splice(ct,1);l[p].clusterId=String(Y),E[Y].push(l[p])}}for(var ft=!1,p=0;p<E.length;p++){for(var Nt=E[p],Ot=new wi([]),$=0;$<Nt.length;$++)Ot=Ot.add(new wi(f[Nt[$].originIndex]));var mt=Ot.avg(Nt.length);mt.equal(new wi(y[p]))||(ft=!0,y[p]=mt.getArr())}if(V++,l.every(function(jt){return jt.clusterId!==void 0})&&ft||V>=1e3)break}var yt=[],Rt={};return u.forEach(function(jt){var Xt,ee,ae=jt.source,he=jt.target,ce=(Xt=l.find(function(Ue){return Ue.id===ae}))===null||Xt===void 0?void 0:Xt.clusterId,xe=(ee=l.find(function(Ue){return Ue.id===he}))===null||ee===void 0?void 0:ee.clusterId,Ce="".concat(ce,"---").concat(xe);if(Rt[Ce])Rt[Ce].count++;else{var je={source:ce,target:xe,count:1};Rt[Ce]=je,yt.push(je)}}),{clusters:E,clusterEdges:yt}},BC=IC,FC=function(t,e){var n=new wi(e),i=n.norm2(),a=new wi(t),s=a.norm2(),o=n.dot(a),l=i*s,c=l?o/l:0;return c},ry=FC,zC=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=nu(t,n),c=ru(l,i,a),u=c[o],h=[];return s.forEach(function(d,f){if(d.id!==e.id){var v=c[f],g=ry(v,u);h.push(g),d.cosineSimilarity=g}}),s.sort(function(d,f){return f.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:h,similarNodes:s}},jC=zC,ZC=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}(),WC=ZC,GC=function(t,e){return t-e},VC=function(){function r(t){t===void 0&&(t=GC),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}(),UC=VC,YC=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 UC(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},iy=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 WC(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},HC=function(t,e,n){var i={prim:YC,kruskal:iy};return n?i[n](t,e):iy(t,e)},XC=HC,KC=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=Rf(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 E=Ei(y,u,"source"),O=0;O<E.length;++O){var P=E[O],R=b[P].outDegree;R>0&&(d+=v[P]/R)}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},ay=KC,QC=-1,iu=-1,sy="-1",na="-1",oy=-1,l7="-1",ly=function(){function r(t,e,n,i){t===void 0&&(t=QC),e===void 0&&(e=iu),n===void 0&&(n=iu),i===void 0&&(i=sy),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),qC=function(){function r(t,e){t===void 0&&(t=iu),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}(),cy=function(){function r(t,e,n){t===void 0&&(t=iu),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 qC(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 ly(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 ly(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||sy,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}(),uy=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=oy),e===void 0&&(e=!1);var n=new cy(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}(),au=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}(),JC=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 uy,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(oy,n),a=i.nodeMap,s=new uy,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,E=n?-1:0,O=function(Ot){if(y)return"break";d.forEach(function(mt){var yt=new au(mt),Rt=t.findBackwardEdge(i,yt.edges[f[Ot]],yt.edges[f[0]],yt);Rt&&(p[Rt.label]||(p[Rt.label]={projected:[],edgeLabel:Rt.label}),p[Rt.label].projected.push({graphId:i.id,edge:p,preNode:mt}),b=s.dfsEdgeList[f[Ot]].fromNode,y=!0)})},P=f.length-1;P>E;P--){var R=O(P);if(R==="break")break}if(y){var F=t.findMinLabel(p);s.dfsEdgeList.push(new ks(g,b,na,F.edgeLabel,na));var I=s.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[I]!==s.dfsEdgeList[I]?!1:h(p[F.edgeLabel].projected)}var V={};y=!1;var Y=0;d.forEach(function(Nt){var Ot=new au(Nt),mt=t.findForwardPureEdges(i,Ot.edges[f[0]],v,Ot);mt.length>0&&(y=!0,Y=g,mt.forEach(function(yt){var Rt="".concat(yt.label,"-").concat(a[yt.to].label);V[Rt]||(V[Rt]={projected:[],edgeLabel:yt.label,nodeLabel2:a[yt.to].label}),V[Rt].projected.push({graphId:i.id,edge:yt,preNode:Nt})}))});for(var J=f.length,$=function(Ot){if(y)return"break";var mt=f[Ot];d.forEach(function(yt){var Rt=new au(yt),jt=t.findForwardRmpathEdges(i,Rt.edges[mt],v,Rt);jt.length>0&&(y=!0,Y=s.dfsEdgeList[mt].fromNode,jt.forEach(function(Xt){var ee="".concat(Xt.label,"-").concat(a[Xt.to].label);V[ee]||(V[ee]={projected:[],edgeLabel:Xt.label,nodeLabel2:a[Xt.to].label}),V[ee].projected.push({graphId:i.id,edge:Xt,preNode:yt})}))})},P=0;P<J;P++){var ot=$(P);if(ot==="break")break}if(!y)return!0;var ct=t.findMinLabel(V);s.dfsEdgeList.push(new ks(Y,g+1,na,ct.edgeLabel,ct.nodeLabel2));var ft=s.dfsEdgeList.length-1;return e.dfsEdgeList[ft]!==s.dfsEdgeList[ft]?!1:h(V["".concat(ct.edgeLabel,"-").concat(ct.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 au(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(E){var O="".concat(s,"-").concat(E.label,"-").concat(d[E.to].label);l[O]||(l[O]={projected:[],fromNodeId:s,edgeLabel:E.label,nodeLabel2:d[E.to].label}),l[O].projected.push({graphId:u.graphId,edge:E,preNode:u})});for(var b=function(O){var P=e.findForwardRmpathEdges(h,f.edges[a[O]],o,f);P.forEach(function(R){var F="".concat(e.dfsCode.dfsEdgeList[a[O]].fromNode,"-").concat(R.label,"-").concat(d[R.to].label);l[F]||(l[F]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[O]].fromNode,edgeLabel:R.label,nodeLabel2:d[R.to].label}),l[F].projected.push({graphId:u.graphId,edge:R,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,E=h[y.to].label;if(!e&&b>E){var O=E;E=b,b=O}var P=y.label,R="".concat(c,"-").concat(b,"-").concat(P,"-").concat(E),F="".concat(b,"-").concat(P,"-").concat(E);if(!s[F]){var I=s[F]||0;I++,s[F]=I}l[R]={graphId:c,nodeLabel1:b,edgeLabel:P,nodeLabel2:E}})})}),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}(),$C=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(s,o){var l=t[s],c=new cy(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},tN=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},hy="cluster",eN=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,s=a===void 0?hy:a,o=t.edgeLabelProp,l=o===void 0?hy:o,c=$C(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 JC(g);p.run();var y=tN(p.frequentSubgraphs,s,l);return y},nN=eN,dy=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(fy(s,o,l,n,i))}),a},fy=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}},rN=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},su=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},ou=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)},iN=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,E){return u[b]-u[E]}),d=10,f=[];h.forEach(function(b,E){f[E%d]||(f[E%d]={graphs:[],totalCount:0,aveCount:0}),f[E%d].graphs.push(b),f[E%d].totalCount+=u[b]});var v=0,g=[];f.forEach(function(b){var E=b.totalCount/b.graphs.length;b.aveCount=E,g.push(E);var O=0,P=b.length;b.graphs.forEach(function(R,F){var I=u[R];b.graphs.forEach(function(V,Y){F!==Y&&(O+=Math.abs(I-u[V]))})}),O/=P*(P-1)/2,v+=O}),v/=f.length;var p=0;g.forEach(function(b,E){g.forEach(function(O,P){E!==P&&(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]}},vy=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}},gy=function(t,e,n){var i={},a={};return t.forEach(function(s,o){i["".concat(Bm)]={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}},py=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},aN=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=su(g,s,t,h),v=h[f]}return ou(v,o,l,c)},my=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}},sN=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=jf(t,n),h=jf(e,n),d=py(t.nodes,u,n),f=py(e.nodes,h,n),v=vy(t.nodes,s),g=v.nodeMap,p=v.nodeLabelMap,y=vy(e.nodes,s),b=y.nodeMap,E=y.nodeLabelMap;gy(t.edges,o,g);var O=gy(e.edges,o,b).edgeLabelMap,P=[];h==null||h.forEach(function(Be){P=P.concat(Be)}),a||(a=Math.max.apply(Math,(0,G.ev)((0,G.ev)([],P,!1),[2],!1))),i||(i=a);var R=dy(t,u,s,i),F=dy(e,h,s,i),I=Math.min(100,c*(c-1)/2),V=rN(i,c,I,R,u),Y=su(V,R,t),J=10,$=1,ot=1,ct=4,ft={graphs:Y,nodeLabelProp:s,edgeLabelProp:o,minSupport:$,minNodeNum:ot,maxNodeNum:ct,directed:n},Nt=nN(ft).slice(0,J),Ot=Nt.length,mt=[];Nt.forEach(function(Be,Qe){mt[Qe]={},Object.keys(Y).forEach(function(Fe){var Ye=Y[Fe],nn=ou(Ye,Be,s,o);mt[Qe][Fe]=nn})});var yt=iN(mt,Ot,Nt),Rt=yt.structure,jt=yt.structureCountMap,Xt=e.nodes[0],ee=[],ae=(l=e.nodes[0])===null||l===void 0?void 0:l[s],he=-1/0;e.nodes.forEach(function(Be){var Qe=Be[s],Fe=p[Qe];(Fe==null?void 0:Fe.length)>he&&(he=Fe.length,ee=Fe,ae=Qe,Xt=Be)});var ce={},xe={},Ce={},je={},Ue={},or={};Object.keys(E).forEach(function(Be,Qe){Ue[Be]=[],n&&(or[Be]=[]);var Fe=-1/0,Ye=E[Be],nn={};Ye.forEach(function(Je){var Xe=f["".concat(Xt.id,"-").concat(Je.id)];if(Xe&&Ue[Be].push(Xe),Fe<Xe&&(Fe=Xe),nn["".concat(Xt.id,"-").concat(Je.id)]={start:0,end:b[Je.id].idx,distance:Xe},n){var Bn=f["".concat(Je.id,"-").concat(Xt.id)];Bn&&or[Be].push(Bn)}}),Ue[Be]=Ue[Be].sort(function(Je,Xe){return Je-Xe}),n&&(or[Be]=or[Be].sort(function(Je,Xe){return Je-Xe})),xe=su(nn,F,e,xe);var pe=[];if(Object.keys(nn).forEach(function(Je){if(Ce[Je]){pe.push(Ce[Je]);return}var Xe=xe[Je];Ce[Je]=ou(Xe,Rt,s,o),pe.push(Ce[Je])}),pe=pe.sort(function(Je,Xe){return Xe-Je}),je["".concat(Xt.id,"-").concat(Be)]=pe,Be!==ae)for(var He=(ee==null?void 0:ee.length)||0,qe=function(Xe){var Bn=ee[Xe],di=R[g[Bn.id].idx],Yn=di.nodeLabelCountMap[Be],Ks=E[Be].length;if(!Yn||Yn.count<Ks)return ee.splice(Xe,1),"continue";for(var Io=!1,zr=0;zr<Ks;zr++)if(Yn.dists[zr]>Ue[Be][zr]){Io=!0;break}if(Io)return ee.splice(Xe,1),"continue";var Ai={};di.neighbors.forEach(function(jr){var Vi=d["".concat(Bn.id,"-").concat(jr.id)];Ai["".concat(Bn.id,"-").concat(jr.id)]={start:g[Bn.id].idx,end:g[jr.id].idx,distance:Vi}}),Y=su(Ai,R,t,Y);var oa=[];Object.keys(Ai).forEach(function(jr){if(jt[jr]){oa.push(jt[jr]);return}var Vi=Y[jr];jt[jr]=ou(Vi,Rt,s,o),oa.push(jt[jr])}),oa=oa.sort(function(jr,Vi){return Vi-jr});for(var rs=!1,zr=0;zr<Ks;zr++)if(oa[zr]<pe[zr]){rs=!0;break}if(rs)return ee.splice(Xe,1),"continue"},tr=He-1;tr>=0;tr--)qe(tr)});var Ke=[];ee==null||ee.forEach(function(Be){for(var Qe=g[Be.id].idx,Fe=fy(t.nodes,u[Qe],Qe,s,a),Ye=Fe.neighbors,nn=Ye.length,pe=!1,He=nn-1;He>=0;He--){if(Ye.length+1<e.nodes.length){pe=!0;return}var qe=Ye[He],tr=qe[s];if(!E[tr]||!E[tr].length){Ye.splice(He,1);continue}if(!Ue[tr]||!Ue[tr].length){Ye.splice(He,1);continue}var Je="".concat(Be.id,"-").concat(qe.id),Xe=d[Je],Bn=Ue[tr].length-1,di=Ue[tr][Bn];if(Xe>di){Ye.splice(He,1);continue}if(n){var Yn="".concat(qe.id,"-").concat(Be.id),Ks=d[Yn];Bn=or[tr].length-1;var Io=or[tr][Bn];if(Ks>Io){Ye.splice(He,1);continue}}var zr=jt[Je]?jt[Je]:aN(t,Be,qe,g,Xe,R,Rt,s,o,jt,Y),Ai="".concat(Xt.id,"-").concat(tr),oa=je[Ai][je[Ai].length-1];if(zr<oa){Ye.splice(He,1);continue}var rs=my(ce,tr,b,E),jr=rs.minPatternNodeLabelDegree,Vi=rs.minPatternNodeLabelInDegree,Ta=rs.minPatternNodeLabelOutDegree;if(g[qe.id].degree<jr){Ye.splice(He,1);continue}}pe||Ke.push({nodes:[Be].concat(Ye)})});var hi=eu(e,Xt.id,!1).length,Pr={};n?(Object.keys(hi).forEach(function(Be){var Qe=b[Be].node[s];Pr[Qe]?Pr[Qe].push(hi[Be]):Pr[Qe]=[hi[Be]]}),Object.keys(Pr).forEach(function(Be){Pr[Be].sort(function(Qe,Fe){return Qe-Fe})})):Pr=Ue;for(var ns=Ke.length,wr=function(Qe){var Fe=Ke[Qe],Ye=Fe.nodes[0],nn={},pe={};Fe.nodes.forEach(function(xn,fi){pe[xn.id]={idx:fi,node:xn,degree:0,inDegree:0,outDegree:0};var lr=xn[s];nn[lr]?nn[lr]++:nn[lr]=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 tr=Object.keys(O).length,Je=!1,Xe=0;Xe<tr;Xe++){var Bn=Object.keys(O)[Xe];if(!qe[Bn]||qe[Bn]<O[Bn].length){Je=!0;break}}if(Je)return Ke.splice(Qe,1),"continue";var di=He.length;if(di<e.edges.length)return Ke.splice(Qe,1),"break";for(var Yn=!1,Ks=function(fi){var lr=He[fi],la=lr[o],Qs=O[la];if(!Qs||!Qs.length)return qe[la]--,Qs&&qe[la]<Qs.length?(Yn=!0,"break"):(He.splice(fi,1),pe[lr.source].degree--,pe[lr.target].degree--,pe[lr.source].outDegree--,pe[lr.target].inDegree--,"continue");var iw=pe[lr.source].node[s],aw=pe[lr.target].node[s],U0=!1;if(Qs.forEach(function(sw){var ow=b[sw.source].node,lw=b[sw.target].node;ow[s]===iw&&lw[s]===aw&&(U0=!0),!n&&ow[s]===aw&&lw[s]===iw&&(U0=!0)}),!U0)return qe[la]--,Qs&&qe[la]<Qs.length?(Yn=!0,"break"):(He.splice(fi,1),pe[lr.source].degree--,pe[lr.target].degree--,pe[lr.source].outDegree--,pe[lr.target].inDegree--,"continue")},Xe=di-1;Xe>=0;Xe--){var Io=Ks(Xe);if(Io==="break")break}if(Yn)return Ke.splice(Qe,1),"continue";Fe.edges=He;var zr=eu(Fe,Fe.nodes[0].id,!1).length;if(Object.keys(zr).reverse().forEach(function(xn){if(!(xn===Fe.nodes[0].id||Yn)){if(zr[xn]===1/0){var fi=pe[xn].node[s];if(nn[fi]--,nn[fi]<E[fi].length){Yn=!0;return}var lr=Fe.nodes.indexOf(pe[xn].node);Fe.nodes.splice(lr,1),pe[xn]=void 0;return}var la=g[xn].node[s];if(!Pr[la]||!Pr[la].length||zr[xn]>Pr[la][Pr[la].length-1]){var fi=pe[xn].node[s];if(nn[fi]--,nn[fi]<E[fi].length){Yn=!0;return}var lr=Fe.nodes.indexOf(pe[xn].node);Fe.nodes.splice(lr,1),pe[xn]=void 0}}}),Yn)return Ke.splice(Qe,1),"continue";for(var Ai=!0,oa=0;Ai&&!Yn;){Ai=!1;var rs=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(rs){Yn=!0;break}if(nn[Ye[s]]<E[Ye[s]].length){Yn=!0;break}for(var jr=Fe.nodes.length,Vi=jr-1;Vi>=0;Vi--){var Ta=Fe.nodes[Vi],nw=pe[Ta.id].degree,jB=pe[Ta.id].inDegree,ZB=pe[Ta.id].outDegree,WB=Ta[s],V0=my(ce,WB,b,E),rw=V0.minPatternNodeLabelDegree,GB=V0.minPatternNodeLabelInDegree,VB=V0.minPatternNodeLabelOutDegree,UB=n?nw<rw||jB<GB||ZB<VB:nw<rw;if(UB){if(nn[Ta[s]]--,nn[Ta[s]]<E[Ta[s]].length){Yn=!0;break}Fe.nodes.splice(Vi,1),pe[Ta.id]=void 0,Ai=!0}}if(Yn||!Ai&&oa!==0)break;di=He.length;for(var ud=di-1;ud>=0;ud--){var Oa=He[ud];if(!pe[Oa.source]||!pe[Oa.target]){He.splice(ud,1);var hd=Oa[o];if(qe[hd]--,pe[Oa.source]&&(pe[Oa.source].degree--,pe[Oa.source].outDegree--),pe[Oa.target]&&(pe[Oa.target].degree--,pe[Oa.target].inDegree--),O[hd]&&qe[hd]<O[hd].length){Yn=!0;break}Ai=!0}}oa++}if(Yn||Yn||Fe.nodes.length<e.nodes.length||He.length<e.edges.length)return Ke.splice(Qe,1),"continue"},vr=ns-1;vr>=0;vr--){var Aa=wr(vr);if(Aa==="break")break}for(var Sr=Ke.length,Jr=function(Qe){var Fe=Ke[Qe],Ye={};Fe.edges.forEach(function(He){var qe="".concat(He.source,"-").concat(He.target,"-").concat(He.label);Ye[qe]?Ye[qe]++:Ye[qe]=1});for(var nn=function(qe){var tr=Ke[qe],Je={};tr.edges.forEach(function(Bn){var di="".concat(Bn.source,"-").concat(Bn.target,"-").concat(Bn.label);Je[di]?Je[di]++:Je[di]=1});var Xe=!0;Object.keys(Je).length!==Object.keys(Ye).length?Xe=!1:Object.keys(Ye).forEach(function(Bn){Je[Bn]!==Ye[Bn]&&(Xe=!1)}),Xe&&Ke.splice(qe,1)},pe=Sr-1;pe>Qe;pe--)nn(pe);Sr=Ke.length},vr=0;vr<=Sr-1;vr++)Jr(vr);return Ke}}},oN=sN,lN=function(){function r(t){t===void 0&&(t=10),this.linkedList=new Im,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}(),cN=lN,uN=Vm,c7={getAdjMatrix:Qc,breadthFirstSearch:GO,connectedComponent:zm,getDegree:Rf,getInDegree:UO,getOutDegree:YO,detectCycle:Vm,detectDirectedCycle:uN,detectAllCycles:KO,detectAllDirectedCycle:Gm,detectAllUndirectedCycle:Wm,depthFirstSearch:Zm,dijkstra:eu,findAllPath:wC,findShortestPath:zf,floydWarshall:jf,labelPropagation:AC,louvain:ey,iLouvain:LC,kCore:DC,kMeans:BC,cosineSimilarity:ry,nodesCosineSimilarity:jC,minimumSpanningTree:XC,pageRank:ay,getNeighbors:Ei,Stack:cN,GADDI:oN};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(pa("The datum does not have available id."))}function lu(r){return r.combo}function yy(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 by=(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 hN(r,e.directed,e.weightPropertyName);case"closeness":return dN(r,e.directed,e.weightPropertyName);case"eigenvector":return vN(r,e.directed);case"pagerank":return fN(r,e.epsilon,e.linkProb);default:return xy(r)}},xy=r=>{var t;const e=new Map;return(t=r.nodes)===null||t===void 0||t.forEach(n=>{e.set(At(n),0)}),e},hN=(r,t,e)=>{const n=xy(r),{nodes:i=[]}=r;return i.forEach(a=>{i.forEach(s=>{if(a!==s){const{allPath:o}=zf(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},dN=(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}=zf(r,At(a),At(l),t,e);o+=c}return o},0);n.set(At(a),1/s)}),n},fN=(r,t,e)=>{var n;const i=new Map,a=ay(r,t,e);return(n=r.nodes)===null||n===void 0||n.forEach(s=>{i.set(At(s),a[At(s)])}),i},vN=(r,t)=>{const{nodes:e=[]}=r,n=gN(r,t),i=pN(n,e.length),a=new Map;return e.forEach((s,o)=>{a.set(At(s),i[o])}),a},gN=(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},pN=(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=Wn){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 mN(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 Gf{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=mN(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=ga(e,i);if(!a)return Xr.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 Vf{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 Vf{}class cu extends si{constructor(t,e){super(t,Object.assign({},cu.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=by(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=[]}=Xc(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=Lm(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()}}cu.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var yN=function(r){if(!Af(r)||!Tg(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=yN,bN=5;function xN(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 Ey(r,t,e,n){e=e||0,n=n||bN;for(var i in t)if(xN(t,i)){var a=t[i];a!==null&&vo(a)?(vo(r[i])||(r[i]={}),e<n?Ey(r[i],a,e+1,n):r[i]=t[i]):Wr(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var EN=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)Ey(r,t[n]);return r},mr=EN;const wy=[0,0,0];function Ne(r,t){return r.map((e,n)=>e+t[n])}function ln(r,t){return r.map((e,n)=>e-t[n])}function Di(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 wN(r,t){return r.reduce((e,n,i)=>e+n*t[i],0)}function SN(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 uu(r,t){return r.reduce((e,n,i)=>e+Math.abs(n-t[i]),0)}function ma(r){const t=r.reduce((e,n)=>e+Math.pow(n,2),0);return r.map(e=>e/Math.sqrt(t))}function Uf(r,t,e=!1){const n=r[0]*t[1]-r[1]*t[0];let i=Math.acos(Di(r,t).reduce((a,s)=>a+s,0)/(bn(r,wy)*bn(t,wy)));return e&&n<0&&(i=2*Math.PI-i),i}function u7(r,t){return r.every((e,n)=>e===t[n])}function hu(r,t=!0){return t?[-r[1],r[0]]:[r[1],-r[0]]}function Yf(r,t){return r.map(e=>e%t)}function Rs(r){return[r[0],r[1]]}function pl(r){return CO(r)?[r[0],r[1],0]:r}function Sy(r){const[t,e]=r;return!t&&!e?0:Math.atan2(e,t)}function My(r,t){const[e,n]=r;if(t%360===0)return[e,n];const i=t*Math.PI/180,a=Math.cos(i),s=Math.sin(i);return[e*a-n*s,e*s+n*a]}function Ay(r,t){const[e,n]=r,[i,a]=t,s=ln(e,n),o=ln(i,a);return SN(s,o).every(l=>l===0)}function Hf(r,t,e=!1){if(Ay(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 Ty(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 ir(r){const{x:t=0,y:e=0,z:n=0}=r.style||{};return[+t,+e,+n]}function MN(r){const{x:t,y:e,z:n}=r.style||{};return t!==void 0||e!==void 0||n!==void 0}function Oy(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 ya(r,t="center"){const e=Ty(t);return Oy(r,e)}function h7(r,t){const e=parseAnchor(t);return Oy(r,e)}const d7=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 f7(r){return r.sort((t,e)=>t[0]-e[0]||t[1]-e[1])}function v7(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(Wn(r,t))return r;const i=n?ln(r,t):ln(t,r),a=ma(i),s=[a[0]*e,a[1]*e];return Ne(Rs(r),s)}function Cy(r,t){return r[1]===t[1]}function AN(r,t){return r[0]===t[0]}function TN(r,t){return Cy(r,t)||AN(r,t)}function Ny(r,t,e){return Ay([r,t],[t,e])}function ky(r,t){return[2*t[0]-r[0],2*t[1]-r[1]]}function Py(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=Ne(t,s),o=Ne(t,o));const l=i?ky(r,t):r,c=Hf([t,l],[s,o]);if(c)return{point:c,line:[s,o]}}return{point:t,line:void 0}}function ON(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 CN(r,t,e=!1){const n=ya(t,"center"),i=[ya(t,"left-top"),ya(t,"right-top"),ya(t,"right-bottom"),ya(t,"left-bottom")];return Py(r,n,i,!1,e).point}function du(r,t,e=!1){const n=t.center,i=e?ky(r,n):r,a=ln(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 NN(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 kN(r,t){let e=1/0,n=[[0,0],[0,0]];return t.forEach(i=>{const a=PN(r,i);a<e&&(e=a,n=i)}),n}function PN(r,t){const e=Ry(r,t);return bn(r,e)}function Ry(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 RN(r){const t=r.reduce((e,n)=>Ne(e,n),[0,0]);return Ii(t,r.length)}function Xf(r,t=!0){const e=RN(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 Ly(r,t){return[r,[r[0],t[1]],t,[t[0],r[1]]]}class Gn{constructor(t,e,n){if(this.phase=e,this.pointerByTouch=[],this.initialDistance=null,this.emitter=t,Gn.instance)return Gn.callbacks[this.phase].push(n),Gn.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),Gn.instance=this,Gn.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)){Gn.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),Gn.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;Gn.callbacks.pinchmove.forEach(l=>l(t,{scale:(o-1)*5}))}onPointerUp(t){var e;Gn.callbacks.pinchend.forEach(n=>n(t,{scale:0})),Gn.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],(e=Gn.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),Gn.instance=null}off(t,e){const n=Gn.callbacks[t].indexOf(e);n>-1&&Gn.callbacks[t].splice(n,1),this.tryDestroy()}tryDestroy(){Object.values(Gn.callbacks).every(t=>t.length===0)&&this.destroy()}}Gn.isPinching=!1,Gn.instance=null,Gn.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const _y=r=>r.map(t=>Ge(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 Gn(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(t,e))}unbind(t,e){this.map.forEach((n,i)=>{Wn(i,t)&&(!e||e===n)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(t){const e=_y(Array.from(this.recordKey)).sort(),n=_y(t).sort();return Wn(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)&&Wn(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=fu(t,this.context.graph),(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(Ly(this.startPoint,this.endPoint))}onPointerUp(t){if(this.startPoint){if(!this.endPoint){this.clearBrush();return}this.endPoint=fu(t,this.context.graph),this.updateElementsStates(Ly(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"&&ON(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(va.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(va.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 fu=(r,t)=>{if((r.targetType==="node"||r.targetType==="combo")&&!(r.nativeEvent.target instanceof HTMLCanvasElement)){const[e,n]=t.getCanvasByClient([r.client.x,r.client.y]);return[e,n]}return[r.canvas.x,r.canvas.y]},ba=.8,Ls=["node","edge","combo"];function _s(r,t,e,n,i=0){n==="TB"&&t(r,i);const a=e(r);if(a)for(const s of a)_s(s,t,e,n,i+1);n==="BT"&&t(r,i)}function LN(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 Dy(r,t,e,n,i="both"){if(t==="combo"||t==="node")return Kf(r,e,n,i);const a=r.getEdgeData(e);if(!a)return[];const s=Kf(r,a.source,n-1,i),o=Kf(r,a.target,n-1,i);return Array.from(new Set([...s,...o,e]))}function Kf(r,t,e,n="both"){const i=new Set,a=new Set,s=new Set;return LN(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 Qf(r){return r.states||[]}var vu=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.onClickSelect=n=>vu(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=>vu(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(va.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 Dy(i,n,e.id,typeof a=="function"?a(t):a).filter(s=>s!==e.id)}updateState(t){return vu(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=Qf(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)]=Qf(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=Qf(h),f=d.filter(v=>!s.has(v));(t||f.length!==d.length)&&(u[At(h)]=f)}),u}clearState(){return vu(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(va.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}gu.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function Kr(r){var t;return!!(!((t=r.style)===null||t===void 0)&&t.collapsed)}var br=function(r,t,e){for(var n=0,i=Ge(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=Ge(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(zn(n[a])||(n[a]=ie(i[s+1])?[]:{}),n=n[a]):n[a]=e}),r},_N=function(r){var t=Tm(r);return t.charAt(0).toLowerCase()+t.substring(1)},DN=_N;function xl(r,t){if(!r.startsWith(t))return!1;const e=r[t.length];return e>="A"&&e<="Z"}function Iy(r,t){return`${t}${Yc(r)}`}function By(r,t,e=!0){if(!t||!xl(r,t))return r;const n=r.slice(t.length);return e?DN(n):n}function _n(r,t){const e=Object.entries(r).reduce((n,[i,a])=>(i==="className"||i==="class"||xl(i,t)&&Object.assign(n,{[By(i,t)]:a}),n),{});if("opacity"in r){const n=Iy("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 qf(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 Fy(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 g7(r,t,e){return Object.entries(r).reduce((n,[i,a])=>(xl(i,t)?n[Iy(By(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 IN=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 zy(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 ur(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 BN(r){const{x:t,y:e,z:n,class:i,className:a,transform:s,transformOrigin:o,zIndex:l,visibility:c}=r;return IN(r,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}function FN(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 jy(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 zN(r,t){if(!t)return{};const{type:e,color:n,field:i,invert:a}=t,s=l=>{const c=typeof n=="string"?ga("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=Xc(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(pa(`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 Zy(r){const t=typeof r=="string"?ga("palette",r):r;if(typeof t!="function")return t}function Wy(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 Gy(r,t,e=1,n=!1){const i=n?e:1,a=(r.max[0]-r.min[0])*i;return Wy(a,t)}function jN(r,t,e=1){const n=bn(r[0],r[1])*e;return Wy(n,t)}var ZN={}.toString,WN=function(r){return ZN.call(r).replace(/^\[object /,"").replace(/]$/,"")},GN=WN,VN=Object.prototype,UN=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||VN;return r===e},YN=UN,HN=Object.prototype.hasOwnProperty;function XN(r){if(me(r))return!0;if(cl(r))return!r.length;var t=GN(r);if(t==="Map"||t==="Set")return!r.size;if(YN(r))return!Object.keys(r).length;for(var e in r)if(HN.call(r,e))return!1;return!0}var ra=XN;class El extends ff{constructor(t){Vy(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"?ga(ul.SHAPE,e):e;if(!g)throw new Error(pa(`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),bv(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);Vy(e),K3(this,e),this.render(e,this),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return BN(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&&(Jf(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${Yc(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(Nf(h),e);d&&(Jf(l,d),n.push(d))}});const s=(o,l)=>{if(!ra(o)){const c=`get${Yc(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(Nf(f),e);g&&(Jf(v,g),n.push(g))}})}}};this.compositeShapes.forEach(([o,l])=>{const c=qf(this.shapeMap,l);s(c,o)})}}return Cf(n)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Ps(this,t)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function Jf(r,t){t==null||t.finished.then(()=>{const e=r.activeAnimations.findIndex(n=>n===t);e>-1&&r.activeAnimations.splice(e,1)})}function Vy(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=Nm(t,e,n,i);a&&(r.transform=a)}return r}var KN=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 ia extends El{constructor(t){super(ur({style:ia.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=KN(e,["padding"]);return Fy(i,"background")}getBackgroundStyle(t){if(t.background===!1)return!1;const e=this.getGraphicStyle(t),{wordWrap:n,wordWrapWidth:i,padding:a}=e,s=_n(e,"background"),{min:[o,l],center:[c,u],halfExtents:[h,d]}=this.shapeMap.text.getGeometryBounds(),[f,v,g,p]=ai(a),y=h*2+p+v,{width:b,height:E}=s;b&&E?Object.assign(s,{x:c-Number(b)/2,y:u-Number(E)/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 P=Number(O.replace("%",""))/100;s.radius=Math.min(+s.width,+s.height)*P}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()}}ia.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(ur({style:po.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",ia,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 QN(r,t=!0){const e=[];return r.forEach((n,i)=>{e.push([i===0?"M":"L",...n])}),t&&e.push(["Z"]),e}const Uy={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 qN(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 Uy?n=a:t.unshift(a),i={type:n},Uy[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 JN(r){const t=[];return(typeof r=="string"?qN(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 Yy=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 $N(r,t,e,n,i,a,s){const[o,l]=ya(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=JN(a);if(!u||u.length<=3)return c;const h=u.map((v,g)=>{const p=v,y=u[(g+1)%u.length];return Wn(p,y)?null:[p,y]}).filter(Boolean),d=kN([o,l],h),f=Ry([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 tk=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(ur({style:wl.defaultStyleProps},t))}getLabelStyle(t){if(!t.label||!t.d||t.d.length===0)return!1;const e=_n(this.getGraphicStyle(t),"label"),{maxWidth:n,offsetX:i,offsetY:a,autoRotate:s,placement:o,closeToPath:l}=e,c=tk(e,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),u=this.shapeMap.key,h=u==null?void 0:u.getRenderBounds();return Object.assign($N(h,o,i,a,l,t.d,s),{wordWrapWidth:Gy(h,n)},c)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",ni,this.getKeyStyle(t),e),this.upsert("label",ia,this.getLabelStyle(t),e)}}wl.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};function ek(r){const t=[],e=n=>{n!=null&&n.children.length&&n.children.forEach(i=>{t.push(i),e(i)})};return e(r),t}function nk(r){const t=[];let e=r.parentNode;for(;e;)t.push(e),e=e.parentNode;return t}class $f extends sl{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},mo=this,this.isMutationObserved=!0,this.addEventListener(De.MOUNTED,this.onMounted),this.addEventListener(De.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 tv=new WeakMap;let mo=null;const ev=r=>{if(mo&&nk(mo).includes(r)){const t=tv.get(r);t?t.includes(mo)||t.push(mo):tv.set(r,[mo])}},nv=r=>{const t=tv.get(r);t&&t.forEach(e=>e.handleRadius())};class Hy 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()?$f:Os,this.getIconStyle(t),e)}}class Xy 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 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 Fi extends Xy{constructor(t){super(ur({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(Fy(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=_n(this.getGraphicStyle(t),"label"),{placement:n,maxWidth:i,offsetX:a,offsetY:s}=e,o=pu(e,["placement","maxWidth","offsetX","offsetY"]),l=this.getShape("key").getLocalBounds();return Object.assign(O1(l,n,a,s),{wordWrapWidth:Gy(l,i)},o)}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),{fill:n}=e,i=pu(e,["fill"]),a=_n(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=_n(this.getGraphicStyle(t),"icon");return Object.assign(FN(t.size,e),e)}getBadgesStyle(t){var e;const n=qf(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=pu(t,["badges","badgePalette","opacity"]),c=Zy(s),u=_n(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=pu(t,["placement","offsetX","offsetY"]),o=O1(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=_n(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(M1(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 pv(rk(this.context,i),n)}getPorts(){return qf(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return CN(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",Hy,n,e),ev(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",ia,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)&&nv(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 rk(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 Ds extends Fi{constructor(t){super(ur({style:Ds.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*ba;return e?Object.assign({width:i,height:i},e):!1}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return du(t,n,e)}}Ds.defaultStyleProps={size:32};class mu 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 Py(t,s,a,!0,e).point}}class ik extends mu{constructor(t){super(t)}getPoints(t){const[e,n]=this.getSize(t);return X3(e,n)}}var ak=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 yu extends Ds{constructor(t){super(ur({style:yu.defaultStyleProps},t))}parseOuterR(){const{size:t}=this.parsedAttributes;return Math.min(...oi(t))/2}parseInnerR(){const{innerR:t}=this.parsedAttributes;return Ge(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=_n(this.getGraphicStyle(t),"donut"),s=Zy(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=ak(h,["value","color"]),p=(o===0?1/i.length:f/o)*360;this.upsert(`round${d}`,ni,Object.assign(Object.assign(Object.assign({},a),{d:lk(l,c,u,u+p),fill:v}),g),e),u+=p})}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}yu.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const bu=(r,t,e,n)=>[r+Math.sin(n)*e,t-Math.cos(n)*e],sk=(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"]],ok=(r,t,e,n,i,a)=>{const[s,o]=[i/360*2*Math.PI,a/360*2*Math.PI],l=[bu(r,t,n,s),bu(r,t,e,s),bu(r,t,e,o),bu(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"]]},lk=(r=0,t=0,e,n)=>{const[i,a]=[0,0];return Math.abs(e-n)%360<1e-6?sk(i,a,r,t):ok(i,a,r,t,e,n)};class xu extends Fi{constructor(t){super(ur({style:xu.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*ba;return e?Object.assign({width:a,height:a},e):!1}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return du(t,n,e)}}xu.defaultStyleProps={size:[45,35]};class ck extends mu{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return Q3(this.getOuterR(t))}getIconStyle(t){const e=super.getIconStyle(t),n=this.getOuterR(t)*ba;return e?Object.assign({width:n,height:n},e):!1}}function uk(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 hk(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 dk(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&&Ve(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&&Ve(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 fk(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&&Ve(e)&&i){var p=e.parentNode.getStartTangent(),y=(0,L.Z)(p,2),b=y[0],E=y[1];v=b[0]-E[0],g=b[1]-E[1],f=Math.atan2(g,v),c=Math.cos(f)*(i||0),u=Math.sin(f)*(i||0)}if(n&&Ve(n)&&a){var O=n.parentNode.getEndTangent(),P=(0,L.Z)(O,2),R=P[0],F=P[1];v=R[0]-F[0],g=R[1]-F[1],f=Math.atan2(g,v),h=Math.cos(f)*(a||0),d=Math.sin(f)*(a||0)}for(var I=0;I<o.length;I++){var V=o[I],Y=V[0],J=o[I+1],$=I===0&&(c!==0||u!==0),ot=(I===o.length-1||J&&(J[0]==="M"||J[0]==="Z"))&&h!==0&&d!==0,ct=$?[c,u]:[0,0],ft=(0,L.Z)(ct,2),Nt=ft[0],Ot=ft[1],mt=ot?[h,d]:[0,0],yt=(0,L.Z)(mt,2),Rt=yt[0],jt=yt[1];switch(Y){case"M":r.moveTo(V[1]+Nt,V[2]+Ot);break;case"L":r.lineTo(V[1]+Rt,V[2]+jt);break;case"Q":r.quadraticCurveTo(V[1],V[2],V[3]+Rt,V[4]+jt);break;case"C":r.bezierCurveTo(V[1],V[2],V[3],V[4],V[5]+Rt,V[6]+jt);break;case"A":{var Xt=l[I].arcParams,ee=Xt.cx,ae=Xt.cy,he=Xt.rx,ce=Xt.ry,xe=Xt.startAngle,Ce=Xt.endAngle,je=Xt.xRotation,Ue=Xt.sweepFlag;if(r.ellipse)r.ellipse(ee,ae,he,ce,je,xe,Ce,!!(1-Ue));else{var or=he>ce?he:ce,Ke=he>ce?1:he/ce,hi=he>ce?ce/he:1;r.translate(ee,ae),r.rotate(je),r.scale(Ke,hi),r.arc(0,0,or,xe,Ce,!!(1-Ue)),r.scale(1/Ke,1/hi),r.rotate(-je),r.translate(-ee,-ae)}ot&&r.lineTo(V[6]+h,V[7]+d);break}case"Z":r.closePath();break}}}function vk(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&&Ve(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&&Ve(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 E=1;E<o-1;E++){var O=s[E];r.lineTo(O[0],O[1])}r.lineTo(u,h)}function gk(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&&Ve(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&&Ve(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 E=1;E<o-1;E++){var O=s[E];r.lineTo(O[0],O[1])}r.lineTo(u+v,h+g)}function pk(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(P){return P!==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(P){return kn(P,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),p=(0,L.Z)(g,4),y=p[0],b=p[1],E=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*E+a),E!==0&&r.arc(c-d*E+n,u-f*E+a,E,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 mk=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,_.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,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.CIRCLE,uk),Dt.ELLIPSE,hk),Dt.RECT,pk),Dt.LINE,dk),Dt.POLYLINE,gk),Dt.POLYGON,vk),Dt.PATH,fk),Dt.TEXT,void 0),Dt.GROUP,void 0),Dt.IMAGE,void 0),(0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.HTML,void 0),Dt.MESH,void 0),Dt.FRAGMENT,void 0));this.context.pathGeneratorFactory=i}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(_a);var yk=pt(),bk=pt(),xk=pt(),Ek=Wt(),Ky=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(Ek,i),l=re(bk,zt(xk,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,La.Z)((0,Tr.Z)().mark(function u(h){return(0,Tr.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(yk,s,o,0),c=e.elementsFromBBox(l[0],l[1],l[0],l[1]),u=[],h=(0,fs.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=Fp(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(E){h.e(E)}finally{h.f()}return n.picked=u,n}}])}();Ky.tag="CanvasPicker";function wk(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=Ar(a,o,t.x,t.y),E=xs(p,c,u),O=(0,L.Z)(E,2),P=O[0],R=O[1];return P&&R||e?b<=l+y:P?b<=l:R?b>=l-y&&b<=l+y:!1}function Eu(r,t,e,n){return r/(e*e)+t/(n*n)}function Sk(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,E=t.y,O=xs(y,u,h),P=(0,L.Z)(O,2),R=P[0],F=P[1],I=(f+g)/2,V=(b-a)*(b-a),Y=(E-o)*(E-o);return R&&F||e?Eu(V,Y,l+I,c+I)<=1:R?Eu(V,Y,l,c)<=1:F?Eu(V,Y,l-I,c-I)>=1&&Eu(V,Y,l+I,c+I)<=1:!1}function Is(r,t,e,n,i,a){return i>=r&&i<=r+e&&a>=t&&a<=t+n}function Mk(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 wu(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 Ar(c.x,c.y,s,o)<=a/2}function Ga(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?Dg(r,t,e,n,a,s)<=i/2:!1}function Qy(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(Ga(o,l,c,u,t,e,n))return!0}if(i){var h=r[0],d=r[a-1];if(Ga(h[0],h[1],d[0],d[1],t,e,n))return!0}return!1}var Ak=1e-6;function rv(r){return Math.abs(r)<Ak?0:r<0?-1:1}function Tk(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 qy(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(Tk(s,o,[t,e]))return!0;rv(s[1]-e)>0!=rv(o[1]-e)>0&&rv(t-(e-s[1])*(s[0]-o[0])/(s[1]-o[1])-s[0])<0&&(n=!n)}return n}function Jy(r,t,e){for(var n=!1,i=0;i<r.length;i++){var a=r[i];if(n=qy(a,t,e),n)break}return n}function Ok(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,L.Z)(p,2),b=y[1];return!b&&!e||!c?!1:Ga(i,a,s,o,c+h,t.x,t.y)}function Ck(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=Ga(h[0],h[1],c[0],c[1],t,e,n),a)return!0;break;case"Q":var f=B2(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=Fg(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=Cd(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=Fg(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 Nk(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,E=f.polygons,O=xs(g,(E==null?void 0:E.length)&&d,h),P=(0,L.Z)(O,2),R=P[0],F=P[1],I=Kd(r),V=!1;return R||e?(y?V=n(r,t):V=Jy(E,t.x,t.y)||Jy(b,t.x,t.y),V):((F||e)&&(V=Ck(p,l+u,t.x,t.y,I)),V)}function kk(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,L.Z)(f,2),g=v[0],p=v[1],y=!1;return(p||e)&&(y=Qy(u.points,o+c,t.x,t.y,!0)),!y&&(g||e)&&(y=qy(u.points,t.x,t.y)),y}function Pk(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,L.Z)(f,2),g=v[1];return!g&&!e||!a?!1:Qy(l.points,a+o,t.x,t.y,!1)}function Rk(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,E=a.pointerEvents,O=E===void 0?"auto":E,P=xs(O,o,l),R=(0,L.Z)(P,2),F=R[0],I=R[1],V=s&&s.some(function(ot){return ot!==0}),Y=u+d;if(V){var $=!1;return(I||e)&&($=Lk(v,p,y,b,s.map(function(ot){return kn(ot,0,Math.min(Math.abs(y)/2,Math.abs(b)/2))}),Y,t.x,t.y)),!$&&(F||e)&&($=n(r,t)),$}else{var J=Y/2;if(F&&I||e)return Is(v-J,p-J,y+J,b+J,t.x,t.y);if(F)return Is(v,p,y,b,t.x,t.y);if(I)return Mk(v,p,y,b,Y,t.x,t.y)}return!1}function Lk(r,t,e,n,i,a,s,o){var l=(0,L.Z)(i,4),c=l[0],u=l[1],h=l[2],d=l[3];return Ga(r+c,t,r+e-u,t,a,s,o)||Ga(r+e,t+u,r+e,t+n-h,a,s,o)||Ga(r+e-h,t+n,r+d,t+n,a,s,o)||Ga(r,t+n-d,r,t+c,a,s,o)||wu(r+e-u,t+u,u,1.5*Math.PI,2*Math.PI,a,s,o)||wu(r+e-h,t+n-h,h,0,.5*Math.PI,a,s,o)||wu(r+d,t+n-d,d,.5*Math.PI,Math.PI,a,s,o)||wu(r+c,t+c,c,Math.PI,1.5*Math.PI,a,s,o)}function _k(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[Dt.IMAGE].render(y,(0,B.Z)((0,B.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(E){return E!==0})}return!0}function Dk(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 Ik=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,_.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,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.CIRCLE,wk),Dt.ELLIPSE,Sk),Dt.RECT,Rk),Dt.LINE,Ok),Dt.POLYLINE,Pk),Dt.POLYGON,kk),Dt.PATH,Nk),Dt.TEXT,Dk),Dt.GROUP,null),Dt.IMAGE,_k),(0,se.Z)((0,se.Z)(n,Dt.HTML,null),Dt.MESH,null));this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new Ky)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(_a);function aa(r,t){if(!{}.hasOwnProperty.call(r,t))throw new TypeError("attempted to use private field on non-instance");return r}var Bk=0;function Fk(r){return"__private_"+Bk+++"_"+r}var zk=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,B.Z)((0,B.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()}}])}(),iv=[],av=[],sv=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;iv.length<=0&&av.length<=0||(av.forEach(function(n){return n()}),av=iv.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 E=function(R){iv.push(function(){var F=R*u,I=b*h,V=[Math.min(n,l-F),Math.min(i,c-I)],Y=V[0],J=V[1],$=o.createCanvas();$.width=n,$.height=i;var ot=$.getContext("2d");ot.drawImage(e,F,I,Y,J,0,0,Y,J),v.tiles[b][R]={x:F,y:I,tileX:R,tileY:b,data:$},a()})},O=0;O<d;O++)E(O)},p=0;p<f;p++)g(p);return r.stop(),r.executeTask(),v}}])}();sv.TASK_NUM_PER_FRAME=10;var li=new zk;li.onRefAdded=function(t){var e=this;t.addEventListener(De.DESTROY,function(){e.releaseRef(t)},{once:!0})};var ov=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=Ge(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=Ge(e)?e:e.src;if(!Ge(e)&&!li.has(a)){var s={img:e,size:[e.naturalWidth||e.width,e.naturalHeight||e.height],tileSize:Su(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=Su(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:Su(u)};li.put(a,h,n),u.onload=function(){h.size=[u.naturalWidth||u.width,u.naturalHeight||u.height],h.tileSize=Su(h.img),l(h)},u.onerror=function(d){c(d)},u.crossOrigin="Anonymous",u.src=a}})}},{key:"createDownSampledImage",value:function(){var t=(0,La.Z)((0,Tr.Z)().mark(function n(i,a){var s,o,l,c,u,h,d,f,v,g,p,y,b,E;return(0,Tr.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,L.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))),E=(0,B.Z)((0,B.Z)({},s),{},{downSamplingRate:b}),li.update(s.img.src,E,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 E=(0,B.Z)((0,B.Z)({},this.getImageSync(i,a)),{},{downSampled:y,downSamplingRate:b}),li.update(s.img.src,E,a),O.abrupt("return",E);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,La.Z)((0,Tr.Z)().mark(function n(i,a,s,o){var l,c,u,h,d;return(0,Tr.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,sv.api={requestAnimationFrame:u,cancelAnimationFrame:h,createCanvas:function(){return uf.createCanvas()}},d=(0,B.Z)((0,B.Z)({},l),sv.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(Ge(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(Ge(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=Xp(Pp(d),new yn({})):y=ge(Wt()),v&&fn(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===Da.LinearGradient){var g=DS(o,l,c,u),p=g.x1,y=g.y1,b=g.x2,E=g.y2;v=n.createLinearGradient(p,y,b,E)}else if(a===Da.RadialGradient){var O=IS(o,l,c,h,d,f),P=O.x,R=O.y,F=O.r;v=n.createRadialGradient(P,R,0,P,R,F)}return v&&(s.forEach(function(I){var V=I.offset,Y=I.color;if(V.unit===te.kPercentage){var J;(J=v)===null||J===void 0||J.addColorStop(V.value/100,Y.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(Ge(n))return"pattern-".concat(n,"-").concat(i);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(i)}}])}();ov.isSupportTile=!!uf.createCanvas();function Su(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 $y=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===Dt.IMAGE){var g=v.src,p=v.keepAspectRatio;a.getImageSync(g,d,function(y){var b=y.img,E=b.width,O=b.height;p&&o(d,E,O),d.renderable.dirty=!0,n.dirtify()})}},c=function(h){var d=h.target,f=h.attrName,v=h.prevValue,g=h.newValue;d.nodeName!==Dt.IMAGE||f!=="src"||(v!==g&&a.releaseImage(v,d),Ge(g)&&a.getOrCreateImage(g,d).then(function(p){var y=p.img,b=y.width,E=y.height;d.attributes.keepAspectRatio&&o(d,b,E),d.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(r.tag,function(){s.addEventListener(De.MOUNTED,l),s.addEventListener(De.ATTR_MODIFIED,c)}),n.hooks.destroy.tap(r.tag,function(){s.removeEventListener(De.MOUNTED,l),s.removeEventListener(De.ATTR_MODIFIED,c)})}}])}();$y.tag="LoadImage";var jk=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,_.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 ov(this.context,n),this.addRenderingPlugin(new $y)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(_a);var Vn=Fk("renderState"),t1=function(){function r(t){(0,N.Z)(this,r),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,Vn,{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=pt(),this.vec3b=pt(),this.vec3c=pt(),this.vec3d=pt(),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 P=O.target,R=P.rBushNode;R!=null&&R.aabb&&i.removedRBushNodeAABBs.push(R.aabb)},p=function(O){var P=O.target,R=P.rBushNode;R.aabb&&i.removedRBushNodeAABBs.push(R.aabb)};l.hooks.init.tap(r.tag,function(){v.addEventListener(De.UNMOUNTED,g),v.addEventListener(De.CULLED,p);var E=f.getDPR(),O=s.width,P=s.height,R=f.getContext();i.clearRect(R,0,0,O*E,P*E,s.background)}),l.hooks.destroy.tap(r.tag,function(){v.removeEventListener(De.UNMOUNTED,g),v.removeEventListener(De.CULLED,p),i.renderQueue=[],i.removedRBushNodeAABBs=[],aa(i,Vn)[Vn]={restoreStack:[],prevObject:null,currentContext:null}});var y=function(){var O,P=f.getContext(),R=f.getDPR(),F=s.width,I=s.height,V=i.canvasRendererPluginOptions,Y=V.dirtyObjectNumThreshold,J=V.dirtyObjectRatioThreshold,$=l.getStats(),ot=$.total,ct=$.rendered,ft=ct/ot;i.clearFullScreen=i.clearFullScreenLastFrame||!((O=v.context.renderingPlugins[1])!==null&&O!==void 0&&O.isFirstTimeRenderingFinished)||l.disableDirtyRectangleRendering()||ct>Y&&ft>J,P&&(typeof P.resetTransform=="function"?P.resetTransform():P.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(P,0,0,F*R,I*R,s.background))},b=function(O,P){for(var R=[O];R.length>0;){var F,I=R.pop();I.isVisible()&&!I.isCulled()&&(d?i.renderDisplayObjectOptimized(I,P,i.context,aa(i,Vn)[Vn],n):i.renderDisplayObject(I,P,i.context,aa(i,Vn)[Vn],n));for(var V=((F=I.sortable)===null||F===void 0||(F=F.sorted)===null||F===void 0?void 0:F.length)>0?I.sortable.sorted:I.childNodes,Y=V.length-1;Y>=0;Y--)R.push(V[Y])}};l.hooks.endFrame.tap(r.tag,function(){if(y(),c.root.childNodes.length===0){i.clearFullScreenLastFrame=!0;return}d=s.renderer.getConfig().enableRenderingOptimization,aa(i,Vn)[Vn]={restoreStack:[],prevObject:null,currentContext:aa(i,Vn)[Vn].currentContext},aa(i,Vn)[Vn].currentContext.clear(),i.clearFullScreenLastFrame=!1;var E=f.getContext(),O=f.getDPR();if(gn(i.dprMatrix,[O,O,1]),Jt(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(E.save(),b(c.root,E),E.restore()):b(c.root,E),i.removedRBushNodeAABBs=[];else{var P=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat((0,k.Z)(i.removedRBushNodeAABBs.map(function(ce){var xe=ce.minX,Ce=ce.minY,je=ce.maxX,Ue=ce.maxY,or=new pn;return or.setMinMax([xe,Ce,0],[je,Ue,0]),or}))));if(i.removedRBushNodeAABBs=[],pn.isEmpty(P)){i.renderQueue=[];return}var R=i.convertAABB2Rect(P),F=R.x,I=R.y,V=R.width,Y=R.height,J=re(i.vec3a,[F,I,0],i.vpMatrix),$=re(i.vec3b,[F+V,I,0],i.vpMatrix),ot=re(i.vec3c,[F,I+Y,0],i.vpMatrix),ct=re(i.vec3d,[F+V,I+Y,0],i.vpMatrix),ft=Math.min(J[0],$[0],ct[0],ot[0]),Nt=Math.min(J[1],$[1],ct[1],ot[1]),Ot=Math.max(J[0],$[0],ct[0],ot[0]),mt=Math.max(J[1],$[1],ct[1],ot[1]),yt=Math.floor(ft),Rt=Math.floor(Nt),jt=Math.ceil(Ot-ft),Xt=Math.ceil(mt-Nt);E.save(),i.clearRect(E,yt,Rt,jt,Xt,s.background),E.beginPath(),E.rect(yt,Rt,jt,Xt),E.clip(),E.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]);var ee=s.renderer.getConfig(),ae=ee.enableDirtyRectangleRenderingDebug;ae&&v.dispatchEvent(new Qn(ri.DIRTY_RECTANGLE,{dirtyRect:{x:yt,y:Rt,width:jt,height:Xt}}));var he=i.searchDirtyObjects(P);he.sort(function(ce,xe){return ce.sortable.renderOrder-xe.sortable.renderOrder}).forEach(function(ce){ce&&ce.isVisible()&&!ce.isCulled()&&i.renderDisplayObject(ce,E,i.context,aa(i,Vn)[Vn],n)}),E.restore(),i.renderQueue.forEach(function(ce){i.saveDirtyAABB(ce)}),i.renderQueue=[]}aa(i,Vn)[Vn].restoreStack.forEach(function(){E.restore()}),aa(i,Vn)[Vn].restoreStack=[]}),l.hooks.render.tap(r.tag,function(E){i.clearFullScreen||i.renderQueue.push(E)})}},{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||!Sd(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||!Sd(e.getWorldTransform(),a.prevObject.getWorldTransform()),l&&this.applyWorldTransform(n,e);var v=!a.prevObject;if(!v){var g=a.prevObject.nodeName;o===Dt.TEXT?v=g!==Dt.TEXT:o===Dt.IMAGE?v=g!==Dt.IMAGE:v=g===Dt.TEXT||g===Dt.IMAGE}u.applyStyleToContext(n,e,v,a),a.prevObject=e}h&&(n.beginPath(),h(n,e.parsedStyle),o!==Dt.LINE&&o!==Dt.PATH&&o!==Dt.POLYLINE&&n.closePath()),u&&u.drawToContext(n,e,aa(this,Vn)[Vn],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!==Dt.LINE&&o!==Dt.PATH&&o!==Dt.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),me(c)||(e.lineDashOffset=c),me(o)||(e.globalAlpha*=o),!me(a)&&!Array.isArray(a)&&!a.isNone&&(e.strokeStyle=n.attributes.stroke),!me(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 pn;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,L.Z)(n,2),a=i[0],s=i[1],o=e.getMax(),l=(0,L.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 pn);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 pn,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}}])}();t1.tag="CanvasRenderer";function Mu(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.dirtify()});return g}function Au(r,t,e,n){var i;if(r.type===Da.LinearGradient||r.type===Da.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,B.Z)((0,B.Z)({type:r.type},r.value),{},{min:l,width:s,height:o}),e)}return i}var Tu=["shadowBlur","shadowOffsetX","shadowOffsetY"],e1=["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},n1={};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 Zk=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?n1:a.prevObject.parsedStyle,o=n.parsedStyle;(i||o.opacity!==s.opacity)&&Rn(e,"globalAlpha",me(o.opacity)?qn.globalAlpha:o.opacity,a.currentContext),(i||o.blend!==s.blend)&&Rn(e,"globalCompositeOperation",me(o.blend)?qn.globalCompositeOperation:o.blend,a.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(e,n,i,a){var s=i?n1: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=!me(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",me(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",me(o.lineDashOffset)?qn.lineDashOffset:o.lineDashOffset,a.currentContext);for(var f=0;f<e1.length;f++){var v=e1[f];(i||o[v]!==s[v])&&Rn(e,v,me(o[v])?qn[v]:o[v],a.currentContext)}}if(u&&(i||n.attributes.fill!==a.prevObject.attributes.fill)){var g=!me(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===Dt.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<Tu.length;o++){var l=Tu[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<Tu.length;o++){var l=Tu[o];Rn(e,l,qn[l],a.currentContext)}}if(i)if(n&&s){var c=e.filter;!me(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",Au(f,n,e,o.imagePool),i.currentContext);h=h!=null?h:v,u?e.fill(u):e.fill()});else{if(ys(c)){var d=Mu(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",Au(d,n,e,o.imagePool),i.currentContext);c=c!=null?c:f,e.stroke()});else{if(ys(l)){var u=Mu(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,E=c.stroke&&!c.stroke.isNone&&y>0;if(!(!b&&!E)){var O=!me(c.shadowColor)&&c.shadowBlur>0,P=c.shadowType==="inner",R=((o=c.fill)===null||o===void 0?void 0:o.alpha)===0,F=!!(c.filter&&c.filter.length),I=O&&E&&(l===Dt.PATH||l===Dt.LINE||l===Dt.POLYLINE||R||P),V=null;if(b){I||this.applyShadowAndFilterStyleToContext(e,n,O,i);var Y=h*f;V=Rn(e,"globalAlpha",Y,i.currentContext),this.fillToContext(e,n,i,a,s),I||this.clearShadowAndFilterStyleForContext(e,O,F,i)}if(E){var J=!1,$=h*g,ot=Rn(e,"globalAlpha",$,i.currentContext);if(V=b?V:ot,I&&(this.applyShadowAndFilterStyleToContext(e,n,O,i),J=!0,P)){var ct=e.globalCompositeOperation;e.globalCompositeOperation="source-atop",this.strokeToContext(e,n,i,a,s),e.globalCompositeOperation=ct,this.clearShadowAndFilterStyleForContext(e,O,F,i,!0)}this.strokeToContext(e,n,i,a,s),J&&this.clearShadowAndFilterStyleForContext(e,O,F,i)}V!==null&&Rn(e,"globalAlpha",V,i.currentContext)}}}])}(),lv=function(r){function t(){return(0,N.Z)(this,t),(0,_.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,E=b===void 0?1:b,O=i.lineCap,P=i.lineJoin,R=i.shadowType,F=i.shadowColor,I=i.shadowBlur,V=i.filter,Y=i.miterLimit,J=c&&!c.isNone,$=g&&!g.isNone&&E>0,ot=(c==null?void 0:c.alpha)===0,ct=!!(V&&V.length),ft=!me(F)&&I>0,Nt=a.nodeName,Ot=R==="inner",mt=$&&ft&&(Nt===Dt.PATH||Nt===Dt.LINE||Nt===Dt.POLYLINE||ot||Ot);J&&(n.globalAlpha=d*v,mt||Ou(a,n,ft),r1(n,a,c,u,s,o,l,this.imagePool),mt||this.clearShadowAndFilter(n,ct,ft)),$&&(n.globalAlpha=d*y,n.lineWidth=E,me(Y)||(n.miterLimit=Y),me(O)||(n.lineCap=O),me(P)||(n.lineJoin=P),mt&&(Ot&&(n.globalCompositeOperation="source-atop"),Ou(a,n,!0),Ot&&(cv(n,a,g,s,o,l,this.imagePool),n.globalCompositeOperation=qn.globalCompositeOperation,this.clearShadowAndFilter(n,ct,!0))),cv(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;!me(s)&&s.indexOf("drop-shadow")>-1&&(n.filter=s.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Zk);function Ou(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 r1(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=Au(c,t,r,o),l||(n?r.fill(n):r.fill())}):(ys(e)&&(r.fillStyle=Mu(e,t,r,i,a,s,o)),l||(n?r.fill(n):r.fill()))}function cv(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=Au(l,t,r,s),o||r.stroke()}):(ys(e)&&(r.strokeStyle=Mu(e,t,r,n,i,a,s)),o||r.stroke())}function Wk(r,t){var e=(0,L.Z)(r,4),n=e[0],i=e[1],a=e[2],s=e[3],o=(0,L.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 Gk(r,t){var e=re(pt(),[r[0],r[1],0],t),n=re(pt(),[r[0]+r[2],r[1],0],t),i=re(pt(),[r[0],r[1]+r[3],0],t),a=re(pt(),[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 Vk=function(r){function t(){return(0,N.Z)(this,t),(0,_.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.dirtify())}).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.dirtify())},a).catch(function(ft){console.error(ft)});return}for(var E=[h[0]/c[2],h[1]/c[3]],O=[l.tileSize[0]/E[0],l.tileSize[1]/E[1]],P=[Math.floor((u[0]-c[0])/O[0]),Math.ceil((u[0]+u[2]-c[0])/O[0])],R=P[0],F=P[1],I=[Math.floor((u[1]-c[1])/O[1]),Math.ceil((u[1]+u[3]-c[1])/O[1])],V=I[0],Y=I[1],J=V;J<=Y;J++)for(var $=R;$<=F;$++){var ot=l.tiles[J][$];if(ot){var ct=[Math.floor(c[0]+ot.tileX*O[0]),Math.floor(c[1]+ot.tileY*O[1]),Math.ceil(O[0]),Math.ceil(O[1])];n.drawImage(ot.data,ct[0],ct[1],ct[2],ct[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 E=!me(f)&&v>0;Ou(a,n,E);try{var O=a.ownerDocument.defaultView.getContextService().getDomElement(),P=O.width,R=O.height,F=n.getTransform(),I=F.a,V=F.b,Y=F.c,J=F.d,$=F.e,ot=F.f,ct=Ae(I,Y,0,0,V,J,0,0,0,0,1,0,$,ot,0,1),ft=Gk([o,c,y,b],ct),Nt=Wk([0,0,P,R],ft);if(!Nt)return;if(!a.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){t.renderFull(n,i,a,{image:p,drawRect:[o,c,y,b]});return}var Ot=ft[2]/g.size[0];if(Ot<(g.downSamplingRate||.5)){this.renderDownSampled(n,i,a,{src:d,imageCache:g,drawRect:[o,c,y,b]});return}if(!ov.isSupportTile){t.renderFull(n,i,a,{image:p,drawRect:[o,c,y,b]});return}this.renderTile(n,i,a,{src:d,imageCache:g,imageRect:ft,drawRect:Nt})}catch(mt){}}}},{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]))}}])}(lv),Uk=function(r){function t(){return(0,N.Z)(this,t),(0,_.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,E=i.letterSpacing,O=E===void 0?0:E,P=i.stroke,R=i.fill,F=i.fillRule,I=i.fillOpacity,V=I===void 0?1:I,Y=i.strokeOpacity,J=Y===void 0?1:Y,$=i.opacity,ot=$===void 0?1:$,ct=i.metrics,ft=i.x,Nt=ft===void 0?0:ft,Ot=i.y,mt=Ot===void 0?0:Ot,yt=i.dx,Rt=i.dy,jt=i.shadowColor,Xt=i.shadowBlur,ee=ct.font,ae=ct.lines,he=ct.height,ce=ct.lineHeight,xe=ct.lineMetrics;n.font=ee,n.lineWidth=u,n.textAlign=d==="middle"?"center":d;var Ce=v;Ce==="alphabetic"&&(Ce="bottom"),n.lineJoin=p,me(b)||(n.miterLimit=b);var je=mt;v==="middle"?je+=-he/2-ce/2:v==="bottom"||v==="alphabetic"||v==="ideographic"?je+=-he:(v==="top"||v==="hanging")&&(je+=-ce);var Ue=Nt+(yt||0);je+=Rt||0,ae.length===1&&(Ce==="bottom"?(Ce="middle",je-=.5*he):Ce==="top"&&(Ce="middle",je+=.5*he)),n.textBaseline=Ce;var or=!me(jt)&&Xt>0;Ou(a,n,or);for(var Ke=0;Ke<ae.length;Ke++){var hi=u/2+Ue;je+=ce,!me(P)&&!P.isNone&&u&&this.drawLetterSpacing(n,a,ae[Ke],xe[Ke],d,hi,je,O,R,F,V,P,J,ot,!0,s,o,l),me(R)||this.drawLetterSpacing(n,a,ae[Ke],xe[Ke],d,hi,je,O,R,F,V,P,J,ot,!1,s,o,l)}}},{key:"drawLetterSpacing",value:function(n,i,a,s,o,l,c,u,h,d,f,v,g,p,y,b,E,O){if(u===0){y?this.strokeText(n,i,a,l,c,v,g,b,E,O):this.fillText(n,i,a,l,c,h,d,f,p,b,E,O);return}var P=n.textAlign;n.textAlign="left";var R=l;o==="center"||o==="middle"?R=l-s.width/2:(o==="right"||o==="end")&&(R=l-s.width);for(var F=Array.from(a),I=n.measureText(a).width,V=0,Y=0;Y<F.length;++Y){var J=F[Y];y?this.strokeText(n,i,J,R,c,v,g,b,E,O):this.fillText(n,i,J,R,c,h,d,f,p,b,E,O),V=n.measureText(a.substring(Y+1)).width,R+=I-V+u,I=V}n.textAlign=P}},{key:"fillText",value:function(n,i,a,s,o,l,c,u,h,d,f,v){r1(n,i,l,c,d,f,v,this.imagePool,!0);var g,p=!me(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){cv(n,i,l,u,h,d,this.imagePool,!0);var f,v=!me(c)&&c!==1;v&&(f=n.globalAlpha,n.globalAlpha=c),n.strokeText(a,s,o),v&&(n.globalAlpha=f)}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i,i.ownerDocument.defaultView.context,s,o)}}])}(lv),Yk=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),e=(0,_.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,B.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),a=this.context.imagePool,s=new lv(a),o=(n={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.CIRCLE,s),Dt.ELLIPSE,s),Dt.RECT,s),Dt.IMAGE,new Vk(a)),Dt.TEXT,new Uk(a)),Dt.LINE,s),Dt.POLYLINE,s),Dt.POLYGON,s),Dt.PATH,s),Dt.GROUP,void 0),(0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.HTML,void 0),Dt.MESH,void 0),Dt.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new t1(i))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(_a);var i1=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(I){a.hooks.pointerMove.call(I)},u=function(I){a.hooks.pointerUp.call(I)},h=function(I){a.hooks.pointerDown.call(I)},d=function(I){a.hooks.pointerOver.call(I)},f=function(I){a.hooks.pointerOut.call(I)},v=function(I){a.hooks.pointerCancel.call(I)},g=function(I){a.hooks.pointerWheel.call(I)},p=function(I){a.hooks.click.call(I)},y=function(I){n.globalThis.document.addEventListener("pointermove",c,!0),I.addEventListener("pointerdown",h,!0),I.addEventListener("pointerleave",f,!0),I.addEventListener("pointerover",d,!0),n.globalThis.addEventListener("pointerup",u,!0),n.globalThis.addEventListener("pointercancel",v,!0)},b=function(I){I.addEventListener("touchstart",h,!0),I.addEventListener("touchend",u,!0),I.addEventListener("touchmove",c,!0),I.addEventListener("touchcancel",v,!0)},E=function(I){n.globalThis.document.addEventListener("mousemove",c,!0),I.addEventListener("mousedown",h,!0),I.addEventListener("mouseout",f,!0),I.addEventListener("mouseover",d,!0),n.globalThis.addEventListener("mouseup",u,!0)},O=function(I){n.globalThis.document.removeEventListener("pointermove",c,!0),I.removeEventListener("pointerdown",h,!0),I.removeEventListener("pointerleave",f,!0),I.removeEventListener("pointerover",d,!0),n.globalThis.removeEventListener("pointerup",u,!0),n.globalThis.removeEventListener("pointercancel",v,!0)},P=function(I){I.removeEventListener("touchstart",h,!0),I.removeEventListener("touchend",u,!0),I.removeEventListener("touchmove",c,!0),I.removeEventListener("touchcancel",v,!0)},R=function(I){n.globalThis.document.removeEventListener("mousemove",c,!0),I.removeEventListener("mousedown",h,!0),I.removeEventListener("mouseout",f,!0),I.removeEventListener("mouseover",d,!0),n.globalThis.removeEventListener("mouseup",u,!0)};a.hooks.init.tap(r.tag,function(){var F=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="none",F.style.msTouchAction="none"):l.supportsPointerEvents&&(F.style.touchAction="none"),l.supportsPointerEvents?y(F):E(F),l.supportsTouchEvents&&b(F),o.useNativeClickEvent&&F.addEventListener("click",p,!0),F.addEventListener("wheel",g,{passive:!0,capture:!0})}),a.hooks.destroy.tap(r.tag,function(){var F=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="",F.style.msTouchAction=""):l.supportsPointerEvents&&(F.style.touchAction=""),l.supportsPointerEvents?O(F):R(F),l.supportsTouchEvents&&P(F),o.useNativeClickEvent&&F.removeEventListener("click",p,!0),F.removeEventListener("wheel",g,!0)})}}])}();i1.tag="DOMInteraction";var Hk=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,_.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 i1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(_a);var Xk="g-canvas-camera",a1=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===Dt.HTML){i.$camera||(i.$camera=i.createCamera(a));var E=i.getOrCreateEl(b);i.$camera.appendChild(E),Object.keys(b.attributes).forEach(function(O){i.updateAttribute(O,b)}),u(b,E),c.set(E,b)}},d=function(y){var b=y.target;if(b.nodeName===Dt.HTML&&i.$camera){var E=i.getOrCreateEl(b);E&&(E.remove(),c.delete(E))}},f=function(y){var b=y.target;if(b.nodeName===Dt.HTML){var E=y.attrName;i.updateAttribute(E,b)}},v=function(y){var b=y.target,E=b.nodeName===Dt.FRAGMENT?b.childNodes:[b];E.forEach(function(O){if(O.nodeName===Dt.HTML){var P=i.getOrCreateEl(O);u(O,P)}})},g=function(){if(i.$camera){var y=i.context.config,b=y.width,E=y.height;i.$camera.parentElement.style.width="".concat(b||0,"px"),i.$camera.parentElement.style.height="".concat(E||0,"px")}};o.hooks.init.tap(r.tag,function(){l.addEventListener(ri.RESIZE,g),l.addEventListener(De.MOUNTED,h),l.addEventListener(De.UNMOUNTED,d),l.addEventListener(De.ATTR_MODIFIED,f),l.addEventListener(De.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(ri.RESIZE,g),l.removeEventListener(De.MOUNTED,h),l.removeEventListener(De.UNMOUNTED,d),l.removeEventListener(De.ATTR_MODIFIED,f),l.removeEventListener(De.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=Xk,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;Ge(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 E=n.style.filter;i.style.filter=E;break;default:!me(n.style[e])&&n.style[e]!==""&&(i.style[e]=n.style[e])}}}])}();a1.tag="HTMLRendering";var Kk=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,_.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 a1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(_a);var Qk=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=Ge(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,XM(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,La.Z)((0,Tr.Z)().mark(function n(){var i,a,s,o=arguments;return(0,Tr.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}()}])}(),qk=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,_.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=Qk}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(_a),Sl=function(r){function t(e){var n;return(0,N.Z)(this,t),n=(0,_.Z)(this,t,[e]),n.registerPlugin(new qk),n.registerPlugin(new jk),n.registerPlugin(new mk),n.registerPlugin(new Yk),n.registerPlugin(new Hk),n.registerPlugin(new Ik),n.registerPlugin(new Kk),n}return(0,C.Z)(t,r),(0,T.Z)(t)}(j2);function Jk(r,t){if(r){var e;if(Wr(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(zn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var s1=Jk,$k=Object.prototype.hasOwnProperty,Bs=function(r,t){if(r===null||!vo(r))return{};var e={};return s1(t,function(n){$k.call(r,n)&&(e[n]=r[n])}),e},t3=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(Object.assign(Object.assign({},t),{style:Object.assign({},Cu.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=t3(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(!me(i)&&!me(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}`}}Cu.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var o1=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 Nu extends Fi{constructor(t){super(ur({style:Nu.defaultStyleProps},t))}getKeyStyle(t){const[e,n]=this.getSize(t),i=super.getKeyStyle(t),{fillOpacity:a,opacity:s=a}=i,o=o1(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=o1(e,["fill","stroke"]),s=_n(this.getGraphicStyle(t),"halo"),o=Number(s.lineWidth),[l,c]=Ne(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*ba,height:i*ba},e):!1}drawKeyShape(t,e){const n=this.upsert("key",$f,this.getKeyStyle(t),e);return ev(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)&&nv(this)}}Nu.defaultStyleProps={size:32};class e3 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*ba,height:i*ba},e):!1}drawKeyShape(t,e){return this.upsert("key",pr,this.getKeyStyle(t),e)}}class n3 extends mu{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 V3(this.getOuterR(t),this.getInnerR(t))}getIconStyle(t){const e=super.getIconStyle(t),n=this.getInnerR(t)*2*ba;return e?Object.assign({width:n,height:n},e):!1}getPortXY(t,e){const{placement:n="top"}=e,i=this.getShape("key").getLocalBounds(),a=U3(this.getOuterR(t),this.getInnerR(t));return pv(i,n,a,!1)}}class ku extends mu{constructor(t){super(ur({style:ku.defaultStyleProps},t))}getPoints(t){const{direction:e}=t,[n,i]=this.getSize(t);return Y3(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=H3(s,o,n);return pv(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=_n(this.getGraphicStyle(t),"icon"),o=this.getShape("key").getLocalBounds(),[l,c]=RO(o,a),u=LO(o,a)*2*ba;return Object.assign({x:l,y:c,width:u,height:u},s)}}ku.defaultStyleProps={size:40,direction:"up"};var l1=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(ur({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]=ai(e);return Ne(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 pn,{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",Hy,n,e),ev(this)}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=_n(this.getGraphicStyle(t),"collapsedMarker"),{type:n}=e,i=l1(e,["type"]),a=this.getShape("key"),[s,o]=ya(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(MN)){const l=o.reduce((c,u)=>Ne(c,ir(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}}),nv(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=l1(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 r3 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&&_n(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 du(t,n,e)}}class i3 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&&_n(e,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}var a3=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},s3=a3,o3=function(r,t){return cl(r)?r.indexOf(t)>-1:!1},l3=o3,c3=function(r,t){return t===void 0&&(t=[]),s3(r,function(e){return!l3(t,e)})},u3=c3;const h3={padding:10};function c1(r,t,e,n,i,a){const{padding:s}=Object.assign(h3,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=TN(g,p);let b=null;if(d===0)if(v===f-1)if(o.intersects(l))b=hv(g,p,o,l);else if(!Kc(g,o)&&!Kc(p,l)){const E=Ns(g,o),O=Ns(p,l);b=h1(E,O,Br(E,O)),b.points.unshift(E),b.points.push(O)}else y||(b=f3(g,p,o,l));else Li(p,o)?b=hv(g,p,o,Fa(p,s),u):y||(b=Pu(g,p,o));else v===f-1?Li(g,l)?b=hv(g,p,Fa(g,s),l,u):y||(b=d1(g,p,l,u)):y||(b=h1(g,p,u));b?(h.push(...b.points),u=b.direction):u=Br(g,p),v<f-1&&h.push(p)}return h.map(Rs)}const d3={N:"S",S:"N",W:"E",E:"W"},u1={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function Br(r,t){const[e,n]=r,[i,a]=t;return e===i?n>a?"N":"S":n===a?e>i?"W":"E":null}function uv(r,t){return t==="N"||t==="S"?ea(r):ta(r)}function h1(r,t,e){const n=[r[0],t[1]],i=[t[0],r[1]],a=Br(r,n),s=Br(r,i),o=e?d3[e]:null,l=a===e||a!==o&&s!==e?n:i;return{points:[l],direction:Br(l,t)}}function Pu(r,t,e){if(Kc(r,e)){const n=Ml(r,t,e);return{points:[n],direction:Br(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:Br(a,t)}}}function d1(r,t,e,n){const i=Kc(t,e)?t:Ns(t,e),a=[[i[0],r[1]],[r[0],i[1]]],s=a.filter(l=>PO(l,e)&&!_m(l,e,!0)),o=s.filter(l=>Br(l,r)!==n);if(o.length>0){const l=o.find(c=>Br(r,c)===n)||o[0];return{points:[l],direction:Br(l,t)}}else{const l=u3(a,s)[0],c=Wa(t,l,uv(e,n)/2);return{points:[Ml(c,r,e),c],direction:Br(c,t)}}}function f3(r,t,e,n){let i=Pu(r,t,e);const a=pl(i.points[0]);if(Li(a,n)){i=Pu(t,r,n);const s=pl(i.points[0]);if(Li(s,e)){const o=Wa(r,a,uv(e,Br(r,a))/2),l=Wa(t,s,uv(n,Br(t,s))/2),c=[(o[0]+l[0])/2,(o[1]+l[1])/2],u=Pu(r,c,e),h=d1(c,t,n,u.direction);i.points=[u.points[0],h.points[0]],i.direction=h.direction}}return i}function hv(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(u1[i]),l[1]+u*Math.sin(u1[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(Wn(ml(h),ml(d))){const v=Uf(ln(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:Br(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 f1(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(Cy(c,u)||!e){const[y,b]=v1(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]=v1(r,l,n,i,d),p=[["translate",v,g],["rotate",d/Math.PI*180]];return{textAlign:h,transform:p}}function v3(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 f1(r.key,e,!0,(l?(l/2+o/2)*(t==="suffix"?1:-1):0)+n,i)}function v1(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 dv(r,t,e,n){if(Wn(r,t))return r;const i=ln(t,r),a=[r[0]+e*i[0],r[1]+e*i[1]],s=ma(hu(i,!1));return a[0]+=n*s[0],a[1]+=n*s[1],a}function g3(r){return ie(r)?[r,-r]:r}function p3(r){return ie(r)?[r,1-r]:r}function m3(r,t,e){return[["M",r[0],r[1]],["Q",e[0],e[1],t[0],t[1]]]}function g1(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 fv(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(!Ny(u,l,h)&&t){const[d,f]=y3(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 y3(r,t,e,n){const i=uu(r,t),a=uu(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 b3=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 p1(r,t,e,n,i){const a=Fa(r),s=r.getCenter();let o=n&&Ua(n),l=i&&Ua(i);if(!o||!l){const c=b3(a),u=c[t][0],h=c[t][1],[d,f]=Ba(a),v=Math.max(d,f),g=Ne(s,[v*Math.cos(u),v*Math.sin(u),0]),p=Ne(s,[v*Math.cos(h),v*Math.sin(h),0]);o=yv(r,g),l=yv(r,p),e||([o,l]=[l,o])}return[o,l]}function x3(r,t,e,n,i,a){const s=r.getPorts()[i||a],o=r.getPorts()[a||i];let[l,c]=p1(r,t,e,s,o);const u=E3(r,l,c,n);return s&&(l=Tl(s,u[0])),o&&(c=Tl(o,u.at(-1))),g1(l,c,u)}function E3(r,t,e,n){const i=r.getCenter();if(Wn(t,e)){const a=ln(t,i),s=[n*Math.sign(a[0])||n/2,n*Math.sign(a[1])||-n/2,0];return[Ne(t,s),Ne(e,Di(s,[1,-1,1]))]}return[Wa(i,t,bn(i,t)+n),Wa(i,e,bn(i,e)+n)]}function w3(r,t,e,n,i,a,s){const o=mv(r),l=o[a||s],c=o[s||a];let[u,h]=p1(r,e,n,l,c);const d=S3(r,u,h,i);return l&&(u=Tl(l,d[0])),c&&(h=Tl(c,d.at(-1))),fv([u,...d,h],t)}function S3(r,t,e,n){const i=[],a=Fa(r);if(Wn(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 vv(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 m1(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(Kr);return e[i]||e.at(-1)}return r}function M3(r,t){return t||(r<4?10:r===4?12:r*2.5)}const A3=(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"]]},y1=(r,t)=>[["M",-r/2,0],["L",r/2,-t/2],["L",r/2,t/2],["Z"]],T3=(r,t)=>[["M",-r/2,0],["L",0,-t/2],["L",r/2,0],["L",0,t/2],["Z"]],O3=(r,t)=>[["M",-r/2,0],["L",r/2,-t/2],["L",4*r/5-r/2,0],["L",r/2,t/2],["Z"]],C3=(r,t)=>[["M",-r/2,-t/2],["L",r/2,-t/2],["L",r/2,t/2],["L",-r/2,t/2],["Z"]],N3=(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"]]},k3=(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 Ru=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 Va extends Xy{constructor(t){super(ur({style:Va.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=Ru(e,["loop"]),{sourceNode:a,targetNode:s}=this,l={d:n&&j3(a,s)?this.getLoopPath(t):this.getKeyPath(t)};return ni.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}=_n(this.getGraphicStyle(t),"loop");return x3(i,o,l,c,e,n)}getEndpoints(t,e=!0,n=[]){const{sourcePort:i,targetPort:a}=t,{sourceNode:s,targetNode:o}=this,[l,c]=W3(s,o,i,a);if(!e){const f=l?Ua(l):s.getCenter(),v=c?Ua(c):o.getCenter();return[f,v]}const u=typeof n=="function"?n():n,h=T1(l||s,u[0]||c||o),d=T1(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=_n(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),n)}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=_n(this.getGraphicStyle(t),"label"),{placement:n,offsetX:i,offsetY:a,autoRotate:s,maxWidth:o}=e,l=Ru(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),c=f1(this.shapeMap.key,n,s,i,a),u=this.shapeMap.key.getLocalBounds(),h=jN([u.min,u.max],o);return Object.assign({wordWrapWidth:h},c,l)}getBadgeStyle(t){if(t.badge===!1||!t.badgeText)return!1;const e=_n(t,"badge"),{offsetX:n,offsetY:i,placement:a}=e,s=Ru(e,["offsetX","offsetY","placement"]);return Object.assign(s,v3(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:ni,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=_n(this.getGraphicStyle(t),i),{size:s,type:o}=a,l=Ru(a,["size","type"]),[c,u]=oi(M3(n.lineWidth,s)),d=(fe(o)?o:Z[o]||y1)(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",ia,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);this.upsert("halo",ni,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",ni,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))})}}Va.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 Va{constructor(t){super(ur({style:Fs.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t),{controlPoints:i,curvePosition:a,curveOffset:s}=t,o=this.getControlPoints(e,n,p3(a),g3(s),i);return g1(e,n,o)}getControlPoints(t,e,n,i,a){return(a==null?void 0:a.length)===2?a:[dv(t,e,n[0],i[0]),dv(t,e,n[1],i[1])]}}Fs.defaultStyleProps={curvePosition:.5,curveOffset:20};class Lu extends Fs{constructor(t){super(ur({style:Lu.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]]]}}Lu.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class _u extends Fs{constructor(t){super(ur({style:_u.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=ir(this.ref),n=this.sourceNode.getIntersectPoint(e,!0),i=this.targetNode.getIntersectPoint(e);return[n,i]}toRadialCoordinate(t){const e=ir(this.ref),n=bn(t,e),i=Sy(ln(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)]]}}_u.defaultStyleProps={curvePosition:.5,curveOffset:20};class Du extends Fs{constructor(t){super(ur({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 Iu extends Va{constructor(t){super(ur({style:Iu.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",n[0],n[1]]]}}Iu.defaultStyleProps={};const P3={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:uu},xa=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 R3(r,t){const e=Math.abs(r-t);return e>Math.PI?2*Math.PI-e:e}function b1(r,t){const e=t[0]-r[0],n=t[1]-r[1];return!e&&!n?0:Math.atan2(n,e)}function x1(r,t,e,n){const i=b1(r,t),a=e[xa(r)],o=b1(a||n,r);return R3(o,i)}const L3=(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 E1(r,t,e){return Math.min(...t.map(n=>e(r,n)))}function _3(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 w1=(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=_O(s);for(let g=0;g<v.length;g++){const p=Hf([r,f],v[g]);p&&_m(p,s)&&l.push(p)}}return l},[]);return Li(r,s)||o.push(r),o.map(l=>zs(l,n.gridSize))},D3=(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[xa(c)];for(;u;){const f=u,v=c;x1(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[xa(f)],c=f}const h=i.map(f=>[f[0]*s,f[1]*s]),d=_3(h,l,uu);return o.unshift(d),o};function I3(r,t,e,n){const i=Rs(r.getCenter()),a=Rs(t.getCenter()),s=Object.assign(P3,n),{gridSize:o}=s,l=s.enableObstacleAvoidance?e:[r,t],c=L3(l,s),u=zs(i,o),h=zs(a,o),d=w1(i,r,s.startDirections,s),f=w1(a,t,s.endDirections,s);d.forEach(I=>delete c[xa(I)]),f.forEach(I=>delete c[xa(I)]);const v={},g={},p={},y={},b={},E=new B3;for(let I=0;I<d.length;I++){const V=d[I],Y=xa(V);v[Y]=V,y[Y]=0,b[Y]=E1(V,f,s.distFunc),E.add({id:Y,value:b[Y]})}const O=f.map(I=>xa(I));let P=s.maximumLoops,R,F=1/0;for(const[I,V]of Object.entries(v))b[I]<=F&&(F=b[I],R=V);for(;Object.keys(v).length>0&&P>0;){const I=E.minId(!1);if(I)R=v[I];else break;const V=xa(R);if(O.includes(V))return D3(R,p,u,a,d,h,o);delete v[V],E.remove(V),g[V]=!0;for(const Y of Object.values(s.directionMap)){const J=Ne(R,[Y.stepX,Y.stepY]),$=xa(J);if(g[$])continue;const ot=x1(R,J,p,u);if(ot>s.maxAllowedDirectionChange||c[$])continue;v[$]||(v[$]=J);const ct=s.penalties[ot],ft=s.distFunc(R,J)+(isNaN(ct)?o:ct),Nt=y[V]+ft,Ot=y[$];Ot&&Nt>=Ot||(p[$]=R,y[$]=Nt,b[$]=Nt+E1(J,f,s.distFunc),E.add({id:$,value:b[$]}))}P-=1}return[]}class B3{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 Bu extends Va{constructor(t){super(ur({style:Bu.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=I3(n,i,l,e),o.length||(o=c1(a,s,n,i,t.controlPoints,{padding:e.offset}))}else e.type==="orth"&&(o=c1(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 fv(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}=_n(this.getGraphicStyle(t),"loop");return w3(a,i,l,c,u,e,n)}}Bu.defaultStyleProps={radius:0,controlPoints:[],router:!1};class Fu extends Va{constructor(t){super(ur({style:Fu.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:n}=t,[i,a]=this.getEndpoints(t),s=t.controlPoint||dv(i,a,e,n);return m3(i,a,s)}}Fu.defaultStyleProps={curvePosition:.5,curveOffset:30};var F3=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 S1(r){return r instanceof Va}function gv(r){return r instanceof yo}function z3(r){return Al(r)||S1(r)||gv(r)}function j3(r,t){return!r||!t?!1:r===t}const Z3={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 pv(r,t,e=Z3,n=!0){const i=[.5,.5],a=Ge(t)?br(e,t.toLocaleLowerCase(),i):t;if(!n&&Ge(t))return a;const[s,o]=a||i;return[r.min[0]+ta(r)*s,r.min[1]+ea(r)*o]}function mv(r){if(!r)return{};const t=r.getPorts();return(r.attributes.ports||[]).forEach((n,i)=>{var a;const{key:s,placement:o}=n;M1(n)&&(t[a=s||i]||(t[a]=ya(r.getShape("key").getBounds(),o)))}),t}function M1(r){const{r:t}=r;return!t||Number(t)===0}function Ua(r){return fo(r)?r:r.getPosition()}function W3(r,t,e,n){const i=A1(r,t,e,n),a=A1(t,r,n,e);return[i,a]}function A1(r,t,e,n){const i=mv(r);if(e)return i[e];const a=Object.values(i);if(a.length===0)return;const s=a.map(c=>Ua(c)),o=G3(t,n),[l]=NN(s,o);return a.find(c=>Ua(c)===l)}function G3(r,t){const e=mv(r);if(t)return[Ua(e[t])];const n=Object.values(e);return n.length>0?n.map(i=>Ua(i)):[r.getCenter()]}function T1(r,t){return gv(r)||Al(r)?yv(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 du(e,r.getBounds())}function yv(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 O1(r,t="bottom",e=0,n=0,i=!1){const a=t.split("-"),[s,o]=ya(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 V3(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 U3(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 Y3(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 H3(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 p7(r,t){return[[r/2,-t/2],[r/2,t/2],[-r/2,t/2],[-r/2,-t/2]]}function X3(r,t){return[[0,-t/2],[r/2,0],[0,t/2],[-r/2,0]]}function C1(r){return br(r,["style","visibility"])!=="hidden"}function K3(r,t){const{zIndex:e,transform:n,transformOrigin:i,visibility:a,cursor:s,clipPath:o,component:l}=t,c=F3(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 bv(r,t){"update"in r?r.update(t):r.attr(t)}function Q3(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 q3(r){bl(r,"__to_be_destroyed__",!0)}function Ol(r){return br(r,"__to_be_destroyed__",!1)}var J3=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 zu extends si{constructor(t,e){super(t,Object.assign({},zu.defaultOptions,e)),this.onCollapseExpand=n=>J3(this,void 0,void 0,function*(){if(!this.validate(n))return;const{target:i}=n;if(!z3(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;Kr(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()}}zu.defaultOptions={enable:!0,animation:!0,trigger:Bt.DBLCLICK,align:!0};var ju={},$3=function(r){return r=r||"g",ju[r]?ju[r]+=1:ju[r]=1,r+ju[r]},Zu=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 tP="g6-create-edge-assist-edge-id",Wu="g6-create-edge-assist-node-id";class Gu extends si{constructor(t,e){super(t,Object.assign({},Gu.defaultOptions,e)),this.drop=n=>Zu(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=>Zu(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:Wu,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:tP,source:this.source,target:Wu,style:Object.assign({pointerEvents:"none"},h)}]),yield(s=u.draw({animation:!1}))===null||s===void 0?void 0:s.finished}),this.updateAssistEdge=n=>Zu(this,void 0,void 0,function*(){var i;if(!this.source)return;const{model:a,element:s}=this.context;a.translateNodeTo(Wu,[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}-${$3()}`,f=c({id:d,source:this.source,target:h,style:o});f&&(s.addEdgeData([f]),l(f))},this.cancelEdge=()=>Zu(this,void 0,void 0,function*(){var n;if(!this.source)return;const{graph:i,element:a,batch:s}=this.context;i.removeNodeData([Wu]),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(xi.CLICK,this.handleCreateEdge),t.on(Cs.CLICK,this.handleCreateEdge),t.on(va.CLICK,this.cancelEdge),t.on(Hc.CLICK,this.cancelEdge)):(t.on(xi.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(xi.CLICK,this.handleCreateEdge),t.off(Cs.CLICK,this.handleCreateEdge),t.off(va.CLICK,this.cancelEdge),t.off(Hc.CLICK,this.cancelEdge),t.off(xi.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()}}Gu.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:r=>r,onFinish:()=>{}};function eP(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=eP,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 Vu extends si{constructor(t,e){super(t,Object.assign({},Vu.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||Gn.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(zn(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 N1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{sensitivity:n}=this.options,i=n*-1;yield this.translate(Di(t,i),this.options.animation),this.invokeOnFinish()})}translate(t,e){return N1(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();return My([t,e],n)}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]=ai(this.options.range),h=[s*o,a*l,s*c,a*u],d=za(Pf(n.getCanvasCenter()),h),f=ln(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()}}Vu.defaultOptions={enable:r=>"targetType"in r?r.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};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 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=>k1(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,dn);c&&At(c)===o&&a.refreshComboData(o),a.setParent(l,o,dn)}),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(va.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]=ln([+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}clampByRotation([t,e]){const n=this.context.graph.getRotation();return My([t,e],n)}moveElement(t,e){return k1(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,this.clampByRotation(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=_n(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 nP="*",rP=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[nP]||[],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}(),Uu=rP;function xv(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 Yu(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)&&Yu(a,t,e,n))return!0;return!1}const P1=()=>!0;class iP{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||P1,n=t.edgeFilter||P1;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];xv([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];Yu(this.getNode(t),new Set,e,i)}}class Un extends Uu{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 Yu(this.getNode(e),new Set,n,a)}bfsTree(e,n,i){const a=s=>this.getChildren(s,i);return xv([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 xv([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 Yu(this.getNode(e),new Set,n,a)}clone(){const e=this.getAllNodes().map(a=>H0(Bo({},a),{data:Bo({},a.data)})),n=this.getAllEdges().map(a=>H0(Bo({},a),{data:Bo({},a.data)})),i=new Un({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 iP(Bo({graph:this},e))}}class Hu{constructor(t,e){this.context=t,this.options=e||{}}}var aP=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())})},sP=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 m7(r){const{type:t}=r;return!!(["comboCombined","comboForce"].includes(t)||t==="antv-dagre"&&r.sortByCombo)}function oP(r){const{type:t}=r;return["compact-box","mindmap","dendrogram","indented"].includes(t)}function y7(r){return isNumber(r.x)&&isNumber(r.y)}function lP(r){return!Array.isArray(r)&&(r==null?void 0:r.preLayout)}function Xu(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 cP(r,t){class e extends Hu{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 Xu(l)}}}execute(i,a){return aP(this,void 0,void 0,function*(){return Xu(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(Xu(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=sP(f,["data","style","combo"]),E={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(E.data,{x:p.x}),p!=null&&p.y&&Object.assign(E.data,{y:p.y}),p!=null&&p.z&&Object.assign(E.data,{z:p.z}),E}),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 Un({nodes:[...l,...h],edges:u});return t.model.model.hasTreeStructure(dn)&&(d.attachTreeStructure(dn),l.forEach(f=>{const v=t.model.model.getParent(f.id,dn);v&&d.hasNode(v.id)&&d.setParent(f.id,v.id,dn)})),d}}return e}function Ev(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 R1(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 uP=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 hP 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):(Xr.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1):!1}moveElement(t,e){return uP(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&&Ev(n,"setFixedPosition",t[a],[...Ne([+s,+o],this.clampByRotation(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&&R1(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach(n=>{const{x:i=0,y:a=0}=n.style||{};e&&Ev(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&&R1(t,"simulation").alphaTarget(0),!this.options.fixed&&this.context.graph.getNodeData(this.target).forEach(e=>{t&&Ev(t,"setFixedPosition",At(e),[null,null,null])})}}var L1=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.isZoomEvent=n=>!!(n.data&&"scale"in n.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=n=>L1(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=ek(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=>L1(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()}}Ku.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 dP=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 Qu extends si{constructor(t,e){super(t,Object.assign({},Qu.defaultOptions,e)),this.focus=n=>dP(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()}}Qu.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=yy(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?Dy(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 fP extends yl{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e,graph:n}=this.context;this.pathShape=new ni({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[fu(t,n)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(fu(t,this.context.graph)),(e=this.pathShape)===null||e===void 0||e.setAttribute("d",QN(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 Ju extends si{constructor(t,e){super(t,Object.assign({},Ju.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()}}Ju.defaultOptions={enable:!0,debounce:200,shapes:r=>r==="node"};var _1=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.onWheel=n=>_1(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(),zn(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=Di(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]=ai(this.options.range),h=[s*o,a*l,s*c,a*u],d=za(Pf(n.getCanvasCenter()),h),f=ln(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 _1(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()}}$u.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var D1=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 th extends si{constructor(t,e){super(t,Object.assign({},th.defaultOptions,e)),this.zoom=(n,i,a)=>D1(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=()=>D1(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()}}th.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var eh=S(13722);const vP=(r,t)=>{if(r!=="next"&&r!=="prev")return t},I1=r=>{r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev};class gP{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 I1(e),e}enqueue(t){const e=this.shortcut;t.prev&&t.next&&I1(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,vP)),n=n==null?void 0:n.prev;return`[${t.join(", ")}]`}}class pP extends gP{}const mP=()=>1,yP=(r,t)=>{var e;if(r.getAllNodes().length<=1)return[];const n=xP(r,t||mP);return(e=bP(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()},bP=(r,t,e)=>{let n=[];const i=t[t.length-1],a=t[0];let s;for(;r.getAllNodes().length;){for(;s=a.dequeue();)wv(r,t,e,s);for(;s=i.dequeue();)wv(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(wv(r,t,e,s,!0));break}}}return n},wv=(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,Sv(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,Sv(t,e,Object.assign({v:h.id},h.data))}),r.removeNode(n.v)),i?o:void 0},xP=(r,t)=>{const e=new Un;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 pP);const o=n+1;return e.getAllNodes().forEach(l=>{Sv(a,o,Object.assign({v:l.id},e.getNode(l.id).data))}),{buckets:a,zeroIdx:o,graph:e}},Sv=(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)},EP=(r,t)=>{const n=t==="greedy"?yP(r,(i=>a=>a.data.weight||1)(r)):wP(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)})})},wP=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},SP=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})})}})},MP=(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},AP=r=>{const t=new Un;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},B1=r=>{const t=new Un;return r.getAllNodes().forEach(e=>{r.getChildren(e.id).length||t.addNode(Object.assign({},e))}),r.getAllEdges().forEach(e=>{t.addEdge(e)}),t},F1=(r,t)=>r==null?void 0:r.reduce((e,n,i)=>(e[n]=t[i],e),{}),b7=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},x7=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 F1(t.map(n=>n.id),e)},z1=(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=Z1(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)=>MP(r.getNode(i).data.order,r.getNode(a).data.order));return t},TP=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)})},OP=(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)}))}},j1=(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)},Z1=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},CP=(r,t)=>{const e={lhs:[],rhs:[]};return r==null||r.forEach(n=>{t(n)?e.lhs.push(n):e.rhs.push(n)}),e},Mv=(r,t)=>r.reduce((e,n)=>{const i=t(e),a=t(n);return i>a?n:e}),W1=(r,t,e,n,i,a)=>{n.includes(t.id)||(n.push(t.id),e||a.push(t.id),i(t.id).forEach(s=>W1(r,s,e,n,i,a)),e&&a.push(t.id))},G1=(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))W1(r,l,e==="post",o,a,s);else throw new Error(`Graph does not have node: ${l}`)}),s},NP=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)V1(r,"borderLeft","_bl",e,i,a),V1(r,"borderRight","_br",e,i,a)}};r.getRoots().forEach(e=>t(e.id))},V1=(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}})},kP=(r,t)=>{const e=t.toLowerCase();(e==="lr"||e==="rl")&&U1(r)},PP=(r,t)=>{const e=t.toLowerCase();(e==="bt"||e==="rl")&&RP(r),(e==="lr"||e==="rl")&&(LP(r),U1(r))},U1=r=>{r.getAllNodes().forEach(t=>{Y1(t)}),r.getAllEdges().forEach(t=>{Y1(t)})},Y1=r=>{const t=r.data.width;r.data.width=r.data.height,r.data.height=t},RP=r=>{r.getAllNodes().forEach(t=>{Av(t.data)}),r.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(n=>Av(n)),t.data.hasOwnProperty("y")&&Av(t.data)})},Av=r=>{r!=null&&r.y&&(r.y=-r.y)},LP=r=>{r.getAllNodes().forEach(t=>{Tv(t.data)}),r.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(n=>Tv(n)),t.data.hasOwnProperty("x")&&Tv(t.data)})},Tv=r=>{const t=r.x;r.x=r.y,r.y=t},_P=r=>{const t=bo(r,"root",{},"_root"),e=DP(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=IP(r)+1;return r.getRoots().forEach(o=>{H1(r,t,a,s,i,e,o.id)}),{nestingRoot:t,nodeRankFactor:a}},H1=(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=j1(r,"_bt"),c=j1(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=>{H1(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]}})},DP=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},IP=r=>{let t=0;return r.getAllEdges().forEach(e=>{t+=e.data.weight}),t},BP=(r,t)=>{t&&r.removeNode(t),r.getAllEdges().forEach(e=>{e.data.nestingEdge&&r.removeEdge(e.id)})},FP="edge",X1="edge-label",zP=(r,t)=>{r.getAllEdges().forEach(e=>jP(r,e,t))},jP=(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,FP,c,"_d"),i===o&&(c.width=t.data.width,c.height=t.data.height,c.dummy=X1,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}})},ZP=(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===X1&&(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)})},WP=(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}})},GP=(r,t,e)=>{const n=VP(r),i=new Un({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},VP=r=>{let t;for(;r.hasNode(t=`_root${Math.random()}`););return t},UP=(r,t,e)=>{const n=F1(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},K1=(r,t)=>{let e=0;for(let n=1;n<(t==null?void 0:t.length);n+=1)e+=UP(r,t[n-1],t[n]);return e},Q1=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},YP=(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}}),HP=(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 XP(s)},XP=r=>{var t,e;const n=[],i=l=>c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&KP(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})},KP=(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 QP=HP;const qP=(r,t,e,n)=>{const i=CP(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(JP(!!t,!!e)),u=q1(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=q1(o,s,u)});const h={vs:o.flat()};return c&&(h.barycenter=l/c,h.weight=c),h},q1=(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},JP=(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},J1=(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=YP(r,u||[]);g==null||g.forEach(b=>{var E;if(!((E=r.getChildren(b.v))===null||E===void 0)&&E.length){const O=J1(r,b.v,e,n,a);v[b.v]=O,O.hasOwnProperty("barycenter")&&tR(b,O)}});const p=QP(g,e);$P(p,v),(s=p.filter(b=>b.vs.length>0))===null||s===void 0||s.forEach(b=>{const E=r.getNode(b.vs[0]);E&&(b.fixorder=E.data.fixorder,b.order=E.data.order)});const y=qP(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)||""),E=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+E.data.order)/(y.weight+2),y.weight+=2}return y},$P=(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()})},tR=(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)},eR=(r,t)=>{const e=Z1(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=$1(r,n,"in"),s=$1(r,i,"out");let o=Q1(r);Ov(r,o);let l=Number.POSITIVE_INFINITY,c;for(let u=0,h=0;h<4;++u,++h){tb(u%2?a:s,u%4>=2,!1,t),o=kl(r);const d=K1(r,o);d<l&&(h=0,c=ho(o),l=d)}o=Q1(r),Ov(r,o);for(let u=0,h=0;h<4;++u,++h){tb(u%2?a:s,u%4>=2,!0,t),o=kl(r);const d=K1(r,o);d<l&&(h=0,c=ho(o),l=d)}Ov(r,c)},$1=(r,t,e)=>t.map(n=>GP(r,n,e)),tb=(r,t,e,n)=>{const i=new Un;r==null||r.forEach(a=>{var s;const o=a.getRoots()[0].id,l=J1(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)}WP(a,i,l.vs)})},Ov=(r,t)=>{t==null||t.forEach(e=>{e==null||e.forEach((n,i)=>{r.getNode(n).data.order=i})})},nR=(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))})},rR=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},iR=(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())}},aR=(r,t)=>{const e=rR(r);t.forEach(n=>{var i,a;let s=n,o=r.getNode(s);const l=o.data.originalEdge;if(!l)return;const c=iR(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}})},eb=(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=sR(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 E=r.getNode(y.id),O=E.data.order;(O<s||v<O)&&!(E.data.dummy&&(!((b=r.getNode(g))===null||b===void 0)&&b.data.dummy))&&rb(e,y.id,g)})}),o=h+1,s=v)}),a};return t!=null&&t.length&&t.reduce(n),e},nb=(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)&&rb(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},sR=(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)},rb=(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},oR=(r,t,e)=>{let n=t,i=e;if(n>i){const a=t;n=i,i=a}return!!r[n]},ib=(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]&&!oR(e,c,v)&&(a[v]=c,a[c]=i[c]=i[v],l=s[v])}}})}),{root:i,align:a}},ab=(r,t,e,n,i,a,s)=>{var o;const l={},c=lR(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},lR=(r,t,e,n,i,a)=>{const s=new Un,o=cR(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},sb=(r,t)=>Mv(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=uR(r,s)/2;i=Math.max(o+l,i),a=Math.min(o-l,a)}),i-a});function ob(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 lb=(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},E7=(r,t)=>{const{align:e,nodesep:n=0,edgesep:i=0}=t||{},a=buildLayerMatrix(r),s=Object.assign(eb(r,a),nb(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=ib(r,l,s,d),v=ab(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=sb(r,o);return ob(o,c),lb(o,e)},cR=(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},uR=(r,t)=>r.getNode(t).data.width||0,hR=(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})},dR=(r,t)=>{const{align:e,nodesep:n=0,edgesep:i=0}=t||{},a=kl(r),s=Object.assign(eb(r,a),nb(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=ib(r,l,s,d),v=ab(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=sb(r,o);return c&&ob(o,c),lb(o,e)},fR=(r,t)=>{var e;const n=B1(r);hR(n,t);const i=dR(n,t);(e=Object.keys(i))===null||e===void 0||e.forEach(a=>{n.getNode(a).data.x=i[a]})},cb=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))},vR=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))})},Ya=(r,t)=>r.getNode(t.target).data.rank-r.getNode(t.source).data.rank-t.data.minlen,gR=r=>{const t=new Un({tree:[]}),e=r.getAllNodes()[0],n=r.getAllNodes().length;t.addNode(e);let i,a;for(;pR(t,r)<n;)i=ub(t,r),a=t.hasNode(i.source)?Ya(r,i):-Ya(r,i),hb(t,r,a);return t},pR=(r,t)=>{const e=n=>{t.getRelatedEdges(n,"both").forEach(i=>{const a=i.source,s=n===a?i.target:a;!r.hasNode(s)&&!Ya(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},mR=r=>{const t=new Un({tree:[]}),e=r.getAllNodes()[0],n=r.getAllNodes().length;t.addNode(e);let i,a;for(;yR(t,r)<n;)i=ub(t,r),a=t.hasNode(i.source)?Ya(r,i):-Ya(r,i),hb(t,r,a);return t},yR=(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||!Ya(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},ub=(r,t)=>Mv(t.getAllEdges(),e=>r.hasNode(e.source)!==r.hasNode(e.target)?Ya(t,e):1/0),hb=(r,t,e)=>{r.getAllNodes().forEach(n=>{const i=t.getNode(n.id);i.data.rank||(i.data.rank=0),i.data.rank+=e})},bR=r=>{const t=AP(r);cb(t);const e=gR(t);fb(e),db(e,t);let n,i;for(;n=wR(e);)i=SR(e,t,n),MR(e,t,n,i)},db=(r,t)=>{let e=G1(r,r.getAllNodes(),"post",!1);e=e.slice(0,(e==null?void 0:e.length)-1),e.forEach(n=>{xR(r,t,n)})},xR=(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=ER(r,t,e)},ER=(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,TR(r,e,u)){const f=r.getRelatedEdges(e,"both").find(v=>v.source===u||v.target===u).data.cutvalue;o+=h?-f:f}}}),o},fb=(r,t=r.getAllNodes()[0].id)=>{vb(r,{},1,t)},vb=(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=vb(r,t,o,c.id,n))}),l.data.low=s,l.data.lim=o++,i?l.data.parent=i:delete l.data.parent,o},wR=r=>r.getAllEdges().find(t=>t.data.cutvalue<0),SR=(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===gb(r.getNode(u.source),o)&&l!==gb(r.getNode(u.target),o));return Mv(c,u=>Ya(t,u))},MR=(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:{}}),fb(r),db(r,t),AR(r,t)},AR=(r,t)=>{const e=r.getAllNodes().find(i=>!i.data.parent);let n=G1(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))})},TR=(r,t,e)=>r.getRelatedEdges(t,"both").find(n=>n.source===e||n.target===e),gb=(r,t)=>t.data.low<=r.data.lim&&r.data.lim<=t.data.lim,OR=(r,t)=>{switch(t){case"network-simplex":NR(r);break;case"tight-tree":pb(r);break;case"longest-path":CR(r);break;default:pb(r)}},CR=cb,pb=r=>{vR(r),mR(r)},NR=r=>{bR(r)},kR=(r,t)=>{const{edgeLabelSpace:e,keepNodeOrder:n,prevGraph:i,rankdir:a,ranksep:s}=t;!n&&i&&RR(r,i);const o=FR(r);e&&(t.ranksep=zR(o,{rankdir:a,ranksep:s}));let l;try{l=PR(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 LR(r,o),l},PR=(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;XR(r),EP(r,e);const{nestingRoot:h,nodeRankFactor:d}=_P(r);OR(B1(r),n),jR(r),OP(r,d),BP(r,h),TP(r),ZR(r),WR(r);const f=[];zP(r,f),aR(r,f),NP(r),s&&nR(r,a),eR(r,s),KR(r),kP(r,i),fR(r,{align:o,nodesep:l,edgesep:c,ranksep:u}),QR(r),HR(r),ZP(r,f),UR(r),PP(r,i);const{width:v,height:g}=GR(r);return VR(r),YR(r),SP(r),{width:v,height:g}},RR=(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})},LR=(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)})},_R=["width","height","layer","fixorder"],DR={width:0,height:0},IR=["minlen","weight","width","height","labeloffset"],BR={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Cv=["labelpos"],FR=r=>{const t=new Un({tree:[]});return r.getAllNodes().forEach(e=>{const n=yb(r.getNode(e.id).data),i=Object.assign(Object.assign({},DR),n),a=mb(i,_R);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);me(s)||(t.hasNode(s.id)||t.addNode(Object.assign({},s)),t.setParent(e.id,s.id))}),r.getAllEdges().forEach(e=>{const n=yb(r.getEdge(e.id).data),i={};Cv==null||Cv.forEach(a=>{n[a]!==void 0&&(i[a]=n[a])}),t.addEdge({id:e.id,source:e.source,target:e.target,data:Object.assign({},BR,mb(n,IR),i)})}),t},zR=(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},jR=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")}})},ZR=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},WR=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))})},GR=(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}},VR=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(z1(e.data,i)),t.data.points.push(z1(n.data,a))})},UR=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}})},YR=r=>{r.getAllEdges().forEach(t=>{var e;t.data.reversed&&((e=t.data.points)===null||e===void 0||e.reverse())})},HR=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)})},XR=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)}})},KR=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})})},QR=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}})},mb=(r,t)=>{const e={};return t==null||t.forEach(n=>{r[n]!==void 0&&(e[n]=+r[n])}),e},yb=(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 Nv(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:zn(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:zn(t)&&t.width&&t.height?()=>e?Math.max(t.width,t.height)||r:[t.width,t.height]:()=>r}const kv=(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:zn(u)?[u.width,u.height]:u}return e},s=>{const o=n(s),l=i(s);return Math.max(...Pl(o))+l}},Pv=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=>Pv(e))}if(typeof r=="object"){const t={};return Object.keys(r).forEach(e=>{t[e]=Pv(r[e])}),t}return r},ci=(r,t)=>{const e=Pv(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},qR={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class JR{constructor(t={}){this.options=t,this.id="antv-dagre",this.options=Object.assign(Object.assign({},qR),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:E}=i,O=new Un({tree:[]}),P=js(l||50,u),R=js(c||50,h);let F=R,I=P;(o==="LR"||o==="RL")&&(F=P,I=R);const V=Nv(10,a,!1),Y=e.getAllNodes(),J=e.getAllEdges();Y.forEach(mt=>{const yt=Pl(V(mt)),Rt=I(mt),jt=F(mt),Xt=yt[0]+2*jt,ee=yt[1]+2*Rt,ae=mt.data.layer;ie(ae)?O.addNode({id:mt.id,data:{width:Xt,height:ee,layer:ae}}):O.addNode({id:mt.id,data:{width:Xt,height:ee}})}),b&&(O.attachTreeStructure("combo"),Y.forEach(mt=>{const{parentId:yt}=mt.data;yt!==void 0&&O.hasNode(yt)&&O.setParent(mt.id,yt,"combo")})),J.forEach(mt=>{O.addEdge({id:mt.id,source:mt.source,target:mt.target,data:{weight:mt.data.weight||1}})});let $;E!=null&&E.length&&($=new Un({nodes:E})),kR(O,{prevGraph:$,edgeLabelSpace:d,keepNodeOrder:!!v,nodeOrder:v||[],acyclicer:"greedy",ranker:f,rankdir:o,nodesep:c,align:s});const ot=[0,0];if(g){let mt=1/0,yt=1/0;O.getAllNodes().forEach(Rt=>{mt>Rt.data.x&&(mt=Rt.data.x),yt>Rt.data.y&&(yt=Rt.data.y)}),O.getAllEdges().forEach(Rt=>{var jt;(jt=Rt.data.points)===null||jt===void 0||jt.forEach(Xt=>{mt>Xt.x&&(mt=Xt.x),yt>Xt.y&&(yt=Xt.y)})}),ot[0]=g[0]-mt,ot[1]=g[1]-yt}const ct=o==="LR"||o==="RL";if(!y){const mt=new Set,Rt=o==="BT"||o==="RL"?(ae,he)=>he-ae:(ae,he)=>ae-he;O.getAllNodes().forEach(ae=>{ae.data.x=ae.data.x+ot[0],ae.data.y=ae.data.y+ot[1],mt.add(ct?ae.data.x:ae.data.y)});const jt=Array.from(mt).sort(Rt),Xt=ct?(ae,he)=>ae.x!==he.x:(ae,he)=>ae.y!==he.y,ee=ct?(ae,he,ce)=>{const xe=Math.max(he.y,ce.y),Ce=Math.min(he.y,ce.y);return ae.filter(je=>je.y<=xe&&je.y>=Ce)}:(ae,he,ce)=>{const xe=Math.max(he.x,ce.x),Ce=Math.min(he.x,ce.x);return ae.filter(je=>je.x<=xe&&je.x>=Ce)};O.getAllEdges().forEach((ae,he)=>{var ce;d&&p&&ae.data.type!=="loop"&&(ae.data.controlPoints=$R((ce=ae.data.points)===null||ce===void 0?void 0:ce.map(({x:xe,y:Ce})=>({x:xe+ot[0],y:Ce+ot[1]})),O.getNode(ae.source),O.getNode(ae.target),jt,ct,Xt,ee))})}let ft=[];ft=O.getAllNodes().map(mt=>ci(mt));const Nt=O.getAllEdges();return t&&(ft.forEach(mt=>{e.mergeNodeData(mt.id,{x:mt.data.x,y:mt.data.y})}),Nt.forEach(mt=>{e.mergeEdgeData(mt.id,{controlPoints:mt.data.controlPoints})})),{nodes:ft,edges:Nt}})}}const $R=(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}},tL={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class eL{constructor(t={}){this.options=t,this.id="circular",this.options=Object.assign(Object.assign({},tL),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,E,O]=rL(a,s,o),P=p==null?void 0:p.length;if(!P||P===1)return Zs(e,t,O);const R=(u-c)/P;let{radius:F,startRadius:I,endRadius:V}=i;if(v){const ct=js(10,v),ft=Nv(10,g);let Nt=-1/0;p.forEach(mt=>{const yt=ft(mt);Nt<yt&&(Nt=yt)});let Ot=0;p.forEach((mt,yt)=>{yt===0?Ot+=Nt||10:Ot+=(ct(mt)||0)+(Nt||10)}),F=Ot/(2*Math.PI)}else!F&&!I&&!V?F=Math.min(E,b)/2:!I&&V?I=V:I&&!V&&(V=I);const Y=R*h;let J=[];d==="topology"?J=bb(e,p):d==="topology-directed"?J=bb(e,p,!0):d==="degree"?J=nL(e,p):J=p.map(ct=>ci(ct));const $=Math.ceil(P/l);for(let ct=0;ct<P;++ct){let ft=F;!ft&&I!==null&&V!==null&&(ft=I+ct*(V-I)/(P-1)),ft||(ft=10+ct*100/(P-1));let Nt=c+ct%$*Y+2*Math.PI/l*Math.floor(ct/$);f||(Nt=u-ct%$*Y-2*Math.PI/l*Math.floor(ct/$)),J[ct].data.x=O[0]+Math.cos(Nt)*ft,J[ct].data.y=O[1]+Math.sin(Nt)*ft}return t&&J.forEach(ct=>{e.mergeNodeData(ct.id,{x:ct.data.x,y:ct.data.y})}),{nodes:J,edges:y}})}}const bb=(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 nL(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 rL=(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]},Ea=Array.isArray,iL={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Rv{constructor(t={}){this.options=t,this.id="concentric",this.options=Object.assign(Object.assign({},iL),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(),E=!s&&typeof window!="undefined"?window.innerWidth:s,O=!o&&typeof window!="undefined"?window.innerHeight:o,P=a||[E/2,O/2];if(!(y!=null&&y.length)||y.length===1)return Zs(e,t,P);const R=[];let F,I=0;Ea(g)?F=Math.max(g[0],g[1]):fe(g)?(F=-1/0,y.forEach(mt=>{const yt=Math.max(...Pl(g(mt)));yt>F&&(F=yt)})):F=g,Ea(p)?I=Math.max(p[0],p[1]):ie(p)&&(I=p),y.forEach(mt=>{const yt=ci(mt);R.push(yt);let Rt=F;const{data:jt}=yt;Ea(jt.size)?Rt=Math.max(jt.size[0],jt.size[1]):ie(jt.size)?Rt=jt.size:zn(jt.size)&&(Rt=Math.max(jt.size.width,jt.size.height)),F=Math.max(F,Rt),fe(p)&&(I=Math.max(p(mt),I))});const V={};R.forEach((mt,yt)=>{V[mt.id]=yt});let Y=l;(!Ge(Y)||R[0].data[Y]===void 0)&&(Y="degree"),Y==="degree"?R.sort((mt,yt)=>e.getDegree(yt.id,"both")-e.getDegree(mt.id,"both")):R.sort((mt,yt)=>yt.data[Y]-mt.data[Y]);const J=R[0],$=(c||(Y==="degree"?e.getDegree(J.id,"both"):J.data[Y]))/4,ot=[{nodes:[]}];let ct=ot[0];R.forEach(mt=>{if(ct.nodes.length>0){const yt=Math.abs(Y==="degree"?e.getDegree(ct.nodes[0].id,"both")-e.getDegree(mt.id,"both"):ct.nodes[0].data[Y]-mt.data[Y]);$&&yt>=$&&(ct={nodes:[]},ot.push(ct))}ct.nodes.push(mt)});let ft=F+I;if(!f){const mt=ot.length>0&&ot[0].nodes.length>1,Rt=(Math.min(E,O)/2-ft)/(ot.length+(mt?1:0));ft=Math.min(ft,Rt)}let Nt=0;if(ot.forEach(mt=>{const yt=u===void 0?2*Math.PI-2*Math.PI/mt.nodes.length:u;if(mt.dTheta=yt/Math.max(1,mt.nodes.length-1),mt.nodes.length>1&&f){const Rt=Math.cos(mt.dTheta)-Math.cos(0),jt=Math.sin(mt.dTheta)-Math.sin(0),Xt=Math.sqrt(ft*ft/(Rt*Rt+jt*jt));Nt=Math.max(Xt,Nt)}mt.r=Nt,Nt+=ft}),d){let mt=0,yt=0;for(let Rt=0;Rt<ot.length;Rt++){const Xt=(ot[Rt].r||0)-yt;mt=Math.max(mt,Xt)}yt=0,ot.forEach((Rt,jt)=>{jt===0&&(yt=Rt.r||0),Rt.r=yt,yt+=mt})}return ot.forEach(mt=>{const yt=mt.dTheta||0,Rt=mt.r||0;mt.nodes.forEach((jt,Xt)=>{const ee=v+(h?1:-1)*yt*Xt;jt.data.x=P[0]+Rt*Math.cos(ee),jt.data.y=P[1]+Rt*Math.sin(ee)})}),t&&R.forEach(mt=>e.mergeNodeData(mt.id,{x:mt.data.x,y:mt.data.y})),{nodes:R,edges:b}})}}var Lv=S(14301),aL=S(7695);const sL=.81,_v=.1;function oL(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,Lv.Z)(o,u=>u.x,u=>u.y):(0,aL.Z)(o,u=>u.x,u=>u.y,u=>u.z)).visitAfter(lL),c=new Map;return o.forEach(u=>{c.set(u.id,u),uL(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 lL(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 cL=(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||_v,u=a.y-r.y||_v,h=a.z-r.z||_v,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*sL<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 uL(r,t,e){t.visit((n,i,a,s,o)=>cL(n,i,a,s,o,r,e))}const hL={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 xb{constructor(t={}){this.options=t,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},hL),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((I,V)=>Object.assign(Object.assign({},I),{data:Object.assign(Object.assign({},I.data),{x:ie(I.data.x)?I.data.x:Math.random()*c,y:ie(I.data.y)?I.data.y:Math.random()*u,z:ie(I.data.z)?I.data.z:Math.random()*Math.sqrt(c*u),size:h(I)||30,mass:d(I),nodeStrength:f(I)})})),y=s.map(I=>Object.assign(Object.assign({},I),{data:Object.assign(Object.assign({},I.data),{edgeStrength:v(I),linkDistance:g(I,e.getNode(I.source),e.getNode(I.target))})}));if(!(a!=null&&a.length))return this.lastResult={nodes:[],edges:s},{nodes:[],edges:s};const b={};a.forEach((I,V)=>{b[I.id]={x:0,y:0,z:0}});const E=new Un({nodes:p,edges:y});this.formatCentripetal(o,E);const{maxIteration:O,minMovement:P,onTick:R}=o;if(this.lastLayoutNodes=p,this.lastLayoutEdges=y,this.lastAssign=t,this.lastGraph=e,this.lastCalcGraph=E,this.lastOptions=o,this.lastVelMap=b,typeof window=="undefined")return;let F=0;return new Promise(I=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&I({nodes:Dv(e,p),edges:s}),this.runOneStep(E,e,F,b,o),this.updatePosition(e,E,b,o),t&&p.forEach(V=>e.mergeNodeData(V.id,{x:V.data.x,y:V.data.y,z:l===3?V.data.z:void 0})),R==null||R({nodes:Dv(e,p),edges:s}),F++,(F>=O||this.judgingDistance<P)&&(window.clearInterval(this.timeInterval),I({nodes:Dv(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=kv(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=Eb(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:E}=d[y.id]||{};return(E==null?void 0:E.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 E;if(b===1){const{sameTypeLeaves:O=[]}=d[y.id]||{};O.length===1?E=void 0:O.length>1&&(E=wb(O))}else E=void 0;return{x:E==null?void 0:E.x,y:E==null?void 0:E.y,z:E==null?void 0:E.z}}})),l&&c){d||(d=Eb(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 E=u.filter(O=>O.data[c]===b).map(O=>e.getNode(O.id));y[b]=wb(E)}),t.centripetalOptions=Object.assign(h,{single:b=>t.clusterNodeStrength(b),leaf:b=>t.clusterNodeStrength(b),others:b=>t.clusterNodeStrength(b),center:b=>{const E=y[b.data[c]];return{x:E==null?void 0:E.x,y:E==null?void 0:E.y,z:E==null?void 0:E.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;oL(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:E=200,edgeStrength:O=200}=s.data||{},R=(E-g)*O,F=u.data.mass||1,I=h.data.mass||1,V=1/F,Y=1/I,J=p*R,$=y*R,ot=b*R;e[l].x-=J*V,e[l].y-=$*V,e[l].z-=ot*V,e[c].x+=J*Y,e[c].y+=$*Y,e[c].z+=ot*Y})}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:E,z:O}=p,P=e.getNode(g);let R=0,F=0,I=0,V=d;const Y=t.getDegree(g,"in"),J=t.getDegree(g,"out"),$=t.getDegree(g,"both"),ot=a==null?void 0:a(P,$);if(ot){const[ct,ft,Nt]=ot;R=b-ct,F=E-ft,V=Nt}else R=b-h[0],F=E-h[1],I=O-h[2];if(V&&(n[g].x-=V*R/y,n[g].y-=V*F/y,n[g].z-=V*I/y),f){const{leaf:ct,single:ft,others:Nt,center:Ot}=f,{x:mt,y:yt,z:Rt,centerStrength:jt}=(Ot==null?void 0:Ot(P,o,l,c,u))||{x:0,y:0,z:0,centerStrength:0};if(!ie(mt)||!ie(yt))return;const Xt=(b-mt)/y,ee=(E-yt)/y,ae=(O-Rt)/y;if(jt&&(n[g].x-=jt*Xt,n[g].y-=jt*ee,n[g].z-=jt*ae),$===0){const ce=ft(P);if(!ce)return;n[g].x-=ce*Xt,n[g].y-=ce*ee,n[g].z-=ce*ae;return}if(Y===0||J===0){const ce=ct(P,o,l);if(!ce)return;n[g].x-=ce*Xt,n[g].y-=ce*ee,n[g].z-=ce*ae;return}const he=Nt(P);if(!he)return;n[g].x-=he*Xt,n[g].y-=he*ee,n[g].z-=he*ae}})}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 Eb=(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]=dL(r,"leaf",i,t))}),n},dL=(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=fL(r,t,n,e,o);return{coreNode:s,siblingLeaves:o,sameTypeLeaves:l}},fL=(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},wb=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}},Dv=(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(88618);const w7=We.XA,S7=We.a_,M7=We.yQ,A7=We.Hs,T7=We.Ec,O7=We.dx,C7=We.LU,N7=We.Rm,Ha=We.y3,k7=We.qK,P7=We.pb,R7=We.j,L7=We.sO,_7=We.BZ,D7=We.EK,I7=We.Db,B7=We.Fx,F7=We.tU,z7=We.Ym,j7=We.rs,Z7=We.QR,W7=We.TB,G7=We.oH,Sb=We.Sc,V7=We.BN,U7=We.it,Y7=We.$r,H7=We.QM,X7=We.AV;var K7=(We.y3,We.y3);const Q7=We.GH,q7=We.SO,J7=We.uZ,$7=We.yU,tj=We.F1,ej=We.re,Mb=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},Ab=(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},vL=(r,t)=>{const e=[];return r.forEach(n=>{const i=[];n.forEach(a=>{i.push(a*t)}),e.push(i)}),e},gL=r=>{let t=1/0,e=1/0,n=-1/0,i=-1/0;return r.forEach(a=>{let s=a.data.size;Ea(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}},Tb=(r,t)=>Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)),Iv=(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),Iv(r,r.getChildren(c.id,i),e,n,i,a),n!=="TB"&&e(c)}}},pL={center:[0,0],linkDistance:50};class Ob{constructor(t={}){this.options=t,this.id="mds",this.options=Object.assign(Object.assign({},pL),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=Ab({nodes:o,edges:l},!1),u=Mb(c);mL(u);const h=vL(u,s),d=yL(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 mL=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)})})},yL=r=>{const e=Ha.mul(Ha.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 Sb(e),o=Ha.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map(l=>Ha.mul([l],[o]).toJSON()[0].splice(0,2))};function Bv(r){return!!r.tick&&!!r.stop}const bL={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},xL={center:[0,0],comboPadding:10,treeKey:"combo"};class EL{constructor(t={}){this.options=t,this.id="comboCombined",this.options=Object.assign(Object.assign({},xL),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(I=>!I.data._isCombo),c=e.getAllNodes().filter(I=>I.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(I=>{f.set(I.id,I)});const v=new Map;c.forEach(I=>{v.set(I.id,I)});const g=new Map,p=this.getInnerGraphs(e,s,f,v,u,i,g);yield Promise.all(p);const y=new Map,b=[],E=new Map;let O=!0;e.getRoots(s).forEach(I=>{const V=g.get(I.id),Y=v.get(I.id)||f.get(I.id),J={id:I.id,data:Object.assign(Object.assign({},I.data),{x:V.data.x||Y.data.x,y:V.data.y||Y.data.y,fx:V.data.fx||Y.data.fx,fy:V.data.fy||Y.data.fy,mass:V.data.mass||Y.data.mass,size:V.data.size})};b.push(J),y.set(I.id,!0),!isNaN(J.data.x)&&J.data.x!==0&&!isNaN(J.data.y)&&J.data.y!==0?O=!1:(J.data.x=Math.random()*100,J.data.y=Math.random()*100),Iv(e,[I],$=>{$.id!==I.id&&E.set($.id,I.id)},"TB",s)});const P=[];u.forEach(I=>{const V=E.get(I.source)||I.source,Y=E.get(I.target)||I.target;V!==Y&&y.has(V)&&y.has(Y)&&P.push({id:I.id,source:V,target:Y,data:{}})});let R;if(b!=null&&b.length){if(b.length===1)b[0].data.x=a[0],b[0].data.y=a[1];else{const I=new Un({nodes:b,edges:P}),V=o||new xb;O&&bL[V.id]&&(yield(b.length<100?new Ob:new Rv).assign(I));const Y=Object.assign({center:a,kg:5,preventOverlap:!0,animate:!1},V.id==="force"?{gravity:1,factor:4,linkDistance:(J,$,ot)=>{const ct=Math.max(...$.data.size)||32,ft=Math.max(...ot.data.size)||32;return ct/2+ft/2+200}}:{});R=yield Cb(V,I,Y)}g.forEach(I=>{var V;const Y=R.nodes.find(ot=>ot.id===I.id);if(Y){const{x:ot,y:ct}=Y.data;I.data.visited=!0,I.data.x=ot,I.data.y=ct,d.push({id:I.id,data:{x:ot,y:ct}})}const{x:J,y:$}=I.data;(V=I.data.nodes)===null||V===void 0||V.forEach(ot=>{d.push({id:ot.id,data:{x:ot.data.x+J,y:ot.data.y+$}})})}),g.forEach(({data:I})=>{const{x:V,y:Y,visited:J,nodes:$}=I;$==null||$.forEach(ot=>{if(!J){const ct=d.find(ft=>ft.id===ot.id);ct.data.x+=V||0,ct.data.y+=Y||0}})})}return t&&d.forEach(I=>{e.mergeNodeData(I.id,{x:I.data.x,y:I.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?Ea(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+u)/2:zn(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 Ea(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+h)/2:((u||32)+h)/2};else if(Ea(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:Ea(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 Rv({}),f={center:[0,0],preventOverlap:!0,nodeSpacing:u},v=[],g=p=>{let y=(c==null?void 0:c(p))||10;return Ea(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();Iv(t,[p],b=>{var E;if(!b.data._isCombo)return;const{size:O,padding:P}=g(b);if(!(!((E=t.getChildren(b.id,e))===null||E===void 0)&&E.length))o.set(b.id,{id:b.id,data:Object.assign(Object.assign({},b.data),{size:O})});else{const R=o.get(b.id);o.set(b.id,{id:b.id,data:Object.assign({nodes:[]},R==null?void 0:R.data)});const F=new Map,I=t.getChildren(b.id,e).map(J=>{if(J.data._isCombo)return o.has(J.id)||o.set(J.id,{id:J.id,data:Object.assign({},J.data)}),F.set(J.id,!0),o.get(J.id);const $=n.get(J.id)||i.get(J.id);return F.set(J.id,!0),{id:J.id,data:Object.assign(Object.assign({},$.data),J.data)}}),V={nodes:I,edges:a.filter(J=>F.has(J.source)&&F.has(J.target))};let Y=1/0;I.forEach(J=>{var $;let{size:ot}=J.data;ot||(ot=(($=o.get(J.id))===null||$===void 0?void 0:$.data.size)||(l==null?void 0:l(J))||[30,30]),ie(ot)&&(ot=[ot,ot]);const[ct,ft]=ot;Y>ct&&(Y=ct),Y>ft&&(Y=ft),J.data.size=ot}),y=y.then(()=>(0,G.mG)(this,void 0,void 0,function*(){const J=new Un(V);yield Cb(d,J,f,!0);const{minX:$,minY:ot,maxX:ct,maxY:ft}=gL(I),Nt={x:(ct+$)/2,y:(ft+ot)/2};V.nodes.forEach(mt=>{mt.data.x-=Nt.x,mt.data.y-=Nt.y});const Ot=[Math.max(ct-$,Y)+P*2,Math.max(ft-ot,Y)+P*2];o.get(b.id).data.size=Ot,o.get(b.id).data.nodes=I}))}return!0},"BT",e),v.push(y)}),v}}function Cb(r,t,e,n){var i;return(0,G.mG)(this,void 0,void 0,function*(){return Bv(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 ar(r){return function(){return r}}function Xa(r){return(r()-.5)*1e-6}function wL(r){return r.index}function Nb(r,t){var e=r.get(t);if(!e)throw new Error("node not found: "+t);return e}function SL(r){var t=wL,e=h,n,i=ar(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 E=0,O,P,R,F,I,V,Y;E<b;++E)O=r[E],P=O.source,R=O.target,F=R.x+R.vx-P.x-P.vx||Xa(c),I=R.y+R.vy-P.y-P.vy||Xa(c),V=Math.sqrt(F*F+I*I),V=(V-a[E])/V*p*n[E],F*=V,I*=V,R.vx-=F*(Y=l[E]),R.vy-=I*Y,P.vx+=F*(Y=1-Y),P.vy+=I*Y}function f(){if(s){var p,y=s.length,b=r.length,E=new Map(s.map((P,R)=>[t(P,R,s),P])),O;for(p=0,o=new Array(y);p<b;++p)O=r[p],O.index=p,typeof O.source!="object"&&(O.source=Nb(E,O.source)),typeof O.target!="object"&&(O.target=Nb(E,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:ar(+p),v(),d):e},d.distance=function(p){return arguments.length?(i=typeof p=="function"?p:ar(+p),g(),d):i},d}var ML=S(72317),AL=S(83833);const TL=1664525,OL=1013904223,kb=4294967296;function CL(){let r=1;return()=>(r=(TL*r+OL)%kb)/kb}function NL(r){return r.x}function kL(r){return r.y}var PL=10,RL=Math.PI*(3-Math.sqrt(5));function LL(r){var t,e=1,n=.001,i=1-Math.pow(n,1/300),a=0,s=.6,o=new Map,l=(0,AL.HT)(h),c=(0,ML.Z)("tick","end"),u=CL();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 E=0;E<g;++E)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=PL*Math.sqrt(.5+g),E=g*RL;y.x=b*Math.cos(E),y.y=b*Math.sin(E)}(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,E=r.length,O,P,R,F,I;for(y==null?y=1/0:y*=y,b=0;b<E;++b)F=r[b],O=g-F.x,P=p-F.y,R=O*O+P*P,R<y&&(I=F,y=R);return I},on:function(g,p){return arguments.length>1?(c.on(g,p),t):c.on(g)}}}function _L(){var r,t,e,n,i=ar(-30),a,s=1,o=1/0,l=.81;function c(f){var v,g=r.length,p=(0,Lv.Z)(r,NL,kL).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,E,O;if(f.length){for(b=E=O=0;O<4;++O)(g=f[O])&&(p=Math.abs(g.value))&&(v+=g.value,y+=p,b+=p*g.x,E+=p*g.y);f.x=b/y,f.y=E/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,E=p-v,O=y*y+b*b;if(E*E/l<O)return O<o&&(y===0&&(y=Xa(e),O+=y*y),b===0&&(b=Xa(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=Xa(e),O+=y*y),b===0&&(b=Xa(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)));do f.data!==t&&(E=a[f.data.index]*n/O,t.vx+=y*E,t.vy+=b*E);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:ar(+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 DL(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 IL(r){return r.x+r.vx}function BL(r){return r.y+r.vy}function FL(r){var t,e,n,i=1,a=1;typeof r!="function"&&(r=ar(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,Lv.Z)(t,IL,BL).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(E,O,P,R,F){var I=E.data,V=E.r,Y=g+V;if(I){if(I.index>d.index){var J=f-I.x-I.vx,$=v-I.y-I.vy,ot=J*J+$*$;ot<Y*Y&&(J===0&&(J=Xa(n),ot+=J*J),$===0&&($=Xa(n),ot+=$*$),ot=(Y-(ot=Math.sqrt(ot)))/ot*i,d.vx+=(J*=ot)*(Y=(V*=V)/(p+V)),d.vy+=($*=ot)*Y,I.vx-=J*(Y=1-Y),I.vy-=$*Y)}return}return O>f+Y||R<f-Y||P>v+Y||F<v-Y}}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:ar(+c),l(),s):r},s}function zL(r,t,e){var n,i=ar(.1),a,s;typeof r!="function"&&(r=ar(+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:ar(+c),l(),o):i},o.radius=function(c){return arguments.length?(r=typeof c=="function"?c:ar(+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 jL(r){var t=ar(.1),e,n,i;typeof r!="function"&&(r=ar(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:ar(+o),s(),a):t},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:ar(+o),s(),a):r},a}function ZL(r){var t=ar(.1),e,n,i;typeof r!="function"&&(r=ar(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:ar(+o),s(),a):t},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:ar(+o),s(),a):r},a}class WL{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:SL,manyBody:_L,center:DL,collide:FL,radial:zL,x:jL,y:ZL},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 LL()}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())})),Pb(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)),Pb(s,Object.entries(t[a]))}else e.force(a,null)}),e}}const Pb=(r,t)=>t.reduce((e,[n,i])=>!e[n]||i===void 0?e:e[n].call(r,i),r);var Rb=S(92546),GL=S.n(Rb);class nh{constructor(t){this.id="dagre",this.options={},Object.assign(this.options,nh.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 Rb.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})}),GL().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})}}nh.defaultOptions={};class Fv{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 Fv(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 VL={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 UL{constructor(t={}){this.options=t,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},VL),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:E}=y;return b!==E}),g=new Un({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:E,target:O}=v[b],P=g.getDegree(E),R=g.getDegree(E);if(P<=1){const F=g.getNode(O);g.mergeNodeData(E,{x:F.data.x,y:F.data.y})}else if(R<=1){const F=g.getNode(E);g.mergeNodeData(O,{x:F.data.x,y:F.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]=kv(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 E={id:p,rx:y.x,ry:y.y,mass:1,g:o,degree:t.getDegree(b)};g[b]=new Fv(E)}}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 E=[p.data.x-g.data.x,p.data.y-g.data.y];let O=Math.hypot(E[0],E[1]);O=O<1e-4?1e-4:O,E[0]=E[0]/O,E[1]=E[1]/O,o&&e<n&&(O=O-i[f]-i[v]);let P=O,R=P;c==="linlog"&&(P=Math.log(1+O),R=P),l&&(P=O/y,R=O/b),o&&e<n&&O<=0?(P=0,R=0):o&&e<n&&O>0&&(P=O,R=O),a[f][0]+=P*E[0],a[v][0]-=R*E[0],a[f][1]+=P*E[1],a[v][1]-=R*E[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:E,data:O}=l[b];o&&t.getDegree(E)<=1||(n[E].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:E}=l[b];o&&t.getDegree(E)<=1||n[E].in(p)&&y.insert(n[E])}for(let b=0;b<c;b+=1){const{id:E,data:O}=l[b],P=t.getDegree(E);if(o&&P<=1)continue;n[E].resetForce(),y.updateForce(n[E]),e[E][0]-=n[E].fx,e[E][1]-=n[E].fy;const R=[O.x-s[0],O.y-s[1]];let F=Math.hypot(R[0],R[1]);F=F<1e-4?1e-4:F,R[0]=R[0]/F,R[1]=R[1]/F;const I=a*(P+1);e[E][0]-=I*R[0],e[E][1]-=I*R[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 P=g+1;P<v;P+=1){const R=f[P],F=t.getDegree(R.id);if(d&&(y<=1||F<=1))continue;const I=[R.data.x-p.data.x,R.data.y-p.data.y];let V=Math.hypot(I[0],I[1]);V=V<1e-4?1e-4:V,I[0]=I[0]/V,I[1]=I[1]/V,l&&e<n&&(V=V-s[p.id]-s[R.id]);let Y=c*(y+1)*(F+1)/V;l&&e<n&&V<0?Y=a*(y+1)*(F+1):l&&e<n&&V===0?Y=0:l&&e<n&&V>0&&(Y=c*(y+1)*(F+1)/V),i[p.id][0]-=Y*I[0],i[R.id][0]+=Y*I[0],i[p.id][1]-=Y*I[1],i[R.id][1]+=Y*I[1]}const b=[p.data.x-h[0],p.data.y-h[1]],E=Math.hypot(b[0],b[1]);b[0]=b[0]/E,b[1]=b[1]/E;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:E}=u[b],O=t.getDegree(E);if(l&&O<=1)continue;const P=[e[E][0]-n[E][0],e[E][1]-n[E][1]],R=Math.hypot(P[0],P[1]),F=[e[E][0]+n[E][0],e[E][1]+n[E][1]],I=Math.hypot(F[0],F[1]);d[b]=R,f[b]=I/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:E,data:O}=u[b],P=t.getDegree(E);if(l&&P<=1||ie(O.fx)&&ie(O.fy))continue;let R=s*p/(1+p*Math.sqrt(d[b])),F=Math.hypot(e[E][0],e[E][1]);F=F<1e-4?1e-4:F;const I=c/F;R=R>I?I:R;const V=R*e[E][0],Y=R*e[E][1];t.mergeNodeData(E,{x:O.x+V,y:O.y+Y})}return p}}const YL={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},HL=800;class XL{constructor(t={}){this.options=t,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},YL),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 E={nodes:[],edges:v};return this.lastResult=E,E}if(f.length===1){t&&e.mergeNodeData(f[0].id,{x:l[0],y:l[1],z:a===3?l[2]:void 0});const E={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=E,E}const g=f.map(E=>ci(E,[s,o])),p=new Un({nodes:g,edges:v}),y={};if(c&&g.forEach(E=>{const O=E.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(E=>{this.timeInterval=window.setInterval(()=>{if(!this.running){E({nodes:g,edges:v});return}this.runOneStep(p,y,i),t&&g.forEach(({id:O,data:P})=>e.mergeNodeData(O,{x:P.x,y:P.y,z:a===3?P.z:void 0})),d==null||d({nodes:g,edges:v}),b++,b>=h&&(window.clearInterval(this.timeInterval),E({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:P}=O,R=e[P[h]];ie(P.x)&&(R.cx+=P.x),ie(P.y)&&(R.cy+=P.y),R.count++});for(const O in e)e[O].cx/=e[O].count,e[O].cy/=e[O].count;const E=d||o;g.forEach((O,P)=>{const{id:R,data:F}=O;if(!ie(F.x)||!ie(F.y))return;const I=e[F[h]],V=Math.sqrt((F.x-I.cx)*(F.x-I.cx)+(F.y-I.cy)*(F.y-I.cy)),Y=y*E;b[R].x-=Y*(F.x-I.cx)/V,b[R].y-=Y*(F.y-I.cy)/V})}g.forEach((E,O)=>{const{id:P,data:R}=E;if(!ie(R.x)||!ie(R.y))return;const F=.01*y*o;b[P].x-=F*(R.x-l[0]),b[P].y-=F*(R.y-l[1]),i===3&&(b[P].z-=F*(R.z-l[2]))}),g.forEach((E,O)=>{const{id:P,data:R}=E;if(ie(R.fx)&&ie(R.fy)){R.x=R.fx,R.y=R.fy,i===3&&(R.z=R.fz);return}if(!ie(R.x)||!ie(R.y))return;const F=Math.sqrt(b[P].x*b[P].x+b[P].y*b[P].y+(i===3?b[P].z*b[P].z:0));if(F>0){const I=Math.min(v*(c/HL),F);t.mergeNodeData(P,{x:R.x+b[P].x/F*I,y:R.y+b[P].y/F*I,z:i===3?R.z+b[P].z/F*I: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 KL={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 QL{constructor(t={}){this.options=t,this.id="grid",this.options=Object.assign(Object.assign({},KL),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(),E=y==null?void 0:y.length;if(!E||E===1)return Zs(e,t,a);const O=y.map(ft=>ci(ft));p!=="id"&&(!Ge(p)||O[0].data[p]===void 0)&&(p="degree"),p==="degree"?O.sort((ft,Nt)=>e.getDegree(Nt.id,"both")-e.getDegree(ft.id,"both")):p==="id"?O.sort((ft,Nt)=>ie(Nt.id)&&ie(ft.id)?Nt.id-ft.id:`${ft.id}`.localeCompare(`${Nt.id}`)):O.sort((ft,Nt)=>Nt.data[p]-ft.data[p]);const P=!f&&typeof window!="undefined"?window.innerWidth:f,R=!v&&typeof window!="undefined"?window.innerHeight:v,F=E,I={rows:c,cols:u};if(c!=null&&u!=null)I.rows=c,I.cols=u;else if(c!=null&&u==null)I.rows=c,I.cols=Math.ceil(F/I.rows);else if(c==null&&u!=null)I.cols=u,I.rows=Math.ceil(F/I.cols);else{const ft=Math.sqrt(F*R/P);I.rows=Math.round(ft),I.cols=Math.round(P/R*ft)}if(I.rows=Math.max(I.rows,1),I.cols=Math.max(I.cols,1),I.cols*I.rows>F){const ft=rh(I),Nt=ih(I);(ft-1)*Nt>=F?rh(I,ft-1):(Nt-1)*ft>=F&&ih(I,Nt-1)}else for(;I.cols*I.rows<F;){const ft=rh(I),Nt=ih(I);(Nt+1)*ft>=F?ih(I,Nt+1):rh(I,ft+1)}let V=s?0:P/I.cols,Y=s?0:R/I.rows;if(l||h){const ft=js(10,h),Nt=Nv(30,d,!1);O.forEach(Ot=>{(!Ot.data.x||!Ot.data.y)&&(Ot.data.x=0,Ot.data.y=0);const mt=e.getNode(Ot.id),[yt,Rt]=Pl(Nt(mt)||30),jt=ft!==void 0?ft(Ot):o,Xt=yt+jt,ee=Rt+jt;V=Math.max(V,Xt),Y=Math.max(Y,ee)})}const J={},$={row:0,col:0},ot={};for(let ft=0;ft<O.length;ft++){const Nt=O[ft];let Ot;if(g&&(Ot=g(e.getNode(Nt.id))),Ot&&(Ot.row!==void 0||Ot.col!==void 0)){const mt={row:Ot.row,col:Ot.col};if(mt.col===void 0)for(mt.col=0;zv(J,mt);)mt.col++;else if(mt.row===void 0)for(mt.row=0;zv(J,mt);)mt.row++;ot[Nt.id]=mt,Lb(J,mt)}qL(Nt,a,V,Y,ot,I,$,J)}const ct={nodes:O,edges:b};return t&&O.forEach(ft=>{e.mergeNodeData(ft.id,{x:ft.data.x,y:ft.data.y})}),ct})}}const rh=(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},ih=(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},zv=(r,t)=>r[`c-${t.row}-${t.col}`]||!1,Lb=(r,t)=>r[`c-${t.row}-${t.col}`]=!0,_b=(r,t)=>{const e=r.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},qL=(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(;zv(o,s);)_b(a,s);l=s.col*e+e/2+t[0],c=s.row*n+n/2+t[1],Lb(o,s),_b(a,s)}r.data.x=l,r.data.y=c},JL=(r,t,e)=>{try{const n=Ha.mul(Ha.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 Sb(n),l=Ha.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(c=>Ha.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}},$L=800,t_={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},e_=(r,t)=>{const e=Object.assign(Object.assign({},t_),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}}),n_(d,n,f,s,u,h),r_(n,f,o,l,c,v,a,u);return n},n_=(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}})})},r_=(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/$L),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},i_={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class a_{constructor(t={}){this.options=t,this.id="radial",this.options=Object.assign(Object.assign({},i_),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,E=e.getAllNodes(),O=e.getAllEdges(),P=!a&&typeof window!="undefined"?window.innerWidth:a,R=!s&&typeof window!="undefined"?window.innerHeight:s,F=o||[P/2,R/2];if(!(E!=null&&E.length)||E.length===1)return Zs(e,t,F);let I=E[0];if(Ge(l)){for(let xe=0;xe<E.length;xe++)if(E[xe].id===l){I=E[xe];break}}else I=l||E[0];const V=l_(E,I.id),Y=Ab({nodes:E,edges:O},!1),J=Mb(Y),$=u_(J,V);c_(J,V,$+1);const ot=J[V];let ct=P-F[0]>F[0]?F[0]:P-F[0],ft=R-F[1]>F[1]?F[1]:R-F[1];ct===0&&(ct=P/2),ft===0&&(ft=R/2);const Nt=Math.min(ct,ft),Ot=Math.max(...ot),mt=[],yt=c||Nt/Ot;ot.forEach((xe,Ce)=>{mt[Ce]=xe*yt});const Rt=s_(E,J,p,mt,yt,g,y),jt=o_(Rt),Xt=JL(p,Rt,p);let ee=Xt.map(([xe,Ce])=>({x:(isNaN(xe)?Math.random()*p:xe)-Xt[V][0],y:(isNaN(Ce)?Math.random()*p:Ce)-Xt[V][1]}));this.run(b,ee,jt,Rt,mt,V);let ae;if(f){ae=kv(u,h);const xe={nodes:E,nodeSizeFunc:ae,positions:ee,radii:mt,height:R,width:P,strictRadial:!!d,focusIdx:V,iterations:v||200,k:ee.length/4.5};ee=e_(e,xe)}const he=[];return ee.forEach((xe,Ce)=>{const je=ci(E[Ce]);je.data.x=xe.x+F[0],je.data.y=xe.y+F[1],he.push(je)}),t&&he.forEach(xe=>e.mergeNodeData(xe.id,{x:xe.data.x,y:xe.data.y})),{nodes:he,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=Tb(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=Tb(l,p),E=b===0?0:1/b,O=i[y][c];v+=a[c][y],d+=a[c][y]*(p.x+O*(l.x-p.x)*E),f+=a[c][y]*(p.y+O*(l.y-p.y)*E)});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 s_=(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;Ge(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;Ge(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},o_=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},l_=(r,t)=>{let e=-1;return r.forEach((n,i)=>{n.id===t&&(e=i)}),Math.max(e,0)},c_=(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}}},u_=(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},h_={center:[0,0],width:300,height:300};class d_{constructor(t={}){this.options=t,this.id="random",this.options=Object.assign(Object.assign({},h_),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 f_(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 jv=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];jv.has(r)||jv.set(r,f_(e));var o=jv.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 v_=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 Hu{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=(E,O=0)=>{var P;return O+=n*((E.children||[]).length+1),(P=E.children)===null||P===void 0||P.forEach(R=>{var F;(F=l.getNodeLikeDatum(R).children)===null||F===void 0||F.forEach(V=>{const Y=l.getNodeLikeDatum(V);O=h(Y,O)})}),O},d=E=>{if(E.depth===1)return u;const O=l.getParentData(E.id,"tree");if(wo(E)){const P=l.getParentData(O.id,"tree"),R=g(E)-g(P);return d(O)+R*n/a}else{const P=(O.children||[]).indexOf(E.id),R=l.getNodeData((O.children||[]).slice(P));return f(O)-R.reduce((F,I)=>F+h(I),0)-c(O)[0]/2}},f=Zv(E=>{if(Wv(E))return c(E)[0]/2;const O=l.getParentData(E.id,"tree");if(wo(E))return d(E)+h(E)+c(E)[0]/2;{const P=g(E)-g(O),R=n/a;return d(E)+P*R}},E=>E.id),v=E=>g(l.getParentData(E,"tree")),g=Zv(E=>{if(Wv(E))return o/2;if(wo(E)){const O=l.getParentData(E.id,"tree"),P=O.children.indexOf(E.id);if(P===0)return v(O.id)+a;const R=l.getNodeLikeDatum(O.children[P-1]);if(ra(R.children))return g(R)+a;const F=l.getDescendantsData(R.id);return Math.max(...F.map(I=>wo(I)?v(I.id):g(I)))+a}else{if(ra(E.children))return v(E.id)+a;const O=l.getNodeLikeDatum(E.children.slice(-1)[0]);if(ra(O.children))return g(O)+a;const P=l.getDescendantsData(E.id).slice(-1)[0];return(wo(P)?v(P.id):g(P))+a}},E=>E.id);let p=0;const y={nodes:[],edges:[]},b=E=>{var O;(O=E.children)===null||O===void 0||O.forEach(V=>b(l.getNodeLikeDatum(V)));const P=g(E),R=f(E);if(y.nodes.push({id:E.id,x:R,y:P}),Wv(E))return;const F=l.getRelatedEdgesData(E.id,"in")[0],I=[d(E),wo(E)?P:v(E.id)];y.edges.push({id:At(F),controlPoints:[I],relatedNodeId:E.id}),p=Math.max(p,R+i(E)),E.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 v_(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign({},ah.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(Db(p,{x:v,y:g}))}),l.edges.forEach(d=>{const{id:f,controlPoints:v}=d,g=c.getEdgeDatum(f);h.push(Db(g,{controlPoints:v}))}),{nodes:u,edges:h}})}}ah.defaultOptions={direction:"RL",getRibSep:()=>60};const Db=(r,t)=>Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},r.style||{}),t)}),Wv=r=>r.depth===0,wo=r=>(r.depth||(r.depth=0))%2===0;var g_=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 Hu{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 g_(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({},sh.defaultOptions,this.options,e),[f,v,g,p]=ai(a),y=this.formatSize(t.nodes||[],i),b=Math.ceil((t.nodes||[]).length/o);let E=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),(E===1/0||E<0)&&(E=0),{nodes:((s?(n=t.nodes)===null||n===void 0?void 0:n.sort(s):p_(t))||[]).map((F,I)=>{const V=Math.floor(I/o),Y=I%o,J=u?V%2===0?Y:o-1-Y:V%2===0?o-1-Y:Y,$=p+J*(y[0]+E)+y[0]/2,ot=f+V*(y[1]+O)+y[1]/2;return{id:F.id,style:{x:$,y:ot}}})}})}}sh.defaultOptions={padding:0,cols:5,clockwise:!0};function p_(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 m_=["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)"],y_=["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)"],b_=["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)"],x_=["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)"],E_=["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 w_=function(r,t,e){if(!Wr(r)&&!vo(r))return r;var n=e;return s1(r,function(i,a){n=t(n,i,a)}),n},S_=w_,Gv=function(r,t){return S_(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})};class hr extends Vf{}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 Vv(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 M_=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 oh extends hr{constructor(t,e){super(t,Object.assign({},oh.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 M_(this,void 0,void 0,function*(){e.update.call(this,t),Object.assign(this.$element.style,Gv(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}oh.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};function Uv(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 Ka(r,t,e,n){return(r-e)*(r-e)+(t-n)*(t-n)}function Ib(r,t,e,n,i){return Ka(r,t,e,n)<i*i}function A_(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 Bb(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 Uv(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 Yv{constructor(t,e=0,n=0){this.state=t,this.x=e,this.y=n}}function lh(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 Yv(Dn.POINT,r.x1+a*(r.x2-r.x1),r.y1+a*(r.y2-r.y1)):new Yv(Dn.NONE)}return new Yv(e===0||n===0?Dn.COINCIDENT:Dn.PARALLEL)}function Fb(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 T_(r,t){function e(i,a,s,o){let l=Fb(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 In;(function(r){r[r.LEFT=0]="LEFT",r[r.TOP=1]="TOP",r[r.RIGHT=2]="RIGHT",r[r.BOTTOM=3]="BOTTOM"})(In||(In={}));function ch(r,t,e){const n=new Set;return r.width<=0?(n.add(In.LEFT),n.add(In.RIGHT)):t<r.x?n.add(In.LEFT):t>r.x+r.width&&n.add(In.RIGHT),r.height<=0?(n.add(In.TOP),n.add(In.BOTTOM)):e<r.y?n.add(In.TOP):e>r.y+r.height&&n.add(In.BOTTOM),n}function zb(r,t){let e=t.x1,n=t.y1;const i=t.x2,a=t.y2,s=Array.from(ch(r,i,a));if(s.length===0)return!0;let o=ch(r,e,n);for(;o.size!==0;){for(const l of s)if(o.has(l))return!1;if(o.has(In.RIGHT)||o.has(In.LEFT)){let l=r.x;o.has(In.RIGHT)&&(l+=r.width),n=n+(l-e)*(a-n)/(i-e),e=l}else{let l=r.y;o.has(In.BOTTOM)&&(l+=r.height),e=e+(l-n)*(i-e)/(a-n),n=l}o=ch(r,e,n)}return!0}function O_(r,t){let e=Number.POSITIVE_INFINITY,n=0;function i(a,s,o,l){let c=Fb(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 C_(r,t){let e=0;const n=lh(r,new dr(t.x,t.y,t.x2,t.y));e+=n.state===Dn.POINT?1:0;const i=lh(r,new dr(t.x,t.y,t.x,t.y2));e+=i.state===Dn.POINT?1:0;const a=lh(r,new dr(t.x,t.y2,t.x2,t.y2));e+=a.state===Dn.POINT?1:0;const s=lh(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 Or{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 Or(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 Or(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=ch(this,t,e);return n.has(In.TOP)?n.has(In.LEFT)?Ka(t,e,this.x,this.y):n.has(In.RIGHT)?Ka(t,e,this.x2,this.y):(this.y-e)*(this.y-e):n.has(In.BOTTOM)?n.has(In.LEFT)?Ka(t,e,this.x,this.y2):n.has(In.RIGHT)?Ka(t,e,this.x2,this.y2):(e-this.y2)*(e-this.y2):n.has(In.LEFT)?(this.x-t)*(this.x-t):n.has(In.RIGHT)?(t-this.x2)*(t-this.x2):0}}function N_(r){if(r.length===0)return null;const t=r[0],e=new Or(t.x,t.y,0,0);for(const n of r)e.addPoint(n);return e}class uh{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 uh(t.cx,t.cy,t.radius)}containsPt(t,e){return Ka(this.cx,this.cy,t,e)<this.radius*this.radius}distSquare(t,e){const n=Ka(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 Or(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 Or(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 jb(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 Zb(r,t,e){return Wb(Object.assign(Bb(r),{distSquare:(n,i)=>Uv(r.x1,r.y1,r.x2,r.y2,n,i)}),t,e)}function Wb(r,t,e){const n=jb(r,e),i=t.scale(n),a=t.createSub(i,n);return k_(a,t,e,(s,o)=>r.distSquare(s,o)),a}function k_(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 P_(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 E=1;E<v;E++){const O=t.invertScaleY(n.y-E),P=r.distSquare(b,O);if(P<d){const R=e-Math.sqrt(P);f.push(R*R)}else break}}const g=[],p=Math.max(s,l),y=Math.max(o,l);for(let b=1;b<p;b++){const E=t.invertScaleX(n.x-b),O=[];for(let P=1;P<y;P++){const R=t.invertScaleY(n.y-P),F=r.distSquare(E,R);if(F<d){const I=e-Math.sqrt(F);O.push(I*I)}else O.push(0)}g.push(O)}for(let b=1;b<Math.min(o,f.length);b++){const E=f[b];a.fillHorizontalLine(s,o-b,u+1,E)}for(let b=1;b<Math.min(c,f.length);b++){const E=f[b];a.fillHorizontalLine(s,o+h+b,u+1,E)}for(let b=1;b<Math.min(s,f.length);b++){const E=f[b];a.fillVerticalLine(s-b,o,h+1,E)}for(let b=1;b<Math.min(c,f.length);b++){const E=f[b];a.fillVerticalLine(s+u+b,o,h+1,E)}for(let b=1;b<s;b++){const E=g[b-1],O=s-b;for(let P=1;P<o;P++)a.set(O,o-P,E[P-1]);for(let P=1;P<c;P++)a.set(O,o+h+P,E[P-1])}for(let b=1;b<l;b++){const E=g[b-1],O=s+u+b;for(let P=1;P<o;P++)a.set(O,o-P,E[P-1]);for(let P=1;P<c;P++)a.set(O,o+h+P,E[P-1])}return a}function nj(r,t,e,n){return{x:r,y:t,width:e,height:n}}function rj(r,t,e){return{cx:r,cy:t,radius:e}}function ij(r,t,e,n){return{x1:r,y1:t,x2:e,y2:n}}function Sn(r,t){return{x:r,y:t}}function R_(r,t,e,n){if(r.length===0)return[];const i=B_(r);return i.map((a,s)=>{const o=i.slice(0,s);return L_(t,a,o,e,n)}).flat()}function L_(r,t,e,n,i){const a=Sn(t.cx,t.cy),s=I_(a,e,r);if(s==null)return[];const o=new dr(a.x,a.y,s.cx,s.cy),l=__(o,r,n,i);return D_(l,r)}function __(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=Gb(t,l),u=c?C_(l,c):null;if(!c||!u||u.count!==2){s||i.push(l);continue}let h=n,d=dh(c,h,u,!0),f=Qa(d,a)||Qa(d,i),v=hh(d,t);for(;!f&&v&&h>=1;)h/=1.5,d=dh(c,h,u,!0),f=Qa(d,a)||Qa(d,i),v=hh(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=dh(c,h,u,!1);let g=Qa(d,a)||Qa(d,i);for(v=hh(d,t);!g&&v&&h>=1;)h/=1.5,d=dh(c,h,u,!1),g=Qa(d,a)||Qa(d,i),v=hh(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 D_(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);Gb(t,a)?(e.push(n),r.push(i)):r.push(a)}return e}function I_(r,t,e){let n=Number.POSITIVE_INFINITY;return t.reduce((i,a)=>{const s=Ka(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=F_(e,o);return s*(l+1)*(l+1)<n&&(i=a,n=s*(l+1)*(l+1)),i},null)}function B_(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 hh(r,t){return t.some(e=>e.containsPt(r.x,r.y))}function Qa(r,t){return t.some(e=>!!(Ib(e.x1,e.y1,r.x,r.y,.001)||Ib(e.x2,e.y2,r.x,r.y,.001)))}function Gb(r,t){let e=Number.POSITIVE_INFINITY,n=null;for(const i of r){if(!zb(i,t))continue;const a=O_(i,t);a>=0&&a<e&&(n=i,e=a)}return n}function F_(r,t){return r.reduce((e,n)=>zb(n,t)&&T_(n,t)?e+1:e,0)}function dh(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 z_(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(Uv(a.x,a.y,s.x,s.y,l.x,l.y)>n)return!1}return!0}function j_(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(;z_(t,n,a,i);)a++;e.push(t.get(n)),n=a}return new Gs(e)}}function Z_(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 W_(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=Z_(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 G_(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:A_(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 G_(t)(this)}simplify(t){return j_(t)(this)}bSplines(t){return W_(t)(this)}apply(t){return t(this)}containsElements(t){const e=N_(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 V_{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,fh=1,vh=2,Hv=3;function U_(r,t){const e=(Math.floor(r.width)+Math.floor(r.height))*2,n=new V_(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=fh;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=vh;break;case 12:case 14:case 4:s=Hv;break;case 6:s=s===Rl?Hv:vh;break;case 1:case 13:case 5:s=Rl;break;case 9:s=s===vh?Rl:fh;break;case 10:case 8:case 11:s=fh;break;default:return console.warn("Marching squares invalid state: "+p),!0}switch(s){case Rl:h--,f-=r.pixelGroup;break;case fh:h++,f+=r.pixelGroup;break;case Hv:u--,d-=r.pixelGroup;break;case vh: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 gh={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 Vb(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 Xv{constructor(t={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new Or(0,0,0,0),this.potentialArea=new Ws(1,0,0,0,0,0,0),this.o=Object.assign({},gh,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)?uh.from(e):Or.from(e),area:null})}}removeMember(t){const e=this.members.findIndex(n=>Vb(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=>Vb(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)?uh.from(e):Or.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=R_(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=H_(i,c),h=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,d=Or.from(jb(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 Or?"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 Or?"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 Or?P_(c.obj,this.potentialArea,this.o.nodeR1):Wb(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=Zb(c.obj,this.potentialArea,this.o.edgeR1))}),this.virtualEdges.forEach(c=>{c.area||(c.area=Zb(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 Y_(e,n,i,a,o=>o.containsElements(s),t)}}function Y_(r,t,e,n,i,a={}){const s=Object.assign({},gh,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=U_(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 H_(r,t){if(r.length===0)return new Or(0,0,0,0);const e=Or.from(r[0]);for(const n of r)e.add(n);for(const n of t)e.add(Bb(n));return e}function aj(r,t=[],e=[],n={}){if(r.length===0)return new Gs([]);const i=new Xv(n);return i.pushMember(...r),i.pushNonMember(...t),i.pushEdge(...e),i.compute()}var X_=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 hr{constructor(t,e){super(t,mr({},ph.defaultOptions,e)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:n,bubbleSetOptions:i}=this.parseOptions();Wn(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&&Wn(a,s)&&Wn(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(E=>{const O=b?this.members:this.avoidMembers,P=b?"pushMember":"pushNonMember",R=b?"removeMember":"removeNonMember";if(y){let F;i.getElementType(E)==="edge"?([F]=Q_(i,E),this.bubbleSets.pushEdge(F)):([F]=K_(i,E),this.bubbleSets[P](F)),O.set(E,F)}else{const F=O.get(E);F&&(i.getElementType(E)==="edge"?this.bubbleSets.removeEdge(F):this.bubbleSets[R](F),O.delete(E))}})};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=Yy(g.points.map(yr)),this.path},this.bindEvents(),this.bubbleSets=new Xv(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 Xv(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=X_(t,["type","key","members","avoidMembers"]),o=Object.keys(s).reduce((l,c)=>(c in gh?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()}}ph.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},gh);const K_=(r,t)=>(Array.isArray(t)?t:[t]).map(n=>{const i=r.getElementRenderBounds(n);return new Or(i.min[0],i.min[1],ta(i),ea(i))}),Q_=(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 sj 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 q_(r){return`
<ul class="g6-contextmenu-ul">
${r.map(t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`).join("")}
</ul>
`}const J_=`
.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 Ub=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 mh extends hr{constructor(t,e){super(t,Object.assign({},mh.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),Vv("g6-contextmenu-css","style",{},J_,document.head)}show(t){return Ub(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 Ub(this,void 0,void 0,function*(){const{getContent:e,getItems:n}=this.options;return n?q_(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)}}mh.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class yh extends hr{constructor(t,e){super(t,Object.assign({},yh.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]=Ne(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:fv(this.edgePoints[f])})})},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map(e=>[At(e),Rs(ir(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(Ne(s,o),2)),this.edgePoints[a].push(o);else{const c=(this.edgePoints[a].length===0?bn(s,o):rD(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=Ne(f,Di(ln(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]=ln(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=$_(n,i),s=tD(n,i),o=eD(n,i),l=nD(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 Di(ln(Ne(n,a),Di(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=ln(s,o),c=bn(s,o);i=Ne(i,Di(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(Di(Ne(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()}}yh.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const $_=(r,t)=>Math.abs(wN([r.vx,r.vy],[t.vx,t.vy])/(r.length*t.length)),tD=(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)},eD=(r,t)=>{const e=(r.length+t.length)/2,n=Ii(Ne(r.source,r.target),2),i=Ii(Ne(t.source,t.target),2);return e/(e+bn(n,i))},Yb=(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]},Hb=(r,t)=>{const e=Yb(t.source,r),n=Yb(t.target,r),i=Ii(Ne(e,n),2),a=Ii(Ne(r.source,r.target),2);return bn(e,n)===0?0:Math.max(0,1-2*bn(a,i)/bn(e,n))},nD=(r,t)=>Math.min(Hb(r,t),Hb(t,r)),rD=r=>{let t=0;for(let e=1;e<r.length;e++)t+=bn(r[e],r[e-1]);return t},iD={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0},Xb=.05;class bh extends hr{constructor(t,e){super(t,Object.assign({},bh.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({},iD,this.options.style);this.isLensOn||(this.lens=new Ds({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(ir(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-Xb):1-Xb,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()}}bh.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const aD={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12},Kb=.05,Qb=.1;class xh extends hr{constructor(t,e){super(t,Object.assign({},xh.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({},aD,this.options.style);this.isLensOn||(this.lens=new Ds({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=ir(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,E=[g+d*y,p+d*b],O=At(c),P=this.getNodeStyle(c),R=Bs(n.getElementRenderStyle(O),Object.keys(P));s.set(O,Object.assign(Object.assign({},Bi(E)),P)),o.set(O,Object.assign(Object.assign({},Bi(u)),R))}),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-Kb):1-Kb,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+Qb:this.d-Qb;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()}}xh.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class Eh extends hr{constructor(t,e){super(t,Object.assign({},Eh.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||!sD()||this.$el.requestFullscreen().catch(t=>{Xr.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()}}Eh.defaultOptions={trigger:{},autoFit:!0};function sD(){return document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled")}class wh extends hr{constructor(t,e){super(t,Object.assign({},wh.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||s===void 0&&this.context.viewport===void 0)return;const o=this.currentScale;this.currentScale=a;const l=a/o,c=Di(s||this.context.graph.getCanvasCenter(),1-l),u=this.baseSize*a,h=Di(this.offset,l),d=Yf(h,u),f=Ne(d,c);this.$element.style.backgroundSize=`${u}px ${u}px`,this.$element.style.backgroundPosition=`${f[0]}px ${f[1]}px`,this.offset=Yf(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=Yf(Ne(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()}}wh.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};function Kv(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 qb(r){const{NodeAdded:t=[],NodeUpdated:e=[],NodeRemoved:n=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:s=[],ComboAdded:o=[],ComboUpdated:l=[],ComboRemoved:c=[]}=Xc(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 Jb(r,t){for(const e in r)zn(r[e])&&!Array.isArray(r[e])&&r[e]!==null?(t[e]||(t[e]={}),Jb(r[e],t[e])):t[e]===void 0&&(t[e]=hl(e))}function oD(r,t=!1,e){const n={animation:t,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:a,remove:s}=qb(Kv(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)})}Jb(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 Sh extends hr{constructor(t,e){super(t,Object.assign({},Sh.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(yy(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(oD(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 Uu;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=[]}}Sh.defaultOptions={stackSize:0};const Qv={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 lD{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 cD(r,t){return new lD(r,t)}const $b=+(Math.pow(2,27)+1);function Mh(r,t,e){const n=r*t,i=$b*r,a=i-r,s=i-a,o=r-s,l=$b*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 uD(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 hD(r,t){const e=r.length;if(e===1){const o=Mh(r[0],t);return o[0]?o:[o[1]]}const n=new Array(2*e),i=[.1,.1],a=[.1,.1];let s=0;Mh(r[0],t,i),i[0]&&(n[s++]=i[0]);for(let o=1;o<e;++o){Mh(r[o],t,a);const l=i[1];uD(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 dD(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 fD(r,t){const e=r.length|0,n=t.length|0;if(e===1&&n===1)return dD(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,E=b,O=p,P,R,F,I,V;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=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,R=P-O,F=P-R,I=p-R,V=O-F,E=V+I,O=P;for(;o<e;)v=u,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,R=P-O,F=P-R,I=p-R,V=O-F,E=V+I,O=P,o+=1,o<e&&(u=r[o]);for(;l<n;)v=d,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,R=P-O,F=P-R,I=p-R,V=O-F,E=V+I,O=P,l+=1,l<n&&(d=-t[l]);return E&&(a[s++]=E),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}function vD(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 gD(r,t){const e=r.length|0,n=t.length|0;if(e===1&&n===1)return vD(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,E=b,O=p,P,R,F,I,V;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=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,R=P-O,F=P-R,I=p-R,V=O-F,E=V+I,O=P;for(;o<e;)v=u,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,R=P-O,F=P-R,I=p-R,V=O-F,E=V+I,O=P,o+=1,o<e&&(u=r[o]);for(;l<n;)v=d,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,R=P-O,F=P-R,I=p-R,V=O-F,E=V+I,O=P,l+=1,l<n&&(d=t[l]);return E&&(a[s++]=E),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}const tx=5,Ah=11102230246251565e-32,pD=(3+16*Ah)*Ah,mD=(7+56*Ah)*Ah;function yD(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 bD(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 xD(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 Th(r){return(r===3?yD:r===4?bD:xD)(gD,Mh,hD,fD)}const ED=Th(3),wD=Th(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=pD*o;return s>=l||s<=-l?s:ED(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,E=s*l,O=h*(v-g)+d*(p-y)+f*(b-E),P=(Math.abs(v)+Math.abs(g))*Math.abs(h)+(Math.abs(p)+Math.abs(y))*Math.abs(d)+(Math.abs(b)+Math.abs(E))*Math.abs(f),R=mD*P;return O>R||-O>R?O:wD(t,e,n,i)}];function SD(r){let t=Vs[r.length];return t||(t=Vs[r.length]=Th(r.length)),t.apply(void 0,...r)}function MD(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 AD(){for(;Vs.length<=tx;)Vs.push(Th(Vs.length));const r=MD(void 0,SD,...Vs);for(let t=0;t<=tx;++t)r[t]=Vs[t];return r}var _l=AD();const ex=_l[3];function TD(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&&ex(r[n[u-2]],r[n[u-1]],c)<=0;)u-=1,n.pop();for(n.push(l),u=i.length;u>1&&ex(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 OD(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 CD(r,t,e,n){const i=_l(r,e,n),a=_l(t,e,n);if(i>0&&a>0||i<0&&a<0)return!1;const s=_l(e,r,t),o=_l(n,r,t);return s>0&&o>0||s<0&&o<0?!1:i===0&&a===0&&s===0&&o===0?OD(r,t,e,n):!0}function ND(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 kD(r){return r.sort(function(t,e){return t[0]-e[0]||t[1]-e[1]})}function qv(r,t){return Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2)}function nx(r,t,e){const n=[t[0]-r[0],t[1]-r[1]],i=[e[0]-r[0],e[1]-r[1]],a=qv(r,t),s=qv(r,e);return(n[0]*i[0]+n[1]*i[1])/Math.sqrt(a*s)}function rx(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])&&CD(r[0],r[1],n[0],n[1]))return!0}return!1}function PD(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 RD(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 LD(r,t,e){let n=null,i=ax,a=ax,s,o;for(let l=0;l<t.length;l++)s=nx(r[0],r[1],t[l]),o=nx(r[1],r[0],t[l]),s>i&&o>a&&!rx([r[0],t[l]],e)&&!rx([r[1],t[l]],e)&&(i=s,a=o,n=t[l]);return n}function ix(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(qv(o[0],o[1])<t||i.has(l))continue;let c=0,u=RD(o),h,d,f;do u=n.extendBbox(u,c),h=u[2]-u[0],d=u[3]-u[1],f=LD(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?ix(r,t,e,n,i):r}function _D(r,t,e){const n=t||20,i=ND(kD(Qv.toXy(r,e)));if(i.length<4){const h=i.concat([i[0]]);return e?Qv.fromXy(h,e):h}const a=PD(i),s=[a[0]*sx,a[1]*sx],o=TD(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=ix(o,Math.pow(n,2),s,cD(l,c),new Set);return e?Qv.fromXy(u,e):u}const ax=Math.cos(90/(180/Math.PI)),sx=.6;function DD(r,t,e){if(r.length===1)return ID(r[0],t,e);if(r.length===2)return ox(r,t,e);if(r.length===3){const[n,i,a]=Xf(r);if(Ny(n,i,a))return ox([n,a],t,e)}switch(e){case"smooth":return FD(r,t);case"sharp":return zD(r,t);case"rounded":default:return BD(r,t)}}const ID=(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]]},ox=(r,t,e)=>{const n=[t,t,0,0,0],i=e==="sharp"?Ne(r[0],Za(ma(ln(r[0],r[1])),t)):r[0],a=e==="sharp"?Ne(r[1],Za(ma(ln(r[1],r[0])),t)):r[1],s=Za(ma(hu(ln(i,a),!1)),t),o=Za(s,-1),l=Ne(i,s),c=Ne(a,s),u=Ne(a,o),h=Ne(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]]]},BD=(r,t)=>{const e=Xf(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=ln(d,f),p=ln(f,o),y=ln(o,v),b=(F,I)=>Uf(F,I,!0)<Math.PI,E=b(g,p),O=b(p,y),P=F=>Za(ma(hu(F,!1)),t),R=P(p);return[{p:Rs(E?Ne(f,P(g)):Ne(f,R)),concave:E&&f},{p:Rs(O?Ne(o,P(y)):Ne(o,R)),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})},FD=(r,t)=>{const e=Xf(r).map((n,i)=>{const a=r[(i+1)%r.length];return{p:n,v:ma(ln(a,n))}});return e.forEach((n,i)=>{const a=i>0?i-1:r.length-1,s=e[a].v,o=ma(Ne(s,Za(n.v,Uf(s,n.v,!0)<Math.PI?1:-1)));n.p=Ne(n.p,Za(o,t))}),Yy(e.map(n=>n.p))},zD=(r,t)=>{const n=r.map((a,s)=>{const o=r[s===0?r.length-1:s-1],l=pl(Za(ma(hu(ln(o,a),!1)),t));return[Ne(o,l),Ne(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 Hf(o,l,!0)}).filter(Boolean).map((a,s)=>[s===0?"M":"L",a[0],a[1]]).concat([["Z"]])};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 Oh extends hr{constructor(t,e){super(t,Object.assign({},Oh.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=!Wn(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=_D(s.map(ir),this.options.concavity).slice(1).reverse(),l=o.flatMap(c=>s.filter(u=>Wn(ir(u),c)).map(At));return Wn(l,this.hullMemberIds)&&!n?this.path:(this.hullMemberIds=l,this.path=DD(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=jD(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()}}Oh.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};function lx(r,t){t(r),r.children&&r.children.forEach(function(e){e&&lx(e,t)})}function Dl(r){Ch(r,!0)}function ji(r){Ch(r,!1)}function Ch(r,t){var e=t?"visible":"hidden";lx(r,function(n){n.attr("visibility",e)})}var ZD=5,cx=function(r,t,e,n){e===void 0&&(e=0),n===void 0&&(n=ZD),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?cx(r[s],o,e+1,n):l[s]=t[s]):Wr(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)cx(r,t[n]);return r},WD=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(De.INSERTED,function(){ji(i)}),i}return t}(rr);function ux(r){var t=r.appendChild(new WD({class:"offscreen"}));return ji(t),t}function GD(r){for(var t=r;t;){if(t.className==="offscreen")return!0;t=t.parent}return!1}function VD(){Ch(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=ux(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"&&VD.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}(ff);function Jv(r){return r.toString().charAt(0).toUpperCase()+r.toString().slice(1)}function UD(r){return r.toString().charAt(0).toLowerCase()+r.toString().slice(1)}function YD(r,t){return"".concat(t).concat(Jv(r))}function hx(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?UD(a):a}function HD(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 Nh=function(r,t){if(!(r!=null&&r.startsWith(t)))return!1;var e=r[t.length];return e>="A"&&e<="Z"};function ke(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(Nh(s,"show")&&Nh(hx(s,"show"),t)!==e)s===YD(t,"show")?n[s]=o:n[s.replace(new RegExp(Jv(t)),"")]=o;else if(!Nh(s,"show")&&Nh(s,t)!==e){var l=hx(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(Jv(a))]=s,e},{})}function wa(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 XD=function(r){if(!Wr(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},KD=XD,$v=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=ux(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 QD(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 qD(r){throw new Error(r)}var JD=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(Y){return Y}),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(Y,J){return[a(Y.__data__,J),Y]})),g=new Map(this._facetElements.map(function(Y,J){return[a(Y.__data__,J),Y]})),p=QD(this._elements,function(Y){return s(Y.__data__)}),y=0;y<i.length;y++){var b=i[y],E=a(b,y),O=s(b,y);if(v.has(E)){var P=v.get(E);P.__data__=b,P.__facet__=!1,u.push(P),h.delete(P),v.delete(E)}else if(g.has(E)){var P=g.get(E);P.__data__=b,P.__facet__=!0,u.push(P),g.delete(E)}else if(p.has(E)){var R=p.get(E);d.push([b,R]);try{for(var F=(o=void 0,(0,G.XA)(R)),I=F.next();!I.done;I=F.next()){var P=I.value;h.delete(P)}}catch(Y){o={error:Y}}finally{try{I&&!I.done&&(l=F.return)&&l.call(F)}finally{if(o)throw o.error}}p.delete(E)}else if(v.has(O)){var P=v.get(O);P.__toData__?P.__toData__.push(b):P.__toData__=[b],f.add(P),h.delete(P)}else c.push(b)}var V=[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,V)},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:qD("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=KD(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:rr,rect:pr,circle:Ji,path:ni,text:$v,ellipse:al,image:sl,line:As,polygon:Ts,polyline:Oc,html:co},r}();function ve(r){return new JD([r],null,r,r.ownerDocument)}function $D(r,t,e){return r.querySelector(t)?ve(r).select(t):ve(r).append(e)}var Cr=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 oj(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 Cr(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 kh(r){return/\S+-\S+/g.test(r)?r.split("-").map(function(t){return t[0]}):r.length>2?[r[0]]:r.split("")}function xr(r){if(ie(r))return[r,r,r,r];if(Wr(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 dx=Zi({text:"text"},"title");function tI(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=kh(n),u=(0,G.CR)(xr(s?i:0),4),h=u[0],d=u[1],f=u[2],v=u[3],g=(0,G.CR)(xr(a),4),p=g[0],y=g[1],b=g[2],E=g[3],O=(0,G.CR)([v+d,h+f],2),P=O[0],R=O[1],F=(0,G.CR)([E+y,p+b],2),I=F[0],V=F[1];if(c[0]==="l")return new Cr(o.x,o.y,l.width+o.width+P+I,Math.max(l.height+V,o.height));if(c[0]==="t")return new Cr(o.x,o.y,Math.max(l.width+I,o.width),l.height+o.height+R+V);var Y=(0,G.CR)([t.attributes.width||l.width,t.attributes.height||l.height],2),J=Y[0],$=Y[1];return new Cr(l.x,l.y,J+o.width+P+I,$+o.height+R+V)}function eI(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 nI(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=kh(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 rI=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(dx.text.class);if(!c)return new Cr(0,0,+i,+a);var u=c.getBBox(),h=u.width,d=u.height,f=(0,G.CR)(xr(o),4),v=f[0],g=f[1],p=f[2],y=f[3],b=(0,G.CR)([0,0,+i,+a],4),E=b[0],O=b[1],P=b[2],R=b[3],F=kh(s);if(F.includes("i"))return new Cr(E,O,P,R);F.forEach(function(Nt,Ot){var mt,yt,Rt,jt;Nt==="t"&&(mt=(0,G.CR)(Ot===0?[d+p,+a-d-p]:[0,+a],2),O=mt[0],R=mt[1]),Nt==="r"&&(yt=(0,G.CR)([+i-h-y],1),P=yt[0]),Nt==="b"&&(Rt=(0,G.CR)([+a-d-v],1),R=Rt[0]),Nt==="l"&&(jt=(0,G.CR)(Ot===0?[h+g,+i-h-g]:[0,+i],2),E=jt[0],P=jt[1])});var I=(0,G.CR)(xr(l),4),V=I[0],Y=I[1],J=I[2],$=I[3],ot=(0,G.CR)([$+Y,V+J],2),ct=ot[0],ft=ot[1];return new Cr(E+$,O+V,P-ct,R-ft)},t.prototype.getBBox=function(){return this.title?this.title.getBBox():new Cr(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)(wa(c),1),h=u[0],d=nI(e),f=d.x,v=d.y,g=d.textAlign,p=d.textBaseline;Qr(!!c.text,ve(n),function(y){i.title=y.maybeAppendByClassName(dx.text,"text").styles(h).call(eI,{x:f,y:v,textAlign:g,textBaseline:p}).node()})},t}(Ln),t0=function(){};function qr(r,t){return fe(r)?r.apply(void 0,(0,G.ev)([],(0,G.CR)(t),!1)):r}function iI(r,t){return r.reduce(function(e,n){return(e[n[t]]=e[n[t]]||[]).push(n),e},{})}function aI(r){return typeof r=="boolean"?!1:"enter"in r&&"update"in r&&"exit"in r}function fx(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 aI(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 sI(r,t){r.length===0?t():Promise.all(r.map(function(e){return e==null?void 0:e.finished})).then(t)}function vx(r,t){"update"in r?r.update(t):r.attr(t)}function gx(r,t,e){if(t.length===0)return null;if(!e){var n=t.slice(-1)[0];return vx(r,{style:n}),null}return r.animate(t,e)}function oI(r,t){return!(r.nodeName!=="text"||t.nodeName!=="text"||r.attributes.text!==t.attributes.text)}function lI(r,t,e,n){if(n===void 0&&(n="destroy"),oI(r,t))return r.remove(),[null];var i=function(){n==="destroy"?r.destroy():n==="hide"&&ji(r),t.isVisible()&&Dl(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],E=y[1],O=r.style.opacity,P=O===void 0?1:O,R=t.style.opacity,F=R===void 0?1:R,I=r.style.transform||"",V=t.style.transform||"",Y=r.animate([{opacity:P,transform:"translate(0, 0) ".concat(I)},{opacity:0,transform:"translate(".concat(b,", ").concat(E,") ").concat(I)}],(0,G.pi)((0,G.pi)({fill:"both"},e),{duration:l+c+u})),J=t.animate([{opacity:0,transform:"translate(".concat(-b,", ").concat(-E,") ").concat(V),offset:.01},{opacity:F,transform:"translate(0, 0) ".concat(V)}],(0,G.pi)((0,G.pi)({fill:"both"},e),{duration:c+u,delay:l+c-u}));return Ao(J,i),[Y,J]}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(!me(l)){var c=r.style[o]||r.parsedStyle[o]||0;c!==l&&(n[o]=c,i[o]=l)}}),e?gx(r,[n,i],(0,G.pi)({fill:"both"},e)):(vx(r,i),null)}function cI(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 e0(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 px=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"]]},uI=px,hI=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"]]},dI=function(r,t,e){return[["M",r-e,t],["L",r,t-e],["L",r+e,t],["L",r,t+e],["Z"]]},fI=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"]]},vI=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"]]},gI=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"]]},pI=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"]]},mx=function(r,t,e){return[["M",r,t+e],["L",r,t-e]]},mI=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]]},yI=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]]},bI=function(r,t,e){return[["M",r-e,t],["L",r+e,t],["M",r,t-e],["L",r,t+e]]},xI=function(r,t,e){return[["M",r-e,t],["L",r+e,t]]},yx=function(r,t,e){return[["M",r-e,t],["L",r+e,t]]},EI=yx,wI=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]]},SI=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,t+2.5],["L",r,t-2.5],["L",r+e+1,t-2.5]]},AI=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 TI(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 OI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t],["L",r-e,t+e],["Z"]]},CI=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]]},Si=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"),NI=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:OI(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 rr({class:Si.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new rr({class:Si.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)(cI(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 Cr(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=gx(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(Si.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)?Dl(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(),E=b.width,O=b.height,P=Math.max(p,u,E),R=o==="horizontal"?{offset:[[0,0],[p/2+l,0],[p+u+l*2,0]],textAlign:"start"}:{offset:[[P/2,-y-l],[P/2,0],[P/2,O+l]],textAlign:"center"},F=(0,G.CR)(R.offset,3),I=(0,G.CR)(F[0],2),V=I[0],Y=I[1],J=(0,G.CR)(F[1],2),$=J[0],ot=J[1],ct=(0,G.CR)(F[2],2),ft=ct[0],Nt=ct[1],Ot=R.textAlign,mt=a.querySelector("text");mt&&(mt.style.textAlign=Ot),n.setLocalPosition(V,Y),a.setLocalPosition($,ot),i.setLocalPosition(ft,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(Si.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(Si.controller,"g");if(Ch(c.node(),l),!!l){var u=ke(this.attributes,"button"),h=ke(this.attributes,"pageNum"),d=(0,G.CR)(wa(u),2),f=d[0],v=d[1],g=f.size,p=(0,G._T)(f,["size"]),y=!c.select(Si.prevBtnGroup.class).node(),b=c.maybeAppendByClassName(Si.prevBtnGroup,"g").styles(v);this.prevBtnGroup=b.node();var E=b.maybeAppendByClassName(Si.prevBtn,"path"),O=c.maybeAppendByClassName(Si.nextBtnGroup,"g").styles(v);this.nextBtnGroup=O.node();var P=O.maybeAppendByClassName(Si.nextBtn,"path");[E,P].forEach(function(F){F.styles((0,G.pi)((0,G.pi)({},p),{transformOrigin:"center"})),e0(F.node(),g,!0)});var R=c.maybeAppendByClassName(Si.pageInfoGroup,"g");this.pageInfoGroup=R.node(),R.maybeAppendByClassName(Si.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(De.INSERTED,n),this.playWindow.addEventListener(De.REMOVED,n)},t}(Ln);function kI(r){var t="default";if(zn(r)&&r instanceof Image)t="image";else if(fe(r))t="symbol";else if(Ge(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 PI(r){var t=kI(r);return["base64","url","image"].includes(t)?"image":r&&t==="symbol"?"path":null}var en=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=PI(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);en.registerSymbol("cross",mI),en.registerSymbol("hyphen",xI),en.registerSymbol("line",mx),en.registerSymbol("plus",bI),en.registerSymbol("tick",yI),en.registerSymbol("circle",px),en.registerSymbol("point",uI),en.registerSymbol("bowtie",pI),en.registerSymbol("hexagon",gI),en.registerSymbol("square",hI),en.registerSymbol("diamond",dI),en.registerSymbol("triangle",fI),en.registerSymbol("triangle-down",vI),en.registerSymbol("line",mx),en.registerSymbol("dot",yx),en.registerSymbol("dash",EI),en.registerSymbol("smooth",wI),en.registerSymbol("hv",SI),en.registerSymbol("vh",MI),en.registerSymbol("hvh",AI),en.registerSymbol("vhv",TI),en.registerSymbol("focus",CI);function lj(r,t,e){var n=Math.round((r-e)/t);return e+n*t}function RI(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 bx=1.4,xx=.4;function LI(r,t,e){var n=e,i=n*bx,a=n/2,s=n/6,o=r+i*xx;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 _I(r,t,e){var n=e,i=n*bx,a=n/2,s=n/6,o=t+i*xx;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]]}en.registerSymbol("hiddenHandle",RI),en.registerSymbol("verticalHandle",LI),en.registerSymbol("horizontalHandle",_I);var cj=function(r,t,e){return r===void 0&&(r="horizontal"),r==="horizontal"?t:e};function uj(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 n0(r,t,e){return r===void 0&&(r="horizontal"),r==="horizontal"?t:e}function hj(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 Ex(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 dj(r,t){var e=select(r).append("text").node();return e.attr(__assign(__assign({},t),{visibility:"hidden"})),e}function DI(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 fj(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 II(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 Sa(r){return typeof r=="function"?r():Ge(r)||ie(r)?new $v({style:{text:String(r)}}):r}function BI(r,t){return typeof r=="function"?r():Ge(r)||ie(r)?new co({style:(0,G.pi)((0,G.pi)({},t),{innerHTML:String(r)})}):r}var Ph,r0;function vj(r){r0=r}var FI=Zv(function(r,t){var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return r0?r0(r,e):(Ph||(Ph=Vt.offscreenCanvasCreator.getOrCreateContext(void 0)),Ph.font=[a,s,i,"".concat(e,"px"),n].join(" "),Ph.measureText(r).width)},function(r,t){return[r,Object.values(t||wx(r)).join()].join("")},4096),wx=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 Sx(r){return r.nodeName==="text"?r:r.nodeName==="g"&&r.children.length===1&&r.children[0].nodeName==="text"?r.children[0]:null}function Mx(r,t){var e=Sx(r);e&&e.attr(t)}function i0(r,t,e){e===void 0&&(e="..."),Mx(r,{wordWrap:!0,wordWrapWidth:t,maxLines:1,textOverflow:e})}function a0(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function zI(r,t,e,n){return t&&a0(r,t),e&&a0(r,e),n&&a0(r,n),r}function jI(r){return r instanceof Element||r instanceof Document}var Ie,ZI="component-poptip",Re={CONTAINER:"component-poptip",ARROW:"component-poptip-arrow",TEXT:"component-poptip-text"},Ax=(Ie={},Ie[".".concat(Re.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"},Ie[".".concat(Re.TEXT)]={"text-align":"center"},Ie[".".concat(Re.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, -100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='left']")]={transform:"translate(-100%, -50%)"},Ie[".".concat(Re.CONTAINER,"[data-position='right']")]={transform:"translate(0, -50%)"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='top-left']")]={transform:"translate(0,-100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='right-top']")]={transform:"translate(0, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},Ie[".".concat(Re.ARROW)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},Ie[".".concat(Re.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},Ie["[data-position='top'] .".concat(Re.ARROW)]={bottom:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},Ie["[data-position='left'] .".concat(Re.ARROW)]={right:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='right']")]={transform:"translate(5px, -50%)"},Ie["[data-position='right'] .".concat(Re.ARROW)]={left:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},Ie["[data-position='bottom'] .".concat(Re.ARROW)]={top:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},Ie["[data-position='top-left'] .".concat(Re.ARROW)]={left:"10px",bottom:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},Ie["[data-position='top-right'] .".concat(Re.ARROW)]={right:"10px",bottom:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},Ie["[data-position='left-top'] .".concat(Re.ARROW)]={right:"-2px",top:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},Ie["[data-position='left-bottom'] .".concat(Re.ARROW)]={right:"-2px",bottom:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='right-top']")]={transform:"translate(5px, 0)"},Ie["[data-position='right-top'] .".concat(Re.ARROW)]={left:"-2px",top:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},Ie["[data-position='right-bottom'] .".concat(Re.ARROW)]={left:"-2px",bottom:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},Ie["[data-position='bottom-left'] .".concat(Re.ARROW)]={top:"-2px",left:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},Ie["[data-position='bottom-right'] .".concat(Re.ARROW)]={top:"-2px",right:"8px"},Ie),WI=void 0;function GI(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 VI=function(r){var t;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t||(t=r.apply(WI,e)),t}};function UI(r){var t=r&&document.getElementById(r);return t||(t=document.createElement("div"),t.setAttribute("id",r),document.body.appendChild(t)),t}function YI(r){var t=VI(UI)(r);return t}var HI=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,mr({style:{id:ZI}},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=zI({},i.style,g),(v||v===!1)&&(c=v),typeof f=="string"&&(h=f)}var p=u.position,y=u.arrowPointAtCenter,b=u.follow,E=u.offset;if(c){var O=l,P=O.clientX,R=O.clientY,F=(0,G.CR)(GI(P,R,c,p,y,b),2),I=F[0],V=F[1];i.showTip(I,V,{text:h,position:p,offset:E})}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(Re.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(Re.CONTAINER).concat(e?" ".concat(e):"")},t.prototype.initShape=function(){var e=this,n=this.style.id;this.container=YI(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(Re.ARROW,'"></span>');e.innerHTML=o,Ge(a)?e.innerHTML+=a:a&&jI(a)&&e.appendChild(a),s&&(e.getElementsByClassName(Re.TEXT)[0].textContent=s),this.applyStyles(),this.container.style.visibility=this.visibility},t.prototype.applyStyles=function(){var e=Jn({},Ax,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:Ax,template:'<div class="'.concat(Re.TEXT,'"></div>')}},t}(Ln),Nr=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"),XI={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 KI(r){var t=r.querySelector(Nr.marker.class);return t?t.style:{}}var QI=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)(xr(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),E=b[0],O=b[1];e=(0,G.CR)([E*y,O*y],2),h=e[0],d=e[1]}var P=o+h+d+v+g+l+p;return{width:P,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)(xr(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=KI(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=ke(this.attributes,"marker");this.markerGroup=e.maybeAppendByClassName(Nr.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 en({style:{symbol:i},className:Nr.marker.name}):i();l?c.nodeName===l.nodeName?l instanceof en?l.update((0,G.pi)((0,G.pi)({},a),{symbol:i})):(II(l,c),ve(l).styles(a)):(l.remove(),ve(c).attr("className",Nr.marker.name).styles(a),o.appendChild(c)):(c instanceof en||ve(c).attr("className",Nr.marker.name).styles(a),o.appendChild(c)),n.markerGroup.node().scale(1/n.markerGroup.node().getScale()[0]);var u=e0(n.markerGroup.node(),n.scaleSize,!0);n.markerGroup.node().style._transform="scale(".concat(u,")")})},t.prototype.renderLabel=function(e){var n=ke(this.attributes,"label"),i=n.text,a=(0,G._T)(n,["text"]);this.labelGroup=e.maybeAppendByClassName(Nr.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Nr.label,function(){return Sa(i)}).styles(a)},t.prototype.renderValue=function(e){var n=this,i=ke(this.attributes,"value"),a=i.text,s=(0,G._T)(i,["text"]);this.valueGroup=e.maybeAppendByClassName(Nr.valueGroup,"g").style("zIndex",0),Qr(this.showValue,this.valueGroup,function(){n.valueGroup.maybeAppendByClassName(Nr.value,function(){return Sa(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 HI({style:Jn(XI,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(Nr.focusGroup,"g").style("zIndex",0),Qr(a,this.focusGroup,function(){var l=new en({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(Nr.value,"g").node(),s=e.maybeAppendByClassName(Nr.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=ke(this.attributes,"background");this.background=e.maybeAppendByClassName(Nr.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Nr.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,")")}),i0(this.labelGroup.select(Nr.label.class).node(),Math.ceil(n)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(c,", ").concat(h,")")}),i0(this.valueGroup.select(Nr.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"),Tx=function(r,t,e){return e===void 0&&(e=!0),r?t(r):e},qI=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:t0,mouseenter:t0,mouseleave:t0})||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=ke(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],E=y[1];return[b,qr(E,[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,E=Math.floor(p/f),O=p%f,P=e.ifHorizontal(d,h),R=[Math.floor(O/P),O%P];i==="vertical"&&R.reverse();var F=(0,G.CR)(R,2),I=F[0],V=F[1],Y=(a-c-(d-1)*o)/d,J=g.getBBox().height,$=(0,G.CR)([0,0],2),ot=$[0],ct=$[1];return i==="horizontal"?(y=(0,G.CR)([v,I*(J+s)],2),ot=y[0],ct=y[1],v=V===d-1?0:v+Y+o):(b=(0,G.CR)([V*(Y+o),v],2),ot=b[0],ct=b[1],v=I===h-1?0:v+J+s),{page:E,index:p,row:I,col:V,pageIndex:O,width:Y,height:J,x:ot,y:ct}})},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],E=g[3],O=g[4],P=g[5],R=g[6],F=g[7];return this.pageViews.children.map(function(I,V){var Y,J,$,ot,ct=I.getBBox(),ft=ct.width,Nt=ct.height,Ot=R===0?0:s,mt=R+Ot+ft;if(mt<=f&&Tx(O,function(Rt){return Rt<h}))return Y=(0,G.CR)([R+Ot,F,mt],3),p=Y[0],y=Y[1],R=Y[2],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:P,col:O++};J=(0,G.CR)([P+1,0,0,F+Nt+a],4),P=J[0],O=J[1],R=J[2],F=J[3];var yt=F+Nt;return yt<=v&&Tx(P,function(Rt){return Rt<u})?($=(0,G.CR)([R,F,ft],3),p=$[0],y=$[1],R=$[2],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:P,col:O++}):(ot=(0,G.CR)([0,0,ft,0,b+1,0,0,0],8),p=ot[0],y=ot[1],R=ot[2],F=ot[3],b=ot[4],E=ot[5],P=ot[6],O=ot[7],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:P,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 n0(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 QI({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(iI(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 rr({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=ke(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 NI({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 Qn(e,{detail:n});this.dispatchEvent(i)},t}(Ln),Il=Zi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Ox={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},gj=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,Ox)||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?n0(a,"horizontalHandle","verticalHandle"):s;Qr(!!o,e,function(l){var c=ke(n.attributes,"marker"),u=(0,G.pi)({symbol:o},c);n.marker=l.maybeAppendByClassName(Il.marker,function(){return new en({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=ke(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,E=b===void 0?0:b,O=(0,G.CR)(n0(s,[0,E+l,"center","top"],[y+l,0,"start","middle"]),4),P=O[0],R=O[1],F=O[2],I=O[3];u.maybeAppendByClassName(Il.label,"text").styles((0,G.pi)((0,G.pi)({},v),{x:P,y:R,text:c(f).toString(),textAlign:F,textBaseline:I}))})},t}(Ln),Cx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},JI=Jn({},Cx,{}),pj=Jn({},Cx,Mo(Ox,"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"}),mj=.01,yj=.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"),$I=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,JI)||this}return t.prototype.renderTitle=function(e,n,i){var a=this.attributes,s=a.showTitle,o=a.titleText,l=ke(this.attributes,"title"),c=(0,G.CR)(wa(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 rI({style:d})}).update(d)},t.prototype.renderItems=function(e,n){var i=n.x,a=n.y,s=n.width,o=n.height,l=ke(this.attributes,"title",!0),c=(0,G.CR)(wa(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 qI({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 Cr(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):tI(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 Rh(r){const{width:t,height:e,renderer:n}=r,i=t6(r),a=new pf({width:t,height:e,container:i,renderer:n||new Sl});return[i,a]}function t6(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]=e6(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 e6(r){const{width:t,height:e,placement:n,graphCanvas:i}=r,[a,s]=i.getSize(),[o,l]=Ty(n);return[o*(a-t),l*(s-e)]}var n6=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 Lh extends hr{constructor(t,e){super(t,Object.assign({},Lh.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:E}=b,O=br(b,["data",h(b)]),P=(s==null?void 0:s.getElementType(y,b))||"circle",R=v(y,b),F=(y==="edge"?R==null?void 0:R.stroke:R==null?void 0:R.fill)||"#1783ff";E&&O&&O.replace(/\s+/g,"")&&(this.setFieldMap(O,E,y),u[O]||(u[O]={id:`${y}__${E}`,label:O,marker:f[P]||d[y],elementType:y,lineWidth:1,stroke:F,fill:F}))})};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=n6(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],E=Object.assign({width:i,height:a,data:b,itemMarkerLineWidth:({lineWidth:R})=>R,itemMarker:({marker:R})=>R,itemMarkerStroke:({stroke:R})=>R,itemMarkerFill:({fill:R})=>R,gridCol:g.length},v,this.getEvents()),O=new $I({className:"legend",style:E});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]=Rh({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()}}Lh.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class _h extends hr{constructor(t,e){super(t,Object.assign({},_h.defaultOptions,e)),this.onDraw=n=>{var i;!((i=n==null?void 0:n.data)===null||i===void 0)&&i.render||this.onRender()},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=Ja(i-p,0)),g+y>a&&(g=Ja(a-y,0)),p<d&&(s>0?(v=Ja(v-s,0),p=qa(p+s,i)):s<0&&(p=qa(p-s,i))),y<f&&(o>0?(g=Ja(g-o,0),y=qa(y+o,a)):o<0&&(y=qa(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,E=parseInt(c)-g;if(b===0&&E===0)return;const O=this.context.canvas.getCamera().getZoom(),P=this.canvas.getCamera().getZoom(),R=O/P;this.context.graph.translateBy([b*R,E*R],!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=Lm(()=>{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&&C1(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,l=(c,u)=>{const h=At(c),d=o==null?void 0:o.getElement(h);if(!d)return;const f=d.getShape("key");let v;if(typeof s=="string"){const g=s;v=d.getShape(g).cloneNode()}else{const g=s(h,u,d);g===d?v=g.cloneNode(!0):v=g}v.setPosition(f.getPosition()),d.style.zIndex&&(v.style.zIndex=d.style.zIndex),v.id=d.id,t.appendChild(v)};t.removeChildren(),i.forEach(c=>l(c,"edge")),a.forEach(c=>l(c,"combo")),n.forEach(c=>l(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]=Rh({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]=ai(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,E=y/g,O=Math.min(b,E),P=this.createLandmark(f,f,O);n.gotoLandmark(P,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=qa(a+n,t),n=0),i<0&&(s=qa(s+i,e),i=0),n+a>t&&(a=Ja(t-n,0)),i+s>e&&(s=Ja(e-i,0)),[qa(n,t),qa(i,e),Ja(a,0),Ja(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()}}_h.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 qa=(r,t)=>Math.min(r,t),Ja=(r,t)=>Math.max(r,t);var s0=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 o0={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class Dh extends hr{constructor(t,e){super(t,Object.assign({},Dh.defaultOptions,e)),this.initSnapline=()=>{const n=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=n.appendChild(new As({style:Object.assign(Object.assign({},o0),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=n.appendChild(new As({style:Object.assign(Object.assign({},o0),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(n,i,a)=>s0(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&&(kr(h,s)<l&&(g=s-h),kr(c,s)<l&&(g=s-c),kr(f,s)<l&&(g=s-f),g!==0&&(this.isVerticalSticking=!0)),o!==null&&(kr(d,o)<l&&(p=o-d),kr(u,o)<l&&(p=o-u),kr(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(E=>{if(Wn(n.id,E.id))return!1;const O=Nx(E,s).getRenderBounds(),{min:[P,R],max:[F,I],center:[V,Y]}=O;return f===null&&(kr(V,h)<a?f=V:kr(P,o)<a||kr(P,c)<a?f=P:(kr(F,c)<a||kr(F,o)<a)&&(f=F),f!==null&&(v=Math.min(R,l),g=Math.max(I,u))),p===null&&(kr(Y,d)<a?p=Y:kr(R,l)<a||kr(R,u)<a?p=R:(kr(I,u)<a||kr(I,l)<a)&&(p=I),p!==null&&(y=Math.min(P,o),b=Math.max(F,c))),f!==null&&p!==null}),{verticalX:f,verticalMinY:v,verticalMaxY:g,horizontalY:p,horizontalMinX:y,horizontalMaxX:b}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=n=>s0(this,void 0,void 0,function*(){const{target:i}=n;if(this.options.autoSnap&&!this.enableSnap(n))return;const a=Nx(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 C1(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||o0.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 s0(this,void 0,void 0,function*(){const{graph:t}=this.context;t.on(xi.DRAG_START,this.onDragStart),t.on(xi.DRAG,this.onDrag),t.on(xi.DRAG_END,this.onDragEnd)})}unbindEvents(){const{graph:t}=this.context;t.off(xi.DRAG_START,this.onDragStart),t.off(xi.DRAG,this.onDrag),t.off(xi.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()}}Dh.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const kr=(r,t)=>Math.abs(r-t),Nx=(r,t)=>typeof t=="function"?t(r):r.getShape(t);var kx=null,r6=null;function Ih(r){return r instanceof Date?r:new Date(r)}function i6(r){for(var t=__read(r,2),e=t[0],n=t[1],i=kx.indexOf(e),a=kx.indexOf(n),s="",o=i;o<=a;o+=1)if(s+=r6[o],o<a){var l="-";o===2?l=" ":o>2&&(l=":"),s+=l}return s}function Fr(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 bj(r,t){return Ih(r).getTime()-Ih(t).getTime()}function xj(r,t){var e=__read([Ih(r),Ih(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 Ej(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),Fr(e,i6(["year",t]))}function a6(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 l0={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 ni({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:[]},wj=mr({},l0,{style:{type:"arc"}}),Sj=mr({},l0,{style:{}}),cn=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 Ma(r,t){return[r[0]*t,r[1]*t]}function Fl(r,t){return[r[0]+t[0],r[1]+t[1]]}function c0(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 Px(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 Mj(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 s6(r,t){return t?[r[1],-r[0]]:[-r[1],r[0]]}function To(r){return r*Math.PI/180}function Rx(r){return Number((r*180/Math.PI).toPrecision(5))}function Bh(r,t){return r.style.opacity||(r.style.opacity=1),Wi(r,{opacity:0},t)}var o6=["$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 l6(r){return o6.includes(r)}function Lx(r){var t={};for(var e in r)l6(e)&&(t[e]=r[e]);return t}var Oo=Zi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function _x(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 c6(r,t,e){var n=t.connect,i=n===void 0?"line":n,a=t.center;if(i==="line")return _x(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 u0(r,t,e){return t.type==="surround"?c6(r,t,e):_x(r)}function u6(r,t,e){var n=e.type,i=e.connect,a=e.center,s=e.closed,o=s?[["Z"]]:[],l=(0,G.CR)([u0(r,e),u0(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,E){return[c,b,u,E,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 h6(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:u0(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=qr(Lx((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=qr(Lx((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=Bh(this,i.exit);return Ao(c,function(){return l.remove()}),c})}).transitions()}function d6(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=u6(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=qr(g,[g,p,l]);this.attr(y)}).attr("className",Oo.region.name)},function(v){return v.transition(function(g,p){var y=qr(g,[g,p,l]);return Wi(this,y,n.update)})},function(v){return v.transition(function(){var g=this,p=Bh(this,n.exit);return Ao(p,function(){return g.remove()}),p})}).transitions()}function f6(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 v6=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=f6(e),u=ve(n).maybeAppendByClassName(Oo.lineGroup,"g"),h=ve(n).maybeAppendByClassName(Oo.regionGroup,"g"),d=h6(u,c,e,l),f=d6(h,c,e);return(0,G.ev)((0,G.ev)([],(0,G.CR)(d),!1),(0,G.CR)(f),!1)},t}(Ln),g6=function(r,t){return function(e){return r*(1-e)+t*e}};function p6(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]=h0(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 m6(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]=h0(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 h0(r,t){return typeof r=="number"&&typeof t=="number"?g6(r,t):Array.isArray(r)&&Array.isArray(t)?p6(r,t):typeof r=="object"&&typeof t=="object"?m6(r,t):function(e){return r}}function y6(r,t,e,n){if(!n)return r.attr("__keyframe_data__",e),null;var i=n.duration,a=i===void 0?0:i,s=h0(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 Dx(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 Ix(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,qr(a,t)]}))}function Aj(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 d0(r,t){return t&&fe(t)?r.filter(t):r}function Bx(r,t){var e=t.startAngle,n=t.endAngle;return(n-e)*r+e}function Fh(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 Px([c,u])}var h=To(Bx(r,t));return[-Math.sin(h),Math.cos(h)]}function f0(r,t,e){var n=Fh(r,e);return s6(n,t!=="positive")}function Co(r,t){return f0(r,t.labelDirection,t)}function b6(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 x6(r,t){var e=t.radius,n=(0,G.CR)(t.center,2),i=n[0],a=n[1],s=To(Bx(r,t));return[i+e*Math.cos(s),a+e*Math.sin(s)]}function zh(r,t){return t.type==="linear"?b6(r,t):x6(r,t)}function v0(r){return Fh(0,r)[1]===0}function Fx(r){return Fh(0,r)[0]===0}function zx(r,t){return t-r===360}function jx(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(Y){return[e+i*Math.cos(Y),n+i*Math.sin(Y)]},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(zx(r,t)){var E=(h+u)/2,O=(0,G.CR)(d(E),2),P=O[0],R=O[1];return[["M",v,g],["A",o,l,0,1,0,P,R],["A",o,l,0,1,0,y,b]]}var F=a>180?1:0,I=r>t?0:1,V=!1;return V?"M".concat(e,",").concat(n,",L").concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(F,",").concat(I,",").concat(y,",").concat(b,",L").concat(e,",").concat(n):"M".concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(F,",").concat(I,",").concat(y,",").concat(b)}function E6(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 w6(r,t,e,n){var i=t.startAngle,a=t.endAngle,s=t.center,o=t.radius;return r.selectAll(cn.line.class).data([{d:jx.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",cn.line.name).styles(t).styles({d:function(c){return c.d}})},function(l){return l.transition(function(){var c=this,u=y6(this,E6(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=jx.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 S6(r,t){var e=t.truncRange,n=t.truncShape,i=t.lineExtension}function M6(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],E=y[1];return[b*v,b*g,E*v,E*g]}function Zx(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 A6(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?M6(a,s,l):new Array(4).fill(0),4),y=p[0],b=p[1],E=p[2],O=p[3],P=function(mt){return r.selectAll(cn.line.class).data(mt,function(yt,Rt){return Rt}).join(function(yt){return yt.append("line").attr("className",function(Rt){return"".concat(cn.line.name," ").concat(Rt.className)}).styles(e).transition(function(Rt){return Wi(this,Zx(Rt.line),!1)})},function(yt){return yt.styles(e).transition(function(Rt){var jt=Rt.line;return Wi(this,Zx(jt),n.update)})},function(yt){return yt.remove()}).transitions()};if(!i||!o)return P([{line:[[h+y,d+b],[v+E,g+O]],className:cn.line.name}]);var R=(0,G.CR)(o,2),F=R[0],I=R[1],V=v-h,Y=g-d,J=(0,G.CR)([h+V*F,d+Y*F],2),$=J[0],ot=J[1],ct=(0,G.CR)([h+V*I,d+Y*I],2),ft=ct[0],Nt=ct[1],Ot=P([{line:[[h+y,d+b],[$,ot]],className:cn.lineFirst.name},{line:[[ft,Nt],[v+E,g+O]],className:cn.lineSecond.name}]);return S6(r,t),Ot}function T6(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(cn.line.class):a?c=r.select(cn.lineSecond.class):c=r.select(cn.line.class),!i||!s||e.type==="arc"&&zx(e.startAngle,e.endAngle)){var u=c.node();u&&(u.style.markerEnd=void 0);return}var h=Sa(s);h.attr(n),e0(h,l,!0),c.style("markerEnd",h).style("markerEndOffset",-o)}function O6(r,t,e){var n=t.type,i,a=ke(t,"line");return n==="linear"?i=A6(r,t,Dx(a,"arrow"),e):i=w6(r,t,Dx(a,"arrow"),e),T6(r,n,t,a),i}function C6(r,t){return f0(r,t.gridDirection,t)}function Wx(r){var t=r.type,e=r.gridCenter;return t==="linear"?e:e||r.center}function N6(r,t){var e=t.gridLength;return r.map(function(n,i){var a=n.value,s=(0,G.CR)(zh(a,t),2),o=s[0],l=s[1],c=(0,G.CR)(Ma(C6(a,t),e),2),u=c[0],h=c[1];return{id:i,points:[[o,l],[o+u,l+h]]}})}function k6(r,t){var e=t.gridControlAngles,n=Wx(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)(zh(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),E=(0,G.CR)([Math.cos(b),Math.sin(b)],2),O=E[0],P=E[1],R=v*O-g*P+a,F=v*P+g*O+s;p.push([R,F])}),{points:p,id:l}})}function P6(r,t,e,n){var i=ke(e,"grid"),a=i.type,s=i.areaFill,o=Wx(e),l=d0(t,e.gridFilter),c=a==="segment"?N6(l,e):k6(l,e),u=(0,G.pi)((0,G.pi)({},i),{center:o,areaFill:fe(s)?l.map(function(h,d){return qr(s,[h,d,l])}):s,animate:n,data:c});return r.selectAll(cn.grid.class).data([1]).join(function(h){return h.append(function(){return new v6({style:u})}).attr("className",cn.grid.name)},function(h){return h.transition(function(){return this.update(u)})},function(h){return h.remove()}).transitions()}function Er(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 R6=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],E=y[1];return[b.toLowerCase(),E]})),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 L6(r,t,e,n){e===void 0&&(e=2),n===void 0&&(n="top"),Mx(r,{wordWrap:!0,wordWrapWidth:t,maxLines:e,textBaseline:n})}function _6(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 Gx(r,t){if(t)try{var e=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,n=t.replace(e,function(i,a,s){return"translate(".concat(_6(r,a,s),")")});r.attr("transform",n)}catch(i){}}var g0=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 jh(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=Sx(r);if(b){f-=1.5;var E=b.style.textAlign,O=b.style.textBaseline;E==="center"?p=(a+l)/2:(E==="right"||E==="end")&&(p=l),O==="middle"?y=(s+c)/2:O==="bottom"&&(y=c)}var P=(0,G.CR)(xr(t),4),R=P[0],F=R===void 0?0:R,I=P[1],V=I===void 0?0:I,Y=P[2],J=Y===void 0?F:Y,$=P[3],ot=$===void 0?V:$,ct=new g0((v+=a)-ot,(g+=s)-F,v+h+V,g+f+J);return r.setEulerAngles(e),ct.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 D6(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 I6(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(D6(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 B6(r,t){return t.every(function(e){return I6(r,e)})}function F6(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=jh(t,e);return B6(o,l)}function Vx(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,E=i-c,O=d*E-f*b;if(O<0===y)return!1;var P=v*E-g*b;return!(P<0===y||O>p===y||P>p===y)}function Ux(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 Vx(t,n)})}var Tj={lineToLine:Vx,intersectBoxLine:Ux,getBounds:jh};function z6(r,t,e){var n,i,a=jh(r,e).flat(1),s=jh(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(Ux(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 j6(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)(xr(t),4),v=f[0],g=f[1],p=f[2],y=f[3];return new g0(l+h-y,c+h-v,l+d+g,c+d+p)}var b=(0,G.CR)(r.startPos,2),E=b[0],O=b[1],P=(0,G.CR)(r.endPos,2),R=P[0],F=P[1],I=(0,G.CR)(Fx(r)?[-t,0,t,0]:[0,t,0,-t],4),V=I[0],Y=I[1],J=I[2],$=I[3],ot=Co(0,r),ct=Ma(ot,i),ft=new g0(E,O,R,F);return ft.x1+=$,ft.y1+=V,ft.x2+=Y+ct[0],ft.y2+=J+ct[1],ft}function Zh(r,t,e){var n,i,a=t.crossPadding,s=new Set,o=null,l=j6(t,a),c=function(v){return l?F6(l,v):!0},u=function(v,g){return!v||!v.firstChild?!0:!z6(v.firstChild,g.firstChild,xr(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 p0(r,t){return t===void 0&&(t={}),me(r)?0:typeof r=="number"?r:Math.floor(FI(r,t))}function Z6(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=wx(n.getTextShape(r[0])),v=p0(u,f),g=s?p0(s,f):v,p=p0(l,f);(me(p)||p===1/0)&&(p=Math.max.apply(null,r.map(function(ct){return ct.getBBox().width})));for(var y=r.slice(),b=(0,G.CR)(d,4),E=b[0],O=E===void 0?0:E,P=b[1],R=P===void 0?0:P,F=b[2],I=F===void 0?O:F,V=b[3],Y=V===void 0?R:V,J=function(ct){if(y.forEach(function(ft){n.ellipsis(n.getTextShape(ft),ct,a)}),y=Zh(r,e,d),y.length<1)return{value:void 0}},$=p;$>g+v;$-=v){var ot=J($);if(typeof ot=="object")return ot.value}}}var W6=function(r){return r!==void 0&&r!=null&&!Number.isNaN(r)},G6={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})}},V6=function(r){return r.filter(W6)};function U6(r,t,e,n){var i=r.length,a=t.keepHeader,s=t.keepTail;if(!(i<=1||i===2&&a&&s)){var o=G6.parity,l=function(E){return E.forEach(n.show),E},c=2,u=r.slice(),h=r.slice(),d=Math.min.apply(Math,(0,G.ev)([1],(0,G.CR)(r.map(function(E){return E.getBBox().width})),!1));if(e.type==="linear"&&(v0(e)||Fx(e))){var f=Ex(r[0]).left,v=Ex(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(V6(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 Y6(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,E){var O=Array.isArray(y)?y[E]: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 H6(r){var t=r.type,e=r.labelDirection;return t==="linear"&&v0(r)?e==="negative"?"bottom":"top":"middle"}function X6(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=qr((a=t.wordWrapWidth)!==null&&a!==void 0?a:50,[i]),f=r.map(function(E){return E.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=H6(e),y=function(E){return r.forEach(function(O,P){var R=Array.isArray(E)?E[P]:E;n.wrap(O,d,R,p)})};if(!(v>o)){if(e.type==="linear"&&v0(e)){if(y(o),g())return}else for(var b=v;b<=o;b++)if(y(b),g())return;c&&y(f)}}var K6=new Map([["hide",U6],["rotate",Y6],["ellipsis",Z6],["wrap",X6]]);function Q6(r,t,e){return t.labelOverlap.length<1?!1:e==="hide"?!GD(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 q6(r,t,e,n){var i=t.labelOverlap,a=i===void 0?[]:i;a.length&&a.forEach(function(s){var o=s.type,l=K6.get(o);Q6(r,t,o)&&(l==null||l(r,s,t,n,e))})}function J6(){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 Yx(r){for(var t=r;t<0;)t+=360;return Math.round(t%360)}function m0(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 $6(r){var t=(r+360)%180;return Er(t,-90,90)||(t+=180),t}function t5(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=Fh(r.value,e);return i==="horizontal"?0:(i==="perpendicular"?s=m0([1,0],o):s=m0([l[0]<0?-1:1,0],l),$6(Rx(s)))}function Hx(r,t,e){var n=e.type,i=e.labelAlign,a=Co(r,e),s=Yx(t),o=Yx(Rx(m0([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?(Er(s,0,90,!1,!0)||Er(s,0,90)||Er(s,270,360))&&(l="start"):o===90?Er(s,0,90,!1,!0)?l="start":(Er(s,90,180)||Er(s,270,360))&&(l="end"):o===270?Er(s,0,90,!1,!0)?l="end":(Er(s,90,180)||Er(s,270,360))&&(l="start"):o===180&&(s===90?l="start":(Er(s,0,90)||Er(s,270,360))&&(l="end")):i==="parallel"?Er(o,0,180,!0)?c="top":c="bottom":i==="horizontal"?Er(o,90,270,!1)?l="end":(Er(o,270,360,!1)||Er(o,0,90))&&(l="start"):i==="perpendicular"&&(Er(o,90,270)?l="end":l="start"),{textAlign:l,textBaseline:c}}function e5(r,t,e){t.setLocalEulerAngles(r);var n=t.__data__.value,i=Hx(n,r,e),a=t.querySelector(cn.labelItem.class);a&&Kx(a,i)}function Xx(r,t,e){var n=e.showTick,i=e.tickLength,a=e.tickDirection,s=e.labelDirection,o=e.labelSpacing,l=t.indexOf(r),c=qr(o,[r,l,t]),u=(0,G.CR)([Co(r.value,e),J6(s,a)],2),h=u[0],d=u[1],f=d===1?qr(n?i:0,[r,l,t]):0,v=(0,G.CR)(Fl(Ma(h,c+f),zh(r.value,e)),2),g=v[0],p=v[1];return{x:g,y:p}}function n5(r,t,e,n){var i=n.labelFormatter,a=fe(i)?function(){return Sa(qr(i,[r,t,e,Co(r.value,n)]))}:function(){return Sa(r.label||"")};return a}function r5(r,t,e,n){var i=n.labelRender,a=(br(n,"endPos.0",400)-br(n,"startPos.0",0))/e.length,s=fe(i)?qr(i,[r,t,e,Co(r.value,n)]):r.label||"",o=R6(s)||30;return function(){return BI(s,{width:a,height:o})}}function Kx(r,t){["text","html"].includes(r.nodeName)&&r.attr(t)}function i5(r,t){q6(this.node().childNodes,r,t,{hide:ji,show:Dl,rotate:function(e,n){e5(+n,e,r)},ellipsis:function(e,n,i){e&&i0(e,n||1/0,i)},wrap:function(e,n,i){e&&L6(e,n,i)},getTextShape:function(e){return e.querySelector("text")}})}function Qx(r,t,e,n,i){var a=e.indexOf(t),s=i.labelRender,o=ve(r).append(s?r5(t,a,e,i):n5(t,a,e,i)).attr("className",cn.labelItem.name).node(),l=(0,G.CR)(wa(Ix(n,[t,a,e])),2),c=l[0],u=l[1],h=u.transform,d=(0,G._T)(u,["transform"]);Gx(o,h);var f=t5(t,o,i);return o.getLocalEulerAngles()||o.setLocalEulerAngles(f),Kx(o,(0,G.pi)((0,G.pi)({},Hx(t.value,f,i)),c)),r.attr(d),o}function a5(r,t,e,n,i){var a=d0(t,e.labelFilter),s=ke(e,"label"),o,l=r.selectAll(cn.label.class).data(a,function(c,u){return u}).join(function(c){return c.append("g").attr("className",cn.label.name).transition(function(u){Qx(this,u,t,s,e);var h=Xx(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(cn.labelItem.class),d=Qx(this,u,t,s,e),f=lI(h,d,n.update),v=Xx(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=Bh(this.childNodes[0],n.exit);return Ao(h,function(){return ve(u).remove()}),h}),o}).transitions();return sI(l,function(){i5.call(r,e,i)}),l}function qx(r,t){return f0(r,t.tickDirection,t)}function s5(r,t){var e=(0,G.CR)(r,2),n=e[0],i=e[1];return[[0,0],[n*t,i*t]]}function o5(r,t,e,n,i){var a=i.tickLength,s=(0,G.CR)(s5(n,qr(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 l5(r,t,e,n,i){var a=i.tickFormatter,s=qx(t.value,i),o="line";return fe(a)&&(o=function(){return qr(a,[t,e,n,s])}),r.append(o).attr("className",cn.tickItem.name)}function c5(r,t,e,n,i,a,s){var o=qx(r.value,a),l=o5(r,t,e,o,a),c=l.x1,u=l.x2,h=l.y1,d=l.y2,f=(0,G.CR)(wa(Ix(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 Jx(r,t,e,n,i,a){var s=l5(ve(this),r,t,e,n);c5(r,t,e,s,this,n,i);var o=(0,G.CR)(zh(r.value,n),2),l=o[0],c=o[1];return Wi(this,{transform:"translate(".concat(l,", ").concat(c,")")},a)}function u5(r,t,e,n){var i=d0(t,e.tickFilter),a=ke(e,"tick");return r.selectAll(cn.tick.class).data(i,function(s){return s.id||s.label}).join(function(s){return s.append("g").attr("className",cn.tick.name).transition(function(o,l){return Jx.call(this,o,l,i,e,a,!1)})},function(s){return s.transition(function(o,l){return this.removeChildren(),Jx.call(this,o,l,i,e,a,n.update)})},function(s){return s.transition(function(){var o=this,l=Bh(this.childNodes[0],n.exit);return Ao(l,function(){return o.remove()}),l})}).transitions()}function h5(r,t,e){var n=e.titlePosition,i=n===void 0?"lb":n,a=e.titleSpacing,s=kh(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],E=y[1],O=(0,G.CR)(xr(a),4),P=O[0],R=O[1],F=O[2],I=O[3];if(["start","end"].includes(i)&&e.type==="linear"){var V=e.startPos,Y=e.endPos,J=(0,G.CR)(i==="start"?[V,Y]:[Y,V],2),$=J[0],ot=J[1],ct=Px([-ot[0]+$[0],-ot[1]+$[1]]),ft=(0,G.CR)(Ma(ct,P),2),Nt=ft[0],Ot=ft[1];return{x:$[0]+Nt,y:$[1]+Ot}}return s.includes("t")&&(E-=f+p+P),s.includes("r")&&(b+=d+g+R),s.includes("l")&&(b-=d+g+I),s.includes("b")&&(E+=f+p+F),{x:b,y:E}}function d5(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 $x(r,t,e,n,i){var a=ke(n,"title"),s=(0,G.CR)(wa(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||d5(r.node(),o.direction,o.position);r.styles((0,G.pi)((0,G.pi)({},o),{transformOrigin:u})),Gx(r.node(),d);var f=h5(ve(e._offscreen||e.querySelector(cn.mainGroup.class)),t,n),v=f.x,g=f.y,p=Wi(t.node(),{transform:"translate(".concat(v,", ").concat(g,")")},i);return p}function f5(r,t,e,n){var i=e.titleText;return r.selectAll(cn.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 Sa(i)}).attr("className",cn.title.name).transition(function(){return $x(ve(this),r,t,e,n.enter)})},function(a){return a.transition(function(){return $x(ve(this),r,t,e,n.update)})},function(a){return a.remove()}).transitions()}function tE(r,t,e,n){var i=r.showLine,a=r.showTick,s=r.showLabel,o=t.maybeAppendByClassName(cn.lineGroup,"g"),l=Qr(i,o,function(f){return O6(f,r,n)})||[],c=t.maybeAppendByClassName(cn.tickGroup,"g"),u=Qr(a,c,function(f){return u5(f,e,r,n)})||[],h=t.maybeAppendByClassName(cn.labelGroup,"g"),d=Qr(s,h,function(f){return a5(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 v5=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,l0)||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=a6(o,h).filter(function(P){var R=P.value;return!(d&&R>d[0]&&R<d[1])}),v=fx(i===void 0?l:i),g=ve(n).maybeAppendByClassName(cn.gridGroup,"g"),p=Qr(u,g,function(P){return P6(P,f,e,v)})||[],y=ve(n).maybeAppendByClassName(cn.mainGroup,"g");s&&(!this.initialized&&v.enter||this.initialized&&v.update)&&tE(e,ve(this.offscreenGroup),f,fx(!1));var b=tE(e,ve(y.node()),f,v),E=ve(n).maybeAppendByClassName(cn.titleGroup,"g"),O=Qr(c,E,function(P){return f5(P,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(P){return!!P})},t}(Ln);function eE(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 y0(r,t){return+r.toPrecision(t)}function Oj(r){return r.toLocaleString()}function Cj(r){return r.toExponential()}function Nj(r,t){return t===void 0&&(t=0),Math.abs(r)<1e3?String(r):"".concat(y0(r/1e3,t).toLocaleString(),"K")}var kj=function(r,t,e){return r<0&&Number.isFinite(r)?t:e},Pj=function(r,t,e){return r>0&&Number.isFinite(r)?t:e},Rj=function(r,t){return r*t},Lj=function(r,t){return r/2+(t||0)/2},b0=function(r){return r};class nE{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 x0(r,t){return t-r?e=>(e-r)/(t-r):e=>.5}function Wh(r,...t){return t.reduce((e,n)=>i=>e(n(i)),r)}function g5(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 p5=S(75196),m5=S.n(p5);function E0(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 y5(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=E0(s,a,t+1/3),l=E0(s,a,t),c=E0(s,a,t-1/3);return[o*255,l*255,c*255,i]}function rE(r){const t=m5().get(r);if(!t)return null;const{model:e,value:n}=t;return e==="rgb"?n:e==="hsl"?y5(n):null}const Gh=(r,t)=>e=>r*(1-e)+t*e,b5=(r,t)=>{const e=rE(r),n=rE(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})`}},x5=(r,t)=>typeof r=="number"&&typeof t=="number"?Gh(r,t):typeof r=="string"&&typeof t=="string"?b5(r,t):()=>r,E5=(r,t)=>{const e=Gh(r,t);return n=>Math.round(e(n))};function w5(r){return r===null}function iE(r){return!Te(r)&&!w5(r)&&!Number.isNaN(r)}const w0=Math.sqrt(50),S0=Math.sqrt(10),M0=Math.sqrt(2);function Vh(r,t,e){const n=(t-r)/Math.max(0,e),i=Math.floor(Math.log(n)/Math.LN10),a=n/is(10,i);return i>=0?(a>=w0?10:a>=S0?5:a>=M0?2:1)*is(10,i):-is(10,-i)/(a>=w0?10:a>=S0?5:a>=M0?2:1)}function _j(r,t,e){const n=Math.abs(t-r)/Math.max(0,e);let i=is(10,Math.floor(Math.log(n)/Math.LN10));const a=n/i;return a>=w0?i*=10:a>=S0?i*=5:a>=M0&&(i*=2),t<r?-i:i}const S5=(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=Vh(s,o,e),l>0?(s=Math.floor(s/l)*l,o=Math.ceil(o/l)*l,l=Vh(s,o,e)):l<0&&(s=Math.ceil(s*l)/l,o=Math.floor(o*l)/l,l=Vh(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 M5(r,t){const e=t<r?t:r,n=r>t?r:t;return i=>Math.min(Math.max(e,i),n)}const A5=(r,t,e)=>{const[n,i]=r,[a,s]=t;let o,l;return n<i?(o=x0(n,i),l=e(a,s)):(o=x0(i,n),l=e(s,a)),Wh(l,o)},T5=(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]=x0(o[c],o[c+1]),a[c]=e(l[c],l[c+1]);return c=>{const u=g5(r,c,1,n)-1,h=i[u],d=a[u];return Wh(d,h)(c)}},aE=(r,t,e,n)=>(Math.min(r.length,t.length)>2?T5:A5)(r,t,n?E5:e);class O5 extends nE{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Gh,tickCount:5}}map(t){return iE(t)?this.output(t):this.options.unknown}invert(t){return iE(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 S5}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?M5(i[0],i[a-1]):b0}composeOutput(t,e){const{domain:n,range:i,round:a,interpolate:s}=this.options,o=aE(n.map(t),i,s,a);this.output=Wh(o,e,t)}composeInput(t,e,n){const{domain:i,range:a}=this.options,s=aE(a,i.map(t),Gh);this.input=Wh(e,n,s)}}const C5=(r,t,e)=>{let n,i,a=r,s=t;if(a===s&&e>0)return[a];let o=Vh(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 O5{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:x5,tickMethod:C5,tickCount:5}}chooseTransforms(){return[b0,b0]}clone(){return new Wl(this.options)}}function sE({map:r,initKey:t},e){const n=t(e);return r.has(n)?r.get(n):e}function N5({map:r,initKey:t},e){const n=t(e);return r.has(n)?r.get(n):(r.set(n,e),e)}function k5({map:r,initKey:t},e){const n=t(e);return r.has(n)&&(e=r.get(n),r.delete(n)),e}function P5(r){return typeof r=="object"?r.valueOf():r}class oE extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=P5,t!==null)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(sE({map:this.map,initKey:this.initKey},t))}has(t){return super.has(sE({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(N5({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(k5({map:this.map,initKey:this.initKey},t))}}const A0=Symbol("defaultUnknown");function lE(r,t,e){for(let n=0;n<t.length;n+=1)r.has(t[n])||r.set(e(t[n]),n)}function cE(r){const{value:t,from:e,to:n,mapper:i,notFoundReturn:a}=r;let s=i.get(t);if(s===void 0){if(a!==A0)return a;s=e.push(t)-1,i.set(t,s)}return n[s%n.length]}function uE(r){return r instanceof Date?t=>`${t}`:typeof r=="object"?t=>JSON.stringify(t):t=>t}class T0 extends nE{getDefaultOptions(){return{domain:[],range:[],unknown:A0}}constructor(t){super(t)}map(t){return this.domainIndexMap.size===0&&lE(this.domainIndexMap,this.getDomain(),this.domainKey),cE({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return this.rangeIndexMap.size===0&&lE(this.rangeIndexMap,this.getRange(),this.rangeKey),cE({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=uE(e),this.rangeKey=uE(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 T0(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 R5(r){const t=Math.min(...r);return r.map(e=>e/t)}function L5(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 _5(r){return Math.round(r*1e12)/1e12}function D5(r){const{domain:t,range:e,paddingOuter:n,paddingInner:i,flex:a,round:s,align:o}=r,l=t.length,c=L5(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=R5(c),b=y.reduce(($,ot)=>$+ot),E=p/b,O=new oE(t.map(($,ot)=>{const ct=y[ot]*E;return[$,s?Math.floor(ct):ct]})),P=new oE(t.map(($,ot)=>{const ft=y[ot]*E+g;return[$,s?Math.floor(ft):ft]})),R=Array.from(P.values()).reduce(($,ot)=>$+ot),I=(d-(R-R/l*i))*o,V=u+I;let Y=s?Math.round(V):V;const J=new Array(l);for(let $=0;$<l;$+=1){J[$]=_5(Y);const ot=t[$];Y+=P.get(ot)}return{valueBandWidth:O,valueStep:P,adjustedRange:J}}function I5(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 D5(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,E)=>d+E*u);return{valueStep:u,valueBandWidth:h,adjustedRange:y}}class O0 extends T0{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:A0,flex:[]}}constructor(t){super(t)}clone(){return new O0(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}=I5({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 B5=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 rr({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}(yn),F5=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 rr),n.areasGroup=n.appendChild(new rr),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}(yn);function z5(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 E=[0,0];E=c0(l,o),E=Ma(E,t);var O=zl(p,o),P=zl(p,l),R=O+P;R!==0&&(O/=R,P/=R);var F=Ma(E,-O),I=Ma(E,P);d=Fl(p,F),h=Fl(p,I),h=Ys(h,Hs(l,p)),h=Hs(h,Ys(l,p)),F=c0(h,p),F=Ma(F,-O/P),d=Fl(p,F),d=Ys(d,Hs(o,p)),d=Hs(d,Ys(o,p)),I=c0(p,d),I=Ma(I,P/O),h=Fl(p,I),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 j5(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=z5(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 Z5(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 Uh(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];Wn(a,e.slice(-2))||e.push.apply(e,(0,G.ev)([],(0,G.CR)(a),!1))}var s=j5(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 C0(r,t,e){var n=ho(r);return n.push(["L",t,e],["L",0,e],["Z"]),n}function W5(r,t,e,n){return r.map(function(i){return C0(t?Uh(i):Gl(i),e,n)})}function G5(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=C0(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 V5(r,t,e){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=Uh(a),o=void 0;if(i===0)o=C0(s,t,e);else{var l=r[i-1],c=Uh(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 U5=function(r,t){if(Wr(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}},Y5=function(r,t){if(Wr(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 hE(r){return r.length===0?[0,0]:[ec(U5(r,function(t){return ec(t)||0})),nc(Y5(r,function(t){return nc(t)||0}))]}function dE(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 H5=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?dE(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=ke(this.attributes,"area"),l=ke(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=Z5(u,{type:"line",x:d,y:f}),g=[];if(o){var p=this.baseline;a?g=s?V5(v,c,p):G5(v,c,p):g=W5(v,s,c,p)}return{lines:v.map(function(y,b){return(0,G.pi)({stroke:e.getColor(b),d:s?Uh(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=ke(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=dE(c));var u=this.createScales(c),h=u.x,d=u.y,f=(0,G.CR)(hE(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(E,O){return E.map(function(P,R){var F=y/c.length,I=function(){return{x:h.map(R)+F*O,y:P>=0?d.map(P):d.map(0),width:F,height:p.map(Math.abs(P))}},V=function(){return{x:h.map(R),y:d.map(P),width:y,height:p.map(b[O][R])}};return(0,G.pi)((0,G.pi)({fill:e.getColor(O)},n),a?V():I())})})}},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){$D(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 F5({className:o,style:l}):new B5({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 Wr(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)(hE(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 O0({domain:e[0].map(function(b,E){return E}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y}},t.tag="sparkline",t}(Ln),fE={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},vE={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},gE={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},sa=Zi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),$a=Zi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),X5=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($a.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($a.iconLine,"-1"),"line").styles((0,G.pi)({x1:g,x2:g,y1:y,y2:b},h)),v.maybeAppendByClassName("".concat($a.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),K5=function(r){(0,G.ZT)(t,r);function t(e){return r.call(this,e,gE)||this}return t.prototype.renderLabel=function(e){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.showLabel,l=ke(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)(wa(g,[]),2),y=p[0],b=p[1],E=ve(e).maybeAppendByClassName($a.labelGroup,"g").styles(b),O=(0,G.pi)((0,G.pi)({},vE),y),P=O.text,R=(0,G._T)(O,["text"]);Qr(!!o,E,function(F){n.label=F.maybeAppendByClassName($a.label,"text").styles((0,G.pi)((0,G.pi)({},R),{x:a+u,y:s+d,transform:f,transformOrigin:v,text:"".concat(P)})),n.label.on("mousedown",function(I){I.stopPropagation()}),n.label.on("touchstart",function(I){I.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},fE),ke(this.attributes,"icon")),c=this.attributes.iconShape,u=c===void 0?function(){return new X5({style:l})}:c,h=ve(e).maybeAppendByClassName($a.iconGroup,"g");h.selectAll($a.icon.class).data([u]).join(function(d){return d.append(typeof u=="string"?u:function(){return u(o)}).attr("className",$a.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),Q5=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(gE,"handle")),Mo(fE,"handleIcon")),Mo(vE,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(i){return function(a){a.stopPropagation(),n.target=i,n.prevPos=n.getOrientVal(eE(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(eE(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 Qn("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=ke(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)(xr(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(sa.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=ke(this.attributes,"track");this.trackShape=ve(e).maybeAppendByClassName(sa.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(sa.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(sa.sparklineGroup,"g");Qr(o==="horizontal",l,function(c){var u=(0,G.pi)((0,G.pi)({},n.sparklineStyle),{x:a,y:s});c.maybeAppendByClassName(sa.sparkline,function(){return new H5({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(sa.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 K5({style:e.getHandleStyle(d)})}).each(function(h){var d=h.type;this.attr("class","".concat(sa.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(sa.foreground,"g");var l=ke(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(sa.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",sa.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 y0(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 y0(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=ke(this.attributes,"handle"),u=ke(c,"label"),h=c.spacing,d=this.getHandleSize(),f=this.clampValues(),v=e==="start"?f[0]:f[1],g=o(v),p=new $v({style:(0,G.pi)((0,G.pi)((0,G.pi)({},u),this.inferTextStyle(e)),{text:g})}),y=p.getBBox(),b=y.width,E=y.height;if(p.destroy(),!l){if(a==="value")return{text:g,x:0,y:-E-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 P=0,R=0,F=this.availableSpace,I=F.width,V=F.height,Y=this.calcSelectionArea()[1],J=Y.x,$=Y.y,ot=Y.width,ct=Y.height,ft=h+d;if(s==="horizontal"){var Nt=ft+b/2;if(e==="start"){var Ot=J-ft-b;P=Ot>0?-Nt:Nt}else{var mt=I-J-ot-ft>b;P=mt?Nt:-Nt}}else{var yt=ft,Rt=E+ft;e==="start"?R=$-d>E?-Rt:yt:R=V-($+ct)-d>E?Rt:-yt}return{x:P,y:R,text:g}},t.prototype.getHandleLabelStyle=function(e){var n=ke(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=ke(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 Qn(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),q5={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},N0=Zi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),J5=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e,q5)||this;return n.point=[0,0],n.group=n.appendChild(new rr({})),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)(xr(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 Cr(h[0]-c,h[1]-s,d[0]+o-h[0]+c,d[1]+l-h[1]+s),v=this.getPath(n,f),g=ke(this.attributes,"background");this.background=ve(this.group).maybeAppendByClassName(N0.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=ke(this.attributes,"label"),s=(0,G.CR)(wa(a),2),o=s[0],l=s[1],c=o.text,u=(0,G._T)(o,["text"]);if(this.label=ve(this.group).maybeAppendByClassName(N0.labelGroup,"g").styles(l),!!i){var h=this.label.maybeAppendByClassName(N0.label,function(){return Sa(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=DI.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,E=v/Math.abs(v),O=n*E,P=O/2,R=O*Math.sqrt(3)/2*i,F=(0,G.CR)([p,p+b-P,p+b,p+b+P,y],5),I=F[0],V=F[1],Y=F[2],J=F[3],$=F[4];return a?(this.point=[Y,c-R],[["L",I,c],["L",V,c],["L",Y,c-R],["L",J,c],["L",$,c]]):(this.point=[l+R,Y],[["L",l,I],["L",l,V],["L",l+R,Y],["L",l,J],["L",l,$]])},t.prototype.applyVisibility=function(){var e=this.attributes.visibility;e==="hidden"?ji(this):Dl(this)},t.prototype.bindEvents=function(){this.label.on(De.BOUNDS_CHANGED,this.renderBackground)},t.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},t}(Ln),$5=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 rr({})),n}return Object.defineProperty(t.prototype,"padding",{get:function(){return xr(this.style.padding)},enumerable:!1,configurable:!0}),t.prototype.renderLabel=function(){var e=this.style,n=e.label,i=e.value,a=ke(this.attributes,"label");ve(this.label).maybeAppend(".label",function(){return Sa(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=ke(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),t4=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 xr(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=ke(this.attributes,"select"),d=ke(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(E){return E.value===e.currentValue}),p=(0,G.pi)({x:a+f[3]},d);ve(this.select).selectAll(".placeholder").data(g?[]:[1]).join(function(E){return E.append("text").attr("className","placeholder").styles(p).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(E){return E.styles(p)},function(E){return E.remove()});var y=ke(this.attributes,"optionLabel"),b=(0,G.pi)({x:a+f[3]},y);ve(this.select).selectAll(".value").data(g?[g]:[]).join(function(E){return E.append(function(O){return Sa(O.label)}).attr("className","value").styles(b).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(E){return E.styles(b)},function(E){return E.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=ke(this.attributes,"dropdown"),v=ke(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(E){return new $5({className:"dropdown-item",style:(0,G.pi)((0,G.pi)((0,G.pi)({},E),v),{width:l-g[1]-g[3],selected:E.value===e.currentValue,onClick:function(O,P,R){e.setValue(O),h==null||h(O,P,R),e.dispatchEvent(new Qn("change",{detail:{value:O,option:P,item:R}})),ji(e.dropdown)}})})}).each(function(E,O){var P,R=(P=this.parentNode)===null||P===void 0?void 0:P.children,F=R.reduce(function(I,V,Y){return Y<O&&(I+=V.getBBox().height),I},0);this.attr("transform","translate(".concat(g[3],", ").concat(g[0]+F,")"))})},function(b){return b.update(function(E){return{selected:E.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):Dl(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 rr({})),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 xr(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=ke(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 J5({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 ni({style:{fill:t,d:"M ".concat(r,",").concat(r," L -").concat(r,",0 L ").concat(r,",-").concat(r," Z"),transformOrigin:"center"}})},e4=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),n4=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),r4=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),i4=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),a4=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),s4=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),o4=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),pE=function(r){return[[-r/2,-r/2],[-r/2,r/2],[r/2,r/2]]},l4=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:pE(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),c4=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:pE(l).map(function(p){var y=(0,G.CR)(p,2),b=y[0],E=y[1];return[b+i,E+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),u4=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),k0=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 xr(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=Gv(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 t4({style:h})}).attr("className","speed").each(function(){this.update(h)})},t.tag="SpeedSelect",t}(Gi),P0=function(r){(0,G.ZT)(t,r);function t(e){var n=r.call(this,e)||this;return n.icon=n.appendChild(new rr({})),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),R0=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",i4],["pause",a4]],n}return t}(P0),L0=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",s4],["value",o4]],n}return t}(P0),_0=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",l4],["column",c4]],n}return t}(P0),h4={reset:e4,speed:k0,backward:n4,playPause:R0,forward:r4,selectionType:L0,chartType:_0,split:u4},d4=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 rr({})),n}return Object.defineProperty(t.prototype,"padding",{get:function(){return xr(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=ke(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(E,O){return E.length&&O.length?E.concat.apply(E,(0,G.ev)(["split"],(0,G.CR)(O),!1)):E.concat.apply(E,(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(E,O){var P,R=h4[E],F={x:l+O*(s+o)+b,y:c+h/2,size:s};if(R===k0?(F.speed=e.attributes.speed,F.onSelect=function(V){return e.handleFunctionChange(E,{value:V})}):[R0,L0,_0].includes(R)?(F.onChange=function(V){return e.handleFunctionChange(E,{value:V})},R===R0&&(F.type=e.attributes.state==="play"?"pause":"play"),R===L0&&(F.type=e.attributes.selectionType==="range"?"value":"range"),R===_0&&(F.type=e.attributes.chartType==="line"?"column":"line")):F.onClick=function(){return e.handleFunctionChange(E,{value:E})},R===k0){var I=(P=e.ownerDocument)===null||P===void 0?void 0:P.defaultView;I&&(e.speedSelect=new R({style:(0,G.pi)((0,G.pi)({},F),{zIndex:100})}),I.appendChild(e.speedSelect))}else e.functions.appendChild(new R({style:F}))})},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),f4=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),v4=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=ke(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=ke(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=ke(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 g4(r,t){return typeof r=="number"?mE(r):p4(r,t)}function p4(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?Fr(e,`HH:mm
YYYY-MM-DD`):Fr(e,"HH:mm");case"half-day":return e.getHours()<12?`AM
`.concat(Fr(e,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(e.getDate())?Fr(e,`DD
YYYY-MM`):Fr(e,"DD");case"week":return e.getDate()<=7?Fr(e,`DD
YYYY-MM`):Fr(e,"DD");case"month":return[0,6].includes(e.getMonth())?Fr(e,`MM\u6708
YYYY`):Fr(e,"MM\u6708");case"season":return[0].includes(e.getMonth())?Fr(e,`MM\u6708
YYYY`):Fr(e,"MM\u6708");case"year":return Fr(e,"YYYY");default:return Fr(e,"YYYY-MM-DD HH:mm")}}function mE(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 m4=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 v5({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),n.timeline=n.appendChild(new Q5({style:{onChange:function(h){n.handleSliderChange(h)}}})),n.controller=n.appendChild(new d4({})),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 Cr(n,i+ +s-l,+a,l),h,d=0;o==="chart"?(d=35,h=new Cr(n,i+c-d,+a,d)):h=new Cr;var f=o==="time"?10:c,v=new Cr(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 v4({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=ke(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 f4({})},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(P){if(v)return v(P);var R=n.getDatumByRatio(P).time;return typeof R=="number"?mE(R):Fr(R,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y);var E=c==="range"?5:0,O=h.map(function(P){var R=P.value;return R});return(0,G.pi)({handleIconOffset:E,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=ke(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):g4(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=ke(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(E){var O=E.time;return O===h}),v=i.findIndex(function(E){var O=E.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(E){var O=(0,G.CR)(E.sort(function(I,V){return I-V}),2),P=O[0],R=O[1],F=function(I){return kn(I,0,a)};return R>a?l==="value"?[0,0]:c==="acc"?[F(P),F(P)]:[0,F(R-P)]:P<0?c==="acc"?[0,F(R)]:[F(P+a-R),a]:[F(P),F(R)]},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 y4(r){return r instanceof Date}var b4=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())})},x4=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 E4=["timestamp","time","date","datetime"];class Yh extends hr{get padding(){return ai(this.options.padding)}constructor(t,e){super(t,Object.assign({},Yh.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=yE(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=x4(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=(Wr(p)?p:[p,p]).map(b=>y4(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 m4({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]=Rh({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 b4(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=yE(this.originalData);n.forEach(c=>{const u=`${c}s`;o[u]=(this.originalData[u]||[]).filter(h=>{const d=i(h);return!!bE(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);bE(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()}}Yh.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:r=>w4(r,E4,void 0),loop:!1};const yE=r=>{const{nodes:t=[],edges:e=[],combos:n=[]}=r;return{nodes:[...t],edges:[...e],combos:[...n]}},bE=(r,t)=>{if(ie(t))return r===t;const[e,n]=t;return r>=e&&r<=n},w4=(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};var S4=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 xE={fill:"#1D2129",wordWrap:!0,maxLines:1,textOverflow:"ellipsis",textBaseline:"top",textAlign:"start",x:0},M4=Object.assign(Object.assign({},xE),{fillOpacity:.9,fontSize:16,fontWeight:"bold"}),A4=Object.assign(Object.assign({},xE),{fillOpacity:.65,fontSize:12,fontWeight:"normal"}),T4={align:"left",spacing:8,size:44,padding:[16,24,0,24]},D0="title",EE="subtitle";class O4 extends hr{get padding(){return ai(this.options.padding)}constructor(t,e){const n=Object.assign({},T4,e);super(t,n),this.onRender=()=>{const i=this.updateCanvas();this.renderTitle(i)},this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_RENDER,this.onRender),t.on(Kt.AFTER_ANIMATE,this.onRender)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_RENDER,this.onRender),t.off(Kt.AFTER_ANIMATE,this.onRender)}destroy(){var t,e;this.unbindEvents(),(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||e.remove(),super.destroy()}updateCanvas(){const{size:t,className:e,align:n}=this.options,[i]=this.context.canvas.getSize(),[a=0,,s=0]=this.padding,o=t+a+s;if(this.canvas){const{width:l,height:c}=this.canvas.getConfig();(i!==l||o!==c)&&this.canvas.resize(i,o)}else{const l={left:"left-top",center:"top",right:"right-top"},[c,u]=Rh({width:i,height:o,placement:l[n]||l.left,className:"title-canvas",graphCanvas:this.context.canvas});e&&c.classList.add(e),this.container=c,this.canvas=u}return this.canvas}renderTitle(t){const e=new C4({options:this.options,ctx:this.context});t.removeChildren(),e.getTitle().forEach(n=>{n&&t.appendChild(n)})}}class C4{get padding(){return ai(this.options.padding)}constructor(t){const{options:e,ctx:n}=t;this.options=e,this.context=n}getTitle(){const t=this.options,e=D0,n=t[e],i=EE,a=t[i],{spacing:s=44,padding:o,align:l}=t,c=S4(t,[typeof e=="symbol"?e:e+"",typeof i=="symbol"?i:i+"","spacing","padding","align"]),u=n,h=a,d=_n(c,D0),f=_n(c,EE),[v]=this.context.graph.getSize(),[g=0,p=0,,y=0]=this.padding,b=v,E=b-y-p;let O=null,P=y,R="left";switch(l){case"left":P=y,R="left";break;case"center":P=b/2,R="center";break;case"right":P=b-p,R="right";break;default:P=y,R="left"}const F=new ia({className:D0,style:Object.assign(Object.assign(Object.assign(Object.assign({},M4),{wordWrapWidth:E-5,x:P,y:g,textAlign:R}),d),{text:u})}),I=F.getBBox();return h&&(O=new ia({className:"subTitle",style:Object.assign(Object.assign(Object.assign(Object.assign({},A4),{wordWrapWidth:E-5,x:P,y:I.height+s+g,textAlign:R}),f),{text:h})})),[F,O]}}function N4(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 k4=`
.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;
}
`,P4=`
<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 wE=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 Hh extends hr{constructor(t,e){super(t,Object.assign({},Hh.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),Vv("g6-toolbar-css","style",{},k4,document.head),Vv("g6-toolbar-svgicon","div",{display:"none"},P4),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return wE(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,N4(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return wE(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("")})}}Hh.defaultOptions={position:"top-left"};function I0(r){var t=document.createElement("div");t.innerHTML=r;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function R4(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 L4=R4,SE=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 B0(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 ME={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function _4(r){var t;r===void 0&&(r="");var e=B0(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},ME),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)"},ME),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 D4=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=B0(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:_4(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 I0(L4(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=I0(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:SE(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=B0(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,SE(f,d);var v=this.element.querySelector(".".concat(u.LIST));v?v.replaceWith(f):h.appendChild(f)}HD(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],E=y[1];d=[g+(u/2+a[0])*b,p+(h/2+a[1])*E]}),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,E=c.y,O=c.width,P=c.height,R={left:g<b,right:g+d>b+O,top:p<E,bottom:p+f>E+P},F=[];u.split("-").forEach(function(V){R[V]?F.push(y[V]):F.push(V)});var I=F.join("-");return this.getRelativeOffsetFromCursor(I)},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 Cr(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),AE=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 Xh extends hr{constructor(t,e){super(t,Object.assign({},Xh.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=>AE(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=>AE(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 D4({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()}}Xh.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var 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())})};let No;function OE(r,t){return No||(No=document.createElement("canvas")),No.width=r,No.height=t,No.getContext("2d").clearRect(0,0,r,t),No}function I4(r,t,e,n){return TE(this,void 0,void 0,function*(){const i=OE(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 B4(r,t,e,n){return TE(this,void 0,void 0,function*(){const i=OE(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 F4=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())})},z4=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 Kh extends hr{constructor(t,e){super(t,Object.assign({},Kh.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 F4(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=z4(n,["width","height","text","imageURL"]);Object.keys(l).forEach(u=>{u.startsWith("background")&&(this.$element.style[u]=t[u])});const c=o?yield B4(i,a,o,l):yield I4(i,a,s,l);this.$element.style.backgroundImage=`url(${c})`})}destroy(){super.destroy(),this.$element.remove()}}Kh.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};const j4=["#7E92B5","#F4664A","#FFBE3A"],Z4={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},W4={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function CE(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=j4,nodePaletteOptions:d=Z4,edgeColor:f,edgeColorDisabled:v,edgePaletteOptions:g=W4,comboColor:p,comboColorDisabled:y,comboStroke:b,comboStrokeDisabled:E,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,badgeBackgroundOpacity:1,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:E,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 G4=CE({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"}),V4=CE({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 ts extends Vf{beforeDraw(t,e){return t}afterLayout(t,e){}}class U4 extends ts{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 Qh(r,t){return Object.keys(r).every(e=>r[e]===t[e])}class Y4 extends ts{beforeDraw(t,e){if(e.stage==="visibility"||!this.context.model.model.hasTreeStructure(dn))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(Kr(l)){const c=n.getDescendantsData(o),u=c.map(At),{internal:h,external:d}=vv(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}=vv(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 NE=(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 H4 extends ts{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(NE(e,"add","node",t),Kr(t))return;const n=At(t);NE(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(ii))return t;const{add:{nodes:i,edges:a},update:{nodes:s}}=t,o=new Map,l=new Map;i.forEach((u,h)=>{Kr(u)&&o.set(h,u)}),a.forEach(u=>{if(e.getElementType(u.source)!=="node")return;const h=e.getNodeData(u.source);Kr(h)&&o.set(u.source,h)}),s.forEach((u,h)=>{const d=this.getElement(h);if(!d)return;const f=d.attributes.collapsed;Kr(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,ii).some(Kr)){ui(t,"remove","node",u);return}this.handleExpand(u,t)}),t}}const F0=new WeakMap;function Fj(r,t,e){F0.has(r)||F0.set(r,{});const n=F0.get(r);if(!n[t])return n[t]=e,!0;const i=n[t];return kE(i,e)?!1:(n[t]=e,!0)}const kE=(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(!kE(s,o,e-1))return!1}else if(s!==o)return!1}return!0};function X4(r,t,e){Of[r][t]&&Xr.warn(`The extension ${t} of ${r} has been registered before, and will be overridden.`),Object.assign(Of[r],{[t]:e})}var PE=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],E=function(){var P=(0,La.Z)((0,Tr.Z)().mark(function R(F){var I,V,Y,J,$,ot;return(0,Tr.Z)().wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(v){ct.next=2;break}if(I=F.timeStamp-g,V=Zr([F.clientX,F.clientY],p),!(I<=n.dragndropPluginOptions.dragstartTimeThreshold||V<=n.dragndropPluginOptions.dragstartDistanceThreshold)){ct.next=1;break}return ct.abrupt("return");case 1:F.type="dragstart",f.dispatchEvent(F),v=!0;case 2:if(F.type="drag",F.dx=F.clientX-b[0],F.dy=F.clientY-b[1],f.dispatchEvent(F),b=[F.clientX,F.clientY],d){ct.next=4;break}return Y=n.dragndropPluginOptions.overlap==="pointer"?[F.canvasX,F.canvasY]:h.getBounds().center,ct.next=3,s.elementsFromPoint(Y[0],Y[1]);case 3:J=ct.sent,$=J[J.indexOf(h)+1],ot=($==null?void 0:$.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?s:null),y!==ot&&(y&&(F.type="dragleave",F.target=y,y.dispatchEvent(F)),ot&&(F.type="dragenter",F.target=ot,ot.dispatchEvent(F)),y=ot,y&&(F.type="dragover",F.target=y,y.dispatchEvent(F)));case 4:case"end":return ct.stop()}},R)}));return function(F){return P.apply(this,arguments)}}();o.addEventListener("pointermove",E);var O=function(R){if(v){R.detail={preventClick:!0};var F=R.clone();y&&(F.type="drop",F.target=y,y.dispatchEvent(F)),F.type="dragend",f.dispatchEvent(F),v=!1}o.removeEventListener("pointermove",E)};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)})}}])}();PE.tag="Dragndrop";var K4=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),e=(0,_.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 PE((0,B.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)}}])}(_a),RE=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())})},LE=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 _E=["main"],DE=["background","main","label","transient"];function Q4(r){return r.main}class IE{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||Q4(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=LE(e,["renderer","background","cursor","enableMultiLayer"]),l=s?DE:_E,c=BE(n,l),u=Object.fromEntries(l.map(h=>{const d=new pf(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:s,renderer:c[h],background:s?h==="background"?i:void 0:i}));return[h,d]}));FE(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=BE(t,this.config.enableMultiLayer?DE:_E);this.extends.renderers=e,Object.entries(e).forEach(([n,i])=>this.getLayer(n).setRenderer(i)),FE(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 RE(this,arguments,void 0,function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:n="viewport"}=t,i=LE(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=I0('<div id="virtual-image"></div>'),u=new pf({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,E]=g.getPosition(),[O,P,R]=g.getFocalPoint();g.setPosition([y+a,b+s,E]),g.setFocalPoint([O+a,P+s,R])}const p=u.getContextService();return new Promise(y=>{u.addEventListener(ri.RERENDER,()=>RE(this,void 0,void 0,function*(){yield new Promise(E=>setTimeout(E,300));const b=yield p.toDataURL(i);y(b)}))})})}destroy(){Object.values(this.getLayers()).forEach(t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()})}}function BE(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 K4({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[e,n]}))}function FE(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 q4(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 zE(r){if(!r)return[0,0];let t=640,e=480;const[n,i]=q4(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 qh{constructor(t){this.type=t}}class $n extends qh{constructor(t,e){super(t),this.data=e}}class Mi extends qh{constructor(t,e,n,i){super(t),this.animationType=e,this.animation=n,this.data=i}}class Po extends qh{constructor(t,e,n){super(t),this.elementType=e,this.data=n}}class Jh extends qh{constructor(t,e){super(t),this.data=e}}function sr(r,t){r.emit(t.type,t)}function J4(r){if(!r)return null;if(r instanceof rm)return{type:"canvas",element:r};let t=r;for(;t;){if(Al(t))return{type:"node",element:t};if(S1(t))return{type:"edge",element:t};if(gv(t))return{type:"combo",element:t};t=t.parentElement}return null}function jE(r){var t;return((t=r==null?void 0:r.style)===null||t===void 0?void 0:t.zIndex)||0}const Ro="cachedStyle",$h=r=>`__${r}__`;function $4(r,t){const e=Array.isArray(t)?t:[t];br(r,Ro)||bl(r,Ro,{}),e.forEach(n=>{bl(br(r,Ro),$h(n),r.attributes[n])})}function ZE(r,t){return br(r,[Ro,$h(t)])}function tB(r,t){return $h(t)in(br(r,Ro)||{})}function zj(r,t,e){set(r,[Ro,$h(t)],e)}class eB{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=mO(this.context.options,g,p,t);(h=u==null?void 0:u.before)===null||h===void 0||h.call(u);const b=y.length?bO(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 E,O;(E=u==null?void 0:u.afterAnimate)===null||E===void 0||E.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=Cf(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=ZE(a,"opacity"))!==null&&n!==void 0?n:hl("opacity")});else if(o==="hide")Object.assign(h,{opacity:(i=ZE(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,E]=p;Object.assign(d,{x:y,y:b,z:E})}}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,E]=p;Object.assign(h,{x:y,y:b,z:E})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b,E]=p;Object.assign(h,{x:y,y:b,z:E,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 nB{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 rB extends Gf{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=e=>{const{target:n}=e,i=J4(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 iB(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 es(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 z0(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 jj(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 aB=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 j0(r){const{id:t=At(r),style:e,data:n}=r,i=aB(r,["id","style","data"]),a=Object.assign(Object.assign({},r),{style:Object.assign({},e),data:Object.assign({},n)});return OO(r)?Object.assign({id:t,data:a},i):{id:t,data:a}}function fr(r){return r.data}function sB(r){if(r.hasTreeStructure(ii))return;r.attachTreeStructure(ii);const t=r.getAllEdges();for(const e of t){const{source:n,target:i}=e;r.setParent(i,n,ii)}}class oB{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new Un}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:z0(n),original:z0(i),type:e})}else this.changes.push({value:z0(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=ii){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 _s(e,i=>{i!==e&&n.push(i)},i=>this.getChildrenData(At(i)),"TB"),n}getParentData(t,e){const{model:n}=this;if(!e){Xr.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"?ii:dn,{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}),j0(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}),j0(e)))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(dn)||e.attachTreeStructure(dn),e.addNodes(t.map(n=>(this.comboIds.add(At(n)),this.pushChange({value:n,type:wn.ComboAdded}),j0(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,dn),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,dn);if(f)d=(((c=f.style)===null||c===void 0?void 0:c.zIndex)||0)+1;else{const v=this.getParentData(h,ii);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"&&!Kr(i)){const s=new Set(this.getAncestorsData(t,dn).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=lu(n);a!==void 0&&(e.hasTreeStructure(dn)||e.attachTreeStructure(dn),a===null&&this.refreshComboData(i),this.setParent(i,lu(n),dn));const s=n.children||[];if(s.length){e.hasTreeStructure(ii)||e.attachTreeStructure(ii);const o=s.filter(l=>e.hasNode(l));o.forEach(l=>this.setParent(l,i,ii)),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=es(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=es(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=es(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=es(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=es(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=lu(a);if(s!==e&&n===dn){const o={id:t,combo:e};this.isCombo(t)?this.syncNodeLikeDatum(o):this.syncNodeLikeDatum(o)}this.model.setParent(t,e,n),i&&n===dn&&iB([s,e]).forEach(o=>{o!==void 0&&this.refreshComboData(o)})}refreshComboData(t){const e=this.getComboData([t])[0],n=this.getAncestorsData(t,dn);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 ir(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=Ne(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;_s(s,l=>{const c=At(l);if(o.has(c))return;o.add(c);const[u,h,d]=ir(l),f=es(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]=ir(o),h=i-l,d=a-c,f=s-u;_s(o,v=>{const g=At(v),[p,y,b]=ir(v),E=es(v,{style:{x:p+h,y:y+d,z:b+f}});this.pushChange({value:E,original:v,type:this.isCombo(g)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(g,E)},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(dn)){const e=lu(this.getNodeLikeDatum(t));this.setParent(t,void 0,dn,!1),this.model.getChildren(t,dn).forEach(n=>{const i=fr(n),a=At(i);this.setParent(At(i),e,dn,!1);const s=es(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)}),me(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(pa(`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 lB{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 rr({className:"elements"}))}}emit(t,e){e.silence||sr(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 Om(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({},jy((i=this.getTheme(e))===null||i===void 0?void 0:i.palette),jy((a=t[e])===null||a===void 0?void 0:a.palette));s!=null&&s.field&&Object.assign(this.paletteStyle,zN(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)]=zy(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 zy(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 Mi(Kt.BEFORE_ANIMATE,Hr.DRAW,c,s),t),afterAnimate:c=>this.emit(new Mi(Kt.AFTER_ANIMATE,Hr.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=Kv(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=[]}=Xc(i,y=>y.type),v=y=>new Map(y.map(b=>{const E=b.value;return[At(E),E]})),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=ga(t,o);if(!c)return Xr.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"&&bv(h,c),s==="visibility"&&(tB(h,"opacity")||$4(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"&&bv(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&&q3(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=ir(this.context.model.getNodeLikeDatum(e)),o=ir(a),l=ln(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 Mi(Kt.BEFORE_ANIMATE,Hr.COLLAPSE,d,o),h),afterAnimate:d=>this.emit(new Mi(Kt.AFTER_ANIMATE,Hr.COLLAPSE,d,o),h)},{collapse:{target:t,descendants:Array.from(c.nodes).map(([,d])=>At(d)),position:ir(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=ir(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 Mi(Kt.BEFORE_ANIMATE,Hr.EXPAND,v,u),f),afterAnimate:v=>this.emit(new Mi(Kt.AFTER_ANIMATE,Hr.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,dn).some(g=>Kr(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 Mi(Kt.BEFORE_ANIMATE,Hr.COLLAPSE,g,u),f),afterAnimate:g=>this.emit(new Mi(Kt.AFTER_ANIMATE,Hr.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=ir(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 Mi(Kt.BEFORE_ANIMATE,Hr.EXPAND,f,l),h),afterAnimate:f=>this.emit(new Mi(Kt.AFTER_ANIMATE,Hr.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 WE=Symbol("Comlink.proxy"),cB=Symbol("Comlink.endpoint"),GE=Symbol("Comlink.releaseProxy"),Z0=Symbol("Comlink.finalizer"),td=Symbol("Comlink.thrown"),VE=r=>typeof r=="object"&&r!==null||typeof r=="function",uB={canHandle:r=>VE(r)&&r[WE],serialize(r){const{port1:t,port2:e}=new MessageChannel;return YE(r,t),[e,[e]]},deserialize(r){return r.start(),XE(r)}},hB={canHandle:r=>VE(r)&&td 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}},UE=new Map([["proxy",uB],["throw",hB]]);function dB(r,t){for(const e of r)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function YE(r,t=globalThis,e=["*"]){t.addEventListener("message",function n(i){if(!i||!i.data)return;if(!dB(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=yB(d)}break;case"ENDPOINT":{const{port1:d,port2:f}=new MessageChannel;YE(r,f),c=mB(d,[d])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[td]:0}}Promise.resolve(c).catch(u=>({value:u,[td]:0})).then(u=>{const[h,d]=id(u);t.postMessage(Object.assign(Object.assign({},h),{id:a}),d),s==="RELEASE"&&(t.removeEventListener("message",n),HE(t),Z0 in r&&typeof r[Z0]=="function"&&r[Z0]())}).catch(u=>{const[h,d]=id({value:new TypeError("Unserializable return value"),[td]:0});t.postMessage(Object.assign(Object.assign({},h),{id:a}),d)})}),t.start&&t.start()}function fB(r){return r.constructor.name==="MessagePort"}function HE(r){fB(r)&&r.close()}function XE(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)}}),W0(r,e,[],t)}function ed(r){if(r)throw new Error("Proxy has been released and is not useable")}function KE(r){return _o(r,new Map,{type:"RELEASE"}).then(()=>{HE(r)})}const nd=new WeakMap,rd="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const t=(nd.get(r)||0)-1;nd.set(r,t),t===0&&KE(r)});function vB(r,t){const e=(nd.get(t)||0)+1;nd.set(t,e),rd&&rd.register(r,t,r)}function gB(r){rd&&rd.unregister(r)}function W0(r,t,e=[],n=function(){}){let i=!1;const a=new Proxy(n,{get(s,o){if(ed(i),o===GE)return()=>{gB(a),KE(r),t.clear(),i=!0};if(o==="then"){if(e.length===0)return{then:()=>a};const l=_o(r,t,{type:"GET",path:e.map(c=>c.toString())}).then(Xs);return l.then.bind(l)}return W0(r,t,[...e,o])},set(s,o,l){ed(i);const[c,u]=id(l);return _o(r,t,{type:"SET",path:[...e,o].map(h=>h.toString()),value:c},u).then(Xs)},apply(s,o,l){ed(i);const c=e[e.length-1];if(c===cB)return _o(r,t,{type:"ENDPOINT"}).then(Xs);if(c==="bind")return W0(r,t,e.slice(0,-1));const[u,h]=QE(l);return _o(r,t,{type:"APPLY",path:e.map(d=>d.toString()),argumentList:u},h).then(Xs)},construct(s,o){ed(i);const[l,c]=QE(o);return _o(r,t,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:l},c).then(Xs)}});return vB(a,r),a}function pB(r){return Array.prototype.concat.apply([],r)}function QE(r){const t=r.map(id);return[t.map(e=>e[0]),pB(t.map(e=>e[1]))]}const qE=new WeakMap;function mB(r,t){return qE.set(r,t),r}function yB(r){return Object.assign(r,{[WE]:!0})}function Zj(r,t=globalThis,e="*"){return{postMessage:(n,i)=>r.postMessage(n,e,i),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function id(r){for(const[t,e]of UE)if(e.canHandle(r)){const[n,i]=e.serialize(r);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:r},qE.get(r)||[]]}function Xs(r){switch(r.type){case"HANDLER":return UE.get(r.name).deserialize(r.value);case"RAW":return r.value}}function _o(r,t,e,n){return new Promise(i=>{const a=bB();t.set(a,i),r.start&&r.start(),r.postMessage(Object.assign({id:a},e),n)})}function bB(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class xB extends Uu{constructor(t,e,n){super(),this.graph=t,this.layout=e,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=XE(new Worker(new URL(S.p+S.u(1157),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[GE]()}isRunning(){return this.running}}var Do=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())})},EB=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 wB{get presetOptions(){return{animation:!!Cm(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 Do(this,void 0,void 0,function*(){var e,n,i,a;const{graph:s,model:o}=this.context,{add:l}=t;sr(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)}),sr(s,new $n(Kt.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",t)})}postLayout(){return Do(this,arguments,void 0,function*(t=this.options){if(!t)return;const e=Array.isArray(t)?t:[t],{graph:n}=this.context;sr(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);sr(n,new $n(Kt.BEFORE_STAGE_LAYOUT,{options:o,index:i}));const l=yield this.stepLayout(s,o,i);sr(n,new $n(Kt.AFTER_STAGE_LAYOUT,{options:o,index:i})),a.animation||this.updateElementPosition(l,!1)}sr(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 Do(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 Do(this,void 0,void 0,function*(){return oP(e)?yield this.treeLayout(t,e,n):yield this.graphLayout(t,e,n)})}graphLayout(t,e,n){return Do(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 xB(c.graphData2LayoutModel(t),c.instance,{iterations:s}),Xu(yield this.supervisor.execute())}if(Bv(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 Do(this,void 0,void 0,function*(){const{type:i,animation:a}=e,s=ga("layout",i);if(!s)return{};const{nodes:o=[],edges:l=[]}=t,c=new Un({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||{}}))});sB(c);const u={nodes:[],edges:[]},h={nodes:[],edges:[]};c.getRoots(ii).forEach(v=>{_s(v,E=>{E.children=c.getSuccessors(E.id)},E=>c.getSuccessors(E.id),"TB");const g=s(v,e),{x:p,y,z:b=0}=g;_s(g,E=>{const{id:O,x:P,y:R,z:F=0}=E;u.nodes.push({id:O,style:{x:p,y,z:b}}),h.nodes.push({id:O,style:{x:P,y:R,z:F}})},E=>E.children,"TB")});const f=this.inferTreeLayoutOffset(h);if(JE(h,f),a){JE(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&&Bv(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,comboFilter:n=()=>!0,preLayout:i=!1,isLayoutInvisibleNodes:a=!1}=t,{nodes:s,edges:o,combos:l}=this.context.model.getData(),{element:c,model:u}=this.context,h=y=>c.getElement(y),d=i?y=>{var b;return!a&&(((b=y.style)===null||b===void 0?void 0:b.visibility)==="hidden"||u.getAncestorsData(y.id,ii).some(Kr)||u.getAncestorsData(y.id,dn).some(Kr))?!1:e(y)}:y=>{const b=At(y),E=h(b);return!E||Ol(E)?!1:e(y)},f=s.filter(d),v=l.filter(n),g=new Map(f.map(y=>[At(y),y]));v.forEach(y=>g.set(At(y),y));const p=o.filter(({source:y,target:b})=>g.has(y)&&g.has(b));return{nodes:f,edges:p,combos:v}}initGraphLayout(t){var e;const{element:n,viewport:i}=this.context,{type:a,enableWorker:s,animation:o,iterations:l}=t,c=EB(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 E=n==null?void 0:n.getElement(b.id);return E?E.attributes.size:n==null?void 0:n.getElementComputedStyle("node",b).size},v=ga("layout",a);if(!v)return Xr.warn(`The layout of ${a} is not registered.`);const g=Object.getPrototypeOf(v.prototype)===Hu.prototype?v:cP(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 JE=(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 SB(r){return[MB].reduce((e,n)=>n(e),r)}function MB(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 AB extends Gf{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;Xr.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 ad=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class TB extends Gf{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...ad.slice(0,ad.length-1),...t,ad[ad.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 OB{get padding(){return ai(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=Cm(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:Ne(s,f),focalPoint:Ne(o,f)}:{position:Ne([l,c,s[2]],f),focalPoint:Ne([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(sr(n,new Jh(Kt.BEFORE_TRANSFORM,t)),!a&&s&&!i&&o&&!l){this.camera.setZoomByViewportPoint(this.getZoomOptions(t),o),sr(n,new Jh(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 sr(n,new Mi(Kt.BEFORE_ANIMATE,Hr.TRANSFORM,null,t)),new Promise(u=>{this.transformResolver=u,this.camera.gotoLandmark(this.createLandmark(c),Object.assign(Object.assign({},l),{onfinish:()=>{sr(n,new Mi(Kt.AFTER_ANIMATE,Hr.TRANSFORM,null,t)),sr(n,new Jh(Kt.AFTER_TRANSFORM,t)),this.transformResolver=void 0,u()}}))});this.camera.gotoLandmark(this.createLandmark(c),{duration:0}),sr(n,new Jh(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,E=d/p,O=l==="x"?b:l==="y"?E:Math.min(b,E),P=this.getAnimation(e);Number.isFinite(O)&&(yield this.transform({mode:"relative",scale:O,translate:Ne(ln(this.getCanvasCenter(),this.getBBoxInViewport(f).center),Ii(this.paddingOffset,O))},P))})}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=ln(i,n);yield this.transform({mode:"relative",translate:Ne(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 pn;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 pn;return u.setMinMax([s,o,0],[l,c,0]),n&&(u=za(u,n)),fo(t)?Li(t,u):e?kO(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 sd extends Uu{constructor(t){var e;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new oB},this.isCollapsingExpanding=!1,this.onResize=Cl(()=>{this.resize()},300),this._setOptions(Object.assign({},sd.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,SB(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()}hasNode(t){return this.context.model.hasNode(t)}hasEdge(t){return this.context.model.hasEdge(t)}hasCombo(t){return this.context.model.hasCombo(t)}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 IE)this.context.canvas=e,s&&e.setCursor(s),a&&e.setRenderer(a),yield e.ready;else{const u=Ge(e)?document.getElementById(e):e,h=zE(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 IE(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 nB(this.context)),this.context.plugin||(this.context.plugin=new AB(this.context)),this.context.viewport||(this.context.viewport=new OB(this.context)),this.context.transform||(this.context.transform=new TB(this.context)),this.context.element||(this.context.element=new lB(this.context)),this.context.animation||(this.context.animation=new eB(this.context)),this.context.layout||(this.context.layout=new wB(this.context)),this.context.behavior||(this.context.behavior=new rB(this.context))}prepare(){return mn(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed){console.error(pa("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(),sr(this,new $n(Kt.BEFORE_RENDER)),this.options.layout)if(!this.rendered&&lP(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,sr(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;sr(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,sr(this,new $n(Kt.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var n;const i=zE((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();Wn(a,s)||(sr(this,new $n(Kt.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),sr(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(Ge(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 ln([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]=zn(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]=zn(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 Gv(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]=zn(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=zn(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,dn).at(-1)||this.getComboData(a),c=[l,...n.getDescendantsData(At(l))],u=s-jE(l);c.forEach(d=>{i[At(d)]=this.getElementZIndex(At(d))+u});const{internal:h}=vv(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 jE(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]=zn(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(Kr(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(!Kr(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)}}sd.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};var CB=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 NB(r,t){const{getNodeData:e=(o,l)=>{if(o.depth=l,!o.children)return o;const{children:c}=o,u=CB(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 _s(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 kB extends ts{beforeDraw(t){const{add:e,update:n}=t,{model:i}=this.context;return[...e.edges.entries(),...n.edges.entries()].forEach(([,a])=>{$E(i,a)}),t}}const $E=(r,t)=>{const{source:e,target:n}=t,i=r.getElementDataById(e),a=r.getElementDataById(n),s=m1(i,h=>r.getParentData(h,dn)),o=m1(a,h=>r.getParentData(h,dn)),l=At(s),c=At(o),u={sourceNode:l,targetNode:c};return t.style?Object.assign(t.style,u):t.style=u,t},PB=(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)},RB=(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)},LB=(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)},_B=(r,t,e)=>{const[n,i]=t,[a,s]=e,o=Math.sqrt((r-n)/(i-n));return a+o*(s-a)};class od extends ts{constructor(t,e){super(t,mr({},od.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 PB(v,c,g);case"log":return RB(v,c,g);case"pow":return LB(v,c,g,2);case"sqrt":return _B(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||!Qh(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+NO(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 by(n,i,t)}}od.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class ld extends ts{constructor(t,e){super(t,Object.assign({},ld.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=ir(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=Sy(ln(ir(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?Gr(l)+180:Gr(l)]];i.updateNodeData([{id:At(s),style:{labelTextAlign:c===u?"right":"left",labelTextBaseline:"middle",labelTransform:g}}])}),n.draw()}}ld.defaultOptions={offset:5};const DB="quadratic",tw=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class cd extends ts{constructor(t,e){super(t,Object.assign({},cd.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=new Set(n.remove.edges.keys()),p=c.getEdgeData().filter(y=>!g.has(At(y))).map(y=>$E(c,y));IB(v,p,!0).forEach(y=>{const b=At(y);u.has(b)||u.set(b,y)})};if(l.size&&l.forEach(d),i.size&&i.forEach(d),s.size){const v=qb(Kv(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&&!G0(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}=ew(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=tw.length;v.loopPlacement=tw[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:DB,style:v}),p=(d=this.context.element)===null||d===void 0?void 0:d.getElement(At(c));(!p||!Qh(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=>{Wn(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}=ew(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||!Qh(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||!Qh(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}}cd.defaultOptions={mode:"bundle",distance:15};const ew=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)&&G0(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}},IB=(r,t,e)=>t.filter(n=>(e||At(n)!==At(r))&&G0(n,r)),G0=(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 BB extends ts{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 FB={animation:{"combo-collapse":Rm,"combo-expand":MO,"node-collapse":km,"node-expand":wO,"path-in":Pm,"path-out":SO,fade:xO,translate:EO},behavior:{"brush-select":yl,"click-select":gu,"collapse-expand":zu,"create-edge":Gu,"drag-canvas":Vu,"drag-element-force":hP,"drag-element":Nl,"fix-element-size":Ku,"focus-element":Qu,"hover-activate":qu,"lasso-select":fP,"auto-adapt-label":cu,"optimize-viewport-transform":Ju,"scroll-canvas":$u,"zoom-canvas":th},combo:{circle:r3,rect:i3},edge:{cubic:Fs,line:Iu,polyline:Bu,quadratic:Fu,"cubic-horizontal":Lu,"cubic-radial":_u,"cubic-vertical":Du},layout:{"antv-dagre":JR,"combo-combined":EL,"compact-box":eh.compactBox,"d3-force":WL,"force-atlas2":UL,circular:eL,concentric:Rv,dagre:nh,dendrogram:eh.dendrogram,fishbone:ah,force:xb,fruchterman:XL,grid:QL,indented:eh.indented,mds:Ob,mindmap:eh.mindmap,radial:a_,random:d_,snake:sh},node:{circle:Ds,diamond:ik,ellipse:xu,hexagon:ck,html:Cu,image:Nu,rect:e3,star:n3,donut:yu,triangle:ku},palette:{spectral:m_,tableau:y_,oranges:b_,greens:x_,blues:E_},theme:{dark:G4,light:V4},plugin:{"bubble-sets":ph,"edge-bundling":yh,"edge-filter-lens":bh,"grid-line":wh,background:oh,contextmenu:mh,fisheye:xh,fullscreen:Eh,history:Sh,hull:Oh,legend:Lh,minimap:_h,snapline:Dh,timebar:Yh,title:O4,toolbar:Hh,tooltip:Xh,watermark:Kh},transform:{"arrange-draw-order":U4,"collapse-expand-combo":Y4,"collapse-expand-node":H4,"get-edge-actual-ends":kB,"map-node-size":od,"place-radial-labels":ld,"process-parallel-edges":cd,"update-related-edges":BB},shape:{circle:Ji,ellipse:al,group:rr,html:co,image:$f,line:As,path:ni,polygon:Ts,polyline:Oc,rect:pr,text:Os,label:ia,badge:po}};function zB(){Object.entries(FB).forEach(([r,t])=>{Object.entries(t).forEach(([e,n])=>{X4(r,e,n)})})}zB();const Wj={css:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css",js:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.js"}},13722:function(U){(function(S,A){U.exports=A()})(typeof self!="undefined"?self:this,function(){return function(Q){var S={};function A(Z){if(S[Z])return S[Z].exports;var B=S[Z]={i:Z,l:!1,exports:{}};return Q[Z].call(B.exports,B,B.exports,A),B.l=!0,B.exports}return A.m=Q,A.c=S,A.d=function(Z,B,N){A.o(Z,B)||Object.defineProperty(Z,B,{configurable:!1,enumerable:!0,get:N})},A.n=function(Z){var B=Z&&Z.__esModule?function(){return Z.default}:function(){return Z};return A.d(B,"a",B),B},A.o=function(Z,B){return Object.prototype.hasOwnProperty.call(Z,B)},A.p="",A(A.s=5)}([function(Q,S){function A(Z,B,N,T){return T===void 0&&(T="height"),N==="center"?(Z[T]+B[T])/2:Z.height}Q.exports={assign:Object.assign,getHeight:A}},function(Q,S,A){var Z=A(3),B=function(){function N(k,_){_===void 0&&(_={});var C=this;C.options=_,C.rootNode=Z(k,_)}var T=N.prototype;return T.execute=function(){throw new Error("please override this method")},N}();Q.exports=B},function(Q,S,A){var Z=A(4),B=["LR","RL","TB","BT","H","V"],N=["LR","RL","H"],T=function(L){return N.indexOf(L)>-1},k=B[0];Q.exports=function(C,L,z){var D=L.direction||k;if(L.isHorizontal=T(D),D&&B.indexOf(D)===-1)throw new TypeError("Invalid direction: "+D);if(D===B[0])z(C,L);else if(D===B[1])z(C,L),C.right2left();else if(D===B[2])z(C,L);else if(D===B[3])z(C,L),C.bottom2top();else if(D===B[4]||D===B[5]){var W=Z(C,L),X=W.left,K=W.right;z(X,L),z(K,L),L.isHorizontal?X.right2left():X.bottom2top(),K.translate(X.x-K.x,X.y-K.y),C.x=X.x,C.y=K.y;var rt=C.getBoundingBox();L.isHorizontal?rt.top<0&&C.translate(0,-rt.top):rt.left<0&&C.translate(-rt.left,0)}var nt=L.fixedRoot;return nt===void 0&&(nt=!0),nt&&C.translate(-(C.x+C.width/2+C.hgap),-(C.y+C.height/2+C.vgap)),_(C,L),C};function _(C,L){if(L.radial){var z=L.isHorizontal?["x","y"]:["y","x"],D=z[0],W=z[1],X={x:1/0,y:1/0},K={x:-1/0,y:-1/0},rt=0;C.DFTraverse(function(it){rt++;var at=it.x,ut=it.y;X.x=Math.min(X.x,at),X.y=Math.min(X.y,ut),K.x=Math.max(K.x,at),K.y=Math.max(K.y,ut)});var nt=K[W]-X[W];if(nt===0)return;var q=Math.PI*2/rt;C.DFTraverse(function(it){var at=(it[W]-X[W])/nt*(Math.PI*2-q)+q,ut=it[D]-C[D];it.x=Math.cos(at)*ut,it.y=Math.sin(at)*ut})}}},function(Q,S,A){var Z=A(0),B=18,N=B*2,T=B,k={getId:function(z){return z.id||z.name},getPreH:function(z){return z.preH||0},getPreV:function(z){return z.preV||0},getHGap:function(z){return z.hgap||T},getVGap:function(z){return z.vgap||T},getChildren:function(z){return z.children},getHeight:function(z){return z.height||N},getWidth:function(z){var D=z.label||" ";return z.width||D.split("").length*B}};function _(L,z){var D=this;if(D.vgap=D.hgap=0,L instanceof _)return L;D.data=L;var W=z.getHGap(L),X=z.getVGap(L);return D.preH=z.getPreH(L),D.preV=z.getPreV(L),D.width=z.getWidth(L),D.height=z.getHeight(L),D.width+=D.preH,D.height+=D.preV,D.id=z.getId(L),D.x=D.y=0,D.depth=0,D.children||(D.children=[]),D.addGap(W,X),D}Z.assign(_.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(z,D){var W=this;W.hgap+=z,W.vgap+=D,W.width+=2*z,W.height+=2*D},eachNode:function(z){for(var D=this,W=[D],X;X=W.shift();)z(X),W=X.children.concat(W)},DFTraverse:function(z){this.eachNode(z)},BFTraverse:function(z){for(var D=this,W=[D],X;X=W.shift();)z(X),W=W.concat(X.children)},getBoundingBox:function(){var z={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(D){z.left=Math.min(z.left,D.x),z.top=Math.min(z.top,D.y),z.width=Math.max(z.width,D.x+D.width),z.height=Math.max(z.height,D.y+D.height)}),z},translate:function(z,D){z===void 0&&(z=0),D===void 0&&(D=0),this.eachNode(function(W){W.x+=z,W.y+=D,W.x+=W.preH,W.y+=W.preV})},right2left:function(){var z=this,D=z.getBoundingBox();z.eachNode(function(W){W.x=W.x-(W.x-D.left)*2-W.width}),z.translate(D.width,0)},bottom2top:function(){var z=this,D=z.getBoundingBox();z.eachNode(function(W){W.y=W.y-(W.y-D.top)*2-W.height}),z.translate(0,D.height)}});function C(L,z,D){z===void 0&&(z={}),z=Z.assign({},k,z);var W=new _(L,z),X=[W],K;if(!D&&!L.collapsed){for(;K=X.shift();)if(!K.data.collapsed){var rt=z.getChildren(K.data),nt=rt?rt.length:0;if(K.children=new Array(nt),rt&&nt)for(var q=0;q<nt;q++){var it=new _(rt[q],z);K.children[q]=it,X.push(it),it.parent=K,it.depth=K.depth+1}}}return W}Q.exports=C},function(Q,S,A){var Z=A(3);Q.exports=function(B,N){for(var T=Z(B.data,N,!0),k=Z(B.data,N,!0),_=B.children.length,C=Math.round(_/2),L=N.getSide||function(X,K){return K<C?"right":"left"},z=0;z<_;z++){var D=B.children[z],W=L(D,z);W==="right"?k.children.push(D):T.children.push(D)}return T.eachNode(function(X){X.isRoot()||(X.side="left")}),k.eachNode(function(X){X.isRoot()||(X.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(D,W){D.prototype=Object.create(W.prototype),D.prototype.constructor=D,B(D,W)}function B(D,W){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,K){return X.__proto__=K,X},B(D,W)}var N=A(1),T=A(7),k=A(2),_=A(0),C=function(D){function W(){return D.apply(this,arguments)||this}Z(W,D);var X=W.prototype;return X.execute=function(){var rt=this;return k(rt.rootNode,rt.options,T)},W}(N),L={};function z(D,W){return W=_.assign({},L,W),new C(D,W).execute()}Q.exports=z},function(Q,S){function A(_,C,L,z){z===void 0&&(z=[]);var D=this;D.w=_||0,D.h=C||0,D.y=L||0,D.x=0,D.c=z||[],D.cs=z.length,D.prelim=0,D.mod=0,D.shift=0,D.change=0,D.tl=null,D.tr=null,D.el=null,D.er=null,D.msel=0,D.mser=0}A.fromNode=function(_,C){if(!_)return null;var L=[];return _.children.forEach(function(z){L.push(A.fromNode(z,C))}),C?new A(_.height,_.width,_.x,L):new A(_.width,_.height,_.y,L)};function Z(_,C,L){L?_.y+=C:_.x+=C,_.children.forEach(function(z){Z(z,C,L)})}function B(_,C){var L=C?_.y:_.x;return _.children.forEach(function(z){L=Math.min(B(z,C),L)}),L}function N(_,C){var L=B(_,C);Z(_,-L,C)}function T(_,C,L){L?C.y=_.x:C.x=_.x,_.c.forEach(function(z,D){T(z,C.children[D],L)})}function k(_,C,L){L===void 0&&(L=0),C?(_.x=L,L+=_.width):(_.y=L,L+=_.height),_.children.forEach(function(z){k(z,C,L)})}Q.exports=function(_,C){C===void 0&&(C={});var L=C.isHorizontal;function z(gt){if(gt.cs===0){D(gt);return}z(gt.c[0]);for(var Et=pt(nt(gt.c[0].el),0,null),kt=1;kt<gt.cs;++kt){z(gt.c[kt]);var zt=nt(gt.c[kt].er);W(gt,kt,Et),Et=pt(zt,kt,Et)}at(gt),D(gt)}function D(gt){gt.cs===0?(gt.el=gt,gt.er=gt,gt.msel=gt.mser=0):(gt.el=gt.c[0].el,gt.msel=gt.c[0].msel,gt.er=gt.c[gt.cs-1].er,gt.mser=gt.c[gt.cs-1].mser)}function W(gt,Et,kt){for(var zt=gt.c[Et-1],Ut=zt.mod,Qt=gt.c[Et],Ee=Qt.mod;zt!==null&&Qt!==null;){nt(zt)>kt.low&&(kt=kt.nxt);var Le=Ut+zt.prelim+zt.w-(Ee+Qt.prelim);Le>0&&(Ee+=Le,X(gt,Et,kt.index,Le));var tn=nt(zt),er=nt(Qt);tn<=er&&(zt=rt(zt),zt!==null&&(Ut+=zt.mod)),tn>=er&&(Qt=K(Qt),Qt!==null&&(Ee+=Qt.mod))}!zt&&Qt?q(gt,Et,Qt,Ee):zt&&!Qt&&it(gt,Et,zt,Ut)}function X(gt,Et,kt,zt){gt.c[Et].mod+=zt,gt.c[Et].msel+=zt,gt.c[Et].mser+=zt,ht(gt,Et,kt,zt)}function K(gt){return gt.cs===0?gt.tl:gt.c[0]}function rt(gt){return gt.cs===0?gt.tr:gt.c[gt.cs-1]}function nt(gt){return gt.y+gt.h}function q(gt,Et,kt,zt){var Ut=gt.c[0].el;Ut.tl=kt;var Qt=zt-kt.mod-gt.c[0].msel;Ut.mod+=Qt,Ut.prelim-=Qt,gt.c[0].el=gt.c[Et].el,gt.c[0].msel=gt.c[Et].msel}function it(gt,Et,kt,zt){var Ut=gt.c[Et].er;Ut.tr=kt;var Qt=zt-kt.mod-gt.c[Et].mser;Ut.mod+=Qt,Ut.prelim-=Qt,gt.c[Et].er=gt.c[Et-1].er,gt.c[Et].mser=gt.c[Et-1].mser}function at(gt){gt.prelim=(gt.c[0].prelim+gt.c[0].mod+gt.c[gt.cs-1].mod+gt.c[gt.cs-1].prelim+gt.c[gt.cs-1].w)/2-gt.w/2}function ut(gt,Et){Et+=gt.mod,gt.x=gt.prelim+Et,xt(gt);for(var kt=0;kt<gt.cs;kt++)ut(gt.c[kt],Et)}function ht(gt,Et,kt,zt){if(kt!==Et-1){var Ut=Et-kt;gt.c[kt+1].shift+=zt/Ut,gt.c[Et].shift-=zt/Ut,gt.c[Et].change-=zt-zt/Ut}}function xt(gt){for(var Et=0,kt=0,zt=0;zt<gt.cs;zt++)Et+=gt.c[zt].shift,kt+=Et+gt.c[zt].change,gt.c[zt].mod+=kt}function pt(gt,Et,kt){for(;kt!==null&&gt>=kt.low;)kt=kt.nxt;return{low:gt,index:Et,nxt:kt}}k(_,L);var wt=A.fromNode(_,L);return z(wt),ut(wt,0),T(wt,_,L),N(_,L),_}},function(Q,S,A){function Z(D,W){D.prototype=Object.create(W.prototype),D.prototype.constructor=D,B(D,W)}function B(D,W){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,K){return X.__proto__=K,X},B(D,W)}var N=A(1),T=A(9),k=A(2),_=A(0),C=function(D){function W(){return D.apply(this,arguments)||this}Z(W,D);var X=W.prototype;return X.execute=function(){var rt=this;return rt.rootNode.width=0,k(rt.rootNode,rt.options,T)},W}(N),L={};function z(D,W){return W=_.assign({},L,W),new C(D,W).execute()}Q.exports=z},function(Q,S,A){var Z=A(0);function B(k,_){k===void 0&&(k=0),_===void 0&&(_=[]);var C=this;C.x=C.y=0,C.leftChild=C.rightChild=null,C.height=0,C.children=_}var N={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function T(k,_,C){C?(_.x=k.x,_.y=k.y):(_.x=k.y,_.y=k.x),k.children.forEach(function(L,z){T(L,_.children[z],C)})}Q.exports=function(k,_){_===void 0&&(_={}),_=Z.assign({},N,_);var C=0;function L(K){if(!K)return null;K.width=0,K.depth&&K.depth>C&&(C=K.depth);var rt=K.children,nt=rt.length,q=new B(K.height,[]);return rt.forEach(function(it,at){var ut=L(it);q.children.push(ut),at===0&&(q.leftChild=ut),at===nt-1&&(q.rightChild=ut)}),q.originNode=K,q.isLeaf=K.isLeaf(),q}function z(K){if(K.isLeaf||K.children.length===0)K.drawingDepth=C;else{var rt=K.children.map(function(q){return z(q)}),nt=Math.min.apply(null,rt);K.drawingDepth=nt-1}return K.drawingDepth}var D;function W(K){K.x=K.drawingDepth*_.rankSep,K.isLeaf?(K.y=0,D&&(K.y=D.y+D.height+_.nodeSep,K.originNode.parent!==D.originNode.parent&&(K.y+=_.subTreeSep)),D=K):(K.children.forEach(function(rt){W(rt)}),K.y=(K.leftChild.y+K.rightChild.y)/2)}var X=L(k);return z(X),W(X),T(X,k,_.isHorizontal),k}},function(Q,S,A){function Z(X,K){X.prototype=Object.create(K.prototype),X.prototype.constructor=X,B(X,K)}function B(X,K){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,nt){return rt.__proto__=nt,rt},B(X,K)}var N=A(1),T=A(11),k=A(4),_=A(0),C=["LR","RL","H"],L=C[0],z=function(X){function K(){return X.apply(this,arguments)||this}Z(K,X);var rt=K.prototype;return rt.execute=function(){var q=this,it=q.options,at=q.rootNode;it.isHorizontal=!0;var ut=it.indent,ht=ut===void 0?20:ut,xt=it.dropCap,pt=xt===void 0?!0:xt,wt=it.direction,gt=wt===void 0?L:wt,Et=it.align;if(gt&&C.indexOf(gt)===-1)throw new TypeError("Invalid direction: "+gt);if(gt===C[0])T(at,ht,pt,Et);else if(gt===C[1])T(at,ht,pt,Et),at.right2left();else if(gt===C[2]){var kt=k(at,it),zt=kt.left,Ut=kt.right;T(zt,ht,pt,Et),zt.right2left(),T(Ut,ht,pt,Et);var Qt=zt.getBoundingBox();Ut.translate(Qt.width,0),at.x=Ut.x-at.width/2}return at},K}(N),D={};function W(X,K){return K=_.assign({},D,K),new z(X,K).execute()}Q.exports=W},function(Q,S,A){var Z=A(0);function B(N,T,k,_,C){var L=(typeof k=="function"?k(N):k)*N.depth;if(!_)try{if(N.id===N.parent.children[0].id){N.x+=L,N.y=T?T.y:0;return}}catch(W){}if(N.x+=L,T){if(N.y=T.y+Z.getHeight(T,N,C),T.parent&&N.parent.id!==T.parent.id){var z=T.parent,D=z.y+Z.getHeight(z,N,C);N.y=D>N.y?D:N.y}}else N.y=0}Q.exports=function(N,T,k,_){var C=null;N.eachNode(function(L){B(L,C,T,k,_),C=L})}},function(Q,S,A){function Z(D,W){D.prototype=Object.create(W.prototype),D.prototype.constructor=D,B(D,W)}function B(D,W){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,K){return X.__proto__=K,X},B(D,W)}var N=A(1),T=A(13),k=A(2),_=A(0),C=function(D){function W(){return D.apply(this,arguments)||this}Z(W,D);var X=W.prototype;return X.execute=function(){var rt=this;return k(rt.rootNode,rt.options,T)},W}(N),L={};function z(D,W){return W=_.assign({},L,W),new C(D,W).execute()}Q.exports=z},function(Q,S,A){var Z=A(0);function B(k,_){var C=0;return k.children.length?k.children.forEach(function(L){C+=B(L,_)}):C=k.height,k._subTreeSep=_.getSubTreeSep(k.data),k.totalHeight=Math.max(k.height,C)+2*k._subTreeSep,k.totalHeight}function N(k){var _=k.children,C=_.length;if(C){_.forEach(function(K){N(K)});var L=_[0],z=_[C-1],D=z.y-L.y+z.height,W=0;if(_.forEach(function(K){W+=K.totalHeight}),D>k.height)k.y=L.y+D/2-k.height/2;else if(_.length!==1||k.height>W){var X=k.y+(k.height-D)/2-L.y;_.forEach(function(K){K.translate(0,X)})}else k.y=(L.y+L.height/2+z.y+z.height/2)/2-k.height/2}}var T={getSubTreeSep:function(){return 0}};Q.exports=function(k,_){_===void 0&&(_={}),_=Z.assign({},T,_),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,B(k,_),k.startY=0,k.y=k.totalHeight/2-k.height/2,k.eachNode(function(C){var L=C.children,z=L.length;if(z){var D=L[0];if(D.startY=C.startY+C._subTreeSep,z===1)D.y=C.y+C.height/2-D.height/2;else{D.y=D.startY+D.totalHeight/2-D.height/2;for(var W=1;W<z;W++){var X=L[W];X.startY=L[W-1].startY+L[W-1].totalHeight,X.y=X.startY+X.totalHeight/2-X.height/2}}}}),N(k)}}])})},55152:function(U,Q,S){"use strict";var A=S(59301),Z=S(42441),B=S(48961),N=S.n(B),T=Object.defineProperty,k=Object.defineProperties,_=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,D=(q,it,at)=>it in q?T(q,it,{enumerable:!0,configurable:!0,writable:!0,value:at}):q[it]=at,W=(q,it)=>{for(var at in it||(it={}))L.call(it,at)&&D(q,at,it[at]);if(C)for(var at of C(it))z.call(it,at)&&D(q,at,it[at]);return q},X=(q,it)=>k(q,_(it));function K(q,it,at=1/3,ut){let ht=q*Math.PI*2,xt=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(pt,wt){return pt<ht?Math.cos(ht)*(1+Math.cos(wt)*at):pt>xt?Math.cos(xt)*(1+Math.cos(wt)*at):Math.cos(pt)*(1+Math.cos(wt)*at)},y:function(pt,wt){return pt<ht?Math.sin(ht)*(1+Math.cos(wt)*at):pt>xt?Math.sin(xt)*(1+Math.cos(wt)*at):Math.sin(pt)*(1+Math.cos(wt)*at)},z:function(pt,wt){return pt<-Math.PI*.5?Math.sin(pt):pt>Math.PI*2.5?Math.sin(pt)*ut*.1:Math.sin(wt)>0?1*ut*.1:-1}}}function rt({pieData:q=[],internalDiameterRatio:it=1/3}){var at,ut,ht,xt;const pt=[],wt=q==null?void 0:q.reduce((Ut,Qt)=>(Ut||0)+((Qt==null?void 0:Qt.value)||0),0);let gt=0,Et=0;const kt=[];for(let Ut=0;Ut<(q==null?void 0:q.length);Ut++){Et=gt+(wt==0?1:((at=q==null?void 0:q[Ut])==null?void 0:at.value)||0);const Qt={itemStyle:((ut=q==null?void 0:q[Ut])==null?void 0:ut.itemStyle)||{},name:((ht=q==null?void 0:q[Ut])==null?void 0:ht.name)||`name${Ut}`,type:"surface",parametric:!0,parametricEquation:K(gt/(wt||(q==null?void 0:q.length)),Et/(wt||(q==null?void 0:q.length)),it,((xt=q==null?void 0:q[Ut])==null?void 0:xt.value)||(wt==0?25:0)),wireframe:{show:!1},pieData:q==null?void 0:q[Ut]};kt.push(Qt.name),pt.push(Qt),gt=Et}return pt.push({name:"pie2d",type:"pie",showEmptyCircle:!0,label:{show:!0,formatter:Ut=>`${Ut.value}
${Ut.name}`},startAngle:-35,radius:["49%","50%"],center:["50%","40%"],data:[...q||[]].reverse(),itemStyle:{opacity:0}}),{legend:{left:"50%",top:"center",textStyle:{fontSize:12},data:kt},xAxis3D:{},yAxis3D:{},zAxis3D:{},grid3D:{viewControl:{alpha:45,rotateSensitivity:0,zoomSensitivity:0,panSensitivity:0,autoRotate:!1},left:"center",top:"-10%",show:!1,boxHeight:25},series:pt}}const nt=({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:ut={},internalDiameterRatio:ht=1/3})=>{const[xt,pt]=(0,A.useState)([]),wt=(0,A.useCallback)(kt=>{const zt=kt.selected||{},Ut=q.map(Qt=>Qt.name).filter(Qt=>zt[Qt]===!1);pt(Ut)},[q]),gt=(0,A.useMemo)(()=>q.filter(kt=>!xt.includes(kt.name)),[q,xt]),Et=(0,A.useMemo)(()=>{const kt=rt({pieData:gt,internalDiameterRatio:ht}),zt=q.map(Qt=>Qt.name),Ut=q.reduce((Qt,Ee)=>(Qt[Ee.name]=!xt.includes(Ee.name),Qt),{});return kt.legend=X(W(W({},kt.legend),ut),{data:zt,selected:Ut}),kt},[gt,ut,ht,q,xt]);return A.createElement(Z.Z,{onEvents:{legendselectchanged:wt},className:`w-full h-full ${it}`,option:Et,style:W({height:"100%"},at)})};Q.Z=nt},88618:function(U,Q,S){"use strict";var A,Z=Object.defineProperty,B=H=>{throw TypeError(H)},N=Math.pow,T=(H,x,w)=>x in H?Z(H,x,{enumerable:!0,configurable:!0,writable:!0,value:w}):H[x]=w,k=(H,x,w)=>T(H,typeof x!="symbol"?x+"":x,w),_=(H,x,w)=>x.has(H)||B("Cannot "+w),C=(H,x,w)=>(_(H,x,"read from private field"),w?w.call(H):x.get(H)),L=(H,x,w)=>x.has(H)?B("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(H):x.set(H,w),z=(H,x,w,m)=>(_(H,x,"write to private field"),m?m.call(H,w):x.set(H,w),w),D=(H,x,w)=>(_(H,x,"access private method"),w),W,X,K;A={value:!0};var rt=S(34634),nt=S(34402);const q=" ".repeat(2),it=" ".repeat(4);function at(){return ut(this)}function ut(H,x={}){const{maxRows:w=15,maxColumns:m=10,maxNumSize:M=8,padMinus:j="auto"}=x;return`${H.constructor.name} {
${q}[
${it}${ht(H,w,m,M,j)}
${q}]
${q}rows: ${H.rows}
${q}columns: ${H.columns}
}`}function ht(H,x,w,m,M){const{rows:j,columns:tt}=H,et=Math.min(j,x),st=Math.min(tt,w),lt=[];if(M==="auto"){M=!1;t:for(let Tt=0;Tt<et;Tt++)for(let vt=0;vt<st;vt++)if(H.get(Tt,vt)<0){M=!0;break t}}for(let Tt=0;Tt<et;Tt++){let vt=[];for(let Ft=0;Ft<st;Ft++)vt.push(xt(H.get(Tt,Ft),m,M));lt.push(`${vt.join(" ")}`)}return st!==tt&&(lt[lt.length-1]+=` ... ${tt-w} more columns`),et!==j&&lt.push(`... ${j-x} more rows`),lt.join(`
${it}`)}function xt(H,x,w){return(H>=0&&w?` ${pt(H,x-1)}`:pt(H,x)).padEnd(x)}function pt(H,x){let w=H.toString();if(w.length<=x)return w;let m=H.toFixed(x);if(m.length>x&&(m=H.toFixed(Math.max(0,x-(m.length-x)))),m.length<=x&&!m.startsWith("0.000")&&!m.startsWith("-0.000"))return m;let M=H.toExponential(x);return M.length>x&&(M=H.toExponential(Math.max(0,x-(M.length-x)))),M.slice(0)}function wt(H,x){H.prototype.add=function(m){return typeof m=="number"?this.addS(m):this.addM(m)},H.prototype.addS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)+m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)+m.get(M,j));return this},H.add=function(m,M){return new x(m).add(M)},H.prototype.sub=function(m){return typeof m=="number"?this.subS(m):this.subM(m)},H.prototype.subS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)-m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)-m.get(M,j));return this},H.sub=function(m,M){return new x(m).sub(M)},H.prototype.subtract=H.prototype.sub,H.prototype.subtractS=H.prototype.subS,H.prototype.subtractM=H.prototype.subM,H.subtract=H.sub,H.prototype.mul=function(m){return typeof m=="number"?this.mulS(m):this.mulM(m)},H.prototype.mulS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)*m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)*m.get(M,j));return this},H.mul=function(m,M){return new x(m).mul(M)},H.prototype.multiply=H.prototype.mul,H.prototype.multiplyS=H.prototype.mulS,H.prototype.multiplyM=H.prototype.mulM,H.multiply=H.mul,H.prototype.div=function(m){return typeof m=="number"?this.divS(m):this.divM(m)},H.prototype.divS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)/m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)/m.get(M,j));return this},H.div=function(m,M){return new x(m).div(M)},H.prototype.divide=H.prototype.div,H.prototype.divideS=H.prototype.divS,H.prototype.divideM=H.prototype.divM,H.divide=H.div,H.prototype.mod=function(m){return typeof m=="number"?this.modS(m):this.modM(m)},H.prototype.modS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)%m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)%m.get(M,j));return this},H.mod=function(m,M){return new x(m).mod(M)},H.prototype.modulus=H.prototype.mod,H.prototype.modulusS=H.prototype.modS,H.prototype.modulusM=H.prototype.modM,H.modulus=H.mod,H.prototype.and=function(m){return typeof m=="number"?this.andS(m):this.andM(m)},H.prototype.andS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)&m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)&m.get(M,j));return this},H.and=function(m,M){return new x(m).and(M)},H.prototype.or=function(m){return typeof m=="number"?this.orS(m):this.orM(m)},H.prototype.orS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)|m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)|m.get(M,j));return this},H.or=function(m,M){return new x(m).or(M)},H.prototype.xor=function(m){return typeof m=="number"?this.xorS(m):this.xorM(m)},H.prototype.xorS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)^m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)^m.get(M,j));return this},H.xor=function(m,M){return new x(m).xor(M)},H.prototype.leftShift=function(m){return typeof m=="number"?this.leftShiftS(m):this.leftShiftM(m)},H.prototype.leftShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)<<m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)<<m.get(M,j));return this},H.leftShift=function(m,M){return new x(m).leftShift(M)},H.prototype.signPropagatingRightShift=function(m){return typeof m=="number"?this.signPropagatingRightShiftS(m):this.signPropagatingRightShiftM(m)},H.prototype.signPropagatingRightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>m.get(M,j));return this},H.signPropagatingRightShift=function(m,M){return new x(m).signPropagatingRightShift(M)},H.prototype.rightShift=function(m){return typeof m=="number"?this.rightShiftS(m):this.rightShiftM(m)},H.prototype.rightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>>m);return this},H.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 j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>>m.get(M,j));return this},H.rightShift=function(m,M){return new x(m).rightShift(M)},H.prototype.zeroFillRightShift=H.prototype.rightShift,H.prototype.zeroFillRightShiftS=H.prototype.rightShiftS,H.prototype.zeroFillRightShiftM=H.prototype.rightShiftM,H.zeroFillRightShift=H.rightShift,H.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},H.not=function(m){return new x(m).not()},H.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},H.abs=function(m){return new x(m).abs()},H.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},H.acos=function(m){return new x(m).acos()},H.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},H.acosh=function(m){return new x(m).acosh()},H.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},H.asin=function(m){return new x(m).asin()},H.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},H.asinh=function(m){return new x(m).asinh()},H.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},H.atan=function(m){return new x(m).atan()},H.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},H.atanh=function(m){return new x(m).atanh()},H.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},H.cbrt=function(m){return new x(m).cbrt()},H.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},H.ceil=function(m){return new x(m).ceil()},H.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},H.clz32=function(m){return new x(m).clz32()},H.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},H.cos=function(m){return new x(m).cos()},H.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},H.cosh=function(m){return new x(m).cosh()},H.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},H.exp=function(m){return new x(m).exp()},H.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},H.expm1=function(m){return new x(m).expm1()},H.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},H.floor=function(m){return new x(m).floor()},H.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},H.fround=function(m){return new x(m).fround()},H.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},H.log=function(m){return new x(m).log()},H.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},H.log1p=function(m){return new x(m).log1p()},H.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},H.log10=function(m){return new x(m).log10()},H.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},H.log2=function(m){return new x(m).log2()},H.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},H.round=function(m){return new x(m).round()},H.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},H.sign=function(m){return new x(m).sign()},H.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},H.sin=function(m){return new x(m).sin()},H.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},H.sinh=function(m){return new x(m).sinh()},H.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},H.sqrt=function(m){return new x(m).sqrt()},H.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},H.tan=function(m){return new x(m).tan()},H.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},H.tanh=function(m){return new x(m).tanh()},H.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},H.trunc=function(m){return new x(m).trunc()},H.pow=function(m,M){return new x(m).pow(M)},H.prototype.pow=function(m){return typeof m=="number"?this.powS(m):this.powM(m)},H.prototype.powS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,N(this.get(M,j),m));return this},H.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 j=0;j<this.columns;j++)this.set(M,j,N(this.get(M,j),m.get(M,j)));return this}}function gt(H,x,w){let m=w?H.rows:H.rows-1;if(x<0||x>m)throw new RangeError("Row index out of range")}function Et(H,x,w){let m=w?H.columns:H.columns-1;if(x<0||x>m)throw new RangeError("Column index out of range")}function kt(H,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==H.columns)throw new RangeError("vector size must be the same as the number of columns");return x}function zt(H,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==H.rows)throw new RangeError("vector size must be the same as the number of rows");return x}function Ut(H,x){if(!rt.isAnyArray(x))throw new TypeError("row indices must be an array");for(let w=0;w<x.length;w++)if(x[w]<0||x[w]>=H.rows)throw new RangeError("row indices are out of range")}function Qt(H,x){if(!rt.isAnyArray(x))throw new TypeError("column indices must be an array");for(let w=0;w<x.length;w++)if(x[w]<0||x[w]>=H.columns)throw new RangeError("column indices are out of range")}function Ee(H,x,w,m,M){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(tn("startRow",x),tn("endRow",w),tn("startColumn",m),tn("endColumn",M),x>w||m>M||x<0||x>=H.rows||w<0||w>=H.rows||m<0||m>=H.columns||M<0||M>=H.columns)throw new RangeError("Submatrix indices are out of range")}function Le(H,x=0){let w=[];for(let m=0;m<H;m++)w.push(x);return w}function tn(H,x){if(typeof x!="number")throw new TypeError(`${H} must be a number`)}function er(H){if(H.isEmpty())throw new Error("Empty matrix has no elements to index")}function $r(H){let x=Le(H.rows);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[w]+=H.get(w,m);return x}function ca(H){let x=Le(H.columns);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[m]+=H.get(w,m);return x}function as(H){let x=0;for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)x+=H.get(w,m);return x}function Pt(H){let x=Le(H.rows,1);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[w]*=H.get(w,m);return x}function _t(H){let x=Le(H.columns,1);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[m]*=H.get(w,m);return x}function It(H){let x=1;for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)x*=H.get(w,m);return x}function dt(H,x,w){const m=H.rows,M=H.columns,j=[];for(let tt=0;tt<m;tt++){let et=0,st=0,lt=0;for(let Tt=0;Tt<M;Tt++)lt=H.get(tt,Tt)-w[tt],et+=lt,st+=lt*lt;x?j.push((st-et*et/M)/(M-1)):j.push((st-et*et/M)/M)}return j}function St(H,x,w){const m=H.rows,M=H.columns,j=[];for(let tt=0;tt<M;tt++){let et=0,st=0,lt=0;for(let Tt=0;Tt<m;Tt++)lt=H.get(Tt,tt)-w[tt],et+=lt,st+=lt*lt;x?j.push((st-et*et/m)/(m-1)):j.push((st-et*et/m)/m)}return j}function Ct(H,x,w){const m=H.rows,M=H.columns,j=m*M;let tt=0,et=0,st=0;for(let lt=0;lt<m;lt++)for(let Tt=0;Tt<M;Tt++)st=H.get(lt,Tt)-w,tt+=st,et+=st*st;return x?(et-tt*tt/j)/(j-1):(et-tt*tt/j)/j}function Gt(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x[w])}function oe(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x[m])}function ye(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x)}function de(H){const x=[];for(let w=0;w<H.rows;w++){let m=0;for(let M=0;M<H.columns;M++)m+=N(H.get(w,M),2)/(H.columns-1);x.push(Math.sqrt(m))}return x}function _e(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x[w])}function Mn(H){const x=[];for(let w=0;w<H.columns;w++){let m=0;for(let M=0;M<H.rows;M++)m+=N(H.get(M,w),2)/(H.rows-1);x.push(Math.sqrt(m))}return x}function Nn(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x[m])}function Pe(H){const x=H.size-1;let w=0;for(let m=0;m<H.columns;m++)for(let M=0;M<H.rows;M++)w+=N(H.get(M,m),2)/x;return Math.sqrt(w)}function Se(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x)}class re{static from1DArray(x,w,m){if(x*w!==m.length)throw new RangeError("data length does not match given dimensions");let j=new ne(x,w);for(let tt=0;tt<x;tt++)for(let et=0;et<w;et++)j.set(tt,et,m[tt*w+et]);return j}static rowVector(x){let w=new ne(1,x.length);for(let m=0;m<x.length;m++)w.set(0,m,x[m]);return w}static columnVector(x){let w=new ne(x.length,1);for(let m=0;m<x.length;m++)w.set(m,0,x[m]);return w}static zeros(x,w){return new ne(x,w)}static ones(x,w){return new ne(x,w).fill(1)}static rand(x,w,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{random:M=Math.random}=m;let j=new ne(x,w);for(let tt=0;tt<x;tt++)for(let et=0;et<w;et++)j.set(tt,et,M());return j}static randInt(x,w,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{min:M=0,max:j=1e3,random:tt=Math.random}=m;if(!Number.isInteger(M))throw new TypeError("min must be an integer");if(!Number.isInteger(j))throw new TypeError("max must be an integer");if(M>=j)throw new RangeError("min must be smaller than max");let et=j-M,st=new ne(x,w);for(let lt=0;lt<x;lt++)for(let Tt=0;Tt<w;Tt++){let vt=M+Math.round(tt()*et);st.set(lt,Tt,vt)}return st}static eye(x,w,m){w===void 0&&(w=x),m===void 0&&(m=1);let M=Math.min(x,w),j=this.zeros(x,w);for(let tt=0;tt<M;tt++)j.set(tt,tt,m);return j}static diag(x,w,m){let M=x.length;w===void 0&&(w=M),m===void 0&&(m=w);let j=Math.min(M,w,m),tt=this.zeros(w,m);for(let et=0;et<j;et++)tt.set(et,et,x[et]);return tt}static min(x,w){x=this.checkMatrix(x),w=this.checkMatrix(w);let m=x.rows,M=x.columns,j=new ne(m,M);for(let tt=0;tt<m;tt++)for(let et=0;et<M;et++)j.set(tt,et,Math.min(x.get(tt,et),w.get(tt,et)));return j}static max(x,w){x=this.checkMatrix(x),w=this.checkMatrix(w);let m=x.rows,M=x.columns,j=new this(m,M);for(let tt=0;tt<m;tt++)for(let et=0;et<M;et++)j.set(tt,et,Math.max(x.get(tt,et),w.get(tt,et)));return j}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 w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.call(this,w,m);return this}to1DArray(){let x=[];for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.push(this.get(w,m));return x}to2DArray(){let x=[];for(let w=0;w<this.rows;w++){x.push([]);for(let m=0;m<this.columns;m++)x[w].push(this.get(w,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 w=0;w<=x;w++)if(this.get(x,w)!==this.get(w,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,w=0,m=-1,M=!0,j=!1;for(;x<this.rows&&M;){for(w=0,j=!1;w<this.columns&&j===!1;)this.get(x,w)===0?w++:this.get(x,w)===1&&w>m?(j=!0,m=w):(M=!1,j=!0);x++}return M}isReducedEchelonForm(){let x=0,w=0,m=-1,M=!0,j=!1;for(;x<this.rows&&M;){for(w=0,j=!1;w<this.columns&&j===!1;)this.get(x,w)===0?w++:this.get(x,w)===1&&w>m?(j=!0,m=w):(M=!1,j=!0);for(let tt=w+1;tt<this.rows;tt++)this.get(x,tt)!==0&&(M=!1);x++}return M}echelonForm(){let x=this.clone(),w=0,m=0;for(;w<x.rows&&m<x.columns;){let M=w;for(let j=w;j<x.rows;j++)x.get(j,m)>x.get(M,m)&&(M=j);if(x.get(M,m)===0)m++;else{x.swapRows(w,M);let j=x.get(w,m);for(let tt=m;tt<x.columns;tt++)x.set(w,tt,x.get(w,tt)/j);for(let tt=w+1;tt<x.rows;tt++){let et=x.get(tt,m)/x.get(w,m);x.set(tt,m,0);for(let st=m+1;st<x.columns;st++)x.set(tt,st,x.get(tt,st)-x.get(w,st)*et)}w++,m++}}return x}reducedEchelonForm(){let x=this.echelonForm(),w=x.columns,m=x.rows,M=m-1;for(;M>=0;)if(x.maxRow(M)===0)M--;else{let j=0,tt=!1;for(;j<m&&tt===!1;)x.get(M,j)===1?tt=!0:j++;for(let et=0;et<M;et++){let st=x.get(et,j);for(let lt=j;lt<w;lt++){let Tt=x.get(et,lt)-st*x.get(M,lt);x.set(et,lt,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:w=1,columns:m=1}=x;if(!Number.isInteger(w)||w<=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*w,this.columns*m);for(let j=0;j<w;j++)for(let tt=0;tt<m;tt++)M.setSubMatrix(this,this.rows*j,this.columns*tt);return M}fill(x){for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,x);return this}neg(){return this.mulS(-1)}getRow(x){gt(this,x);let w=[];for(let m=0;m<this.columns;m++)w.push(this.get(x,m));return w}getRowVector(x){return ne.rowVector(this.getRow(x))}setRow(x,w){gt(this,x),w=kt(this,w);for(let m=0;m<this.columns;m++)this.set(x,m,w[m]);return this}swapRows(x,w){gt(this,x),gt(this,w);for(let m=0;m<this.columns;m++){let M=this.get(x,m);this.set(x,m,this.get(w,m)),this.set(w,m,M)}return this}getColumn(x){Et(this,x);let w=[];for(let m=0;m<this.rows;m++)w.push(this.get(m,x));return w}getColumnVector(x){return ne.columnVector(this.getColumn(x))}setColumn(x,w){Et(this,x),w=zt(this,w);for(let m=0;m<this.rows;m++)this.set(m,x,w[m]);return this}swapColumns(x,w){Et(this,x),Et(this,w);for(let m=0;m<this.rows;m++){let M=this.get(m,x);this.set(m,x,this.get(m,w)),this.set(m,w,M)}return this}addRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)+x[m]);return this}subRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)-x[m]);return this}mulRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)*x[m]);return this}divRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)/x[m]);return this}addColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)+x[w]);return this}subColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)-x[w]);return this}mulColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)*x[w]);return this}divColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)/x[w]);return this}mulRow(x,w){gt(this,x);for(let m=0;m<this.columns;m++)this.set(x,m,this.get(x,m)*w);return this}mulColumn(x,w){Et(this,x);for(let m=0;m<this.rows;m++)this.set(m,x,this.get(m,x)*w);return this}max(x){if(this.isEmpty())return NaN;switch(x){case"row":{const w=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)>w[m]&&(w[m]=this.get(m,M));return w}case"column":{const w=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)>w[M]&&(w[M]=this.get(m,M));return w}case void 0:{let w=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w&&(w=this.get(m,M));return w}default:throw new Error(`invalid option: ${x}`)}}maxIndex(){er(this);let x=this.get(0,0),w=[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),w[0]=m,w[1]=M);return w}min(x){if(this.isEmpty())return NaN;switch(x){case"row":{const w=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)<w[m]&&(w[m]=this.get(m,M));return w}case"column":{const w=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)<w[M]&&(w[M]=this.get(m,M));return w}case void 0:{let w=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w&&(w=this.get(m,M));return w}default:throw new Error(`invalid option: ${x}`)}}minIndex(){er(this);let x=this.get(0,0),w=[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),w[0]=m,w[1]=M);return w}maxRow(x){if(gt(this,x),this.isEmpty())return NaN;let w=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)>w&&(w=this.get(x,m));return w}maxRowIndex(x){gt(this,x),er(this);let w=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)>w&&(w=this.get(x,M),m[1]=M);return m}minRow(x){if(gt(this,x),this.isEmpty())return NaN;let w=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)<w&&(w=this.get(x,m));return w}minRowIndex(x){gt(this,x),er(this);let w=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)<w&&(w=this.get(x,M),m[1]=M);return m}maxColumn(x){if(Et(this,x),this.isEmpty())return NaN;let w=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)>w&&(w=this.get(m,x));return w}maxColumnIndex(x){Et(this,x),er(this);let w=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)>w&&(w=this.get(M,x),m[0]=M);return m}minColumn(x){if(Et(this,x),this.isEmpty())return NaN;let w=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)<w&&(w=this.get(m,x));return w}minColumnIndex(x){Et(this,x),er(this);let w=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)<w&&(w=this.get(M,x),m[0]=M);return m}diag(){let x=Math.min(this.rows,this.columns),w=[];for(let m=0;m<x;m++)w.push(this.get(m,m));return w}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 w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x+=this.get(w,m),this.set(w,m,x);return this}dot(x){re.isMatrix(x)&&(x=x.to1DArray());let w=this.to1DArray();if(w.length!==x.length)throw new RangeError("vectors do not have the same size");let m=0;for(let M=0;M<w.length;M++)m+=w[M]*x[M];return m}mmul(x){x=ne.checkMatrix(x);let w=this.rows,m=this.columns,M=x.columns,j=new ne(w,M),tt=new Float64Array(m);for(let et=0;et<M;et++){for(let st=0;st<m;st++)tt[st]=x.get(st,et);for(let st=0;st<w;st++){let lt=0;for(let Tt=0;Tt<m;Tt++)lt+=this.get(st,Tt)*tt[Tt];j.set(st,et,lt)}}return j}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 w=ne.eye(this.rows),m=this;for(let M=x;M>=1;M/=2)M&1&&(w=w.mmul(m)),m=m.mmul(m);return w}strassen2x2(x){x=ne.checkMatrix(x);let w=new ne(2,2);const m=this.get(0,0),M=x.get(0,0),j=this.get(0,1),tt=x.get(0,1),et=this.get(1,0),st=x.get(1,0),lt=this.get(1,1),Tt=x.get(1,1),vt=(m+lt)*(M+Tt),Ft=(et+lt)*M,qt=m*(tt-Tt),Lt=lt*(st-M),Zt=(m+j)*Tt,le=(et-m)*(M+tt),bt=(j-lt)*(st+Tt),Wt=vt+Lt-Zt+bt,ue=qt+Zt,we=Ft+Lt,Ae=vt-Ft+qt+le;return w.set(0,0,Wt),w.set(0,1,ue),w.set(1,0,we),w.set(1,1,Ae),w}strassen3x3(x){x=ne.checkMatrix(x);let w=new ne(3,3);const m=this.get(0,0),M=this.get(0,1),j=this.get(0,2),tt=this.get(1,0),et=this.get(1,1),st=this.get(1,2),lt=this.get(2,0),Tt=this.get(2,1),vt=this.get(2,2),Ft=x.get(0,0),qt=x.get(0,1),Lt=x.get(0,2),Zt=x.get(1,0),le=x.get(1,1),bt=x.get(1,2),Wt=x.get(2,0),ue=x.get(2,1),we=x.get(2,2),Ae=(m+M+j-tt-et-Tt-vt)*le,un=(m-tt)*(-qt+le),ge=et*(-Ft+qt+Zt-le-bt-Wt+we),be=(-m+tt+et)*(Ft-qt+le),Ze=(tt+et)*(-Ft+qt),Mt=m*Ft,Yt=(-m+lt+Tt)*(Ft-Lt+bt),Jt=(-m+lt)*(Lt-bt),Ht=(lt+Tt)*(-Ft+Lt),fn=(m+M+j-et-st-lt-Tt)*bt,$e=Tt*(-Ft+Lt+Zt-le-bt-Wt+ue),hn=(-j+Tt+vt)*(le+Wt-ue),vn=(j-vt)*(le-ue),nr=j*Wt,Xn=(Tt+vt)*(-Wt+ue),gn=(-j+et+st)*(bt+Wt-we),ti=(j-st)*(bt-we),vi=(et+st)*(-Wt+we),ze=M*Zt,Fn=st*ue,Mr=tt*Lt,_r=lt*qt,Tn=vt*we,Na=Mt+nr+ze,Js=Ae+be+Ze+Mt+hn+nr+Xn,bd=Mt+Yt+Ht+fn+nr+gn+vi,xd=un+ge+be+Mt+nr+gn+ti,hs=un+be+Ze+Mt+Fn,Wo=nr+gn+ti+vi+Mr,Ed=Mt+Yt+Jt+$e+hn+vn+nr,Kl=hn+vn+nr+Xn+_r,wd=Mt+Yt+Jt+Ht+Tn;return w.set(0,0,Na),w.set(0,1,Js),w.set(0,2,bd),w.set(1,0,xd),w.set(1,1,hs),w.set(1,2,Wo),w.set(2,0,Ed),w.set(2,1,Kl),w.set(2,2,wd),w}mmulStrassen(x){x=ne.checkMatrix(x);let w=this.clone(),m=w.rows,M=w.columns,j=x.rows,tt=x.columns;M!==j&&console.warn(`Multiplying ${m} x ${M} and ${j} x ${tt} matrix: dimensions do not match.`);function et(vt,Ft,qt){let Lt=vt.rows,Zt=vt.columns;if(Lt===Ft&&Zt===qt)return vt;{let le=re.zeros(Ft,qt);return le=le.setSubMatrix(vt,0,0),le}}let st=Math.max(m,j),lt=Math.max(M,tt);w=et(w,st,lt),x=et(x,st,lt);function Tt(vt,Ft,qt,Lt){if(qt<=512||Lt<=512)return vt.mmul(Ft);qt%2===1&&Lt%2===1?(vt=et(vt,qt+1,Lt+1),Ft=et(Ft,qt+1,Lt+1)):qt%2===1?(vt=et(vt,qt+1,Lt),Ft=et(Ft,qt+1,Lt)):Lt%2===1&&(vt=et(vt,qt,Lt+1),Ft=et(Ft,qt,Lt+1));let Zt=parseInt(vt.rows/2,10),le=parseInt(vt.columns/2,10),bt=vt.subMatrix(0,Zt-1,0,le-1),Wt=Ft.subMatrix(0,Zt-1,0,le-1),ue=vt.subMatrix(0,Zt-1,le,vt.columns-1),we=Ft.subMatrix(0,Zt-1,le,Ft.columns-1),Ae=vt.subMatrix(Zt,vt.rows-1,0,le-1),un=Ft.subMatrix(Zt,Ft.rows-1,0,le-1),ge=vt.subMatrix(Zt,vt.rows-1,le,vt.columns-1),be=Ft.subMatrix(Zt,Ft.rows-1,le,Ft.columns-1),Ze=Tt(re.add(bt,ge),re.add(Wt,be),Zt,le),Mt=Tt(re.add(Ae,ge),Wt,Zt,le),Yt=Tt(bt,re.sub(we,be),Zt,le),Jt=Tt(ge,re.sub(un,Wt),Zt,le),Ht=Tt(re.add(bt,ue),be,Zt,le),fn=Tt(re.sub(Ae,bt),re.add(Wt,we),Zt,le),$e=Tt(re.sub(ue,ge),re.add(un,be),Zt,le),hn=re.add(Ze,Jt);hn.sub(Ht),hn.add($e);let vn=re.add(Yt,Ht),nr=re.add(Mt,Jt),Xn=re.sub(Ze,Mt);Xn.add(Yt),Xn.add(fn);let gn=re.zeros(2*hn.rows,2*hn.columns);return gn=gn.setSubMatrix(hn,0,0),gn=gn.setSubMatrix(vn,hn.rows,0),gn=gn.setSubMatrix(nr,0,hn.columns),gn=gn.setSubMatrix(Xn,hn.rows,hn.columns),gn.subMatrix(0,qt-1,0,Lt-1)}return Tt(w,x,st,lt)}scaleRows(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:w=0,max:m=1}=x;if(!Number.isFinite(w))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(w>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let j=0;j<this.rows;j++){const tt=this.getRow(j);tt.length>0&&nt(tt,{min:w,max:m,output:tt}),M.setRow(j,tt)}return M}scaleColumns(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:w=0,max:m=1}=x;if(!Number.isFinite(w))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(w>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let j=0;j<this.columns;j++){const tt=this.getColumn(j);tt.length&&nt(tt,{min:w,max:m,output:tt}),M.setColumn(j,tt)}return M}flipRows(){const x=Math.ceil(this.columns/2);for(let w=0;w<this.rows;w++)for(let m=0;m<x;m++){let M=this.get(w,m),j=this.get(w,this.columns-1-m);this.set(w,m,j),this.set(w,this.columns-1-m,M)}return this}flipColumns(){const x=Math.ceil(this.rows/2);for(let w=0;w<this.columns;w++)for(let m=0;m<x;m++){let M=this.get(m,w),j=this.get(this.rows-1-m,w);this.set(m,w,j),this.set(this.rows-1-m,w,M)}return this}kroneckerProduct(x){x=ne.checkMatrix(x);let w=this.rows,m=this.columns,M=x.rows,j=x.columns,tt=new ne(w*M,m*j);for(let et=0;et<w;et++)for(let st=0;st<m;st++)for(let lt=0;lt<M;lt++)for(let Tt=0;Tt<j;Tt++)tt.set(M*et+lt,j*st+Tt,this.get(et,st)*x.get(lt,Tt));return tt}kroneckerSum(x){if(x=ne.checkMatrix(x),!this.isSquare()||!x.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let w=this.rows,m=x.rows,M=this.kroneckerProduct(ne.eye(m,m)),j=ne.eye(w,w).kroneckerProduct(x);return M.add(j)}transpose(){let x=new ne(this.columns,this.rows);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.set(m,w,this.get(w,m));return x}sortRows(x=Oe){for(let w=0;w<this.rows;w++)this.setRow(w,this.getRow(w).sort(x));return this}sortColumns(x=Oe){for(let w=0;w<this.columns;w++)this.setColumn(w,this.getColumn(w).sort(x));return this}subMatrix(x,w,m,M){Ee(this,x,w,m,M);let j=new ne(w-x+1,M-m+1);for(let tt=x;tt<=w;tt++)for(let et=m;et<=M;et++)j.set(tt-x,et-m,this.get(tt,et));return j}subMatrixRow(x,w,m){if(w===void 0&&(w=0),m===void 0&&(m=this.columns-1),w>m||w<0||w>=this.columns||m<0||m>=this.columns)throw new RangeError("Argument out of range");let M=new ne(x.length,m-w+1);for(let j=0;j<x.length;j++)for(let tt=w;tt<=m;tt++){if(x[j]<0||x[j]>=this.rows)throw new RangeError(`Row index out of range: ${x[j]}`);M.set(j,tt-w,this.get(x[j],tt))}return M}subMatrixColumn(x,w,m){if(w===void 0&&(w=0),m===void 0&&(m=this.rows-1),w>m||w<0||w>=this.rows||m<0||m>=this.rows)throw new RangeError("Argument out of range");let M=new ne(m-w+1,x.length);for(let j=0;j<x.length;j++)for(let tt=w;tt<=m;tt++){if(x[j]<0||x[j]>=this.columns)throw new RangeError(`Column index out of range: ${x[j]}`);M.set(tt-w,j,this.get(tt,x[j]))}return M}setSubMatrix(x,w,m){if(x=ne.checkMatrix(x),x.isEmpty())return this;let M=w+x.rows-1,j=m+x.columns-1;Ee(this,w,M,m,j);for(let tt=0;tt<x.rows;tt++)for(let et=0;et<x.columns;et++)this.set(w+tt,m+et,x.get(tt,et));return this}selection(x,w){Ut(this,x),Qt(this,w);let m=new ne(x.length,w.length);for(let M=0;M<x.length;M++){let j=x[M];for(let tt=0;tt<w.length;tt++){let et=w[tt];m.set(M,tt,this.get(j,et))}}return m}trace(){let x=Math.min(this.rows,this.columns),w=0;for(let m=0;m<x;m++)w+=this.get(m,m);return w}clone(){return this.constructor.copy(this,new ne(this.rows,this.columns))}static copy(x,w){for(const[m,M,j]of x.entries())w.set(m,M,j);return w}sum(x){switch(x){case"row":return $r(this);case"column":return ca(this);case void 0:return as(this);default:throw new Error(`invalid option: ${x}`)}}product(x){switch(x){case"row":return Pt(this);case"column":return _t(this);case void 0:return It(this);default:throw new Error(`invalid option: ${x}`)}}mean(x){const w=this.sum(x);switch(x){case"row":{for(let m=0;m<this.rows;m++)w[m]/=this.columns;return w}case"column":{for(let m=0;m<this.columns;m++)w[m]/=this.rows;return w}case void 0:return w/this.size;default:throw new Error(`invalid option: ${x}`)}}variance(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");const{unbiased:m=!0,mean:M=this.mean(x)}=w;if(typeof m!="boolean")throw new TypeError("unbiased must be a boolean");switch(x){case"row":{if(!rt.isAnyArray(M))throw new TypeError("mean must be an array");return dt(this,m,M)}case"column":{if(!rt.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 Ct(this,m,M)}default:throw new Error(`invalid option: ${x}`)}}standardDeviation(x,w){typeof x=="object"&&(w=x,x=void 0);const m=this.variance(x,w);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,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");const{center:m=this.mean(x)}=w;switch(x){case"row":{if(!rt.isAnyArray(m))throw new TypeError("center must be an array");return Gt(this,m),this}case"column":{if(!rt.isAnyArray(m))throw new TypeError("center must be an array");return oe(this,m),this}case void 0:{if(typeof m!="number")throw new TypeError("center must be a number");return ye(this,m),this}default:throw new Error(`invalid option: ${x}`)}}scale(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");let m=w.scale;switch(x){case"row":{if(m===void 0)m=de(this);else if(!rt.isAnyArray(m))throw new TypeError("scale must be an array");return _e(this,m),this}case"column":{if(m===void 0)m=Mn(this);else if(!rt.isAnyArray(m))throw new TypeError("scale must be an array");return Nn(this,m),this}case void 0:{if(m===void 0)m=Pe(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 ut(this,x)}[Symbol.iterator](){return this.entries()}*entries(){for(let x=0;x<this.rows;x++)for(let w=0;w<this.columns;w++)yield[x,w,this.get(x,w)]}*values(){for(let x=0;x<this.rows;x++)for(let w=0;w<this.columns;w++)yield this.get(x,w)}}re.prototype.klass="Matrix",typeof Symbol!="undefined"&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=at);function Oe(H,x){return H-x}function cr(H){return H.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 ua=class X0 extends re{constructor(x,w){if(super(),L(this,W),k(this,"data"),X0.isMatrix(x))D(this,W,X).call(this,x.rows,x.columns),X0.copy(x,this);else if(Number.isInteger(x)&&x>=0)D(this,W,X).call(this,x,w);else if(rt.isAnyArray(x)){const m=x;if(x=m.length,w=x?m[0].length:0,typeof w!="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!==w)throw new RangeError("Inconsistent array dimensions");if(!cr(m[M]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(m[M]))}this.rows=x,this.columns=w}else throw new TypeError("First argument must be a positive number or an array")}set(x,w,m){return this.data[x][w]=m,this}get(x,w){return this.data[x][w]}removeRow(x){return gt(this,x),this.data.splice(x,1),this.rows-=1,this}addRow(x,w){return w===void 0&&(w=x,x=this.rows),gt(this,x,!0),w=Float64Array.from(kt(this,w)),this.data.splice(x,0,w),this.rows+=1,this}removeColumn(x){Et(this,x);for(let w=0;w<this.rows;w++){const m=new Float64Array(this.columns-1);for(let M=0;M<x;M++)m[M]=this.data[w][M];for(let M=x+1;M<this.columns;M++)m[M-1]=this.data[w][M];this.data[w]=m}return this.columns-=1,this}addColumn(x,w){typeof w=="undefined"&&(w=x,x=this.columns),Et(this,x,!0),w=zt(this,w);for(let m=0;m<this.rows;m++){const M=new Float64Array(this.columns+1);let j=0;for(;j<x;j++)M[j]=this.data[m][j];for(M[j++]=w[m];j<this.columns+1;j++)M[j]=this.data[m][j-1];this.data[m]=M}return this.columns+=1,this}};W=new WeakSet,X=function(H,x){if(this.data=[],Number.isInteger(x)&&x>=0)for(let w=0;w<H;w++)this.data.push(new Float64Array(x));else throw new TypeError("nColumns must be a positive integer");this.rows=H,this.columns=x};let ne=ua;wt(re,ne);const ss=class K0 extends re{constructor(x){if(super(),L(this,K),ne.isMatrix(x)){if(!x.isSymmetric())throw new TypeError("not symmetric data");z(this,K,ne.copy(x,new ne(x.rows,x.rows)))}else if(Number.isInteger(x)&&x>=0)z(this,K,new ne(x,x));else if(z(this,K,new ne(x)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return C(this,K).size}get rows(){return C(this,K).rows}get columns(){return C(this,K).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 K0(this.diagonalSize);for(const[w,m,M]of this.upperRightEntries())x.set(w,m,M);return x}toMatrix(){return new ne(this)}get(x,w){return C(this,K).get(x,w)}set(x,w,m){return C(this,K).set(x,w,m),C(this,K).set(w,x,m),this}removeCross(x){return C(this,K).removeRow(x),C(this,K).removeColumn(x),this}addCross(x,w){w===void 0&&(w=x,x=this.diagonalSize);const m=w.slice();return m.splice(x,1),C(this,K).addRow(x,m),C(this,K).addColumn(x,w),this}applyMask(x){if(x.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const w=[];for(const[m,M]of x.entries())M||w.push(m);w.reverse();for(const m of w)this.removeCross(m);return this}toCompact(){const{diagonalSize:x}=this,w=new Array(x*(x+1)/2);for(let m=0,M=0,j=0;j<w.length;j++)w[j]=this.get(M,m),++m>=x&&(m=++M);return w}static fromCompact(x){const w=x.length,m=(Math.sqrt(8*w+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 K0(m);for(let j=0,tt=0,et=0;et<w;et++)M.set(j,tt,x[et]),++j>=m&&(j=++tt);return M}*upperRightEntries(){for(let x=0,w=0;x<this.diagonalSize;void 0){const m=this.get(x,w);yield[x,w,m],++w>=this.diagonalSize&&(w=++x)}}*upperRightValues(){for(let x=0,w=0;x<this.diagonalSize;void 0)yield this.get(x,w),++w>=this.diagonalSize&&(w=++x)}};K=new WeakMap;let Rr=ss;Rr.prototype.klassType="SymmetricMatrix";class Hn extends Rr{static isDistanceMatrix(x){return Rr.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,w,m){return x===w&&(m=0),super.set(x,w,m)}addCross(x,w){return w===void 0&&(w=x,x=this.diagonalSize),w=w.slice(),w[x]=0,super.addCross(x,w)}toSymmetricMatrix(){return new Rr(this)}clone(){const x=new Hn(this.diagonalSize);for(const[w,m,M]of this.upperRightEntries())w!==m&&x.set(w,m,M);return x}toCompact(){const{diagonalSize:x}=this,w=(x-1)*x/2,m=new Array(w);for(let M=1,j=0,tt=0;tt<m.length;tt++)m[tt]=this.get(j,M),++M>=x&&(M=++j+1);return m}static fromCompact(x){const w=x.length;if(w===0)return new this(0);const m=(Math.sqrt(8*w+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 j=1,tt=0,et=0;et<w;et++)M.set(j,tt,x[et]),++j>=m&&(j=++tt+1);return M}}Hn.prototype.klassSubType="DistanceMatrix";class Lr extends re{constructor(x,w,m){super(),this.matrix=x,this.rows=w,this.columns=m}}class os extends Lr{constructor(x,w){Et(x,w),super(x,x.rows,1),this.column=w}set(x,w,m){return this.matrix.set(x,this.column,m),this}get(x){return this.matrix.get(x,this.column)}}class ha extends Lr{constructor(x,w){Qt(x,w),super(x,x.rows,w.length),this.columnIndices=w}set(x,w,m){return this.matrix.set(x,this.columnIndices[w],m),this}get(x,w){return this.matrix.get(x,this.columnIndices[w])}}class qs extends Lr{constructor(x){super(x,x.rows,x.columns)}set(x,w,m){return this.matrix.set(x,this.columns-w-1,m),this}get(x,w){return this.matrix.get(x,this.columns-w-1)}}class da extends Lr{constructor(x){super(x,x.rows,x.columns)}set(x,w,m){return this.matrix.set(this.rows-x-1,w,m),this}get(x,w){return this.matrix.get(this.rows-x-1,w)}}class Fo extends Lr{constructor(x,w){gt(x,w),super(x,1,x.columns),this.row=w}set(x,w,m){return this.matrix.set(this.row,w,m),this}get(x,w){return this.matrix.get(this.row,w)}}class ls extends Lr{constructor(x,w){Ut(x,w),super(x,w.length,x.columns),this.rowIndices=w}set(x,w,m){return this.matrix.set(this.rowIndices[x],w,m),this}get(x,w){return this.matrix.get(this.rowIndices[x],w)}}class cs extends Lr{constructor(x,w,m){Ut(x,w),Qt(x,m),super(x,w.length,m.length),this.rowIndices=w,this.columnIndices=m}set(x,w,m){return this.matrix.set(this.rowIndices[x],this.columnIndices[w],m),this}get(x,w){return this.matrix.get(this.rowIndices[x],this.columnIndices[w])}}class us extends Lr{constructor(x,w,m,M,j){Ee(x,w,m,M,j),super(x,m-w+1,j-M+1),this.startRow=w,this.startColumn=M}set(x,w,m){return this.matrix.set(this.startRow+x,this.startColumn+w,m),this}get(x,w){return this.matrix.get(this.startRow+x,this.startColumn+w)}}class Ti extends Lr{constructor(x){super(x,x.columns,x.rows)}set(x,w,m){return this.matrix.set(w,x,m),this}get(x,w){return this.matrix.get(w,x)}}class Oi extends re{constructor(x,w={}){const{rows:m=1}=w;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,w,m){let M=this._calculateIndex(x,w);return this.data[M]=m,this}get(x,w){let m=this._calculateIndex(x,w);return this.data[m]}_calculateIndex(x,w){return x*this.columns+w}}class An extends re{constructor(x){super(),this.data=x,this.rows=x.length,this.columns=x[0].length}set(x,w,m){return this.data[x][w]=m,this}get(x,w){return this.data[x][w]}}function dd(H,x){if(rt.isAnyArray(H))return H[0]&&rt.isAnyArray(H[0])?new An(H):new Oi(H,x);throw new Error("the argument is not an array")}class Ui{constructor(x){x=An.checkMatrix(x);let w=x.clone(),m=w.rows,M=w.columns,j=new Float64Array(m),tt=1,et,st,lt,Tt,vt,Ft,qt,Lt,Zt;for(et=0;et<m;et++)j[et]=et;for(Lt=new Float64Array(m),st=0;st<M;st++){for(et=0;et<m;et++)Lt[et]=w.get(et,st);for(et=0;et<m;et++){for(Zt=Math.min(et,st),vt=0,lt=0;lt<Zt;lt++)vt+=w.get(et,lt)*Lt[lt];Lt[et]-=vt,w.set(et,st,Lt[et])}for(Tt=st,et=st+1;et<m;et++)Math.abs(Lt[et])>Math.abs(Lt[Tt])&&(Tt=et);if(Tt!==st){for(lt=0;lt<M;lt++)Ft=w.get(Tt,lt),w.set(Tt,lt,w.get(st,lt)),w.set(st,lt,Ft);qt=j[Tt],j[Tt]=j[st],j[st]=qt,tt=-tt}if(st<m&&w.get(st,st)!==0)for(et=st+1;et<m;et++)w.set(et,st,w.get(et,st)/w.get(st,st))}this.LU=w,this.pivotVector=j,this.pivotSign=tt}isSingular(){let x=this.LU,w=x.columns;for(let m=0;m<w;m++)if(x.get(m,m)===0)return!0;return!1}solve(x){x=ne.checkMatrix(x);let w=this.LU;if(w.rows!==x.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let M=x.columns,j=x.subMatrixRow(this.pivotVector,0,M-1),tt=w.columns,et,st,lt;for(lt=0;lt<tt;lt++)for(et=lt+1;et<tt;et++)for(st=0;st<M;st++)j.set(et,st,j.get(et,st)-j.get(lt,st)*w.get(et,lt));for(lt=tt-1;lt>=0;lt--){for(st=0;st<M;st++)j.set(lt,st,j.get(lt,st)/w.get(lt,lt));for(et=0;et<lt;et++)for(st=0;st<M;st++)j.set(et,st,j.get(et,st)-j.get(lt,st)*w.get(et,lt))}return j}get determinant(){let x=this.LU;if(!x.isSquare())throw new Error("Matrix must be square");let w=this.pivotSign,m=x.columns;for(let M=0;M<m;M++)w*=x.get(M,M);return w}get lowerTriangularMatrix(){let x=this.LU,w=x.rows,m=x.columns,M=new ne(w,m);for(let j=0;j<w;j++)for(let tt=0;tt<m;tt++)j>tt?M.set(j,tt,x.get(j,tt)):j===tt?M.set(j,tt,1):M.set(j,tt,0);return M}get upperTriangularMatrix(){let x=this.LU,w=x.rows,m=x.columns,M=new ne(w,m);for(let j=0;j<w;j++)for(let tt=0;tt<m;tt++)j<=tt?M.set(j,tt,x.get(j,tt)):M.set(j,tt,0);return M}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Ci(H,x){let w=0;return Math.abs(H)>Math.abs(x)?(w=x/H,Math.abs(H)*Math.sqrt(1+w*w)):x!==0?(w=H/x,Math.abs(x)*Math.sqrt(1+w*w)):0}class zo{constructor(x){x=An.checkMatrix(x);let w=x.clone(),m=x.rows,M=x.columns,j=new Float64Array(M),tt,et,st,lt;for(st=0;st<M;st++){let Tt=0;for(tt=st;tt<m;tt++)Tt=Ci(Tt,w.get(tt,st));if(Tt!==0){for(w.get(st,st)<0&&(Tt=-Tt),tt=st;tt<m;tt++)w.set(tt,st,w.get(tt,st)/Tt);for(w.set(st,st,w.get(st,st)+1),et=st+1;et<M;et++){for(lt=0,tt=st;tt<m;tt++)lt+=w.get(tt,st)*w.get(tt,et);for(lt=-lt/w.get(st,st),tt=st;tt<m;tt++)w.set(tt,et,w.get(tt,et)+lt*w.get(tt,st))}}j[st]=-Tt}this.QR=w,this.Rdiag=j}solve(x){x=ne.checkMatrix(x);let w=this.QR,m=w.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,j=x.clone(),tt=w.columns,et,st,lt,Tt;for(lt=0;lt<tt;lt++)for(st=0;st<M;st++){for(Tt=0,et=lt;et<m;et++)Tt+=w.get(et,lt)*j.get(et,st);for(Tt=-Tt/w.get(lt,lt),et=lt;et<m;et++)j.set(et,st,j.get(et,st)+Tt*w.get(et,lt))}for(lt=tt-1;lt>=0;lt--){for(st=0;st<M;st++)j.set(lt,st,j.get(lt,st)/this.Rdiag[lt]);for(et=0;et<lt;et++)for(st=0;st<M;st++)j.set(et,st,j.get(et,st)-j.get(lt,st)*w.get(et,lt))}return j.subMatrix(0,tt-1,0,M-1)}isFullRank(){let x=this.QR.columns;for(let w=0;w<x;w++)if(this.Rdiag[w]===0)return!1;return!0}get upperTriangularMatrix(){let x=this.QR,w=x.columns,m=new ne(w,w),M,j;for(M=0;M<w;M++)for(j=0;j<w;j++)M<j?m.set(M,j,x.get(M,j)):M===j?m.set(M,j,this.Rdiag[M]):m.set(M,j,0);return m}get orthogonalMatrix(){let x=this.QR,w=x.rows,m=x.columns,M=new ne(w,m),j,tt,et,st;for(et=m-1;et>=0;et--){for(j=0;j<w;j++)M.set(j,et,0);for(M.set(et,et,1),tt=et;tt<m;tt++)if(x.get(et,et)!==0){for(st=0,j=et;j<w;j++)st+=x.get(j,et)*M.get(j,tt);for(st=-st/x.get(et,et),j=et;j<w;j++)M.set(j,tt,M.get(j,tt)+st*x.get(j,et))}}return M}}class Ca{constructor(x,w={}){if(x=An.checkMatrix(x),x.isEmpty())throw new Error("Matrix must be non-empty");let m=x.rows,M=x.columns;const{computeLeftSingularVectors:j=!0,computeRightSingularVectors:tt=!0,autoTranspose:et=!1}=w;let st=!!j,lt=!!tt,Tt=!1,vt;if(m<M)if(!et)vt=x.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{vt=x.transpose(),m=vt.rows,M=vt.columns,Tt=!0;let Mt=st;st=lt,lt=Mt}else vt=x.clone();let Ft=Math.min(m,M),qt=Math.min(m+1,M),Lt=new Float64Array(qt),Zt=new ne(m,Ft),le=new ne(M,M),bt=new Float64Array(M),Wt=new Float64Array(m),ue=new Float64Array(qt);for(let Mt=0;Mt<qt;Mt++)ue[Mt]=Mt;let we=Math.min(m-1,M),Ae=Math.max(0,Math.min(M-2,m)),un=Math.max(we,Ae);for(let Mt=0;Mt<un;Mt++){if(Mt<we){Lt[Mt]=0;for(let Yt=Mt;Yt<m;Yt++)Lt[Mt]=Ci(Lt[Mt],vt.get(Yt,Mt));if(Lt[Mt]!==0){vt.get(Mt,Mt)<0&&(Lt[Mt]=-Lt[Mt]);for(let Yt=Mt;Yt<m;Yt++)vt.set(Yt,Mt,vt.get(Yt,Mt)/Lt[Mt]);vt.set(Mt,Mt,vt.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+=vt.get(Ht,Mt)*vt.get(Ht,Yt);Jt=-Jt/vt.get(Mt,Mt);for(let Ht=Mt;Ht<m;Ht++)vt.set(Ht,Yt,vt.get(Ht,Yt)+Jt*vt.get(Ht,Mt))}bt[Yt]=vt.get(Mt,Yt)}if(st&&Mt<we)for(let Yt=Mt;Yt<m;Yt++)Zt.set(Yt,Mt,vt.get(Yt,Mt));if(Mt<Ae){bt[Mt]=0;for(let Yt=Mt+1;Yt<M;Yt++)bt[Mt]=Ci(bt[Mt],bt[Yt]);if(bt[Mt]!==0){bt[Mt+1]<0&&(bt[Mt]=0-bt[Mt]);for(let Yt=Mt+1;Yt<M;Yt++)bt[Yt]/=bt[Mt];bt[Mt+1]+=1}if(bt[Mt]=-bt[Mt],Mt+1<m&&bt[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]+=bt[Jt]*vt.get(Yt,Jt);for(let Yt=Mt+1;Yt<M;Yt++){let Jt=-bt[Yt]/bt[Mt+1];for(let Ht=Mt+1;Ht<m;Ht++)vt.set(Ht,Yt,vt.get(Ht,Yt)+Jt*Wt[Ht])}}if(lt)for(let Yt=Mt+1;Yt<M;Yt++)le.set(Yt,Mt,bt[Yt])}}let ge=Math.min(M,m+1);if(we<M&&(Lt[we]=vt.get(we,we)),m<ge&&(Lt[ge-1]=0),Ae+1<ge&&(bt[Ae]=vt.get(Ae,ge-1)),bt[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(lt)for(let Mt=M-1;Mt>=0;Mt--){if(Mt<Ae&&bt[Mt]!==0)for(let Yt=Mt+1;Yt<M;Yt++){let Jt=0;for(let Ht=Mt+1;Ht<M;Ht++)Jt+=le.get(Ht,Mt)*le.get(Ht,Yt);Jt=-Jt/le.get(Mt+1,Mt);for(let Ht=Mt+1;Ht<M;Ht++)le.set(Ht,Yt,le.get(Ht,Yt)+Jt*le.get(Ht,Mt))}for(let Yt=0;Yt<M;Yt++)le.set(Yt,Mt,0);le.set(Mt,Mt,1)}let be=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(bt[Mt])<=Jt||Number.isNaN(bt[Mt])){bt[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(bt[Jt]):0)+(Jt!==Mt+1?Math.abs(bt[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=bt[ge-2];bt[ge-2]=0;for(let Ht=ge-2;Ht>=Mt;Ht--){let fn=Ci(Lt[Ht],Jt),$e=Lt[Ht]/fn,hn=Jt/fn;if(Lt[Ht]=fn,Ht!==Mt&&(Jt=-hn*bt[Ht-1],bt[Ht-1]=$e*bt[Ht-1]),lt)for(let vn=0;vn<M;vn++)fn=$e*le.get(vn,Ht)+hn*le.get(vn,ge-1),le.set(vn,ge-1,-hn*le.get(vn,Ht)+$e*le.get(vn,ge-1)),le.set(vn,Ht,fn)}break}case 2:{let Jt=bt[Mt-1];bt[Mt-1]=0;for(let Ht=Mt;Ht<ge;Ht++){let fn=Ci(Lt[Ht],Jt),$e=Lt[Ht]/fn,hn=Jt/fn;if(Lt[Ht]=fn,Jt=-hn*bt[Ht],bt[Ht]=$e*bt[Ht],st)for(let vn=0;vn<m;vn++)fn=$e*Zt.get(vn,Ht)+hn*Zt.get(vn,Mt-1),Zt.set(vn,Mt-1,-hn*Zt.get(vn,Ht)+$e*Zt.get(vn,Mt-1)),Zt.set(vn,Ht,fn)}break}case 3:{const Jt=Math.max(Math.abs(Lt[ge-1]),Math.abs(Lt[ge-2]),Math.abs(bt[ge-2]),Math.abs(Lt[Mt]),Math.abs(bt[Mt])),Ht=Lt[ge-1]/Jt,fn=Lt[ge-2]/Jt,$e=bt[ge-2]/Jt,hn=Lt[Mt]/Jt,vn=bt[Mt]/Jt,nr=((fn+Ht)*(fn-Ht)+$e*$e)/2,Xn=Ht*$e*(Ht*$e);let gn=0;(nr!==0||Xn!==0)&&(nr<0?gn=0-Math.sqrt(nr*nr+Xn):gn=Math.sqrt(nr*nr+Xn),gn=Xn/(nr+gn));let ti=(hn+Ht)*(hn-Ht)+gn,vi=hn*vn;for(let ze=Mt;ze<ge-1;ze++){let Fn=Ci(ti,vi);Fn===0&&(Fn=Number.MIN_VALUE);let Mr=ti/Fn,_r=vi/Fn;if(ze!==Mt&&(bt[ze-1]=Fn),ti=Mr*Lt[ze]+_r*bt[ze],bt[ze]=Mr*bt[ze]-_r*Lt[ze],vi=_r*Lt[ze+1],Lt[ze+1]=Mr*Lt[ze+1],lt)for(let Tn=0;Tn<M;Tn++)Fn=Mr*le.get(Tn,ze)+_r*le.get(Tn,ze+1),le.set(Tn,ze+1,-_r*le.get(Tn,ze)+Mr*le.get(Tn,ze+1)),le.set(Tn,ze,Fn);if(Fn=Ci(ti,vi),Fn===0&&(Fn=Number.MIN_VALUE),Mr=ti/Fn,_r=vi/Fn,Lt[ze]=Fn,ti=Mr*bt[ze]+_r*Lt[ze+1],Lt[ze+1]=-_r*bt[ze]+Mr*Lt[ze+1],vi=_r*bt[ze+1],bt[ze+1]=Mr*bt[ze+1],st&&ze<m-1)for(let Tn=0;Tn<m;Tn++)Fn=Mr*Zt.get(Tn,ze)+_r*Zt.get(Tn,ze+1),Zt.set(Tn,ze+1,-_r*Zt.get(Tn,ze)+Mr*Zt.get(Tn,ze+1)),Zt.set(Tn,ze,Fn)}bt[ge-2]=ti;break}case 4:{if(Lt[Mt]<=0&&(Lt[Mt]=Lt[Mt]<0?-Lt[Mt]:0,lt))for(let Jt=0;Jt<=be;Jt++)le.set(Jt,Mt,-le.get(Jt,Mt));for(;Mt<be&&!(Lt[Mt]>=Lt[Mt+1]);){let Jt=Lt[Mt];if(Lt[Mt]=Lt[Mt+1],Lt[Mt+1]=Jt,lt&&Mt<M-1)for(let Ht=0;Ht<M;Ht++)Jt=le.get(Ht,Mt+1),le.set(Ht,Mt+1,le.get(Ht,Mt)),le.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=le;le=Zt,Zt=Mt}this.m=m,this.n=M,this.s=Lt,this.U=Zt,this.V=le}solve(x){let w=x,m=this.threshold,M=this.s.length,j=ne.zeros(M,M);for(let Ft=0;Ft<M;Ft++)Math.abs(this.s[Ft])<=m?j.set(Ft,Ft,0):j.set(Ft,Ft,1/this.s[Ft]);let tt=this.U,et=this.rightSingularVectors,st=et.mmul(j),lt=et.rows,Tt=tt.rows,vt=ne.zeros(lt,Tt);for(let Ft=0;Ft<lt;Ft++)for(let qt=0;qt<Tt;qt++){let Lt=0;for(let Zt=0;Zt<M;Zt++)Lt+=st.get(Ft,Zt)*tt.get(qt,Zt);vt.set(Ft,qt,Lt)}return vt.mmul(w)}solveForDiagonal(x){return this.solve(ne.diag(x))}inverse(){let x=this.V,w=this.threshold,m=x.rows,M=x.columns,j=new ne(m,this.s.length);for(let Tt=0;Tt<m;Tt++)for(let vt=0;vt<M;vt++)Math.abs(this.s[vt])>w&&j.set(Tt,vt,x.get(Tt,vt)/this.s[vt]);let tt=this.U,et=tt.rows,st=tt.columns,lt=new ne(m,et);for(let Tt=0;Tt<m;Tt++)for(let vt=0;vt<et;vt++){let Ft=0;for(let qt=0;qt<st;qt++)Ft+=j.get(Tt,qt)*tt.get(vt,qt);lt.set(Tt,vt,Ft)}return lt}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,w=0,m=this.s;for(let M=0,j=m.length;M<j;M++)m[M]>x&&w++;return w}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 Q0(H,x=!1){return H=An.checkMatrix(H),x?new Ca(H).inverse():fd(H,ne.eye(H.rows))}function fd(H,x,w=!1){return H=An.checkMatrix(H),x=An.checkMatrix(x),w?new Ca(H).solve(x):H.isSquare()?new Ui(H).solve(x):new zo(H).solve(x)}function jo(H){if(H=ne.checkMatrix(H),H.isSquare()){if(H.columns===0)return 1;let x,w,m,M;if(H.columns===2)return x=H.get(0,0),w=H.get(0,1),m=H.get(1,0),M=H.get(1,1),x*M-w*m;if(H.columns===3){let j,tt,et;return j=new cs(H,[1,2],[1,2]),tt=new cs(H,[1,2],[0,2]),et=new cs(H,[1,2],[0,1]),x=H.get(0,0),w=H.get(0,1),m=H.get(0,2),x*jo(j)-w*jo(tt)+m*jo(et)}else return new Ui(H).determinant}else throw Error("determinant can only be calculated for a square matrix")}function q0(H,x){let w=[];for(let m=0;m<H;m++)m!==x&&w.push(m);return w}function J0(H,x,w,m=1e-9,M=1e-9){if(H>M)return new Array(x.rows+1).fill(0);{let j=x.addRow(w,[0]);for(let tt=0;tt<j.rows;tt++)Math.abs(j.get(tt,0))<m&&j.set(tt,0,0);return j.to1DArray()}}function $0(H,x={}){const{thresholdValue:w=1e-9,thresholdError:m=1e-9}=x;H=ne.checkMatrix(H);let M=H.rows,j=new ne(M,M);for(let tt=0;tt<M;tt++){let et=ne.columnVector(H.getRow(tt)),st=H.subMatrixRow(q0(M,tt)).transpose(),Tt=new Ca(st).solve(et),vt=ne.sub(et,st.mmul(Tt)).abs().max();j.setRow(tt,J0(vt,Tt,tt,w,m))}return j}function tg(H,x=Number.EPSILON){if(H=ne.checkMatrix(H),H.isEmpty())return H.transpose();let w=new Ca(H,{autoTranspose:!0}),m=w.leftSingularVectors,M=w.rightSingularVectors,j=w.diagonal;for(let tt=0;tt<j.length;tt++)Math.abs(j[tt])>x?j[tt]=1/j[tt]:j[tt]=0;return M.mmul(ne.diag(j).mmul(m.transpose()))}function eg(H,x=H,w={}){H=new ne(H);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!rt.isAnyArray(x)?(w=x,x=H,m=!0):x=new ne(x),H.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0}=w;M&&(H=H.center("column"),m||(x=x.center("column")));const j=H.transpose().mmul(x);for(let tt=0;tt<j.rows;tt++)for(let et=0;et<j.columns;et++)j.set(tt,et,j.get(tt,et)*(1/(H.rows-1)));return j}function vd(H,x=H,w={}){H=new ne(H);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!rt.isAnyArray(x)?(w=x,x=H,m=!0):x=new ne(x),H.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0,scale:j=!0}=w;M&&(H.center("column"),m||x.center("column")),j&&(H.scale("column"),m||x.scale("column"));const tt=H.standardDeviation("column",{unbiased:!0}),et=m?tt:x.standardDeviation("column",{unbiased:!0}),st=H.transpose().mmul(x);for(let lt=0;lt<st.rows;lt++)for(let Tt=0;Tt<st.columns;Tt++)st.set(lt,Tt,st.get(lt,Tt)*(1/(tt[lt]*et[Tt]))*(1/(H.rows-1)));return st}class gd{constructor(x,w={}){const{assumeSymmetric:m=!1}=w;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,j=new ne(M,M),tt=new Float64Array(M),et=new Float64Array(M),st=x,lt,Tt,vt=!1;if(m?vt=!0:vt=x.isSymmetric(),vt){for(lt=0;lt<M;lt++)for(Tt=0;Tt<M;Tt++)j.set(lt,Tt,st.get(lt,Tt));ng(M,et,tt,j),rg(M,et,tt,j)}else{let Ft=new ne(M,M),qt=new Float64Array(M);for(Tt=0;Tt<M;Tt++)for(lt=0;lt<M;lt++)Ft.set(lt,Tt,st.get(lt,Tt));pd(M,Ft,qt,j),md(M,et,tt,j,Ft)}this.n=M,this.e=et,this.d=tt,this.V=j}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,w=this.e,m=this.d,M=new ne(x,x),j,tt;for(j=0;j<x;j++){for(tt=0;tt<x;tt++)M.set(j,tt,0);M.set(j,j,m[j]),w[j]>0?M.set(j,j+1,w[j]):w[j]<0&&M.set(j,j-1,w[j])}return M}}function ng(H,x,w,m){let M,j,tt,et,st,lt,Tt,vt;for(st=0;st<H;st++)w[st]=m.get(H-1,st);for(et=H-1;et>0;et--){for(vt=0,tt=0,lt=0;lt<et;lt++)vt=vt+Math.abs(w[lt]);if(vt===0)for(x[et]=w[et-1],st=0;st<et;st++)w[st]=m.get(et-1,st),m.set(et,st,0),m.set(st,et,0);else{for(lt=0;lt<et;lt++)w[lt]/=vt,tt+=w[lt]*w[lt];for(M=w[et-1],j=Math.sqrt(tt),M>0&&(j=-j),x[et]=vt*j,tt=tt-M*j,w[et-1]=M-j,st=0;st<et;st++)x[st]=0;for(st=0;st<et;st++){for(M=w[st],m.set(st,et,M),j=x[st]+m.get(st,st)*M,lt=st+1;lt<=et-1;lt++)j+=m.get(lt,st)*w[lt],x[lt]+=m.get(lt,st)*M;x[st]=j}for(M=0,st=0;st<et;st++)x[st]/=tt,M+=x[st]*w[st];for(Tt=M/(tt+tt),st=0;st<et;st++)x[st]-=Tt*w[st];for(st=0;st<et;st++){for(M=w[st],j=x[st],lt=st;lt<=et-1;lt++)m.set(lt,st,m.get(lt,st)-(M*x[lt]+j*w[lt]));w[st]=m.get(et-1,st),m.set(et,st,0)}}w[et]=tt}for(et=0;et<H-1;et++){if(m.set(H-1,et,m.get(et,et)),m.set(et,et,1),tt=w[et+1],tt!==0){for(lt=0;lt<=et;lt++)w[lt]=m.get(lt,et+1)/tt;for(st=0;st<=et;st++){for(j=0,lt=0;lt<=et;lt++)j+=m.get(lt,et+1)*m.get(lt,st);for(lt=0;lt<=et;lt++)m.set(lt,st,m.get(lt,st)-j*w[lt])}}for(lt=0;lt<=et;lt++)m.set(lt,et+1,0)}for(st=0;st<H;st++)w[st]=m.get(H-1,st),m.set(H-1,st,0);m.set(H-1,H-1,1),x[0]=0}function rg(H,x,w,m){let M,j,tt,et,st,lt,Tt,vt,Ft,qt,Lt,Zt,le,bt,Wt,ue;for(tt=1;tt<H;tt++)x[tt-1]=x[tt];x[H-1]=0;let we=0,Ae=0,un=Number.EPSILON;for(lt=0;lt<H;lt++){for(Ae=Math.max(Ae,Math.abs(w[lt])+Math.abs(x[lt])),Tt=lt;Tt<H&&!(Math.abs(x[Tt])<=un*Ae);)Tt++;if(Tt>lt)do{for(M=w[lt],vt=(w[lt+1]-M)/(2*x[lt]),Ft=Ci(vt,1),vt<0&&(Ft=-Ft),w[lt]=x[lt]/(vt+Ft),w[lt+1]=x[lt]*(vt+Ft),qt=w[lt+1],j=M-w[lt],tt=lt+2;tt<H;tt++)w[tt]-=j;for(we=we+j,vt=w[Tt],Lt=1,Zt=Lt,le=Lt,bt=x[lt+1],Wt=0,ue=0,tt=Tt-1;tt>=lt;tt--)for(le=Zt,Zt=Lt,ue=Wt,M=Lt*x[tt],j=Lt*vt,Ft=Ci(vt,x[tt]),x[tt+1]=Wt*Ft,Wt=x[tt]/Ft,Lt=vt/Ft,vt=Lt*w[tt]-Wt*M,w[tt+1]=j+Wt*(Lt*M+Wt*w[tt]),st=0;st<H;st++)j=m.get(st,tt+1),m.set(st,tt+1,Wt*m.get(st,tt)+Lt*j),m.set(st,tt,Lt*m.get(st,tt)-Wt*j);vt=-Wt*ue*le*bt*x[lt]/qt,x[lt]=Wt*vt,w[lt]=Lt*vt}while(Math.abs(x[lt])>un*Ae);w[lt]=w[lt]+we,x[lt]=0}for(tt=0;tt<H-1;tt++){for(st=tt,vt=w[tt],et=tt+1;et<H;et++)w[et]<vt&&(st=et,vt=w[et]);if(st!==tt)for(w[st]=w[tt],w[tt]=vt,et=0;et<H;et++)vt=m.get(et,tt),m.set(et,tt,m.get(et,st)),m.set(et,st,vt)}}function pd(H,x,w,m){let M=0,j=H-1,tt,et,st,lt,Tt,vt,Ft;for(vt=M+1;vt<=j-1;vt++){for(Ft=0,lt=vt;lt<=j;lt++)Ft=Ft+Math.abs(x.get(lt,vt-1));if(Ft!==0){for(st=0,lt=j;lt>=vt;lt--)w[lt]=x.get(lt,vt-1)/Ft,st+=w[lt]*w[lt];for(et=Math.sqrt(st),w[vt]>0&&(et=-et),st=st-w[vt]*et,w[vt]=w[vt]-et,Tt=vt;Tt<H;Tt++){for(tt=0,lt=j;lt>=vt;lt--)tt+=w[lt]*x.get(lt,Tt);for(tt=tt/st,lt=vt;lt<=j;lt++)x.set(lt,Tt,x.get(lt,Tt)-tt*w[lt])}for(lt=0;lt<=j;lt++){for(tt=0,Tt=j;Tt>=vt;Tt--)tt+=w[Tt]*x.get(lt,Tt);for(tt=tt/st,Tt=vt;Tt<=j;Tt++)x.set(lt,Tt,x.get(lt,Tt)-tt*w[Tt])}w[vt]=Ft*w[vt],x.set(vt,vt-1,Ft*et)}}for(lt=0;lt<H;lt++)for(Tt=0;Tt<H;Tt++)m.set(lt,Tt,lt===Tt?1:0);for(vt=j-1;vt>=M+1;vt--)if(x.get(vt,vt-1)!==0){for(lt=vt+1;lt<=j;lt++)w[lt]=x.get(lt,vt-1);for(Tt=vt;Tt<=j;Tt++){for(et=0,lt=vt;lt<=j;lt++)et+=w[lt]*m.get(lt,Tt);for(et=et/w[vt]/x.get(vt,vt-1),lt=vt;lt<=j;lt++)m.set(lt,Tt,m.get(lt,Tt)+et*w[lt])}}}function md(H,x,w,m,M){let j=H-1,tt=0,et=H-1,st=Number.EPSILON,lt=0,Tt=0,vt=0,Ft=0,qt=0,Lt=0,Zt=0,le=0,bt,Wt,ue,we,Ae,un,ge,be,Ze,Mt,Yt,Jt,Ht,fn,$e;for(bt=0;bt<H;bt++)for((bt<tt||bt>et)&&(w[bt]=M.get(bt,bt),x[bt]=0),Wt=Math.max(bt-1,0);Wt<H;Wt++)Tt=Tt+Math.abs(M.get(bt,Wt));for(;j>=tt;){for(we=j;we>tt&&(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===j)M.set(j,j,M.get(j,j)+lt),w[j]=M.get(j,j),x[j]=0,j--,le=0;else if(we===j-1){if(ge=M.get(j,j-1)*M.get(j-1,j),vt=(M.get(j-1,j-1)-M.get(j,j))/2,Ft=vt*vt+ge,Zt=Math.sqrt(Math.abs(Ft)),M.set(j,j,M.get(j,j)+lt),M.set(j-1,j-1,M.get(j-1,j-1)+lt),be=M.get(j,j),Ft>=0){for(Zt=vt>=0?vt+Zt:vt-Zt,w[j-1]=be+Zt,w[j]=w[j-1],Zt!==0&&(w[j]=be-ge/Zt),x[j-1]=0,x[j]=0,be=M.get(j,j-1),Lt=Math.abs(be)+Math.abs(Zt),vt=be/Lt,Ft=Zt/Lt,qt=Math.sqrt(vt*vt+Ft*Ft),vt=vt/qt,Ft=Ft/qt,Wt=j-1;Wt<H;Wt++)Zt=M.get(j-1,Wt),M.set(j-1,Wt,Ft*Zt+vt*M.get(j,Wt)),M.set(j,Wt,Ft*M.get(j,Wt)-vt*Zt);for(bt=0;bt<=j;bt++)Zt=M.get(bt,j-1),M.set(bt,j-1,Ft*Zt+vt*M.get(bt,j)),M.set(bt,j,Ft*M.get(bt,j)-vt*Zt);for(bt=tt;bt<=et;bt++)Zt=m.get(bt,j-1),m.set(bt,j-1,Ft*Zt+vt*m.get(bt,j)),m.set(bt,j,Ft*m.get(bt,j)-vt*Zt)}else w[j-1]=be+vt,w[j]=be+vt,x[j-1]=Zt,x[j]=-Zt;j=j-2,le=0}else{if(be=M.get(j,j),Ze=0,ge=0,we<j&&(Ze=M.get(j-1,j-1),ge=M.get(j,j-1)*M.get(j-1,j)),le===10){for(lt+=be,bt=tt;bt<=j;bt++)M.set(bt,bt,M.get(bt,bt)-be);Lt=Math.abs(M.get(j,j-1))+Math.abs(M.get(j-1,j-2)),be=Ze=.75*Lt,ge=-.4375*Lt*Lt}if(le===30&&(Lt=(Ze-be)/2,Lt=Lt*Lt+ge,Lt>0)){for(Lt=Math.sqrt(Lt),Ze<be&&(Lt=-Lt),Lt=be-ge/((Ze-be)/2+Lt),bt=tt;bt<=j;bt++)M.set(bt,bt,M.get(bt,bt)-Lt);lt+=Lt,be=Ze=ge=.964}for(le=le+1,Ae=j-2;Ae>=we&&(Zt=M.get(Ae,Ae),qt=be-Zt,Lt=Ze-Zt,vt=(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(vt)+Math.abs(Ft)+Math.abs(qt),vt=vt/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(vt)*(Math.abs(M.get(Ae-1,Ae-1))+Math.abs(Zt)+Math.abs(M.get(Ae+1,Ae+1))))));)Ae--;for(bt=Ae+2;bt<=j;bt++)M.set(bt,bt-2,0),bt>Ae+2&&M.set(bt,bt-3,0);for(ue=Ae;ue<=j-1&&(fn=ue!==j-1,ue!==Ae&&(vt=M.get(ue,ue-1),Ft=M.get(ue+1,ue-1),qt=fn?M.get(ue+2,ue-1):0,be=Math.abs(vt)+Math.abs(Ft)+Math.abs(qt),be!==0&&(vt=vt/be,Ft=Ft/be,qt=qt/be)),be!==0);ue++)if(Lt=Math.sqrt(vt*vt+Ft*Ft+qt*qt),vt<0&&(Lt=-Lt),Lt!==0){for(ue!==Ae?M.set(ue,ue-1,-Lt*be):we!==Ae&&M.set(ue,ue-1,-M.get(ue,ue-1)),vt=vt+Lt,be=vt/Lt,Ze=Ft/Lt,Zt=qt/Lt,Ft=Ft/vt,qt=qt/vt,Wt=ue;Wt<H;Wt++)vt=M.get(ue,Wt)+Ft*M.get(ue+1,Wt),fn&&(vt=vt+qt*M.get(ue+2,Wt),M.set(ue+2,Wt,M.get(ue+2,Wt)-vt*Zt)),M.set(ue,Wt,M.get(ue,Wt)-vt*be),M.set(ue+1,Wt,M.get(ue+1,Wt)-vt*Ze);for(bt=0;bt<=Math.min(j,ue+3);bt++)vt=be*M.get(bt,ue)+Ze*M.get(bt,ue+1),fn&&(vt=vt+Zt*M.get(bt,ue+2),M.set(bt,ue+2,M.get(bt,ue+2)-vt*qt)),M.set(bt,ue,M.get(bt,ue)-vt),M.set(bt,ue+1,M.get(bt,ue+1)-vt*Ft);for(bt=tt;bt<=et;bt++)vt=be*m.get(bt,ue)+Ze*m.get(bt,ue+1),fn&&(vt=vt+Zt*m.get(bt,ue+2),m.set(bt,ue+2,m.get(bt,ue+2)-vt*qt)),m.set(bt,ue,m.get(bt,ue)-vt),m.set(bt,ue+1,m.get(bt,ue+1)-vt*Ft)}}}if(Tt!==0){for(j=H-1;j>=0;j--)if(vt=w[j],Ft=x[j],Ft===0)for(we=j,M.set(j,j,1),bt=j-1;bt>=0;bt--){for(ge=M.get(bt,bt)-vt,qt=0,Wt=we;Wt<=j;Wt++)qt=qt+M.get(bt,Wt)*M.get(Wt,j);if(x[bt]<0)Zt=ge,Lt=qt;else if(we=bt,x[bt]===0?M.set(bt,j,ge!==0?-qt/ge:-qt/(st*Tt)):(be=M.get(bt,bt+1),Ze=M.get(bt+1,bt),Ft=(w[bt]-vt)*(w[bt]-vt)+x[bt]*x[bt],un=(be*Lt-Zt*qt)/Ft,M.set(bt,j,un),M.set(bt+1,j,Math.abs(be)>Math.abs(Zt)?(-qt-ge*un)/be:(-Lt-Ze*un)/Zt)),un=Math.abs(M.get(bt,j)),st*un*un>1)for(Wt=bt;Wt<=j;Wt++)M.set(Wt,j,M.get(Wt,j)/un)}else if(Ft<0)for(we=j-1,Math.abs(M.get(j,j-1))>Math.abs(M.get(j-1,j))?(M.set(j-1,j-1,Ft/M.get(j,j-1)),M.set(j-1,j,-(M.get(j,j)-vt)/M.get(j,j-1))):($e=Zo(0,-M.get(j-1,j),M.get(j-1,j-1)-vt,Ft),M.set(j-1,j-1,$e[0]),M.set(j-1,j,$e[1])),M.set(j,j-1,0),M.set(j,j,1),bt=j-2;bt>=0;bt--){for(Mt=0,Yt=0,Wt=we;Wt<=j;Wt++)Mt=Mt+M.get(bt,Wt)*M.get(Wt,j-1),Yt=Yt+M.get(bt,Wt)*M.get(Wt,j);if(ge=M.get(bt,bt)-vt,x[bt]<0)Zt=ge,qt=Mt,Lt=Yt;else if(we=bt,x[bt]===0?($e=Zo(-Mt,-Yt,ge,Ft),M.set(bt,j-1,$e[0]),M.set(bt,j,$e[1])):(be=M.get(bt,bt+1),Ze=M.get(bt+1,bt),Jt=(w[bt]-vt)*(w[bt]-vt)+x[bt]*x[bt]-Ft*Ft,Ht=(w[bt]-vt)*2*Ft,Jt===0&&Ht===0&&(Jt=st*Tt*(Math.abs(ge)+Math.abs(Ft)+Math.abs(be)+Math.abs(Ze)+Math.abs(Zt))),$e=Zo(be*qt-Zt*Mt+Ft*Yt,be*Lt-Zt*Yt-Ft*Mt,Jt,Ht),M.set(bt,j-1,$e[0]),M.set(bt,j,$e[1]),Math.abs(be)>Math.abs(Zt)+Math.abs(Ft)?(M.set(bt+1,j-1,(-Mt-ge*M.get(bt,j-1)+Ft*M.get(bt,j))/be),M.set(bt+1,j,(-Yt-ge*M.get(bt,j)-Ft*M.get(bt,j-1))/be)):($e=Zo(-qt-Ze*M.get(bt,j-1),-Lt-Ze*M.get(bt,j),Zt,Ft),M.set(bt+1,j-1,$e[0]),M.set(bt+1,j,$e[1]))),un=Math.max(Math.abs(M.get(bt,j-1)),Math.abs(M.get(bt,j))),st*un*un>1)for(Wt=bt;Wt<=j;Wt++)M.set(Wt,j-1,M.get(Wt,j-1)/un),M.set(Wt,j,M.get(Wt,j)/un)}for(bt=0;bt<H;bt++)if(bt<tt||bt>et)for(Wt=bt;Wt<H;Wt++)m.set(bt,Wt,M.get(bt,Wt));for(Wt=H-1;Wt>=tt;Wt--)for(bt=tt;bt<=et;bt++){for(Zt=0,ue=tt;ue<=Math.min(Wt,et);ue++)Zt=Zt+m.get(bt,ue)*M.get(ue,Wt);m.set(bt,Wt,Zt)}}}function Zo(H,x,w,m){let M,j;return Math.abs(w)>Math.abs(m)?(M=m/w,j=w+M*m,[(H+M*x)/j,(x-M*H)/j]):(M=w/m,j=m+M*w,[(M*H+x)/j,(M*x-H)/j])}class yd{constructor(x){if(x=An.checkMatrix(x),!x.isSymmetric())throw new Error("Matrix is not symmetric");let w=x,m=w.rows,M=new ne(m,m),j=!0,tt,et,st;for(et=0;et<m;et++){let lt=0;for(st=0;st<et;st++){let Tt=0;for(tt=0;tt<st;tt++)Tt+=M.get(st,tt)*M.get(et,tt);Tt=(w.get(et,st)-Tt)/M.get(st,st),M.set(et,st,Tt),lt=lt+Tt*Tt}for(lt=w.get(et,et)-lt,j&&(j=lt>0),M.set(et,et,Math.sqrt(Math.max(lt,0))),st=et+1;st<m;st++)M.set(et,st,0)}this.L=M,this.positiveDefinite=j}isPositiveDefinite(){return this.positiveDefinite}solve(x){x=An.checkMatrix(x);let w=this.L,m=w.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,j=x.clone(),tt,et,st;for(st=0;st<m;st++)for(et=0;et<M;et++){for(tt=0;tt<st;tt++)j.set(st,et,j.get(st,et)-j.get(tt,et)*w.get(st,tt));j.set(st,et,j.get(st,et)/w.get(st,st))}for(st=m-1;st>=0;st--)for(et=0;et<M;et++){for(tt=st+1;tt<m;tt++)j.set(st,et,j.get(st,et)-j.get(tt,et)*w.get(tt,st));j.set(st,et,j.get(st,et)/w.get(st,st))}return j}get lowerTriangularMatrix(){return this.L}}class Xl{constructor(x,w={}){x=An.checkMatrix(x);let{Y:m}=w;const{scaleScores:M=!1,maxIterations:j=1e3,terminationCriteria:tt=1e-10}=w;let et;if(m){if(rt.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");et=m.getColumnVector(0)}else et=x.getColumnVector(0);let st=1,lt,Tt,vt,Ft;for(let qt=0;qt<j&&st>tt;qt++)vt=x.transpose().mmul(et).div(et.transpose().mmul(et).get(0,0)),vt=vt.div(vt.norm()),lt=x.mmul(vt).div(vt.transpose().mmul(vt).get(0,0)),qt>0&&(st=lt.clone().sub(Ft).pow(2).sum()),Ft=lt.clone(),m?(Tt=m.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0)),Tt=Tt.div(Tt.norm()),et=m.mmul(Tt).div(Tt.transpose().mmul(Tt).get(0,0))):et=lt;if(m){let qt=x.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0));qt=qt.div(qt.norm());let Lt=x.clone().sub(lt.clone().mmul(qt.transpose())),Zt=et.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0)),le=m.clone().sub(lt.clone().mulS(Zt.get(0,0)).mmul(Tt.transpose()));this.t=lt,this.p=qt.transpose(),this.w=vt.transpose(),this.q=Tt,this.u=et,this.s=lt.transpose().mmul(lt),this.xResidual=Lt,this.yResidual=le,this.betas=Zt}else this.w=vt.transpose(),this.s=lt.transpose().mmul(lt).sqrt(),M?this.t=lt.clone().div(this.s.get(0,0)):this.t=lt,this.xResidual=x.sub(lt.mmul(vt.transpose()))}}Q.XA=re,Q.a_=yd,Q.yQ=yd,Q.Hs=Hn,Q.Ec=gd,Q.dx=gd,Q.LU=Ui,Q.Rm=Ui,Q.y3=ne,Q.qK=ha,Q.pb=os,Q.j=qs,Q.sO=da,Q.BZ=ls,Q.EK=Fo,Q.Db=cs,Q.Fx=us,Q.tU=Ti,Q.Ym=Xl,Q.rs=Xl,Q.QR=zo,Q.TB=zo,Q.oH=Ca,Q.Sc=Ca,Q.BN=Rr,Q.it=Oi,Q.$r=An,Q.QM=vd,Q.AV=eg,A=ne,Q.GH=jo,Q.SO=Q0,Q.uZ=$0,Q.yU=tg,Q.F1=fd,Q.re=dd},45411:function(U){"use strict";U.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(U,Q,S){var A=S(45411),Z=S(81683),B=Object.hasOwnProperty,N=Object.create(null);for(var T in A)B.call(A,T)&&(N[A[T]]=T);var k=U.exports={to:{},get:{}};k.get=function(L){var z=L.substring(0,3).toLowerCase(),D,W;switch(z){case"hsl":D=k.get.hsl(L),W="hsl";break;case"hwb":D=k.get.hwb(L),W="hwb";break;default:D=k.get.rgb(L),W="rgb";break}return D?{model:W,value:D}:null},k.get.rgb=function(L){if(!L)return null;var z=/^#([a-f0-9]{3,4})$/i,D=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,W=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,X=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,K=/^(\w+)$/,rt=[0,0,0,1],nt,q,it;if(nt=L.match(D)){for(it=nt[2],nt=nt[1],q=0;q<3;q++){var at=q*2;rt[q]=parseInt(nt.slice(at,at+2),16)}it&&(rt[3]=parseInt(it,16)/255)}else if(nt=L.match(z)){for(nt=nt[1],it=nt[3],q=0;q<3;q++)rt[q]=parseInt(nt[q]+nt[q],16);it&&(rt[3]=parseInt(it+it,16)/255)}else if(nt=L.match(W)){for(q=0;q<3;q++)rt[q]=parseInt(nt[q+1],0);nt[4]&&(nt[5]?rt[3]=parseFloat(nt[4])*.01:rt[3]=parseFloat(nt[4]))}else if(nt=L.match(X)){for(q=0;q<3;q++)rt[q]=Math.round(parseFloat(nt[q+1])*2.55);nt[4]&&(nt[5]?rt[3]=parseFloat(nt[4])*.01:rt[3]=parseFloat(nt[4]))}else return(nt=L.match(K))?nt[1]==="transparent"?[0,0,0,0]:B.call(A,nt[1])?(rt=A[nt[1]],rt[3]=1,rt):null:null;for(q=0;q<3;q++)rt[q]=_(rt[q],0,255);return rt[3]=_(rt[3],0,1),rt},k.get.hsl=function(L){if(!L)return null;var z=/^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*)?\)$/,D=L.match(z);if(D){var W=parseFloat(D[4]),X=(parseFloat(D[1])%360+360)%360,K=_(parseFloat(D[2]),0,100),rt=_(parseFloat(D[3]),0,100),nt=_(isNaN(W)?1:W,0,1);return[X,K,rt,nt]}return null},k.get.hwb=function(L){if(!L)return null;var z=/^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*)?\)$/,D=L.match(z);if(D){var W=parseFloat(D[4]),X=(parseFloat(D[1])%360+360)%360,K=_(parseFloat(D[2]),0,100),rt=_(parseFloat(D[3]),0,100),nt=_(isNaN(W)?1:W,0,1);return[X,K,rt,nt]}return null},k.to.hex=function(){var L=Z(arguments);return"#"+C(L[0])+C(L[1])+C(L[2])+(L[3]<1?C(Math.round(L[3]*255)):"")},k.to.rgb=function(){var L=Z(arguments);return L.length<4||L[3]===1?"rgb("+Math.round(L[0])+", "+Math.round(L[1])+", "+Math.round(L[2])+")":"rgba("+Math.round(L[0])+", "+Math.round(L[1])+", "+Math.round(L[2])+", "+L[3]+")"},k.to.rgb.percent=function(){var L=Z(arguments),z=Math.round(L[0]/255*100),D=Math.round(L[1]/255*100),W=Math.round(L[2]/255*100);return L.length<4||L[3]===1?"rgb("+z+"%, "+D+"%, "+W+"%)":"rgba("+z+"%, "+D+"%, "+W+"%, "+L[3]+")"},k.to.hsl=function(){var L=Z(arguments);return L.length<4||L[3]===1?"hsl("+L[0]+", "+L[1]+"%, "+L[2]+"%)":"hsla("+L[0]+", "+L[1]+"%, "+L[2]+"%, "+L[3]+")"},k.to.hwb=function(){var L=Z(arguments),z="";return L.length>=4&&L[3]!==1&&(z=", "+L[3]),"hwb("+L[0]+", "+L[1]+"%, "+L[2]+"%"+z+")"},k.to.keyword=function(L){return N[L.slice(0,3)]};function _(L,z,D){return Math.min(Math.max(z,L),D)}function C(L){var z=Math.round(L).toString(16).toUpperCase();return z.length<2?"0"+z:z}},92546:function(U,Q,S){U.exports={graphlib:S(76626),layout:S(47194),debug:S(11303),util:{time:S(53063).time,notime:S(53063).notime},version:S(11897)}},81255:function(U,Q,S){"use strict";var A=S(72361),Z=S(39240);U.exports={run:B,undo:T};function B(k){var _=k.graph().acyclicer==="greedy"?Z(k,C(k)):N(k);A.forEach(_,function(L){var z=k.edge(L);k.removeEdge(L),z.forwardName=L.name,z.reversed=!0,k.setEdge(L.w,L.v,z,A.uniqueId("rev"))});function C(L){return function(z){return L.edge(z).weight}}}function N(k){var _=[],C={},L={};function z(D){A.has(L,D)||(L[D]=!0,C[D]=!0,A.forEach(k.outEdges(D),function(W){A.has(C,W.w)?_.push(W):z(W.w)}),delete C[D])}return A.forEach(k.nodes(),z),_}function T(k){A.forEach(k.edges(),function(_){var C=k.edge(_);if(C.reversed){k.removeEdge(_);var L=C.forwardName;delete C.reversed,delete C.forwardName,k.setEdge(_.w,_.v,C,L)}})}},60765:function(U,Q,S){var A=S(72361),Z=S(53063);U.exports=B;function B(T){function k(_){var C=T.children(_),L=T.node(_);if(C.length&&A.forEach(C,k),A.has(L,"minRank")){L.borderLeft=[],L.borderRight=[];for(var z=L.minRank,D=L.maxRank+1;z<D;++z)N(T,"borderLeft","_bl",_,L,z),N(T,"borderRight","_br",_,L,z)}}A.forEach(T.children(),k)}function N(T,k,_,C,L,z){var D={width:0,height:0,rank:z,borderType:k},W=L[k][z-1],X=Z.addDummyNode(T,"border",D,_);L[k][z]=X,T.setParent(X,C),W&&T.setEdge(W,X,{weight:1})}},13257:function(U,Q,S){"use strict";var A=S(72361);U.exports={adjust:Z,undo:B};function Z(z){var D=z.graph().rankdir.toLowerCase();(D==="lr"||D==="rl")&&N(z)}function B(z){var D=z.graph().rankdir.toLowerCase();(D==="bt"||D==="rl")&&k(z),(D==="lr"||D==="rl")&&(C(z),N(z))}function N(z){A.forEach(z.nodes(),function(D){T(z.node(D))}),A.forEach(z.edges(),function(D){T(z.edge(D))})}function T(z){var D=z.width;z.width=z.height,z.height=D}function k(z){A.forEach(z.nodes(),function(D){_(z.node(D))}),A.forEach(z.edges(),function(D){var W=z.edge(D);A.forEach(W.points,_),A.has(W,"y")&&_(W)})}function _(z){z.y=-z.y}function C(z){A.forEach(z.nodes(),function(D){L(z.node(D))}),A.forEach(z.edges(),function(D){var W=z.edge(D);A.forEach(W.points,L),A.has(W,"x")&&L(W)})}function L(z){var D=z.x;z.x=z.y,z.y=D}},21135:function(U){U.exports=Q;function Q(){var Z={};Z._next=Z._prev=Z,this._sentinel=Z}Q.prototype.dequeue=function(){var Z=this._sentinel,B=Z._prev;if(B!==Z)return S(B),B},Q.prototype.enqueue=function(Z){var B=this._sentinel;Z._prev&&Z._next&&S(Z),Z._next=B._next,B._next._prev=Z,B._next=Z,Z._prev=B},Q.prototype.toString=function(){for(var Z=[],B=this._sentinel,N=B._prev;N!==B;)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,B){if(Z!=="_next"&&Z!=="_prev")return B}},11303:function(U,Q,S){var A=S(72361),Z=S(53063),B=S(76626).Graph;U.exports={debugOrdering:N};function N(T){var k=Z.buildLayerMatrix(T),_=new B({compound:!0,multigraph:!0}).setGraph({});return A.forEach(T.nodes(),function(C){_.setNode(C,{label:C}),_.setParent(C,"layer"+T.node(C).rank)}),A.forEach(T.edges(),function(C){_.setEdge(C.v,C.w,{},C.name)}),A.forEach(k,function(C,L){var z="layer"+L;_.setNode(z,{rank:"same"}),A.reduce(C,function(D,W){return _.setEdge(D,W,{style:"invis"}),W})}),_}},76626:function(U,Q,S){var A;try{A=S(75172)}catch(Z){}A||(A=window.graphlib),U.exports=A},39240:function(U,Q,S){var A=S(72361),Z=S(76626).Graph,B=S(21135);U.exports=T;var N=A.constant(1);function T(z,D){if(z.nodeCount()<=1)return[];var W=C(z,D||N),X=k(W.graph,W.buckets,W.zeroIdx);return A.flatten(A.map(X,function(K){return z.outEdges(K.v,K.w)}),!0)}function k(z,D,W){for(var X=[],K=D[D.length-1],rt=D[0],nt;z.nodeCount();){for(;nt=rt.dequeue();)_(z,D,W,nt);for(;nt=K.dequeue();)_(z,D,W,nt);if(z.nodeCount()){for(var q=D.length-2;q>0;--q)if(nt=D[q].dequeue(),nt){X=X.concat(_(z,D,W,nt,!0));break}}}return X}function _(z,D,W,X,K){var rt=K?[]:void 0;return A.forEach(z.inEdges(X.v),function(nt){var q=z.edge(nt),it=z.node(nt.v);K&&rt.push({v:nt.v,w:nt.w}),it.out-=q,L(D,W,it)}),A.forEach(z.outEdges(X.v),function(nt){var q=z.edge(nt),it=nt.w,at=z.node(it);at.in-=q,L(D,W,at)}),z.removeNode(X.v),rt}function C(z,D){var W=new Z,X=0,K=0;A.forEach(z.nodes(),function(q){W.setNode(q,{v:q,in:0,out:0})}),A.forEach(z.edges(),function(q){var it=W.edge(q.v,q.w)||0,at=D(q),ut=it+at;W.setEdge(q.v,q.w,ut),K=Math.max(K,W.node(q.v).out+=at),X=Math.max(X,W.node(q.w).in+=at)});var rt=A.range(K+X+3).map(function(){return new B}),nt=X+1;return A.forEach(W.nodes(),function(q){L(rt,nt,W.node(q))}),{graph:W,buckets:rt,zeroIdx:nt}}function L(z,D,W){W.out?W.in?z[W.out-W.in+D].enqueue(W):z[z.length-1].enqueue(W):z[0].enqueue(W)}},47194:function(U,Q,S){"use strict";var A=S(72361),Z=S(81255),B=S(27163),N=S(64505),T=S(53063).normalizeRanks,k=S(71970),_=S(53063).removeEmptyRanks,C=S(31733),L=S(60765),z=S(13257),D=S(62852),W=S(93021),X=S(53063),K=S(76626).Graph;U.exports=rt;function rt(dt,St){var Ct=St&&St.debugTiming?X.time:X.notime;Ct("layout",function(){var Gt=Ct(" buildLayoutGraph",function(){return Et(dt)});Ct(" runLayout",function(){nt(Gt,Ct)}),Ct(" updateInputGraph",function(){q(dt,Gt)})})}function nt(dt,St){St(" makeSpaceForEdgeLabels",function(){kt(dt)}),St(" removeSelfEdges",function(){ca(dt)}),St(" acyclic",function(){Z.run(dt)}),St(" nestingGraph.run",function(){C.run(dt)}),St(" rank",function(){N(X.asNonCompoundGraph(dt))}),St(" injectEdgeLabelProxies",function(){zt(dt)}),St(" removeEmptyRanks",function(){_(dt)}),St(" nestingGraph.cleanup",function(){C.cleanup(dt)}),St(" normalizeRanks",function(){T(dt)}),St(" assignRankMinMax",function(){Ut(dt)}),St(" removeEdgeLabelProxies",function(){Qt(dt)}),St(" normalize.run",function(){B.run(dt)}),St(" parentDummyChains",function(){k(dt)}),St(" addBorderSegments",function(){L(dt)}),St(" order",function(){D(dt)}),St(" insertSelfEdges",function(){as(dt)}),St(" adjustCoordinateSystem",function(){z.adjust(dt)}),St(" position",function(){W(dt)}),St(" positionSelfEdges",function(){Pt(dt)}),St(" removeBorderNodes",function(){$r(dt)}),St(" normalize.undo",function(){B.undo(dt)}),St(" fixupEdgeLabelCoords",function(){tn(dt)}),St(" undoCoordinateSystem",function(){z.undo(dt)}),St(" translateGraph",function(){Ee(dt)}),St(" assignNodeIntersects",function(){Le(dt)}),St(" reversePoints",function(){er(dt)}),St(" acyclic.undo",function(){Z.undo(dt)})}function q(dt,St){A.forEach(dt.nodes(),function(Ct){var Gt=dt.node(Ct),oe=St.node(Ct);Gt&&(Gt.x=oe.x,Gt.y=oe.y,St.children(Ct).length&&(Gt.width=oe.width,Gt.height=oe.height))}),A.forEach(dt.edges(),function(Ct){var Gt=dt.edge(Ct),oe=St.edge(Ct);Gt.points=oe.points,A.has(oe,"x")&&(Gt.x=oe.x,Gt.y=oe.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"},ut=["acyclicer","ranker","rankdir","align"],ht=["width","height"],xt={width:0,height:0},pt=["minlen","weight","width","height","labeloffset"],wt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function Et(dt){var St=new K({multigraph:!0,compound:!0}),Ct=It(dt.graph());return St.setGraph(A.merge({},at,_t(Ct,it),A.pick(Ct,ut))),A.forEach(dt.nodes(),function(Gt){var oe=It(dt.node(Gt));St.setNode(Gt,A.defaults(_t(oe,ht),xt)),St.setParent(Gt,dt.parent(Gt))}),A.forEach(dt.edges(),function(Gt){var oe=It(dt.edge(Gt));St.setEdge(Gt,A.merge({},wt,_t(oe,pt),A.pick(oe,gt)))}),St}function kt(dt){var St=dt.graph();St.ranksep/=2,A.forEach(dt.edges(),function(Ct){var Gt=dt.edge(Ct);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 Ct=dt.edge(St);if(Ct.width&&Ct.height){var Gt=dt.node(St.v),oe=dt.node(St.w),ye={rank:(oe.rank-Gt.rank)/2+Gt.rank,e:St};X.addDummyNode(dt,"edge-proxy",ye,"_ep")}})}function Ut(dt){var St=0;A.forEach(dt.nodes(),function(Ct){var Gt=dt.node(Ct);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 Ct=dt.node(St);Ct.dummy==="edge-proxy"&&(dt.edge(Ct.e).labelRank=Ct.rank,dt.removeNode(St))})}function Ee(dt){var St=Number.POSITIVE_INFINITY,Ct=0,Gt=Number.POSITIVE_INFINITY,oe=0,ye=dt.graph(),de=ye.marginx||0,_e=ye.marginy||0;function Mn(Nn){var Pe=Nn.x,Se=Nn.y,re=Nn.width,Oe=Nn.height;St=Math.min(St,Pe-re/2),Ct=Math.max(Ct,Pe+re/2),Gt=Math.min(Gt,Se-Oe/2),oe=Math.max(oe,Se+Oe/2)}A.forEach(dt.nodes(),function(Nn){Mn(dt.node(Nn))}),A.forEach(dt.edges(),function(Nn){var Pe=dt.edge(Nn);A.has(Pe,"x")&&Mn(Pe)}),St-=de,Gt-=_e,A.forEach(dt.nodes(),function(Nn){var Pe=dt.node(Nn);Pe.x-=St,Pe.y-=Gt}),A.forEach(dt.edges(),function(Nn){var Pe=dt.edge(Nn);A.forEach(Pe.points,function(Se){Se.x-=St,Se.y-=Gt}),A.has(Pe,"x")&&(Pe.x-=St),A.has(Pe,"y")&&(Pe.y-=Gt)}),ye.width=Ct-St+de,ye.height=oe-Gt+_e}function Le(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St),Gt=dt.node(St.v),oe=dt.node(St.w),ye,de;Ct.points?(ye=Ct.points[0],de=Ct.points[Ct.points.length-1]):(Ct.points=[],ye=oe,de=Gt),Ct.points.unshift(X.intersectRect(Gt,ye)),Ct.points.push(X.intersectRect(oe,de))})}function tn(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St);if(A.has(Ct,"x"))switch((Ct.labelpos==="l"||Ct.labelpos==="r")&&(Ct.width-=Ct.labeloffset),Ct.labelpos){case"l":Ct.x-=Ct.width/2+Ct.labeloffset;break;case"r":Ct.x+=Ct.width/2+Ct.labeloffset;break}})}function er(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St);Ct.reversed&&Ct.points.reverse()})}function $r(dt){A.forEach(dt.nodes(),function(St){if(dt.children(St).length){var Ct=dt.node(St),Gt=dt.node(Ct.borderTop),oe=dt.node(Ct.borderBottom),ye=dt.node(A.last(Ct.borderLeft)),de=dt.node(A.last(Ct.borderRight));Ct.width=Math.abs(de.x-ye.x),Ct.height=Math.abs(oe.y-Gt.y),Ct.x=ye.x+Ct.width/2,Ct.y=Gt.y+Ct.height/2}}),A.forEach(dt.nodes(),function(St){dt.node(St).dummy==="border"&&dt.removeNode(St)})}function ca(dt){A.forEach(dt.edges(),function(St){if(St.v===St.w){var Ct=dt.node(St.v);Ct.selfEdges||(Ct.selfEdges=[]),Ct.selfEdges.push({e:St,label:dt.edge(St)}),dt.removeEdge(St)}})}function as(dt){var St=X.buildLayerMatrix(dt);A.forEach(St,function(Ct){var Gt=0;A.forEach(Ct,function(oe,ye){var de=dt.node(oe);de.order=ye+Gt,A.forEach(de.selfEdges,function(_e){X.addDummyNode(dt,"selfedge",{width:_e.label.width,height:_e.label.height,rank:de.rank,order:ye+ ++Gt,e:_e.e,label:_e.label},"_se")}),delete de.selfEdges})})}function Pt(dt){A.forEach(dt.nodes(),function(St){var Ct=dt.node(St);if(Ct.dummy==="selfedge"){var Gt=dt.node(Ct.e.v),oe=Gt.x+Gt.width/2,ye=Gt.y,de=Ct.x-oe,_e=Gt.height/2;dt.setEdge(Ct.e,Ct.label),dt.removeNode(St),Ct.label.points=[{x:oe+2*de/3,y:ye-_e},{x:oe+5*de/6,y:ye-_e},{x:oe+de,y:ye},{x:oe+5*de/6,y:ye+_e},{x:oe+2*de/3,y:ye+_e}],Ct.label.x=Ct.x,Ct.label.y=Ct.y}})}function _t(dt,St){return A.mapValues(A.pick(dt,St),Number)}function It(dt){var St={};return A.forEach(dt,function(Ct,Gt){St[Gt.toLowerCase()]=Ct}),St}},72361:function(U,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(40151),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(73376),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._),U.exports=A},31733:function(U,Q,S){var A=S(72361),Z=S(53063);U.exports={run:B,cleanup:_};function B(C){var L=Z.addDummyNode(C,"root",{},"_root"),z=T(C),D=A.max(A.values(z))-1,W=2*D+1;C.graph().nestingRoot=L,A.forEach(C.edges(),function(K){C.edge(K).minlen*=W});var X=k(C)+1;A.forEach(C.children(),function(K){N(C,L,W,X,D,z,K)}),C.graph().nodeRankFactor=W}function N(C,L,z,D,W,X,K){var rt=C.children(K);if(!rt.length){K!==L&&C.setEdge(L,K,{weight:0,minlen:z});return}var nt=Z.addBorderNode(C,"_bt"),q=Z.addBorderNode(C,"_bb"),it=C.node(K);C.setParent(nt,K),it.borderTop=nt,C.setParent(q,K),it.borderBottom=q,A.forEach(rt,function(at){N(C,L,z,D,W,X,at);var ut=C.node(at),ht=ut.borderTop?ut.borderTop:at,xt=ut.borderBottom?ut.borderBottom:at,pt=ut.borderTop?D:2*D,wt=ht!==xt?1:W-X[K]+1;C.setEdge(nt,ht,{weight:pt,minlen:wt,nestingEdge:!0}),C.setEdge(xt,q,{weight:pt,minlen:wt,nestingEdge:!0})}),C.parent(K)||C.setEdge(L,nt,{weight:0,minlen:W+X[K]})}function T(C){var L={};function z(D,W){var X=C.children(D);X&&X.length&&A.forEach(X,function(K){z(K,W+1)}),L[D]=W}return A.forEach(C.children(),function(D){z(D,1)}),L}function k(C){return A.reduce(C.edges(),function(L,z){return L+C.edge(z).weight},0)}function _(C){var L=C.graph();C.removeNode(L.nestingRoot),delete L.nestingRoot,A.forEach(C.edges(),function(z){var D=C.edge(z);D.nestingEdge&&C.removeEdge(z)})}},27163:function(U,Q,S){"use strict";var A=S(72361),Z=S(53063);U.exports={run:B,undo:T};function B(k){k.graph().dummyChains=[],A.forEach(k.edges(),function(_){N(k,_)})}function N(k,_){var C=_.v,L=k.node(C).rank,z=_.w,D=k.node(z).rank,W=_.name,X=k.edge(_),K=X.labelRank;if(D!==L+1){k.removeEdge(_);var rt,nt,q;for(q=0,++L;L<D;++q,++L)X.points=[],nt={width:0,height:0,edgeLabel:X,edgeObj:_,rank:L},rt=Z.addDummyNode(k,"edge",nt,"_d"),L===K&&(nt.width=X.width,nt.height=X.height,nt.dummy="edge-label",nt.labelpos=X.labelpos),k.setEdge(C,rt,{weight:X.weight},W),q===0&&k.graph().dummyChains.push(rt),C=rt;k.setEdge(C,z,{weight:X.weight},W)}}function T(k){A.forEach(k.graph().dummyChains,function(_){var C=k.node(_),L=C.edgeLabel,z;for(k.setEdge(C.edgeObj,L);C.dummy;)z=k.successors(_)[0],k.removeNode(_),L.points.push({x:C.x,y:C.y}),C.dummy==="edge-label"&&(L.x=C.x,L.y=C.y,L.width=C.width,L.height=C.height),_=z,C=k.node(_)})}},52205:function(U,Q,S){var A=S(72361);U.exports=Z;function Z(B,N,T){var k={},_;A.forEach(T,function(C){for(var L=B.parent(C),z,D;L;){if(z=B.parent(L),z?(D=k[z],k[z]=L):(D=_,_=L),D&&D!==L){N.setEdge(D,L);return}L=z}})}},99506:function(U,Q,S){var A=S(72361);U.exports=Z;function Z(B,N){return A.map(N,function(T){var k=B.inEdges(T);if(k.length){var _=A.reduce(k,function(C,L){var z=B.edge(L),D=B.node(L.v);return{sum:C.sum+z.weight*D.order,weight:C.weight+z.weight}},{sum:0,weight:0});return{v:T,barycenter:_.sum/_.weight,weight:_.weight}}else return{v:T}})}},59105:function(U,Q,S){var A=S(72361),Z=S(76626).Graph;U.exports=B;function B(T,k,_){var C=N(T),L=new Z({compound:!0}).setGraph({root:C}).setDefaultNodeLabel(function(z){return T.node(z)});return A.forEach(T.nodes(),function(z){var D=T.node(z),W=T.parent(z);(D.rank===k||D.minRank<=k&&k<=D.maxRank)&&(L.setNode(z),L.setParent(z,W||C),A.forEach(T[_](z),function(X){var K=X.v===z?X.w:X.v,rt=L.edge(K,z),nt=A.isUndefined(rt)?0:rt.weight;L.setEdge(K,z,{weight:T.edge(X).weight+nt})}),A.has(D,"minRank")&&L.setNode(z,{borderLeft:D.borderLeft[k],borderRight:D.borderRight[k]}))}),L}function N(T){for(var k;T.hasNode(k=A.uniqueId("_root")););return k}},45456:function(U,Q,S){"use strict";var A=S(72361);U.exports=Z;function Z(N,T){for(var k=0,_=1;_<T.length;++_)k+=B(N,T[_-1],T[_]);return k}function B(N,T,k){for(var _=A.zipObject(k,A.map(k,function(X,K){return K})),C=A.flatten(A.map(T,function(X){return A.sortBy(A.map(N.outEdges(X),function(K){return{pos:_[K.w],weight:N.edge(K).weight}}),"pos")}),!0),L=1;L<k.length;)L<<=1;var z=2*L-1;L-=1;var D=A.map(new Array(z),function(){return 0}),W=0;return A.forEach(C.forEach(function(X){var K=X.pos+L;D[K]+=X.weight;for(var rt=0;K>0;)K%2&&(rt+=D[K+1]),K=K-1>>1,D[K]+=X.weight;W+=X.weight*rt})),W}},62852:function(U,Q,S){"use strict";var A=S(72361),Z=S(18043),B=S(45456),N=S(86490),T=S(59105),k=S(52205),_=S(76626).Graph,C=S(53063);U.exports=L;function L(X){var K=C.maxRank(X),rt=z(X,A.range(1,K+1),"inEdges"),nt=z(X,A.range(K-1,-1,-1),"outEdges"),q=Z(X);W(X,q);for(var it=Number.POSITIVE_INFINITY,at,ut=0,ht=0;ht<4;++ut,++ht){D(ut%2?rt:nt,ut%4>=2),q=C.buildLayerMatrix(X);var xt=B(X,q);xt<it&&(ht=0,at=A.cloneDeep(q),it=xt)}W(X,at)}function z(X,K,rt){return A.map(K,function(nt){return T(X,nt,rt)})}function D(X,K){var rt=new _;A.forEach(X,function(nt){var q=nt.graph().root,it=N(nt,q,rt,K);A.forEach(it.vs,function(at,ut){nt.node(at).order=ut}),k(nt,rt,it.vs)})}function W(X,K){A.forEach(K,function(rt){A.forEach(rt,function(nt,q){X.node(nt).order=q})})}},18043:function(U,Q,S){"use strict";var A=S(72361);U.exports=Z;function Z(B){var N={},T=A.filter(B.nodes(),function(z){return!B.children(z).length}),k=A.max(A.map(T,function(z){return B.node(z).rank})),_=A.map(A.range(k+1),function(){return[]});function C(z){if(!A.has(N,z)){N[z]=!0;var D=B.node(z);_[D.rank].push(z),A.forEach(B.successors(z),C)}}var L=A.sortBy(T,function(z){return B.node(z).rank});return A.forEach(L,C),_}},45926:function(U,Q,S){"use strict";var A=S(72361);U.exports=Z;function Z(T,k){var _={};A.forEach(T,function(L,z){var D=_[L.v]={indegree:0,in:[],out:[],vs:[L.v],i:z};A.isUndefined(L.barycenter)||(D.barycenter=L.barycenter,D.weight=L.weight)}),A.forEach(k.edges(),function(L){var z=_[L.v],D=_[L.w];!A.isUndefined(z)&&!A.isUndefined(D)&&(D.indegree++,z.out.push(_[L.w]))});var C=A.filter(_,function(L){return!L.indegree});return B(C)}function B(T){var k=[];function _(z){return function(D){D.merged||(A.isUndefined(D.barycenter)||A.isUndefined(z.barycenter)||D.barycenter>=z.barycenter)&&N(z,D)}}function C(z){return function(D){D.in.push(z),--D.indegree===0&&T.push(D)}}for(;T.length;){var L=T.pop();k.push(L),A.forEach(L.in.reverse(),_(L)),A.forEach(L.out,C(L))}return A.map(A.filter(k,function(z){return!z.merged}),function(z){return A.pick(z,["vs","i","barycenter","weight"])})}function N(T,k){var _=0,C=0;T.weight&&(_+=T.barycenter*T.weight,C+=T.weight),k.weight&&(_+=k.barycenter*k.weight,C+=k.weight),T.vs=k.vs.concat(T.vs),T.barycenter=_/C,T.weight=C,T.i=Math.min(k.i,T.i),k.merged=!0}},86490:function(U,Q,S){var A=S(72361),Z=S(99506),B=S(45926),N=S(1349);U.exports=T;function T(C,L,z,D){var W=C.children(L),X=C.node(L),K=X?X.borderLeft:void 0,rt=X?X.borderRight:void 0,nt={};K&&(W=A.filter(W,function(xt){return xt!==K&&xt!==rt}));var q=Z(C,W);A.forEach(q,function(xt){if(C.children(xt.v).length){var pt=T(C,xt.v,z,D);nt[xt.v]=pt,A.has(pt,"barycenter")&&_(xt,pt)}});var it=B(q,z);k(it,nt);var at=N(it,D);if(K&&(at.vs=A.flatten([K,at.vs,rt],!0),C.predecessors(K).length)){var ut=C.node(C.predecessors(K)[0]),ht=C.node(C.predecessors(rt)[0]);A.has(at,"barycenter")||(at.barycenter=0,at.weight=0),at.barycenter=(at.barycenter*at.weight+ut.order+ht.order)/(at.weight+2),at.weight+=2}return at}function k(C,L){A.forEach(C,function(z){z.vs=A.flatten(z.vs.map(function(D){return L[D]?L[D].vs:D}),!0)})}function _(C,L){A.isUndefined(C.barycenter)?(C.barycenter=L.barycenter,C.weight=L.weight):(C.barycenter=(C.barycenter*C.weight+L.barycenter*L.weight)/(C.weight+L.weight),C.weight+=L.weight)}},1349:function(U,Q,S){var A=S(72361),Z=S(53063);U.exports=B;function B(k,_){var C=Z.partition(k,function(nt){return A.has(nt,"barycenter")}),L=C.lhs,z=A.sortBy(C.rhs,function(nt){return-nt.i}),D=[],W=0,X=0,K=0;L.sort(T(!!_)),K=N(D,z,K),A.forEach(L,function(nt){K+=nt.vs.length,D.push(nt.vs),W+=nt.barycenter*nt.weight,X+=nt.weight,K=N(D,z,K)});var rt={vs:A.flatten(D,!0)};return X&&(rt.barycenter=W/X,rt.weight=X),rt}function N(k,_,C){for(var L;_.length&&(L=A.last(_)).i<=C;)_.pop(),k.push(L.vs),C++;return C}function T(k){return function(_,C){return _.barycenter<C.barycenter?-1:_.barycenter>C.barycenter?1:k?C.i-_.i:_.i-C.i}}},71970:function(U,Q,S){var A=S(72361);U.exports=Z;function Z(T){var k=N(T);A.forEach(T.graph().dummyChains,function(_){for(var C=T.node(_),L=C.edgeObj,z=B(T,k,L.v,L.w),D=z.path,W=z.lca,X=0,K=D[X],rt=!0;_!==L.w;){if(C=T.node(_),rt){for(;(K=D[X])!==W&&T.node(K).maxRank<C.rank;)X++;K===W&&(rt=!1)}if(!rt){for(;X<D.length-1&&T.node(K=D[X+1]).minRank<=C.rank;)X++;K=D[X]}T.setParent(_,K),_=T.successors(_)[0]}})}function B(T,k,_,C){var L=[],z=[],D=Math.min(k[_].low,k[C].low),W=Math.max(k[_].lim,k[C].lim),X,K;X=_;do X=T.parent(X),L.push(X);while(X&&(k[X].low>D||W>k[X].lim));for(K=X,X=C;(X=T.parent(X))!==K;)z.push(X);return{path:L.concat(z.reverse()),lca:K}}function N(T){var k={},_=0;function C(L){var z=_;A.forEach(T.children(L),C),k[L]={low:z,lim:_++}}return A.forEach(T.children(),C),k}},92080:function(U,Q,S){"use strict";var A=S(72361),Z=S(76626).Graph,B=S(53063);U.exports={positionX:rt,findType1Conflicts:N,findType2Conflicts:T,addConflict:_,hasConflict:C,verticalAlignment:L,horizontalCompaction:z,alignCoordinates:X,findSmallestWidthAlignment:W,balance:K};function N(it,at){var ut={};function ht(xt,pt){var wt=0,gt=0,Et=xt.length,kt=A.last(pt);return A.forEach(pt,function(zt,Ut){var Qt=k(it,zt),Ee=Qt?it.node(Qt).order:Et;(Qt||zt===kt)&&(A.forEach(pt.slice(gt,Ut+1),function(Le){A.forEach(it.predecessors(Le),function(tn){var er=it.node(tn),$r=er.order;($r<wt||Ee<$r)&&!(er.dummy&&it.node(Le).dummy)&&_(ut,tn,Le)})}),gt=Ut+1,wt=Ee)}),pt}return A.reduce(at,ht),ut}function T(it,at){var ut={};function ht(pt,wt,gt,Et,kt){var zt;A.forEach(A.range(wt,gt),function(Ut){zt=pt[Ut],it.node(zt).dummy&&A.forEach(it.predecessors(zt),function(Qt){var Ee=it.node(Qt);Ee.dummy&&(Ee.order<Et||Ee.order>kt)&&_(ut,Qt,zt)})})}function xt(pt,wt){var gt=-1,Et,kt=0;return A.forEach(wt,function(zt,Ut){if(it.node(zt).dummy==="border"){var Qt=it.predecessors(zt);Qt.length&&(Et=it.node(Qt[0]).order,ht(wt,kt,Ut,gt,Et),kt=Ut,gt=Et)}ht(wt,kt,wt.length,Et,pt.length)}),wt}return A.reduce(at,xt),ut}function k(it,at){if(it.node(at).dummy)return A.find(it.predecessors(at),function(ut){return it.node(ut).dummy})}function _(it,at,ut){if(at>ut){var ht=at;at=ut,ut=ht}var xt=it[at];xt||(it[at]=xt={}),xt[ut]=!0}function C(it,at,ut){if(at>ut){var ht=at;at=ut,ut=ht}return A.has(it[at],ut)}function L(it,at,ut,ht){var xt={},pt={},wt={};return A.forEach(at,function(gt){A.forEach(gt,function(Et,kt){xt[Et]=Et,pt[Et]=Et,wt[Et]=kt})}),A.forEach(at,function(gt){var Et=-1;A.forEach(gt,function(kt){var zt=ht(kt);if(zt.length){zt=A.sortBy(zt,function(tn){return wt[tn]});for(var Ut=(zt.length-1)/2,Qt=Math.floor(Ut),Ee=Math.ceil(Ut);Qt<=Ee;++Qt){var Le=zt[Qt];pt[kt]===kt&&Et<wt[Le]&&!C(ut,kt,Le)&&(pt[Le]=kt,pt[kt]=xt[kt]=xt[Le],Et=wt[Le])}}})}),{root:xt,align:pt}}function z(it,at,ut,ht,xt){var pt={},wt=D(it,at,ut,xt),gt=xt?"borderLeft":"borderRight";function Et(Ut,Qt){for(var Ee=wt.nodes(),Le=Ee.pop(),tn={};Le;)tn[Le]?Ut(Le):(tn[Le]=!0,Ee.push(Le),Ee=Ee.concat(Qt(Le))),Le=Ee.pop()}function kt(Ut){pt[Ut]=wt.inEdges(Ut).reduce(function(Qt,Ee){return Math.max(Qt,pt[Ee.v]+wt.edge(Ee))},0)}function zt(Ut){var Qt=wt.outEdges(Ut).reduce(function(Le,tn){return Math.min(Le,pt[tn.w]-wt.edge(tn))},Number.POSITIVE_INFINITY),Ee=it.node(Ut);Qt!==Number.POSITIVE_INFINITY&&Ee.borderType!==gt&&(pt[Ut]=Math.max(pt[Ut],Qt))}return Et(kt,wt.predecessors.bind(wt)),Et(zt,wt.successors.bind(wt)),A.forEach(ht,function(Ut){pt[Ut]=pt[ut[Ut]]}),pt}function D(it,at,ut,ht){var xt=new Z,pt=it.graph(),wt=nt(pt.nodesep,pt.edgesep,ht);return A.forEach(at,function(gt){var Et;A.forEach(gt,function(kt){var zt=ut[kt];if(xt.setNode(zt),Et){var Ut=ut[Et],Qt=xt.edge(Ut,zt);xt.setEdge(Ut,zt,Math.max(wt(it,kt,Et),Qt||0))}Et=kt})}),xt}function W(it,at){return A.minBy(A.values(at),function(ut){var ht=Number.NEGATIVE_INFINITY,xt=Number.POSITIVE_INFINITY;return A.forIn(ut,function(pt,wt){var gt=q(it,wt)/2;ht=Math.max(pt+gt,ht),xt=Math.min(pt-gt,xt)}),ht-xt})}function X(it,at){var ut=A.values(at),ht=A.min(ut),xt=A.max(ut);A.forEach(["u","d"],function(pt){A.forEach(["l","r"],function(wt){var gt=pt+wt,Et=it[gt],kt;if(Et!==at){var zt=A.values(Et);kt=wt==="l"?ht-A.min(zt):xt-A.max(zt),kt&&(it[gt]=A.mapValues(Et,function(Ut){return Ut+kt}))}})})}function K(it,at){return A.mapValues(it.ul,function(ut,ht){if(at)return it[at.toLowerCase()][ht];var xt=A.sortBy(A.map(it,ht));return(xt[1]+xt[2])/2})}function rt(it){var at=B.buildLayerMatrix(it),ut=A.merge(N(it,at),T(it,at)),ht={},xt;A.forEach(["u","d"],function(wt){xt=wt==="u"?at:A.values(at).reverse(),A.forEach(["l","r"],function(gt){gt==="r"&&(xt=A.map(xt,function(Ut){return A.values(Ut).reverse()}));var Et=(wt==="u"?it.predecessors:it.successors).bind(it),kt=L(it,xt,ut,Et),zt=z(it,xt,kt.root,kt.align,gt==="r");gt==="r"&&(zt=A.mapValues(zt,function(Ut){return-Ut})),ht[wt+gt]=zt})});var pt=W(it,ht);return X(ht,pt),K(ht,it.graph().align)}function nt(it,at,ut){return function(ht,xt,pt){var wt=ht.node(xt),gt=ht.node(pt),Et=0,kt;if(Et+=wt.width/2,A.has(wt,"labelpos"))switch(wt.labelpos.toLowerCase()){case"l":kt=-wt.width/2;break;case"r":kt=wt.width/2;break}if(kt&&(Et+=ut?kt:-kt),kt=0,Et+=(wt.dummy?at:it)/2,Et+=(gt.dummy?at:it)/2,Et+=gt.width/2,A.has(gt,"labelpos"))switch(gt.labelpos.toLowerCase()){case"l":kt=gt.width/2;break;case"r":kt=-gt.width/2;break}return kt&&(Et+=ut?kt:-kt),kt=0,Et}}function q(it,at){return it.node(at).width}},93021:function(U,Q,S){"use strict";var A=S(72361),Z=S(53063),B=S(92080).positionX;U.exports=N;function N(k){k=Z.asNonCompoundGraph(k),T(k),A.forEach(B(k),function(_,C){k.node(C).x=_})}function T(k){var _=Z.buildLayerMatrix(k),C=k.graph().ranksep,L=0;A.forEach(_,function(z){var D=A.max(A.map(z,function(W){return k.node(W).height}));A.forEach(z,function(W){k.node(W).y=L+D/2}),L+=D+C})}},61031:function(U,Q,S){"use strict";var A=S(72361),Z=S(76626).Graph,B=S(2416).slack;U.exports=N;function N(C){var L=new Z({directed:!1}),z=C.nodes()[0],D=C.nodeCount();L.setNode(z,{});for(var W,X;T(L,C)<D;)W=k(L,C),X=L.hasNode(W.v)?B(C,W):-B(C,W),_(L,C,X);return L}function T(C,L){function z(D){A.forEach(L.nodeEdges(D),function(W){var X=W.v,K=D===X?W.w:X;!C.hasNode(K)&&!B(L,W)&&(C.setNode(K,{}),C.setEdge(D,K,{}),z(K))})}return A.forEach(C.nodes(),z),C.nodeCount()}function k(C,L){return A.minBy(L.edges(),function(z){if(C.hasNode(z.v)!==C.hasNode(z.w))return B(L,z)})}function _(C,L,z){A.forEach(C.nodes(),function(D){L.node(D).rank+=z})}},64505:function(U,Q,S){"use strict";var A=S(2416),Z=A.longestPath,B=S(61031),N=S(77076);U.exports=T;function T(L){switch(L.graph().ranker){case"network-simplex":C(L);break;case"tight-tree":_(L);break;case"longest-path":k(L);break;default:C(L)}}var k=Z;function _(L){Z(L),B(L)}function C(L){N(L)}},77076:function(U,Q,S){"use strict";var A=S(72361),Z=S(61031),B=S(2416).slack,N=S(2416).longestPath,T=S(76626).alg.preorder,k=S(76626).alg.postorder,_=S(53063).simplify;U.exports=C,C.initLowLimValues=W,C.initCutValues=L,C.calcCutValue=D,C.leaveEdge=K,C.enterEdge=rt,C.exchangeEdges=nt;function C(ut){ut=_(ut),N(ut);var ht=Z(ut);W(ht),L(ht,ut);for(var xt,pt;xt=K(ht);)pt=rt(ht,ut,xt),nt(ht,ut,xt,pt)}function L(ut,ht){var xt=k(ut,ut.nodes());xt=xt.slice(0,xt.length-1),A.forEach(xt,function(pt){z(ut,ht,pt)})}function z(ut,ht,xt){var pt=ut.node(xt),wt=pt.parent;ut.edge(xt,wt).cutvalue=D(ut,ht,xt)}function D(ut,ht,xt){var pt=ut.node(xt),wt=pt.parent,gt=!0,Et=ht.edge(xt,wt),kt=0;return Et||(gt=!1,Et=ht.edge(wt,xt)),kt=Et.weight,A.forEach(ht.nodeEdges(xt),function(zt){var Ut=zt.v===xt,Qt=Ut?zt.w:zt.v;if(Qt!==wt){var Ee=Ut===gt,Le=ht.edge(zt).weight;if(kt+=Ee?Le:-Le,it(ut,xt,Qt)){var tn=ut.edge(xt,Qt).cutvalue;kt+=Ee?-tn:tn}}}),kt}function W(ut,ht){arguments.length<2&&(ht=ut.nodes()[0]),X(ut,{},1,ht)}function X(ut,ht,xt,pt,wt){var gt=xt,Et=ut.node(pt);return ht[pt]=!0,A.forEach(ut.neighbors(pt),function(kt){A.has(ht,kt)||(xt=X(ut,ht,xt,kt,pt))}),Et.low=gt,Et.lim=xt++,wt?Et.parent=wt:delete Et.parent,xt}function K(ut){return A.find(ut.edges(),function(ht){return ut.edge(ht).cutvalue<0})}function rt(ut,ht,xt){var pt=xt.v,wt=xt.w;ht.hasEdge(pt,wt)||(pt=xt.w,wt=xt.v);var gt=ut.node(pt),Et=ut.node(wt),kt=gt,zt=!1;gt.lim>Et.lim&&(kt=Et,zt=!0);var Ut=A.filter(ht.edges(),function(Qt){return zt===at(ut,ut.node(Qt.v),kt)&&zt!==at(ut,ut.node(Qt.w),kt)});return A.minBy(Ut,function(Qt){return B(ht,Qt)})}function nt(ut,ht,xt,pt){var wt=xt.v,gt=xt.w;ut.removeEdge(wt,gt),ut.setEdge(pt.v,pt.w,{}),W(ut),L(ut,ht),q(ut,ht)}function q(ut,ht){var xt=A.find(ut.nodes(),function(wt){return!ht.node(wt).parent}),pt=T(ut,xt);pt=pt.slice(1),A.forEach(pt,function(wt){var gt=ut.node(wt).parent,Et=ht.edge(wt,gt),kt=!1;Et||(Et=ht.edge(gt,wt),kt=!0),ht.node(wt).rank=ht.node(gt).rank+(kt?Et.minlen:-Et.minlen)})}function it(ut,ht,xt){return ut.hasEdge(ht,xt)}function at(ut,ht,xt){return xt.low<=ht.lim&&ht.lim<=xt.lim}},2416:function(U,Q,S){"use strict";var A=S(72361);U.exports={longestPath:Z,slack:B};function Z(N){var T={};function k(_){var C=N.node(_);if(A.has(T,_))return C.rank;T[_]=!0;var L=A.min(A.map(N.outEdges(_),function(z){return k(z.w)-N.edge(z).minlen}));return(L===Number.POSITIVE_INFINITY||L===void 0||L===null)&&(L=0),C.rank=L}A.forEach(N.sources(),k)}function B(N,T){return N.node(T.w).rank-N.node(T.v).rank-N.edge(T).minlen}},53063:function(U,Q,S){"use strict";var A=S(72361),Z=S(76626).Graph;U.exports={addDummyNode:B,simplify:N,asNonCompoundGraph:T,successorWeights:k,predecessorWeights:_,intersectRect:C,buildLayerMatrix:L,normalizeRanks:z,removeEmptyRanks:D,addBorderNode:W,maxRank:X,partition:K,time:rt,notime:nt};function B(q,it,at,ut){var ht;do ht=A.uniqueId(ut);while(q.hasNode(ht));return at.dummy=it,q.setNode(ht,at),ht}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 ut=it.edge(at.v,at.w)||{weight:0,minlen:1},ht=q.edge(at);it.setEdge(at.v,at.w,{weight:ut.weight+ht.weight,minlen:Math.max(ut.minlen,ht.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 ut={};return A.forEach(q.outEdges(at),function(ht){ut[ht.w]=(ut[ht.w]||0)+q.edge(ht).weight}),ut});return A.zipObject(q.nodes(),it)}function _(q){var it=A.map(q.nodes(),function(at){var ut={};return A.forEach(q.inEdges(at),function(ht){ut[ht.v]=(ut[ht.v]||0)+q.edge(ht).weight}),ut});return A.zipObject(q.nodes(),it)}function C(q,it){var at=q.x,ut=q.y,ht=it.x-at,xt=it.y-ut,pt=q.width/2,wt=q.height/2;if(!ht&&!xt)throw new Error("Not possible to find intersection inside of the rectangle");var gt,Et;return Math.abs(xt)*pt>Math.abs(ht)*wt?(xt<0&&(wt=-wt),gt=wt*ht/xt,Et=wt):(ht<0&&(pt=-pt),gt=pt,Et=pt*xt/ht),{x:at+gt,y:ut+Et}}function L(q){var it=A.map(A.range(X(q)+1),function(){return[]});return A.forEach(q.nodes(),function(at){var ut=q.node(at),ht=ut.rank;A.isUndefined(ht)||(it[ht][ut.order]=at)}),it}function z(q){var it=A.min(A.map(q.nodes(),function(at){return q.node(at).rank}));A.forEach(q.nodes(),function(at){var ut=q.node(at);A.has(ut,"rank")&&(ut.rank-=it)})}function D(q){var it=A.min(A.map(q.nodes(),function(xt){return q.node(xt).rank})),at=[];A.forEach(q.nodes(),function(xt){var pt=q.node(xt).rank-it;at[pt]||(at[pt]=[]),at[pt].push(xt)});var ut=0,ht=q.graph().nodeRankFactor;A.forEach(at,function(xt,pt){A.isUndefined(xt)&&pt%ht!==0?--ut:ut&&A.forEach(xt,function(wt){q.node(wt).rank+=ut})})}function W(q,it,at,ut){var ht={width:0,height:0};return arguments.length>=4&&(ht.rank=at,ht.order=ut),B(q,"border",ht,it)}function X(q){return A.max(A.map(q.nodes(),function(it){var at=q.node(it).rank;if(!A.isUndefined(at))return at}))}function K(q,it){var at={lhs:[],rhs:[]};return A.forEach(q,function(ut){it(ut)?at.lhs.push(ut):at.rhs.push(ut)}),at}function rt(q,it){var at=A.now();try{return it()}finally{console.log(q+" time: "+(A.now()-at)+"ms")}}function nt(q,it){return it()}},11897:function(U){U.exports="0.8.5"},37271:function(U){"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,_,C){this.fn=k,this.context=_,this.once=C||!1}function B(k,_,C,L,z){if(typeof C!="function")throw new TypeError("The listener must be a function");var D=new Z(C,L||k,z),W=S?S+_:_;return k._events[W]?k._events[W].fn?k._events[W]=[k._events[W],D]:k._events[W].push(D):(k._events[W]=D,k._eventsCount++),k}function N(k,_){--k._eventsCount===0?k._events=new A:delete k._events[_]}function T(){this._events=new A,this._eventsCount=0}T.prototype.eventNames=function(){var _=[],C,L;if(this._eventsCount===0)return _;for(L in C=this._events)Q.call(C,L)&&_.push(S?L.slice(1):L);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(C)):_},T.prototype.listeners=function(_){var C=S?S+_:_,L=this._events[C];if(!L)return[];if(L.fn)return[L.fn];for(var z=0,D=L.length,W=new Array(D);z<D;z++)W[z]=L[z].fn;return W},T.prototype.listenerCount=function(_){var C=S?S+_:_,L=this._events[C];return L?L.fn?1:L.length:0},T.prototype.emit=function(_,C,L,z,D,W){var X=S?S+_:_;if(!this._events[X])return!1;var K=this._events[X],rt=arguments.length,nt,q;if(K.fn){switch(K.once&&this.removeListener(_,K.fn,void 0,!0),rt){case 1:return K.fn.call(K.context),!0;case 2:return K.fn.call(K.context,C),!0;case 3:return K.fn.call(K.context,C,L),!0;case 4:return K.fn.call(K.context,C,L,z),!0;case 5:return K.fn.call(K.context,C,L,z,D),!0;case 6:return K.fn.call(K.context,C,L,z,D,W),!0}for(q=1,nt=new Array(rt-1);q<rt;q++)nt[q-1]=arguments[q];K.fn.apply(K.context,nt)}else{var it=K.length,at;for(q=0;q<it;q++)switch(K[q].once&&this.removeListener(_,K[q].fn,void 0,!0),rt){case 1:K[q].fn.call(K[q].context);break;case 2:K[q].fn.call(K[q].context,C);break;case 3:K[q].fn.call(K[q].context,C,L);break;case 4:K[q].fn.call(K[q].context,C,L,z);break;default:if(!nt)for(at=1,nt=new Array(rt-1);at<rt;at++)nt[at-1]=arguments[at];K[q].fn.apply(K[q].context,nt)}}return!0},T.prototype.on=function(_,C,L){return B(this,_,C,L,!1)},T.prototype.once=function(_,C,L){return B(this,_,C,L,!0)},T.prototype.removeListener=function(_,C,L,z){var D=S?S+_:_;if(!this._events[D])return this;if(!C)return N(this,D),this;var W=this._events[D];if(W.fn)W.fn===C&&(!z||W.once)&&(!L||W.context===L)&&N(this,D);else{for(var X=0,K=[],rt=W.length;X<rt;X++)(W[X].fn!==C||z&&!W[X].once||L&&W[X].context!==L)&&K.push(W[X]);K.length?this._events[D]=K.length===1?K[0]:K:N(this,D)}return this},T.prototype.removeAllListeners=function(_){var C;return _?(C=S?S+_:_,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,U.exports=T},75172:function(U,Q,S){var A=S(89224);U.exports={Graph:A.Graph,json:S(17401),alg:S(54613),version:A.version}},91606:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(B){var N={},T=[],k;function _(C){A.has(N,C)||(N[C]=!0,k.push(C),A.each(B.successors(C),_),A.each(B.predecessors(C),_))}return A.each(B.nodes(),function(C){k=[],_(C),k.length&&T.push(k)}),T}},21482:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(N,T,k){A.isArray(T)||(T=[T]);var _=(N.isDirected()?N.successors:N.neighbors).bind(N),C=[],L={};return A.each(T,function(z){if(!N.hasNode(z))throw new Error("Graph does not have node: "+z);B(N,z,k==="post",L,_,C)}),C}function B(N,T,k,_,C,L){A.has(_,T)||(_[T]=!0,k||L.push(T),A.each(C(T),function(z){B(N,z,k,_,C,L)}),k&&L.push(T))}},40845:function(U,Q,S){var A=S(13746),Z=S(95329);U.exports=B;function B(N,T,k){return Z.transform(N.nodes(),function(_,C){_[C]=A(N,C,T,k)},{})}},13746:function(U,Q,S){var A=S(95329),Z=S(36614);U.exports=N;var B=A.constant(1);function N(k,_,C,L){return T(k,String(_),C||B,L||function(z){return k.outEdges(z)})}function T(k,_,C,L){var z={},D=new Z,W,X,K=function(rt){var nt=rt.v!==W?rt.v:rt.w,q=z[nt],it=C(rt),at=X.distance+it;if(it<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+rt+" Weight: "+it);at<q.distance&&(q.distance=at,q.predecessor=W,D.decrease(nt,at))};for(k.nodes().forEach(function(rt){var nt=rt===_?0:Number.POSITIVE_INFINITY;z[rt]={distance:nt},D.add(rt,nt)});D.size()>0&&(W=D.removeMin(),X=z[W],X.distance!==Number.POSITIVE_INFINITY);)L(W).forEach(K);return z}},59324:function(U,Q,S){var A=S(95329),Z=S(94558);U.exports=B;function B(N){return A.filter(Z(N),function(T){return T.length>1||T.length===1&&N.hasEdge(T[0],T[0])})}},22893:function(U,Q,S){var A=S(95329);U.exports=B;var Z=A.constant(1);function B(T,k,_){return N(T,k||Z,_||function(C){return T.outEdges(C)})}function N(T,k,_){var C={},L=T.nodes();return L.forEach(function(z){C[z]={},C[z][z]={distance:0},L.forEach(function(D){z!==D&&(C[z][D]={distance:Number.POSITIVE_INFINITY})}),_(z).forEach(function(D){var W=D.v===z?D.w:D.v,X=k(D);C[z][W]={distance:X,predecessor:z}})}),L.forEach(function(z){var D=C[z];L.forEach(function(W){var X=C[W];L.forEach(function(K){var rt=X[z],nt=D[K],q=X[K],it=rt.distance+nt.distance;it<q.distance&&(q.distance=it,q.predecessor=nt.predecessor)})})}),C}},54613:function(U,Q,S){U.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(U,Q,S){var A=S(7793);U.exports=Z;function Z(B){try{A(B)}catch(N){if(N instanceof A.CycleException)return!1;throw N}return!0}},98049:function(U,Q,S){var A=S(21482);U.exports=Z;function Z(B,N){return A(B,N,"post")}},67158:function(U,Q,S){var A=S(21482);U.exports=Z;function Z(B,N){return A(B,N,"pre")}},66058:function(U,Q,S){var A=S(95329),Z=S(6349),B=S(36614);U.exports=N;function N(T,k){var _=new Z,C={},L=new B,z;function D(X){var K=X.v===z?X.w:X.v,rt=L.priority(K);if(rt!==void 0){var nt=k(X);nt<rt&&(C[K]=z,L.decrease(K,nt))}}if(T.nodeCount()===0)return _;A.each(T.nodes(),function(X){L.add(X,Number.POSITIVE_INFINITY),_.setNode(X)}),L.decrease(T.nodes()[0],0);for(var W=!1;L.size()>0;){if(z=L.removeMin(),A.has(C,z))_.setEdge(z,C[z]);else{if(W)throw new Error("Input graph is not connected: "+T);W=!0}T.nodeEdges(z).forEach(D)}return _}},94558:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(B){var N=0,T=[],k={},_=[];function C(L){var z=k[L]={onStack:!0,lowlink:N,index:N++};if(T.push(L),B.successors(L).forEach(function(X){A.has(k,X)?k[X].onStack&&(z.lowlink=Math.min(z.lowlink,k[X].index)):(C(X),z.lowlink=Math.min(z.lowlink,k[X].lowlink))}),z.lowlink===z.index){var D=[],W;do W=T.pop(),k[W].onStack=!1,D.push(W);while(L!==W);_.push(D)}}return B.nodes().forEach(function(L){A.has(k,L)||C(L)}),_}},7793:function(U,Q,S){var A=S(95329);U.exports=Z,Z.CycleException=B;function Z(N){var T={},k={},_=[];function C(L){if(A.has(k,L))throw new B;A.has(T,L)||(k[L]=!0,T[L]=!0,A.each(N.predecessors(L),C),delete k[L],_.push(L))}if(A.each(N.sinks(),C),A.size(T)!==N.nodeCount())throw new B;return _}function B(){}B.prototype=new Error},36614:function(U,Q,S){var A=S(95329);U.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(B){return B.key})},Z.prototype.has=function(B){return A.has(this._keyIndices,B)},Z.prototype.priority=function(B){var N=this._keyIndices[B];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(B,N){var T=this._keyIndices;if(B=String(B),!A.has(T,B)){var k=this._arr,_=k.length;return T[B]=_,k.push({key:B,priority:N}),this._decrease(_),!0}return!1},Z.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var B=this._arr.pop();return delete this._keyIndices[B.key],this._heapify(0),B.key},Z.prototype.decrease=function(B,N){var T=this._keyIndices[B];if(N>this._arr[T].priority)throw new Error("New priority is greater than current priority. Key: "+B+" Old: "+this._arr[T].priority+" New: "+N);this._arr[T].priority=N,this._decrease(T)},Z.prototype._heapify=function(B){var N=this._arr,T=2*B,k=T+1,_=B;T<N.length&&(_=N[T].priority<N[_].priority?T:_,k<N.length&&(_=N[k].priority<N[_].priority?k:_),_!==B&&(this._swap(B,_),this._heapify(_)))},Z.prototype._decrease=function(B){for(var N=this._arr,T=N[B].priority,k;B!==0&&(k=B>>1,!(N[k].priority<T));)this._swap(B,k),B=k},Z.prototype._swap=function(B,N){var T=this._arr,k=this._keyIndices,_=T[B],C=T[N];T[B]=C,T[N]=_,k[C.key]=B,k[_.key]=N}},6349:function(U,Q,S){"use strict";var A=S(95329);U.exports=T;var Z="\0",B="\0",N="";function T(D){this._isDirected=A.has(D,"directed")?D.directed:!0,this._isMultigraph=A.has(D,"multigraph")?D.multigraph:!1,this._isCompound=A.has(D,"compound")?D.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[B]={}),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(D){return this._label=D,this},T.prototype.graph=function(){return this._label},T.prototype.setDefaultNodeLabel=function(D){return A.isFunction(D)||(D=A.constant(D)),this._defaultNodeLabelFn=D,this},T.prototype.nodeCount=function(){return this._nodeCount},T.prototype.nodes=function(){return A.keys(this._nodes)},T.prototype.sources=function(){var D=this;return A.filter(this.nodes(),function(W){return A.isEmpty(D._in[W])})},T.prototype.sinks=function(){var D=this;return A.filter(this.nodes(),function(W){return A.isEmpty(D._out[W])})},T.prototype.setNodes=function(D,W){var X=arguments,K=this;return A.each(D,function(rt){X.length>1?K.setNode(rt,W):K.setNode(rt)}),this},T.prototype.setNode=function(D,W){return A.has(this._nodes,D)?(arguments.length>1&&(this._nodes[D]=W),this):(this._nodes[D]=arguments.length>1?W:this._defaultNodeLabelFn(D),this._isCompound&&(this._parent[D]=B,this._children[D]={},this._children[B][D]=!0),this._in[D]={},this._preds[D]={},this._out[D]={},this._sucs[D]={},++this._nodeCount,this)},T.prototype.node=function(D){return this._nodes[D]},T.prototype.hasNode=function(D){return A.has(this._nodes,D)},T.prototype.removeNode=function(D){var W=this;if(A.has(this._nodes,D)){var X=function(K){W.removeEdge(W._edgeObjs[K])};delete this._nodes[D],this._isCompound&&(this._removeFromParentsChildList(D),delete this._parent[D],A.each(this.children(D),function(K){W.setParent(K)}),delete this._children[D]),A.each(A.keys(this._in[D]),X),delete this._in[D],delete this._preds[D],A.each(A.keys(this._out[D]),X),delete this._out[D],delete this._sucs[D],--this._nodeCount}return this},T.prototype.setParent=function(D,W){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(A.isUndefined(W))W=B;else{W+="";for(var X=W;!A.isUndefined(X);X=this.parent(X))if(X===D)throw new Error("Setting "+W+" as parent of "+D+" would create a cycle");this.setNode(W)}return this.setNode(D),this._removeFromParentsChildList(D),this._parent[D]=W,this._children[W][D]=!0,this},T.prototype._removeFromParentsChildList=function(D){delete this._children[this._parent[D]][D]},T.prototype.parent=function(D){if(this._isCompound){var W=this._parent[D];if(W!==B)return W}},T.prototype.children=function(D){if(A.isUndefined(D)&&(D=B),this._isCompound){var W=this._children[D];if(W)return A.keys(W)}else{if(D===B)return this.nodes();if(this.hasNode(D))return[]}},T.prototype.predecessors=function(D){var W=this._preds[D];if(W)return A.keys(W)},T.prototype.successors=function(D){var W=this._sucs[D];if(W)return A.keys(W)},T.prototype.neighbors=function(D){var W=this.predecessors(D);if(W)return A.union(W,this.successors(D))},T.prototype.isLeaf=function(D){var W;return this.isDirected()?W=this.successors(D):W=this.neighbors(D),W.length===0},T.prototype.filterNodes=function(D){var W=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});W.setGraph(this.graph());var X=this;A.each(this._nodes,function(nt,q){D(q)&&W.setNode(q,nt)}),A.each(this._edgeObjs,function(nt){W.hasNode(nt.v)&&W.hasNode(nt.w)&&W.setEdge(nt,X.edge(nt))});var K={};function rt(nt){var q=X.parent(nt);return q===void 0||W.hasNode(q)?(K[nt]=q,q):q in K?K[q]:rt(q)}return this._isCompound&&A.each(W.nodes(),function(nt){W.setParent(nt,rt(nt))}),W},T.prototype.setDefaultEdgeLabel=function(D){return A.isFunction(D)||(D=A.constant(D)),this._defaultEdgeLabelFn=D,this},T.prototype.edgeCount=function(){return this._edgeCount},T.prototype.edges=function(){return A.values(this._edgeObjs)},T.prototype.setPath=function(D,W){var X=this,K=arguments;return A.reduce(D,function(rt,nt){return K.length>1?X.setEdge(rt,nt,W):X.setEdge(rt,nt),nt}),this},T.prototype.setEdge=function(){var D,W,X,K,rt=!1,nt=arguments[0];typeof nt=="object"&&nt!==null&&"v"in nt?(D=nt.v,W=nt.w,X=nt.name,arguments.length===2&&(K=arguments[1],rt=!0)):(D=nt,W=arguments[1],X=arguments[3],arguments.length>2&&(K=arguments[2],rt=!0)),D=""+D,W=""+W,A.isUndefined(X)||(X=""+X);var q=C(this._isDirected,D,W,X);if(A.has(this._edgeLabels,q))return rt&&(this._edgeLabels[q]=K),this;if(!A.isUndefined(X)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(D),this.setNode(W),this._edgeLabels[q]=rt?K:this._defaultEdgeLabelFn(D,W,X);var it=L(this._isDirected,D,W,X);return D=it.v,W=it.w,Object.freeze(it),this._edgeObjs[q]=it,k(this._preds[W],D),k(this._sucs[D],W),this._in[W][q]=it,this._out[D][q]=it,this._edgeCount++,this},T.prototype.edge=function(D,W,X){var K=arguments.length===1?z(this._isDirected,arguments[0]):C(this._isDirected,D,W,X);return this._edgeLabels[K]},T.prototype.hasEdge=function(D,W,X){var K=arguments.length===1?z(this._isDirected,arguments[0]):C(this._isDirected,D,W,X);return A.has(this._edgeLabels,K)},T.prototype.removeEdge=function(D,W,X){var K=arguments.length===1?z(this._isDirected,arguments[0]):C(this._isDirected,D,W,X),rt=this._edgeObjs[K];return rt&&(D=rt.v,W=rt.w,delete this._edgeLabels[K],delete this._edgeObjs[K],_(this._preds[W],D),_(this._sucs[D],W),delete this._in[W][K],delete this._out[D][K],this._edgeCount--),this},T.prototype.inEdges=function(D,W){var X=this._in[D];if(X){var K=A.values(X);return W?A.filter(K,function(rt){return rt.v===W}):K}},T.prototype.outEdges=function(D,W){var X=this._out[D];if(X){var K=A.values(X);return W?A.filter(K,function(rt){return rt.w===W}):K}},T.prototype.nodeEdges=function(D,W){var X=this.inEdges(D,W);if(X)return X.concat(this.outEdges(D,W))};function k(D,W){D[W]?D[W]++:D[W]=1}function _(D,W){--D[W]||delete D[W]}function C(D,W,X,K){var rt=""+W,nt=""+X;if(!D&&rt>nt){var q=rt;rt=nt,nt=q}return rt+N+nt+N+(A.isUndefined(K)?Z:K)}function L(D,W,X,K){var rt=""+W,nt=""+X;if(!D&&rt>nt){var q=rt;rt=nt,nt=q}var it={v:rt,w:nt};return K&&(it.name=K),it}function z(D,W){return C(D,W.v,W.w,W.name)}},89224:function(U,Q,S){U.exports={Graph:S(6349),version:S(16544)}},17401:function(U,Q,S){var A=S(95329),Z=S(6349);U.exports={write:B,read:k};function B(_){var C={options:{directed:_.isDirected(),multigraph:_.isMultigraph(),compound:_.isCompound()},nodes:N(_),edges:T(_)};return A.isUndefined(_.graph())||(C.value=A.clone(_.graph())),C}function N(_){return A.map(_.nodes(),function(C){var L=_.node(C),z=_.parent(C),D={v:C};return A.isUndefined(L)||(D.value=L),A.isUndefined(z)||(D.parent=z),D})}function T(_){return A.map(_.edges(),function(C){var L=_.edge(C),z={v:C.v,w:C.w};return A.isUndefined(C.name)||(z.name=C.name),A.isUndefined(L)||(z.value=L),z})}function k(_){var C=new Z(_.options).setGraph(_.value);return A.each(_.nodes,function(L){C.setNode(L.v,L.value),L.parent&&C.setParent(L.v,L.parent)}),A.each(_.edges,function(L){C.setEdge({v:L.v,w:L.w,name:L.name},L.value)}),C}},95329:function(U,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._),U.exports=A},16544:function(U){U.exports="2.1.8"},34634:function(U,Q,S){"use strict";S.r(Q),S.d(Q,{isAnyArray:function(){return Z}});const A=Object.prototype.toString;function Z(B){const N=A.call(B);return N.endsWith("Array]")&&!N.includes("Big")}},55973:function(U){U.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(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"DataView");U.exports=B},97288:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"Promise");U.exports=B},23599:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"Set");U.exports=B},98924:function(U,Q,S){var A=S(52166),Z=S(34776),B=S(40393);function N(T){var k=-1,_=T==null?0:T.length;for(this.__data__=new A;++k<_;)this.add(T[k])}N.prototype.add=N.prototype.push=Z,N.prototype.has=B,U.exports=N},26873:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"WeakMap");U.exports=B},74809:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length;++Z<B&&A(S[Z],Z,S)!==!1;);return S}U.exports=Q},86952:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length,N=0,T=[];++Z<B;){var k=S[Z];A(k,Z,S)&&(T[N++]=k)}return T}U.exports=Q},84271:function(U,Q,S){var A=S(17424);function Z(B,N){var T=B==null?0:B.length;return!!T&&A(B,N,0)>-1}U.exports=Z},94874:function(U){function Q(S,A,Z){for(var B=-1,N=S==null?0:S.length;++B<N;)if(Z(A,S[B]))return!0;return!1}U.exports=Q},75010:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length,N=Array(B);++Z<B;)N[Z]=A(S[Z],Z,S);return N}U.exports=Q},57095:function(U){function Q(S,A){for(var Z=-1,B=A.length,N=S.length;++Z<B;)S[N+Z]=A[Z];return S}U.exports=Q},99861:function(U){function Q(S,A,Z,B){var N=-1,T=S==null?0:S.length;for(B&&T&&(Z=S[++N]);++N<T;)Z=A(Z,S[N],N,S);return Z}U.exports=Q},64045:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length;++Z<B;)if(A(S[Z],Z,S))return!0;return!1}U.exports=Q},26539:function(U,Q,S){var A=S(22310),Z=A("length");U.exports=Z},91937:function(U,Q,S){var A=S(95378),Z=S(55451);function B(N,T){return N&&A(T,Z(T),N)}U.exports=B},26680:function(U,Q,S){var A=S(95378),Z=S(56730);function B(N,T){return N&&A(T,Z(T),N)}U.exports=B},99045:function(U,Q,S){var A=S(91866),Z=S(74809),B=S(60348),N=S(91937),T=S(26680),k=S(32315),_=S(47760),C=S(15168),L=S(71678),z=S(12076),D=S(22675),W=S(66139),X=S(79264),K=S(97541),rt=S(4084),nt=S(80744),q=S(57835),it=S(41626),at=S(20816),ut=S(65226),ht=S(55451),xt=S(56730),pt=1,wt=2,gt=4,Et="[object Arguments]",kt="[object Array]",zt="[object Boolean]",Ut="[object Date]",Qt="[object Error]",Ee="[object Function]",Le="[object GeneratorFunction]",tn="[object Map]",er="[object Number]",$r="[object Object]",ca="[object RegExp]",as="[object Set]",Pt="[object String]",_t="[object Symbol]",It="[object WeakMap]",dt="[object ArrayBuffer]",St="[object DataView]",Ct="[object Float32Array]",Gt="[object Float64Array]",oe="[object Int8Array]",ye="[object Int16Array]",de="[object Int32Array]",_e="[object Uint8Array]",Mn="[object Uint8ClampedArray]",Nn="[object Uint16Array]",Pe="[object Uint32Array]",Se={};Se[Et]=Se[kt]=Se[dt]=Se[St]=Se[zt]=Se[Ut]=Se[Ct]=Se[Gt]=Se[oe]=Se[ye]=Se[de]=Se[tn]=Se[er]=Se[$r]=Se[ca]=Se[as]=Se[Pt]=Se[_t]=Se[_e]=Se[Mn]=Se[Nn]=Se[Pe]=!0,Se[Qt]=Se[Ee]=Se[It]=!1;function re(Oe,cr,ua,ne,ss,Rr){var Hn,Lr=cr&pt,os=cr&wt,ha=cr&gt;if(ua&&(Hn=ss?ua(Oe,ne,ss,Rr):ua(Oe)),Hn!==void 0)return Hn;if(!at(Oe))return Oe;var qs=nt(Oe);if(qs){if(Hn=X(Oe),!Lr)return _(Oe,Hn)}else{var da=W(Oe),Fo=da==Ee||da==Le;if(q(Oe))return k(Oe,Lr);if(da==$r||da==Et||Fo&&!ss){if(Hn=os||Fo?{}:rt(Oe),!Lr)return os?L(Oe,T(Hn,Oe)):C(Oe,N(Hn,Oe))}else{if(!Se[da])return ss?Oe:{};Hn=K(Oe,da,Lr)}}Rr||(Rr=new A);var ls=Rr.get(Oe);if(ls)return ls;Rr.set(Oe,Hn),ut(Oe)?Oe.forEach(function(Ti){Hn.add(re(Ti,cr,ua,Ti,Oe,Rr))}):it(Oe)&&Oe.forEach(function(Ti,Oi){Hn.set(Oi,re(Ti,cr,ua,Oi,Oe,Rr))});var cs=ha?os?D:z:os?xt:ht,us=qs?void 0:cs(Oe);return Z(us||Oe,function(Ti,Oi){us&&(Oi=Ti,Ti=Oe[Oi]),B(Hn,Oi,re(Ti,cr,ua,Oi,Oe,Rr))}),Hn}U.exports=re},44107:function(U,Q,S){var A=S(1585),Z=S(49164),B=Z(A);U.exports=B},2659:function(U,Q,S){var A=S(45029);function Z(B,N,T){for(var k=-1,_=B.length;++k<_;){var C=B[k],L=N(C);if(L!=null&&(z===void 0?L===L&&!A(L):T(L,z)))var z=L,D=C}return D}U.exports=Z},32872:function(U,Q,S){var A=S(44107);function Z(B,N){var T=[];return A(B,function(k,_,C){N(k,_,C)&&T.push(k)}),T}U.exports=Z},51533:function(U){function Q(S,A,Z,B){for(var N=S.length,T=Z+(B?1:-1);B?T--:++T<N;)if(A(S[T],T,S))return T;return-1}U.exports=Q},9256:function(U,Q,S){var A=S(57095),Z=S(88133);function B(N,T,k,_,C){var L=-1,z=N.length;for(k||(k=Z),C||(C=[]);++L<z;){var D=N[L];T>0&&k(D)?T>1?B(D,T-1,k,_,C):A(C,D):_||(C[C.length]=D)}return C}U.exports=B},1585:function(U,Q,S){var A=S(14018),Z=S(55451);function B(N,T){return N&&A(N,T,Z)}U.exports=B},89147:function(U,Q,S){var A=S(1186),Z=S(9171);function B(N,T){T=A(T,N);for(var k=0,_=T.length;N!=null&&k<_;)N=N[Z(T[k++])];return k&&k==_?N:void 0}U.exports=B},75635:function(U,Q,S){var A=S(57095),Z=S(80744);function B(N,T,k){var _=T(N);return Z(N)?_:A(_,k(N))}U.exports=B},40302:function(U){function Q(S,A){return S>A}U.exports=Q},3251:function(U){var Q=Object.prototype,S=Q.hasOwnProperty;function A(Z,B){return Z!=null&&S.call(Z,B)}U.exports=A},62348:function(U){function Q(S,A){return S!=null&&A in Object(S)}U.exports=Q},17424:function(U,Q,S){var A=S(51533),Z=S(8373),B=S(49244);function N(T,k,_){return k===k?B(T,k,_):A(T,Z,_)}U.exports=N},77295:function(U,Q,S){var A=S(84412),Z=S(93913);function B(N,T,k,_,C){return N===T?!0:N==null||T==null||!Z(N)&&!Z(T)?N!==N&&T!==T:A(N,T,k,_,B,C)}U.exports=B},84412:function(U,Q,S){var A=S(91866),Z=S(50401),B=S(57710),N=S(4983),T=S(66139),k=S(80744),_=S(57835),C=S(18397),L=1,z="[object Arguments]",D="[object Array]",W="[object Object]",X=Object.prototype,K=X.hasOwnProperty;function rt(nt,q,it,at,ut,ht){var xt=k(nt),pt=k(q),wt=xt?D:T(nt),gt=pt?D:T(q);wt=wt==z?W:wt,gt=gt==z?W:gt;var Et=wt==W,kt=gt==W,zt=wt==gt;if(zt&&_(nt)){if(!_(q))return!1;xt=!0,Et=!1}if(zt&&!Et)return ht||(ht=new A),xt||C(nt)?Z(nt,q,it,at,ut,ht):B(nt,q,wt,it,at,ut,ht);if(!(it&L)){var Ut=Et&&K.call(nt,"__wrapped__"),Qt=kt&&K.call(q,"__wrapped__");if(Ut||Qt){var Ee=Ut?nt.value():nt,Le=Qt?q.value():q;return ht||(ht=new A),ut(Ee,Le,it,at,ht)}}return zt?(ht||(ht=new A),N(nt,q,it,at,ut,ht)):!1}U.exports=rt},55005:function(U,Q,S){var A=S(66139),Z=S(93913),B="[object Map]";function N(T){return Z(T)&&A(T)==B}U.exports=N},51524:function(U,Q,S){var A=S(91866),Z=S(77295),B=1,N=2;function T(k,_,C,L){var z=C.length,D=z,W=!L;if(k==null)return!D;for(k=Object(k);z--;){var X=C[z];if(W&&X[2]?X[1]!==k[X[0]]:!(X[0]in k))return!1}for(;++z<D;){X=C[z];var K=X[0],rt=k[K],nt=X[1];if(W&&X[2]){if(rt===void 0&&!(K in k))return!1}else{var q=new A;if(L)var it=L(rt,nt,K,k,_,q);if(!(it===void 0?Z(nt,rt,B|N,L,q):it))return!1}}return!0}U.exports=T},8373:function(U){function Q(S){return S!==S}U.exports=Q},38652:function(U,Q,S){var A=S(66139),Z=S(93913),B="[object Set]";function N(T){return Z(T)&&A(T)==B}U.exports=N},95979:function(U,Q,S){var A=S(17632),Z=S(38933),B=S(46962),N=S(80744),T=S(35769);function k(_){return typeof _=="function"?_:_==null?B:typeof _=="object"?N(_)?Z(_[0],_[1]):A(_):T(_)}U.exports=k},6019:function(U,Q,S){var A=S(7975),Z=S(23730),B=Object.prototype,N=B.hasOwnProperty;function T(k){if(!A(k))return Z(k);var _=[];for(var C in Object(k))N.call(k,C)&&C!="constructor"&&_.push(C);return _}U.exports=T},93757:function(U){function Q(S,A){return S<A}U.exports=Q},65487:function(U,Q,S){var A=S(44107),Z=S(24665);function B(N,T){var k=-1,_=Z(N)?Array(N.length):[];return A(N,function(C,L,z){_[++k]=T(C,L,z)}),_}U.exports=B},17632:function(U,Q,S){var A=S(51524),Z=S(10261),B=S(24122);function N(T){var k=Z(T);return k.length==1&&k[0][2]?B(k[0][0],k[0][1]):function(_){return _===T||A(_,T,k)}}U.exports=N},38933:function(U,Q,S){var A=S(77295),Z=S(44231),B=S(37879),N=S(86773),T=S(88411),k=S(24122),_=S(9171),C=1,L=2;function z(D,W){return N(D)&&T(W)?k(_(D),W):function(X){var K=Z(X,D);return K===void 0&&K===W?B(X,D):A(W,K,C|L)}}U.exports=z},58506:function(U,Q,S){var A=S(75010),Z=S(89147),B=S(95979),N=S(65487),T=S(33065),k=S(38342),_=S(11249),C=S(46962),L=S(80744);function z(D,W,X){W.length?W=A(W,function(nt){return L(nt)?function(q){return Z(q,nt.length===1?nt[0]:nt)}:nt}):W=[C];var K=-1;W=A(W,k(B));var rt=N(D,function(nt,q,it){var at=A(W,function(ut){return ut(nt)});return{criteria:at,index:++K,value:nt}});return T(rt,function(nt,q){return _(nt,q,X)})}U.exports=z},88832:function(U,Q,S){var A=S(10867),Z=S(37879);function B(N,T){return A(N,T,function(k,_){return Z(N,_)})}U.exports=B},10867:function(U,Q,S){var A=S(89147),Z=S(36897),B=S(1186);function N(T,k,_){for(var C=-1,L=k.length,z={};++C<L;){var D=k[C],W=A(T,D);_(W,D)&&Z(z,B(D,T),W)}return z}U.exports=N},22310:function(U){function Q(S){return function(A){return A==null?void 0:A[S]}}U.exports=Q},96916:function(U,Q,S){var A=S(89147);function Z(B){return function(N){return A(N,B)}}U.exports=Z},36121:function(U){var Q=Math.ceil,S=Math.max;function A(Z,B,N,T){for(var k=-1,_=S(Q((B-Z)/(N||1)),0),C=Array(_);_--;)C[T?_:++k]=Z,Z+=N;return C}U.exports=A},30739:function(U){function Q(S,A,Z,B,N){return N(S,function(T,k,_){Z=B?(B=!1,T):A(Z,T,k,_)}),Z}U.exports=Q},36897:function(U,Q,S){var A=S(60348),Z=S(1186),B=S(70213),N=S(20816),T=S(9171);function k(_,C,L,z){if(!N(_))return _;C=Z(C,_);for(var D=-1,W=C.length,X=W-1,K=_;K!=null&&++D<W;){var rt=T(C[D]),nt=L;if(rt==="__proto__"||rt==="constructor"||rt==="prototype")return _;if(D!=X){var q=K[rt];nt=z?z(q,rt,K):void 0,nt===void 0&&(nt=N(q)?q:B(C[D+1])?[]:{})}A(K,rt,nt),K=K[rt]}return _}U.exports=k},33065:function(U){function Q(S,A){var Z=S.length;for(S.sort(A);Z--;)S[Z]=S[Z].value;return S}U.exports=Q},50230:function(U,Q,S){var A=S(91869),Z=S(75010),B=S(80744),N=S(45029),T=1/0,k=A?A.prototype:void 0,_=k?k.toString:void 0;function C(L){if(typeof L=="string")return L;if(B(L))return Z(L,C)+"";if(N(L))return _?_.call(L):"";var z=L+"";return z=="0"&&1/L==-T?"-0":z}U.exports=C},13927:function(U,Q,S){var A=S(15333),Z=/^\s+/;function B(N){return N&&N.slice(0,A(N)+1).replace(Z,"")}U.exports=B},29098:function(U,Q,S){var A=S(98924),Z=S(84271),B=S(94874),N=S(1931),T=S(47506),k=S(79679),_=200;function C(L,z,D){var W=-1,X=Z,K=L.length,rt=!0,nt=[],q=nt;if(D)rt=!1,X=B;else if(K>=_){var it=z?null:T(L);if(it)return k(it);rt=!1,X=N,q=new A}else q=z?[]:nt;t:for(;++W<K;){var at=L[W],ut=z?z(at):at;if(at=D||at!==0?at:0,rt&&ut===ut){for(var ht=q.length;ht--;)if(q[ht]===ut)continue t;z&&q.push(ut),nt.push(at)}else X(q,ut,D)||(q!==nt&&q.push(ut),nt.push(at))}return nt}U.exports=C},20720:function(U,Q,S){var A=S(75010);function Z(B,N){return A(N,function(T){return B[T]})}U.exports=Z},94484:function(U){function Q(S,A,Z){for(var B=-1,N=S.length,T=A.length,k={};++B<N;){var _=B<T?A[B]:void 0;Z(k,S[B],_)}return k}U.exports=Q},1931:function(U){function Q(S,A){return S.has(A)}U.exports=Q},11756:function(U,Q,S){var A=S(46962);function Z(B){return typeof B=="function"?B:A}U.exports=Z},1186:function(U,Q,S){var A=S(80744),Z=S(86773),B=S(40493),N=S(44140);function T(k,_){return A(k)?k:Z(k,_)?[k]:B(N(k))}U.exports=T},27984:function(U,Q,S){var A=S(20188);function Z(B,N){var T=N?A(B.buffer):B.buffer;return new B.constructor(T,B.byteOffset,B.byteLength)}U.exports=Z},78583:function(U){var Q=/\w*$/;function S(A){var Z=new A.constructor(A.source,Q.exec(A));return Z.lastIndex=A.lastIndex,Z}U.exports=S},28757:function(U,Q,S){var A=S(91869),Z=A?A.prototype:void 0,B=Z?Z.valueOf:void 0;function N(T){return B?Object(B.call(T)):{}}U.exports=N},83018:function(U,Q,S){var A=S(45029);function Z(B,N){if(B!==N){var T=B!==void 0,k=B===null,_=B===B,C=A(B),L=N!==void 0,z=N===null,D=N===N,W=A(N);if(!z&&!W&&!C&&B>N||C&&L&&D&&!z&&!W||k&&L&&D||!T&&D||!_)return 1;if(!k&&!C&&!W&&B<N||W&&T&&_&&!k&&!C||z&&T&&_||!L&&_||!D)return-1}return 0}U.exports=Z},11249:function(U,Q,S){var A=S(83018);function Z(B,N,T){for(var k=-1,_=B.criteria,C=N.criteria,L=_.length,z=T.length;++k<L;){var D=A(_[k],C[k]);if(D){if(k>=z)return D;var W=T[k];return D*(W=="desc"?-1:1)}}return B.index-N.index}U.exports=Z},15168:function(U,Q,S){var A=S(95378),Z=S(58966);function B(N,T){return A(N,Z(N),T)}U.exports=B},71678:function(U,Q,S){var A=S(95378),Z=S(66817);function B(N,T){return A(N,Z(N),T)}U.exports=B},49164:function(U,Q,S){var A=S(24665);function Z(B,N){return function(T,k){if(T==null)return T;if(!A(T))return B(T,k);for(var _=T.length,C=N?_:-1,L=Object(T);(N?C--:++C<_)&&k(L[C],C,L)!==!1;);return T}}U.exports=Z},19554:function(U,Q,S){var A=S(95979),Z=S(24665),B=S(55451);function N(T){return function(k,_,C){var L=Object(k);if(!Z(k)){var z=A(_,3);k=B(k),_=function(W){return z(L[W],W,L)}}var D=T(k,_,C);return D>-1?L[z?k[D]:D]:void 0}}U.exports=N},76106:function(U,Q,S){var A=S(36121),Z=S(8138),B=S(97341);function N(T){return function(k,_,C){return C&&typeof C!="number"&&Z(k,_,C)&&(_=C=void 0),k=B(k),_===void 0?(_=k,k=0):_=B(_),C=C===void 0?k<_?1:-1:B(C),A(k,_,C,T)}}U.exports=N},47506:function(U,Q,S){var A=S(23599),Z=S(9958),B=S(79679),N=1/0,T=A&&1/B(new A([,-0]))[1]==N?function(k){return new A(k)}:Z;U.exports=T},50401:function(U,Q,S){var A=S(98924),Z=S(64045),B=S(1931),N=1,T=2;function k(_,C,L,z,D,W){var X=L&N,K=_.length,rt=C.length;if(K!=rt&&!(X&&rt>K))return!1;var nt=W.get(_),q=W.get(C);if(nt&&q)return nt==C&&q==_;var it=-1,at=!0,ut=L&T?new A:void 0;for(W.set(_,C),W.set(C,_);++it<K;){var ht=_[it],xt=C[it];if(z)var pt=X?z(xt,ht,it,C,_,W):z(ht,xt,it,_,C,W);if(pt!==void 0){if(pt)continue;at=!1;break}if(ut){if(!Z(C,function(wt,gt){if(!B(ut,gt)&&(ht===wt||D(ht,wt,L,z,W)))return ut.push(gt)})){at=!1;break}}else if(!(ht===xt||D(ht,xt,L,z,W))){at=!1;break}}return W.delete(_),W.delete(C),at}U.exports=k},57710:function(U,Q,S){var A=S(91869),Z=S(77945),B=S(43607),N=S(50401),T=S(83383),k=S(79679),_=1,C=2,L="[object Boolean]",z="[object Date]",D="[object Error]",W="[object Map]",X="[object Number]",K="[object RegExp]",rt="[object Set]",nt="[object String]",q="[object Symbol]",it="[object ArrayBuffer]",at="[object DataView]",ut=A?A.prototype:void 0,ht=ut?ut.valueOf:void 0;function xt(pt,wt,gt,Et,kt,zt,Ut){switch(gt){case at:if(pt.byteLength!=wt.byteLength||pt.byteOffset!=wt.byteOffset)return!1;pt=pt.buffer,wt=wt.buffer;case it:return!(pt.byteLength!=wt.byteLength||!zt(new Z(pt),new Z(wt)));case L:case z:case X:return B(+pt,+wt);case D:return pt.name==wt.name&&pt.message==wt.message;case K:case nt:return pt==wt+"";case W:var Qt=T;case rt:var Ee=Et&_;if(Qt||(Qt=k),pt.size!=wt.size&&!Ee)return!1;var Le=Ut.get(pt);if(Le)return Le==wt;Et|=C,Ut.set(pt,wt);var tn=N(Qt(pt),Qt(wt),Et,kt,zt,Ut);return Ut.delete(pt),tn;case q:if(ht)return ht.call(pt)==ht.call(wt)}return!1}U.exports=xt},4983:function(U,Q,S){var A=S(12076),Z=1,B=Object.prototype,N=B.hasOwnProperty;function T(k,_,C,L,z,D){var W=C&Z,X=A(k),K=X.length,rt=A(_),nt=rt.length;if(K!=nt&&!W)return!1;for(var q=K;q--;){var it=X[q];if(!(W?it in _:N.call(_,it)))return!1}var at=D.get(k),ut=D.get(_);if(at&&ut)return at==_&&ut==k;var ht=!0;D.set(k,_),D.set(_,k);for(var xt=W;++q<K;){it=X[q];var pt=k[it],wt=_[it];if(L)var gt=W?L(wt,pt,it,_,k,D):L(pt,wt,it,k,_,D);if(!(gt===void 0?pt===wt||z(pt,wt,C,L,D):gt)){ht=!1;break}xt||(xt=it=="constructor")}if(ht&&!xt){var Et=k.constructor,kt=_.constructor;Et!=kt&&"constructor"in k&&"constructor"in _&&!(typeof Et=="function"&&Et instanceof Et&&typeof kt=="function"&&kt instanceof kt)&&(ht=!1)}return D.delete(k),D.delete(_),ht}U.exports=T},522:function(U,Q,S){var A=S(40151),Z=S(19652),B=S(71152);function N(T){return B(Z(T,void 0,A),T+"")}U.exports=N},12076:function(U,Q,S){var A=S(75635),Z=S(58966),B=S(55451);function N(T){return A(T,B,Z)}U.exports=N},22675:function(U,Q,S){var A=S(75635),Z=S(66817),B=S(56730);function N(T){return A(T,B,Z)}U.exports=N},10261:function(U,Q,S){var A=S(88411),Z=S(55451);function B(N){for(var T=Z(N),k=T.length;k--;){var _=T[k],C=N[_];T[k]=[_,C,A(C)]}return T}U.exports=B},58966:function(U,Q,S){var A=S(86952),Z=S(4134),B=Object.prototype,N=B.propertyIsEnumerable,T=Object.getOwnPropertySymbols,k=T?function(_){return _==null?[]:(_=Object(_),A(T(_),function(C){return N.call(_,C)}))}:Z;U.exports=k},66817:function(U,Q,S){var A=S(57095),Z=S(49217),B=S(58966),N=S(4134),T=Object.getOwnPropertySymbols,k=T?function(_){for(var C=[];_;)A(C,B(_)),_=Z(_);return C}:N;U.exports=k},66139:function(U,Q,S){var A=S(15584),Z=S(40164),B=S(97288),N=S(23599),T=S(26873),k=S(86756),_=S(63256),C="[object Map]",L="[object Object]",z="[object Promise]",D="[object Set]",W="[object WeakMap]",X="[object DataView]",K=_(A),rt=_(Z),nt=_(B),q=_(N),it=_(T),at=k;(A&&at(new A(new ArrayBuffer(1)))!=X||Z&&at(new Z)!=C||B&&at(B.resolve())!=z||N&&at(new N)!=D||T&&at(new T)!=W)&&(at=function(ut){var ht=k(ut),xt=ht==L?ut.constructor:void 0,pt=xt?_(xt):"";if(pt)switch(pt){case K:return X;case rt:return C;case nt:return z;case q:return D;case it:return W}return ht}),U.exports=at},63100:function(U,Q,S){var A=S(1186),Z=S(13053),B=S(80744),N=S(70213),T=S(11156),k=S(9171);function _(C,L,z){L=A(L,C);for(var D=-1,W=L.length,X=!1;++D<W;){var K=k(L[D]);if(!(X=C!=null&&z(C,K)))break;C=C[K]}return X||++D!=W?X:(W=C==null?0:C.length,!!W&&T(W)&&N(K,W)&&(B(C)||Z(C)))}U.exports=_},55015:function(U){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",Z="\\u20d0-\\u20ff",B=S+A+Z,N="\\ufe0e\\ufe0f",T="\\u200d",k=RegExp("["+T+Q+B+N+"]");function _(C){return k.test(C)}U.exports=_},79264:function(U){var Q=Object.prototype,S=Q.hasOwnProperty;function A(Z){var B=Z.length,N=new Z.constructor(B);return B&&typeof Z[0]=="string"&&S.call(Z,"index")&&(N.index=Z.index,N.input=Z.input),N}U.exports=A},97541:function(U,Q,S){var A=S(20188),Z=S(27984),B=S(78583),N=S(28757),T=S(78358),k="[object Boolean]",_="[object Date]",C="[object Map]",L="[object Number]",z="[object RegExp]",D="[object Set]",W="[object String]",X="[object Symbol]",K="[object ArrayBuffer]",rt="[object DataView]",nt="[object Float32Array]",q="[object Float64Array]",it="[object Int8Array]",at="[object Int16Array]",ut="[object Int32Array]",ht="[object Uint8Array]",xt="[object Uint8ClampedArray]",pt="[object Uint16Array]",wt="[object Uint32Array]";function gt(Et,kt,zt){var Ut=Et.constructor;switch(kt){case K:return A(Et);case k:case _:return new Ut(+Et);case rt:return Z(Et,zt);case nt:case q:case it:case at:case ut:case ht:case xt:case pt:case wt:return T(Et,zt);case C:return new Ut;case L:case W:return new Ut(Et);case z:return B(Et);case D:return new Ut;case X:return N(Et)}}U.exports=gt},88133:function(U,Q,S){var A=S(91869),Z=S(13053),B=S(80744),N=A?A.isConcatSpreadable:void 0;function T(k){return B(k)||Z(k)||!!(N&&k&&k[N])}U.exports=T},86773:function(U,Q,S){var A=S(80744),Z=S(45029),B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N=/^\w*$/;function T(k,_){if(A(k))return!1;var C=typeof k;return C=="number"||C=="symbol"||C=="boolean"||k==null||Z(k)?!0:N.test(k)||!B.test(k)||_!=null&&k in Object(_)}U.exports=T},88411:function(U,Q,S){var A=S(20816);function Z(B){return B===B&&!A(B)}U.exports=Z},83383:function(U){function Q(S){var A=-1,Z=Array(S.size);return S.forEach(function(B,N){Z[++A]=[N,B]}),Z}U.exports=Q},24122:function(U){function Q(S,A){return function(Z){return Z==null?!1:Z[S]===A&&(A!==void 0||S in Object(Z))}}U.exports=Q},26332:function(U,Q,S){var A=S(52858),Z=500;function B(N){var T=A(N,function(_){return k.size===Z&&k.clear(),_}),k=T.cache;return T}U.exports=B},23730:function(U,Q,S){var A=S(31030),Z=A(Object.keys,Object);U.exports=Z},34776:function(U){var Q="__lodash_hash_undefined__";function S(A){return this.__data__.set(A,Q),this}U.exports=S},40393:function(U){function Q(S){return this.__data__.has(S)}U.exports=Q},79679:function(U){function Q(S){var A=-1,Z=Array(S.size);return S.forEach(function(B){Z[++A]=B}),Z}U.exports=Q},49244:function(U){function Q(S,A,Z){for(var B=Z-1,N=S.length;++B<N;)if(S[B]===A)return B;return-1}U.exports=Q},29405:function(U,Q,S){var A=S(26539),Z=S(55015),B=S(60844);function N(T){return Z(T)?B(T):A(T)}U.exports=N},40493:function(U,Q,S){var A=S(26332),Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/\\(\\)?/g,N=A(function(T){var k=[];return T.charCodeAt(0)===46&&k.push(""),T.replace(Z,function(_,C,L,z){k.push(L?z.replace(B,"$1"):C||_)}),k});U.exports=N},9171:function(U,Q,S){var A=S(45029),Z=1/0;function B(N){if(typeof N=="string"||A(N))return N;var T=N+"";return T=="0"&&1/N==-Z?"-0":T}U.exports=B},15333:function(U){var Q=/\s/;function S(A){for(var Z=A.length;Z--&&Q.test(A.charAt(Z)););return Z}U.exports=S},60844:function(U){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",Z="\\u20d0-\\u20ff",B=S+A+Z,N="\\ufe0e\\ufe0f",T="["+Q+"]",k="["+B+"]",_="\\ud83c[\\udffb-\\udfff]",C="(?:"+k+"|"+_+")",L="[^"+Q+"]",z="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",W="\\u200d",X=C+"?",K="["+N+"]?",rt="(?:"+W+"(?:"+[L,z,D].join("|")+")"+K+X+")*",nt=K+X+rt,q="(?:"+[L+k+"?",k,z,D,T].join("|")+")",it=RegExp(_+"(?="+_+")|"+q+nt,"g");function at(ut){for(var ht=it.lastIndex=0;it.test(ut);)++ht;return ht}U.exports=at},76833:function(U,Q,S){var A=S(99045),Z=4;function B(N){return A(N,Z)}U.exports=B},20250:function(U,Q,S){var A=S(99045),Z=1,B=4;function N(T){return A(T,Z|B)}U.exports=N},28548:function(U,Q,S){var A=S(92918),Z=S(43607),B=S(8138),N=S(56730),T=Object.prototype,k=T.hasOwnProperty,_=A(function(C,L){C=Object(C);var z=-1,D=L.length,W=D>2?L[2]:void 0;for(W&&B(L[0],L[1],W)&&(D=1);++z<D;)for(var X=L[z],K=N(X),rt=-1,nt=K.length;++rt<nt;){var q=K[rt],it=C[q];(it===void 0||Z(it,T[q])&&!k.call(C,q))&&(C[q]=X[q])}return C});U.exports=_},76934:function(U,Q,S){U.exports=S(99204)},64725:function(U,Q,S){var A=S(86952),Z=S(32872),B=S(95979),N=S(80744);function T(k,_){var C=N(k)?A:Z;return C(k,B(_,3))}U.exports=T},79785:function(U,Q,S){var A=S(19554),Z=S(9991),B=A(Z);U.exports=B},9991:function(U,Q,S){var A=S(51533),Z=S(95979),B=S(12824),N=Math.max;function T(k,_,C){var L=k==null?0:k.length;if(!L)return-1;var z=C==null?0:B(C);return z<0&&(z=N(L+z,0)),A(k,Z(_,3),z)}U.exports=T},40151:function(U,Q,S){var A=S(9256);function Z(B){var N=B==null?0:B.length;return N?A(B,1):[]}U.exports=Z},99204:function(U,Q,S){var A=S(74809),Z=S(44107),B=S(11756),N=S(80744);function T(k,_){var C=N(k)?A:Z;return C(k,B(_))}U.exports=T},23190:function(U,Q,S){var A=S(14018),Z=S(11756),B=S(56730);function N(T,k){return T==null?T:A(T,Z(k),B)}U.exports=N},44231:function(U,Q,S){var A=S(89147);function Z(B,N,T){var k=B==null?void 0:A(B,N);return k===void 0?T:k}U.exports=Z},99946:function(U,Q,S){var A=S(3251),Z=S(63100);function B(N,T){return N!=null&&Z(N,T,A)}U.exports=B},37879:function(U,Q,S){var A=S(62348),Z=S(63100);function B(N,T){return N!=null&&Z(N,T,A)}U.exports=B},61627:function(U,Q,S){var A=S(6019),Z=S(66139),B=S(13053),N=S(80744),T=S(24665),k=S(57835),_=S(7975),C=S(18397),L="[object Map]",z="[object Set]",D=Object.prototype,W=D.hasOwnProperty;function X(K){if(K==null)return!0;if(T(K)&&(N(K)||typeof K=="string"||typeof K.splice=="function"||k(K)||C(K)||B(K)))return!K.length;var rt=Z(K);if(rt==L||rt==z)return!K.size;if(_(K))return!A(K).length;for(var nt in K)if(W.call(K,nt))return!1;return!0}U.exports=X},41626:function(U,Q,S){var A=S(55005),Z=S(38342),B=S(52495),N=B&&B.isMap,T=N?Z(N):A;U.exports=T},65226:function(U,Q,S){var A=S(38652),Z=S(38342),B=S(52495),N=B&&B.isSet,T=N?Z(N):A;U.exports=T},7941:function(U,Q,S){var A=S(86756),Z=S(80744),B=S(93913),N="[object String]";function T(k){return typeof k=="string"||!Z(k)&&B(k)&&A(k)==N}U.exports=T},45029:function(U,Q,S){var A=S(86756),Z=S(93913),B="[object Symbol]";function N(T){return typeof T=="symbol"||Z(T)&&A(T)==B}U.exports=N},16513:function(U){function Q(S){return S===void 0}U.exports=Q},55451:function(U,Q,S){var A=S(63333),Z=S(6019),B=S(24665);function N(T){return B(T)?A(T):Z(T)}U.exports=N},10611:function(U){function Q(S){var A=S==null?0:S.length;return A?S[A-1]:void 0}U.exports=Q},9924:function(U,Q,S){var A=S(75010),Z=S(95979),B=S(65487),N=S(80744);function T(k,_){var C=N(k)?A:B;return C(k,Z(_,3))}U.exports=T},70642:function(U,Q,S){var A=S(42813),Z=S(1585),B=S(95979);function N(T,k){var _={};return k=B(k,3),Z(T,function(C,L,z){A(_,L,k(C,L,z))}),_}U.exports=N},95987:function(U,Q,S){var A=S(2659),Z=S(40302),B=S(46962);function N(T){return T&&T.length?A(T,B,Z):void 0}U.exports=N},52858:function(U,Q,S){var A=S(52166),Z="Expected a function";function B(N,T){if(typeof N!="function"||T!=null&&typeof T!="function")throw new TypeError(Z);var k=function(){var _=arguments,C=T?T.apply(this,_):_[0],L=k.cache;if(L.has(C))return L.get(C);var z=N.apply(this,_);return k.cache=L.set(C,z)||L,z};return k.cache=new(B.Cache||A),k}B.Cache=A,U.exports=B},73376:function(U,Q,S){var A=S(2659),Z=S(93757),B=S(46962);function N(T){return T&&T.length?A(T,B,Z):void 0}U.exports=N},83296:function(U,Q,S){var A=S(2659),Z=S(95979),B=S(93757);function N(T,k){return T&&T.length?A(T,Z(k,2),B):void 0}U.exports=N},9958:function(U){function Q(){}U.exports=Q},5795:function(U,Q,S){var A=S(33152),Z=function(){return A.Date.now()};U.exports=Z},89409:function(U,Q,S){var A=S(88832),Z=S(522),B=Z(function(N,T){return N==null?{}:A(N,T)});U.exports=B},35769:function(U,Q,S){var A=S(22310),Z=S(96916),B=S(86773),N=S(9171);function T(k){return B(k)?A(N(k)):Z(k)}U.exports=T},60859:function(U,Q,S){var A=S(76106),Z=A();U.exports=Z},16473:function(U,Q,S){var A=S(99861),Z=S(44107),B=S(95979),N=S(30739),T=S(80744);function k(_,C,L){var z=T(_)?A:N,D=arguments.length<3;return z(_,B(C,4),L,D,Z)}U.exports=k},40617:function(U,Q,S){var A=S(6019),Z=S(66139),B=S(24665),N=S(7941),T=S(29405),k="[object Map]",_="[object Set]";function C(L){if(L==null)return 0;if(B(L))return N(L)?T(L):L.length;var z=Z(L);return z==k||z==_?L.size:A(L).length}U.exports=C},351:function(U,Q,S){var A=S(9256),Z=S(58506),B=S(92918),N=S(8138),T=B(function(k,_){if(k==null)return[];var C=_.length;return C>1&&N(k,_[0],_[1])?_=[]:C>2&&N(_[0],_[1],_[2])&&(_=[_[0]]),Z(k,A(_,1),[])});U.exports=T},4134:function(U){function Q(){return[]}U.exports=Q},97341:function(U,Q,S){var A=S(59406),Z=1/0,B=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*B}return T===T?T:0}U.exports=N},12824:function(U,Q,S){var A=S(97341);function Z(B){var N=A(B),T=N%1;return N===N?T?N-T:N:0}U.exports=Z},59406:function(U,Q,S){var A=S(13927),Z=S(20816),B=S(45029),N=NaN,T=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,_=/^0o[0-7]+$/i,C=parseInt;function L(z){if(typeof z=="number")return z;if(B(z))return N;if(Z(z)){var D=typeof z.valueOf=="function"?z.valueOf():z;z=Z(D)?D+"":D}if(typeof z!="string")return z===0?z:+z;z=A(z);var W=k.test(z);return W||_.test(z)?C(z.slice(2),W?2:8):T.test(z)?N:+z}U.exports=L},44140:function(U,Q,S){var A=S(50230);function Z(B){return B==null?"":A(B)}U.exports=Z},91116:function(U,Q,S){var A=S(74809),Z=S(35024),B=S(1585),N=S(95979),T=S(49217),k=S(80744),_=S(57835),C=S(9363),L=S(20816),z=S(18397);function D(W,X,K){var rt=k(W),nt=rt||_(W)||z(W);if(X=N(X,4),K==null){var q=W&&W.constructor;nt?K=rt?new q:[]:L(W)?K=C(q)?Z(T(W)):{}:K={}}return(nt?A:B)(W,function(it,at,ut){return X(K,it,at,ut)}),K}U.exports=D},44065:function(U,Q,S){var A=S(9256),Z=S(92918),B=S(29098),N=S(41590),T=Z(function(k){return B(A(k,1,N,!0))});U.exports=T},95708:function(U,Q,S){var A=S(44140),Z=0;function B(N){var T=++Z;return A(N)+T}U.exports=B},81229:function(U,Q,S){var A=S(20720),Z=S(55451);function B(N){return N==null?[]:A(N,Z(N))}U.exports=B},65441:function(U,Q,S){var A=S(60348),Z=S(94484);function B(N,T){return Z(N||[],T||[],A)}U.exports=B},34402:function(U,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 _=k.fromIndex,C=_===void 0?0:_,L=k.toIndex,z=L===void 0?T.length:L;if(C<0||C>=T.length||!Number.isInteger(C))throw new Error("fromIndex must be a positive integer smaller than length");if(z<=C||z>T.length||!Number.isInteger(z))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var D=T[C],W=C+1;W<z;W++)T[W]>D&&(D=T[W]);return D}function B(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 _=k.fromIndex,C=_===void 0?0:_,L=k.toIndex,z=L===void 0?T.length:L;if(C<0||C>=T.length||!Number.isInteger(C))throw new Error("fromIndex must be a positive integer smaller than length");if(z<=C||z>T.length||!Number.isInteger(z))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var D=T[C],W=C+1;W<z;W++)T[W]<D&&(D=T[W]);return D}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 _;if(k.output!==void 0){if(!(0,A.isAnyArray)(k.output))throw new TypeError("output option must be an array if specified");_=k.output}else _=new Array(T.length);var C=B(T),L=Z(T);if(C===L)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var z=k.min,D=z===void 0?k.autoMinMax?C:0:z,W=k.max,X=W===void 0?k.autoMinMax?L:1:W;if(D>=X)throw new RangeError("min option must be smaller than max option");for(var K=(X-D)/(L-C),rt=0;rt<T.length;rt++)_[rt]=(T[rt]-C)*K+D;return _}},81683:function(U,Q,S){"use strict";var A=S(55973),Z=Array.prototype.concat,B=Array.prototype.slice,N=U.exports=function(k){for(var _=[],C=0,L=k.length;C<L;C++){var z=k[C];A(z)?_=Z.call(_,B.call(z)):_.push(z)}return _};N.wrap=function(T){return function(){return T(N(arguments))}}},99755:function(U){"use strict";U.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(U){"use strict";U.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(U){"use strict";U.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(U){"use strict";U.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(U){"use strict";U.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(U){"use strict";U.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(U,Q,S){"use strict";S.d(Q,{Z:function(){return N}});var A=S(58289),Z=S(75538),B=S(85458);function N(T,k,_){return k=(0,A.Z)(k),(0,B.Z)(T,(0,Z.Z)()?Reflect.construct(k,_||[],(0,A.Z)(T).constructor):k.apply(T,_))}},72317:function(U,Q){"use strict";var S={value:()=>{}};function A(){for(var k=0,_=arguments.length,C={},L;k<_;++k){if(!(L=arguments[k]+"")||L in C||/[\s.]/.test(L))throw new Error("illegal type: "+L);C[L]=[]}return new Z(C)}function Z(k){this._=k}function B(k,_){return k.trim().split(/^|\s+/).map(function(C){var L="",z=C.indexOf(".");if(z>=0&&(L=C.slice(z+1),C=C.slice(0,z)),C&&!_.hasOwnProperty(C))throw new Error("unknown type: "+C);return{type:C,name:L}})}Z.prototype=A.prototype={constructor:Z,on:function(k,_){var C=this._,L=B(k+"",C),z,D=-1,W=L.length;if(arguments.length<2){for(;++D<W;)if((z=(k=L[D]).type)&&(z=N(C[z],k.name)))return z;return}if(_!=null&&typeof _!="function")throw new Error("invalid callback: "+_);for(;++D<W;)if(z=(k=L[D]).type)C[z]=T(C[z],k.name,_);else if(_==null)for(z in C)C[z]=T(C[z],k.name,null);return this},copy:function(){var k={},_=this._;for(var C in _)k[C]=_[C].slice();return new Z(k)},call:function(k,_){if((z=arguments.length-2)>0)for(var C=new Array(z),L=0,z,D;L<z;++L)C[L]=arguments[L+2];if(!this._.hasOwnProperty(k))throw new Error("unknown type: "+k);for(D=this._[k],L=0,z=D.length;L<z;++L)D[L].value.apply(_,C)},apply:function(k,_,C){if(!this._.hasOwnProperty(k))throw new Error("unknown type: "+k);for(var L=this._[k],z=0,D=L.length;z<D;++z)L[z].value.apply(_,C)}};function N(k,_){for(var C=0,L=k.length,z;C<L;++C)if((z=k[C]).name===_)return z.value}function T(k,_,C){for(var L=0,z=k.length;L<z;++L)if(k[L].name===_){k[L]=S,k=k.slice(0,L).concat(k.slice(L+1));break}return C!=null&&k.push({name:_,value:C}),k}Q.Z=A},12713:function(U,Q,S){"use strict";S.d(Q,{H:function(){return B},Z:function(){return A}});function A(N){const T=+this._x.call(null,N),k=+this._y.call(null,N),_=+this._z.call(null,N);return Z(this.cover(T,k,_),T,k,_,N)}function Z(N,T,k,_,C){if(isNaN(T)||isNaN(k)||isNaN(_))return N;var L,z=N._root,D={data:C},W=N._x0,X=N._y0,K=N._z0,rt=N._x1,nt=N._y1,q=N._z1,it,at,ut,ht,xt,pt,wt,gt,Et,kt,zt;if(!z)return N._root=D,N;for(;z.length;)if((wt=T>=(it=(W+rt)/2))?W=it:rt=it,(gt=k>=(at=(X+nt)/2))?X=at:nt=at,(Et=_>=(ut=(K+q)/2))?K=ut:q=ut,L=z,!(z=z[kt=Et<<2|gt<<1|wt]))return L[kt]=D,N;if(ht=+N._x.call(null,z.data),xt=+N._y.call(null,z.data),pt=+N._z.call(null,z.data),T===ht&&k===xt&&_===pt)return D.next=z,L?L[kt]=D:N._root=D,N;do L=L?L[kt]=new Array(8):N._root=new Array(8),(wt=T>=(it=(W+rt)/2))?W=it:rt=it,(gt=k>=(at=(X+nt)/2))?X=at:nt=at,(Et=_>=(ut=(K+q)/2))?K=ut:q=ut;while((kt=Et<<2|gt<<1|wt)===(zt=(pt>=ut)<<2|(xt>=at)<<1|ht>=it));return L[zt]=z,L[kt]=D,N}function B(N){Array.isArray(N)||(N=Array.from(N));const T=N.length,k=new Float64Array(T),_=new Float64Array(T),C=new Float64Array(T);let L=1/0,z=1/0,D=1/0,W=-1/0,X=-1/0,K=-1/0;for(let rt=0,nt,q,it,at;rt<T;++rt)isNaN(q=+this._x.call(null,nt=N[rt]))||isNaN(it=+this._y.call(null,nt))||isNaN(at=+this._z.call(null,nt))||(k[rt]=q,_[rt]=it,C[rt]=at,q<L&&(L=q),q>W&&(W=q),it<z&&(z=it),it>X&&(X=it),at<D&&(D=at),at>K&&(K=at));if(L>W||z>X||D>K)return this;this.cover(L,z,D).cover(W,X,K);for(let rt=0;rt<T;++rt)Z(this,k[rt],_[rt],C[rt],N[rt]);return this}},17646:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B,N){if(isNaN(Z=+Z)||isNaN(B=+B)||isNaN(N=+N))return this;var T=this._x0,k=this._y0,_=this._z0,C=this._x1,L=this._y1,z=this._z1;if(isNaN(T))C=(T=Math.floor(Z))+1,L=(k=Math.floor(B))+1,z=(_=Math.floor(N))+1;else{for(var D=C-T||1,W=this._root,X,K;T>Z||Z>=C||k>B||B>=L||_>N||N>=z;)switch(K=(N<_)<<2|(B<k)<<1|Z<T,X=new Array(8),X[K]=W,W=X,D*=2,K){case 0:C=T+D,L=k+D,z=_+D;break;case 1:T=C-D,L=k+D,z=_+D;break;case 2:C=T+D,k=L-D,z=_+D;break;case 3:T=C-D,k=L-D,z=_+D;break;case 4:C=T+D,L=k+D,_=z-D;break;case 5:T=C-D,L=k+D,_=z-D;break;case 6:C=T+D,k=L-D,_=z-D;break;case 7:T=C-D,k=L-D,_=z-D;break}this._root&&this._root.length&&(this._root=W)}return this._x0=T,this._y0=k,this._z0=_,this._x1=C,this._y1=L,this._z1=z,this}},39894:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=[];return this.visit(function(B){if(!B.length)do Z.push(B.data);while(B=B.next)}),Z}},56033:function(U,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(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(26805);function Z(B,N,T,k){var _,C=this._x0,L=this._y0,z=this._z0,D,W,X,K,rt,nt,q=this._x1,it=this._y1,at=this._z1,ut=[],ht=this._root,xt,pt;for(ht&&ut.push(new A.Z(ht,C,L,z,q,it,at)),k==null?k=1/0:(C=B-k,L=N-k,z=T-k,q=B+k,it=N+k,at=T+k,k*=k);xt=ut.pop();)if(!(!(ht=xt.node)||(D=xt.x0)>q||(W=xt.y0)>it||(X=xt.z0)>at||(K=xt.x1)<C||(rt=xt.y1)<L||(nt=xt.z1)<z))if(ht.length){var wt=(D+K)/2,gt=(W+rt)/2,Et=(X+nt)/2;ut.push(new A.Z(ht[7],wt,gt,Et,K,rt,nt),new A.Z(ht[6],D,gt,Et,wt,rt,nt),new A.Z(ht[5],wt,W,Et,K,gt,nt),new A.Z(ht[4],D,W,Et,wt,gt,nt),new A.Z(ht[3],wt,gt,X,K,rt,Et),new A.Z(ht[2],D,gt,X,wt,rt,Et),new A.Z(ht[1],wt,W,X,K,gt,Et),new A.Z(ht[0],D,W,X,wt,gt,Et)),(pt=(T>=Et)<<2|(N>=gt)<<1|B>=wt)&&(xt=ut[ut.length-1],ut[ut.length-1]=ut[ut.length-1-pt],ut[ut.length-1-pt]=xt)}else{var kt=B-+this._x.call(null,ht.data),zt=N-+this._y.call(null,ht.data),Ut=T-+this._z.call(null,ht.data),Qt=kt*kt+zt*zt+Ut*Ut;if(Qt<k){var Ee=Math.sqrt(k=Qt);C=B-Ee,L=N-Ee,z=T-Ee,q=B+Ee,it=N+Ee,at=T+Ee,_=ht.data}}return _}},72096:function(U,Q,S){"use strict";S.d(Q,{r:function(){return Z}});const A=(B,N,T,k,_,C)=>Math.sqrt(is(B-k,2)+is(N-_,2)+is(T-C,2));function Z(B,N,T,k){const _=[],C=B-k,L=N-k,z=T-k,D=B+k,W=N+k,X=T+k;return this.visit((K,rt,nt,q,it,at,ut)=>{if(!K.length)do{const ht=K.data;A(B,N,T,this._x(ht),this._y(ht),this._z(ht))<=k&&_.push(ht)}while(K=K.next);return rt>D||nt>W||q>X||it<C||at<L||ut<z}),_}},26805:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B,N,T,k,_,C){this.node=Z,this.x0=B,this.y0=N,this.z0=T,this.x1=k,this.y1=_,this.z1=C}},7695:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return rt}});var A=S(12713),Z=S(17646),B=S(39894),N=S(56033),T=S(77480),k=S(72096),_=S(36989),C=S(10325),L=S(15902),z=S(12027),D=S(66612),W=S(14763),X=S(94009),K=S(68889);function rt(at,ut,ht,xt){var pt=new nt(ut==null?W.P:ut,ht==null?X.q:ht,xt==null?K.i:xt,NaN,NaN,NaN,NaN,NaN,NaN);return at==null?pt:pt.addAll(at)}function nt(at,ut,ht,xt,pt,wt,gt,Et,kt){this._x=at,this._y=ut,this._z=ht,this._x0=xt,this._y0=pt,this._z0=wt,this._x1=gt,this._y1=Et,this._z1=kt,this._root=void 0}function q(at){for(var ut={data:at.data},ht=ut;at=at.next;)ht=ht.next={data:at.data};return ut}var it=rt.prototype=nt.prototype;it.copy=function(){var at=new nt(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),ut=this._root,ht,xt;if(!ut)return at;if(!ut.length)return at._root=q(ut),at;for(ht=[{source:ut,target:at._root=new Array(8)}];ut=ht.pop();)for(var pt=0;pt<8;++pt)(xt=ut.source[pt])&&(xt.length?ht.push({source:xt,target:ut.target[pt]=new Array(8)}):ut.target[pt]=q(xt));return at},it.add=A.Z,it.addAll=A.H,it.cover=Z.Z,it.data=B.Z,it.extent=N.Z,it.find=T.Z,it.findAllWithinRadius=k.r,it.remove=_.Z,it.removeAll=_.x,it.root=C.Z,it.size=L.Z,it.visit=z.Z,it.visitAfter=D.Z,it.x=W.Z,it.y=X.Z,it.z=K.Z},36989:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return Z}});function A(B){if(isNaN(rt=+this._x.call(null,B))||isNaN(nt=+this._y.call(null,B))||isNaN(q=+this._z.call(null,B)))return this;var N,T=this._root,k,_,C,L=this._x0,z=this._y0,D=this._z0,W=this._x1,X=this._y1,K=this._z1,rt,nt,q,it,at,ut,ht,xt,pt,wt,gt;if(!T)return this;if(T.length)for(;;){if((ht=rt>=(it=(L+W)/2))?L=it:W=it,(xt=nt>=(at=(z+X)/2))?z=at:X=at,(pt=q>=(ut=(D+K)/2))?D=ut:K=ut,N=T,!(T=T[wt=pt<<2|xt<<1|ht]))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,gt=wt)}for(;T.data!==B;)if(_=T,!(T=T.next))return this;return(C=T.next)&&delete T.next,_?(C?_.next=C:delete _.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[gt]=T:this._root=T),this):(this._root=C,this)}function Z(B){for(var N=0,T=B.length;N<T;++N)this.remove(B[N]);return this}},10325:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},15902:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=0;return this.visit(function(B){if(!B.length)do++Z;while(B=B.next)}),Z}},12027:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(26805);function Z(B){var N=[],T,k=this._root,_,C,L,z,D,W,X;for(k&&N.push(new A.Z(k,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));T=N.pop();)if(!B(k=T.node,C=T.x0,L=T.y0,z=T.z0,D=T.x1,W=T.y1,X=T.z1)&&k.length){var K=(C+D)/2,rt=(L+W)/2,nt=(z+X)/2;(_=k[7])&&N.push(new A.Z(_,K,rt,nt,D,W,X)),(_=k[6])&&N.push(new A.Z(_,C,rt,nt,K,W,X)),(_=k[5])&&N.push(new A.Z(_,K,L,nt,D,rt,X)),(_=k[4])&&N.push(new A.Z(_,C,L,nt,K,rt,X)),(_=k[3])&&N.push(new A.Z(_,K,rt,z,D,W,nt)),(_=k[2])&&N.push(new A.Z(_,C,rt,z,K,W,nt)),(_=k[1])&&N.push(new A.Z(_,K,L,z,D,rt,nt)),(_=k[0])&&N.push(new A.Z(_,C,L,z,K,rt,nt))}return this}},66612:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(26805);function Z(B){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 _=k.node;if(_.length){var C,L=k.x0,z=k.y0,D=k.z0,W=k.x1,X=k.y1,K=k.z1,rt=(L+W)/2,nt=(z+X)/2,q=(D+K)/2;(C=_[0])&&N.push(new A.Z(C,L,z,D,rt,nt,q)),(C=_[1])&&N.push(new A.Z(C,rt,z,D,W,nt,q)),(C=_[2])&&N.push(new A.Z(C,L,nt,D,rt,X,q)),(C=_[3])&&N.push(new A.Z(C,rt,nt,D,W,X,q)),(C=_[4])&&N.push(new A.Z(C,L,z,q,rt,nt,K)),(C=_[5])&&N.push(new A.Z(C,rt,z,q,W,nt,K)),(C=_[6])&&N.push(new A.Z(C,L,nt,q,rt,X,K)),(C=_[7])&&N.push(new A.Z(C,rt,nt,q,W,X,K))}T.push(k)}for(;k=T.pop();)B(k.node,k.x0,k.y0,k.z0,k.x1,k.y1,k.z1);return this}},14763:function(U,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return Z}});function A(B){return B[0]}function Z(B){return arguments.length?(this._x=B,this):this._x}},94009:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z},q:function(){return A}});function A(B){return B[1]}function Z(B){return arguments.length?(this._y=B,this):this._y}},68889:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z},i:function(){return A}});function A(B){return B[2]}function Z(B){return arguments.length?(this._z=B,this):this._z}},60272:function(U,Q,S){"use strict";S.d(Q,{H:function(){return B},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,_){if(isNaN(T)||isNaN(k))return N;var C,L=N._root,z={data:_},D=N._x0,W=N._y0,X=N._x1,K=N._y1,rt,nt,q,it,at,ut,ht,xt;if(!L)return N._root=z,N;for(;L.length;)if((at=T>=(rt=(D+X)/2))?D=rt:X=rt,(ut=k>=(nt=(W+K)/2))?W=nt:K=nt,C=L,!(L=L[ht=ut<<1|at]))return C[ht]=z,N;if(q=+N._x.call(null,L.data),it=+N._y.call(null,L.data),T===q&&k===it)return z.next=L,C?C[ht]=z:N._root=z,N;do C=C?C[ht]=new Array(4):N._root=new Array(4),(at=T>=(rt=(D+X)/2))?D=rt:X=rt,(ut=k>=(nt=(W+K)/2))?W=nt:K=nt;while((ht=ut<<1|at)===(xt=(it>=nt)<<1|q>=rt));return C[xt]=L,C[ht]=z,N}function B(N){var T,k,_=N.length,C,L,z=new Array(_),D=new Array(_),W=1/0,X=1/0,K=-1/0,rt=-1/0;for(k=0;k<_;++k)isNaN(C=+this._x.call(null,T=N[k]))||isNaN(L=+this._y.call(null,T))||(z[k]=C,D[k]=L,C<W&&(W=C),C>K&&(K=C),L<X&&(X=L),L>rt&&(rt=L));if(W>K||X>rt)return this;for(this.cover(W,X).cover(K,rt),k=0;k<_;++k)Z(this,z[k],D[k],N[k]);return this}},51097:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B){if(isNaN(Z=+Z)||isNaN(B=+B))return this;var N=this._x0,T=this._y0,k=this._x1,_=this._y1;if(isNaN(N))k=(N=Math.floor(Z))+1,_=(T=Math.floor(B))+1;else{for(var C=k-N||1,L=this._root,z,D;N>Z||Z>=k||T>B||B>=_;)switch(D=(B<T)<<1|Z<N,z=new Array(4),z[D]=L,L=z,C*=2,D){case 0:k=N+C,_=T+C;break;case 1:N=k-C,_=T+C;break;case 2:k=N+C,T=_-C;break;case 3:N=k-C,T=_-C;break}this._root&&this._root.length&&(this._root=L)}return this._x0=N,this._y0=T,this._x1=k,this._y1=_,this}},58007:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=[];return this.visit(function(B){if(!B.length)do Z.push(B.data);while(B=B.next)}),Z}},12070:function(U,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(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(44213);function Z(B,N,T){var k,_=this._x0,C=this._y0,L,z,D,W,X=this._x1,K=this._y1,rt=[],nt=this._root,q,it;for(nt&&rt.push(new A.Z(nt,_,C,X,K)),T==null?T=1/0:(_=B-T,C=N-T,X=B+T,K=N+T,T*=T);q=rt.pop();)if(!(!(nt=q.node)||(L=q.x0)>X||(z=q.y0)>K||(D=q.x1)<_||(W=q.y1)<C))if(nt.length){var at=(L+D)/2,ut=(z+W)/2;rt.push(new A.Z(nt[3],at,ut,D,W),new A.Z(nt[2],L,ut,at,W),new A.Z(nt[1],at,z,D,ut),new A.Z(nt[0],L,z,at,ut)),(it=(N>=ut)<<1|B>=at)&&(q=rt[rt.length-1],rt[rt.length-1]=rt[rt.length-1-it],rt[rt.length-1-it]=q)}else{var ht=B-+this._x.call(null,nt.data),xt=N-+this._y.call(null,nt.data),pt=ht*ht+xt*xt;if(pt<T){var wt=Math.sqrt(T=pt);_=B-wt,C=N-wt,X=B+wt,K=N+wt,k=nt.data}}return k}},44213:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B,N,T,k){this.node=Z,this.x0=B,this.y0=N,this.x1=T,this.y1=k}},14301:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return X}});var A=S(60272),Z=S(51097),B=S(58007),N=S(12070),T=S(47064),k=S(88866),_=S(10864),C=S(68984),L=S(3715),z=S(73607),D=S(56570),W=S(30992);function X(q,it,at){var ut=new K(it==null?D.P:it,at==null?W.q:at,NaN,NaN,NaN,NaN);return q==null?ut:ut.addAll(q)}function K(q,it,at,ut,ht,xt){this._x=q,this._y=it,this._x0=at,this._y0=ut,this._x1=ht,this._y1=xt,this._root=void 0}function rt(q){for(var it={data:q.data},at=it;q=q.next;)at=at.next={data:q.data};return it}var nt=X.prototype=K.prototype;nt.copy=function(){var q=new K(this._x,this._y,this._x0,this._y0,this._x1,this._y1),it=this._root,at,ut;if(!it)return q;if(!it.length)return q._root=rt(it),q;for(at=[{source:it,target:q._root=new Array(4)}];it=at.pop();)for(var ht=0;ht<4;++ht)(ut=it.source[ht])&&(ut.length?at.push({source:ut,target:it.target[ht]=new Array(4)}):it.target[ht]=rt(ut));return q},nt.add=A.Z,nt.addAll=A.H,nt.cover=Z.Z,nt.data=B.Z,nt.extent=N.Z,nt.find=T.Z,nt.remove=k.Z,nt.removeAll=k.x,nt.root=_.Z,nt.size=C.Z,nt.visit=L.Z,nt.visitAfter=z.Z,nt.x=D.Z,nt.y=W.Z},88866:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return Z}});function A(B){if(isNaN(X=+this._x.call(null,B))||isNaN(K=+this._y.call(null,B)))return this;var N,T=this._root,k,_,C,L=this._x0,z=this._y0,D=this._x1,W=this._y1,X,K,rt,nt,q,it,at,ut;if(!T)return this;if(T.length)for(;;){if((q=X>=(rt=(L+D)/2))?L=rt:D=rt,(it=K>=(nt=(z+W)/2))?z=nt:W=nt,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,ut=at)}for(;T.data!==B;)if(_=T,!(T=T.next))return this;return(C=T.next)&&delete T.next,_?(C?_.next=C:delete _.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[ut]=T:this._root=T),this):(this._root=C,this)}function Z(B){for(var N=0,T=B.length;N<T;++N)this.remove(B[N]);return this}},10864:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},68984:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=0;return this.visit(function(B){if(!B.length)do++Z;while(B=B.next)}),Z}},3715:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(44213);function Z(B){var N=[],T,k=this._root,_,C,L,z,D;for(k&&N.push(new A.Z(k,this._x0,this._y0,this._x1,this._y1));T=N.pop();)if(!B(k=T.node,C=T.x0,L=T.y0,z=T.x1,D=T.y1)&&k.length){var W=(C+z)/2,X=(L+D)/2;(_=k[3])&&N.push(new A.Z(_,W,X,z,D)),(_=k[2])&&N.push(new A.Z(_,C,X,W,D)),(_=k[1])&&N.push(new A.Z(_,W,L,z,X)),(_=k[0])&&N.push(new A.Z(_,C,L,W,X))}return this}},73607:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(44213);function Z(B){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 _=k.node;if(_.length){var C,L=k.x0,z=k.y0,D=k.x1,W=k.y1,X=(L+D)/2,K=(z+W)/2;(C=_[0])&&N.push(new A.Z(C,L,z,X,K)),(C=_[1])&&N.push(new A.Z(C,X,z,D,K)),(C=_[2])&&N.push(new A.Z(C,L,K,X,W)),(C=_[3])&&N.push(new A.Z(C,X,K,D,W))}T.push(k)}for(;k=T.pop();)B(k.node,k.x0,k.y0,k.x1,k.y1);return this}},56570:function(U,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return Z}});function A(B){return B[0]}function Z(B){return arguments.length?(this._x=B,this):this._x}},30992:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z},q:function(){return A}});function A(B){return B[1]}function Z(B){return arguments.length?(this._y=B,this):this._y}},83833:function(U,Q,S){"use strict";S.d(Q,{HT:function(){return rt}});var A=0,Z=0,B=0,N=1e3,T,k,_=0,C=0,L=0,z=typeof performance=="object"&&performance.now?performance:Date,D=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(ht){setTimeout(ht,17)};function W(){return C||(D(X),C=z.now()+L)}function X(){C=0}function K(){this._call=this._time=this._next=null}K.prototype=rt.prototype={constructor:K,restart:function(ht,xt,pt){if(typeof ht!="function")throw new TypeError("callback is not a function");pt=(pt==null?W():+pt)+(xt==null?0:+xt),!this._next&&k!==this&&(k?k._next=this:T=this,k=this),this._call=ht,this._time=pt,ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,ut())}};function rt(ht,xt,pt){var wt=new K;return wt.restart(ht,xt,pt),wt}function nt(){W(),++A;for(var ht=T,xt;ht;)(xt=C-ht._time)>=0&&ht._call.call(void 0,xt),ht=ht._next;--A}function q(){C=(_=z.now())+L,A=Z=0;try{nt()}finally{A=0,at(),C=0}}function it(){var ht=z.now(),xt=ht-_;xt>N&&(L-=xt,_=ht)}function at(){for(var ht,xt=T,pt,wt=1/0;xt;)xt._call?(wt>xt._time&&(wt=xt._time),ht=xt,xt=xt._next):(pt=xt._next,xt._next=null,xt=ht?ht._next=pt:T=pt);k=ht,ut(wt)}function ut(ht){if(!A){Z&&(Z=clearTimeout(Z));var xt=ht-C;xt>24?(ht<1/0&&(Z=setTimeout(q,ht-z.now()-L)),B&&(B=clearInterval(B))):(B||(_=z.now(),B=setInterval(it,N)),A=1,D(q))}}},80813:function(U,Q,S){"use strict";S.d(Q,{CR:function(){return q},Jh:function(){return X},Q_:function(){return Qt},XA:function(){return nt},ZT:function(){return Z},_T:function(){return N},ev:function(){return ut},mG:function(){return W},pi:function(){return B},pr:function(){return at}});var A=function(Pt,_t){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(Pt,_t)};function Z(Pt,_t){if(typeof _t!="function"&&_t!==null)throw new TypeError("Class extends value "+String(_t)+" is not a constructor or null");A(Pt,_t);function It(){this.constructor=Pt}Pt.prototype=_t===null?Object.create(_t):(It.prototype=_t.prototype,new It)}var B=function(){return B=Object.assign||function(_t){for(var It,dt=1,St=arguments.length;dt<St;dt++){It=arguments[dt];for(var Ct in It)Object.prototype.hasOwnProperty.call(It,Ct)&&(_t[Ct]=It[Ct])}return _t},B.apply(this,arguments)};function N(Pt,_t){var It={};for(var dt in Pt)Object.prototype.hasOwnProperty.call(Pt,dt)&&_t.indexOf(dt)<0&&(It[dt]=Pt[dt]);if(Pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var St=0,dt=Object.getOwnPropertySymbols(Pt);St<dt.length;St++)_t.indexOf(dt[St])<0&&Object.prototype.propertyIsEnumerable.call(Pt,dt[St])&&(It[dt[St]]=Pt[dt[St]]);return It}function T(Pt,_t,It,dt){var St=arguments.length,Ct=St<3?_t:dt===null?dt=Object.getOwnPropertyDescriptor(_t,It):dt,Gt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ct=Reflect.decorate(Pt,_t,It,dt);else for(var oe=Pt.length-1;oe>=0;oe--)(Gt=Pt[oe])&&(Ct=(St<3?Gt(Ct):St>3?Gt(_t,It,Ct):Gt(_t,It))||Ct);return St>3&&Ct&&Object.defineProperty(_t,It,Ct),Ct}function k(Pt,_t){return function(It,dt){_t(It,dt,Pt)}}function _(Pt,_t,It,dt,St,Ct){function Gt(cr){if(cr!==void 0&&typeof cr!="function")throw new TypeError("Function expected");return cr}for(var oe=dt.kind,ye=oe==="getter"?"get":oe==="setter"?"set":"value",de=!_t&&Pt?dt.static?Pt:Pt.prototype:null,_e=_t||(de?Object.getOwnPropertyDescriptor(de,dt.name):{}),Mn,Nn=!1,Pe=It.length-1;Pe>=0;Pe--){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(cr){if(Nn)throw new TypeError("Cannot add initializers after decoration has completed");Ct.push(Gt(cr||null))};var Oe=(0,It[Pe])(oe==="accessor"?{get:_e.get,set:_e.set}:_e[ye],Se);if(oe==="accessor"){if(Oe===void 0)continue;if(Oe===null||typeof Oe!="object")throw new TypeError("Object expected");(Mn=Gt(Oe.get))&&(_e.get=Mn),(Mn=Gt(Oe.set))&&(_e.set=Mn),(Mn=Gt(Oe.init))&&St.unshift(Mn)}else(Mn=Gt(Oe))&&(oe==="field"?St.unshift(Mn):_e[ye]=Mn)}de&&Object.defineProperty(de,dt.name,_e),Nn=!0}function C(Pt,_t,It){for(var dt=arguments.length>2,St=0;St<_t.length;St++)It=dt?_t[St].call(Pt,It):_t[St].call(Pt);return dt?It:void 0}function L(Pt){return typeof Pt=="symbol"?Pt:"".concat(Pt)}function z(Pt,_t,It){return typeof _t=="symbol"&&(_t=_t.description?"[".concat(_t.description,"]"):""),Object.defineProperty(Pt,"name",{configurable:!0,value:It?"".concat(It," ",_t):_t})}function D(Pt,_t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Pt,_t)}function W(Pt,_t,It,dt){function St(Ct){return Ct instanceof It?Ct:new It(function(Gt){Gt(Ct)})}return new(It||(It=Promise))(function(Ct,Gt){function oe(_e){try{de(dt.next(_e))}catch(Mn){Gt(Mn)}}function ye(_e){try{de(dt.throw(_e))}catch(Mn){Gt(Mn)}}function de(_e){_e.done?Ct(_e.value):St(_e.value).then(oe,ye)}de((dt=dt.apply(Pt,_t||[])).next())})}function X(Pt,_t){var It={label:0,sent:function(){if(Ct[0]&1)throw Ct[1];return Ct[1]},trys:[],ops:[]},dt,St,Ct,Gt=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return Gt.next=oe(0),Gt.throw=oe(1),Gt.return=oe(2),typeof Symbol=="function"&&(Gt[Symbol.iterator]=function(){return this}),Gt;function oe(de){return function(_e){return ye([de,_e])}}function ye(de){if(dt)throw new TypeError("Generator is already executing.");for(;Gt&&(Gt=0,de[0]&&(It=0)),It;)try{if(dt=1,St&&(Ct=de[0]&2?St.return:de[0]?St.throw||((Ct=St.return)&&Ct.call(St),0):St.next)&&!(Ct=Ct.call(St,de[1])).done)return Ct;switch(St=0,Ct&&(de=[de[0]&2,Ct.value]),de[0]){case 0:case 1:Ct=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(Ct=It.trys,!(Ct=Ct.length>0&&Ct[Ct.length-1])&&(de[0]===6||de[0]===2)){It=0;continue}if(de[0]===3&&(!Ct||de[1]>Ct[0]&&de[1]<Ct[3])){It.label=de[1];break}if(de[0]===6&&It.label<Ct[1]){It.label=Ct[1],Ct=de;break}if(Ct&&It.label<Ct[2]){It.label=Ct[2],It.ops.push(de);break}Ct[2]&&It.ops.pop(),It.trys.pop();continue}de=_t.call(Pt,It)}catch(_e){de=[6,_e],St=0}finally{dt=Ct=0}if(de[0]&5)throw de[1];return{value:de[0]?de[1]:void 0,done:!0}}}var K=Object.create?function(Pt,_t,It,dt){dt===void 0&&(dt=It);var St=Object.getOwnPropertyDescriptor(_t,It);(!St||("get"in St?!_t.__esModule:St.writable||St.configurable))&&(St={enumerable:!0,get:function(){return _t[It]}}),Object.defineProperty(Pt,dt,St)}:function(Pt,_t,It,dt){dt===void 0&&(dt=It),Pt[dt]=_t[It]};function rt(Pt,_t){for(var It in Pt)It!=="default"&&!Object.prototype.hasOwnProperty.call(_t,It)&&K(_t,Pt,It)}function nt(Pt){var _t=typeof Symbol=="function"&&Symbol.iterator,It=_t&&Pt[_t],dt=0;if(It)return It.call(Pt);if(Pt&&typeof Pt.length=="number")return{next:function(){return Pt&&dt>=Pt.length&&(Pt=void 0),{value:Pt&&Pt[dt++],done:!Pt}}};throw new TypeError(_t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(Pt,_t){var It=typeof Symbol=="function"&&Pt[Symbol.iterator];if(!It)return Pt;var dt=It.call(Pt),St,Ct=[],Gt;try{for(;(_t===void 0||_t-- >0)&&!(St=dt.next()).done;)Ct.push(St.value)}catch(oe){Gt={error:oe}}finally{try{St&&!St.done&&(It=dt.return)&&It.call(dt)}finally{if(Gt)throw Gt.error}}return Ct}function it(){for(var Pt=[],_t=0;_t<arguments.length;_t++)Pt=Pt.concat(q(arguments[_t]));return Pt}function at(){for(var Pt=0,_t=0,It=arguments.length;_t<It;_t++)Pt+=arguments[_t].length;for(var dt=Array(Pt),St=0,_t=0;_t<It;_t++)for(var Ct=arguments[_t],Gt=0,oe=Ct.length;Gt<oe;Gt++,St++)dt[St]=Ct[Gt];return dt}function ut(Pt,_t,It){if(It||arguments.length===2)for(var dt=0,St=_t.length,Ct;dt<St;dt++)(Ct||!(dt in _t))&&(Ct||(Ct=Array.prototype.slice.call(_t,0,dt)),Ct[dt]=_t[dt]);return Pt.concat(Ct||Array.prototype.slice.call(_t))}function ht(Pt){return this instanceof ht?(this.v=Pt,this):new ht(Pt)}function xt(Pt,_t,It){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var dt=It.apply(Pt,_t||[]),St,Ct=[];return St=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),oe("next"),oe("throw"),oe("return",Gt),St[Symbol.asyncIterator]=function(){return this},St;function Gt(Pe){return function(Se){return Promise.resolve(Se).then(Pe,Mn)}}function oe(Pe,Se){dt[Pe]&&(St[Pe]=function(re){return new Promise(function(Oe,cr){Ct.push([Pe,re,Oe,cr])>1||ye(Pe,re)})},Se&&(St[Pe]=Se(St[Pe])))}function ye(Pe,Se){try{de(dt[Pe](Se))}catch(re){Nn(Ct[0][3],re)}}function de(Pe){Pe.value instanceof ht?Promise.resolve(Pe.value.v).then(_e,Mn):Nn(Ct[0][2],Pe)}function _e(Pe){ye("next",Pe)}function Mn(Pe){ye("throw",Pe)}function Nn(Pe,Se){Pe(Se),Ct.shift(),Ct.length&&ye(Ct[0][0],Ct[0][1])}}function pt(Pt){var _t,It;return _t={},dt("next"),dt("throw",function(St){throw St}),dt("return"),_t[Symbol.iterator]=function(){return this},_t;function dt(St,Ct){_t[St]=Pt[St]?function(Gt){return(It=!It)?{value:ht(Pt[St](Gt)),done:!1}:Ct?Ct(Gt):Gt}:Ct}}function wt(Pt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var _t=Pt[Symbol.asyncIterator],It;return _t?_t.call(Pt):(Pt=typeof nt=="function"?nt(Pt):Pt[Symbol.iterator](),It={},dt("next"),dt("throw"),dt("return"),It[Symbol.asyncIterator]=function(){return this},It);function dt(Ct){It[Ct]=Pt[Ct]&&function(Gt){return new Promise(function(oe,ye){Gt=Pt[Ct](Gt),St(oe,ye,Gt.done,Gt.value)})}}function St(Ct,Gt,oe,ye){Promise.resolve(ye).then(function(de){Ct({value:de,done:oe})},Gt)}}function gt(Pt,_t){return Object.defineProperty?Object.defineProperty(Pt,"raw",{value:_t}):Pt.raw=_t,Pt}var Et=Object.create?function(Pt,_t){Object.defineProperty(Pt,"default",{enumerable:!0,value:_t})}:function(Pt,_t){Pt.default=_t},kt=function(Pt){return kt=Object.getOwnPropertyNames||function(_t){var It=[];for(var dt in _t)Object.prototype.hasOwnProperty.call(_t,dt)&&(It[It.length]=dt);return It},kt(Pt)};function zt(Pt){if(Pt&&Pt.__esModule)return Pt;var _t={};if(Pt!=null)for(var It=kt(Pt),dt=0;dt<It.length;dt++)It[dt]!=="default"&&K(_t,Pt,It[dt]);return Et(_t,Pt),_t}function Ut(Pt){return Pt&&Pt.__esModule?Pt:{default:Pt}}function Qt(Pt,_t,It,dt){if(It==="a"&&!dt)throw new TypeError("Private accessor was defined without a getter");if(typeof _t=="function"?Pt!==_t||!dt:!_t.has(Pt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return It==="m"?dt:It==="a"?dt.call(Pt):dt?dt.value:_t.get(Pt)}function Ee(Pt,_t,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 _t=="function"?Pt!==_t||!St:!_t.has(Pt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return dt==="a"?St.call(Pt,It):St?St.value=It:_t.set(Pt,It),It}function Le(Pt,_t){if(_t===null||typeof _t!="object"&&typeof _t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Pt=="function"?_t===Pt:Pt.has(_t)}function tn(Pt,_t,It){if(_t!=null){if(typeof _t!="object"&&typeof _t!="function")throw new TypeError("Object expected.");var dt,St;if(It){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");dt=_t[Symbol.asyncDispose]}if(dt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");dt=_t[Symbol.dispose],It&&(St=dt)}if(typeof dt!="function")throw new TypeError("Object not disposable.");St&&(dt=function(){try{St.call(this)}catch(Ct){return Promise.reject(Ct)}}),Pt.stack.push({value:_t,dispose:dt,async:It})}else It&&Pt.stack.push({async:!0});return _t}var er=typeof SuppressedError=="function"?SuppressedError:function(Pt,_t,It){var dt=new Error(It);return dt.name="SuppressedError",dt.error=Pt,dt.suppressed=_t,dt};function $r(Pt){function _t(Ct){Pt.error=Pt.hasError?new er(Ct,Pt.error,"An error was suppressed during disposal."):Ct,Pt.hasError=!0}var It,dt=0;function St(){for(;It=Pt.stack.pop();)try{if(!It.async&&dt===1)return dt=0,Pt.stack.push(It),Promise.resolve().then(St);if(It.dispose){var Ct=It.dispose.call(It.value);if(It.async)return dt|=2,Promise.resolve(Ct).then(St,function(Gt){return _t(Gt),St()})}else dt|=1}catch(Gt){_t(Gt)}if(dt===1)return Pt.hasError?Promise.reject(Pt.error):Promise.resolve();if(Pt.hasError)throw Pt.error}return St()}function ca(Pt,_t){return typeof Pt=="string"&&/^\.\.?\//.test(Pt)?Pt.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(It,dt,St,Ct,Gt){return dt?_t?".jsx":".js":St&&(!Ct||!Gt)?It:St+Ct+"."+Gt.toLowerCase()+"js"}):Pt}var as={__extends:Z,__assign:B,__rest:N,__decorate:T,__param:k,__esDecorate:_,__runInitializers:C,__propKey:L,__setFunctionName:z,__metadata:D,__awaiter:W,__generator:X,__createBinding:K,__exportStar:rt,__values:nt,__read:q,__spread:it,__spreadArrays:at,__spreadArray:ut,__await:ht,__asyncGenerator:xt,__asyncDelegator:pt,__asyncValues:wt,__makeTemplateObject:gt,__importStar:zt,__importDefault:Ut,__classPrivateFieldGet:Qt,__classPrivateFieldSet:Ee,__classPrivateFieldIn:Le,__addDisposableResource:tn,__disposeResources:$r,__rewriteRelativeImportExtension:ca}}}]);
}());